From d3210b61966f6ed8e4e14d628a982d7621c3e8c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 10 Jul 2026 00:26:35 +0000 Subject: [PATCH] chore: update to latest Copilot LSP --- copilot/js/main.js | 1854 +++++++++++++++++++++--------------------- lua/copilot/util.lua | 2 +- 2 files changed, 928 insertions(+), 928 deletions(-) diff --git a/copilot/js/main.js b/copilot/js/main.js index c8e6005b..f2a437d5 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,18 +1,18 @@ -"use strict";var eco=Object.create;var hCe=Object.defineProperty;var tco=Object.getOwnPropertyDescriptor;var rco=Object.getOwnPropertyNames;var nco=Object.getPrototypeOf,ico=Object.prototype.hasOwnProperty;var fQr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),pQr=t=>{throw TypeError(t)};var a=(t,e)=>hCe(t,"name",{value:e,configurable:!0});var ve=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ki=(t,e)=>{for(var r in e)hCe(t,r,{get:e[r],enumerable:!0})},hQr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rco(e))!ico.call(t,o)&&o!==r&&hCe(t,o,{get:()=>e[o],enumerable:!(n=tco(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?eco(nco(t)):{},hQr(e||!t||!t.__esModule?hCe(r,"default",{value:t,enumerable:!0}):r,t)),ba=t=>hQr(hCe({},"__esModule",{value:!0}),t);var Rkt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&pQr("Object expected");var n,o;r&&(n=e[fQr("asyncDispose")]),n===void 0&&(n=e[fQr("dispose")],r&&(o=n)),typeof n!="function"&&pQr("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},kkt=(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=ve(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var bQr,SQr=ve(()=>{p();bQr="ffffffff-ffff-ffff-ffff-ffffffffffff"});var TQr,IQr=ve(()=>{p();TQr="00000000-0000-0000-0000-000000000000"});var xQr,wQr=ve(()=>{p();xQr=/^(?:[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 gco(t){return typeof t=="string"&&xQr.test(t)}var nU,mCe=ve(()=>{p();wQr();a(gco,"validate");nU=gco});function Aco(t){if(!nU(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 XL,gCe=ve(()=>{p();mCe();a(Aco,"parse");XL=Aco});function h_(t,e=0){return(dA[t[e+0]]+dA[t[e+1]]+dA[t[e+2]]+dA[t[e+3]]+"-"+dA[t[e+4]]+dA[t[e+5]]+"-"+dA[t[e+6]]+dA[t[e+7]]+"-"+dA[t[e+8]]+dA[t[e+9]]+"-"+dA[t[e+10]]+dA[t[e+11]]+dA[t[e+12]]+dA[t[e+13]]+dA[t[e+14]]+dA[t[e+15]]).toLowerCase()}function yco(t,e=0){let r=h_(t,e);if(!nU(r))throw TypeError("Stringified UUID is invalid");return r}var dA,RQr,eB=ve(()=>{p();mCe();dA=[];for(let t=0;t<256;++t)dA.push((t+256).toString(16).slice(1));a(h_,"unsafeStringify");a(yco,"stringify");RQr=yco});function tB(){return crypto.getRandomValues(Eco)}var Eco,D6e=ve(()=>{p();Eco=new Uint8Array(16);a(tB,"rng")});function _co(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=kQr(t.random??t.rng?.()??tB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=tB();vco(ACe,s,c),n=kQr(c,ACe.msecs,ACe.nsecs,o?void 0:ACe.clockseq,o?void 0:ACe.node,e,r)}return e??h_(n)}function vco(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 ACe,N6e,Okt=ve(()=>{p();D6e();eB();ACe={};a(_co,"v1");a(vco,"updateV1State");a(kQr,"v1Bytes");N6e=_co});function yCe(t){let e=typeof t=="string"?XL(t):t,r=Cco(e);return typeof t=="string"?h_(r):r}function Cco(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 Lkt=ve(()=>{p();gCe();eB();a(yCe,"v1ToV6");a(Cco,"_v1ToV6")});function bco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,PQr.createHash)("md5").update(t).digest()}var PQr,DQr,NQr=ve(()=>{p();PQr=require("node:crypto");a(bco,"md5");DQr=bco});function Sco(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 h_(u)}var M6e,O6e,Bkt=ve(()=>{p();gCe();eB();a(Sco,"stringToBytes");M6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",O6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(ECe,"v35")});function Fkt(t,e,r,n){return ECe(48,DQr,t,e,r,n)}var MQr,OQr=ve(()=>{p();NQr();Bkt();a(Fkt,"v3");Fkt.DNS=M6e;Fkt.URL=O6e;MQr=Fkt});function Tco(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Ico(t,e,r)}function Ico(t,e,r){t=t||{};let n=t.random??t.rng?.()??tB();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 h_(n)}var Mt,LQr=ve(()=>{p();D6e();eB();a(Tco,"v4");a(Ico,"_v4");Mt=Tco});function xco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,BQr.createHash)("sha1").update(t).digest()}var BQr,FQr,UQr=ve(()=>{p();BQr=require("node:crypto");a(xco,"sha1");FQr=xco});function Ukt(t,e,r,n){return ECe(80,FQr,t,e,r,n)}var QQr,qQr=ve(()=>{p();UQr();Bkt();a(Ukt,"v5");Ukt.DNS=M6e;Ukt.URL=O6e;QQr=Ukt});function wco(t,e,r){t??={},r??=0;let n=N6e({...t,_v6:!0},new Uint8Array(16));if(n=yCe(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 h_(n)}var jQr,HQr=ve(()=>{p();eB();Okt();Lkt();a(wco,"v6");jQr=wco});function Qkt(t){let e=typeof t=="string"?XL(t):t,r=Rco(e);return typeof t=="string"?h_(r):r}function Rco(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 GQr=ve(()=>{p();gCe();eB();a(Qkt,"v6ToV1");a(Rco,"_v6ToV1")});function kco(t,e,r){let n;if(t)n=$Qr(t.random??t.rng?.()??tB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=tB();Pco(qkt,o,s),n=$Qr(s,qkt.msecs,qkt.seq,e,r)}return e??h_(n)}function Pco(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 $Qr(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 qkt,VQr,WQr=ve(()=>{p();D6e();eB();qkt={};a(kco,"v7");a(Pco,"updateV7State");a($Qr,"v7Bytes");VQr=kco});function Dco(t){if(!nU(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var zQr,YQr=ve(()=>{p();mCe();a(Dco,"version");zQr=Dco});var Cc={};ki(Cc,{MAX:()=>bQr,NIL:()=>TQr,parse:()=>XL,stringify:()=>RQr,v1:()=>N6e,v1ToV6:()=>yCe,v3:()=>MQr,v4:()=>Mt,v5:()=>QQr,v6:()=>jQr,v6ToV1:()=>Qkt,v7:()=>VQr,validate:()=>nU,version:()=>zQr});var Mo=ve(()=>{p();SQr();IQr();gCe();eB();Okt();Lkt();OQr();LQr();qQr();HQr();GQr();WQr();mCe();YQr()});var V0=I(jkt=>{"use strict";p();jkt.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})};jkt.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 JQr=I(($sl,KQr)=>{p();var iU=require("constants"),Nco=process.cwd,L6e=null,Mco=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return L6e||(L6e=Nco.call(process)),L6e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Hkt=process.chdir,process.chdir=function(t){L6e=null,Hkt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Hkt));var Hkt;KQr.exports=Oco;function Oco(t){iU.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(){}),Mco==="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,iU.O_WRONLY|iU.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,iU.O_WRONLY|iU.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){iU.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,iU.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,iU.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(Oco,"patch")});var eqr=I((zsl,XQr)=>{p();var ZQr=require("stream").Stream;XQr.exports=Lco;function Lco(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);ZQr.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);ZQr.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(Lco,"legacy")});var rqr=I((Jsl,tqr)=>{"use strict";p();tqr.exports=Fco;var Bco=Object.getPrototypeOf||function(t){return t.__proto__};function Fco(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Bco(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Fco,"clone")});var Eoe=I((eal,Vkt)=>{p();var sf=require("fs"),Uco=JQr(),Qco=eqr(),qco=rqr(),B6e=require("util"),fA,U6e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(fA=Symbol.for("graceful-fs.queue"),U6e=Symbol.for("graceful-fs.previous")):(fA="___graceful-fs.queue",U6e="___graceful-fs.previous");function jco(){}a(jco,"noop");function oqr(t,e){Object.defineProperty(t,fA,{get:a(function(){return e},"get")})}a(oqr,"publishQueue");var SW=jco;B6e.debuglog?SW=B6e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(SW=a(function(){var t=B6e.format.apply(B6e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));sf[fA]||(nqr=global[fA]||[],oqr(sf,nqr),sf.close=(function(t){function e(r,n){return t.call(sf,r,function(o){o||iqr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,U6e,{value:t}),e})(sf.close),sf.closeSync=(function(t){function e(r){t.apply(sf,arguments),iqr()}return a(e,"closeSync"),Object.defineProperty(e,U6e,{value:t}),e})(sf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){SW(sf[fA]),require("assert").equal(sf[fA].length,0)}));var nqr;global[fA]||oqr(global,sf[fA]);Vkt.exports=Gkt(qco(sf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!sf.__patched&&(Vkt.exports=Gkt(sf),sf.__patched=!0);function Gkt(t){Uco(t),t.gracefulify=Gkt,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,j){return e(q,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?yoe([B,[q,M,O],Q,j||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,j,Q,U){return n(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,j,Q,U){return s(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,j,Q,U){return l(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,j,Q,U){return d(O,q(O,j,Q,U))},"go$readdir"):a(function(O,j,Q,U){return d(O,j,q(O,j,Q,U))},"go$readdir");return B(D,N,L);function q(M,O,j,Q){return function(U,Y){U&&(U.code==="EMFILE"||U.code==="ENFILE")?yoe([B,[M,O,j],U,Q||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof j=="function"&&j.call(this,U,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Qco(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,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;P(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=P;function P(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return x(M,O,j,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$open")}return a(P,"open"),t}a(Gkt,"patch");function yoe(t){SW("ENQUEUE",t[0].name,t[1]),sf[fA].push(t),$kt()}a(yoe,"enqueue");var F6e;function iqr(){for(var t=Date.now(),e=0;e2&&(sf[fA][e][3]=t,sf[fA][e][4]=t);$kt()}a(iqr,"resetQueue");function $kt(){if(clearTimeout(F6e),F6e=void 0,sf[fA].length!==0){var t=sf[fA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)SW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){SW("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?(SW("RETRY",e.name,r),e.apply(null,r.concat([o]))):sf[fA].push(t)}F6e===void 0&&(F6e=setTimeout($kt,0))}}a($kt,"retry")});var g_=I(rB=>{"use strict";p();var sqr=V0().fromCallback,m_=Eoe(),Hco=["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 m_[t]=="function");Object.assign(rB,m_);Hco.forEach(t=>{rB[t]=sqr(m_[t])});rB.exists=function(t,e){return typeof e=="function"?m_.exists(t,e):new Promise(r=>m_.exists(t,r))};rB.read=function(t,e,r,n,o,s){return typeof s=="function"?m_.read(t,e,r,n,o,s):new Promise((c,l)=>{m_.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};rB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.write(t,e,...r):new Promise((n,o)=>{m_.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};rB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.readv(t,e,...r):new Promise((n,o)=>{m_.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};rB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.writev(t,e,...r):new Promise((n,o)=>{m_.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof m_.realpath.native=="function"?rB.realpath.native=sqr(m_.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var cqr=I((oal,aqr)=>{"use strict";p();var Gco=require("path");aqr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Gco.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var fqr=I((cal,Wkt)=>{"use strict";p();var lqr=g_(),{checkPath:uqr}=cqr(),dqr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Wkt.exports.makeDir=async(t,e)=>(uqr(t),lqr.mkdir(t,{mode:dqr(e),recursive:!0}));Wkt.exports.makeDirSync=(t,e)=>(uqr(t),lqr.mkdirSync(t,{mode:dqr(e),recursive:!0}))});var Rk=I((dal,pqr)=>{"use strict";p();var $co=V0().fromPromise,{makeDir:Vco,makeDirSync:zkt}=fqr(),Ykt=$co(Vco);pqr.exports={mkdirs:Ykt,mkdirsSync:zkt,mkdirp:Ykt,mkdirpSync:zkt,ensureDir:Ykt,ensureDirSync:zkt}});var oU=I((pal,mqr)=>{"use strict";p();var Wco=V0().fromPromise,hqr=g_();function zco(t){return hqr.access(t).then(()=>!0).catch(()=>!1)}a(zco,"pathExists");mqr.exports={pathExists:Wco(zco),pathExistsSync:hqr.existsSync}});var Kkt=I((gal,gqr)=>{"use strict";p();var _oe=g_(),Yco=V0().fromPromise;async function Kco(t,e,r){let n=await _oe.open(t,"r+"),o=null;try{await _oe.futimes(n,e,r)}finally{try{await _oe.close(n)}catch(s){o=s}}if(o)throw o}a(Kco,"utimesMillis");function Jco(t,e,r){let n=_oe.openSync(t,"r+");return _oe.futimesSync(n,e,r),_oe.closeSync(n)}a(Jco,"utimesMillisSync");gqr.exports={utimesMillis:Yco(Kco),utimesMillisSync:Jco}});var TW=I((Eal,_qr)=>{"use strict";p();var voe=g_(),W0=require("path"),Aqr=V0().fromPromise;function Zco(t,e,r){let n=r.dereference?o=>voe.stat(o,{bigint:!0}):o=>voe.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(Zco,"getStats");function Xco(t,e,r){let n,o=r.dereference?c=>voe.statSync(c,{bigint:!0}):c=>voe.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(Xco,"getStatsSync");async function elo(t,e,r,n){let{srcStat:o,destStat:s}=await Zco(t,e,n);if(s){if(_Ce(o,s)){let c=W0.basename(t),l=W0.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()&&Jkt(t,e))throw new Error(Q6e(t,e,r));return{srcStat:o,destStat:s}}a(elo,"checkPaths");function tlo(t,e,r,n){let{srcStat:o,destStat:s}=Xco(t,e,n);if(s){if(_Ce(o,s)){let c=W0.basename(t),l=W0.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()&&Jkt(t,e))throw new Error(Q6e(t,e,r));return{srcStat:o,destStat:s}}a(tlo,"checkPathsSync");async function yqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=await voe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(_Ce(e,c))throw new Error(Q6e(t,r,n));return yqr(t,e,s,n)}a(yqr,"checkParentPaths");function Eqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=voe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(_Ce(e,c))throw new Error(Q6e(t,r,n));return Eqr(t,e,s,n)}a(Eqr,"checkParentPathsSync");function _Ce(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(_Ce,"areIdentical");function Jkt(t,e){let r=W0.resolve(t).split(W0.sep).filter(o=>o),n=W0.resolve(e).split(W0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Jkt,"isSrcSubdir");function Q6e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(Q6e,"errMsg");_qr.exports={checkPaths:Aqr(elo),checkPathsSync:tlo,checkParentPaths:Aqr(yqr),checkParentPathsSync:Eqr,isSrcSubdir:Jkt,areIdentical:_Ce}});var Cqr=I((Cal,vqr)=>{"use strict";p();async function rlo(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(rlo,"asyncIteratorConcurrentProcess");vqr.exports={asyncIteratorConcurrentProcess:rlo}});var xqr=I((Tal,Iqr)=>{"use strict";p();var Oy=g_(),vCe=require("path"),{mkdirs:nlo}=Rk(),{pathExists:ilo}=oU(),{utimesMillis:olo}=Kkt(),CCe=TW(),{asyncIteratorConcurrentProcess:slo}=Cqr();async function alo(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 uco=Object.create;var ACe=Object.defineProperty;var dco=Object.getOwnPropertyDescriptor;var fco=Object.getOwnPropertyNames;var pco=Object.getPrototypeOf,hco=Object.prototype.hasOwnProperty;var AQr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),yQr=t=>{throw TypeError(t)};var a=(t,e)=>ACe(t,"name",{value:e,configurable:!0});var ve=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ki=(t,e)=>{for(var r in e)ACe(t,r,{get:e[r],enumerable:!0})},EQr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fco(e))!hco.call(t,o)&&o!==r&&ACe(t,o,{get:()=>e[o],enumerable:!(n=dco(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?uco(pco(t)):{},EQr(e||!t||!t.__esModule?ACe(r,"default",{value:t,enumerable:!0}):r,t)),Sa=t=>EQr(ACe({},"__esModule",{value:!0}),t);var Nkt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&yQr("Object expected");var n,o;r&&(n=e[AQr("asyncDispose")]),n===void 0&&(n=e[AQr("dispose")],r&&(o=n)),typeof n!="function"&&yQr("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},Mkt=(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=ve(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var wQr,RQr=ve(()=>{p();wQr="ffffffff-ffff-ffff-ffff-ffffffffffff"});var kQr,PQr=ve(()=>{p();kQr="00000000-0000-0000-0000-000000000000"});var DQr,NQr=ve(()=>{p();DQr=/^(?:[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 Ico(t){return typeof t=="string"&&DQr.test(t)}var oU,yCe=ve(()=>{p();NQr();a(Ico,"validate");oU=Ico});function xco(t){if(!oU(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,ECe=ve(()=>{p();yCe();a(xco,"parse");eB=xco});function m_(t,e=0){return(fA[t[e+0]]+fA[t[e+1]]+fA[t[e+2]]+fA[t[e+3]]+"-"+fA[t[e+4]]+fA[t[e+5]]+"-"+fA[t[e+6]]+fA[t[e+7]]+"-"+fA[t[e+8]]+fA[t[e+9]]+"-"+fA[t[e+10]]+fA[t[e+11]]+fA[t[e+12]]+fA[t[e+13]]+fA[t[e+14]]+fA[t[e+15]]).toLowerCase()}function wco(t,e=0){let r=m_(t,e);if(!oU(r))throw TypeError("Stringified UUID is invalid");return r}var fA,MQr,tB=ve(()=>{p();yCe();fA=[];for(let t=0;t<256;++t)fA.push((t+256).toString(16).slice(1));a(m_,"unsafeStringify");a(wco,"stringify");MQr=wco});function rB(){return crypto.getRandomValues(Rco)}var Rco,B6e=ve(()=>{p();Rco=new Uint8Array(16);a(rB,"rng")});function kco(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=OQr(t.random??t.rng?.()??rB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=rB();Pco(_Ce,s,c),n=OQr(c,_Ce.msecs,_Ce.nsecs,o?void 0:_Ce.clockseq,o?void 0:_Ce.node,e,r)}return e??m_(n)}function Pco(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 _Ce,F6e,Ukt=ve(()=>{p();B6e();tB();_Ce={};a(kco,"v1");a(Pco,"updateV1State");a(OQr,"v1Bytes");F6e=kco});function vCe(t){let e=typeof t=="string"?eB(t):t,r=Dco(e);return typeof t=="string"?m_(r):r}function Dco(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 Qkt=ve(()=>{p();ECe();tB();a(vCe,"v1ToV6");a(Dco,"_v1ToV6")});function Nco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,LQr.createHash)("md5").update(t).digest()}var LQr,BQr,FQr=ve(()=>{p();LQr=require("node:crypto");a(Nco,"md5");BQr=Nco});function Mco(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 m_(u)}var U6e,Q6e,qkt=ve(()=>{p();ECe();tB();a(Mco,"stringToBytes");U6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Q6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(CCe,"v35")});function jkt(t,e,r,n){return CCe(48,BQr,t,e,r,n)}var UQr,QQr=ve(()=>{p();FQr();qkt();a(jkt,"v3");jkt.DNS=U6e;jkt.URL=Q6e;UQr=jkt});function Oco(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Lco(t,e,r)}function Lco(t,e,r){t=t||{};let n=t.random??t.rng?.()??rB();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 m_(n)}var Mt,qQr=ve(()=>{p();B6e();tB();a(Oco,"v4");a(Lco,"_v4");Mt=Oco});function Bco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,jQr.createHash)("sha1").update(t).digest()}var jQr,HQr,GQr=ve(()=>{p();jQr=require("node:crypto");a(Bco,"sha1");HQr=Bco});function Hkt(t,e,r,n){return CCe(80,HQr,t,e,r,n)}var $Qr,VQr=ve(()=>{p();GQr();qkt();a(Hkt,"v5");Hkt.DNS=U6e;Hkt.URL=Q6e;$Qr=Hkt});function Fco(t,e,r){t??={},r??=0;let n=F6e({...t,_v6:!0},new Uint8Array(16));if(n=vCe(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 m_(n)}var WQr,zQr=ve(()=>{p();tB();Ukt();Qkt();a(Fco,"v6");WQr=Fco});function Gkt(t){let e=typeof t=="string"?eB(t):t,r=Uco(e);return typeof t=="string"?m_(r):r}function Uco(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 YQr=ve(()=>{p();ECe();tB();a(Gkt,"v6ToV1");a(Uco,"_v6ToV1")});function Qco(t,e,r){let n;if(t)n=KQr(t.random??t.rng?.()??rB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=rB();qco($kt,o,s),n=KQr(s,$kt.msecs,$kt.seq,e,r)}return e??m_(n)}function qco(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 KQr(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 $kt,JQr,ZQr=ve(()=>{p();B6e();tB();$kt={};a(Qco,"v7");a(qco,"updateV7State");a(KQr,"v7Bytes");JQr=Qco});function jco(t){if(!oU(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var XQr,eqr=ve(()=>{p();yCe();a(jco,"version");XQr=jco});var Cc={};ki(Cc,{MAX:()=>wQr,NIL:()=>kQr,parse:()=>eB,stringify:()=>MQr,v1:()=>F6e,v1ToV6:()=>vCe,v3:()=>UQr,v4:()=>Mt,v5:()=>$Qr,v6:()=>WQr,v6ToV1:()=>Gkt,v7:()=>JQr,validate:()=>oU,version:()=>XQr});var Oo=ve(()=>{p();RQr();PQr();ECe();tB();Ukt();Qkt();QQr();qQr();VQr();zQr();YQr();ZQr();yCe();eqr()});var W0=I(Vkt=>{"use strict";p();Vkt.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})};Vkt.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 rqr=I((lal,tqr)=>{p();var sU=require("constants"),Hco=process.cwd,q6e=null,Gco=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return q6e||(q6e=Hco.call(process)),q6e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Wkt=process.chdir,process.chdir=function(t){q6e=null,Wkt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Wkt));var Wkt;tqr.exports=$co;function $co(t){sU.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(){}),Gco==="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,sU.O_WRONLY|sU.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,sU.O_WRONLY|sU.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){sU.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,sU.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,sU.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($co,"patch")});var oqr=I((fal,iqr)=>{p();var nqr=require("stream").Stream;iqr.exports=Vco;function Vco(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);nqr.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);nqr.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(Vco,"legacy")});var aqr=I((mal,sqr)=>{"use strict";p();sqr.exports=zco;var Wco=Object.getPrototypeOf||function(t){return t.__proto__};function zco(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Wco(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(zco,"clone")});var _oe=I((yal,Kkt)=>{p();var cf=require("fs"),Yco=rqr(),Kco=oqr(),Jco=aqr(),j6e=require("util"),pA,G6e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pA=Symbol.for("graceful-fs.queue"),G6e=Symbol.for("graceful-fs.previous")):(pA="___graceful-fs.queue",G6e="___graceful-fs.previous");function Zco(){}a(Zco,"noop");function uqr(t,e){Object.defineProperty(t,pA,{get:a(function(){return e},"get")})}a(uqr,"publishQueue");var wW=Zco;j6e.debuglog?wW=j6e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(wW=a(function(){var t=j6e.format.apply(j6e,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)},"debug"));cf[pA]||(cqr=global[pA]||[],uqr(cf,cqr),cf.close=(function(t){function e(r,n){return t.call(cf,r,function(o){o||lqr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,G6e,{value:t}),e})(cf.close),cf.closeSync=(function(t){function e(r){t.apply(cf,arguments),lqr()}return a(e,"closeSync"),Object.defineProperty(e,G6e,{value:t}),e})(cf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){wW(cf[pA]),require("assert").equal(cf[pA].length,0)}));var cqr;global[pA]||uqr(global,cf[pA]);Kkt.exports=zkt(Jco(cf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!cf.__patched&&(Kkt.exports=zkt(cf),cf.__patched=!0);function zkt(t){Yco(t),t.gracefulify=zkt,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,j){return e(q,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Eoe([B,[q,M,O],Q,j||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,j,Q,U){return n(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Eoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,j,Q,U){return s(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Eoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,j,Q,U){return l(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Eoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.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,j,Q,U){return d(O,q(O,j,Q,U))},"go$readdir"):a(function(O,j,Q,U){return d(O,j,q(O,j,Q,U))},"go$readdir");return B(D,N,L);function q(M,O,j,Q){return function(U,Y){U&&(U.code==="EMFILE"||U.code==="ENFILE")?Eoe([B,[M,O,j],U,Q||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof j=="function"&&j.call(this,U,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Kco(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,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;P(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=P;function P(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return x(M,O,j,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Eoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$open")}return a(P,"open"),t}a(zkt,"patch");function Eoe(t){wW("ENQUEUE",t[0].name,t[1]),cf[pA].push(t),Ykt()}a(Eoe,"enqueue");var H6e;function lqr(){for(var t=Date.now(),e=0;e2&&(cf[pA][e][3]=t,cf[pA][e][4]=t);Ykt()}a(lqr,"resetQueue");function Ykt(){if(clearTimeout(H6e),H6e=void 0,cf[pA].length!==0){var t=cf[pA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)wW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){wW("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?(wW("RETRY",e.name,r),e.apply(null,r.concat([o]))):cf[pA].push(t)}H6e===void 0&&(H6e=setTimeout(Ykt,0))}}a(Ykt,"retry")});var A_=I(nB=>{"use strict";p();var dqr=W0().fromCallback,g_=_oe(),Xco=["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 g_[t]=="function");Object.assign(nB,g_);Xco.forEach(t=>{nB[t]=dqr(g_[t])});nB.exists=function(t,e){return typeof e=="function"?g_.exists(t,e):new Promise(r=>g_.exists(t,r))};nB.read=function(t,e,r,n,o,s){return typeof s=="function"?g_.read(t,e,r,n,o,s):new Promise((c,l)=>{g_.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};nB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?g_.write(t,e,...r):new Promise((n,o)=>{g_.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};nB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?g_.readv(t,e,...r):new Promise((n,o)=>{g_.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};nB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?g_.writev(t,e,...r):new Promise((n,o)=>{g_.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof g_.realpath.native=="function"?nB.realpath.native=dqr(g_.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var pqr=I((bal,fqr)=>{"use strict";p();var elo=require("path");fqr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(elo.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var Aqr=I((Ial,Jkt)=>{"use strict";p();var hqr=A_(),{checkPath:mqr}=pqr(),gqr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Jkt.exports.makeDir=async(t,e)=>(mqr(t),hqr.mkdir(t,{mode:gqr(e),recursive:!0}));Jkt.exports.makeDirSync=(t,e)=>(mqr(t),hqr.mkdirSync(t,{mode:gqr(e),recursive:!0}))});var Pk=I((Ral,yqr)=>{"use strict";p();var tlo=W0().fromPromise,{makeDir:rlo,makeDirSync:Zkt}=Aqr(),Xkt=tlo(rlo);yqr.exports={mkdirs:Xkt,mkdirsSync:Zkt,mkdirp:Xkt,mkdirpSync:Zkt,ensureDir:Xkt,ensureDirSync:Zkt}});var aU=I((Pal,_qr)=>{"use strict";p();var nlo=W0().fromPromise,Eqr=A_();function ilo(t){return Eqr.access(t).then(()=>!0).catch(()=>!1)}a(ilo,"pathExists");_qr.exports={pathExists:nlo(ilo),pathExistsSync:Eqr.existsSync}});var ePt=I((Mal,vqr)=>{"use strict";p();var voe=A_(),olo=W0().fromPromise;async function slo(t,e,r){let n=await voe.open(t,"r+"),o=null;try{await voe.futimes(n,e,r)}finally{try{await voe.close(n)}catch(s){o=s}}if(o)throw o}a(slo,"utimesMillis");function alo(t,e,r){let n=voe.openSync(t,"r+");return voe.futimesSync(n,e,r),voe.closeSync(n)}a(alo,"utimesMillisSync");vqr.exports={utimesMillis:olo(slo),utimesMillisSync:alo}});var RW=I((Bal,Tqr)=>{"use strict";p();var Coe=A_(),z0=require("path"),Cqr=W0().fromPromise;function clo(t,e,r){let n=r.dereference?o=>Coe.stat(o,{bigint:!0}):o=>Coe.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(clo,"getStats");function llo(t,e,r){let n,o=r.dereference?c=>Coe.statSync(c,{bigint:!0}):c=>Coe.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(llo,"getStatsSync");async function ulo(t,e,r,n){let{srcStat:o,destStat:s}=await clo(t,e,n);if(s){if(bCe(o,s)){let c=z0.basename(t),l=z0.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()&&tPt(t,e))throw new Error($6e(t,e,r));return{srcStat:o,destStat:s}}a(ulo,"checkPaths");function dlo(t,e,r,n){let{srcStat:o,destStat:s}=llo(t,e,n);if(s){if(bCe(o,s)){let c=z0.basename(t),l=z0.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()&&tPt(t,e))throw new Error($6e(t,e,r));return{srcStat:o,destStat:s}}a(dlo,"checkPathsSync");async function bqr(t,e,r,n){let o=z0.resolve(z0.dirname(t)),s=z0.resolve(z0.dirname(r));if(s===o||s===z0.parse(s).root)return;let c;try{c=await Coe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(bCe(e,c))throw new Error($6e(t,r,n));return bqr(t,e,s,n)}a(bqr,"checkParentPaths");function Sqr(t,e,r,n){let o=z0.resolve(z0.dirname(t)),s=z0.resolve(z0.dirname(r));if(s===o||s===z0.parse(s).root)return;let c;try{c=Coe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(bCe(e,c))throw new Error($6e(t,r,n));return Sqr(t,e,s,n)}a(Sqr,"checkParentPathsSync");function bCe(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(bCe,"areIdentical");function tPt(t,e){let r=z0.resolve(t).split(z0.sep).filter(o=>o),n=z0.resolve(e).split(z0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(tPt,"isSrcSubdir");function $6e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a($6e,"errMsg");Tqr.exports={checkPaths:Cqr(ulo),checkPathsSync:dlo,checkParentPaths:Cqr(bqr),checkParentPathsSync:Sqr,isSrcSubdir:tPt,areIdentical:bCe}});var xqr=I((Qal,Iqr)=>{"use strict";p();async function flo(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(flo,"asyncIteratorConcurrentProcess");Iqr.exports={asyncIteratorConcurrentProcess:flo}});var Dqr=I((Hal,Pqr)=>{"use strict";p();var Ly=A_(),SCe=require("path"),{mkdirs:plo}=Pk(),{pathExists:hlo}=aU(),{utimesMillis:mlo}=ePt(),TCe=RW(),{asyncIteratorConcurrentProcess:glo}=xqr();async function Alo(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 CCe.checkPaths(t,e,"copy",r);if(await CCe.checkParentPaths(t,n,e,"copy"),!await Sqr(t,e,r))return;let c=vCe.dirname(e);await ilo(c)||await nlo(c),await Tqr(o,t,e,r)}a(alo,"copy");async function Sqr(t,e,r){return r.filter?r.filter(t,e):!0}a(Sqr,"runFilter");async function Tqr(t,e,r,n){let s=await(n.dereference?Oy.stat:Oy.lstat)(e);if(s.isDirectory())return dlo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return clo(s,t,e,r,n);if(s.isSymbolicLink())return flo(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(Tqr,"getStatsAndPerformCopy");async function clo(t,e,r,n,o){if(!e)return bqr(t,r,n,o);if(o.overwrite)return await Oy.unlink(n),bqr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(clo,"onFile");async function bqr(t,e,r,n){if(await Oy.copyFile(e,r),n.preserveTimestamps){llo(t.mode)&&await ulo(r,t.mode);let o=await Oy.stat(e);await olo(r,o.atime,o.mtime)}return Oy.chmod(r,t.mode)}a(bqr,"copyFile");function llo(t){return(t&128)===0}a(llo,"fileIsNotWritable");function ulo(t,e){return Oy.chmod(t,e|128)}a(ulo,"makeFileWritable");async function dlo(t,e,r,n,o){e||await Oy.mkdir(n),await slo(await Oy.opendir(r),async s=>{let c=vCe.join(r,s.name),l=vCe.join(n,s.name);if(await Sqr(c,l,o)){let{destStat:d}=await CCe.checkPaths(c,l,"copy",o);await Tqr(d,c,l,o)}}),e||await Oy.chmod(n,t.mode)}a(dlo,"onDir");async function flo(t,e,r,n){let o=await Oy.readlink(e);if(n.dereference&&(o=vCe.resolve(process.cwd(),o)),!t)return Oy.symlink(o,r);let s=null;try{s=await Oy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Oy.symlink(o,r);throw c}if(n.dereference&&(s=vCe.resolve(process.cwd(),s)),o!==s){if(CCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(CCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Oy.unlink(r),Oy.symlink(o,r)}a(flo,"onLink");Iqr.exports=alo});var Dqr=I((wal,Pqr)=>{"use strict";p();var A_=Eoe(),bCe=require("path"),plo=Rk().mkdirsSync,hlo=Kkt().utimesMillisSync,SCe=TW();function mlo(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 TCe.checkPaths(t,e,"copy",r);if(await TCe.checkParentPaths(t,n,e,"copy"),!await Rqr(t,e,r))return;let c=SCe.dirname(e);await hlo(c)||await plo(c),await kqr(o,t,e,r)}a(Alo,"copy");async function Rqr(t,e,r){return r.filter?r.filter(t,e):!0}a(Rqr,"runFilter");async function kqr(t,e,r,n){let s=await(n.dereference?Ly.stat:Ly.lstat)(e);if(s.isDirectory())return vlo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return ylo(s,t,e,r,n);if(s.isSymbolicLink())return Clo(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(kqr,"getStatsAndPerformCopy");async function ylo(t,e,r,n,o){if(!e)return wqr(t,r,n,o);if(o.overwrite)return await Ly.unlink(n),wqr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(ylo,"onFile");async function wqr(t,e,r,n){if(await Ly.copyFile(e,r),n.preserveTimestamps){Elo(t.mode)&&await _lo(r,t.mode);let o=await Ly.stat(e);await mlo(r,o.atime,o.mtime)}return Ly.chmod(r,t.mode)}a(wqr,"copyFile");function Elo(t){return(t&128)===0}a(Elo,"fileIsNotWritable");function _lo(t,e){return Ly.chmod(t,e|128)}a(_lo,"makeFileWritable");async function vlo(t,e,r,n,o){e||await Ly.mkdir(n),await glo(await Ly.opendir(r),async s=>{let c=SCe.join(r,s.name),l=SCe.join(n,s.name);if(await Rqr(c,l,o)){let{destStat:d}=await TCe.checkPaths(c,l,"copy",o);await kqr(d,c,l,o)}}),e||await Ly.chmod(n,t.mode)}a(vlo,"onDir");async function Clo(t,e,r,n){let o=await Ly.readlink(e);if(n.dereference&&(o=SCe.resolve(process.cwd(),o)),!t)return Ly.symlink(o,r);let s=null;try{s=await Ly.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Ly.symlink(o,r);throw c}if(n.dereference&&(s=SCe.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 Ly.unlink(r),Ly.symlink(o,r)}a(Clo,"onLink");Pqr.exports=Alo});var Bqr=I((Val,Lqr)=>{"use strict";p();var y_=_oe(),ICe=require("path"),blo=Pk().mkdirsSync,Slo=ePt().utimesMillisSync,xCe=RW();function Tlo(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}=SCe.checkPathsSync(t,e,"copy",r);if(SCe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=bCe.dirname(e);return A_.existsSync(s)||plo(s),wqr(o,t,e,r)}a(mlo,"copySync");function wqr(t,e,r,n){let s=(n.dereference?A_.statSync:A_.lstatSync)(e);if(s.isDirectory())return Clo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return glo(s,t,e,r,n);if(s.isSymbolicLink())return Tlo(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(wqr,"getStats");function glo(t,e,r,n,o){return e?Alo(t,r,n,o):Rqr(t,r,n,o)}a(glo,"onFile");function Alo(t,e,r,n){if(n.overwrite)return A_.unlinkSync(r),Rqr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(Alo,"mayCopyFile");function Rqr(t,e,r,n){return A_.copyFileSync(e,r),n.preserveTimestamps&&ylo(t.mode,e,r),Zkt(r,t.mode)}a(Rqr,"copyFile");function ylo(t,e,r){return Elo(t)&&_lo(r,t),vlo(e,r)}a(ylo,"handleTimestamps");function Elo(t){return(t&128)===0}a(Elo,"fileIsNotWritable");function _lo(t,e){return Zkt(t,e|128)}a(_lo,"makeFileWritable");function Zkt(t,e){return A_.chmodSync(t,e)}a(Zkt,"setDestMode");function vlo(t,e){let r=A_.statSync(t);return hlo(e,r.atime,r.mtime)}a(vlo,"setDestTimestamps");function Clo(t,e,r,n,o){return e?kqr(r,n,o):blo(t.mode,r,n,o)}a(Clo,"onDir");function blo(t,e,r,n){return A_.mkdirSync(r),kqr(e,r,n),Zkt(r,t)}a(blo,"mkDirAndCopy");function kqr(t,e,r){let n=A_.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)Slo(o.name,t,e,r)}finally{n.closeSync()}}a(kqr,"copyDir");function Slo(t,e,r,n){let o=bCe.join(e,t),s=bCe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=SCe.checkPathsSync(o,s,"copy",n);return wqr(c,o,s,n)}a(Slo,"copyDirItem");function Tlo(t,e,r,n){let o=A_.readlinkSync(e);if(n.dereference&&(o=bCe.resolve(process.cwd(),o)),t){let s;try{s=A_.readlinkSync(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return A_.symlinkSync(o,r);throw c}if(n.dereference&&(s=bCe.resolve(process.cwd(),s)),o!==s){if(SCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(SCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return Ilo(o,r)}else return A_.symlinkSync(o,r)}a(Tlo,"onLink");function Ilo(t,e){return A_.unlinkSync(e),A_.symlinkSync(t,e)}a(Ilo,"copyLink");Pqr.exports=mlo});var q6e=I((Pal,Nqr)=>{"use strict";p();var xlo=V0().fromPromise;Nqr.exports={copy:xlo(xqr()),copySync:Dqr()}});var TCe=I((Nal,Oqr)=>{"use strict";p();var Mqr=Eoe(),wlo=V0().fromCallback;function Rlo(t,e){Mqr.rm(t,{recursive:!0,force:!0},e)}a(Rlo,"remove");function klo(t){Mqr.rmSync(t,{recursive:!0,force:!0})}a(klo,"removeSync");Oqr.exports={remove:wlo(Rlo),removeSync:klo}});var Hqr=I((Lal,jqr)=>{"use strict";p();var Plo=V0().fromPromise,Fqr=g_(),Uqr=require("path"),Qqr=Rk(),qqr=TCe(),Lqr=Plo(a(async function(e){let r;try{r=await Fqr.readdir(e)}catch{return Qqr.mkdirs(e)}return Promise.all(r.map(n=>qqr.remove(Uqr.join(e,n))))},"emptyDir"));function Bqr(t){let e;try{e=Fqr.readdirSync(t)}catch{return Qqr.mkdirsSync(t)}e.forEach(r=>{r=Uqr.join(t,r),qqr.removeSync(r)})}a(Bqr,"emptyDirSync");jqr.exports={emptyDirSync:Bqr,emptydirSync:Bqr,emptyDir:Lqr,emptydir:Lqr}});var Wqr=I((Ual,Vqr)=>{"use strict";p();var Dlo=V0().fromPromise,Gqr=require("path"),nB=g_(),$qr=Rk();async function Nlo(t){let e;try{e=await nB.stat(t)}catch{}if(e&&e.isFile())return;let r=Gqr.dirname(t),n=null;try{n=await nB.stat(r)}catch(o){if(o.code==="ENOENT"){await $qr.mkdirs(r),await nB.writeFile(t,"");return}else throw o}n.isDirectory()?await nB.writeFile(t,""):await nB.readdir(r)}a(Nlo,"createFile");function Mlo(t){let e;try{e=nB.statSync(t)}catch{}if(e&&e.isFile())return;let r=Gqr.dirname(t);try{nB.statSync(r).isDirectory()||nB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")$qr.mkdirsSync(r);else throw n}nB.writeFileSync(t,"")}a(Mlo,"createFileSync");Vqr.exports={createFile:Dlo(Nlo),createFileSync:Mlo}});var Zqr=I((jal,Jqr)=>{"use strict";p();var Olo=V0().fromPromise,zqr=require("path"),sU=g_(),Yqr=Rk(),{pathExists:Llo}=oU(),{areIdentical:Kqr}=TW();async function Blo(t,e){let r;try{r=await sU.lstat(e)}catch{}let n;try{n=await sU.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&Kqr(n,r))return;let o=zqr.dirname(e);await Llo(o)||await Yqr.mkdirs(o),await sU.link(t,e)}a(Blo,"createLink");function Flo(t,e){let r;try{r=sU.lstatSync(e)}catch{}try{let s=sU.lstatSync(t);if(r&&Kqr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=zqr.dirname(e);return sU.existsSync(n)||Yqr.mkdirsSync(n),sU.linkSync(t,e)}a(Flo,"createLinkSync");Jqr.exports={createLink:Olo(Blo),createLinkSync:Flo}});var ejr=I(($al,Xqr)=>{"use strict";p();var aU=require("path"),ICe=g_(),{pathExists:Ulo}=oU(),Qlo=V0().fromPromise;async function qlo(t,e){if(aU.isAbsolute(t)){try{await ICe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=aU.dirname(e),n=aU.join(r,t);if(await Ulo(n))return{toCwd:n,toDst:t};try{await ICe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:aU.relative(r,t)}}a(qlo,"symlinkPaths");function jlo(t,e){if(aU.isAbsolute(t)){if(!ICe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=aU.dirname(e),n=aU.join(r,t);if(ICe.existsSync(n))return{toCwd:n,toDst:t};if(!ICe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:aU.relative(r,t)}}a(jlo,"symlinkPathsSync");Xqr.exports={symlinkPaths:Qlo(qlo),symlinkPathsSync:jlo}});var njr=I((zal,rjr)=>{"use strict";p();var tjr=g_(),Hlo=V0().fromPromise;async function Glo(t,e){if(e)return e;let r;try{r=await tjr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Glo,"symlinkType");function $lo(t,e){if(e)return e;let r;try{r=tjr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a($lo,"symlinkTypeSync");rjr.exports={symlinkType:Hlo(Glo),symlinkTypeSync:$lo}});var sjr=I((Jal,ojr)=>{"use strict";p();var Vlo=V0().fromPromise,cU=require("path"),rC=g_(),{mkdirs:Wlo,mkdirsSync:zlo}=Rk(),{symlinkPaths:Ylo,symlinkPathsSync:Klo}=ejr(),{symlinkType:Jlo,symlinkTypeSync:Zlo}=njr(),{pathExists:Xlo}=oU(),{areIdentical:ijr}=TW();async function euo(t,e,r){let n;try{n=await rC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(cU.isAbsolute(t))l=await rC.stat(t);else{let d=cU.dirname(e),f=cU.join(d,t);try{l=await rC.stat(f)}catch{l=await rC.stat(t)}}let u=await rC.stat(e);if(ijr(l,u))return}let o=await Ylo(t,e);t=o.toDst;let s=await Jlo(o.toCwd,r),c=cU.dirname(e);return await Xlo(c)||await Wlo(c),rC.symlink(t,e,s)}a(euo,"createSymlink");function tuo(t,e,r){let n;try{n=rC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(cU.isAbsolute(t))l=rC.statSync(t);else{let d=cU.dirname(e),f=cU.join(d,t);try{l=rC.statSync(f)}catch{l=rC.statSync(t)}}let u=rC.statSync(e);if(ijr(l,u))return}let o=Klo(t,e);t=o.toDst,r=Zlo(o.toCwd,r);let s=cU.dirname(e);return rC.existsSync(s)||zlo(s),rC.symlinkSync(t,e,r)}a(tuo,"createSymlinkSync");ojr.exports={createSymlink:Vlo(euo),createSymlinkSync:tuo}});var hjr=I((ecl,pjr)=>{"use strict";p();var{createFile:ajr,createFileSync:cjr}=Wqr(),{createLink:ljr,createLinkSync:ujr}=Zqr(),{createSymlink:djr,createSymlinkSync:fjr}=sjr();pjr.exports={createFile:ajr,createFileSync:cjr,ensureFile:ajr,ensureFileSync:cjr,createLink:ljr,createLinkSync:ujr,ensureLink:ljr,ensureLinkSync:ujr,createSymlink:djr,createSymlinkSync:fjr,ensureSymlink:djr,ensureSymlinkSync:fjr}});var j6e=I((rcl,mjr)=>{p();function ruo(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(ruo,"stringify");function nuo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(nuo,"stripBom");mjr.exports={stringify:ruo,stripBom:nuo}});var Ejr=I((ocl,yjr)=>{p();var Coe;try{Coe=Eoe()}catch{Coe=require("fs")}var H6e=V0(),{stringify:gjr,stripBom:Ajr}=j6e();async function iuo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0,o=await H6e.fromCallback(r.readFile)(t,e);o=Ajr(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(iuo,"_readFile");var ouo=H6e.fromPromise(iuo);function suo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=Ajr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(suo,"readFileSync");async function auo(t,e,r={}){let n=r.fs||Coe,o=gjr(e,r);await H6e.fromCallback(n.writeFile)(t,o,r)}a(auo,"_writeFile");var cuo=H6e.fromPromise(auo);function luo(t,e,r={}){let n=r.fs||Coe,o=gjr(e,r);return n.writeFileSync(t,o,r)}a(luo,"writeFileSync");yjr.exports={readFile:ouo,readFileSync:suo,writeFile:cuo,writeFileSync:luo}});var vjr=I((ccl,_jr)=>{"use strict";p();var G6e=Ejr();_jr.exports={readJson:G6e.readFile,readJsonSync:G6e.readFileSync,writeJson:G6e.writeFile,writeJsonSync:G6e.writeFileSync}});var $6e=I((ucl,Sjr)=>{"use strict";p();var uuo=V0().fromPromise,Xkt=g_(),Cjr=require("path"),bjr=Rk(),duo=oU().pathExists;async function fuo(t,e,r="utf-8"){let n=Cjr.dirname(t);return await duo(n)||await bjr.mkdirs(n),Xkt.writeFile(t,e,r)}a(fuo,"outputFile");function puo(t,...e){let r=Cjr.dirname(t);Xkt.existsSync(r)||bjr.mkdirsSync(r),Xkt.writeFileSync(t,...e)}a(puo,"outputFileSync");Sjr.exports={outputFile:uuo(fuo),outputFileSync:puo}});var Ijr=I((pcl,Tjr)=>{"use strict";p();var{stringify:huo}=j6e(),{outputFile:muo}=$6e();async function guo(t,e,r={}){let n=huo(e,r);await muo(t,n,r)}a(guo,"outputJson");Tjr.exports=guo});var wjr=I((gcl,xjr)=>{"use strict";p();var{stringify:Auo}=j6e(),{outputFileSync:yuo}=$6e();function Euo(t,e,r){let n=Auo(e,r);yuo(t,n,r)}a(Euo,"outputJsonSync");xjr.exports=Euo});var kjr=I((Ecl,Rjr)=>{"use strict";p();var _uo=V0().fromPromise,y_=vjr();y_.outputJson=_uo(Ijr());y_.outputJsonSync=wjr();y_.outputJSON=y_.outputJson;y_.outputJSONSync=y_.outputJsonSync;y_.writeJSON=y_.writeJson;y_.writeJSONSync=y_.writeJsonSync;y_.readJSON=y_.readJson;y_.readJSONSync=y_.readJsonSync;Rjr.exports=y_});var Ojr=I((vcl,Mjr)=>{"use strict";p();var vuo=g_(),Pjr=require("path"),{copy:Cuo}=q6e(),{remove:Njr}=TCe(),{mkdirp:buo}=Rk(),{pathExists:Suo}=oU(),Djr=TW();async function Tuo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await Djr.checkPaths(t,e,"move",r);await Djr.checkParentPaths(t,o,e,"move");let c=Pjr.dirname(e);return Pjr.parse(c).root!==c&&await buo(c),Iuo(t,e,n,s)}a(Tuo,"move");async function Iuo(t,e,r,n){if(!n){if(r)await Njr(e);else if(await Suo(e))throw new Error("dest already exists.")}try{await vuo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await xuo(t,e,r)}}a(Iuo,"doRename");async function xuo(t,e,r){return await Cuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Njr(t)}a(xuo,"moveAcrossDevice");Mjr.exports=Tuo});var Qjr=I((Scl,Ujr)=>{"use strict";p();var Bjr=Eoe(),tPt=require("path"),wuo=q6e().copySync,Fjr=TCe().removeSync,Ruo=Rk().mkdirpSync,Ljr=TW();function kuo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=Ljr.checkPathsSync(t,e,"move",r);return Ljr.checkParentPathsSync(t,o,e,"move"),Puo(e)||Ruo(tPt.dirname(e)),Duo(t,e,n,s)}a(kuo,"moveSync");function Puo(t){let e=tPt.dirname(t);return tPt.parse(e).root===e}a(Puo,"isParentRoot");function Duo(t,e,r,n){if(n)return ePt(t,e,r);if(r)return Fjr(e),ePt(t,e,r);if(Bjr.existsSync(e))throw new Error("dest already exists.");return ePt(t,e,r)}a(Duo,"doRename");function ePt(t,e,r){try{Bjr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Nuo(t,e,r)}}a(ePt,"rename");function Nuo(t,e,r){return wuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Fjr(t)}a(Nuo,"moveAcrossDevice");Ujr.exports=kuo});var jjr=I((xcl,qjr)=>{"use strict";p();var Muo=V0().fromPromise;qjr.exports={move:Muo(Ojr()),moveSync:Qjr()}});var Gjr=I((Rcl,Hjr)=>{"use strict";p();Hjr.exports={...g_(),...q6e(),...Hqr(),...hjr(),...kjr(),...Rk(),...jjr(),...$6e(),...oU(),...TCe()}});var W6e=I((Pcl,Wjr)=>{p();var rPt=require("fs"),V6e=require("path"),xCe=V6e.join,Ouo=V6e.dirname,$jr=rPt.accessSync&&function(t){try{rPt.accessSync(t)}catch{return!1}return!0}||rPt.existsSync||V6e.existsSync,Vjr={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 Luo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(Vjr).map(function(u){u in t||(t[u]=Vjr[u])}),t.module_root||(t.module_root=Buo(__filename)),V6e.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 Blo=W0().fromPromise;Fqr.exports={copy:Blo(Dqr()),copySync:Bqr()}});var wCe=I((Jal,Qqr)=>{"use strict";p();var Uqr=_oe(),Flo=W0().fromCallback;function Ulo(t,e){Uqr.rm(t,{recursive:!0,force:!0},e)}a(Ulo,"remove");function Qlo(t){Uqr.rmSync(t,{recursive:!0,force:!0})}a(Qlo,"removeSync");Qqr.exports={remove:Flo(Ulo),removeSync:Qlo}});var zqr=I((ecl,Wqr)=>{"use strict";p();var qlo=W0().fromPromise,Hqr=A_(),Gqr=require("path"),$qr=Pk(),Vqr=wCe(),qqr=qlo(a(async function(e){let r;try{r=await Hqr.readdir(e)}catch{return $qr.mkdirs(e)}return Promise.all(r.map(n=>Vqr.remove(Gqr.join(e,n))))},"emptyDir"));function jqr(t){let e;try{e=Hqr.readdirSync(t)}catch{return $qr.mkdirsSync(t)}e.forEach(r=>{r=Gqr.join(t,r),Vqr.removeSync(r)})}a(jqr,"emptyDirSync");Wqr.exports={emptyDirSync:jqr,emptydirSync:jqr,emptyDir:qqr,emptydir:qqr}});var Zqr=I((ncl,Jqr)=>{"use strict";p();var jlo=W0().fromPromise,Yqr=require("path"),iB=A_(),Kqr=Pk();async function Hlo(t){let e;try{e=await iB.stat(t)}catch{}if(e&&e.isFile())return;let r=Yqr.dirname(t),n=null;try{n=await iB.stat(r)}catch(o){if(o.code==="ENOENT"){await Kqr.mkdirs(r),await iB.writeFile(t,"");return}else throw o}n.isDirectory()?await iB.writeFile(t,""):await iB.readdir(r)}a(Hlo,"createFile");function Glo(t){let e;try{e=iB.statSync(t)}catch{}if(e&&e.isFile())return;let r=Yqr.dirname(t);try{iB.statSync(r).isDirectory()||iB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Kqr.mkdirsSync(r);else throw n}iB.writeFileSync(t,"")}a(Glo,"createFileSync");Jqr.exports={createFile:jlo(Hlo),createFileSync:Glo}});var njr=I((scl,rjr)=>{"use strict";p();var $lo=W0().fromPromise,Xqr=require("path"),cU=A_(),ejr=Pk(),{pathExists:Vlo}=aU(),{areIdentical:tjr}=RW();async function Wlo(t,e){let r;try{r=await cU.lstat(e)}catch{}let n;try{n=await cU.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&tjr(n,r))return;let o=Xqr.dirname(e);await Vlo(o)||await ejr.mkdirs(o),await cU.link(t,e)}a(Wlo,"createLink");function zlo(t,e){let r;try{r=cU.lstatSync(e)}catch{}try{let s=cU.lstatSync(t);if(r&&tjr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=Xqr.dirname(e);return cU.existsSync(n)||ejr.mkdirsSync(n),cU.linkSync(t,e)}a(zlo,"createLinkSync");rjr.exports={createLink:$lo(Wlo),createLinkSync:zlo}});var ojr=I((lcl,ijr)=>{"use strict";p();var lU=require("path"),RCe=A_(),{pathExists:Ylo}=aU(),Klo=W0().fromPromise;async function Jlo(t,e){if(lU.isAbsolute(t)){try{await RCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=lU.dirname(e),n=lU.join(r,t);if(await Ylo(n))return{toCwd:n,toDst:t};try{await RCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:lU.relative(r,t)}}a(Jlo,"symlinkPaths");function Zlo(t,e){if(lU.isAbsolute(t)){if(!RCe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=lU.dirname(e),n=lU.join(r,t);if(RCe.existsSync(n))return{toCwd:n,toDst:t};if(!RCe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:lU.relative(r,t)}}a(Zlo,"symlinkPathsSync");ijr.exports={symlinkPaths:Klo(Jlo),symlinkPathsSync:Zlo}});var cjr=I((fcl,ajr)=>{"use strict";p();var sjr=A_(),Xlo=W0().fromPromise;async function euo(t,e){if(e)return e;let r;try{r=await sjr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(euo,"symlinkType");function tuo(t,e){if(e)return e;let r;try{r=sjr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(tuo,"symlinkTypeSync");ajr.exports={symlinkType:Xlo(euo),symlinkTypeSync:tuo}});var djr=I((mcl,ujr)=>{"use strict";p();var ruo=W0().fromPromise,uU=require("path"),iC=A_(),{mkdirs:nuo,mkdirsSync:iuo}=Pk(),{symlinkPaths:ouo,symlinkPathsSync:suo}=ojr(),{symlinkType:auo,symlinkTypeSync:cuo}=cjr(),{pathExists:luo}=aU(),{areIdentical:ljr}=RW();async function uuo(t,e,r){let n;try{n=await iC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(uU.isAbsolute(t))l=await iC.stat(t);else{let d=uU.dirname(e),f=uU.join(d,t);try{l=await iC.stat(f)}catch{l=await iC.stat(t)}}let u=await iC.stat(e);if(ljr(l,u))return}let o=await ouo(t,e);t=o.toDst;let s=await auo(o.toCwd,r),c=uU.dirname(e);return await luo(c)||await nuo(c),iC.symlink(t,e,s)}a(uuo,"createSymlink");function duo(t,e,r){let n;try{n=iC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(uU.isAbsolute(t))l=iC.statSync(t);else{let d=uU.dirname(e),f=uU.join(d,t);try{l=iC.statSync(f)}catch{l=iC.statSync(t)}}let u=iC.statSync(e);if(ljr(l,u))return}let o=suo(t,e);t=o.toDst,r=cuo(o.toCwd,r);let s=uU.dirname(e);return iC.existsSync(s)||iuo(s),iC.symlinkSync(t,e,r)}a(duo,"createSymlinkSync");ujr.exports={createSymlink:ruo(uuo),createSymlinkSync:duo}});var Ejr=I((ycl,yjr)=>{"use strict";p();var{createFile:fjr,createFileSync:pjr}=Zqr(),{createLink:hjr,createLinkSync:mjr}=njr(),{createSymlink:gjr,createSymlinkSync:Ajr}=djr();yjr.exports={createFile:fjr,createFileSync:pjr,ensureFile:fjr,ensureFileSync:pjr,createLink:hjr,createLinkSync:mjr,ensureLink:hjr,ensureLinkSync:mjr,createSymlink:gjr,createSymlinkSync:Ajr,ensureSymlink:gjr,ensureSymlinkSync:Ajr}});var W6e=I((_cl,_jr)=>{p();function fuo(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(fuo,"stringify");function puo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(puo,"stripBom");_jr.exports={stringify:fuo,stripBom:puo}});var Sjr=I((bcl,bjr)=>{p();var boe;try{boe=_oe()}catch{boe=require("fs")}var z6e=W0(),{stringify:vjr,stripBom:Cjr}=W6e();async function huo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||boe,n="throws"in e?e.throws:!0,o=await z6e.fromCallback(r.readFile)(t,e);o=Cjr(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(huo,"_readFile");var muo=z6e.fromPromise(huo);function guo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||boe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=Cjr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(guo,"readFileSync");async function Auo(t,e,r={}){let n=r.fs||boe,o=vjr(e,r);await z6e.fromCallback(n.writeFile)(t,o,r)}a(Auo,"_writeFile");var yuo=z6e.fromPromise(Auo);function Euo(t,e,r={}){let n=r.fs||boe,o=vjr(e,r);return n.writeFileSync(t,o,r)}a(Euo,"writeFileSync");bjr.exports={readFile:muo,readFileSync:guo,writeFile:yuo,writeFileSync:Euo}});var Ijr=I((Icl,Tjr)=>{"use strict";p();var Y6e=Sjr();Tjr.exports={readJson:Y6e.readFile,readJsonSync:Y6e.readFileSync,writeJson:Y6e.writeFile,writeJsonSync:Y6e.writeFileSync}});var K6e=I((wcl,Rjr)=>{"use strict";p();var _uo=W0().fromPromise,nPt=A_(),xjr=require("path"),wjr=Pk(),vuo=aU().pathExists;async function Cuo(t,e,r="utf-8"){let n=xjr.dirname(t);return await vuo(n)||await wjr.mkdirs(n),nPt.writeFile(t,e,r)}a(Cuo,"outputFile");function buo(t,...e){let r=xjr.dirname(t);nPt.existsSync(r)||wjr.mkdirsSync(r),nPt.writeFileSync(t,...e)}a(buo,"outputFileSync");Rjr.exports={outputFile:_uo(Cuo),outputFileSync:buo}});var Pjr=I((Pcl,kjr)=>{"use strict";p();var{stringify:Suo}=W6e(),{outputFile:Tuo}=K6e();async function Iuo(t,e,r={}){let n=Suo(e,r);await Tuo(t,n,r)}a(Iuo,"outputJson");kjr.exports=Iuo});var Njr=I((Mcl,Djr)=>{"use strict";p();var{stringify:xuo}=W6e(),{outputFileSync:wuo}=K6e();function Ruo(t,e,r){let n=xuo(e,r);wuo(t,n,r)}a(Ruo,"outputJsonSync");Djr.exports=Ruo});var Ojr=I((Bcl,Mjr)=>{"use strict";p();var kuo=W0().fromPromise,E_=Ijr();E_.outputJson=kuo(Pjr());E_.outputJsonSync=Njr();E_.outputJSON=E_.outputJson;E_.outputJSONSync=E_.outputJsonSync;E_.writeJSON=E_.writeJson;E_.writeJSONSync=E_.writeJsonSync;E_.readJSON=E_.readJson;E_.readJSONSync=E_.readJsonSync;Mjr.exports=E_});var Qjr=I((Ucl,Ujr)=>{"use strict";p();var Puo=A_(),Ljr=require("path"),{copy:Duo}=V6e(),{remove:Fjr}=wCe(),{mkdirp:Nuo}=Pk(),{pathExists:Muo}=aU(),Bjr=RW();async function Ouo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await Bjr.checkPaths(t,e,"move",r);await Bjr.checkParentPaths(t,o,e,"move");let c=Ljr.dirname(e);return Ljr.parse(c).root!==c&&await Nuo(c),Luo(t,e,n,s)}a(Ouo,"move");async function Luo(t,e,r,n){if(!n){if(r)await Fjr(e);else if(await Muo(e))throw new Error("dest already exists.")}try{await Puo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await Buo(t,e,r)}}a(Luo,"doRename");async function Buo(t,e,r){return await Duo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Fjr(t)}a(Buo,"moveAcrossDevice");Ujr.exports=Ouo});var $jr=I((jcl,Gjr)=>{"use strict";p();var jjr=_oe(),oPt=require("path"),Fuo=V6e().copySync,Hjr=wCe().removeSync,Uuo=Pk().mkdirpSync,qjr=RW();function Quo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=qjr.checkPathsSync(t,e,"move",r);return qjr.checkParentPathsSync(t,o,e,"move"),quo(e)||Uuo(oPt.dirname(e)),juo(t,e,n,s)}a(Quo,"moveSync");function quo(t){let e=oPt.dirname(t);return oPt.parse(e).root===e}a(quo,"isParentRoot");function juo(t,e,r,n){if(n)return iPt(t,e,r);if(r)return Hjr(e),iPt(t,e,r);if(jjr.existsSync(e))throw new Error("dest already exists.");return iPt(t,e,r)}a(juo,"doRename");function iPt(t,e,r){try{jjr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Huo(t,e,r)}}a(iPt,"rename");function Huo(t,e,r){return Fuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Hjr(t)}a(Huo,"moveAcrossDevice");Gjr.exports=Quo});var Wjr=I(($cl,Vjr)=>{"use strict";p();var Guo=W0().fromPromise;Vjr.exports={move:Guo(Qjr()),moveSync:$jr()}});var Yjr=I((Wcl,zjr)=>{"use strict";p();zjr.exports={...A_(),...V6e(),...zqr(),...Ejr(),...Ojr(),...Pk(),...Wjr(),...K6e(),...aU(),...wCe()}});var Z6e=I((Ycl,Zjr)=>{p();var sPt=require("fs"),J6e=require("path"),kCe=J6e.join,$uo=J6e.dirname,Kjr=sPt.accessSync&&function(t){try{sPt.accessSync(t)}catch{return!1}return!0}||sPt.existsSync||J6e.existsSync,Jjr={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 Vuo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(Jjr).map(function(u){u in t||(t[u]=Jjr[u])}),t.module_root||(t.module_root=Wuo(__filename)),J6e.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 Fuo=FI&&FI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uuo=FI&&FI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zjr=FI&&FI.__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)&&Fuo(e,t,r);return Uuo(e,t),e};Object.defineProperty(FI,"__esModule",{value:!0});FI.setDeviceId=FI.getDeviceId=void 0;var z6e=zjr(require("path")),Y6e=zjr(Gjr()),Yjr=process.platform==="win32"?W6e()("windows"):null,Quo="deviceid";function Kjr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=z6e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??z6e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return z6e.join(t,"Microsoft","DeveloperTools")}a(Kjr,"getDirectory");function nPt(){return z6e.join(Kjr(),Quo)}a(nPt,"getDeviceIdFilePath");async function quo(){return process.platform==="win32"?Yjr?.GetDeviceId():await juo(nPt())?Y6e.readFile(nPt(),"utf8"):void 0}a(quo,"getDeviceId");FI.getDeviceId=quo;async function juo(t){try{return await Y6e.promises.access(t),!0}catch{return!1}}a(juo,"exists");async function Huo(t){process.platform==="win32"?Yjr?.SetDeviceId(t):(await Y6e.ensureDir(Kjr()),await Y6e.writeFile(nPt(),t,"utf8"))}a(Huo,"setDeviceId");FI.setDeviceId=Huo});var Xjr=I(ZN=>{"use strict";p();var Guo=ZN&&ZN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$uo=ZN&&ZN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vuo=ZN&&ZN.__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)&&Guo(e,t,r);return $uo(e,t),e};Object.defineProperty(ZN,"__esModule",{value:!0});ZN.getDeviceId=void 0;var Wuo=(Mo(),ba(Cc)),Zjr=Vuo(Jjr());async function zuo(){let t;try{t=await Zjr.getDeviceId()}catch{}if(t)return t;{let e=(0,Wuo.v4)().toLowerCase();return await Zjr.setDeviceId(e),e}}a(zuo,"getDeviceId");ZN.getDeviceId=zuo});var eHr=I(IW=>{"use strict";p();var Yuo=IW&&IW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kuo=IW&&IW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yuo(e,t,r)};Object.defineProperty(IW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");Kuo(Xjr(),IW)});var sa=I((J6e,tHr)=>{p();(function(t,e){typeof J6e=="object"?tHr.exports=J6e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(J6e,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 L=0;L{p();(function(t,e){typeof Z6e=="object"?rHr.exports=Z6e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Z6e,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 X6e=="object"?nHr.exports=X6e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(X6e,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 sHr=I((e9e,oHr)=>{p();(function(t,e){typeof e9e=="object"?oHr.exports=e9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(e9e,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 lU=I((t9e,aHr)=>{p();(function(t,e){typeof t9e=="object"?aHr.exports=t9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(t9e,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 lHr=I((r9e,cHr)=>{p();(function(t,e){typeof r9e=="object"?cHr.exports=r9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(r9e,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 uU=I((n9e,uHr)=>{p();(function(t,e){typeof n9e=="object"?uHr.exports=n9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n9e,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],L=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],O=g[A+12],j=g[A+13],Q=g[A+14],U=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,b,7,l[0]),z=d(z,Y,W,V,T,12,l[1]),V=d(V,z,Y,W,w,17,l[2]),W=d(W,V,z,Y,R,22,l[3]),Y=d(Y,W,V,z,x,7,l[4]),z=d(z,Y,W,V,P,12,l[5]),V=d(V,z,Y,W,D,17,l[6]),W=d(W,V,z,Y,N,22,l[7]),Y=d(Y,W,V,z,L,7,l[8]),z=d(z,Y,W,V,B,12,l[9]),V=d(V,z,Y,W,q,17,l[10]),W=d(W,V,z,Y,M,22,l[11]),Y=d(Y,W,V,z,O,7,l[12]),z=d(z,Y,W,V,j,12,l[13]),V=d(V,z,Y,W,Q,17,l[14]),W=d(W,V,z,Y,U,22,l[15]),Y=f(Y,W,V,z,T,5,l[16]),z=f(z,Y,W,V,D,9,l[17]),V=f(V,z,Y,W,M,14,l[18]),W=f(W,V,z,Y,b,20,l[19]),Y=f(Y,W,V,z,P,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,U,14,l[22]),W=f(W,V,z,Y,x,20,l[23]),Y=f(Y,W,V,z,B,5,l[24]),z=f(z,Y,W,V,Q,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,L,20,l[27]),Y=f(Y,W,V,z,j,5,l[28]),z=f(z,Y,W,V,w,9,l[29]),V=f(V,z,Y,W,N,14,l[30]),W=f(W,V,z,Y,O,20,l[31]),Y=h(Y,W,V,z,P,4,l[32]),z=h(z,Y,W,V,L,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,Q,23,l[35]),Y=h(Y,W,V,z,T,4,l[36]),z=h(z,Y,W,V,x,11,l[37]),V=h(V,z,Y,W,N,16,l[38]),W=h(W,V,z,Y,q,23,l[39]),Y=h(Y,W,V,z,j,4,l[40]),z=h(z,Y,W,V,b,11,l[41]),V=h(V,z,Y,W,R,16,l[42]),W=h(W,V,z,Y,D,23,l[43]),Y=h(Y,W,V,z,B,4,l[44]),z=h(z,Y,W,V,O,11,l[45]),V=h(V,z,Y,W,U,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,b,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,Q,15,l[50]),W=m(W,V,z,Y,P,21,l[51]),Y=m(Y,W,V,z,O,6,l[52]),z=m(z,Y,W,V,R,10,l[53]),V=m(V,z,Y,W,q,15,l[54]),W=m(W,V,z,Y,T,21,l[55]),Y=m(Y,W,V,z,L,6,l[56]),z=m(z,Y,W,V,U,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,j,21,l[59]),Y=m(Y,W,V,z,x,6,l[60]),z=m(z,Y,W,V,M,10,l[61]),V=m(V,z,Y,W,w,15,l[62]),W=m(W,V,z,Y,B,21,l[63]),v[0]=v[0]+Y|0,v[1]=v[1]+W|0,v[2]=v[2]+V|0,v[3]=v[3]+z|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 sPt=I((i9e,dHr)=>{p();(function(t,e){typeof i9e=="object"?dHr.exports=i9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(i9e,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 s9e=I((o9e,fHr)=>{p();(function(t,e){typeof o9e=="object"?fHr.exports=o9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(o9e,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 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],j=q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+j|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 hHr=I((a9e,pHr)=>{p();(function(t,e,r){typeof a9e=="object"?pHr.exports=a9e=e(sa(),s9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(a9e,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 aPt=I((c9e,mHr)=>{p();(function(t,e,r){typeof c9e=="object"?mHr.exports=c9e=e(sa(),wCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(c9e,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,L=_.high,B=_.low,q=v.high,M=v.low,O=b.high,j=b.low,Q=T.high,U=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=P,re=D,le=N,Le=L,ge=B,Ue=q,ke=M,X=O,ee=j,K=Q,he=U,Z=Y,ue=W,qe=V,ne=z,ce=0;ce<80;ce++){var Ne,we,Be=f[ce];if(ce<16)we=Be.high=m[g+ce*2]|0,Ne=Be.low=m[g+ce*2+1]|0;else{var rt=f[ce-15],st=rt.high,_t=rt.low,Dt=(st>>>1|_t<<31)^(st>>>8|_t<<24)^st>>>7,$t=(_t>>>1|st<<31)^(_t>>>8|st<<24)^(_t>>>7|st<<25),Gt=f[ce-2],Ie=Gt.high,F=Gt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Qe=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),pe=f[ce-7],Se=pe.high,Fe=pe.low,te=f[ce-16],Te=te.high,Ge=te.low;Ne=$t+Fe,we=Dt+Se+(Ne>>>0<$t>>>0?1:0),Ne=Ne+Qe,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 J=X&K^~X&Z,se=ee&he^~ee&ue,me=ie&re^ie&Le^re&Le,Ce=H&le^H&ge^le&ge,He=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),$e=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),et=(X>>>14|ee<<18)^(X>>>18|ee<<14)^(X<<23|ee>>>9),ct=(ee>>>14|X<<18)^(ee>>>18|X<<14)^(ee<<23|X>>>9),bt=d[ce],ht=bt.high,We=bt.low,ae=ne+ct,Re=qe+et+(ae>>>0>>0?1:0),ae=ae+se,Re=Re+J+(ae>>>0>>0?1:0),ae=ae+We,Re=Re+ht+(ae>>>0>>0?1:0),ae=ae+Ne,Re=Re+we+(ae>>>0>>0?1:0),Me=$e+Ce,ye=He+me+(Me>>>0<$e>>>0?1:0);qe=Z,ne=ue,Z=K,ue=he,K=X,he=ee,ee=ke+ae|0,X=Ue+Re+(ee>>>0>>0?1:0)|0,Ue=Le,ke=ge,Le=re,ge=le,re=ie,le=H,H=ae+Me|0,ie=Re+ye+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ie+(P>>>0>>0?1:0),N=E.low=N+le,E.high=D+re+(N>>>0>>0?1:0),B=_.low=B+ge,_.high=L+Le+(B>>>0>>0?1:0),M=v.low=M+ke,v.high=q+Ue+(M>>>0>>0?1:0),j=b.low=j+ee,b.high=O+X+(j>>>0>>0?1:0),U=T.low=U+he,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=Y+Z+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+qe+(z>>>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 AHr=I((l9e,gHr)=>{p();(function(t,e,r){typeof l9e=="object"?gHr.exports=l9e=e(sa(),wCe(),aPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(l9e,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 EHr=I((u9e,yHr)=>{p();(function(t,e,r){typeof u9e=="object"?yHr.exports=u9e=e(sa(),wCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(u9e,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 L=m[x];L.high=P,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,P=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^=P,w.low^=D}for(var j=1;j<25;j++){var P,D,w=E[j],Q=w.high,U=w.low,Y=d[j];Y<32?(P=Q<>>32-Y,D=U<>>32-Y):(P=U<>>64-Y,D=Q<>>64-Y);var W=m[f[j]];W.high=P,W.low=D}var V=m[0],z=E[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var j=x+5*N,w=E[j],ie=m[j],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ie.high^~H.high&re.high,w.low=ie.low^~H.low&re.low}var w=E[0],le=h[R];w.high^=le.high,w.low^=le.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 vHr=I((d9e,_Hr)=>{p();(function(t,e){typeof d9e=="object"?_Hr.exports=d9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(d9e,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,L=m.words,B=l.words,q=u.words,M=d.words,O=f.words,j,Q,U,Y,W,V,z,ie,H,re;V=j=D[0],z=Q=D[1],ie=U=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=j+T[w+B[R]]|0,R<16?le+=A(Q,U,Y)+N[0]:R<32?le+=y(Q,U,Y)+N[1]:R<48?le+=E(Q,U,Y)+N[2]:R<64?le+=_(Q,U,Y)+N[3]:le+=v(Q,U,Y)+N[4],le=le|0,le=b(le,M[R]),le=le+W|0,j=W,W=Y,Y=b(U,10),U=Q,Q=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+L[0]:R<32?le+=_(z,ie,H)+L[1]:R<48?le+=E(z,ie,H)+L[2]:R<64?le+=y(z,ie,H)+L[3]:le+=A(z,ie,H)+L[4],le=le|0,le=b(le,O[R]),le=le+re|0,V=re,re=H,H=b(ie,10),ie=z,z=le;le=D[1]+U+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+j+z|0,D[4]=D[0]+Q+ie|0,D[0]=le},"_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 L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>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 p9e=I((f9e,CHr)=>{p();(function(t,e){typeof f9e=="object"?CHr.exports=f9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(f9e,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 h9e=="object"?bHr.exports=h9e=e(sa(),s9e(),p9e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(h9e,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 m9e=="object"?THr.exports=m9e=e(sa(),sPt(),p9e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(m9e,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 g9e=="object"?IHr.exports=g9e=e(sa(),oB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(g9e,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,j=O.blockSize;B.call(this,q,M,j),O.encryptBlock(q,M),this._prevBlock=q.slice(M,M+j)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize,Q=q.slice(M,M+j);O.decryptBlock(q,M),B.call(this,q,M,j),this._prevBlock=Q},"processBlock")});function B(q,M,O){var j,Q=this._iv;Q?(j=Q,this._iv=e):j=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),j=O.finalize(B),Q=O.cfg;return T.create({ciphertext:j,key:q,iv:Q.iv,algorithm:L,mode:Q.mode,padding:Q.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")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(L,B,q,M,O){if(M||(M=s.random(64/8)),O)var j=h.create({keySize:B+q,hasher:O}).compute(L,M);else var j=h.create({keySize:B+q}).compute(L,M);var Q=s.create(j.words.slice(B),q*4);return j.sigBytes=B*4,T.create({key:j,iv:Q,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 j=x.encrypt.call(this,L,B,O.key,M);return j.mixIn(O),j},"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 j=x.decrypt.call(this,L,B,O.key,M);return j},"decrypt")})})()})});var wHr=I((A9e,xHr)=>{p();(function(t,e,r){typeof A9e=="object"?xHr.exports=A9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(A9e,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 y9e=="object"?RHr.exports=y9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(y9e,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 E9e=="object"?PHr.exports=E9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(E9e,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 _9e=="object"?NHr.exports=_9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(_9e,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 v9e=="object"?OHr.exports=v9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(v9e,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 FHr=I((C9e,BHr)=>{p();(function(t,e,r){typeof C9e=="object"?BHr.exports=C9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(C9e,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 QHr=I((b9e,UHr)=>{p();(function(t,e,r){typeof b9e=="object"?UHr.exports=b9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(b9e,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 jHr=I((S9e,qHr)=>{p();(function(t,e,r){typeof S9e=="object"?qHr.exports=S9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(S9e,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 GHr=I((T9e,HHr)=>{p();(function(t,e,r){typeof T9e=="object"?HHr.exports=T9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(T9e,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 VHr=I((I9e,$Hr)=>{p();(function(t,e,r){typeof I9e=="object"?$Hr.exports=I9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(I9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var zHr=I((x9e,WHr)=>{p();(function(t,e,r){typeof x9e=="object"?WHr.exports=x9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(x9e,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 KHr=I((w9e,YHr)=>{p();(function(t,e,r){typeof w9e=="object"?YHr.exports=w9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(w9e,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],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++],Q=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++],Y=T[q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=j,L=Q,B=U,q=Y}var j=(P[N>>>24]<<24|P[L>>>16&255]<<16|P[B>>>8&255]<<8|P[q&255])^b[M++],Q=(P[L>>>24]<<24|P[B>>>16&255]<<16|P[q>>>8&255]<<8|P[N&255])^b[M++],U=(P[B>>>24]<<24|P[q>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],Y=(P[q>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=j,_[v+1]=Q,_[v+2]=U,_[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var ZHr=I((R9e,JHr)=>{p();(function(t,e,r){typeof R9e=="object"?JHr.exports=R9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(R9e,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 eGr=I((k9e,XHr)=>{p();(function(t,e,r){typeof k9e=="object"?XHr.exports=k9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(k9e,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 rGr=I((P9e,tGr)=>{p();(function(t,e,r){typeof P9e=="object"?tGr.exports=P9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(P9e,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 iGr=I((D9e,nGr)=>{p();(function(t,e,r){typeof D9e=="object"?nGr.exports=D9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(D9e,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 sGr=I((N9e,oGr)=>{p();(function(t,e,r){typeof N9e=="object"?oGr.exports=N9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(N9e,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 M9e=="object"?aGr.exports=M9e=e(sa(),wCe(),iHr(),sHr(),lU(),lHr(),uU(),sPt(),s9e(),hHr(),aPt(),AHr(),EHr(),vHr(),p9e(),SHr(),oB(),jm(),wHr(),kHr(),DHr(),MHr(),LHr(),FHr(),QHr(),jHr(),GHr(),VHr(),zHr(),KHr(),ZHr(),eGr(),rGr(),iGr(),sGr()):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)})(M9e,function(t){return t})});var Xoe=I(qy=>{"use strict";p();Object.defineProperty(qy,"__esModule",{value:!0});qy.stringArray=qy.array=qy.func=qy.error=qy.number=qy.string=qy.boolean=void 0;function hAo(t){return t===!0||t===!1}a(hAo,"boolean");qy.boolean=hAo;function jVr(t){return typeof t=="string"||t instanceof String}a(jVr,"string");qy.string=jVr;function mAo(t){return typeof t=="number"||t instanceof Number}a(mAo,"number");qy.number=mAo;function gAo(t){return t instanceof Error}a(gAo,"error");qy.error=gAo;function AAo(t){return typeof t=="function"}a(AAo,"func");qy.func=AAo;function HVr(t){return Array.isArray(t)}a(HVr,"array");qy.array=HVr;function yAo(t){return HVr(t)&&t.every(e=>jVr(e))}a(yAo,"stringArray");qy.stringArray=yAo});var D2t=I(pi=>{"use strict";p();Object.defineProperty(pi,"__esModule",{value:!0});pi.Message=pi.NotificationType9=pi.NotificationType8=pi.NotificationType7=pi.NotificationType6=pi.NotificationType5=pi.NotificationType4=pi.NotificationType3=pi.NotificationType2=pi.NotificationType1=pi.NotificationType0=pi.NotificationType=pi.RequestType9=pi.RequestType8=pi.RequestType7=pi.RequestType6=pi.RequestType5=pi.RequestType4=pi.RequestType3=pi.RequestType2=pi.RequestType1=pi.RequestType=pi.RequestType0=pi.AbstractMessageSignature=pi.ParameterStructures=pi.ResponseError=pi.ErrorCodes=void 0;var BW=Xoe(),c2t;(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})(c2t||(pi.ErrorCodes=c2t={}));var l2t=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=BW.number(e)?e:c2t.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}};pi.ResponseError=l2t;var lC=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}};pi.ParameterStructures=lC;lC.auto=new lC("auto");lC.byPosition=new lC("byPosition");lC.byName=new lC("byName");var ju=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return lC.auto}};pi.AbstractMessageSignature=ju;var u2t=class extends ju{static{a(this,"RequestType0")}constructor(e){super(e,0)}};pi.RequestType0=u2t;var d2t=class extends ju{static{a(this,"RequestType")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType=d2t;var f2t=class extends ju{static{a(this,"RequestType1")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType1=f2t;var p2t=class extends ju{static{a(this,"RequestType2")}constructor(e){super(e,2)}};pi.RequestType2=p2t;var h2t=class extends ju{static{a(this,"RequestType3")}constructor(e){super(e,3)}};pi.RequestType3=h2t;var m2t=class extends ju{static{a(this,"RequestType4")}constructor(e){super(e,4)}};pi.RequestType4=m2t;var g2t=class extends ju{static{a(this,"RequestType5")}constructor(e){super(e,5)}};pi.RequestType5=g2t;var A2t=class extends ju{static{a(this,"RequestType6")}constructor(e){super(e,6)}};pi.RequestType6=A2t;var y2t=class extends ju{static{a(this,"RequestType7")}constructor(e){super(e,7)}};pi.RequestType7=y2t;var E2t=class extends ju{static{a(this,"RequestType8")}constructor(e){super(e,8)}};pi.RequestType8=E2t;var _2t=class extends ju{static{a(this,"RequestType9")}constructor(e){super(e,9)}};pi.RequestType9=_2t;var v2t=class extends ju{static{a(this,"NotificationType")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType=v2t;var C2t=class extends ju{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};pi.NotificationType0=C2t;var b2t=class extends ju{static{a(this,"NotificationType1")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType1=b2t;var S2t=class extends ju{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};pi.NotificationType2=S2t;var T2t=class extends ju{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};pi.NotificationType3=T2t;var I2t=class extends ju{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};pi.NotificationType4=I2t;var x2t=class extends ju{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};pi.NotificationType5=x2t;var w2t=class extends ju{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};pi.NotificationType6=w2t;var R2t=class extends ju{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};pi.NotificationType7=R2t;var k2t=class extends ju{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};pi.NotificationType8=k2t;var P2t=class extends ju{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};pi.NotificationType9=P2t;var GVr;(function(t){function e(o){let s=o;return s&&BW.string(s.method)&&(BW.string(s.id)||BW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&BW.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)&&(BW.string(s.id)||BW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(GVr||(pi.Message=GVr={}))});var M2t=I(TU=>{"use strict";p();var $Vr;Object.defineProperty(TU,"__esModule",{value:!0});TU.LRUCache=TU.LinkedMap=TU.Touch=void 0;var jy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(jy||(TU.Touch=jy={}));var gUe=class{static{a(this,"LinkedMap")}constructor(){this[$Vr]="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=jy.None){let n=this._map.get(e);if(n)return r!==jy.None&&this.touch(n,r),n.value}set(e,r,n=jy.None){let o=this._map.get(e);if(o)o.value=r,n!==jy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case jy.None:this.addItemLast(o);break;case jy.First:this.addItemFirst(o);break;case jy.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}[($Vr=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!==jy.First&&r!==jy.Last)){if(r===jy.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===jy.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)}};TU.LinkedMap=gUe;var N2t=class extends gUe{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=jy.AsNew){return super.get(e,r)}peek(e){return super.get(e,jy.None)}set(e,r){return super.set(e,r,jy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};TU.LRUCache=N2t});var WVr=I(AUe=>{"use strict";p();Object.defineProperty(AUe,"__esModule",{value:!0});AUe.Disposable=void 0;var VVr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(VVr||(AUe.Disposable=VVr={}))});var IU=I(B2t=>{"use strict";p();Object.defineProperty(B2t,"__esModule",{value:!0});var O2t;function L2t(){if(O2t===void 0)throw new Error("No runtime abstraction layer installed");return O2t}a(L2t,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");O2t=r}a(e,"install"),t.install=e})(L2t||(L2t={}));B2t.default=L2t});var tse=I(ese=>{"use strict";p();Object.defineProperty(ese,"__esModule",{value:!0});ese.Emitter=ese.Event=void 0;var EAo=IU(),zVr;(function(t){let e={dispose(){}};t.None=function(){return e}})(zVr||(ese.Event=zVr={}));var F2t=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 F2t),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)}};ese.Emitter=yUe;yUe._noop=function(){}});var vUe=I(rse=>{"use strict";p();Object.defineProperty(rse,"__esModule",{value:!0});rse.CancellationTokenSource=rse.CancellationToken=void 0;var _Ao=IU(),vAo=Xoe(),U2t=tse(),EUe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U2t.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U2t.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||vAo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(EUe||(rse.CancellationToken=EUe={}));var CAo=Object.freeze(function(t,e){let r=(0,_Ao.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),_Ue=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?CAo:(this._emitter||(this._emitter=new U2t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Q2t=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new _Ue),this._token}cancel(){this._token?this._token.cancel():this._token=EUe.Cancelled}dispose(){this._token?this._token instanceof _Ue&&this._token.dispose():this._token=EUe.None}};rse.CancellationTokenSource=Q2t});var YVr=I(nse=>{"use strict";p();Object.defineProperty(nse,"__esModule",{value:!0});nse.SharedArrayReceiverStrategy=nse.SharedArraySenderStrategy=void 0;var bAo=vUe(),zCe;(function(t){t.Continue=0,t.Cancelled=1})(zCe||(zCe={}));var q2t=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]=zCe.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,zCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nse.SharedArraySenderStrategy=q2t;var j2t=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===zCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},H2t=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new j2t(e)}cancel(){}dispose(){}},G2t=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new bAo.CancellationTokenSource:new H2t(r)}};nse.SharedArrayReceiverStrategy=G2t});var V2t=I(CUe=>{"use strict";p();Object.defineProperty(CUe,"__esModule",{value:!0});CUe.Semaphore=void 0;var SAo=IU(),$2t=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,SAo.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()}}};CUe.Semaphore=$2t});var JVr=I(xU=>{"use strict";p();Object.defineProperty(xU,"__esModule",{value:!0});xU.ReadableStreamMessageReader=xU.AbstractMessageReader=xU.MessageReader=void 0;var z2t=IU(),ise=Xoe(),W2t=tse(),TAo=V2t(),KVr;(function(t){function e(r){let n=r;return n&&ise.func(n.listen)&&ise.func(n.dispose)&&ise.func(n.onError)&&ise.func(n.onClose)&&ise.func(n.onPartialMessage)}a(e,"is"),t.is=e})(KVr||(xU.MessageReader=KVr={}));var bUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new W2t.Emitter,this.closeEmitter=new W2t.Emitter,this.partialMessageEmitter=new W2t.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: ${ise.string(e.message)?e.message:"unknown"}`)}};xU.AbstractMessageReader=bUe;var Y2t;(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,z2t.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(Y2t||(Y2t={}));var K2t=class extends bUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=Y2t.fromOptions(r),this.buffer=(0,z2t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new TAo.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,z2t.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))}};xU.ReadableStreamMessageReader=K2t});var rWr=I(wU=>{"use strict";p();Object.defineProperty(wU,"__esModule",{value:!0});wU.WriteableStreamMessageWriter=wU.AbstractMessageWriter=wU.MessageWriter=void 0;var ZVr=IU(),YCe=Xoe(),IAo=V2t(),XVr=tse(),xAo="Content-Length: ",eWr=`\r -`,tWr;(function(t){function e(r){let n=r;return n&&YCe.func(n.dispose)&&YCe.func(n.onClose)&&YCe.func(n.onError)&&YCe.func(n.write)}a(e,"is"),t.is=e})(tWr||(wU.MessageWriter=tWr={}));var SUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new XVr.Emitter,this.closeEmitter=new XVr.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: ${YCe.string(e.message)?e.message:"unknown"}`)}};wU.AbstractMessageWriter=SUe;var J2t;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,ZVr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,ZVr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(J2t||(J2t={}));var Z2t=class extends SUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=J2t.fromOptions(r),this.errorCount=0,this.writeSemaphore=new IAo.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(xAo,n.byteLength.toString(),eWr),o.push(eWr),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()}};wU.WriteableStreamMessageWriter=Z2t});var nWr=I(TUe=>{"use strict";p();Object.defineProperty(TUe,"__esModule",{value:!0});TUe.AbstractMessageBuffer=void 0;var wAo=13,RAo=10,kAo=`\r -`,X2t=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}};TUe.AbstractMessageBuffer=X2t});var cWr=I(Oo=>{"use strict";p();Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createMessageConnection=Oo.ConnectionOptions=Oo.MessageStrategy=Oo.CancellationStrategy=Oo.CancellationSenderStrategy=Oo.CancellationReceiverStrategy=Oo.RequestCancellationReceiverStrategy=Oo.IdCancellationReceiverStrategy=Oo.ConnectionStrategy=Oo.ConnectionError=Oo.ConnectionErrors=Oo.LogTraceNotification=Oo.SetTraceNotification=Oo.TraceFormat=Oo.TraceValues=Oo.Trace=Oo.NullLogger=Oo.ProgressType=Oo.ProgressToken=void 0;var iWr=IU(),lf=Xoe(),Vi=D2t(),oWr=M2t(),KCe=tse(),eDt=vUe(),XCe;(function(t){t.type=new Vi.NotificationType("$/cancelRequest")})(XCe||(XCe={}));var tDt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(tDt||(Oo.ProgressToken=tDt={}));var JCe;(function(t){t.type=new Vi.NotificationType("$/progress")})(JCe||(JCe={}));var rDt=class{static{a(this,"ProgressType")}constructor(){}};Oo.ProgressType=rDt;var nDt;(function(t){function e(r){return lf.func(r)}a(e,"is"),t.is=e})(nDt||(nDt={}));Oo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var bc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(bc||(Oo.Trace=bc={}));var sWr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(sWr||(Oo.TraceValues=sWr={}));(function(t){function e(n){if(!lf.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})(bc||(Oo.Trace=bc={}));var G1;(function(t){t.Text="text",t.JSON="json"})(G1||(Oo.TraceFormat=G1={}));(function(t){function e(r){return lf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(G1||(Oo.TraceFormat=G1={}));var iDt;(function(t){t.type=new Vi.NotificationType("$/setTrace")})(iDt||(Oo.SetTraceNotification=iDt={}));var IUe;(function(t){t.type=new Vi.NotificationType("$/logTrace")})(IUe||(Oo.LogTraceNotification=IUe={}));var ZCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ZCe||(Oo.ConnectionErrors=ZCe={}));var ose=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Oo.ConnectionError=ose;var oDt;(function(t){function e(r){let n=r;return n&&lf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(oDt||(Oo.ConnectionStrategy=oDt={}));var xUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(xUe||(Oo.IdCancellationReceiverStrategy=xUe={}));var sDt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(sDt||(Oo.RequestCancellationReceiverStrategy=sDt={}));var wUe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new eDt.CancellationTokenSource}});function e(r){return xUe.is(r)||sDt.is(r)}a(e,"is"),t.is=e})(wUe||(Oo.CancellationReceiverStrategy=wUe={}));var RUe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(XCe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&lf.func(n.sendCancellation)&&lf.func(n.cleanup)}a(e,"is"),t.is=e})(RUe||(Oo.CancellationSenderStrategy=RUe={}));var kUe;(function(t){t.Message=Object.freeze({receiver:wUe.Message,sender:RUe.Message});function e(r){let n=r;return n&&wUe.is(n.receiver)&&RUe.is(n.sender)}a(e,"is"),t.is=e})(kUe||(Oo.CancellationStrategy=kUe={}));var PUe;(function(t){function e(r){let n=r;return n&&lf.func(n.handleMessage)}a(e,"is"),t.is=e})(PUe||(Oo.MessageStrategy=PUe={}));var aWr;(function(t){function e(r){let n=r;return n&&(kUe.is(n.cancellationStrategy)||oDt.is(n.connectionStrategy)||PUe.is(n.messageStrategy))}a(e,"is"),t.is=e})(aWr||(Oo.ConnectionOptions=aWr={}));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 PAo(t,e,r,n){let o=r!==void 0?r:Oo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new oWr.LinkedMap,E=new Map,_=new Set,v=new Map,b=bc.Off,T=G1.Text,w,R=$k.New,x=new KCe.Emitter,P=new KCe.Emitter,D=new KCe.Emitter,N=new KCe.Emitter,L=new KCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:kUe.Message;function q(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(q,"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 j(Ie,F){Vi.Message.isRequest(F)?Ie.set(q(F.id),F):Vi.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(j,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===$k.Listening}a(U,"isListening");function Y(){return R===$k.Closed}a(Y,"isClosed");function W(){return R===$k.Disposed}a(W,"isDisposed");function V(){(R===$k.New||R===$k.Listening)&&(R=$k.Closed,P.fire(void 0))}a(V,"closeHandler");function z(Ie){x.fire([Ie,void 0,void 0])}a(z,"readErrorHandler");function ie(Ie){x.fire(Ie)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,iWr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(Ie){Vi.Message.isRequest(Ie)?ge(Ie):Vi.Message.isNotification(Ie)?ke(Ie):Vi.Message.isResponse(Ie)?Ue(Ie):X(Ie)}a(re,"handleMessage");function le(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;PUe.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(le,"processMessageQueue");let Le=a(Ie=>{try{if(Vi.Message.isNotification(Ie)&&Ie.method===XCe.type.method){let F=Ie.params.id,be=q(F),Qe=y.get(be);if(Vi.Message.isRequest(Qe)){let Se=n?.connectionStrategy,Fe=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Qe,Q):void 0;if(Fe&&(Fe.error!==void 0||Fe.result!==void 0)){y.delete(be),v.delete(F),Fe.id=Qe.id,Z(Fe,Ie.method,Date.now()),e.write(Fe).catch(()=>o.error("Sending response for canceled message failed."));return}}let pe=v.get(F);if(pe!==void 0){pe.cancel(),qe(Ie);return}else _.add(F)}j(y,Ie)}finally{H()}},"callback");function ge(Ie){if(W())return;function F(Te,Ge,J){let se={jsonrpc:u,id:Ie.id};Te instanceof Vi.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,J){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Qe(Te,Ge,J){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),ue(Ie);let pe=f.get(Ie.method),Se,Fe;pe&&(Se=pe.type,Fe=pe.handler);let te=Date.now();if(Fe||d){let Te=Ie.id??String(Date.now()),Ge=xUe.is(B.receiver)?B.receiver.createCancellationTokenSource(Te):B.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let J;if(Fe)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}J=Fe(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byName){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}J=Fe(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byPosition){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}J=Fe(Ie.params,Ge.token)}else d&&(J=d(Ie.method,Ie.params,Ge.token));let se=J;J?se.then?se.then(me=>{v.delete(Te),F(me,Ie.method,te)},me=>{v.delete(Te),me instanceof Vi.ResponseError?be(me,Ie.method,te):me&&lf.string(me.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${me.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(J,Ie.method,te)):(v.delete(Te),Qe(J,Ie.method,te))}catch(J){v.delete(Te),J instanceof Vi.ResponseError?F(J,Ie.method,te):J&&lf.string(J.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${J.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new Vi.ResponseError(Vi.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ge,"handleRequest");function Ue(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(ne(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Qe=Ie.error;be.reject(new Vi.ResponseError(Qe.code,Qe.message,Qe.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${be.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Ue,"handleResponse");function ke(Ie){if(W())return;let F,be;if(Ie.method===XCe.type.method){let Qe=Ie.params.id;_.delete(Qe),qe(Ie);return}else{let Qe=m.get(Ie.method);Qe&&(be=Qe.handler,F=Qe.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Qe=Ie.params;Ie.method===JCe.type.method&&Qe.length===2&&tDt.is(Qe[0])?be({token:Qe[0],value:Qe[1]}):(F!==void 0&&(F.parameterStructures===Vi.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 ${Qe.length} arguments`)),be(...Qe))}else F!==void 0&&F.parameterStructures===Vi.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(Qe){Qe.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(ke,"handleNotification");function X(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(lf.string(F.id)||lf.number(F.id)){let be=F.id,Qe=E.get(be);Qe&&Qe.reject(new Error("The received response has neither a result nor an error property."))}}a(X,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case bc.Verbose:return JSON.stringify(Ie,null,4);case bc.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} +`)),l.tries=r,l}a(Vuo,"bindings");Zjr.exports=Vuo;function Wuo(t){for(var e=$uo(t),r;;){if(e==="."&&(e=process.cwd()),Kjr(kCe(e,"dist")))return kCe(e,"dist");if(Kjr(kCe(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=kCe(e,"..")}}a(Wuo,"getRoot")});var rHr=I(QI=>{"use strict";p();var zuo=QI&&QI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yuo=QI&&QI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xjr=QI&&QI.__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)&&zuo(e,t,r);return Yuo(e,t),e};Object.defineProperty(QI,"__esModule",{value:!0});QI.setDeviceId=QI.getDeviceId=void 0;var X6e=Xjr(require("path")),e9e=Xjr(Yjr()),eHr=process.platform==="win32"?Z6e()("windows"):null,Kuo="deviceid";function tHr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=X6e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??X6e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return X6e.join(t,"Microsoft","DeveloperTools")}a(tHr,"getDirectory");function aPt(){return X6e.join(tHr(),Kuo)}a(aPt,"getDeviceIdFilePath");async function Juo(){return process.platform==="win32"?eHr?.GetDeviceId():await Zuo(aPt())?e9e.readFile(aPt(),"utf8"):void 0}a(Juo,"getDeviceId");QI.getDeviceId=Juo;async function Zuo(t){try{return await e9e.promises.access(t),!0}catch{return!1}}a(Zuo,"exists");async function Xuo(t){process.platform==="win32"?eHr?.SetDeviceId(t):(await e9e.ensureDir(tHr()),await e9e.writeFile(aPt(),t,"utf8"))}a(Xuo,"setDeviceId");QI.setDeviceId=Xuo});var iHr=I(tM=>{"use strict";p();var edo=tM&&tM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tdo=tM&&tM.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rdo=tM&&tM.__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)&&edo(e,t,r);return tdo(e,t),e};Object.defineProperty(tM,"__esModule",{value:!0});tM.getDeviceId=void 0;var ndo=(Oo(),Sa(Cc)),nHr=rdo(rHr());async function ido(){let t;try{t=await nHr.getDeviceId()}catch{}if(t)return t;{let e=(0,ndo.v4)().toLowerCase();return await nHr.setDeviceId(e),e}}a(ido,"getDeviceId");tM.getDeviceId=ido});var oHr=I(kW=>{"use strict";p();var odo=kW&&kW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sdo=kW&&kW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&odo(e,t,r)};Object.defineProperty(kW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");sdo(iHr(),kW)});var aa=I((r9e,sHr)=>{p();(function(t,e){typeof r9e=="object"?sHr.exports=r9e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(r9e,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 L=0;L{p();(function(t,e){typeof n9e=="object"?aHr.exports=n9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n9e,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 i9e=="object"?cHr.exports=i9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(i9e,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 dHr=I((o9e,uHr)=>{p();(function(t,e){typeof o9e=="object"?uHr.exports=o9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(o9e,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 dU=I((s9e,fHr)=>{p();(function(t,e){typeof s9e=="object"?fHr.exports=s9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(s9e,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 hHr=I((a9e,pHr)=>{p();(function(t,e){typeof a9e=="object"?pHr.exports=a9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(a9e,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 fU=I((c9e,mHr)=>{p();(function(t,e){typeof c9e=="object"?mHr.exports=c9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(c9e,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],L=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],O=g[A+12],j=g[A+13],Q=g[A+14],U=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,b,7,l[0]),z=d(z,Y,W,V,T,12,l[1]),V=d(V,z,Y,W,w,17,l[2]),W=d(W,V,z,Y,R,22,l[3]),Y=d(Y,W,V,z,x,7,l[4]),z=d(z,Y,W,V,P,12,l[5]),V=d(V,z,Y,W,D,17,l[6]),W=d(W,V,z,Y,N,22,l[7]),Y=d(Y,W,V,z,L,7,l[8]),z=d(z,Y,W,V,B,12,l[9]),V=d(V,z,Y,W,q,17,l[10]),W=d(W,V,z,Y,M,22,l[11]),Y=d(Y,W,V,z,O,7,l[12]),z=d(z,Y,W,V,j,12,l[13]),V=d(V,z,Y,W,Q,17,l[14]),W=d(W,V,z,Y,U,22,l[15]),Y=f(Y,W,V,z,T,5,l[16]),z=f(z,Y,W,V,D,9,l[17]),V=f(V,z,Y,W,M,14,l[18]),W=f(W,V,z,Y,b,20,l[19]),Y=f(Y,W,V,z,P,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,U,14,l[22]),W=f(W,V,z,Y,x,20,l[23]),Y=f(Y,W,V,z,B,5,l[24]),z=f(z,Y,W,V,Q,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,L,20,l[27]),Y=f(Y,W,V,z,j,5,l[28]),z=f(z,Y,W,V,w,9,l[29]),V=f(V,z,Y,W,N,14,l[30]),W=f(W,V,z,Y,O,20,l[31]),Y=h(Y,W,V,z,P,4,l[32]),z=h(z,Y,W,V,L,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,Q,23,l[35]),Y=h(Y,W,V,z,T,4,l[36]),z=h(z,Y,W,V,x,11,l[37]),V=h(V,z,Y,W,N,16,l[38]),W=h(W,V,z,Y,q,23,l[39]),Y=h(Y,W,V,z,j,4,l[40]),z=h(z,Y,W,V,b,11,l[41]),V=h(V,z,Y,W,R,16,l[42]),W=h(W,V,z,Y,D,23,l[43]),Y=h(Y,W,V,z,B,4,l[44]),z=h(z,Y,W,V,O,11,l[45]),V=h(V,z,Y,W,U,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,b,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,Q,15,l[50]),W=m(W,V,z,Y,P,21,l[51]),Y=m(Y,W,V,z,O,6,l[52]),z=m(z,Y,W,V,R,10,l[53]),V=m(V,z,Y,W,q,15,l[54]),W=m(W,V,z,Y,T,21,l[55]),Y=m(Y,W,V,z,L,6,l[56]),z=m(z,Y,W,V,U,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,j,21,l[59]),Y=m(Y,W,V,z,x,6,l[60]),z=m(z,Y,W,V,M,10,l[61]),V=m(V,z,Y,W,w,15,l[62]),W=m(W,V,z,Y,B,21,l[63]),v[0]=v[0]+Y|0,v[1]=v[1]+W|0,v[2]=v[2]+V|0,v[3]=v[3]+z|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 uPt=I((l9e,gHr)=>{p();(function(t,e){typeof l9e=="object"?gHr.exports=l9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(l9e,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 d9e=I((u9e,AHr)=>{p();(function(t,e){typeof u9e=="object"?AHr.exports=u9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(u9e,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 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],j=q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+j|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 EHr=I((f9e,yHr)=>{p();(function(t,e,r){typeof f9e=="object"?yHr.exports=f9e=e(aa(),d9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(f9e,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 dPt=I((p9e,_Hr)=>{p();(function(t,e,r){typeof p9e=="object"?_Hr.exports=p9e=e(aa(),PCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(p9e,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,L=_.high,B=_.low,q=v.high,M=v.low,O=b.high,j=b.low,Q=T.high,U=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=P,re=D,le=N,Le=L,ge=B,Ue=q,ke=M,X=O,ee=j,K=Q,he=U,Z=Y,ue=W,qe=V,ne=z,ce=0;ce<80;ce++){var Me,we,Be=f[ce];if(ce<16)we=Be.high=m[g+ce*2]|0,Me=Be.low=m[g+ce*2+1]|0;else{var rt=f[ce-15],st=rt.high,Et=rt.low,Dt=(st>>>1|Et<<31)^(st>>>8|Et<<24)^st>>>7,$t=(Et>>>1|st<<31)^(Et>>>8|st<<24)^(Et>>>7|st<<25),Gt=f[ce-2],Ie=Gt.high,F=Gt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Qe=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),pe=f[ce-7],Se=pe.high,Fe=pe.low,te=f[ce-16],Te=te.high,Ge=te.low;Me=$t+Fe,we=Dt+Se+(Me>>>0<$t>>>0?1:0),Me=Me+Qe,we=we+be+(Me>>>0>>0?1:0),Me=Me+Ge,we=we+Te+(Me>>>0>>0?1:0),Be.high=we,Be.low=Me}var J=X&K^~X&Z,se=ee&he^~ee&ue,me=ie&re^ie&Le^re&Le,Ce=H&le^H&ge^le&ge,He=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),$e=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),et=(X>>>14|ee<<18)^(X>>>18|ee<<14)^(X<<23|ee>>>9),ct=(ee>>>14|X<<18)^(ee>>>18|X<<14)^(ee<<23|X>>>9),Ct=d[ce],ht=Ct.high,We=Ct.low,ae=ne+ct,Re=qe+et+(ae>>>0>>0?1:0),ae=ae+se,Re=Re+J+(ae>>>0>>0?1:0),ae=ae+We,Re=Re+ht+(ae>>>0>>0?1:0),ae=ae+Me,Re=Re+we+(ae>>>0>>0?1:0),Oe=$e+Ce,ye=He+me+(Oe>>>0<$e>>>0?1:0);qe=Z,ne=ue,Z=K,ue=he,K=X,he=ee,ee=ke+ae|0,X=Ue+Re+(ee>>>0>>0?1:0)|0,Ue=Le,ke=ge,Le=re,ge=le,re=ie,le=H,H=ae+Oe|0,ie=Re+ye+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ie+(P>>>0>>0?1:0),N=E.low=N+le,E.high=D+re+(N>>>0>>0?1:0),B=_.low=B+ge,_.high=L+Le+(B>>>0>>0?1:0),M=v.low=M+ke,v.high=q+Ue+(M>>>0>>0?1:0),j=b.low=j+ee,b.high=O+X+(j>>>0>>0?1:0),U=T.low=U+he,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=Y+Z+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+qe+(z>>>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 CHr=I((h9e,vHr)=>{p();(function(t,e,r){typeof h9e=="object"?vHr.exports=h9e=e(aa(),PCe(),dPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(h9e,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 SHr=I((m9e,bHr)=>{p();(function(t,e,r){typeof m9e=="object"?bHr.exports=m9e=e(aa(),PCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(m9e,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 L=m[x];L.high=P,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,P=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^=P,w.low^=D}for(var j=1;j<25;j++){var P,D,w=E[j],Q=w.high,U=w.low,Y=d[j];Y<32?(P=Q<>>32-Y,D=U<>>32-Y):(P=U<>>64-Y,D=Q<>>64-Y);var W=m[f[j]];W.high=P,W.low=D}var V=m[0],z=E[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var j=x+5*N,w=E[j],ie=m[j],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ie.high^~H.high&re.high,w.low=ie.low^~H.low&re.low}var w=E[0],le=h[R];w.high^=le.high,w.low^=le.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 IHr=I((g9e,THr)=>{p();(function(t,e){typeof g9e=="object"?THr.exports=g9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(g9e,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,L=m.words,B=l.words,q=u.words,M=d.words,O=f.words,j,Q,U,Y,W,V,z,ie,H,re;V=j=D[0],z=Q=D[1],ie=U=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=j+T[w+B[R]]|0,R<16?le+=A(Q,U,Y)+N[0]:R<32?le+=y(Q,U,Y)+N[1]:R<48?le+=E(Q,U,Y)+N[2]:R<64?le+=_(Q,U,Y)+N[3]:le+=v(Q,U,Y)+N[4],le=le|0,le=b(le,M[R]),le=le+W|0,j=W,W=Y,Y=b(U,10),U=Q,Q=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+L[0]:R<32?le+=_(z,ie,H)+L[1]:R<48?le+=E(z,ie,H)+L[2]:R<64?le+=y(z,ie,H)+L[3]:le+=A(z,ie,H)+L[4],le=le|0,le=b(le,O[R]),le=le+re|0,V=re,re=H,H=b(ie,10),ie=z,z=le;le=D[1]+U+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+j+z|0,D[4]=D[0]+Q+ie|0,D[0]=le},"_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 L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>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 y9e=I((A9e,xHr)=>{p();(function(t,e){typeof A9e=="object"?xHr.exports=A9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(A9e,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 E9e=="object"?wHr.exports=E9e=e(aa(),d9e(),y9e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(E9e,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 _9e=="object"?kHr.exports=_9e=e(aa(),uPt(),y9e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(_9e,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 v9e=="object"?PHr.exports=v9e=e(aa(),sB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(v9e,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,j=O.blockSize;B.call(this,q,M,j),O.encryptBlock(q,M),this._prevBlock=q.slice(M,M+j)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize,Q=q.slice(M,M+j);O.decryptBlock(q,M),B.call(this,q,M,j),this._prevBlock=Q},"processBlock")});function B(q,M,O){var j,Q=this._iv;Q?(j=Q,this._iv=e):j=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),j=O.finalize(B),Q=O.cfg;return T.create({ciphertext:j,key:q,iv:Q.iv,algorithm:L,mode:Q.mode,padding:Q.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")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(L,B,q,M,O){if(M||(M=s.random(64/8)),O)var j=h.create({keySize:B+q,hasher:O}).compute(L,M);else var j=h.create({keySize:B+q}).compute(L,M);var Q=s.create(j.words.slice(B),q*4);return j.sigBytes=B*4,T.create({key:j,iv:Q,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 j=x.encrypt.call(this,L,B,O.key,M);return j.mixIn(O),j},"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 j=x.decrypt.call(this,L,B,O.key,M);return j},"decrypt")})})()})});var NHr=I((C9e,DHr)=>{p();(function(t,e,r){typeof C9e=="object"?DHr.exports=C9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(C9e,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 b9e=="object"?MHr.exports=b9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(b9e,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 S9e=="object"?LHr.exports=S9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(S9e,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 T9e=="object"?FHr.exports=T9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(T9e,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 I9e=="object"?QHr.exports=I9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(I9e,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 HHr=I((x9e,jHr)=>{p();(function(t,e,r){typeof x9e=="object"?jHr.exports=x9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(x9e,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 $Hr=I((w9e,GHr)=>{p();(function(t,e,r){typeof w9e=="object"?GHr.exports=w9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(w9e,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 WHr=I((R9e,VHr)=>{p();(function(t,e,r){typeof R9e=="object"?VHr.exports=R9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(R9e,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 YHr=I((k9e,zHr)=>{p();(function(t,e,r){typeof k9e=="object"?zHr.exports=k9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(k9e,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 JHr=I((P9e,KHr)=>{p();(function(t,e,r){typeof P9e=="object"?KHr.exports=P9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(P9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var XHr=I((D9e,ZHr)=>{p();(function(t,e,r){typeof D9e=="object"?ZHr.exports=D9e=e(aa(),Gm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(D9e,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 tGr=I((N9e,eGr)=>{p();(function(t,e,r){typeof N9e=="object"?eGr.exports=N9e=e(aa(),dU(),fU(),sB(),Gm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(N9e,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],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++],Q=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++],Y=T[q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=j,L=Q,B=U,q=Y}var j=(P[N>>>24]<<24|P[L>>>16&255]<<16|P[B>>>8&255]<<8|P[q&255])^b[M++],Q=(P[L>>>24]<<24|P[B>>>16&255]<<16|P[q>>>8&255]<<8|P[N&255])^b[M++],U=(P[B>>>24]<<24|P[q>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],Y=(P[q>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=j,_[v+1]=Q,_[v+2]=U,_[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var nGr=I((M9e,rGr)=>{p();(function(t,e,r){typeof M9e=="object"?rGr.exports=M9e=e(aa(),dU(),fU(),sB(),Gm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(M9e,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 oGr=I((O9e,iGr)=>{p();(function(t,e,r){typeof O9e=="object"?iGr.exports=O9e=e(aa(),dU(),fU(),sB(),Gm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(O9e,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 aGr=I((L9e,sGr)=>{p();(function(t,e,r){typeof L9e=="object"?sGr.exports=L9e=e(aa(),dU(),fU(),sB(),Gm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(L9e,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 lGr=I((B9e,cGr)=>{p();(function(t,e,r){typeof B9e=="object"?cGr.exports=B9e=e(aa(),dU(),fU(),sB(),Gm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(B9e,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 dGr=I((F9e,uGr)=>{p();(function(t,e,r){typeof F9e=="object"?uGr.exports=F9e=e(aa(),dU(),fU(),sB(),Gm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(F9e,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 U9e=="object"?fGr.exports=U9e=e(aa(),PCe(),lHr(),dHr(),dU(),hHr(),fU(),uPt(),d9e(),EHr(),dPt(),CHr(),SHr(),IHr(),y9e(),RHr(),sB(),Gm(),NHr(),OHr(),BHr(),UHr(),qHr(),HHr(),$Hr(),WHr(),YHr(),JHr(),XHr(),tGr(),nGr(),oGr(),aGr(),lGr(),dGr()):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)})(U9e,function(t){return t})});var ese=I(jy=>{"use strict";p();Object.defineProperty(jy,"__esModule",{value:!0});jy.stringArray=jy.array=jy.func=jy.error=jy.number=jy.string=jy.boolean=void 0;function SAo(t){return t===!0||t===!1}a(SAo,"boolean");jy.boolean=SAo;function WVr(t){return typeof t=="string"||t instanceof String}a(WVr,"string");jy.string=WVr;function TAo(t){return typeof t=="number"||t instanceof Number}a(TAo,"number");jy.number=TAo;function IAo(t){return t instanceof Error}a(IAo,"error");jy.error=IAo;function xAo(t){return typeof t=="function"}a(xAo,"func");jy.func=xAo;function zVr(t){return Array.isArray(t)}a(zVr,"array");jy.array=zVr;function wAo(t){return zVr(t)&&t.every(e=>WVr(e))}a(wAo,"stringArray");jy.stringArray=wAo});var L2t=I(pi=>{"use strict";p();Object.defineProperty(pi,"__esModule",{value:!0});pi.Message=pi.NotificationType9=pi.NotificationType8=pi.NotificationType7=pi.NotificationType6=pi.NotificationType5=pi.NotificationType4=pi.NotificationType3=pi.NotificationType2=pi.NotificationType1=pi.NotificationType0=pi.NotificationType=pi.RequestType9=pi.RequestType8=pi.RequestType7=pi.RequestType6=pi.RequestType5=pi.RequestType4=pi.RequestType3=pi.RequestType2=pi.RequestType1=pi.RequestType=pi.RequestType0=pi.AbstractMessageSignature=pi.ParameterStructures=pi.ResponseError=pi.ErrorCodes=void 0;var qW=ese(),f2t;(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})(f2t||(pi.ErrorCodes=f2t={}));var p2t=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=qW.number(e)?e:f2t.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}};pi.ResponseError=p2t;var uC=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}};pi.ParameterStructures=uC;uC.auto=new uC("auto");uC.byPosition=new uC("byPosition");uC.byName=new uC("byName");var Hu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return uC.auto}};pi.AbstractMessageSignature=Hu;var h2t=class extends Hu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};pi.RequestType0=h2t;var m2t=class extends Hu{static{a(this,"RequestType")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType=m2t;var g2t=class extends Hu{static{a(this,"RequestType1")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType1=g2t;var A2t=class extends Hu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};pi.RequestType2=A2t;var y2t=class extends Hu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};pi.RequestType3=y2t;var E2t=class extends Hu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};pi.RequestType4=E2t;var _2t=class extends Hu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};pi.RequestType5=_2t;var v2t=class extends Hu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};pi.RequestType6=v2t;var C2t=class extends Hu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};pi.RequestType7=C2t;var b2t=class extends Hu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};pi.RequestType8=b2t;var S2t=class extends Hu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};pi.RequestType9=S2t;var T2t=class extends Hu{static{a(this,"NotificationType")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType=T2t;var I2t=class extends Hu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};pi.NotificationType0=I2t;var x2t=class extends Hu{static{a(this,"NotificationType1")}constructor(e,r=uC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType1=x2t;var w2t=class extends Hu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};pi.NotificationType2=w2t;var R2t=class extends Hu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};pi.NotificationType3=R2t;var k2t=class extends Hu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};pi.NotificationType4=k2t;var P2t=class extends Hu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};pi.NotificationType5=P2t;var D2t=class extends Hu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};pi.NotificationType6=D2t;var N2t=class extends Hu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};pi.NotificationType7=N2t;var M2t=class extends Hu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};pi.NotificationType8=M2t;var O2t=class extends Hu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};pi.NotificationType9=O2t;var YVr;(function(t){function e(o){let s=o;return s&&qW.string(s.method)&&(qW.string(s.id)||qW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&qW.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)&&(qW.string(s.id)||qW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(YVr||(pi.Message=YVr={}))});var F2t=I(xU=>{"use strict";p();var KVr;Object.defineProperty(xU,"__esModule",{value:!0});xU.LRUCache=xU.LinkedMap=xU.Touch=void 0;var Hy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Hy||(xU.Touch=Hy={}));var vUe=class{static{a(this,"LinkedMap")}constructor(){this[KVr]="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=Hy.None){let n=this._map.get(e);if(n)return r!==Hy.None&&this.touch(n,r),n.value}set(e,r,n=Hy.None){let o=this._map.get(e);if(o)o.value=r,n!==Hy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Hy.None:this.addItemLast(o);break;case Hy.First:this.addItemFirst(o);break;case Hy.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}[(KVr=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!==Hy.First&&r!==Hy.Last)){if(r===Hy.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===Hy.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)}};xU.LinkedMap=vUe;var B2t=class extends vUe{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=Hy.AsNew){return super.get(e,r)}peek(e){return super.get(e,Hy.None)}set(e,r){return super.set(e,r,Hy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};xU.LRUCache=B2t});var ZVr=I(CUe=>{"use strict";p();Object.defineProperty(CUe,"__esModule",{value:!0});CUe.Disposable=void 0;var JVr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(JVr||(CUe.Disposable=JVr={}))});var wU=I(q2t=>{"use strict";p();Object.defineProperty(q2t,"__esModule",{value:!0});var U2t;function Q2t(){if(U2t===void 0)throw new Error("No runtime abstraction layer installed");return U2t}a(Q2t,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");U2t=r}a(e,"install"),t.install=e})(Q2t||(Q2t={}));q2t.default=Q2t});var rse=I(tse=>{"use strict";p();Object.defineProperty(tse,"__esModule",{value:!0});tse.Emitter=tse.Event=void 0;var RAo=wU(),XVr;(function(t){let e={dispose(){}};t.None=function(){return e}})(XVr||(tse.Event=XVr={}));var j2t=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 j2t),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)}};tse.Emitter=bUe;bUe._noop=function(){}});var IUe=I(nse=>{"use strict";p();Object.defineProperty(nse,"__esModule",{value:!0});nse.CancellationTokenSource=nse.CancellationToken=void 0;var kAo=wU(),PAo=ese(),H2t=rse(),SUe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:H2t.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:H2t.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||PAo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(SUe||(nse.CancellationToken=SUe={}));var DAo=Object.freeze(function(t,e){let r=(0,kAo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),TUe=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?DAo:(this._emitter||(this._emitter=new H2t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},G2t=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new TUe),this._token}cancel(){this._token?this._token.cancel():this._token=SUe.Cancelled}dispose(){this._token?this._token instanceof TUe&&this._token.dispose():this._token=SUe.None}};nse.CancellationTokenSource=G2t});var eWr=I(ise=>{"use strict";p();Object.defineProperty(ise,"__esModule",{value:!0});ise.SharedArrayReceiverStrategy=ise.SharedArraySenderStrategy=void 0;var NAo=IUe(),JCe;(function(t){t.Continue=0,t.Cancelled=1})(JCe||(JCe={}));var $2t=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]=JCe.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,JCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};ise.SharedArraySenderStrategy=$2t;var V2t=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===JCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},W2t=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new V2t(e)}cancel(){}dispose(){}},z2t=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new NAo.CancellationTokenSource:new W2t(r)}};ise.SharedArrayReceiverStrategy=z2t});var K2t=I(xUe=>{"use strict";p();Object.defineProperty(xUe,"__esModule",{value:!0});xUe.Semaphore=void 0;var MAo=wU(),Y2t=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,MAo.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()}}};xUe.Semaphore=Y2t});var rWr=I(RU=>{"use strict";p();Object.defineProperty(RU,"__esModule",{value:!0});RU.ReadableStreamMessageReader=RU.AbstractMessageReader=RU.MessageReader=void 0;var Z2t=wU(),ose=ese(),J2t=rse(),OAo=K2t(),tWr;(function(t){function e(r){let n=r;return n&&ose.func(n.listen)&&ose.func(n.dispose)&&ose.func(n.onError)&&ose.func(n.onClose)&&ose.func(n.onPartialMessage)}a(e,"is"),t.is=e})(tWr||(RU.MessageReader=tWr={}));var wUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new J2t.Emitter,this.closeEmitter=new J2t.Emitter,this.partialMessageEmitter=new J2t.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: ${ose.string(e.message)?e.message:"unknown"}`)}};RU.AbstractMessageReader=wUe;var X2t;(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,Z2t.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(X2t||(X2t={}));var eDt=class extends wUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=X2t.fromOptions(r),this.buffer=(0,Z2t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new OAo.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,Z2t.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))}};RU.ReadableStreamMessageReader=eDt});var aWr=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.WriteableStreamMessageWriter=kU.AbstractMessageWriter=kU.MessageWriter=void 0;var nWr=wU(),ZCe=ese(),LAo=K2t(),iWr=rse(),BAo="Content-Length: ",oWr=`\r +`,sWr;(function(t){function e(r){let n=r;return n&&ZCe.func(n.dispose)&&ZCe.func(n.onClose)&&ZCe.func(n.onError)&&ZCe.func(n.write)}a(e,"is"),t.is=e})(sWr||(kU.MessageWriter=sWr={}));var RUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new iWr.Emitter,this.closeEmitter=new iWr.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: ${ZCe.string(e.message)?e.message:"unknown"}`)}};kU.AbstractMessageWriter=RUe;var tDt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,nWr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,nWr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(tDt||(tDt={}));var rDt=class extends RUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=tDt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new LAo.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(BAo,n.byteLength.toString(),oWr),o.push(oWr),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()}};kU.WriteableStreamMessageWriter=rDt});var cWr=I(kUe=>{"use strict";p();Object.defineProperty(kUe,"__esModule",{value:!0});kUe.AbstractMessageBuffer=void 0;var FAo=13,UAo=10,QAo=`\r +`,nDt=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}};kUe.AbstractMessageBuffer=nDt});var pWr=I(Lo=>{"use strict";p();Object.defineProperty(Lo,"__esModule",{value:!0});Lo.createMessageConnection=Lo.ConnectionOptions=Lo.MessageStrategy=Lo.CancellationStrategy=Lo.CancellationSenderStrategy=Lo.CancellationReceiverStrategy=Lo.RequestCancellationReceiverStrategy=Lo.IdCancellationReceiverStrategy=Lo.ConnectionStrategy=Lo.ConnectionError=Lo.ConnectionErrors=Lo.LogTraceNotification=Lo.SetTraceNotification=Lo.TraceFormat=Lo.TraceValues=Lo.Trace=Lo.NullLogger=Lo.ProgressType=Lo.ProgressToken=void 0;var lWr=wU(),df=ese(),Vi=L2t(),uWr=F2t(),XCe=rse(),iDt=IUe(),rbe;(function(t){t.type=new Vi.NotificationType("$/cancelRequest")})(rbe||(rbe={}));var oDt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(oDt||(Lo.ProgressToken=oDt={}));var ebe;(function(t){t.type=new Vi.NotificationType("$/progress")})(ebe||(ebe={}));var sDt=class{static{a(this,"ProgressType")}constructor(){}};Lo.ProgressType=sDt;var aDt;(function(t){function e(r){return df.func(r)}a(e,"is"),t.is=e})(aDt||(aDt={}));Lo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var bc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(bc||(Lo.Trace=bc={}));var dWr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(dWr||(Lo.TraceValues=dWr={}));(function(t){function e(n){if(!df.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})(bc||(Lo.Trace=bc={}));var G1;(function(t){t.Text="text",t.JSON="json"})(G1||(Lo.TraceFormat=G1={}));(function(t){function e(r){return df.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(G1||(Lo.TraceFormat=G1={}));var cDt;(function(t){t.type=new Vi.NotificationType("$/setTrace")})(cDt||(Lo.SetTraceNotification=cDt={}));var PUe;(function(t){t.type=new Vi.NotificationType("$/logTrace")})(PUe||(Lo.LogTraceNotification=PUe={}));var tbe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(tbe||(Lo.ConnectionErrors=tbe={}));var sse=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Lo.ConnectionError=sse;var lDt;(function(t){function e(r){let n=r;return n&&df.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(lDt||(Lo.ConnectionStrategy=lDt={}));var DUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&df.func(n.createCancellationTokenSource)&&(n.dispose===void 0||df.func(n.dispose))}a(e,"is"),t.is=e})(DUe||(Lo.IdCancellationReceiverStrategy=DUe={}));var uDt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&df.func(n.createCancellationTokenSource)&&(n.dispose===void 0||df.func(n.dispose))}a(e,"is"),t.is=e})(uDt||(Lo.RequestCancellationReceiverStrategy=uDt={}));var NUe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new iDt.CancellationTokenSource}});function e(r){return DUe.is(r)||uDt.is(r)}a(e,"is"),t.is=e})(NUe||(Lo.CancellationReceiverStrategy=NUe={}));var MUe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(rbe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&df.func(n.sendCancellation)&&df.func(n.cleanup)}a(e,"is"),t.is=e})(MUe||(Lo.CancellationSenderStrategy=MUe={}));var OUe;(function(t){t.Message=Object.freeze({receiver:NUe.Message,sender:MUe.Message});function e(r){let n=r;return n&&NUe.is(n.receiver)&&MUe.is(n.sender)}a(e,"is"),t.is=e})(OUe||(Lo.CancellationStrategy=OUe={}));var LUe;(function(t){function e(r){let n=r;return n&&df.func(n.handleMessage)}a(e,"is"),t.is=e})(LUe||(Lo.MessageStrategy=LUe={}));var fWr;(function(t){function e(r){let n=r;return n&&(OUe.is(n.cancellationStrategy)||lDt.is(n.connectionStrategy)||LUe.is(n.messageStrategy))}a(e,"is"),t.is=e})(fWr||(Lo.ConnectionOptions=fWr={}));var Wk;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Wk||(Wk={}));function qAo(t,e,r,n){let o=r!==void 0?r:Lo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new uWr.LinkedMap,E=new Map,_=new Set,v=new Map,b=bc.Off,T=G1.Text,w,R=Wk.New,x=new XCe.Emitter,P=new XCe.Emitter,D=new XCe.Emitter,N=new XCe.Emitter,L=new XCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:OUe.Message;function q(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(q,"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 j(Ie,F){Vi.Message.isRequest(F)?Ie.set(q(F.id),F):Vi.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(j,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===Wk.Listening}a(U,"isListening");function Y(){return R===Wk.Closed}a(Y,"isClosed");function W(){return R===Wk.Disposed}a(W,"isDisposed");function V(){(R===Wk.New||R===Wk.Listening)&&(R=Wk.Closed,P.fire(void 0))}a(V,"closeHandler");function z(Ie){x.fire([Ie,void 0,void 0])}a(z,"readErrorHandler");function ie(Ie){x.fire(Ie)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,lWr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(Ie){Vi.Message.isRequest(Ie)?ge(Ie):Vi.Message.isNotification(Ie)?ke(Ie):Vi.Message.isResponse(Ie)?Ue(Ie):X(Ie)}a(re,"handleMessage");function le(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;LUe.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(le,"processMessageQueue");let Le=a(Ie=>{try{if(Vi.Message.isNotification(Ie)&&Ie.method===rbe.type.method){let F=Ie.params.id,be=q(F),Qe=y.get(be);if(Vi.Message.isRequest(Qe)){let Se=n?.connectionStrategy,Fe=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Qe,Q):void 0;if(Fe&&(Fe.error!==void 0||Fe.result!==void 0)){y.delete(be),v.delete(F),Fe.id=Qe.id,Z(Fe,Ie.method,Date.now()),e.write(Fe).catch(()=>o.error("Sending response for canceled message failed."));return}}let pe=v.get(F);if(pe!==void 0){pe.cancel(),qe(Ie);return}else _.add(F)}j(y,Ie)}finally{H()}},"callback");function ge(Ie){if(W())return;function F(Te,Ge,J){let se={jsonrpc:u,id:Ie.id};Te instanceof Vi.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,J){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Qe(Te,Ge,J){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),ue(Ie);let pe=f.get(Ie.method),Se,Fe;pe&&(Se=pe.type,Fe=pe.handler);let te=Date.now();if(Fe||d){let Te=Ie.id??String(Date.now()),Ge=DUe.is(B.receiver)?B.receiver.createCancellationTokenSource(Te):B.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let J;if(Fe)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}J=Fe(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byName){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}J=Fe(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byPosition){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}J=Fe(Ie.params,Ge.token)}else d&&(J=d(Ie.method,Ie.params,Ge.token));let se=J;J?se.then?se.then(me=>{v.delete(Te),F(me,Ie.method,te)},me=>{v.delete(Te),me instanceof Vi.ResponseError?be(me,Ie.method,te):me&&df.string(me.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${me.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(J,Ie.method,te)):(v.delete(Te),Qe(J,Ie.method,te))}catch(J){v.delete(Te),J instanceof Vi.ResponseError?F(J,Ie.method,te):J&&df.string(J.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${J.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new Vi.ResponseError(Vi.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ge,"handleRequest");function Ue(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(ne(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Qe=Ie.error;be.reject(new Vi.ResponseError(Qe.code,Qe.message,Qe.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${be.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Ue,"handleResponse");function ke(Ie){if(W())return;let F,be;if(Ie.method===rbe.type.method){let Qe=Ie.params.id;_.delete(Qe),qe(Ie);return}else{let Qe=m.get(Ie.method);Qe&&(be=Qe.handler,F=Qe.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Qe=Ie.params;Ie.method===ebe.type.method&&Qe.length===2&&oDt.is(Qe[0])?be({token:Qe[0],value:Qe[1]}):(F!==void 0&&(F.parameterStructures===Vi.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 ${Qe.length} arguments`)),be(...Qe))}else F!==void 0&&F.parameterStructures===Vi.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(Qe){Qe.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(ke,"handleNotification");function X(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(df.string(F.id)||df.number(F.id)){let be=F.id,Qe=E.get(be);Qe&&Qe.reject(new Error("The received response has neither a result nor an error property."))}}a(X,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case bc.Verbose:return JSON.stringify(Ie,null,4);case bc.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} `),w.log(`Sending request '${Ie.method} - (${Ie.id})'.`,F)}else ce("send-request",Ie)}a(K,"traceSendingRequest");function he(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} @@ -26,7 +26,7 @@ ${JSON.stringify(Ie,null,4)}`);let F=Ie;if(lf.string(F.id)||lf.number(F.id)){let `)),w.log(`Sending response '${F} - (${Ie.id})'. Processing request took ${Date.now()-be}ms`,Qe)}else ce("send-response",Ie)}a(Z,"traceSendingResponse");function ue(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} -`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else ce("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===bc.Off||!w||Ie.method===IUe.type.method))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} +`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else ce("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===bc.Off||!w||Ie.method===PUe.type.method))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} `:F=`No parameters provided. @@ -36,58 +36,58 @@ ${JSON.stringify(Ie,null,4)}`);let F=Ie;if(lf.string(F.id)||lf.number(F.id)){let `:Ie.error===void 0&&(be=`No result returned. -`)),F){let Qe=Ie.error?` Request failed: ${Ie.error.message} (${Ie.error.code}).`:"";w.log(`Received response '${F.method} - (${Ie.id})' in ${Date.now()-F.timerStart}ms.${Qe}`,be)}else w.log(`Received response ${Ie.id} without active response promise.`,be)}else ce("receive-response",Ie)}a(ne,"traceReceivedResponse");function ce(Ie,F){if(!w||b===bc.Off)return;let be={isLSPMessage:!0,type:Ie,message:F,timestamp:Date.now()};w.log(be)}a(ce,"logLSPMessage");function Ne(){if(Y())throw new ose(ZCe.Closed,"Connection is closed.");if(W())throw new ose(ZCe.Disposed,"Connection is disposed.")}a(Ne,"throwIfClosedOrDisposed");function we(){if(U())throw new ose(ZCe.AlreadyListening,"Connection is already listening")}a(we,"throwIfListening");function Be(){if(!U())throw new Error("Call listen() first.")}a(Be,"throwIfNotListening");function rt(Ie){return Ie===void 0?null:Ie}a(rt,"undefinedToNull");function st(Ie){if(Ie!==null)return Ie}a(st,"nullToUndefined");function _t(Ie){return Ie!=null&&!Array.isArray(Ie)&&typeof Ie=="object"}a(_t,"isNamedParam");function Dt(Ie,F){switch(Ie){case Vi.ParameterStructures.auto:return _t(F)?st(F):[rt(F)];case Vi.ParameterStructures.byName:if(!_t(F))throw new Error("Received parameters by name but param is not an object literal.");return st(F);case Vi.ParameterStructures.byPosition:return[rt(F)];default:throw new Error(`Unknown parameter structure ${Ie.toString()}`)}}a(Dt,"computeSingleParam");function $t(Ie,F){let be,Qe=Ie.numberOfParams;switch(Qe){case 0:be=void 0;break;case 1:be=Dt(Ie.parameterStructures,F[0]);break;default:be=[];for(let pe=0;pe{Ne();let be,Qe;if(lf.string(Ie)){be=Ie;let Se=F[0],Fe=0,te=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Se)&&(Fe=1,te=Se);let Te=F.length,Ge=Te-Fe;switch(Ge){case 0:Qe=void 0;break;case 1:Qe=Dt(te,F[Fe]);break;default:if(te===Vi.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Qe=F.slice(Fe,Te).map(J=>rt(J));break}}else{let Se=F;be=Ie.method,Qe=$t(Ie,Se)}let pe={jsonrpc:u,method:be,params:Qe};return he(pe),e.write(pe).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return lf.func(Ie)?h=Ie:F&&(lf.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)=>Gt.sendNotification(JCe.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Be();let be,Qe,pe;if(lf.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],J=0,se=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Te)&&(J=1,se=Te);let me=F.length;eDt.CancellationToken.is(Ge)&&(me=me-1,pe=Ge);let Ce=me-J;switch(Ce){case 0:Qe=void 0;break;case 1:Qe=Dt(se,F[J]);break;default:if(se===Vi.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Qe=F.slice(J,me).map(He=>rt(He));break}}else{let Te=F;be=Ie.method,Qe=$t(Ie,Te);let Ge=Ie.numberOfParams;pe=eDt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Fe;pe&&(Fe=pe.onCancellationRequested(()=>{let Te=B.sender.sendCancellation(Gt,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:Qe};return K(te),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let J=a(Ce=>{Te(Ce),B.sender.cleanup(Se),Fe?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),B.sender.cleanup(Se),Fe?.dispose()},"rejectWithCleanup"),me={method:be,timerStart:Date.now(),resolve:J,reject:se};try{await e.write(te),E.set(Se,me)}catch(Ce){throw o.error("Sending request failed."),me.reject(new Vi.ResponseError(Vi.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return nDt.is(Ie)?(be=void 0,d=Ie):lf.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 Qe=!1,pe=G1.Text;be!==void 0&&(lf.boolean(be)?Qe=be:(Qe=be.sendNotification||!1,pe=be.traceFormat||G1.Text)),b=Ie,T=pe,b===bc.Off?w=void 0:w=F,Qe&&!Y()&&!W()&&await Gt.sendNotification(iDt.type,{value:bc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=$k.Disposed,L.fire(void 0);let Ie=new Vi.ResponseError(Vi.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 oWr.LinkedMap,lf.func(e.dispose)&&e.dispose(),lf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=$k.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,iWr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(IUe.type,Ie=>{if(b===bc.Off||!w)return;let F=b===bc.Verbose||b===bc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),Gt.onNotification(JCe.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),Gt}a(PAo,"createMessageConnection");Oo.createMessageConnection=PAo});var DUe=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 cu=D2t();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return cu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return cu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return cu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return cu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return cu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return cu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return cu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return cu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return cu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return cu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return cu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return cu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return cu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return cu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return cu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return cu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return cu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return cu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return cu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return cu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return cu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return cu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return cu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return cu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return cu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return cu.ParameterStructures},"get")});var aDt=M2t();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return aDt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return aDt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return aDt.Touch},"get")});var DAo=WVr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return DAo.Disposable},"get")});var lWr=tse();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return lWr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return lWr.Emitter},"get")});var uWr=vUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return uWr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return uWr.CancellationToken},"get")});var dWr=YVr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return dWr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return dWr.SharedArrayReceiverStrategy},"get")});var cDt=JVr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return cDt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return cDt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return cDt.ReadableStreamMessageReader},"get")});var lDt=rWr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return lDt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return lDt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return lDt.WriteableStreamMessageWriter},"get")});var NAo=nWr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return NAo.AbstractMessageBuffer},"get")});var gA=cWr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return gA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return gA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return gA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return gA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return gA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return gA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return gA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return gA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return gA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return gA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return gA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return gA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return gA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return gA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return gA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return gA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return gA.MessageStrategy},"get")});var MAo=IU();Bt.RAL=MAo.default});var hWr=I(pDt=>{"use strict";p();Object.defineProperty(pDt,"__esModule",{value:!0});var fWr=require("util"),_B=DUe(),NUe=class t extends _B.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 fWr.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)}};NUe.emptyBuffer=Buffer.allocUnsafe(0);var uDt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),_B.Disposable.create(()=>this.stream.off("data",e))}},dDt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.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()}},pWr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new NUe(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 fWr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new uDt(t),"asReadableStream"),asWritableStream:a(t=>new dDt(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 fDt(){return pWr}a(fDt,"RIL");(function(t){function e(){_B.RAL.install(pWr)}a(e,"install"),t.install=e})(fDt||(fDt={}));pDt.default=fDt});var QW=I(xa=>{"use strict";p();var OAo=xa&&xa.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LAo=xa&&xa.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OAo(e,t,r)};Object.defineProperty(xa,"__esModule",{value:!0});xa.createMessageConnection=xa.createServerSocketTransport=xa.createClientSocketTransport=xa.createServerPipeTransport=xa.createClientPipeTransport=xa.generateRandomPipeName=xa.StreamMessageWriter=xa.StreamMessageReader=xa.SocketMessageWriter=xa.SocketMessageReader=xa.PortMessageWriter=xa.PortMessageReader=xa.IPCMessageWriter=xa.IPCMessageReader=void 0;var sse=hWr();sse.default.install();var mWr=require("path"),BAo=require("os"),FAo=require("crypto"),LUe=require("net"),$1=DUe();LAo(DUe(),xa);var hDt=class extends $1.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),$1.Disposable.create(()=>this.process.off("message",e))}};xa.IPCMessageReader=hDt;var mDt=class extends $1.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(){}};xa.IPCMessageWriter=mDt;var gDt=class extends $1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new $1.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)}};xa.PortMessageReader=gDt;var ADt=class extends $1.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(){}};xa.PortMessageWriter=ADt;var FW=class extends $1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,sse.default)().stream.asReadableStream(e),r)}};xa.SocketMessageReader=FW;var UW=class extends $1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};xa.SocketMessageWriter=UW;var MUe=class extends $1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,sse.default)().stream.asReadableStream(e),r)}};xa.StreamMessageReader=MUe;var OUe=class extends $1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r)}};xa.StreamMessageWriter=OUe;var gWr=process.env.XDG_RUNTIME_DIR,UAo=new Map([["linux",107],["darwin",103]]);function QAo(){let t=(0,FAo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gWr?e=mWr.join(gWr,`vscode-ipc-${t}.sock`):e=mWr.join(BAo.tmpdir(),`vscode-${t}.sock`);let r=UAo.get(process.platform);return r!==void 0&&e.length>r&&(0,sse.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(QAo,"generateRandomPipeName");xa.generateRandomPipeName=QAo;function qAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,LUe.createServer)(l=>{c.close(),r([new FW(l,e),new UW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(qAo,"createClientPipeTransport");xa.createClientPipeTransport=qAo;function jAo(t,e="utf-8"){let r=(0,LUe.createConnection)(t);return[new FW(r,e),new UW(r,e)]}a(jAo,"createServerPipeTransport");xa.createServerPipeTransport=jAo;function HAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,LUe.createServer)(l=>{c.close(),r([new FW(l,e),new UW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(HAo,"createClientSocketTransport");xa.createClientSocketTransport=HAo;function GAo(t,e="utf-8"){let r=(0,LUe.createConnection)(t,"127.0.0.1");return[new FW(r,e),new UW(r,e)]}a(GAo,"createServerSocketTransport");xa.createServerSocketTransport=GAo;function $Ao(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a($Ao,"isReadableStream");function VAo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(VAo,"isWritableStream");function WAo(t,e,r,n){r||(r=$1.NullLogger);let o=$Ao(t)?new MUe(t):t,s=VAo(e)?new OUe(e):e;return $1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,$1.createMessageConnection)(o,s,r,n)}a(WAo,"createMessageConnection");xa.createMessageConnection=WAo});var yDt=I((MIl,AWr)=>{"use strict";p();AWr.exports=QW()});var ebe=I((yWr,BUe)=>{p();(function(t){if(typeof BUe=="object"&&typeof BUe.exports=="object"){var e=t(require,yWr);e!==void 0&&(BUe.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(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(n||(e.URI=n={}));var o;(function(ae){ae.MIN_VALUE=-2147483648,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(o||(e.integer=o={}));var s;(function(ae){ae.MIN_VALUE=0,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(s||(e.uinteger=s={}));var c;(function(ae){function Re(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ae.is=Me})(c||(e.Position=c={}));var l;(function(ae){function Re(ye,oe,ze,at){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ye,oe),end:c.create(ze,at)};if(c.is(ye)&&c.is(oe))return{start:ye,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ye,", ").concat(oe,", ").concat(ze,", ").concat(at,"]"))}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ae.is=Me})(l||(e.Range=l={}));var u;(function(ae){function Re(ye,oe){return{uri:ye,range:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ae.is=Me})(u||(e.Location=u={}));var d;(function(ae){function Re(ye,oe,ze,at){return{targetUri:ye,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(d||(e.LocationLink=d={}));var f;(function(ae){function Re(ye,oe,ze,at){return{red:ye,green:oe,blue:ze,alpha:at}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(f||(e.Color=f={}));var h;(function(ae){function Re(ye,oe){return{range:ye,color:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ae.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ae){function Re(ye,oe,ze){return{label:ye,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ae){ae.Comment="comment",ae.Imports="imports",ae.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={startLine:ye,endLine:oe};return We.defined(ze)&&(cr.startCharacter=ze),We.defined(at)&&(cr.endCharacter=at),We.defined(Vt)&&(cr.kind=Vt),We.defined(gr)&&(cr.collapsedText=gr),cr}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ae){function Re(ye,oe){return{location:ye,message:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ae.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ae){ae.Error=1,ae.Warning=2,ae.Information=3,ae.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ae){ae.Unnecessary=1,ae.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Re,"is"),ae.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={range:ye,message:oe};return We.defined(ze)&&(cr.severity=ze),We.defined(at)&&(cr.code=at),We.defined(Vt)&&(cr.source=Vt),We.defined(gr)&&(cr.relatedInformation=gr),cr}a(Re,"create"),ae.create=Re;function Me(ye){var oe,ze=ye;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"),ae.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ae){function Re(ye,oe){for(var ze=[],at=2;at0&&(Vt.arguments=ze),Vt}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ae.is=Me})(T||(e.Command=T={}));var w;(function(ae){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ae.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ae.insert=Me;function ye(ze){return{range:ze,newText:""}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ae.is=oe})(w||(e.TextEdit=w={}));var R;(function(ae){function Re(ye,oe,ze){var at={label:ye};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ae){function Re(Me){var ye=Me;return We.string(ye)}a(Re,"is"),ae.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ae){function Re(ze,at,Vt){return{range:ze,newText:at,annotationId:Vt}}a(Re,"replace"),ae.replace=Re;function Me(ze,at,Vt){return{range:{start:ze,end:ze},newText:at,annotationId:Vt}}a(Me,"insert"),ae.insert=Me;function ye(ze,at){return{range:ze,newText:"",annotationId:at}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ae.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ae){function Re(ye,oe){return{textDocument:ye,edits:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ae.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ae){function Re(ye,oe,ze){var at={kind:"create",uri:ye};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"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(N||(e.CreateFile=N={}));var L;(function(ae){function Re(ye,oe,ze,at){var Vt={kind:"rename",oldUri:ye,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&(Vt.options=ze),at!==void 0&&(Vt.annotationId=at),Vt}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(L||(e.RenameFile=L={}));var B;(function(ae){function Re(ye,oe,ze){var at={kind:"delete",uri:ye};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"),ae.create=Re;function Me(ye){var oe=ye;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"),ae.is=Me})(B||(e.DeleteFile=B={}));var q;(function(ae){function Re(Me){var ye=Me;return ye&&(ye.changes!==void 0||ye.documentChanges!==void 0)&&(ye.documentChanges===void 0||ye.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Re,"is"),ae.is=Re})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ae(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ae,"TextEditChangeImpl"),ae.prototype.insert=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.insert(Re,Me):x.is(ye)?(ze=ye,oe=P.insert(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.replace=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.replace(Re,Me):x.is(ye)?(ze=ye,oe=P.replace(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.delete=function(Re,Me){var ye,oe;if(Me===void 0?ye=w.del(Re):x.is(Me)?(oe=Me,ye=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=P.del(Re,oe)),this.edits.push(ye),oe!==void 0)return oe},ae.prototype.add=function(Re){this.edits.push(Re)},ae.prototype.all=function(){return this.edits},ae.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ae.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ae})(),O=(function(){function ae(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ae,"ChangeAnnotations"),ae.prototype.all=function(){return this._annotations},Object.defineProperty(ae.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ae.prototype.manage=function(Re,Me){var ye;if(x.is(Re)?ye=Re:(ye=this.nextId(),Me=Re),this._annotations[ye]!==void 0)throw new Error("Id ".concat(ye," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ye));return this._annotations[ye]=Me,this._size++,ye},ae.prototype.nextId=function(){return this._counter++,this._counter.toString()},ae})(),j=(function(){function ae(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(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ye){var oe=new M(Re.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ae,"WorkspaceChange"),Object.defineProperty(ae.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}),ae.prototype.getTextEditChange=function(Re){if(Y.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},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),ye=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ye}return ye}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ye=this._textEditChanges[Re];if(!ye){var oe=[];this._workspaceEdit.changes[Re]=oe,ye=new M(oe),this._textEditChanges[Re]=ye}return ye}},ae.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())},ae.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ae.prototype.createFile=function(Re,Me,ye){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:ye=Me;var ze,at;if(oe===void 0?ze=N.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae.prototype.renameFile=function(Re,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ye)||x.is(ye)?ze=ye:oe=ye;var at,Vt;if(ze===void 0?at=L.create(Re,Me,oe):(Vt=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=L.create(Re,Me,oe,Vt)),this._workspaceEdit.documentChanges.push(at),Vt!==void 0)return Vt},ae.prototype.deleteFile=function(Re,Me,ye){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:ye=Me;var ze,at;if(oe===void 0?ze=B.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=B.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae})();e.WorkspaceChange=j;var Q;(function(ae){function Re(ye){return{uri:ye}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ae.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ae.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var Y;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ae.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ae){function Re(ye,oe,ze,at){return{uri:ye,languageId:oe,version:ze,text:at}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ae.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ae){ae.PlainText="plaintext",ae.Markdown="markdown";function Re(Me){var ye=Me;return ye===ae.PlainText||ye===ae.Markdown}a(Re,"is"),ae.is=Re})(V||(e.MarkupKind=V={}));var z;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Re,"is"),ae.is=Re})(z||(e.MarkupContent=z={}));var ie;(function(ae){ae.Text=1,ae.Method=2,ae.Function=3,ae.Constructor=4,ae.Field=5,ae.Variable=6,ae.Class=7,ae.Interface=8,ae.Module=9,ae.Property=10,ae.Unit=11,ae.Value=12,ae.Enum=13,ae.Keyword=14,ae.Snippet=15,ae.Color=16,ae.File=17,ae.Reference=18,ae.Folder=19,ae.EnumMember=20,ae.Constant=21,ae.Struct=22,ae.Event=23,ae.Operator=24,ae.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ae){ae.PlainText=1,ae.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ae){ae.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ae){function Re(ye,oe,ze){return{newText:ye,insert:oe,replace:ze}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ae.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ae){ae.asIs=1,ae.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var ge;(function(ae){function Re(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Re,"is"),ae.is=Re})(ge||(e.CompletionItemLabelDetails=ge={}));var Ue;(function(ae){function Re(Me){return{label:Me}}a(Re,"create"),ae.create=Re})(Ue||(e.CompletionItem=Ue={}));var ke;(function(ae){function Re(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Re,"create"),ae.create=Re})(ke||(e.CompletionList=ke={}));var X;(function(ae){function Re(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ae.fromPlainText=Re;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ae.is=Me})(X||(e.MarkedString=X={}));var ee;(function(ae){function Re(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||X.is(ye.contents)||We.typedArray(ye.contents,X.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ae.is=Re})(ee||(e.Hover=ee={}));var K;(function(ae){function Re(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Re,"create"),ae.create=Re})(K||(e.ParameterInformation=K={}));var he;(function(ae){function Re(Me,ye){for(var oe=[],ze=2;ze{Me();let be,Qe;if(df.string(Ie)){be=Ie;let Se=F[0],Fe=0,te=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Se)&&(Fe=1,te=Se);let Te=F.length,Ge=Te-Fe;switch(Ge){case 0:Qe=void 0;break;case 1:Qe=Dt(te,F[Fe]);break;default:if(te===Vi.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Qe=F.slice(Fe,Te).map(J=>rt(J));break}}else{let Se=F;be=Ie.method,Qe=$t(Ie,Se)}let pe={jsonrpc:u,method:be,params:Qe};return he(pe),e.write(pe).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Me();let be;return df.func(Ie)?h=Ie:F&&(df.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)=>Gt.sendNotification(ebe.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Me(),Be();let be,Qe,pe;if(df.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],J=0,se=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Te)&&(J=1,se=Te);let me=F.length;iDt.CancellationToken.is(Ge)&&(me=me-1,pe=Ge);let Ce=me-J;switch(Ce){case 0:Qe=void 0;break;case 1:Qe=Dt(se,F[J]);break;default:if(se===Vi.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Qe=F.slice(J,me).map(He=>rt(He));break}}else{let Te=F;be=Ie.method,Qe=$t(Ie,Te);let Ge=Ie.numberOfParams;pe=iDt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Fe;pe&&(Fe=pe.onCancellationRequested(()=>{let Te=B.sender.sendCancellation(Gt,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:Qe};return K(te),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let J=a(Ce=>{Te(Ce),B.sender.cleanup(Se),Fe?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),B.sender.cleanup(Se),Fe?.dispose()},"rejectWithCleanup"),me={method:be,timerStart:Date.now(),resolve:J,reject:se};try{await e.write(te),E.set(Se,me)}catch(Ce){throw o.error("Sending request failed."),me.reject(new Vi.ResponseError(Vi.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Me();let be=null;return aDt.is(Ie)?(be=void 0,d=Ie):df.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 Qe=!1,pe=G1.Text;be!==void 0&&(df.boolean(be)?Qe=be:(Qe=be.sendNotification||!1,pe=be.traceFormat||G1.Text)),b=Ie,T=pe,b===bc.Off?w=void 0:w=F,Qe&&!Y()&&!W()&&await Gt.sendNotification(cDt.type,{value:bc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=Wk.Disposed,L.fire(void 0);let Ie=new Vi.ResponseError(Vi.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 uWr.LinkedMap,df.func(e.dispose)&&e.dispose(),df.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Me(),we(),R=Wk.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,lWr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(PUe.type,Ie=>{if(b===bc.Off||!w)return;let F=b===bc.Verbose||b===bc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),Gt.onNotification(ebe.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),Gt}a(qAo,"createMessageConnection");Lo.createMessageConnection=qAo});var BUe=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 cu=L2t();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return cu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return cu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return cu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return cu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return cu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return cu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return cu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return cu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return cu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return cu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return cu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return cu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return cu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return cu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return cu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return cu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return cu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return cu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return cu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return cu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return cu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return cu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return cu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return cu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return cu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return cu.ParameterStructures},"get")});var dDt=F2t();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return dDt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return dDt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return dDt.Touch},"get")});var jAo=ZVr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return jAo.Disposable},"get")});var hWr=rse();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return hWr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return hWr.Emitter},"get")});var mWr=IUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return mWr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return mWr.CancellationToken},"get")});var gWr=eWr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return gWr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return gWr.SharedArrayReceiverStrategy},"get")});var fDt=rWr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return fDt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return fDt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return fDt.ReadableStreamMessageReader},"get")});var pDt=aWr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return pDt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return pDt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return pDt.WriteableStreamMessageWriter},"get")});var HAo=cWr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return HAo.AbstractMessageBuffer},"get")});var AA=pWr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return AA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return AA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return AA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return AA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return AA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return AA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return AA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return AA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return AA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return AA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return AA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return AA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return AA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return AA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return AA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return AA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return AA.MessageStrategy},"get")});var GAo=wU();Bt.RAL=GAo.default});var EWr=I(ADt=>{"use strict";p();Object.defineProperty(ADt,"__esModule",{value:!0});var AWr=require("util"),vB=BUe(),FUe=class t extends vB.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 AWr.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)}};FUe.emptyBuffer=Buffer.allocUnsafe(0);var hDt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),vB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),vB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),vB.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),vB.Disposable.create(()=>this.stream.off("data",e))}},mDt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),vB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),vB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),vB.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()}},yWr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new FUe(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 AWr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new hDt(t),"asReadableStream"),asWritableStream:a(t=>new mDt(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 gDt(){return yWr}a(gDt,"RIL");(function(t){function e(){vB.RAL.install(yWr)}a(e,"install"),t.install=e})(gDt||(gDt={}));ADt.default=gDt});var GW=I(wa=>{"use strict";p();var $Ao=wa&&wa.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VAo=wa&&wa.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Ao(e,t,r)};Object.defineProperty(wa,"__esModule",{value:!0});wa.createMessageConnection=wa.createServerSocketTransport=wa.createClientSocketTransport=wa.createServerPipeTransport=wa.createClientPipeTransport=wa.generateRandomPipeName=wa.StreamMessageWriter=wa.StreamMessageReader=wa.SocketMessageWriter=wa.SocketMessageReader=wa.PortMessageWriter=wa.PortMessageReader=wa.IPCMessageWriter=wa.IPCMessageReader=void 0;var ase=EWr();ase.default.install();var _Wr=require("path"),WAo=require("os"),zAo=require("crypto"),qUe=require("net"),$1=BUe();VAo(BUe(),wa);var yDt=class extends $1.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),$1.Disposable.create(()=>this.process.off("message",e))}};wa.IPCMessageReader=yDt;var EDt=class extends $1.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(){}};wa.IPCMessageWriter=EDt;var _Dt=class extends $1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new $1.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)}};wa.PortMessageReader=_Dt;var vDt=class extends $1.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(){}};wa.PortMessageWriter=vDt;var jW=class extends $1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,ase.default)().stream.asReadableStream(e),r)}};wa.SocketMessageReader=jW;var HW=class extends $1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,ase.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};wa.SocketMessageWriter=HW;var UUe=class extends $1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,ase.default)().stream.asReadableStream(e),r)}};wa.StreamMessageReader=UUe;var QUe=class extends $1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,ase.default)().stream.asWritableStream(e),r)}};wa.StreamMessageWriter=QUe;var vWr=process.env.XDG_RUNTIME_DIR,YAo=new Map([["linux",107],["darwin",103]]);function KAo(){let t=(0,zAo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;vWr?e=_Wr.join(vWr,`vscode-ipc-${t}.sock`):e=_Wr.join(WAo.tmpdir(),`vscode-${t}.sock`);let r=YAo.get(process.platform);return r!==void 0&&e.length>r&&(0,ase.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(KAo,"generateRandomPipeName");wa.generateRandomPipeName=KAo;function JAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,qUe.createServer)(l=>{c.close(),r([new jW(l,e),new HW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(JAo,"createClientPipeTransport");wa.createClientPipeTransport=JAo;function ZAo(t,e="utf-8"){let r=(0,qUe.createConnection)(t);return[new jW(r,e),new HW(r,e)]}a(ZAo,"createServerPipeTransport");wa.createServerPipeTransport=ZAo;function XAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,qUe.createServer)(l=>{c.close(),r([new jW(l,e),new HW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(XAo,"createClientSocketTransport");wa.createClientSocketTransport=XAo;function eyo(t,e="utf-8"){let r=(0,qUe.createConnection)(t,"127.0.0.1");return[new jW(r,e),new HW(r,e)]}a(eyo,"createServerSocketTransport");wa.createServerSocketTransport=eyo;function tyo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(tyo,"isReadableStream");function ryo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(ryo,"isWritableStream");function nyo(t,e,r,n){r||(r=$1.NullLogger);let o=tyo(t)?new UUe(t):t,s=ryo(e)?new QUe(e):e;return $1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,$1.createMessageConnection)(o,s,r,n)}a(nyo,"createMessageConnection");wa.createMessageConnection=nyo});var CDt=I((ZIl,CWr)=>{"use strict";p();CWr.exports=GW()});var nbe=I((bWr,jUe)=>{p();(function(t){if(typeof jUe=="object"&&typeof jUe.exports=="object"){var e=t(require,bWr);e!==void 0&&(jUe.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(ae){function Re(Oe){return typeof Oe=="string"}a(Re,"is"),ae.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ae){function Re(Oe){return typeof Oe=="string"}a(Re,"is"),ae.is=Re})(n||(e.URI=n={}));var o;(function(ae){ae.MIN_VALUE=-2147483648,ae.MAX_VALUE=2147483647;function Re(Oe){return typeof Oe=="number"&&ae.MIN_VALUE<=Oe&&Oe<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(o||(e.integer=o={}));var s;(function(ae){ae.MIN_VALUE=0,ae.MAX_VALUE=2147483647;function Re(Oe){return typeof Oe=="number"&&ae.MIN_VALUE<=Oe&&Oe<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(s||(e.uinteger=s={}));var c;(function(ae){function Re(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Oe,"is"),ae.is=Oe})(c||(e.Position=c={}));var l;(function(ae){function Re(ye,oe,ze,at){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ye,oe),end:c.create(ze,at)};if(c.is(ye)&&c.is(oe))return{start:ye,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ye,", ").concat(oe,", ").concat(ze,", ").concat(at,"]"))}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Oe,"is"),ae.is=Oe})(l||(e.Range=l={}));var u;(function(ae){function Re(ye,oe){return{uri:ye,range:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Oe,"is"),ae.is=Oe})(u||(e.Location=u={}));var d;(function(ae){function Re(ye,oe,ze,at){return{targetUri:ye,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(d||(e.LocationLink=d={}));var f;(function(ae){function Re(ye,oe,ze,at){return{red:ye,green:oe,blue:ze,alpha:at}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(f||(e.Color=f={}));var h;(function(ae){function Re(ye,oe){return{range:ye,color:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Oe,"is"),ae.is=Oe})(h||(e.ColorInformation=h={}));var m;(function(ae){function Re(ye,oe,ze){return{label:ye,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(m||(e.ColorPresentation=m={}));var g;(function(ae){ae.Comment="comment",ae.Imports="imports",ae.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={startLine:ye,endLine:oe};return We.defined(ze)&&(cr.startCharacter=ze),We.defined(at)&&(cr.endCharacter=at),We.defined(Vt)&&(cr.kind=Vt),We.defined(gr)&&(cr.collapsedText=gr),cr}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(A||(e.FoldingRange=A={}));var y;(function(ae){function Re(ye,oe){return{location:ye,message:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Oe,"is"),ae.is=Oe})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ae){ae.Error=1,ae.Warning=2,ae.Information=3,ae.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ae){ae.Unnecessary=1,ae.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ae){function Re(Oe){var ye=Oe;return We.objectLiteral(ye)&&We.string(ye.href)}a(Re,"is"),ae.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={range:ye,message:oe};return We.defined(ze)&&(cr.severity=ze),We.defined(at)&&(cr.code=at),We.defined(Vt)&&(cr.source=Vt),We.defined(gr)&&(cr.relatedInformation=gr),cr}a(Re,"create"),ae.create=Re;function Oe(ye){var oe,ze=ye;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(Oe,"is"),ae.is=Oe})(b||(e.Diagnostic=b={}));var T;(function(ae){function Re(ye,oe){for(var ze=[],at=2;at0&&(Vt.arguments=ze),Vt}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Oe,"is"),ae.is=Oe})(T||(e.Command=T={}));var w;(function(ae){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ae.replace=Re;function Oe(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Oe,"insert"),ae.insert=Oe;function ye(ze){return{range:ze,newText:""}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ae.is=oe})(w||(e.TextEdit=w={}));var R;(function(ae){function Re(ye,oe,ze){var at={label:ye};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(R||(e.ChangeAnnotation=R={}));var x;(function(ae){function Re(Oe){var ye=Oe;return We.string(ye)}a(Re,"is"),ae.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ae){function Re(ze,at,Vt){return{range:ze,newText:at,annotationId:Vt}}a(Re,"replace"),ae.replace=Re;function Oe(ze,at,Vt){return{range:{start:ze,end:ze},newText:at,annotationId:Vt}}a(Oe,"insert"),ae.insert=Oe;function ye(ze,at){return{range:ze,newText:"",annotationId:at}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ae.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ae){function Re(ye,oe){return{textDocument:ye,edits:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Oe,"is"),ae.is=Oe})(D||(e.TextDocumentEdit=D={}));var N;(function(ae){function Re(ye,oe,ze){var at={kind:"create",uri:ye};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"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(N||(e.CreateFile=N={}));var L;(function(ae){function Re(ye,oe,ze,at){var Vt={kind:"rename",oldUri:ye,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&(Vt.options=ze),at!==void 0&&(Vt.annotationId=at),Vt}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(L||(e.RenameFile=L={}));var B;(function(ae){function Re(ye,oe,ze){var at={kind:"delete",uri:ye};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"),ae.create=Re;function Oe(ye){var oe=ye;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(Oe,"is"),ae.is=Oe})(B||(e.DeleteFile=B={}));var q;(function(ae){function Re(Oe){var ye=Oe;return ye&&(ye.changes!==void 0||ye.documentChanges!==void 0)&&(ye.documentChanges===void 0||ye.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Re,"is"),ae.is=Re})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ae(Re,Oe){this.edits=Re,this.changeAnnotations=Oe}return a(ae,"TextEditChangeImpl"),ae.prototype.insert=function(Re,Oe,ye){var oe,ze;if(ye===void 0?oe=w.insert(Re,Oe):x.is(ye)?(ze=ye,oe=P.insert(Re,Oe,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.insert(Re,Oe,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.replace=function(Re,Oe,ye){var oe,ze;if(ye===void 0?oe=w.replace(Re,Oe):x.is(ye)?(ze=ye,oe=P.replace(Re,Oe,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.replace(Re,Oe,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.delete=function(Re,Oe){var ye,oe;if(Oe===void 0?ye=w.del(Re):x.is(Oe)?(oe=Oe,ye=P.del(Re,Oe)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Oe),ye=P.del(Re,oe)),this.edits.push(ye),oe!==void 0)return oe},ae.prototype.add=function(Re){this.edits.push(Re)},ae.prototype.all=function(){return this.edits},ae.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ae.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ae})(),O=(function(){function ae(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ae,"ChangeAnnotations"),ae.prototype.all=function(){return this._annotations},Object.defineProperty(ae.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ae.prototype.manage=function(Re,Oe){var ye;if(x.is(Re)?ye=Re:(ye=this.nextId(),Oe=Re),this._annotations[ye]!==void 0)throw new Error("Id ".concat(ye," is already in use."));if(Oe===void 0)throw new Error("No annotation provided for id ".concat(ye));return this._annotations[ye]=Oe,this._size++,ye},ae.prototype.nextId=function(){return this._counter++,this._counter.toString()},ae})(),j=(function(){function ae(Re){var Oe=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(ye){if(D.is(ye)){var oe=new M(ye.edits,Oe._changeAnnotations);Oe._textEditChanges[ye.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ye){var oe=new M(Re.changes[ye]);Oe._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ae,"WorkspaceChange"),Object.defineProperty(ae.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}),ae.prototype.getTextEditChange=function(Re){if(Y.is(Re)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Oe={uri:Re.uri,version:Re.version},ye=this._textEditChanges[Oe.uri];if(!ye){var oe=[],ze={textDocument:Oe,edits:oe};this._workspaceEdit.documentChanges.push(ze),ye=new M(oe,this._changeAnnotations),this._textEditChanges[Oe.uri]=ye}return ye}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ye=this._textEditChanges[Re];if(!ye){var oe=[];this._workspaceEdit.changes[Re]=oe,ye=new M(oe),this._textEditChanges[Re]=ye}return ye}},ae.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())},ae.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ae.prototype.createFile=function(Re,Oe,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Oe)||x.is(Oe)?oe=Oe:ye=Oe;var ze,at;if(oe===void 0?ze=N.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae.prototype.renameFile=function(Re,Oe,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ye)||x.is(ye)?ze=ye:oe=ye;var at,Vt;if(ze===void 0?at=L.create(Re,Oe,oe):(Vt=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=L.create(Re,Oe,oe,Vt)),this._workspaceEdit.documentChanges.push(at),Vt!==void 0)return Vt},ae.prototype.deleteFile=function(Re,Oe,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Oe)||x.is(Oe)?oe=Oe:ye=Oe;var ze,at;if(oe===void 0?ze=B.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=B.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae})();e.WorkspaceChange=j;var Q;(function(ae){function Re(ye){return{uri:ye}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Oe,"is"),ae.is=Oe})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Oe,"is"),ae.is=Oe})(U||(e.VersionedTextDocumentIdentifier=U={}));var Y;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Oe,"is"),ae.is=Oe})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ae){function Re(ye,oe,ze,at){return{uri:ye,languageId:oe,version:ze,text:at}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Oe,"is"),ae.is=Oe})(W||(e.TextDocumentItem=W={}));var V;(function(ae){ae.PlainText="plaintext",ae.Markdown="markdown";function Re(Oe){var ye=Oe;return ye===ae.PlainText||ye===ae.Markdown}a(Re,"is"),ae.is=Re})(V||(e.MarkupKind=V={}));var z;(function(ae){function Re(Oe){var ye=Oe;return We.objectLiteral(Oe)&&V.is(ye.kind)&&We.string(ye.value)}a(Re,"is"),ae.is=Re})(z||(e.MarkupContent=z={}));var ie;(function(ae){ae.Text=1,ae.Method=2,ae.Function=3,ae.Constructor=4,ae.Field=5,ae.Variable=6,ae.Class=7,ae.Interface=8,ae.Module=9,ae.Property=10,ae.Unit=11,ae.Value=12,ae.Enum=13,ae.Keyword=14,ae.Snippet=15,ae.Color=16,ae.File=17,ae.Reference=18,ae.Folder=19,ae.EnumMember=20,ae.Constant=21,ae.Struct=22,ae.Event=23,ae.Operator=24,ae.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ae){ae.PlainText=1,ae.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ae){ae.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ae){function Re(ye,oe,ze){return{newText:ye,insert:oe,replace:ze}}a(Re,"create"),ae.create=Re;function Oe(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Oe,"is"),ae.is=Oe})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ae){ae.asIs=1,ae.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var ge;(function(ae){function Re(Oe){var ye=Oe;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Re,"is"),ae.is=Re})(ge||(e.CompletionItemLabelDetails=ge={}));var Ue;(function(ae){function Re(Oe){return{label:Oe}}a(Re,"create"),ae.create=Re})(Ue||(e.CompletionItem=Ue={}));var ke;(function(ae){function Re(Oe,ye){return{items:Oe||[],isIncomplete:!!ye}}a(Re,"create"),ae.create=Re})(ke||(e.CompletionList=ke={}));var X;(function(ae){function Re(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ae.fromPlainText=Re;function Oe(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Oe,"is"),ae.is=Oe})(X||(e.MarkedString=X={}));var ee;(function(ae){function Re(Oe){var ye=Oe;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||X.is(ye.contents)||We.typedArray(ye.contents,X.is))&&(Oe.range===void 0||l.is(Oe.range))}a(Re,"is"),ae.is=Re})(ee||(e.Hover=ee={}));var K;(function(ae){function Re(Oe,ye){return ye?{label:Oe,documentation:ye}:{label:Oe}}a(Re,"create"),ae.create=Re})(K||(e.ParameterInformation=K={}));var he;(function(ae){function Re(Oe,ye){for(var oe=[],ze=2;ze=0;Mr--){var Hr=gr[Mr],Gr=ze.offsetAt(Hr.range.start),Yt=ze.offsetAt(Hr.range.end);if(Yt<=cr)Vt=Vt.substring(0,Gr)+Hr.newText+Vt.substring(Yt,Vt.length);else throw new Error("Overlapping edit");cr=Gr}return Vt}a(ye,"applyEdits"),ae.applyEdits=ye;function oe(ze,at){if(ze.length<=1)return ze;var Vt=ze.length/2|0,gr=ze.slice(0,Vt),cr=ze.slice(Vt);oe(gr,at),oe(cr,at);for(var Mr=0,Hr=0,Gr=0;Mr0&&Re.push(Me.length),this._lineOffsets=Re}return this._lineOffsets},ae.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;yeRe?oe=ze:ye=ze+1}var at=ye-1;return c.create(at,Re-Me[at])},ae.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var ye=Me[Re.line],oe=Re.line+1"u"}a(ye,"undefined"),ae.undefined=ye;function oe(Yt){return Yt===!0||Yt===!1}a(oe,"boolean"),ae.boolean=oe;function ze(Yt){return Re.call(Yt)==="[object String]"}a(ze,"string"),ae.string=ze;function at(Yt){return Re.call(Yt)==="[object Number]"}a(at,"number"),ae.number=at;function Vt(Yt,_r,$0){return Re.call(Yt)==="[object Number]"&&_r<=Yt&&Yt<=$0}a(Vt,"numberRange"),ae.numberRange=Vt;function gr(Yt){return Re.call(Yt)==="[object Number]"&&-2147483648<=Yt&&Yt<=2147483647}a(gr,"integer"),ae.integer=gr;function cr(Yt){return Re.call(Yt)==="[object Number]"&&0<=Yt&&Yt<=2147483647}a(cr,"uinteger"),ae.uinteger=cr;function Mr(Yt){return Re.call(Yt)==="[object Function]"}a(Mr,"func"),ae.func=Mr;function Hr(Yt){return Yt!==null&&typeof Yt=="object"}a(Hr,"objectLiteral"),ae.objectLiteral=Hr;function Gr(Yt,_r){return Array.isArray(Yt)&&Yt.every(_r)}a(Gr,"typedArray"),ae.typedArray=Gr})(We||(We={}))})});var Pd=I(uC=>{"use strict";p();Object.defineProperty(uC,"__esModule",{value:!0});uC.ProtocolNotificationType=uC.ProtocolNotificationType0=uC.ProtocolRequestType=uC.ProtocolRequestType0=uC.RegistrationType=uC.MessageDirection=void 0;var ase=QW(),EWr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(EWr||(uC.MessageDirection=EWr={}));var EDt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};uC.RegistrationType=EDt;var _Dt=class extends ase.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};uC.ProtocolRequestType0=_Dt;var vDt=class extends ase.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,ase.ParameterStructures.byName)}};uC.ProtocolRequestType=vDt;var CDt=class extends ase.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};uC.ProtocolNotificationType0=CDt;var bDt=class extends ase.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,ase.ParameterStructures.byName)}};uC.ProtocolNotificationType=bDt});var FUe=I(wh=>{"use strict";p();Object.defineProperty(wh,"__esModule",{value:!0});wh.objectLiteral=wh.typedArray=wh.stringArray=wh.array=wh.func=wh.error=wh.number=wh.string=wh.boolean=void 0;function zAo(t){return t===!0||t===!1}a(zAo,"boolean");wh.boolean=zAo;function _Wr(t){return typeof t=="string"||t instanceof String}a(_Wr,"string");wh.string=_Wr;function YAo(t){return typeof t=="number"||t instanceof Number}a(YAo,"number");wh.number=YAo;function KAo(t){return t instanceof Error}a(KAo,"error");wh.error=KAo;function JAo(t){return typeof t=="function"}a(JAo,"func");wh.func=JAo;function vWr(t){return Array.isArray(t)}a(vWr,"array");wh.array=vWr;function ZAo(t){return vWr(t)&&t.every(e=>_Wr(e))}a(ZAo,"stringArray");wh.stringArray=ZAo;function XAo(t,e){return Array.isArray(t)&&t.every(e)}a(XAo,"typedArray");wh.typedArray=XAo;function eyo(t){return t!==null&&typeof t=="object"}a(eyo,"objectLiteral");wh.objectLiteral=eyo});var SWr=I(UUe=>{"use strict";p();Object.defineProperty(UUe,"__esModule",{value:!0});UUe.ImplementationRequest=void 0;var CWr=Pd(),bWr;(function(t){t.method="textDocument/implementation",t.messageDirection=CWr.MessageDirection.clientToServer,t.type=new CWr.ProtocolRequestType(t.method)})(bWr||(UUe.ImplementationRequest=bWr={}))});var xWr=I(QUe=>{"use strict";p();Object.defineProperty(QUe,"__esModule",{value:!0});QUe.TypeDefinitionRequest=void 0;var TWr=Pd(),IWr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=TWr.MessageDirection.clientToServer,t.type=new TWr.ProtocolRequestType(t.method)})(IWr||(QUe.TypeDefinitionRequest=IWr={}))});var kWr=I(cse=>{"use strict";p();Object.defineProperty(cse,"__esModule",{value:!0});cse.DidChangeWorkspaceFoldersNotification=cse.WorkspaceFoldersRequest=void 0;var qUe=Pd(),wWr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=qUe.MessageDirection.serverToClient,t.type=new qUe.ProtocolRequestType0(t.method)})(wWr||(cse.WorkspaceFoldersRequest=wWr={}));var RWr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=qUe.MessageDirection.clientToServer,t.type=new qUe.ProtocolNotificationType(t.method)})(RWr||(cse.DidChangeWorkspaceFoldersNotification=RWr={}))});var NWr=I(jUe=>{"use strict";p();Object.defineProperty(jUe,"__esModule",{value:!0});jUe.ConfigurationRequest=void 0;var PWr=Pd(),DWr;(function(t){t.method="workspace/configuration",t.messageDirection=PWr.MessageDirection.serverToClient,t.type=new PWr.ProtocolRequestType(t.method)})(DWr||(jUe.ConfigurationRequest=DWr={}))});var LWr=I(lse=>{"use strict";p();Object.defineProperty(lse,"__esModule",{value:!0});lse.ColorPresentationRequest=lse.DocumentColorRequest=void 0;var HUe=Pd(),MWr;(function(t){t.method="textDocument/documentColor",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolRequestType(t.method)})(MWr||(lse.DocumentColorRequest=MWr={}));var OWr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolRequestType(t.method)})(OWr||(lse.ColorPresentationRequest=OWr={}))});var UWr=I(use=>{"use strict";p();Object.defineProperty(use,"__esModule",{value:!0});use.FoldingRangeRefreshRequest=use.FoldingRangeRequest=void 0;var GUe=Pd(),BWr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=GUe.MessageDirection.clientToServer,t.type=new GUe.ProtocolRequestType(t.method)})(BWr||(use.FoldingRangeRequest=BWr={}));var FWr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=GUe.MessageDirection.serverToClient,t.type=new GUe.ProtocolRequestType0(t.method)})(FWr||(use.FoldingRangeRefreshRequest=FWr={}))});var jWr=I($Ue=>{"use strict";p();Object.defineProperty($Ue,"__esModule",{value:!0});$Ue.DeclarationRequest=void 0;var QWr=Pd(),qWr;(function(t){t.method="textDocument/declaration",t.messageDirection=QWr.MessageDirection.clientToServer,t.type=new QWr.ProtocolRequestType(t.method)})(qWr||($Ue.DeclarationRequest=qWr={}))});var $Wr=I(VUe=>{"use strict";p();Object.defineProperty(VUe,"__esModule",{value:!0});VUe.SelectionRangeRequest=void 0;var HWr=Pd(),GWr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=HWr.MessageDirection.clientToServer,t.type=new HWr.ProtocolRequestType(t.method)})(GWr||(VUe.SelectionRangeRequest=GWr={}))});var YWr=I(RU=>{"use strict";p();Object.defineProperty(RU,"__esModule",{value:!0});RU.WorkDoneProgressCancelNotification=RU.WorkDoneProgressCreateRequest=RU.WorkDoneProgress=void 0;var tyo=QW(),WUe=Pd(),VWr;(function(t){t.type=new tyo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(VWr||(RU.WorkDoneProgress=VWr={}));var WWr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=WUe.MessageDirection.serverToClient,t.type=new WUe.ProtocolRequestType(t.method)})(WWr||(RU.WorkDoneProgressCreateRequest=WWr={}));var zWr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=WUe.MessageDirection.clientToServer,t.type=new WUe.ProtocolNotificationType(t.method)})(zWr||(RU.WorkDoneProgressCancelNotification=zWr={}))});var XWr=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.CallHierarchyOutgoingCallsRequest=kU.CallHierarchyIncomingCallsRequest=kU.CallHierarchyPrepareRequest=void 0;var dse=Pd(),KWr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(KWr||(kU.CallHierarchyPrepareRequest=KWr={}));var JWr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(JWr||(kU.CallHierarchyIncomingCallsRequest=JWr={}));var ZWr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(ZWr||(kU.CallHierarchyOutgoingCallsRequest=ZWr={}))});var ozr=I(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});dC.SemanticTokensRefreshRequest=dC.SemanticTokensRangeRequest=dC.SemanticTokensDeltaRequest=dC.SemanticTokensRequest=dC.SemanticTokensRegistrationType=dC.TokenFormat=void 0;var vB=Pd(),ezr;(function(t){t.Relative="relative"})(ezr||(dC.TokenFormat=ezr={}));var tbe;(function(t){t.method="textDocument/semanticTokens",t.type=new vB.RegistrationType(t.method)})(tbe||(dC.SemanticTokensRegistrationType=tbe={}));var tzr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(tzr||(dC.SemanticTokensRequest=tzr={}));var rzr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(rzr||(dC.SemanticTokensDeltaRequest=rzr={}));var nzr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(nzr||(dC.SemanticTokensRangeRequest=nzr={}));var izr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=vB.MessageDirection.serverToClient,t.type=new vB.ProtocolRequestType0(t.method)})(izr||(dC.SemanticTokensRefreshRequest=izr={}))});var czr=I(zUe=>{"use strict";p();Object.defineProperty(zUe,"__esModule",{value:!0});zUe.ShowDocumentRequest=void 0;var szr=Pd(),azr;(function(t){t.method="window/showDocument",t.messageDirection=szr.MessageDirection.serverToClient,t.type=new szr.ProtocolRequestType(t.method)})(azr||(zUe.ShowDocumentRequest=azr={}))});var dzr=I(YUe=>{"use strict";p();Object.defineProperty(YUe,"__esModule",{value:!0});YUe.LinkedEditingRangeRequest=void 0;var lzr=Pd(),uzr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=lzr.MessageDirection.clientToServer,t.type=new lzr.ProtocolRequestType(t.method)})(uzr||(YUe.LinkedEditingRangeRequest=uzr={}))});var Ezr=I(Hy=>{"use strict";p();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.WillDeleteFilesRequest=Hy.DidDeleteFilesNotification=Hy.DidRenameFilesNotification=Hy.WillRenameFilesRequest=Hy.DidCreateFilesNotification=Hy.WillCreateFilesRequest=Hy.FileOperationPatternKind=void 0;var YI=Pd(),fzr;(function(t){t.file="file",t.folder="folder"})(fzr||(Hy.FileOperationPatternKind=fzr={}));var pzr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(pzr||(Hy.WillCreateFilesRequest=pzr={}));var hzr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(hzr||(Hy.DidCreateFilesNotification=hzr={}));var mzr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(mzr||(Hy.WillRenameFilesRequest=mzr={}));var gzr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(gzr||(Hy.DidRenameFilesNotification=gzr={}));var Azr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(Azr||(Hy.DidDeleteFilesNotification=Azr={}));var yzr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(yzr||(Hy.WillDeleteFilesRequest=yzr={}))});var Szr=I(PU=>{"use strict";p();Object.defineProperty(PU,"__esModule",{value:!0});PU.MonikerRequest=PU.MonikerKind=PU.UniquenessLevel=void 0;var _zr=Pd(),vzr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(vzr||(PU.UniquenessLevel=vzr={}));var Czr;(function(t){t.$import="import",t.$export="export",t.local="local"})(Czr||(PU.MonikerKind=Czr={}));var bzr;(function(t){t.method="textDocument/moniker",t.messageDirection=_zr.MessageDirection.clientToServer,t.type=new _zr.ProtocolRequestType(t.method)})(bzr||(PU.MonikerRequest=bzr={}))});var wzr=I(DU=>{"use strict";p();Object.defineProperty(DU,"__esModule",{value:!0});DU.TypeHierarchySubtypesRequest=DU.TypeHierarchySupertypesRequest=DU.TypeHierarchyPrepareRequest=void 0;var fse=Pd(),Tzr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Tzr||(DU.TypeHierarchyPrepareRequest=Tzr={}));var Izr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Izr||(DU.TypeHierarchySupertypesRequest=Izr={}));var xzr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(xzr||(DU.TypeHierarchySubtypesRequest=xzr={}))});var Pzr=I(pse=>{"use strict";p();Object.defineProperty(pse,"__esModule",{value:!0});pse.InlineValueRefreshRequest=pse.InlineValueRequest=void 0;var KUe=Pd(),Rzr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=KUe.MessageDirection.clientToServer,t.type=new KUe.ProtocolRequestType(t.method)})(Rzr||(pse.InlineValueRequest=Rzr={}));var kzr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=KUe.MessageDirection.serverToClient,t.type=new KUe.ProtocolRequestType0(t.method)})(kzr||(pse.InlineValueRefreshRequest=kzr={}))});var Ozr=I(NU=>{"use strict";p();Object.defineProperty(NU,"__esModule",{value:!0});NU.InlayHintRefreshRequest=NU.InlayHintResolveRequest=NU.InlayHintRequest=void 0;var hse=Pd(),Dzr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Dzr||(NU.InlayHintRequest=Dzr={}));var Nzr;(function(t){t.method="inlayHint/resolve",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Nzr||(NU.InlayHintResolveRequest=Nzr={}));var Mzr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=hse.MessageDirection.serverToClient,t.type=new hse.ProtocolRequestType0(t.method)})(Mzr||(NU.InlayHintRefreshRequest=Mzr={}))});var jzr=I(KI=>{"use strict";p();Object.defineProperty(KI,"__esModule",{value:!0});KI.DiagnosticRefreshRequest=KI.WorkspaceDiagnosticRequest=KI.DocumentDiagnosticRequest=KI.DocumentDiagnosticReportKind=KI.DiagnosticServerCancellationData=void 0;var qzr=QW(),ryo=FUe(),mse=Pd(),Lzr;(function(t){function e(r){let n=r;return n&&ryo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(Lzr||(KI.DiagnosticServerCancellationData=Lzr={}));var Bzr;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bzr||(KI.DocumentDiagnosticReportKind=Bzr={}));var Fzr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new qzr.ProgressType})(Fzr||(KI.DocumentDiagnosticRequest=Fzr={}));var Uzr;(function(t){t.method="workspace/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new qzr.ProgressType})(Uzr||(KI.WorkspaceDiagnosticRequest=Uzr={}));var Qzr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=mse.MessageDirection.serverToClient,t.type=new mse.ProtocolRequestType0(t.method)})(Qzr||(KI.DiagnosticRefreshRequest=Qzr={}))});var Yzr=I(Hf=>{"use strict";p();Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DidCloseNotebookDocumentNotification=Hf.DidSaveNotebookDocumentNotification=Hf.DidChangeNotebookDocumentNotification=Hf.NotebookCellArrayChange=Hf.DidOpenNotebookDocumentNotification=Hf.NotebookDocumentSyncRegistrationType=Hf.NotebookDocument=Hf.NotebookCell=Hf.ExecutionSummary=Hf.NotebookCellKind=void 0;var rbe=ebe(),Vk=FUe(),iM=Pd(),SDt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(SDt||(Hf.NotebookCellKind=SDt={}));var TDt;(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 Vk.objectLiteral(s)&&rbe.uinteger.is(s.executionOrder)&&(s.success===void 0||Vk.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})(TDt||(Hf.ExecutionSummary=TDt={}));var JUe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return Vk.objectLiteral(c)&&SDt.is(c.kind)&&rbe.DocumentUri.is(c.document)&&(c.metadata===void 0||Vk.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)&&!TDt.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(ZUe,"__esModule",{value:!0});ZUe.InlineCompletionRequest=void 0;var Kzr=Pd(),Jzr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Kzr.MessageDirection.clientToServer,t.type=new Kzr.ProtocolRequestType(t.method)})(Jzr||(ZUe.InlineCompletionRequest=Jzr={}))});var dKr=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=Pd(),Xzr=ebe(),Z0=FUe(),nyo=SWr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return nyo.ImplementationRequest},"get")});var iyo=xWr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return iyo.TypeDefinitionRequest},"get")});var aKr=kWr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return aKr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return aKr.DidChangeWorkspaceFoldersNotification},"get")});var oyo=NWr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return oyo.ConfigurationRequest},"get")});var cKr=LWr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return cKr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return cKr.ColorPresentationRequest},"get")});var lKr=UWr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return lKr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return lKr.FoldingRangeRefreshRequest},"get")});var syo=jWr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return syo.DeclarationRequest},"get")});var ayo=$Wr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return ayo.SelectionRangeRequest},"get")});var kDt=YWr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgressCancelNotification},"get")});var PDt=XWr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyPrepareRequest},"get")});var Ase=ozr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return Ase.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRegistrationType},"get")});var cyo=czr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return cyo.ShowDocumentRequest},"get")});var lyo=dzr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return lyo.LinkedEditingRangeRequest},"get")});var qW=Ezr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return qW.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return qW.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return qW.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return qW.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return qW.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return qW.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return qW.WillDeleteFilesRequest},"get")});var DDt=Szr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return DDt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return DDt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return DDt.MonikerRequest},"get")});var NDt=wzr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchySupertypesRequest},"get")});var uKr=Pzr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return uKr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return uKr.InlineValueRefreshRequest},"get")});var MDt=Ozr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintRefreshRequest},"get")});var nbe=jzr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return nbe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return nbe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return nbe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return nbe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return nbe.DiagnosticRefreshRequest},"get")});var oM=Yzr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return oM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return oM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return oM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return oM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return oM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return oM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidCloseNotebookDocumentNotification},"get")});var uyo=Zzr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return uyo.InlineCompletionRequest},"get")});var IDt;(function(t){function e(r){let n=r;return Z0.string(n)||Z0.string(n.language)||Z0.string(n.scheme)||Z0.string(n.pattern)}a(e,"is"),t.is=e})(IDt||(Ve.TextDocumentFilter=IDt={}));var xDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebookType)||Z0.string(n.scheme)||Z0.string(n.pattern))}a(e,"is"),t.is=e})(xDt||(Ve.NotebookDocumentFilter=xDt={}));var wDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebook)||xDt.is(n.notebook))&&(n.language===void 0||Z0.string(n.language))}a(e,"is"),t.is=e})(wDt||(Ve.NotebookCellTextDocumentFilter=wDt={}));var RDt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Z0.string(n)&&!IDt.is(n)&&!wDt.is(n))return!1;return!0}a(e,"is"),t.is=e})(RDt||(Ve.DocumentSelector=RDt={}));var eYr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(eYr||(Ve.RegistrationRequest=eYr={}));var tYr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(tYr||(Ve.UnregistrationRequest=tYr={}));var rYr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(rYr||(Ve.ResourceOperationKind=rYr={}));var nYr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nYr||(Ve.FailureHandlingKind=nYr={}));var iYr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(iYr||(Ve.PositionEncodingKind=iYr={}));var oYr;(function(t){function e(r){let n=r;return n&&Z0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(oYr||(Ve.StaticRegistrationOptions=oYr={}));var sYr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||RDt.is(n.documentSelector))}a(e,"is"),t.is=e})(sYr||(Ve.TextDocumentRegistrationOptions=sYr={}));var aYr;(function(t){function e(n){let o=n;return Z0.objectLiteral(o)&&(o.workDoneProgress===void 0||Z0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Z0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(aYr||(Ve.WorkDoneProgressOptions=aYr={}));var cYr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cYr||(Ve.InitializeRequest=cYr={}));var lYr;(function(t){t.unknownProtocolVersion=1})(lYr||(Ve.InitializeErrorCodes=lYr={}));var uYr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(uYr||(Ve.InitializedNotification=uYr={}));var dYr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(dYr||(Ve.ShutdownRequest=dYr={}));var fYr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(fYr||(Ve.ExitNotification=fYr={}));var pYr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(pYr||(Ve.DidChangeConfigurationNotification=pYr={}));var hYr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(hYr||(Ve.MessageType=hYr={}));var mYr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(mYr||(Ve.ShowMessageNotification=mYr={}));var gYr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(gYr||(Ve.ShowMessageRequest=gYr={}));var AYr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(AYr||(Ve.LogMessageNotification=AYr={}));var yYr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(yYr||(Ve.TelemetryEventNotification=yYr={}));var EYr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(EYr||(Ve.TextDocumentSyncKind=EYr={}));var _Yr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(_Yr||(Ve.DidOpenTextDocumentNotification=_Yr={}));var vYr;(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})(vYr||(Ve.TextDocumentContentChangeEvent=vYr={}));var CYr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(CYr||(Ve.DidChangeTextDocumentNotification=CYr={}));var bYr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(bYr||(Ve.DidCloseTextDocumentNotification=bYr={}));var SYr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(SYr||(Ve.DidSaveTextDocumentNotification=SYr={}));var TYr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(TYr||(Ve.TextDocumentSaveReason=TYr={}));var IYr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(IYr||(Ve.WillSaveTextDocumentNotification=IYr={}));var xYr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(xYr||(Ve.WillSaveTextDocumentWaitUntilRequest=xYr={}));var wYr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(wYr||(Ve.DidChangeWatchedFilesNotification=wYr={}));var RYr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(RYr||(Ve.FileChangeType=RYr={}));var kYr;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Xzr.URI.is(n.baseUri)||Xzr.WorkspaceFolder.is(n.baseUri))&&Z0.string(n.pattern)}a(e,"is"),t.is=e})(kYr||(Ve.RelativePattern=kYr={}));var PYr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(PYr||(Ve.WatchKind=PYr={}));var DYr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(DYr||(Ve.PublishDiagnosticsNotification=DYr={}));var NYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(NYr||(Ve.CompletionTriggerKind=NYr={}));var MYr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(MYr||(Ve.CompletionRequest=MYr={}));var OYr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(OYr||(Ve.CompletionResolveRequest=OYr={}));var LYr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LYr||(Ve.HoverRequest=LYr={}));var BYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(BYr||(Ve.SignatureHelpTriggerKind=BYr={}));var FYr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(FYr||(Ve.SignatureHelpRequest=FYr={}));var UYr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(UYr||(Ve.DefinitionRequest=UYr={}));var QYr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QYr||(Ve.ReferencesRequest=QYr={}));var qYr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qYr||(Ve.DocumentHighlightRequest=qYr={}));var jYr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jYr||(Ve.DocumentSymbolRequest=jYr={}));var HYr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HYr||(Ve.CodeActionRequest=HYr={}));var GYr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GYr||(Ve.CodeActionResolveRequest=GYr={}));var $Yr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Yr||(Ve.WorkspaceSymbolRequest=$Yr={}));var VYr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(VYr||(Ve.WorkspaceSymbolResolveRequest=VYr={}));var WYr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WYr||(Ve.CodeLensRequest=WYr={}));var zYr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zYr||(Ve.CodeLensResolveRequest=zYr={}));var YYr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(YYr||(Ve.CodeLensRefreshRequest=YYr={}));var KYr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(KYr||(Ve.DocumentLinkRequest=KYr={}));var JYr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(JYr||(Ve.DocumentLinkResolveRequest=JYr={}));var ZYr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(ZYr||(Ve.DocumentFormattingRequest=ZYr={}));var XYr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(XYr||(Ve.DocumentRangeFormattingRequest=XYr={}));var eKr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(eKr||(Ve.DocumentRangesFormattingRequest=eKr={}));var tKr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tKr||(Ve.DocumentOnTypeFormattingRequest=tKr={}));var rKr;(function(t){t.Identifier=1})(rKr||(Ve.PrepareSupportDefaultBehavior=rKr={}));var nKr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(nKr||(Ve.RenameRequest=nKr={}));var iKr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iKr||(Ve.PrepareRenameRequest=iKr={}));var oKr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oKr||(Ve.ExecuteCommandRequest=oKr={}));var sKr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(sKr||(Ve.ApplyWorkspaceEditRequest=sKr={}))});var pKr=I(XUe=>{"use strict";p();Object.defineProperty(XUe,"__esModule",{value:!0});XUe.createProtocolConnection=void 0;var fKr=QW();function dyo(t,e,r,n){return fKr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fKr.createMessageConnection)(t,e,r,n)}a(dyo,"createProtocolConnection");XUe.createProtocolConnection=dyo});var mKr=I(fC=>{"use strict";p();var fyo=fC&&fC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e7e=fC&&fC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fyo(e,t,r)};Object.defineProperty(fC,"__esModule",{value:!0});fC.LSPErrorCodes=fC.createProtocolConnection=void 0;e7e(QW(),fC);e7e(ebe(),fC);e7e(Pd(),fC);e7e(dKr(),fC);var pyo=pKr();Object.defineProperty(fC,"createProtocolConnection",{enumerable:!0,get:a(function(){return pyo.createProtocolConnection},"get")});var hKr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(hKr||(fC.LSPErrorCodes=hKr={}))});var ri=I(sM=>{"use strict";p();var hyo=sM&&sM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gKr=sM&&sM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hyo(e,t,r)};Object.defineProperty(sM,"__esModule",{value:!0});sM.createProtocolConnection=void 0;var myo=yDt();gKr(yDt(),sM);gKr(mKr(),sM);function gyo(t,e,r,n){return(0,myo.createMessageConnection)(t,e,r,n)}a(gyo,"createProtocolConnection");sM.createProtocolConnection=gyo});var q5t=I(kje=>{"use strict";p();Object.defineProperty(kje,"__esModule",{value:!0});kje.state=void 0;kje.state={instrumenterImplementation:void 0}});var Tce=I((_Bt,_nn)=>{p();var kHe=require("buffer"),HM=kHe.Buffer;function Enn(t,e){for(var r in t)e[r]=t[r]}a(Enn,"copyProps");HM.from&&HM.alloc&&HM.allocUnsafe&&HM.allocUnsafeSlow?_nn.exports=kHe:(Enn(kHe,_Bt),_Bt.Buffer=vY);function vY(t,e,r){return HM(t,e,r)}a(vY,"SafeBuffer");vY.prototype=Object.create(HM.prototype);Enn(HM,vY);vY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return HM(t,e,r)};vY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=HM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return HM(t)};vY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return kHe.SlowBuffer(t)}});var vBt=I((ZJl,vnn)=>{p();var PHe=Tce().Buffer,PTo=require("stream"),DTo=require("util");function DHe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=PHe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=PHe.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(DHe,"DataStream");DTo.inherits(DHe,PTo);DHe.prototype.write=a(function(e){this.buffer=PHe.concat([this.buffer,PHe.from(e)]),this.emit("data",e)},"write");DHe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");vnn.exports=DHe});var bnn=I((tZl,Cnn)=>{"use strict";p();function CBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(CBt,"getParamSize");var NTo={ES256:CBt(256),ES384:CBt(384),ES512:CBt(521)};function MTo(t){var e=NTo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(MTo,"getParamBytesForAlg");Cnn.exports=MTo});var knn=I((iZl,Rnn)=>{"use strict";p();var NHe=Tce().Buffer,Tnn=bnn(),MHe=128,Inn=0,OTo=32,LTo=16,BTo=2,xnn=LTo|OTo|Inn<<6,OHe=BTo|Inn<<6;function FTo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(FTo,"base64Url");function wnn(t){if(NHe.isBuffer(t))return t;if(typeof t=="string")return NHe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(wnn,"signatureAsBuffer");function UTo(t,e){t=wnn(t);var r=Tnn(e),n=r+1,o=t.length,s=0;if(t[s++]!==xnn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(MHe|1)&&(c=t[s++]),o-s=MHe;return o&&--n,n}a(Snn,"countPadding");function QTo(t,e){t=wnn(t);var r=Tnn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Snn(t,0,r),s=Snn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var tTe=require("buffer").Buffer,bBt=require("buffer").SlowBuffer;Pnn.exports=LHe;function LHe(t,e){if(!tTe.isBuffer(t)||!tTe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var xce=Tce().Buffer,xx=require("crypto"),Mnn=knn(),Nnn=require("util"),HTo=`"%s" is not a valid algorithm. +`,"\r"];var Ct;(function(ae){function Re(ze,at,Vt,gr){return new ht(ze,at,Vt,gr)}a(Re,"create"),ae.create=Re;function Oe(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(Oe,"is"),ae.is=Oe;function ye(ze,at){for(var Vt=ze.getText(),gr=oe(at,function(_r,V0){var gQr=_r.range.start.line-V0.range.start.line;return gQr===0?_r.range.start.character-V0.range.start.character:gQr}),cr=Vt.length,Mr=gr.length-1;Mr>=0;Mr--){var Hr=gr[Mr],Gr=ze.offsetAt(Hr.range.start),Yt=ze.offsetAt(Hr.range.end);if(Yt<=cr)Vt=Vt.substring(0,Gr)+Hr.newText+Vt.substring(Yt,Vt.length);else throw new Error("Overlapping edit");cr=Gr}return Vt}a(ye,"applyEdits"),ae.applyEdits=ye;function oe(ze,at){if(ze.length<=1)return ze;var Vt=ze.length/2|0,gr=ze.slice(0,Vt),cr=ze.slice(Vt);oe(gr,at),oe(cr,at);for(var Mr=0,Hr=0,Gr=0;Mr0&&Re.push(Oe.length),this._lineOffsets=Re}return this._lineOffsets},ae.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Oe=this.getLineOffsets(),ye=0,oe=Oe.length;if(oe===0)return c.create(0,Re);for(;yeRe?oe=ze:ye=ze+1}var at=ye-1;return c.create(at,Re-Oe[at])},ae.prototype.offsetAt=function(Re){var Oe=this.getLineOffsets();if(Re.line>=Oe.length)return this._content.length;if(Re.line<0)return 0;var ye=Oe[Re.line],oe=Re.line+1"u"}a(ye,"undefined"),ae.undefined=ye;function oe(Yt){return Yt===!0||Yt===!1}a(oe,"boolean"),ae.boolean=oe;function ze(Yt){return Re.call(Yt)==="[object String]"}a(ze,"string"),ae.string=ze;function at(Yt){return Re.call(Yt)==="[object Number]"}a(at,"number"),ae.number=at;function Vt(Yt,_r,V0){return Re.call(Yt)==="[object Number]"&&_r<=Yt&&Yt<=V0}a(Vt,"numberRange"),ae.numberRange=Vt;function gr(Yt){return Re.call(Yt)==="[object Number]"&&-2147483648<=Yt&&Yt<=2147483647}a(gr,"integer"),ae.integer=gr;function cr(Yt){return Re.call(Yt)==="[object Number]"&&0<=Yt&&Yt<=2147483647}a(cr,"uinteger"),ae.uinteger=cr;function Mr(Yt){return Re.call(Yt)==="[object Function]"}a(Mr,"func"),ae.func=Mr;function Hr(Yt){return Yt!==null&&typeof Yt=="object"}a(Hr,"objectLiteral"),ae.objectLiteral=Hr;function Gr(Yt,_r){return Array.isArray(Yt)&&Yt.every(_r)}a(Gr,"typedArray"),ae.typedArray=Gr})(We||(We={}))})});var Nd=I(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});dC.ProtocolNotificationType=dC.ProtocolNotificationType0=dC.ProtocolRequestType=dC.ProtocolRequestType0=dC.RegistrationType=dC.MessageDirection=void 0;var cse=GW(),SWr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(SWr||(dC.MessageDirection=SWr={}));var bDt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};dC.RegistrationType=bDt;var SDt=class extends cse.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};dC.ProtocolRequestType0=SDt;var TDt=class extends cse.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,cse.ParameterStructures.byName)}};dC.ProtocolRequestType=TDt;var IDt=class extends cse.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};dC.ProtocolNotificationType0=IDt;var xDt=class extends cse.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,cse.ParameterStructures.byName)}};dC.ProtocolNotificationType=xDt});var HUe=I(kh=>{"use strict";p();Object.defineProperty(kh,"__esModule",{value:!0});kh.objectLiteral=kh.typedArray=kh.stringArray=kh.array=kh.func=kh.error=kh.number=kh.string=kh.boolean=void 0;function iyo(t){return t===!0||t===!1}a(iyo,"boolean");kh.boolean=iyo;function TWr(t){return typeof t=="string"||t instanceof String}a(TWr,"string");kh.string=TWr;function oyo(t){return typeof t=="number"||t instanceof Number}a(oyo,"number");kh.number=oyo;function syo(t){return t instanceof Error}a(syo,"error");kh.error=syo;function ayo(t){return typeof t=="function"}a(ayo,"func");kh.func=ayo;function IWr(t){return Array.isArray(t)}a(IWr,"array");kh.array=IWr;function cyo(t){return IWr(t)&&t.every(e=>TWr(e))}a(cyo,"stringArray");kh.stringArray=cyo;function lyo(t,e){return Array.isArray(t)&&t.every(e)}a(lyo,"typedArray");kh.typedArray=lyo;function uyo(t){return t!==null&&typeof t=="object"}a(uyo,"objectLiteral");kh.objectLiteral=uyo});var RWr=I(GUe=>{"use strict";p();Object.defineProperty(GUe,"__esModule",{value:!0});GUe.ImplementationRequest=void 0;var xWr=Nd(),wWr;(function(t){t.method="textDocument/implementation",t.messageDirection=xWr.MessageDirection.clientToServer,t.type=new xWr.ProtocolRequestType(t.method)})(wWr||(GUe.ImplementationRequest=wWr={}))});var DWr=I($Ue=>{"use strict";p();Object.defineProperty($Ue,"__esModule",{value:!0});$Ue.TypeDefinitionRequest=void 0;var kWr=Nd(),PWr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=kWr.MessageDirection.clientToServer,t.type=new kWr.ProtocolRequestType(t.method)})(PWr||($Ue.TypeDefinitionRequest=PWr={}))});var OWr=I(lse=>{"use strict";p();Object.defineProperty(lse,"__esModule",{value:!0});lse.DidChangeWorkspaceFoldersNotification=lse.WorkspaceFoldersRequest=void 0;var VUe=Nd(),NWr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=VUe.MessageDirection.serverToClient,t.type=new VUe.ProtocolRequestType0(t.method)})(NWr||(lse.WorkspaceFoldersRequest=NWr={}));var MWr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=VUe.MessageDirection.clientToServer,t.type=new VUe.ProtocolNotificationType(t.method)})(MWr||(lse.DidChangeWorkspaceFoldersNotification=MWr={}))});var FWr=I(WUe=>{"use strict";p();Object.defineProperty(WUe,"__esModule",{value:!0});WUe.ConfigurationRequest=void 0;var LWr=Nd(),BWr;(function(t){t.method="workspace/configuration",t.messageDirection=LWr.MessageDirection.serverToClient,t.type=new LWr.ProtocolRequestType(t.method)})(BWr||(WUe.ConfigurationRequest=BWr={}))});var qWr=I(use=>{"use strict";p();Object.defineProperty(use,"__esModule",{value:!0});use.ColorPresentationRequest=use.DocumentColorRequest=void 0;var zUe=Nd(),UWr;(function(t){t.method="textDocument/documentColor",t.messageDirection=zUe.MessageDirection.clientToServer,t.type=new zUe.ProtocolRequestType(t.method)})(UWr||(use.DocumentColorRequest=UWr={}));var QWr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=zUe.MessageDirection.clientToServer,t.type=new zUe.ProtocolRequestType(t.method)})(QWr||(use.ColorPresentationRequest=QWr={}))});var GWr=I(dse=>{"use strict";p();Object.defineProperty(dse,"__esModule",{value:!0});dse.FoldingRangeRefreshRequest=dse.FoldingRangeRequest=void 0;var YUe=Nd(),jWr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=YUe.MessageDirection.clientToServer,t.type=new YUe.ProtocolRequestType(t.method)})(jWr||(dse.FoldingRangeRequest=jWr={}));var HWr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=YUe.MessageDirection.serverToClient,t.type=new YUe.ProtocolRequestType0(t.method)})(HWr||(dse.FoldingRangeRefreshRequest=HWr={}))});var WWr=I(KUe=>{"use strict";p();Object.defineProperty(KUe,"__esModule",{value:!0});KUe.DeclarationRequest=void 0;var $Wr=Nd(),VWr;(function(t){t.method="textDocument/declaration",t.messageDirection=$Wr.MessageDirection.clientToServer,t.type=new $Wr.ProtocolRequestType(t.method)})(VWr||(KUe.DeclarationRequest=VWr={}))});var KWr=I(JUe=>{"use strict";p();Object.defineProperty(JUe,"__esModule",{value:!0});JUe.SelectionRangeRequest=void 0;var zWr=Nd(),YWr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=zWr.MessageDirection.clientToServer,t.type=new zWr.ProtocolRequestType(t.method)})(YWr||(JUe.SelectionRangeRequest=YWr={}))});var ezr=I(PU=>{"use strict";p();Object.defineProperty(PU,"__esModule",{value:!0});PU.WorkDoneProgressCancelNotification=PU.WorkDoneProgressCreateRequest=PU.WorkDoneProgress=void 0;var dyo=GW(),ZUe=Nd(),JWr;(function(t){t.type=new dyo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(JWr||(PU.WorkDoneProgress=JWr={}));var ZWr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=ZUe.MessageDirection.serverToClient,t.type=new ZUe.ProtocolRequestType(t.method)})(ZWr||(PU.WorkDoneProgressCreateRequest=ZWr={}));var XWr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=ZUe.MessageDirection.clientToServer,t.type=new ZUe.ProtocolNotificationType(t.method)})(XWr||(PU.WorkDoneProgressCancelNotification=XWr={}))});var izr=I(DU=>{"use strict";p();Object.defineProperty(DU,"__esModule",{value:!0});DU.CallHierarchyOutgoingCallsRequest=DU.CallHierarchyIncomingCallsRequest=DU.CallHierarchyPrepareRequest=void 0;var fse=Nd(),tzr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(tzr||(DU.CallHierarchyPrepareRequest=tzr={}));var rzr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(rzr||(DU.CallHierarchyIncomingCallsRequest=rzr={}));var nzr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(nzr||(DU.CallHierarchyOutgoingCallsRequest=nzr={}))});var uzr=I(fC=>{"use strict";p();Object.defineProperty(fC,"__esModule",{value:!0});fC.SemanticTokensRefreshRequest=fC.SemanticTokensRangeRequest=fC.SemanticTokensDeltaRequest=fC.SemanticTokensRequest=fC.SemanticTokensRegistrationType=fC.TokenFormat=void 0;var CB=Nd(),ozr;(function(t){t.Relative="relative"})(ozr||(fC.TokenFormat=ozr={}));var ibe;(function(t){t.method="textDocument/semanticTokens",t.type=new CB.RegistrationType(t.method)})(ibe||(fC.SemanticTokensRegistrationType=ibe={}));var szr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=CB.MessageDirection.clientToServer,t.type=new CB.ProtocolRequestType(t.method),t.registrationMethod=ibe.method})(szr||(fC.SemanticTokensRequest=szr={}));var azr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=CB.MessageDirection.clientToServer,t.type=new CB.ProtocolRequestType(t.method),t.registrationMethod=ibe.method})(azr||(fC.SemanticTokensDeltaRequest=azr={}));var czr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=CB.MessageDirection.clientToServer,t.type=new CB.ProtocolRequestType(t.method),t.registrationMethod=ibe.method})(czr||(fC.SemanticTokensRangeRequest=czr={}));var lzr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=CB.MessageDirection.serverToClient,t.type=new CB.ProtocolRequestType0(t.method)})(lzr||(fC.SemanticTokensRefreshRequest=lzr={}))});var pzr=I(XUe=>{"use strict";p();Object.defineProperty(XUe,"__esModule",{value:!0});XUe.ShowDocumentRequest=void 0;var dzr=Nd(),fzr;(function(t){t.method="window/showDocument",t.messageDirection=dzr.MessageDirection.serverToClient,t.type=new dzr.ProtocolRequestType(t.method)})(fzr||(XUe.ShowDocumentRequest=fzr={}))});var gzr=I(e7e=>{"use strict";p();Object.defineProperty(e7e,"__esModule",{value:!0});e7e.LinkedEditingRangeRequest=void 0;var hzr=Nd(),mzr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=hzr.MessageDirection.clientToServer,t.type=new hzr.ProtocolRequestType(t.method)})(mzr||(e7e.LinkedEditingRangeRequest=mzr={}))});var Szr=I(Gy=>{"use strict";p();Object.defineProperty(Gy,"__esModule",{value:!0});Gy.WillDeleteFilesRequest=Gy.DidDeleteFilesNotification=Gy.DidRenameFilesNotification=Gy.WillRenameFilesRequest=Gy.DidCreateFilesNotification=Gy.WillCreateFilesRequest=Gy.FileOperationPatternKind=void 0;var ZI=Nd(),Azr;(function(t){t.file="file",t.folder="folder"})(Azr||(Gy.FileOperationPatternKind=Azr={}));var yzr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=ZI.MessageDirection.clientToServer,t.type=new ZI.ProtocolRequestType(t.method)})(yzr||(Gy.WillCreateFilesRequest=yzr={}));var Ezr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=ZI.MessageDirection.clientToServer,t.type=new ZI.ProtocolNotificationType(t.method)})(Ezr||(Gy.DidCreateFilesNotification=Ezr={}));var _zr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=ZI.MessageDirection.clientToServer,t.type=new ZI.ProtocolRequestType(t.method)})(_zr||(Gy.WillRenameFilesRequest=_zr={}));var vzr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=ZI.MessageDirection.clientToServer,t.type=new ZI.ProtocolNotificationType(t.method)})(vzr||(Gy.DidRenameFilesNotification=vzr={}));var Czr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=ZI.MessageDirection.clientToServer,t.type=new ZI.ProtocolNotificationType(t.method)})(Czr||(Gy.DidDeleteFilesNotification=Czr={}));var bzr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=ZI.MessageDirection.clientToServer,t.type=new ZI.ProtocolRequestType(t.method)})(bzr||(Gy.WillDeleteFilesRequest=bzr={}))});var Rzr=I(NU=>{"use strict";p();Object.defineProperty(NU,"__esModule",{value:!0});NU.MonikerRequest=NU.MonikerKind=NU.UniquenessLevel=void 0;var Tzr=Nd(),Izr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Izr||(NU.UniquenessLevel=Izr={}));var xzr;(function(t){t.$import="import",t.$export="export",t.local="local"})(xzr||(NU.MonikerKind=xzr={}));var wzr;(function(t){t.method="textDocument/moniker",t.messageDirection=Tzr.MessageDirection.clientToServer,t.type=new Tzr.ProtocolRequestType(t.method)})(wzr||(NU.MonikerRequest=wzr={}))});var Nzr=I(MU=>{"use strict";p();Object.defineProperty(MU,"__esModule",{value:!0});MU.TypeHierarchySubtypesRequest=MU.TypeHierarchySupertypesRequest=MU.TypeHierarchyPrepareRequest=void 0;var pse=Nd(),kzr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=pse.MessageDirection.clientToServer,t.type=new pse.ProtocolRequestType(t.method)})(kzr||(MU.TypeHierarchyPrepareRequest=kzr={}));var Pzr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=pse.MessageDirection.clientToServer,t.type=new pse.ProtocolRequestType(t.method)})(Pzr||(MU.TypeHierarchySupertypesRequest=Pzr={}));var Dzr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=pse.MessageDirection.clientToServer,t.type=new pse.ProtocolRequestType(t.method)})(Dzr||(MU.TypeHierarchySubtypesRequest=Dzr={}))});var Lzr=I(hse=>{"use strict";p();Object.defineProperty(hse,"__esModule",{value:!0});hse.InlineValueRefreshRequest=hse.InlineValueRequest=void 0;var t7e=Nd(),Mzr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=t7e.MessageDirection.clientToServer,t.type=new t7e.ProtocolRequestType(t.method)})(Mzr||(hse.InlineValueRequest=Mzr={}));var Ozr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=t7e.MessageDirection.serverToClient,t.type=new t7e.ProtocolRequestType0(t.method)})(Ozr||(hse.InlineValueRefreshRequest=Ozr={}))});var Qzr=I(OU=>{"use strict";p();Object.defineProperty(OU,"__esModule",{value:!0});OU.InlayHintRefreshRequest=OU.InlayHintResolveRequest=OU.InlayHintRequest=void 0;var mse=Nd(),Bzr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method)})(Bzr||(OU.InlayHintRequest=Bzr={}));var Fzr;(function(t){t.method="inlayHint/resolve",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method)})(Fzr||(OU.InlayHintResolveRequest=Fzr={}));var Uzr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=mse.MessageDirection.serverToClient,t.type=new mse.ProtocolRequestType0(t.method)})(Uzr||(OU.InlayHintRefreshRequest=Uzr={}))});var Wzr=I(XI=>{"use strict";p();Object.defineProperty(XI,"__esModule",{value:!0});XI.DiagnosticRefreshRequest=XI.WorkspaceDiagnosticRequest=XI.DocumentDiagnosticRequest=XI.DocumentDiagnosticReportKind=XI.DiagnosticServerCancellationData=void 0;var Vzr=GW(),fyo=HUe(),gse=Nd(),qzr;(function(t){function e(r){let n=r;return n&&fyo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(qzr||(XI.DiagnosticServerCancellationData=qzr={}));var jzr;(function(t){t.Full="full",t.Unchanged="unchanged"})(jzr||(XI.DocumentDiagnosticReportKind=jzr={}));var Hzr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=gse.MessageDirection.clientToServer,t.type=new gse.ProtocolRequestType(t.method),t.partialResult=new Vzr.ProgressType})(Hzr||(XI.DocumentDiagnosticRequest=Hzr={}));var Gzr;(function(t){t.method="workspace/diagnostic",t.messageDirection=gse.MessageDirection.clientToServer,t.type=new gse.ProtocolRequestType(t.method),t.partialResult=new Vzr.ProgressType})(Gzr||(XI.WorkspaceDiagnosticRequest=Gzr={}));var $zr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=gse.MessageDirection.serverToClient,t.type=new gse.ProtocolRequestType0(t.method)})($zr||(XI.DiagnosticRefreshRequest=$zr={}))});var eYr=I($f=>{"use strict";p();Object.defineProperty($f,"__esModule",{value:!0});$f.DidCloseNotebookDocumentNotification=$f.DidSaveNotebookDocumentNotification=$f.DidChangeNotebookDocumentNotification=$f.NotebookCellArrayChange=$f.DidOpenNotebookDocumentNotification=$f.NotebookDocumentSyncRegistrationType=$f.NotebookDocument=$f.NotebookCell=$f.ExecutionSummary=$f.NotebookCellKind=void 0;var obe=nbe(),zk=HUe(),aM=Nd(),wDt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(wDt||($f.NotebookCellKind=wDt={}));var RDt;(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 zk.objectLiteral(s)&&obe.uinteger.is(s.executionOrder)&&(s.success===void 0||zk.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})(RDt||($f.ExecutionSummary=RDt={}));var r7e;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return zk.objectLiteral(c)&&wDt.is(c.kind)&&obe.DocumentUri.is(c.document)&&(c.metadata===void 0||zk.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)&&!RDt.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(n7e,"__esModule",{value:!0});n7e.InlineCompletionRequest=void 0;var tYr=Nd(),rYr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=tYr.MessageDirection.clientToServer,t.type=new tYr.ProtocolRequestType(t.method)})(rYr||(n7e.InlineCompletionRequest=rYr={}))});var gKr=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=Nd(),iYr=nbe(),X0=HUe(),pyo=RWr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return pyo.ImplementationRequest},"get")});var hyo=DWr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return hyo.TypeDefinitionRequest},"get")});var fKr=OWr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return fKr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return fKr.DidChangeWorkspaceFoldersNotification},"get")});var myo=FWr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return myo.ConfigurationRequest},"get")});var pKr=qWr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return pKr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return pKr.ColorPresentationRequest},"get")});var hKr=GWr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return hKr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return hKr.FoldingRangeRefreshRequest},"get")});var gyo=WWr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return gyo.DeclarationRequest},"get")});var Ayo=KWr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return Ayo.SelectionRangeRequest},"get")});var MDt=ezr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return MDt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return MDt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return MDt.WorkDoneProgressCancelNotification},"get")});var ODt=izr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return ODt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return ODt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return ODt.CallHierarchyPrepareRequest},"get")});var yse=uzr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return yse.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return yse.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return yse.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return yse.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return yse.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return yse.SemanticTokensRegistrationType},"get")});var yyo=pzr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return yyo.ShowDocumentRequest},"get")});var Eyo=gzr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return Eyo.LinkedEditingRangeRequest},"get")});var $W=Szr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return $W.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return $W.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return $W.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return $W.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return $W.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return $W.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return $W.WillDeleteFilesRequest},"get")});var LDt=Rzr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return LDt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return LDt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return LDt.MonikerRequest},"get")});var BDt=Nzr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return BDt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return BDt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return BDt.TypeHierarchySupertypesRequest},"get")});var mKr=Lzr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return mKr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return mKr.InlineValueRefreshRequest},"get")});var FDt=Qzr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return FDt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return FDt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return FDt.InlayHintRefreshRequest},"get")});var sbe=Wzr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return sbe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return sbe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return sbe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return sbe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return sbe.DiagnosticRefreshRequest},"get")});var cM=eYr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return cM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return cM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return cM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return cM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return cM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return cM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return cM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return cM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return cM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return cM.DidCloseNotebookDocumentNotification},"get")});var _yo=nYr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return _yo.InlineCompletionRequest},"get")});var kDt;(function(t){function e(r){let n=r;return X0.string(n)||X0.string(n.language)||X0.string(n.scheme)||X0.string(n.pattern)}a(e,"is"),t.is=e})(kDt||(Ve.TextDocumentFilter=kDt={}));var PDt;(function(t){function e(r){let n=r;return X0.objectLiteral(n)&&(X0.string(n.notebookType)||X0.string(n.scheme)||X0.string(n.pattern))}a(e,"is"),t.is=e})(PDt||(Ve.NotebookDocumentFilter=PDt={}));var DDt;(function(t){function e(r){let n=r;return X0.objectLiteral(n)&&(X0.string(n.notebook)||PDt.is(n.notebook))&&(n.language===void 0||X0.string(n.language))}a(e,"is"),t.is=e})(DDt||(Ve.NotebookCellTextDocumentFilter=DDt={}));var NDt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!X0.string(n)&&!kDt.is(n)&&!DDt.is(n))return!1;return!0}a(e,"is"),t.is=e})(NDt||(Ve.DocumentSelector=NDt={}));var oYr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(oYr||(Ve.RegistrationRequest=oYr={}));var sYr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(sYr||(Ve.UnregistrationRequest=sYr={}));var aYr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(aYr||(Ve.ResourceOperationKind=aYr={}));var cYr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(cYr||(Ve.FailureHandlingKind=cYr={}));var lYr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(lYr||(Ve.PositionEncodingKind=lYr={}));var uYr;(function(t){function e(r){let n=r;return n&&X0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(uYr||(Ve.StaticRegistrationOptions=uYr={}));var dYr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||NDt.is(n.documentSelector))}a(e,"is"),t.is=e})(dYr||(Ve.TextDocumentRegistrationOptions=dYr={}));var fYr;(function(t){function e(n){let o=n;return X0.objectLiteral(o)&&(o.workDoneProgress===void 0||X0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&X0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(fYr||(Ve.WorkDoneProgressOptions=fYr={}));var pYr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(pYr||(Ve.InitializeRequest=pYr={}));var hYr;(function(t){t.unknownProtocolVersion=1})(hYr||(Ve.InitializeErrorCodes=hYr={}));var mYr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(mYr||(Ve.InitializedNotification=mYr={}));var gYr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(gYr||(Ve.ShutdownRequest=gYr={}));var AYr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(AYr||(Ve.ExitNotification=AYr={}));var yYr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(yYr||(Ve.DidChangeConfigurationNotification=yYr={}));var EYr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(EYr||(Ve.MessageType=EYr={}));var _Yr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(_Yr||(Ve.ShowMessageNotification=_Yr={}));var vYr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(vYr||(Ve.ShowMessageRequest=vYr={}));var CYr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(CYr||(Ve.LogMessageNotification=CYr={}));var bYr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(bYr||(Ve.TelemetryEventNotification=bYr={}));var SYr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(SYr||(Ve.TextDocumentSyncKind=SYr={}));var TYr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(TYr||(Ve.DidOpenTextDocumentNotification=TYr={}));var IYr;(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})(IYr||(Ve.TextDocumentContentChangeEvent=IYr={}));var xYr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(xYr||(Ve.DidChangeTextDocumentNotification=xYr={}));var wYr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(wYr||(Ve.DidCloseTextDocumentNotification=wYr={}));var RYr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(RYr||(Ve.DidSaveTextDocumentNotification=RYr={}));var kYr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(kYr||(Ve.TextDocumentSaveReason=kYr={}));var PYr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(PYr||(Ve.WillSaveTextDocumentNotification=PYr={}));var DYr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(DYr||(Ve.WillSaveTextDocumentWaitUntilRequest=DYr={}));var NYr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(NYr||(Ve.DidChangeWatchedFilesNotification=NYr={}));var MYr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(MYr||(Ve.FileChangeType=MYr={}));var OYr;(function(t){function e(r){let n=r;return X0.objectLiteral(n)&&(iYr.URI.is(n.baseUri)||iYr.WorkspaceFolder.is(n.baseUri))&&X0.string(n.pattern)}a(e,"is"),t.is=e})(OYr||(Ve.RelativePattern=OYr={}));var LYr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(LYr||(Ve.WatchKind=LYr={}));var BYr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(BYr||(Ve.PublishDiagnosticsNotification=BYr={}));var FYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(FYr||(Ve.CompletionTriggerKind=FYr={}));var UYr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(UYr||(Ve.CompletionRequest=UYr={}));var QYr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QYr||(Ve.CompletionResolveRequest=QYr={}));var qYr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qYr||(Ve.HoverRequest=qYr={}));var jYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(jYr||(Ve.SignatureHelpTriggerKind=jYr={}));var HYr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HYr||(Ve.SignatureHelpRequest=HYr={}));var GYr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GYr||(Ve.DefinitionRequest=GYr={}));var $Yr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Yr||(Ve.ReferencesRequest=$Yr={}));var VYr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(VYr||(Ve.DocumentHighlightRequest=VYr={}));var WYr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WYr||(Ve.DocumentSymbolRequest=WYr={}));var zYr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zYr||(Ve.CodeActionRequest=zYr={}));var YYr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(YYr||(Ve.CodeActionResolveRequest=YYr={}));var KYr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(KYr||(Ve.WorkspaceSymbolRequest=KYr={}));var JYr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(JYr||(Ve.WorkspaceSymbolResolveRequest=JYr={}));var ZYr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(ZYr||(Ve.CodeLensRequest=ZYr={}));var XYr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(XYr||(Ve.CodeLensResolveRequest=XYr={}));var eKr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(eKr||(Ve.CodeLensRefreshRequest=eKr={}));var tKr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tKr||(Ve.DocumentLinkRequest=tKr={}));var rKr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(rKr||(Ve.DocumentLinkResolveRequest=rKr={}));var nKr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(nKr||(Ve.DocumentFormattingRequest=nKr={}));var iKr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iKr||(Ve.DocumentRangeFormattingRequest=iKr={}));var oKr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oKr||(Ve.DocumentRangesFormattingRequest=oKr={}));var sKr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(sKr||(Ve.DocumentOnTypeFormattingRequest=sKr={}));var aKr;(function(t){t.Identifier=1})(aKr||(Ve.PrepareSupportDefaultBehavior=aKr={}));var cKr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cKr||(Ve.RenameRequest=cKr={}));var lKr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(lKr||(Ve.PrepareRenameRequest=lKr={}));var uKr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(uKr||(Ve.ExecuteCommandRequest=uKr={}));var dKr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(dKr||(Ve.ApplyWorkspaceEditRequest=dKr={}))});var yKr=I(i7e=>{"use strict";p();Object.defineProperty(i7e,"__esModule",{value:!0});i7e.createProtocolConnection=void 0;var AKr=GW();function vyo(t,e,r,n){return AKr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,AKr.createMessageConnection)(t,e,r,n)}a(vyo,"createProtocolConnection");i7e.createProtocolConnection=vyo});var _Kr=I(pC=>{"use strict";p();var Cyo=pC&&pC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o7e=pC&&pC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cyo(e,t,r)};Object.defineProperty(pC,"__esModule",{value:!0});pC.LSPErrorCodes=pC.createProtocolConnection=void 0;o7e(GW(),pC);o7e(nbe(),pC);o7e(Nd(),pC);o7e(gKr(),pC);var byo=yKr();Object.defineProperty(pC,"createProtocolConnection",{enumerable:!0,get:a(function(){return byo.createProtocolConnection},"get")});var EKr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(EKr||(pC.LSPErrorCodes=EKr={}))});var ei=I(lM=>{"use strict";p();var Syo=lM&&lM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vKr=lM&&lM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Syo(e,t,r)};Object.defineProperty(lM,"__esModule",{value:!0});lM.createProtocolConnection=void 0;var Tyo=CDt();vKr(CDt(),lM);vKr(_Kr(),lM);function Iyo(t,e,r,n){return(0,Tyo.createMessageConnection)(t,e,r,n)}a(Iyo,"createProtocolConnection");lM.createProtocolConnection=Iyo});var $5t=I(Oje=>{"use strict";p();Object.defineProperty(Oje,"__esModule",{value:!0});Oje.state=void 0;Oje.state={instrumenterImplementation:void 0}});var Ice=I((SBt,Tnn)=>{p();var OHe=require("buffer"),VM=OHe.Buffer;function Snn(t,e){for(var r in t)e[r]=t[r]}a(Snn,"copyProps");VM.from&&VM.alloc&&VM.allocUnsafe&&VM.allocUnsafeSlow?Tnn.exports=OHe:(Snn(OHe,SBt),SBt.Buffer=TY);function TY(t,e,r){return VM(t,e,r)}a(TY,"SafeBuffer");TY.prototype=Object.create(VM.prototype);Snn(VM,TY);TY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return VM(t,e,r)};TY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=VM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};TY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return VM(t)};TY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return OHe.SlowBuffer(t)}});var TBt=I((gZl,Inn)=>{p();var LHe=Ice().Buffer,HTo=require("stream"),GTo=require("util");function BHe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=LHe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=LHe.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(BHe,"DataStream");GTo.inherits(BHe,HTo);BHe.prototype.write=a(function(e){this.buffer=LHe.concat([this.buffer,LHe.from(e)]),this.emit("data",e)},"write");BHe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Inn.exports=BHe});var wnn=I((EZl,xnn)=>{"use strict";p();function IBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(IBt,"getParamSize");var $To={ES256:IBt(256),ES384:IBt(384),ES512:IBt(521)};function VTo(t){var e=$To[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(VTo,"getParamBytesForAlg");xnn.exports=VTo});var Onn=I((CZl,Mnn)=>{"use strict";p();var FHe=Ice().Buffer,knn=wnn(),UHe=128,Pnn=0,WTo=32,zTo=16,YTo=2,Dnn=zTo|WTo|Pnn<<6,QHe=YTo|Pnn<<6;function KTo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(KTo,"base64Url");function Nnn(t){if(FHe.isBuffer(t))return t;if(typeof t=="string")return FHe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Nnn,"signatureAsBuffer");function JTo(t,e){t=Nnn(t);var r=knn(e),n=r+1,o=t.length,s=0;if(t[s++]!==Dnn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(UHe|1)&&(c=t[s++]),o-s=UHe;return o&&--n,n}a(Rnn,"countPadding");function ZTo(t,e){t=Nnn(t);var r=knn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Rnn(t,0,r),s=Rnn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var iTe=require("buffer").Buffer,xBt=require("buffer").SlowBuffer;Lnn.exports=qHe;function qHe(t,e){if(!iTe.isBuffer(t)||!iTe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var wce=Ice().Buffer,Rx=require("crypto"),Unn=Onn(),Fnn=require("util"),tIo=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,rTe="secret must be a string or buffer",Ice="key must be a string or a buffer",GTo="key must be a string, a buffer or an object",TBt=typeof xx.createPublicKey=="function";TBt&&(Ice+=" or a KeyObject",rTe+="or a KeyObject");function Onn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&(!TBt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw gP(Ice)}a(Onn,"checkIsPublicKey");function Lnn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw gP(GTo)}a(Lnn,"checkIsPrivateKey");function $To(t){if(!xce.isBuffer(t)){if(typeof t=="string")return t;if(!TBt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw gP(rTe)}}a($To,"checkIsSecretKey");function IBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(IBt,"fromBase64");function Bnn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var tIo=require("buffer").Buffer;jnn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||tIo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var znn=I((gZl,Wnn)=>{p();var rIo=Tce().Buffer,Hnn=vBt(),nIo=xBt(),iIo=require("stream"),Gnn=wBt(),RBt=require("util");function $nn(t,e){return rIo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a($nn,"base64url");function oIo(t,e,r){r=r||"utf8";var n=$nn(Gnn(t),"binary"),o=$nn(Gnn(e),r);return RBt.format("%s.%s",n,o)}a(oIo,"jwsSecuredInput");function Vnn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=nIo(e.alg),c=oIo(e,r,o),l=s.sign(c,n);return RBt.format("%s.%s",c,l)}a(Vnn,"jwsSign");function BHe(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 Hnn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Hnn(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(BHe,"SignStream");RBt.inherits(BHe,iIo);BHe.prototype.sign=a(function(){try{var e=Vnn({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");BHe.sign=Vnn;Wnn.exports=BHe});var iin=I((EZl,nin)=>{p();var Knn=Tce().Buffer,Ynn=vBt(),sIo=xBt(),aIo=require("stream"),Jnn=wBt(),cIo=require("util"),lIo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function uIo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(uIo,"isObject");function dIo(t){if(uIo(t))return t;try{return JSON.parse(t)}catch{return}}a(dIo,"safeJsonParse");function Znn(t){var e=t.split(".",1)[0];return dIo(Knn.from(e,"base64").toString("binary"))}a(Znn,"headerFromJWS");function fIo(t){return t.split(".",2).join(".")}a(fIo,"securedInputFromJWS");function Xnn(t){return t.split(".")[2]}a(Xnn,"signatureFromJWS");function pIo(t,e){e=e||"utf8";var r=t.split(".")[1];return Knn.from(r,"base64").toString(e)}a(pIo,"payloadFromJWS");function ein(t){return lIo.test(t)&&!!Znn(t)}a(ein,"isValidJws");function tin(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Jnn(t);var o=Xnn(t),s=fIo(t),c=sIo(e);return c.verify(s,o,r)}a(tin,"jwsVerify");function rin(t,e){if(e=e||{},t=Jnn(t),!ein(t))return null;var r=Znn(t);if(!r)return null;var n=pIo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Xnn(t)}}a(rin,"jwsDecode");function wce(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 Ynn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Ynn(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(wce,"VerifyStream");cIo.inherits(wce,aIo);wce.prototype.verify=a(function(){try{var e=tin(this.signature.buffer,this.algorithm,this.key.buffer),r=rin(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");wce.decode=rin;wce.isValid=ein;wce.verify=tin;nin.exports=wce});var UHe=I(Z7=>{p();var oin=znn(),FHe=iin(),hIo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Z7.ALGORITHMS=hIo;Z7.sign=oin.sign;Z7.verify=FHe.verify;Z7.decode=FHe.decode;Z7.isValid=FHe.isValid;Z7.createSign=a(function(e){return new oin(e)},"createSign");Z7.createVerify=a(function(e){return new FHe(e)},"createVerify")});var kBt=I((TZl,sin)=>{p();var mIo=UHe();sin.exports=function(t,e){e=e||{};var r=mIo.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 iTe=I((xZl,ain)=>{p();var QHe=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");QHe.prototype=Object.create(Error.prototype);QHe.prototype.constructor=QHe;ain.exports=QHe});var PBt=I((kZl,lin)=>{p();var cin=iTe(),qHe=a(function(t,e){cin.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");qHe.prototype=Object.create(cin.prototype);qHe.prototype.constructor=qHe;lin.exports=qHe});var DBt=I((NZl,din)=>{p();var uin=iTe(),jHe=a(function(t,e){uin.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");jHe.prototype=Object.create(uin.prototype);jHe.prototype.constructor=jHe;din.exports=jHe});var NBt=I((LZl,fin)=>{p();var Rce=1e3,kce=Rce*60,Pce=kce*60,CY=Pce*24,gIo=CY*7,AIo=CY*365.25;fin.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return yIo(t);if(r==="number"&&isFinite(t))return e.long?_Io(t):EIo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function yIo(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*AIo;case"weeks":case"week":case"w":return r*gIo;case"days":case"day":case"d":return r*CY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Pce;case"minutes":case"minute":case"mins":case"min":case"m":return r*kce;case"seconds":case"second":case"secs":case"sec":case"s":return r*Rce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(yIo,"parse");function EIo(t){var e=Math.abs(t);return e>=CY?Math.round(t/CY)+"d":e>=Pce?Math.round(t/Pce)+"h":e>=kce?Math.round(t/kce)+"m":e>=Rce?Math.round(t/Rce)+"s":t+"ms"}a(EIo,"fmtShort");function _Io(t){var e=Math.abs(t);return e>=CY?HHe(t,e,CY,"day"):e>=Pce?HHe(t,e,Pce,"hour"):e>=kce?HHe(t,e,kce,"minute"):e>=Rce?HHe(t,e,Rce,"second"):t+" ms"}a(_Io,"fmtLong");function HHe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(HHe,"plural")});var MBt=I((UZl,pin)=>{p();var vIo=NBt();pin.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=vIo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Dce=I((qZl,hin)=>{"use strict";p();var CIo="2.0.0",bIo=Number.MAX_SAFE_INTEGER||9007199254740991,SIo=16,TIo=250,IIo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];hin.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:SIo,MAX_SAFE_BUILD_LENGTH:TIo,MAX_SAFE_INTEGER:bIo,RELEASE_TYPES:IIo,SEMVER_SPEC_VERSION:CIo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var oTe=I((HZl,min)=>{"use strict";p();var xIo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};min.exports=xIo});var Nce=I((GM,gin)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:OBt,MAX_SAFE_BUILD_LENGTH:wIo,MAX_LENGTH:RIo}=Dce(),kIo=oTe();GM=gin.exports={};var PIo=GM.re=[],DIo=GM.safeRe=[],xn=GM.src=[],NIo=GM.safeSrc=[],wn=GM.t={},MIo=0,LBt="[a-zA-Z0-9-]",OIo=[["\\s",1],["\\d",RIo],[LBt,wIo]],LIo=a(t=>{for(let[e,r]of OIo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Uo=a((t,e,r)=>{let n=LIo(e),o=MIo++;kIo(t,o,e),wn[t]=o,xn[o]=e,NIo[o]=n,PIo[o]=new RegExp(e,r?"g":void 0),DIo[o]=new RegExp(n,r?"g":void 0)},"createToken");Uo("NUMERICIDENTIFIER","0|[1-9]\\d*");Uo("NUMERICIDENTIFIERLOOSE","\\d+");Uo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${LBt}*`);Uo("MAINVERSION",`(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})`);Uo("MAINVERSIONLOOSE",`(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASEIDENTIFIER",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIER]})`);Uo("PRERELEASEIDENTIFIERLOOSE",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASE",`(?:-(${xn[wn.PRERELEASEIDENTIFIER]}(?:\\.${xn[wn.PRERELEASEIDENTIFIER]})*))`);Uo("PRERELEASELOOSE",`(?:-?(${xn[wn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${xn[wn.PRERELEASEIDENTIFIERLOOSE]})*))`);Uo("BUILDIDENTIFIER",`${LBt}+`);Uo("BUILD",`(?:\\+(${xn[wn.BUILDIDENTIFIER]}(?:\\.${xn[wn.BUILDIDENTIFIER]})*))`);Uo("FULLPLAIN",`v?${xn[wn.MAINVERSION]}${xn[wn.PRERELEASE]}?${xn[wn.BUILD]}?`);Uo("FULL",`^${xn[wn.FULLPLAIN]}$`);Uo("LOOSEPLAIN",`[v=\\s]*${xn[wn.MAINVERSIONLOOSE]}${xn[wn.PRERELEASELOOSE]}?${xn[wn.BUILD]}?`);Uo("LOOSE",`^${xn[wn.LOOSEPLAIN]}$`);Uo("GTLT","((?:<|>)?=?)");Uo("XRANGEIDENTIFIERLOOSE",`${xn[wn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Uo("XRANGEIDENTIFIER",`${xn[wn.NUMERICIDENTIFIER]}|x|X|\\*`);Uo("XRANGEPLAIN",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:${xn[wn.PRERELEASE]})?${xn[wn.BUILD]}?)?)?`);Uo("XRANGEPLAINLOOSE",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:${xn[wn.PRERELEASELOOSE]})?${xn[wn.BUILD]}?)?)?`);Uo("XRANGE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAIN]}$`);Uo("XRANGELOOSE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${OBt}})(?:\\.(\\d{1,${OBt}}))?(?:\\.(\\d{1,${OBt}}))?`);Uo("COERCE",`${xn[wn.COERCEPLAIN]}(?:$|[^\\d])`);Uo("COERCEFULL",xn[wn.COERCEPLAIN]+`(?:${xn[wn.PRERELEASE]})?(?:${xn[wn.BUILD]})?(?:$|[^\\d])`);Uo("COERCERTL",xn[wn.COERCE],!0);Uo("COERCERTLFULL",xn[wn.COERCEFULL],!0);Uo("LONETILDE","(?:~>?)");Uo("TILDETRIM",`(\\s*)${xn[wn.LONETILDE]}\\s+`,!0);GM.tildeTrimReplace="$1~";Uo("TILDE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAIN]}$`);Uo("TILDELOOSE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("LONECARET","(?:\\^)");Uo("CARETTRIM",`(\\s*)${xn[wn.LONECARET]}\\s+`,!0);GM.caretTrimReplace="$1^";Uo("CARET",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAIN]}$`);Uo("CARETLOOSE",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("COMPARATORLOOSE",`^${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]})$|^$`);Uo("COMPARATOR",`^${xn[wn.GTLT]}\\s*(${xn[wn.FULLPLAIN]})$|^$`);Uo("COMPARATORTRIM",`(\\s*)${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]}|${xn[wn.XRANGEPLAIN]})`,!0);GM.comparatorTrimReplace="$1$2$3";Uo("HYPHENRANGE",`^\\s*(${xn[wn.XRANGEPLAIN]})\\s+-\\s+(${xn[wn.XRANGEPLAIN]})\\s*$`);Uo("HYPHENRANGELOOSE",`^\\s*(${xn[wn.XRANGEPLAINLOOSE]})\\s+-\\s+(${xn[wn.XRANGEPLAINLOOSE]})\\s*$`);Uo("STAR","(<|>)?=?\\s*\\*");Uo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Uo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var GHe=I((WZl,Ain)=>{"use strict";p();var BIo=Object.freeze({loose:!0}),FIo=Object.freeze({}),UIo=a(t=>t?typeof t!="object"?BIo:t:FIo,"parseOptions");Ain.exports=UIo});var BBt=I((KZl,_in)=>{"use strict";p();var yin=/^[0-9]+$/,Ein=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tEin(e,t),"rcompareIdentifiers");_in.exports={compareIdentifiers:Ein,rcompareIdentifiers:QIo}});var bA=I((XZl,Cin)=>{"use strict";p();var $He=oTe(),{MAX_LENGTH:vin,MAX_SAFE_INTEGER:VHe}=Dce(),{safeRe:WHe,t:zHe}=Nce(),qIo=GHe(),{compareIdentifiers:FBt}=BBt(),jIo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nvin)throw new TypeError(`version is longer than ${vin} characters`);$He("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?WHe[zHe.LOOSE]:WHe[zHe.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>VHe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>VHe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>VHe||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($He("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 FBt(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($He("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 FBt(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?WHe[zHe.PRERELEASELOOSE]:WHe[zHe.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];if(n===!1&&(s=[r]),jIo(this.prerelease,r)){let c=this.prerelease[r.split(".").length];isNaN(c)&&(this.prerelease=s)}else 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}};Cin.exports=UBt});var X7=I((rXl,Sin)=>{"use strict";p();var bin=bA(),HIo=a((t,e,r=!1)=>{if(t instanceof bin)return t;try{return new bin(t,e)}catch(n){if(!r)return null;throw n}},"parse");Sin.exports=HIo});var Iin=I((oXl,Tin)=>{"use strict";p();var GIo=X7(),$Io=a((t,e)=>{let r=GIo(t,e);return r?r.version:null},"valid");Tin.exports=$Io});var win=I((cXl,xin)=>{"use strict";p();var VIo=X7(),WIo=a((t,e)=>{let r=VIo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");xin.exports=WIo});var Pin=I((dXl,kin)=>{"use strict";p();var Rin=bA(),zIo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Rin(t instanceof Rin?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");kin.exports=zIo});var Min=I((hXl,Nin)=>{"use strict";p();var Din=X7(),YIo=a((t,e)=>{let r=Din(t,null,!0),n=Din(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");Nin.exports=YIo});var Lin=I((AXl,Oin)=>{"use strict";p();var KIo=bA(),JIo=a((t,e)=>new KIo(t,e).major,"major");Oin.exports=JIo});var Fin=I((_Xl,Bin)=>{"use strict";p();var ZIo=bA(),XIo=a((t,e)=>new ZIo(t,e).minor,"minor");Bin.exports=XIo});var Qin=I((bXl,Uin)=>{"use strict";p();var exo=bA(),txo=a((t,e)=>new exo(t,e).patch,"patch");Uin.exports=txo});var jin=I((IXl,qin)=>{"use strict";p();var rxo=X7(),nxo=a((t,e)=>{let r=rxo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");qin.exports=nxo});var wx=I((RXl,Gin)=>{"use strict";p();var Hin=bA(),ixo=a((t,e,r)=>new Hin(t,r).compare(new Hin(e,r)),"compare");Gin.exports=ixo});var Vin=I((DXl,$in)=>{"use strict";p();var oxo=wx(),sxo=a((t,e,r)=>oxo(e,t,r),"rcompare");$in.exports=sxo});var zin=I((OXl,Win)=>{"use strict";p();var axo=wx(),cxo=a((t,e)=>axo(t,e,!0),"compareLoose");Win.exports=cxo});var YHe=I((FXl,Kin)=>{"use strict";p();var Yin=bA(),lxo=a((t,e,r)=>{let n=new Yin(t,r),o=new Yin(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");Kin.exports=lxo});var Zin=I((qXl,Jin)=>{"use strict";p();var uxo=YHe(),dxo=a((t,e)=>t.sort((r,n)=>uxo(r,n,e)),"sort");Jin.exports=dxo});var eon=I((GXl,Xin)=>{"use strict";p();var fxo=YHe(),pxo=a((t,e)=>t.sort((r,n)=>fxo(n,r,e)),"rsort");Xin.exports=pxo});var sTe=I((WXl,ton)=>{"use strict";p();var hxo=wx(),mxo=a((t,e,r)=>hxo(t,e,r)>0,"gt");ton.exports=mxo});var KHe=I((KXl,ron)=>{"use strict";p();var gxo=wx(),Axo=a((t,e,r)=>gxo(t,e,r)<0,"lt");ron.exports=Axo});var QBt=I((XXl,non)=>{"use strict";p();var yxo=wx(),Exo=a((t,e,r)=>yxo(t,e,r)===0,"eq");non.exports=Exo});var qBt=I((reu,ion)=>{"use strict";p();var _xo=wx(),vxo=a((t,e,r)=>_xo(t,e,r)!==0,"neq");ion.exports=vxo});var JHe=I((oeu,oon)=>{"use strict";p();var Cxo=wx(),bxo=a((t,e,r)=>Cxo(t,e,r)>=0,"gte");oon.exports=bxo});var ZHe=I((ceu,son)=>{"use strict";p();var Sxo=wx(),Txo=a((t,e,r)=>Sxo(t,e,r)<=0,"lte");son.exports=Txo});var jBt=I((deu,aon)=>{"use strict";p();var Ixo=QBt(),xxo=qBt(),wxo=sTe(),Rxo=JHe(),kxo=KHe(),Pxo=ZHe(),Dxo=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 Ixo(t,r,n);case"!=":return xxo(t,r,n);case">":return wxo(t,r,n);case">=":return Rxo(t,r,n);case"<":return kxo(t,r,n);case"<=":return Pxo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");aon.exports=Dxo});var lon=I((heu,con)=>{"use strict";p();var Nxo=bA(),Mxo=X7(),{safeRe:XHe,t:eGe}=Nce(),Oxo=a((t,e)=>{if(t instanceof Nxo)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?XHe[eGe.COERCEFULL]:XHe[eGe.COERCE]);else{let u=e.includePrerelease?XHe[eGe.COERCERTLFULL]:XHe[eGe.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 Mxo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");con.exports=Oxo});var don=I((Aeu,uon)=>{"use strict";p();var Lxo=X7(),Bxo=Dce(),Fxo=bA(),Uxo=a((t,e,r)=>{if(!Bxo.RELEASE_TYPES.includes(e))return null;let n=Qxo(t,r);return n&&qxo(n,e)},"truncate"),Qxo=a((t,e)=>{let r=t instanceof Fxo?t.version:t;return Lxo(r,e)},"cloneInputVersion"),qxo=a((t,e)=>{if(jxo(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"),jxo=a(t=>t.startsWith("pre"),"isPrerelease");uon.exports=Uxo});var pon=I((_eu,fon)=>{"use strict";p();var HBt=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}};fon.exports=HBt});var Rx=I((beu,Aon)=>{"use strict";p();var Hxo=/\s+/g,GBt=class t{static{a(this,"Range")}constructor(e,r){if(r=$xo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof $Bt)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(Hxo," "),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=>!mon(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&&ewo(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(Xxo,"");let n=((this.options.includePrerelease&&Jxo)|(this.options.loose&&Zxo))+":"+e,o=hon.get(n);if(o)return o;let s=this.options.loose,c=s?N_[SA.HYPHENRANGELOOSE]:N_[SA.HYPHENRANGE];e=e.replace(c,dwo(this.options.includePrerelease)),Ku("hyphen replace",e),e=e.replace(N_[SA.COMPARATORTRIM],zxo),Ku("comparator trim",e),e=e.replace(N_[SA.TILDETRIM],Yxo),Ku("tilde trim",e),e=e.replace(N_[SA.CARETTRIM],Kxo),Ku("caret trim",e);let l=e.split(" ").map(h=>two(h,this.options)).join(" ").split(/\s+/).map(h=>uwo(h,this.options));s&&(l=l.filter(h=>(Ku("loose invalid filter",h,this.options),!!h.match(N_[SA.COMPARATORLOOSE])))),Ku("range list",l);let u=new Map,d=l.map(h=>new $Bt(h,this.options));for(let h of d){if(mon(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return hon.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>gon(n,r)&&e.set.some(o=>gon(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 Vxo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),ewo=a(t=>t.value==="","isAny"),gon=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"),two=a((t,e)=>(t=t.replace(N_[SA.BUILD],""),Ku("comp",t,e),t=owo(t,e),Ku("caret",t),t=nwo(t,e),Ku("tildes",t),t=awo(t,e),Ku("xrange",t),t=lwo(t,e),Ku("stars",t),t),"parseComparator"),n0=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),rwo=a((t,e,r)=>n0(t)&&!n0(e)||n0(e)&&r&&!n0(r),"invalidXRangeOrder"),nwo=a((t,e)=>t.trim().split(/\s+/).map(r=>iwo(r,e)).join(" "),"replaceTildes"),iwo=a((t,e)=>{let r=e.loose?N_[SA.TILDELOOSE]:N_[SA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("tilde",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(Ku("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,Ku("tilde return",d),d})},"replaceTilde"),owo=a((t,e)=>t.trim().split(/\s+/).map(r=>swo(r,e)).join(" "),"replaceCarets"),swo=a((t,e)=>{Ku("caret",t,e);let r=e.loose?N_[SA.CARETLOOSE]:N_[SA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("caret",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Ku("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`):(Ku("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),Ku("caret return",d),d})},"replaceCaret"),awo=a((t,e)=>(Ku("replaceXRanges",t,e),t.split(/\s+/).map(r=>cwo(r,e)).join(" ")),"replaceXRanges"),cwo=a((t,e)=>{t=t.trim();let r=e.loose?N_[SA.XRANGELOOSE]:N_[SA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(Ku("xRange",t,n,o,s,c,l,u),rwo(s,c,l))return t;let d=n0(s),f=d||n0(c),h=f||n0(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`),Ku("xRange return",n),n})},"replaceXRange"),lwo=a((t,e)=>(Ku("replaceStars",t,e),t.trim().replace(N_[SA.STAR],"")),"replaceStars"),uwo=a((t,e)=>(Ku("replaceGTE0",t,e),t.trim().replace(N_[e.includePrerelease?SA.GTE0PRE:SA.GTE0],"")),"replaceGTE0"),dwo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(n0(n)?r="":n0(o)?r=`>=${n}.0.0${t?"-0":""}`:n0(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,n0(d)?u="":n0(f)?u=`<${+d+1}.0.0-0`:n0(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"),fwo=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 aTe=I((Ieu,bon)=>{"use strict";p();var cTe=Symbol("SemVer ANY"),zBt=class t{static{a(this,"Comparator")}static get ANY(){return cTe}constructor(e,r){if(r=yon(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),WBt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===cTe?this.value="":this.value=this.operator+this.semver.version,WBt("comp",this)}parse(e){let r=this.options.loose?Eon[_on.COMPARATORLOOSE]:Eon[_on.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 von(n[2],this.options.loose):this.semver=cTe}toString(){return this.value}test(e){if(WBt("Comparator.test",e,this.options.loose),this.semver===cTe||e===cTe)return!0;if(typeof e=="string")try{e=new von(e,this.options)}catch{return!1}return VBt(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 Con(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Con(this.value,r).test(e.semver):(r=yon(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("=")||VBt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||VBt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};bon.exports=zBt;var yon=GHe(),{safeRe:Eon,t:_on}=Nce(),VBt=jBt(),WBt=oTe(),von=bA(),Con=Rx()});var lTe=I((Reu,Son)=>{"use strict";p();var pwo=Rx(),hwo=a((t,e,r)=>{try{e=new pwo(e,r)}catch{return!1}return e.test(t)},"satisfies");Son.exports=hwo});var Ion=I((Deu,Ton)=>{"use strict";p();var mwo=Rx(),gwo=a((t,e)=>new mwo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Ton.exports=gwo});var won=I((Oeu,xon)=>{"use strict";p();var Awo=bA(),ywo=Rx(),Ewo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new ywo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Awo(n,r))}),n},"maxSatisfying");xon.exports=Ewo});var kon=I((Feu,Ron)=>{"use strict";p();var _wo=bA(),vwo=Rx(),Cwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new vwo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new _wo(n,r))}),n},"minSatisfying");Ron.exports=Cwo});var Non=I((qeu,Don)=>{"use strict";p();var YBt=bA(),bwo=Rx(),Pon=sTe(),Swo=a((t,e)=>{t=new bwo(t,e);let r=new YBt("0.0.0");if(t.test(r)||(r=new YBt("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new YBt(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Pon(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Pon(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Don.exports=Swo});var Oon=I((Geu,Mon)=>{"use strict";p();var Two=Rx(),Iwo=a((t,e)=>{try{return new Two(t,e).range||"*"}catch{return null}},"validRange");Mon.exports=Iwo});var tGe=I((Weu,Uon)=>{"use strict";p();var xwo=bA(),Fon=aTe(),{ANY:wwo}=Fon,Rwo=Rx(),kwo=lTe(),Lon=sTe(),Bon=KHe(),Pwo=ZHe(),Dwo=JHe(),Nwo=a((t,e,r,n)=>{t=new xwo(t,n),e=new Rwo(e,n);let o,s,c,l,u;switch(r){case">":o=Lon,s=Pwo,c=Bon,l=">",u=">=";break;case"<":o=Bon,s=Dwo,c=Lon,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kwo(t,e,n))return!1;for(let d=0;d{g.semver===wwo&&(g=new Fon(">=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");Uon.exports=Nwo});var qon=I((Keu,Qon)=>{"use strict";p();var Mwo=tGe(),Owo=a((t,e,r)=>Mwo(t,e,">",r),"gtr");Qon.exports=Owo});var Hon=I((Xeu,jon)=>{"use strict";p();var Lwo=tGe(),Bwo=a((t,e,r)=>Lwo(t,e,"<",r),"ltr");jon.exports=Bwo});var Von=I((rtu,$on)=>{"use strict";p();var Gon=Rx(),Fwo=a((t,e,r)=>(t=new Gon(t,r),e=new Gon(e,r),t.intersects(e,r)),"intersects");$on.exports=Fwo});var zon=I((otu,Won)=>{"use strict";p();var Uwo=lTe(),Qwo=wx();Won.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Qwo(f,h,r));for(let f of c)Uwo(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 Yon=Rx(),ZBt=aTe(),{ANY:KBt}=ZBt,JBt=lTe(),XBt=wx(),qwo=a((t,e,r={})=>{if(t===e)return!0;t=new Yon(t,r),e=new Yon(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Hwo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),jwo=[new ZBt(">=0.0.0-0")],Kon=[new ZBt(">=0.0.0")],Hwo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===KBt){if(e.length===1&&e[0].semver===KBt)return!0;r.includePrerelease?t=jwo:t=Kon}if(e.length===1&&e[0].semver===KBt){if(r.includePrerelease)return!0;e=Kon}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=Jon(o,g,r):g.operator==="<"||g.operator==="<="?s=Zon(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=XBt(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&&!JBt(g,String(o),r)||s&&!JBt(g,String(s),r))return null;for(let A of e)if(!JBt(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=Jon(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=Zon(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"),Jon=a((t,e,r)=>{if(!t)return e;let n=XBt(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Zon=a((t,e,r)=>{if(!t)return e;let n=XBt(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Xon.exports=qwo});var AP=I((utu,nsn)=>{"use strict";p();var e3t=Nce(),tsn=Dce(),Gwo=bA(),rsn=BBt(),$wo=X7(),Vwo=Iin(),Wwo=win(),zwo=Pin(),Ywo=Min(),Kwo=Lin(),Jwo=Fin(),Zwo=Qin(),Xwo=jin(),eRo=wx(),tRo=Vin(),rRo=zin(),nRo=YHe(),iRo=Zin(),oRo=eon(),sRo=sTe(),aRo=KHe(),cRo=QBt(),lRo=qBt(),uRo=JHe(),dRo=ZHe(),fRo=jBt(),pRo=lon(),hRo=don(),mRo=aTe(),gRo=Rx(),ARo=lTe(),yRo=Ion(),ERo=won(),_Ro=kon(),vRo=Non(),CRo=Oon(),bRo=tGe(),SRo=qon(),TRo=Hon(),IRo=Von(),xRo=zon(),wRo=esn();nsn.exports={parse:$wo,valid:Vwo,clean:Wwo,inc:zwo,diff:Ywo,major:Kwo,minor:Jwo,patch:Zwo,prerelease:Xwo,compare:eRo,rcompare:tRo,compareLoose:rRo,compareBuild:nRo,sort:iRo,rsort:oRo,gt:sRo,lt:aRo,eq:cRo,neq:lRo,gte:uRo,lte:dRo,cmp:fRo,coerce:pRo,truncate:hRo,Comparator:mRo,Range:gRo,satisfies:ARo,toComparators:yRo,maxSatisfying:ERo,minSatisfying:_Ro,minVersion:vRo,validRange:CRo,outside:bRo,gtr:SRo,ltr:TRo,intersects:IRo,simplifyRange:xRo,subset:wRo,SemVer:Gwo,re:e3t.re,src:e3t.src,tokens:e3t.t,SEMVER_SPEC_VERSION:tsn.SEMVER_SPEC_VERSION,RELEASE_TYPES:tsn.RELEASE_TYPES,compareIdentifiers:rsn.compareIdentifiers,rcompareIdentifiers:rsn.rcompareIdentifiers}});var osn=I((ftu,isn)=>{p();var RRo=AP();isn.exports=RRo.satisfies(process.version,">=15.7.0")});var asn=I((htu,ssn)=>{p();var kRo=AP();ssn.exports=kRo.satisfies(process.version,">=16.9.0")});var t3t=I((gtu,csn)=>{p();var PRo=osn(),DRo=asn(),NRo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},MRo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};csn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=NRo[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(PRo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=MRo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(DRo){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 r3t=I((ytu,lsn)=>{p();var ORo=AP();lsn.exports=ORo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var fsn=I((_tu,dsn)=>{p();var pu=iTe(),LRo=PBt(),usn=DBt(),BRo=kBt(),FRo=MBt(),URo=t3t(),QRo=r3t(),qRo=UHe(),{KeyObject:jRo,createSecretKey:HRo,createPublicKey:GRo}=require("crypto"),n3t=["RS256","RS384","RS512"],$Ro=["ES256","ES384","ES512"],i3t=["RS256","RS384","RS512"],VRo=["HS256","HS384","HS512"];QRo&&(n3t.splice(n3t.length,0,"PS256","PS384","PS512"),i3t.splice(i3t.length,0,"PS256","PS384","PS512"));dsn.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 pu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new pu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new pu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new pu("jwt must be provided"));if(typeof t!="string")return o(new pu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new pu("jwt malformed"));let l;try{l=BRo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new pu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new pu("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 pu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new pu("jwt signature is required"));if(m&&!h)return o(new pu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new pu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof jRo))try{h=GRo(h)}catch{try{h=HRo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new pu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=VRo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=i3t:h.asymmetricKeyType==="ec"?r.algorithms=$Ro:r.algorithms=n3t),r.algorithms.indexOf(l.header.alg)===-1)return o(new pu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new pu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new pu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{URo(u.alg,h)}catch(y){return o(y)}let g;try{g=qRo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new pu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new pu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new LRo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new pu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new usn("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 pu("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 pu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new pu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new pu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new pu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new pu("iat required when maxAge is specified"));let y=FRo(r.maxAge,A.iat);if(typeof y>"u")return o(new pu('"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 usn("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 ysn=I((btu,Asn)=>{p();var psn=1/0,msn=9007199254740991,WRo=17976931348623157e292,hsn=NaN,zRo="[object Arguments]",YRo="[object Function]",KRo="[object GeneratorFunction]",JRo="[object String]",ZRo="[object Symbol]",XRo=/^\s+|\s+$/g,eko=/^[-+]0x[0-9a-f]+$/i,tko=/^0b[01]+$/i,rko=/^0o[0-7]+$/i,nko=/^(?:0|[1-9]\d*)$/,iko=parseInt;function oko(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&ako(t,e,r)>-1}a(Eko,"includes");function _ko(t){return vko(t)&&s3t.call(t,"callee")&&(!fko.call(t,"callee")||nGe.call(t)==zRo)}a(_ko,"isArguments");var gsn=Array.isArray;function a3t(t){return t!=null&&bko(t.length)&&!Cko(t)}a(a3t,"isArrayLike");function vko(t){return c3t(t)&&a3t(t)}a(vko,"isArrayLikeObject");function Cko(t){var e=o3t(t)?nGe.call(t):"";return e==YRo||e==KRo}a(Cko,"isFunction");function bko(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=msn}a(bko,"isLength");function o3t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(o3t,"isObject");function c3t(t){return!!t&&typeof t=="object"}a(c3t,"isObjectLike");function Sko(t){return typeof t=="string"||!gsn(t)&&c3t(t)&&nGe.call(t)==JRo}a(Sko,"isString");function Tko(t){return typeof t=="symbol"||c3t(t)&&nGe.call(t)==ZRo}a(Tko,"isSymbol");function Iko(t){if(!t)return t===0?t:0;if(t=wko(t),t===psn||t===-psn){var e=t<0?-1:1;return e*WRo}return t===t?t:0}a(Iko,"toFinite");function xko(t){var e=Iko(t),r=e%1;return e===e?r?e-r:e:0}a(xko,"toInteger");function wko(t){if(typeof t=="number")return t;if(Tko(t))return hsn;if(o3t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=o3t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(XRo,"");var r=tko.test(t);return r||rko.test(t)?iko(t.slice(2),r?2:8):eko.test(t)?hsn:+t}a(wko,"toNumber");function Rko(t){return a3t(t)?mko(t):gko(t)}a(Rko,"keys");function kko(t){return t?uko(t,Rko(t)):[]}a(kko,"values");Asn.exports=Eko});var _sn=I((Itu,Esn)=>{p();var Pko="[object Boolean]",Dko=Object.prototype,Nko=Dko.toString;function Mko(t){return t===!0||t===!1||Oko(t)&&Nko.call(t)==Pko}a(Mko,"isBoolean");function Oko(t){return!!t&&typeof t=="object"}a(Oko,"isObjectLike");Esn.exports=Mko});var Tsn=I((Rtu,Ssn)=>{p();var vsn=1/0,Lko=17976931348623157e292,Csn=NaN,Bko="[object Symbol]",Fko=/^\s+|\s+$/g,Uko=/^[-+]0x[0-9a-f]+$/i,Qko=/^0b[01]+$/i,qko=/^0o[0-7]+$/i,jko=parseInt,Hko=Object.prototype,Gko=Hko.toString;function $ko(t){return typeof t=="number"&&t==Yko(t)}a($ko,"isInteger");function bsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(bsn,"isObject");function Vko(t){return!!t&&typeof t=="object"}a(Vko,"isObjectLike");function Wko(t){return typeof t=="symbol"||Vko(t)&&Gko.call(t)==Bko}a(Wko,"isSymbol");function zko(t){if(!t)return t===0?t:0;if(t=Kko(t),t===vsn||t===-vsn){var e=t<0?-1:1;return e*Lko}return t===t?t:0}a(zko,"toFinite");function Yko(t){var e=zko(t),r=e%1;return e===e?r?e-r:e:0}a(Yko,"toInteger");function Kko(t){if(typeof t=="number")return t;if(Wko(t))return Csn;if(bsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=bsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Fko,"");var r=Qko.test(t);return r||qko.test(t)?jko(t.slice(2),r?2:8):Uko.test(t)?Csn:+t}a(Kko,"toNumber");Ssn.exports=$ko});var xsn=I((Dtu,Isn)=>{p();var Jko="[object Number]",Zko=Object.prototype,Xko=Zko.toString;function ePo(t){return!!t&&typeof t=="object"}a(ePo,"isObjectLike");function tPo(t){return typeof t=="number"||ePo(t)&&Xko.call(t)==Jko}a(tPo,"isNumber");Isn.exports=tPo});var Psn=I((Otu,ksn)=>{p();var rPo="[object Object]";function nPo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(nPo,"isHostObject");function iPo(t,e){return function(r){return t(e(r))}}a(iPo,"overArg");var oPo=Function.prototype,wsn=Object.prototype,Rsn=oPo.toString,sPo=wsn.hasOwnProperty,aPo=Rsn.call(Object),cPo=wsn.toString,lPo=iPo(Object.getPrototypeOf,Object);function uPo(t){return!!t&&typeof t=="object"}a(uPo,"isObjectLike");function dPo(t){if(!uPo(t)||cPo.call(t)!=rPo||nPo(t))return!1;var e=lPo(t);if(e===null)return!0;var r=sPo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Rsn.call(r)==aPo}a(dPo,"isPlainObject");ksn.exports=dPo});var Nsn=I((Ftu,Dsn)=>{p();var fPo="[object String]",pPo=Object.prototype,hPo=pPo.toString,mPo=Array.isArray;function gPo(t){return!!t&&typeof t=="object"}a(gPo,"isObjectLike");function APo(t){return typeof t=="string"||!mPo(t)&&gPo(t)&&hPo.call(t)==fPo}a(APo,"isString");Dsn.exports=APo});var Fsn=I((qtu,Bsn)=>{p();var yPo="Expected a function",Msn=1/0,EPo=17976931348623157e292,Osn=NaN,_Po="[object Symbol]",vPo=/^\s+|\s+$/g,CPo=/^[-+]0x[0-9a-f]+$/i,bPo=/^0b[01]+$/i,SPo=/^0o[0-7]+$/i,TPo=parseInt,IPo=Object.prototype,xPo=IPo.toString;function wPo(t,e){var r;if(typeof e!="function")throw new TypeError(yPo);return t=NPo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(wPo,"before");function RPo(t){return wPo(2,t)}a(RPo,"once");function Lsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Lsn,"isObject");function kPo(t){return!!t&&typeof t=="object"}a(kPo,"isObjectLike");function PPo(t){return typeof t=="symbol"||kPo(t)&&xPo.call(t)==_Po}a(PPo,"isSymbol");function DPo(t){if(!t)return t===0?t:0;if(t=MPo(t),t===Msn||t===-Msn){var e=t<0?-1:1;return e*EPo}return t===t?t:0}a(DPo,"toFinite");function NPo(t){var e=DPo(t),r=e%1;return e===e?r?e-r:e:0}a(NPo,"toInteger");function MPo(t){if(typeof t=="number")return t;if(PPo(t))return Osn;if(Lsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(vPo,"");var r=bPo.test(t);return r||SPo.test(t)?TPo(t.slice(2),r?2:8):CPo.test(t)?Osn:+t}a(MPo,"toNumber");Bsn.exports=RPo});var Wsn=I((Gtu,Vsn)=>{p();var Usn=MBt(),OPo=r3t(),LPo=t3t(),Qsn=UHe(),BPo=ysn(),iGe=_sn(),qsn=Tsn(),l3t=xsn(),Hsn=Psn(),eQ=Nsn(),FPo=Fsn(),{KeyObject:UPo,createSecretKey:QPo,createPrivateKey:qPo}=require("crypto"),Gsn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];OPo&&Gsn.splice(3,0,"PS256","PS384","PS512");var jPo={expiresIn:{isValid:a(function(t){return qsn(t)||eQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return qsn(t)||eQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return eQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:BPo.bind(null,Gsn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Hsn,message:'"header" must be an object'},encoding:{isValid:eQ,message:'"encoding" must be a string'},issuer:{isValid:eQ,message:'"issuer" must be a string'},subject:{isValid:eQ,message:'"subject" must be a string'},jwtid:{isValid:eQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:iGe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:eQ,message:'"keyid" must be a string'},mutatePayload:{isValid:iGe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:iGe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:iGe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},HPo={iat:{isValid:l3t,message:'"iat" should be a number of seconds'},exp:{isValid:l3t,message:'"exp" should be a number of seconds'},nbf:{isValid:l3t,message:'"nbf" should be a number of seconds'}};function $sn(t,e,r,n){if(!Hsn(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($sn,"validate");function GPo(t){return $sn(jPo,!1,t,"options")}a(GPo,"validateOptions");function $Po(t){return $sn(HPo,!0,t,"payload")}a($Po,"validatePayload");var jsn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},VPo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Vsn.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 UPo))try{e=qPo(e)}catch{try{e=QPo(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{$Po(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=VPo.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{GPo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{LPo(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=Usn(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=Usn(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(jsn).forEach(function(d){let f=jsn[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&&FPo(n),Qsn.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=Qsn.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 Ysn=I((Wtu,zsn)=>{p();zsn.exports={decode:kBt(),verify:fsn(),sign:Wsn(),JsonWebTokenError:iTe(),NotBeforeError:PBt(),TokenExpiredError:DBt()}});var Q3t=I((qlu,Yan)=>{p();function z2o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=NBt(),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();CS.formatArgs=K2o;CS.save=J2o;CS.load=Z2o;CS.useColors=Y2o;CS.storage=X2o();CS.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`."))}})();CS.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 Y2o(){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(Y2o,"useColors");function K2o(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+OGe.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(K2o,"formatArgs");CS.log=console.debug||console.log||(()=>{});function J2o(t){try{t?CS.storage.setItem("debug",t):CS.storage.removeItem("debug")}catch{}}a(J2o,"save");function Z2o(){let t;try{t=CS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Z2o,"load");function X2o(){try{return localStorage}catch{}}a(X2o,"localstorage");OGe.exports=Q3t()(CS);var{formatters:eDo}=OGe.exports;eDo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Zan=I((Vlu,Jan)=>{"use strict";p();Jan.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 tDo=require("os"),Xan=require("tty"),Px=Zan(),{env:og}=process,nQ;Px("no-color")||Px("no-colors")||Px("color=false")||Px("color=never")?nQ=0:(Px("color")||Px("colors")||Px("color=true")||Px("color=always"))&&(nQ=1);"FORCE_COLOR"in og&&(og.FORCE_COLOR==="true"?nQ=1:og.FORCE_COLOR==="false"?nQ=0:nQ=og.FORCE_COLOR.length===0?1:Math.min(parseInt(og.FORCE_COLOR,10),3));function q3t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(q3t,"translateLevel");function j3t(t,e){if(nQ===0)return 0;if(Px("color=16m")||Px("color=full")||Px("color=truecolor"))return 3;if(Px("color=256"))return 2;if(t&&!e&&nQ===void 0)return 0;let r=nQ||0;if(og.TERM==="dumb")return r;if(process.platform==="win32"){let n=tDo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in og)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in og)||og.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in og)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(og.TEAMCITY_VERSION)?1:0;if(og.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in og){let n=parseInt((og.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(og.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(og.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(og.TERM)||"COLORTERM"in og?1:r}a(j3t,"supportsColor");function rDo(t){let e=j3t(t,t&&t.isTTY);return q3t(e)}a(rDo,"getSupportLevel");ecn.exports={supportsColor:rDo,stdout:q3t(j3t(!0,Xan.isatty(1))),stderr:q3t(j3t(!0,Xan.isatty(2)))}});var rcn=I((IA,FGe)=>{p();var nDo=require("tty"),BGe=require("util");IA.init=uDo;IA.log=aDo;IA.formatArgs=oDo;IA.save=cDo;IA.load=lDo;IA.useColors=iDo;IA.destroy=BGe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");IA.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(IA.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{}IA.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 iDo(){return"colors"in IA.inspectOpts?!!IA.inspectOpts.colors:nDo.isatty(process.stderr.fd)}a(iDo,"useColors");function oDo(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".`,oTe="secret must be a string or buffer",xce="key must be a string or a buffer",rIo="key must be a string, a buffer or an object",RBt=typeof Rx.createPublicKey=="function";RBt&&(xce+=" or a KeyObject",oTe+="or a KeyObject");function Qnn(t){if(!wce.isBuffer(t)&&typeof t!="string"&&(!RBt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw yP(xce)}a(Qnn,"checkIsPublicKey");function qnn(t){if(!wce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw yP(rIo)}a(qnn,"checkIsPrivateKey");function nIo(t){if(!wce.isBuffer(t)){if(typeof t=="string")return t;if(!RBt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw yP(oTe)}}a(nIo,"checkIsSecretKey");function kBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(kBt,"fromBase64");function jnn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var pIo=require("buffer").Buffer;Wnn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||pIo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Xnn=I((MZl,Znn)=>{p();var hIo=Ice().Buffer,znn=TBt(),mIo=PBt(),gIo=require("stream"),Ynn=DBt(),NBt=require("util");function Knn(t,e){return hIo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Knn,"base64url");function AIo(t,e,r){r=r||"utf8";var n=Knn(Ynn(t),"binary"),o=Knn(Ynn(e),r);return NBt.format("%s.%s",n,o)}a(AIo,"jwsSecuredInput");function Jnn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=mIo(e.alg),c=AIo(e,r,o),l=s.sign(c,n);return NBt.format("%s.%s",c,l)}a(Jnn,"jwsSign");function jHe(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 znn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new znn(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(jHe,"SignStream");NBt.inherits(jHe,gIo);jHe.prototype.sign=a(function(){try{var e=Jnn({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");jHe.sign=Jnn;Znn.exports=jHe});var lin=I((BZl,cin)=>{p();var tin=Ice().Buffer,ein=TBt(),yIo=PBt(),EIo=require("stream"),rin=DBt(),_Io=require("util"),vIo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function CIo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(CIo,"isObject");function bIo(t){if(CIo(t))return t;try{return JSON.parse(t)}catch{return}}a(bIo,"safeJsonParse");function nin(t){var e=t.split(".",1)[0];return bIo(tin.from(e,"base64").toString("binary"))}a(nin,"headerFromJWS");function SIo(t){return t.split(".",2).join(".")}a(SIo,"securedInputFromJWS");function iin(t){return t.split(".")[2]}a(iin,"signatureFromJWS");function TIo(t,e){e=e||"utf8";var r=t.split(".")[1];return tin.from(r,"base64").toString(e)}a(TIo,"payloadFromJWS");function oin(t){return vIo.test(t)&&!!nin(t)}a(oin,"isValidJws");function sin(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=rin(t);var o=iin(t),s=SIo(t),c=yIo(e);return c.verify(s,o,r)}a(sin,"jwsVerify");function ain(t,e){if(e=e||{},t=rin(t),!oin(t))return null;var r=nin(t);if(!r)return null;var n=TIo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:iin(t)}}a(ain,"jwsDecode");function Rce(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 ein(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new ein(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(Rce,"VerifyStream");_Io.inherits(Rce,EIo);Rce.prototype.verify=a(function(){try{var e=sin(this.signature.buffer,this.algorithm,this.key.buffer),r=ain(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");Rce.decode=ain;Rce.isValid=oin;Rce.verify=sin;cin.exports=Rce});var GHe=I(eQ=>{p();var uin=Xnn(),HHe=lin(),IIo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];eQ.ALGORITHMS=IIo;eQ.sign=uin.sign;eQ.verify=HHe.verify;eQ.decode=HHe.decode;eQ.isValid=HHe.isValid;eQ.createSign=a(function(e){return new uin(e)},"createSign");eQ.createVerify=a(function(e){return new HHe(e)},"createVerify")});var MBt=I((HZl,din)=>{p();var xIo=GHe();din.exports=function(t,e){e=e||{};var r=xIo.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 aTe=I(($Zl,fin)=>{p();var $He=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");$He.prototype=Object.create(Error.prototype);$He.prototype.constructor=$He;fin.exports=$He});var OBt=I((zZl,hin)=>{p();var pin=aTe(),VHe=a(function(t,e){pin.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");VHe.prototype=Object.create(pin.prototype);VHe.prototype.constructor=VHe;hin.exports=VHe});var LBt=I((JZl,gin)=>{p();var min=aTe(),WHe=a(function(t,e){min.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");WHe.prototype=Object.create(min.prototype);WHe.prototype.constructor=WHe;gin.exports=WHe});var BBt=I((eXl,Ain)=>{p();var kce=1e3,Pce=kce*60,Dce=Pce*60,IY=Dce*24,wIo=IY*7,RIo=IY*365.25;Ain.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return kIo(t);if(r==="number"&&isFinite(t))return e.long?DIo(t):PIo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function kIo(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*RIo;case"weeks":case"week":case"w":return r*wIo;case"days":case"day":case"d":return r*IY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Dce;case"minutes":case"minute":case"mins":case"min":case"m":return r*Pce;case"seconds":case"second":case"secs":case"sec":case"s":return r*kce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(kIo,"parse");function PIo(t){var e=Math.abs(t);return e>=IY?Math.round(t/IY)+"d":e>=Dce?Math.round(t/Dce)+"h":e>=Pce?Math.round(t/Pce)+"m":e>=kce?Math.round(t/kce)+"s":t+"ms"}a(PIo,"fmtShort");function DIo(t){var e=Math.abs(t);return e>=IY?zHe(t,e,IY,"day"):e>=Dce?zHe(t,e,Dce,"hour"):e>=Pce?zHe(t,e,Pce,"minute"):e>=kce?zHe(t,e,kce,"second"):t+" ms"}a(DIo,"fmtLong");function zHe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(zHe,"plural")});var FBt=I((nXl,yin)=>{p();var NIo=BBt();yin.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=NIo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Nce=I((oXl,Ein)=>{"use strict";p();var MIo="2.0.0",OIo=Number.MAX_SAFE_INTEGER||9007199254740991,LIo=16,BIo=250,FIo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ein.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:LIo,MAX_SAFE_BUILD_LENGTH:BIo,MAX_SAFE_INTEGER:OIo,RELEASE_TYPES:FIo,SEMVER_SPEC_VERSION:MIo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cTe=I((aXl,_in)=>{"use strict";p();var UIo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};_in.exports=UIo});var Mce=I((WM,vin)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:UBt,MAX_SAFE_BUILD_LENGTH:QIo,MAX_LENGTH:qIo}=Nce(),jIo=cTe();WM=vin.exports={};var HIo=WM.re=[],GIo=WM.safeRe=[],xn=WM.src=[],$Io=WM.safeSrc=[],wn=WM.t={},VIo=0,QBt="[a-zA-Z0-9-]",WIo=[["\\s",1],["\\d",qIo],[QBt,QIo]],zIo=a(t=>{for(let[e,r]of WIo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Qo=a((t,e,r)=>{let n=zIo(e),o=VIo++;jIo(t,o,e),wn[t]=o,xn[o]=e,$Io[o]=n,HIo[o]=new RegExp(e,r?"g":void 0),GIo[o]=new RegExp(n,r?"g":void 0)},"createToken");Qo("NUMERICIDENTIFIER","0|[1-9]\\d*");Qo("NUMERICIDENTIFIERLOOSE","\\d+");Qo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${QBt}*`);Qo("MAINVERSION",`(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})`);Qo("MAINVERSIONLOOSE",`(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Qo("PRERELEASEIDENTIFIER",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIER]})`);Qo("PRERELEASEIDENTIFIERLOOSE",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Qo("PRERELEASE",`(?:-(${xn[wn.PRERELEASEIDENTIFIER]}(?:\\.${xn[wn.PRERELEASEIDENTIFIER]})*))`);Qo("PRERELEASELOOSE",`(?:-?(${xn[wn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${xn[wn.PRERELEASEIDENTIFIERLOOSE]})*))`);Qo("BUILDIDENTIFIER",`${QBt}+`);Qo("BUILD",`(?:\\+(${xn[wn.BUILDIDENTIFIER]}(?:\\.${xn[wn.BUILDIDENTIFIER]})*))`);Qo("FULLPLAIN",`v?${xn[wn.MAINVERSION]}${xn[wn.PRERELEASE]}?${xn[wn.BUILD]}?`);Qo("FULL",`^${xn[wn.FULLPLAIN]}$`);Qo("LOOSEPLAIN",`[v=\\s]*${xn[wn.MAINVERSIONLOOSE]}${xn[wn.PRERELEASELOOSE]}?${xn[wn.BUILD]}?`);Qo("LOOSE",`^${xn[wn.LOOSEPLAIN]}$`);Qo("GTLT","((?:<|>)?=?)");Qo("XRANGEIDENTIFIERLOOSE",`${xn[wn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Qo("XRANGEIDENTIFIER",`${xn[wn.NUMERICIDENTIFIER]}|x|X|\\*`);Qo("XRANGEPLAIN",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:${xn[wn.PRERELEASE]})?${xn[wn.BUILD]}?)?)?`);Qo("XRANGEPLAINLOOSE",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:${xn[wn.PRERELEASELOOSE]})?${xn[wn.BUILD]}?)?)?`);Qo("XRANGE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAIN]}$`);Qo("XRANGELOOSE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAINLOOSE]}$`);Qo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${UBt}})(?:\\.(\\d{1,${UBt}}))?(?:\\.(\\d{1,${UBt}}))?`);Qo("COERCE",`${xn[wn.COERCEPLAIN]}(?:$|[^\\d])`);Qo("COERCEFULL",xn[wn.COERCEPLAIN]+`(?:${xn[wn.PRERELEASE]})?(?:${xn[wn.BUILD]})?(?:$|[^\\d])`);Qo("COERCERTL",xn[wn.COERCE],!0);Qo("COERCERTLFULL",xn[wn.COERCEFULL],!0);Qo("LONETILDE","(?:~>?)");Qo("TILDETRIM",`(\\s*)${xn[wn.LONETILDE]}\\s+`,!0);WM.tildeTrimReplace="$1~";Qo("TILDE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAIN]}$`);Qo("TILDELOOSE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAINLOOSE]}$`);Qo("LONECARET","(?:\\^)");Qo("CARETTRIM",`(\\s*)${xn[wn.LONECARET]}\\s+`,!0);WM.caretTrimReplace="$1^";Qo("CARET",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAIN]}$`);Qo("CARETLOOSE",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAINLOOSE]}$`);Qo("COMPARATORLOOSE",`^${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]})$|^$`);Qo("COMPARATOR",`^${xn[wn.GTLT]}\\s*(${xn[wn.FULLPLAIN]})$|^$`);Qo("COMPARATORTRIM",`(\\s*)${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]}|${xn[wn.XRANGEPLAIN]})`,!0);WM.comparatorTrimReplace="$1$2$3";Qo("HYPHENRANGE",`^\\s*(${xn[wn.XRANGEPLAIN]})\\s+-\\s+(${xn[wn.XRANGEPLAIN]})\\s*$`);Qo("HYPHENRANGELOOSE",`^\\s*(${xn[wn.XRANGEPLAINLOOSE]})\\s+-\\s+(${xn[wn.XRANGEPLAINLOOSE]})\\s*$`);Qo("STAR","(<|>)?=?\\s*\\*");Qo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Qo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var YHe=I((dXl,Cin)=>{"use strict";p();var YIo=Object.freeze({loose:!0}),KIo=Object.freeze({}),JIo=a(t=>t?typeof t!="object"?YIo:t:KIo,"parseOptions");Cin.exports=JIo});var qBt=I((hXl,Tin)=>{"use strict";p();var bin=/^[0-9]+$/,Sin=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tSin(e,t),"rcompareIdentifiers");Tin.exports={compareIdentifiers:Sin,rcompareIdentifiers:ZIo}});var SA=I((AXl,xin)=>{"use strict";p();var KHe=cTe(),{MAX_LENGTH:Iin,MAX_SAFE_INTEGER:JHe}=Nce(),{safeRe:ZHe,t:XHe}=Mce(),XIo=YHe(),{compareIdentifiers:jBt}=qBt(),exo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nIin)throw new TypeError(`version is longer than ${Iin} characters`);KHe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?ZHe[XHe.LOOSE]:ZHe[XHe.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>JHe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>JHe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>JHe||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(KHe("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 jBt(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(KHe("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 jBt(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?ZHe[XHe.PRERELEASELOOSE]:ZHe[XHe.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];if(n===!1&&(s=[r]),exo(this.prerelease,r)){let c=this.prerelease[r.split(".").length];isNaN(c)&&(this.prerelease=s)}else 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}};xin.exports=HBt});var tQ=I((_Xl,Rin)=>{"use strict";p();var win=SA(),txo=a((t,e,r=!1)=>{if(t instanceof win)return t;try{return new win(t,e)}catch(n){if(!r)return null;throw n}},"parse");Rin.exports=txo});var Pin=I((bXl,kin)=>{"use strict";p();var rxo=tQ(),nxo=a((t,e)=>{let r=rxo(t,e);return r?r.version:null},"valid");kin.exports=nxo});var Nin=I((IXl,Din)=>{"use strict";p();var ixo=tQ(),oxo=a((t,e)=>{let r=ixo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");Din.exports=oxo});var Lin=I((RXl,Oin)=>{"use strict";p();var Min=SA(),sxo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Min(t instanceof Min?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Oin.exports=sxo});var Uin=I((DXl,Fin)=>{"use strict";p();var Bin=tQ(),axo=a((t,e)=>{let r=Bin(t,null,!0),n=Bin(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");Fin.exports=axo});var qin=I((OXl,Qin)=>{"use strict";p();var cxo=SA(),lxo=a((t,e)=>new cxo(t,e).major,"major");Qin.exports=lxo});var Hin=I((FXl,jin)=>{"use strict";p();var uxo=SA(),dxo=a((t,e)=>new uxo(t,e).minor,"minor");jin.exports=dxo});var $in=I((qXl,Gin)=>{"use strict";p();var fxo=SA(),pxo=a((t,e)=>new fxo(t,e).patch,"patch");Gin.exports=pxo});var Win=I((GXl,Vin)=>{"use strict";p();var hxo=tQ(),mxo=a((t,e)=>{let r=hxo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Vin.exports=mxo});var kx=I((WXl,Yin)=>{"use strict";p();var zin=SA(),gxo=a((t,e,r)=>new zin(t,r).compare(new zin(e,r)),"compare");Yin.exports=gxo});var Jin=I((KXl,Kin)=>{"use strict";p();var Axo=kx(),yxo=a((t,e,r)=>Axo(e,t,r),"rcompare");Kin.exports=yxo});var Xin=I((XXl,Zin)=>{"use strict";p();var Exo=kx(),_xo=a((t,e)=>Exo(t,e,!0),"compareLoose");Zin.exports=_xo});var eGe=I((reu,ton)=>{"use strict";p();var eon=SA(),vxo=a((t,e,r)=>{let n=new eon(t,r),o=new eon(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");ton.exports=vxo});var non=I((oeu,ron)=>{"use strict";p();var Cxo=eGe(),bxo=a((t,e)=>t.sort((r,n)=>Cxo(r,n,e)),"sort");ron.exports=bxo});var oon=I((ceu,ion)=>{"use strict";p();var Sxo=eGe(),Txo=a((t,e)=>t.sort((r,n)=>Sxo(n,r,e)),"rsort");ion.exports=Txo});var lTe=I((deu,son)=>{"use strict";p();var Ixo=kx(),xxo=a((t,e,r)=>Ixo(t,e,r)>0,"gt");son.exports=xxo});var tGe=I((heu,aon)=>{"use strict";p();var wxo=kx(),Rxo=a((t,e,r)=>wxo(t,e,r)<0,"lt");aon.exports=Rxo});var GBt=I((Aeu,con)=>{"use strict";p();var kxo=kx(),Pxo=a((t,e,r)=>kxo(t,e,r)===0,"eq");con.exports=Pxo});var $Bt=I((_eu,lon)=>{"use strict";p();var Dxo=kx(),Nxo=a((t,e,r)=>Dxo(t,e,r)!==0,"neq");lon.exports=Nxo});var rGe=I((beu,uon)=>{"use strict";p();var Mxo=kx(),Oxo=a((t,e,r)=>Mxo(t,e,r)>=0,"gte");uon.exports=Oxo});var nGe=I((Ieu,don)=>{"use strict";p();var Lxo=kx(),Bxo=a((t,e,r)=>Lxo(t,e,r)<=0,"lte");don.exports=Bxo});var VBt=I((Reu,fon)=>{"use strict";p();var Fxo=GBt(),Uxo=$Bt(),Qxo=lTe(),qxo=rGe(),jxo=tGe(),Hxo=nGe(),Gxo=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 Fxo(t,r,n);case"!=":return Uxo(t,r,n);case">":return Qxo(t,r,n);case">=":return qxo(t,r,n);case"<":return jxo(t,r,n);case"<=":return Hxo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");fon.exports=Gxo});var hon=I((Deu,pon)=>{"use strict";p();var $xo=SA(),Vxo=tQ(),{safeRe:iGe,t:oGe}=Mce(),Wxo=a((t,e)=>{if(t instanceof $xo)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?iGe[oGe.COERCEFULL]:iGe[oGe.COERCE]);else{let u=e.includePrerelease?iGe[oGe.COERCERTLFULL]:iGe[oGe.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 Vxo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");pon.exports=Wxo});var gon=I((Oeu,mon)=>{"use strict";p();var zxo=tQ(),Yxo=Nce(),Kxo=SA(),Jxo=a((t,e,r)=>{if(!Yxo.RELEASE_TYPES.includes(e))return null;let n=Zxo(t,r);return n&&Xxo(n,e)},"truncate"),Zxo=a((t,e)=>{let r=t instanceof Kxo?t.version:t;return zxo(r,e)},"cloneInputVersion"),Xxo=a((t,e)=>{if(ewo(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"),ewo=a(t=>t.startsWith("pre"),"isPrerelease");mon.exports=Jxo});var yon=I((Feu,Aon)=>{"use strict";p();var WBt=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}};Aon.exports=WBt});var Px=I((qeu,Con)=>{"use strict";p();var two=/\s+/g,zBt=class t{static{a(this,"Range")}constructor(e,r){if(r=nwo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof YBt)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(two," "),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=>!_on(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&&fwo(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(dwo,"");let n=((this.options.includePrerelease&&lwo)|(this.options.loose&&uwo))+":"+e,o=Eon.get(n);if(o)return o;let s=this.options.loose,c=s?M_[TA.HYPHENRANGELOOSE]:M_[TA.HYPHENRANGE];e=e.replace(c,bwo(this.options.includePrerelease)),Ju("hyphen replace",e),e=e.replace(M_[TA.COMPARATORTRIM],swo),Ju("comparator trim",e),e=e.replace(M_[TA.TILDETRIM],awo),Ju("tilde trim",e),e=e.replace(M_[TA.CARETTRIM],cwo),Ju("caret trim",e);let l=e.split(" ").map(h=>pwo(h,this.options)).join(" ").split(/\s+/).map(h=>Cwo(h,this.options));s&&(l=l.filter(h=>(Ju("loose invalid filter",h,this.options),!!h.match(M_[TA.COMPARATORLOOSE])))),Ju("range list",l);let u=new Map,d=l.map(h=>new YBt(h,this.options));for(let h of d){if(_on(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return Eon.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>von(n,r)&&e.set.some(o=>von(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 iwo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),fwo=a(t=>t.value==="","isAny"),von=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"),pwo=a((t,e)=>(t=t.replace(M_[TA.BUILD],""),Ju("comp",t,e),t=Awo(t,e),Ju("caret",t),t=mwo(t,e),Ju("tildes",t),t=Ewo(t,e),Ju("xrange",t),t=vwo(t,e),Ju("stars",t),t),"parseComparator"),o0=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),hwo=a((t,e,r)=>o0(t)&&!o0(e)||o0(e)&&r&&!o0(r),"invalidXRangeOrder"),mwo=a((t,e)=>t.trim().split(/\s+/).map(r=>gwo(r,e)).join(" "),"replaceTildes"),gwo=a((t,e)=>{let r=e.loose?M_[TA.TILDELOOSE]:M_[TA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ju("tilde",t,o,s,c,l,u);let d;return o0(s)?d="":o0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:o0(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(Ju("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,Ju("tilde return",d),d})},"replaceTilde"),Awo=a((t,e)=>t.trim().split(/\s+/).map(r=>ywo(r,e)).join(" "),"replaceCarets"),ywo=a((t,e)=>{Ju("caret",t,e);let r=e.loose?M_[TA.CARETLOOSE]:M_[TA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ju("caret",t,o,s,c,l,u);let d;return o0(s)?d="":o0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:o0(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Ju("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`):(Ju("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),Ju("caret return",d),d})},"replaceCaret"),Ewo=a((t,e)=>(Ju("replaceXRanges",t,e),t.split(/\s+/).map(r=>_wo(r,e)).join(" ")),"replaceXRanges"),_wo=a((t,e)=>{t=t.trim();let r=e.loose?M_[TA.XRANGELOOSE]:M_[TA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(Ju("xRange",t,n,o,s,c,l,u),hwo(s,c,l))return t;let d=o0(s),f=d||o0(c),h=f||o0(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`),Ju("xRange return",n),n})},"replaceXRange"),vwo=a((t,e)=>(Ju("replaceStars",t,e),t.trim().replace(M_[TA.STAR],"")),"replaceStars"),Cwo=a((t,e)=>(Ju("replaceGTE0",t,e),t.trim().replace(M_[e.includePrerelease?TA.GTE0PRE:TA.GTE0],"")),"replaceGTE0"),bwo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(o0(n)?r="":o0(o)?r=`>=${n}.0.0${t?"-0":""}`:o0(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,o0(d)?u="":o0(f)?u=`<${+d+1}.0.0-0`:o0(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"),Swo=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 uTe=I((Geu,won)=>{"use strict";p();var dTe=Symbol("SemVer ANY"),ZBt=class t{static{a(this,"Comparator")}static get ANY(){return dTe}constructor(e,r){if(r=bon(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),JBt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===dTe?this.value="":this.value=this.operator+this.semver.version,JBt("comp",this)}parse(e){let r=this.options.loose?Son[Ton.COMPARATORLOOSE]:Son[Ton.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 Ion(n[2],this.options.loose):this.semver=dTe}toString(){return this.value}test(e){if(JBt("Comparator.test",e,this.options.loose),this.semver===dTe||e===dTe)return!0;if(typeof e=="string")try{e=new Ion(e,this.options)}catch{return!1}return KBt(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 xon(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new xon(this.value,r).test(e.semver):(r=bon(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("=")||KBt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||KBt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};won.exports=ZBt;var bon=YHe(),{safeRe:Son,t:Ton}=Mce(),KBt=VBt(),JBt=cTe(),Ion=SA(),xon=Px()});var fTe=I((Weu,Ron)=>{"use strict";p();var Two=Px(),Iwo=a((t,e,r)=>{try{e=new Two(e,r)}catch{return!1}return e.test(t)},"satisfies");Ron.exports=Iwo});var Pon=I((Keu,kon)=>{"use strict";p();var xwo=Px(),wwo=a((t,e)=>new xwo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");kon.exports=wwo});var Non=I((Xeu,Don)=>{"use strict";p();var Rwo=SA(),kwo=Px(),Pwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new kwo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Rwo(n,r))}),n},"maxSatisfying");Don.exports=Pwo});var Oon=I((rtu,Mon)=>{"use strict";p();var Dwo=SA(),Nwo=Px(),Mwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Nwo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Dwo(n,r))}),n},"minSatisfying");Mon.exports=Mwo});var Fon=I((otu,Bon)=>{"use strict";p();var XBt=SA(),Owo=Px(),Lon=lTe(),Lwo=a((t,e)=>{t=new Owo(t,e);let r=new XBt("0.0.0");if(t.test(r)||(r=new XBt("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new XBt(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Lon(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Lon(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Bon.exports=Lwo});var Qon=I((ctu,Uon)=>{"use strict";p();var Bwo=Px(),Fwo=a((t,e)=>{try{return new Bwo(t,e).range||"*"}catch{return null}},"validRange");Uon.exports=Fwo});var sGe=I((dtu,Gon)=>{"use strict";p();var Uwo=SA(),Hon=uTe(),{ANY:Qwo}=Hon,qwo=Px(),jwo=fTe(),qon=lTe(),jon=tGe(),Hwo=nGe(),Gwo=rGe(),$wo=a((t,e,r,n)=>{t=new Uwo(t,n),e=new qwo(e,n);let o,s,c,l,u;switch(r){case">":o=qon,s=Hwo,c=jon,l=">",u=">=";break;case"<":o=jon,s=Gwo,c=qon,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(jwo(t,e,n))return!1;for(let d=0;d{g.semver===Qwo&&(g=new Hon(">=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");Gon.exports=$wo});var Von=I((htu,$on)=>{"use strict";p();var Vwo=sGe(),Wwo=a((t,e,r)=>Vwo(t,e,">",r),"gtr");$on.exports=Wwo});var zon=I((Atu,Won)=>{"use strict";p();var zwo=sGe(),Ywo=a((t,e,r)=>zwo(t,e,"<",r),"ltr");Won.exports=Ywo});var Jon=I((_tu,Kon)=>{"use strict";p();var Yon=Px(),Kwo=a((t,e,r)=>(t=new Yon(t,r),e=new Yon(e,r),t.intersects(e,r)),"intersects");Kon.exports=Kwo});var Xon=I((btu,Zon)=>{"use strict";p();var Jwo=fTe(),Zwo=kx();Zon.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Zwo(f,h,r));for(let f of c)Jwo(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 esn=Px(),r3t=uTe(),{ANY:e3t}=r3t,t3t=fTe(),n3t=kx(),Xwo=a((t,e,r={})=>{if(t===e)return!0;t=new esn(t,r),e=new esn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=tRo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),eRo=[new r3t(">=0.0.0-0")],tsn=[new r3t(">=0.0.0")],tRo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===e3t){if(e.length===1&&e[0].semver===e3t)return!0;r.includePrerelease?t=eRo:t=tsn}if(e.length===1&&e[0].semver===e3t){if(r.includePrerelease)return!0;e=tsn}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=rsn(o,g,r):g.operator==="<"||g.operator==="<="?s=nsn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=n3t(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&&!t3t(g,String(o),r)||s&&!t3t(g,String(s),r))return null;for(let A of e)if(!t3t(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=rsn(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=nsn(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"),rsn=a((t,e,r)=>{if(!t)return e;let n=n3t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),nsn=a((t,e,r)=>{if(!t)return e;let n=n3t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");isn.exports=Xwo});var EP=I((wtu,csn)=>{"use strict";p();var i3t=Mce(),ssn=Nce(),rRo=SA(),asn=qBt(),nRo=tQ(),iRo=Pin(),oRo=Nin(),sRo=Lin(),aRo=Uin(),cRo=qin(),lRo=Hin(),uRo=$in(),dRo=Win(),fRo=kx(),pRo=Jin(),hRo=Xin(),mRo=eGe(),gRo=non(),ARo=oon(),yRo=lTe(),ERo=tGe(),_Ro=GBt(),vRo=$Bt(),CRo=rGe(),bRo=nGe(),SRo=VBt(),TRo=hon(),IRo=gon(),xRo=uTe(),wRo=Px(),RRo=fTe(),kRo=Pon(),PRo=Non(),DRo=Oon(),NRo=Fon(),MRo=Qon(),ORo=sGe(),LRo=Von(),BRo=zon(),FRo=Jon(),URo=Xon(),QRo=osn();csn.exports={parse:nRo,valid:iRo,clean:oRo,inc:sRo,diff:aRo,major:cRo,minor:lRo,patch:uRo,prerelease:dRo,compare:fRo,rcompare:pRo,compareLoose:hRo,compareBuild:mRo,sort:gRo,rsort:ARo,gt:yRo,lt:ERo,eq:_Ro,neq:vRo,gte:CRo,lte:bRo,cmp:SRo,coerce:TRo,truncate:IRo,Comparator:xRo,Range:wRo,satisfies:RRo,toComparators:kRo,maxSatisfying:PRo,minSatisfying:DRo,minVersion:NRo,validRange:MRo,outside:ORo,gtr:LRo,ltr:BRo,intersects:FRo,simplifyRange:URo,subset:QRo,SemVer:rRo,re:i3t.re,src:i3t.src,tokens:i3t.t,SEMVER_SPEC_VERSION:ssn.SEMVER_SPEC_VERSION,RELEASE_TYPES:ssn.RELEASE_TYPES,compareIdentifiers:asn.compareIdentifiers,rcompareIdentifiers:asn.rcompareIdentifiers}});var usn=I((ktu,lsn)=>{p();var qRo=EP();lsn.exports=qRo.satisfies(process.version,">=15.7.0")});var fsn=I((Dtu,dsn)=>{p();var jRo=EP();dsn.exports=jRo.satisfies(process.version,">=16.9.0")});var o3t=I((Mtu,psn)=>{p();var HRo=usn(),GRo=fsn(),$Ro={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},VRo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};psn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=$Ro[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(HRo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=VRo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(GRo){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 s3t=I((Ltu,hsn)=>{p();var WRo=EP();hsn.exports=WRo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Asn=I((Ftu,gsn)=>{p();var pu=aTe(),zRo=OBt(),msn=LBt(),YRo=MBt(),KRo=FBt(),JRo=o3t(),ZRo=s3t(),XRo=GHe(),{KeyObject:eko,createSecretKey:tko,createPublicKey:rko}=require("crypto"),a3t=["RS256","RS384","RS512"],nko=["ES256","ES384","ES512"],c3t=["RS256","RS384","RS512"],iko=["HS256","HS384","HS512"];ZRo&&(a3t.splice(a3t.length,0,"PS256","PS384","PS512"),c3t.splice(c3t.length,0,"PS256","PS384","PS512"));gsn.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 pu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new pu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new pu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new pu("jwt must be provided"));if(typeof t!="string")return o(new pu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new pu("jwt malformed"));let l;try{l=YRo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new pu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new pu("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 pu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new pu("jwt signature is required"));if(m&&!h)return o(new pu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new pu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof eko))try{h=rko(h)}catch{try{h=tko(typeof h=="string"?Buffer.from(h):h)}catch{return o(new pu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=iko:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=c3t:h.asymmetricKeyType==="ec"?r.algorithms=nko:r.algorithms=a3t),r.algorithms.indexOf(l.header.alg)===-1)return o(new pu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new pu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new pu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{JRo(u.alg,h)}catch(y){return o(y)}let g;try{g=XRo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new pu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new pu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new zRo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new pu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new msn("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 pu("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 pu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new pu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new pu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new pu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new pu("iat required when maxAge is specified"));let y=KRo(r.maxAge,A.iat);if(typeof y>"u")return o(new pu('"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 msn("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 bsn=I((qtu,Csn)=>{p();var ysn=1/0,_sn=9007199254740991,oko=17976931348623157e292,Esn=NaN,sko="[object Arguments]",ako="[object Function]",cko="[object GeneratorFunction]",lko="[object String]",uko="[object Symbol]",dko=/^\s+|\s+$/g,fko=/^[-+]0x[0-9a-f]+$/i,pko=/^0b[01]+$/i,hko=/^0o[0-7]+$/i,mko=/^(?:0|[1-9]\d*)$/,gko=parseInt;function Ako(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&Eko(t,e,r)>-1}a(Pko,"includes");function Dko(t){return Nko(t)&&u3t.call(t,"callee")&&(!Sko.call(t,"callee")||cGe.call(t)==sko)}a(Dko,"isArguments");var vsn=Array.isArray;function d3t(t){return t!=null&&Oko(t.length)&&!Mko(t)}a(d3t,"isArrayLike");function Nko(t){return f3t(t)&&d3t(t)}a(Nko,"isArrayLikeObject");function Mko(t){var e=l3t(t)?cGe.call(t):"";return e==ako||e==cko}a(Mko,"isFunction");function Oko(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_sn}a(Oko,"isLength");function l3t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(l3t,"isObject");function f3t(t){return!!t&&typeof t=="object"}a(f3t,"isObjectLike");function Lko(t){return typeof t=="string"||!vsn(t)&&f3t(t)&&cGe.call(t)==lko}a(Lko,"isString");function Bko(t){return typeof t=="symbol"||f3t(t)&&cGe.call(t)==uko}a(Bko,"isSymbol");function Fko(t){if(!t)return t===0?t:0;if(t=Qko(t),t===ysn||t===-ysn){var e=t<0?-1:1;return e*oko}return t===t?t:0}a(Fko,"toFinite");function Uko(t){var e=Fko(t),r=e%1;return e===e?r?e-r:e:0}a(Uko,"toInteger");function Qko(t){if(typeof t=="number")return t;if(Bko(t))return Esn;if(l3t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=l3t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(dko,"");var r=pko.test(t);return r||hko.test(t)?gko(t.slice(2),r?2:8):fko.test(t)?Esn:+t}a(Qko,"toNumber");function qko(t){return d3t(t)?xko(t):wko(t)}a(qko,"keys");function jko(t){return t?Cko(t,qko(t)):[]}a(jko,"values");Csn.exports=Pko});var Tsn=I((Gtu,Ssn)=>{p();var Hko="[object Boolean]",Gko=Object.prototype,$ko=Gko.toString;function Vko(t){return t===!0||t===!1||Wko(t)&&$ko.call(t)==Hko}a(Vko,"isBoolean");function Wko(t){return!!t&&typeof t=="object"}a(Wko,"isObjectLike");Ssn.exports=Vko});var ksn=I((Wtu,Rsn)=>{p();var Isn=1/0,zko=17976931348623157e292,xsn=NaN,Yko="[object Symbol]",Kko=/^\s+|\s+$/g,Jko=/^[-+]0x[0-9a-f]+$/i,Zko=/^0b[01]+$/i,Xko=/^0o[0-7]+$/i,ePo=parseInt,tPo=Object.prototype,rPo=tPo.toString;function nPo(t){return typeof t=="number"&&t==aPo(t)}a(nPo,"isInteger");function wsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(wsn,"isObject");function iPo(t){return!!t&&typeof t=="object"}a(iPo,"isObjectLike");function oPo(t){return typeof t=="symbol"||iPo(t)&&rPo.call(t)==Yko}a(oPo,"isSymbol");function sPo(t){if(!t)return t===0?t:0;if(t=cPo(t),t===Isn||t===-Isn){var e=t<0?-1:1;return e*zko}return t===t?t:0}a(sPo,"toFinite");function aPo(t){var e=sPo(t),r=e%1;return e===e?r?e-r:e:0}a(aPo,"toInteger");function cPo(t){if(typeof t=="number")return t;if(oPo(t))return xsn;if(wsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Kko,"");var r=Zko.test(t);return r||Xko.test(t)?ePo(t.slice(2),r?2:8):Jko.test(t)?xsn:+t}a(cPo,"toNumber");Rsn.exports=nPo});var Dsn=I((Ktu,Psn)=>{p();var lPo="[object Number]",uPo=Object.prototype,dPo=uPo.toString;function fPo(t){return!!t&&typeof t=="object"}a(fPo,"isObjectLike");function pPo(t){return typeof t=="number"||fPo(t)&&dPo.call(t)==lPo}a(pPo,"isNumber");Psn.exports=pPo});var Lsn=I((Xtu,Osn)=>{p();var hPo="[object Object]";function mPo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(mPo,"isHostObject");function gPo(t,e){return function(r){return t(e(r))}}a(gPo,"overArg");var APo=Function.prototype,Nsn=Object.prototype,Msn=APo.toString,yPo=Nsn.hasOwnProperty,EPo=Msn.call(Object),_Po=Nsn.toString,vPo=gPo(Object.getPrototypeOf,Object);function CPo(t){return!!t&&typeof t=="object"}a(CPo,"isObjectLike");function bPo(t){if(!CPo(t)||_Po.call(t)!=hPo||mPo(t))return!1;var e=vPo(t);if(e===null)return!0;var r=yPo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Msn.call(r)==EPo}a(bPo,"isPlainObject");Osn.exports=bPo});var Fsn=I((rru,Bsn)=>{p();var SPo="[object String]",TPo=Object.prototype,IPo=TPo.toString,xPo=Array.isArray;function wPo(t){return!!t&&typeof t=="object"}a(wPo,"isObjectLike");function RPo(t){return typeof t=="string"||!xPo(t)&&wPo(t)&&IPo.call(t)==SPo}a(RPo,"isString");Bsn.exports=RPo});var Hsn=I((oru,jsn)=>{p();var kPo="Expected a function",Usn=1/0,PPo=17976931348623157e292,Qsn=NaN,DPo="[object Symbol]",NPo=/^\s+|\s+$/g,MPo=/^[-+]0x[0-9a-f]+$/i,OPo=/^0b[01]+$/i,LPo=/^0o[0-7]+$/i,BPo=parseInt,FPo=Object.prototype,UPo=FPo.toString;function QPo(t,e){var r;if(typeof e!="function")throw new TypeError(kPo);return t=$Po(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(QPo,"before");function qPo(t){return QPo(2,t)}a(qPo,"once");function qsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(qsn,"isObject");function jPo(t){return!!t&&typeof t=="object"}a(jPo,"isObjectLike");function HPo(t){return typeof t=="symbol"||jPo(t)&&UPo.call(t)==DPo}a(HPo,"isSymbol");function GPo(t){if(!t)return t===0?t:0;if(t=VPo(t),t===Usn||t===-Usn){var e=t<0?-1:1;return e*PPo}return t===t?t:0}a(GPo,"toFinite");function $Po(t){var e=GPo(t),r=e%1;return e===e?r?e-r:e:0}a($Po,"toInteger");function VPo(t){if(typeof t=="number")return t;if(HPo(t))return Qsn;if(qsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=qsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(NPo,"");var r=OPo.test(t);return r||LPo.test(t)?BPo(t.slice(2),r?2:8):MPo.test(t)?Qsn:+t}a(VPo,"toNumber");jsn.exports=qPo});var Zsn=I((cru,Jsn)=>{p();var Gsn=FBt(),WPo=s3t(),zPo=o3t(),$sn=GHe(),YPo=bsn(),lGe=Tsn(),Vsn=ksn(),p3t=Dsn(),zsn=Lsn(),rQ=Fsn(),KPo=Hsn(),{KeyObject:JPo,createSecretKey:ZPo,createPrivateKey:XPo}=require("crypto"),Ysn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];WPo&&Ysn.splice(3,0,"PS256","PS384","PS512");var e2o={expiresIn:{isValid:a(function(t){return Vsn(t)||rQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return Vsn(t)||rQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return rQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:YPo.bind(null,Ysn),message:'"algorithm" must be a valid string enum value'},header:{isValid:zsn,message:'"header" must be an object'},encoding:{isValid:rQ,message:'"encoding" must be a string'},issuer:{isValid:rQ,message:'"issuer" must be a string'},subject:{isValid:rQ,message:'"subject" must be a string'},jwtid:{isValid:rQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:lGe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:rQ,message:'"keyid" must be a string'},mutatePayload:{isValid:lGe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:lGe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:lGe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},t2o={iat:{isValid:p3t,message:'"iat" should be a number of seconds'},exp:{isValid:p3t,message:'"exp" should be a number of seconds'},nbf:{isValid:p3t,message:'"nbf" should be a number of seconds'}};function Ksn(t,e,r,n){if(!zsn(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(Ksn,"validate");function r2o(t){return Ksn(e2o,!1,t,"options")}a(r2o,"validateOptions");function n2o(t){return Ksn(t2o,!0,t,"payload")}a(n2o,"validatePayload");var Wsn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},i2o=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Jsn.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 JPo))try{e=XPo(e)}catch{try{e=ZPo(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{n2o(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=i2o.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{r2o(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{zPo(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=Gsn(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=Gsn(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(Wsn).forEach(function(d){let f=Wsn[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&&KPo(n),$sn.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=$sn.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 ean=I((dru,Xsn)=>{p();Xsn.exports={decode:MBt(),verify:Asn(),sign:Zsn(),JsonWebTokenError:aTe(),NotBeforeError:OBt(),TokenExpiredError:LBt()}});var G3t=I((ouu,ecn)=>{p();function sDo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=BBt(),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();bS.formatArgs=cDo;bS.save=lDo;bS.load=uDo;bS.useColors=aDo;bS.storage=dDo();bS.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`."))}})();bS.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 aDo(){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(aDo,"useColors");function cDo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+QGe.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(cDo,"formatArgs");bS.log=console.debug||console.log||(()=>{});function lDo(t){try{t?bS.storage.setItem("debug",t):bS.storage.removeItem("debug")}catch{}}a(lDo,"save");function uDo(){let t;try{t=bS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(uDo,"load");function dDo(){try{return localStorage}catch{}}a(dDo,"localstorage");QGe.exports=G3t()(bS);var{formatters:fDo}=QGe.exports;fDo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ncn=I((uuu,rcn)=>{"use strict";p();rcn.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 pDo=require("os"),icn=require("tty"),Nx=ncn(),{env:sg}=process,oQ;Nx("no-color")||Nx("no-colors")||Nx("color=false")||Nx("color=never")?oQ=0:(Nx("color")||Nx("colors")||Nx("color=true")||Nx("color=always"))&&(oQ=1);"FORCE_COLOR"in sg&&(sg.FORCE_COLOR==="true"?oQ=1:sg.FORCE_COLOR==="false"?oQ=0:oQ=sg.FORCE_COLOR.length===0?1:Math.min(parseInt(sg.FORCE_COLOR,10),3));function $3t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a($3t,"translateLevel");function V3t(t,e){if(oQ===0)return 0;if(Nx("color=16m")||Nx("color=full")||Nx("color=truecolor"))return 3;if(Nx("color=256"))return 2;if(t&&!e&&oQ===void 0)return 0;let r=oQ||0;if(sg.TERM==="dumb")return r;if(process.platform==="win32"){let n=pDo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in sg)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in sg)||sg.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in sg)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(sg.TEAMCITY_VERSION)?1:0;if(sg.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in sg){let n=parseInt((sg.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(sg.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(sg.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(sg.TERM)||"COLORTERM"in sg?1:r}a(V3t,"supportsColor");function hDo(t){let e=V3t(t,t&&t.isTTY);return $3t(e)}a(hDo,"getSupportLevel");ocn.exports={supportsColor:hDo,stdout:$3t(V3t(!0,icn.isatty(1))),stderr:$3t(V3t(!0,icn.isatty(2)))}});var acn=I((xA,HGe)=>{p();var mDo=require("tty"),jGe=require("util");xA.init=CDo;xA.log=EDo;xA.formatArgs=ADo;xA.save=_Do;xA.load=vDo;xA.useColors=gDo;xA.destroy=jGe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");xA.colors=[6,2,3,4,5,1];try{let t=qGe();t&&(t.stderr||t).level>=2&&(xA.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{}xA.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 gDo(){return"colors"in xA.inspectOpts?!!xA.inspectOpts.colors:mDo.isatty(process.stderr.fd)}a(gDo,"useColors");function ADo(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+"+FGe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=sDo()+e+" "+t[0]}a(oDo,"formatArgs");function sDo(){return IA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(sDo,"getDate");function aDo(...t){return process.stderr.write(BGe.format(...t)+` -`)}a(aDo,"log");function cDo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(cDo,"save");function lDo(){return process.env.DEBUG}a(lDo,"load");function uDo(t){t.inspectOpts={};let e=Object.keys(IA.inspectOpts);for(let r=0;re.trim()).join(" ")};tcn.O=function(t){return this.inspectOpts.colors=this.useColors,BGe.inspect(t,this.inspectOpts)}});var EP=I((Xlu,H3t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?H3t.exports=Kan():H3t.exports=rcn()});var ocn=I(xC=>{"use strict";p();var dDo=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]})),fDo=xC&&xC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ncn=xC&&xC.__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)&&dDo(e,t,r);return fDo(e,t),e};Object.defineProperty(xC,"__esModule",{value:!0});xC.req=xC.json=xC.toBuffer=void 0;var pDo=ncn(require("http")),hDo=ncn(require("https"));async function icn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(icn,"toBuffer");xC.toBuffer=icn;async function mDo(t){let r=(await icn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(mDo,"json");xC.json=mDo;function gDo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?hDo:pDo).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(gDo,"req");xC.req=gDo});var $3t=I(bS=>{"use strict";p();var acn=bS&&bS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ADo=bS&&bS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ccn=bS&&bS.__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)&&acn(e,t,r);return ADo(e,t),e},yDo=bS&&bS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&acn(e,t,r)};Object.defineProperty(bS,"__esModule",{value:!0});bS.Agent=void 0;var EDo=ccn(require("net")),scn=ccn(require("http")),_Do=require("https");yDo(ocn(),bS);var zM=Symbol("AgentBaseInternalState"),G3t=class extends scn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[zM]={}}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 EDo.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))?_Do.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 scn.Agent)return l.addRequest(e,o);this[zM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[zM].currentSocket;if(this[zM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zM]&&(this[zM].defaultPort=e)}get protocol(){return this[zM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zM]&&(this[zM].protocol=e)}};bS.Agent=G3t});var lcn=I(Wce=>{"use strict";p();var vDo=Wce&&Wce.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wce,"__esModule",{value:!0});Wce.parseProxyResponse=void 0;var CDo=vDo(EP()),UGe=(0,CDo.default)("https-proxy-agent:parse-proxy-response");function bDo(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(),UGe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),UGe("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+"+HGe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=yDo()+e+" "+t[0]}a(ADo,"formatArgs");function yDo(){return xA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(yDo,"getDate");function EDo(...t){return process.stderr.write(jGe.format(...t)+` +`)}a(EDo,"log");function _Do(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(_Do,"save");function vDo(){return process.env.DEBUG}a(vDo,"load");function CDo(t){t.inspectOpts={};let e=Object.keys(xA.inspectOpts);for(let r=0;re.trim()).join(" ")};scn.O=function(t){return this.inspectOpts.colors=this.useColors,jGe.inspect(t,this.inspectOpts)}});var vP=I((Auu,W3t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?W3t.exports=tcn():W3t.exports=acn()});var ucn=I(wC=>{"use strict";p();var bDo=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]})),SDo=wC&&wC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ccn=wC&&wC.__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)&&bDo(e,t,r);return SDo(e,t),e};Object.defineProperty(wC,"__esModule",{value:!0});wC.req=wC.json=wC.toBuffer=void 0;var TDo=ccn(require("http")),IDo=ccn(require("https"));async function lcn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(lcn,"toBuffer");wC.toBuffer=lcn;async function xDo(t){let r=(await lcn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(xDo,"json");wC.json=xDo;function wDo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?IDo:TDo).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(wDo,"req");wC.req=wDo});var Y3t=I(SS=>{"use strict";p();var fcn=SS&&SS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RDo=SS&&SS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pcn=SS&&SS.__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)&&fcn(e,t,r);return RDo(e,t),e},kDo=SS&&SS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fcn(e,t,r)};Object.defineProperty(SS,"__esModule",{value:!0});SS.Agent=void 0;var PDo=pcn(require("net")),dcn=pcn(require("http")),DDo=require("https");kDo(ucn(),SS);var JM=Symbol("AgentBaseInternalState"),z3t=class extends dcn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[JM]={}}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 PDo.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))?DDo.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 dcn.Agent)return l.addRequest(e,o);this[JM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[JM].currentSocket;if(this[JM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[JM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[JM]&&(this[JM].defaultPort=e)}get protocol(){return this[JM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[JM]&&(this[JM].protocol=e)}};SS.Agent=z3t});var hcn=I(zce=>{"use strict";p();var NDo=zce&&zce.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zce,"__esModule",{value:!0});zce.parseProxyResponse=void 0;var MDo=NDo(vP()),GGe=(0,MDo.default)("https-proxy-agent:parse-proxy-response");function ODo(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(),GGe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),GGe("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){UGe("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}UGe("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(bDo,"parseProxyResponse");Wce.parseProxyResponse=bDo});var W3t=I(Dx=>{"use strict";p();var SDo=Dx&&Dx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TDo=Dx&&Dx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fcn=Dx&&Dx.__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)&&SDo(e,t,r);return TDo(e,t),e},pcn=Dx&&Dx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dx,"__esModule",{value:!0});Dx.HttpsProxyAgent=void 0;var V3t=fcn(require("net")),ucn=fcn(require("tls")),IDo=pcn(require("assert")),xDo=pcn(EP()),wDo=$3t(),RDo=require("url"),kDo=lcn(),CTe=(0,xDo.default)("https-proxy-agent"),QGe=class extends wDo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new RDo.URL(e):e,this.proxyHeaders=r?.headers??{},CTe("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?dcn(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:"){CTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=ucn.connect({...this.connectOpts,servername:m})}else CTe("Creating `net.Socket`: %o",this.connectOpts),o=V3t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=V3t.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r +`);if(m===-1){GGe("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}GGe("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(ODo,"parseProxyResponse");zce.parseProxyResponse=ODo});var J3t=I(Mx=>{"use strict";p();var LDo=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]})),BDo=Mx&&Mx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Acn=Mx&&Mx.__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)&&LDo(e,t,r);return BDo(e,t),e},ycn=Mx&&Mx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mx,"__esModule",{value:!0});Mx.HttpsProxyAgent=void 0;var K3t=Acn(require("net")),mcn=Acn(require("tls")),FDo=ycn(require("assert")),UDo=ycn(vP()),QDo=Y3t(),qDo=require("url"),jDo=hcn(),TTe=(0,UDo.default)("https-proxy-agent"),$Ge=class extends QDo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new qDo.URL(e):e,this.proxyHeaders=r?.headers??{},TTe("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?gcn(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:"){TTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=mcn.connect({...this.connectOpts,servername:m})}else TTe("Creating `net.Socket`: %o",this.connectOpts),o=K3t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=K3t.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,kDo.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",PDo),r.secureEndpoint){CTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return ucn.connect({...dcn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new V3t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{CTe("Replaying proxy buffer for failed request"),(0,IDo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};QGe.protocols=["http","https"];Dx.HttpsProxyAgent=QGe;function PDo(t){t.resume()}a(PDo,"resume");function dcn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(dcn,"omit")});var z3t=I(Nx=>{"use strict";p();var DDo=Nx&&Nx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NDo=Nx&&Nx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mcn=Nx&&Nx.__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)&&DDo(e,t,r);return NDo(e,t),e},MDo=Nx&&Nx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.HttpProxyAgent=void 0;var ODo=mcn(require("net")),LDo=mcn(require("tls")),BDo=MDo(EP()),FDo=require("events"),UDo=$3t(),hcn=require("url"),zce=(0,BDo.default)("http-proxy-agent"),qGe=class extends UDo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new hcn.URL(e):e,this.proxyHeaders=r?.headers??{},zce("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?QDo(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 hcn.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;zce("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(zce("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r +`;let u=(0,jDo.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",HDo),r.secureEndpoint){TTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return mcn.connect({...gcn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new K3t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{TTe("Replaying proxy buffer for failed request"),(0,FDo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};$Ge.protocols=["http","https"];Mx.HttpsProxyAgent=$Ge;function HDo(t){t.resume()}a(HDo,"resume");function gcn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(gcn,"omit")});var Z3t=I(Ox=>{"use strict";p();var GDo=Ox&&Ox.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Do=Ox&&Ox.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_cn=Ox&&Ox.__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)&&GDo(e,t,r);return $Do(e,t),e},VDo=Ox&&Ox.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ox,"__esModule",{value:!0});Ox.HttpProxyAgent=void 0;var WDo=_cn(require("net")),zDo=_cn(require("tls")),YDo=VDo(vP()),KDo=require("events"),JDo=Y3t(),Ecn=require("url"),Yce=(0,YDo.default)("http-proxy-agent"),VGe=class extends JDo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new Ecn.URL(e):e,this.proxyHeaders=r?.headers??{},Yce("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?ZDo(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 Ecn.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;Yce("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(Yce("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),zce("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(zce("Creating `tls.Socket`: %o",this.connectOpts),s=LDo.connect(this.connectOpts)):(zce("Creating `net.Socket`: %o",this.connectOpts),s=ODo.connect(this.connectOpts)),await(0,FDo.once)(s,"connect"),s}};qGe.protocols=["http","https"];Nx.HttpProxyAgent=qGe;function QDo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(QDo,"omit")});var iQ={};ki(iQ,{__addDisposableResource:()=>Gcn,__assign:()=>WGe,__asyncDelegator:()=>Bcn,__asyncGenerator:()=>bTe,__asyncValues:()=>KGe,__await:()=>SS,__awaiter:()=>Pcn,__classPrivateFieldGet:()=>qcn,__classPrivateFieldIn:()=>Hcn,__classPrivateFieldSet:()=>jcn,__createBinding:()=>YGe,__decorate:()=>Scn,__disposeResources:()=>$cn,__esDecorate:()=>Icn,__exportStar:()=>Ncn,__extends:()=>Ccn,__generator:()=>Dcn,__importDefault:()=>Qcn,__importStar:()=>Ucn,__makeTemplateObject:()=>Fcn,__metadata:()=>kcn,__param:()=>Tcn,__propKey:()=>wcn,__read:()=>eFt,__rest:()=>bcn,__rewriteRelativeImportExtension:()=>Vcn,__runInitializers:()=>xcn,__setFunctionName:()=>Rcn,__spread:()=>Mcn,__spreadArray:()=>Lcn,__spreadArrays:()=>Ocn,__values:()=>zGe,default:()=>ZDo});function Ccn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Z3t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function bcn(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 Tcn(t,e){return function(r,n){e(r,n,t)}}function Icn(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 xcn(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 eFt(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 Mcn(){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 SS?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 Bcn(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:SS(t[o](c)),done:!1}:s?s(c):c}:s}}function KGe(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 zGe=="function"?zGe(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 Fcn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ucn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=X3t(t),n=0;n{p();Z3t=a(function(t,e){return Z3t=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])},Z3t(t,e)},"extendStatics");a(Ccn,"__extends");WGe=a(function(){return WGe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(a$e,"__esModule",{value:!0});a$e.state=void 0;a$e.state={operationRequestMap:new WeakMap}});function XNo(){try{return xFt.default.statSync("/.dockerenv"),!0}catch{return!1}}function eMo(){try{return xFt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function wFt(){return IFt===void 0&&(IFt=XNo()||eMo()),IFt}var xFt,IFt,Tln=ve(()=>{p();xFt=de(require("node:fs"),1);a(XNo,"hasDockerEnv");a(eMo,"hasDockerCGroup");a(wFt,"isDocker")});function Zce(){return RFt===void 0&&(RFt=tMo()||wFt()),RFt}var Iln,RFt,tMo,kFt=ve(()=>{p();Iln=de(require("node:fs"),1);Tln();tMo=a(()=>{try{return Iln.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Zce,"isInsideContainer")});var PFt,wln,Rln,xln,cQ,DFt=ve(()=>{p();PFt=de(require("node:process"),1),wln=de(require("node:os"),1),Rln=de(require("node:fs"),1);kFt();xln=a(()=>{if(PFt.default.platform!=="linux")return!1;if(wln.default.release().toLowerCase().includes("microsoft"))return!Zce();try{return Rln.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Zce():!1}catch{return!1}},"isWsl"),cQ=PFt.default.env.__IS_WSL_TEST__?xln:xln()});var NFt,RTe,rMo,nMo,MFt,kln=ve(()=>{p();NFt=de(require("node:process"),1),RTe=de(require("node:fs/promises"),1);DFt();DFt();rMo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await RTe.default.access(r,RTe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await RTe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),nMo=a(async()=>`${await rMo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),MFt=a(async()=>cQ?nMo():`${NFt.default.env.SYSTEMROOT||NFt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function lQ(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 Pln=ve(()=>{p();a(lQ,"defineLazyProperty")});async function OFt(){if(Nln.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await iMo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Dln,Nln,Mln,iMo,Oln=ve(()=>{p();Dln=require("node:util"),Nln=de(require("node:process"),1),Mln=require("node:child_process"),iMo=(0,Dln.promisify)(Mln.execFile);a(OFt,"defaultBrowserId")});async function Fln(t,{humanReadableOutput:e=!0}={}){if(Lln.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await oMo("osascript",["-e",t,r]);return n.trim()}var Lln,Bln,LFt,oMo,Uln=ve(()=>{p();Lln=de(require("node:process"),1),Bln=require("node:util"),LFt=require("node:child_process"),oMo=(0,Bln.promisify)(LFt.execFile);a(Fln,"runAppleScript")});async function BFt(t){return Fln(`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 Qln=ve(()=>{p();Uln();a(BFt,"bundleName")});async function FFt(t=sMo){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 l$e(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=aMo[n];if(!o)throw new l$e(`Unknown browser ID: ${n}`);return o}var qln,jln,sMo,aMo,l$e,Hln=ve(()=>{p();qln=require("node:util"),jln=require("node:child_process"),sMo=(0,qln.promisify)(jln.execFile),aMo={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"}},l$e=class extends Error{static{a(this,"UnknownBrowserError")}};a(FFt,"defaultBrowser")});async function UFt(){if(u$e.default.platform==="darwin"){let t=await OFt();return{name:await BFt(t),id:t}}if(u$e.default.platform==="linux"){let{stdout:t}=await cMo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:lMo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(u$e.default.platform==="win32")return FFt();throw new Error("Only macOS, Linux, and Windows are supported")}var Gln,u$e,$ln,cMo,lMo,Vln=ve(()=>{p();Gln=require("node:util"),u$e=de(require("node:process"),1),$ln=require("node:child_process");Oln();Qln();Hln();cMo=(0,Gln.promisify)($ln.execFile),lMo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(UFt,"defaultBrowser")});var Xln={};ki(Xln,{apps:()=>uQ,default:()=>PTe,openApp:()=>pMo});async function dMo(){let t=await MFt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=jFt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await uMo(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 Kln(t){if(typeof t=="string"||Array.isArray(t))return t;let{[zln]:e}=t;if(!e)throw new Error(`${zln} is not supported`);return e}function f$e({[Xce]:t},{wsl:e}){if(e&&cQ)return Kln(e);if(!t)throw new Error(`${Xce} is not supported`);return Kln(t)}var qFt,jFt,HFt,Jln,Zln,GFt,d$e,uMo,QFt,Wln,Xce,zln,Yln,kTe,fMo,pMo,uQ,PTe,p$e=ve(()=>{p();qFt=de(require("node:process"),1),jFt=require("node:buffer"),HFt=de(require("node:path"),1),Jln=require("node:url"),Zln=require("node:util"),GFt=de(require("node:child_process"),1),d$e=de(require("node:fs/promises"),1);kln();Pln();Vln();kFt();uMo=(0,Zln.promisify)(GFt.default.execFile),QFt=HFt.default.dirname((0,Jln.fileURLToPath)(importMetaUrlShim)),Wln=HFt.default.join(QFt,"xdg-open"),{platform:Xce,arch:zln}=qFt.default;a(dMo,"getWindowsDefaultBrowserFromWsl");Yln=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),kTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Yln(t.app,l=>kTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Yln(e,l=>kTe({...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=cQ?await dMo():await UFt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),kTe({...t,app:{name:uQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Xce==="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(Xce==="win32"||cQ&&!Zce()&&!e){n=await MFt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),cQ||(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=jFt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!QFt||QFt==="/",u=!1;try{await d$e.default.access(Wln,d$e.constants.X_OK),u=!0}catch{}n=qFt.default.versions.electron??(Xce==="android"||l||!u)?"xdg-open":Wln}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Xce==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=GFt.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"),fMo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return kTe({...e,target:t})},"open"),pMo=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 kTe({...e,app:{name:t,arguments:r}})},"openApp");a(Kln,"detectArchBinary");a(f$e,"detectPlatformBinary");uQ={};lQ(uQ,"chrome",()=>f$e({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"]}}));lQ(uQ,"brave",()=>f$e({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"]}}));lQ(uQ,"firefox",()=>f$e({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));lQ(uQ,"edge",()=>f$e({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));lQ(uQ,"browser",()=>"browser");lQ(uQ,"browserPrivate",()=>"browserPrivate");PTe=fMo});var h8t=I((dxu,sdn)=>{"use strict";p();sdn.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 cdn=I((hxu,adn)=>{"use strict";p();var v4o=h8t();function C4o(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=v4o(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(C4o,"parsePath");adn.exports=C4o});var hdn=I((Axu,pdn)=>{"use strict";p();var b4o=cdn();function S4o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(S4o,"_interopDefaultLegacy");var T4o=S4o(b4o);function I4o(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(I4o,"getAugmentedNamespace");var udn={},x4o="text/plain",w4o="us-ascii",ldn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),R4o=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===w4o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==x4o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function k4o(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 R4o(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];ldn(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()])ldn(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(k4o,"normalizeUrl");var P4o=Object.freeze({__proto__:null,default:k4o}),D4o=I4o(P4o);Object.defineProperty(udn,"__esModule",{value:!0});var N4o=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},M4o=D4o,O4o=ddn(M4o),L4o=T4o.default,B4o=ddn(L4o);function ddn(t){return t&&t.__esModule?t:{default:t}}a(ddn,"_interopRequireDefault");var fdn=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":N4o(r))!=="object"&&(r={stripHash:!1}),e=(0,O4o.default)(e,r));var s=(0,B4o.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");fdn.MAX_INPUT_LENGTH=2048;var F4o=udn.default=fdn;pdn.exports=F4o});var Adn=I((_xu,gdn)=>{"use strict";p();var U4o=h8t();function mdn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=U4o(t);if(t=t.substring(t.indexOf("://")+3),mdn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var Q4o=hdn(),ydn=Adn();function q4o(t){let e=Q4o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),ydn(e.protocols)||e.protocols.length===0&&ydn(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(q4o,"gitUp");Edn.exports=q4o});var Cdn=I((Ixu,vdn)=>{"use strict";p();var j4o=_dn();function m8t(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=j4o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return m8t.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=$4o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(m8t,"gitUrlParse");m8t.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?H4o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+G4o(t)+o;default:return t.href}};function H4o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(H4o,"buildToken");function G4o(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(G4o,"buildPath");function $4o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a($4o,"findLongestMatchingSubstring");vdn.exports=m8t});var ale=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;hYcn,__assign:()=>ZGe,__asyncDelegator:()=>jcn,__asyncGenerator:()=>ITe,__asyncValues:()=>t$e,__await:()=>TS,__awaiter:()=>Lcn,__classPrivateFieldGet:()=>Vcn,__classPrivateFieldIn:()=>zcn,__classPrivateFieldSet:()=>Wcn,__createBinding:()=>e$e,__decorate:()=>Rcn,__disposeResources:()=>Kcn,__esDecorate:()=>Pcn,__exportStar:()=>Fcn,__extends:()=>xcn,__generator:()=>Bcn,__importDefault:()=>$cn,__importStar:()=>Gcn,__makeTemplateObject:()=>Hcn,__metadata:()=>Ocn,__param:()=>kcn,__propKey:()=>Ncn,__read:()=>iFt,__rest:()=>wcn,__rewriteRelativeImportExtension:()=>Jcn,__runInitializers:()=>Dcn,__setFunctionName:()=>Mcn,__spread:()=>Ucn,__spreadArray:()=>qcn,__spreadArrays:()=>Qcn,__values:()=>XGe,default:()=>uNo});function xcn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rFt(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function wcn(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 kcn(t,e){return function(r,n){e(r,n,t)}}function Pcn(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 Dcn(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 iFt(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 Ucn(){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 TS?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 jcn(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:TS(t[o](c)),done:!1}:s?s(c):c}:s}}function t$e(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 XGe=="function"?XGe(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 Hcn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Gcn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=nFt(t),n=0;n{p();rFt=a(function(t,e){return rFt=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])},rFt(t,e)},"extendStatics");a(xcn,"__extends");ZGe=a(function(){return ZGe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(f$e,"__esModule",{value:!0});f$e.state=void 0;f$e.state={operationRequestMap:new WeakMap}});function dMo(){try{return PFt.default.statSync("/.dockerenv"),!0}catch{return!1}}function fMo(){try{return PFt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function DFt(){return kFt===void 0&&(kFt=dMo()||fMo()),kFt}var PFt,kFt,kln=ve(()=>{p();PFt=de(require("node:fs"),1);a(dMo,"hasDockerEnv");a(fMo,"hasDockerCGroup");a(DFt,"isDocker")});function Xce(){return NFt===void 0&&(NFt=pMo()||DFt()),NFt}var Pln,NFt,pMo,MFt=ve(()=>{p();Pln=de(require("node:fs"),1);kln();pMo=a(()=>{try{return Pln.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Xce,"isInsideContainer")});var OFt,Nln,Mln,Dln,uQ,LFt=ve(()=>{p();OFt=de(require("node:process"),1),Nln=de(require("node:os"),1),Mln=de(require("node:fs"),1);MFt();Dln=a(()=>{if(OFt.default.platform!=="linux")return!1;if(Nln.default.release().toLowerCase().includes("microsoft"))return!Xce();try{return Mln.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Xce():!1}catch{return!1}},"isWsl"),uQ=OFt.default.env.__IS_WSL_TEST__?Dln:Dln()});var BFt,DTe,hMo,mMo,FFt,Oln=ve(()=>{p();BFt=de(require("node:process"),1),DTe=de(require("node:fs/promises"),1);LFt();LFt();hMo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await DTe.default.access(r,DTe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await DTe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),mMo=a(async()=>`${await hMo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),FFt=a(async()=>uQ?mMo():`${BFt.default.env.SYSTEMROOT||BFt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function dQ(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 Lln=ve(()=>{p();a(dQ,"defineLazyProperty")});async function UFt(){if(Fln.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await gMo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Bln,Fln,Uln,gMo,Qln=ve(()=>{p();Bln=require("node:util"),Fln=de(require("node:process"),1),Uln=require("node:child_process"),gMo=(0,Bln.promisify)(Uln.execFile);a(UFt,"defaultBrowserId")});async function Hln(t,{humanReadableOutput:e=!0}={}){if(qln.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await AMo("osascript",["-e",t,r]);return n.trim()}var qln,jln,QFt,AMo,Gln=ve(()=>{p();qln=de(require("node:process"),1),jln=require("node:util"),QFt=require("node:child_process"),AMo=(0,jln.promisify)(QFt.execFile);a(Hln,"runAppleScript")});async function qFt(t){return Hln(`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 $ln=ve(()=>{p();Gln();a(qFt,"bundleName")});async function jFt(t=yMo){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 h$e(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=EMo[n];if(!o)throw new h$e(`Unknown browser ID: ${n}`);return o}var Vln,Wln,yMo,EMo,h$e,zln=ve(()=>{p();Vln=require("node:util"),Wln=require("node:child_process"),yMo=(0,Vln.promisify)(Wln.execFile),EMo={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"}},h$e=class extends Error{static{a(this,"UnknownBrowserError")}};a(jFt,"defaultBrowser")});async function HFt(){if(m$e.default.platform==="darwin"){let t=await UFt();return{name:await qFt(t),id:t}}if(m$e.default.platform==="linux"){let{stdout:t}=await _Mo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:vMo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(m$e.default.platform==="win32")return jFt();throw new Error("Only macOS, Linux, and Windows are supported")}var Yln,m$e,Kln,_Mo,vMo,Jln=ve(()=>{p();Yln=require("node:util"),m$e=de(require("node:process"),1),Kln=require("node:child_process");Qln();$ln();zln();_Mo=(0,Yln.promisify)(Kln.execFile),vMo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(HFt,"defaultBrowser")});var oun={};ki(oun,{apps:()=>fQ,default:()=>MTe,openApp:()=>TMo});async function bMo(){let t=await FFt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=VFt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await CMo(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 tun(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Xln]:e}=t;if(!e)throw new Error(`${Xln} is not supported`);return e}function A$e({[ele]:t},{wsl:e}){if(e&&uQ)return tun(e);if(!t)throw new Error(`${ele} is not supported`);return tun(t)}var $Ft,VFt,WFt,nun,iun,zFt,g$e,CMo,GFt,Zln,ele,Xln,eun,NTe,SMo,TMo,fQ,MTe,y$e=ve(()=>{p();$Ft=de(require("node:process"),1),VFt=require("node:buffer"),WFt=de(require("node:path"),1),nun=require("node:url"),iun=require("node:util"),zFt=de(require("node:child_process"),1),g$e=de(require("node:fs/promises"),1);Oln();Lln();Jln();MFt();CMo=(0,iun.promisify)(zFt.default.execFile),GFt=WFt.default.dirname((0,nun.fileURLToPath)(importMetaUrlShim)),Zln=WFt.default.join(GFt,"xdg-open"),{platform:ele,arch:Xln}=$Ft.default;a(bMo,"getWindowsDefaultBrowserFromWsl");eun=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),NTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return eun(t.app,l=>NTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return eun(e,l=>NTe({...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=uQ?await bMo():await HFt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),NTe({...t,app:{name:fQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(ele==="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(ele==="win32"||uQ&&!Xce()&&!e){n=await FFt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),uQ||(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=VFt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!GFt||GFt==="/",u=!1;try{await g$e.default.access(Zln,g$e.constants.X_OK),u=!0}catch{}n=$Ft.default.versions.electron??(ele==="android"||l||!u)?"xdg-open":Zln}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}ele==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=zFt.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"),SMo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return NTe({...e,target:t})},"open"),TMo=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 NTe({...e,app:{name:t,arguments:r}})},"openApp");a(tun,"detectArchBinary");a(A$e,"detectPlatformBinary");fQ={};dQ(fQ,"chrome",()=>A$e({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"]}}));dQ(fQ,"brave",()=>A$e({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"]}}));dQ(fQ,"firefox",()=>A$e({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));dQ(fQ,"edge",()=>A$e({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));dQ(fQ,"browser",()=>"browser");dQ(fQ,"browserPrivate",()=>"browserPrivate");MTe=SMo});var y8t=I((Rxu,ddn)=>{"use strict";p();ddn.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 pdn=I((Dxu,fdn)=>{"use strict";p();var N4o=y8t();function M4o(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=N4o(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(M4o,"parsePath");fdn.exports=M4o});var Edn=I((Oxu,ydn)=>{"use strict";p();var O4o=pdn();function L4o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(L4o,"_interopDefaultLegacy");var B4o=L4o(O4o);function F4o(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(F4o,"getAugmentedNamespace");var mdn={},U4o="text/plain",Q4o="us-ascii",hdn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),q4o=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===Q4o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==U4o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function j4o(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 q4o(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];hdn(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()])hdn(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(j4o,"normalizeUrl");var H4o=Object.freeze({__proto__:null,default:j4o}),G4o=F4o(H4o);Object.defineProperty(mdn,"__esModule",{value:!0});var $4o=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},V4o=G4o,W4o=gdn(V4o),z4o=B4o.default,Y4o=gdn(z4o);function gdn(t){return t&&t.__esModule?t:{default:t}}a(gdn,"_interopRequireDefault");var Adn=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":$4o(r))!=="object"&&(r={stripHash:!1}),e=(0,W4o.default)(e,r));var s=(0,Y4o.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");Adn.MAX_INPUT_LENGTH=2048;var K4o=mdn.default=Adn;ydn.exports=K4o});var Cdn=I((Fxu,vdn)=>{"use strict";p();var J4o=y8t();function _dn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=J4o(t);if(t=t.substring(t.indexOf("://")+3),_dn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var Z4o=Edn(),bdn=Cdn();function X4o(t){let e=Z4o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),bdn(e.protocols)||e.protocols.length===0&&bdn(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(X4o,"gitUp");Sdn.exports=X4o});var xdn=I((Gxu,Idn)=>{"use strict";p();var eLo=Tdn();function E8t(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=eLo(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return E8t.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=nLo(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(E8t,"gitUrlParse");E8t.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?tLo(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+rLo(t)+o;default:return t.href}};function tLo(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(tLo,"buildToken");function rLo(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(rLo,"buildPath");function nLo(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(nLo,"findLongestMatchingSubstring");Idn.exports=E8t});var cle=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,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(j=>{let Q=[],U=[];for(let W of j)W.name===M&&Q.push(W.node),W.name===O&&U.push(W.node);let Y=a((W,V,z)=>z?W.text===V.text:W.text!==V.text,"compare");return D?Q.every(W=>U.some(V=>Y(W,V,P))):Q.some(W=>U.some(V=>Y(W,V,P)))})}else{N=v[1].name;let M=v[2].value,O=a(Q=>Q.text===M,"matches"),j=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 Y=P?O:j;return D?U.every(Y):U.some(Y)})}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 L=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 j=a((Q,U)=>U?L.test(Q):!L.test(Q),"test");return O.length===0?!P:D?O.every(Q=>j(Q,P)):O.some(Q=>j(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 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?":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 j of M)j.name===N&&O.push(j.node.text);return O.length===0?!P:O.every(j=>q.includes(j))===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 qdn=I((Kwu,Qdn)=>{"use strict";p();var RLo=require("path"),kLo=RLo.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");Qdn.exports=require(kLo)});var epn={};ki(epn,{TextDocument:()=>S3});function E6t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);E6t(n,e),E6t(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 l3o(t){let e=Xfn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var nWe,S3,_6t=ve(()=>{"use strict";p();nWe=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=Xfn(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=Jfn(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&&Zfn(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 nWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof nWe)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=E6t(s.map(l3o),(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})(S3||(S3={}));a(E6t,"mergeSort");a(Jfn,"computeLineOffsets");a(Zfn,"isEOL");a(Xfn,"getWellformedRange");a(l3o,"getWellformedEdit")});var pWe=I(Vh=>{"use strict";p();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.thenable=Vh.typedArray=Vh.stringArray=Vh.array=Vh.func=Vh.error=Vh.number=Vh.string=Vh.boolean=void 0;function h3o(t){return t===!0||t===!1}a(h3o,"boolean");Vh.boolean=h3o;function uhn(t){return typeof t=="string"||t instanceof String}a(uhn,"string");Vh.string=uhn;function m3o(t){return typeof t=="number"||t instanceof Number}a(m3o,"number");Vh.number=m3o;function g3o(t){return t instanceof Error}a(g3o,"error");Vh.error=g3o;function dhn(t){return typeof t=="function"}a(dhn,"func");Vh.func=dhn;function fhn(t){return Array.isArray(t)}a(fhn,"array");Vh.array=fhn;function A3o(t){return fhn(t)&&t.every(e=>uhn(e))}a(A3o,"stringArray");Vh.stringArray=A3o;function y3o(t,e){return Array.isArray(t)&&t.every(e)}a(y3o,"typedArray");Vh.typedArray=y3o;function E3o(t){return t&&dhn(t.then)}a(E3o,"thenable");Vh.thenable=E3o});var F6t=I(Fx=>{"use strict";p();Object.defineProperty(Fx,"__esModule",{value:!0});Fx.generateUuid=Fx.parse=Fx.isUUID=Fx.v4=Fx.empty=void 0;var bIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},SIe=class t extends bIe{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(""))}};SIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];SIe._timeHighBits=["8","9","a","b"];Fx.empty=new bIe("00000000-0000-0000-0000-000000000000");function phn(){return new SIe}a(phn,"v4");Fx.v4=phn;var _3o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hhn(t){return _3o.test(t)}a(hhn,"isUUID");Fx.isUUID=hhn;function v3o(t){if(!hhn(t))throw new Error("invalid uuid");return new bIe(t)}a(v3o,"parse");Fx.parse=v3o;function C3o(){return phn().asHex()}a(C3o,"generateUuid");Fx.generateUuid=C3o});var mhn=I(DQ=>{"use strict";p();Object.defineProperty(DQ,"__esModule",{value:!0});DQ.attachPartialResult=DQ.ProgressFeature=DQ.attachWorkDone=void 0;var PQ=ri(),b3o=F6t(),$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(PQ.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(PQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(PQ.WorkDoneProgress.type,this._token,{kind:"end"})}};$Y.Instances=new Map;var hWe=class extends $Y{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new PQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},TIe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},mWe=class extends TIe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new PQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function S3o(t,e){if(e===void 0||e.workDoneToken===void 0)return new TIe;let r=e.workDoneToken;return delete e.workDoneToken,new $Y(t,r)}a(S3o,"attachWorkDone");DQ.attachWorkDone=S3o;var T3o=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(PQ.WorkDoneProgressCancelNotification.type,r=>{let n=$Y.Instances.get(r.token);(n instanceof hWe||n instanceof mWe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new TIe:new $Y(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,b3o.generateUuid)();return this.connection.sendRequest(PQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new hWe(this.connection,e))}else return Promise.resolve(new mWe)}},"ProgressFeature");DQ.ProgressFeature=T3o;var U6t;(function(t){t.type=new PQ.ProgressType})(U6t||(U6t={}));var Q6t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(U6t.type,this._token,e)}};function I3o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new Q6t(t,r)}a(I3o,"attachPartialResult");DQ.attachPartialResult=I3o});var ghn=I(gWe=>{"use strict";p();Object.defineProperty(gWe,"__esModule",{value:!0});gWe.ConfigurationFeature=void 0;var x3o=ri(),w3o=pWe(),R3o=a(t=>class extends t{getConfiguration(e){return e?w3o.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(x3o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");gWe.ConfigurationFeature=R3o});var Ahn=I(yWe=>{"use strict";p();Object.defineProperty(yWe,"__esModule",{value:!0});yWe.WorkspaceFoldersFeature=void 0;var AWe=ri(),k3o=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 AWe.Emitter,this.connection.onNotification(AWe.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(AWe.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(AWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");yWe.WorkspaceFoldersFeature=k3o});var yhn=I(EWe=>{"use strict";p();Object.defineProperty(EWe,"__esModule",{value:!0});EWe.CallHierarchyFeature=void 0;var q6t=ri(),P3o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(q6t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=q6t.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=q6t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");EWe.CallHierarchyFeature=P3o});var H6t=I(NQ=>{"use strict";p();Object.defineProperty(NQ,"__esModule",{value:!0});NQ.SemanticTokensBuilder=NQ.SemanticTokensDiff=NQ.SemanticTokensFeature=void 0;var _We=ri(),D3o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(_We.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=_We.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=_We.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=_We.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");NQ.SemanticTokensFeature=D3o;var vWe=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 vWe(this._prevData,this._data).computeDiff()}:this.build()}};NQ.SemanticTokensBuilder=j6t});var Ehn=I(CWe=>{"use strict";p();Object.defineProperty(CWe,"__esModule",{value:!0});CWe.ShowDocumentFeature=void 0;var N3o=ri(),M3o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(N3o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");CWe.ShowDocumentFeature=M3o});var _hn=I(bWe=>{"use strict";p();Object.defineProperty(bWe,"__esModule",{value:!0});bWe.FileOperationsFeature=void 0;var Tle=ri(),O3o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Tle.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Tle.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Tle.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Tle.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Tle.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Tle.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");bWe.FileOperationsFeature=O3o});var vhn=I(SWe=>{"use strict";p();Object.defineProperty(SWe,"__esModule",{value:!0});SWe.LinkedEditingRangeFeature=void 0;var L3o=ri(),B3o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(L3o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");SWe.LinkedEditingRangeFeature=B3o});var Chn=I(TWe=>{"use strict";p();Object.defineProperty(TWe,"__esModule",{value:!0});TWe.TypeHierarchyFeature=void 0;var G6t=ri(),F3o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(G6t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=G6t.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=G6t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");TWe.TypeHierarchyFeature=F3o});var Shn=I(IWe=>{"use strict";p();Object.defineProperty(IWe,"__esModule",{value:!0});IWe.InlineValueFeature=void 0;var bhn=ri(),U3o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(bhn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(bhn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");IWe.InlineValueFeature=U3o});var Ihn=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.FoldingRangeFeature=void 0;var Thn=ri(),Q3o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Thn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Thn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");xWe.FoldingRangeFeature=Q3o});var xhn=I(wWe=>{"use strict";p();Object.defineProperty(wWe,"__esModule",{value:!0});wWe.InlayHintFeature=void 0;var $6t=ri(),q3o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest($6t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest($6t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest($6t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");wWe.InlayHintFeature=q3o});var whn=I(RWe=>{"use strict";p();Object.defineProperty(RWe,"__esModule",{value:!0});RWe.DiagnosticFeature=void 0;var IIe=ri(),j3o=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(IIe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(IIe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(IIe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(IIe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(IIe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");RWe.DiagnosticFeature=j3o});var W6t=I(kWe=>{"use strict";p();Object.defineProperty(kWe,"__esModule",{value:!0});kWe.TextDocuments=void 0;var VY=ri(),V6t=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())})}};kWe.TextDocuments=V6t});var Y6t=I(Ile=>{"use strict";p();Object.defineProperty(Ile,"__esModule",{value:!0});Ile.NotebookDocuments=Ile.NotebookSyncFeature=void 0;var Ux=ri(),Rhn=W6t(),H3o=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Ux.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Ux.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Ux.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Ux.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Ile.NotebookSyncFeature=H3o;var PWe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Ux.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ux.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ux.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 z6t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Rhn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Rhn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ux.Emitter,this._onDidChange=new Ux.Emitter,this._onDidSave=new Ux.Emitter,this._onDidClose=new Ux.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)}})),Ux.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Ile.NotebookDocuments=z6t});var khn=I(DWe=>{"use strict";p();Object.defineProperty(DWe,"__esModule",{value:!0});DWe.MonikerFeature=void 0;var G3o=ri(),$3o=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=G3o.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");DWe.MonikerFeature=$3o});var t9t=I(gc=>{"use strict";p();Object.defineProperty(gc,"__esModule",{value:!0});gc.createConnection=gc.combineFeatures=gc.combineNotebooksFeatures=gc.combineLanguagesFeatures=gc.combineWorkspaceFeatures=gc.combineWindowFeatures=gc.combineClientFeatures=gc.combineTracerFeatures=gc.combineTelemetryFeatures=gc.combineConsoleFeatures=gc._NotebooksImpl=gc._LanguagesImpl=gc.BulkUnregistration=gc.BulkRegistration=gc.ErrorMessageTracker=void 0;var Kr=ri(),Qx=pWe(),J6t=F6t(),To=mhn(),V3o=ghn(),W3o=Ahn(),z3o=yhn(),Y3o=H6t(),K3o=Ehn(),J3o=_hn(),Z3o=vhn(),X3o=Chn(),eFo=Shn(),tFo=Ihn(),rFo=xhn(),nFo=whn(),iFo=Y6t(),oFo=khn();function K6t(t){if(t!==null)return t}a(K6t,"null2Undefined");var Z6t=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)})}};gc.ErrorMessageTracker=Z6t;var NWe=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")})}},X6t=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(K6t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}},Phn=(0,K3o.ShowDocumentFeature)((0,To.ProgressFeature)(X6t)),Dhn;(function(t){function e(){return new MWe}a(e,"create"),t.create=e})(Dhn||(gc.BulkRegistration=Dhn={}));var MWe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Qx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=J6t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Nhn;(function(t){function e(){return new xIe(void 0,[])}a(e,"create"),t.create=e})(Nhn||(gc.BulkUnregistration=Nhn={}));var xIe=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=Qx.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}},OWe=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 MWe?this.registerMany(e):e instanceof xIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Qx.string(r)?r:r.method,s=J6t.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=Qx.string(e)?e:e.method,o=J6t.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 xIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},e9t=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)}},Mhn=(0,J3o.FileOperationsFeature)((0,W3o.WorkspaceFoldersFeature)((0,V3o.ConfigurationFeature)(e9t))),LWe=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")})}},FWe=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,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};gc._LanguagesImpl=FWe;var Ohn=(0,tFo.FoldingRangeFeature)((0,oFo.MonikerFeature)((0,nFo.DiagnosticFeature)((0,rFo.InlayHintFeature)((0,eFo.InlineValueFeature)((0,X3o.TypeHierarchyFeature)((0,Z3o.LinkedEditingRangeFeature)((0,Y3o.SemanticTokensFeature)((0,z3o.CallHierarchyFeature)(FWe))))))))),UWe=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,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};gc._NotebooksImpl=UWe;var Lhn=(0,iFo.NotebookSyncFeature)(UWe);function Bhn(t,e){return function(r){return e(t(r))}}a(Bhn,"combineConsoleFeatures");gc.combineConsoleFeatures=Bhn;function Fhn(t,e){return function(r){return e(t(r))}}a(Fhn,"combineTelemetryFeatures");gc.combineTelemetryFeatures=Fhn;function Uhn(t,e){return function(r){return e(t(r))}}a(Uhn,"combineTracerFeatures");gc.combineTracerFeatures=Uhn;function Qhn(t,e){return function(r){return e(t(r))}}a(Qhn,"combineClientFeatures");gc.combineClientFeatures=Qhn;function qhn(t,e){return function(r){return e(t(r))}}a(qhn,"combineWindowFeatures");gc.combineWindowFeatures=qhn;function jhn(t,e){return function(r){return e(t(r))}}a(jhn,"combineWorkspaceFeatures");gc.combineWorkspaceFeatures=jhn;function Hhn(t,e){return function(r){return e(t(r))}}a(Hhn,"combineLanguagesFeatures");gc.combineLanguagesFeatures=Hhn;function Ghn(t,e){return function(r){return e(t(r))}}a(Ghn,"combineNotebooksFeatures");gc.combineNotebooksFeatures=Ghn;function sFo(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,Bhn),tracer:r(t.tracer,e.tracer,Uhn),telemetry:r(t.telemetry,e.telemetry,Fhn),client:r(t.client,e.client,Qhn),window:r(t.window,e.window,qhn),workspace:r(t.workspace,e.workspace,jhn),languages:r(t.languages,e.languages,Hhn),notebooks:r(t.notebooks,e.notebooks,Ghn)}}a(sFo,"combineFeatures");gc.combineFeatures=sFo;function aFo(t,e,r){let n=r&&r.console?new(r.console(NWe)):new NWe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(LWe)):new LWe,c=r&&r.telemetry?new(r.telemetry(BWe)):new BWe,l=r&&r.client?new(r.client(OWe)):new OWe,u=r&&r.window?new(r.window(Phn)):new Phn,d=r&&r.workspace?new(r.workspace(Mhn)):new Mhn,f=r&&r.languages?new(r.languages(Ohn)):new Ohn,h=r&&r.notebooks?new(r.notebooks(Lhn)):new Lhn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Qx.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(Qx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Qx.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,To.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.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,To.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.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,To.attachWorkDone)(o,b),(0,To.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,To.attachWorkDone)(o,b),(0,To.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,To.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,To.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,To.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,To.attachWorkDone)(o,b),(0,To.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,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,To.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),Qx.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,To.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=Qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!Qx.number(R.textDocumentSync)&&!Qx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Qx.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(aFo,"createConnection");gc.createConnection=aFo});var $hn=I(DC=>{"use strict";p();Object.defineProperty(DC,"__esModule",{value:!0});DC.resolveModulePath=DC.FileSystem=DC.resolveGlobalYarnPath=DC.resolveGlobalNodePath=DC.resolve=DC.uriToFilePath=void 0;var cFo=require("url"),kP=require("path"),r9t=require("fs"),s9t=require("child_process");function lFo(t){let e=cFo.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 kP.normalize(r.join("/"))}a(lFo,"uriToFilePath");DC.uriToFilePath=lFo;function n9t(){return process.platform==="win32"}a(n9t,"isWindows");function QWe(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&&r9t.existsSync(e)&&(d[o]?d[o]=e+kP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,s9t.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(QWe,"resolve");DC.resolve=QWe;function i9t(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};n9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,s9t.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?n9t()?kP.join(c,"node_modules"):kP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(i9t,"resolveGlobalNodePath");DC.resolveGlobalNodePath=i9t;function uFo(t){let e="yarn",r={encoding:"utf8"};n9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,s9t.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 kP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(uFo,"resolveGlobalYarnPath");DC.resolveGlobalYarnPath=uFo;var o9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!r9t.existsSync(__filename.toUpperCase())||!r9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?kP.normalize(s).indexOf(kP.normalize(o))===0:kP.normalize(s).toLowerCase().indexOf(kP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(o9t||(DC.FileSystem=o9t={}));function dFo(t,e,r,n){return r?(kP.isAbsolute(r)||(r=kP.join(t,r)),QWe(e,r,r,n).then(o=>o9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>QWe(e,i9t(n),t,n))):QWe(e,i9t(n),t,n)}a(dFo,"resolveModulePath");DC.resolveModulePath=dFo});var a9t=I((eLu,Vhn)=>{"use strict";p();Vhn.exports=ri()});var Whn=I(qWe=>{"use strict";p();Object.defineProperty(qWe,"__esModule",{value:!0});qWe.InlineCompletionFeature=void 0;var fFo=ri(),pFo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(fFo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");qWe.InlineCompletionFeature=pFo});var Khn=I(oE=>{"use strict";p();var hFo=oE&&oE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yhn=oE&&oE.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hFo(e,t,r)};Object.defineProperty(oE,"__esModule",{value:!0});oE.ProposedFeatures=oE.NotebookDocuments=oE.TextDocuments=oE.SemanticTokensBuilder=void 0;var mFo=H6t();Object.defineProperty(oE,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return mFo.SemanticTokensBuilder},"get")});var gFo=Whn();Yhn(ri(),oE);var AFo=W6t();Object.defineProperty(oE,"TextDocuments",{enumerable:!0,get:a(function(){return AFo.TextDocuments},"get")});var yFo=Y6t();Object.defineProperty(oE,"NotebookDocuments",{enumerable:!0,get:a(function(){return yFo.NotebookDocuments},"get")});Yhn(t9t(),oE);var zhn;(function(t){t.all={__brand:"features",languages:gFo.InlineCompletionFeature}})(zhn||(oE.ProposedFeatures=zhn={}))});var Xc=I(qx=>{"use strict";p();var EFo=qx&&qx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),emn=qx&&qx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EFo(e,t,r)};Object.defineProperty(qx,"__esModule",{value:!0});qx.createConnection=qx.Files=void 0;var Jhn=require("node:util"),c9t=pWe(),_Fo=t9t(),wIe=$hn(),WY=a9t();emn(a9t(),qx);emn(Khn(),qx);var Zhn;(function(t){t.uriToFilePath=wIe.uriToFilePath,t.resolveGlobalNodePath=wIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=wIe.resolveGlobalYarnPath,t.resolve=wIe.resolve,t.resolveModulePath=wIe.resolveModulePath})(Zhn||(qx.Files=Zhn={}));var Xhn;function jWe(){if(Xhn!==void 0)try{Xhn.end()}catch{}}a(jWe,"endProtocolConnection");var xle=!1,tmn;function vFo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(tmn=setInterval(()=>{try{process.kill(n,0)}catch{jWe(),process.exit(xle?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;c9t.number(e)&&tmn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(xle?0:1)}},3e3)},"initialize"),get shutdownReceived(){return xle},set shutdownReceived(t){xle=t},exit:a(t=>{jWe(),process.exit(t)},"exit")};function bFo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),WY.ConnectionStrategy.is(t)||WY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),SFo(s,c,l,o)}a(bFo,"createConnection");qx.createConnection=bFo;function SFo(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{jWe(),process.exit(xle?0:1)}),u.on("close",()=>{jWe(),process.exit(xle?0:1)})}let l=a(u=>{let d=(0,WY.createProtocolConnection)(t,e,u,r);return o&&TFo(u),d},"connectionFactory");return(0,_Fo.createConnection)(l,CFo,n)}a(SFo,"_createConnection");function TFo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,Jhn.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,Jhn.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(TFo,"patchConsole")});var PP=I((fLu,rmn)=>{"use strict";p();rmn.exports=Xc()});var Mmn=I((n3u,Nmn)=>{"use strict";p();Nmn.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 D0n=I(s0=>{"use strict";p();var G9t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),I8o=G9t(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")}),x8o=G9t(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")}),w8o=G9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),x0n=s0&&s0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R8o=s0&&s0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w0n=s0&&s0.__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:D8o,sync:N8o}=D0n(),{join:M8o,delimiter:O8o,sep:N0n,posix:M0n}=require("path"),O0n=process.platform==="win32",L0n=new RegExp(`[${M0n.sep}${N0n===M0n.sep?"":N0n}]`.replace(/(\\)/g,"\\$1")),L8o=new RegExp(`^\\.${L0n.source}`),B0n=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),F0n=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=O8o})=>{let o=t.match(L0n)?[""]:[...O0n?[process.cwd()]:[],...(e||"").split(n)];if(O0n){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"),U0n=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&L8o.test(e)?e.slice(0,2):"")+M8o(r,e)},"getPathPart"),Q0n=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=F0n(t,e),s=[];for(let c of r){let l=U0n(c,t);for(let u of n){let d=l+u;if(await D8o(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 B0n(t)},"which"),B8o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=F0n(t,e),s=[];for(let c of r){let l=U0n(c,t);for(let u of n){let d=l+u;if(N8o(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 B0n(t)},"whichSync");q0n.exports=Q0n;Q0n.sync=B8o});var GIe=I((U7u,rAn)=>{"use strict";p();var Zgn="[^\\\\/]",_9o="(?=.)",Xgn="[^/]",lUt="(?:\\/|$)",eAn="(?:^|\\/)",uUt=`\\.{1,2}${lUt}`,v9o="(?!\\.)",C9o=`(?!${eAn}${uUt})`,b9o=`(?!\\.{0,1}${lUt})`,S9o=`(?!${uUt})`,T9o="[^.\\/]",I9o=`${Xgn}*?`,x9o="/",tAn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_9o,QMARK:Xgn,END_ANCHOR:lUt,DOTS_SLASH:uUt,NO_DOT:v9o,NO_DOTS:C9o,NO_DOT_SLASH:b9o,NO_DOTS_SLASH:S9o,QMARK_NO_DOT:T9o,STAR:I9o,START_ANCHOR:eAn,SEP:x9o},w9o={...tAn,SLASH_LITERAL:"[\\\\/]",QMARK:Zgn,STAR:`${Zgn}*?`,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:"\\"},R9o={__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"};rAn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:R9o,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?w9o:tAn}}});var $Ie=I(LC=>{"use strict";p();var{REGEX_BACKSLASH:k9o,REGEX_REMOVE_BACKSLASH:P9o,REGEX_SPECIAL_CHARS:D9o,REGEX_SPECIAL_CHARS_GLOBAL:N9o}=GIe();LC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);LC.hasRegexChars=t=>D9o.test(t);LC.isRegexChar=t=>t.length===1&&LC.hasRegexChars(t);LC.escapeRegex=t=>t.replace(N9o,"\\$1");LC.toPosixSlashes=t=>t.replace(k9o,"/");LC.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};LC.removeBackslashes=t=>t.replace(P9o,e=>e==="\\"?"":e);LC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?LC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};LC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};LC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};LC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var uAn=I((H7u,lAn)=>{"use strict";p();var nAn=$Ie(),{CHAR_ASTERISK:dUt,CHAR_AT:M9o,CHAR_BACKWARD_SLASH:VIe,CHAR_COMMA:O9o,CHAR_DOT:fUt,CHAR_EXCLAMATION_MARK:pUt,CHAR_FORWARD_SLASH:cAn,CHAR_LEFT_CURLY_BRACE:hUt,CHAR_LEFT_PARENTHESES:mUt,CHAR_LEFT_SQUARE_BRACKET:L9o,CHAR_PLUS:B9o,CHAR_QUESTION_MARK:iAn,CHAR_RIGHT_CURLY_BRACE:F9o,CHAR_RIGHT_PARENTHESES:oAn,CHAR_RIGHT_SQUARE_BRACKET:U9o}=GIe(),sAn=a(t=>t===cAn||t===VIe,"isPathSeparator"),aAn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),Q9o=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"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=P,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&&sAn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(O&&(O=nAn.removeBackslashes(O)),q&&v===!0&&(q=nAn.removeBackslashes(q)));let j={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&&(j.maxDepth=0,sAn(P)||c.push(D),j.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var WIe=GIe(),QS=$Ie(),{MAX_LENGTH:Dze,POSIX_REGEX_SOURCE:q9o,REGEX_NON_SPECIAL_CHARS:j9o,REGEX_SPECIAL_CHARS_BACKREF:H9o,REPLACEMENTS:dAn}=WIe,G9o=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=>QS.escapeRegex(o)).join("..")}return r},"expandRange"),Qle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),fAn=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"),$9o=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"),pAn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if($9o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),V9o=a(t=>{let e=t.map(pAn).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"),W9o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=pAn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?QS.escapeRegex(r[0]):`[${r.map(o=>QS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),z9o=a(t=>{let e=0,r=t.trim(),n=gUt(r);for(;n;)e++,r=n.body.trim(),n=gUt(r);return e},"repeatedExtglobRecursion"),Y9o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:WIe.DEFAULT_MAX_EXTGLOB_RECURSION,n=fAn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||V9o(n)))return{risky:!0};for(let o of n){let s=W9o(o);if(s)return{risky:!0,safeOutput:s};if(z9o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),AUt=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=WIe.globChars(r.windows),d=WIe.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(ge=>`(${l}(?:(?!${w}${ge.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=QS.removePrefix(t,N),o=t.length;let L=[],B=[],q=[],M=s,O,j=a(()=>N.index===o-1,"eos"),Q=N.peek=(ge=1)=>t[N.index+ge],U=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((ge="",Ue=0)=>{N.consumed+=ge,N.index+=Ue},"consume"),V=a(ge=>{N.output+=ge.output!=null?ge.output:ge.value,W(ge.value)},"append"),z=a(()=>{let ge=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ge++;return ge%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(ge=>{N[ge]++,q.push(ge)},"increment"),H=a(ge=>{N[ge]--,q.pop()},"decrement"),re=a(ge=>{if(M.type==="globstar"){let Ue=N.braces>0&&(ge.type==="comma"||ge.type==="brace"),ke=ge.extglob===!0||L.length&&(ge.type==="pipe"||ge.type==="paren");ge.type!=="slash"&&ge.type!=="paren"&&!Ue&&!ke&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ge.type!=="paren"&&(L[L.length-1].inner+=ge.value),(ge.value||ge.output)&&V(ge),M&&M.type==="text"&&ge.type==="text"){M.output=(M.output||M.value)+ge.value,M.value+=ge.value;return}ge.prev=M,c.push(ge),M=ge},"push"),le=a((ge,Ue)=>{let ke={...d[Ue],conditions:1,inner:""};ke.prev=M,ke.parens=N.parens,ke.output=N.output,ke.startIndex=N.index,ke.tokensIndex=c.length;let X=(r.capture?"(":"")+ke.open;ie("parens"),re({type:ge,value:Ue,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:X}),L.push(ke)},"extglobOpen"),Le=a(ge=>{let Ue=t.slice(ge.startIndex,N.index+1),ke=t.slice(ge.startIndex+2,N.index),X=Y9o(ke,r);if((ge.type==="plus"||ge.type==="star")&&X.risky){let he=X.safeOutput?(ge.output?"":g)+(r.capture?`(${X.safeOutput})`:X.safeOutput):void 0,Z=c[ge.tokensIndex];Z.type="text",Z.value=Ue,Z.output=he||QS.escapeRegex(Ue);for(let ue=ge.tokensIndex+1;ue1&&ge.inner.includes("/")&&(he=R(r)),(he!==D||j()||/^\)+$/.test(Y()))&&(ee=ge.close=`)$))${he}`),ge.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let Z=AUt(K,{...e,fastpaths:!1}).output;ee=ge.close=`)${Z})${he})`}ge.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 ge=!1,Ue=t.replace(H9o,(ke,X,ee,K,he,Z)=>K==="\\"?(ge=!0,ke):K==="?"?X?X+K+(he?v.repeat(he.length):""):Z===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?X?X+K+(he?D:""):D:X?ke:`\\${ke}`);return ge===!0&&(r.unescape===!0?Ue=Ue.replace(/\\/g,""):Ue=Ue.replace(/\\+/g,ke=>ke.length%2===0?"\\\\":ke?"\\":"")),Ue===t&&r.contains===!0?(N.output=t,N):(N.output=QS.wrapOutput(Ue,N,e),N)}for(;!j();){if(O=U(),O==="\0")continue;if(O==="\\"){let ke=Q();if(ke==="/"&&r.bash!==!0||ke==="."||ke===";")continue;if(!ke){O+="\\",re({type:"text",value:O});continue}let X=/^\\+/.exec(Y()),ee=0;if(X&&X[0].length>2&&(ee=X[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 ke=M.value.slice(1);if(ke.includes("[")&&(M.posix=!0,ke.includes(":"))){let X=M.value.lastIndexOf("["),ee=M.value.slice(0,X),K=M.value.slice(X+2),he=q9o[K];if(he){M.value=ee+he,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,V({value:O});continue}if(N.quotes===1&&O!=='"'){O=QS.escapeRegex(O),M.value+=O,V({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ie("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qle("opening","("));let ke=L[L.length-1];if(ke&&N.parens===ke.parens+1){Le(L.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));O=`\\${O}`}else ie("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(Qle("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let ke=M.value.slice(1);if(M.posix!==!0&&ke[0]==="^"&&!ke.includes("/")&&(O=`/${O}`),M.value+=O,V({value:O}),r.literalBrackets===!1||QS.hasRegexChars(ke))continue;let X=QS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=X,M.value=X;continue}M.value=`(${l}${X}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ie("braces");let ke={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(ke),re(ke);continue}if(O==="}"){let ke=B[B.length-1];if(r.nobrace===!0||!ke){re({type:"text",value:O,output:O});continue}let X=")";if(ke.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);X=G9o(K,r),N.backtrack=!0}if(ke.comma!==!0&&ke.dots!==!0){let ee=N.output.slice(0,ke.outputIndex),K=N.tokens.slice(ke.tokensIndex);ke.value=ke.output="\\{",O=X="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:O,output:X}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let ke=O,X=B[B.length-1];X&&q[q.length-1]==="braces"&&(X.comma=!0,ke="|"),re({type:"comma",value:O,output:ke});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 ke=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,ke.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)!=="?"){le("qmark",O);continue}if(M&&M.type==="paren"){let X=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(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)))){le("negate",O);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("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 ke=j9o.exec(Y());ke&&(O+=ke[0],N.index+=ke[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 ge=Y();if(r.noextglob!==!0&&/^\([^?]/.test(ge)){le("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let ke=M.prev,X=ke.prev,ee=ke.type==="slash"||ke.type==="bos",K=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!ee||ge[0]&&ge[0]!=="/")){re({type:"star",value:O,output:""});continue}let he=N.braces>0&&(ke.type==="comma"||ke.type==="brace"),Z=L.length&&(ke.type==="pipe"||ke.type==="paren");if(!ee&&ke.type!=="paren"&&!he&&!Z){re({type:"star",value:O,output:""});continue}for(;ge.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ge=ge.slice(3),W("/**",3)}if(ke.type==="bos"&&j()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&!K&&j()){N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=ke.output+M.output,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&ge[0]==="/"){let ue=ge[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=ke.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(ke.type==="bos"&&ge[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 Ue={type:"star",value:O,output:D};if(r.bash===!0){Ue.output=".*?",(M.type==="bos"||M.type==="slash")&&(Ue.output=x+Ue.output),re(Ue);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Ue.output=O,re(Ue);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(Ue)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));N.output=QS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing",")"));N.output=QS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","}"));N.output=QS.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 ge of N.tokens)N.output+=ge.output!=null?ge.output:ge.value,ge.suffix&&(N.output+=ge.suffix)}return N},"parse");AUt.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}=WIe.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=QS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};hAn.exports=AUt});var yAn=I((Y7u,AAn)=>{"use strict";p();var K9o=uAn(),yUt=mAn(),gAn=$Ie(),J9o=GIe(),Z9o=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Zp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Zp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=Z9o(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?Zp.compileRe(t,e):Zp.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=Zp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Zp.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");Zp.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?gAn.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=Zp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Zp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Zp.makeRe(e,r)).test(gAn.basename(t));Zp.isMatch=(t,e,r)=>Zp(e,r)(t);Zp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Zp.parse(r,e)):yUt(t,{...e,fastpaths:!1});Zp.scan=(t,e)=>K9o(t,e);Zp.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=Zp.toRegex(l,e);return n===!0&&(u.state=t),u};Zp.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=yUt.fastpaths(t,e)),o.output||(o=yUt(t,e)),Zp.compileRe(o,e,r,n)};Zp.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/$^/}};Zp.constants=J9o;AAn.exports=Zp});var CAn=I((Z7u,vAn)=>{"use strict";p();var EAn=yAn(),X9o=$Ie();function _An(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:X9o.isWindows()}),EAn(t,e,r)}a(_An,"picomatch");Object.assign(_An,EAn);vAn.exports=_An});var SAn=I((tQu,bAn)=>{p();bAn.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 xAn=I((iQu,IAn)=>{p();var eUo=SAn(),TAn={"{":"}","(":")","[":"]"},tUo=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=TAn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),rUo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var yK=require("path"),nUo=CAn(),iUo=xAn();function Nze(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(iUo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=nUo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(yK.resolve(t,o))}return e}a(Nze,"normalizeOptions");wAn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(yK.resolve(e),yK.resolve(r),Nze(e,n))},getEventsSince(e,r,n){return t.getEventsSince(yK.resolve(e),yK.resolve(r),Nze(e,n))},async subscribe(e,r,n){return e=yK.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(yK.resolve(e),r,Nze(e,n))}})});var kAn=I(zIe=>{"use strict";p();var oUo=require("path"),{createWrapper:sUo}=RAn();function aUo(){return oUo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(aUo,"resolveBindingPath");var cUo=require(aUo()),Mze=sUo(cUo);zIe.writeSnapshot=Mze.writeSnapshot;zIe.getEventsSince=Mze.getEventsSince;zIe.subscribe=Mze.subscribe;zIe.unsubscribe=Mze.unsubscribe});var q_=I(Qze=>{"use strict";p();Object.defineProperty(Qze,"__esModule",{value:!0});Qze.Position=void 0;var bUt=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 LAn=q_(),SUt=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 LAn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new LAn.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=SUt});var Fyn=I(l7t=>{"use strict";p();Object.defineProperty(l7t,"__esModule",{value:!0});l7t.assertNever=f7o;function f7o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(f7o,"assertNever")});var lxe=I(F3=>{"use strict";p();Object.defineProperty(F3,"__esModule",{value:!0});F3.ChatCompletionContentPartOpaque=F3.ChatCompletionContentPartKind=F3.ChatRole=void 0;var p7o=Fyn(),hYe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(hYe||(F3.ChatRole=hYe={}));(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,p7o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(hYe||(F3.ChatRole=hYe={}));var Uyn;(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"})(Uyn||(F3.ChatCompletionContentPartKind=Uyn={}));var Qyn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(Qyn||(F3.ChatCompletionContentPartOpaque=Qyn={}))});var u7t=I(EO=>{"use strict";p();Object.defineProperty(EO,"__esModule",{value:!0});EO.BaseTokensPerName=EO.BaseTokensPerMessage=EO.BaseTokensPerCompletion=EO.ChatRole=void 0;var qyn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(qyn||(EO.ChatRole=qyn={}));EO.BaseTokensPerCompletion=3;EO.BaseTokensPerMessage=3;EO.BaseTokensPerName=1});var $yn=I(gYe=>{"use strict";p();Object.defineProperty(gYe,"__esModule",{value:!0});gYe.toOpenAiChatMessage=Gyn;gYe.toOpenAIChatMessages=m7o;var _O=lxe(),mYe=u7t(),h7o=sq();function jyn(t){return t.filter(e=>e.type===_O.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(jyn,"onlyStringContent");function Hyn(t){let e=t.map(r=>{if(r.type===_O.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===_O.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===_O.ChatCompletionContentPartKind.Document)return;if(r.type===_O.ChatCompletionContentPartKind.Opaque&&_O.ChatCompletionContentPartOpaque.usableIn(r,h7o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(Hyn,"stringAndImageContent");function Gyn(t){switch(t.role){case _O.ChatRole.System:return{role:mYe.ChatRole.System,content:jyn(t.content),name:t.name};case _O.ChatRole.User:return{role:mYe.ChatRole.User,content:Hyn(t.content),name:t.name};case _O.ChatRole.Assistant:return{role:mYe.ChatRole.Assistant,content:jyn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case _O.ChatRole.Tool:return{role:mYe.ChatRole.Tool,content:Hyn(t.content),tool_call_id:t.toolCallId};default:return}}a(Gyn,"toOpenAiChatMessage");function m7o(t){return t.map(Gyn).filter(e=>!!e)}a(m7o,"toOpenAIChatMessages")});var Wyn=I(EYe=>{"use strict";p();Object.defineProperty(EYe,"__esModule",{value:!0});EYe.toVsCodeChatMessage=Vyn;EYe.toVsCodeChatMessages=g7o;var yYe=lxe();function AYe(t){return t.filter(e=>e.type===yYe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(AYe,"onlyStringContent");var aq;function Vyn(t){switch(aq??=require("vscode"),t.role){case yYe.ChatRole.Assistant:let e=aq.LanguageModelChatMessage.Assistant(AYe(t.content),t.name);return t.toolCalls&&(e.content=[new aq.LanguageModelTextPart(AYe(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 aq.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case yYe.ChatRole.User:return aq.LanguageModelChatMessage.User(AYe(t.content),t.name);case yYe.ChatRole.Tool:{let r=aq.LanguageModelChatMessage.User("");return r.content=[new aq.LanguageModelToolResultPart(t.toolCallId,[new aq.LanguageModelTextPart(AYe(t.content))])],r}default:return}}a(Vyn,"toVsCodeChatMessage");function g7o(t){return t.map(Vyn).filter(e=>!!e)}a(g7o,"toVsCodeChatMessages")});var sq=I(FP=>{"use strict";p();Object.defineProperty(FP,"__esModule",{value:!0});FP.OutputMode=FP.Raw=FP.OpenAI=void 0;FP.toMode=d7t;FP.toVSCode=A7o;FP.toOpenAI=y7o;var zyn=$yn(),Yyn=Wyn();FP.OpenAI=u7t();FP.Raw=lxe();var IK;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(IK||(FP.OutputMode=IK={}));function d7t(t,e){switch(t){case IK.Raw:return e;case IK.VSCode:return e instanceof Array?(0,Yyn.toVsCodeChatMessages)(e):(0,Yyn.toVsCodeChatMessage)(e);case IK.OpenAI:return e instanceof Array?(0,zyn.toOpenAIChatMessages)(e):(0,zyn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(d7t,"toMode");function A7o(t){return d7t(IK.VSCode,t)}a(A7o,"toVSCode");function y7o(t){return d7t(IK.OpenAI,t)}a(y7o,"toOpenAI")});var f7t=I(uxe=>{"use strict";p();Object.defineProperty(uxe,"__esModule",{value:!0});uxe.jsonRetainedProps=void 0;uxe.forEachNode=Kyn;uxe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Kyn(t,e){if(e(t),t.type===1)for(let r of t.children)Kyn(r,e)}a(Kyn,"forEachNode")});var Jyn=I(p7t=>{"use strict";p();Object.defineProperty(p7t,"__esModule",{value:!0});p7t.once=E7o;function E7o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(E7o,"once")});var A7t=I(hg=>{"use strict";p();Object.defineProperty(hg,"__esModule",{value:!0});hg.BudgetExceededError=hg.MaterializedChatMessageDocument=hg.MaterializedChatMessageImage=hg.MaterializedChatMessageBreakpoint=hg.MaterializedChatMessageOpaque=hg.MaterializedChatMessage=hg.MaterializedChatMessageTextChunk=hg.GenericMaterializedContainer=void 0;var xK=Jyn(),RA=sq(),U3=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=lq(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 sEn(e,this.children,r)}allMetadata(){return oEn(this)}findById(e){return g7t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)_7o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof QP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof QP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return m7t(this,e),e}};hg.GenericMaterializedContainer=U3;var dxe=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,xK.once)(async e=>await e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};hg.MaterializedChatMessageTextChunk=dxe;var QP=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=sEn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return m7t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return g7t(e,this)}_tokenCount=(0,xK.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,RA.toMode)(e.mode,r))});_upperBound=(0,xK.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,xK.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===RA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===RA.Raw.ChatCompletionContentPartKind.Image||n.type===RA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,RA.toMode)(e.mode,r))});_text=(0,xK.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of nEn(this)){if(r instanceof wK||r instanceof RK||r instanceof cq){e.push(r);continue}if(r instanceof UP){e.at(-1)instanceof UP?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(` +${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 Vdn=I((hRu,$dn)=>{"use strict";p();var qLo=require("path"),jLo=qLo.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");$dn.exports=require(jLo)});var opn={};ki(opn,{TextDocument:()=>T3});function b6t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);b6t(n,e),b6t(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 v3o(t){let e=ipn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var cWe,T3,S6t=ve(()=>{"use strict";p();cWe=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=ipn(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=rpn(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&&npn(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 cWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof cWe)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=b6t(s.map(v3o),(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})(T3||(T3={}));a(b6t,"mergeSort");a(rpn,"computeLineOffsets");a(npn,"isEOL");a(ipn,"getWellformedRange");a(v3o,"getWellformedEdit")});var yWe=I(zh=>{"use strict";p();Object.defineProperty(zh,"__esModule",{value:!0});zh.thenable=zh.typedArray=zh.stringArray=zh.array=zh.func=zh.error=zh.number=zh.string=zh.boolean=void 0;function I3o(t){return t===!0||t===!1}a(I3o,"boolean");zh.boolean=I3o;function mhn(t){return typeof t=="string"||t instanceof String}a(mhn,"string");zh.string=mhn;function x3o(t){return typeof t=="number"||t instanceof Number}a(x3o,"number");zh.number=x3o;function w3o(t){return t instanceof Error}a(w3o,"error");zh.error=w3o;function ghn(t){return typeof t=="function"}a(ghn,"func");zh.func=ghn;function Ahn(t){return Array.isArray(t)}a(Ahn,"array");zh.array=Ahn;function R3o(t){return Ahn(t)&&t.every(e=>mhn(e))}a(R3o,"stringArray");zh.stringArray=R3o;function k3o(t,e){return Array.isArray(t)&&t.every(e)}a(k3o,"typedArray");zh.typedArray=k3o;function P3o(t){return t&&ghn(t.then)}a(P3o,"thenable");zh.thenable=P3o});var j6t=I(Qx=>{"use strict";p();Object.defineProperty(Qx,"__esModule",{value:!0});Qx.generateUuid=Qx.parse=Qx.isUUID=Qx.v4=Qx.empty=void 0;var IIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},xIe=class t extends IIe{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(""))}};xIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];xIe._timeHighBits=["8","9","a","b"];Qx.empty=new IIe("00000000-0000-0000-0000-000000000000");function yhn(){return new xIe}a(yhn,"v4");Qx.v4=yhn;var D3o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ehn(t){return D3o.test(t)}a(Ehn,"isUUID");Qx.isUUID=Ehn;function N3o(t){if(!Ehn(t))throw new Error("invalid uuid");return new IIe(t)}a(N3o,"parse");Qx.parse=N3o;function M3o(){return yhn().asHex()}a(M3o,"generateUuid");Qx.generateUuid=M3o});var _hn=I(MQ=>{"use strict";p();Object.defineProperty(MQ,"__esModule",{value:!0});MQ.attachPartialResult=MQ.ProgressFeature=MQ.attachWorkDone=void 0;var NQ=ei(),O3o=j6t(),YY=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(NQ.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(NQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(NQ.WorkDoneProgress.type,this._token,{kind:"end"})}};YY.Instances=new Map;var EWe=class extends YY{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new NQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},wIe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},_We=class extends wIe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new NQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function L3o(t,e){if(e===void 0||e.workDoneToken===void 0)return new wIe;let r=e.workDoneToken;return delete e.workDoneToken,new YY(t,r)}a(L3o,"attachWorkDone");MQ.attachWorkDone=L3o;var B3o=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(NQ.WorkDoneProgressCancelNotification.type,r=>{let n=YY.Instances.get(r.token);(n instanceof EWe||n instanceof _We)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new wIe:new YY(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,O3o.generateUuid)();return this.connection.sendRequest(NQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new EWe(this.connection,e))}else return Promise.resolve(new _We)}},"ProgressFeature");MQ.ProgressFeature=B3o;var H6t;(function(t){t.type=new NQ.ProgressType})(H6t||(H6t={}));var G6t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(H6t.type,this._token,e)}};function F3o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new G6t(t,r)}a(F3o,"attachPartialResult");MQ.attachPartialResult=F3o});var vhn=I(vWe=>{"use strict";p();Object.defineProperty(vWe,"__esModule",{value:!0});vWe.ConfigurationFeature=void 0;var U3o=ei(),Q3o=yWe(),q3o=a(t=>class extends t{getConfiguration(e){return e?Q3o.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(U3o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");vWe.ConfigurationFeature=q3o});var Chn=I(bWe=>{"use strict";p();Object.defineProperty(bWe,"__esModule",{value:!0});bWe.WorkspaceFoldersFeature=void 0;var CWe=ei(),j3o=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 CWe.Emitter,this.connection.onNotification(CWe.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(CWe.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(CWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");bWe.WorkspaceFoldersFeature=j3o});var bhn=I(SWe=>{"use strict";p();Object.defineProperty(SWe,"__esModule",{value:!0});SWe.CallHierarchyFeature=void 0;var $6t=ei(),H3o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest($6t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=$6t.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=$6t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");SWe.CallHierarchyFeature=H3o});var W6t=I(OQ=>{"use strict";p();Object.defineProperty(OQ,"__esModule",{value:!0});OQ.SemanticTokensBuilder=OQ.SemanticTokensDiff=OQ.SemanticTokensFeature=void 0;var TWe=ei(),G3o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(TWe.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=TWe.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=TWe.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=TWe.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");OQ.SemanticTokensFeature=G3o;var IWe=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 IWe(this._prevData,this._data).computeDiff()}:this.build()}};OQ.SemanticTokensBuilder=V6t});var Shn=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.ShowDocumentFeature=void 0;var $3o=ei(),V3o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest($3o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");xWe.ShowDocumentFeature=V3o});var Thn=I(wWe=>{"use strict";p();Object.defineProperty(wWe,"__esModule",{value:!0});wWe.FileOperationsFeature=void 0;var Ile=ei(),W3o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ile.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Ile.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Ile.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Ile.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Ile.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Ile.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");wWe.FileOperationsFeature=W3o});var Ihn=I(RWe=>{"use strict";p();Object.defineProperty(RWe,"__esModule",{value:!0});RWe.LinkedEditingRangeFeature=void 0;var z3o=ei(),Y3o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(z3o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");RWe.LinkedEditingRangeFeature=Y3o});var xhn=I(kWe=>{"use strict";p();Object.defineProperty(kWe,"__esModule",{value:!0});kWe.TypeHierarchyFeature=void 0;var z6t=ei(),K3o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(z6t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=z6t.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=z6t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");kWe.TypeHierarchyFeature=K3o});var Rhn=I(PWe=>{"use strict";p();Object.defineProperty(PWe,"__esModule",{value:!0});PWe.InlineValueFeature=void 0;var whn=ei(),J3o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(whn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(whn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");PWe.InlineValueFeature=J3o});var Phn=I(DWe=>{"use strict";p();Object.defineProperty(DWe,"__esModule",{value:!0});DWe.FoldingRangeFeature=void 0;var khn=ei(),Z3o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(khn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=khn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");DWe.FoldingRangeFeature=Z3o});var Dhn=I(NWe=>{"use strict";p();Object.defineProperty(NWe,"__esModule",{value:!0});NWe.InlayHintFeature=void 0;var Y6t=ei(),X3o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(Y6t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Y6t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(Y6t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");NWe.InlayHintFeature=X3o});var Nhn=I(MWe=>{"use strict";p();Object.defineProperty(MWe,"__esModule",{value:!0});MWe.DiagnosticFeature=void 0;var RIe=ei(),eFo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(RIe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(RIe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(RIe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(RIe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(RIe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");MWe.DiagnosticFeature=eFo});var J6t=I(OWe=>{"use strict";p();Object.defineProperty(OWe,"__esModule",{value:!0});OWe.TextDocuments=void 0;var KY=ei(),K6t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new KY.Emitter,this._onDidOpen=new KY.Emitter,this._onDidClose=new KY.Emitter,this._onDidSave=new KY.Emitter,this._onWillSave=new KY.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=KY.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}))})),KY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};OWe.TextDocuments=K6t});var X6t=I(xle=>{"use strict";p();Object.defineProperty(xle,"__esModule",{value:!0});xle.NotebookDocuments=xle.NotebookSyncFeature=void 0;var qx=ei(),Mhn=J6t(),tFo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(qx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(qx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(qx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(qx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");xle.NotebookSyncFeature=tFo;var LWe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,qx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,qx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,qx.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}};LWe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var Z6t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Mhn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Mhn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new qx.Emitter,this._onDidChange=new qx.Emitter,this._onDidSave=new qx.Emitter,this._onDidClose=new qx.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 LWe,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)}})),qx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};xle.NotebookDocuments=Z6t});var Ohn=I(BWe=>{"use strict";p();Object.defineProperty(BWe,"__esModule",{value:!0});BWe.MonikerFeature=void 0;var rFo=ei(),nFo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=rFo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");BWe.MonikerFeature=nFo});var o9t=I(gc=>{"use strict";p();Object.defineProperty(gc,"__esModule",{value:!0});gc.createConnection=gc.combineFeatures=gc.combineNotebooksFeatures=gc.combineLanguagesFeatures=gc.combineWorkspaceFeatures=gc.combineWindowFeatures=gc.combineClientFeatures=gc.combineTracerFeatures=gc.combineTelemetryFeatures=gc.combineConsoleFeatures=gc._NotebooksImpl=gc._LanguagesImpl=gc.BulkUnregistration=gc.BulkRegistration=gc.ErrorMessageTracker=void 0;var Kr=ei(),jx=yWe(),t9t=j6t(),Io=_hn(),iFo=vhn(),oFo=Chn(),sFo=bhn(),aFo=W6t(),cFo=Shn(),lFo=Thn(),uFo=Ihn(),dFo=xhn(),fFo=Rhn(),pFo=Phn(),hFo=Dhn(),mFo=Nhn(),gFo=X6t(),AFo=Ohn();function e9t(t){if(t!==null)return t}a(e9t,"null2Undefined");var r9t=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)})}};gc.ErrorMessageTracker=r9t;var FWe=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")})}},n9t=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(e9t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(e9t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(e9t)}},Lhn=(0,cFo.ShowDocumentFeature)((0,Io.ProgressFeature)(n9t)),Bhn;(function(t){function e(){return new UWe}a(e,"create"),t.create=e})(Bhn||(gc.BulkRegistration=Bhn={}));var UWe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=jx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=t9t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Fhn;(function(t){function e(){return new kIe(void 0,[])}a(e,"create"),t.create=e})(Fhn||(gc.BulkUnregistration=Fhn={}));var kIe=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=jx.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}},QWe=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 UWe?this.registerMany(e):e instanceof kIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=jx.string(r)?r:r.method,s=t9t.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=jx.string(e)?e:e.method,o=t9t.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 kIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},i9t=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)}},Uhn=(0,lFo.FileOperationsFeature)((0,oFo.WorkspaceFoldersFeature)((0,iFo.ConfigurationFeature)(i9t))),qWe=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(()=>{})}},jWe=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")})}},HWe=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,Io.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,Io.attachPartialResult)(this.connection,r)}};gc._LanguagesImpl=HWe;var Qhn=(0,pFo.FoldingRangeFeature)((0,AFo.MonikerFeature)((0,mFo.DiagnosticFeature)((0,hFo.InlayHintFeature)((0,fFo.InlineValueFeature)((0,dFo.TypeHierarchyFeature)((0,uFo.LinkedEditingRangeFeature)((0,aFo.SemanticTokensFeature)((0,sFo.CallHierarchyFeature)(HWe))))))))),GWe=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,Io.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,Io.attachPartialResult)(this.connection,r)}};gc._NotebooksImpl=GWe;var qhn=(0,gFo.NotebookSyncFeature)(GWe);function jhn(t,e){return function(r){return e(t(r))}}a(jhn,"combineConsoleFeatures");gc.combineConsoleFeatures=jhn;function Hhn(t,e){return function(r){return e(t(r))}}a(Hhn,"combineTelemetryFeatures");gc.combineTelemetryFeatures=Hhn;function Ghn(t,e){return function(r){return e(t(r))}}a(Ghn,"combineTracerFeatures");gc.combineTracerFeatures=Ghn;function $hn(t,e){return function(r){return e(t(r))}}a($hn,"combineClientFeatures");gc.combineClientFeatures=$hn;function Vhn(t,e){return function(r){return e(t(r))}}a(Vhn,"combineWindowFeatures");gc.combineWindowFeatures=Vhn;function Whn(t,e){return function(r){return e(t(r))}}a(Whn,"combineWorkspaceFeatures");gc.combineWorkspaceFeatures=Whn;function zhn(t,e){return function(r){return e(t(r))}}a(zhn,"combineLanguagesFeatures");gc.combineLanguagesFeatures=zhn;function Yhn(t,e){return function(r){return e(t(r))}}a(Yhn,"combineNotebooksFeatures");gc.combineNotebooksFeatures=Yhn;function yFo(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,jhn),tracer:r(t.tracer,e.tracer,Ghn),telemetry:r(t.telemetry,e.telemetry,Hhn),client:r(t.client,e.client,$hn),window:r(t.window,e.window,Vhn),workspace:r(t.workspace,e.workspace,Whn),languages:r(t.languages,e.languages,zhn),notebooks:r(t.notebooks,e.notebooks,Yhn)}}a(yFo,"combineFeatures");gc.combineFeatures=yFo;function EFo(t,e,r){let n=r&&r.console?new(r.console(FWe)):new FWe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(qWe)):new qWe,c=r&&r.telemetry?new(r.telemetry(jWe)):new jWe,l=r&&r.client?new(r.client(QWe)):new QWe,u=r&&r.window?new(r.window(Lhn)):new Lhn,d=r&&r.workspace?new(r.workspace(Uhn)):new Uhn,f=r&&r.languages?new(r.languages(Qhn)):new Qhn,h=r&&r.notebooks?new(r.notebooks(qhn)):new qhn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:jx.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(jx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=jx.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,Io.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.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,Io.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.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,Io.attachWorkDone)(o,b),(0,Io.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,Io.attachWorkDone)(o,b),(0,Io.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,Io.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,Io.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,Io.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,Io.attachWorkDone)(o,b),(0,Io.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,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,Io.attachWorkDone)(o,b),(0,Io.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,Io.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),jx.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,Io.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=jx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!jx.number(R.textDocumentSync)&&!jx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=jx.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(EFo,"createConnection");gc.createConnection=EFo});var Khn=I(NC=>{"use strict";p();Object.defineProperty(NC,"__esModule",{value:!0});NC.resolveModulePath=NC.FileSystem=NC.resolveGlobalYarnPath=NC.resolveGlobalNodePath=NC.resolve=NC.uriToFilePath=void 0;var _Fo=require("url"),DP=require("path"),s9t=require("fs"),u9t=require("child_process");function vFo(t){let e=_Fo.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 DP.normalize(r.join("/"))}a(vFo,"uriToFilePath");NC.uriToFilePath=vFo;function a9t(){return process.platform==="win32"}a(a9t,"isWindows");function $We(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&&s9t.existsSync(e)&&(d[o]?d[o]=e+DP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,u9t.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($We,"resolve");NC.resolve=$We;function c9t(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};a9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,u9t.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?a9t()?DP.join(c,"node_modules"):DP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(c9t,"resolveGlobalNodePath");NC.resolveGlobalNodePath=c9t;function CFo(t){let e="yarn",r={encoding:"utf8"};a9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,u9t.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 DP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(CFo,"resolveGlobalYarnPath");NC.resolveGlobalYarnPath=CFo;var l9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!s9t.existsSync(__filename.toUpperCase())||!s9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?DP.normalize(s).indexOf(DP.normalize(o))===0:DP.normalize(s).toLowerCase().indexOf(DP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(l9t||(NC.FileSystem=l9t={}));function bFo(t,e,r,n){return r?(DP.isAbsolute(r)||(r=DP.join(t,r)),$We(e,r,r,n).then(o=>l9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>$We(e,c9t(n),t,n))):$We(e,c9t(n),t,n)}a(bFo,"resolveModulePath");NC.resolveModulePath=bFo});var d9t=I((yLu,Jhn)=>{"use strict";p();Jhn.exports=ei()});var Zhn=I(VWe=>{"use strict";p();Object.defineProperty(VWe,"__esModule",{value:!0});VWe.InlineCompletionFeature=void 0;var SFo=ei(),TFo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(SFo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");VWe.InlineCompletionFeature=TFo});var tmn=I(sE=>{"use strict";p();var IFo=sE&&sE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),emn=sE&&sE.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IFo(e,t,r)};Object.defineProperty(sE,"__esModule",{value:!0});sE.ProposedFeatures=sE.NotebookDocuments=sE.TextDocuments=sE.SemanticTokensBuilder=void 0;var xFo=W6t();Object.defineProperty(sE,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return xFo.SemanticTokensBuilder},"get")});var wFo=Zhn();emn(ei(),sE);var RFo=J6t();Object.defineProperty(sE,"TextDocuments",{enumerable:!0,get:a(function(){return RFo.TextDocuments},"get")});var kFo=X6t();Object.defineProperty(sE,"NotebookDocuments",{enumerable:!0,get:a(function(){return kFo.NotebookDocuments},"get")});emn(o9t(),sE);var Xhn;(function(t){t.all={__brand:"features",languages:wFo.InlineCompletionFeature}})(Xhn||(sE.ProposedFeatures=Xhn={}))});var Xc=I(Hx=>{"use strict";p();var PFo=Hx&&Hx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),omn=Hx&&Hx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PFo(e,t,r)};Object.defineProperty(Hx,"__esModule",{value:!0});Hx.createConnection=Hx.Files=void 0;var rmn=require("node:util"),f9t=yWe(),DFo=o9t(),PIe=Khn(),JY=d9t();omn(d9t(),Hx);omn(tmn(),Hx);var nmn;(function(t){t.uriToFilePath=PIe.uriToFilePath,t.resolveGlobalNodePath=PIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=PIe.resolveGlobalYarnPath,t.resolve=PIe.resolve,t.resolveModulePath=PIe.resolveModulePath})(nmn||(Hx.Files=nmn={}));var imn;function WWe(){if(imn!==void 0)try{imn.end()}catch{}}a(WWe,"endProtocolConnection");var wle=!1,smn;function NFo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(smn=setInterval(()=>{try{process.kill(n,0)}catch{WWe(),process.exit(wle?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;f9t.number(e)&&smn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(wle?0:1)}},3e3)},"initialize"),get shutdownReceived(){return wle},set shutdownReceived(t){wle=t},exit:a(t=>{WWe(),process.exit(t)},"exit")};function OFo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),JY.ConnectionStrategy.is(t)||JY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),LFo(s,c,l,o)}a(OFo,"createConnection");Hx.createConnection=OFo;function LFo(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{WWe(),process.exit(wle?0:1)}),u.on("close",()=>{WWe(),process.exit(wle?0:1)})}let l=a(u=>{let d=(0,JY.createProtocolConnection)(t,e,u,r);return o&&BFo(u),d},"connectionFactory");return(0,DFo.createConnection)(l,MFo,n)}a(LFo,"_createConnection");function BFo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,rmn.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,rmn.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(BFo,"patchConsole")});var NP=I((kLu,amn)=>{"use strict";p();amn.exports=Xc()});var Umn=I((v3u,Fmn)=>{"use strict";p();Fmn.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 B0n=I(c0=>{"use strict";p();var z9t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),F8o=z9t(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")}),U8o=z9t(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")}),Q8o=z9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),D0n=c0&&c0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q8o=c0&&c0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),N0n=c0&&c0.__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:G8o,sync:$8o}=B0n(),{join:V8o,delimiter:W8o,sep:F0n,posix:U0n}=require("path"),Q0n=process.platform==="win32",q0n=new RegExp(`[${U0n.sep}${F0n===U0n.sep?"":F0n}]`.replace(/(\\)/g,"\\$1")),z8o=new RegExp(`^\\.${q0n.source}`),j0n=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),H0n=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=W8o})=>{let o=t.match(q0n)?[""]:[...Q0n?[process.cwd()]:[],...(e||"").split(n)];if(Q0n){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"),G0n=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&z8o.test(e)?e.slice(0,2):"")+V8o(r,e)},"getPathPart"),$0n=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=H0n(t,e),s=[];for(let c of r){let l=G0n(c,t);for(let u of n){let d=l+u;if(await G8o(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 j0n(t)},"which"),Y8o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=H0n(t,e),s=[];for(let c of r){let l=G0n(c,t);for(let u of n){let d=l+u;if($8o(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 j0n(t)},"whichSync");V0n.exports=$0n;$0n.sync=Y8o});var WIe=I((nQu,aAn)=>{"use strict";p();var nAn="[^\\\\/]",D9o="(?=.)",iAn="[^/]",pUt="(?:\\/|$)",oAn="(?:^|\\/)",hUt=`\\.{1,2}${pUt}`,N9o="(?!\\.)",M9o=`(?!${oAn}${hUt})`,O9o=`(?!\\.{0,1}${pUt})`,L9o=`(?!${hUt})`,B9o="[^.\\/]",F9o=`${iAn}*?`,U9o="/",sAn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:D9o,QMARK:iAn,END_ANCHOR:pUt,DOTS_SLASH:hUt,NO_DOT:N9o,NO_DOTS:M9o,NO_DOT_SLASH:O9o,NO_DOTS_SLASH:L9o,QMARK_NO_DOT:B9o,STAR:F9o,START_ANCHOR:oAn,SEP:U9o},Q9o={...sAn,SLASH_LITERAL:"[\\\\/]",QMARK:nAn,STAR:`${nAn}*?`,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:"\\"},q9o={__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"};aAn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:q9o,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?Q9o:sAn}}});var zIe=I(BC=>{"use strict";p();var{REGEX_BACKSLASH:j9o,REGEX_REMOVE_BACKSLASH:H9o,REGEX_SPECIAL_CHARS:G9o,REGEX_SPECIAL_CHARS_GLOBAL:$9o}=WIe();BC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);BC.hasRegexChars=t=>G9o.test(t);BC.isRegexChar=t=>t.length===1&&BC.hasRegexChars(t);BC.escapeRegex=t=>t.replace($9o,"\\$1");BC.toPosixSlashes=t=>t.replace(j9o,"/");BC.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};BC.removeBackslashes=t=>t.replace(H9o,e=>e==="\\"?"":e);BC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?BC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};BC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};BC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};BC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var mAn=I((aQu,hAn)=>{"use strict";p();var cAn=zIe(),{CHAR_ASTERISK:mUt,CHAR_AT:V9o,CHAR_BACKWARD_SLASH:YIe,CHAR_COMMA:W9o,CHAR_DOT:gUt,CHAR_EXCLAMATION_MARK:AUt,CHAR_FORWARD_SLASH:pAn,CHAR_LEFT_CURLY_BRACE:yUt,CHAR_LEFT_PARENTHESES:EUt,CHAR_LEFT_SQUARE_BRACKET:z9o,CHAR_PLUS:Y9o,CHAR_QUESTION_MARK:lAn,CHAR_RIGHT_CURLY_BRACE:K9o,CHAR_RIGHT_PARENTHESES:uAn,CHAR_RIGHT_SQUARE_BRACKET:J9o}=WIe(),dAn=a(t=>t===pAn||t===YIe,"isPathSeparator"),fAn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),Z9o=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"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=P,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&&dAn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(O&&(O=cAn.removeBackslashes(O)),q&&v===!0&&(q=cAn.removeBackslashes(q)));let j={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&&(j.maxDepth=0,dAn(P)||c.push(D),j.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var KIe=WIe(),jS=zIe(),{MAX_LENGTH:Bze,POSIX_REGEX_SOURCE:X9o,REGEX_NON_SPECIAL_CHARS:eUo,REGEX_SPECIAL_CHARS_BACKREF:tUo,REPLACEMENTS:gAn}=KIe,rUo=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=>jS.escapeRegex(o)).join("..")}return r},"expandRange"),qle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),AAn=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"),nUo=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"),yAn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(nUo(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),iUo=a(t=>{let e=t.map(yAn).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"),oUo=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=yAn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?jS.escapeRegex(r[0]):`[${r.map(o=>jS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),sUo=a(t=>{let e=0,r=t.trim(),n=_Ut(r);for(;n;)e++,r=n.body.trim(),n=_Ut(r);return e},"repeatedExtglobRecursion"),aUo=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:KIe.DEFAULT_MAX_EXTGLOB_RECURSION,n=AAn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||iUo(n)))return{risky:!0};for(let o of n){let s=oUo(o);if(s)return{risky:!0,safeOutput:s};if(sUo(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),vUt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=gAn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Bze,r.maxLength):Bze,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=KIe.globChars(r.windows),d=KIe.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(ge=>`(${l}(?:(?!${w}${ge.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=jS.removePrefix(t,N),o=t.length;let L=[],B=[],q=[],M=s,O,j=a(()=>N.index===o-1,"eos"),Q=N.peek=(ge=1)=>t[N.index+ge],U=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((ge="",Ue=0)=>{N.consumed+=ge,N.index+=Ue},"consume"),V=a(ge=>{N.output+=ge.output!=null?ge.output:ge.value,W(ge.value)},"append"),z=a(()=>{let ge=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ge++;return ge%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(ge=>{N[ge]++,q.push(ge)},"increment"),H=a(ge=>{N[ge]--,q.pop()},"decrement"),re=a(ge=>{if(M.type==="globstar"){let Ue=N.braces>0&&(ge.type==="comma"||ge.type==="brace"),ke=ge.extglob===!0||L.length&&(ge.type==="pipe"||ge.type==="paren");ge.type!=="slash"&&ge.type!=="paren"&&!Ue&&!ke&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ge.type!=="paren"&&(L[L.length-1].inner+=ge.value),(ge.value||ge.output)&&V(ge),M&&M.type==="text"&&ge.type==="text"){M.output=(M.output||M.value)+ge.value,M.value+=ge.value;return}ge.prev=M,c.push(ge),M=ge},"push"),le=a((ge,Ue)=>{let ke={...d[Ue],conditions:1,inner:""};ke.prev=M,ke.parens=N.parens,ke.output=N.output,ke.startIndex=N.index,ke.tokensIndex=c.length;let X=(r.capture?"(":"")+ke.open;ie("parens"),re({type:ge,value:Ue,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:X}),L.push(ke)},"extglobOpen"),Le=a(ge=>{let Ue=t.slice(ge.startIndex,N.index+1),ke=t.slice(ge.startIndex+2,N.index),X=aUo(ke,r);if((ge.type==="plus"||ge.type==="star")&&X.risky){let he=X.safeOutput?(ge.output?"":g)+(r.capture?`(${X.safeOutput})`:X.safeOutput):void 0,Z=c[ge.tokensIndex];Z.type="text",Z.value=Ue,Z.output=he||jS.escapeRegex(Ue);for(let ue=ge.tokensIndex+1;ue1&&ge.inner.includes("/")&&(he=R(r)),(he!==D||j()||/^\)+$/.test(Y()))&&(ee=ge.close=`)$))${he}`),ge.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let Z=vUt(K,{...e,fastpaths:!1}).output;ee=ge.close=`)${Z})${he})`}ge.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 ge=!1,Ue=t.replace(tUo,(ke,X,ee,K,he,Z)=>K==="\\"?(ge=!0,ke):K==="?"?X?X+K+(he?v.repeat(he.length):""):Z===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?X?X+K+(he?D:""):D:X?ke:`\\${ke}`);return ge===!0&&(r.unescape===!0?Ue=Ue.replace(/\\/g,""):Ue=Ue.replace(/\\+/g,ke=>ke.length%2===0?"\\\\":ke?"\\":"")),Ue===t&&r.contains===!0?(N.output=t,N):(N.output=jS.wrapOutput(Ue,N,e),N)}for(;!j();){if(O=U(),O==="\0")continue;if(O==="\\"){let ke=Q();if(ke==="/"&&r.bash!==!0||ke==="."||ke===";")continue;if(!ke){O+="\\",re({type:"text",value:O});continue}let X=/^\\+/.exec(Y()),ee=0;if(X&&X[0].length>2&&(ee=X[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 ke=M.value.slice(1);if(ke.includes("[")&&(M.posix=!0,ke.includes(":"))){let X=M.value.lastIndexOf("["),ee=M.value.slice(0,X),K=M.value.slice(X+2),he=X9o[K];if(he){M.value=ee+he,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,V({value:O});continue}if(N.quotes===1&&O!=='"'){O=jS.escapeRegex(O),M.value+=O,V({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ie("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(qle("opening","("));let ke=L[L.length-1];if(ke&&N.parens===ke.parens+1){Le(L.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(qle("closing","]"));O=`\\${O}`}else ie("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(qle("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let ke=M.value.slice(1);if(M.posix!==!0&&ke[0]==="^"&&!ke.includes("/")&&(O=`/${O}`),M.value+=O,V({value:O}),r.literalBrackets===!1||jS.hasRegexChars(ke))continue;let X=jS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=X,M.value=X;continue}M.value=`(${l}${X}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ie("braces");let ke={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(ke),re(ke);continue}if(O==="}"){let ke=B[B.length-1];if(r.nobrace===!0||!ke){re({type:"text",value:O,output:O});continue}let X=")";if(ke.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);X=rUo(K,r),N.backtrack=!0}if(ke.comma!==!0&&ke.dots!==!0){let ee=N.output.slice(0,ke.outputIndex),K=N.tokens.slice(ke.tokensIndex);ke.value=ke.output="\\{",O=X="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:O,output:X}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let ke=O,X=B[B.length-1];X&&q[q.length-1]==="braces"&&(X.comma=!0,ke="|"),re({type:"comma",value:O,output:ke});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 ke=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,ke.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)!=="?"){le("qmark",O);continue}if(M&&M.type==="paren"){let X=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(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)))){le("negate",O);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("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 ke=eUo.exec(Y());ke&&(O+=ke[0],N.index+=ke[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 ge=Y();if(r.noextglob!==!0&&/^\([^?]/.test(ge)){le("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let ke=M.prev,X=ke.prev,ee=ke.type==="slash"||ke.type==="bos",K=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!ee||ge[0]&&ge[0]!=="/")){re({type:"star",value:O,output:""});continue}let he=N.braces>0&&(ke.type==="comma"||ke.type==="brace"),Z=L.length&&(ke.type==="pipe"||ke.type==="paren");if(!ee&&ke.type!=="paren"&&!he&&!Z){re({type:"star",value:O,output:""});continue}for(;ge.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ge=ge.slice(3),W("/**",3)}if(ke.type==="bos"&&j()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&!K&&j()){N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=ke.output+M.output,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&ge[0]==="/"){let ue=ge[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=ke.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(ke.type==="bos"&&ge[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 Ue={type:"star",value:O,output:D};if(r.bash===!0){Ue.output=".*?",(M.type==="bos"||M.type==="slash")&&(Ue.output=x+Ue.output),re(Ue);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Ue.output=O,re(Ue);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(Ue)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(qle("closing","]"));N.output=jS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(qle("closing",")"));N.output=jS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(qle("closing","}"));N.output=jS.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 ge of N.tokens)N.output+=ge.output!=null?ge.output:ge.value,ge.suffix&&(N.output+=ge.suffix)}return N},"parse");vUt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Bze,r.maxLength):Bze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=gAn[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}=KIe.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=jS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};EAn.exports=vUt});var bAn=I((pQu,CAn)=>{"use strict";p();var cUo=mAn(),CUt=_An(),vAn=zIe(),lUo=WIe(),uUo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),eh=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>eh(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=uUo(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?eh.compileRe(t,e):eh.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=eh(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=eh.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");eh.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?vAn.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=eh.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};eh.matchBase=(t,e,r)=>(e instanceof RegExp?e:eh.makeRe(e,r)).test(vAn.basename(t));eh.isMatch=(t,e,r)=>eh(e,r)(t);eh.parse=(t,e)=>Array.isArray(t)?t.map(r=>eh.parse(r,e)):CUt(t,{...e,fastpaths:!1});eh.scan=(t,e)=>cUo(t,e);eh.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=eh.toRegex(l,e);return n===!0&&(u.state=t),u};eh.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=CUt.fastpaths(t,e)),o.output||(o=CUt(t,e)),eh.compileRe(o,e,r,n)};eh.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/$^/}};eh.constants=lUo;CAn.exports=eh});var xAn=I((gQu,IAn)=>{"use strict";p();var SAn=bAn(),dUo=zIe();function TAn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:dUo.isWindows()}),SAn(t,e,r)}a(TAn,"picomatch");Object.assign(TAn,SAn);IAn.exports=TAn});var RAn=I((EQu,wAn)=>{p();wAn.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 DAn=I((CQu,PAn)=>{p();var fUo=RAn(),kAn={"{":"}","(":")","[":"]"},pUo=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=kAn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),hUo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var vK=require("path"),mUo=xAn(),gUo=DAn();function Fze(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(gUo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=mUo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(vK.resolve(t,o))}return e}a(Fze,"normalizeOptions");NAn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(vK.resolve(e),vK.resolve(r),Fze(e,n))},getEventsSince(e,r,n){return t.getEventsSince(vK.resolve(e),vK.resolve(r),Fze(e,n))},async subscribe(e,r,n){return e=vK.resolve(e),n=Fze(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(vK.resolve(e),r,Fze(e,n))}})});var OAn=I(JIe=>{"use strict";p();var AUo=require("path"),{createWrapper:yUo}=MAn();function EUo(){return AUo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(EUo,"resolveBindingPath");var _Uo=require(EUo()),Uze=yUo(_Uo);JIe.writeSnapshot=Uze.writeSnapshot;JIe.getEventsSince=Uze.getEventsSince;JIe.subscribe=Uze.subscribe;JIe.unsubscribe=Uze.unsubscribe});var j_=I($ze=>{"use strict";p();Object.defineProperty($ze,"__esModule",{value:!0});$ze.Position=void 0;var xUt=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(Vze,"__esModule",{value:!0});Vze.Range=void 0;var qAn=j_(),wUt=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 qAn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new qAn.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}};Vze.Range=wUt});var Hyn=I(p7t=>{"use strict";p();Object.defineProperty(p7t,"__esModule",{value:!0});p7t.assertNever=I7o;function I7o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(I7o,"assertNever")});var fxe=I(Q3=>{"use strict";p();Object.defineProperty(Q3,"__esModule",{value:!0});Q3.ChatCompletionContentPartOpaque=Q3.ChatCompletionContentPartKind=Q3.ChatRole=void 0;var x7o=Hyn(),_Ye;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(_Ye||(Q3.ChatRole=_Ye={}));(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,x7o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(_Ye||(Q3.ChatRole=_Ye={}));var Gyn;(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"})(Gyn||(Q3.ChatCompletionContentPartKind=Gyn={}));var $yn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})($yn||(Q3.ChatCompletionContentPartOpaque=$yn={}))});var h7t=I(vO=>{"use strict";p();Object.defineProperty(vO,"__esModule",{value:!0});vO.BaseTokensPerName=vO.BaseTokensPerMessage=vO.BaseTokensPerCompletion=vO.ChatRole=void 0;var Vyn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(Vyn||(vO.ChatRole=Vyn={}));vO.BaseTokensPerCompletion=3;vO.BaseTokensPerMessage=3;vO.BaseTokensPerName=1});var Kyn=I(CYe=>{"use strict";p();Object.defineProperty(CYe,"__esModule",{value:!0});CYe.toOpenAiChatMessage=Yyn;CYe.toOpenAIChatMessages=R7o;var CO=fxe(),vYe=h7t(),w7o=lq();function Wyn(t){return t.filter(e=>e.type===CO.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(Wyn,"onlyStringContent");function zyn(t){let e=t.map(r=>{if(r.type===CO.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===CO.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===CO.ChatCompletionContentPartKind.Document)return;if(r.type===CO.ChatCompletionContentPartKind.Opaque&&CO.ChatCompletionContentPartOpaque.usableIn(r,w7o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(zyn,"stringAndImageContent");function Yyn(t){switch(t.role){case CO.ChatRole.System:return{role:vYe.ChatRole.System,content:Wyn(t.content),name:t.name};case CO.ChatRole.User:return{role:vYe.ChatRole.User,content:zyn(t.content),name:t.name};case CO.ChatRole.Assistant:return{role:vYe.ChatRole.Assistant,content:Wyn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case CO.ChatRole.Tool:return{role:vYe.ChatRole.Tool,content:zyn(t.content),tool_call_id:t.toolCallId};default:return}}a(Yyn,"toOpenAiChatMessage");function R7o(t){return t.map(Yyn).filter(e=>!!e)}a(R7o,"toOpenAIChatMessages")});var Zyn=I(TYe=>{"use strict";p();Object.defineProperty(TYe,"__esModule",{value:!0});TYe.toVsCodeChatMessage=Jyn;TYe.toVsCodeChatMessages=k7o;var SYe=fxe();function bYe(t){return t.filter(e=>e.type===SYe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(bYe,"onlyStringContent");var uq;function Jyn(t){switch(uq??=require("vscode"),t.role){case SYe.ChatRole.Assistant:let e=uq.LanguageModelChatMessage.Assistant(bYe(t.content),t.name);return t.toolCalls&&(e.content=[new uq.LanguageModelTextPart(bYe(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 uq.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case SYe.ChatRole.User:return uq.LanguageModelChatMessage.User(bYe(t.content),t.name);case SYe.ChatRole.Tool:{let r=uq.LanguageModelChatMessage.User("");return r.content=[new uq.LanguageModelToolResultPart(t.toolCallId,[new uq.LanguageModelTextPart(bYe(t.content))])],r}default:return}}a(Jyn,"toVsCodeChatMessage");function k7o(t){return t.map(Jyn).filter(e=>!!e)}a(k7o,"toVsCodeChatMessages")});var lq=I(QP=>{"use strict";p();Object.defineProperty(QP,"__esModule",{value:!0});QP.OutputMode=QP.Raw=QP.OpenAI=void 0;QP.toMode=m7t;QP.toVSCode=P7o;QP.toOpenAI=D7o;var Xyn=Kyn(),eEn=Zyn();QP.OpenAI=h7t();QP.Raw=fxe();var wK;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(wK||(QP.OutputMode=wK={}));function m7t(t,e){switch(t){case wK.Raw:return e;case wK.VSCode:return e instanceof Array?(0,eEn.toVsCodeChatMessages)(e):(0,eEn.toVsCodeChatMessage)(e);case wK.OpenAI:return e instanceof Array?(0,Xyn.toOpenAIChatMessages)(e):(0,Xyn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(m7t,"toMode");function P7o(t){return m7t(wK.VSCode,t)}a(P7o,"toVSCode");function D7o(t){return m7t(wK.OpenAI,t)}a(D7o,"toOpenAI")});var g7t=I(pxe=>{"use strict";p();Object.defineProperty(pxe,"__esModule",{value:!0});pxe.jsonRetainedProps=void 0;pxe.forEachNode=tEn;pxe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function tEn(t,e){if(e(t),t.type===1)for(let r of t.children)tEn(r,e)}a(tEn,"forEachNode")});var rEn=I(A7t=>{"use strict";p();Object.defineProperty(A7t,"__esModule",{value:!0});A7t.once=N7o;function N7o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(N7o,"once")});var v7t=I(mg=>{"use strict";p();Object.defineProperty(mg,"__esModule",{value:!0});mg.BudgetExceededError=mg.MaterializedChatMessageDocument=mg.MaterializedChatMessageImage=mg.MaterializedChatMessageBreakpoint=mg.MaterializedChatMessageOpaque=mg.MaterializedChatMessage=mg.MaterializedChatMessageTextChunk=mg.GenericMaterializedContainer=void 0;var RK=rEn(),kA=lq(),q3=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=fq(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 dEn(e,this.children,r)}allMetadata(){return uEn(this)}findById(e){return _7t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)M7o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof jP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof jP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return E7t(this,e),e}};mg.GenericMaterializedContainer=q3;var hxe=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,RK.once)(async e=>await e.tokenLength({type:kA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};mg.MaterializedChatMessageTextChunk=hxe;var jP=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=dEn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return E7t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return _7t(e,this)}_tokenCount=(0,RK.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,kA.toMode)(e.mode,r))});_upperBound=(0,RK.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,RK.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===kA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===kA.Raw.ChatCompletionContentPartKind.Image||n.type===kA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,kA.toMode)(e.mode,r))});_text=(0,RK.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of cEn(this)){if(r instanceof kK||r instanceof PK||r instanceof dq){e.push(r);continue}if(r instanceof qP){e.at(-1)instanceof qP?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:RA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof wK)return{type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:aEn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof RK)return{type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof cq)return{type:RA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof UP)return r.part;throw new Error("Unexpected element type")});if(this.role===RA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===RA.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===RA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===RA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};hg.MaterializedChatMessage=QP;var cq=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&&RA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};hg.MaterializedChatMessageOpaque=cq;var UP=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};hg.MaterializedChatMessageBreakpoint=UP;var wK=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,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:aEn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};hg.MaterializedChatMessageImage=wK;var RK=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,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};hg.MaterializedChatMessageDocument=RK;function lq(t){return t instanceof U3||t instanceof QP}a(lq,"isContainerType");function rEn(t){return t instanceof dxe||t instanceof wK||t instanceof RK||t instanceof cq||t instanceof UP}a(rEn,"isContentType");function _7o(t){if(!lq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(_7o,"assertContainerOrChatMessage");function*nEn(t,e=!1){for(let r of t.children)r instanceof dxe?(yield{content:r,isTextSibling:e},e=!0):r instanceof wK||r instanceof RK||r instanceof cq||r instanceof UP?yield{content:r,isTextSibling:!1}:r instanceof cq?yield{content:r,isTextSibling:!0}:(r&&(yield*nEn(r,e)),e=!1)}a(nEn,"contentChunks");function v7o(t,e){let r;function n(o,s){if(rEn(o))(!r||o.priorityn instanceof UP):t instanceof U3&&(r=t.children.some(iEn)),Zyn.set(t,r),r}a(iEn,"hasCachePoint");function C7o(t){if(t instanceof QP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof QP)return!1;return!0}a(C7o,"shouldLookForCachePointInNode");function m7t(t,e){let r;if(t instanceof U3&&t.has(1)){v7o(t,e);return}let n=C7o(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 QP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};hg.BudgetExceededError=_Ye;function Xyn(t){if(!lq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(Xyn,"getLowestPriorityAmongChildren");function*oEn(t){yield*t.metadata;for(let e of t.children)lq(e)?yield*oEn(e):yield*e.metadata}a(oEn,"allMetadata");function sEn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,lq(r)&&e.push(...r.children)}}a(eEn,"forEachNode");function b7o(t){let e=t;for(;e.parent;)e=e.parent;return e}a(b7o,"getRoot");function tEn(t){return t instanceof U3&&t.keepWithId!==void 0}a(tEn,"isKeepWith");var h7t=new Set;function S7o(t,e){let r=new Set;for(let n of eEn(t))tEn(n)&&!h7t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)h7t.add(n);try{let n=b7o(t);for(let o of eEn(n))tEn(o)&&r.has(o.keepWithId)?fxe(o,e):o instanceof QP&&o.toolCalls&&(o.toolCalls=T7o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&fxe(o,e))}finally{for(let n of r)h7t.delete(n)}}a(S7o,"removeOtherKeepWiths");function g7t(t,e){if(e.id===t)return e;for(let r of e.children)if(lq(r)){let n=g7t(t,r);if(n)return n}}a(g7t,"findNodeById");function fxe(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),S7o(t,e),r.isEmpty?fxe(r,e):r.onChunksChange())}a(fxe,"removeNode");function aEn(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(aEn,"getEncodedBase64");function T7o(t,e){for(let r=0;r{"use strict";p();function I7o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(I7o,"_vscpp");function cEn(){throw new Error("This should not be invoked!")}a(cEn,"_vscppf");cEn.isFragment=!0;globalThis.vscpp=I7o;globalThis.vscppf=cEn});var E7t=I(vYe=>{"use strict";p();Object.defineProperty(vYe,"__esModule",{value:!0});vYe.PromptElement=void 0;lEn();var y7t=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}};vYe.PromptElement=y7t});var k7t=I(Qs=>{"use strict";p();Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LogicalWrapper=Qs.IfEmpty=Qs.AbstractKeepWith=Qs.TokenLimit=Qs.Expandable=Qs.Chunk=Qs.LegacyPrioritization=Qs.ToolResult=Qs.PrioritizedList=Qs.Document=Qs.Image=Qs.TextChunk=Qs.ToolMessage=Qs.AssistantMessage=Qs.UserMessage=Qs.SystemMessage=Qs.BaseChatMessage=void 0;Qs.isChatMessagePromptElement=x7o;Qs.useKeepWith=P7o;var hxe=Io(),$S=E7t();function x7o(t){return t instanceof CYe||t instanceof bYe||t instanceof SYe}a(x7o,"isChatMessagePromptElement");var kK=class extends $S.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.BaseChatMessage=kK;var CYe=class extends kK{static{a(this,"SystemMessage")}constructor(e){e.role=hxe.Raw.ChatRole.System,super(e)}};Qs.SystemMessage=CYe;var bYe=class extends kK{static{a(this,"UserMessage")}constructor(e){e.role=hxe.Raw.ChatRole.User,super(e)}};Qs.UserMessage=bYe;var SYe=class extends kK{static{a(this,"AssistantMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Assistant,super(e)}};Qs.AssistantMessage=SYe;var w7o=/\s+/g,_7t=class extends kK{static{a(this,"ToolMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Tool,super(e)}};Qs.ToolMessage=_7t;var TYe=class extends $S.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?w7o: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 R7o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Qs.TextChunk=TYe;async function R7o(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(R7o,"getTextContentBelowBudget");var v7t=class extends $S.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Image=v7t;var C7t=class extends $S.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Document=C7t;var b7t=class extends $S.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(TYe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Qs.PrioritizedList=b7t;var S7t=class extends $S.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})}))}};Qs.ToolResult=S7t;var T7t=class extends $S.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LegacyPrioritization=T7t;var I7t=class extends $S.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Chunk=I7t;var x7t=class extends $S.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Qs.Expandable=x7t;var w7t=class extends $S.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.TokenLimit=w7t;var IYe=class extends $S.PromptElement{static{a(this,"AbstractKeepWith")}};Qs.AbstractKeepWith=IYe;var k7o=0;function P7o(){let t=k7o++;return class extends IYe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(P7o,"useKeepWith");var R7t=class extends $S.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(pxe,null,this.props.alt),vscpp(pxe,{flexGrow:1},this.props.children))}};Qs.IfEmpty=R7t;var pxe=class extends $S.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LogicalWrapper=pxe});var dEn=I(mxe=>{"use strict";p();Object.defineProperty(mxe,"__esModule",{value:!0});mxe.localize=D7o;mxe.localize2=N7o;mxe.getConfiguredDefaultLocale=M7o;function uEn(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(uEn,"_format");function D7o(t,e,...r){return uEn(e,r)}a(D7o,"localize");function N7o(t,e,...r){let n=uEn(e,r);return{original:n,value:n}}a(N7o,"localize2");function M7o(t){}a(M7o,"getConfiguredDefaultLocale")});var M7t=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=L7o;Sr.isLittleEndian=B7o;Sr.isBigSurOrNewer=F7o;var fEn=dEn();Sr.LANGUAGE_DEFAULT="en";var yxe=!1,Exe=!1,Axe=!1,gEn=!1,AEn=!1,D7t=!1,yEn=!1,N7t=!1,EEn=!1,_En=!1,gxe,xYe=Sr.LANGUAGE_DEFAULT,P7t=Sr.LANGUAGE_DEFAULT,vEn,Q3,q3=globalThis,VS;typeof q3.vscode<"u"&&typeof q3.vscode.process<"u"?VS=q3.vscode.process:typeof process<"u"&&(VS=process);var CEn=typeof VS?.versions?.electron=="string",O7o=CEn&&VS?.type==="renderer";if(typeof VS=="object"){yxe=VS.platform==="win32",Exe=VS.platform==="darwin",Axe=VS.platform==="linux",gEn=Axe&&!!VS.env.SNAP&&!!VS.env.SNAP_REVISION,yEn=CEn,EEn=!!VS.env.CI||!!VS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gxe=Sr.LANGUAGE_DEFAULT,xYe=Sr.LANGUAGE_DEFAULT;let t=VS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];gxe=e.locale,P7t=e.osLocale,xYe=r||Sr.LANGUAGE_DEFAULT,vEn=e._translationsConfigFile}catch{}AEn=!0}else typeof navigator=="object"&&!O7o?(Q3=navigator.userAgent,yxe=Q3.indexOf("Windows")>=0,Exe=Q3.indexOf("Macintosh")>=0,N7t=(Q3.indexOf("Macintosh")>=0||Q3.indexOf("iPad")>=0||Q3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Axe=Q3.indexOf("Linux")>=0,_En=Q3?.indexOf("Mobi")>=0,D7t=!0,gxe=fEn.getConfiguredDefaultLocale(fEn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,xYe=gxe,P7t=navigator.language):console.error("Unable to resolve platform.");function L7o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(L7o,"PlatformToString");var wYe=0;Exe?wYe=1:yxe?wYe=3:Axe&&(wYe=2);Sr.isWindows=yxe;Sr.isMacintosh=Exe;Sr.isLinux=Axe;Sr.isLinuxSnap=gEn;Sr.isNative=AEn;Sr.isElectron=yEn;Sr.isWeb=D7t;Sr.isWebWorker=D7t&&typeof q3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?q3.origin:void 0;Sr.isIOS=N7t;Sr.isMobile=_En;Sr.isCI=EEn;Sr.platform=wYe;Sr.userAgent=Q3;Sr.language=xYe;var pEn;(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})(pEn||(Sr.Language=pEn={}));Sr.locale=gxe;Sr.platformLocale=P7t;Sr.translationsConfigFile=vEn;Sr.setTimeout0IsFaster=typeof q3.postMessage=="function"&&!q3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];q3.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}),q3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=Exe||N7t?2:yxe?1:3;var hEn=!0,mEn=!1;function B7o(){if(!mEn){mEn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,hEn=new Uint16Array(t.buffer)[0]===513}return hEn}a(B7o,"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 F7o(t){return parseFloat(t)>=20}a(F7o,"isBigSurOrNewer")});var SEn=I(vO=>{"use strict";p();Object.defineProperty(vO,"__esModule",{value:!0});vO.arch=vO.platform=vO.env=vO.cwd=void 0;var bEn=M7t(),PK,O7t=globalThis.vscode;if(typeof O7t<"u"&&typeof O7t.process<"u"){let t=O7t.process;PK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?PK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:PK={get platform(){return bEn.isWindows?"win32":bEn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};vO.cwd=PK.cwd;vO.env=PK.env;vO.platform=PK.platform;vO.arch=PK.arch});var IEn=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.delimiter=An.sep=An.toNamespacedPath=An.parse=An.format=An.extname=An.basename=An.dirname=An.relative=An.resolve=An.join=An.isAbsolute=An.normalize=An.posix=An.win32=void 0;var eue=SEn(),U7o=65,Q7o=97,q7o=90,j7o=122,fq=46,mg=47,FC=92,uq=58,H7o=63,RYe=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 G7o(t,e){if(t===null||typeof t!="object")throw new RYe(e,"Object",t)}a(G7o,"validateObject");function ip(t,e){if(typeof t!="string")throw new RYe(e,"string",t)}a(ip,"validateString");var UC=eue.platform==="win32";function ns(t){return t===mg||t===FC}a(ns,"isPathSeparator");function L7t(t){return t===mg}a(L7t,"isPosixPathSeparator");function dq(t){return t>=U7o&&t<=q7o||t>=Q7o&&t<=j7o}a(dq,"isWindowsDeviceRoot");function kYe(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===fq&&l!==-1?++l:l=-1}return o}a(kYe,"normalizeString");function TEn(t,e){G7o(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(TEn,"_format");An.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],ip(s,"path"),s.length===0)continue}else e.length===0?s=eue.cwd():(s=eue.env[`=${e}`]||eue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===FC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ns(f)&&(l=1,d=!0);else if(ns(f))if(d=!0,ns(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ns(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=kYe(r,!n,"\\",ns),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return L7t(s)?"\\":t;if(ns(s))if(o=!0,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ns(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){ip(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ns(r)||e>2&&dq(r)&&t.charCodeAt(1)===uq&&ns(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"&&ns(r.charCodeAt(0))){++o;let s=r.length;s>1&&ns(r.charCodeAt(1))&&(++o,s>2&&(ns(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return An.win32.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e)return"";let r=An.win32.resolve(t),n=An.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===FC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===FC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===FC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===FC?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)===FC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===FC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=An.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===FC){if(e.charCodeAt(1)===FC){let r=e.charCodeAt(2);if(r!==H7o&&r!==fq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(dq(e.charCodeAt(0))&&e.charCodeAt(1)===uq&&e.charCodeAt(2)===FC)return`\\\\?\\${e}`;return t},dirname(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ns(o)?t:".";if(ns(o)){if(r=n=1,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ns(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&&ip(e,"ext"),ip(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&dq(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(ns(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(ns(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){ip(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===uq&&dq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ns(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===fq?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:TEn.bind(null,"\\"),parse(t){ip(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 ns(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ns(o)){if(n=1,ns(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),ns(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===fq?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 $7o=(()=>{if(UC){let t=/\\/g;return()=>{let e=eue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>eue.cwd()})();An.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:$7o();ip(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===mg)}return e=kYe(e,!r,"/",L7t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=t.charCodeAt(t.length-1)===mg;return t=kYe(t,!e,"/",L7t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ip(t,"path"),t.length>0&&t.charCodeAt(0)===mg},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?".":An.posix.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e||(t=An.posix.resolve(t),e=An.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)===mg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===mg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===mg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===mg){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&&ip(e,"ext"),ip(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===mg){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)===mg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ip(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===mg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===fq?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:TEn.bind(null,"/"),parse(t){ip(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===mg,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===mg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===fq?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};An.posix.win32=An.win32.win32=An.win32;An.posix.posix=An.win32.posix=An.posix;An.normalize=UC?An.win32.normalize:An.posix.normalize;An.isAbsolute=UC?An.win32.isAbsolute:An.posix.isAbsolute;An.join=UC?An.win32.join:An.posix.join;An.resolve=UC?An.win32.resolve:An.posix.resolve;An.relative=UC?An.win32.relative:An.posix.relative;An.dirname=UC?An.win32.dirname:An.posix.dirname;An.basename=UC?An.win32.basename:An.posix.basename;An.extname=UC?An.win32.extname:An.posix.extname;An.format=UC?An.win32.format:An.posix.format;An.parse=UC?An.win32.parse:An.posix.parse;An.toNamespacedPath=UC?An.win32.toNamespacedPath:An.posix.toNamespacedPath;An.sep=UC?An.win32.sep:An.posix.sep;An.delimiter=UC?An.win32.delimiter:An.posix.delimiter});var NEn=I(tue=>{"use strict";p();Object.defineProperty(tue,"__esModule",{value:!0});tue.URI=void 0;tue.isUriComponents=X7o;tue.uriToFsPath=MYe;var xEn=IEn(),DYe=M7t(),V7o=/^\w[\w\d+.-]*$/,W7o=/^\//,z7o=/^\/\//;function Y7o(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&&!V7o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!W7o.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(z7o.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(Y7o,"_validateUri");function K7o(t,e){return!t&&!e?"file":t}a(K7o,"_schemeFix");function J7o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==qP&&(e=qP+e):e=qP;break}return e}a(J7o,"_referenceResolution");var Hl="",qP="/",Z7o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,NYe=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||Hl,this.authority=e.authority||Hl,this.path=e.path||Hl,this.query=e.query||Hl,this.fragment=e.fragment||Hl):(this.scheme=K7o(e,c),this.authority=r||Hl,this.path=J7o(this.scheme,n||Hl),this.query=o||Hl,this.fragment=s||Hl,Y7o(this,c))}get fsPath(){return MYe(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=Hl),n===void 0?n=this.authority:n===null&&(n=Hl),o===void 0?o=this.path:o===null&&(o=Hl),s===void 0?s=this.query:s===null&&(s=Hl),c===void 0?c=this.fragment:c===null&&(c=Hl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new pq(r,n,o,s,c)}static parse(e,r=!1){let n=Z7o.exec(e);return n?new pq(n[2]||Hl,PYe(n[4]||Hl),PYe(n[5]||Hl),PYe(n[7]||Hl),PYe(n[9]||Hl),r):new pq(Hl,Hl,Hl,Hl,Hl)}static file(e){let r=Hl;if(DYe.isWindows&&(e=e.replace(/\\/g,qP)),e[0]===qP&&e[1]===qP){let n=e.indexOf(qP,2);n===-1?(r=e.substring(2),e=qP):(r=e.substring(2,n),e=e.substring(n)||qP)}return new pq("file",r,e,Hl,Hl)}static from(e,r){return new pq(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 DYe.isWindows&&e.scheme==="file"?n=t.file(xEn.win32.join(MYe(e,!0),...r)).path:n=xEn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return B7t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new pq(e);return r._formatted=e.external??null,r._fsPath=e._sep===kEn?e.fsPath??null:null,r}}else return e}};tue.URI=NYe;function X7o(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(X7o,"isUriComponents");var kEn=DYe.isWindows?1:void 0,pq=class extends NYe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=MYe(this,!1)),this._fsPath}toString(e=!1){return e?B7t(this,!0):(this._formatted||(this._formatted=B7t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=kEn),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}},PEn={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 wEn(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=PEn[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(wEn,"encodeURIComponentFast");function eQo(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,DYe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(MYe,"uriToFsPath");function B7t(t,e){let r=e?eQo:wEn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=qP,n+=qP),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:wEn(u,!1,!1)),n}a(B7t,"_asFormatted");function DEn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+DEn(t.substr(3)):t}}a(DEn,"decodeURIComponentGraceful");var REn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function PYe(t){return t.match(REn)?t.replace(REn,e=>DEn(e)):t}a(PYe,"percentDecode")});var Q7t=I(hq=>{"use strict";p();Object.defineProperty(hq,"__esModule",{value:!0});hq.PromptReference=hq.ChatResponseReferencePartStatusKind=hq.PromptMetadata=void 0;var _xe=NEn(),F7t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};hq.PromptMetadata=F7t;var MEn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(MEn||(hq.ChatResponseReferencePartStatusKind=MEn={}));var U7t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?_xe.URI.from(n):{uri:_xe.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?_xe.URI.from(e.iconPath):"light"in e.iconPath?{light:_xe.URI.from(e.iconPath.light),dark:_xe.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}}};hq.PromptReference=U7t});var z7t=I(rue=>{"use strict";p();Object.defineProperty(rue,"__esModule",{value:!0});rue.PromptRenderer=rue.MetadataMap=void 0;var tQo=f7t(),mq=A7t(),NK=sq(),Bd=k7t(),W7t=Q7t(),LYe;(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")})})(LYe||(rue.MetadataMap=LYe={}));var q7t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new UYe(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=FEn(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 Bd.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:NK.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 LEn(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 LEn(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 DK(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Bd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=BEn(o),u=new DK(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await rQo(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 DK(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,NK.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new DK(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 CO))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(QYe),h=o.map(m=>{if(!(m instanceof CO)||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(QYe);return{metadata:LYe.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 mq.BudgetExceededError&&(m.metadata=LYe.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 Bd.Expandable))throw new Error("unreachable: expected growable");let l=new UYe(null,0,s.elem.id),u=new DK(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:NK.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===Bd.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},BYe(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 CO(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 CO(u));else this._handleIntrinsic(e,l.name,l.props,BYe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};rue.PromptRenderer=q7t;async function rQo(t,e,r,n){let o=0;if((0,Bd.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,NK.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:NK.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(rQo,"computeTokensConsumedByLiterals");function BEn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new G7t(String(t))):nQo(t)?BYe(t.children,e):iQo(t)?BYe(t,e):typeof t.ctor=="string"?e.push(new j7t(t.ctor,t.props,t.children)):e.push(new H7t(t.ctor,t.props,t.children)),e)}a(BEn,"flattenAndReduce");function BYe(t,e=[]){for(let r of t)BEn(r,e);return e}a(BYe,"flattenAndReduceArr");var j7t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},H7t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},G7t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},FYe=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 mq.MaterializedChatMessageOpaque(e,{type:NK.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},DK=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}},UYe=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 CO(W7t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return vxe.fromJSON(o,c,s);case 3:return FYe.fromJSON(o,c,s);default:}}).filter(QYe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Bd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Bd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Bd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Bd.Image(r.props);break;case 4:o._obj=new Bd.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 Bd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Bd.Chunk&&(this._objFlags|=2),this._obj instanceof Bd.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 vxe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new vxe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new FYe(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(QYe),props:{},references:this._metadata.filter(r=>r instanceof CO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=OYe(this._obj.props,tQo.jsonRetainedProps)),this._obj instanceof Bd.BaseChatMessage)e.ctor=1,Object.assign(e.props,OYe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Bd.Image)return{...e,ctor:3,props:{...e.props,...OYe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Bd.Document)return{...e,ctor:4,props:{...e.props,...OYe(this._obj.props,["data","mediaType"])}};this._obj instanceof Bd.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 Bd.Image)return new mq.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 Bd.Document)return new mq.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 Bd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new mq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Bd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Bd.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 mq.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 Bd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Bd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new $7t({type:NK.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},$7t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new mq.MaterializedChatMessageBreakpoint(e,this.part)}},vxe=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 CO(W7t.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 mq.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 CO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function nQo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(nQo,"isFragmentCtor");function QYe(t){return t!==void 0}a(QYe,"isDefined");var V7t=class extends W7t.PromptMetadata{static{a(this,"InternalMetadata")}},CO=class extends V7t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function iQo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(iQo,"isIterable");function OYe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(OYe,"pickProps");function FEn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(FEn,"atPath");var OEn=new WeakSet;async function LEn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!OEn.has(r)&&r.constructor.name!=="CancellationError"&&(OEn.add(r),r.message+=` (at tsx element ${FEn(t.path)})`),r}}a(LEn,"annotateError")});var UEn=I(qYe=>{"use strict";p();Object.defineProperty(qYe,"__esModule",{value:!0});qYe.VSCodeTokenizer=void 0;var Y7t=sq(),K7t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=Y7t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==Y7t.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===Y7t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};qYe.VSCodeTokenizer=K7t});var QEn=I(nue=>{"use strict";p();Object.defineProperty(nue,"__esModule",{value:!0});nue.tracerCss=nue.tracerSrc=void 0;nue.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';nue.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 $En=I(HYe=>{"use strict";p();Object.defineProperty(HYe,"__esModule",{value:!0});HYe.HTMLTracer=void 0;var qEn=QEn(),gq=A7t(),oQo=sq(),J7t=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 Z7t.create({epochs:this.epochs,traceData:HEn(this.traceData)})}serveRouter(e){return new jYe({baseAddress:e,epochs:this.epochs,traceData:HEn(this.traceData)})}};HYe.HTMLTracer=J7t;var jYe=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` - +`)}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:kA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof kK)return{type:kA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:fEn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof PK)return{type:kA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof dq)return{type:kA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof qP)return r.part;throw new Error("Unexpected element type")});if(this.role===kA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===kA.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===kA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===kA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};mg.MaterializedChatMessage=jP;var dq=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&&kA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};mg.MaterializedChatMessageOpaque=dq;var qP=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};mg.MaterializedChatMessageBreakpoint=qP;var kK=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,RK.once)(async e=>e.tokenLength({type:kA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:fEn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};mg.MaterializedChatMessageImage=kK;var PK=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,RK.once)(async e=>e.tokenLength({type:kA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};mg.MaterializedChatMessageDocument=PK;function fq(t){return t instanceof q3||t instanceof jP}a(fq,"isContainerType");function aEn(t){return t instanceof hxe||t instanceof kK||t instanceof PK||t instanceof dq||t instanceof qP}a(aEn,"isContentType");function M7o(t){if(!fq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(M7o,"assertContainerOrChatMessage");function*cEn(t,e=!1){for(let r of t.children)r instanceof hxe?(yield{content:r,isTextSibling:e},e=!0):r instanceof kK||r instanceof PK||r instanceof dq||r instanceof qP?yield{content:r,isTextSibling:!1}:r instanceof dq?yield{content:r,isTextSibling:!0}:(r&&(yield*cEn(r,e)),e=!1)}a(cEn,"contentChunks");function O7o(t,e){let r;function n(o,s){if(aEn(o))(!r||o.priorityn instanceof qP):t instanceof q3&&(r=t.children.some(lEn)),nEn.set(t,r),r}a(lEn,"hasCachePoint");function L7o(t){if(t instanceof jP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof jP)return!1;return!0}a(L7o,"shouldLookForCachePointInNode");function E7t(t,e){let r;if(t instanceof q3&&t.has(1)){O7o(t,e);return}let n=L7o(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 jP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};mg.BudgetExceededError=IYe;function iEn(t){if(!fq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(iEn,"getLowestPriorityAmongChildren");function*uEn(t){yield*t.metadata;for(let e of t.children)fq(e)?yield*uEn(e):yield*e.metadata}a(uEn,"allMetadata");function dEn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,fq(r)&&e.push(...r.children)}}a(oEn,"forEachNode");function B7o(t){let e=t;for(;e.parent;)e=e.parent;return e}a(B7o,"getRoot");function sEn(t){return t instanceof q3&&t.keepWithId!==void 0}a(sEn,"isKeepWith");var y7t=new Set;function F7o(t,e){let r=new Set;for(let n of oEn(t))sEn(n)&&!y7t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)y7t.add(n);try{let n=B7o(t);for(let o of oEn(n))sEn(o)&&r.has(o.keepWithId)?mxe(o,e):o instanceof jP&&o.toolCalls&&(o.toolCalls=U7o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&mxe(o,e))}finally{for(let n of r)y7t.delete(n)}}a(F7o,"removeOtherKeepWiths");function _7t(t,e){if(e.id===t)return e;for(let r of e.children)if(fq(r)){let n=_7t(t,r);if(n)return n}}a(_7t,"findNodeById");function mxe(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),F7o(t,e),r.isEmpty?mxe(r,e):r.onChunksChange())}a(mxe,"removeNode");function fEn(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(fEn,"getEncodedBase64");function U7o(t,e){for(let r=0;r{"use strict";p();function Q7o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(Q7o,"_vscpp");function pEn(){throw new Error("This should not be invoked!")}a(pEn,"_vscppf");pEn.isFragment=!0;globalThis.vscpp=Q7o;globalThis.vscppf=pEn});var b7t=I(xYe=>{"use strict";p();Object.defineProperty(xYe,"__esModule",{value:!0});xYe.PromptElement=void 0;hEn();var C7t=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}};xYe.PromptElement=C7t});var M7t=I(Qs=>{"use strict";p();Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LogicalWrapper=Qs.IfEmpty=Qs.AbstractKeepWith=Qs.TokenLimit=Qs.Expandable=Qs.Chunk=Qs.LegacyPrioritization=Qs.ToolResult=Qs.PrioritizedList=Qs.Document=Qs.Image=Qs.TextChunk=Qs.ToolMessage=Qs.AssistantMessage=Qs.UserMessage=Qs.SystemMessage=Qs.BaseChatMessage=void 0;Qs.isChatMessagePromptElement=q7o;Qs.useKeepWith=$7o;var Axe=xo(),WS=b7t();function q7o(t){return t instanceof wYe||t instanceof RYe||t instanceof kYe}a(q7o,"isChatMessagePromptElement");var DK=class extends WS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.BaseChatMessage=DK;var wYe=class extends DK{static{a(this,"SystemMessage")}constructor(e){e.role=Axe.Raw.ChatRole.System,super(e)}};Qs.SystemMessage=wYe;var RYe=class extends DK{static{a(this,"UserMessage")}constructor(e){e.role=Axe.Raw.ChatRole.User,super(e)}};Qs.UserMessage=RYe;var kYe=class extends DK{static{a(this,"AssistantMessage")}constructor(e){e.role=Axe.Raw.ChatRole.Assistant,super(e)}};Qs.AssistantMessage=kYe;var j7o=/\s+/g,S7t=class extends DK{static{a(this,"ToolMessage")}constructor(e){e.role=Axe.Raw.ChatRole.Tool,super(e)}};Qs.ToolMessage=S7t;var PYe=class extends WS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?j7o: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 H7o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Qs.TextChunk=PYe;async function H7o(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(H7o,"getTextContentBelowBudget");var T7t=class extends WS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Image=T7t;var I7t=class extends WS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Document=I7t;var x7t=class extends WS.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(PYe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Qs.PrioritizedList=x7t;var w7t=class extends WS.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})}))}};Qs.ToolResult=w7t;var R7t=class extends WS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LegacyPrioritization=R7t;var k7t=class extends WS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Chunk=k7t;var P7t=class extends WS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Qs.Expandable=P7t;var D7t=class extends WS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.TokenLimit=D7t;var DYe=class extends WS.PromptElement{static{a(this,"AbstractKeepWith")}};Qs.AbstractKeepWith=DYe;var G7o=0;function $7o(){let t=G7o++;return class extends DYe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a($7o,"useKeepWith");var N7t=class extends WS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(gxe,null,this.props.alt),vscpp(gxe,{flexGrow:1},this.props.children))}};Qs.IfEmpty=N7t;var gxe=class extends WS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LogicalWrapper=gxe});var gEn=I(yxe=>{"use strict";p();Object.defineProperty(yxe,"__esModule",{value:!0});yxe.localize=V7o;yxe.localize2=W7o;yxe.getConfiguredDefaultLocale=z7o;function mEn(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(mEn,"_format");function V7o(t,e,...r){return mEn(e,r)}a(V7o,"localize");function W7o(t,e,...r){let n=mEn(e,r);return{original:n,value:n}}a(W7o,"localize2");function z7o(t){}a(z7o,"getConfiguredDefaultLocale")});var F7t=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=K7o;Sr.isLittleEndian=J7o;Sr.isBigSurOrNewer=Z7o;var AEn=gEn();Sr.LANGUAGE_DEFAULT="en";var vxe=!1,Cxe=!1,_xe=!1,vEn=!1,CEn=!1,L7t=!1,bEn=!1,B7t=!1,SEn=!1,TEn=!1,Exe,NYe=Sr.LANGUAGE_DEFAULT,O7t=Sr.LANGUAGE_DEFAULT,IEn,j3,H3=globalThis,zS;typeof H3.vscode<"u"&&typeof H3.vscode.process<"u"?zS=H3.vscode.process:typeof process<"u"&&(zS=process);var xEn=typeof zS?.versions?.electron=="string",Y7o=xEn&&zS?.type==="renderer";if(typeof zS=="object"){vxe=zS.platform==="win32",Cxe=zS.platform==="darwin",_xe=zS.platform==="linux",vEn=_xe&&!!zS.env.SNAP&&!!zS.env.SNAP_REVISION,bEn=xEn,SEn=!!zS.env.CI||!!zS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Exe=Sr.LANGUAGE_DEFAULT,NYe=Sr.LANGUAGE_DEFAULT;let t=zS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];Exe=e.locale,O7t=e.osLocale,NYe=r||Sr.LANGUAGE_DEFAULT,IEn=e._translationsConfigFile}catch{}CEn=!0}else typeof navigator=="object"&&!Y7o?(j3=navigator.userAgent,vxe=j3.indexOf("Windows")>=0,Cxe=j3.indexOf("Macintosh")>=0,B7t=(j3.indexOf("Macintosh")>=0||j3.indexOf("iPad")>=0||j3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_xe=j3.indexOf("Linux")>=0,TEn=j3?.indexOf("Mobi")>=0,L7t=!0,Exe=AEn.getConfiguredDefaultLocale(AEn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,NYe=Exe,O7t=navigator.language):console.error("Unable to resolve platform.");function K7o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(K7o,"PlatformToString");var MYe=0;Cxe?MYe=1:vxe?MYe=3:_xe&&(MYe=2);Sr.isWindows=vxe;Sr.isMacintosh=Cxe;Sr.isLinux=_xe;Sr.isLinuxSnap=vEn;Sr.isNative=CEn;Sr.isElectron=bEn;Sr.isWeb=L7t;Sr.isWebWorker=L7t&&typeof H3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?H3.origin:void 0;Sr.isIOS=B7t;Sr.isMobile=TEn;Sr.isCI=SEn;Sr.platform=MYe;Sr.userAgent=j3;Sr.language=NYe;var yEn;(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})(yEn||(Sr.Language=yEn={}));Sr.locale=Exe;Sr.platformLocale=O7t;Sr.translationsConfigFile=IEn;Sr.setTimeout0IsFaster=typeof H3.postMessage=="function"&&!H3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];H3.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}),H3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=Cxe||B7t?2:vxe?1:3;var EEn=!0,_En=!1;function J7o(){if(!_En){_En=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,EEn=new Uint16Array(t.buffer)[0]===513}return EEn}a(J7o,"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 Z7o(t){return parseFloat(t)>=20}a(Z7o,"isBigSurOrNewer")});var REn=I(bO=>{"use strict";p();Object.defineProperty(bO,"__esModule",{value:!0});bO.arch=bO.platform=bO.env=bO.cwd=void 0;var wEn=F7t(),NK,U7t=globalThis.vscode;if(typeof U7t<"u"&&typeof U7t.process<"u"){let t=U7t.process;NK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?NK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:NK={get platform(){return wEn.isWindows?"win32":wEn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};bO.cwd=NK.cwd;bO.env=NK.env;bO.platform=NK.platform;bO.arch=NK.arch});var PEn=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.delimiter=An.sep=An.toNamespacedPath=An.parse=An.format=An.extname=An.basename=An.dirname=An.relative=An.resolve=An.join=An.isAbsolute=An.normalize=An.posix=An.win32=void 0;var tue=REn(),X7o=65,eQo=97,tQo=90,rQo=122,mq=46,gg=47,FC=92,pq=58,nQo=63,OYe=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 iQo(t,e){if(t===null||typeof t!="object")throw new OYe(e,"Object",t)}a(iQo,"validateObject");function sp(t,e){if(typeof t!="string")throw new OYe(e,"string",t)}a(sp,"validateString");var UC=tue.platform==="win32";function ns(t){return t===gg||t===FC}a(ns,"isPathSeparator");function Q7t(t){return t===gg}a(Q7t,"isPosixPathSeparator");function hq(t){return t>=X7o&&t<=tQo||t>=eQo&&t<=rQo}a(hq,"isWindowsDeviceRoot");function LYe(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===mq&&l!==-1?++l:l=-1}return o}a(LYe,"normalizeString");function kEn(t,e){iQo(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(kEn,"_format");An.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],sp(s,"path"),s.length===0)continue}else e.length===0?s=tue.cwd():(s=tue.env[`=${e}`]||tue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===FC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ns(f)&&(l=1,d=!0);else if(ns(f))if(d=!0,ns(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ns(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=LYe(r,!n,"\\",ns),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){sp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return Q7t(s)?"\\":t;if(ns(s))if(o=!0,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ns(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){sp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ns(r)||e>2&&hq(r)&&t.charCodeAt(1)===pq&&ns(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"&&ns(r.charCodeAt(0))){++o;let s=r.length;s>1&&ns(r.charCodeAt(1))&&(++o,s>2&&(ns(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return An.win32.normalize(e)},relative(t,e){if(sp(t,"from"),sp(e,"to"),t===e)return"";let r=An.win32.resolve(t),n=An.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===FC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===FC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===FC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===FC?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)===FC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===FC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=An.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===FC){if(e.charCodeAt(1)===FC){let r=e.charCodeAt(2);if(r!==nQo&&r!==mq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(hq(e.charCodeAt(0))&&e.charCodeAt(1)===pq&&e.charCodeAt(2)===FC)return`\\\\?\\${e}`;return t},dirname(t){sp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ns(o)?t:".";if(ns(o)){if(r=n=1,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ns(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&&sp(e,"ext"),sp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&hq(t.charCodeAt(0))&&t.charCodeAt(1)===pq&&(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(ns(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(ns(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){sp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===pq&&hq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ns(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===mq?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:kEn.bind(null,"\\"),parse(t){sp(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 ns(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ns(o)){if(n=1,ns(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),ns(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===mq?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 oQo=(()=>{if(UC){let t=/\\/g;return()=>{let e=tue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>tue.cwd()})();An.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:oQo();sp(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===gg)}return e=LYe(e,!r,"/",Q7t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(sp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===gg,r=t.charCodeAt(t.length-1)===gg;return t=LYe(t,!e,"/",Q7t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return sp(t,"path"),t.length>0&&t.charCodeAt(0)===gg},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?".":An.posix.normalize(e)},relative(t,e){if(sp(t,"from"),sp(e,"to"),t===e||(t=An.posix.resolve(t),e=An.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)===gg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===gg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===gg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(sp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===gg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===gg){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&&sp(e,"ext"),sp(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===gg){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)===gg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){sp(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===gg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===mq?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:kEn.bind(null,"/"),parse(t){sp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===gg,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===gg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===mq?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};An.posix.win32=An.win32.win32=An.win32;An.posix.posix=An.win32.posix=An.posix;An.normalize=UC?An.win32.normalize:An.posix.normalize;An.isAbsolute=UC?An.win32.isAbsolute:An.posix.isAbsolute;An.join=UC?An.win32.join:An.posix.join;An.resolve=UC?An.win32.resolve:An.posix.resolve;An.relative=UC?An.win32.relative:An.posix.relative;An.dirname=UC?An.win32.dirname:An.posix.dirname;An.basename=UC?An.win32.basename:An.posix.basename;An.extname=UC?An.win32.extname:An.posix.extname;An.format=UC?An.win32.format:An.posix.format;An.parse=UC?An.win32.parse:An.posix.parse;An.toNamespacedPath=UC?An.win32.toNamespacedPath:An.posix.toNamespacedPath;An.sep=UC?An.win32.sep:An.posix.sep;An.delimiter=UC?An.win32.delimiter:An.posix.delimiter});var FEn=I(rue=>{"use strict";p();Object.defineProperty(rue,"__esModule",{value:!0});rue.URI=void 0;rue.isUriComponents=pQo;rue.uriToFsPath=QYe;var DEn=PEn(),FYe=F7t(),sQo=/^\w[\w\d+.-]*$/,aQo=/^\//,cQo=/^\/\//;function lQo(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&&!sQo.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!aQo.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(cQo.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(lQo,"_validateUri");function uQo(t,e){return!t&&!e?"file":t}a(uQo,"_schemeFix");function dQo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==HP&&(e=HP+e):e=HP;break}return e}a(dQo,"_referenceResolution");var Gl="",HP="/",fQo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,UYe=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||Gl,this.authority=e.authority||Gl,this.path=e.path||Gl,this.query=e.query||Gl,this.fragment=e.fragment||Gl):(this.scheme=uQo(e,c),this.authority=r||Gl,this.path=dQo(this.scheme,n||Gl),this.query=o||Gl,this.fragment=s||Gl,lQo(this,c))}get fsPath(){return QYe(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=Gl),n===void 0?n=this.authority:n===null&&(n=Gl),o===void 0?o=this.path:o===null&&(o=Gl),s===void 0?s=this.query:s===null&&(s=Gl),c===void 0?c=this.fragment:c===null&&(c=Gl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new gq(r,n,o,s,c)}static parse(e,r=!1){let n=fQo.exec(e);return n?new gq(n[2]||Gl,BYe(n[4]||Gl),BYe(n[5]||Gl),BYe(n[7]||Gl),BYe(n[9]||Gl),r):new gq(Gl,Gl,Gl,Gl,Gl)}static file(e){let r=Gl;if(FYe.isWindows&&(e=e.replace(/\\/g,HP)),e[0]===HP&&e[1]===HP){let n=e.indexOf(HP,2);n===-1?(r=e.substring(2),e=HP):(r=e.substring(2,n),e=e.substring(n)||HP)}return new gq("file",r,e,Gl,Gl)}static from(e,r){return new gq(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 FYe.isWindows&&e.scheme==="file"?n=t.file(DEn.win32.join(QYe(e,!0),...r)).path:n=DEn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return q7t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new gq(e);return r._formatted=e.external??null,r._fsPath=e._sep===OEn?e.fsPath??null:null,r}}else return e}};rue.URI=UYe;function pQo(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(pQo,"isUriComponents");var OEn=FYe.isWindows?1:void 0,gq=class extends UYe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=QYe(this,!1)),this._fsPath}toString(e=!1){return e?q7t(this,!0):(this._formatted||(this._formatted=q7t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=OEn),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}},LEn={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 NEn(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=LEn[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(NEn,"encodeURIComponentFast");function hQo(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,FYe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(QYe,"uriToFsPath");function q7t(t,e){let r=e?hQo:NEn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=HP,n+=HP),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:NEn(u,!1,!1)),n}a(q7t,"_asFormatted");function BEn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+BEn(t.substr(3)):t}}a(BEn,"decodeURIComponentGraceful");var MEn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BYe(t){return t.match(MEn)?t.replace(MEn,e=>BEn(e)):t}a(BYe,"percentDecode")});var G7t=I(Aq=>{"use strict";p();Object.defineProperty(Aq,"__esModule",{value:!0});Aq.PromptReference=Aq.ChatResponseReferencePartStatusKind=Aq.PromptMetadata=void 0;var bxe=FEn(),j7t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};Aq.PromptMetadata=j7t;var UEn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(UEn||(Aq.ChatResponseReferencePartStatusKind=UEn={}));var H7t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?bxe.URI.from(n):{uri:bxe.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?bxe.URI.from(e.iconPath):"light"in e.iconPath?{light:bxe.URI.from(e.iconPath.light),dark:bxe.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}}};Aq.PromptReference=H7t});var Z7t=I(nue=>{"use strict";p();Object.defineProperty(nue,"__esModule",{value:!0});nue.PromptRenderer=nue.MetadataMap=void 0;var mQo=g7t(),yq=v7t(),OK=lq(),Ud=M7t(),J7t=G7t(),jYe;(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")})})(jYe||(nue.MetadataMap=jYe={}));var $7t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new $Ye(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=HEn(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 Ud.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:OK.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 qEn(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 qEn(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 MK(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Ud.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=jEn(o),u=new MK(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await gQo(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 MK(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,OK.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new MK(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 SO))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(VYe),h=o.map(m=>{if(!(m instanceof SO)||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(VYe);return{metadata:jYe.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 yq.BudgetExceededError&&(m.metadata=jYe.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 Ud.Expandable))throw new Error("unreachable: expected growable");let l=new $Ye(null,0,s.elem.id),u=new MK(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:OK.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===Ud.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},HYe(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 SO(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 SO(u));else this._handleIntrinsic(e,l.name,l.props,HYe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};nue.PromptRenderer=$7t;async function gQo(t,e,r,n){let o=0;if((0,Ud.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,OK.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:OK.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(gQo,"computeTokensConsumedByLiterals");function jEn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new z7t(String(t))):AQo(t)?HYe(t.children,e):yQo(t)?HYe(t,e):typeof t.ctor=="string"?e.push(new V7t(t.ctor,t.props,t.children)):e.push(new W7t(t.ctor,t.props,t.children)),e)}a(jEn,"flattenAndReduce");function HYe(t,e=[]){for(let r of t)jEn(r,e);return e}a(HYe,"flattenAndReduceArr");var V7t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},W7t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},z7t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},GYe=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 yq.MaterializedChatMessageOpaque(e,{type:OK.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},MK=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}},$Ye=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 SO(J7t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return Sxe.fromJSON(o,c,s);case 3:return GYe.fromJSON(o,c,s);default:}}).filter(VYe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Ud.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Ud.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Ud.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Ud.Image(r.props);break;case 4:o._obj=new Ud.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 Ud.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Ud.Chunk&&(this._objFlags|=2),this._obj instanceof Ud.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 Sxe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new Sxe(this,r,` +`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new GYe(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(VYe),props:{},references:this._metadata.filter(r=>r instanceof SO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=qYe(this._obj.props,mQo.jsonRetainedProps)),this._obj instanceof Ud.BaseChatMessage)e.ctor=1,Object.assign(e.props,qYe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Ud.Image)return{...e,ctor:3,props:{...e.props,...qYe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Ud.Document)return{...e,ctor:4,props:{...e.props,...qYe(this._obj.props,["data","mediaType"])}};this._obj instanceof Ud.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 Ud.Image)return new yq.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 Ud.Document)return new yq.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 Ud.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new yq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Ud.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Ud.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 yq.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 Ud.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Ud.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new Y7t({type:OK.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},Y7t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new yq.MaterializedChatMessageBreakpoint(e,this.part)}},Sxe=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 SO(J7t.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 yq.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 SO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function AQo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(AQo,"isFragmentCtor");function VYe(t){return t!==void 0}a(VYe,"isDefined");var K7t=class extends J7t.PromptMetadata{static{a(this,"InternalMetadata")}},SO=class extends K7t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function yQo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(yQo,"isIterable");function qYe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(qYe,"pickProps");function HEn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(HEn,"atPath");var QEn=new WeakSet;async function qEn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!QEn.has(r)&&r.constructor.name!=="CancellationError"&&(QEn.add(r),r.message+=` (at tsx element ${HEn(t.path)})`),r}}a(qEn,"annotateError")});var GEn=I(WYe=>{"use strict";p();Object.defineProperty(WYe,"__esModule",{value:!0});WYe.VSCodeTokenizer=void 0;var X7t=lq(),eQt=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=X7t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==X7t.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===X7t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};WYe.VSCodeTokenizer=eQt});var $En=I(iue=>{"use strict";p();Object.defineProperty(iue,"__esModule",{value:!0});iue.tracerCss=iue.tracerSrc=void 0;iue.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';iue.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 KEn=I(YYe=>{"use strict";p();Object.defineProperty(YYe,"__esModule",{value:!0});YYe.HTMLTracer=void 0;var VEn=$En(),Eq=v7t(),EQo=lq(),tQt=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 rQt.create({epochs:this.epochs,traceData:zEn(this.traceData)})}serveRouter(e){return new zYe({baseAddress:e,epochs:this.epochs,traceData:zEn(this.traceData)})}};YYe.HTMLTracer=tQt;var zYe=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 jEn(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)})}},Z7t=class t extends jYe{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 jEn(t,e){return{container:await GEn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(jEn,"serializeRenderData");async function GEn(t,e,r){let n={metadata:e.metadata.map(aQo),priority:e.priority};if(e instanceof gq.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof gq.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof gq.MaterializedChatMessageOpaque||e instanceof gq.MaterializedChatMessageBreakpoint||e instanceof gq.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>GEn(t,s,r||e instanceof gq.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof gq.GenericMaterializedContainer)return{...o,type:0};if(e instanceof gq.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:oQo.Raw.ChatRole.display(e.role),text:s}}}sQo(e)}a(GEn,"serializeMaterialized");function sQo(t){throw new Error("unreachable")}a(sQo,"assertNever");function aQo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(aQo,"serializeMetadata");var HEn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var WEn=I(VEn=>{"use strict";p();Object.defineProperty(VEn,"__esModule",{value:!0})});var YEn=I(zEn=>{"use strict";p();Object.defineProperty(zEn,"__esModule",{value:!0})});var JEn=I(KEn=>{"use strict";p();Object.defineProperty(KEn,"__esModule",{value:!0})});var Io=I(ed=>{"use strict";p();var cQo=ed&&ed.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MK=ed&&ed.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cQo(e,t,r)};Object.defineProperty(ed,"__esModule",{value:!0});ed.contentType=ed.PromptRenderer=ed.MetadataMap=ed.PromptElement=ed.JSONTree=void 0;ed.renderPrompt=dQo;ed.renderElementJSON=fQo;var X7t=sq(),ZEn=z7t(),lQo=UEn();MK($En(),ed);ed.JSONTree=f7t();MK(sq(),ed);MK(k7t(),ed);MK(Q7t(),ed);MK(WEn(),ed);MK(YEn(),ed);MK(JEn(),ed);var uQo=E7t();Object.defineProperty(ed,"PromptElement",{enumerable:!0,get:a(function(){return uQo.PromptElement},"get")});var XEn=z7t();Object.defineProperty(ed,"MetadataMap",{enumerable:!0,get:a(function(){return XEn.MetadataMap},"get")});Object.defineProperty(ed,"PromptRenderer",{enumerable:!0,get:a(function(){return XEn.PromptRenderer},"get")});async function dQo(t,e,r,n,o,s,c=X7t.OutputMode.VSCode){let l="countTokens"in n?new lQo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new ZEn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(dQo,"renderPrompt");ed.contentType="application/vnd.codechat.prompt+json.1";function fQo(t,e,r,n){return new ZEn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:X7t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===X7t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(fQo,"renderElementJSON")});var cCn=I((Asd,Uxe)=>{"use strict";p();var eJe=a(function(){},"NullObject");eJe.prototype=Object.create(null);var ZKe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,XKe=/\\([\v\u0020-\u00ff])/gu,oCn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,GK={type:"",parameters:new eJe};Object.freeze(GK.parameters);Object.freeze(GK);function sCn(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(oCn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new eJe};if(e===-1)return n;let o,s,c;for(ZKe.lastIndex=e;s=ZKe.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),XKe.test(c)&&(c=c.replace(XKe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(sCn,"parse");function aCn(t){if(typeof t!="string")return GK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(oCn.test(r)===!1)return GK;let n={type:r.toLowerCase(),parameters:new eJe};if(e===-1)return n;let o,s,c;for(ZKe.lastIndex=e;s=ZKe.exec(t);){if(s.index!==e)return GK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),XKe.test(c)&&(c=c.replace(XKe,"$1"))),n.parameters[o]=c}return e!==t.length?GK:n}a(aCn,"safeParse");Uxe.exports.default={parse:sCn,safeParse:aCn};Uxe.exports.parse=sCn;Uxe.exports.safeParse=aCn;Uxe.exports.defaultContentType=GK});var xq=I(Eg=>{"use strict";p();Object.defineProperty(Eg,"__esModule",{value:!0});Eg.MonotonousArray=void 0;Eg.findLast=jHo;Eg.findLastIdx=tbn;Eg.findFirst=HHo;Eg.findFirstIdx=rbn;Eg.findLastMonotonous=GHo;Eg.findLastIdxMonotonous=Fqt;Eg.findFirstMonotonous=$Ho;Eg.findFirstIdxMonotonousOrArrLen=Uqt;Eg.findFirstIdxMonotonous=VHo;Eg.findFirstMax=nbn;Eg.findLastMax=WHo;Eg.findFirstMin=zHo;Eg.findMaxIdx=YHo;Eg.mapFindFirst=KHo;function jHo(t,e,r=t.length-1){let n=tbn(t,e,r);if(n!==-1)return t[n]}a(jHo,"findLast");function tbn(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(tbn,"findLastIdx");function HHo(t,e,r=0){let n=rbn(t,e,r);if(n!==-1)return t[n]}a(HHo,"findFirst");function rbn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(nbn,"findFirstMax");function WHo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(WHo,"findLastMax");function zHo(t,e){return nbn(t,(r,n)=>-e(r,n))}a(zHo,"findFirstMin");function YHo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(YHo,"findMaxIdx");function KHo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(KHo,"mapFindFirst")});var Rs=I(wo=>{"use strict";p();Object.defineProperty(wo,"__esModule",{value:!0});wo.BugIndicatingError=wo.ErrorNoTelemetry=wo.ExpectedError=wo.NotSupportedError=wo.NotImplementedError=wo.ReadonlyError=wo.PendingMigrationError=wo.CancellationError=wo.canceledName=wo.errorHandler=wo.ErrorHandler=void 0;wo.setUnexpectedErrorHandler=JHo;wo.isSigPipeError=ZHo;wo.onBugIndicatingError=XHo;wo.onUnexpectedError=eGo;wo.onUnexpectedExternalError=tGo;wo.transformErrorForSerialization=ibn;wo.transformErrorFromSerialization=obn;wo.isCancellationError=Vqt;wo.canceled=rGo;wo.illegalArgument=nGo;wo.illegalState=iGo;wo.getErrorMessage=oGo;var SJe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zK.isErrorNoTelemetry(e)?new zK(e.message+` + `}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 WEn(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)})}},rQt=class t extends zYe{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 WEn(t,e){return{container:await YEn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(WEn,"serializeRenderData");async function YEn(t,e,r){let n={metadata:e.metadata.map(vQo),priority:e.priority};if(e instanceof Eq.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof Eq.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof Eq.MaterializedChatMessageOpaque||e instanceof Eq.MaterializedChatMessageBreakpoint||e instanceof Eq.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>YEn(t,s,r||e instanceof Eq.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof Eq.GenericMaterializedContainer)return{...o,type:0};if(e instanceof Eq.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:EQo.Raw.ChatRole.display(e.role),text:s}}}_Qo(e)}a(YEn,"serializeMaterialized");function _Qo(t){throw new Error("unreachable")}a(_Qo,"assertNever");function vQo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(vQo,"serializeMetadata");var zEn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var ZEn=I(JEn=>{"use strict";p();Object.defineProperty(JEn,"__esModule",{value:!0})});var e_n=I(XEn=>{"use strict";p();Object.defineProperty(XEn,"__esModule",{value:!0})});var r_n=I(t_n=>{"use strict";p();Object.defineProperty(t_n,"__esModule",{value:!0})});var xo=I(td=>{"use strict";p();var CQo=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]})),LK=td&&td.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CQo(e,t,r)};Object.defineProperty(td,"__esModule",{value:!0});td.contentType=td.PromptRenderer=td.MetadataMap=td.PromptElement=td.JSONTree=void 0;td.renderPrompt=TQo;td.renderElementJSON=IQo;var nQt=lq(),n_n=Z7t(),bQo=GEn();LK(KEn(),td);td.JSONTree=g7t();LK(lq(),td);LK(M7t(),td);LK(G7t(),td);LK(ZEn(),td);LK(e_n(),td);LK(r_n(),td);var SQo=b7t();Object.defineProperty(td,"PromptElement",{enumerable:!0,get:a(function(){return SQo.PromptElement},"get")});var i_n=Z7t();Object.defineProperty(td,"MetadataMap",{enumerable:!0,get:a(function(){return i_n.MetadataMap},"get")});Object.defineProperty(td,"PromptRenderer",{enumerable:!0,get:a(function(){return i_n.PromptRenderer},"get")});async function TQo(t,e,r,n,o,s,c=nQt.OutputMode.VSCode){let l="countTokens"in n?new bQo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new n_n.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(TQo,"renderPrompt");td.contentType="application/vnd.codechat.prompt+json.1";function IQo(t,e,r,n){return new n_n.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:nQt.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===nQt.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(IQo,"renderElementJSON")});var pCn=I((Lsd,jxe)=>{"use strict";p();var sJe=a(function(){},"NullObject");sJe.prototype=Object.create(null);var iJe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,oJe=/\\([\v\u0020-\u00ff])/gu,uCn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,VK={type:"",parameters:new sJe};Object.freeze(VK.parameters);Object.freeze(VK);function dCn(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(uCn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new sJe};if(e===-1)return n;let o,s,c;for(iJe.lastIndex=e;s=iJe.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),oJe.test(c)&&(c=c.replace(oJe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(dCn,"parse");function fCn(t){if(typeof t!="string")return VK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(uCn.test(r)===!1)return VK;let n={type:r.toLowerCase(),parameters:new sJe};if(e===-1)return n;let o,s,c;for(iJe.lastIndex=e;s=iJe.exec(t);){if(s.index!==e)return VK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),oJe.test(c)&&(c=c.replace(oJe,"$1"))),n.parameters[o]=c}return e!==t.length?VK:n}a(fCn,"safeParse");jxe.exports.default={parse:dCn,safeParse:fCn};jxe.exports.parse=dCn;jxe.exports.safeParse=fCn;jxe.exports.defaultContentType=VK});var kq=I(_g=>{"use strict";p();Object.defineProperty(_g,"__esModule",{value:!0});_g.MonotonousArray=void 0;_g.findLast=rGo;_g.findLastIdx=sbn;_g.findFirst=nGo;_g.findFirstIdx=abn;_g.findLastMonotonous=iGo;_g.findLastIdxMonotonous=jqt;_g.findFirstMonotonous=oGo;_g.findFirstIdxMonotonousOrArrLen=Hqt;_g.findFirstIdxMonotonous=sGo;_g.findFirstMax=cbn;_g.findLastMax=aGo;_g.findFirstMin=cGo;_g.findMaxIdx=lGo;_g.mapFindFirst=uGo;function rGo(t,e,r=t.length-1){let n=sbn(t,e,r);if(n!==-1)return t[n]}a(rGo,"findLast");function sbn(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(sbn,"findLastIdx");function nGo(t,e,r=0){let n=abn(t,e,r);if(n!==-1)return t[n]}a(nGo,"findFirst");function abn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(cbn,"findFirstMax");function aGo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(aGo,"findLastMax");function cGo(t,e){return cbn(t,(r,n)=>-e(r,n))}a(cGo,"findFirstMin");function lGo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(lGo,"findMaxIdx");function uGo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(uGo,"mapFindFirst")});var Rs=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=dGo;Ro.isSigPipeError=fGo;Ro.onBugIndicatingError=pGo;Ro.onUnexpectedError=hGo;Ro.onUnexpectedExternalError=mGo;Ro.transformErrorForSerialization=lbn;Ro.transformErrorFromSerialization=ubn;Ro.isCancellationError=Kqt;Ro.canceled=gGo;Ro.illegalArgument=AGo;Ro.illegalState=yGo;Ro.getErrorMessage=EGo;var kJe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?KK.isErrorNoTelemetry(e)?new KK(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)}};wo.ErrorHandler=SJe;wo.errorHandler=new SJe;function JHo(t){wo.errorHandler.setUnexpectedErrorHandler(t)}a(JHo,"setUnexpectedErrorHandler");function ZHo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(ZHo,"isSigPipeError");function XHo(t){wo.errorHandler.onUnexpectedError(t)}a(XHo,"onBugIndicatingError");function eGo(t){Vqt(t)||wo.errorHandler.onUnexpectedError(t)}a(eGo,"onUnexpectedError");function tGo(t){Vqt(t)||wo.errorHandler.onUnexpectedExternalError(t)}a(tGo,"onUnexpectedExternalError");function ibn(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:zK.isErrorNoTelemetry(t),cause:n?ibn(n):void 0,code:t.code}}return t}a(ibn,"transformErrorForSerialization");function obn(t){let e;return t.noTelemetry?e=new zK:(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=obn(t.cause)),e}a(obn,"transformErrorFromSerialization");wo.canceledName="Canceled";function Vqt(t){return t instanceof TJe?!0:t instanceof Error&&t.name===wo.canceledName&&t.message===wo.canceledName}a(Vqt,"isCancellationError");var TJe=class extends Error{static{a(this,"CancellationError")}constructor(){super(wo.canceledName),this.name=this.message}};wo.CancellationError=TJe;var Qqt=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}};wo.PendingMigrationError=Qqt;function rGo(){let t=new Error(wo.canceledName);return t.name=t.message,t}a(rGo,"canceled");function nGo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(nGo,"illegalArgument");function iGo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(iGo,"illegalState");var qqt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};wo.ReadonlyError=qqt;function oGo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(oGo,"getErrorMessage");var jqt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};wo.NotImplementedError=jqt;var Hqt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};wo.NotSupportedError=Hqt;var Gqt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};wo.ExpectedError=Gqt;var zK=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"}};wo.ErrorNoTelemetry=zK;var $qt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};wo.BugIndicatingError=$qt});var Sl=I(Wn=>{"use strict";p();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Permutation=Wn.CallbackIterable=Wn.ArrayQueue=Wn.booleanComparator=Wn.numberComparator=Wn.CompareResult=void 0;Wn.tail=cGo;Wn.equals=lGo;Wn.removeFastWithoutKeepingOrder=uGo;Wn.binarySearch=dGo;Wn.binarySearch2=sbn;Wn.quickSelect=Wqt;Wn.groupBy=fGo;Wn.groupAdjacentBy=pGo;Wn.forEachAdjacent=hGo;Wn.forEachWithNeighbors=mGo;Wn.concatArrays=gGo;Wn.sortedDiff=abn;Wn.delta=AGo;Wn.top=yGo;Wn.topAsync=EGo;Wn.coalesce=_Go;Wn.coalesceInPlace=vGo;Wn.move=CGo;Wn.isFalsyOrEmpty=bGo;Wn.isNonEmptyArray=SGo;Wn.distinct=TGo;Wn.uniqueFilter=IGo;Wn.commonPrefixLength=xGo;Wn.range=wGo;Wn.index=RGo;Wn.insert=kGo;Wn.remove=lbn;Wn.arrayInsert=PGo;Wn.shuffle=DGo;Wn.pushToStart=NGo;Wn.pushToEnd=MGo;Wn.pushMany=OGo;Wn.mapArrayOrNot=LGo;Wn.mapFilter=BGo;Wn.withoutDuplicates=FGo;Wn.asArray=UGo;Wn.getRandomElement=QGo;Wn.insertInto=ubn;Wn.splice=qGo;Wn.compareBy=jGo;Wn.tieBreakComparators=HGo;Wn.reverseOrder=VGo;Wn.compareUndefinedSmallest=WGo;Wn.findAsync=zGo;Wn.sum=YGo;Wn.sumBy=KGo;var sGo=xq(),aGo=Rs();function cGo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(cGo,"tail");function lGo(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(dGo,"binarySearch");function sbn(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(sbn,"binarySearch2");function Wqt(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(abn,"sortedDiff");function AGo(t,e,r){let n=abn(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(AGo,"delta");function yGo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return cbn(t,e,n,r,t.length),n}a(yGo,"top");function EGo(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 aGo.CancellationError;cbn(t,e,u,d,f)}return u})().then(s,c)})}a(EGo,"topAsync");function cbn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(cbn,"topStep");function _Go(t){return t.filter(e=>!!e)}a(_Go,"coalesce");function vGo(t){let e=0;for(let r=0;r0}a(SGo,"isNonEmptyArray");function TGo(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(TGo,"distinct");function IGo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(IGo,"uniqueFilter");function xGo(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(wGo,"range");function RGo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(RGo,"index");function kGo(t,e){return t.push(e),()=>lbn(t,e)}a(kGo,"insert");function lbn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(lbn,"remove");function PGo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(PGo,"arrayInsert");function DGo(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(DGo,"shuffle");function NGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(NGo,"pushToStart");function MGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(MGo,"pushToEnd");function OGo(t,e){for(let r of e)t.push(r)}a(OGo,"pushMany");function LGo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(LGo,"mapArrayOrNot");function BGo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(BGo,"mapFilter");function FGo(t){let e=new Set(t);return Array.from(e)}a(FGo,"withoutDuplicates");function UGo(t){return Array.isArray(t)?t:[t]}a(UGo,"asArray");function QGo(t){return t[Math.floor(Math.random()*t.length)]}a(QGo,"getRandomElement");function ubn(t,e,r){let n=dbn(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})(wq||(Wn.CompareResult=wq={}));function jGo(t,e){return(r,n)=>e(t(r),t(n))}a(jGo,"compareBy");function HGo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!wq.isNeitherLessOrGreaterThan(o))return o}return wq.neitherLessOrGreaterThan}}a(HGo,"tieBreakComparators");var GGo=a((t,e)=>t-e,"numberComparator");Wn.numberComparator=GGo;var $Go=a((t,e)=>(0,Wn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Wn.booleanComparator=$Go;function VGo(t){return(e,r)=>-t(e,r)}a(VGo,"reverseOrder");function WGo(t){return(e,r)=>e===void 0?r===void 0?wq.neitherLessOrGreaterThan:wq.lessThan:r===void 0?wq.greaterThan:t(e,r)}a(WGo,"compareUndefinedSmallest");var zqt=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}};Wn.ArrayQueue=zqt;var Yqt=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||wq.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Wn.CallbackIterable=Yqt;var Kqt=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(zGo,"findAsync");function YGo(t){return t.reduce((e,r)=>e+r,0)}a(YGo,"sum");function KGo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(KGo,"sumBy")});var Xqt=I(V3=>{"use strict";p();var pbn;Object.defineProperty(V3,"__esModule",{value:!0});V3.SetWithKey=void 0;V3.groupBy=XGo;V3.groupByMap=e$o;V3.diffSets=t$o;V3.diffMaps=r$o;V3.intersection=n$o;function XGo(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(XGo,"groupBy");function e$o(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(e$o,"groupByMap");function t$o(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(t$o,"diffSets");function r$o(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(r$o,"diffMaps");function n$o(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(n$o,"intersection");var Zqt=class{static{a(this,"SetWithKey")}static{pbn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[pbn]="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()}};V3.SetWithKey=Zqt});var tjt=I(ejt=>{"use strict";p();Object.defineProperty(ejt,"__esModule",{value:!0});ejt.createSingleCallFunction=i$o;function i$o(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(i$o,"createSingleCallFunction")});var zP=I(Ud=>{"use strict";p();var hbn,mbn,gbn;Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NKeyMap=Ud.SetMap=Ud.BidirectionalMap=Ud.CounterSet=Ud.MRUCache=Ud.LRUCache=Ud.LinkedMap=Ud.ResourceSet=Ud.ResourceMap=void 0;Ud.getOrSet=o$o;Ud.mapToString=s$o;Ud.setToString=a$o;Ud.mapsStrictEqualIgnoreOrder=l$o;function o$o(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(o$o,"getOrSet");function s$o(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(s$o,"mapToString");function a$o(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(a$o,"setToString");var rjt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function c$o(t){return Array.isArray(t)}a(c$o,"isEntries");var Jxe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[hbn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(c$o(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 rjt(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]}*[(hbn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Ud.ResourceMap=Jxe;var njt=class{static{a(this,"ResourceSet")}constructor(e,r){this[mbn]="ResourceSet",!e||typeof e=="function"?this._map=new Jxe(e):(this._map=new Jxe(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()}[(mbn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Ud.ResourceSet=njt;var IJe=class{static{a(this,"LinkedMap")}constructor(){this[gbn]="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}[(gbn=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)}};Ud.LinkedMap=IJe;var xJe=class extends IJe{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))}},ijt=class extends xJe{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}};Ud.LRUCache=ijt;var ojt=class extends xJe{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}};Ud.MRUCache=ojt;var sjt=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)}};Ud.CounterSet=sjt;var ajt=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()}};Ud.BidirectionalMap=ajt;var cjt=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}};Ud.SetMap=cjt;function l$o(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(l$o,"mapsStrictEqualIgnoreOrder");var ljt=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)}};Ro.ErrorHandler=kJe;Ro.errorHandler=new kJe;function dGo(t){Ro.errorHandler.setUnexpectedErrorHandler(t)}a(dGo,"setUnexpectedErrorHandler");function fGo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(fGo,"isSigPipeError");function pGo(t){Ro.errorHandler.onUnexpectedError(t)}a(pGo,"onBugIndicatingError");function hGo(t){Kqt(t)||Ro.errorHandler.onUnexpectedError(t)}a(hGo,"onUnexpectedError");function mGo(t){Kqt(t)||Ro.errorHandler.onUnexpectedExternalError(t)}a(mGo,"onUnexpectedExternalError");function lbn(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:KK.isErrorNoTelemetry(t),cause:n?lbn(n):void 0,code:t.code}}return t}a(lbn,"transformErrorForSerialization");function ubn(t){let e;return t.noTelemetry?e=new KK:(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=ubn(t.cause)),e}a(ubn,"transformErrorFromSerialization");Ro.canceledName="Canceled";function Kqt(t){return t instanceof PJe?!0:t instanceof Error&&t.name===Ro.canceledName&&t.message===Ro.canceledName}a(Kqt,"isCancellationError");var PJe=class extends Error{static{a(this,"CancellationError")}constructor(){super(Ro.canceledName),this.name=this.message}};Ro.CancellationError=PJe;var Gqt=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=Gqt;function gGo(){let t=new Error(Ro.canceledName);return t.name=t.message,t}a(gGo,"canceled");function AGo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(AGo,"illegalArgument");function yGo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(yGo,"illegalState");var $qt=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=$qt;function EGo(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}a(EGo,"getErrorMessage");var Vqt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};Ro.NotImplementedError=Vqt;var Wqt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};Ro.NotSupportedError=Wqt;var zqt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};Ro.ExpectedError=zqt;var KK=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=KK;var Yqt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};Ro.BugIndicatingError=Yqt});var Tl=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=CGo;Vn.equals=bGo;Vn.removeFastWithoutKeepingOrder=SGo;Vn.binarySearch=TGo;Vn.binarySearch2=dbn;Vn.quickSelect=Jqt;Vn.groupBy=IGo;Vn.groupAdjacentBy=xGo;Vn.forEachAdjacent=wGo;Vn.forEachWithNeighbors=RGo;Vn.concatArrays=kGo;Vn.sortedDiff=fbn;Vn.delta=PGo;Vn.top=DGo;Vn.topAsync=NGo;Vn.coalesce=MGo;Vn.coalesceInPlace=OGo;Vn.move=LGo;Vn.isFalsyOrEmpty=BGo;Vn.isNonEmptyArray=FGo;Vn.distinct=UGo;Vn.uniqueFilter=QGo;Vn.commonPrefixLength=qGo;Vn.range=jGo;Vn.index=HGo;Vn.insert=GGo;Vn.remove=hbn;Vn.arrayInsert=$Go;Vn.shuffle=VGo;Vn.pushToStart=WGo;Vn.pushToEnd=zGo;Vn.pushMany=YGo;Vn.mapArrayOrNot=KGo;Vn.mapFilter=JGo;Vn.withoutDuplicates=ZGo;Vn.asArray=XGo;Vn.getRandomElement=e$o;Vn.insertInto=mbn;Vn.splice=t$o;Vn.compareBy=r$o;Vn.tieBreakComparators=n$o;Vn.reverseOrder=s$o;Vn.compareUndefinedSmallest=a$o;Vn.findAsync=c$o;Vn.sum=l$o;Vn.sumBy=u$o;var _Go=kq(),vGo=Rs();function CGo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(CGo,"tail");function bGo(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(TGo,"binarySearch");function dbn(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(dbn,"binarySearch2");function Jqt(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(fbn,"sortedDiff");function PGo(t,e,r){let n=fbn(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(PGo,"delta");function DGo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return pbn(t,e,n,r,t.length),n}a(DGo,"top");function NGo(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 vGo.CancellationError;pbn(t,e,u,d,f)}return u})().then(s,c)})}a(NGo,"topAsync");function pbn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(pbn,"topStep");function MGo(t){return t.filter(e=>!!e)}a(MGo,"coalesce");function OGo(t){let e=0;for(let r=0;r0}a(FGo,"isNonEmptyArray");function UGo(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(UGo,"distinct");function QGo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(QGo,"uniqueFilter");function qGo(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(jGo,"range");function HGo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(HGo,"index");function GGo(t,e){return t.push(e),()=>hbn(t,e)}a(GGo,"insert");function hbn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(hbn,"remove");function $Go(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a($Go,"arrayInsert");function VGo(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(VGo,"shuffle");function WGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(WGo,"pushToStart");function zGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(zGo,"pushToEnd");function YGo(t,e){for(let r of e)t.push(r)}a(YGo,"pushMany");function KGo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(KGo,"mapArrayOrNot");function JGo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(JGo,"mapFilter");function ZGo(t){let e=new Set(t);return Array.from(e)}a(ZGo,"withoutDuplicates");function XGo(t){return Array.isArray(t)?t:[t]}a(XGo,"asArray");function e$o(t){return t[Math.floor(Math.random()*t.length)]}a(e$o,"getRandomElement");function mbn(t,e,r){let n=gbn(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})(Pq||(Vn.CompareResult=Pq={}));function r$o(t,e){return(r,n)=>e(t(r),t(n))}a(r$o,"compareBy");function n$o(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!Pq.isNeitherLessOrGreaterThan(o))return o}return Pq.neitherLessOrGreaterThan}}a(n$o,"tieBreakComparators");var i$o=a((t,e)=>t-e,"numberComparator");Vn.numberComparator=i$o;var o$o=a((t,e)=>(0,Vn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Vn.booleanComparator=o$o;function s$o(t){return(e,r)=>-t(e,r)}a(s$o,"reverseOrder");function a$o(t){return(e,r)=>e===void 0?r===void 0?Pq.neitherLessOrGreaterThan:Pq.lessThan:r===void 0?Pq.greaterThan:t(e,r)}a(a$o,"compareUndefinedSmallest");var Zqt=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=Zqt;var Xqt=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||Pq.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Vn.CallbackIterable=Xqt;var ejt=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(c$o,"findAsync");function l$o(t){return t.reduce((e,r)=>e+r,0)}a(l$o,"sum");function u$o(t,e){return t.reduce((r,n)=>r+e(n),0)}a(u$o,"sumBy")});var njt=I(z3=>{"use strict";p();var ybn;Object.defineProperty(z3,"__esModule",{value:!0});z3.SetWithKey=void 0;z3.groupBy=p$o;z3.groupByMap=h$o;z3.diffSets=m$o;z3.diffMaps=g$o;z3.intersection=A$o;function p$o(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(p$o,"groupBy");function h$o(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(h$o,"groupByMap");function m$o(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(m$o,"diffSets");function g$o(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(g$o,"diffMaps");function A$o(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(A$o,"intersection");var rjt=class{static{a(this,"SetWithKey")}static{ybn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[ybn]="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()}};z3.SetWithKey=rjt});var ojt=I(ijt=>{"use strict";p();Object.defineProperty(ijt,"__esModule",{value:!0});ijt.createSingleCallFunction=y$o;function y$o(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(y$o,"createSingleCallFunction")});var KP=I(qd=>{"use strict";p();var Ebn,_bn,vbn;Object.defineProperty(qd,"__esModule",{value:!0});qd.NKeyMap=qd.SetMap=qd.BidirectionalMap=qd.CounterSet=qd.MRUCache=qd.LRUCache=qd.LinkedMap=qd.ResourceSet=qd.ResourceMap=void 0;qd.getOrSet=E$o;qd.mapToString=_$o;qd.setToString=v$o;qd.mapsStrictEqualIgnoreOrder=b$o;function E$o(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(E$o,"getOrSet");function _$o(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(_$o,"mapToString");function v$o(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(v$o,"setToString");var sjt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function C$o(t){return Array.isArray(t)}a(C$o,"isEntries");var ewe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[Ebn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(C$o(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 sjt(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]}*[(Ebn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};qd.ResourceMap=ewe;var ajt=class{static{a(this,"ResourceSet")}constructor(e,r){this[_bn]="ResourceSet",!e||typeof e=="function"?this._map=new ewe(e):(this._map=new ewe(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()}[(_bn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};qd.ResourceSet=ajt;var DJe=class{static{a(this,"LinkedMap")}constructor(){this[vbn]="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}[(vbn=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)}};qd.LinkedMap=DJe;var NJe=class extends DJe{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))}},cjt=class extends NJe{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}};qd.LRUCache=cjt;var ljt=class extends NJe{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}};qd.MRUCache=ljt;var ujt=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)}};qd.CounterSet=ujt;var djt=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()}};qd.BidirectionalMap=djt;var fjt=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}};qd.SetMap=fjt;function b$o(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(b$o,"mapsStrictEqualIgnoreOrder");var pjt=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)}};Ud.NKeyMap=ljt});var rd=I(W3=>{"use strict";p();Object.defineProperty(W3,"__esModule",{value:!0});W3.ok=u$o;W3.assertNever=d$o;W3.softAssertNever=f$o;W3.assert=p$o;W3.softAssert=h$o;W3.assertFn=m$o;W3.checkAdjacentItems=g$o;var Zxe=Rs();function u$o(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(u$o,"ok");function d$o(t,e="Unreachable"){throw new Error(e)}a(d$o,"assertNever");function f$o(t){}a(f$o,"softAssertNever");function p$o(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Zxe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(p$o,"assert");function h$o(t,e="Soft Assertion Failed"){t||(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError(e))}a(h$o,"softAssert");function m$o(t){if(!t()){debugger;t(),(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError("Assertion Failed"))}}a(m$o,"assertFn");function g$o(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.isOneOf=void 0;Tl.isString=ujt;Tl.isStringArray=y$o;Tl.isArrayOf=Abn;Tl.isObject=ybn;Tl.isTypedArray=E$o;Tl.isNumber=_$o;Tl.isIterable=v$o;Tl.isAsyncIterable=C$o;Tl.isBoolean=b$o;Tl.isUndefined=Ebn;Tl.isDefined=S$o;Tl.isUndefinedOrNull=wJe;Tl.assertType=T$o;Tl.assertReturnsDefined=I$o;Tl.assertDefined=x$o;Tl.assertReturnsAllDefined=w$o;Tl.typeCheck=k$o;Tl.isEmptyObject=D$o;Tl.isFunction=djt;Tl.areFunctions=N$o;Tl.validateConstraints=M$o;Tl.validateConstraint=_bn;Tl.upcast=O$o;Tl.hasKey=L$o;var A$o=rd();function ujt(t){return typeof t=="string"}a(ujt,"isString");function y$o(t){return Abn(t,ujt)}a(y$o,"isStringArray");function Abn(t,e){return Array.isArray(t)&&t.every(e)}a(Abn,"isArrayOf");function ybn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(ybn,"isObject");function E$o(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(E$o,"isTypedArray");function _$o(t){return typeof t=="number"&&!isNaN(t)}a(_$o,"isNumber");function v$o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(v$o,"isIterable");function C$o(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(C$o,"isAsyncIterable");function b$o(t){return t===!0||t===!1}a(b$o,"isBoolean");function Ebn(t){return typeof t>"u"}a(Ebn,"isUndefined");function S$o(t){return!wJe(t)}a(S$o,"isDefined");function wJe(t){return Ebn(t)||t===null}a(wJe,"isUndefinedOrNull");function T$o(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(T$o,"assertType");function I$o(t){return(0,A$o.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(I$o,"assertReturnsDefined");function x$o(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(x$o,"assertDefined");function w$o(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Tl.isOneOf=R$o;function k$o(t){}a(k$o,"typeCheck");var P$o=Object.prototype.hasOwnProperty;function D$o(t){if(!ybn(t))return!1;for(let e in t)if(P$o.call(t,e))return!1;return!0}a(D$o,"isEmptyObject");function djt(t){return typeof t=="function"}a(djt,"isFunction");function N$o(...t){return t.length>0&&t.every(djt)}a(N$o,"areFunctions");function M$o(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(RJe,"__esModule",{value:!0});RJe.Iterable=void 0;var B$o=KS(),vbn;(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,B$o.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let L of x)N=P(N,L);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(hs,"__esModule",{value:!0});hs.DisposableResourceMap=hs.DisposableSet=hs.DisposableMap=hs.ImmortalReference=hs.AsyncReferenceCollection=hs.ReferenceCollection=hs.RefCountedDisposable=hs.MandatoryMutableDisposable=hs.MutableDisposable=hs.Disposable=hs.DisposableStore=hs.DisposableTracker=hs.GCBasedDisposableTracker=void 0;hs.setDisposableTracker=Tbn;hs.trackDisposable=KK;hs.markAsDisposed=JK;hs.markAsSingleton=H$o;hs.isDisposable=Ibn;hs.dispose=ewe;hs.disposeIfDisposable=G$o;hs.combinedDisposable=$$o;hs.toDisposable=bjt;hs.disposeOnReturn=V$o;hs.thenIfNotDisposed=W$o;hs.thenRegisterOrDispose=z$o;var Cbn=Sl(),F$o=Xqt(),Sbn=zP(),U$o=tjt(),Q$o=fjt(),bbn=Rs(),q$o=!1,YK=null,pjt=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)}};hs.GCBasedDisposableTracker=pjt;var hjt=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 Sbn.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,Cbn.compareBy)(u=>u.idx,Cbn.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(Y3,"__esModule",{value:!0});Y3.ok=S$o;Y3.assertNever=T$o;Y3.softAssertNever=I$o;Y3.assert=x$o;Y3.softAssert=w$o;Y3.assertFn=R$o;Y3.checkAdjacentItems=k$o;var twe=Rs();function S$o(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(S$o,"ok");function T$o(t,e="Unreachable"){throw new Error(e)}a(T$o,"assertNever");function I$o(t){}a(I$o,"softAssertNever");function x$o(t,e="unexpected state"){if(!t)throw typeof e=="string"?new twe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(x$o,"assert");function w$o(t,e="Soft Assertion Failed"){t||(0,twe.onUnexpectedError)(new twe.BugIndicatingError(e))}a(w$o,"softAssert");function R$o(t){if(!t()){debugger;t(),(0,twe.onUnexpectedError)(new twe.BugIndicatingError("Assertion Failed"))}}a(R$o,"assertFn");function k$o(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Il,"__esModule",{value:!0});Il.isOneOf=void 0;Il.isString=hjt;Il.isStringArray=D$o;Il.isArrayOf=Cbn;Il.isObject=bbn;Il.isTypedArray=N$o;Il.isNumber=M$o;Il.isIterable=O$o;Il.isAsyncIterable=L$o;Il.isBoolean=B$o;Il.isUndefined=Sbn;Il.isDefined=F$o;Il.isUndefinedOrNull=MJe;Il.assertType=U$o;Il.assertReturnsDefined=Q$o;Il.assertDefined=q$o;Il.assertReturnsAllDefined=j$o;Il.typeCheck=G$o;Il.isEmptyObject=V$o;Il.isFunction=mjt;Il.areFunctions=W$o;Il.validateConstraints=z$o;Il.validateConstraint=Tbn;Il.upcast=Y$o;Il.hasKey=K$o;var P$o=nd();function hjt(t){return typeof t=="string"}a(hjt,"isString");function D$o(t){return Cbn(t,hjt)}a(D$o,"isStringArray");function Cbn(t,e){return Array.isArray(t)&&t.every(e)}a(Cbn,"isArrayOf");function bbn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(bbn,"isObject");function N$o(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(N$o,"isTypedArray");function M$o(t){return typeof t=="number"&&!isNaN(t)}a(M$o,"isNumber");function O$o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(O$o,"isIterable");function L$o(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(L$o,"isAsyncIterable");function B$o(t){return t===!0||t===!1}a(B$o,"isBoolean");function Sbn(t){return typeof t>"u"}a(Sbn,"isUndefined");function F$o(t){return!MJe(t)}a(F$o,"isDefined");function MJe(t){return Sbn(t)||t===null}a(MJe,"isUndefinedOrNull");function U$o(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(U$o,"assertType");function Q$o(t){return(0,P$o.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(Q$o,"assertReturnsDefined");function q$o(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(q$o,"assertDefined");function j$o(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Il.isOneOf=H$o;function G$o(t){}a(G$o,"typeCheck");var $$o=Object.prototype.hasOwnProperty;function V$o(t){if(!bbn(t))return!1;for(let e in t)if($$o.call(t,e))return!1;return!0}a(V$o,"isEmptyObject");function mjt(t){return typeof t=="function"}a(mjt,"isFunction");function W$o(...t){return t.length>0&&t.every(mjt)}a(W$o,"areFunctions");function z$o(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(OJe,"__esModule",{value:!0});OJe.Iterable=void 0;var J$o=ZS(),Ibn;(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,J$o.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let L of x)N=P(N,L);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(hs,"__esModule",{value:!0});hs.DisposableResourceMap=hs.DisposableSet=hs.DisposableMap=hs.ImmortalReference=hs.AsyncReferenceCollection=hs.ReferenceCollection=hs.RefCountedDisposable=hs.MandatoryMutableDisposable=hs.MutableDisposable=hs.Disposable=hs.DisposableStore=hs.DisposableTracker=hs.GCBasedDisposableTracker=void 0;hs.setDisposableTracker=kbn;hs.trackDisposable=ZK;hs.markAsDisposed=XK;hs.markAsSingleton=nVo;hs.isDisposable=Pbn;hs.dispose=nwe;hs.disposeIfDisposable=iVo;hs.combinedDisposable=oVo;hs.toDisposable=xjt;hs.disposeOnReturn=sVo;hs.thenIfNotDisposed=aVo;hs.thenRegisterOrDispose=cVo;var xbn=Tl(),Z$o=njt(),Rbn=KP(),X$o=ojt(),eVo=gjt(),wbn=Rs(),tVo=!1,JK=null,Ajt=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)}};hs.GCBasedDisposableTracker=Ajt;var yjt=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 Rbn.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,xbn.compareBy)(u=>u.idx,xbn.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,Z$o.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} ==================== @@ -100,129 +100,129 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};hs.DisposableTracker=hjt;function Tbn(t){YK=t}a(Tbn,"setDisposableTracker");if(q$o){let t="__is_disposable_tracked__";Tbn(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!==_ue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==_ue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function KK(t){return YK?.trackDisposable(t),t}a(KK,"trackDisposable");function JK(t){YK?.markAsDisposed(t)}a(JK,"markAsDisposed");function z3(t,e){YK?.setParent(t,e)}a(z3,"setParentOfDisposable");function j$o(t,e){if(YK)for(let r of t)YK.setParent(r,e)}a(j$o,"setParentOfDisposables");function H$o(t){return YK?.markAsSingleton(t),t}a(H$o,"markAsSingleton");function Ibn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(Ibn,"isDisposable");function ewe(t){if(Q$o.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(ewe,"dispose");function G$o(t){for(let e of t)Ibn(e)&&e.dispose();return[]}a(G$o,"disposeIfDisposable");function $$o(...t){let e=bjt(()=>ewe(t));return j$o(t,e),e}a($$o,"combinedDisposable");var mjt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,KK(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,JK(this),this._fn()}}};function bjt(t){return new mjt(t)}a(bjt,"toDisposable");var Xxe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,KK(this)}dispose(){this._isDisposed||(JK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ewe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===_ue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return z3(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)&&z3(e,null)}assertNotDisposed(){this._isDisposed&&(0,bbn.onUnexpectedError)(new bbn.BugIndicatingError("Object disposed"))}};hs.DisposableStore=Xxe;var _ue=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Xxe,KK(this),z3(this._store,this)}dispose(){JK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};hs.Disposable=_ue;var kJe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,KK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&z3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,JK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&z3(e,null),e}};hs.MutableDisposable=kJe;var gjt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new kJe,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()}};hs.MandatoryMutableDisposable=gjt;var Ajt=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}};hs.RefCountedDisposable=Ajt;var yjt=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,U$o.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};hs.ReferenceCollection=yjt;var Ejt=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}}};hs.AsyncReferenceCollection=Ejt;var _jt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};hs.ImmortalReference=_jt;function V$o(t){let e=new Xxe;try{t(e)}finally{e.dispose()}}a(V$o,"disposeOnReturn");var PJe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(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),z3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&z3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableMap=PJe;var vjt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(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),z3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return z3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableSet=vjt;function W$o(t,e){let r=!1;return t.then(n=>{r||e(n)}),bjt(()=>{r=!0})}a(W$o,"thenIfNotDisposed");function z$o(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(z$o,"thenRegisterOrDispose");var Cjt=class extends PJe{static{a(this,"DisposableResourceMap")}constructor(){super(new Sbn.ResourceMap)}};hs.DisposableResourceMap=Cjt});var vue=I(DJe=>{"use strict";p();Object.defineProperty(DJe,"__esModule",{value:!0});DJe.LinkedList=void 0;var yu=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}},Sjt=class{static{a(this,"LinkedList")}constructor(){this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yu.Undefined}clear(){let e=this._first;for(;e!==yu.Undefined;){let r=e.next;e.prev=yu.Undefined,e.next=yu.Undefined,e=r}this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new yu(e);if(this._first===yu.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!==yu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==yu.Undefined)return this._last.element}_remove(e){if(e.prev!==yu.Undefined&&e.next!==yu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===yu.Undefined&&e.next===yu.Undefined?(this._first=yu.Undefined,this._last=yu.Undefined):e.next===yu.Undefined?(this._last=this._last.prev,this._last.next=yu.Undefined):e.prev===yu.Undefined&&(this._first=this._first.next,this._first.prev=yu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yu.Undefined;)yield e.element,e=e.next}};DJe.LinkedList=Sjt});var kbn=I(Cue=>{"use strict";p();Object.defineProperty(Cue,"__esModule",{value:!0});Cue.getNLSMessages=xbn;Cue.getNLSLanguage=wbn;Cue.localize=K$o;Cue.localize2=J$o;function xbn(){return globalThis._VSCODE_NLS_MESSAGES}a(xbn,"getNLSMessages");function wbn(){return globalThis._VSCODE_NLS_LANGUAGE}a(wbn,"getNLSLanguage");var Y$o=wbn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function NJe(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}),Y$o&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(NJe,"_format");function K$o(t,e,...r){return NJe(typeof t=="number"?Rbn(t,e):e,r)}a(K$o,"localize");function Rbn(t,e){let r=xbn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(Rbn,"lookupMessage");function J$o(t,e,...r){let n;typeof t=="number"?n=Rbn(t,e):n=e;let o=NJe(n,r);return{value:o,original:e===n?o:NJe(e,r)}}a(J$o,"localize2")});var Rq=I(pr=>{"use strict";p();var Z$o=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]})),X$o=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eVo=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,iwe=Y3.indexOf("Macintosh")>=0,xjt=(Y3.indexOf("Macintosh")>=0||Y3.indexOf("iPad")>=0||Y3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rwe=Y3.indexOf("Linux")>=0,Fbn=Y3?.indexOf("Mobi")>=0,Ijt=!0,MJe=tVo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,twe=navigator.language.toLowerCase(),Tjt=twe):console.error("Unable to resolve platform.");function nVo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(nVo,"PlatformToString");var OJe=0;iwe?OJe=1:nwe?OJe=3:rwe&&(OJe=2);pr.isWindows=nwe;pr.isMacintosh=iwe;pr.isLinux=rwe;pr.isLinuxSnap=Mbn;pr.isNative=Obn;pr.isElectron=Lbn;pr.isWeb=Ijt;pr.isWebWorker=Ijt&&typeof K3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?K3.origin:void 0;pr.isIOS=xjt;pr.isMobile=Fbn;pr.isCI=Bbn;pr.platform=OJe;pr.userAgent=Y3;pr.language=MJe;var Pbn;(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})(Pbn||(pr.Language=Pbn={}));pr.locale=twe;pr.platformLocale=Tjt;pr.translationsConfigFile=Ubn;pr.setTimeout0IsFaster=typeof K3.postMessage=="function"&&!K3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];K3.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}),K3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=iwe||xjt?2:nwe?1:3;var Dbn=!0,Nbn=!1;function iVo(){if(!Nbn){Nbn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Dbn=new Uint16Array(t.buffer)[0]===513}return Dbn}a(iVo,"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 oVo(t){return parseFloat(t)>=25}a(oVo,"isTahoeOrNewer")});var owe=I(BO=>{"use strict";p();Object.defineProperty(BO,"__esModule",{value:!0});BO.arch=BO.platform=BO.env=BO.cwd=void 0;var qbn=Rq(),ZK,wjt=globalThis.vscode;if(typeof wjt<"u"&&typeof wjt.process<"u"){let t=wjt.process;ZK={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"?ZK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:ZK={get platform(){return qbn.isWindows?"win32":qbn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};BO.cwd=ZK.cwd;BO.env=ZK.env;BO.platform=ZK.platform;BO.arch=ZK.arch});var FO=I(LJe=>{"use strict";p();Object.defineProperty(LJe,"__esModule",{value:!0});LJe.StopWatch=void 0;var sVo=globalThis.performance.now.bind(globalThis.performance),Rjt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:sVo,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}};LJe.StopWatch=Rjt});var Ic=I(Ga=>{"use strict";p();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.ValueWithChangeEvent=Ga.Relay=Ga.EventBufferer=Ga.DynamicListEventMultiplexer=Ga.EventMultiplexer=Ga.MicrotaskEmitter=Ga.DebounceEmitter=Ga.PauseableEmitter=Ga.AsyncEmitter=Ga.createEventDeliveryQueue=Ga.Emitter=Ga.ListenerRefusalError=Ga.ListenerLeakError=Ga.EventProfiling=Ga.Event=void 0;Ga.setGlobalLeakWarningThreshold=pVo;Ga.trackSetChanges=AVo;var aVo=Xqt(),swe=Rs(),cVo=tjt(),WC=Ro(),Vbn=vue(),lVo=owe(),uVo=FO(),jbn=!1,dVo=!1,fVo=100,Hbn=6e4;function Gbn(){return!!lVo.env.VSCODE_DEV}a(Gbn,"_isBufferLeakWarningEnabled");var BJe;(function(t){t.None=()=>WC.Disposable.None;function e(M){if(dVo){let{onDidAddListener:O}=M,j=Sue.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,j){return g(M,()=>{},0,void 0,O??!0,void 0,j)}a(r,"defer"),t.defer=r;function n(M){return(O,j=null,Q)=>{let U=!1,Y;return Y=M(W=>{if(!U)return Y?Y.dispose():U=!0,O.call(j,W)},null,Q),U&&Y.dispose(),Y}}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,j){return h((Q,U=null,Y)=>M(W=>Q.call(U,O(W)),null,Y),j)}a(s,"map"),t.map=s;function c(M,O,j){return h((Q,U=null,Y)=>M(W=>{O(W),Q.call(U,W)},null,Y),j)}a(c,"forEach"),t.forEach=c;function l(M,O,j){return h((Q,U=null,Y)=>M(W=>O(W)&&Q.call(U,W),null,Y),j)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,j=null,Q)=>{let U=(0,WC.combinedDisposable)(...M.map(Y=>Y(W=>O.call(j,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,j,Q){let U=j;return s(M,Y=>(U=O(U,Y),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let j,Q={onWillAddFirstListener(){j=M(U.fire,U)},onDidRemoveLastListener(){j?.dispose()}};O||e(Q);let U=new dE(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,j=100,Q=!1,U=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(ge=>{H++,z=O(z,ge),Q&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Ue=z;z=void 0,ie=void 0,(!Q||H>1)&&Le.fire(Ue),H=0},"doFire"),typeof j=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,j)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new dE(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,j,Q){return t.debounce(M,(U,Y)=>U?(U.push(Y),U):[Y],O,void 0,j??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,j=100,Q=!0,U=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=O(z,Le),ie===void 0&&(Q&&(le.fire(z),z=void 0,H=0),typeof j=="number"?ie=setTimeout(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},j):(ie=0,queueMicrotask(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new dE(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,j){let Q=!0,U;return l(M,Y=>{let W=Q||!O(Y,U);return Q=!1,U=Y,W},j)}a(E,"latch"),t.latch=E;function _(M,O,j){return[t.filter(M,O,j),t.filter(M,Q=>!O(Q),j)]}a(_,"split"),t.split=_;function v(M,O,j=!1,Q=[],U){let Y=Q.slice(),W;Gbn()&&(W={stack:Sue.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered for ${Hbn/1e3}s without being consumed. Buffered here:`),W.stack.print())},Hbn),warned:!1},U&&U.add((0,WC.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),Gbn()&&W&&!W.warned&&Y.length>=fVo&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new dE({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),U&&U.add(z))},onDidAddFirstListener(){Y&&(j?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,Y)=>{let W=O(new w);return M(function(V){let z=W.evaluate(V);z!==T&&Q.call(U,z)},void 0,Y)},"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(j=>(O(j),j)),this}filter(O){return this.steps.push(j=>O(j)?j:T),this}reduce(O,j){let Q=j;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(U=>{let Y=j||!O(U,Q);return j=!1,Q=U,Y?U:T}),this}evaluate(O){for(let j of this.steps)if(O=j(O),O===T)break;return O}}function R(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let j,Q,U=new Promise(Y=>{Q=n(M)(Y),Ujt(Q,O),j=a(()=>{$bn(Q,O)},"cancelRef")});return U.cancel=j,O&&U.finally(()=>$bn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(j=>O.fire(j))}a(D,"forward"),t.forward=D;function N(M,O,j){return O(j),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,j){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")};j||e(Q),this.emitter=new dE(Q),j&&j.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,j){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,j,Q)=>{let U=0,Y=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),Y&&(Y=!1,O.call(j)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return Ujt(V,Q),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(BJe||(Ga.Event=BJe={}));var FJe=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 uVo.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}}};Ga.EventProfiling=FJe;var awe=-1;function pVo(t){let e=awe;return awe=t,{dispose(){awe=e}}}a(pVo,"setGlobalLeakWarningThreshold");var kjt=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 cwe(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!==vue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==vue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function ZK(t){return JK?.trackDisposable(t),t}a(ZK,"trackDisposable");function XK(t){JK?.markAsDisposed(t)}a(XK,"markAsDisposed");function K3(t,e){JK?.setParent(t,e)}a(K3,"setParentOfDisposable");function rVo(t,e){if(JK)for(let r of t)JK.setParent(r,e)}a(rVo,"setParentOfDisposables");function nVo(t){return JK?.markAsSingleton(t),t}a(nVo,"markAsSingleton");function Pbn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(Pbn,"isDisposable");function nwe(t){if(eVo.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(nwe,"dispose");function iVo(t){for(let e of t)Pbn(e)&&e.dispose();return[]}a(iVo,"disposeIfDisposable");function oVo(...t){let e=xjt(()=>nwe(t));return rVo(t,e),e}a(oVo,"combinedDisposable");var Ejt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,ZK(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,XK(this),this._fn()}}};function xjt(t){return new Ejt(t)}a(xjt,"toDisposable");var rwe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,ZK(this)}dispose(){this._isDisposed||(XK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{nwe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===vue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return K3(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)&&K3(e,null)}assertNotDisposed(){this._isDisposed&&(0,wbn.onUnexpectedError)(new wbn.BugIndicatingError("Object disposed"))}};hs.DisposableStore=rwe;var vue=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new rwe,ZK(this),K3(this._store,this)}dispose(){XK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};hs.Disposable=vue;var LJe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,ZK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&K3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,XK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&K3(e,null),e}};hs.MutableDisposable=LJe;var _jt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new LJe,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()}};hs.MandatoryMutableDisposable=_jt;var vjt=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}};hs.RefCountedDisposable=vjt;var Cjt=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,X$o.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};hs.ReferenceCollection=Cjt;var bjt=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}}};hs.AsyncReferenceCollection=bjt;var Sjt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};hs.ImmortalReference=Sjt;function sVo(t){let e=new rwe;try{t(e)}finally{e.dispose()}}a(sVo,"disposeOnReturn");var BJe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,ZK(this)}dispose(){XK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{nwe(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),K3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&K3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableMap=BJe;var Tjt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,ZK(this)}dispose(){XK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{nwe(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),K3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return K3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableSet=Tjt;function aVo(t,e){let r=!1;return t.then(n=>{r||e(n)}),xjt(()=>{r=!0})}a(aVo,"thenIfNotDisposed");function cVo(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(cVo,"thenRegisterOrDispose");var Ijt=class extends BJe{static{a(this,"DisposableResourceMap")}constructor(){super(new Rbn.ResourceMap)}};hs.DisposableResourceMap=Ijt});var Cue=I(FJe=>{"use strict";p();Object.defineProperty(FJe,"__esModule",{value:!0});FJe.LinkedList=void 0;var yu=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}},wjt=class{static{a(this,"LinkedList")}constructor(){this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yu.Undefined}clear(){let e=this._first;for(;e!==yu.Undefined;){let r=e.next;e.prev=yu.Undefined,e.next=yu.Undefined,e=r}this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new yu(e);if(this._first===yu.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!==yu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==yu.Undefined)return this._last.element}_remove(e){if(e.prev!==yu.Undefined&&e.next!==yu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===yu.Undefined&&e.next===yu.Undefined?(this._first=yu.Undefined,this._last=yu.Undefined):e.next===yu.Undefined?(this._last=this._last.prev,this._last.next=yu.Undefined):e.prev===yu.Undefined&&(this._first=this._first.next,this._first.prev=yu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yu.Undefined;)yield e.element,e=e.next}};FJe.LinkedList=wjt});var Obn=I(bue=>{"use strict";p();Object.defineProperty(bue,"__esModule",{value:!0});bue.getNLSMessages=Dbn;bue.getNLSLanguage=Nbn;bue.localize=uVo;bue.localize2=dVo;function Dbn(){return globalThis._VSCODE_NLS_MESSAGES}a(Dbn,"getNLSMessages");function Nbn(){return globalThis._VSCODE_NLS_LANGUAGE}a(Nbn,"getNLSLanguage");var lVo=Nbn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function UJe(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}),lVo&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(UJe,"_format");function uVo(t,e,...r){return UJe(typeof t=="number"?Mbn(t,e):e,r)}a(uVo,"localize");function Mbn(t,e){let r=Dbn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(Mbn,"lookupMessage");function dVo(t,e,...r){let n;typeof t=="number"?n=Mbn(t,e):n=e;let o=UJe(n,r);return{value:o,original:e===n?o:UJe(e,r)}}a(dVo,"localize2")});var Dq=I(pr=>{"use strict";p();var fVo=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]})),pVo=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hVo=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,awe=J3.indexOf("Macintosh")>=0,Pjt=(J3.indexOf("Macintosh")>=0||J3.indexOf("iPad")>=0||J3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,owe=J3.indexOf("Linux")>=0,Hbn=J3?.indexOf("Mobi")>=0,kjt=!0,QJe=mVo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,iwe=navigator.language.toLowerCase(),Rjt=iwe):console.error("Unable to resolve platform.");function AVo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(AVo,"PlatformToString");var qJe=0;awe?qJe=1:swe?qJe=3:owe&&(qJe=2);pr.isWindows=swe;pr.isMacintosh=awe;pr.isLinux=owe;pr.isLinuxSnap=Ubn;pr.isNative=Qbn;pr.isElectron=qbn;pr.isWeb=kjt;pr.isWebWorker=kjt&&typeof Z3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?Z3.origin:void 0;pr.isIOS=Pjt;pr.isMobile=Hbn;pr.isCI=jbn;pr.platform=qJe;pr.userAgent=J3;pr.language=QJe;var Lbn;(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})(Lbn||(pr.Language=Lbn={}));pr.locale=iwe;pr.platformLocale=Rjt;pr.translationsConfigFile=Gbn;pr.setTimeout0IsFaster=typeof Z3.postMessage=="function"&&!Z3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];Z3.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}),Z3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=awe||Pjt?2:swe?1:3;var Bbn=!0,Fbn=!1;function yVo(){if(!Fbn){Fbn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Bbn=new Uint16Array(t.buffer)[0]===513}return Bbn}a(yVo,"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 EVo(t){return parseFloat(t)>=25}a(EVo,"isTahoeOrNewer")});var cwe=I(UO=>{"use strict";p();Object.defineProperty(UO,"__esModule",{value:!0});UO.arch=UO.platform=UO.env=UO.cwd=void 0;var Vbn=Dq(),eJ,Djt=globalThis.vscode;if(typeof Djt<"u"&&typeof Djt.process<"u"){let t=Djt.process;eJ={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"?eJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:eJ={get platform(){return Vbn.isWindows?"win32":Vbn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};UO.cwd=eJ.cwd;UO.env=eJ.env;UO.platform=eJ.platform;UO.arch=eJ.arch});var QO=I(jJe=>{"use strict";p();Object.defineProperty(jJe,"__esModule",{value:!0});jJe.StopWatch=void 0;var _Vo=globalThis.performance.now.bind(globalThis.performance),Njt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:_Vo,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}};jJe.StopWatch=Njt});var Ic=I($a=>{"use strict";p();Object.defineProperty($a,"__esModule",{value:!0});$a.ValueWithChangeEvent=$a.Relay=$a.EventBufferer=$a.DynamicListEventMultiplexer=$a.EventMultiplexer=$a.MicrotaskEmitter=$a.DebounceEmitter=$a.PauseableEmitter=$a.AsyncEmitter=$a.createEventDeliveryQueue=$a.Emitter=$a.ListenerRefusalError=$a.ListenerLeakError=$a.EventProfiling=$a.Event=void 0;$a.setGlobalLeakWarningThreshold=xVo;$a.trackSetChanges=PVo;var vVo=njt(),lwe=Rs(),CVo=ojt(),WC=ko(),Jbn=Cue(),bVo=cwe(),SVo=QO(),Wbn=!1,TVo=!1,IVo=100,zbn=6e4;function Ybn(){return!!bVo.env.VSCODE_DEV}a(Ybn,"_isBufferLeakWarningEnabled");var HJe;(function(t){t.None=()=>WC.Disposable.None;function e(M){if(TVo){let{onDidAddListener:O}=M,j=Tue.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,j){return g(M,()=>{},0,void 0,O??!0,void 0,j)}a(r,"defer"),t.defer=r;function n(M){return(O,j=null,Q)=>{let U=!1,Y;return Y=M(W=>{if(!U)return Y?Y.dispose():U=!0,O.call(j,W)},null,Q),U&&Y.dispose(),Y}}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,j){return h((Q,U=null,Y)=>M(W=>Q.call(U,O(W)),null,Y),j)}a(s,"map"),t.map=s;function c(M,O,j){return h((Q,U=null,Y)=>M(W=>{O(W),Q.call(U,W)},null,Y),j)}a(c,"forEach"),t.forEach=c;function l(M,O,j){return h((Q,U=null,Y)=>M(W=>O(W)&&Q.call(U,W),null,Y),j)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,j=null,Q)=>{let U=(0,WC.combinedDisposable)(...M.map(Y=>Y(W=>O.call(j,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,j,Q){let U=j;return s(M,Y=>(U=O(U,Y),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let j,Q={onWillAddFirstListener(){j=M(U.fire,U)},onDidRemoveLastListener(){j?.dispose()}};O||e(Q);let U=new fE(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,j=100,Q=!1,U=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(ge=>{H++,z=O(z,ge),Q&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Ue=z;z=void 0,ie=void 0,(!Q||H>1)&&Le.fire(Ue),H=0},"doFire"),typeof j=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,j)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new fE(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,j,Q){return t.debounce(M,(U,Y)=>U?(U.push(Y),U):[Y],O,void 0,j??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,j=100,Q=!0,U=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=O(z,Le),ie===void 0&&(Q&&(le.fire(z),z=void 0,H=0),typeof j=="number"?ie=setTimeout(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},j):(ie=0,queueMicrotask(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new fE(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,j){let Q=!0,U;return l(M,Y=>{let W=Q||!O(Y,U);return Q=!1,U=Y,W},j)}a(E,"latch"),t.latch=E;function _(M,O,j){return[t.filter(M,O,j),t.filter(M,Q=>!O(Q),j)]}a(_,"split"),t.split=_;function v(M,O,j=!1,Q=[],U){let Y=Q.slice(),W;Ybn()&&(W={stack:Tue.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered for ${zbn/1e3}s without being consumed. Buffered here:`),W.stack.print())},zbn),warned:!1},U&&U.add((0,WC.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),Ybn()&&W&&!W.warned&&Y.length>=IVo&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new fE({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),U&&U.add(z))},onDidAddFirstListener(){Y&&(j?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,Y)=>{let W=O(new w);return M(function(V){let z=W.evaluate(V);z!==T&&Q.call(U,z)},void 0,Y)},"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(j=>(O(j),j)),this}filter(O){return this.steps.push(j=>O(j)?j:T),this}reduce(O,j){let Q=j;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(U=>{let Y=j||!O(U,Q);return j=!1,Q=U,Y?U:T}),this}evaluate(O){for(let j of this.steps)if(O=j(O),O===T)break;return O}}function R(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new fE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new fE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let j,Q,U=new Promise(Y=>{Q=n(M)(Y),Hjt(Q,O),j=a(()=>{Kbn(Q,O)},"cancelRef")});return U.cancel=j,O&&U.finally(()=>Kbn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(j=>O.fire(j))}a(D,"forward"),t.forward=D;function N(M,O,j){return O(j),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,j){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")};j||e(Q),this.emitter=new fE(Q),j&&j.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,j){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,j,Q)=>{let U=0,Y=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),Y&&(Y=!1,O.call(j)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return Hjt(V,Q),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(HJe||($a.Event=HJe={}));var GJe=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 SVo.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}}};$a.EventProfiling=GJe;var uwe=-1;function xVo(t){let e=uwe;return uwe=t,{dispose(){uwe=e}}}a(xVo,"setGlobalLeakWarningThreshold");var Mjt=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 dwe(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 bue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new kjt(e?.onListenerError??swe.onUnexpectedError,this._options?.leakWarningThreshold??awe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new FJe(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(jbn){let e=this._listeners;queueMicrotask(()=>{Wbn(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 UJe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||swe.onUnexpectedError)(h),WC.Disposable.None}if(this._disposed)return WC.Disposable.None;r&&(e=e.bind(r));let o=new bue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Sue.create(),s=this._leakageMon.check(o.stack,this._size+1)),jbn&&(o.stack=c??Sue.create()),this._listeners?this._listeners instanceof bue?(this._deliveryQueue??=new QJe,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,WC.toDisposable)(()=>{s?.(),this._removeListener(o)});return Ujt(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*mVo<=r.length){let s=0;for(let c=0;c0}};Ga.Emitter=dE;var gVo=a(()=>new QJe,"createEventDeliveryQueue");Ga.createEventDeliveryQueue=gVo;var QJe=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}},Pjt=class extends dE{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Vbn.LinkedList),Wbn(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,swe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,swe.onUnexpectedError)(d.reason)})}}};Ga.AsyncEmitter=Pjt;var qJe=class extends dE{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Vbn.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))}};Ga.PauseableEmitter=qJe;var Djt=class extends qJe{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)}};Ga.DebounceEmitter=Djt;var Njt=class extends dE{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=[]}))}};Ga.MicrotaskEmitter=Njt;var jJe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new dE({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,WC.toDisposable)((0,cVo.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=[]}};Ga.EventMultiplexer=jJe;var Mjt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new WC.DisposableStore;let s=this._store.add(new jJe),c=this._store.add(new WC.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()}};Ga.DynamicListEventMultiplexer=Mjt;var Ojt=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}};Ga.EventBufferer=Ojt;var Ljt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=BJe.None,this.inputEventListener=WC.Disposable.None,this.emitter=new dE({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()}};Ga.Relay=Ljt;var Bjt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new Fjt(e)}constructor(e){this._value=e,this._onDidChange=new dE,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Ga.ValueWithChangeEvent=Bjt;var Fjt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=BJe.None}};function AVo(t,e,r){let n=new WC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new WC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,aVo.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(AVo,"trackSetChanges");function Ujt(t,e){e instanceof WC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(Ujt,"addToDisposables");function $bn(t,e){if(e instanceof WC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a($bn,"disposeAndRemove")});var YP=I(J3=>{"use strict";p();Object.defineProperty(J3,"__esModule",{value:!0});J3.CancellationTokenPool=J3.CancellationTokenSource=J3.CancellationToken=void 0;J3.cancelOnDispose=EVo;var zbn=Ic(),yVo=Ro(),Ybn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),HJe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Tue?!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:zbn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ybn})})(HJe||(J3.CancellationToken=HJe={}));var Tue=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?Ybn:(this._emitter||(this._emitter=new zbn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},lwe=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 Tue),this._token}cancel(){this._token?this._token instanceof Tue&&this._token.cancel():this._token=HJe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Tue&&this._token.dispose():this._token=HJe.None}};J3.CancellationTokenSource=lwe;function EVo(t){let e=new lwe;return t.add({dispose(){e.cancel()}}),e.token}a(EVo,"cancelOnDispose");var Qjt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new lwe,this._listeners=new yVo.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()}};J3.CancellationTokenPool=Qjt});var NA=I(Jr=>{"use strict";p();var _Vo=Jr&&Jr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vVo=Jr&&Jr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CVo=Jr&&Jr.__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=bVo&&t<=TVo||t>=SVo&&t<=IVo}a(X3,"isWindowsDeviceRoot");function $Je(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===XK&&l!==-1?++l:l=-1}return o}a($Je,"normalizeString");function RVo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(RVo,"formatExt");function Kbn(t,e){wVo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${RVo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Kbn,"_format");Jr.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],cp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Iue.cwd():(s=Iue.env[`=${e}`]||Iue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===zC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Ko(f)&&(l=1,d=!0);else if(Ko(f))if(d=!0,Ko(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Ko(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=$Je(r,!n,"\\",Ko),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return qjt(s)?"\\":t;if(Ko(s))if(o=!0,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Ko(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&X3(c.charCodeAt(0))&&c.charCodeAt(1)===Z3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Ko(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){cp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Ko(r)||e>2&&X3(r)&&t.charCodeAt(1)===Z3&&Ko(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"&&Ko(r.charCodeAt(0))){++o;let s=r.length;s>1&&Ko(r.charCodeAt(1))&&(++o,s>2&&(Ko(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Jr.win32.normalize(e)},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e)return"";let r=Jr.win32.resolve(t),n=Jr.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)===zC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===zC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===zC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===zC?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)===zC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===zC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Jr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===zC){if(e.charCodeAt(1)===zC){let r=e.charCodeAt(2);if(r!==xVo&&r!==XK)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(X3(e.charCodeAt(0))&&e.charCodeAt(1)===Z3&&e.charCodeAt(2)===zC)return`\\\\?\\${e}`;return e},dirname(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Ko(o)?t:".";if(Ko(o)){if(r=n=1,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Ko(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&&cp(e,"suffix"),cp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&X3(t.charCodeAt(0))&&t.charCodeAt(1)===Z3&&(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(Ko(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(Ko(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){cp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Z3&&X3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Ko(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===XK?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:Kbn.bind(null,"\\"),parse(t){cp(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 Ko(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Ko(o)){if(n=1,Ko(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),Ko(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===XK?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 kVo=(()=>{if(YC){let t=/\\/g;return()=>{let e=Iue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Iue.cwd()})();Jr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];cp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===_g)}if(!r){let n=kVo();e=`${n}/${e}`,r=n.charCodeAt(0)===_g}return e=$Je(e,!r,"/",qjt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=t.charCodeAt(t.length-1)===_g;return t=$Je(t,!e,"/",qjt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return cp(t,"path"),t.length>0&&t.charCodeAt(0)===_g},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Jr.posix.normalize(e.join("/"))},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e||(t=Jr.posix.resolve(t),e=Jr.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)===_g)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===_g?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===_g)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===_g){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&&cp(e,"suffix"),cp(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===_g){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)===_g){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(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:Kbn.bind(null,"/"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===_g,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===_g){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===XK?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};Jr.posix.win32=Jr.win32.win32=Jr.win32;Jr.posix.posix=Jr.win32.posix=Jr.posix;Jr.normalize=YC?Jr.win32.normalize:Jr.posix.normalize;Jr.isAbsolute=YC?Jr.win32.isAbsolute:Jr.posix.isAbsolute;Jr.join=YC?Jr.win32.join:Jr.posix.join;Jr.resolve=YC?Jr.win32.resolve:Jr.posix.resolve;Jr.relative=YC?Jr.win32.relative:Jr.posix.relative;Jr.dirname=YC?Jr.win32.dirname:Jr.posix.dirname;Jr.basename=YC?Jr.win32.basename:Jr.posix.basename;Jr.extname=YC?Jr.win32.extname:Jr.posix.extname;Jr.format=YC?Jr.win32.format:Jr.posix.format;Jr.parse=YC?Jr.win32.parse:Jr.posix.parse;Jr.toNamespacedPath=YC?Jr.win32.toNamespacedPath:Jr.posix.toNamespacedPath;Jr.sep=YC?Jr.win32.sep:Jr.posix.sep;Jr.delimiter=YC?Jr.win32.delimiter:Jr.posix.delimiter});var WJe=I(KP=>{"use strict";p();Object.defineProperty(KP,"__esModule",{value:!0});KP.WeakCachedFunction=KP.CachedFunction=KP.LRUCachedFunction=KP.Cache=void 0;KP.identity=VJe;var PVo=YP(),jjt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new PVo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};KP.Cache=jjt;function VJe(t){return t}a(VJe,"identity");var Hjt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(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}};KP.LRUCachedFunction=Hjt;var Gjt=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=VJe):(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}};KP.CachedFunction=Gjt;var $jt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(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}};KP.WeakCachedFunction=$jt});var eF=I(zJe=>{"use strict";p();Object.defineProperty(zJe,"__esModule",{value:!0});zJe.Lazy=void 0;var kq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(kq||(kq={}));var Vjt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=kq.Uninitialized}get hasValue(){return this._state===kq.Completed}get value(){if(this._state===kq.Uninitialized){this._state=kq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=kq.Completed}}else if(this._state===kq.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}};zJe.Lazy=Vjt});var em=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.Ellipsis=kr.InvisibleCharacters=kr.AmbiguousCharacters=kr.noBreakWhitespace=kr.UTF8_BOM_CHARACTER=kr.UNUSUAL_LINE_TERMINATORS=kr.GraphemeIterator=kr.CodePointIterator=void 0;kr.isFalsyOrWhitespace=NVo;kr.format=OVo;kr.format2=BVo;kr.htmlAttributeEncodeValue=FVo;kr.escape=UVo;kr.escapeRegExpCharacters=Xbn;kr.count=QVo;kr.truncate=qVo;kr.truncateMiddle=jVo;kr.trim=HVo;kr.ltrim=e1n;kr.rtrim=t1n;kr.convertSimple2RegExpPattern=GVo;kr.createRegExp=$Vo;kr.regExpLeadsToEndlessLoop=VVo;kr.joinStrings=WVo;kr.splitLines=zVo;kr.splitLinesIncludeSeparators=YVo;kr.indexOfPattern=KVo;kr.firstNonWhitespaceIndex=r1n;kr.getLeadingWhitespace=JVo;kr.lastNonWhitespaceIndex=ZVo;kr.getIndentationLength=XVo;kr.replaceAsync=eWo;kr.compare=tWo;kr.compareSubstring=n1n;kr.compareIgnoreCase=rWo;kr.compareSubstringIgnoreCase=dwe;kr.isAsciiDigit=nWo;kr.isLowerAsciiLetter=zjt;kr.isUpperAsciiLetter=iWo;kr.equalsIgnoreCase=i1n;kr.equals=oWo;kr.startsWithIgnoreCase=sWo;kr.endsWithIgnoreCase=aWo;kr.commonPrefixLength=cWo;kr.commonSuffixLength=lWo;kr.isHighSurrogate=Jjt;kr.isLowSurrogate=YJe;kr.computeCodePoint=Zjt;kr.getNextCodePoint=o1n;kr.nextCharLength=s1n;kr.prevCharLength=a1n;kr.getCharContainingOffset=dWo;kr.charCount=fWo;kr.containsRTL=hWo;kr.isBasicASCII=gWo;kr.containsUnusualLineTerminators=AWo;kr.isFullWidthCharacter=yWo;kr.isEmojiImprecise=c1n;kr.lcut=EWo;kr.rcut=_Wo;kr.forAnsiStringParts=SWo;kr.removeAnsiEscapeCodes=u1n;kr.removeAnsiEscapeCodesFromPrompt=IWo;kr.startsWithUTF8BOM=d1n;kr.stripUTF8BOM=xWo;kr.fuzzyContains=wWo;kr.containsUppercaseCharacter=RWo;kr.uppercaseFirstLetter=kWo;kr.getNLines=PWo;kr.singleLetterHash=DWo;kr.getGraphemeBreakType=NWo;kr.getLeftDeleteOffset=OWo;kr.multibyteAwareBtoa=UWo;var DVo=WJe(),Jbn=eF();function NVo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(NVo,"isFalsyOrWhitespace");var MVo=/{(\d+)}/g;function OVo(t,...e){return e.length===0?t:t.replace(MVo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(OVo,"format");var LVo=/{([^}]+)}/g;function BVo(t,e){return Object.keys(e).length===0?t:t.replace(LVo,(r,n)=>e[n]??r)}a(BVo,"format2");function FVo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(FVo,"htmlAttributeEncodeValue");function UVo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(UVo,"escape");function Xbn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Xbn,"escapeRegExpCharacters");function QVo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(QVo,"count");function qVo(t,e,r=kr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(qVo,"truncate");function jVo(t,e,r=kr.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(jVo,"truncateMiddle");function HVo(t,e=" "){let r=e1n(t,e);return t1n(r,e)}a(HVo,"trim");function e1n(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(t1n,"rtrim");function GVo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(GVo,"convertSimple2RegExpPattern");function $Vo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Xbn(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($Vo,"createRegExp");function VVo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(VVo,"regExpLeadsToEndlessLoop");function WVo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(WVo,"joinStrings");function zVo(t){return t.split(/\r\n|\r|\n/)}a(zVo,"splitLines");function YVo(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(ZVo,"lastNonWhitespaceIndex");function XVo(t){let e=r1n(t);return e===-1?t.length:e}a(XVo,"getIndentationLength");function eWo(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(eWo,"replaceAsync");function tWo(t,e){return te?1:0}a(tWo,"compare");function n1n(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(n1n,"compareSubstring");function rWo(t,e){return dwe(t,e,0,t.length,0,e.length)}a(rWo,"compareIgnoreCase");function dwe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return n1n(t.toLowerCase(),e.toLowerCase(),r,n,o,s);zjt(u)&&(u-=32),zjt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(dwe,"compareSubstringIgnoreCase");function nWo(t){return t>=48&&t<=57}a(nWo,"isAsciiDigit");function zjt(t){return t>=97&&t<=122}a(zjt,"isLowerAsciiLetter");function iWo(t){return t>=65&&t<=90}a(iWo,"isUpperAsciiLetter");function i1n(t,e){return t.length===e.length&&dwe(t,e)===0}a(i1n,"equalsIgnoreCase");function oWo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&i1n(t,e)}a(oWo,"equals");function sWo(t,e){let r=e.length;return r<=t.length&&dwe(t,e,0,r)===0}a(sWo,"startsWithIgnoreCase");function aWo(t,e){let r=t.length,n=r-e.length;return n>=0&&dwe(t,e,n,r)===0}a(aWo,"endsWithIgnoreCase");function cWo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(Jjt(n))return Zjt(n,r)}return r}a(uWo,"getPrevCodePoint");var xue=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=uWo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=o1n(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};kr.CodePointIterator=xue;var wue=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new xue(e,r)}nextGraphemeLength(){let e=uwe.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(Zbn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=uwe.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(Zbn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};kr.GraphemeIterator=wue;function s1n(t,e){return new wue(t,e).nextGraphemeLength()}a(s1n,"nextCharLength");function a1n(t,e){return new wue(t,e).prevGraphemeLength()}a(a1n,"prevCharLength");function dWo(t,e){e>0&&YJe(t.charCodeAt(e))&&e--;let r=e+s1n(t,e);return[r-a1n(t,r),r]}a(dWo,"getCharContainingOffset");function fWo(t){let e=new wue(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(fWo,"charCount");var Wjt;function pWo(){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(pWo,"makeContainsRtl");function hWo(t){return Wjt||(Wjt=pWo()),Wjt.test(t)}a(hWo,"containsRTL");var mWo=/^[\t\n\r\x20-\x7E]*$/;function gWo(t){return mWo.test(t)}a(gWo,"isBasicASCII");kr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function AWo(t){return kr.UNUSUAL_LINE_TERMINATORS.test(t)}a(AWo,"containsUnusualLineTerminators");function yWo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(yWo,"isFullWidthCharacter");function c1n(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(c1n,"isEmojiImprecise");function EWo(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@^`{}|~]/,CWo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,bWo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,l1n=new RegExp("(?:"+[vWo.source,CWo.source,bWo.source].join("|")+")","g");function*SWo(t){let e=0;for(let r of t.matchAll(l1n))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(SWo,"forAnsiStringParts");function u1n(t){return t&&(t=t.replace(l1n,"")),t}a(u1n,"removeAnsiEscapeCodes");var TWo=/\\\[.*?\\\]/g;function IWo(t){return u1n(t).replace(TWo,"")}a(IWo,"removeAnsiEscapeCodesFromPrompt");kr.UTF8_BOM_CHARACTER="\uFEFF";function d1n(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(d1n,"startsWithUTF8BOM");function xWo(t){return d1n(t)?t.substr(1):t}a(xWo,"stripUTF8BOM");function wWo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(PWo,"getNLines");function DWo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(DWo,"singleLetterHash");function NWo(t){return uwe.getInstance().getGraphemeBreakType(t)}a(NWo,"getGraphemeBreakType");function Zbn(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(Zbn,"breakBetweenGraphemeBreakType");var uwe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=MWo()}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 MWo(){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(MWo,"getGraphemeBreakRawData");function OWo(t,e){if(t===0)return 0;let r=LWo(t,e);if(r!==void 0)return r;let n=new xue(e,t);return n.prevCodePoint(),n.offset}a(OWo,"getLeftDeleteOffset");function LWo(t,e){let r=new xue(e,t),n=r.prevCodePoint();for(;BWo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!c1n(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(LWo,"getOffsetBeforeLastEmojiComponent");function BWo(t){return 127995<=t&&t<=127999}a(BWo,"isEmojiModifier");kr.noBreakWhitespace="\xA0";var Yjt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Jbn.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 DVo.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 Jbn.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(d0,"__esModule",{value:!0});d0.isPathSeparator=tF;d0.toSlashes=f1n;d0.toPosixPath=qWo;d0.getRoot=jWo;d0.isUNC=HWo;d0.isValidBasename=WWo;d0.isEqual=zWo;d0.isEqualOrParent=YWo;d0.isWindowsDriveLetter=Xjt;d0.sanitizeFilePath=KWo;d0.removeTrailingPathSeparator=p1n;d0.isRootOrDriveLetter=JWo;d0.hasDriveLetter=eHt;d0.getDriveLetter=ZWo;d0.indexOfPath=XWo;d0.parseLineAndColumnAware=ezo;d0.randomPath=nzo;var u0=NA(),Pq=Rq(),KJe=em(),QWo=KS();function tF(t){return t===47||t===92}a(tF,"isPathSeparator");function f1n(t){return t.replace(/[\\/]/g,u0.posix.sep)}a(f1n,"toSlashes");function qWo(t){return t.indexOf("/")===-1&&(t=f1n(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(qWo,"toPosixPath");function jWo(t,e=u0.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(tF(n)){if(tF(t.charCodeAt(1))&&!tF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,$Wo=/[/]/g,VWo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function WWo(t,e=Pq.isWindows){let r=e?GWo:$Wo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&VWo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(WWo,"isValidBasename");function zWo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,KJe.equalsIgnoreCase)(t,e)}a(zWo,"isEqual");function YWo(t,e,r,n=!1){let o=n?u0.posix.sep:u0.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?u0.posix.normalize(t):(0,u0.normalize)(t),e=n?u0.posix.normalize(e):(0,u0.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,KJe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let c=e.length;return e.charAt(e.length-1)===o&&c--,t.charAt(c)===o}return e.charAt(e.length-1)!==o&&(e+=o),t.indexOf(e)===0}a(YWo,"isEqualOrParent");function Xjt(t){return t>=65&&t<=90||t>=97&&t<=122}a(Xjt,"isWindowsDriveLetter");function KWo(t,e){return Pq.isWindows&&t.endsWith(":")&&(t+=u0.sep),(0,u0.isAbsolute)(t)||(t=(0,u0.join)(e,t)),t=(0,u0.normalize)(t),p1n(t)}a(KWo,"sanitizeFilePath");function p1n(t){return Pq.isWindows?(t=(0,KJe.rtrim)(t,u0.sep),t.endsWith(":")&&(t+=u0.sep)):(t=(0,KJe.rtrim)(t,u0.sep),t||(t=u0.sep)),t}a(p1n,"removeTrailingPathSeparator");function JWo(t){let e=(0,u0.normalize)(t);return Pq.isWindows?t.length>3?!1:eHt(e)&&(t.length===2||e.charCodeAt(2)===92):e===u0.posix.sep}a(JWo,"isRootOrDriveLetter");function eHt(t,e=Pq.isWindows){return e?Xjt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(eHt,"hasDriveLetter");function ZWo(t,e=Pq.isWindows){return eHt(t,e)?t[0]:void 0}a(ZWo,"getDriveLetter");function XWo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(XWo,"indexOfPath");function ezo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,QWo.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(ezo,"parseLineAndColumnAware");var tzo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rzo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function nzo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var izo=iw&&iw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ozo=iw&&iw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),szo=iw&&iw.__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(!czo.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(lzo.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(uzo,"_validateUri");function dzo(t,e){return!t&&!e?"file":t}a(dzo,"_schemeFix");function fzo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==JP&&(e=JP+e):e=JP;break}return e}a(fzo,"_referenceResolution");var Gl="",JP="/",pzo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,XJe=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||Gl,this.authority=e.authority||Gl,this.path=e.path||Gl,this.query=e.query||Gl,this.fragment=e.fragment||Gl):(this.scheme=dzo(e,c),this.authority=r||Gl,this.path=fzo(this.scheme,n||Gl),this.query=o||Gl,this.fragment=s||Gl,uzo(this,c))}get fsPath(){return eZe(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=Gl),n===void 0?n=this.authority:n===null&&(n=Gl),o===void 0?o=this.path:o===null&&(o=Gl),s===void 0?s=this.query:s===null&&(s=Gl),c===void 0?c=this.fragment:c===null&&(c=Gl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Dq(r,n,o,s,c)}static parse(e,r=!1){let n=pzo.exec(e);return n?new Dq(n[2]||Gl,JJe(n[4]||Gl),JJe(n[5]||Gl),JJe(n[7]||Gl),JJe(n[9]||Gl),r):new Dq(Gl,Gl,Gl,Gl,Gl)}static file(e){let r=Gl;if(ZJe.isWindows&&(e=e.replace(/\\/g,JP)),e[0]===JP&&e[1]===JP){let n=e.indexOf(JP,2);n===-1?(r=e.substring(2),e=JP):(r=e.substring(2,n),e=e.substring(n)||JP)}return new Dq("file",r,e,Gl,Gl)}static from(e,r){return new Dq(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 ZJe.isWindows&&e.scheme==="file"?n=t.file(h1n.win32.join(eZe(e,!0),...r)).path:n=h1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return rHt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Dq(e);return r._formatted=e.external??null,r._fsPath=e._sep===A1n?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};iw.URI=XJe;function hzo(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(hzo,"isUriComponents");var A1n=ZJe.isWindows?1:void 0,Dq=class extends XJe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=eZe(this,!1)),this._fsPath}toString(e=!1){return e?rHt(this,!0):(this._formatted||(this._formatted=rHt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=A1n),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}},y1n={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 m1n(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=y1n[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(m1n,"encodeURIComponentFast");function mzo(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,ZJe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(eZe,"uriToFsPath");function rHt(t,e){let r=e?mzo:m1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=JP,n+=JP),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:m1n(u,!1,!1)),n}a(rHt,"_asFormatted");function E1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+E1n(t.substr(3)):t}}a(E1n,"decodeURIComponentGraceful");var g1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function JJe(t){return t.match(g1n)?t.replace(g1n,e=>E1n(e)):t}a(JJe,"percentDecode")});var tJ=I(ms=>{"use strict";p();var gzo=ms&&ms.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Azo=ms&&ms.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aHt=ms&&ms.__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;oC1n(t,r))}a(Ezo,"matchesSomeScheme");ms.connectionTokenCookieName="vscode-tkn";ms.connectionTokenQueryName="tkn";var oHt=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=iHt.posix.join(r??"/",b1n(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return iHt.posix.join(this._serverRootPath,UO.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 yzo.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+=`&${ms.connectionTokenQueryName}=${encodeURIComponent(s)}`),eJ.URI.from({scheme:nHt.isWeb?this._preferredWebSchema:UO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ms.RemoteAuthorities=new oHt;function b1n(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(b1n,"getServerProductSegment");ms.builtinExtensionsPath="vs/../../extensions";ms.nodeModulesPath="vs/../../node_modules";ms.nodeModulesAsarPath="vs/../../node_modules.asar";ms.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ms.VSCODE_AUTHORITY="vscode-app";var sHt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ms.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===UO.vscodeRemote?ms.RemoteAuthorities.rewrite(e):e.scheme===UO.file&&(nHt.isNative||nHt.webWorkerOrigin===`${UO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:UO.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===UO.vscodeFileResource?e.with({scheme:UO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(eJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return eJ.URI.joinPath(eJ.URI.parse(r,!0),e);let n=iHt.join(r,e);return eJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ms.FileAccess=new sHt;ms.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ms.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var v1n;(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:eJ.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})(v1n||(ms.COI=v1n={}))});var ZP=I(yr=>{"use strict";p();var _zo=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]})),vzo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I1n=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;oRue.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,yr.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===Nq.Schemas.file){let o=QO(e);n=o!==void 0&&o.length===Rue.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=kue;yr.extUri=new kue(()=>!1);yr.extUriBiasedIgnorePathCase=new kue(t=>t.scheme===Nq.Schemas.file?!x1n.isLinux:!0);yr.extUriIgnorePathCase=new kue(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 Czo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(Czo,"distinctParents");var T1n;(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})(T1n||(yr.DataUri=T1n={}));function bzo(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(bzo,"toLocalResource")});var w1n=I(tZe=>{"use strict";p();Object.defineProperty(tZe,"__esModule",{value:!0});tZe.MicrotaskDelay=void 0;tZe.MicrotaskDelay=Symbol("MicrotaskDelay")});var nl=I(Kt=>{"use strict";p();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.AsyncReader=Kt.AsyncReaderEndOfStream=Kt.CancelableAsyncIterableProducer=Kt.AsyncIterableProducer=Kt.AsyncIterableSource=Kt.AsyncIterableObject=Kt.LazyStatefulPromise=Kt.StatefulPromise=Kt.Promises=Kt.DeferredPromise=Kt.IntervalCounter=Kt.TaskSequentializer=Kt.GlobalIdleValue=Kt.AbstractIdleValue=Kt._runWhenIdle=Kt.runWhenGlobalIdle=Kt.ThrottledWorker=Kt.RunOnceWorker=Kt.ProcessTimeRunOnceScheduler=Kt.RunOnceScheduler=Kt.IntervalTimer=Kt.TimeoutTimer=Kt.TaskQueue=Kt.ResourceQueue=Kt.LimitedQueue=Kt.Queue=Kt.Limiter=Kt.AutoOpenBarrier=Kt.Barrier=Kt.ThrottledDelayer=Kt.Delayer=Kt.SequencerByKey=Kt.Sequencer=Kt.Throttler=void 0;Kt.isThenable=P1n;Kt.createCancelablePromise=D1n;Kt.raceCancellation=N1n;Kt.raceCancellationError=xzo;Kt.rejectIfNotCanceled=wzo;Kt.notCancellablePromise=Rzo;Kt.raceCancellablePromises=kzo;Kt.raceTimeout=M1n;Kt.asPromise=Pzo;Kt.promiseWithResolvers=O1n;Kt.timeout=xHt;Kt.disposableTimeout=Mzo;Kt.sequence=Ozo;Kt.first=Lzo;Kt.firstParallel=Bzo;Kt.installFakeRunWhenIdle=Fzo;Kt.retry=Uzo;Kt.createCancelableAsyncIterableProducer=Qzo;Kt.cancellableIterable=qzo;Kt.createTimeout=jzo;var IHt=YP(),K_=Rs(),pwe=Ic(),Mq=Ro(),R1n=ZP(),Szo=Rq(),Tzo=w1n(),Izo=eF();function P1n(t){return!!t&&typeof t.then=="function"}a(P1n,"isThenable");function D1n(t){let e=new IHt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new K_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,Mq.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(D1n,"createCancelablePromise");function N1n(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(N1n,"raceCancellation");function xzo(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new K_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(xzo,"raceCancellationError");function wzo(t){if(!(0,K_.isCancellationError)(t))return Promise.reject(t)}a(wzo,"rejectIfNotCanceled");function Rzo(t){return new Promise((e,r)=>{t.then(e,r)})}a(Rzo,"notCancellablePromise");function kzo(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(kzo,"raceCancellablePromises");function M1n(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(M1n,"raceTimeout");function Pzo(t){return new Promise((e,r)=>{let n=t();P1n(n)?n.then(e,r):e(n)})}a(Pzo,"asPromise");function O1n(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(O1n,"promiseWithResolvers");var rZe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new IHt.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()}};Kt.Throttler=rZe;var cHt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Kt.Sequencer=cHt;var lHt=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()}};Kt.SequencerByKey=lHt;var Dzo=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"),Nzo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),nZe=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===Tzo.MicrotaskDelay?Nzo(n):Dzo(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new K_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Kt.Delayer=nZe;var uHt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new nZe(e),this.throttler=new rZe}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()}};Kt.ThrottledDelayer=uHt;var iZe=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}};Kt.Barrier=iZe;var dHt=class extends iZe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Kt.AutoOpenBarrier=dHt;function xHt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new K_.CancellationError)})}):D1n(r=>xHt(t,r))}a(xHt,"timeout");function Mzo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,Mq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(Mzo,"disposableTimeout");function Ozo(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(Lzo,"first");function Bzo(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(Bzo,"firstParallel");var oZe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new pwe.Emitter}whenIdle(){return this.size>0?pwe.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()}};Kt.Limiter=oZe;var sZe=class extends oZe{static{a(this,"Queue")}constructor(){super(1)}};Kt.Queue=sZe;var fHt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new cZe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Kt.LimitedQueue=fHt;var pHt=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 rF;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=R1n.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=R1n.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new sZe;let c=this.drainListenerCount++,l=pwe.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 Mq.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()}};Kt.ResourceQueue=pHt;var hHt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new rF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new rF;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 K_.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 K_.CancellationError)}};Kt.TaskQueue=hHt;var mHt=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 K_.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 K_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Kt.TimeoutTimer=mHt;var gHt=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 K_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,Mq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Kt.IntervalTimer=gHt;var hwe=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?.()}};Kt.RunOnceScheduler=hwe;var AHt=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?.())}};Kt.ProcessTimeRunOnceScheduler=AHt;var yHt=class extends hwe{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()}};Kt.RunOnceWorker=yHt;var EHt=class extends Mq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new Mq.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 hwe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Kt.ThrottledWorker=EHt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Kt._runWhenIdle=(e,r,n)=>{(0,Szo.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)}}}:Kt._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))}}},Kt.runWhenGlobalIdle=(e,r)=>(0,Kt._runWhenIdle)(globalThis,e,r)})();function Fzo(t){let e=Kt._runWhenIdle,r=Kt.runWhenGlobalIdle;return Kt._runWhenIdle=t,Kt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,Mq.toDisposable)(()=>{Kt._runWhenIdle=e,Kt.runWhenGlobalIdle=r})}a(Fzo,"installFakeRunWhenIdle");var aZe=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,Kt._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}};Kt.AbstractIdleValue=aZe;var _Ht=class extends aZe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Kt.GlobalIdleValue=_Ht;async function Uzo(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}=O1n();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}};Kt.TaskSequentializer=cZe;var vHt=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}};Kt.IntervalCounter=vHt;var rF=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 K_.CancellationError)}};Kt.DeferredPromise=rF;var k1n;(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})(k1n||(Kt.Promises=k1n={}));var lZe=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 K_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Kt.StatefulPromise=lZe;var CHt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new Izo.Lazy(()=>new lZe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Kt.LazyStatefulPromise=CHt;var uZe=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 pwe.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())}};Kt.AsyncIterableObject=uZe;function Qzo(t){let e=new IHt.CancellationTokenSource,r=t(e.token);return new fZe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new K_.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(Qzo,"createCancelableAsyncIterableProducer");var bHt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new rF,this._asyncIterable=new uZe(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)}};Kt.AsyncIterableSource=bHt;function qzo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await N1n(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(qzo,"cancellableIterable");var SHt=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 K_.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 rF;return this._unsatisfiedConsumers.push(e),e.p}}},dZe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new SHt,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 rF,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}};Kt.AsyncIterableProducer=dZe;var fZe=class extends dZe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Kt.CancelableAsyncIterableProducer=fZe;Kt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var THt=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?Kt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Kt.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?Kt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Kt.AsyncReaderEndOfStream;throw new K_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await M1n(this._extendBuffer(),e),this._atEnd)return Kt.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)}};Kt.AsyncReader=THt;function jzo(t,e){let r=setTimeout(e,t);return(0,Mq.toDisposable)(()=>clearTimeout(r))}a(jzo,"createTimeout")});var H1n=I(JS=>{"use strict";p();var Wzo=JS&&JS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(JS,"__esModule",{value:!0});var zzo=require("fs"),Yzo=Wzo(EP()),Due=Yzo.default("@kwsites/file-exists");function Kzo(t,e,r){Due("checking %s",t);try{let n=zzo.statSync(t);return n.isFile()&&e?(Due("[OK] path represents a file"),!0):n.isDirectory()&&r?(Due("[OK] path represents a directory"),!0):(Due("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Due("[FAIL] path is not accessible: %o",n),!1;throw Due("[FATAL] %o",n),n}}a(Kzo,"check");function Jzo(t,e=JS.READABLE){return Kzo(t,(e&JS.FILE)>0,(e&JS.FOLDER)>0)}a(Jzo,"exists");JS.exists=Jzo;JS.FILE=1;JS.FOLDER=2;JS.READABLE=JS.FILE+JS.FOLDER});var G1n=I(yZe=>{"use strict";p();function Zzo(t){for(var e in t)yZe.hasOwnProperty(e)||(yZe[e]=t[e])}a(Zzo,"__export");Object.defineProperty(yZe,"__esModule",{value:!0});Zzo(H1n())});var V1n=I((k0d,$1n)=>{p();var Oue=1e3,Lue=Oue*60,Bue=Lue*60,rJ=Bue*24,Xzo=rJ*7,eYo=rJ*365.25;$1n.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return tYo(t);if(r==="number"&&isFinite(t))return e.long?nYo(t):rYo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function tYo(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*eYo;case"weeks":case"week":case"w":return r*Xzo;case"days":case"day":case"d":return r*rJ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Bue;case"minutes":case"minute":case"mins":case"min":case"m":return r*Lue;case"seconds":case"second":case"secs":case"sec":case"s":return r*Oue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(tYo,"parse");function rYo(t){var e=Math.abs(t);return e>=rJ?Math.round(t/rJ)+"d":e>=Bue?Math.round(t/Bue)+"h":e>=Lue?Math.round(t/Lue)+"m":e>=Oue?Math.round(t/Oue)+"s":t+"ms"}a(rYo,"fmtShort");function nYo(t){var e=Math.abs(t);return e>=rJ?EZe(t,e,rJ,"day"):e>=Bue?EZe(t,e,Bue,"hour"):e>=Lue?EZe(t,e,Lue,"minute"):e>=Oue?EZe(t,e,Oue,"second"):t+" ms"}a(nYo,"fmtLong");function EZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(EZe,"plural")});var PHt=I((N0d,W1n)=>{p();function iYo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=V1n(),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(iYo,"setup");W1n.exports=iYo});var z1n=I((ZS,_Ze)=>{p();ZS.formatArgs=sYo;ZS.save=aYo;ZS.load=cYo;ZS.useColors=oYo;ZS.storage=lYo();ZS.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`."))}})();ZS.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 oYo(){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(oYo,"useColors");function sYo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+_Ze.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(sYo,"formatArgs");ZS.log=console.debug||console.log||(()=>{});function aYo(t){try{t?ZS.storage.setItem("debug",t):ZS.storage.removeItem("debug")}catch{}}a(aYo,"save");function cYo(){let t;try{t=ZS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(cYo,"load");function lYo(){try{return localStorage}catch{}}a(lYo,"localstorage");_Ze.exports=PHt()(ZS);var{formatters:uYo}=_Ze.exports;uYo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var K1n=I((vg,CZe)=>{p();var dYo=require("tty"),vZe=require("util");vg.init=yYo;vg.log=mYo;vg.formatArgs=pYo;vg.save=gYo;vg.load=AYo;vg.useColors=fYo;vg.destroy=vZe.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=LGe();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 fYo(){return"colors"in vg.inspectOpts?!!vg.inspectOpts.colors:dYo.isatty(process.stderr.fd)}a(fYo,"useColors");function pYo(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(` +`))}},dwe=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"}};$a.ListenerLeakError=dwe;var $Je=class extends dwe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};$a.ListenerRefusalError=$Je;var wVo=0,Sue=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=wVo++}},RVo=2,Zbn=a((t,e)=>{if(t instanceof Sue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new Mjt(e?.onListenerError??lwe.onUnexpectedError,this._options?.leakWarningThreshold??uwe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new GJe(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(Wbn){let e=this._listeners;queueMicrotask(()=>{Zbn(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 $Je(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||lwe.onUnexpectedError)(h),WC.Disposable.None}if(this._disposed)return WC.Disposable.None;r&&(e=e.bind(r));let o=new Sue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Tue.create(),s=this._leakageMon.check(o.stack,this._size+1)),Wbn&&(o.stack=c??Tue.create()),this._listeners?this._listeners instanceof Sue?(this._deliveryQueue??=new VJe,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,WC.toDisposable)(()=>{s?.(),this._removeListener(o)});return Hjt(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*RVo<=r.length){let s=0;for(let c=0;c0}};$a.Emitter=fE;var kVo=a(()=>new VJe,"createEventDeliveryQueue");$a.createEventDeliveryQueue=kVo;var VJe=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}},Ojt=class extends fE{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Jbn.LinkedList),Zbn(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,lwe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,lwe.onUnexpectedError)(d.reason)})}}};$a.AsyncEmitter=Ojt;var WJe=class extends fE{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Jbn.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))}};$a.PauseableEmitter=WJe;var Ljt=class extends WJe{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)}};$a.DebounceEmitter=Ljt;var Bjt=class extends fE{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=[]}))}};$a.MicrotaskEmitter=Bjt;var zJe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new fE({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,WC.toDisposable)((0,CVo.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=[]}};$a.EventMultiplexer=zJe;var Fjt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new WC.DisposableStore;let s=this._store.add(new zJe),c=this._store.add(new WC.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()}};$a.DynamicListEventMultiplexer=Fjt;var Ujt=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}};$a.EventBufferer=Ujt;var Qjt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=HJe.None,this.inputEventListener=WC.Disposable.None,this.emitter=new fE({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()}};$a.Relay=Qjt;var qjt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new jjt(e)}constructor(e){this._value=e,this._onDidChange=new fE,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};$a.ValueWithChangeEvent=qjt;var jjt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=HJe.None}};function PVo(t,e,r){let n=new WC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new WC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,vVo.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(PVo,"trackSetChanges");function Hjt(t,e){e instanceof WC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(Hjt,"addToDisposables");function Kbn(t,e){if(e instanceof WC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(Kbn,"disposeAndRemove")});var JP=I(X3=>{"use strict";p();Object.defineProperty(X3,"__esModule",{value:!0});X3.CancellationTokenPool=X3.CancellationTokenSource=X3.CancellationToken=void 0;X3.cancelOnDispose=NVo;var Xbn=Ic(),DVo=ko(),e1n=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),YJe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Iue?!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:Xbn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:e1n})})(YJe||(X3.CancellationToken=YJe={}));var Iue=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?e1n:(this._emitter||(this._emitter=new Xbn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},fwe=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 Iue),this._token}cancel(){this._token?this._token instanceof Iue&&this._token.cancel():this._token=YJe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Iue&&this._token.dispose():this._token=YJe.None}};X3.CancellationTokenSource=fwe;function NVo(t){let e=new fwe;return t.add({dispose(){e.cancel()}}),e.token}a(NVo,"cancelOnDispose");var Gjt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new fwe,this._listeners=new DVo.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()}};X3.CancellationTokenPool=Gjt});var MA=I(Jr=>{"use strict";p();var MVo=Jr&&Jr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OVo=Jr&&Jr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),LVo=Jr&&Jr.__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=BVo&&t<=UVo||t>=FVo&&t<=QVo}a(tF,"isWindowsDeviceRoot");function JJe(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===tJ&&l!==-1?++l:l=-1}return o}a(JJe,"normalizeString");function HVo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(HVo,"formatExt");function t1n(t,e){jVo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${HVo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(t1n,"_format");Jr.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],up(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=xue.cwd():(s=xue.env[`=${e}`]||xue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===zC)&&(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=JJe(r,!n,"\\",Jo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){up(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return $jt(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+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&tF(c.charCodeAt(0))&&c.charCodeAt(1)===eF)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Jo(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){up(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Jo(r)||e>2&&tF(r)&&t.charCodeAt(1)===eF&&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 Jr.win32.normalize(e)},relative(t,e){if(up(t,"from"),up(e,"to"),t===e)return"";let r=Jr.win32.resolve(t),n=Jr.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)===zC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===zC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===zC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===zC?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)===zC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===zC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Jr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===zC){if(e.charCodeAt(1)===zC){let r=e.charCodeAt(2);if(r!==qVo&&r!==tJ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(tF(e.charCodeAt(0))&&e.charCodeAt(1)===eF&&e.charCodeAt(2)===zC)return`\\\\?\\${e}`;return e},dirname(t){up(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&&up(e,"suffix"),up(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&tF(t.charCodeAt(0))&&t.charCodeAt(1)===eF&&(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){up(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===eF&&tF(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===tJ?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:t1n.bind(null,"\\"),parse(t){up(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===tJ?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 GVo=(()=>{if(YC){let t=/\\/g;return()=>{let e=xue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>xue.cwd()})();Jr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];up(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===vg)}if(!r){let n=GVo();e=`${n}/${e}`,r=n.charCodeAt(0)===vg}return e=JJe(e,!r,"/",$jt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(up(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===vg,r=t.charCodeAt(t.length-1)===vg;return t=JJe(t,!e,"/",$jt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return up(t,"path"),t.length>0&&t.charCodeAt(0)===vg},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Jr.posix.normalize(e.join("/"))},relative(t,e){if(up(t,"from"),up(e,"to"),t===e||(t=Jr.posix.resolve(t),e=Jr.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)===vg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===vg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===vg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(up(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===vg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===vg){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&&up(e,"suffix"),up(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===vg){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)===vg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){up(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:t1n.bind(null,"/"),parse(t){up(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===vg,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===vg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===tJ?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};Jr.posix.win32=Jr.win32.win32=Jr.win32;Jr.posix.posix=Jr.win32.posix=Jr.posix;Jr.normalize=YC?Jr.win32.normalize:Jr.posix.normalize;Jr.isAbsolute=YC?Jr.win32.isAbsolute:Jr.posix.isAbsolute;Jr.join=YC?Jr.win32.join:Jr.posix.join;Jr.resolve=YC?Jr.win32.resolve:Jr.posix.resolve;Jr.relative=YC?Jr.win32.relative:Jr.posix.relative;Jr.dirname=YC?Jr.win32.dirname:Jr.posix.dirname;Jr.basename=YC?Jr.win32.basename:Jr.posix.basename;Jr.extname=YC?Jr.win32.extname:Jr.posix.extname;Jr.format=YC?Jr.win32.format:Jr.posix.format;Jr.parse=YC?Jr.win32.parse:Jr.posix.parse;Jr.toNamespacedPath=YC?Jr.win32.toNamespacedPath:Jr.posix.toNamespacedPath;Jr.sep=YC?Jr.win32.sep:Jr.posix.sep;Jr.delimiter=YC?Jr.win32.delimiter:Jr.posix.delimiter});var XJe=I(ZP=>{"use strict";p();Object.defineProperty(ZP,"__esModule",{value:!0});ZP.WeakCachedFunction=ZP.CachedFunction=ZP.LRUCachedFunction=ZP.Cache=void 0;ZP.identity=ZJe;var $Vo=JP(),Vjt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new $Vo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};ZP.Cache=Vjt;function ZJe(t){return t}a(ZJe,"identity");var Wjt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=ZJe):(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}};ZP.LRUCachedFunction=Wjt;var zjt=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=ZJe):(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}};ZP.CachedFunction=zjt;var Yjt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=ZJe):(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}};ZP.WeakCachedFunction=Yjt});var rF=I(eZe=>{"use strict";p();Object.defineProperty(eZe,"__esModule",{value:!0});eZe.Lazy=void 0;var Nq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(Nq||(Nq={}));var Kjt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=Nq.Uninitialized}get hasValue(){return this._state===Nq.Completed}get value(){if(this._state===Nq.Uninitialized){this._state=Nq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Nq.Completed}}else if(this._state===Nq.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}};eZe.Lazy=Kjt});var rm=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.Ellipsis=kr.InvisibleCharacters=kr.AmbiguousCharacters=kr.noBreakWhitespace=kr.UTF8_BOM_CHARACTER=kr.UNUSUAL_LINE_TERMINATORS=kr.GraphemeIterator=kr.CodePointIterator=void 0;kr.isFalsyOrWhitespace=WVo;kr.format=YVo;kr.format2=JVo;kr.htmlAttributeEncodeValue=ZVo;kr.escape=XVo;kr.escapeRegExpCharacters=i1n;kr.count=eWo;kr.truncate=tWo;kr.truncateMiddle=rWo;kr.trim=nWo;kr.ltrim=o1n;kr.rtrim=s1n;kr.convertSimple2RegExpPattern=iWo;kr.createRegExp=oWo;kr.regExpLeadsToEndlessLoop=sWo;kr.joinStrings=aWo;kr.splitLines=cWo;kr.splitLinesIncludeSeparators=lWo;kr.indexOfPattern=uWo;kr.firstNonWhitespaceIndex=a1n;kr.getLeadingWhitespace=dWo;kr.lastNonWhitespaceIndex=fWo;kr.getIndentationLength=pWo;kr.replaceAsync=hWo;kr.compare=mWo;kr.compareSubstring=c1n;kr.compareIgnoreCase=gWo;kr.compareSubstringIgnoreCase=hwe;kr.isAsciiDigit=AWo;kr.isLowerAsciiLetter=Zjt;kr.isUpperAsciiLetter=yWo;kr.equalsIgnoreCase=l1n;kr.equals=EWo;kr.startsWithIgnoreCase=_Wo;kr.endsWithIgnoreCase=vWo;kr.commonPrefixLength=CWo;kr.commonSuffixLength=bWo;kr.isHighSurrogate=tHt;kr.isLowSurrogate=tZe;kr.computeCodePoint=rHt;kr.getNextCodePoint=u1n;kr.nextCharLength=d1n;kr.prevCharLength=f1n;kr.getCharContainingOffset=TWo;kr.charCount=IWo;kr.containsRTL=wWo;kr.isBasicASCII=kWo;kr.containsUnusualLineTerminators=PWo;kr.isFullWidthCharacter=DWo;kr.isEmojiImprecise=p1n;kr.lcut=NWo;kr.rcut=MWo;kr.forAnsiStringParts=FWo;kr.removeAnsiEscapeCodes=m1n;kr.removeAnsiEscapeCodesFromPrompt=QWo;kr.startsWithUTF8BOM=g1n;kr.stripUTF8BOM=qWo;kr.fuzzyContains=jWo;kr.containsUppercaseCharacter=HWo;kr.uppercaseFirstLetter=GWo;kr.getNLines=$Wo;kr.singleLetterHash=VWo;kr.getGraphemeBreakType=WWo;kr.getLeftDeleteOffset=YWo;kr.multibyteAwareBtoa=XWo;var VVo=XJe(),r1n=rF();function WVo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(WVo,"isFalsyOrWhitespace");var zVo=/{(\d+)}/g;function YVo(t,...e){return e.length===0?t:t.replace(zVo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(YVo,"format");var KVo=/{([^}]+)}/g;function JVo(t,e){return Object.keys(e).length===0?t:t.replace(KVo,(r,n)=>e[n]??r)}a(JVo,"format2");function ZVo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(ZVo,"htmlAttributeEncodeValue");function XVo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(XVo,"escape");function i1n(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(i1n,"escapeRegExpCharacters");function eWo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(eWo,"count");function tWo(t,e,r=kr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(tWo,"truncate");function rWo(t,e,r=kr.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(rWo,"truncateMiddle");function nWo(t,e=" "){let r=o1n(t,e);return s1n(r,e)}a(nWo,"trim");function o1n(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(s1n,"rtrim");function iWo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(iWo,"convertSimple2RegExpPattern");function oWo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=i1n(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(oWo,"createRegExp");function sWo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(sWo,"regExpLeadsToEndlessLoop");function aWo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(aWo,"joinStrings");function cWo(t){return t.split(/\r\n|\r|\n/)}a(cWo,"splitLines");function lWo(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(fWo,"lastNonWhitespaceIndex");function pWo(t){let e=a1n(t);return e===-1?t.length:e}a(pWo,"getIndentationLength");function hWo(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(hWo,"replaceAsync");function mWo(t,e){return te?1:0}a(mWo,"compare");function c1n(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(c1n,"compareSubstring");function gWo(t,e){return hwe(t,e,0,t.length,0,e.length)}a(gWo,"compareIgnoreCase");function hwe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return c1n(t.toLowerCase(),e.toLowerCase(),r,n,o,s);Zjt(u)&&(u-=32),Zjt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(hwe,"compareSubstringIgnoreCase");function AWo(t){return t>=48&&t<=57}a(AWo,"isAsciiDigit");function Zjt(t){return t>=97&&t<=122}a(Zjt,"isLowerAsciiLetter");function yWo(t){return t>=65&&t<=90}a(yWo,"isUpperAsciiLetter");function l1n(t,e){return t.length===e.length&&hwe(t,e)===0}a(l1n,"equalsIgnoreCase");function EWo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&l1n(t,e)}a(EWo,"equals");function _Wo(t,e){let r=e.length;return r<=t.length&&hwe(t,e,0,r)===0}a(_Wo,"startsWithIgnoreCase");function vWo(t,e){let r=t.length,n=r-e.length;return n>=0&&hwe(t,e,n,r)===0}a(vWo,"endsWithIgnoreCase");function CWo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(tHt(n))return rHt(n,r)}return r}a(SWo,"getPrevCodePoint");var wue=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=SWo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=u1n(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};kr.CodePointIterator=wue;var Rue=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new wue(e,r)}nextGraphemeLength(){let e=pwe.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(n1n(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=pwe.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(n1n(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};kr.GraphemeIterator=Rue;function d1n(t,e){return new Rue(t,e).nextGraphemeLength()}a(d1n,"nextCharLength");function f1n(t,e){return new Rue(t,e).prevGraphemeLength()}a(f1n,"prevCharLength");function TWo(t,e){e>0&&tZe(t.charCodeAt(e))&&e--;let r=e+d1n(t,e);return[r-f1n(t,r),r]}a(TWo,"getCharContainingOffset");function IWo(t){let e=new Rue(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(IWo,"charCount");var Jjt;function xWo(){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(xWo,"makeContainsRtl");function wWo(t){return Jjt||(Jjt=xWo()),Jjt.test(t)}a(wWo,"containsRTL");var RWo=/^[\t\n\r\x20-\x7E]*$/;function kWo(t){return RWo.test(t)}a(kWo,"isBasicASCII");kr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function PWo(t){return kr.UNUSUAL_LINE_TERMINATORS.test(t)}a(PWo,"containsUnusualLineTerminators");function DWo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(DWo,"isFullWidthCharacter");function p1n(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(p1n,"isEmojiImprecise");function NWo(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@^`{}|~]/,LWo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,BWo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,h1n=new RegExp("(?:"+[OWo.source,LWo.source,BWo.source].join("|")+")","g");function*FWo(t){let e=0;for(let r of t.matchAll(h1n))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(FWo,"forAnsiStringParts");function m1n(t){return t&&(t=t.replace(h1n,"")),t}a(m1n,"removeAnsiEscapeCodes");var UWo=/\\\[.*?\\\]/g;function QWo(t){return m1n(t).replace(UWo,"")}a(QWo,"removeAnsiEscapeCodesFromPrompt");kr.UTF8_BOM_CHARACTER="\uFEFF";function g1n(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(g1n,"startsWithUTF8BOM");function qWo(t){return g1n(t)?t.substr(1):t}a(qWo,"stripUTF8BOM");function jWo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a($Wo,"getNLines");function VWo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(VWo,"singleLetterHash");function WWo(t){return pwe.getInstance().getGraphemeBreakType(t)}a(WWo,"getGraphemeBreakType");function n1n(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(n1n,"breakBetweenGraphemeBreakType");var pwe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=zWo()}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 zWo(){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(zWo,"getGraphemeBreakRawData");function YWo(t,e){if(t===0)return 0;let r=KWo(t,e);if(r!==void 0)return r;let n=new wue(e,t);return n.prevCodePoint(),n.offset}a(YWo,"getLeftDeleteOffset");function KWo(t,e){let r=new wue(e,t),n=r.prevCodePoint();for(;JWo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!p1n(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(KWo,"getOffsetBeforeLastEmojiComponent");function JWo(t){return 127995<=t&&t<=127999}a(JWo,"isEmojiModifier");kr.noBreakWhitespace="\xA0";var Xjt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new r1n.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 VVo.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 r1n.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(p0,"__esModule",{value:!0});p0.isPathSeparator=nF;p0.toSlashes=A1n;p0.toPosixPath=tzo;p0.getRoot=rzo;p0.isUNC=nzo;p0.isValidBasename=azo;p0.isEqual=czo;p0.isEqualOrParent=lzo;p0.isWindowsDriveLetter=nHt;p0.sanitizeFilePath=uzo;p0.removeTrailingPathSeparator=y1n;p0.isRootOrDriveLetter=dzo;p0.hasDriveLetter=iHt;p0.getDriveLetter=fzo;p0.indexOfPath=pzo;p0.parseLineAndColumnAware=hzo;p0.randomPath=Azo;var f0=MA(),Mq=Dq(),rZe=rm(),ezo=ZS();function nF(t){return t===47||t===92}a(nF,"isPathSeparator");function A1n(t){return t.replace(/[\\/]/g,f0.posix.sep)}a(A1n,"toSlashes");function tzo(t){return t.indexOf("/")===-1&&(t=A1n(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(tzo,"toPosixPath");function rzo(t,e=f0.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(nF(n)){if(nF(t.charCodeAt(1))&&!nF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,ozo=/[/]/g,szo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function azo(t,e=Mq.isWindows){let r=e?izo:ozo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&szo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(azo,"isValidBasename");function czo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,rZe.equalsIgnoreCase)(t,e)}a(czo,"isEqual");function lzo(t,e,r,n=!1){let o=n?f0.posix.sep:f0.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?f0.posix.normalize(t):(0,f0.normalize)(t),e=n?f0.posix.normalize(e):(0,f0.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,rZe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let c=e.length;return e.charAt(e.length-1)===o&&c--,t.charAt(c)===o}return e.charAt(e.length-1)!==o&&(e+=o),t.indexOf(e)===0}a(lzo,"isEqualOrParent");function nHt(t){return t>=65&&t<=90||t>=97&&t<=122}a(nHt,"isWindowsDriveLetter");function uzo(t,e){return Mq.isWindows&&t.endsWith(":")&&(t+=f0.sep),(0,f0.isAbsolute)(t)||(t=(0,f0.join)(e,t)),t=(0,f0.normalize)(t),y1n(t)}a(uzo,"sanitizeFilePath");function y1n(t){return Mq.isWindows?(t=(0,rZe.rtrim)(t,f0.sep),t.endsWith(":")&&(t+=f0.sep)):(t=(0,rZe.rtrim)(t,f0.sep),t||(t=f0.sep)),t}a(y1n,"removeTrailingPathSeparator");function dzo(t){let e=(0,f0.normalize)(t);return Mq.isWindows?t.length>3?!1:iHt(e)&&(t.length===2||e.charCodeAt(2)===92):e===f0.posix.sep}a(dzo,"isRootOrDriveLetter");function iHt(t,e=Mq.isWindows){return e?nHt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(iHt,"hasDriveLetter");function fzo(t,e=Mq.isWindows){return iHt(t,e)?t[0]:void 0}a(fzo,"getDriveLetter");function pzo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(pzo,"indexOfPath");function hzo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,ezo.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(hzo,"parseLineAndColumnAware");var mzo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",gzo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function Azo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var yzo=sw&&sw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ezo=sw&&sw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_zo=sw&&sw.__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(!Czo.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(bzo.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(Szo,"_validateUri");function Tzo(t,e){return!t&&!e?"file":t}a(Tzo,"_schemeFix");function Izo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==XP&&(e=XP+e):e=XP;break}return e}a(Izo,"_referenceResolution");var $l="",XP="/",xzo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,oZe=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||$l,this.authority=e.authority||$l,this.path=e.path||$l,this.query=e.query||$l,this.fragment=e.fragment||$l):(this.scheme=Tzo(e,c),this.authority=r||$l,this.path=Izo(this.scheme,n||$l),this.query=o||$l,this.fragment=s||$l,Szo(this,c))}get fsPath(){return sZe(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=$l),n===void 0?n=this.authority:n===null&&(n=$l),o===void 0?o=this.path:o===null&&(o=$l),s===void 0?s=this.query:s===null&&(s=$l),c===void 0?c=this.fragment:c===null&&(c=$l),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Oq(r,n,o,s,c)}static parse(e,r=!1){let n=xzo.exec(e);return n?new Oq(n[2]||$l,nZe(n[4]||$l),nZe(n[5]||$l),nZe(n[7]||$l),nZe(n[9]||$l),r):new Oq($l,$l,$l,$l,$l)}static file(e){let r=$l;if(iZe.isWindows&&(e=e.replace(/\\/g,XP)),e[0]===XP&&e[1]===XP){let n=e.indexOf(XP,2);n===-1?(r=e.substring(2),e=XP):(r=e.substring(2,n),e=e.substring(n)||XP)}return new Oq("file",r,e,$l,$l)}static from(e,r){return new Oq(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 iZe.isWindows&&e.scheme==="file"?n=t.file(E1n.win32.join(sZe(e,!0),...r)).path:n=E1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return sHt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Oq(e);return r._formatted=e.external??null,r._fsPath=e._sep===C1n?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};sw.URI=oZe;function wzo(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(wzo,"isUriComponents");var C1n=iZe.isWindows?1:void 0,Oq=class extends oZe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=sZe(this,!1)),this._fsPath}toString(e=!1){return e?sHt(this,!0):(this._formatted||(this._formatted=sHt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=C1n),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}},b1n={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 _1n(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=b1n[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(_1n,"encodeURIComponentFast");function Rzo(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,iZe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(sZe,"uriToFsPath");function sHt(t,e){let r=e?Rzo:_1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=XP,n+=XP),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:_1n(u,!1,!1)),n}a(sHt,"_asFormatted");function S1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+S1n(t.substr(3)):t}}a(S1n,"decodeURIComponentGraceful");var v1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function nZe(t){return t.match(v1n)?t.replace(v1n,e=>S1n(e)):t}a(nZe,"percentDecode")});var nJ=I(ms=>{"use strict";p();var kzo=ms&&ms.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pzo=ms&&ms.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dHt=ms&&ms.__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;ox1n(t,r))}a(Nzo,"matchesSomeScheme");ms.connectionTokenCookieName="vscode-tkn";ms.connectionTokenQueryName="tkn";var lHt=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=cHt.posix.join(r??"/",w1n(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return cHt.posix.join(this._serverRootPath,qO.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 Dzo.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+=`&${ms.connectionTokenQueryName}=${encodeURIComponent(s)}`),rJ.URI.from({scheme:aHt.isWeb?this._preferredWebSchema:qO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ms.RemoteAuthorities=new lHt;function w1n(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(w1n,"getServerProductSegment");ms.builtinExtensionsPath="vs/../../extensions";ms.nodeModulesPath="vs/../../node_modules";ms.nodeModulesAsarPath="vs/../../node_modules.asar";ms.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ms.VSCODE_AUTHORITY="vscode-app";var uHt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ms.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===qO.vscodeRemote?ms.RemoteAuthorities.rewrite(e):e.scheme===qO.file&&(aHt.isNative||aHt.webWorkerOrigin===`${qO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:qO.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===qO.vscodeFileResource?e.with({scheme:qO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(rJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return rJ.URI.joinPath(rJ.URI.parse(r,!0),e);let n=cHt.join(r,e);return rJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ms.FileAccess=new uHt;ms.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ms.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var I1n;(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:rJ.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})(I1n||(ms.COI=I1n={}))});var e2=I(yr=>{"use strict";p();var Mzo=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]})),Ozo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),P1n=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;okue.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=J_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=J_.sep){let n=!1;if(e.scheme===Lq.Schemas.file){let o=jO(e);n=o!==void 0&&o.length===kue.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=Pue;yr.extUri=new Pue(()=>!1);yr.extUriBiasedIgnorePathCase=new Pue(t=>t.scheme===Lq.Schemas.file?!D1n.isLinux:!0);yr.extUriIgnorePathCase=new Pue(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 Lzo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(Lzo,"distinctParents");var k1n;(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})(k1n||(yr.DataUri=k1n={}));function Bzo(t,e,r){if(e){let n=t.path;return n&&n[0]!==J_.posix.sep&&(n=J_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(Bzo,"toLocalResource")});var N1n=I(aZe=>{"use strict";p();Object.defineProperty(aZe,"__esModule",{value:!0});aZe.MicrotaskDelay=void 0;aZe.MicrotaskDelay=Symbol("MicrotaskDelay")});var nl=I(Kt=>{"use strict";p();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.AsyncReader=Kt.AsyncReaderEndOfStream=Kt.CancelableAsyncIterableProducer=Kt.AsyncIterableProducer=Kt.AsyncIterableSource=Kt.AsyncIterableObject=Kt.LazyStatefulPromise=Kt.StatefulPromise=Kt.Promises=Kt.DeferredPromise=Kt.IntervalCounter=Kt.TaskSequentializer=Kt.GlobalIdleValue=Kt.AbstractIdleValue=Kt._runWhenIdle=Kt.runWhenGlobalIdle=Kt.ThrottledWorker=Kt.RunOnceWorker=Kt.ProcessTimeRunOnceScheduler=Kt.RunOnceScheduler=Kt.IntervalTimer=Kt.TimeoutTimer=Kt.TaskQueue=Kt.ResourceQueue=Kt.LimitedQueue=Kt.Queue=Kt.Limiter=Kt.AutoOpenBarrier=Kt.Barrier=Kt.ThrottledDelayer=Kt.Delayer=Kt.SequencerByKey=Kt.Sequencer=Kt.Throttler=void 0;Kt.isThenable=L1n;Kt.createCancelablePromise=B1n;Kt.raceCancellation=F1n;Kt.raceCancellationError=qzo;Kt.rejectIfNotCanceled=jzo;Kt.notCancellablePromise=Hzo;Kt.raceCancellablePromises=Gzo;Kt.raceTimeout=U1n;Kt.asPromise=$zo;Kt.promiseWithResolvers=Q1n;Kt.timeout=PHt;Kt.disposableTimeout=zzo;Kt.sequence=Yzo;Kt.first=Kzo;Kt.firstParallel=Jzo;Kt.installFakeRunWhenIdle=Zzo;Kt.retry=Xzo;Kt.createCancelableAsyncIterableProducer=eYo;Kt.cancellableIterable=tYo;Kt.createTimeout=rYo;var kHt=JP(),Z_=Rs(),gwe=Ic(),Bq=ko(),M1n=e2(),Fzo=Dq(),Uzo=N1n(),Qzo=rF();function L1n(t){return!!t&&typeof t.then=="function"}a(L1n,"isThenable");function B1n(t){let e=new kHt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new Z_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,Bq.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(B1n,"createCancelablePromise");function F1n(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(F1n,"raceCancellation");function qzo(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new Z_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(qzo,"raceCancellationError");function jzo(t){if(!(0,Z_.isCancellationError)(t))return Promise.reject(t)}a(jzo,"rejectIfNotCanceled");function Hzo(t){return new Promise((e,r)=>{t.then(e,r)})}a(Hzo,"notCancellablePromise");function Gzo(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(Gzo,"raceCancellablePromises");function U1n(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(U1n,"raceTimeout");function $zo(t){return new Promise((e,r)=>{let n=t();L1n(n)?n.then(e,r):e(n)})}a($zo,"asPromise");function Q1n(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(Q1n,"promiseWithResolvers");var cZe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new kHt.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()}};Kt.Throttler=cZe;var fHt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Kt.Sequencer=fHt;var pHt=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()}};Kt.SequencerByKey=pHt;var Vzo=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"),Wzo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),lZe=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===Uzo.MicrotaskDelay?Wzo(n):Vzo(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Z_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Kt.Delayer=lZe;var hHt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new lZe(e),this.throttler=new cZe}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()}};Kt.ThrottledDelayer=hHt;var uZe=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}};Kt.Barrier=uZe;var mHt=class extends uZe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Kt.AutoOpenBarrier=mHt;function PHt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new Z_.CancellationError)})}):B1n(r=>PHt(t,r))}a(PHt,"timeout");function zzo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,Bq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(zzo,"disposableTimeout");function Yzo(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(Kzo,"first");function Jzo(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(Jzo,"firstParallel");var dZe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new gwe.Emitter}whenIdle(){return this.size>0?gwe.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()}};Kt.Limiter=dZe;var fZe=class extends dZe{static{a(this,"Queue")}constructor(){super(1)}};Kt.Queue=fZe;var gHt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new hZe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Kt.LimitedQueue=gHt;var AHt=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 iF;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=M1n.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=M1n.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new fZe;let c=this.drainListenerCount++,l=gwe.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 Bq.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()}};Kt.ResourceQueue=AHt;var yHt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new iF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new iF;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 Z_.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 Z_.CancellationError)}};Kt.TaskQueue=yHt;var EHt=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 Z_.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 Z_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Kt.TimeoutTimer=EHt;var _Ht=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 Z_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,Bq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Kt.IntervalTimer=_Ht;var Awe=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?.()}};Kt.RunOnceScheduler=Awe;var vHt=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?.())}};Kt.ProcessTimeRunOnceScheduler=vHt;var CHt=class extends Awe{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()}};Kt.RunOnceWorker=CHt;var bHt=class extends Bq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new Bq.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 Awe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Kt.ThrottledWorker=bHt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Kt._runWhenIdle=(e,r,n)=>{(0,Fzo.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)}}}:Kt._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))}}},Kt.runWhenGlobalIdle=(e,r)=>(0,Kt._runWhenIdle)(globalThis,e,r)})();function Zzo(t){let e=Kt._runWhenIdle,r=Kt.runWhenGlobalIdle;return Kt._runWhenIdle=t,Kt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,Bq.toDisposable)(()=>{Kt._runWhenIdle=e,Kt.runWhenGlobalIdle=r})}a(Zzo,"installFakeRunWhenIdle");var pZe=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,Kt._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}};Kt.AbstractIdleValue=pZe;var SHt=class extends pZe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Kt.GlobalIdleValue=SHt;async function Xzo(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}=Q1n();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}};Kt.TaskSequentializer=hZe;var THt=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}};Kt.IntervalCounter=THt;var iF=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 Z_.CancellationError)}};Kt.DeferredPromise=iF;var O1n;(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})(O1n||(Kt.Promises=O1n={}));var mZe=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 Z_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Kt.StatefulPromise=mZe;var IHt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new Qzo.Lazy(()=>new mZe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Kt.LazyStatefulPromise=IHt;var gZe=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 gwe.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())}};Kt.AsyncIterableObject=gZe;function eYo(t){let e=new kHt.CancellationTokenSource,r=t(e.token);return new yZe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new Z_.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(eYo,"createCancelableAsyncIterableProducer");var xHt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new iF,this._asyncIterable=new gZe(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)}};Kt.AsyncIterableSource=xHt;function tYo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await F1n(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(tYo,"cancellableIterable");var wHt=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 Z_.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 iF;return this._unsatisfiedConsumers.push(e),e.p}}},AZe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new wHt,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 iF,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}};Kt.AsyncIterableProducer=AZe;var yZe=class extends AZe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Kt.CancelableAsyncIterableProducer=yZe;Kt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var RHt=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?Kt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Kt.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?Kt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Kt.AsyncReaderEndOfStream;throw new Z_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await U1n(this._extendBuffer(),e),this._atEnd)return Kt.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)}};Kt.AsyncReader=RHt;function rYo(t,e){let r=setTimeout(e,t);return(0,Bq.toDisposable)(()=>clearTimeout(r))}a(rYo,"createTimeout")});var z1n=I(XS=>{"use strict";p();var aYo=XS&&XS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(XS,"__esModule",{value:!0});var cYo=require("fs"),lYo=aYo(vP()),Nue=lYo.default("@kwsites/file-exists");function uYo(t,e,r){Nue("checking %s",t);try{let n=cYo.statSync(t);return n.isFile()&&e?(Nue("[OK] path represents a file"),!0):n.isDirectory()&&r?(Nue("[OK] path represents a directory"),!0):(Nue("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Nue("[FAIL] path is not accessible: %o",n),!1;throw Nue("[FATAL] %o",n),n}}a(uYo,"check");function dYo(t,e=XS.READABLE){return uYo(t,(e&XS.FILE)>0,(e&XS.FOLDER)>0)}a(dYo,"exists");XS.exists=dYo;XS.FILE=1;XS.FOLDER=2;XS.READABLE=XS.FILE+XS.FOLDER});var Y1n=I(SZe=>{"use strict";p();function fYo(t){for(var e in t)SZe.hasOwnProperty(e)||(SZe[e]=t[e])}a(fYo,"__export");Object.defineProperty(SZe,"__esModule",{value:!0});fYo(z1n())});var J1n=I((Y0d,K1n)=>{p();var Lue=1e3,Bue=Lue*60,Fue=Bue*60,iJ=Fue*24,pYo=iJ*7,hYo=iJ*365.25;K1n.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return mYo(t);if(r==="number"&&isFinite(t))return e.long?AYo(t):gYo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function mYo(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*hYo;case"weeks":case"week":case"w":return r*pYo;case"days":case"day":case"d":return r*iJ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Fue;case"minutes":case"minute":case"mins":case"min":case"m":return r*Bue;case"seconds":case"second":case"secs":case"sec":case"s":return r*Lue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(mYo,"parse");function gYo(t){var e=Math.abs(t);return e>=iJ?Math.round(t/iJ)+"d":e>=Fue?Math.round(t/Fue)+"h":e>=Bue?Math.round(t/Bue)+"m":e>=Lue?Math.round(t/Lue)+"s":t+"ms"}a(gYo,"fmtShort");function AYo(t){var e=Math.abs(t);return e>=iJ?TZe(t,e,iJ,"day"):e>=Fue?TZe(t,e,Fue,"hour"):e>=Bue?TZe(t,e,Bue,"minute"):e>=Lue?TZe(t,e,Lue,"second"):t+" ms"}a(AYo,"fmtLong");function TZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(TZe,"plural")});var OHt=I((Z0d,Z1n)=>{p();function yYo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=J1n(),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(yYo,"setup");Z1n.exports=yYo});var X1n=I((eT,IZe)=>{p();eT.formatArgs=_Yo;eT.save=vYo;eT.load=CYo;eT.useColors=EYo;eT.storage=bYo();eT.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`."))}})();eT.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 EYo(){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(EYo,"useColors");function _Yo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+IZe.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(_Yo,"formatArgs");eT.log=console.debug||console.log||(()=>{});function vYo(t){try{t?eT.storage.setItem("debug",t):eT.storage.removeItem("debug")}catch{}}a(vYo,"save");function CYo(){let t;try{t=eT.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(CYo,"load");function bYo(){try{return localStorage}catch{}}a(bYo,"localstorage");IZe.exports=OHt()(eT);var{formatters:SYo}=IZe.exports;SYo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var tSn=I((Cg,wZe)=>{p();var TYo=require("tty"),xZe=require("util");Cg.init=DYo;Cg.log=RYo;Cg.formatArgs=xYo;Cg.save=kYo;Cg.load=PYo;Cg.useColors=IYo;Cg.destroy=xZe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Cg.colors=[6,2,3,4,5,1];try{let t=qGe();t&&(t.stderr||t).level>=2&&(Cg.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{}Cg.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 IYo(){return"colors"in Cg.inspectOpts?!!Cg.inspectOpts.colors:TYo.isatty(process.stderr.fd)}a(IYo,"useColors");function xYo(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+"+CZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hYo()+e+" "+t[0]}a(pYo,"formatArgs");function hYo(){return vg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(hYo,"getDate");function mYo(...t){return process.stderr.write(vZe.formatWithOptions(vg.inspectOpts,...t)+` -`)}a(mYo,"log");function gYo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(gYo,"save");function AYo(){return process.env.DEBUG}a(AYo,"load");function yYo(t){t.inspectOpts={};let e=Object.keys(vg.inspectOpts);for(let r=0;re.trim()).join(" ")};Y1n.O=function(t){return this.inspectOpts.colors=this.useColors,vZe.inspect(t,this.inspectOpts)}});var J1n=I((Q0d,DHt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?DHt.exports=z1n():DHt.exports=K1n()});var MHt=I(nJ=>{"use strict";p();Object.defineProperty(nJ,"__esModule",{value:!0});nJ.createDeferred=nJ.deferred=void 0;function NHt(){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(NHt,"deferred");nJ.deferred=NHt;nJ.createDeferred=NHt;nJ.default=NHt});var zZe=I(eT=>{"use strict";p();Object.defineProperty(eT,"__esModule",{value:!0});eT.deepClone=XIn;eT.deepFreeze=nXo;eT.cloneAndChange=iXo;eT.mixin=txn;eT.equals=xwe;eT.safeStringify=oXo;eT.stableStringify=sXo;eT.distinct=aXo;eT.getCaseInsensitive=cXo;eT.filter=lXo;eT.mapValues=uXo;var Fq=KS();function XIn(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"?XIn(n):n}),e}a(XIn,"deepClone");function nXo(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(exn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Fq.isTypedArray)(o)&&e.push(o)}}return t}a(nXo,"deepFreeze");var exn=Object.prototype.hasOwnProperty;function iXo(t,e){return OGt(t,e,new Set)}a(iXo,"cloneAndChange");function OGt(t,e,r){if((0,Fq.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(OGt(s,e,r));return o}if((0,Fq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)exn.call(t,s)&&(o[s]=OGt(t[s],e,r));return r.delete(t),o}return t}a(OGt,"_cloneAndChange");function txn(t,e,r=!0){return(0,Fq.isObject)(t)?((0,Fq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Fq.isObject)(t[n])&&(0,Fq.isObject)(e[n])?txn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(txn,"mixin");function xwe(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,Fq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(oXo,"safeStringify");function sXo(t){if(t===void 0)return"undefined";try{return LGt(t,new WeakSet)}catch{return""}}a(sXo,"stableStringify");function LGt(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=>LGt(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)+":"+LGt(s,e))}return"{"+n.join(",")+"}"}a(LGt,"_stableStringify");function aXo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];xwe(s,c)||(r[o]=c)}),r}a(aXo,"distinct");function cXo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(cXo,"getCaseInsensitive");function lXo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(lXo,"filter");function uXo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(uXo,"mapValues")});var X_=I(YZe=>{"use strict";p();Object.defineProperty(YZe,"__esModule",{value:!0});YZe.ErrorUtils=void 0;var dXo=zZe(),rxn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,dXo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(rxn||(YZe.ErrorUtils=rxn={}))});var uw=I(KZe=>{"use strict";p();Object.defineProperty(KZe,"__esModule",{value:!0});KZe.Result=void 0;var BGt=X_(),nxn;(function(t){function e(c){return new FGt(c)}a(e,"ok"),t.ok=e;function r(c){return new UGt(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(BGt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(BGt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(nxn||(KZe.Result=nxn={}));var FGt=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}},UGt=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:BGt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var jd=I((rZd,u2n)=>{p();u2n.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 Ec=I((iZd,O2n)=>{"use strict";p();var d2n=Symbol.for("undici.error.UND_ERR"),Hd=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[d2n]===!0}[d2n]=!0},f2n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),NZt=class extends Hd{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[f2n]===!0}[f2n]=!0},p2n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),MZt=class extends Hd{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[p2n]===!0}[p2n]=!0},h2n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),OZt=class extends Hd{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[h2n]===!0}[h2n]=!0},m2n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),LZt=class extends Hd{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[m2n]===!0}[m2n]=!0},g2n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),BZt=class extends Hd{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[g2n]===!0}[g2n]=!0},A2n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),FZt=class extends Hd{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[A2n]===!0}[A2n]=!0},y2n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),UZt=class extends Hd{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[y2n]===!0}[y2n]=!0},E2n=Symbol.for("undici.error.UND_ERR_ABORT"),Lrt=class extends Hd{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[E2n]===!0}[E2n]=!0},_2n=Symbol.for("undici.error.UND_ERR_ABORTED"),QZt=class extends Lrt{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[_2n]===!0}[_2n]=!0},v2n=Symbol.for("undici.error.UND_ERR_INFO"),qZt=class extends Hd{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[v2n]===!0}[v2n]=!0},C2n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),jZt=class extends Hd{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[C2n]===!0}[C2n]=!0},b2n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),HZt=class extends Hd{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[b2n]===!0}[b2n]=!0},S2n=Symbol.for("undici.error.UND_ERR_DESTROYED"),GZt=class extends Hd{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[S2n]===!0}[S2n]=!0},T2n=Symbol.for("undici.error.UND_ERR_CLOSED"),$Zt=class extends Hd{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[T2n]===!0}[T2n]=!0},I2n=Symbol.for("undici.error.UND_ERR_SOCKET"),VZt=class extends Hd{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[I2n]===!0}[I2n]=!0},x2n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),WZt=class extends Hd{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[x2n]===!0}[x2n]=!0},w2n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),zZt=class extends Hd{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[w2n]===!0}[w2n]=!0},R2n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),YZt=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[R2n]===!0}[R2n]=!0},k2n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),KZt=class extends Hd{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[k2n]===!0}[k2n]=!0},P2n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),JZt=class extends Hd{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[P2n]===!0}[P2n]=!0},D2n=Symbol.for("undici.error.UND_ERR_RESPONSE"),ZZt=class extends Hd{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[D2n]===!0}[D2n]=!0},N2n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),XZt=class extends Hd{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[N2n]===!0}[N2n]=!0},M2n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),eXt=class extends Hd{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[M2n]===!0}get[M2n](){return!0}};O2n.exports={AbortError:Lrt,HTTPParserError:YZt,UndiciError:Hd,HeadersTimeoutError:MZt,HeadersOverflowError:OZt,BodyTimeoutError:LZt,RequestContentLengthMismatchError:jZt,ConnectTimeoutError:NZt,ResponseStatusCodeError:BZt,InvalidArgumentError:FZt,InvalidReturnValueError:UZt,RequestAbortedError:QZt,ClientDestroyedError:GZt,ClientClosedError:$Zt,InformationalError:qZt,SocketError:VZt,NotSupportedError:WZt,ResponseContentLengthMismatchError:HZt,BalancedPoolMissingUpstreamError:zZt,ResponseExceededMaxSizeError:KZt,RequestRetryError:JZt,ResponseError:ZZt,SecureProxyConnectionError:XZt,MessageSizeExceededError:eXt}});var Frt=I((aZd,L2n)=>{"use strict";p();var Brt={},tXt=["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:B2n,headerNameLowerCasedRecord:Dls}=Frt(),rXt=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 KRe=require("node:assert"),{kDestroyed:j2n,kBodyUsed:Gde,kListeners:nXt,kBody:q2n}=jd(),{IncomingMessage:Nls}=require("node:http"),jrt=require("node:stream"),Mls=require("node:net"),{Blob:Ols}=require("node:buffer"),Lls=require("node:util"),{stringify:Bls}=require("node:querystring"),{EventEmitter:Fls}=require("node:events"),{InvalidArgumentError:xg}=Ec(),{headerNameLowerCasedRecord:Uls}=Frt(),{tree:H2n}=Q2n(),[Qls,qls]=process.versions.node.split(".").map(t=>Number(t)),qrt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[q2n]=e,this[Gde]=!1}async*[Symbol.asyncIterator](){KRe(!this[Gde],"disturbed"),this[Gde]=!0,yield*this[q2n]}};function jls(t){return Hrt(t)?(z2n(t)===0&&t.on("data",function(){KRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Gde]=!1,Fls.prototype.on.call(t,"data",function(){this[Gde]=!0})),t):t&&typeof t.pipeTo=="function"?new qrt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&W2n(t)?new qrt(t):t}a(jls,"wrapRequestBody");function Hls(){}a(Hls,"nop");function Hrt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Hrt,"isStream");function G2n(t){if(t===null)return!1;if(t instanceof Ols)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(G2n,"isBlobLike");function Gls(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Bls(e);return r&&(t+="?"+r),t}a(Gls,"buildURL");function $2n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a($2n,"isValidPort");function Qrt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Qrt,"isHttpOrHttpsPrefixed");function V2n(t){if(typeof t=="string"){if(t=new URL(t),!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new xg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&$2n(t.port)===!1)throw new xg("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 xg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new xg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new xg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new xg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Qrt(t.origin||t.protocol))throw new xg("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(!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(V2n,"parseURL");function $ls(t){if(t=V2n(t),t.pathname!=="/"||t.search||t.hash)throw new xg("invalid url");return t}a($ls,"parseOrigin");function Vls(t){if(t[0]==="["){let r=t.indexOf("]");return KRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Vls,"getHostname");function Wls(t){if(!t)return null;KRe(typeof t=="string");let e=Vls(t);return Mls.isIP(e)?"":e}a(Wls,"getServerName");function zls(t){return JSON.parse(JSON.stringify(t))}a(zls,"deepClone");function Yls(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Yls,"isAsyncIterable");function W2n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(W2n,"isIterable");function z2n(t){if(t==null)return 0;if(Hrt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(G2n(t))return t.size!=null?t.size:null;if(J2n(t))return t.byteLength}return null}a(z2n,"bodyLength");function Y2n(t){return t&&!!(t.destroyed||t[j2n]||jrt.isDestroyed?.(t))}a(Y2n,"isDestroyed");function Kls(t,e){t==null||!Hrt(t)||Y2n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Nls&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[j2n]=!0))}a(Kls,"destroy");var Jls=/timeout=(\d+)/;function Zls(t){let e=t.toString().match(Jls);return e?parseInt(e[1],10)*1e3:null}a(Zls,"parseKeepAliveTimeout");function K2n(t){return typeof t=="string"?Uls[t]??t.toLowerCase():H2n.lookup(t)??t.toString("latin1").toLowerCase()}a(K2n,"headerNameToString");function Xls(t){return H2n.lookup(t)??t.toString("latin1").toLowerCase()}a(Xls,"bufferToLowerCasedHeaderName");function eus(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(eus,"parseHeaders");function tus(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(aus,"ReadableStreamFrom");function cus(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(cus,"isFormDataLike");function lus(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(lus,"addAbortListener");var uus=typeof String.prototype.toWellFormed=="function",dus=typeof String.prototype.isWellFormed=="function";function Z2n(t){return uus?`${t}`.toWellFormed():Lls.toUSVString(t)}a(Z2n,"toUSVString");function fus(t){return dus?`${t}`.isWellFormed():Z2n(t)===`${t}`}a(fus,"isUSVString");function X2n(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(X2n,"isTokenCharCode");function pus(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),sXt=require("node:util"),Grt=sXt.debuglog("undici"),oXt=sXt.debuglog("fetch"),QJ=sXt.debuglog("websocket"),nDn=!1,_us={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(Grt.enabled||oXt.enabled){let t=oXt.enabled?oXt:Grt;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)}),nDn=!0}if(QJ.enabled){if(!nDn){let t=Grt.enabled?Grt:QJ;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;QJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;QJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{QJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{QJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{QJ("pong received")})}iDn.exports={channels:_us}});var cDn=I((AZd,aDn)=>{"use strict";p();var{InvalidArgumentError:Su,NotSupportedError:vus}=Ec(),TF=require("node:assert"),{isValidHTTPToken:sDn,isValidHeaderValue:aXt,isStream:Cus,destroy:bus,isBuffer:Sus,isFormDataLike:Tus,isIterable:Ius,isBlobLike:xus,buildURL:wus,validateHandler:Rus,getServerName:kus,normalizedMethodRecords:Pus}=qs(),{channels:c5}=$de(),{headerNameLowerCasedRecord:oDn}=Frt(),Dus=/[^\u0021-\u00ff]/,_w=Symbol("handler"),cXt=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 Su("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Su("path must be an absolute URL or start with a slash");if(Dus.test(r))throw new Su("invalid request path");if(typeof n!="string")throw new Su("method must be a string");if(Pus[n]===void 0&&!sDn(n))throw new Su("invalid request method");if(d&&typeof d!="string")throw new Su("upgrade must be a string");if(d&&!aXt(d))throw new Su("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Su("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Su("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Su("invalid reset");if(A!=null&&typeof A!="boolean")throw new Su("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(Cus(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){bus(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(Sus(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(Tus(o)||Ius(o)||xus(o))this.body=o;else throw new Su("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?wus(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 Su("headers array must be even");for(let _=0;_{"use strict";p();var Nus=require("node:events"),Vrt=class extends Nus{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 lXt(this,n)}},lXt=class extends Vrt{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)}};lDn.exports=Vrt});var Yde=I((bZd,uDn)=>{"use strict";p();var Mus=JRe(),{ClientDestroyedError:uXt,ClientClosedError:Ous,InvalidArgumentError:Vde}=Ec(),{kDestroy:Lus,kClose:Bus,kClosed:ZRe,kDestroyed:Wde,kDispatch:dXt,kInterceptors:qJ}=jd(),IF=Symbol("onDestroyed"),zde=Symbol("onClosed"),Wrt=Symbol("Intercepted Dispatch"),fXt=class extends Mus{static{a(this,"DispatcherBase")}constructor(){super(),this[Wde]=!1,this[IF]=null,this[ZRe]=!1,this[zde]=[]}get destroyed(){return this[Wde]}get closed(){return this[ZRe]}get interceptors(){return this[qJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[qJ][r]!="function")throw new Vde("interceptor must be an function")}this[qJ]=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 Vde("invalid callback");if(this[Wde]){queueMicrotask(()=>e(new uXt,null));return}if(this[ZRe]){this[zde]?this[zde].push(e):queueMicrotask(()=>e(null,null));return}this[ZRe]=!0,this[zde].push(e);let r=a(()=>{let n=this[zde];this[zde]=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 Vde("invalid callback");if(this[Wde]){this[IF]?this[IF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new uXt),this[Wde]=!0,this[IF]=this[IF]||[],this[IF].push(r);let n=a(()=>{let o=this[IF];this[IF]=null;for(let s=0;s{queueMicrotask(n)})}[Wrt](e,r){if(!this[qJ]||this[qJ].length===0)return this[Wrt]=this[dXt],this[dXt](e,r);let n=this[dXt].bind(this);for(let o=this[qJ].length-1;o>=0;o--)n=this[qJ][o](n);return this[Wrt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Vde("handler must be an object");try{if(!e||typeof e!="object")throw new Vde("opts must be an object.");if(this[Wde]||this[IF])throw new uXt;if(this[ZRe])throw new Ous;return this[Wrt](e,r)}catch(n){if(typeof r.onError!="function")throw new Vde("invalid onError method");return r.onError(n),!1}}};uDn.exports=fXt});var EXt=I((IZd,hDn)=>{"use strict";p();var Kde=0,pXt=1e3,hXt=(pXt>>1)-1,xF,mXt=Symbol("kFastTimer"),wF=[],gXt=-2,AXt=-1,fDn=0,dDn=1;function yXt(){Kde+=hXt;let t=0,e=wF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=AXt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===AXt?(r._state=gXt,--e!==0&&(wF[t]=wF[e])):++t}wF.length=e,wF.length!==0&&pDn()}a(yXt,"onTick");function pDn(){xF?xF.refresh():(clearTimeout(xF),xF=setTimeout(yXt,hXt),xF.unref&&xF.unref())}a(pDn,"refreshTimeout");var zrt=class{static{a(this,"FastTimer")}[mXt]=!0;_state=gXt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===gXt&&wF.push(this),(!xF||wF.length===1)&&pDn(),this._state=fDn}clear(){this._state=AXt,this._idleStart=-1}};hDn.exports={setTimeout(t,e,r){return e<=pXt?setTimeout(t,e,r):new zrt(t,e,r)},clearTimeout(t){t[mXt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new zrt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Kde},tick(t=0){Kde+=t-pXt+1,yXt(),yXt()},reset(){Kde=0,wF.length=0,clearTimeout(xF),xF=null},kFastTimer:mXt}});var XRe=I((PZd,EDn)=>{"use strict";p();var Fus=require("node:net"),mDn=require("node:assert"),yDn=qs(),{InvalidArgumentError:Uus,ConnectTimeoutError:Qus}=Ec(),Yrt=EXt();function gDn(){}a(gDn,"noop");var _Xt,vXt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?vXt=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 qus({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Uus("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new vXt(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:"){_Xt||(_Xt=require("node:tls")),g=g||c.servername||yDn.getServerName(f)||null;let b=g||d;mDn(b);let T=o||l.get(b)||null;m=m||443,_=_Xt.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 mDn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Fus.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=jus(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(qus,"buildConnector");var jus=process.platform==="win32"?(t,e)=>{if(!e.timeout)return gDn;let r=null,n=null,o=Yrt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>ADn(t.deref(),e))})},e.timeout);return()=>{Yrt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return gDn;let r=null,n=Yrt.setFastTimeout(()=>{r=setImmediate(()=>{ADn(t.deref(),e)})},e.timeout);return()=>{Yrt.clearFastTimeout(n),clearImmediate(r)}};function ADn(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)`,yDn.destroy(t,new Qus(r))}a(ADn,"onConnectTimeout");EDn.exports=qus});var _Dn=I(Krt=>{"use strict";p();Object.defineProperty(Krt,"__esModule",{value:!0});Krt.enumToMap=void 0;function Hus(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Hus,"enumToMap");Krt.enumToMap=Hus});var vDn=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 Gus=_Dn(),$us;(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"})($us=Pr.ERROR||(Pr.ERROR={}));var Vus;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Vus=Pr.TYPE||(Pr.TYPE={}));var Wus;(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"})(Wus=Pr.FLAGS||(Pr.FLAGS={}));var zus;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(zus=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var Mi;(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"})(Mi=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[Mi.DELETE,Mi.GET,Mi.HEAD,Mi.POST,Mi.PUT,Mi.CONNECT,Mi.OPTIONS,Mi.TRACE,Mi.COPY,Mi.LOCK,Mi.MKCOL,Mi.MOVE,Mi.PROPFIND,Mi.PROPPATCH,Mi.SEARCH,Mi.UNLOCK,Mi.BIND,Mi.REBIND,Mi.UNBIND,Mi.ACL,Mi.REPORT,Mi.MKACTIVITY,Mi.CHECKOUT,Mi.MERGE,Mi["M-SEARCH"],Mi.NOTIFY,Mi.SUBSCRIBE,Mi.UNSUBSCRIBE,Mi.PATCH,Mi.PURGE,Mi.MKCALENDAR,Mi.LINK,Mi.UNLINK,Mi.PRI,Mi.SOURCE];Pr.METHODS_ICE=[Mi.SOURCE];Pr.METHODS_RTSP=[Mi.OPTIONS,Mi.DESCRIBE,Mi.ANNOUNCE,Mi.SETUP,Mi.PLAY,Mi.PAUSE,Mi.TEARDOWN,Mi.GET_PARAMETER,Mi.SET_PARAMETER,Mi.REDIRECT,Mi.RECORD,Mi.FLUSH,Mi.GET,Mi.POST];Pr.METHOD_MAP=Gus.enumToMap(Mi);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var Yus;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(Yus=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 Jde;(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"})(Jde=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Jde.CONNECTION,"content-length":Jde.CONTENT_LENGTH,"proxy-connection":Jde.CONNECTION,"transfer-encoding":Jde.TRANSFER_ENCODING,upgrade:Jde.UPGRADE}});var CXt=I((UZd,CDn)=>{"use strict";p();var{Buffer:Kus}=require("node:buffer");CDn.exports=Kus.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 SDn=I((qZd,bDn)=>{"use strict";p();var{Buffer:Jus}=require("node:buffer");bDn.exports=Jus.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 eke=I((HZd,DDn)=>{"use strict";p();var TDn=["GET","HEAD","POST"],Zus=new Set(TDn),Xus=[101,204,205,304],IDn=[301,302,303,307,308],eds=new Set(IDn),xDn=["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"],tds=new Set(xDn),wDn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],rds=new Set(wDn),nds=["follow","manual","error"],RDn=["GET","HEAD","OPTIONS","TRACE"],ids=new Set(RDn),ods=["navigate","same-origin","no-cors","cors"],sds=["omit","same-origin","include"],ads=["default","no-store","reload","no-cache","force-cache","only-if-cached"],cds=["content-encoding","content-language","content-location","content-type","content-length"],lds=["half"],kDn=["CONNECT","TRACE","TRACK"],uds=new Set(kDn),PDn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],dds=new Set(PDn);DDn.exports={subresource:PDn,forbiddenMethods:kDn,requestBodyHeader:cds,referrerPolicy:wDn,requestRedirect:nds,requestMode:ods,requestCredentials:sds,requestCache:ads,redirectStatus:IDn,corsSafeListedMethods:TDn,nullBodyStatus:Xus,safeMethods:RDn,badPorts:xDn,requestDuplex:lds,subresourceSet:dds,badPortsSet:tds,redirectStatusSet:eds,corsSafeListedMethodsSet:Zus,safeMethodsSet:ids,forbiddenMethodsSet:uds,referrerPolicySet:rds}});var SXt=I(($Zd,NDn)=>{"use strict";p();var bXt=Symbol.for("undici.globalOrigin.1");function fds(){return globalThis[bXt]}a(fds,"getGlobalOrigin");function pds(t){if(t===void 0){Object.defineProperty(globalThis,bXt,{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,bXt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(pds,"setGlobalOrigin");NDn.exports={getGlobalOrigin:fds,setGlobalOrigin:pds}});var nb=I((zZd,QDn)=>{"use strict";p();var Zrt=require("node:assert"),hds=new TextEncoder,tke=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,mds=/[\u000A\u000D\u0009\u0020]/,gds=/[\u0009\u000A\u000C\u000D\u0020]/g,Ads=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function yds(t){Zrt(t.protocol==="data:");let e=LDn(t,!0);e=e.slice(5);let r={position:0},n=Zde(",",e,r),o=n.length;if(n=Sds(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=BDn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=UDn(c);if(c=_ds(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=TXt(n);return l==="failure"&&(l=TXt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(yds,"dataURLProcessor");function LDn(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(LDn,"URLSerializer");function Xrt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(MDn,"isHexCharByte");function ODn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(ODn,"hexByteToNumber");function Eds(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Zde(";",t,e);if(n=Jrt(n,!1,!0),n.length===0||!tke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionmds.test(d),t,e);let l=Xrt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=FDn(t,e,!0),Zde(";",t,e);else if(u=Zde(";",t,e),u=Jrt(u,!1,!0),u.length===0)continue;l.length!==0&&tke.test(l)&&(u.length===0||Ads.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(TXt,"parseMIMEType");function _ds(t){t=t.replace(gds,"");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(_ds,"forgivingBase64");function FDn(t,e,r){let n=e.position,o="";for(Zrt(t[e.position]==='"'),e.position++;o+=Xrt(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{Zrt(s==='"');break}}return r?o:t.slice(n,e.position)}a(FDn,"collectAnHTTPQuotedString");function vds(t){Zrt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",tke.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(vds,"serializeAMimeType");function Cds(t){return t===13||t===10||t===9||t===32}a(Cds,"isHTTPWhiteSpace");function Jrt(t,e=!0,r=!0){return IXt(t,e,r,Cds)}a(Jrt,"removeHTTPWhitespace");function bds(t){return t===13||t===10||t===9||t===12||t===32}a(bds,"isASCIIWhitespace");function Sds(t,e=!0,r=!0){return IXt(t,e,r,bds)}a(Sds,"removeASCIIWhitespace");function IXt(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(IXt,"removeChars");function UDn(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(UDn,"isomorphicDecode");function Tds(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(Tds,"minimizeSupportedMimeType");QDn.exports={dataURLProcessor:yds,URLSerializer:LDn,collectASequenceOfCodePoints:Xrt,collectASequenceOfCodePointsFast:Zde,stringPercentDecode:BDn,parseMIMEType:TXt,collectAnHTTPQuotedString:FDn,serializeAMimeType:vds,removeChars:IXt,removeHTTPWhitespace:Jrt,minimizeSupportedMimeType:Tds,HTTP_TOKEN_CODEPOINTS:tke,isomorphicDecode:UDn}});var qA=I((JZd,qDn)=>{"use strict";p();var{types:l5,inspect:Ids}=require("node:util"),{markAsUncloneable:xds}=require("node:worker_threads"),{toUSVString:wds}=qs(),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 Ids(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(!l5.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=wds;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"||!l5.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&l5.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"||!l5.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&&l5.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"||!l5.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&l5.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(l5.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(l5.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(l5.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);qDn.exports={webidl:Er}});var sT=I((XZd,tNn)=>{"use strict";p();var{Transform:Rds}=require("node:stream"),jDn=require("node:zlib"),{redirectStatusSet:kds,referrerPolicySet:Pds,badPortsSet:Dds}=eke(),{getGlobalOrigin:HDn}=SXt(),{collectASequenceOfCodePoints:jJ,collectAnHTTPQuotedString:Nds,removeChars:Mds,parseMIMEType:Ods}=nb(),{performance:Lds}=require("node:perf_hooks"),{isBlobLike:Bds,ReadableStreamFrom:Fds,isValidHTTPToken:GDn,normalizedMethodRecordsBase:Uds}=qs(),HJ=require("node:assert"),{isUint8Array:Qds}=require("node:util/types"),{webidl:rke}=qA(),$Dn=[],tnt;try{tnt=require("node:crypto");let t=["sha256","sha384","sha512"];$Dn=tnt.getHashes().filter(e=>t.includes(e))}catch{}function VDn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(VDn,"responseURL");function qds(t,e){if(!kds.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&zDn(r)&&(WDn(r)||(r=jds(r)),r=new URL(r,VDn(t))),r&&!r.hash&&(r.hash=e),r}a(qds,"responseLocationURL");function WDn(t){for(let e=0;e126||r<32)return!1}return!0}a(WDn,"isValidEncodedURL");function jds(t){return Buffer.from(t,"binary").toString("utf8")}a(jds,"normalizeBinaryStringToUtf8");function ike(t){return t.urlList[t.urlList.length-1]}a(ike,"requestCurrentURL");function Hds(t){let e=ike(t);return XDn(e)&&Dds.has(e.port)?"blocked":"allowed"}a(Hds,"requestBadPort");function Gds(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Gds,"isErrorLike");function $ds(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a($ds,"isValidReasonPhrase");var Vds=GDn;function zDn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(zDn,"isValidHeaderValue");function Wds(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(Pds.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Wds,"setRequestReferrerPolicyOnRedirect");function zds(){return"allowed"}a(zds,"crossOriginResourcePolicyCheck");function Yds(){return"success"}a(Yds,"corsCheck");function Kds(){return"success"}a(Kds,"TAOCheck");function Jds(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Jds,"appendFetchMetadata");function Zds(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&&wXt(t.origin)&&!wXt(ike(t))&&(e=null);break;case"same-origin":rnt(t,ike(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Zds,"appendRequestOriginHeader");function Xde(t,e){return t}a(Xde,"coarsenTime");function Xds(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=rnt(t,n),c=nke(n)&&!nke(t.url);switch(e){case"origin":return o??xXt(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=ike(t);return rnt(n,l)?n:nke(n)&&!nke(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(nfs,"determineRequestsReferrer");function xXt(t,e){return HJ(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(xXt,"stripURLForReferrer");function nke(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(nke,"isURLPotentiallyTrustworthy");function ifs(t,e){if(tnt===void 0)return!0;let r=KDn(e);if(r==="no metadata"||r.length===0)return!0;let n=sfs(r),o=afs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=tnt.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)),cfs(u,l))return!0}return!1}a(ifs,"bytesMatch");var ofs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function KDn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=ofs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();$Dn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(KDn,"parseMetadata");function sfs(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(ufs,"createDeferredPromise");function dfs(t){return t.controller.state==="aborted"}a(dfs,"isAborted");function ffs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(ffs,"isCancelled");function pfs(t){return Uds[t.toLowerCase()]??t}a(pfs,"normalizeMethod");function hfs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return HJ(typeof e=="string"),e}a(hfs,"serializeJavascriptValueToJSONString");var mfs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function JDn(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,mfs),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(JDn,"createIterator");function gfs(t,e,r,n=0,o=1){let s=JDn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(rke.brandCheck(this,e),rke.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(gfs,"iteratorMixin");async function Afs(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await ZDn(s))}catch(c){o(c)}}a(Afs,"fullyReadBody");function yfs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(yfs,"isReadableStreamLike");function Efs(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(Efs,"readableStreamClose");var _fs=/[^\x00-\xFF]/;function ent(t){return HJ(!_fs.test(t)),t}a(ent,"isomorphicEncode");async function ZDn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Qds(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(ZDn,"readAllBytes");function vfs(t){HJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(vfs,"urlIsLocal");function wXt(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(wXt,"urlHasHttpsScheme");function XDn(t){HJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(XDn,"urlIsHttpHttpsScheme");function Cfs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let o=jJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let c=jJ(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(Cfs,"simpleRangeHeaderValue");function bfs(t,e,r){let n="bytes ";return n+=ent(`${t}`),n+="-",n+=ent(`${e}`),n+="/",n+=ent(`${r}`),n}a(bfs,"buildContentRange");var RXt=class extends Rds{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?jDn.createInflate(this.#e):jDn.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 Sfs(t){return new RXt(t)}a(Sfs,"createInflate");function Tfs(t){let e=null,r=null,n=null,o=eNn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Ods(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(Tfs,"extractMimeType");function Ifs(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(Ifs,"gettingDecodingSplitting");function eNn(t,e){let r=e.get(t,!0);return r===null?null:Ifs(r)}a(eNn,"getDecodeSplit");var xfs=new TextDecoder;function wfs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),xfs.decode(t))}a(wfs,"utf8DecodeBytes");var kXt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return HDn()}get origin(){return this.baseUrl?.origin}policyContainer=YDn()},PXt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new kXt},Rfs=new PXt;tNn.exports={isAborted:dfs,isCancelled:ffs,isValidEncodedURL:WDn,createDeferredPromise:ufs,ReadableStreamFrom:Fds,tryUpgradeRequestToAPotentiallyTrustworthyURL:lfs,clampAndCoarsenConnectionTimingInfo:Xds,coarsenedSharedCurrentTime:efs,determineRequestsReferrer:nfs,makePolicyContainer:YDn,clonePolicyContainer:rfs,appendFetchMetadata:Jds,appendRequestOriginHeader:Zds,TAOCheck:Kds,corsCheck:Yds,crossOriginResourcePolicyCheck:zds,createOpaqueTimingInfo:tfs,setRequestReferrerPolicyOnRedirect:Wds,isValidHTTPToken:GDn,requestBadPort:Hds,requestCurrentURL:ike,responseURL:VDn,responseLocationURL:qds,isBlobLike:Bds,isURLPotentiallyTrustworthy:nke,isValidReasonPhrase:$ds,sameOrigin:rnt,normalizeMethod:pfs,serializeJavascriptValueToJSONString:hfs,iteratorMixin:gfs,createIterator:JDn,isValidHeaderName:Vds,isValidHeaderValue:zDn,isErrorLike:Gds,fullyReadBody:Afs,bytesMatch:ifs,isReadableStreamLike:yfs,readableStreamClose:Efs,isomorphicEncode:ent,urlIsLocal:vfs,urlHasHttpsScheme:wXt,urlIsHttpHttpsScheme:XDn,readAllBytes:ZDn,simpleRangeHeaderValue:Cfs,buildContentRange:bfs,parseMetadata:KDn,createInflate:Sfs,extractMimeType:Tfs,getDecodeSplit:eNn,utf8DecodeBytes:wfs,environmentSettingsObject:Rfs}});var oj=I((rXd,rNn)=>{"use strict";p();rNn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var NXt=I((iXd,nNn)=>{"use strict";p();var{Blob:kfs,File:Pfs}=require("node:buffer"),{kState:RF}=oj(),{webidl:u5}=qA(),DXt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[RF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return u5.brandCheck(this,t),this[RF].blobLike.stream(...e)}arrayBuffer(...e){return u5.brandCheck(this,t),this[RF].blobLike.arrayBuffer(...e)}slice(...e){return u5.brandCheck(this,t),this[RF].blobLike.slice(...e)}text(...e){return u5.brandCheck(this,t),this[RF].blobLike.text(...e)}get size(){return u5.brandCheck(this,t),this[RF].blobLike.size}get type(){return u5.brandCheck(this,t),this[RF].blobLike.type}get name(){return u5.brandCheck(this,t),this[RF].name}get lastModified(){return u5.brandCheck(this,t),this[RF].lastModified}get[Symbol.toStringTag](){return"File"}};u5.converters.Blob=u5.interfaceConverter(kfs);function Dfs(t){return t instanceof Pfs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Dfs,"isFileLike");nNn.exports={FileLike:DXt,isFileLike:Dfs}});var ske=I((aXd,cNn)=>{"use strict";p();var{isBlobLike:nnt,iteratorMixin:Nfs}=sT(),{kState:nv}=oj(),{kEnumerableProperty:efe}=qs(),{FileLike:iNn,isFileLike:Mfs}=NXt(),{webidl:Tu}=qA(),{File:aNn}=require("node:buffer"),oNn=require("node:util"),sNn=globalThis.File??aNn,oke=class t{static{a(this,"FormData")}constructor(e){if(Tu.util.markAsUncloneable(this),e!==void 0)throw Tu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[nv]=[]}append(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.append";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!nnt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=nnt(r)?Tu.converters.Blob(r,o,"value",{strict:!1}):Tu.converters.USVString(r,o,"value"),n=arguments.length===3?Tu.converters.USVString(n,o,"filename"):void 0;let s=MXt(e,r,n);this[nv].push(s)}delete(e){Tu.brandCheck(this,t);let r="FormData.delete";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv]=this[nv].filter(n=>n.name!==e)}get(e){Tu.brandCheck(this,t);let r="FormData.get";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name");let n=this[nv].findIndex(o=>o.name===e);return n===-1?null:this[nv][n].value}getAll(e){Tu.brandCheck(this,t);let r="FormData.getAll";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv].filter(n=>n.name===e).map(n=>n.value)}has(e){Tu.brandCheck(this,t);let r="FormData.has";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.set";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!nnt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=nnt(r)?Tu.converters.Blob(r,o,"name",{strict:!1}):Tu.converters.USVString(r,o,"name"),n=arguments.length===3?Tu.converters.USVString(n,o,"name"):void 0;let s=MXt(e,r,n),c=this[nv].findIndex(l=>l.name===e);c!==-1?this[nv]=[...this[nv].slice(0,c),s,...this[nv].slice(c+1).filter(l=>l.name!==e)]:this[nv].push(s)}[oNn.inspect.custom](e,r){let n=this[nv].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=oNn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Nfs("FormData",oke,nv,"name","value");Object.defineProperties(oke.prototype,{append:efe,delete:efe,get:efe,getAll:efe,has:efe,set:efe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function MXt(t,e,r){if(typeof e!="string"){if(Mfs(e)||(e=e instanceof Blob?new sNn([e],"blob",{type:e.type}):new iNn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof aNn?new sNn([e],r,n):new iNn(e,r,n)}}return{name:t,value:e}}a(MXt,"makeEntry");cNn.exports={FormData:oke,makeEntry:MXt}});var hNn=I((uXd,pNn)=>{"use strict";p();var{isUSVString:lNn,bufferToLowerCasedHeaderName:Ofs}=qs(),{utf8DecodeBytes:Lfs}=sT(),{HTTP_TOKEN_CODEPOINTS:Bfs,isomorphicDecode:uNn}=nb(),{isFileLike:Ffs}=NXt(),{makeEntry:Ufs}=ske(),int=require("node:assert"),{File:Qfs}=require("node:buffer"),qfs=globalThis.File??Qfs,jfs=Buffer.from('form-data; name="'),dNn=Buffer.from("; filename"),Hfs=Buffer.from("--"),Gfs=Buffer.from(`--\r -`);function $fs(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(Vfs,"validateBoundary");function Wfs(t,e){int(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&&ont(t,Hfs,s)||s.position===t.length-4&&ont(t,Gfs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=zfs(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",$fs(f)||(f=""),g=new qfs([m],d,{type:f})):g=Lfs(Buffer.from(m)),int(lNn(u)),int(typeof g=="string"&&lNn(g)||Ffs(g)),o.push(Ufs(u,g,d))}}a(Wfs,"multipartFormDataParser");function zfs(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=tfe(l=>l!==10&&l!==13&&l!==58,t,e);if(c=OXt(c,!0,!0,l=>l===9||l===32),!Bfs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,tfe(l=>l===32||l===9,t,e),Ofs(c)){case"content-disposition":{if(r=n=null,!ont(t,jfs,e)||(e.position+=17,r=fNn(t,e),r===null))return"failure";if(ont(t,dNn,e)){let l=e.position+dNn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=fNn(t,e),n===null))return"failure"}break}case"content-type":{let l=tfe(u=>u!==10&&u!==13,t,e);l=OXt(l,!1,!0,u=>u===9||u===32),o=uNn(l);break}case"content-transfer-encoding":{let l=tfe(u=>u!==10&&u!==13,t,e);l=OXt(l,!1,!0,u=>u===9||u===32),s=uNn(l);break}default:tfe(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(zfs,"parseMultipartFormDataHeaders");function fNn(t,e){int(t[e.position-1]===34);let r=tfe(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(fNn,"parseMultipartFormDataName");function tfe(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(OXt,"removeChars");function ont(t,e,r){if(t.length{"use strict";p();var ake=qs(),{ReadableStreamFrom:Yfs,isBlobLike:mNn,isReadableStreamLike:Kfs,readableStreamClose:Jfs,createDeferredPromise:Zfs,fullyReadBody:Xfs,extractMimeType:eps,utf8DecodeBytes:yNn}=sT(),{FormData:gNn}=ske(),{kState:nfe}=oj(),{webidl:tps}=qA(),{Blob:rps}=require("node:buffer"),LXt=require("node:assert"),{isErrored:ENn,isDisturbed:nps}=require("node:stream"),{isArrayBuffer:ips}=require("node:util/types"),{serializeAMimeType:ops}=nb(),{multipartFormDataParser:sps}=hNn(),BXt;try{let t=require("node:crypto");BXt=a(e=>t.randomInt(0,e),"random")}catch{BXt=a(t=>Math.floor(Math.random(t)),"random")}var snt=new TextEncoder;function aps(){}a(aps,"noop");var _Nn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,vNn;_Nn&&(vNn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!nps(e)&&!ENn(e)&&e.cancel("Response object has been garbage collected").catch(aps)}));function CNn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:mNn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?snt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>Jfs(u))},start(){},type:"bytes"}),LXt(Kfs(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(ips(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(ake.isFormDataLike(t)){let u=`----formdata-undici-0${`${BXt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+s),t.push(o+"m+"+wZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=wYo()+e+" "+t[0]}a(xYo,"formatArgs");function wYo(){return Cg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(wYo,"getDate");function RYo(...t){return process.stderr.write(xZe.formatWithOptions(Cg.inspectOpts,...t)+` +`)}a(RYo,"log");function kYo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(kYo,"save");function PYo(){return process.env.DEBUG}a(PYo,"load");function DYo(t){t.inspectOpts={};let e=Object.keys(Cg.inspectOpts);for(let r=0;re.trim()).join(" ")};eSn.O=function(t){return this.inspectOpts.colors=this.useColors,xZe.inspect(t,this.inspectOpts)}});var rSn=I((ogd,LHt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?LHt.exports=X1n():LHt.exports=tSn()});var FHt=I(oJ=>{"use strict";p();Object.defineProperty(oJ,"__esModule",{value:!0});oJ.createDeferred=oJ.deferred=void 0;function BHt(){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(BHt,"deferred");oJ.deferred=BHt;oJ.createDeferred=BHt;oJ.default=BHt});var eXe=I(rT=>{"use strict";p();Object.defineProperty(rT,"__esModule",{value:!0});rT.deepClone=ixn;rT.deepFreeze=AXo;rT.cloneAndChange=yXo;rT.mixin=sxn;rT.equals=kwe;rT.safeStringify=EXo;rT.stableStringify=_Xo;rT.distinct=vXo;rT.getCaseInsensitive=CXo;rT.filter=bXo;rT.mapValues=SXo;var qq=ZS();function ixn(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"?ixn(n):n}),e}a(ixn,"deepClone");function AXo(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(oxn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,qq.isTypedArray)(o)&&e.push(o)}}return t}a(AXo,"deepFreeze");var oxn=Object.prototype.hasOwnProperty;function yXo(t,e){return UGt(t,e,new Set)}a(yXo,"cloneAndChange");function UGt(t,e,r){if((0,qq.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(UGt(s,e,r));return o}if((0,qq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)oxn.call(t,s)&&(o[s]=UGt(t[s],e,r));return r.delete(t),o}return t}a(UGt,"_cloneAndChange");function sxn(t,e,r=!0){return(0,qq.isObject)(t)?((0,qq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,qq.isObject)(t[n])&&(0,qq.isObject)(e[n])?sxn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(sxn,"mixin");function kwe(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,qq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(EXo,"safeStringify");function _Xo(t){if(t===void 0)return"undefined";try{return QGt(t,new WeakSet)}catch{return""}}a(_Xo,"stableStringify");function QGt(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=>QGt(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)+":"+QGt(s,e))}return"{"+n.join(",")+"}"}a(QGt,"_stableStringify");function vXo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];kwe(s,c)||(r[o]=c)}),r}a(vXo,"distinct");function CXo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(CXo,"getCaseInsensitive");function bXo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(bXo,"filter");function SXo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(SXo,"mapValues")});var tv=I(tXe=>{"use strict";p();Object.defineProperty(tXe,"__esModule",{value:!0});tXe.ErrorUtils=void 0;var TXo=eXe(),axn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,TXo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(axn||(tXe.ErrorUtils=axn={}))});var fw=I(rXe=>{"use strict";p();Object.defineProperty(rXe,"__esModule",{value:!0});rXe.Result=void 0;var qGt=tv(),cxn;(function(t){function e(c){return new jGt(c)}a(e,"ok"),t.ok=e;function r(c){return new HGt(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(qGt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(qGt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(cxn||(rXe.Result=cxn={}));var jGt=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}},HGt=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:qGt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Gd=I((CZd,m2n)=>{p();m2n.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 Ec=I((SZd,Q2n)=>{"use strict";p();var g2n=Symbol.for("undici.error.UND_ERR"),$d=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[g2n]===!0}[g2n]=!0},A2n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),BZt=class extends $d{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[A2n]===!0}[A2n]=!0},y2n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),FZt=class extends $d{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[y2n]===!0}[y2n]=!0},E2n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),UZt=class extends $d{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[E2n]===!0}[E2n]=!0},_2n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),QZt=class extends $d{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[_2n]===!0}[_2n]=!0},v2n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),qZt=class extends $d{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[v2n]===!0}[v2n]=!0},C2n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),jZt=class extends $d{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[C2n]===!0}[C2n]=!0},b2n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),HZt=class extends $d{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[b2n]===!0}[b2n]=!0},S2n=Symbol.for("undici.error.UND_ERR_ABORT"),jrt=class extends $d{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[S2n]===!0}[S2n]=!0},T2n=Symbol.for("undici.error.UND_ERR_ABORTED"),GZt=class extends jrt{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[T2n]===!0}[T2n]=!0},I2n=Symbol.for("undici.error.UND_ERR_INFO"),$Zt=class extends $d{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[I2n]===!0}[I2n]=!0},x2n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),VZt=class extends $d{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[x2n]===!0}[x2n]=!0},w2n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),WZt=class extends $d{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[w2n]===!0}[w2n]=!0},R2n=Symbol.for("undici.error.UND_ERR_DESTROYED"),zZt=class extends $d{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[R2n]===!0}[R2n]=!0},k2n=Symbol.for("undici.error.UND_ERR_CLOSED"),YZt=class extends $d{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[k2n]===!0}[k2n]=!0},P2n=Symbol.for("undici.error.UND_ERR_SOCKET"),KZt=class extends $d{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[P2n]===!0}[P2n]=!0},D2n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),JZt=class extends $d{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[D2n]===!0}[D2n]=!0},N2n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),ZZt=class extends $d{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[N2n]===!0}[N2n]=!0},M2n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),XZt=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[M2n]===!0}[M2n]=!0},O2n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),eXt=class extends $d{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[O2n]===!0}[O2n]=!0},L2n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),tXt=class extends $d{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[L2n]===!0}[L2n]=!0},B2n=Symbol.for("undici.error.UND_ERR_RESPONSE"),rXt=class extends $d{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[B2n]===!0}[B2n]=!0},F2n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),nXt=class extends $d{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[F2n]===!0}[F2n]=!0},U2n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),iXt=class extends $d{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[U2n]===!0}get[U2n](){return!0}};Q2n.exports={AbortError:jrt,HTTPParserError:XZt,UndiciError:$d,HeadersTimeoutError:FZt,HeadersOverflowError:UZt,BodyTimeoutError:QZt,RequestContentLengthMismatchError:VZt,ConnectTimeoutError:BZt,ResponseStatusCodeError:qZt,InvalidArgumentError:jZt,InvalidReturnValueError:HZt,RequestAbortedError:GZt,ClientDestroyedError:zZt,ClientClosedError:YZt,InformationalError:$Zt,SocketError:KZt,NotSupportedError:JZt,ResponseContentLengthMismatchError:WZt,BalancedPoolMissingUpstreamError:ZZt,ResponseExceededMaxSizeError:eXt,RequestRetryError:tXt,ResponseError:rXt,SecureProxyConnectionError:nXt,MessageSizeExceededError:iXt}});var Grt=I((xZd,q2n)=>{"use strict";p();var Hrt={},oXt=["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:j2n,headerNameLowerCasedRecord:Wls}=Grt(),sXt=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 XRe=require("node:assert"),{kDestroyed:W2n,kBodyUsed:$de,kListeners:aXt,kBody:V2n}=Gd(),{IncomingMessage:zls}=require("node:http"),zrt=require("node:stream"),Yls=require("node:net"),{Blob:Kls}=require("node:buffer"),Jls=require("node:util"),{stringify:Zls}=require("node:querystring"),{EventEmitter:Xls}=require("node:events"),{InvalidArgumentError:wg}=Ec(),{headerNameLowerCasedRecord:eus}=Grt(),{tree:z2n}=$2n(),[tus,rus]=process.versions.node.split(".").map(t=>Number(t)),Wrt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[V2n]=e,this[$de]=!1}async*[Symbol.asyncIterator](){XRe(!this[$de],"disturbed"),this[$de]=!0,yield*this[V2n]}};function nus(t){return Yrt(t)?(X2n(t)===0&&t.on("data",function(){XRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[$de]=!1,Xls.prototype.on.call(t,"data",function(){this[$de]=!0})),t):t&&typeof t.pipeTo=="function"?new Wrt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&Z2n(t)?new Wrt(t):t}a(nus,"wrapRequestBody");function ius(){}a(ius,"nop");function Yrt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Yrt,"isStream");function Y2n(t){if(t===null)return!1;if(t instanceof Kls)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(Y2n,"isBlobLike");function ous(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Zls(e);return r&&(t+="?"+r),t}a(ous,"buildURL");function K2n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(K2n,"isValidPort");function Vrt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Vrt,"isHttpOrHttpsPrefixed");function J2n(t){if(typeof t=="string"){if(t=new URL(t),!Vrt(t.origin||t.protocol))throw new wg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new wg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&K2n(t.port)===!1)throw new wg("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 wg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new wg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new wg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new wg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Vrt(t.origin||t.protocol))throw new wg("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(!Vrt(t.origin||t.protocol))throw new wg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(J2n,"parseURL");function sus(t){if(t=J2n(t),t.pathname!=="/"||t.search||t.hash)throw new wg("invalid url");return t}a(sus,"parseOrigin");function aus(t){if(t[0]==="["){let r=t.indexOf("]");return XRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(aus,"getHostname");function cus(t){if(!t)return null;XRe(typeof t=="string");let e=aus(t);return Yls.isIP(e)?"":e}a(cus,"getServerName");function lus(t){return JSON.parse(JSON.stringify(t))}a(lus,"deepClone");function uus(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(uus,"isAsyncIterable");function Z2n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(Z2n,"isIterable");function X2n(t){if(t==null)return 0;if(Yrt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(Y2n(t))return t.size!=null?t.size:null;if(rDn(t))return t.byteLength}return null}a(X2n,"bodyLength");function eDn(t){return t&&!!(t.destroyed||t[W2n]||zrt.isDestroyed?.(t))}a(eDn,"isDestroyed");function dus(t,e){t==null||!Yrt(t)||eDn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===zls&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[W2n]=!0))}a(dus,"destroy");var fus=/timeout=(\d+)/;function pus(t){let e=t.toString().match(fus);return e?parseInt(e[1],10)*1e3:null}a(pus,"parseKeepAliveTimeout");function tDn(t){return typeof t=="string"?eus[t]??t.toLowerCase():z2n.lookup(t)??t.toString("latin1").toLowerCase()}a(tDn,"headerNameToString");function hus(t){return z2n.lookup(t)??t.toString("latin1").toLowerCase()}a(hus,"bufferToLowerCasedHeaderName");function mus(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(mus,"parseHeaders");function gus(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(Cus,"ReadableStreamFrom");function bus(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(bus,"isFormDataLike");function Sus(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(Sus,"addAbortListener");var Tus=typeof String.prototype.toWellFormed=="function",Ius=typeof String.prototype.isWellFormed=="function";function nDn(t){return Tus?`${t}`.toWellFormed():Jls.toUSVString(t)}a(nDn,"toUSVString");function xus(t){return Ius?`${t}`.isWellFormed():nDn(t)===`${t}`}a(xus,"isUSVString");function iDn(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(iDn,"isTokenCharCode");function wus(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),uXt=require("node:util"),Krt=uXt.debuglog("undici"),lXt=uXt.debuglog("fetch"),jJ=uXt.debuglog("websocket"),cDn=!1,Ous={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(Krt.enabled||lXt.enabled){let t=lXt.enabled?lXt:Krt;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)}),cDn=!0}if(jJ.enabled){if(!cDn){let t=Krt.enabled?Krt:jJ;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;jJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;jJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{jJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{jJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{jJ("pong received")})}lDn.exports={channels:Ous}});var pDn=I((BZd,fDn)=>{"use strict";p();var{InvalidArgumentError:Su,NotSupportedError:Lus}=Ec(),xF=require("node:assert"),{isValidHTTPToken:dDn,isValidHeaderValue:dXt,isStream:Bus,destroy:Fus,isBuffer:Uus,isFormDataLike:Qus,isIterable:qus,isBlobLike:jus,buildURL:Hus,validateHandler:Gus,getServerName:$us,normalizedMethodRecords:Vus}=qs(),{channels:u5}=Vde(),{headerNameLowerCasedRecord:uDn}=Grt(),Wus=/[^\u0021-\u00ff]/,Cw=Symbol("handler"),fXt=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 Su("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Su("path must be an absolute URL or start with a slash");if(Wus.test(r))throw new Su("invalid request path");if(typeof n!="string")throw new Su("method must be a string");if(Vus[n]===void 0&&!dDn(n))throw new Su("invalid request method");if(d&&typeof d!="string")throw new Su("upgrade must be a string");if(d&&!dXt(d))throw new Su("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Su("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Su("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Su("invalid reset");if(A!=null&&typeof A!="boolean")throw new Su("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(Bus(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){Fus(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(Uus(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(Qus(o)||qus(o)||jus(o))this.body=o;else throw new Su("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?Hus(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 Su("headers array must be even");for(let _=0;_{"use strict";p();var zus=require("node:events"),Zrt=class extends zus{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 pXt(this,n)}},pXt=class extends Zrt{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)}};hDn.exports=Zrt});var Kde=I((HZd,mDn)=>{"use strict";p();var Yus=eke(),{ClientDestroyedError:hXt,ClientClosedError:Kus,InvalidArgumentError:Wde}=Ec(),{kDestroy:Jus,kClose:Zus,kClosed:tke,kDestroyed:zde,kDispatch:mXt,kInterceptors:HJ}=Gd(),wF=Symbol("onDestroyed"),Yde=Symbol("onClosed"),Xrt=Symbol("Intercepted Dispatch"),gXt=class extends Yus{static{a(this,"DispatcherBase")}constructor(){super(),this[zde]=!1,this[wF]=null,this[tke]=!1,this[Yde]=[]}get destroyed(){return this[zde]}get closed(){return this[tke]}get interceptors(){return this[HJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[HJ][r]!="function")throw new Wde("interceptor must be an function")}this[HJ]=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 Wde("invalid callback");if(this[zde]){queueMicrotask(()=>e(new hXt,null));return}if(this[tke]){this[Yde]?this[Yde].push(e):queueMicrotask(()=>e(null,null));return}this[tke]=!0,this[Yde].push(e);let r=a(()=>{let n=this[Yde];this[Yde]=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 Wde("invalid callback");if(this[zde]){this[wF]?this[wF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new hXt),this[zde]=!0,this[wF]=this[wF]||[],this[wF].push(r);let n=a(()=>{let o=this[wF];this[wF]=null;for(let s=0;s{queueMicrotask(n)})}[Xrt](e,r){if(!this[HJ]||this[HJ].length===0)return this[Xrt]=this[mXt],this[mXt](e,r);let n=this[mXt].bind(this);for(let o=this[HJ].length-1;o>=0;o--)n=this[HJ][o](n);return this[Xrt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Wde("handler must be an object");try{if(!e||typeof e!="object")throw new Wde("opts must be an object.");if(this[zde]||this[wF])throw new hXt;if(this[tke])throw new Kus;return this[Xrt](e,r)}catch(n){if(typeof r.onError!="function")throw new Wde("invalid onError method");return r.onError(n),!1}}};mDn.exports=gXt});var bXt=I((VZd,EDn)=>{"use strict";p();var Jde=0,AXt=1e3,yXt=(AXt>>1)-1,RF,EXt=Symbol("kFastTimer"),kF=[],_Xt=-2,vXt=-1,ADn=0,gDn=1;function CXt(){Jde+=yXt;let t=0,e=kF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=vXt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===vXt?(r._state=_Xt,--e!==0&&(kF[t]=kF[e])):++t}kF.length=e,kF.length!==0&&yDn()}a(CXt,"onTick");function yDn(){RF?RF.refresh():(clearTimeout(RF),RF=setTimeout(CXt,yXt),RF.unref&&RF.unref())}a(yDn,"refreshTimeout");var ent=class{static{a(this,"FastTimer")}[EXt]=!0;_state=_Xt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===_Xt&&kF.push(this),(!RF||kF.length===1)&&yDn(),this._state=ADn}clear(){this._state=vXt,this._idleStart=-1}};EDn.exports={setTimeout(t,e,r){return e<=AXt?setTimeout(t,e,r):new ent(t,e,r)},clearTimeout(t){t[EXt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new ent(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Jde},tick(t=0){Jde+=t-AXt+1,CXt(),CXt()},reset(){Jde=0,kF.length=0,clearTimeout(RF),RF=null},kFastTimer:EXt}});var rke=I((JZd,SDn)=>{"use strict";p();var Xus=require("node:net"),_Dn=require("node:assert"),bDn=qs(),{InvalidArgumentError:eds,ConnectTimeoutError:tds}=Ec(),tnt=bXt();function vDn(){}a(vDn,"noop");var SXt,TXt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?TXt=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 rds({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new eds("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new TXt(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:"){SXt||(SXt=require("node:tls")),g=g||c.servername||bDn.getServerName(f)||null;let b=g||d;_Dn(b);let T=o||l.get(b)||null;m=m||443,_=SXt.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 _Dn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Xus.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=nds(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(rds,"buildConnector");var nds=process.platform==="win32"?(t,e)=>{if(!e.timeout)return vDn;let r=null,n=null,o=tnt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>CDn(t.deref(),e))})},e.timeout);return()=>{tnt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return vDn;let r=null,n=tnt.setFastTimeout(()=>{r=setImmediate(()=>{CDn(t.deref(),e)})},e.timeout);return()=>{tnt.clearFastTimeout(n),clearImmediate(r)}};function CDn(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)`,bDn.destroy(t,new tds(r))}a(CDn,"onConnectTimeout");SDn.exports=rds});var TDn=I(rnt=>{"use strict";p();Object.defineProperty(rnt,"__esModule",{value:!0});rnt.enumToMap=void 0;function ids(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(ids,"enumToMap");rnt.enumToMap=ids});var IDn=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 ods=TDn(),sds;(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"})(sds=Pr.ERROR||(Pr.ERROR={}));var ads;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(ads=Pr.TYPE||(Pr.TYPE={}));var cds;(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"})(cds=Pr.FLAGS||(Pr.FLAGS={}));var lds;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(lds=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var Mi;(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"})(Mi=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[Mi.DELETE,Mi.GET,Mi.HEAD,Mi.POST,Mi.PUT,Mi.CONNECT,Mi.OPTIONS,Mi.TRACE,Mi.COPY,Mi.LOCK,Mi.MKCOL,Mi.MOVE,Mi.PROPFIND,Mi.PROPPATCH,Mi.SEARCH,Mi.UNLOCK,Mi.BIND,Mi.REBIND,Mi.UNBIND,Mi.ACL,Mi.REPORT,Mi.MKACTIVITY,Mi.CHECKOUT,Mi.MERGE,Mi["M-SEARCH"],Mi.NOTIFY,Mi.SUBSCRIBE,Mi.UNSUBSCRIBE,Mi.PATCH,Mi.PURGE,Mi.MKCALENDAR,Mi.LINK,Mi.UNLINK,Mi.PRI,Mi.SOURCE];Pr.METHODS_ICE=[Mi.SOURCE];Pr.METHODS_RTSP=[Mi.OPTIONS,Mi.DESCRIBE,Mi.ANNOUNCE,Mi.SETUP,Mi.PLAY,Mi.PAUSE,Mi.TEARDOWN,Mi.GET_PARAMETER,Mi.SET_PARAMETER,Mi.REDIRECT,Mi.RECORD,Mi.FLUSH,Mi.GET,Mi.POST];Pr.METHOD_MAP=ods.enumToMap(Mi);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var uds;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(uds=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 Zde;(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"})(Zde=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Zde.CONNECTION,"content-length":Zde.CONTENT_LENGTH,"proxy-connection":Zde.CONNECTION,"transfer-encoding":Zde.TRANSFER_ENCODING,upgrade:Zde.UPGRADE}});var IXt=I((oXd,xDn)=>{"use strict";p();var{Buffer:dds}=require("node:buffer");xDn.exports=dds.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 RDn=I((aXd,wDn)=>{"use strict";p();var{Buffer:fds}=require("node:buffer");wDn.exports=fds.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 nke=I((lXd,BDn)=>{"use strict";p();var kDn=["GET","HEAD","POST"],pds=new Set(kDn),hds=[101,204,205,304],PDn=[301,302,303,307,308],mds=new Set(PDn),DDn=["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"],gds=new Set(DDn),NDn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],Ads=new Set(NDn),yds=["follow","manual","error"],MDn=["GET","HEAD","OPTIONS","TRACE"],Eds=new Set(MDn),_ds=["navigate","same-origin","no-cors","cors"],vds=["omit","same-origin","include"],Cds=["default","no-store","reload","no-cache","force-cache","only-if-cached"],bds=["content-encoding","content-language","content-location","content-type","content-length"],Sds=["half"],ODn=["CONNECT","TRACE","TRACK"],Tds=new Set(ODn),LDn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],Ids=new Set(LDn);BDn.exports={subresource:LDn,forbiddenMethods:ODn,requestBodyHeader:bds,referrerPolicy:NDn,requestRedirect:yds,requestMode:_ds,requestCredentials:vds,requestCache:Cds,redirectStatus:PDn,corsSafeListedMethods:kDn,nullBodyStatus:hds,safeMethods:MDn,badPorts:DDn,requestDuplex:Sds,subresourceSet:Ids,badPortsSet:gds,redirectStatusSet:mds,corsSafeListedMethodsSet:pds,safeMethodsSet:Eds,forbiddenMethodsSet:Tds,referrerPolicySet:Ads}});var wXt=I((dXd,FDn)=>{"use strict";p();var xXt=Symbol.for("undici.globalOrigin.1");function xds(){return globalThis[xXt]}a(xds,"getGlobalOrigin");function wds(t){if(t===void 0){Object.defineProperty(globalThis,xXt,{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,xXt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(wds,"setGlobalOrigin");FDn.exports={getGlobalOrigin:xds,setGlobalOrigin:wds}});var nb=I((hXd,$Dn)=>{"use strict";p();var int=require("node:assert"),Rds=new TextEncoder,ike=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,kds=/[\u000A\u000D\u0009\u0020]/,Pds=/[\u0009\u000A\u000C\u000D\u0020]/g,Dds=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Nds(t){int(t.protocol==="data:");let e=qDn(t,!0);e=e.slice(5);let r={position:0},n=Xde(",",e,r),o=n.length;if(n=Uds(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=jDn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=GDn(c);if(c=Ods(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=RXt(n);return l==="failure"&&(l=RXt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Nds,"dataURLProcessor");function qDn(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(qDn,"URLSerializer");function ont(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(UDn,"isHexCharByte");function QDn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(QDn,"hexByteToNumber");function Mds(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Xde(";",t,e);if(n=nnt(n,!1,!0),n.length===0||!ike.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionkds.test(d),t,e);let l=ont(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=HDn(t,e,!0),Xde(";",t,e);else if(u=Xde(";",t,e),u=nnt(u,!1,!0),u.length===0)continue;l.length!==0&&ike.test(l)&&(u.length===0||Dds.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(RXt,"parseMIMEType");function Ods(t){t=t.replace(Pds,"");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(Ods,"forgivingBase64");function HDn(t,e,r){let n=e.position,o="";for(int(t[e.position]==='"'),e.position++;o+=ont(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{int(s==='"');break}}return r?o:t.slice(n,e.position)}a(HDn,"collectAnHTTPQuotedString");function Lds(t){int(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",ike.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(Lds,"serializeAMimeType");function Bds(t){return t===13||t===10||t===9||t===32}a(Bds,"isHTTPWhiteSpace");function nnt(t,e=!0,r=!0){return kXt(t,e,r,Bds)}a(nnt,"removeHTTPWhitespace");function Fds(t){return t===13||t===10||t===9||t===12||t===32}a(Fds,"isASCIIWhitespace");function Uds(t,e=!0,r=!0){return kXt(t,e,r,Fds)}a(Uds,"removeASCIIWhitespace");function kXt(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(kXt,"removeChars");function GDn(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(GDn,"isomorphicDecode");function Qds(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(Qds,"minimizeSupportedMimeType");$Dn.exports={dataURLProcessor:Nds,URLSerializer:qDn,collectASequenceOfCodePoints:ont,collectASequenceOfCodePointsFast:Xde,stringPercentDecode:jDn,parseMIMEType:RXt,collectAnHTTPQuotedString:HDn,serializeAMimeType:Lds,removeChars:kXt,removeHTTPWhitespace:nnt,minimizeSupportedMimeType:Qds,HTTP_TOKEN_CODEPOINTS:ike,isomorphicDecode:GDn}});var jA=I((AXd,VDn)=>{"use strict";p();var{types:d5,inspect:qds}=require("node:util"),{markAsUncloneable:jds}=require("node:worker_threads"),{toUSVString:Hds}=qs(),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 qds(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(!d5.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=Hds;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"||!d5.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&d5.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"||!d5.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&&d5.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"||!d5.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&d5.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(d5.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(d5.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(d5.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);VDn.exports={webidl:Er}});var cT=I((EXd,sNn)=>{"use strict";p();var{Transform:Gds}=require("node:stream"),WDn=require("node:zlib"),{redirectStatusSet:$ds,referrerPolicySet:Vds,badPortsSet:Wds}=nke(),{getGlobalOrigin:zDn}=wXt(),{collectASequenceOfCodePoints:GJ,collectAnHTTPQuotedString:zds,removeChars:Yds,parseMIMEType:Kds}=nb(),{performance:Jds}=require("node:perf_hooks"),{isBlobLike:Zds,ReadableStreamFrom:Xds,isValidHTTPToken:YDn,normalizedMethodRecordsBase:efs}=qs(),$J=require("node:assert"),{isUint8Array:tfs}=require("node:util/types"),{webidl:oke}=jA(),KDn=[],ant;try{ant=require("node:crypto");let t=["sha256","sha384","sha512"];KDn=ant.getHashes().filter(e=>t.includes(e))}catch{}function JDn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(JDn,"responseURL");function rfs(t,e){if(!$ds.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&XDn(r)&&(ZDn(r)||(r=nfs(r)),r=new URL(r,JDn(t))),r&&!r.hash&&(r.hash=e),r}a(rfs,"responseLocationURL");function ZDn(t){for(let e=0;e126||r<32)return!1}return!0}a(ZDn,"isValidEncodedURL");function nfs(t){return Buffer.from(t,"binary").toString("utf8")}a(nfs,"normalizeBinaryStringToUtf8");function ake(t){return t.urlList[t.urlList.length-1]}a(ake,"requestCurrentURL");function ifs(t){let e=ake(t);return iNn(e)&&Wds.has(e.port)?"blocked":"allowed"}a(ifs,"requestBadPort");function ofs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(ofs,"isErrorLike");function sfs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(sfs,"isValidReasonPhrase");var afs=YDn;function XDn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(XDn,"isValidHeaderValue");function cfs(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(Vds.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(cfs,"setRequestReferrerPolicyOnRedirect");function lfs(){return"allowed"}a(lfs,"crossOriginResourcePolicyCheck");function ufs(){return"success"}a(ufs,"corsCheck");function dfs(){return"success"}a(dfs,"TAOCheck");function ffs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(ffs,"appendFetchMetadata");function pfs(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&&DXt(t.origin)&&!DXt(ake(t))&&(e=null);break;case"same-origin":cnt(t,ake(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(pfs,"appendRequestOriginHeader");function efe(t,e){return t}a(efe,"coarsenTime");function hfs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=cnt(t,n),c=ske(n)&&!ske(t.url);switch(e){case"origin":return o??PXt(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=ake(t);return cnt(n,l)?n:ske(n)&&!ske(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(yfs,"determineRequestsReferrer");function PXt(t,e){return $J(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(PXt,"stripURLForReferrer");function ske(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(ske,"isURLPotentiallyTrustworthy");function Efs(t,e){if(ant===void 0)return!0;let r=tNn(e);if(r==="no metadata"||r.length===0)return!0;let n=vfs(r),o=Cfs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=ant.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)),bfs(u,l))return!0}return!1}a(Efs,"bytesMatch");var _fs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function tNn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=_fs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();KDn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(tNn,"parseMetadata");function vfs(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(Tfs,"createDeferredPromise");function Ifs(t){return t.controller.state==="aborted"}a(Ifs,"isAborted");function xfs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(xfs,"isCancelled");function wfs(t){return efs[t.toLowerCase()]??t}a(wfs,"normalizeMethod");function Rfs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return $J(typeof e=="string"),e}a(Rfs,"serializeJavascriptValueToJSONString");var kfs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function rNn(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,kfs),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(rNn,"createIterator");function Pfs(t,e,r,n=0,o=1){let s=rNn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return oke.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return oke.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return oke.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(oke.brandCheck(this,e),oke.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(Pfs,"iteratorMixin");async function Dfs(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await nNn(s))}catch(c){o(c)}}a(Dfs,"fullyReadBody");function Nfs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(Nfs,"isReadableStreamLike");function Mfs(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(Mfs,"readableStreamClose");var Ofs=/[^\x00-\xFF]/;function snt(t){return $J(!Ofs.test(t)),t}a(snt,"isomorphicEncode");async function nNn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!tfs(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(nNn,"readAllBytes");function Lfs(t){$J("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(Lfs,"urlIsLocal");function DXt(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(DXt,"urlHasHttpsScheme");function iNn(t){$J("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(iNn,"urlIsHttpHttpsScheme");function Bfs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&GJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&GJ(u=>u===" "||u===" ",r,n);let o=GJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&GJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&GJ(u=>u===" "||u===" ",r,n);let c=GJ(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(Bfs,"simpleRangeHeaderValue");function Ffs(t,e,r){let n="bytes ";return n+=snt(`${t}`),n+="-",n+=snt(`${e}`),n+="/",n+=snt(`${r}`),n}a(Ffs,"buildContentRange");var NXt=class extends Gds{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?WDn.createInflate(this.#e):WDn.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 Ufs(t){return new NXt(t)}a(Ufs,"createInflate");function Qfs(t){let e=null,r=null,n=null,o=oNn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Kds(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(Qfs,"extractMimeType");function qfs(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(qfs,"gettingDecodingSplitting");function oNn(t,e){let r=e.get(t,!0);return r===null?null:qfs(r)}a(oNn,"getDecodeSplit");var jfs=new TextDecoder;function Hfs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),jfs.decode(t))}a(Hfs,"utf8DecodeBytes");var MXt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return zDn()}get origin(){return this.baseUrl?.origin}policyContainer=eNn()},OXt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new MXt},Gfs=new OXt;sNn.exports={isAborted:Ifs,isCancelled:xfs,isValidEncodedURL:ZDn,createDeferredPromise:Tfs,ReadableStreamFrom:Xds,tryUpgradeRequestToAPotentiallyTrustworthyURL:Sfs,clampAndCoarsenConnectionTimingInfo:hfs,coarsenedSharedCurrentTime:mfs,determineRequestsReferrer:yfs,makePolicyContainer:eNn,clonePolicyContainer:Afs,appendFetchMetadata:ffs,appendRequestOriginHeader:pfs,TAOCheck:dfs,corsCheck:ufs,crossOriginResourcePolicyCheck:lfs,createOpaqueTimingInfo:gfs,setRequestReferrerPolicyOnRedirect:cfs,isValidHTTPToken:YDn,requestBadPort:ifs,requestCurrentURL:ake,responseURL:JDn,responseLocationURL:rfs,isBlobLike:Zds,isURLPotentiallyTrustworthy:ske,isValidReasonPhrase:sfs,sameOrigin:cnt,normalizeMethod:wfs,serializeJavascriptValueToJSONString:Rfs,iteratorMixin:Pfs,createIterator:rNn,isValidHeaderName:afs,isValidHeaderValue:XDn,isErrorLike:ofs,fullyReadBody:Dfs,bytesMatch:Efs,isReadableStreamLike:Nfs,readableStreamClose:Mfs,isomorphicEncode:snt,urlIsLocal:Lfs,urlHasHttpsScheme:DXt,urlIsHttpHttpsScheme:iNn,readAllBytes:nNn,simpleRangeHeaderValue:Bfs,buildContentRange:Ffs,parseMetadata:tNn,createInflate:Ufs,extractMimeType:Qfs,getDecodeSplit:oNn,utf8DecodeBytes:Hfs,environmentSettingsObject:Gfs}});var cj=I((CXd,aNn)=>{"use strict";p();aNn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var BXt=I((SXd,cNn)=>{"use strict";p();var{Blob:$fs,File:Vfs}=require("node:buffer"),{kState:PF}=cj(),{webidl:f5}=jA(),LXt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[PF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return f5.brandCheck(this,t),this[PF].blobLike.stream(...e)}arrayBuffer(...e){return f5.brandCheck(this,t),this[PF].blobLike.arrayBuffer(...e)}slice(...e){return f5.brandCheck(this,t),this[PF].blobLike.slice(...e)}text(...e){return f5.brandCheck(this,t),this[PF].blobLike.text(...e)}get size(){return f5.brandCheck(this,t),this[PF].blobLike.size}get type(){return f5.brandCheck(this,t),this[PF].blobLike.type}get name(){return f5.brandCheck(this,t),this[PF].name}get lastModified(){return f5.brandCheck(this,t),this[PF].lastModified}get[Symbol.toStringTag](){return"File"}};f5.converters.Blob=f5.interfaceConverter($fs);function Wfs(t){return t instanceof Vfs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Wfs,"isFileLike");cNn.exports={FileLike:LXt,isFileLike:Wfs}});var lke=I((xXd,pNn)=>{"use strict";p();var{isBlobLike:lnt,iteratorMixin:zfs}=cT(),{kState:ov}=cj(),{kEnumerableProperty:tfe}=qs(),{FileLike:lNn,isFileLike:Yfs}=BXt(),{webidl:Tu}=jA(),{File:fNn}=require("node:buffer"),uNn=require("node:util"),dNn=globalThis.File??fNn,cke=class t{static{a(this,"FormData")}constructor(e){if(Tu.util.markAsUncloneable(this),e!==void 0)throw Tu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[ov]=[]}append(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.append";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!lnt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=lnt(r)?Tu.converters.Blob(r,o,"value",{strict:!1}):Tu.converters.USVString(r,o,"value"),n=arguments.length===3?Tu.converters.USVString(n,o,"filename"):void 0;let s=FXt(e,r,n);this[ov].push(s)}delete(e){Tu.brandCheck(this,t);let r="FormData.delete";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[ov]=this[ov].filter(n=>n.name!==e)}get(e){Tu.brandCheck(this,t);let r="FormData.get";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name");let n=this[ov].findIndex(o=>o.name===e);return n===-1?null:this[ov][n].value}getAll(e){Tu.brandCheck(this,t);let r="FormData.getAll";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[ov].filter(n=>n.name===e).map(n=>n.value)}has(e){Tu.brandCheck(this,t);let r="FormData.has";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[ov].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.set";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!lnt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=lnt(r)?Tu.converters.Blob(r,o,"name",{strict:!1}):Tu.converters.USVString(r,o,"name"),n=arguments.length===3?Tu.converters.USVString(n,o,"name"):void 0;let s=FXt(e,r,n),c=this[ov].findIndex(l=>l.name===e);c!==-1?this[ov]=[...this[ov].slice(0,c),s,...this[ov].slice(c+1).filter(l=>l.name!==e)]:this[ov].push(s)}[uNn.inspect.custom](e,r){let n=this[ov].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=uNn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};zfs("FormData",cke,ov,"name","value");Object.defineProperties(cke.prototype,{append:tfe,delete:tfe,get:tfe,getAll:tfe,has:tfe,set:tfe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function FXt(t,e,r){if(typeof e!="string"){if(Yfs(e)||(e=e instanceof Blob?new dNn([e],"blob",{type:e.type}):new lNn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof fNn?new dNn([e],r,n):new lNn(e,r,n)}}return{name:t,value:e}}a(FXt,"makeEntry");pNn.exports={FormData:cke,makeEntry:FXt}});var ENn=I((kXd,yNn)=>{"use strict";p();var{isUSVString:hNn,bufferToLowerCasedHeaderName:Kfs}=qs(),{utf8DecodeBytes:Jfs}=cT(),{HTTP_TOKEN_CODEPOINTS:Zfs,isomorphicDecode:mNn}=nb(),{isFileLike:Xfs}=BXt(),{makeEntry:eps}=lke(),unt=require("node:assert"),{File:tps}=require("node:buffer"),rps=globalThis.File??tps,nps=Buffer.from('form-data; name="'),gNn=Buffer.from("; filename"),ips=Buffer.from("--"),ops=Buffer.from(`--\r +`);function sps(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(aps,"validateBoundary");function cps(t,e){unt(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&&dnt(t,ips,s)||s.position===t.length-4&&dnt(t,ops,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=lps(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",sps(f)||(f=""),g=new rps([m],d,{type:f})):g=Jfs(Buffer.from(m)),unt(hNn(u)),unt(typeof g=="string"&&hNn(g)||Xfs(g)),o.push(eps(u,g,d))}}a(cps,"multipartFormDataParser");function lps(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=rfe(l=>l!==10&&l!==13&&l!==58,t,e);if(c=UXt(c,!0,!0,l=>l===9||l===32),!Zfs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,rfe(l=>l===32||l===9,t,e),Kfs(c)){case"content-disposition":{if(r=n=null,!dnt(t,nps,e)||(e.position+=17,r=ANn(t,e),r===null))return"failure";if(dnt(t,gNn,e)){let l=e.position+gNn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=ANn(t,e),n===null))return"failure"}break}case"content-type":{let l=rfe(u=>u!==10&&u!==13,t,e);l=UXt(l,!1,!0,u=>u===9||u===32),o=mNn(l);break}case"content-transfer-encoding":{let l=rfe(u=>u!==10&&u!==13,t,e);l=UXt(l,!1,!0,u=>u===9||u===32),s=mNn(l);break}default:rfe(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(lps,"parseMultipartFormDataHeaders");function ANn(t,e){unt(t[e.position-1]===34);let r=rfe(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(ANn,"parseMultipartFormDataName");function rfe(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(UXt,"removeChars");function dnt(t,e,r){if(t.length{"use strict";p();var uke=qs(),{ReadableStreamFrom:ups,isBlobLike:_Nn,isReadableStreamLike:dps,readableStreamClose:fps,createDeferredPromise:pps,fullyReadBody:hps,extractMimeType:mps,utf8DecodeBytes:bNn}=cT(),{FormData:vNn}=lke(),{kState:ife}=cj(),{webidl:gps}=jA(),{Blob:Aps}=require("node:buffer"),QXt=require("node:assert"),{isErrored:SNn,isDisturbed:yps}=require("node:stream"),{isArrayBuffer:Eps}=require("node:util/types"),{serializeAMimeType:_ps}=nb(),{multipartFormDataParser:vps}=ENn(),qXt;try{let t=require("node:crypto");qXt=a(e=>t.randomInt(0,e),"random")}catch{qXt=a(t=>Math.floor(Math.random(t)),"random")}var fnt=new TextEncoder;function Cps(){}a(Cps,"noop");var TNn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,INn;TNn&&(INn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!yps(e)&&!SNn(e)&&e.cancel("Response object has been garbage collected").catch(Cps)}));function xNn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:_Nn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?fnt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>fps(u))},start(){},type:"bytes"}),QXt(dps(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(Eps(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(uke.isFormDataLike(t)){let u=`----formdata-undici-0${`${qXt(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=snt.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=fnt.encode(d+`; name="${f(h(E))}"\r \r ${h(_)}\r -`);m.push(v),s+=v.byteLength}else{let v=snt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r +`);m.push(v),s+=v.byteLength}else{let v=fnt.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=snt.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(mNn(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(ake.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:Yfs(t)}if((typeof o=="string"||ake.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(!ENn(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(CNn,"extractBody");function cps(t,e=!1){return t instanceof ReadableStream&&(LXt(!ake.isDisturbed(t),"The body has already been consumed."),LXt(!t.locked,"The stream is locked.")),CNn(t,e)}a(cps,"safelyExtractBody");function lps(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(lps,"cloneBody");function ups(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(ups,"throwIfAborted");function dps(t){return{blob(){return rfe(this,r=>{let n=ANn(this);return n===null?n="":n&&(n=ops(n)),new rps([r],{type:n})},t)},arrayBuffer(){return rfe(this,r=>new Uint8Array(r).buffer,t)},text(){return rfe(this,yNn,t)},json(){return rfe(this,pps,t)},formData(){return rfe(this,r=>{let n=ANn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=sps(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new gNn;return s[nfe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new gNn;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 rfe(this,r=>new Uint8Array(r),t)}}}a(dps,"bodyMixinMethods");function fps(t){Object.assign(t.prototype,dps(t))}a(fps,"mixinBody");async function rfe(t,e,r){if(tps.brandCheck(t,r),bNn(t))throw new TypeError("Body is unusable: Body has already been read");ups(t[nfe]);let n=Zfs(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[nfe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Xfs(t[nfe].body,s,o),n.promise)}a(rfe,"consumeBody");function bNn(t){let e=t[nfe].body;return e!=null&&(e.stream.locked||ake.isDisturbed(e.stream))}a(bNn,"bodyUnusable");function pps(t){return JSON.parse(yNn(t))}a(pps,"parseJSONFromBytes");function ANn(t){let e=t[nfe].headersList,r=eps(e);return r==="failure"?null:r}a(ANn,"bodyMimeType");SNn.exports={extractBody:CNn,safelyExtractBody:cps,cloneBody:lps,mixinBody:fps,streamRegistry:vNn,hasFinalizationRegistry:_Nn,bodyUnusable:bNn}});var ONn=I((gXd,MNn)=>{"use strict";p();var Hi=require("node:assert"),Ao=qs(),{channels:TNn}=$de(),FXt=EXt(),{RequestContentLengthMismatchError:GJ,ResponseContentLengthMismatchError:hps,RequestAbortedError:PNn,HeadersTimeoutError:mps,HeadersOverflowError:gps,SocketError:fnt,InformationalError:ofe,BodyTimeoutError:Aps,HTTPParserError:yps,ResponseExceededMaxSizeError:Eps}=Ec(),{kUrl:DNn,kReset:ib,kClient:jXt,kParser:dp,kBlocking:uke,kRunning:yE,kPending:_ps,kSize:INn,kWriting:aj,kQueue:u2,kNoRef:cke,kKeepAliveDefaultTimeout:vps,kHostHeader:Cps,kPendingIdx:bps,kRunningIdx:vw,kError:Cw,kPipelining:unt,kSocket:sfe,kKeepAliveTimeoutValue:pnt,kMaxHeadersSize:UXt,kKeepAliveMaxTimeout:Sps,kKeepAliveTimeoutThreshold:Tps,kHeadersTimeout:Ips,kBodyTimeout:xps,kStrictContentLength:HXt,kMaxRequests:xNn,kCounter:wps,kMaxResponseSize:Rps,kOnError:kps,kResume:sj,kHTTPContext:NNn}=jd(),d5=vDn(),Pps=Buffer.alloc(0),ant=Buffer[Symbol.species],cnt=Ao.addListener,Dps=Ao.removeAllListeners,QXt;async function Nps(){let t=process.env.JEST_WORKER_ID?CXt():void 0,e;try{e=await WebAssembly.compile(SDn())}catch{e=await WebAssembly.compile(t||CXt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onStatus(new ant(f5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Hi(A0.ptr===r),A0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderField(new ant(f5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderValue(new ant(f5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Hi(A0.ptr===r),A0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onBody(new ant(f5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Hi(A0.ptr===r),A0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Nps,"lazyllhttp");var qXt=null,GXt=Nps();GXt.catch();var A0=null,f5=null,lnt=0,p5=null,Mps=0,lke=1,afe=2|lke,dnt=4|lke,$Xt=8|Mps,VXt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Hi(Number.isFinite(e[UXt])&&e[UXt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(d5.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[UXt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Rps]}setTimeout(e,r){e!==this.timeoutValue||r&lke^this.timeoutType&lke?(this.timeout&&(FXt.clearTimeout(this.timeout),this.timeout=null),e&&(r&lke?this.timeout=FXt.setFastTimeout(wNn,e,new WeakRef(this)):(this.timeout=setTimeout(wNn,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||(Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_resume(this.ptr),Hi(this.timeoutType===dnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Pps),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Hi(this.ptr!=null),Hi(A0==null),Hi(!this.paused);let{socket:r,llhttp:n}=this;e.length>lnt&&(p5&&n.free(p5),lnt=Math.ceil(e.length/4096)*4096,p5=n.malloc(lnt)),new Uint8Array(n.memory.buffer,p5,lnt).set(e);try{let o;try{f5=e,A0=this,o=n.llhttp_execute(this.ptr,p5,e.length)}catch(c){throw c}finally{A0=null,f5=null}let s=n.llhttp_get_error_pos(this.ptr)-p5;if(o===d5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===d5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==d5.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 yps(l,d5.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&FXt.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[u2][r[vw]];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 gps)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Hi(r),Hi(n[sfe]===o),Hi(!o.destroyed),Hi(!this.paused),Hi((s.length&1)===0);let l=n[u2][n[vw]];Hi(l),Hi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[dp].destroy(),o[dp]=null,o[jXt]=null,o[Cw]=null,Dps(o),n[sfe]=null,n[NNn]=null,n[u2][n[vw]++]=null,n.emit("disconnect",n[DNn],[n],new ofe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[sj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[u2][o[vw]];if(!u)return-1;if(Hi(!this.upgrade),Hi(this.statusCode<200),e===100)return Ao.destroy(s,new fnt("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new fnt("bad upgrade",Ao.getSocketInfo(s))),-1;if(Hi(this.timeoutType===afe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ib]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[xps];this.setTimeout(f,dnt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Hi(o[yE]===1),this.upgrade=!0,2;if(r)return Hi(o[yE]===1),this.upgrade=!0,2;if(Hi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[unt]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Tps],o[Sps]);h<=0?s[ib]=!0:o[pnt]=h}else o[pnt]=o[vps]}else s[ib]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[uke]&&(s[uke]=!1,o[sj]()),d?d5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[u2][r[vw]];if(Hi(c),Hi(this.timeoutType===dnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Hi(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new Eps),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return d5.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;Hi(n>=100),Hi((this.headers.length&1)===0);let d=e[u2][e[vw]];if(Hi(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 hps),-1;if(d.onComplete(s),e[u2][e[vw]++]=null,r[aj])return Hi(e[yE]===0),Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;if(u){if(r[ib]&&e[yE]===0)return Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;e[unt]==null||e[unt]===1?setImmediate(()=>e[sj]()):e[sj]()}else return Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED}}};function wNn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===afe?(!e[aj]||e.writableNeedDrain||n[yE]>1)&&(Hi(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new mps)):r===dnt?o||Ao.destroy(e,new Aps):r===$Xt&&(Hi(n[yE]===0&&n[pnt]),Ao.destroy(e,new ofe("socket idle timeout")))}a(wNn,"onParserTimeout");async function Ops(t,e){t[sfe]=e,qXt||(qXt=await GXt,GXt=null),e[cke]=!1,e[aj]=!1,e[ib]=!1,e[uke]=!1,e[dp]=new VXt(t,e,qXt),cnt(e,"error",function(n){Hi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[dp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[Cw]=n,this[jXt][kps](n)}),cnt(e,"readable",function(){let n=this[dp];n&&n.readMore()}),cnt(e,"end",function(){let n=this[dp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new fnt("other side closed",Ao.getSocketInfo(this)))}),cnt(e,"close",function(){let n=this[jXt],o=this[dp];o&&(!this[Cw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[dp].destroy(),this[dp]=null);let s=this[Cw]||new fnt("closed",Ao.getSocketInfo(this));if(n[sfe]=null,n[NNn]=null,n.destroyed){Hi(n[_ps]===0);let c=n[u2].splice(n[vw]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[u2][n[vw]];n[u2][n[vw]++]=null,Ao.errorRequest(n,c,s)}n[bps]=n[vw],Hi(n[yE]===0),n.emit("disconnect",n[DNn],[n],s),n[sj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Fps(t,...n)},resume(){Lps(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[aj]||e[ib]||e[uke]||n&&(t[yE]>0&&!n.idempotent||t[yE]>0&&(n.upgrade||n.method==="CONNECT")||t[yE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(Ops,"connectH1");function Lps(t){let e=t[sfe];if(e&&!e.destroyed){if(t[INn]===0?!e[cke]&&e.unref&&(e.unref(),e[cke]=!0):e[cke]&&e.ref&&(e.ref(),e[cke]=!1),t[INn]===0)e[dp].timeoutType!==$Xt&&e[dp].setTimeout(t[pnt],$Xt);else if(t[yE]>0&&e[dp].statusCode<200&&e[dp].timeoutType!==afe){let r=t[u2][t[vw]],n=r.headersTimeout!=null?r.headersTimeout:t[Ips];e[dp].setTimeout(n,afe)}}}a(Lps,"resumeH1");function Bps(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Bps,"shouldSendContentLength");function Fps(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)){QXt||(QXt=ife().extractBody);let[E,_]=QXt(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),Bps(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[HXt])return Ao.errorRequest(t,e,new GJ),!1;process.emitWarning(new GJ)}let g=t[sfe],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new PNn),Ao.destroy(u),Ao.destroy(g,new ofe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ib]=!0),(s||r==="CONNECT")&&(g[ib]=!0),l!=null&&(g[ib]=l),t[xNn]&&g[wps]++>=t[xNn]&&(g[ib]=!0),c&&(g[uke]=!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=fnt.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(_Nn(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(uke.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:ups(t)}if((typeof o=="string"||uke.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(!SNn(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(xNn,"extractBody");function bps(t,e=!1){return t instanceof ReadableStream&&(QXt(!uke.isDisturbed(t),"The body has already been consumed."),QXt(!t.locked,"The stream is locked.")),xNn(t,e)}a(bps,"safelyExtractBody");function Sps(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(Sps,"cloneBody");function Tps(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(Tps,"throwIfAborted");function Ips(t){return{blob(){return nfe(this,r=>{let n=CNn(this);return n===null?n="":n&&(n=_ps(n)),new Aps([r],{type:n})},t)},arrayBuffer(){return nfe(this,r=>new Uint8Array(r).buffer,t)},text(){return nfe(this,bNn,t)},json(){return nfe(this,wps,t)},formData(){return nfe(this,r=>{let n=CNn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=vps(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new vNn;return s[ife]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new vNn;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 nfe(this,r=>new Uint8Array(r),t)}}}a(Ips,"bodyMixinMethods");function xps(t){Object.assign(t.prototype,Ips(t))}a(xps,"mixinBody");async function nfe(t,e,r){if(gps.brandCheck(t,r),wNn(t))throw new TypeError("Body is unusable: Body has already been read");Tps(t[ife]);let n=pps(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[ife].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await hps(t[ife].body,s,o),n.promise)}a(nfe,"consumeBody");function wNn(t){let e=t[ife].body;return e!=null&&(e.stream.locked||uke.isDisturbed(e.stream))}a(wNn,"bodyUnusable");function wps(t){return JSON.parse(bNn(t))}a(wps,"parseJSONFromBytes");function CNn(t){let e=t[ife].headersList,r=mps(e);return r==="failure"?null:r}a(CNn,"bodyMimeType");RNn.exports={extractBody:xNn,safelyExtractBody:bps,cloneBody:Sps,mixinBody:xps,streamRegistry:INn,hasFinalizationRegistry:TNn,bodyUnusable:wNn}});var QNn=I((LXd,UNn)=>{"use strict";p();var Hi=require("node:assert"),yo=qs(),{channels:kNn}=Vde(),jXt=bXt(),{RequestContentLengthMismatchError:VJ,ResponseContentLengthMismatchError:Rps,RequestAbortedError:LNn,HeadersTimeoutError:kps,HeadersOverflowError:Pps,SocketError:ynt,InformationalError:sfe,BodyTimeoutError:Dps,HTTPParserError:Nps,ResponseExceededMaxSizeError:Mps}=Ec(),{kUrl:BNn,kReset:ib,kClient:VXt,kParser:pp,kBlocking:pke,kRunning:EE,kPending:Ops,kSize:PNn,kWriting:uj,kQueue:f2,kNoRef:dke,kKeepAliveDefaultTimeout:Lps,kHostHeader:Bps,kPendingIdx:Fps,kRunningIdx:bw,kError:Sw,kPipelining:gnt,kSocket:afe,kKeepAliveTimeoutValue:Ent,kMaxHeadersSize:HXt,kKeepAliveMaxTimeout:Ups,kKeepAliveTimeoutThreshold:Qps,kHeadersTimeout:qps,kBodyTimeout:jps,kStrictContentLength:WXt,kMaxRequests:DNn,kCounter:Hps,kMaxResponseSize:Gps,kOnError:$ps,kResume:lj,kHTTPContext:FNn}=Gd(),p5=IDn(),Vps=Buffer.alloc(0),pnt=Buffer[Symbol.species],hnt=yo.addListener,Wps=yo.removeAllListeners,GXt;async function zps(){let t=process.env.JEST_WORKER_ID?IXt():void 0,e;try{e=await WebAssembly.compile(RDn())}catch{e=await WebAssembly.compile(t||IXt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Hi(E0.ptr===r);let s=n-m5+h5.byteOffset;return E0.onStatus(new pnt(h5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Hi(E0.ptr===r),E0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Hi(E0.ptr===r);let s=n-m5+h5.byteOffset;return E0.onHeaderField(new pnt(h5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Hi(E0.ptr===r);let s=n-m5+h5.byteOffset;return E0.onHeaderValue(new pnt(h5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Hi(E0.ptr===r),E0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Hi(E0.ptr===r);let s=n-m5+h5.byteOffset;return E0.onBody(new pnt(h5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Hi(E0.ptr===r),E0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(zps,"lazyllhttp");var $Xt=null,zXt=zps();zXt.catch();var E0=null,h5=null,mnt=0,m5=null,Yps=0,fke=1,cfe=2|fke,Ant=4|fke,YXt=8|Yps,KXt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Hi(Number.isFinite(e[HXt])&&e[HXt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(p5.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[HXt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Gps]}setTimeout(e,r){e!==this.timeoutValue||r&fke^this.timeoutType&fke?(this.timeout&&(jXt.clearTimeout(this.timeout),this.timeout=null),e&&(r&fke?this.timeout=jXt.setFastTimeout(NNn,e,new WeakRef(this)):(this.timeout=setTimeout(NNn,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||(Hi(this.ptr!=null),Hi(E0==null),this.llhttp.llhttp_resume(this.ptr),Hi(this.timeoutType===Ant),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Vps),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Hi(this.ptr!=null),Hi(E0==null),Hi(!this.paused);let{socket:r,llhttp:n}=this;e.length>mnt&&(m5&&n.free(m5),mnt=Math.ceil(e.length/4096)*4096,m5=n.malloc(mnt)),new Uint8Array(n.memory.buffer,m5,mnt).set(e);try{let o;try{h5=e,E0=this,o=n.llhttp_execute(this.ptr,m5,e.length)}catch(c){throw c}finally{E0=null,h5=null}let s=n.llhttp_get_error_pos(this.ptr)-m5;if(o===p5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===p5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==p5.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 Nps(l,p5.ERROR[o],e.slice(s))}}catch(o){yo.destroy(r,o)}}destroy(){Hi(this.ptr!=null),Hi(E0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&jXt.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[f2][r[bw]];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 Pps)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Hi(r),Hi(n[afe]===o),Hi(!o.destroyed),Hi(!this.paused),Hi((s.length&1)===0);let l=n[f2][n[bw]];Hi(l),Hi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[pp].destroy(),o[pp]=null,o[VXt]=null,o[Sw]=null,Wps(o),n[afe]=null,n[FNn]=null,n[f2][n[bw]++]=null,n.emit("disconnect",n[BNn],[n],new sfe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){yo.destroy(o,u)}n[lj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[f2][o[bw]];if(!u)return-1;if(Hi(!this.upgrade),Hi(this.statusCode<200),e===100)return yo.destroy(s,new ynt("bad response",yo.getSocketInfo(s))),-1;if(r&&!u.upgrade)return yo.destroy(s,new ynt("bad upgrade",yo.getSocketInfo(s))),-1;if(Hi(this.timeoutType===cfe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ib]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[jps];this.setTimeout(f,Ant)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Hi(o[EE]===1),this.upgrade=!0,2;if(r)return Hi(o[EE]===1),this.upgrade=!0,2;if(Hi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[gnt]){let f=this.keepAlive?yo.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Qps],o[Ups]);h<=0?s[ib]=!0:o[Ent]=h}else o[Ent]=o[Lps]}else s[ib]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[pke]&&(s[pke]=!1,o[lj]()),d?p5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[f2][r[bw]];if(Hi(c),Hi(this.timeoutType===Ant),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Hi(o>=200),s>-1&&this.bytesRead+e.length>s)return yo.destroy(n,new Mps),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return p5.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;Hi(n>=100),Hi((this.headers.length&1)===0);let d=e[f2][e[bw]];if(Hi(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 Rps),-1;if(d.onComplete(s),e[f2][e[bw]++]=null,r[uj])return Hi(e[EE]===0),yo.destroy(r,new sfe("reset")),p5.ERROR.PAUSED;if(u){if(r[ib]&&e[EE]===0)return yo.destroy(r,new sfe("reset")),p5.ERROR.PAUSED;e[gnt]==null||e[gnt]===1?setImmediate(()=>e[lj]()):e[lj]()}else return yo.destroy(r,new sfe("reset")),p5.ERROR.PAUSED}}};function NNn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===cfe?(!e[uj]||e.writableNeedDrain||n[EE]>1)&&(Hi(!o,"cannot be paused while waiting for headers"),yo.destroy(e,new kps)):r===Ant?o||yo.destroy(e,new Dps):r===YXt&&(Hi(n[EE]===0&&n[Ent]),yo.destroy(e,new sfe("socket idle timeout")))}a(NNn,"onParserTimeout");async function Kps(t,e){t[afe]=e,$Xt||($Xt=await zXt,zXt=null),e[dke]=!1,e[uj]=!1,e[ib]=!1,e[pke]=!1,e[pp]=new KXt(t,e,$Xt),hnt(e,"error",function(n){Hi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[pp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[Sw]=n,this[VXt][$ps](n)}),hnt(e,"readable",function(){let n=this[pp];n&&n.readMore()}),hnt(e,"end",function(){let n=this[pp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}yo.destroy(this,new ynt("other side closed",yo.getSocketInfo(this)))}),hnt(e,"close",function(){let n=this[VXt],o=this[pp];o&&(!this[Sw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[pp].destroy(),this[pp]=null);let s=this[Sw]||new ynt("closed",yo.getSocketInfo(this));if(n[afe]=null,n[FNn]=null,n.destroyed){Hi(n[Ops]===0);let c=n[f2].splice(n[bw]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[f2][n[bw]];n[f2][n[bw]++]=null,yo.errorRequest(n,c,s)}n[Fps]=n[bw],Hi(n[EE]===0),n.emit("disconnect",n[BNn],[n],s),n[lj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Xps(t,...n)},resume(){Jps(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[uj]||e[ib]||e[pke]||n&&(t[EE]>0&&!n.idempotent||t[EE]>0&&(n.upgrade||n.method==="CONNECT")||t[EE]>0&&yo.bodyLength(n.body)!==0&&(yo.isStream(n.body)||yo.isAsyncIterable(n.body)||yo.isFormDataLike(n.body))))}}}a(Kps,"connectH1");function Jps(t){let e=t[afe];if(e&&!e.destroyed){if(t[PNn]===0?!e[dke]&&e.unref&&(e.unref(),e[dke]=!0):e[dke]&&e.ref&&(e.ref(),e[dke]=!1),t[PNn]===0)e[pp].timeoutType!==YXt&&e[pp].setTimeout(t[Ent],YXt);else if(t[EE]>0&&e[pp].statusCode<200&&e[pp].timeoutType!==cfe){let r=t[f2][t[bw]],n=r.headersTimeout!=null?r.headersTimeout:t[qps];e[pp].setTimeout(n,cfe)}}}a(Jps,"resumeH1");function Zps(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Zps,"shouldSendContentLength");function Xps(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)){GXt||(GXt=ofe().extractBody);let[E,_]=GXt(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),Zps(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[WXt])return yo.errorRequest(t,e,new VJ),!1;process.emitWarning(new VJ)}let g=t[afe],A=a(E=>{e.aborted||e.completed||(yo.errorRequest(t,e,E||new LNn),yo.destroy(u),yo.destroy(g,new sfe("aborted")))},"abort");try{e.onConnect(A)}catch(E){yo.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ib]=!0),(s||r==="CONNECT")&&(g[ib]=!0),l!=null&&(g[ib]=l),t[DNn]&&g[Hps]++>=t[DNn]&&(g[ib]=!0),c&&(g[pke]=!0);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[Cps],s?y+=`connection: upgrade\r +`:y+=t[Bps],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[unt]&&!g[ib]?y+=`connection: keep-alive\r +`:t[gnt]&&!g[ib]?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 PNn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Hi(o.destroyed||o[aj]&&r[yE]<=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(Ups,"writeStream");function RNn(t,e,r,n,o,s,c,l){try{e?Ao.isBuffer(e)&&(Hi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return kNn.sendHeaders.hasSubscribers&&kNn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?MNn(A,null,t,e,g,f,y,h):yo.isBuffer(u)?MNn(A,u,t,e,g,f,y,h):yo.isBlobLike(u)?typeof u.stream=="function"?ONn(A,u.stream(),t,e,g,f,y,h):ths(A,u,t,e,g,f,y,h):yo.isStream(u)?ehs(A,u,t,e,g,f,y,h):yo.isIterable(u)?ONn(A,u,t,e,g,f,y,h):Hi(!1),!0}a(Xps,"writeH1");function ehs(t,e,r,n,o,s,c,l){Hi(s!==0||r[EE]===0,"stream body cannot be pipelined");let u=!1,d=new _nt({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){yo.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 LNn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Hi(o.destroyed||o[uj]&&r[EE]<=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(ehs,"writeStream");function MNn(t,e,r,n,o,s,c,l){try{e?yo.isBuffer(e)&&(Hi(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[ib]=!0)):s===0?o.write(`${c}content-length: 0\r \r `,"latin1"):(Hi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[sj]()}catch(u){t(u)}}a(RNn,"writeBuffer");async function Qps(t,e,r,n,o,s,c,l){Hi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new GJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1")),n.onRequestSent(),r[lj]()}catch(u){t(u)}}a(MNn,"writeBuffer");async function ths(t,e,r,n,o,s,c,l){Hi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new VJ;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[ib]=!0),r[sj]()}catch(u){t(u)}}a(Qps,"writeBlob");async function kNn(t,e,r,n,o,s,c,l){Hi(s!==0||r[yE]===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)=>{Hi(u===null),o[Cw]?g(o[Cw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new hnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[Cw])throw o[Cw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(kNn,"writeIterable");var hnt=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[aj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[Cw])throw r[Cw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[HXt])throw new GJ;process.emitWarning(new GJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ib]=!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[ib]=!0),r[lj]()}catch(u){t(u)}}a(ths,"writeBlob");async function ONn(t,e,r,n,o,s,c,l){Hi(s!==0||r[EE]===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)=>{Hi(u===null),o[Sw]?g(o[Sw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new _nt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[Sw])throw o[Sw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(ONn,"writeIterable");var _nt=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[uj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[Sw])throw r[Sw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[WXt])throw new VJ;process.emitWarning(new VJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ib]=!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[dp].timeout&&r[dp].timeoutType===afe&&r[dp].timeout.refresh&&r[dp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[aj]=!1,e[Cw])throw e[Cw];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[pp].timeout&&r[pp].timeoutType===cfe&&r[pp].timeout.refresh&&r[pp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[uj]=!1,e[Sw])throw e[Sw];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[HXt])throw new GJ;process.emitWarning(new GJ)}e[dp].timeout&&e[dp].timeoutType===afe&&e[dp].timeout.refresh&&e[dp].timeout.refresh(),n[sj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[aj]=!1,e&&(Hi(n[yE]<=1,"pipeline should only contain this request"),o(e))}};MNn.exports=Ops});var HNn=I((EXd,jNn)=>{"use strict";p();var bw=require("node:assert"),{pipeline:qps}=require("node:stream"),fa=qs(),{RequestContentLengthMismatchError:WXt,RequestAbortedError:LNn,SocketError:dke,InformationalError:zXt}=Ec(),{kUrl:mnt,kReset:Ant,kClient:cfe,kRunning:ynt,kPending:jps,kQueue:cj,kPendingIdx:YXt,kRunningIdx:d2,kError:p2,kSocket:wg,kStrictContentLength:Hps,kOnError:KXt,kMaxConcurrentStreams:qNn,kHTTP2Session:f2,kResume:lj,kSize:Gps,kHTTPContext:$ps}=jd(),kF=Symbol("open streams"),BNn,FNn=!1,gnt;try{gnt=require("node:http2")}catch{gnt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Vps,HTTP2_HEADER_METHOD:Wps,HTTP2_HEADER_PATH:zps,HTTP2_HEADER_SCHEME:Yps,HTTP2_HEADER_CONTENT_LENGTH:Kps,HTTP2_HEADER_EXPECT:Jps,HTTP2_HEADER_STATUS:Zps}}=gnt;function Xps(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(Xps,"parseH2Headers");async function ehs(t,e){t[wg]=e,FNn||(FNn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=gnt.connect(t[mnt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[qNn]});r[kF]=0,r[cfe]=t,r[wg]=e,fa.addListener(r,"error",rhs),fa.addListener(r,"frameError",nhs),fa.addListener(r,"end",ihs),fa.addListener(r,"goaway",ohs),fa.addListener(r,"close",function(){let{[cfe]:o}=this,{[wg]:s}=o,c=this[wg][p2]||this[p2]||new dke("closed",fa.getSocketInfo(s));if(o[f2]=null,o.destroyed){bw(o[jps]===0);let l=o[cj].splice(o[d2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return ahs(t,...o)},resume(){ths(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(ehs,"connectH2");function ths(t){let e=t[wg];e?.destroyed===!1&&(t[Gps]===0&&t[qNn]===0?(e.unref(),t[f2].unref()):(e.ref(),t[f2].ref()))}a(ths,"resumeH2");function rhs(t){bw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[wg][p2]=t,this[cfe][KXt](t)}a(rhs,"onHttp2SessionError");function nhs(t,e,r){if(r===0){let n=new zXt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[wg][p2]=n,this[cfe][KXt](n)}}a(nhs,"onHttp2FrameError");function ihs(){let t=new dke("other side closed",fa.getSocketInfo(this[wg]));this.destroy(t),fa.destroy(this[wg],t)}a(ihs,"onHttp2SessionEnd");function ohs(t){let e=this[p2]||new dke(`HTTP/2: "GOAWAY" frame received with code ${t}`,fa.getSocketInfo(this)),r=this[cfe];if(r[wg]=null,r[$ps]=null,this[f2]!=null&&(this[f2].destroy(e),this[f2]=null),fa.destroy(this[wg],e),r[d2]{e.aborted||e.completed||(T=T||new LNn,fa.errorRequest(t,e,T),m!=null&&fa.destroy(m,T),fa.destroy(f,T),t[cj][t[d2]++]=null,t[lj]())},"abort");try{e.onConnect(y)}catch(T){fa.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[kF],t[cj][t[d2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[kF],t[cj][t[d2]++]=null}),m.once("close",()=>{r[kF]-=1,r[kF]===0&&r.unref()}),!0;h[zps]=o,h[Yps]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=fa.bodyLength(f);if(fa.isFormDataLike(f)){BNn??=ife().extractBody;let[T,w]=BNn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),shs(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Hps])return fa.errorRequest(t,e,new WXt),!1;process.emitWarning(new WXt)}_!=null&&(bw(f,"no body must not have content length"),h[Kps]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[Jps]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[kF],m.once("response",T=>{let{[Zps]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new LNn;fa.errorRequest(t,e,x),fa.destroy(m,x);return}e.onHeaders(Number(w),Xps(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[kF]===0&&r.unref(),y(new zXt("HTTP/2: stream half-closed (remote)")),t[cj][t[d2]++]=null,t[YXt]=t[d2],t[lj]()}),m.once("close",()=>{r[kF]-=1,r[kF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new zXt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?UNn(y,m,null,t,e,t[wg],_,E):fa.isBuffer(f)?UNn(y,m,f,t,e,t[wg],_,E):fa.isBlobLike(f)?typeof f.stream=="function"?QNn(y,m,f.stream(),t,e,t[wg],_,E):lhs(y,m,f,t,e,t[wg],_,E):fa.isStream(f)?chs(y,t[wg],E,m,f,t,e,_):fa.isIterable(f)?QNn(y,m,f,t,e,t[wg],_,E):bw(!1)}a(b,"writeBodyH2")}a(ahs,"writeH2");function UNn(t,e,r,n,o,s,c,l){try{r!=null&&fa.isBuffer(r)&&(bw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Ant]=!0),o.onRequestSent(),n[lj]()}catch(u){t(u)}}a(UNn,"writeBuffer");function chs(t,e,r,n,o,s,c,l){bw(l!==0||s[ynt]===0,"stream body cannot be pipelined");let u=qps(o,n,f=>{f?(fa.destroy(u,f),t(f)):(fa.removeAllListeners(u),c.onRequestSent(),r||(e[Ant]=!0),s[lj]())});fa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(chs,"writeStream");async function lhs(t,e,r,n,o,s,c,l){bw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new WXt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Ant]=!0),n[lj]()}catch(u){t(u)}}a(lhs,"writeBlob");async function QNn(t,e,r,n,o,s,c,l){bw(c!==0||n[ynt]===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)=>{bw(u===null),s[p2]?m(s[p2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[p2])throw s[p2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Ant]=!0),n[lj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(QNn,"writeIterable");jNn.exports=ehs});var _nt=I((CXd,VNn)=>{"use strict";p();var h5=qs(),{kBodyUsed:fke}=jd(),ZXt=require("node:assert"),{InvalidArgumentError:uhs}=Ec(),dhs=require("node:events"),fhs=[300,301,302,303,307,308],GNn=Symbol("body"),Ent=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[GNn]=e,this[fke]=!1}async*[Symbol.asyncIterator](){ZXt(!this[fke],"disturbed"),this[fke]=!0,yield*this[GNn]}},JXt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new uhs("maxRedirections must be a positive number");h5.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,h5.isStream(this.opts.body)?(h5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ZXt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[fke]=!1,dhs.prototype.on.call(this.opts.body,"data",function(){this[fke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Ent(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&h5.isIterable(this.opts.body)&&(this.opts.body=new Ent(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||h5.isDisturbed(this.opts.body)?null:phs(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}=h5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=hhs(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 phs(t,e){if(fhs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var mhs=_nt();function ghs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new mhs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(ghs,"createRedirectInterceptor");WNn.exports=ghs});var dfe=I((wXd,nMn)=>{"use strict";p();var PF=require("node:assert"),XNn=require("node:net"),Ahs=require("node:http"),$J=qs(),{channels:lfe}=$de(),yhs=cDn(),Ehs=Yde(),{InvalidArgumentError:sh,InformationalError:_hs,ClientDestroyedError:vhs}=Ec(),Chs=XRe(),{kUrl:m5,kServerName:uj,kClient:bhs,kBusy:XXt,kConnect:Shs,kResuming:VJ,kRunning:Ake,kPending:yke,kSize:gke,kQueue:h2,kConnected:Ths,kConnecting:ufe,kNeedDrain:fj,kKeepAliveDefaultTimeout:zNn,kHostHeader:Ihs,kPendingIdx:m2,kRunningIdx:DF,kError:xhs,kPipelining:Cnt,kKeepAliveTimeoutValue:whs,kMaxHeadersSize:Rhs,kKeepAliveMaxTimeout:khs,kKeepAliveTimeoutThreshold:Phs,kHeadersTimeout:Dhs,kBodyTimeout:Nhs,kStrictContentLength:Mhs,kConnector:pke,kMaxRedirections:Ohs,kMaxRequests:eer,kCounter:Lhs,kClose:Bhs,kDestroy:Fhs,kDispatch:Uhs,kInterceptors:YNn,kLocalAddress:hke,kMaxResponseSize:Qhs,kOnError:qhs,kHTTPContext:ah,kMaxConcurrentStreams:jhs,kResume:mke}=jd(),Hhs=ONn(),Ghs=HNn(),KNn=!1,dj=Symbol("kClosedResolve"),JNn=a(()=>{},"noop");function eMn(t){return t[Cnt]??t[ah]?.defaultPipelining??1}a(eMn,"getPipelining");var ter=class extends Ehs{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:L,allowH2:B}={}){if(super(),f!==void 0)throw new sh("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new sh("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new sh("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new sh("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new sh("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new sh("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new sh("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new sh("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new sh("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new sh("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new sh("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new sh("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new sh("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new sh("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new sh("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new sh("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||XNn.isIP(x)===0))throw new sh("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new sh("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new sh("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new sh("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new sh("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Chs({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[YNn]=r.Client,KNn||(KNn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[YNn]=[$hs({maxRedirections:T})],this[m5]=$J.parseOrigin(e),this[pke]=w,this[Cnt]=E??1,this[Rhs]=n||Ahs.maxHeaderSize,this[zNn]=h??4e3,this[khs]=g??6e5,this[Phs]=A??2e3,this[whs]=this[zNn],this[uj]=null,this[hke]=x??null,this[VJ]=0,this[fj]=0,this[Ihs]=`host: ${this[m5].hostname}${this[m5].port?`:${this[m5].port}`:""}\r -`,this[Nhs]=u??3e5,this[Dhs]=o??3e5,this[Mhs]=v??!0,this[Ohs]=T,this[eer]=R,this[dj]=null,this[Qhs]=P>-1?P:-1,this[jhs]=L??100,this[ah]=null,this[h2]=[],this[DF]=0,this[m2]=0,this[mke]=q=>rer(this,q),this[qhs]=q=>tMn(this,q)}get pipelining(){return this[Cnt]}set pipelining(e){this[Cnt]=e,this[mke](!0)}get[yke](){return this[h2].length-this[m2]}get[Ake](){return this[m2]-this[DF]}get[gke](){return this[h2].length-this[DF]}get[Ths](){return!!this[ah]&&!this[ufe]&&!this[ah].destroyed}get[XXt](){return!!(this[ah]?.busy(null)||this[gke]>=(eMn(this)||1)||this[yke]>0)}[Shs](e){rMn(this),this.once("connect",e)}[Uhs](e,r){let n=e.origin||this[m5].origin,o=new yhs(n,e,r);return this[h2].push(o),this[VJ]||($J.bodyLength(o.body)==null&&$J.isIterable(o.body)?(this[VJ]=1,queueMicrotask(()=>rer(this))):this[mke](!0)),this[VJ]&&this[fj]!==2&&this[XXt]&&(this[fj]=2),this[fj]<2}async[Bhs](){return new Promise(e=>{this[gke]?this[dj]=e:e(null)})}async[Fhs](e){return new Promise(r=>{let n=this[h2].splice(this[m2]);for(let s=0;s{this[dj]&&(this[dj](),this[dj]=null),r(null)},"callback");this[ah]?(this[ah].destroy(e,o),this[ah]=null):queueMicrotask(o),this[mke]()})}},$hs=vnt();function tMn(t,e){if(t[Ake]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){PF(t[m2]===t[DF]);let r=t[h2].splice(t[DF]);for(let n=0;n{t[pke]({host:e,hostname:r,protocol:n,port:o,servername:t[uj],localAddress:t[hke]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){$J.destroy(s.on("error",JNn),new vhs);return}PF(s);try{t[ah]=s.alpnProtocol==="h2"?await Ghs(t,s):await Hhs(t,s)}catch(c){throw s.destroy().on("error",JNn),c}t[ufe]=!1,s[Lhs]=0,s[eer]=t[eer],s[bhs]=t,s[xhs]=null,lfe.connected.hasSubscribers&&lfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[uj],localAddress:t[hke]},connector:t[pke],socket:s}),t.emit("connect",t[m5],[t])}catch(s){if(t.destroyed)return;if(t[ufe]=!1,lfe.connectError.hasSubscribers&&lfe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[uj],localAddress:t[hke]},connector:t[pke],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(PF(t[Ake]===0);t[yke]>0&&t[h2][t[m2]].servername===t[uj];){let c=t[h2][t[m2]++];$J.errorRequest(t,c,s)}else tMn(t,s);t.emit("connectionError",t[m5],[t],s)}t[mke]()}a(rMn,"connect");function ZNn(t){t[fj]=0,t.emit("drain",t[m5],[t])}a(ZNn,"emitDrain");function rer(t,e){t[VJ]!==2&&(t[VJ]=2,Vhs(t,e),t[VJ]=0,t[DF]>256&&(t[h2].splice(0,t[DF]),t[m2]-=t[DF],t[DF]=0))}a(rer,"resume");function Vhs(t,e){for(;;){if(t.destroyed){PF(t[yke]===0);return}if(t[dj]&&!t[gke]){t[dj](),t[dj]=null;return}if(t[ah]&&t[ah].resume(),t[XXt])t[fj]=2;else if(t[fj]===2){e?(t[fj]=1,queueMicrotask(()=>ZNn(t))):ZNn(t);continue}if(t[yke]===0||t[Ake]>=(eMn(t)||1))return;let r=t[h2][t[m2]];if(t[m5].protocol==="https:"&&t[uj]!==r.servername){if(t[Ake]>0)return;t[uj]=r.servername,t[ah]?.destroy(new _hs("servername changed"),()=>{t[ah]=null,rer(t)})}if(t[ufe])return;if(!t[ah]){rMn(t);return}if(t[ah].destroyed||t[ah].busy(r))return;!r.aborted&&t[ah].write(r)?t[m2]++:t[h2].splice(t[m2],1)}}a(Vhs,"_resume");nMn.exports=ter});var ner=I((DXd,iMn)=>{"use strict";p();var bnt=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)}};iMn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new bnt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new bnt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var sMn=I((OXd,oMn)=>{p();var{kFree:Whs,kConnected:zhs,kPending:Yhs,kQueued:Khs,kRunning:Jhs,kSize:Zhs}=jd(),WJ=Symbol("pool"),ier=class{static{a(this,"PoolStats")}constructor(e){this[WJ]=e}get connected(){return this[WJ][zhs]}get free(){return this[WJ][Whs]}get pending(){return this[WJ][Yhs]}get queued(){return this[WJ][Khs]}get running(){return this[WJ][Jhs]}get size(){return this[WJ][Zhs]}};oMn.exports=ier});var uer=I((FXd,gMn)=>{"use strict";p();var Xhs=Yde(),ems=ner(),{kConnected:oer,kSize:aMn,kRunning:cMn,kPending:lMn,kQueued:Eke,kBusy:tms,kFree:rms,kUrl:nms,kClose:ims,kDestroy:oms,kDispatch:sms}=jd(),ams=sMn(),ob=Symbol("clients"),iv=Symbol("needDrain"),_ke=Symbol("queue"),ser=Symbol("closed resolve"),aer=Symbol("onDrain"),uMn=Symbol("onConnect"),dMn=Symbol("onDisconnect"),fMn=Symbol("onConnectionError"),cer=Symbol("get dispatcher"),hMn=Symbol("add client"),mMn=Symbol("remove client"),pMn=Symbol("stats"),ler=class extends Xhs{static{a(this,"PoolBase")}constructor(){super(),this[_ke]=new ems,this[ob]=[],this[Eke]=0;let e=this;this[aer]=a(function(n,o){let s=e[_ke],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Eke]--,c=!this.dispatch(l.opts,l.handler)}this[iv]=c,!this[iv]&&e[iv]&&(e[iv]=!1,e.emit("drain",n,[e,...o])),e[ser]&&s.isEmpty()&&Promise.all(e[ob].map(l=>l.close())).then(e[ser])},"onDrain"),this[uMn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[dMn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[fMn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[pMn]=new ams(this)}get[tms](){return this[iv]}get[oer](){return this[ob].filter(e=>e[oer]).length}get[rms](){return this[ob].filter(e=>e[oer]&&!e[iv]).length}get[lMn](){let e=this[Eke];for(let{[lMn]:r}of this[ob])e+=r;return e}get[cMn](){let e=0;for(let{[cMn]:r}of this[ob])e+=r;return e}get[aMn](){let e=this[Eke];for(let{[aMn]:r}of this[ob])e+=r;return e}get stats(){return this[pMn]}async[ims](){this[_ke].isEmpty()?await Promise.all(this[ob].map(e=>e.close())):await new Promise(e=>{this[ser]=e})}async[oms](e){for(;;){let r=this[_ke].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[ob].map(r=>r.destroy(e)))}[sms](e,r){let n=this[cer]();return n?n.dispatch(e,r)||(n[iv]=!0,this[iv]=!this[cer]()):(this[iv]=!0,this[_ke].push({opts:e,handler:r}),this[Eke]++),!this[iv]}[hMn](e){return e.on("drain",this[aer]).on("connect",this[uMn]).on("disconnect",this[dMn]).on("connectionError",this[fMn]),this[ob].push(e),this[iv]&&queueMicrotask(()=>{this[iv]&&this[aer](e[nms],[this,e])}),this}[mMn](e){e.close(()=>{let r=this[ob].indexOf(e);r!==-1&&this[ob].splice(r,1)}),this[iv]=this[ob].some(r=>!r[iv]&&r.closed!==!0&&r.destroyed!==!0)}};gMn.exports={PoolBase:ler,kClients:ob,kNeedDrain:iv,kAddClient:hMn,kRemoveClient:mMn,kGetDispatcher:cer}});var ffe=I((qXd,_Mn)=>{"use strict";p();var{PoolBase:cms,kClients:Snt,kNeedDrain:lms,kAddClient:ums,kGetDispatcher:dms}=uer(),fms=dfe(),{InvalidArgumentError:der}=Ec(),AMn=qs(),{kUrl:yMn,kInterceptors:pms}=jd(),hms=XRe(),fer=Symbol("options"),per=Symbol("connections"),EMn=Symbol("factory");function mms(t,e){return new fms(t,e)}a(mms,"defaultFactory");var her=class extends cms{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=mms,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 der("invalid connections");if(typeof n!="function")throw new der("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new der("connect must be a function or an object");typeof o!="function"&&(o=hms({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[pms]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[per]=r||null,this[yMn]=AMn.parseOrigin(e),this[fer]={...AMn.deepClone(m),connect:o,allowH2:h},this[fer].interceptors=m.interceptors?{...m.interceptors}:void 0,this[EMn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[Snt].indexOf(E);_!==-1&&this[Snt].splice(_,1)}})}[dms](){for(let e of this[Snt])if(!e[lms])return e;if(!this[per]||this[Snt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:gms,InvalidArgumentError:Ams}=Ec(),{PoolBase:yms,kClients:EE,kNeedDrain:vke,kAddClient:Ems,kRemoveClient:_ms,kGetDispatcher:vms}=uer(),Cms=ffe(),{kUrl:mer,kInterceptors:bms}=jd(),{parseOrigin:vMn}=qs(),CMn=Symbol("factory"),Tnt=Symbol("options"),bMn=Symbol("kGreatestCommonDivisor"),zJ=Symbol("kCurrentWeight"),YJ=Symbol("kIndex"),Sw=Symbol("kWeight"),Int=Symbol("kMaxWeightPerServer"),xnt=Symbol("kErrorPenalty");function Sms(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Sms,"getGreatestCommonDivisor");function Tms(t,e){return new Cms(t,e)}a(Tms,"defaultFactory");var ger=class extends yms{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Tms,...n}={}){if(super(),this[Tnt]=n,this[YJ]=-1,this[zJ]=0,this[Int]=this[Tnt].maxWeightPerServer||100,this[xnt]=this[Tnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Ams("factory must be a function.");this[bms]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[CMn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=vMn(e).origin;if(this[EE].find(o=>o[mer].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[CMn](r,Object.assign({},this[Tnt]));this[Ems](n),n.on("connect",()=>{n[Sw]=Math.min(this[Int],n[Sw]+this[xnt])}),n.on("connectionError",()=>{n[Sw]=Math.max(1,n[Sw]-this[xnt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Sw]=Math.max(1,n[Sw]-this[xnt]),this._updateBalancedPoolStats())});for(let o of this[EE])o[Sw]=this[Int];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[mer].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[_ms](n),this}get upstreams(){return this[EE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[mer].origin)}[vms](){if(this[EE].length===0)throw new gms;if(!this[EE].find(s=>!s[vke]&&s.closed!==!0&&s.destroyed!==!0)||this[EE].map(s=>s[vke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[EE].findIndex(s=>!s[vke]);for(;n++this[EE][o][Sw]&&!s[vke]&&(o=this[YJ]),this[YJ]===0&&(this[zJ]=this[zJ]-this[bMn],this[zJ]<=0&&(this[zJ]=this[Int])),s[Sw]>=this[zJ]&&!s[vke])return s}return this[zJ]=this[EE][o][Sw],this[YJ]=o,this[EE][o]}};SMn.exports=ger});var pfe=I((WXd,DMn)=>{"use strict";p();var{InvalidArgumentError:wnt}=Ec(),{kClients:pj,kRunning:IMn,kClose:Ims,kDestroy:xms,kDispatch:wms,kInterceptors:Rms}=jd(),kms=Yde(),Pms=ffe(),Dms=dfe(),Nms=qs(),Mms=vnt(),xMn=Symbol("onConnect"),wMn=Symbol("onDisconnect"),RMn=Symbol("onConnectionError"),Oms=Symbol("maxRedirections"),kMn=Symbol("onDrain"),PMn=Symbol("factory"),Aer=Symbol("options");function Lms(t,e){return e&&e.connections===1?new Dms(t,e):new Pms(t,e)}a(Lms,"defaultFactory");var yer=class extends kms{static{a(this,"Agent")}constructor({factory:e=Lms,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new wnt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new wnt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new wnt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Rms]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Mms({maxRedirections:r})],this[Aer]={...Nms.deepClone(o),connect:n},this[Aer].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Oms]=r,this[PMn]=e,this[pj]=new Map,this[kMn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[xMn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[wMn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[RMn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[IMn](){let e=0;for(let r of this[pj].values())e+=r[IMn];return e}[wms](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new wnt("opts.origin must be a non-empty string or URL.");let o=this[pj].get(n);return o||(o=this[PMn](e.origin,this[Aer]).on("drain",this[kMn]).on("connect",this[xMn]).on("disconnect",this[wMn]).on("connectionError",this[RMn]),this[pj].set(n,o)),o.dispatch(e,r)}async[Ims](){let e=[];for(let r of this[pj].values())e.push(r.close());this[pj].clear(),await Promise.all(e)}async[xms](e){let r=[];for(let n of this[pj].values())r.push(n.destroy(e));this[pj].clear(),await Promise.all(r)}};DMn.exports=yer});var ber=I((KXd,HMn)=>{"use strict";p();var{kProxy:Eer,kClose:FMn,kDestroy:UMn,kDispatch:NMn,kInterceptors:Bms}=jd(),{URL:KJ}=require("node:url"),Fms=pfe(),QMn=ffe(),qMn=Yde(),{InvalidArgumentError:hfe,RequestAbortedError:Ums,SecureProxyConnectionError:Qms}=Ec(),MMn=XRe(),jMn=dfe(),Rnt=Symbol("proxy agent"),knt=Symbol("proxy client"),hj=Symbol("proxy headers"),_er=Symbol("request tls settings"),OMn=Symbol("proxy tls settings"),LMn=Symbol("connect endpoint function"),BMn=Symbol("tunnel proxy");function qms(t){return t==="https:"?443:80}a(qms,"defaultProtocolPort");function jms(t,e){return new QMn(t,e)}a(jms,"defaultFactory");var Hms=a(()=>{},"noop");function Gms(t,e){return e.connections===1?new jMn(t,e):new QMn(t,e)}a(Gms,"defaultAgentFactory");var ver=class extends qMn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new hfe("Proxy URL is mandatory");this[hj]=r,o?this.#e=o(e,{connect:n}):this.#e=new jMn(e,{connect:n})}[NMn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new hfe("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 KJ(o);c.host=l}return e.headers={...this[hj],...c},this.#e[NMn](e,r)}async[FMn](){return this.#e.close()}async[UMn](e){return this.#e.destroy(e)}},Cer=class extends qMn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof KJ)&&!e.uri)throw new hfe("Proxy uri is mandatory");let{clientFactory:r=jms}=e;if(typeof r!="function")throw new hfe("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[Eer]={uri:s,protocol:u},this[Bms]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[_er]=e.requestTls,this[OMn]=e.proxyTls,this[hj]=e.headers||{},this[BMn]=n,e.auth&&e.token)throw new hfe("opts.auth cannot be used in combination with opts.token");e.auth?this[hj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[hj]["proxy-authorization"]=e.token:d&&f&&(this[hj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=MMn({...e.proxyTls});this[LMn]=MMn({...e.requestTls});let g=e.factory||Gms,A=a((y,E)=>{let{protocol:_}=new KJ(y);return!this[BMn]&&_==="http:"&&this[Eer].protocol==="http:"?new ver(this[Eer].uri,{headers:this[hj],connect:m,factory:g}):g(y,E)},"factory");this[knt]=r(o,{connect:m}),this[Rnt]=new Fms({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${qms(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[knt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[hj],host:y.host},servername:this[OMn]?.servername||h});if(b!==200&&(v.on("error",Hms).destroy(),E(new Ums(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[_er]?T=this[_er].servername:T=y.servername,this[LMn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Qms(v)):E(v)}},"connect")})}dispatch(e,r){let n=$ms(e.headers);if(Vms(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new KJ(e.origin);n.host=o}return this[Rnt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new KJ(e):e instanceof KJ?e:new KJ(e.uri)}async[FMn](){await this[Rnt].close(),await this[knt].close()}async[UMn](){await this[Rnt].destroy(),await this[knt].destroy()}};function $ms(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new hfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Vms,"throwIfProxyAuthIsSent");HMn.exports=Cer});var YMn=I((XXd,zMn)=>{"use strict";p();var Wms=Yde(),{kClose:zms,kDestroy:Yms,kClosed:GMn,kDestroyed:$Mn,kDispatch:Kms,kNoProxyAgent:Cke,kHttpProxyAgent:mj,kHttpsProxyAgent:JJ}=jd(),VMn=ber(),Jms=pfe(),Zms={"http:":80,"https:":443},WMn=!1,Ser=class extends Wms{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,WMn||(WMn=!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[Cke]=new Jms(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[mj]=new VMn({...s,uri:c}):this[mj]=this[Cke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[JJ]=new VMn({...s,uri:l}):this[JJ]=this[mj],this.#o()}[Kms](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[zms](){await this[Cke].close(),this[mj][GMn]||await this[mj].close(),this[JJ][GMn]||await this[JJ].close()}async[Yms](e){await this[Cke].destroy(e),this[mj][$Mn]||await this[mj].destroy(e),this[JJ][$Mn]||await this[JJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Zms[r]||0,this.#i(n,o)?r==="https:"?this[JJ]:this[mj]:this[Cke]}#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 mfe=require("node:assert"),{kRetryHandlerDefaultRetry:KMn}=jd(),{RequestRetryError:bke}=Ec(),{isDisturbed:JMn,parseHeaders:Xms,parseRangeHeader:ZMn,wrapRequestBody:e0s}=qs();function t0s(t){let e=Date.now();return new Date(t).getTime()-e}a(t0s,"calculateRetryAfterHeader");var Ter=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:e0s(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[KMn],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[KMn](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)?t0s(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=Xms(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new bke("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 bke("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=ZMn(s["content-range"]);if(!l)return this.abort(new bke("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new bke("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return mfe(this.start===u,"content-range mismatch"),mfe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=ZMn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;mfe(u!=null&&Number.isFinite(u),"content-range mismatch"),mfe(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 mfe(Number.isFinite(this.start)),mfe(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 bke("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||JMn(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||JMn(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")}};XMn.exports=Ter});var tOn=I((oef,eOn)=>{"use strict";p();var r0s=JRe(),n0s=Pnt(),Ier=class extends r0s{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 n0s({...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()}};eOn.exports=Ier});var Der=I((cef,uOn)=>{"use strict";p();var sOn=require("node:assert"),{Readable:i0s}=require("node:stream"),{RequestAbortedError:aOn,NotSupportedError:o0s,InvalidArgumentError:s0s,AbortError:xer}=Ec(),cOn=qs(),{ReadableStreamFrom:a0s}=qs(),aT=Symbol("kConsume"),Ske=Symbol("kReading"),gj=Symbol("kBody"),rOn=Symbol("kAbort"),lOn=Symbol("kContentType"),nOn=Symbol("kContentLength"),c0s=a(()=>{},"noop"),wer=class extends i0s{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[rOn]=r,this[aT]=null,this[gj]=null,this[lOn]=n,this[nOn]=o,this[Ske]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new aOn),e&&this[rOn](),super.destroy(e)}_destroy(e,r){this[Ske]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Ske]=!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[Ske]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[aT]&&e!==null?(ker(this[aT],e),this[Ske]?super.push(e):!0):super.push(e)}async text(){return Tke(this,"text")}async json(){return Tke(this,"json")}async blob(){return Tke(this,"blob")}async bytes(){return Tke(this,"bytes")}async arrayBuffer(){return Tke(this,"arrayBuffer")}async formData(){throw new o0s}get bodyUsed(){return cOn.isDisturbed(this)}get body(){return this[gj]||(this[gj]=a0s(this),this[aT]&&(this[gj].getReader(),sOn(this[gj].locked))),this[gj]}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 s0s("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[nOn]>r&&this.destroy(new xer);let c=a(()=>{this.destroy(n.reason??new xer)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new xer):o(null)}).on("error",c0s).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function l0s(t){return t[gj]&&t[gj].locked===!0||t[aT]}a(l0s,"isLocked");function u0s(t){return cOn.isDisturbed(t)||l0s(t)}a(u0s,"isUnusable");async function Tke(t,e){return sOn(!t[aT]),new Promise((r,n)=>{if(u0s(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[aT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Per(this[aT],o)}).on("close",function(){this[aT].body!==null&&Per(this[aT],new aOn)}),d0s(t[aT])})})}a(Tke,"consume");function d0s(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(Rer,"chunksDecode");function iOn(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 f0s=require("node:assert"),{ResponseStatusCodeError:dOn}=Ec(),{chunksDecode:fOn}=Der(),p0s=128*1024;async function h0s({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){f0s(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>p0s){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new dOn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{pOn(r)?f=JSON.parse(fOn(c,l)):hOn(r)&&(f=fOn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new dOn(u,n,s,f)))}a(h0s,"getResolveErrorBodyCallback");var pOn=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"),hOn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");mOn.exports={getResolveErrorBodyCallback:h0s,isContentTypeApplicationJson:pOn,isContentTypeText:hOn}});var yOn=I((hef,Mer)=>{"use strict";p();var m0s=require("node:assert"),{Readable:g0s}=Der(),{InvalidArgumentError:gfe,RequestAbortedError:gOn}=Ec(),cT=qs(),{getResolveErrorBodyCallback:A0s}=Ner(),{AsyncResource:y0s}=require("node:async_hooks"),Dnt=class extends y0s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new gfe("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 gfe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new gfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new gfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new gfe("invalid method");if(l&&typeof l!="function")throw new gfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw cT.isStream(c)&&cT.destroy(c.on("error",cT.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,cT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new gOn:this.removeAbortListener=cT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new gOn,this.res?cT.destroy(this.res.on("error",cT.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}m0s(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"?cT.parseRawHeaders(r):cT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?cT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new g0s({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(A0s,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){cT.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(()=>{cT.destroy(r,e)})),o&&(this.body=null,cT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function AOn(t,e){if(e===void 0)return new Promise((r,n)=>{AOn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new Dnt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(AOn,"request");Mer.exports=AOn;Mer.exports.RequestHandler=Dnt});var Ike=I((Aef,vOn)=>{p();var{addAbortListener:E0s}=qs(),{RequestAbortedError:_0s}=Ec(),Afe=Symbol("kListener"),g5=Symbol("kSignal");function EOn(t){t.abort?t.abort(t[g5]?.reason):t.reason=t[g5]?.reason??new _0s,_On(t)}a(EOn,"abort");function v0s(t,e){if(t.reason=null,t[g5]=null,t[Afe]=null,!!e){if(e.aborted){EOn(t);return}t[g5]=e,t[Afe]=()=>{EOn(t)},E0s(t[g5],t[Afe])}}a(v0s,"addSignal");function _On(t){t[g5]&&("removeEventListener"in t[g5]?t[g5].removeEventListener("abort",t[Afe]):t[g5].removeListener("abort",t[Afe]),t[g5]=null,t[Afe]=null)}a(_On,"removeSignal");vOn.exports={addSignal:v0s,removeSignal:_On}});var TOn=I((_ef,SOn)=>{"use strict";p();var C0s=require("node:assert"),{finished:b0s,PassThrough:S0s}=require("node:stream"),{InvalidArgumentError:yfe,InvalidReturnValueError:T0s}=Ec(),g2=qs(),{getResolveErrorBodyCallback:I0s}=Ner(),{AsyncResource:x0s}=require("node:async_hooks"),{addSignal:w0s,removeSignal:COn}=Ike(),Oer=class extends x0s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new yfe("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 yfe("invalid callback");if(typeof r!="function")throw new yfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new yfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new yfe("invalid method");if(u&&typeof u!="function")throw new yfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw g2.isStream(l)&&g2.destroy(l.on("error",g2.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,g2.isStream(l)&&l.on("error",h=>{this.onError(h)}),w0s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}C0s(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"?g2.parseRawHeaders(r):g2.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"?g2.parseHeaders(r):f)["content-type"];h=new S0s,this.callback=null,this.runInAsyncScope(I0s,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 T0s("expected Writable");b0s(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&g2.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;COn(this),r&&(this.trailers=g2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;COn(this),this.factory=null,r?(this.res=null,g2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,g2.destroy(s,e))}};function bOn(t,e,r){if(r===void 0)return new Promise((n,o)=>{bOn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new Oer(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(bOn,"stream");SOn.exports=bOn});var ROn=I((bef,wOn)=>{"use strict";p();var{Readable:xOn,Duplex:R0s,PassThrough:k0s}=require("node:stream"),{InvalidArgumentError:xke,InvalidReturnValueError:P0s,RequestAbortedError:Ler}=Ec(),Tw=qs(),{AsyncResource:D0s}=require("node:async_hooks"),{addSignal:N0s,removeSignal:M0s}=Ike(),IOn=require("node:assert"),Efe=Symbol("resume"),Ber=class extends xOn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Efe]=null}_read(){let{[Efe]:e}=this;e&&(this[Efe]=null,e())}_destroy(e,r){this._read(),r(e)}},Fer=class extends xOn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Efe]=e}_read(){this[Efe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Ler),r(e)}},Uer=class extends D0s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new xke("invalid opts");if(typeof r!="function")throw new xke("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 xke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new xke("invalid method");if(c&&typeof c!="function")throw new xke("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 Ber().on("error",Tw.nop),this.ret=new R0s({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[Efe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Ler),A&&u&&A(),Tw.destroy(f,u),Tw.destroy(h,u),Tw.destroy(m,u),M0s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,N0s(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}IOn(!o,"pipeline cannot be retried"),IOn(!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"?Tw.parseRawHeaders(r):Tw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Fer(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Tw.parseRawHeaders(r):Tw.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",Tw.nop),u}if(!l||typeof l.on!="function")throw new P0s("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;Tw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Tw.destroy(u,new Ler)}),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,Tw.destroy(r,e)}};function O0s(t,e){try{let r=new Uer(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new k0s().destroy(r)}}a(O0s,"pipeline");wOn.exports=O0s});var OOn=I((Ief,MOn)=>{"use strict";p();var{InvalidArgumentError:Qer,SocketError:L0s}=Ec(),{AsyncResource:B0s}=require("node:async_hooks"),kOn=qs(),{addSignal:F0s,removeSignal:POn}=Ike(),DOn=require("node:assert"),qer=class extends B0s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Qer("invalid opts");if(typeof r!="function")throw new Qer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Qer("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,F0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}DOn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new L0s("bad upgrade",null)}onUpgrade(e,r,n){DOn(e===101);let{callback:o,opaque:s,context:c}=this;POn(this),this.callback=null;let l=this.responseHeaders==="raw"?kOn.parseRawHeaders(r):kOn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;POn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function NOn(t,e){if(e===void 0)return new Promise((r,n)=>{NOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new qer(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(NOn,"upgrade");MOn.exports=NOn});var QOn=I((Ref,UOn)=>{"use strict";p();var U0s=require("node:assert"),{AsyncResource:Q0s}=require("node:async_hooks"),{InvalidArgumentError:jer,SocketError:q0s}=Ec(),LOn=qs(),{addSignal:j0s,removeSignal:BOn}=Ike(),Her=class extends Q0s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new jer("invalid opts");if(typeof r!="function")throw new jer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new jer("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,j0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}U0s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new q0s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;BOn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?LOn.parseRawHeaders(r):LOn.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;BOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function FOn(t,e){if(e===void 0)return new Promise((r,n)=>{FOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Her(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(FOn,"connect");UOn.exports=FOn});var qOn=I((Def,_fe)=>{"use strict";p();_fe.exports.request=yOn();_fe.exports.stream=TOn();_fe.exports.pipeline=ROn();_fe.exports.upgrade=OOn();_fe.exports.connect=QOn()});var $er=I((Mef,HOn)=>{"use strict";p();var{UndiciError:H0s}=Ec(),jOn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Ger=class t extends H0s{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[jOn]===!0}[jOn]=!0};HOn.exports={MockNotMatchedError:Ger}});var vfe=I((Bef,GOn)=>{"use strict";p();GOn.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 wke=I((Uef,t5n)=>{"use strict";p();var{MockNotMatchedError:ZJ}=$er(),{kDispatches:Nnt,kMockAgent:G0s,kOriginalDispatch:$0s,kOrigin:V0s,kGetNetConnect:W0s}=vfe(),{buildURL:z0s}=qs(),{STATUS_CODES:Y0s}=require("node:http"),{types:{isPromise:K0s}}=require("node:util");function NF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(NF,"matchValue");function VOn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(VOn,"lowerCaseEntries");function WOn(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=WOn(e,r);if(!NF(n,o))return!1}return!0}a(zOn,"matchHeaders");function $On(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($On,"safeUrl");function J0s(t,{path:e,method:r,body:n,headers:o}){let s=NF(t.path,e),c=NF(t.method,r),l=typeof t.body<"u"?NF(t.body,n):!0,u=zOn(t,o);return s&&c&&l&&u}a(J0s,"matchKey");function YOn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(YOn,"getResponseData");function KOn(t,e){let r=e.query?z0s(e.path,e.query):e.path,n=typeof r=="string"?$On(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>NF($On(s),n));if(o.length===0)throw new ZJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>NF(s,e.method)),o.length===0)throw new ZJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?NF(s,e.body):!0),o.length===0)throw new ZJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>zOn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new ZJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(KOn,"getMockDispatch");function Z0s(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(Z0s,"addMockDispatch");function Ver(t,e){let r=t.findIndex(n=>n.consumed?J0s(n,e):!1);r!==-1&&t.splice(r,1)}a(Ver,"deleteMockDispatch");function JOn(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(JOn,"buildKey");function Wer(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Nnt])},d):g(this[Nnt]);function g(y,E=s){let _=Array.isArray(t.headers)?zer(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(K0s(v)){v.then(R=>g(y,R));return}let b=YOn(v),T=Wer(c),w=Wer(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,ZOn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),Ver(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(XOn,"mockDispatch");function egs(){let t=this[G0s],e=this[V0s],r=this[$0s];return a(function(o,s){if(t.isMockActive)try{XOn.call(this,o,s)}catch(c){if(c instanceof ZJ){let l=t[W0s]();if(l===!1)throw new ZJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(e5n(l,e))r.call(this,o,s);else throw new ZJ(`${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(egs,"buildMockDispatch");function e5n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>NF(n,r.host)))}a(e5n,"checkNetConnect");function tgs(t){if(t){let{agent:e,...r}=t;return r}}a(tgs,"buildMockOptions");t5n.exports={getResponseData:YOn,getMockDispatch:KOn,addMockDispatch:Z0s,deleteMockDispatch:Ver,buildKey:JOn,generateKeyValues:Wer,matchValue:NF,getResponse:X0s,getStatusText:ZOn,mockDispatch:XOn,buildMockDispatch:egs,checkNetConnect:e5n,buildMockOptions:tgs,getHeaderByName:WOn,buildHeadersFromArray:zer}});var ttr=I((jef,etr)=>{"use strict";p();var{getResponseData:rgs,buildKey:ngs,addMockDispatch:Yer}=wke(),{kDispatches:Mnt,kDispatchKey:Ont,kDefaultHeaders:Ker,kDefaultTrailers:Jer,kContentLength:Zer,kMockDispatch:Lnt}=vfe(),{InvalidArgumentError:A5}=Ec(),{buildURL:igs}=qs(),Cfe=class{static{a(this,"MockScope")}constructor(e){this[Lnt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("waitInMs must be a valid integer > 0");return this[Lnt].delay=e,this}persist(){return this[Lnt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("repeatTimes must be a valid integer > 0");return this[Lnt].times=e,this}},Xer=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new A5("opts must be an object");if(typeof e.path>"u")throw new A5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=igs(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[Ont]=ngs(e),this[Mnt]=r,this[Ker]={},this[Jer]={},this[Zer]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=rgs(r),s=this[Zer]?{"content-length":o.length}:{},c={...this[Ker],...s,...n.headers},l={...this[Jer],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new A5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new A5("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 A5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Yer(this[Mnt],this[Ont],s);return new Cfe(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=Yer(this[Mnt],this[Ont],n);return new Cfe(o)}replyWithError(e){if(typeof e>"u")throw new A5("error must be defined");let r=Yer(this[Mnt],this[Ont],{error:e});return new Cfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new A5("headers must be defined");return this[Ker]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new A5("trailers must be defined");return this[Jer]=e,this}replyContentLength(){return this[Zer]=!0,this}};etr.exports.MockInterceptor=Xer;etr.exports.MockScope=Cfe});var itr=I(($ef,c5n)=>{"use strict";p();var{promisify:ogs}=require("node:util"),sgs=dfe(),{buildMockDispatch:ags}=wke(),{kDispatches:r5n,kMockAgent:n5n,kClose:i5n,kOriginalClose:o5n,kOrigin:s5n,kOriginalDispatch:cgs,kConnected:rtr}=vfe(),{MockInterceptor:lgs}=ttr(),a5n=jd(),{InvalidArgumentError:ugs}=Ec(),ntr=class extends sgs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ugs("Argument opts.agent must implement Agent");this[n5n]=r.agent,this[s5n]=e,this[r5n]=[],this[rtr]=1,this[cgs]=this.dispatch,this[o5n]=this.close.bind(this),this.dispatch=ags.call(this),this.close=this[i5n]}get[a5n.kConnected](){return this[rtr]}intercept(e){return new lgs(e,this[r5n])}async[i5n](){await ogs(this[o5n])(),this[rtr]=0,this[n5n][a5n.kClients].delete(this[s5n])}};c5n.exports=ntr});var atr=I((zef,m5n)=>{"use strict";p();var{promisify:dgs}=require("node:util"),fgs=ffe(),{buildMockDispatch:pgs}=wke(),{kDispatches:l5n,kMockAgent:u5n,kClose:d5n,kOriginalClose:f5n,kOrigin:p5n,kOriginalDispatch:hgs,kConnected:otr}=vfe(),{MockInterceptor:mgs}=ttr(),h5n=jd(),{InvalidArgumentError:ggs}=Ec(),str=class extends fgs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ggs("Argument opts.agent must implement Agent");this[u5n]=r.agent,this[p5n]=e,this[l5n]=[],this[otr]=1,this[hgs]=this.dispatch,this[f5n]=this.close.bind(this),this.dispatch=pgs.call(this),this.close=this[d5n]}get[h5n.kConnected](){return this[otr]}intercept(e){return new mgs(e,this[l5n])}async[d5n](){await dgs(this[f5n])(),this[otr]=0,this[u5n][h5n.kClients].delete(this[p5n])}};m5n.exports=str});var A5n=I((Zef,g5n)=>{"use strict";p();var Ags={pronoun:"it",is:"is",was:"was",this:"this"},ygs={pronoun:"they",is:"are",was:"were",this:"these"};g5n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Ags:ygs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var E5n=I((rtf,y5n)=>{"use strict";p();var{Transform:Egs}=require("node:stream"),{Console:_gs}=require("node:console"),vgs=process.versions.icu?"\u2705":"Y ",Cgs=process.versions.icu?"\u274C":"N ";y5n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Egs({transform(r,n,o){o(null,r)}}),this.logger=new _gs({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?vgs:Cgs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var b5n=I((otf,C5n)=>{"use strict";p();var{kClients:XJ}=jd(),bgs=pfe(),{kAgent:ctr,kMockAgentSet:Bnt,kMockAgentGet:_5n,kDispatches:ltr,kIsMockActive:Fnt,kNetConnect:eZ,kGetNetConnect:Sgs,kOptions:Unt,kFactory:Qnt}=vfe(),Tgs=itr(),Igs=atr(),{matchValue:xgs,buildMockOptions:wgs}=wke(),{InvalidArgumentError:v5n,UndiciError:Rgs}=Ec(),kgs=JRe(),Pgs=A5n(),Dgs=E5n(),utr=class extends kgs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[eZ]=!0,this[Fnt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new v5n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new bgs(e);this[ctr]=r,this[XJ]=r[XJ],this[Unt]=wgs(e)}get(e){let r=this[_5n](e);return r||(r=this[Qnt](e),this[Bnt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[ctr].dispatch(e,r)}async close(){await this[ctr].close(),this[XJ].clear()}deactivate(){this[Fnt]=!1}activate(){this[Fnt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[eZ])?this[eZ].push(e):this[eZ]=[e];else if(typeof e>"u")this[eZ]=!0;else throw new v5n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[eZ]=!1}get isMockActive(){return this[Fnt]}[Bnt](e,r){this[XJ].set(e,r)}[Qnt](e){let r=Object.assign({agent:this},this[Unt]);return this[Unt]&&this[Unt].connections===1?new Tgs(e,r):new Igs(e,r)}[_5n](e){let r=this[XJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Qnt]("http://localhost:9999");return this[Bnt](e,n),n}for(let[n,o]of Array.from(this[XJ]))if(o&&typeof n!="string"&&xgs(n,e)){let s=this[Qnt](e);return this[Bnt](e,s),s[ltr]=o[ltr],s}}[Sgs](){return this[eZ]}pendingInterceptors(){let e=this[XJ];return Array.from(e.entries()).flatMap(([r,n])=>n[ltr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Dgs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Pgs("interceptor","interceptors").pluralize(r.length);throw new Rgs(` +`,"latin1"),r!==null&&o!==r){if(n[WXt])throw new VJ;process.emitWarning(new VJ)}e[pp].timeout&&e[pp].timeoutType===cfe&&e[pp].timeout.refresh&&e[pp].timeout.refresh(),n[lj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[uj]=!1,e&&(Hi(n[EE]<=1,"pipeline should only contain this request"),o(e))}};UNn.exports=Kps});var zNn=I((UXd,WNn)=>{"use strict";p();var Tw=require("node:assert"),{pipeline:rhs}=require("node:stream"),pa=qs(),{RequestContentLengthMismatchError:JXt,RequestAbortedError:qNn,SocketError:hke,InformationalError:ZXt}=Ec(),{kUrl:vnt,kReset:bnt,kClient:lfe,kRunning:Snt,kPending:nhs,kQueue:dj,kPendingIdx:XXt,kRunningIdx:p2,kError:m2,kSocket:Rg,kStrictContentLength:ihs,kOnError:eer,kMaxConcurrentStreams:VNn,kHTTP2Session:h2,kResume:fj,kSize:ohs,kHTTPContext:shs}=Gd(),DF=Symbol("open streams"),jNn,HNn=!1,Cnt;try{Cnt=require("node:http2")}catch{Cnt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:ahs,HTTP2_HEADER_METHOD:chs,HTTP2_HEADER_PATH:lhs,HTTP2_HEADER_SCHEME:uhs,HTTP2_HEADER_CONTENT_LENGTH:dhs,HTTP2_HEADER_EXPECT:fhs,HTTP2_HEADER_STATUS:phs}}=Cnt;function hhs(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(hhs,"parseH2Headers");async function mhs(t,e){t[Rg]=e,HNn||(HNn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=Cnt.connect(t[vnt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[VNn]});r[DF]=0,r[lfe]=t,r[Rg]=e,pa.addListener(r,"error",Ahs),pa.addListener(r,"frameError",yhs),pa.addListener(r,"end",Ehs),pa.addListener(r,"goaway",_hs),pa.addListener(r,"close",function(){let{[lfe]:o}=this,{[Rg]:s}=o,c=this[Rg][m2]||this[m2]||new hke("closed",pa.getSocketInfo(s));if(o[h2]=null,o.destroyed){Tw(o[nhs]===0);let l=o[dj].splice(o[p2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return Chs(t,...o)},resume(){ghs(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(mhs,"connectH2");function ghs(t){let e=t[Rg];e?.destroyed===!1&&(t[ohs]===0&&t[VNn]===0?(e.unref(),t[h2].unref()):(e.ref(),t[h2].ref()))}a(ghs,"resumeH2");function Ahs(t){Tw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Rg][m2]=t,this[lfe][eer](t)}a(Ahs,"onHttp2SessionError");function yhs(t,e,r){if(r===0){let n=new ZXt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Rg][m2]=n,this[lfe][eer](n)}}a(yhs,"onHttp2FrameError");function Ehs(){let t=new hke("other side closed",pa.getSocketInfo(this[Rg]));this.destroy(t),pa.destroy(this[Rg],t)}a(Ehs,"onHttp2SessionEnd");function _hs(t){let e=this[m2]||new hke(`HTTP/2: "GOAWAY" frame received with code ${t}`,pa.getSocketInfo(this)),r=this[lfe];if(r[Rg]=null,r[shs]=null,this[h2]!=null&&(this[h2].destroy(e),this[h2]=null),pa.destroy(this[Rg],e),r[p2]{e.aborted||e.completed||(T=T||new qNn,pa.errorRequest(t,e,T),m!=null&&pa.destroy(m,T),pa.destroy(f,T),t[dj][t[p2]++]=null,t[fj]())},"abort");try{e.onConnect(y)}catch(T){pa.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[DF],t[dj][t[p2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[DF],t[dj][t[p2]++]=null}),m.once("close",()=>{r[DF]-=1,r[DF]===0&&r.unref()}),!0;h[lhs]=o,h[uhs]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=pa.bodyLength(f);if(pa.isFormDataLike(f)){jNn??=ofe().extractBody;let[T,w]=jNn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),vhs(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[ihs])return pa.errorRequest(t,e,new JXt),!1;process.emitWarning(new JXt)}_!=null&&(Tw(f,"no body must not have content length"),h[dhs]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[fhs]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[DF],m.once("response",T=>{let{[phs]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new qNn;pa.errorRequest(t,e,x),pa.destroy(m,x);return}e.onHeaders(Number(w),hhs(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[DF]===0&&r.unref(),y(new ZXt("HTTP/2: stream half-closed (remote)")),t[dj][t[p2]++]=null,t[XXt]=t[p2],t[fj]()}),m.once("close",()=>{r[DF]-=1,r[DF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new ZXt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?GNn(y,m,null,t,e,t[Rg],_,E):pa.isBuffer(f)?GNn(y,m,f,t,e,t[Rg],_,E):pa.isBlobLike(f)?typeof f.stream=="function"?$Nn(y,m,f.stream(),t,e,t[Rg],_,E):Shs(y,m,f,t,e,t[Rg],_,E):pa.isStream(f)?bhs(y,t[Rg],E,m,f,t,e,_):pa.isIterable(f)?$Nn(y,m,f,t,e,t[Rg],_,E):Tw(!1)}a(b,"writeBodyH2")}a(Chs,"writeH2");function GNn(t,e,r,n,o,s,c,l){try{r!=null&&pa.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[bnt]=!0),o.onRequestSent(),n[fj]()}catch(u){t(u)}}a(GNn,"writeBuffer");function bhs(t,e,r,n,o,s,c,l){Tw(l!==0||s[Snt]===0,"stream body cannot be pipelined");let u=rhs(o,n,f=>{f?(pa.destroy(u,f),t(f)):(pa.removeAllListeners(u),c.onRequestSent(),r||(e[bnt]=!0),s[fj]())});pa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(bhs,"writeStream");async function Shs(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 JXt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[bnt]=!0),n[fj]()}catch(u){t(u)}}a(Shs,"writeBlob");async function $Nn(t,e,r,n,o,s,c,l){Tw(c!==0||n[Snt]===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[m2]?m(s[m2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[m2])throw s[m2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[bnt]=!0),n[fj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a($Nn,"writeIterable");WNn.exports=mhs});var Int=I((jXd,JNn)=>{"use strict";p();var g5=qs(),{kBodyUsed:mke}=Gd(),rer=require("node:assert"),{InvalidArgumentError:Ths}=Ec(),Ihs=require("node:events"),xhs=[300,301,302,303,307,308],YNn=Symbol("body"),Tnt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[YNn]=e,this[mke]=!1}async*[Symbol.asyncIterator](){rer(!this[mke],"disturbed"),this[mke]=!0,yield*this[YNn]}},ter=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Ths("maxRedirections must be a positive number");g5.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,g5.isStream(this.opts.body)?(g5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){rer(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[mke]=!1,Ihs.prototype.on.call(this.opts.body,"data",function(){this[mke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Tnt(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&g5.isIterable(this.opts.body)&&(this.opts.body=new Tnt(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||g5.isDisturbed(this.opts.body)?null:whs(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}=g5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=Rhs(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 whs(t,e){if(xhs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var khs=Int();function Phs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new khs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(Phs,"createRedirectInterceptor");ZNn.exports=Phs});var ffe=I((zXd,cMn)=>{"use strict";p();var NF=require("node:assert"),iMn=require("node:net"),Dhs=require("node:http"),WJ=qs(),{channels:ufe}=Vde(),Nhs=pDn(),Mhs=Kde(),{InvalidArgumentError:ch,InformationalError:Ohs,ClientDestroyedError:Lhs}=Ec(),Bhs=rke(),{kUrl:A5,kServerName:pj,kClient:Fhs,kBusy:ner,kConnect:Uhs,kResuming:zJ,kRunning:_ke,kPending:vke,kSize:Eke,kQueue:g2,kConnected:Qhs,kConnecting:dfe,kNeedDrain:mj,kKeepAliveDefaultTimeout:XNn,kHostHeader:qhs,kPendingIdx:A2,kRunningIdx:MF,kError:jhs,kPipelining:wnt,kKeepAliveTimeoutValue:Hhs,kMaxHeadersSize:Ghs,kKeepAliveMaxTimeout:$hs,kKeepAliveTimeoutThreshold:Vhs,kHeadersTimeout:Whs,kBodyTimeout:zhs,kStrictContentLength:Yhs,kConnector:gke,kMaxRedirections:Khs,kMaxRequests:ier,kCounter:Jhs,kClose:Zhs,kDestroy:Xhs,kDispatch:ems,kInterceptors:eMn,kLocalAddress:Ake,kMaxResponseSize:tms,kOnError:rms,kHTTPContext:lh,kMaxConcurrentStreams:nms,kResume:yke}=Gd(),ims=QNn(),oms=zNn(),tMn=!1,hj=Symbol("kClosedResolve"),rMn=a(()=>{},"noop");function oMn(t){return t[wnt]??t[lh]?.defaultPipelining??1}a(oMn,"getPipelining");var oer=class extends Mhs{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:L,allowH2:B}={}){if(super(),f!==void 0)throw new ch("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new ch("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new ch("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new ch("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new ch("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new ch("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new ch("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new ch("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new ch("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new ch("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new ch("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new ch("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new ch("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new ch("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new ch("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new ch("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||iMn.isIP(x)===0))throw new ch("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new ch("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new ch("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new ch("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new ch("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Bhs({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[eMn]=r.Client,tMn||(tMn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[eMn]=[sms({maxRedirections:T})],this[A5]=WJ.parseOrigin(e),this[gke]=w,this[wnt]=E??1,this[Ghs]=n||Dhs.maxHeaderSize,this[XNn]=h??4e3,this[$hs]=g??6e5,this[Vhs]=A??2e3,this[Hhs]=this[XNn],this[pj]=null,this[Ake]=x??null,this[zJ]=0,this[mj]=0,this[qhs]=`host: ${this[A5].hostname}${this[A5].port?`:${this[A5].port}`:""}\r +`,this[zhs]=u??3e5,this[Whs]=o??3e5,this[Yhs]=v??!0,this[Khs]=T,this[ier]=R,this[hj]=null,this[tms]=P>-1?P:-1,this[nms]=L??100,this[lh]=null,this[g2]=[],this[MF]=0,this[A2]=0,this[yke]=q=>ser(this,q),this[rms]=q=>sMn(this,q)}get pipelining(){return this[wnt]}set pipelining(e){this[wnt]=e,this[yke](!0)}get[vke](){return this[g2].length-this[A2]}get[_ke](){return this[A2]-this[MF]}get[Eke](){return this[g2].length-this[MF]}get[Qhs](){return!!this[lh]&&!this[dfe]&&!this[lh].destroyed}get[ner](){return!!(this[lh]?.busy(null)||this[Eke]>=(oMn(this)||1)||this[vke]>0)}[Uhs](e){aMn(this),this.once("connect",e)}[ems](e,r){let n=e.origin||this[A5].origin,o=new Nhs(n,e,r);return this[g2].push(o),this[zJ]||(WJ.bodyLength(o.body)==null&&WJ.isIterable(o.body)?(this[zJ]=1,queueMicrotask(()=>ser(this))):this[yke](!0)),this[zJ]&&this[mj]!==2&&this[ner]&&(this[mj]=2),this[mj]<2}async[Zhs](){return new Promise(e=>{this[Eke]?this[hj]=e:e(null)})}async[Xhs](e){return new Promise(r=>{let n=this[g2].splice(this[A2]);for(let s=0;s{this[hj]&&(this[hj](),this[hj]=null),r(null)},"callback");this[lh]?(this[lh].destroy(e,o),this[lh]=null):queueMicrotask(o),this[yke]()})}},sms=xnt();function sMn(t,e){if(t[_ke]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){NF(t[A2]===t[MF]);let r=t[g2].splice(t[MF]);for(let n=0;n{t[gke]({host:e,hostname:r,protocol:n,port:o,servername:t[pj],localAddress:t[Ake]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){WJ.destroy(s.on("error",rMn),new Lhs);return}NF(s);try{t[lh]=s.alpnProtocol==="h2"?await oms(t,s):await ims(t,s)}catch(c){throw s.destroy().on("error",rMn),c}t[dfe]=!1,s[Jhs]=0,s[ier]=t[ier],s[Fhs]=t,s[jhs]=null,ufe.connected.hasSubscribers&&ufe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[lh]?.version,servername:t[pj],localAddress:t[Ake]},connector:t[gke],socket:s}),t.emit("connect",t[A5],[t])}catch(s){if(t.destroyed)return;if(t[dfe]=!1,ufe.connectError.hasSubscribers&&ufe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[lh]?.version,servername:t[pj],localAddress:t[Ake]},connector:t[gke],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(NF(t[_ke]===0);t[vke]>0&&t[g2][t[A2]].servername===t[pj];){let c=t[g2][t[A2]++];WJ.errorRequest(t,c,s)}else sMn(t,s);t.emit("connectionError",t[A5],[t],s)}t[yke]()}a(aMn,"connect");function nMn(t){t[mj]=0,t.emit("drain",t[A5],[t])}a(nMn,"emitDrain");function ser(t,e){t[zJ]!==2&&(t[zJ]=2,ams(t,e),t[zJ]=0,t[MF]>256&&(t[g2].splice(0,t[MF]),t[A2]-=t[MF],t[MF]=0))}a(ser,"resume");function ams(t,e){for(;;){if(t.destroyed){NF(t[vke]===0);return}if(t[hj]&&!t[Eke]){t[hj](),t[hj]=null;return}if(t[lh]&&t[lh].resume(),t[ner])t[mj]=2;else if(t[mj]===2){e?(t[mj]=1,queueMicrotask(()=>nMn(t))):nMn(t);continue}if(t[vke]===0||t[_ke]>=(oMn(t)||1))return;let r=t[g2][t[A2]];if(t[A5].protocol==="https:"&&t[pj]!==r.servername){if(t[_ke]>0)return;t[pj]=r.servername,t[lh]?.destroy(new Ohs("servername changed"),()=>{t[lh]=null,ser(t)})}if(t[dfe])return;if(!t[lh]){aMn(t);return}if(t[lh].destroyed||t[lh].busy(r))return;!r.aborted&&t[lh].write(r)?t[A2]++:t[g2].splice(t[A2],1)}}a(ams,"_resume");cMn.exports=oer});var aer=I((ZXd,lMn)=>{"use strict";p();var Rnt=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)}};lMn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Rnt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Rnt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var dMn=I((tef,uMn)=>{p();var{kFree:cms,kConnected:lms,kPending:ums,kQueued:dms,kRunning:fms,kSize:pms}=Gd(),YJ=Symbol("pool"),cer=class{static{a(this,"PoolStats")}constructor(e){this[YJ]=e}get connected(){return this[YJ][lms]}get free(){return this[YJ][cms]}get pending(){return this[YJ][ums]}get queued(){return this[YJ][dms]}get running(){return this[YJ][fms]}get size(){return this[YJ][pms]}};uMn.exports=cer});var her=I((ief,vMn)=>{"use strict";p();var hms=Kde(),mms=aer(),{kConnected:ler,kSize:fMn,kRunning:pMn,kPending:hMn,kQueued:Cke,kBusy:gms,kFree:Ams,kUrl:yms,kClose:Ems,kDestroy:_ms,kDispatch:vms}=Gd(),Cms=dMn(),ob=Symbol("clients"),sv=Symbol("needDrain"),bke=Symbol("queue"),uer=Symbol("closed resolve"),der=Symbol("onDrain"),mMn=Symbol("onConnect"),gMn=Symbol("onDisconnect"),AMn=Symbol("onConnectionError"),fer=Symbol("get dispatcher"),EMn=Symbol("add client"),_Mn=Symbol("remove client"),yMn=Symbol("stats"),per=class extends hms{static{a(this,"PoolBase")}constructor(){super(),this[bke]=new mms,this[ob]=[],this[Cke]=0;let e=this;this[der]=a(function(n,o){let s=e[bke],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Cke]--,c=!this.dispatch(l.opts,l.handler)}this[sv]=c,!this[sv]&&e[sv]&&(e[sv]=!1,e.emit("drain",n,[e,...o])),e[uer]&&s.isEmpty()&&Promise.all(e[ob].map(l=>l.close())).then(e[uer])},"onDrain"),this[mMn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[gMn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[AMn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[yMn]=new Cms(this)}get[gms](){return this[sv]}get[ler](){return this[ob].filter(e=>e[ler]).length}get[Ams](){return this[ob].filter(e=>e[ler]&&!e[sv]).length}get[hMn](){let e=this[Cke];for(let{[hMn]:r}of this[ob])e+=r;return e}get[pMn](){let e=0;for(let{[pMn]:r}of this[ob])e+=r;return e}get[fMn](){let e=this[Cke];for(let{[fMn]:r}of this[ob])e+=r;return e}get stats(){return this[yMn]}async[Ems](){this[bke].isEmpty()?await Promise.all(this[ob].map(e=>e.close())):await new Promise(e=>{this[uer]=e})}async[_ms](e){for(;;){let r=this[bke].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[ob].map(r=>r.destroy(e)))}[vms](e,r){let n=this[fer]();return n?n.dispatch(e,r)||(n[sv]=!0,this[sv]=!this[fer]()):(this[sv]=!0,this[bke].push({opts:e,handler:r}),this[Cke]++),!this[sv]}[EMn](e){return e.on("drain",this[der]).on("connect",this[mMn]).on("disconnect",this[gMn]).on("connectionError",this[AMn]),this[ob].push(e),this[sv]&&queueMicrotask(()=>{this[sv]&&this[der](e[yms],[this,e])}),this}[_Mn](e){e.close(()=>{let r=this[ob].indexOf(e);r!==-1&&this[ob].splice(r,1)}),this[sv]=this[ob].some(r=>!r[sv]&&r.closed!==!0&&r.destroyed!==!0)}};vMn.exports={PoolBase:per,kClients:ob,kNeedDrain:sv,kAddClient:EMn,kRemoveClient:_Mn,kGetDispatcher:fer}});var pfe=I((aef,TMn)=>{"use strict";p();var{PoolBase:bms,kClients:knt,kNeedDrain:Sms,kAddClient:Tms,kGetDispatcher:Ims}=her(),xms=ffe(),{InvalidArgumentError:mer}=Ec(),CMn=qs(),{kUrl:bMn,kInterceptors:wms}=Gd(),Rms=rke(),ger=Symbol("options"),Aer=Symbol("connections"),SMn=Symbol("factory");function kms(t,e){return new xms(t,e)}a(kms,"defaultFactory");var yer=class extends bms{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=kms,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 mer("invalid connections");if(typeof n!="function")throw new mer("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new mer("connect must be a function or an object");typeof o!="function"&&(o=Rms({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[wms]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[Aer]=r||null,this[bMn]=CMn.parseOrigin(e),this[ger]={...CMn.deepClone(m),connect:o,allowH2:h},this[ger].interceptors=m.interceptors?{...m.interceptors}:void 0,this[SMn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[knt].indexOf(E);_!==-1&&this[knt].splice(_,1)}})}[Ims](){for(let e of this[knt])if(!e[Sms])return e;if(!this[Aer]||this[knt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Pms,InvalidArgumentError:Dms}=Ec(),{PoolBase:Nms,kClients:_E,kNeedDrain:Ske,kAddClient:Mms,kRemoveClient:Oms,kGetDispatcher:Lms}=her(),Bms=pfe(),{kUrl:Eer,kInterceptors:Fms}=Gd(),{parseOrigin:IMn}=qs(),xMn=Symbol("factory"),Pnt=Symbol("options"),wMn=Symbol("kGreatestCommonDivisor"),KJ=Symbol("kCurrentWeight"),JJ=Symbol("kIndex"),Iw=Symbol("kWeight"),Dnt=Symbol("kMaxWeightPerServer"),Nnt=Symbol("kErrorPenalty");function Ums(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Ums,"getGreatestCommonDivisor");function Qms(t,e){return new Bms(t,e)}a(Qms,"defaultFactory");var _er=class extends Nms{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Qms,...n}={}){if(super(),this[Pnt]=n,this[JJ]=-1,this[KJ]=0,this[Dnt]=this[Pnt].maxWeightPerServer||100,this[Nnt]=this[Pnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Dms("factory must be a function.");this[Fms]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[xMn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=IMn(e).origin;if(this[_E].find(o=>o[Eer].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[xMn](r,Object.assign({},this[Pnt]));this[Mms](n),n.on("connect",()=>{n[Iw]=Math.min(this[Dnt],n[Iw]+this[Nnt])}),n.on("connectionError",()=>{n[Iw]=Math.max(1,n[Iw]-this[Nnt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Iw]=Math.max(1,n[Iw]-this[Nnt]),this._updateBalancedPoolStats())});for(let o of this[_E])o[Iw]=this[Dnt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Eer].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Oms](n),this}get upstreams(){return this[_E].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Eer].origin)}[Lms](){if(this[_E].length===0)throw new Pms;if(!this[_E].find(s=>!s[Ske]&&s.closed!==!0&&s.destroyed!==!0)||this[_E].map(s=>s[Ske]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[_E].findIndex(s=>!s[Ske]);for(;n++this[_E][o][Iw]&&!s[Ske]&&(o=this[JJ]),this[JJ]===0&&(this[KJ]=this[KJ]-this[wMn],this[KJ]<=0&&(this[KJ]=this[Dnt])),s[Iw]>=this[KJ]&&!s[Ske])return s}return this[KJ]=this[_E][o][Iw],this[JJ]=o,this[_E][o]}};RMn.exports=_er});var hfe=I((pef,BMn)=>{"use strict";p();var{InvalidArgumentError:Mnt}=Ec(),{kClients:gj,kRunning:PMn,kClose:qms,kDestroy:jms,kDispatch:Hms,kInterceptors:Gms}=Gd(),$ms=Kde(),Vms=pfe(),Wms=ffe(),zms=qs(),Yms=xnt(),DMn=Symbol("onConnect"),NMn=Symbol("onDisconnect"),MMn=Symbol("onConnectionError"),Kms=Symbol("maxRedirections"),OMn=Symbol("onDrain"),LMn=Symbol("factory"),ver=Symbol("options");function Jms(t,e){return e&&e.connections===1?new Wms(t,e):new Vms(t,e)}a(Jms,"defaultFactory");var Cer=class extends $ms{static{a(this,"Agent")}constructor({factory:e=Jms,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new Mnt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Mnt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new Mnt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Gms]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Yms({maxRedirections:r})],this[ver]={...zms.deepClone(o),connect:n},this[ver].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Kms]=r,this[LMn]=e,this[gj]=new Map,this[OMn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[DMn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[NMn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[MMn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[PMn](){let e=0;for(let r of this[gj].values())e+=r[PMn];return e}[Hms](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Mnt("opts.origin must be a non-empty string or URL.");let o=this[gj].get(n);return o||(o=this[LMn](e.origin,this[ver]).on("drain",this[OMn]).on("connect",this[DMn]).on("disconnect",this[NMn]).on("connectionError",this[MMn]),this[gj].set(n,o)),o.dispatch(e,r)}async[qms](){let e=[];for(let r of this[gj].values())e.push(r.close());this[gj].clear(),await Promise.all(e)}async[jms](e){let r=[];for(let n of this[gj].values())r.push(n.destroy(e));this[gj].clear(),await Promise.all(r)}};BMn.exports=Cer});var xer=I((gef,zMn)=>{"use strict";p();var{kProxy:ber,kClose:HMn,kDestroy:GMn,kDispatch:FMn,kInterceptors:Zms}=Gd(),{URL:ZJ}=require("node:url"),Xms=hfe(),$Mn=pfe(),VMn=Kde(),{InvalidArgumentError:mfe,RequestAbortedError:e0s,SecureProxyConnectionError:t0s}=Ec(),UMn=rke(),WMn=ffe(),Ont=Symbol("proxy agent"),Lnt=Symbol("proxy client"),Aj=Symbol("proxy headers"),Ser=Symbol("request tls settings"),QMn=Symbol("proxy tls settings"),qMn=Symbol("connect endpoint function"),jMn=Symbol("tunnel proxy");function r0s(t){return t==="https:"?443:80}a(r0s,"defaultProtocolPort");function n0s(t,e){return new $Mn(t,e)}a(n0s,"defaultFactory");var i0s=a(()=>{},"noop");function o0s(t,e){return e.connections===1?new WMn(t,e):new $Mn(t,e)}a(o0s,"defaultAgentFactory");var Ter=class extends VMn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new mfe("Proxy URL is mandatory");this[Aj]=r,o?this.#e=o(e,{connect:n}):this.#e=new WMn(e,{connect:n})}[FMn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new mfe("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 ZJ(o);c.host=l}return e.headers={...this[Aj],...c},this.#e[FMn](e,r)}async[HMn](){return this.#e.close()}async[GMn](e){return this.#e.destroy(e)}},Ier=class extends VMn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof ZJ)&&!e.uri)throw new mfe("Proxy uri is mandatory");let{clientFactory:r=n0s}=e;if(typeof r!="function")throw new mfe("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[ber]={uri:s,protocol:u},this[Zms]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[Ser]=e.requestTls,this[QMn]=e.proxyTls,this[Aj]=e.headers||{},this[jMn]=n,e.auth&&e.token)throw new mfe("opts.auth cannot be used in combination with opts.token");e.auth?this[Aj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Aj]["proxy-authorization"]=e.token:d&&f&&(this[Aj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=UMn({...e.proxyTls});this[qMn]=UMn({...e.requestTls});let g=e.factory||o0s,A=a((y,E)=>{let{protocol:_}=new ZJ(y);return!this[jMn]&&_==="http:"&&this[ber].protocol==="http:"?new Ter(this[ber].uri,{headers:this[Aj],connect:m,factory:g}):g(y,E)},"factory");this[Lnt]=r(o,{connect:m}),this[Ont]=new Xms({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${r0s(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[Lnt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[Aj],host:y.host},servername:this[QMn]?.servername||h});if(b!==200&&(v.on("error",i0s).destroy(),E(new e0s(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[Ser]?T=this[Ser].servername:T=y.servername,this[qMn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new t0s(v)):E(v)}},"connect")})}dispatch(e,r){let n=s0s(e.headers);if(a0s(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new ZJ(e.origin);n.host=o}return this[Ont].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new ZJ(e):e instanceof ZJ?e:new ZJ(e.uri)}async[HMn](){await this[Ont].close(),await this[Lnt].close()}async[GMn](){await this[Ont].destroy(),await this[Lnt].destroy()}};function s0s(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new mfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(a0s,"throwIfProxyAuthIsSent");zMn.exports=Ier});var eOn=I((Eef,XMn)=>{"use strict";p();var c0s=Kde(),{kClose:l0s,kDestroy:u0s,kClosed:YMn,kDestroyed:KMn,kDispatch:d0s,kNoProxyAgent:Tke,kHttpProxyAgent:yj,kHttpsProxyAgent:XJ}=Gd(),JMn=xer(),f0s=hfe(),p0s={"http:":80,"https:":443},ZMn=!1,wer=class extends c0s{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,ZMn||(ZMn=!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[Tke]=new f0s(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[yj]=new JMn({...s,uri:c}):this[yj]=this[Tke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[XJ]=new JMn({...s,uri:l}):this[XJ]=this[yj],this.#o()}[d0s](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[l0s](){await this[Tke].close(),this[yj][YMn]||await this[yj].close(),this[XJ][YMn]||await this[XJ].close()}async[u0s](e){await this[Tke].destroy(e),this[yj][KMn]||await this[yj].destroy(e),this[XJ][KMn]||await 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)||p0s[r]||0,this.#i(n,o)?r==="https:"?this[XJ]:this[yj]:this[Tke]}#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 gfe=require("node:assert"),{kRetryHandlerDefaultRetry:tOn}=Gd(),{RequestRetryError:Ike}=Ec(),{isDisturbed:rOn,parseHeaders:h0s,parseRangeHeader:nOn,wrapRequestBody:m0s}=qs();function g0s(t){let e=Date.now();return new Date(t).getTime()-e}a(g0s,"calculateRetryAfterHeader");var Rer=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:m0s(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[tOn],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[tOn](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)?g0s(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=h0s(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new Ike("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 Ike("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=nOn(s["content-range"]);if(!l)return this.abort(new Ike("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new Ike("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return gfe(this.start===u,"content-range mismatch"),gfe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=nOn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;gfe(u!=null&&Number.isFinite(u),"content-range mismatch"),gfe(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 gfe(Number.isFinite(this.start)),gfe(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 Ike("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||rOn(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||rOn(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")}};iOn.exports=Rer});var sOn=I((Tef,oOn)=>{"use strict";p();var A0s=eke(),y0s=Bnt(),ker=class extends A0s{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 y0s({...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()}};oOn.exports=ker});var Ler=I((wef,mOn)=>{"use strict";p();var dOn=require("node:assert"),{Readable:E0s}=require("node:stream"),{RequestAbortedError:fOn,NotSupportedError:_0s,InvalidArgumentError:v0s,AbortError:Per}=Ec(),pOn=qs(),{ReadableStreamFrom:C0s}=qs(),lT=Symbol("kConsume"),xke=Symbol("kReading"),Ej=Symbol("kBody"),aOn=Symbol("kAbort"),hOn=Symbol("kContentType"),cOn=Symbol("kContentLength"),b0s=a(()=>{},"noop"),Der=class extends E0s{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[aOn]=r,this[lT]=null,this[Ej]=null,this[hOn]=n,this[cOn]=o,this[xke]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new fOn),e&&this[aOn](),super.destroy(e)}_destroy(e,r){this[xke]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[xke]=!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[xke]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[lT]&&e!==null?(Mer(this[lT],e),this[xke]?super.push(e):!0):super.push(e)}async text(){return wke(this,"text")}async json(){return wke(this,"json")}async blob(){return wke(this,"blob")}async bytes(){return wke(this,"bytes")}async arrayBuffer(){return wke(this,"arrayBuffer")}async formData(){throw new _0s}get bodyUsed(){return pOn.isDisturbed(this)}get body(){return this[Ej]||(this[Ej]=C0s(this),this[lT]&&(this[Ej].getReader(),dOn(this[Ej].locked))),this[Ej]}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 v0s("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[cOn]>r&&this.destroy(new Per);let c=a(()=>{this.destroy(n.reason??new Per)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new Per):o(null)}).on("error",b0s).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function S0s(t){return t[Ej]&&t[Ej].locked===!0||t[lT]}a(S0s,"isLocked");function T0s(t){return pOn.isDisturbed(t)||S0s(t)}a(T0s,"isUnusable");async function wke(t,e){return dOn(!t[lT]),new Promise((r,n)=>{if(T0s(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[lT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Oer(this[lT],o)}).on("close",function(){this[lT].body!==null&&Oer(this[lT],new fOn)}),I0s(t[lT])})})}a(wke,"consume");function I0s(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(Ner,"chunksDecode");function lOn(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 x0s=require("node:assert"),{ResponseStatusCodeError:gOn}=Ec(),{chunksDecode:AOn}=Ler(),w0s=128*1024;async function R0s({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){x0s(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>w0s){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new gOn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{yOn(r)?f=JSON.parse(AOn(c,l)):EOn(r)&&(f=AOn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new gOn(u,n,s,f)))}a(R0s,"getResolveErrorBodyCallback");var yOn=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"),EOn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");_On.exports={getResolveErrorBodyCallback:R0s,isContentTypeApplicationJson:yOn,isContentTypeText:EOn}});var bOn=I((Mef,Fer)=>{"use strict";p();var k0s=require("node:assert"),{Readable:P0s}=Ler(),{InvalidArgumentError:Afe,RequestAbortedError:vOn}=Ec(),uT=qs(),{getResolveErrorBodyCallback:D0s}=Ber(),{AsyncResource:N0s}=require("node:async_hooks"),Fnt=class extends N0s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Afe("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 Afe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new Afe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Afe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Afe("invalid method");if(l&&typeof l!="function")throw new Afe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw uT.isStream(c)&&uT.destroy(c.on("error",uT.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,uT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new vOn:this.removeAbortListener=uT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new vOn,this.res?uT.destroy(this.res.on("error",uT.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}k0s(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"?uT.parseRawHeaders(r):uT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?uT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new P0s({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(D0s,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){uT.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(()=>{uT.destroy(r,e)})),o&&(this.body=null,uT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function COn(t,e){if(e===void 0)return new Promise((r,n)=>{COn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new Fnt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(COn,"request");Fer.exports=COn;Fer.exports.RequestHandler=Fnt});var Rke=I((Bef,IOn)=>{p();var{addAbortListener:M0s}=qs(),{RequestAbortedError:O0s}=Ec(),yfe=Symbol("kListener"),y5=Symbol("kSignal");function SOn(t){t.abort?t.abort(t[y5]?.reason):t.reason=t[y5]?.reason??new O0s,TOn(t)}a(SOn,"abort");function L0s(t,e){if(t.reason=null,t[y5]=null,t[yfe]=null,!!e){if(e.aborted){SOn(t);return}t[y5]=e,t[yfe]=()=>{SOn(t)},M0s(t[y5],t[yfe])}}a(L0s,"addSignal");function TOn(t){t[y5]&&("removeEventListener"in t[y5]?t[y5].removeEventListener("abort",t[yfe]):t[y5].removeListener("abort",t[yfe]),t[y5]=null,t[yfe]=null)}a(TOn,"removeSignal");IOn.exports={addSignal:L0s,removeSignal:TOn}});var kOn=I((Qef,ROn)=>{"use strict";p();var B0s=require("node:assert"),{finished:F0s,PassThrough:U0s}=require("node:stream"),{InvalidArgumentError:Efe,InvalidReturnValueError:Q0s}=Ec(),y2=qs(),{getResolveErrorBodyCallback:q0s}=Ber(),{AsyncResource:j0s}=require("node:async_hooks"),{addSignal:H0s,removeSignal:xOn}=Rke(),Uer=class extends j0s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Efe("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 Efe("invalid callback");if(typeof r!="function")throw new Efe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Efe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Efe("invalid method");if(u&&typeof u!="function")throw new Efe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw y2.isStream(l)&&y2.destroy(l.on("error",y2.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,y2.isStream(l)&&l.on("error",h=>{this.onError(h)}),H0s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}B0s(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"?y2.parseRawHeaders(r):y2.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"?y2.parseHeaders(r):f)["content-type"];h=new U0s,this.callback=null,this.runInAsyncScope(q0s,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 Q0s("expected Writable");F0s(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&y2.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;xOn(this),r&&(this.trailers=y2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;xOn(this),this.factory=null,r?(this.res=null,y2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,y2.destroy(s,e))}};function wOn(t,e,r){if(r===void 0)return new Promise((n,o)=>{wOn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new Uer(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(wOn,"stream");ROn.exports=wOn});var MOn=I((Hef,NOn)=>{"use strict";p();var{Readable:DOn,Duplex:G0s,PassThrough:$0s}=require("node:stream"),{InvalidArgumentError:kke,InvalidReturnValueError:V0s,RequestAbortedError:Qer}=Ec(),xw=qs(),{AsyncResource:W0s}=require("node:async_hooks"),{addSignal:z0s,removeSignal:Y0s}=Rke(),POn=require("node:assert"),_fe=Symbol("resume"),qer=class extends DOn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[_fe]=null}_read(){let{[_fe]:e}=this;e&&(this[_fe]=null,e())}_destroy(e,r){this._read(),r(e)}},jer=class extends DOn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[_fe]=e}_read(){this[_fe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Qer),r(e)}},Her=class extends W0s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new kke("invalid opts");if(typeof r!="function")throw new kke("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 kke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new kke("invalid method");if(c&&typeof c!="function")throw new kke("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 qer().on("error",xw.nop),this.ret=new G0s({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[_fe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Qer),A&&u&&A(),xw.destroy(f,u),xw.destroy(h,u),xw.destroy(m,u),Y0s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,z0s(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}POn(!o,"pipeline cannot be retried"),POn(!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"?xw.parseRawHeaders(r):xw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new jer(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?xw.parseRawHeaders(r):xw.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",xw.nop),u}if(!l||typeof l.on!="function")throw new V0s("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;xw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||xw.destroy(u,new Qer)}),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,xw.destroy(r,e)}};function K0s(t,e){try{let r=new Her(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new $0s().destroy(r)}}a(K0s,"pipeline");NOn.exports=K0s});var QOn=I((Vef,UOn)=>{"use strict";p();var{InvalidArgumentError:Ger,SocketError:J0s}=Ec(),{AsyncResource:Z0s}=require("node:async_hooks"),OOn=qs(),{addSignal:X0s,removeSignal:LOn}=Rke(),BOn=require("node:assert"),$er=class extends Z0s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ger("invalid opts");if(typeof r!="function")throw new Ger("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ger("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,X0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}BOn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new J0s("bad upgrade",null)}onUpgrade(e,r,n){BOn(e===101);let{callback:o,opaque:s,context:c}=this;LOn(this),this.callback=null;let l=this.responseHeaders==="raw"?OOn.parseRawHeaders(r):OOn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;LOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function FOn(t,e){if(e===void 0)return new Promise((r,n)=>{FOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new $er(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(FOn,"upgrade");UOn.exports=FOn});var $On=I((Yef,GOn)=>{"use strict";p();var egs=require("node:assert"),{AsyncResource:tgs}=require("node:async_hooks"),{InvalidArgumentError:Ver,SocketError:rgs}=Ec(),qOn=qs(),{addSignal:ngs,removeSignal:jOn}=Rke(),Wer=class extends tgs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ver("invalid opts");if(typeof r!="function")throw new Ver("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ver("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,ngs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}egs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new rgs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;jOn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?qOn.parseRawHeaders(r):qOn.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;jOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function HOn(t,e){if(e===void 0)return new Promise((r,n)=>{HOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Wer(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(HOn,"connect");GOn.exports=HOn});var VOn=I((Zef,vfe)=>{"use strict";p();vfe.exports.request=bOn();vfe.exports.stream=kOn();vfe.exports.pipeline=MOn();vfe.exports.upgrade=QOn();vfe.exports.connect=$On()});var Yer=I((etf,zOn)=>{"use strict";p();var{UndiciError:igs}=Ec(),WOn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),zer=class t extends igs{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[WOn]===!0}[WOn]=!0};zOn.exports={MockNotMatchedError:zer}});var Cfe=I((ntf,YOn)=>{"use strict";p();YOn.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 Pke=I((otf,s5n)=>{"use strict";p();var{MockNotMatchedError:eZ}=Yer(),{kDispatches:Unt,kMockAgent:ogs,kOriginalDispatch:sgs,kOrigin:ags,kGetNetConnect:cgs}=Cfe(),{buildURL:lgs}=qs(),{STATUS_CODES:ugs}=require("node:http"),{types:{isPromise:dgs}}=require("node:util");function OF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(OF,"matchValue");function JOn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(JOn,"lowerCaseEntries");function ZOn(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=ZOn(e,r);if(!OF(n,o))return!1}return!0}a(XOn,"matchHeaders");function KOn(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(KOn,"safeUrl");function fgs(t,{path:e,method:r,body:n,headers:o}){let s=OF(t.path,e),c=OF(t.method,r),l=typeof t.body<"u"?OF(t.body,n):!0,u=XOn(t,o);return s&&c&&l&&u}a(fgs,"matchKey");function e5n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(e5n,"getResponseData");function t5n(t,e){let r=e.query?lgs(e.path,e.query):e.path,n=typeof r=="string"?KOn(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>OF(KOn(s),n));if(o.length===0)throw new eZ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>OF(s,e.method)),o.length===0)throw new eZ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?OF(s,e.body):!0),o.length===0)throw new eZ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>XOn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new eZ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(t5n,"getMockDispatch");function pgs(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(pgs,"addMockDispatch");function Ker(t,e){let r=t.findIndex(n=>n.consumed?fgs(n,e):!1);r!==-1&&t.splice(r,1)}a(Ker,"deleteMockDispatch");function r5n(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(r5n,"buildKey");function Jer(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Unt])},d):g(this[Unt]);function g(y,E=s){let _=Array.isArray(t.headers)?Zer(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(dgs(v)){v.then(R=>g(y,R));return}let b=e5n(v),T=Jer(c),w=Jer(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,n5n(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),Ker(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(i5n,"mockDispatch");function mgs(){let t=this[ogs],e=this[ags],r=this[sgs];return a(function(o,s){if(t.isMockActive)try{i5n.call(this,o,s)}catch(c){if(c instanceof eZ){let l=t[cgs]();if(l===!1)throw new eZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(o5n(l,e))r.call(this,o,s);else throw new eZ(`${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(mgs,"buildMockDispatch");function o5n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>OF(n,r.host)))}a(o5n,"checkNetConnect");function ggs(t){if(t){let{agent:e,...r}=t;return r}}a(ggs,"buildMockOptions");s5n.exports={getResponseData:e5n,getMockDispatch:t5n,addMockDispatch:pgs,deleteMockDispatch:Ker,buildKey:r5n,generateKeyValues:Jer,matchValue:OF,getResponse:hgs,getStatusText:n5n,mockDispatch:i5n,buildMockDispatch:mgs,checkNetConnect:o5n,buildMockOptions:ggs,getHeaderByName:ZOn,buildHeadersFromArray:Zer}});var otr=I((ctf,itr)=>{"use strict";p();var{getResponseData:Ags,buildKey:ygs,addMockDispatch:Xer}=Pke(),{kDispatches:Qnt,kDispatchKey:qnt,kDefaultHeaders:etr,kDefaultTrailers:ttr,kContentLength:rtr,kMockDispatch:jnt}=Cfe(),{InvalidArgumentError:E5}=Ec(),{buildURL:Egs}=qs(),bfe=class{static{a(this,"MockScope")}constructor(e){this[jnt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new E5("waitInMs must be a valid integer > 0");return this[jnt].delay=e,this}persist(){return this[jnt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new E5("repeatTimes must be a valid integer > 0");return this[jnt].times=e,this}},ntr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new E5("opts must be an object");if(typeof e.path>"u")throw new E5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=Egs(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[qnt]=ygs(e),this[Qnt]=r,this[etr]={},this[ttr]={},this[rtr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=Ags(r),s=this[rtr]?{"content-length":o.length}:{},c={...this[etr],...s,...n.headers},l={...this[ttr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new E5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new E5("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 E5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Xer(this[Qnt],this[qnt],s);return new bfe(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=Xer(this[Qnt],this[qnt],n);return new bfe(o)}replyWithError(e){if(typeof e>"u")throw new E5("error must be defined");let r=Xer(this[Qnt],this[qnt],{error:e});return new bfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new E5("headers must be defined");return this[etr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new E5("trailers must be defined");return this[ttr]=e,this}replyContentLength(){return this[rtr]=!0,this}};itr.exports.MockInterceptor=ntr;itr.exports.MockScope=bfe});var ctr=I((dtf,p5n)=>{"use strict";p();var{promisify:_gs}=require("node:util"),vgs=ffe(),{buildMockDispatch:Cgs}=Pke(),{kDispatches:a5n,kMockAgent:c5n,kClose:l5n,kOriginalClose:u5n,kOrigin:d5n,kOriginalDispatch:bgs,kConnected:str}=Cfe(),{MockInterceptor:Sgs}=otr(),f5n=Gd(),{InvalidArgumentError:Tgs}=Ec(),atr=class extends vgs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Tgs("Argument opts.agent must implement Agent");this[c5n]=r.agent,this[d5n]=e,this[a5n]=[],this[str]=1,this[bgs]=this.dispatch,this[u5n]=this.close.bind(this),this.dispatch=Cgs.call(this),this.close=this[l5n]}get[f5n.kConnected](){return this[str]}intercept(e){return new Sgs(e,this[a5n])}async[l5n](){await _gs(this[u5n])(),this[str]=0,this[c5n][f5n.kClients].delete(this[d5n])}};p5n.exports=atr});var dtr=I((htf,_5n)=>{"use strict";p();var{promisify:Igs}=require("node:util"),xgs=pfe(),{buildMockDispatch:wgs}=Pke(),{kDispatches:h5n,kMockAgent:m5n,kClose:g5n,kOriginalClose:A5n,kOrigin:y5n,kOriginalDispatch:Rgs,kConnected:ltr}=Cfe(),{MockInterceptor:kgs}=otr(),E5n=Gd(),{InvalidArgumentError:Pgs}=Ec(),utr=class extends xgs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Pgs("Argument opts.agent must implement Agent");this[m5n]=r.agent,this[y5n]=e,this[h5n]=[],this[ltr]=1,this[Rgs]=this.dispatch,this[A5n]=this.close.bind(this),this.dispatch=wgs.call(this),this.close=this[g5n]}get[E5n.kConnected](){return this[ltr]}intercept(e){return new kgs(e,this[h5n])}async[g5n](){await Igs(this[A5n])(),this[ltr]=0,this[m5n][E5n.kClients].delete(this[y5n])}};_5n.exports=utr});var C5n=I((ytf,v5n)=>{"use strict";p();var Dgs={pronoun:"it",is:"is",was:"was",this:"this"},Ngs={pronoun:"they",is:"are",was:"were",this:"these"};v5n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Dgs:Ngs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var S5n=I((Ctf,b5n)=>{"use strict";p();var{Transform:Mgs}=require("node:stream"),{Console:Ogs}=require("node:console"),Lgs=process.versions.icu?"\u2705":"Y ",Bgs=process.versions.icu?"\u274C":"N ";b5n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Mgs({transform(r,n,o){o(null,r)}}),this.logger=new Ogs({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?Lgs:Bgs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var w5n=I((Ttf,x5n)=>{"use strict";p();var{kClients:tZ}=Gd(),Fgs=hfe(),{kAgent:ftr,kMockAgentSet:Hnt,kMockAgentGet:T5n,kDispatches:ptr,kIsMockActive:Gnt,kNetConnect:rZ,kGetNetConnect:Ugs,kOptions:$nt,kFactory:Vnt}=Cfe(),Qgs=ctr(),qgs=dtr(),{matchValue:jgs,buildMockOptions:Hgs}=Pke(),{InvalidArgumentError:I5n,UndiciError:Ggs}=Ec(),$gs=eke(),Vgs=C5n(),Wgs=S5n(),htr=class extends $gs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[rZ]=!0,this[Gnt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new I5n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new Fgs(e);this[ftr]=r,this[tZ]=r[tZ],this[$nt]=Hgs(e)}get(e){let r=this[T5n](e);return r||(r=this[Vnt](e),this[Hnt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[ftr].dispatch(e,r)}async close(){await this[ftr].close(),this[tZ].clear()}deactivate(){this[Gnt]=!1}activate(){this[Gnt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[rZ])?this[rZ].push(e):this[rZ]=[e];else if(typeof e>"u")this[rZ]=!0;else throw new I5n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[rZ]=!1}get isMockActive(){return this[Gnt]}[Hnt](e,r){this[tZ].set(e,r)}[Vnt](e){let r=Object.assign({agent:this},this[$nt]);return this[$nt]&&this[$nt].connections===1?new Qgs(e,r):new qgs(e,r)}[T5n](e){let r=this[tZ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Vnt]("http://localhost:9999");return this[Hnt](e,n),n}for(let[n,o]of Array.from(this[tZ]))if(o&&typeof n!="string"&&jgs(n,e)){let s=this[Vnt](e);return this[Hnt](e,s),s[ptr]=o[ptr],s}}[Ugs](){return this[rZ]}pendingInterceptors(){let e=this[tZ];return Array.from(e.entries()).flatMap(([r,n])=>n[ptr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Wgs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Vgs("interceptor","interceptors").pluralize(r.length);throw new Ggs(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};C5n.exports=utr});var qnt=I((ctf,x5n)=>{"use strict";p();var S5n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Ngs}=Ec(),Mgs=pfe();I5n()===void 0&&T5n(new Mgs);function T5n(t){if(!t||typeof t.dispatch!="function")throw new Ngs("Argument agent must implement Agent");Object.defineProperty(globalThis,S5n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(T5n,"setGlobalDispatcher");function I5n(){return globalThis[S5n]}a(I5n,"getGlobalDispatcher");x5n.exports={setGlobalDispatcher:T5n,getGlobalDispatcher:I5n}});var jnt=I((ftf,w5n)=>{"use strict";p();w5n.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 k5n=I((mtf,R5n)=>{"use strict";p();var Ogs=_nt();R5n.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 Ogs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var D5n=I((ytf,P5n)=>{"use strict";p();var Lgs=Pnt();P5n.exports=t=>e=>a(function(n,o){return e(n,new Lgs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var M5n=I((vtf,N5n)=>{"use strict";p();var Bgs=qs(),{InvalidArgumentError:Fgs,RequestAbortedError:Ugs}=Ec(),Qgs=jnt(),dtr=class extends Qgs{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 Fgs("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=Bgs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Ugs(`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 qgs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new dtr({maxSize:s},o);return e(n,c)},"Intercept")}a(qgs,"createDumpInterceptor");N5n.exports=qgs});var B5n=I((Stf,L5n)=>{"use strict";p();var{isIP:jgs}=require("node:net"),{lookup:Hgs}=require("node:dns"),Ggs=jnt(),{InvalidArgumentError:bfe,InformationalError:$gs}=Ec(),O5n=Math.pow(2,31)-1,ftr=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 $gs("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){Hgs(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===O5n?(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===O5n?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 ptr(this,e,r)}},ptr=class extends Ggs{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}}};L5n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new bfe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new bfe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new bfe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new bfe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new bfe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new bfe("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 ftr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return jgs(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 tZ=I((xtf,G5n)=>{"use strict";p();var{kConstruct:Vgs}=jd(),{kEnumerableProperty:Sfe}=qs(),{iteratorMixin:Wgs,isValidHeaderName:Rke,isValidHeaderValue:U5n}=sT(),{webidl:$a}=qA(),htr=require("node:assert"),Hnt=require("node:util"),sm=Symbol("headers map"),lT=Symbol("headers map sorted");function F5n(t){return t===10||t===13||t===9||t===32}a(F5n,"isHTTPWhiteSpaceCharCode");function Q5n(t){let e=0,r=t.length;for(;r>e&&F5n(t.charCodeAt(r-1));)--r;for(;r>e&&F5n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(Q5n,"headerValueNormalize");function q5n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(q5n,"fill");function mtr(t,e,r){if(r=Q5n(r),Rke(e)){if(!U5n(r))throw $a.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(H5n(t)==="immutable")throw new TypeError("immutable");return gtr(t).append(e,r,!1)}a(mtr,"appendHeader");function j5n(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[sm])r[n++]=[o,s],htr(s!==null);return r.sort(j5n)}}},A2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){$a.util.markAsUncloneable(this),e!==Vgs&&(this.#t=new Gnt,this.#e="none",e!==void 0&&(e=$a.converters.HeadersInit(e,"Headers contructor","init"),q5n(this,e)))}append(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),mtr(this,e,r)}delete(e){if($a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.delete"),e=$a.converters.ByteString(e,"Headers.delete","name"),!Rke(e))throw $a.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){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),r=Q5n(r),Rke(e)){if(!U5n(r))throw $a.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){$a.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[lT](){if(this.#t[lT])return this.#t[lT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[lT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):$a.converters["record"](t,e,r)}throw $a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};G5n.exports={fill:q5n,compareHeaderName:j5n,Headers:A2,HeadersList:Gnt,getHeadersGuard:H5n,setHeadersGuard:zgs,setHeadersList:Ygs,getHeadersList:gtr}});var Pke=I((ktf,r4n)=>{"use strict";p();var{Headers:K5n,HeadersList:$5n,fill:Kgs,getHeadersGuard:Jgs,setHeadersGuard:J5n,setHeadersList:Z5n}=tZ(),{extractBody:V5n,cloneBody:Zgs,mixinBody:Xgs,hasFinalizationRegistry:X5n,streamRegistry:e4n,bodyUnusable:eAs}=ife(),Atr=qs(),W5n=require("node:util"),{kEnumerableProperty:uT}=Atr,{isValidReasonPhrase:tAs,isCancelled:rAs,isAborted:nAs,isBlobLike:iAs,serializeJavascriptValueToJSONString:oAs,isErrorLike:sAs,isomorphicEncode:aAs,environmentSettingsObject:cAs}=sT(),{redirectStatusSet:lAs,nullBodyStatus:uAs}=eke(),{kState:Gd,kHeaders:MF}=oj(),{webidl:ss}=qA(),{FormData:dAs}=ske(),{URLSerializer:z5n}=nb(),{kConstruct:Vnt}=jd(),ytr=require("node:assert"),{types:fAs}=require("node:util"),pAs=new TextEncoder("utf-8"),rZ=class t{static{a(this,"Response")}static error(){return kke(Wnt(),"immutable")}static json(e,r={}){ss.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ss.converters.ResponseInit(r));let n=pAs.encode(oAs(e)),o=V5n(n),s=kke(Tfe({}),"response");return Y5n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ss.argumentLengthCheck(arguments,1,"Response.redirect"),e=ss.converters.USVString(e),r=ss.converters["unsigned short"](r);let n;try{n=new URL(e,cAs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!lAs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=kke(Tfe({}),"immutable");o[Gd].status=r;let s=aAs(z5n(n));return o[Gd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ss.util.markAsUncloneable(this),e===Vnt)return;e!==null&&(e=ss.converters.BodyInit(e)),r=ss.converters.ResponseInit(r),this[Gd]=Tfe({}),this[MF]=new K5n(Vnt),J5n(this[MF],"response"),Z5n(this[MF],this[Gd].headersList);let n=null;if(e!=null){let[o,s]=V5n(e);n={body:o,type:s}}Y5n(this,r,n)}get type(){return ss.brandCheck(this,t),this[Gd].type}get url(){ss.brandCheck(this,t);let e=this[Gd].urlList,r=e[e.length-1]??null;return r===null?"":z5n(r,!0)}get redirected(){return ss.brandCheck(this,t),this[Gd].urlList.length>1}get status(){return ss.brandCheck(this,t),this[Gd].status}get ok(){return ss.brandCheck(this,t),this[Gd].status>=200&&this[Gd].status<=299}get statusText(){return ss.brandCheck(this,t),this[Gd].statusText}get headers(){return ss.brandCheck(this,t),this[MF]}get body(){return ss.brandCheck(this,t),this[Gd].body?this[Gd].body.stream:null}get bodyUsed(){return ss.brandCheck(this,t),!!this[Gd].body&&Atr.isDisturbed(this[Gd].body.stream)}clone(){if(ss.brandCheck(this,t),eAs(this))throw ss.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Etr(this[Gd]);return X5n&&this[Gd].body?.stream&&e4n.register(this,new WeakRef(this[Gd].body.stream)),kke(e,Jgs(this[MF]))}[W5n.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 ${W5n.formatWithOptions(r,n)}`}};Xgs(rZ);Object.defineProperties(rZ.prototype,{type:uT,url:uT,status:uT,ok:uT,redirected:uT,statusText:uT,headers:uT,clone:uT,body:uT,bodyUsed:uT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(rZ,{json:uT,redirect:uT,error:uT});function Etr(t){if(t.internalResponse)return t4n(Etr(t.internalResponse),t.type);let e=Tfe({...t,body:null});return t.body!=null&&(e.body=Zgs(e,t.body)),e}a(Etr,"cloneResponse");function Tfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new $5n(t?.headersList):new $5n,urlList:t?.urlList?[...t.urlList]:[]}}a(Tfe,"makeResponse");function Wnt(t){let e=sAs(t);return Tfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Wnt,"makeNetworkError");function hAs(t){return t.type==="error"&&t.status===0}a(hAs,"isNetworkError");function $nt(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 ytr(!(n in e)),r[n]=o,!0}})}a($nt,"makeFilteredResponse");function t4n(t,e){if(e==="basic")return $nt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return $nt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return $nt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return $nt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});ytr(!1)}a(t4n,"filterResponse");function mAs(t,e=null){return ytr(rAs(t)),nAs(t)?Wnt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Wnt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(mAs,"makeAppropriateNetworkError");function Y5n(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&&!tAs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Gd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Gd].statusText=e.statusText),"headers"in e&&e.headers!=null&&Kgs(t[MF],e.headers),r){if(uAs.includes(t.status))throw ss.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Gd].body=r.body,r.type!=null&&!t[Gd].headersList.contains("content-type",!0)&&t[Gd].headersList.append("content-type",r.type,!0)}}a(Y5n,"initializeResponse");function kke(t,e){let r=new rZ(Vnt);return r[Gd]=t,r[MF]=new K5n(Vnt),Z5n(r[MF],t.headersList),J5n(r[MF],e),X5n&&t.body?.stream&&e4n.register(r,new WeakRef(t.body.stream)),r}a(kke,"fromInnerResponse");ss.converters.ReadableStream=ss.interfaceConverter(ReadableStream);ss.converters.FormData=ss.interfaceConverter(dAs);ss.converters.URLSearchParams=ss.interfaceConverter(URLSearchParams);ss.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ss.converters.USVString(t,e,r):iAs(t)?ss.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||fAs.isArrayBuffer(t)?ss.converters.BufferSource(t,e,r):Atr.isFormDataLike(t)?ss.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ss.converters.URLSearchParams(t,e,r):ss.converters.DOMString(t,e,r)};ss.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ss.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ss.converters.XMLHttpRequestBodyInit(t,e,r)};ss.converters.ResponseInit=ss.dictionaryConverter([{key:"status",converter:ss.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ss.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ss.converters.HeadersInit}]);r4n.exports={isNetworkError:hAs,makeNetworkError:Wnt,makeResponse:Tfe,makeAppropriateNetworkError:mAs,filterResponse:t4n,Response:rZ,cloneResponse:Etr,fromInnerResponse:kke}});var s4n=I((Ntf,o4n)=>{"use strict";p();var{kConnected:n4n,kSize:i4n}=jd(),_tr=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[n4n]===0&&this.value[i4n]===0?void 0:this.value}},vtr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[n4n]===0&&e[i4n]===0&&this.finalizer(r)})}unregister(e){}};o4n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:_tr,FinalizationRegistry:vtr}):{WeakRef,FinalizationRegistry}}});var Ife=I((Ltf,v4n)=>{"use strict";p();var{extractBody:gAs,mixinBody:AAs,cloneBody:yAs,bodyUnusable:a4n}=ife(),{Headers:g4n,fill:EAs,HeadersList:Jnt,setHeadersGuard:btr,getHeadersGuard:_As,setHeadersList:A4n,getHeadersList:c4n}=tZ(),{FinalizationRegistry:vAs}=s4n()(),Ynt=qs(),l4n=require("node:util"),{isValidHTTPToken:CAs,sameOrigin:u4n,environmentSettingsObject:znt}=sT(),{forbiddenMethodsSet:bAs,corsSafeListedMethodsSet:SAs,referrerPolicy:TAs,requestRedirect:IAs,requestMode:xAs,requestCredentials:wAs,requestCache:RAs,requestDuplex:kAs}=eke(),{kEnumerableProperty:am,normalizedMethodRecordsBase:PAs,normalizedMethodRecords:DAs}=Ynt,{kHeaders:dT,kSignal:Knt,kState:sd,kDispatcher:Ctr}=oj(),{webidl:Gi}=qA(),{URLSerializer:NAs}=nb(),{kConstruct:Znt}=jd(),MAs=require("node:assert"),{getMaxListeners:d4n,setMaxListeners:f4n,getEventListeners:OAs,defaultMaxListeners:p4n}=require("node:events"),LAs=Symbol("abortController"),y4n=new vAs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Xnt=new WeakMap;function h4n(t){return e;function e(){let r=t.deref();if(r!==void 0){y4n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Xnt.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()}Xnt.delete(r.signal)}}}}a(h4n,"buildAbort");var m4n=!1,Aj=class t{static{a(this,"Request")}constructor(e,r={}){if(Gi.util.markAsUncloneable(this),e===Znt)return;let n="Request constructor";Gi.argumentLengthCheck(arguments,1,n),e=Gi.converters.RequestInfo(e,n,"input"),r=Gi.converters.RequestInit(r,n,"init");let o=null,s=null,c=znt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Ctr]=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=eit({urlList:[_]}),s="cors"}else this[Ctr]=r.dispatcher||e[Ctr],MAs(e instanceof t),o=e[sd],l=e[Knt];let u=znt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&u4n(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=eit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:znt.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&&!u4n(v,znt.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 Gi.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=DAs[_];if(v!==void 0)o.method=v;else{if(!CAs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(bAs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=PAs[b]??_,o.method=_}!m4n&&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"}),m4n=!0)}r.signal!==void 0&&(l=r.signal),this[sd]=o;let m=new AbortController;if(this[Knt]=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[LAs]=m;let _=new WeakRef(m),v=h4n(_);try{(typeof d4n=="function"&&d4n(l)===p4n||OAs(l,"abort").length>=p4n)&&f4n(1500,l)}catch{}Ynt.addAbortListener(l,v),y4n.register(m,{signal:l,abort:v},v)}}if(this[dT]=new g4n(Znt),A4n(this[dT],o.headersList),btr(this[dT],"request"),h==="no-cors"){if(!SAs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);btr(this[dT],"request-no-cors")}if(f){let _=c4n(this[dT]),v=r.headers!==void 0?r.headers:new Jnt(_);if(_.clear(),v instanceof Jnt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else EAs(this[dT],v)}let g=e instanceof t?e[sd].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]=gAs(r.body,o.keepalive);A=_,v&&!c4n(this[dT]).contains("content-type",!0)&&this[dT].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(a4n(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[sd].body=E}get method(){return Gi.brandCheck(this,t),this[sd].method}get url(){return Gi.brandCheck(this,t),NAs(this[sd].url)}get headers(){return Gi.brandCheck(this,t),this[dT]}get destination(){return Gi.brandCheck(this,t),this[sd].destination}get referrer(){return Gi.brandCheck(this,t),this[sd].referrer==="no-referrer"?"":this[sd].referrer==="client"?"about:client":this[sd].referrer.toString()}get referrerPolicy(){return Gi.brandCheck(this,t),this[sd].referrerPolicy}get mode(){return Gi.brandCheck(this,t),this[sd].mode}get credentials(){return this[sd].credentials}get cache(){return Gi.brandCheck(this,t),this[sd].cache}get redirect(){return Gi.brandCheck(this,t),this[sd].redirect}get integrity(){return Gi.brandCheck(this,t),this[sd].integrity}get keepalive(){return Gi.brandCheck(this,t),this[sd].keepalive}get isReloadNavigation(){return Gi.brandCheck(this,t),this[sd].reloadNavigation}get isHistoryNavigation(){return Gi.brandCheck(this,t),this[sd].historyNavigation}get signal(){return Gi.brandCheck(this,t),this[Knt]}get body(){return Gi.brandCheck(this,t),this[sd].body?this[sd].body.stream:null}get bodyUsed(){return Gi.brandCheck(this,t),!!this[sd].body&&Ynt.isDisturbed(this[sd].body.stream)}get duplex(){return Gi.brandCheck(this,t),"half"}clone(){if(Gi.brandCheck(this,t),a4n(this))throw new TypeError("unusable");let e=E4n(this[sd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Xnt.get(this.signal);n===void 0&&(n=new Set,Xnt.set(this.signal,n));let o=new WeakRef(r);n.add(o),Ynt.addAbortListener(r.signal,h4n(o))}return _4n(e,r.signal,_As(this[dT]))}[l4n.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 ${l4n.formatWithOptions(r,n)}`}};AAs(Aj);function eit(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 Jnt(t.headersList):new Jnt}}a(eit,"makeRequest");function E4n(t){let e=eit({...t,body:null});return t.body!=null&&(e.body=yAs(e,t.body)),e}a(E4n,"cloneRequest");function _4n(t,e,r){let n=new Aj(Znt);return n[sd]=t,n[Knt]=e,n[dT]=new g4n(Znt),A4n(n[dT],t.headersList),btr(n[dT],r),n}a(_4n,"fromInnerRequest");Object.defineProperties(Aj.prototype,{method:am,url:am,headers:am,redirect:am,clone:am,signal:am,duplex:am,destination:am,body:am,bodyUsed:am,isHistoryNavigation:am,isReloadNavigation:am,keepalive:am,integrity:am,cache:am,credentials:am,attribute:am,referrerPolicy:am,referrer:am,mode:am,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Gi.converters.Request=Gi.interfaceConverter(Aj);Gi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Gi.converters.USVString(t,e,r):t instanceof Aj?Gi.converters.Request(t,e,r):Gi.converters.USVString(t,e,r)};Gi.converters.AbortSignal=Gi.interfaceConverter(AbortSignal);Gi.converters.RequestInit=Gi.dictionaryConverter([{key:"method",converter:Gi.converters.ByteString},{key:"headers",converter:Gi.converters.HeadersInit},{key:"body",converter:Gi.nullableConverter(Gi.converters.BodyInit)},{key:"referrer",converter:Gi.converters.USVString},{key:"referrerPolicy",converter:Gi.converters.DOMString,allowedValues:TAs},{key:"mode",converter:Gi.converters.DOMString,allowedValues:xAs},{key:"credentials",converter:Gi.converters.DOMString,allowedValues:wAs},{key:"cache",converter:Gi.converters.DOMString,allowedValues:RAs},{key:"redirect",converter:Gi.converters.DOMString,allowedValues:IAs},{key:"integrity",converter:Gi.converters.DOMString},{key:"keepalive",converter:Gi.converters.boolean},{key:"signal",converter:Gi.nullableConverter(t=>Gi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Gi.converters.any},{key:"duplex",converter:Gi.converters.DOMString,allowedValues:kAs},{key:"dispatcher",converter:Gi.converters.any}]);v4n.exports={Request:Aj,makeRequest:eit,fromInnerRequest:_4n,cloneRequest:E4n}});var Nke=I((Utf,L4n)=>{"use strict";p();var{makeNetworkError:sl,makeAppropriateNetworkError:tit,filterResponse:Str,makeResponse:rit,fromInnerResponse:BAs}=Pke(),{HeadersList:C4n}=tZ(),{Request:FAs,cloneRequest:UAs}=Ife(),yj=require("node:zlib"),{bytesMatch:QAs,makePolicyContainer:qAs,clonePolicyContainer:jAs,requestBadPort:HAs,TAOCheck:GAs,appendRequestOriginHeader:$As,responseLocationURL:VAs,requestCurrentURL:y5,setRequestReferrerPolicyOnRedirect:WAs,tryUpgradeRequestToAPotentiallyTrustworthyURL:zAs,createOpaqueTimingInfo:Rtr,appendFetchMetadata:YAs,corsCheck:KAs,crossOriginResourcePolicyCheck:JAs,determineRequestsReferrer:ZAs,coarsenedSharedCurrentTime:Dke,createDeferredPromise:XAs,isBlobLike:eys,sameOrigin:wtr,isCancelled:nZ,isAborted:b4n,isErrorLike:tys,fullyReadBody:rys,readableStreamClose:nys,isomorphicEncode:nit,urlIsLocal:iys,urlIsHttpHttpsScheme:ktr,urlHasHttpsScheme:oys,clampAndCoarsenConnectionTimingInfo:sys,simpleRangeHeaderValue:ays,buildContentRange:cys,createInflate:lys,extractMimeType:uys}=sT(),{kState:x4n,kDispatcher:dys}=oj(),iZ=require("node:assert"),{safelyExtractBody:Ptr,extractBody:S4n}=ife(),{redirectStatusSet:w4n,nullBodyStatus:R4n,safeMethodsSet:fys,requestBodyHeader:pys,subresourceSet:hys}=eke(),mys=require("node:events"),{Readable:gys,pipeline:Ays,finished:yys}=require("node:stream"),{addAbortListener:Eys,isErrored:_ys,isReadable:iit,bufferToLowerCasedHeaderName:T4n}=qs(),{dataURLProcessor:vys,serializeAMimeType:Cys,minimizeSupportedMimeType:bys}=nb(),{getGlobalDispatcher:Sys}=qnt(),{webidl:Tys}=qA(),{STATUS_CODES:Iys}=require("node:http"),xys=["GET","HEAD"],wys=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Ttr,oit=class extends mys{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 Rys(t){k4n(t,"fetch")}a(Rys,"handleFetchDone");function kys(t,e=void 0){Tys.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=XAs(),n;try{n=new FAs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[x4n];if(n.signal.aborted)return Itr(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 Eys(n.signal,()=>{l=!0,iZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Itr(r,o,f,n.signal.reason)}),u=D4n({request:o,processResponseEndOfBody:Rys,processResponse:a(f=>{if(!l){if(f.aborted){Itr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(BAs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[dys]}),r.promise}a(kys,"fetch");function k4n(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;ktr(r)&&n!==null&&(t.timingAllowPassed||(n=Rtr({startTime:n.startTime}),o=""),n.endTime=Dke(),t.timingInfo=n,P4n(n,r.href,e,globalThis,o))}a(k4n,"finalizeAndReportTiming");var P4n=performance.markResourceTiming;function Itr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&iit(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[x4n];o.body!=null&&iit(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(Itr,"abortFetch");function D4n({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Sys()}){iZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Dke(d),h=Rtr({startTime:f}),m={controller:new oit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return iZ(!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=jAs(t.client.policyContainer):t.policyContainer=qAs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,hys.has(t.destination),N4n(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(D4n,"fetching");async function N4n(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!iys(y5(r))&&(n=sl("local URLs only")),zAs(r),HAs(r)==="blocked"&&(n=sl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=ZAs(r)),n===null&&(n=await(async()=>{let s=y5(r);return wtr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await I4n(t)):r.mode==="same-origin"?sl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?sl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await I4n(t)):ktr(y5(r))?(r.responseTainting="cors",await M4n(t)):sl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Str(n,"basic"):r.responseTainting==="cors"?n=Str(n,"cors"):r.responseTainting==="opaque"?n=Str(n,"opaque"):iZ(!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=sl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||R4n.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>xtr(t,sl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!QAs(l,r.integrity)){s("integrity mismatch");return}n.body=Ptr(l)[0],xtr(t,n)},"processBody");await rys(n.body,c,s)}else xtr(t,n)}a(N4n,"mainFetch");function I4n(t){if(nZ(t)&&t.request.redirectCount===0)return Promise.resolve(tit(t));let{request:e}=t,{protocol:r}=y5(e);switch(r){case"about:":return Promise.resolve(sl("about scheme is not supported"));case"blob:":{Ttr||(Ttr=require("node:buffer").resolveObjectURL);let n=y5(e);if(n.search.length!==0)return Promise.resolve(sl("NetworkError when attempting to fetch resource."));let o=Ttr(n.toString());if(e.method!=="GET"||!eys(o))return Promise.resolve(sl("invalid method"));let s=rit(),c=o.size,l=nit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=ays(d,!0);if(f==="failure")return Promise.resolve(sl("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(sl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=S4n(g);s.body=A[0];let y=nit(`${g.size}`),E=cys(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=S4n(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=y5(e),o=vys(n);if(o==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let s=Cys(o.mimeType);return Promise.resolve(rit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Ptr(o.body)[0]}))}case"file:":return Promise.resolve(sl("not implemented... yet..."));case"http:":case"https:":return M4n(t).catch(n=>sl(n));default:return Promise.resolve(sl("unknown scheme"))}}a(I4n,"schemeFetch");function Pys(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Pys,"finalizeResponse");function xtr(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=Rtr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=uys(e.headersList);f!=="failure"&&(u.contentType=bys(f))}t.request.initiatorType!=null&&P4n(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():yys(o.body.stream,()=>{n()})}a(xtr,"fetchFinale");async function M4n(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 O4n(t),e.responseTainting==="cors"&&KAs(e,r)==="failure")return sl("cors failure");GAs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&JAs(e.origin,e.client,e.destination,n)==="blocked"?sl("blocked"):(w4n.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=sl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await Dys(t,r):iZ(!1)),r.timingInfo=o,r)}a(M4n,"httpFetch");function Dys(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=VAs(n,y5(r).hash),o==null)return e}catch(c){return Promise.resolve(sl(c))}if(!ktr(o))return Promise.resolve(sl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(sl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!wtr(r,o))return Promise.resolve(sl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(sl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(sl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!xys.includes(r.method)){r.method="GET",r.body=null;for(let c of pys)r.headersList.delete(c)}wtr(y5(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&&(iZ(r.body.source!=null),r.body=Ptr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Dke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),WAs(r,n),N4n(t,!0)}a(Dys,"httpRedirectFetch");async function O4n(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=UAs(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=nit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",nit(s.referrer.href),!0),$As(s),YAs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",wys),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)||(oys(y5(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 sl("only if cached");let m=await Nys(o,d,r);!fys.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"?sl():nZ(t)?tit(t):sl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(nZ(t))return tit(t);t.controller.connection.destroy(),c=await O4n(t,e,!0)}return c}a(O4n,"httpNetworkOrCacheFetch");async function Nys(t,e=!1,r=!1){iZ(!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*(_){nZ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{nZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{nZ(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=rit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=rit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),tit(t,A)):sl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{nZ(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(b4n(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){nys(t.controller.controller),Pys(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),_ys(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){b4n(t)?(o.aborted=!0,iit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):iit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:tys(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=y5(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=sys(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=Dke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Dke(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new C4n;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 j=q[O].trim();if(j==="x-gzip"||j==="gzip")D.push(yj.createGunzip({flush:yj.constants.Z_SYNC_FLUSH,finishFlush:yj.constants.Z_SYNC_FLUSH}));else if(j==="deflate")D.push(lys({flush:yj.constants.Z_SYNC_FLUSH,finishFlush:yj.constants.Z_SYNC_FLUSH}));else if(j==="br")D.push(yj.createBrotliDecompress({flush:yj.constants.BROTLI_OPERATION_FLUSH,finishFlush:yj.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?Ays(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 C4n;for(let x=0;x{"use strict";p();B4n.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 U4n=I((Gtf,F4n)=>{"use strict";p();var{webidl:fT}=qA(),sit=Symbol("ProgressEvent state"),Ntr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=fT.converters.DOMString(e,"ProgressEvent constructor","type"),r=fT.converters.ProgressEventInit(r??{}),super(e,r),this[sit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return fT.brandCheck(this,t),this[sit].lengthComputable}get loaded(){return fT.brandCheck(this,t),this[sit].loaded}get total(){return fT.brandCheck(this,t),this[sit].total}};fT.converters.ProgressEventInit=fT.dictionaryConverter([{key:"lengthComputable",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:fT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:fT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);F4n.exports={ProgressEvent:Ntr}});var q4n=I((Wtf,Q4n)=>{"use strict";p();function Mys(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(Mys,"getEncoding");Q4n.exports={getEncoding:Mys}});var Y4n=I((Ktf,z4n)=>{"use strict";p();var{kState:xfe,kError:Mtr,kResult:j4n,kAborted:Mke,kLastProgressEventFired:Otr}=Dtr(),{ProgressEvent:Oys}=U4n(),{getEncoding:H4n}=q4n(),{serializeAMimeType:Lys,parseMIMEType:G4n}=nb(),{types:Bys}=require("node:util"),{StringDecoder:$4n}=require("string_decoder"),{btoa:V4n}=require("node:buffer"),Fys={enumerable:!0,writable:!1,configurable:!1};function Uys(t,e,r,n){if(t[xfe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[xfe]="loading",t[j4n]=null,t[Mtr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[Mke];)try{let{done:d,value:f}=await l;if(u&&!t[Mke]&&queueMicrotask(()=>{Ej("loadstart",t)}),u=!1,!d&&Bys.isUint8Array(f))c.push(f),(t[Otr]===void 0||Date.now()-t[Otr]>=50)&&!t[Mke]&&(t[Otr]=Date.now(),queueMicrotask(()=>{Ej("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[xfe]="done";try{let h=Qys(c,r,e.type,n);if(t[Mke])return;t[j4n]=h,Ej("load",t)}catch(h){t[Mtr]=h,Ej("error",t)}t[xfe]!=="loading"&&Ej("loadend",t)});break}}catch(d){if(t[Mke])return;queueMicrotask(()=>{t[xfe]="done",t[Mtr]=d,Ej("error",t),t[xfe]!=="loading"&&Ej("loadend",t)});break}})()}a(Uys,"readOperation");function Ej(t,e){let r=new Oys(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Ej,"fireAProgressEvent");function Qys(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=G4n(r||"application/octet-stream");s!=="failure"&&(o+=Lys(s)),o+=";base64,";let c=new $4n("latin1");for(let l of t)o+=V4n(c.write(l));return o+=V4n(c.end()),o}case"Text":{let o="failure";if(n&&(o=H4n(n)),o==="failure"&&r){let s=G4n(r);s!=="failure"&&(o=H4n(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),qys(t,o)}case"ArrayBuffer":return W4n(t).buffer;case"BinaryString":{let o="",s=new $4n("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(Qys,"packageData");function qys(t,e){let r=W4n(t),n=jys(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(qys,"decode");function jys(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(jys,"BOMSniffing");function W4n(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(W4n,"combineByteSequences");z4n.exports={staticPropertyDescriptors:Fys,readOperation:Uys,fireAProgressEvent:Ej}});var X4n=I((Xtf,Z4n)=>{"use strict";p();var{staticPropertyDescriptors:wfe,readOperation:ait,fireAProgressEvent:K4n}=Y4n(),{kState:oZ,kError:J4n,kResult:cit,kEvents:wc,kAborted:Hys}=Dtr(),{webidl:wl}=qA(),{kEnumerableProperty:sb}=qs(),y2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[oZ]="empty",this[cit]=null,this[J4n]=null,this[wc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"ArrayBuffer")}readAsBinaryString(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"BinaryString")}readAsText(e,r=void 0){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=wl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=wl.converters.DOMString(r,"FileReader.readAsText","encoding")),ait(this,e,"Text",r)}readAsDataURL(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"DataURL")}abort(){if(this[oZ]==="empty"||this[oZ]==="done"){this[cit]=null;return}this[oZ]==="loading"&&(this[oZ]="done",this[cit]=null),this[Hys]=!0,K4n("abort",this),this[oZ]!=="loading"&&K4n("loadend",this)}get readyState(){switch(wl.brandCheck(this,t),this[oZ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return wl.brandCheck(this,t),this[cit]}get error(){return wl.brandCheck(this,t),this[J4n]}get onloadend(){return wl.brandCheck(this,t),this[wc].loadend}set onloadend(e){wl.brandCheck(this,t),this[wc].loadend&&this.removeEventListener("loadend",this[wc].loadend),typeof e=="function"?(this[wc].loadend=e,this.addEventListener("loadend",e)):this[wc].loadend=null}get onerror(){return wl.brandCheck(this,t),this[wc].error}set onerror(e){wl.brandCheck(this,t),this[wc].error&&this.removeEventListener("error",this[wc].error),typeof e=="function"?(this[wc].error=e,this.addEventListener("error",e)):this[wc].error=null}get onloadstart(){return wl.brandCheck(this,t),this[wc].loadstart}set onloadstart(e){wl.brandCheck(this,t),this[wc].loadstart&&this.removeEventListener("loadstart",this[wc].loadstart),typeof e=="function"?(this[wc].loadstart=e,this.addEventListener("loadstart",e)):this[wc].loadstart=null}get onprogress(){return wl.brandCheck(this,t),this[wc].progress}set onprogress(e){wl.brandCheck(this,t),this[wc].progress&&this.removeEventListener("progress",this[wc].progress),typeof e=="function"?(this[wc].progress=e,this.addEventListener("progress",e)):this[wc].progress=null}get onload(){return wl.brandCheck(this,t),this[wc].load}set onload(e){wl.brandCheck(this,t),this[wc].load&&this.removeEventListener("load",this[wc].load),typeof e=="function"?(this[wc].load=e,this.addEventListener("load",e)):this[wc].load=null}get onabort(){return wl.brandCheck(this,t),this[wc].abort}set onabort(e){wl.brandCheck(this,t),this[wc].abort&&this.removeEventListener("abort",this[wc].abort),typeof e=="function"?(this[wc].abort=e,this.addEventListener("abort",e)):this[wc].abort=null}};y2.EMPTY=y2.prototype.EMPTY=0;y2.LOADING=y2.prototype.LOADING=1;y2.DONE=y2.prototype.DONE=2;Object.defineProperties(y2.prototype,{EMPTY:wfe,LOADING:wfe,DONE:wfe,readAsArrayBuffer:sb,readAsBinaryString:sb,readAsText:sb,readAsDataURL:sb,abort:sb,readyState:sb,result:sb,error:sb,onloadstart:sb,onprogress:sb,onload:sb,onabort:sb,onerror:sb,onloadend:sb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(y2,{EMPTY:wfe,LOADING:wfe,DONE:wfe});Z4n.exports={FileReader:y2}});var lit=I((rrf,eLn)=>{"use strict";p();eLn.exports={kConstruct:jd().kConstruct}});var nLn=I((irf,rLn)=>{"use strict";p();var Gys=require("node:assert"),{URLSerializer:tLn}=nb(),{isValidHeaderName:$ys}=sT();function Vys(t,e,r=!1){let n=tLn(t,r),o=tLn(e,r);return n===o}a(Vys,"urlEquals");function Wys(t){Gys(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),$ys(r)&&e.push(r);return e}a(Wys,"getFieldValues");rLn.exports={urlEquals:Vys,getFieldValues:Wys}});var sLn=I((arf,oLn)=>{"use strict";p();var{kConstruct:zys}=lit(),{urlEquals:Yys,getFieldValues:Ltr}=nLn(),{kEnumerableProperty:sZ,isDisturbed:Kys}=qs(),{webidl:vi}=qA(),{Response:Jys,cloneResponse:Zys,fromInnerResponse:Xys}=Pke(),{Request:OF,fromInnerRequest:eEs}=Ife(),{kState:E2}=oj(),{fetching:tEs}=Nke(),{urlIsHttpHttpsScheme:uit,createDeferredPromise:Rfe,readAllBytes:rEs}=sT(),Btr=require("node:assert"),dit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==zys&&vi.illegalConstructor(),vi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){vi.brandCheck(this,t);let n="Cache.match";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.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={}){vi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){vi.brandCheck(this,t);let r="Cache.add";vi.argumentLengthCheck(arguments,1,r),e=vi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){vi.brandCheck(this,t);let r="Cache.addAll";vi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw vi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=vi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[E2];if(!uit(g.url)||g.method!=="GET")throw vi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new OF(m)[E2];if(!uit(g.url))throw vi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Rfe();s.push(tEs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Ltr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(vi.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=Rfe(),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){vi.brandCheck(this,t);let n="Cache.put";vi.argumentLengthCheck(arguments,2,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.Response(r,n,"response");let o=null;if(e instanceof OF?o=e[E2]:o=new OF(e)[E2],!uit(o.url)||o.method!=="GET")throw vi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[E2];if(s.status===206)throw vi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Ltr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw vi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(Kys(s.body.stream)||s.body.stream.locked))throw vi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=Zys(s),l=Rfe();if(s.body!=null){let A=s.body.stream.getReader();rEs(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=Rfe(),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={}){vi.brandCheck(this,t);let n="Cache.delete";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return!1}else Btr(typeof e=="string"),o=new OF(e)[E2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Rfe(),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={}){vi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new OF(e)[E2]);let s=Rfe(),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=eEs(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 vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw vi.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);Btr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!uit(u.url))throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw vi.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);Btr(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=""),!Yys(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Ltr(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 OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new OF(e)[E2]);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=Xys(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(dit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:sZ,matchAll:sZ,add:sZ,addAll:sZ,put:sZ,delete:sZ,keys:sZ});var iLn=[{key:"ignoreSearch",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];vi.converters.CacheQueryOptions=vi.dictionaryConverter(iLn);vi.converters.MultiCacheQueryOptions=vi.dictionaryConverter([...iLn,{key:"cacheName",converter:vi.converters.DOMString}]);vi.converters.Response=vi.interfaceConverter(Jys);vi.converters["sequence"]=vi.sequenceConverter(vi.converters.RequestInfo);oLn.exports={Cache:dit}});var cLn=I((urf,aLn)=>{"use strict";p();var{kConstruct:Oke}=lit(),{Cache:fit}=sLn(),{webidl:_E}=qA(),{kEnumerableProperty:Lke}=qs(),pit=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Oke&&_E.illegalConstructor(),_E.util.markAsUncloneable(this)}async match(e,r={}){if(_E.brandCheck(this,t),_E.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=_E.converters.RequestInfo(e),r=_E.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new fit(Oke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new fit(Oke,n).match(e,r);if(s!==void 0)return s}}async has(e){_E.brandCheck(this,t);let r="CacheStorage.has";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){_E.brandCheck(this,t);let r="CacheStorage.open";if(_E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new fit(Oke,o)}let n=[];return this.#e.set(e,n),new fit(Oke,n)}async delete(e){_E.brandCheck(this,t);let r="CacheStorage.delete";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return _E.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(pit.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Lke,has:Lke,open:Lke,delete:Lke,keys:Lke});aLn.exports={CacheStorage:pit}});var uLn=I((prf,lLn)=>{"use strict";p();lLn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Ftr=I((mrf,mLn)=>{"use strict";p();function nEs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(nEs,"isCTLExcludingHtab");function dLn(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(dLn,"validateCookieName");function fLn(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(fLn,"validateCookieValue");function pLn(t){for(let e=0;ee.toString().padStart(2,"0"));function hLn(t){return typeof t=="number"&&(t=new Date(t)),`${oEs[t.getUTCDay()]}, ${hit[t.getUTCDate()]} ${sEs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${hit[t.getUTCHours()]}:${hit[t.getUTCMinutes()]}:${hit[t.getUTCSeconds()]} GMT`}a(hLn,"toIMFDate");function aEs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(aEs,"validateCookieMaxAge");function cEs(t){if(t.name.length===0)return null;dLn(t.name),fLn(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"&&(aEs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(iEs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(pLn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${hLn(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(cEs,"stringify");mLn.exports={isCTLExcludingHtab:nEs,validateCookieName:dLn,validateCookiePath:pLn,validateCookieValue:fLn,toIMFDate:hLn,stringify:cEs}});var ALn=I((yrf,gLn)=>{"use strict";p();var{maxNameValuePairSize:lEs,maxAttributeValueSize:uEs}=uLn(),{isCTLExcludingHtab:dEs}=Ftr(),{collectASequenceOfCodePointsFast:mit}=nb(),fEs=require("node:assert");function pEs(t){if(dEs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=mit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=mit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>lEs?null:{name:n,value:o,...kfe(r)}}a(pEs,"parseSetCookie");function kfe(t,e={}){if(t.length===0)return e;fEs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=mit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=mit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>uEs)return kfe(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 kfe(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 kfe(t,e)}a(kfe,"parseUnparsedAttributes");gLn.exports={parseSetCookie:pEs,parseUnparsedAttributes:kfe}});var _Ln=I((vrf,ELn)=>{"use strict";p();var{parseSetCookie:hEs}=ALn(),{stringify:mEs}=Ftr(),{webidl:pa}=qA(),{Headers:git}=tZ();function gEs(t){pa.argumentLengthCheck(arguments,1,"getCookies"),pa.brandCheck(t,git,{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(gEs,"getCookies");function AEs(t,e,r){pa.brandCheck(t,git,{strict:!1});let n="deleteCookie";pa.argumentLengthCheck(arguments,2,n),e=pa.converters.DOMString(e,n,"name"),r=pa.converters.DeleteCookieAttributes(r),yLn(t,{name:e,value:"",expires:new Date(0),...r})}a(AEs,"deleteCookie");function yEs(t){pa.argumentLengthCheck(arguments,1,"getSetCookies"),pa.brandCheck(t,git,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>hEs(r)):[]}a(yEs,"getSetCookies");function yLn(t,e){pa.argumentLengthCheck(arguments,2,"setCookie"),pa.brandCheck(t,git,{strict:!1}),e=pa.converters.Cookie(e);let r=mEs(e);r&&t.append("Set-Cookie",r)}a(yLn,"setCookie");pa.converters.DeleteCookieAttributes=pa.dictionaryConverter([{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);pa.converters.Cookie=pa.dictionaryConverter([{converter:pa.converters.DOMString,key:"name"},{converter:pa.converters.DOMString,key:"value"},{converter:pa.nullableConverter(t=>typeof t=="number"?pa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:pa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:pa.sequenceConverter(pa.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);ELn.exports={getCookies:gEs,deleteCookie:AEs,getSetCookies:yEs,setCookie:yLn}});var Dfe=I((Srf,CLn)=>{"use strict";p();var{webidl:hi}=qA(),{kEnumerableProperty:ab}=qs(),{kConstruct:vLn}=jd(),{MessagePort:EEs}=require("node:worker_threads"),Pfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===vLn){super(arguments[1],arguments[2]),hi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get data(){return hi.brandCheck(this,t),this.#e.data}get origin(){return hi.brandCheck(this,t),this.#e.origin}get lastEventId(){return hi.brandCheck(this,t),this.#e.lastEventId}get source(){return hi.brandCheck(this,t),this.#e.source}get ports(){return hi.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 hi.brandCheck(this,t),hi.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(vLn,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:_Es}=Pfe;delete Pfe.createFastMessageEvent;var Ait=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.CloseEventInit(r),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get wasClean(){return hi.brandCheck(this,t),this.#e.wasClean}get code(){return hi.brandCheck(this,t),this.#e.code}get reason(){return hi.brandCheck(this,t),this.#e.reason}},yit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";hi.argumentLengthCheck(arguments,1,n),super(e,r),hi.util.markAsUncloneable(this),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return hi.brandCheck(this,t),this.#e.message}get filename(){return hi.brandCheck(this,t),this.#e.filename}get lineno(){return hi.brandCheck(this,t),this.#e.lineno}get colno(){return hi.brandCheck(this,t),this.#e.colno}get error(){return hi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Pfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ab,origin:ab,lastEventId:ab,source:ab,ports:ab,initMessageEvent:ab});Object.defineProperties(Ait.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ab,code:ab,wasClean:ab});Object.defineProperties(yit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ab,filename:ab,lineno:ab,colno:ab,error:ab});hi.converters.MessagePort=hi.interfaceConverter(EEs);hi.converters["sequence"]=hi.sequenceConverter(hi.converters.MessagePort);var Utr=[{key:"bubbles",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];hi.converters.MessageEventInit=hi.dictionaryConverter([...Utr,{key:"data",converter:hi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:hi.nullableConverter(hi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:hi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);hi.converters.CloseEventInit=hi.dictionaryConverter([...Utr,{key:"wasClean",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:hi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);hi.converters.ErrorEventInit=hi.dictionaryConverter([...Utr,{key:"message",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:hi.converters.any}]);CLn.exports={MessageEvent:Pfe,CloseEvent:Ait,ErrorEvent:yit,createFastMessageEvent:_Es}});var aZ=I((xrf,bLn)=>{"use strict";p();var vEs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",CEs={enumerable:!0,writable:!1,configurable:!1},bEs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},SEs={NOT_SENT:0,PROCESSING:1,SENT:2},TEs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},IEs=2**16-1,xEs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},wEs=Buffer.allocUnsafe(0),REs={string:1,typedArray:2,arrayBuffer:3,blob:4};bLn.exports={uid:vEs,sentCloseFrameState:SEs,staticPropertyDescriptors:CEs,states:bEs,opcodes:TEs,maxUnsigned16Bit:IEs,parserStates:xEs,emptyBuffer:wEs,sendHints:REs}});var Bke=I((Rrf,SLn)=>{"use strict";p();SLn.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 Qke=I((Prf,NLn)=>{"use strict";p();var{kReadyState:Fke,kController:kEs,kResponse:PEs,kBinaryType:DEs,kWebSocketURL:NEs}=Bke(),{states:Uke,opcodes:_j}=aZ(),{ErrorEvent:MEs,createFastMessageEvent:OEs}=Dfe(),{isUtf8:LEs}=require("node:buffer"),{collectASequenceOfCodePointsFast:BEs,removeHTTPWhitespace:TLn}=nb();function FEs(t){return t[Fke]===Uke.CONNECTING}a(FEs,"isConnecting");function UEs(t){return t[Fke]===Uke.OPEN}a(UEs,"isEstablished");function QEs(t){return t[Fke]===Uke.CLOSING}a(QEs,"isClosing");function qEs(t){return t[Fke]===Uke.CLOSED}a(qEs,"isClosed");function Qtr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Qtr,"fireEvent");function jEs(t,e,r){if(t[Fke]!==Uke.OPEN)return;let n;if(e===_j.TEXT)try{n=DLn(r)}catch{xLn(t,"Received invalid UTF-8 in text frame.");return}else e===_j.BINARY&&(t[DEs]==="blob"?n=new Blob([r]):n=HEs(r));Qtr("message",t,OEs,{origin:t[NEs].origin,data:n})}a(jEs,"websocketMessageReceived");function HEs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(HEs,"toArrayBuffer");function GEs(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(GEs,"isValidSubprotocol");function $Es(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a($Es,"isValidStatusCode");function xLn(t,e){let{[kEs]:r,[PEs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&Qtr("error",t,(o,s)=>new MEs(o,s),{error:new Error(e),message:e})}a(xLn,"failWebsocketConnection");function wLn(t){return t===_j.CLOSE||t===_j.PING||t===_j.PONG}a(wLn,"isControlFrame");function RLn(t){return t===_j.CONTINUATION}a(RLn,"isContinuationFrame");function kLn(t){return t===_j.TEXT||t===_j.BINARY}a(kLn,"isTextBinaryFrame");function VEs(t){return kLn(t)||RLn(t)||wLn(t)}a(VEs,"isValidOpcode");function WEs(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(zEs,"isValidClientWindowBits");var PLn=typeof process.versions.icu=="string",ILn=PLn?new TextDecoder("utf-8",{fatal:!0}):void 0,DLn=PLn?ILn.decode.bind(ILn):function(t){if(LEs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};NLn.exports={isConnecting:FEs,isEstablished:UEs,isClosing:QEs,isClosed:qEs,fireEvent:Qtr,isValidSubprotocol:GEs,isValidStatusCode:$Es,failWebsocketConnection:xLn,websocketMessageReceived:jEs,utf8Decode:DLn,isControlFrame:wLn,isContinuationFrame:RLn,isTextBinaryFrame:kLn,isValidOpcode:VEs,parseExtensions:WEs,isValidClientWindowBits:zEs}});var _it=I((Mrf,MLn)=>{"use strict";p();var{maxUnsigned16Bit:YEs}=aZ(),Eit=16386,qtr,qke=null,Nfe=Eit;try{qtr=require("node:crypto")}catch{qtr={randomFillSync:a(function(e,r,n){for(let o=0;oYEs?(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:JEs,states:jke,sentCloseFrameState:vit,emptyBuffer:ZEs,opcodes:XEs}=aZ(),{kReadyState:Hke,kSentClose:Cit,kByteParser:LLn,kReceivedClose:OLn,kResponse:BLn}=Bke(),{fireEvent:e_s,failWebsocketConnection:vj,isClosing:t_s,isClosed:r_s,isEstablished:n_s,parseExtensions:i_s}=Qke(),{channels:Mfe}=$de(),{CloseEvent:o_s}=Dfe(),{makeRequest:s_s}=Ife(),{fetching:a_s}=Nke(),{Headers:c_s,getHeadersList:l_s}=tZ(),{getDecodeSplit:u_s}=sT(),{WebsocketFrameSend:d_s}=_it(),Htr;try{Htr=require("node:crypto")}catch{}function f_s(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=s_s({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=l_s(new c_s(s.headers));l.headersList=h}let u=Htr.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"),a_s({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){vj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){vj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){vj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){vj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Htr.createHash("sha1").update(u+JEs).digest("base64");if(m!==g){vj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=i_s(A),!y.has("permessage-deflate"))){vj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!u_s("sec-websocket-protocol",l.headersList).includes(E)){vj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",FLn),h.socket.on("close",ULn),h.socket.on("error",QLn),Mfe.open.hasSubscribers&&Mfe.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(f_s,"establishWebSocketConnection");function p_s(t,e,r,n){if(!(t_s(t)||r_s(t)))if(!n_s(t))vj(t,"Connection was closed before it was established."),t[Hke]=jke.CLOSING;else if(t[Cit]===vit.NOT_SENT){t[Cit]=vit.PROCESSING;let o=new d_s;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=ZEs,t[BLn].socket.write(o.createFrame(XEs.CLOSE)),t[Cit]=vit.SENT,t[Hke]=jke.CLOSING}else t[Hke]=jke.CLOSING}a(p_s,"closeWebSocketConnection");function FLn(t){this.ws[LLn].write(t)||this.pause()}a(FLn,"onSocketData");function ULn(){let{ws:t}=this,{[BLn]:e}=t;e.socket.off("data",FLn),e.socket.off("close",ULn),e.socket.off("error",QLn);let r=t[Cit]===vit.SENT&&t[OLn],n=1005,o="",s=t[LLn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[OLn]||(n=1006),t[Hke]=jke.CLOSED,e_s("close",t,(c,l)=>new o_s(c,l),{wasClean:r,code:n,reason:o}),Mfe.close.hasSubscribers&&Mfe.close.publish({websocket:t,code:n,reason:o})}a(ULn,"onSocketClose");function QLn(t){let{ws:e}=this;e[Hke]=jke.CLOSING,Mfe.socketError.hasSubscribers&&Mfe.socketError.publish(t),this.destroy()}a(QLn,"onSocketError");qLn.exports={establishWebSocketConnection:f_s,closeWebSocketConnection:p_s}});var GLn=I((Qrf,HLn)=>{"use strict";p();var{createInflateRaw:h_s,Z_DEFAULT_WINDOWBITS:m_s}=require("node:zlib"),{isValidClientWindowBits:g_s}=Qke(),{MessageSizeExceededError:jLn}=Ec(),A_s=Buffer.from([0,0,255,255]),bit=Symbol("kBuffer"),Gke=Symbol("kLength"),y_s=4*1024*1024,$tr=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 jLn);return}if(!this.#e){let o=m_s;if(this.#t.serverMaxWindowBits){if(!g_s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=h_s({windowBits:o})}catch(s){n(s);return}this.#e[bit]=[],this.#e[Gke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Gke]+=s.length,this.#e[Gke]>y_s){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new jLn)}return}this.#e[bit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(A_s),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[bit],this.#e[Gke]);this.#e[bit].length=0,this.#e[Gke]=0,this.#n=null,n(null,o)})}};HLn.exports={PerMessageDeflate:$tr}});var eBn=I((Hrf,XLn)=>{"use strict";p();var{Writable:E_s}=require("node:stream"),__s=require("node:assert"),{parserStates:cb,opcodes:Ofe,states:v_s,emptyBuffer:$Ln,sentCloseFrameState:VLn}=aZ(),{kReadyState:C_s,kSentClose:WLn,kResponse:zLn,kReceivedClose:YLn}=Bke(),{channels:Sit}=$de(),{isValidStatusCode:b_s,isValidOpcode:S_s,failWebsocketConnection:pT,websocketMessageReceived:KLn,utf8Decode:T_s,isControlFrame:JLn,isTextBinaryFrame:Vtr,isContinuationFrame:I_s}=Qke(),{WebsocketFrameSend:ZLn}=_it(),{closeWebSocketConnection:x_s}=Gtr(),{PerMessageDeflate:w_s}=GLn(),Wtr=class extends E_s{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=cb.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 w_s(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===cb.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!==Ofe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!S_s(o))return pT(this.ws,"Invalid opcode received"),e();if(s)return pT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){pT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){pT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Vtr(o)){pT(this.ws,"Invalid frame type was fragmented.");return}if(Vtr(o)&&this.#o.length>0){pT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){pT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&JLn(o)){pT(this.ws,"Control frame either too large or fragmented");return}if(I_s(o)&&this.#o.length===0&&!this.#i.compressed){pT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=cb.READ_DATA):l===126?this.#n=cb.PAYLOADLENGTH_16:l===127&&(this.#n=cb.PAYLOADLENGTH_64),Vtr(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===cb.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=cb.READ_DATA}else if(this.#n===cb.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){pT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=cb.READ_DATA}else if(this.#n===cb.READ_DATA){if(this.#t{if(n){pT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=cb.INFO,this.#r=!0,this.run(e);return}KLn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=cb.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);KLn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=cb.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return $Ln;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){__s(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!b_s(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=T_s(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===Ofe.CLOSE){if(n===1)return pT(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 x_s(this.ws,o,s,s.length),pT(this.ws,s),!1}if(this.ws[WLn]!==VLn.SENT){let o=$Ln;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new ZLn(o);this.ws[zLn].socket.write(s.createFrame(Ofe.CLOSE),c=>{c||(this.ws[WLn]=VLn.SENT)})}return this.ws[C_s]=v_s.CLOSING,this.ws[YLn]=!0,!1}else if(r===Ofe.PING){if(!this.ws[YLn]){let o=new ZLn(e);this.ws[zLn].socket.write(o.createFrame(Ofe.PONG)),Sit.ping.hasSubscribers&&Sit.ping.publish({payload:e})}}else r===Ofe.PONG&&Sit.pong.hasSubscribers&&Sit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};XLn.exports={ByteParser:Wtr}});var oBn=I((Vrf,iBn)=>{"use strict";p();var{WebsocketFrameSend:R_s}=_it(),{opcodes:tBn,sendHints:Lfe}=aZ(),k_s=ner(),rBn=Buffer[Symbol.species],ztr=class{static{a(this,"SendQueue")}#e=new k_s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Lfe.blob){let s=nBn(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=nBn(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 nBn(t,e){return new R_s(P_s(t,e)).createFrame(e===Lfe.string?tBn.TEXT:tBn.BINARY)}a(nBn,"createFrame");function P_s(t,e){switch(e){case Lfe.string:return Buffer.from(t);case Lfe.arrayBuffer:case Lfe.blob:return new rBn(t);case Lfe.typedArray:return new rBn(t.buffer,t.byteOffset,t.byteLength)}}a(P_s,"toBuffer");iBn.exports={SendQueue:ztr}});var hBn=I((Yrf,pBn)=>{"use strict";p();var{webidl:so}=qA(),{URLSerializer:D_s}=nb(),{environmentSettingsObject:sBn}=sT(),{staticPropertyDescriptors:Cj,states:$ke,sentCloseFrameState:N_s,sendHints:Tit}=aZ(),{kWebSocketURL:aBn,kReadyState:Ytr,kController:M_s,kBinaryType:Iit,kResponse:cBn,kSentClose:O_s,kByteParser:L_s}=Bke(),{isConnecting:B_s,isEstablished:F_s,isClosing:U_s,isValidSubprotocol:Q_s,fireEvent:lBn}=Qke(),{establishWebSocketConnection:q_s,closeWebSocketConnection:uBn}=Gtr(),{ByteParser:j_s}=eBn(),{kEnumerableProperty:Iw,isBlobLike:dBn}=qs(),{getGlobalDispatcher:H_s}=qnt(),{types:fBn}=require("node:util"),{ErrorEvent:G_s,CloseEvent:$_s}=Dfe(),{SendQueue:V_s}=oBn(),hT=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=sBn.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=>Q_s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[aBn]=new URL(c.href);let l=sBn.settingsObject;this[M_s]=q_s(c,r,l,this,(u,d)=>this.#o(u,d),o),this[Ytr]=t.CONNECTING,this[O_s]=N_s.NOT_SENT,this[Iit]="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");uBn(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"),B_s(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!F_s(this)||U_s(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},Tit.string)}else fBn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Tit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Tit.typedArray)):dBn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Tit.blob))}get readyState(){return so.brandCheck(this,t),this[Ytr]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),D_s(this[aBn])}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[Iit]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Iit]="blob":this[Iit]=e}#o(e,r){this[cBn]=e;let n=new j_s(this,r);n.on("drain",W_s),n.on("error",z_s.bind(this)),e.socket.ws=this,this[L_s]=n,this.#i=new V_s(e.socket),this[Ytr]=$ke.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),lBn("open",this)}};hT.CONNECTING=hT.prototype.CONNECTING=$ke.CONNECTING;hT.OPEN=hT.prototype.OPEN=$ke.OPEN;hT.CLOSING=hT.prototype.CLOSING=$ke.CLOSING;hT.CLOSED=hT.prototype.CLOSED=$ke.CLOSED;Object.defineProperties(hT.prototype,{CONNECTING:Cj,OPEN:Cj,CLOSING:Cj,CLOSED:Cj,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(hT,{CONNECTING:Cj,OPEN:Cj,CLOSING:Cj,CLOSED:Cj});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(()=>H_s(),"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(dBn(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||fBn.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function W_s(){this.ws[cBn].socket.resume()}a(W_s,"onParserDrain");function z_s(t){let e,r;t instanceof $_s?(e=t.reason,r=t.code):e=t.message,lBn("error",this,()=>new G_s("error",{error:t,message:e})),uBn(this,r)}a(z_s,"onParserError");pBn.exports={WebSocket:hT}});var Ktr=I((Zrf,mBn)=>{"use strict";p();function Y_s(t){return t.indexOf("\0")===-1}a(Y_s,"isValidLastEventId");function K_s(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(K_s,"isASCIINumber");function J_s(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(J_s,"delay");mBn.exports={isValidLastEventId:Y_s,isASCIINumber:K_s,delay:J_s}});var EBn=I((tnf,yBn)=>{"use strict";p();var{Transform:Z_s}=require("node:stream"),{isASCIINumber:gBn,isValidLastEventId:ABn}=Ktr(),LF=[239,187,191],Jtr=10,xit=13,X_s=58,evs=32,Ztr=class extends Z_s{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]===LF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]&&this.buffer[2]===LF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]&&this.buffer[2]===LF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&gBn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&ABn(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}}};yBn.exports={EventSourceStream:Ztr}});var xBn=I((inf,IBn)=>{"use strict";p();var{pipeline:tvs}=require("node:stream"),{fetching:rvs}=Nke(),{makeRequest:nvs}=Ife(),{webidl:BF}=qA(),{EventSourceStream:ivs}=EBn(),{parseMIMEType:ovs}=nb(),{createFastMessageEvent:svs}=Dfe(),{isNetworkError:_Bn}=Pke(),{delay:avs}=Ktr(),{kEnumerableProperty:cZ}=qs(),{environmentSettingsObject:vBn}=sT(),CBn=!1,bBn=3e3,Vke=0,SBn=1,Wke=2,cvs="anonymous",lvs="use-credentials",Bfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=Vke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),BF.util.markAsUncloneable(this);let n="EventSource constructor";BF.argumentLengthCheck(arguments,1,n),CBn||(CBn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=BF.converters.USVString(e,n,"url"),r=BF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:bBn};let o=vBn,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=cvs;r.withCredentials&&(c=lvs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=vBn.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=nvs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Wke)return;this.#n=Vke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{_Bn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(_Bn(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?ovs(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=SBn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new ivs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(svs(u.type,u.options))},"push")});tvs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=rvs(e)}async#u(){this.#n!==Wke&&(this.#n=Vke,this.dispatchEvent(new Event("error")),await avs(this.#a.reconnectionTime),this.#n===Vke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){BF.brandCheck(this,t),this.#n!==Wke&&(this.#n=Wke,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}},TBn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Vke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:SBn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Wke,writable:!1}};Object.defineProperties(Bfe,TBn);Object.defineProperties(Bfe.prototype,TBn);Object.defineProperties(Bfe.prototype,{close:cZ,onerror:cZ,onmessage:cZ,onopen:cZ,readyState:cZ,url:cZ,withCredentials:cZ});BF.converters.EventSourceInitDict=BF.dictionaryConverter([{key:"withCredentials",converter:BF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:BF.converters.any}]);IBn.exports={EventSource:Bfe,defaultReconnectionTime:bBn}});var PBn=I((anf,Ki)=>{"use strict";p();var uvs=dfe(),wBn=JRe(),dvs=ffe(),fvs=TMn(),pvs=pfe(),hvs=ber(),mvs=YMn(),gvs=tOn(),RBn=Ec(),Rit=qs(),{InvalidArgumentError:wit}=RBn,Ffe=qOn(),Avs=XRe(),yvs=itr(),Evs=b5n(),_vs=atr(),vvs=$er(),Cvs=Pnt(),{getGlobalDispatcher:kBn,setGlobalDispatcher:bvs}=qnt(),Svs=jnt(),Tvs=_nt(),Ivs=vnt();Object.assign(wBn.prototype,Ffe);Ki.exports.Dispatcher=wBn;Ki.exports.Client=uvs;Ki.exports.Pool=dvs;Ki.exports.BalancedPool=fvs;Ki.exports.Agent=pvs;Ki.exports.ProxyAgent=hvs;Ki.exports.EnvHttpProxyAgent=mvs;Ki.exports.RetryAgent=gvs;Ki.exports.RetryHandler=Cvs;Ki.exports.DecoratorHandler=Svs;Ki.exports.RedirectHandler=Tvs;Ki.exports.createRedirectInterceptor=Ivs;Ki.exports.interceptors={redirect:k5n(),retry:D5n(),dump:M5n(),dns:B5n()};Ki.exports.buildConnector=Avs;Ki.exports.errors=RBn;Ki.exports.util={parseHeaders:Rit.parseHeaders,headerNameToString:Rit.headerNameToString};function zke(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 wit("invalid url");if(r!=null&&typeof r!="object")throw new wit("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new wit("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Rit.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Rit.parseURL(e);let{agent:o,dispatcher:s=kBn()}=r;if(o)throw new wit("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(zke,"makeDispatcher");Ki.exports.setGlobalDispatcher=bvs;Ki.exports.getGlobalDispatcher=kBn;var xvs=Nke().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await xvs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=tZ().Headers;Ki.exports.Response=Pke().Response;Ki.exports.Request=Ife().Request;Ki.exports.FormData=ske().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=X4n().FileReader;var{setGlobalOrigin:wvs,getGlobalOrigin:Rvs}=SXt();Ki.exports.setGlobalOrigin=wvs;Ki.exports.getGlobalOrigin=Rvs;var{CacheStorage:kvs}=cLn(),{kConstruct:Pvs}=lit();Ki.exports.caches=new kvs(Pvs);var{deleteCookie:Dvs,getCookies:Nvs,getSetCookies:Mvs,setCookie:Ovs}=_Ln();Ki.exports.deleteCookie=Dvs;Ki.exports.getCookies=Nvs;Ki.exports.getSetCookies=Mvs;Ki.exports.setCookie=Ovs;var{parseMIMEType:Lvs,serializeAMimeType:Bvs}=nb();Ki.exports.parseMIMEType=Lvs;Ki.exports.serializeAMimeType=Bvs;var{CloseEvent:Fvs,ErrorEvent:Uvs,MessageEvent:Qvs}=Dfe();Ki.exports.WebSocket=hBn().WebSocket;Ki.exports.CloseEvent=Fvs;Ki.exports.ErrorEvent=Uvs;Ki.exports.MessageEvent=Qvs;Ki.exports.request=zke(Ffe.request);Ki.exports.stream=zke(Ffe.stream);Ki.exports.pipeline=zke(Ffe.pipeline);Ki.exports.connect=zke(Ffe.connect);Ki.exports.upgrade=zke(Ffe.upgrade);Ki.exports.MockClient=yvs;Ki.exports.MockPool=_vs;Ki.exports.MockAgent=Evs;Ki.exports.mockErrors=vvs;var{EventSource:qvs}=xBn();Ki.exports.EventSource=qvs});var As=I((unf,DBn)=>{p();DBn.exports={options:{usePureJavaScript:!1}}});var OBn=I((fnf,MBn)=>{p();var Xtr={};MBn.exports=Xtr;var NBn={};Xtr.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=jvs(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};Xtr.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=NBn[e];if(!r){r=NBn[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(jvs,"_encodeWithByteBuffer")});var ac=I((mnf,UBn)=>{p();var LBn=As(),BBn=OBn(),nt=UBn.exports=LBn.util=LBn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){nt.nextTick=process.nextTick,typeof setImmediate=="function"?nt.setImmediate=setImmediate:nt.setImmediate=nt.nextTick;return}if(typeof setImmediate=="function"){nt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},nt.nextTick=function(l){return setImmediate(l)};return}if(nt.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=[];nt.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=nt.setImmediate;nt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}nt.nextTick=nt.setImmediate})();nt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;nt.globalScope=(function(){return nt.isNodejs?global:typeof self>"u"?window:self})();nt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};nt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};nt.isArrayBufferView=function(t){return t&&nt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function Yke(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(Yke,"_checkBitsParam");nt.ByteBuffer=trr;function trr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(nt.isArrayBuffer(t)||nt.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;rHvs&&(this.data.substr(0,1),this._constructedStringLength=0)};nt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};nt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};nt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};nt.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};nt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};nt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(nt.encodeUtf8(t))};nt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.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))};nt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};nt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};nt.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))};nt.ByteStringBuffer.prototype.putInt=function(t,e){Yke(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};nt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};nt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.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};nt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};nt.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};nt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};nt.ByteStringBuffer.prototype.copy=function(){var t=nt.createBuffer(this.data);return t.read=this.read,t};nt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};nt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};nt.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};nt.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};nt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};nt.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};nt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};nt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};nt.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};nt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};nt.DataBuffer.prototype.putInt=function(t,e){Yke(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};nt.DataBuffer.prototype.putSignedInt=function(t,e){return Yke(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};nt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.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};nt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};nt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};nt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};nt.DataBuffer.prototype.copy=function(){return new nt.DataBuffer(this)};nt.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};nt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};nt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};nt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};nt.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};nt.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 bj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Sj=[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],FBn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":bj.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};nt.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};nt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};nt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};nt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:BBn.encode,decode:BBn.decode}};nt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};nt.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+=bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":bj.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};nt.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)};nt.binary.base58.encode=function(t,e){return nt.binary.baseN.encode(t,FBn,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,FBn,e)};nt.text={utf8:{},utf16:{}};nt.text.utf8.encode=function(t,e,r){t=nt.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");nt.setItem=function(t,e,r,n,o){kit($vs,arguments,o)};nt.getItem=function(t,e,r,n){return kit(Vvs,arguments,n)};nt.removeItem=function(t,e,r,n){kit(Wvs,arguments,n)};nt.clearItems=function(t,e,r){kit(zvs,arguments,r)};nt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};nt.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("")};nt.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):"")};nt.formatSize=function(t){return t>=1073741824?t=nt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=nt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=nt.formatNumber(t/1024,0)+" KiB":t=nt.formatNumber(t,0)+" bytes",t};nt.bytesFromIP=function(t){return t.indexOf(".")!==-1?nt.bytesFromIPv4(t):t.indexOf(":")!==-1?nt.bytesFromIPv6(t):null};nt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=nt.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(":")};nt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in nt&&!t.update)return e(null,nt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return nt.cores=navigator.hardwareConcurrency,e(null,nt.cores);if(typeof Worker>"u")return nt.cores=1,e(null,nt.cores);if(typeof Blob>"u")return nt.cores=2,e(null,nt.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 Rg=As();ac();QBn.exports=Rg.cipher=Rg.cipher||{};Rg.cipher.algorithms=Rg.cipher.algorithms||{};Rg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Rg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Rg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Rg.cipher.algorithms[t]=e};Rg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Rg.cipher.algorithms?Rg.cipher.algorithms[t]:null};var irr=Rg.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)};irr.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=Rg.util.createBuffer(),this.output=t.output||Rg.util.createBuffer(),this.mode.start(e)};irr.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()};irr.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 srr=I((_nf,qBn)=>{p();var kg=As();ac();kg.cipher=kg.cipher||{};var Xs=qBn.exports=kg.cipher.modes=kg.cipher.modes||{};Xs.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)};Xs.ecb.prototype.start=function(t){};Xs.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)};Xs.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)};Xs.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=Dit(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xs.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)};Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.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};Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.ofb.prototype.decrypt=Xs.ofb.prototype.encrypt;Xs.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=kg.util.createBuffer(),this._partialBytes=0};Xs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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}Nit(this._inBlock)};Xs.ctr.prototype.decrypt=Xs.ctr.prototype.encrypt;Xs.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=kg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=kg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=kg.util.createBuffer(t.additionalData):r=kg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=kg.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(orr(n*8)))}this._inBlock=this._j0.slice(0),Nit(this._inBlock),this._partialBytes=0,r=kg.util.createBuffer(r),this._aDataLength=orr(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()])};Xs.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),Nit(this._inBlock)};Xs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Nit(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)};Xs.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};Xs.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)};Xs.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=kg.util.createBuffer();for(var n=0;n{p();var Iu=As();Pit();srr();ac();$Bn.exports=Iu.aes=Iu.aes||{};Iu.aes.startEncrypting=function(t,e,r,n){var o=Mit({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Iu.aes.createEncryptionCipher=function(t,e){return Mit({key:t,output:null,decrypt:!1,mode:e})};Iu.aes.startDecrypting=function(t,e,r,n){var o=Mit({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Iu.aes.createDecryptionCipher=function(t,e){return Mit({key:t,output:null,decrypt:!0,mode:e})};Iu.aes.Algorithm=function(t,e){lrr||HBn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return crr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return crr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Iu.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=Iu.util.createBuffer(e);else if(Iu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Iu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,ov[r]=l,arr[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)lZ[h][r]=d,_2[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(HBn,"initialize");function GBn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Ufe*c,u=s;u>>16&255]<<24^ov[n>>>8&255]<<16^ov[n&255]<<8^ov[n>>>24]^jBn[o]<<24,o++):s>6&&u%s===4&&(n=ov[n>>>24]<<24^ov[n>>>16&255]<<16^ov[n>>>8&255]<<8^ov[n&255]),r[u]=r[u-s]^n;if(e){var d,f=_2[0],h=_2[1],m=_2[2],g=_2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Ufe;u>>24]]^h[ov[d>>>16&255]]^m[ov[d>>>8&255]]^g[ov[d&255]];r=A}return r}a(GBn,"_expandKey");function crr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=_2[0],c=_2[1],l=_2[2],u=_2[3],d=arr):(s=lZ[0],c=lZ[1],l=lZ[2],u=lZ[3],d=ov);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(crr,"_updateBlock");function Mit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Iu.cipher.createDecipher(r,t.key):n=Iu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Iu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Mit,"_createCipher")});var Ij=I((Inf,VBn)=>{p();var Kke=As();Kke.pki=Kke.pki||{};var urr=VBn.exports=Kke.pki.oids=Kke.oids=Kke.oids||{};function ir(t,e){urr[t]=e,urr[e]=t}a(ir,"_IN");function Uc(t,e){urr[t]=e}a(Uc,"_I_");ir("1.2.840.113549.1.1.1","rsaEncryption");ir("1.2.840.113549.1.1.4","md5WithRSAEncryption");ir("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ir("1.2.840.113549.1.1.7","RSAES-OAEP");ir("1.2.840.113549.1.1.8","mgf1");ir("1.2.840.113549.1.1.9","pSpecified");ir("1.2.840.113549.1.1.10","RSASSA-PSS");ir("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ir("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ir("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ir("1.3.101.112","EdDSA25519");ir("1.2.840.10040.4.3","dsa-with-sha1");ir("1.3.14.3.2.7","desCBC");ir("1.3.14.3.2.26","sha1");ir("1.3.14.3.2.29","sha1WithRSASignature");ir("2.16.840.1.101.3.4.2.1","sha256");ir("2.16.840.1.101.3.4.2.2","sha384");ir("2.16.840.1.101.3.4.2.3","sha512");ir("2.16.840.1.101.3.4.2.4","sha224");ir("2.16.840.1.101.3.4.2.5","sha512-224");ir("2.16.840.1.101.3.4.2.6","sha512-256");ir("1.2.840.113549.2.2","md2");ir("1.2.840.113549.2.5","md5");ir("1.2.840.113549.1.7.1","data");ir("1.2.840.113549.1.7.2","signedData");ir("1.2.840.113549.1.7.3","envelopedData");ir("1.2.840.113549.1.7.4","signedAndEnvelopedData");ir("1.2.840.113549.1.7.5","digestedData");ir("1.2.840.113549.1.7.6","encryptedData");ir("1.2.840.113549.1.9.1","emailAddress");ir("1.2.840.113549.1.9.2","unstructuredName");ir("1.2.840.113549.1.9.3","contentType");ir("1.2.840.113549.1.9.4","messageDigest");ir("1.2.840.113549.1.9.5","signingTime");ir("1.2.840.113549.1.9.6","counterSignature");ir("1.2.840.113549.1.9.7","challengePassword");ir("1.2.840.113549.1.9.8","unstructuredAddress");ir("1.2.840.113549.1.9.14","extensionRequest");ir("1.2.840.113549.1.9.20","friendlyName");ir("1.2.840.113549.1.9.21","localKeyId");ir("1.2.840.113549.1.9.22.1","x509Certificate");ir("1.2.840.113549.1.12.10.1.1","keyBag");ir("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ir("1.2.840.113549.1.12.10.1.3","certBag");ir("1.2.840.113549.1.12.10.1.4","crlBag");ir("1.2.840.113549.1.12.10.1.5","secretBag");ir("1.2.840.113549.1.12.10.1.6","safeContentsBag");ir("1.2.840.113549.1.5.13","pkcs5PBES2");ir("1.2.840.113549.1.5.12","pkcs5PBKDF2");ir("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ir("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ir("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ir("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ir("1.2.840.113549.2.7","hmacWithSHA1");ir("1.2.840.113549.2.8","hmacWithSHA224");ir("1.2.840.113549.2.9","hmacWithSHA256");ir("1.2.840.113549.2.10","hmacWithSHA384");ir("1.2.840.113549.2.11","hmacWithSHA512");ir("1.2.840.113549.3.7","des-EDE3-CBC");ir("2.16.840.1.101.3.4.1.2","aes128-CBC");ir("2.16.840.1.101.3.4.1.22","aes192-CBC");ir("2.16.840.1.101.3.4.1.42","aes256-CBC");ir("2.5.4.3","commonName");ir("2.5.4.4","surname");ir("2.5.4.5","serialNumber");ir("2.5.4.6","countryName");ir("2.5.4.7","localityName");ir("2.5.4.8","stateOrProvinceName");ir("2.5.4.9","streetAddress");ir("2.5.4.10","organizationName");ir("2.5.4.11","organizationalUnitName");ir("2.5.4.12","title");ir("2.5.4.13","description");ir("2.5.4.15","businessCategory");ir("2.5.4.17","postalCode");ir("2.5.4.42","givenName");ir("2.5.4.65","pseudonym");ir("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ir("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ir("2.16.840.1.113730.1.1","nsCertType");ir("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");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("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");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");ir("1.3.6.1.4.1.11129.2.4.2","timestampList");ir("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ir("1.3.6.1.5.5.7.3.1","serverAuth");ir("1.3.6.1.5.5.7.3.2","clientAuth");ir("1.3.6.1.5.5.7.3.3","codeSigning");ir("1.3.6.1.5.5.7.3.4","emailProtection");ir("1.3.6.1.5.5.7.3.8","timeStamping")});var v2=I((Rnf,zBn)=>{p();var ad=As();ac();Ij();var rn=zBn.exports=ad.asn1=ad.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(ad.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(Jke,"_checkBufferLength");var Yvs=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;Jke(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=ad.util.createBuffer(t));var r=t.length(),n=Oit(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 Oit(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;Jke(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=Yvs(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(Jke(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(Oit(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(Oit(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&&(Jke(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=Oit(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)Jke(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(Oit,"_fromDer");rn.toDer=function(t){var e=ad.util.createBuffer(),r=t.tagClass|t.type,n=ad.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=ad.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=ad.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=ad.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&&ad.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` +`.trim())}};x5n.exports=htr});var Wnt=I((wtf,D5n)=>{"use strict";p();var R5n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:zgs}=Ec(),Ygs=hfe();P5n()===void 0&&k5n(new Ygs);function k5n(t){if(!t||typeof t.dispatch!="function")throw new zgs("Argument agent must implement Agent");Object.defineProperty(globalThis,R5n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(k5n,"setGlobalDispatcher");function P5n(){return globalThis[R5n]}a(P5n,"getGlobalDispatcher");D5n.exports={setGlobalDispatcher:k5n,getGlobalDispatcher:P5n}});var znt=I((Dtf,N5n)=>{"use strict";p();N5n.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 O5n=I((Otf,M5n)=>{"use strict";p();var Kgs=Int();M5n.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 Kgs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var B5n=I((Ftf,L5n)=>{"use strict";p();var Jgs=Bnt();L5n.exports=t=>e=>a(function(n,o){return e(n,new Jgs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var U5n=I((qtf,F5n)=>{"use strict";p();var Zgs=qs(),{InvalidArgumentError:Xgs,RequestAbortedError:eAs}=Ec(),tAs=znt(),mtr=class extends tAs{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 Xgs("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=Zgs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new eAs(`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 rAs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new mtr({maxSize:s},o);return e(n,c)},"Intercept")}a(rAs,"createDumpInterceptor");F5n.exports=rAs});var j5n=I((Gtf,q5n)=>{"use strict";p();var{isIP:nAs}=require("node:net"),{lookup:iAs}=require("node:dns"),oAs=znt(),{InvalidArgumentError:Sfe,InformationalError:sAs}=Ec(),Q5n=Math.pow(2,31)-1,gtr=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 sAs("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){iAs(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===Q5n?(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===Q5n?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 Atr(this,e,r)}},Atr=class extends oAs{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}}};q5n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new Sfe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new Sfe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new Sfe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new Sfe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new Sfe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new Sfe("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 gtr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return nAs(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 nZ=I((Wtf,Y5n)=>{"use strict";p();var{kConstruct:aAs}=Gd(),{kEnumerableProperty:Tfe}=qs(),{iteratorMixin:cAs,isValidHeaderName:Dke,isValidHeaderValue:G5n}=cT(),{webidl:Va}=jA(),ytr=require("node:assert"),Ynt=require("node:util"),cm=Symbol("headers map"),dT=Symbol("headers map sorted");function H5n(t){return t===10||t===13||t===9||t===32}a(H5n,"isHTTPWhiteSpaceCharCode");function $5n(t){let e=0,r=t.length;for(;r>e&&H5n(t.charCodeAt(r-1));)--r;for(;r>e&&H5n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a($5n,"headerValueNormalize");function V5n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(V5n,"fill");function Etr(t,e,r){if(r=$5n(r),Dke(e)){if(!G5n(r))throw Va.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Va.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(z5n(t)==="immutable")throw new TypeError("immutable");return _tr(t).append(e,r,!1)}a(Etr,"appendHeader");function W5n(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[cm])r[n++]=[o,s],ytr(s!==null);return r.sort(W5n)}}},E2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Va.util.markAsUncloneable(this),e!==aAs&&(this.#t=new Knt,this.#e="none",e!==void 0&&(e=Va.converters.HeadersInit(e,"Headers contructor","init"),V5n(this,e)))}append(e,r){Va.brandCheck(this,t),Va.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Va.converters.ByteString(e,n,"name"),r=Va.converters.ByteString(r,n,"value"),Etr(this,e,r)}delete(e){if(Va.brandCheck(this,t),Va.argumentLengthCheck(arguments,1,"Headers.delete"),e=Va.converters.ByteString(e,"Headers.delete","name"),!Dke(e))throw Va.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){Va.brandCheck(this,t),Va.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Va.converters.ByteString(e,r,"name"),!Dke(e))throw Va.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Va.brandCheck(this,t),Va.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Va.converters.ByteString(e,r,"name"),!Dke(e))throw Va.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Va.brandCheck(this,t),Va.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Va.converters.ByteString(e,n,"name"),r=Va.converters.ByteString(r,n,"value"),r=$5n(r),Dke(e)){if(!G5n(r))throw Va.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Va.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Va.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[dT](){if(this.#t[dT])return this.#t[dT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[dT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):Va.converters["record"](t,e,r)}throw Va.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};Y5n.exports={fill:V5n,compareHeaderName:W5n,Headers:E2,HeadersList:Knt,getHeadersGuard:z5n,setHeadersGuard:lAs,setHeadersList:uAs,getHeadersList:_tr}});var Mke=I((Ktf,a4n)=>{"use strict";p();var{Headers:t4n,HeadersList:K5n,fill:dAs,getHeadersGuard:fAs,setHeadersGuard:r4n,setHeadersList:n4n}=nZ(),{extractBody:J5n,cloneBody:pAs,mixinBody:hAs,hasFinalizationRegistry:i4n,streamRegistry:o4n,bodyUnusable:mAs}=ofe(),vtr=qs(),Z5n=require("node:util"),{kEnumerableProperty:fT}=vtr,{isValidReasonPhrase:gAs,isCancelled:AAs,isAborted:yAs,isBlobLike:EAs,serializeJavascriptValueToJSONString:_As,isErrorLike:vAs,isomorphicEncode:CAs,environmentSettingsObject:bAs}=cT(),{redirectStatusSet:SAs,nullBodyStatus:TAs}=nke(),{kState:Vd,kHeaders:LF}=cj(),{webidl:ss}=jA(),{FormData:IAs}=lke(),{URLSerializer:X5n}=nb(),{kConstruct:Znt}=Gd(),Ctr=require("node:assert"),{types:xAs}=require("node:util"),wAs=new TextEncoder("utf-8"),iZ=class t{static{a(this,"Response")}static error(){return Nke(Xnt(),"immutable")}static json(e,r={}){ss.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ss.converters.ResponseInit(r));let n=wAs.encode(_As(e)),o=J5n(n),s=Nke(Ife({}),"response");return e4n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ss.argumentLengthCheck(arguments,1,"Response.redirect"),e=ss.converters.USVString(e),r=ss.converters["unsigned short"](r);let n;try{n=new URL(e,bAs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!SAs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Nke(Ife({}),"immutable");o[Vd].status=r;let s=CAs(X5n(n));return o[Vd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ss.util.markAsUncloneable(this),e===Znt)return;e!==null&&(e=ss.converters.BodyInit(e)),r=ss.converters.ResponseInit(r),this[Vd]=Ife({}),this[LF]=new t4n(Znt),r4n(this[LF],"response"),n4n(this[LF],this[Vd].headersList);let n=null;if(e!=null){let[o,s]=J5n(e);n={body:o,type:s}}e4n(this,r,n)}get type(){return ss.brandCheck(this,t),this[Vd].type}get url(){ss.brandCheck(this,t);let e=this[Vd].urlList,r=e[e.length-1]??null;return r===null?"":X5n(r,!0)}get redirected(){return ss.brandCheck(this,t),this[Vd].urlList.length>1}get status(){return ss.brandCheck(this,t),this[Vd].status}get ok(){return ss.brandCheck(this,t),this[Vd].status>=200&&this[Vd].status<=299}get statusText(){return ss.brandCheck(this,t),this[Vd].statusText}get headers(){return ss.brandCheck(this,t),this[LF]}get body(){return ss.brandCheck(this,t),this[Vd].body?this[Vd].body.stream:null}get bodyUsed(){return ss.brandCheck(this,t),!!this[Vd].body&&vtr.isDisturbed(this[Vd].body.stream)}clone(){if(ss.brandCheck(this,t),mAs(this))throw ss.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=btr(this[Vd]);return i4n&&this[Vd].body?.stream&&o4n.register(this,new WeakRef(this[Vd].body.stream)),Nke(e,fAs(this[LF]))}[Z5n.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 ${Z5n.formatWithOptions(r,n)}`}};hAs(iZ);Object.defineProperties(iZ.prototype,{type:fT,url:fT,status:fT,ok:fT,redirected:fT,statusText:fT,headers:fT,clone:fT,body:fT,bodyUsed:fT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(iZ,{json:fT,redirect:fT,error:fT});function btr(t){if(t.internalResponse)return s4n(btr(t.internalResponse),t.type);let e=Ife({...t,body:null});return t.body!=null&&(e.body=pAs(e,t.body)),e}a(btr,"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 K5n(t?.headersList):new K5n,urlList:t?.urlList?[...t.urlList]:[]}}a(Ife,"makeResponse");function Xnt(t){let e=vAs(t);return Ife({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Xnt,"makeNetworkError");function RAs(t){return t.type==="error"&&t.status===0}a(RAs,"isNetworkError");function Jnt(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 Ctr(!(n in e)),r[n]=o,!0}})}a(Jnt,"makeFilteredResponse");function s4n(t,e){if(e==="basic")return Jnt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Jnt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Jnt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Jnt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Ctr(!1)}a(s4n,"filterResponse");function kAs(t,e=null){return Ctr(AAs(t)),yAs(t)?Xnt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Xnt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(kAs,"makeAppropriateNetworkError");function e4n(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&&!gAs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Vd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Vd].statusText=e.statusText),"headers"in e&&e.headers!=null&&dAs(t[LF],e.headers),r){if(TAs.includes(t.status))throw ss.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Vd].body=r.body,r.type!=null&&!t[Vd].headersList.contains("content-type",!0)&&t[Vd].headersList.append("content-type",r.type,!0)}}a(e4n,"initializeResponse");function Nke(t,e){let r=new iZ(Znt);return r[Vd]=t,r[LF]=new t4n(Znt),n4n(r[LF],t.headersList),r4n(r[LF],e),i4n&&t.body?.stream&&o4n.register(r,new WeakRef(t.body.stream)),r}a(Nke,"fromInnerResponse");ss.converters.ReadableStream=ss.interfaceConverter(ReadableStream);ss.converters.FormData=ss.interfaceConverter(IAs);ss.converters.URLSearchParams=ss.interfaceConverter(URLSearchParams);ss.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ss.converters.USVString(t,e,r):EAs(t)?ss.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||xAs.isArrayBuffer(t)?ss.converters.BufferSource(t,e,r):vtr.isFormDataLike(t)?ss.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ss.converters.URLSearchParams(t,e,r):ss.converters.DOMString(t,e,r)};ss.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ss.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ss.converters.XMLHttpRequestBodyInit(t,e,r)};ss.converters.ResponseInit=ss.dictionaryConverter([{key:"status",converter:ss.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ss.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ss.converters.HeadersInit}]);a4n.exports={isNetworkError:RAs,makeNetworkError:Xnt,makeResponse:Ife,makeAppropriateNetworkError:kAs,filterResponse:s4n,Response:iZ,cloneResponse:btr,fromInnerResponse:Nke}});var d4n=I((Xtf,u4n)=>{"use strict";p();var{kConnected:c4n,kSize:l4n}=Gd(),Str=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[c4n]===0&&this.value[l4n]===0?void 0:this.value}},Ttr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[c4n]===0&&e[l4n]===0&&this.finalizer(r)})}unregister(e){}};u4n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:Str,FinalizationRegistry:Ttr}):{WeakRef,FinalizationRegistry}}});var xfe=I((rrf,I4n)=>{"use strict";p();var{extractBody:PAs,mixinBody:DAs,cloneBody:NAs,bodyUnusable:f4n}=ofe(),{Headers:v4n,fill:MAs,HeadersList:nit,setHeadersGuard:xtr,getHeadersGuard:OAs,setHeadersList:C4n,getHeadersList:p4n}=nZ(),{FinalizationRegistry:LAs}=d4n()(),tit=qs(),h4n=require("node:util"),{isValidHTTPToken:BAs,sameOrigin:m4n,environmentSettingsObject:eit}=cT(),{forbiddenMethodsSet:FAs,corsSafeListedMethodsSet:UAs,referrerPolicy:QAs,requestRedirect:qAs,requestMode:jAs,requestCredentials:HAs,requestCache:GAs,requestDuplex:$As}=nke(),{kEnumerableProperty:lm,normalizedMethodRecordsBase:VAs,normalizedMethodRecords:WAs}=tit,{kHeaders:pT,kSignal:rit,kState:ad,kDispatcher:Itr}=cj(),{webidl:Gi}=jA(),{URLSerializer:zAs}=nb(),{kConstruct:iit}=Gd(),YAs=require("node:assert"),{getMaxListeners:g4n,setMaxListeners:A4n,getEventListeners:KAs,defaultMaxListeners:y4n}=require("node:events"),JAs=Symbol("abortController"),b4n=new LAs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),oit=new WeakMap;function E4n(t){return e;function e(){let r=t.deref();if(r!==void 0){b4n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=oit.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()}oit.delete(r.signal)}}}}a(E4n,"buildAbort");var _4n=!1,_j=class t{static{a(this,"Request")}constructor(e,r={}){if(Gi.util.markAsUncloneable(this),e===iit)return;let n="Request constructor";Gi.argumentLengthCheck(arguments,1,n),e=Gi.converters.RequestInfo(e,n,"input"),r=Gi.converters.RequestInit(r,n,"init");let o=null,s=null,c=eit.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Itr]=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=sit({urlList:[_]}),s="cors"}else this[Itr]=r.dispatcher||e[Itr],YAs(e instanceof t),o=e[ad],l=e[rit];let u=eit.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&m4n(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=sit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:eit.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&&!m4n(v,eit.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 Gi.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=WAs[_];if(v!==void 0)o.method=v;else{if(!BAs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(FAs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=VAs[b]??_,o.method=_}!_4n&&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"}),_4n=!0)}r.signal!==void 0&&(l=r.signal),this[ad]=o;let m=new AbortController;if(this[rit]=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[JAs]=m;let _=new WeakRef(m),v=E4n(_);try{(typeof g4n=="function"&&g4n(l)===y4n||KAs(l,"abort").length>=y4n)&&A4n(1500,l)}catch{}tit.addAbortListener(l,v),b4n.register(m,{signal:l,abort:v},v)}}if(this[pT]=new v4n(iit),C4n(this[pT],o.headersList),xtr(this[pT],"request"),h==="no-cors"){if(!UAs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);xtr(this[pT],"request-no-cors")}if(f){let _=p4n(this[pT]),v=r.headers!==void 0?r.headers:new nit(_);if(_.clear(),v instanceof nit){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else MAs(this[pT],v)}let g=e instanceof t?e[ad].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]=PAs(r.body,o.keepalive);A=_,v&&!p4n(this[pT]).contains("content-type",!0)&&this[pT].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(f4n(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[ad].body=E}get method(){return Gi.brandCheck(this,t),this[ad].method}get url(){return Gi.brandCheck(this,t),zAs(this[ad].url)}get headers(){return Gi.brandCheck(this,t),this[pT]}get destination(){return Gi.brandCheck(this,t),this[ad].destination}get referrer(){return Gi.brandCheck(this,t),this[ad].referrer==="no-referrer"?"":this[ad].referrer==="client"?"about:client":this[ad].referrer.toString()}get referrerPolicy(){return Gi.brandCheck(this,t),this[ad].referrerPolicy}get mode(){return Gi.brandCheck(this,t),this[ad].mode}get credentials(){return this[ad].credentials}get cache(){return Gi.brandCheck(this,t),this[ad].cache}get redirect(){return Gi.brandCheck(this,t),this[ad].redirect}get integrity(){return Gi.brandCheck(this,t),this[ad].integrity}get keepalive(){return Gi.brandCheck(this,t),this[ad].keepalive}get isReloadNavigation(){return Gi.brandCheck(this,t),this[ad].reloadNavigation}get isHistoryNavigation(){return Gi.brandCheck(this,t),this[ad].historyNavigation}get signal(){return Gi.brandCheck(this,t),this[rit]}get body(){return Gi.brandCheck(this,t),this[ad].body?this[ad].body.stream:null}get bodyUsed(){return Gi.brandCheck(this,t),!!this[ad].body&&tit.isDisturbed(this[ad].body.stream)}get duplex(){return Gi.brandCheck(this,t),"half"}clone(){if(Gi.brandCheck(this,t),f4n(this))throw new TypeError("unusable");let e=S4n(this[ad]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=oit.get(this.signal);n===void 0&&(n=new Set,oit.set(this.signal,n));let o=new WeakRef(r);n.add(o),tit.addAbortListener(r.signal,E4n(o))}return T4n(e,r.signal,OAs(this[pT]))}[h4n.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 ${h4n.formatWithOptions(r,n)}`}};DAs(_j);function sit(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 nit(t.headersList):new nit}}a(sit,"makeRequest");function S4n(t){let e=sit({...t,body:null});return t.body!=null&&(e.body=NAs(e,t.body)),e}a(S4n,"cloneRequest");function T4n(t,e,r){let n=new _j(iit);return n[ad]=t,n[rit]=e,n[pT]=new v4n(iit),C4n(n[pT],t.headersList),xtr(n[pT],r),n}a(T4n,"fromInnerRequest");Object.defineProperties(_j.prototype,{method:lm,url:lm,headers:lm,redirect:lm,clone:lm,signal:lm,duplex:lm,destination:lm,body:lm,bodyUsed:lm,isHistoryNavigation:lm,isReloadNavigation:lm,keepalive:lm,integrity:lm,cache:lm,credentials:lm,attribute:lm,referrerPolicy:lm,referrer:lm,mode:lm,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Gi.converters.Request=Gi.interfaceConverter(_j);Gi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Gi.converters.USVString(t,e,r):t instanceof _j?Gi.converters.Request(t,e,r):Gi.converters.USVString(t,e,r)};Gi.converters.AbortSignal=Gi.interfaceConverter(AbortSignal);Gi.converters.RequestInit=Gi.dictionaryConverter([{key:"method",converter:Gi.converters.ByteString},{key:"headers",converter:Gi.converters.HeadersInit},{key:"body",converter:Gi.nullableConverter(Gi.converters.BodyInit)},{key:"referrer",converter:Gi.converters.USVString},{key:"referrerPolicy",converter:Gi.converters.DOMString,allowedValues:QAs},{key:"mode",converter:Gi.converters.DOMString,allowedValues:jAs},{key:"credentials",converter:Gi.converters.DOMString,allowedValues:HAs},{key:"cache",converter:Gi.converters.DOMString,allowedValues:GAs},{key:"redirect",converter:Gi.converters.DOMString,allowedValues:qAs},{key:"integrity",converter:Gi.converters.DOMString},{key:"keepalive",converter:Gi.converters.boolean},{key:"signal",converter:Gi.nullableConverter(t=>Gi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Gi.converters.any},{key:"duplex",converter:Gi.converters.DOMString,allowedValues:$As},{key:"dispatcher",converter:Gi.converters.any}]);I4n.exports={Request:_j,makeRequest:sit,fromInnerRequest:T4n,cloneRequest:S4n}});var Lke=I((orf,q4n)=>{"use strict";p();var{makeNetworkError:sl,makeAppropriateNetworkError:ait,filterResponse:wtr,makeResponse:cit,fromInnerResponse:ZAs}=Mke(),{HeadersList:x4n}=nZ(),{Request:XAs,cloneRequest:eys}=xfe(),vj=require("node:zlib"),{bytesMatch:tys,makePolicyContainer:rys,clonePolicyContainer:nys,requestBadPort:iys,TAOCheck:oys,appendRequestOriginHeader:sys,responseLocationURL:ays,requestCurrentURL:_5,setRequestReferrerPolicyOnRedirect:cys,tryUpgradeRequestToAPotentiallyTrustworthyURL:lys,createOpaqueTimingInfo:Ntr,appendFetchMetadata:uys,corsCheck:dys,crossOriginResourcePolicyCheck:fys,determineRequestsReferrer:pys,coarsenedSharedCurrentTime:Oke,createDeferredPromise:hys,isBlobLike:mys,sameOrigin:Dtr,isCancelled:oZ,isAborted:w4n,isErrorLike:gys,fullyReadBody:Ays,readableStreamClose:yys,isomorphicEncode:lit,urlIsLocal:Eys,urlIsHttpHttpsScheme:Mtr,urlHasHttpsScheme:_ys,clampAndCoarsenConnectionTimingInfo:vys,simpleRangeHeaderValue:Cys,buildContentRange:bys,createInflate:Sys,extractMimeType:Tys}=cT(),{kState:D4n,kDispatcher:Iys}=cj(),sZ=require("node:assert"),{safelyExtractBody:Otr,extractBody:R4n}=ofe(),{redirectStatusSet:N4n,nullBodyStatus:M4n,safeMethodsSet:xys,requestBodyHeader:wys,subresourceSet:Rys}=nke(),kys=require("node:events"),{Readable:Pys,pipeline:Dys,finished:Nys}=require("node:stream"),{addAbortListener:Mys,isErrored:Oys,isReadable:uit,bufferToLowerCasedHeaderName:k4n}=qs(),{dataURLProcessor:Lys,serializeAMimeType:Bys,minimizeSupportedMimeType:Fys}=nb(),{getGlobalDispatcher:Uys}=Wnt(),{webidl:Qys}=jA(),{STATUS_CODES:qys}=require("node:http"),jys=["GET","HEAD"],Hys=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Rtr,dit=class extends kys{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 Gys(t){O4n(t,"fetch")}a(Gys,"handleFetchDone");function $ys(t,e=void 0){Qys.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=hys(),n;try{n=new XAs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[D4n];if(n.signal.aborted)return ktr(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 Mys(n.signal,()=>{l=!0,sZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();ktr(r,o,f,n.signal.reason)}),u=B4n({request:o,processResponseEndOfBody:Gys,processResponse:a(f=>{if(!l){if(f.aborted){ktr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(ZAs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[Iys]}),r.promise}a($ys,"fetch");function O4n(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Mtr(r)&&n!==null&&(t.timingAllowPassed||(n=Ntr({startTime:n.startTime}),o=""),n.endTime=Oke(),t.timingInfo=n,L4n(n,r.href,e,globalThis,o))}a(O4n,"finalizeAndReportTiming");var L4n=performance.markResourceTiming;function ktr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&uit(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[D4n];o.body!=null&&uit(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(ktr,"abortFetch");function B4n({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Uys()}){sZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Oke(d),h=Ntr({startTime:f}),m={controller:new dit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return sZ(!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=nys(t.client.policyContainer):t.policyContainer=rys()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,Rys.has(t.destination),F4n(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(B4n,"fetching");async function F4n(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!Eys(_5(r))&&(n=sl("local URLs only")),lys(r),iys(r)==="blocked"&&(n=sl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=pys(r)),n===null&&(n=await(async()=>{let s=_5(r);return Dtr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await P4n(t)):r.mode==="same-origin"?sl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?sl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await P4n(t)):Mtr(_5(r))?(r.responseTainting="cors",await U4n(t)):sl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=wtr(n,"basic"):r.responseTainting==="cors"?n=wtr(n,"cors"):r.responseTainting==="opaque"?n=wtr(n,"opaque"):sZ(!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=sl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||M4n.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>Ptr(t,sl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!tys(l,r.integrity)){s("integrity mismatch");return}n.body=Otr(l)[0],Ptr(t,n)},"processBody");await Ays(n.body,c,s)}else Ptr(t,n)}a(F4n,"mainFetch");function P4n(t){if(oZ(t)&&t.request.redirectCount===0)return Promise.resolve(ait(t));let{request:e}=t,{protocol:r}=_5(e);switch(r){case"about:":return Promise.resolve(sl("about scheme is not supported"));case"blob:":{Rtr||(Rtr=require("node:buffer").resolveObjectURL);let n=_5(e);if(n.search.length!==0)return Promise.resolve(sl("NetworkError when attempting to fetch resource."));let o=Rtr(n.toString());if(e.method!=="GET"||!mys(o))return Promise.resolve(sl("invalid method"));let s=cit(),c=o.size,l=lit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=Cys(d,!0);if(f==="failure")return Promise.resolve(sl("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(sl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=R4n(g);s.body=A[0];let y=lit(`${g.size}`),E=bys(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=R4n(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=_5(e),o=Lys(n);if(o==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let s=Bys(o.mimeType);return Promise.resolve(cit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Otr(o.body)[0]}))}case"file:":return Promise.resolve(sl("not implemented... yet..."));case"http:":case"https:":return U4n(t).catch(n=>sl(n));default:return Promise.resolve(sl("unknown scheme"))}}a(P4n,"schemeFetch");function Vys(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Vys,"finalizeResponse");function Ptr(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=Ntr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=Tys(e.headersList);f!=="failure"&&(u.contentType=Fys(f))}t.request.initiatorType!=null&&L4n(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():Nys(o.body.stream,()=>{n()})}a(Ptr,"fetchFinale");async function U4n(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 Q4n(t),e.responseTainting==="cors"&&dys(e,r)==="failure")return sl("cors failure");oys(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&fys(e.origin,e.client,e.destination,n)==="blocked"?sl("blocked"):(N4n.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=sl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await Wys(t,r):sZ(!1)),r.timingInfo=o,r)}a(U4n,"httpFetch");function Wys(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=ays(n,_5(r).hash),o==null)return e}catch(c){return Promise.resolve(sl(c))}if(!Mtr(o))return Promise.resolve(sl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(sl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Dtr(r,o))return Promise.resolve(sl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(sl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(sl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!jys.includes(r.method)){r.method="GET",r.body=null;for(let c of wys)r.headersList.delete(c)}Dtr(_5(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&&(sZ(r.body.source!=null),r.body=Otr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Oke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),cys(r,n),F4n(t,!0)}a(Wys,"httpRedirectFetch");async function Q4n(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=eys(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=lit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",lit(s.referrer.href),!0),sys(s),uys(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",Hys),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)||(_ys(_5(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 sl("only if cached");let m=await zys(o,d,r);!xys.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"?sl():oZ(t)?ait(t):sl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(oZ(t))return ait(t);t.controller.connection.destroy(),c=await Q4n(t,e,!0)}return c}a(Q4n,"httpNetworkOrCacheFetch");async function zys(t,e=!1,r=!1){sZ(!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*(_){oZ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{oZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{oZ(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=cit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=cit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),ait(t,A)):sl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{oZ(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(w4n(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){yys(t.controller.controller),Vys(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),Oys(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){w4n(t)?(o.aborted=!0,uit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):uit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:gys(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=_5(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=vys(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=Oke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Oke(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new x4n;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 j=q[O].trim();if(j==="x-gzip"||j==="gzip")D.push(vj.createGunzip({flush:vj.constants.Z_SYNC_FLUSH,finishFlush:vj.constants.Z_SYNC_FLUSH}));else if(j==="deflate")D.push(Sys({flush:vj.constants.Z_SYNC_FLUSH,finishFlush:vj.constants.Z_SYNC_FLUSH}));else if(j==="br")D.push(vj.createBrotliDecompress({flush:vj.constants.BROTLI_OPERATION_FLUSH,finishFlush:vj.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?Dys(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 x4n;for(let x=0;x{"use strict";p();j4n.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 G4n=I((urf,H4n)=>{"use strict";p();var{webidl:hT}=jA(),fit=Symbol("ProgressEvent state"),Btr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=hT.converters.DOMString(e,"ProgressEvent constructor","type"),r=hT.converters.ProgressEventInit(r??{}),super(e,r),this[fit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return hT.brandCheck(this,t),this[fit].lengthComputable}get loaded(){return hT.brandCheck(this,t),this[fit].loaded}get total(){return hT.brandCheck(this,t),this[fit].total}};hT.converters.ProgressEventInit=hT.dictionaryConverter([{key:"lengthComputable",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:hT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:hT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);H4n.exports={ProgressEvent:Btr}});var V4n=I((prf,$4n)=>{"use strict";p();function Yys(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(Yys,"getEncoding");$4n.exports={getEncoding:Yys}});var eLn=I((grf,X4n)=>{"use strict";p();var{kState:wfe,kError:Ftr,kResult:W4n,kAborted:Bke,kLastProgressEventFired:Utr}=Ltr(),{ProgressEvent:Kys}=G4n(),{getEncoding:z4n}=V4n(),{serializeAMimeType:Jys,parseMIMEType:Y4n}=nb(),{types:Zys}=require("node:util"),{StringDecoder:K4n}=require("string_decoder"),{btoa:J4n}=require("node:buffer"),Xys={enumerable:!0,writable:!1,configurable:!1};function eEs(t,e,r,n){if(t[wfe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[wfe]="loading",t[W4n]=null,t[Ftr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[Bke];)try{let{done:d,value:f}=await l;if(u&&!t[Bke]&&queueMicrotask(()=>{Cj("loadstart",t)}),u=!1,!d&&Zys.isUint8Array(f))c.push(f),(t[Utr]===void 0||Date.now()-t[Utr]>=50)&&!t[Bke]&&(t[Utr]=Date.now(),queueMicrotask(()=>{Cj("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[wfe]="done";try{let h=tEs(c,r,e.type,n);if(t[Bke])return;t[W4n]=h,Cj("load",t)}catch(h){t[Ftr]=h,Cj("error",t)}t[wfe]!=="loading"&&Cj("loadend",t)});break}}catch(d){if(t[Bke])return;queueMicrotask(()=>{t[wfe]="done",t[Ftr]=d,Cj("error",t),t[wfe]!=="loading"&&Cj("loadend",t)});break}})()}a(eEs,"readOperation");function Cj(t,e){let r=new Kys(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Cj,"fireAProgressEvent");function tEs(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=Y4n(r||"application/octet-stream");s!=="failure"&&(o+=Jys(s)),o+=";base64,";let c=new K4n("latin1");for(let l of t)o+=J4n(c.write(l));return o+=J4n(c.end()),o}case"Text":{let o="failure";if(n&&(o=z4n(n)),o==="failure"&&r){let s=Y4n(r);s!=="failure"&&(o=z4n(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),rEs(t,o)}case"ArrayBuffer":return Z4n(t).buffer;case"BinaryString":{let o="",s=new K4n("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(tEs,"packageData");function rEs(t,e){let r=Z4n(t),n=nEs(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(rEs,"decode");function nEs(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(nEs,"BOMSniffing");function Z4n(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(Z4n,"combineByteSequences");X4n.exports={staticPropertyDescriptors:Xys,readOperation:eEs,fireAProgressEvent:Cj}});var iLn=I((Erf,nLn)=>{"use strict";p();var{staticPropertyDescriptors:Rfe,readOperation:pit,fireAProgressEvent:tLn}=eLn(),{kState:aZ,kError:rLn,kResult:hit,kEvents:wc,kAborted:iEs}=Ltr(),{webidl:Rl}=jA(),{kEnumerableProperty:sb}=qs(),_2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[aZ]="empty",this[hit]=null,this[rLn]=null,this[wc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){Rl.brandCheck(this,t),Rl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=Rl.converters.Blob(e,{strict:!1}),pit(this,e,"ArrayBuffer")}readAsBinaryString(e){Rl.brandCheck(this,t),Rl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=Rl.converters.Blob(e,{strict:!1}),pit(this,e,"BinaryString")}readAsText(e,r=void 0){Rl.brandCheck(this,t),Rl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=Rl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=Rl.converters.DOMString(r,"FileReader.readAsText","encoding")),pit(this,e,"Text",r)}readAsDataURL(e){Rl.brandCheck(this,t),Rl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=Rl.converters.Blob(e,{strict:!1}),pit(this,e,"DataURL")}abort(){if(this[aZ]==="empty"||this[aZ]==="done"){this[hit]=null;return}this[aZ]==="loading"&&(this[aZ]="done",this[hit]=null),this[iEs]=!0,tLn("abort",this),this[aZ]!=="loading"&&tLn("loadend",this)}get readyState(){switch(Rl.brandCheck(this,t),this[aZ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Rl.brandCheck(this,t),this[hit]}get error(){return Rl.brandCheck(this,t),this[rLn]}get onloadend(){return Rl.brandCheck(this,t),this[wc].loadend}set onloadend(e){Rl.brandCheck(this,t),this[wc].loadend&&this.removeEventListener("loadend",this[wc].loadend),typeof e=="function"?(this[wc].loadend=e,this.addEventListener("loadend",e)):this[wc].loadend=null}get onerror(){return Rl.brandCheck(this,t),this[wc].error}set onerror(e){Rl.brandCheck(this,t),this[wc].error&&this.removeEventListener("error",this[wc].error),typeof e=="function"?(this[wc].error=e,this.addEventListener("error",e)):this[wc].error=null}get onloadstart(){return Rl.brandCheck(this,t),this[wc].loadstart}set onloadstart(e){Rl.brandCheck(this,t),this[wc].loadstart&&this.removeEventListener("loadstart",this[wc].loadstart),typeof e=="function"?(this[wc].loadstart=e,this.addEventListener("loadstart",e)):this[wc].loadstart=null}get onprogress(){return Rl.brandCheck(this,t),this[wc].progress}set onprogress(e){Rl.brandCheck(this,t),this[wc].progress&&this.removeEventListener("progress",this[wc].progress),typeof e=="function"?(this[wc].progress=e,this.addEventListener("progress",e)):this[wc].progress=null}get onload(){return Rl.brandCheck(this,t),this[wc].load}set onload(e){Rl.brandCheck(this,t),this[wc].load&&this.removeEventListener("load",this[wc].load),typeof e=="function"?(this[wc].load=e,this.addEventListener("load",e)):this[wc].load=null}get onabort(){return Rl.brandCheck(this,t),this[wc].abort}set onabort(e){Rl.brandCheck(this,t),this[wc].abort&&this.removeEventListener("abort",this[wc].abort),typeof e=="function"?(this[wc].abort=e,this.addEventListener("abort",e)):this[wc].abort=null}};_2.EMPTY=_2.prototype.EMPTY=0;_2.LOADING=_2.prototype.LOADING=1;_2.DONE=_2.prototype.DONE=2;Object.defineProperties(_2.prototype,{EMPTY:Rfe,LOADING:Rfe,DONE:Rfe,readAsArrayBuffer:sb,readAsBinaryString:sb,readAsText:sb,readAsDataURL:sb,abort:sb,readyState:sb,result:sb,error:sb,onloadstart:sb,onprogress:sb,onload:sb,onabort:sb,onerror:sb,onloadend:sb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(_2,{EMPTY:Rfe,LOADING:Rfe,DONE:Rfe});nLn.exports={FileReader:_2}});var mit=I((Crf,oLn)=>{"use strict";p();oLn.exports={kConstruct:Gd().kConstruct}});var cLn=I((Srf,aLn)=>{"use strict";p();var oEs=require("node:assert"),{URLSerializer:sLn}=nb(),{isValidHeaderName:sEs}=cT();function aEs(t,e,r=!1){let n=sLn(t,r),o=sLn(e,r);return n===o}a(aEs,"urlEquals");function cEs(t){oEs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),sEs(r)&&e.push(r);return e}a(cEs,"getFieldValues");aLn.exports={urlEquals:aEs,getFieldValues:cEs}});var dLn=I((xrf,uLn)=>{"use strict";p();var{kConstruct:lEs}=mit(),{urlEquals:uEs,getFieldValues:Qtr}=cLn(),{kEnumerableProperty:cZ,isDisturbed:dEs}=qs(),{webidl:vi}=jA(),{Response:fEs,cloneResponse:pEs,fromInnerResponse:hEs}=Mke(),{Request:BF,fromInnerRequest:mEs}=xfe(),{kState:v2}=cj(),{fetching:gEs}=Lke(),{urlIsHttpHttpsScheme:git,createDeferredPromise:kfe,readAllBytes:AEs}=cT(),qtr=require("node:assert"),Ait=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==lEs&&vi.illegalConstructor(),vi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){vi.brandCheck(this,t);let n="Cache.match";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.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={}){vi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){vi.brandCheck(this,t);let r="Cache.add";vi.argumentLengthCheck(arguments,1,r),e=vi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){vi.brandCheck(this,t);let r="Cache.addAll";vi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw vi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=vi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[v2];if(!git(g.url)||g.method!=="GET")throw vi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new BF(m)[v2];if(!git(g.url))throw vi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=kfe();s.push(gEs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Qtr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(vi.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=kfe(),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){vi.brandCheck(this,t);let n="Cache.put";vi.argumentLengthCheck(arguments,2,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.Response(r,n,"response");let o=null;if(e instanceof BF?o=e[v2]:o=new BF(e)[v2],!git(o.url)||o.method!=="GET")throw vi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[v2];if(s.status===206)throw vi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Qtr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw vi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(dEs(s.body.stream)||s.body.stream.locked))throw vi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=pEs(s),l=kfe();if(s.body!=null){let A=s.body.stream.getReader();AEs(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=kfe(),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={}){vi.brandCheck(this,t);let n="Cache.delete";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof BF){if(o=e[v2],o.method!=="GET"&&!r.ignoreMethod)return!1}else qtr(typeof e=="string"),o=new BF(e)[v2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=kfe(),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={}){vi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof BF){if(o=e[v2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new BF(e)[v2]);let s=kfe(),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=mEs(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 vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw vi.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);qtr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!git(u.url))throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw vi.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);qtr(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=""),!uEs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Qtr(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 BF){if(o=e[v2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new BF(e)[v2]);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=hEs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Ait.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:cZ,matchAll:cZ,add:cZ,addAll:cZ,put:cZ,delete:cZ,keys:cZ});var lLn=[{key:"ignoreSearch",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];vi.converters.CacheQueryOptions=vi.dictionaryConverter(lLn);vi.converters.MultiCacheQueryOptions=vi.dictionaryConverter([...lLn,{key:"cacheName",converter:vi.converters.DOMString}]);vi.converters.Response=vi.interfaceConverter(fEs);vi.converters["sequence"]=vi.sequenceConverter(vi.converters.RequestInfo);uLn.exports={Cache:Ait}});var pLn=I((krf,fLn)=>{"use strict";p();var{kConstruct:Fke}=mit(),{Cache:yit}=dLn(),{webidl:vE}=jA(),{kEnumerableProperty:Uke}=qs(),Eit=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Fke&&vE.illegalConstructor(),vE.util.markAsUncloneable(this)}async match(e,r={}){if(vE.brandCheck(this,t),vE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=vE.converters.RequestInfo(e),r=vE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new yit(Fke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new yit(Fke,n).match(e,r);if(s!==void 0)return s}}async has(e){vE.brandCheck(this,t);let r="CacheStorage.has";return vE.argumentLengthCheck(arguments,1,r),e=vE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){vE.brandCheck(this,t);let r="CacheStorage.open";if(vE.argumentLengthCheck(arguments,1,r),e=vE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new yit(Fke,o)}let n=[];return this.#e.set(e,n),new yit(Fke,n)}async delete(e){vE.brandCheck(this,t);let r="CacheStorage.delete";return vE.argumentLengthCheck(arguments,1,r),e=vE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return vE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Eit.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Uke,has:Uke,open:Uke,delete:Uke,keys:Uke});fLn.exports={CacheStorage:Eit}});var mLn=I((Nrf,hLn)=>{"use strict";p();hLn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var jtr=I((Orf,_Ln)=>{"use strict";p();function yEs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(yEs,"isCTLExcludingHtab");function gLn(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(gLn,"validateCookieName");function ALn(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(ALn,"validateCookieValue");function yLn(t){for(let e=0;ee.toString().padStart(2,"0"));function ELn(t){return typeof t=="number"&&(t=new Date(t)),`${_Es[t.getUTCDay()]}, ${_it[t.getUTCDate()]} ${vEs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${_it[t.getUTCHours()]}:${_it[t.getUTCMinutes()]}:${_it[t.getUTCSeconds()]} GMT`}a(ELn,"toIMFDate");function CEs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(CEs,"validateCookieMaxAge");function bEs(t){if(t.name.length===0)return null;gLn(t.name),ALn(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"&&(CEs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(EEs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(yLn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${ELn(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(bEs,"stringify");_Ln.exports={isCTLExcludingHtab:yEs,validateCookieName:gLn,validateCookiePath:yLn,validateCookieValue:ALn,toIMFDate:ELn,stringify:bEs}});var CLn=I((Frf,vLn)=>{"use strict";p();var{maxNameValuePairSize:SEs,maxAttributeValueSize:TEs}=mLn(),{isCTLExcludingHtab:IEs}=jtr(),{collectASequenceOfCodePointsFast:vit}=nb(),xEs=require("node:assert");function wEs(t){if(IEs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=vit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=vit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>SEs?null:{name:n,value:o,...Pfe(r)}}a(wEs,"parseSetCookie");function Pfe(t,e={}){if(t.length===0)return e;xEs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=vit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=vit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>TEs)return Pfe(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 Pfe(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 Pfe(t,e)}a(Pfe,"parseUnparsedAttributes");vLn.exports={parseSetCookie:wEs,parseUnparsedAttributes:Pfe}});var TLn=I((qrf,SLn)=>{"use strict";p();var{parseSetCookie:REs}=CLn(),{stringify:kEs}=jtr(),{webidl:ha}=jA(),{Headers:Cit}=nZ();function PEs(t){ha.argumentLengthCheck(arguments,1,"getCookies"),ha.brandCheck(t,Cit,{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(PEs,"getCookies");function DEs(t,e,r){ha.brandCheck(t,Cit,{strict:!1});let n="deleteCookie";ha.argumentLengthCheck(arguments,2,n),e=ha.converters.DOMString(e,n,"name"),r=ha.converters.DeleteCookieAttributes(r),bLn(t,{name:e,value:"",expires:new Date(0),...r})}a(DEs,"deleteCookie");function NEs(t){ha.argumentLengthCheck(arguments,1,"getSetCookies"),ha.brandCheck(t,Cit,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>REs(r)):[]}a(NEs,"getSetCookies");function bLn(t,e){ha.argumentLengthCheck(arguments,2,"setCookie"),ha.brandCheck(t,Cit,{strict:!1}),e=ha.converters.Cookie(e);let r=kEs(e);r&&t.append("Set-Cookie",r)}a(bLn,"setCookie");ha.converters.DeleteCookieAttributes=ha.dictionaryConverter([{converter:ha.nullableConverter(ha.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ha.nullableConverter(ha.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);ha.converters.Cookie=ha.dictionaryConverter([{converter:ha.converters.DOMString,key:"name"},{converter:ha.converters.DOMString,key:"value"},{converter:ha.nullableConverter(t=>typeof t=="number"?ha.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:ha.nullableConverter(ha.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:ha.nullableConverter(ha.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:ha.nullableConverter(ha.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ha.nullableConverter(ha.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:ha.nullableConverter(ha.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:ha.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:ha.sequenceConverter(ha.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);SLn.exports={getCookies:PEs,deleteCookie:DEs,getSetCookies:NEs,setCookie:bLn}});var Nfe=I((Grf,xLn)=>{"use strict";p();var{webidl:hi}=jA(),{kEnumerableProperty:ab}=qs(),{kConstruct:ILn}=Gd(),{MessagePort:MEs}=require("node:worker_threads"),Dfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===ILn){super(arguments[1],arguments[2]),hi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get data(){return hi.brandCheck(this,t),this.#e.data}get origin(){return hi.brandCheck(this,t),this.#e.origin}get lastEventId(){return hi.brandCheck(this,t),this.#e.lastEventId}get source(){return hi.brandCheck(this,t),this.#e.source}get ports(){return hi.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 hi.brandCheck(this,t),hi.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(ILn,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:OEs}=Dfe;delete Dfe.createFastMessageEvent;var bit=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.CloseEventInit(r),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get wasClean(){return hi.brandCheck(this,t),this.#e.wasClean}get code(){return hi.brandCheck(this,t),this.#e.code}get reason(){return hi.brandCheck(this,t),this.#e.reason}},Sit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";hi.argumentLengthCheck(arguments,1,n),super(e,r),hi.util.markAsUncloneable(this),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return hi.brandCheck(this,t),this.#e.message}get filename(){return hi.brandCheck(this,t),this.#e.filename}get lineno(){return hi.brandCheck(this,t),this.#e.lineno}get colno(){return hi.brandCheck(this,t),this.#e.colno}get error(){return hi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Dfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ab,origin:ab,lastEventId:ab,source:ab,ports:ab,initMessageEvent:ab});Object.defineProperties(bit.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ab,code:ab,wasClean:ab});Object.defineProperties(Sit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ab,filename:ab,lineno:ab,colno:ab,error:ab});hi.converters.MessagePort=hi.interfaceConverter(MEs);hi.converters["sequence"]=hi.sequenceConverter(hi.converters.MessagePort);var Htr=[{key:"bubbles",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];hi.converters.MessageEventInit=hi.dictionaryConverter([...Htr,{key:"data",converter:hi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:hi.nullableConverter(hi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:hi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);hi.converters.CloseEventInit=hi.dictionaryConverter([...Htr,{key:"wasClean",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:hi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);hi.converters.ErrorEventInit=hi.dictionaryConverter([...Htr,{key:"message",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:hi.converters.any}]);xLn.exports={MessageEvent:Dfe,CloseEvent:bit,ErrorEvent:Sit,createFastMessageEvent:OEs}});var lZ=I((Wrf,wLn)=>{"use strict";p();var LEs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",BEs={enumerable:!0,writable:!1,configurable:!1},FEs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},UEs={NOT_SENT:0,PROCESSING:1,SENT:2},QEs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},qEs=2**16-1,jEs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},HEs=Buffer.allocUnsafe(0),GEs={string:1,typedArray:2,arrayBuffer:3,blob:4};wLn.exports={uid:LEs,sentCloseFrameState:UEs,staticPropertyDescriptors:BEs,states:FEs,opcodes:QEs,maxUnsigned16Bit:qEs,parserStates:jEs,emptyBuffer:HEs,sendHints:GEs}});var Qke=I((Yrf,RLn)=>{"use strict";p();RLn.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 Hke=I((Jrf,FLn)=>{"use strict";p();var{kReadyState:qke,kController:$Es,kResponse:VEs,kBinaryType:WEs,kWebSocketURL:zEs}=Qke(),{states:jke,opcodes:bj}=lZ(),{ErrorEvent:YEs,createFastMessageEvent:KEs}=Nfe(),{isUtf8:JEs}=require("node:buffer"),{collectASequenceOfCodePointsFast:ZEs,removeHTTPWhitespace:kLn}=nb();function XEs(t){return t[qke]===jke.CONNECTING}a(XEs,"isConnecting");function e_s(t){return t[qke]===jke.OPEN}a(e_s,"isEstablished");function t_s(t){return t[qke]===jke.CLOSING}a(t_s,"isClosing");function r_s(t){return t[qke]===jke.CLOSED}a(r_s,"isClosed");function Gtr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Gtr,"fireEvent");function n_s(t,e,r){if(t[qke]!==jke.OPEN)return;let n;if(e===bj.TEXT)try{n=BLn(r)}catch{DLn(t,"Received invalid UTF-8 in text frame.");return}else e===bj.BINARY&&(t[WEs]==="blob"?n=new Blob([r]):n=i_s(r));Gtr("message",t,KEs,{origin:t[zEs].origin,data:n})}a(n_s,"websocketMessageReceived");function i_s(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(i_s,"toArrayBuffer");function o_s(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(o_s,"isValidSubprotocol");function s_s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(s_s,"isValidStatusCode");function DLn(t,e){let{[$Es]:r,[VEs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&Gtr("error",t,(o,s)=>new YEs(o,s),{error:new Error(e),message:e})}a(DLn,"failWebsocketConnection");function NLn(t){return t===bj.CLOSE||t===bj.PING||t===bj.PONG}a(NLn,"isControlFrame");function MLn(t){return t===bj.CONTINUATION}a(MLn,"isContinuationFrame");function OLn(t){return t===bj.TEXT||t===bj.BINARY}a(OLn,"isTextBinaryFrame");function a_s(t){return OLn(t)||MLn(t)||NLn(t)}a(a_s,"isValidOpcode");function c_s(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(l_s,"isValidClientWindowBits");var LLn=typeof process.versions.icu=="string",PLn=LLn?new TextDecoder("utf-8",{fatal:!0}):void 0,BLn=LLn?PLn.decode.bind(PLn):function(t){if(JEs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};FLn.exports={isConnecting:XEs,isEstablished:e_s,isClosing:t_s,isClosed:r_s,fireEvent:Gtr,isValidSubprotocol:o_s,isValidStatusCode:s_s,failWebsocketConnection:DLn,websocketMessageReceived:n_s,utf8Decode:BLn,isControlFrame:NLn,isContinuationFrame:MLn,isTextBinaryFrame:OLn,isValidOpcode:a_s,parseExtensions:c_s,isValidClientWindowBits:l_s}});var Iit=I((enf,ULn)=>{"use strict";p();var{maxUnsigned16Bit:u_s}=lZ(),Tit=16386,$tr,Gke=null,Mfe=Tit;try{$tr=require("node:crypto")}catch{$tr={randomFillSync:a(function(e,r,n){for(let o=0;ou_s?(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:f_s,states:$ke,sentCloseFrameState:xit,emptyBuffer:p_s,opcodes:h_s}=lZ(),{kReadyState:Vke,kSentClose:wit,kByteParser:qLn,kReceivedClose:QLn,kResponse:jLn}=Qke(),{fireEvent:m_s,failWebsocketConnection:Sj,isClosing:g_s,isClosed:A_s,isEstablished:y_s,parseExtensions:E_s}=Hke(),{channels:Ofe}=Vde(),{CloseEvent:__s}=Nfe(),{makeRequest:v_s}=xfe(),{fetching:C_s}=Lke(),{Headers:b_s,getHeadersList:S_s}=nZ(),{getDecodeSplit:T_s}=cT(),{WebsocketFrameSend:I_s}=Iit(),Wtr;try{Wtr=require("node:crypto")}catch{}function x_s(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=v_s({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=S_s(new b_s(s.headers));l.headersList=h}let u=Wtr.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"),C_s({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Sj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Sj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Sj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Sj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Wtr.createHash("sha1").update(u+f_s).digest("base64");if(m!==g){Sj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=E_s(A),!y.has("permessage-deflate"))){Sj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!T_s("sec-websocket-protocol",l.headersList).includes(E)){Sj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",HLn),h.socket.on("close",GLn),h.socket.on("error",$Ln),Ofe.open.hasSubscribers&&Ofe.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(x_s,"establishWebSocketConnection");function w_s(t,e,r,n){if(!(g_s(t)||A_s(t)))if(!y_s(t))Sj(t,"Connection was closed before it was established."),t[Vke]=$ke.CLOSING;else if(t[wit]===xit.NOT_SENT){t[wit]=xit.PROCESSING;let o=new I_s;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=p_s,t[jLn].socket.write(o.createFrame(h_s.CLOSE)),t[wit]=xit.SENT,t[Vke]=$ke.CLOSING}else t[Vke]=$ke.CLOSING}a(w_s,"closeWebSocketConnection");function HLn(t){this.ws[qLn].write(t)||this.pause()}a(HLn,"onSocketData");function GLn(){let{ws:t}=this,{[jLn]:e}=t;e.socket.off("data",HLn),e.socket.off("close",GLn),e.socket.off("error",$Ln);let r=t[wit]===xit.SENT&&t[QLn],n=1005,o="",s=t[qLn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[QLn]||(n=1006),t[Vke]=$ke.CLOSED,m_s("close",t,(c,l)=>new __s(c,l),{wasClean:r,code:n,reason:o}),Ofe.close.hasSubscribers&&Ofe.close.publish({websocket:t,code:n,reason:o})}a(GLn,"onSocketClose");function $Ln(t){let{ws:e}=this;e[Vke]=$ke.CLOSING,Ofe.socketError.hasSubscribers&&Ofe.socketError.publish(t),this.destroy()}a($Ln,"onSocketError");VLn.exports={establishWebSocketConnection:x_s,closeWebSocketConnection:w_s}});var YLn=I((snf,zLn)=>{"use strict";p();var{createInflateRaw:R_s,Z_DEFAULT_WINDOWBITS:k_s}=require("node:zlib"),{isValidClientWindowBits:P_s}=Hke(),{MessageSizeExceededError:WLn}=Ec(),D_s=Buffer.from([0,0,255,255]),Rit=Symbol("kBuffer"),Wke=Symbol("kLength"),N_s=4*1024*1024,Ytr=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 WLn);return}if(!this.#e){let o=k_s;if(this.#t.serverMaxWindowBits){if(!P_s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=R_s({windowBits:o})}catch(s){n(s);return}this.#e[Rit]=[],this.#e[Wke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Wke]+=s.length,this.#e[Wke]>N_s){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new WLn)}return}this.#e[Rit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(D_s),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Rit],this.#e[Wke]);this.#e[Rit].length=0,this.#e[Wke]=0,this.#n=null,n(null,o)})}};zLn.exports={PerMessageDeflate:Ytr}});var oBn=I((lnf,iBn)=>{"use strict";p();var{Writable:M_s}=require("node:stream"),O_s=require("node:assert"),{parserStates:cb,opcodes:Lfe,states:L_s,emptyBuffer:KLn,sentCloseFrameState:JLn}=lZ(),{kReadyState:B_s,kSentClose:ZLn,kResponse:XLn,kReceivedClose:eBn}=Qke(),{channels:kit}=Vde(),{isValidStatusCode:F_s,isValidOpcode:U_s,failWebsocketConnection:mT,websocketMessageReceived:tBn,utf8Decode:Q_s,isControlFrame:rBn,isTextBinaryFrame:Ktr,isContinuationFrame:q_s}=Hke(),{WebsocketFrameSend:nBn}=Iit(),{closeWebSocketConnection:j_s}=ztr(),{PerMessageDeflate:H_s}=YLn(),Jtr=class extends M_s{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=cb.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 H_s(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===cb.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!==Lfe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!U_s(o))return mT(this.ws,"Invalid opcode received"),e();if(s)return mT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){mT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){mT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Ktr(o)){mT(this.ws,"Invalid frame type was fragmented.");return}if(Ktr(o)&&this.#o.length>0){mT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){mT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&rBn(o)){mT(this.ws,"Control frame either too large or fragmented");return}if(q_s(o)&&this.#o.length===0&&!this.#i.compressed){mT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=cb.READ_DATA):l===126?this.#n=cb.PAYLOADLENGTH_16:l===127&&(this.#n=cb.PAYLOADLENGTH_64),Ktr(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===cb.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=cb.READ_DATA}else if(this.#n===cb.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){mT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=cb.READ_DATA}else if(this.#n===cb.READ_DATA){if(this.#t{if(n){mT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=cb.INFO,this.#r=!0,this.run(e);return}tBn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=cb.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);tBn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=cb.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return KLn;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){O_s(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!F_s(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=Q_s(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===Lfe.CLOSE){if(n===1)return mT(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 j_s(this.ws,o,s,s.length),mT(this.ws,s),!1}if(this.ws[ZLn]!==JLn.SENT){let o=KLn;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new nBn(o);this.ws[XLn].socket.write(s.createFrame(Lfe.CLOSE),c=>{c||(this.ws[ZLn]=JLn.SENT)})}return this.ws[B_s]=L_s.CLOSING,this.ws[eBn]=!0,!1}else if(r===Lfe.PING){if(!this.ws[eBn]){let o=new nBn(e);this.ws[XLn].socket.write(o.createFrame(Lfe.PONG)),kit.ping.hasSubscribers&&kit.ping.publish({payload:e})}}else r===Lfe.PONG&&kit.pong.hasSubscribers&&kit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};iBn.exports={ByteParser:Jtr}});var uBn=I((fnf,lBn)=>{"use strict";p();var{WebsocketFrameSend:G_s}=Iit(),{opcodes:sBn,sendHints:Bfe}=lZ(),$_s=aer(),aBn=Buffer[Symbol.species],Ztr=class{static{a(this,"SendQueue")}#e=new $_s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Bfe.blob){let s=cBn(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=cBn(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 cBn(t,e){return new G_s(V_s(t,e)).createFrame(e===Bfe.string?sBn.TEXT:sBn.BINARY)}a(cBn,"createFrame");function V_s(t,e){switch(e){case Bfe.string:return Buffer.from(t);case Bfe.arrayBuffer:case Bfe.blob:return new aBn(t);case Bfe.typedArray:return new aBn(t.buffer,t.byteOffset,t.byteLength)}}a(V_s,"toBuffer");lBn.exports={SendQueue:Ztr}});var EBn=I((mnf,yBn)=>{"use strict";p();var{webidl:so}=jA(),{URLSerializer:W_s}=nb(),{environmentSettingsObject:dBn}=cT(),{staticPropertyDescriptors:Tj,states:zke,sentCloseFrameState:z_s,sendHints:Pit}=lZ(),{kWebSocketURL:fBn,kReadyState:Xtr,kController:Y_s,kBinaryType:Dit,kResponse:pBn,kSentClose:K_s,kByteParser:J_s}=Qke(),{isConnecting:Z_s,isEstablished:X_s,isClosing:evs,isValidSubprotocol:tvs,fireEvent:hBn}=Hke(),{establishWebSocketConnection:rvs,closeWebSocketConnection:mBn}=ztr(),{ByteParser:nvs}=oBn(),{kEnumerableProperty:ww,isBlobLike:gBn}=qs(),{getGlobalDispatcher:ivs}=Wnt(),{types:ABn}=require("node:util"),{ErrorEvent:ovs,CloseEvent:svs}=Nfe(),{SendQueue:avs}=uBn(),gT=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=dBn.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=>tvs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[fBn]=new URL(c.href);let l=dBn.settingsObject;this[Y_s]=rvs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[Xtr]=t.CONNECTING,this[K_s]=z_s.NOT_SENT,this[Dit]="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");mBn(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"),Z_s(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!X_s(this)||evs(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},Pit.string)}else ABn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Pit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Pit.typedArray)):gBn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Pit.blob))}get readyState(){return so.brandCheck(this,t),this[Xtr]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),W_s(this[fBn])}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[Dit]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Dit]="blob":this[Dit]=e}#o(e,r){this[pBn]=e;let n=new nvs(this,r);n.on("drain",cvs),n.on("error",lvs.bind(this)),e.socket.ws=this,this[J_s]=n,this.#i=new avs(e.socket),this[Xtr]=zke.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),hBn("open",this)}};gT.CONNECTING=gT.prototype.CONNECTING=zke.CONNECTING;gT.OPEN=gT.prototype.OPEN=zke.OPEN;gT.CLOSING=gT.prototype.CLOSING=zke.CLOSING;gT.CLOSED=gT.prototype.CLOSED=zke.CLOSED;Object.defineProperties(gT.prototype,{CONNECTING:Tj,OPEN:Tj,CLOSING:Tj,CLOSED:Tj,url:ww,readyState:ww,bufferedAmount:ww,onopen:ww,onerror:ww,onclose:ww,close:ww,onmessage:ww,binaryType:ww,send:ww,extensions:ww,protocol:ww,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(gT,{CONNECTING:Tj,OPEN:Tj,CLOSING:Tj,CLOSED:Tj});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(()=>ivs(),"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(gBn(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||ABn.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function cvs(){this.ws[pBn].socket.resume()}a(cvs,"onParserDrain");function lvs(t){let e,r;t instanceof svs?(e=t.reason,r=t.code):e=t.message,hBn("error",this,()=>new ovs("error",{error:t,message:e})),mBn(this,r)}a(lvs,"onParserError");yBn.exports={WebSocket:gT}});var trr=I((ynf,_Bn)=>{"use strict";p();function uvs(t){return t.indexOf("\0")===-1}a(uvs,"isValidLastEventId");function dvs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(dvs,"isASCIINumber");function fvs(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(fvs,"delay");_Bn.exports={isValidLastEventId:uvs,isASCIINumber:dvs,delay:fvs}});var SBn=I((vnf,bBn)=>{"use strict";p();var{Transform:pvs}=require("node:stream"),{isASCIINumber:vBn,isValidLastEventId:CBn}=trr(),FF=[239,187,191],rrr=10,Nit=13,hvs=58,mvs=32,nrr=class extends pvs{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]===FF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===FF[0]&&this.buffer[1]===FF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===FF[0]&&this.buffer[1]===FF[1]&&this.buffer[2]===FF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===FF[0]&&this.buffer[1]===FF[1]&&this.buffer[2]===FF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&vBn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&CBn(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}}};bBn.exports={EventSourceStream:nrr}});var DBn=I((Snf,PBn)=>{"use strict";p();var{pipeline:gvs}=require("node:stream"),{fetching:Avs}=Lke(),{makeRequest:yvs}=xfe(),{webidl:UF}=jA(),{EventSourceStream:Evs}=SBn(),{parseMIMEType:_vs}=nb(),{createFastMessageEvent:vvs}=Nfe(),{isNetworkError:TBn}=Mke(),{delay:Cvs}=trr(),{kEnumerableProperty:uZ}=qs(),{environmentSettingsObject:IBn}=cT(),xBn=!1,wBn=3e3,Yke=0,RBn=1,Kke=2,bvs="anonymous",Svs="use-credentials",Ffe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=Yke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),UF.util.markAsUncloneable(this);let n="EventSource constructor";UF.argumentLengthCheck(arguments,1,n),xBn||(xBn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=UF.converters.USVString(e,n,"url"),r=UF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:wBn};let o=IBn,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=bvs;r.withCredentials&&(c=Svs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=IBn.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=yvs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Kke)return;this.#n=Yke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{TBn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(TBn(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?_vs(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=RBn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new Evs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(vvs(u.type,u.options))},"push")});gvs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=Avs(e)}async#u(){this.#n!==Kke&&(this.#n=Yke,this.dispatchEvent(new Event("error")),await Cvs(this.#a.reconnectionTime),this.#n===Yke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){UF.brandCheck(this,t),this.#n!==Kke&&(this.#n=Kke,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}},kBn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Yke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:RBn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Kke,writable:!1}};Object.defineProperties(Ffe,kBn);Object.defineProperties(Ffe.prototype,kBn);Object.defineProperties(Ffe.prototype,{close:uZ,onerror:uZ,onmessage:uZ,onopen:uZ,readyState:uZ,url:uZ,withCredentials:uZ});UF.converters.EventSourceInitDict=UF.dictionaryConverter([{key:"withCredentials",converter:UF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:UF.converters.any}]);PBn.exports={EventSource:Ffe,defaultReconnectionTime:wBn}});var LBn=I((xnf,Ki)=>{"use strict";p();var Tvs=ffe(),NBn=eke(),Ivs=pfe(),xvs=kMn(),wvs=hfe(),Rvs=xer(),kvs=eOn(),Pvs=sOn(),MBn=Ec(),Oit=qs(),{InvalidArgumentError:Mit}=MBn,Ufe=VOn(),Dvs=rke(),Nvs=ctr(),Mvs=w5n(),Ovs=dtr(),Lvs=Yer(),Bvs=Bnt(),{getGlobalDispatcher:OBn,setGlobalDispatcher:Fvs}=Wnt(),Uvs=znt(),Qvs=Int(),qvs=xnt();Object.assign(NBn.prototype,Ufe);Ki.exports.Dispatcher=NBn;Ki.exports.Client=Tvs;Ki.exports.Pool=Ivs;Ki.exports.BalancedPool=xvs;Ki.exports.Agent=wvs;Ki.exports.ProxyAgent=Rvs;Ki.exports.EnvHttpProxyAgent=kvs;Ki.exports.RetryAgent=Pvs;Ki.exports.RetryHandler=Bvs;Ki.exports.DecoratorHandler=Uvs;Ki.exports.RedirectHandler=Qvs;Ki.exports.createRedirectInterceptor=qvs;Ki.exports.interceptors={redirect:O5n(),retry:B5n(),dump:U5n(),dns:j5n()};Ki.exports.buildConnector=Dvs;Ki.exports.errors=MBn;Ki.exports.util={parseHeaders:Oit.parseHeaders,headerNameToString:Oit.headerNameToString};function Jke(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 Mit("invalid url");if(r!=null&&typeof r!="object")throw new Mit("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Mit("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Oit.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Oit.parseURL(e);let{agent:o,dispatcher:s=OBn()}=r;if(o)throw new Mit("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(Jke,"makeDispatcher");Ki.exports.setGlobalDispatcher=Fvs;Ki.exports.getGlobalDispatcher=OBn;var jvs=Lke().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await jvs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=nZ().Headers;Ki.exports.Response=Mke().Response;Ki.exports.Request=xfe().Request;Ki.exports.FormData=lke().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=iLn().FileReader;var{setGlobalOrigin:Hvs,getGlobalOrigin:Gvs}=wXt();Ki.exports.setGlobalOrigin=Hvs;Ki.exports.getGlobalOrigin=Gvs;var{CacheStorage:$vs}=pLn(),{kConstruct:Vvs}=mit();Ki.exports.caches=new $vs(Vvs);var{deleteCookie:Wvs,getCookies:zvs,getSetCookies:Yvs,setCookie:Kvs}=TLn();Ki.exports.deleteCookie=Wvs;Ki.exports.getCookies=zvs;Ki.exports.getSetCookies=Yvs;Ki.exports.setCookie=Kvs;var{parseMIMEType:Jvs,serializeAMimeType:Zvs}=nb();Ki.exports.parseMIMEType=Jvs;Ki.exports.serializeAMimeType=Zvs;var{CloseEvent:Xvs,ErrorEvent:eCs,MessageEvent:tCs}=Nfe();Ki.exports.WebSocket=EBn().WebSocket;Ki.exports.CloseEvent=Xvs;Ki.exports.ErrorEvent=eCs;Ki.exports.MessageEvent=tCs;Ki.exports.request=Jke(Ufe.request);Ki.exports.stream=Jke(Ufe.stream);Ki.exports.pipeline=Jke(Ufe.pipeline);Ki.exports.connect=Jke(Ufe.connect);Ki.exports.upgrade=Jke(Ufe.upgrade);Ki.exports.MockClient=Nvs;Ki.exports.MockPool=Ovs;Ki.exports.MockAgent=Mvs;Ki.exports.mockErrors=Lvs;var{EventSource:rCs}=DBn();Ki.exports.EventSource=rCs});var As=I((knf,BBn)=>{p();BBn.exports={options:{usePureJavaScript:!1}}});var QBn=I((Dnf,UBn)=>{p();var irr={};UBn.exports=irr;var FBn={};irr.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=nCs(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};irr.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=FBn[e];if(!r){r=FBn[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(nCs,"_encodeWithByteBuffer")});var cc=I((Onf,GBn)=>{p();var qBn=As(),jBn=QBn(),nt=GBn.exports=qBn.util=qBn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){nt.nextTick=process.nextTick,typeof setImmediate=="function"?nt.setImmediate=setImmediate:nt.setImmediate=nt.nextTick;return}if(typeof setImmediate=="function"){nt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},nt.nextTick=function(l){return setImmediate(l)};return}if(nt.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=[];nt.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=nt.setImmediate;nt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}nt.nextTick=nt.setImmediate})();nt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;nt.globalScope=(function(){return nt.isNodejs?global:typeof self>"u"?window:self})();nt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};nt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};nt.isArrayBufferView=function(t){return t&&nt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function Zke(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(Zke,"_checkBitsParam");nt.ByteBuffer=orr;function orr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(nt.isArrayBuffer(t)||nt.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;riCs&&(this.data.substr(0,1),this._constructedStringLength=0)};nt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};nt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};nt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};nt.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};nt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};nt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(nt.encodeUtf8(t))};nt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.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))};nt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};nt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};nt.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))};nt.ByteStringBuffer.prototype.putInt=function(t,e){Zke(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};nt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};nt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.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};nt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};nt.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};nt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};nt.ByteStringBuffer.prototype.copy=function(){var t=nt.createBuffer(this.data);return t.read=this.read,t};nt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};nt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};nt.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};nt.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};nt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};nt.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};nt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};nt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};nt.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};nt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};nt.DataBuffer.prototype.putInt=function(t,e){Zke(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};nt.DataBuffer.prototype.putSignedInt=function(t,e){return Zke(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};nt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.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};nt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};nt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};nt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};nt.DataBuffer.prototype.copy=function(){return new nt.DataBuffer(this)};nt.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};nt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};nt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};nt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};nt.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};nt.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 Ij="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",xj=[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],HBn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=Ij.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Ij.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Ij.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};nt.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};nt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};nt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};nt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:jBn.encode,decode:jBn.decode}};nt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};nt.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+=Ij.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Ij.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Ij.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};nt.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)};nt.binary.base58.encode=function(t,e){return nt.binary.baseN.encode(t,HBn,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,HBn,e)};nt.text={utf8:{},utf16:{}};nt.text.utf8.encode=function(t,e,r){t=nt.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");nt.setItem=function(t,e,r,n,o){Lit(sCs,arguments,o)};nt.getItem=function(t,e,r,n){return Lit(aCs,arguments,n)};nt.removeItem=function(t,e,r,n){Lit(cCs,arguments,n)};nt.clearItems=function(t,e,r){Lit(lCs,arguments,r)};nt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};nt.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("")};nt.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):"")};nt.formatSize=function(t){return t>=1073741824?t=nt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=nt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=nt.formatNumber(t/1024,0)+" KiB":t=nt.formatNumber(t,0)+" bytes",t};nt.bytesFromIP=function(t){return t.indexOf(".")!==-1?nt.bytesFromIPv4(t):t.indexOf(":")!==-1?nt.bytesFromIPv6(t):null};nt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=nt.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(":")};nt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in nt&&!t.update)return e(null,nt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return nt.cores=navigator.hardwareConcurrency,e(null,nt.cores);if(typeof Worker>"u")return nt.cores=1,e(null,nt.cores);if(typeof Blob>"u")return nt.cores=2,e(null,nt.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 kg=As();cc();$Bn.exports=kg.cipher=kg.cipher||{};kg.cipher.algorithms=kg.cipher.algorithms||{};kg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=kg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new kg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};kg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=kg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new kg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};kg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),kg.cipher.algorithms[t]=e};kg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in kg.cipher.algorithms?kg.cipher.algorithms[t]:null};var crr=kg.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)};crr.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=kg.util.createBuffer(),this.output=t.output||kg.util.createBuffer(),this.mode.start(e)};crr.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()};crr.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 urr=I((Qnf,VBn)=>{p();var Pg=As();cc();Pg.cipher=Pg.cipher||{};var Xs=VBn.exports=Pg.cipher.modes=Pg.cipher.modes||{};Xs.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)};Xs.ecb.prototype.start=function(t){};Xs.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)};Xs.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)};Xs.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=Fit(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xs.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)};Xs.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=Pg.util.createBuffer(),this._partialBytes=0};Xs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Fit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.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};Xs.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=Pg.util.createBuffer(),this._partialBytes=0};Xs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Fit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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};Xs.ofb.prototype.decrypt=Xs.ofb.prototype.encrypt;Xs.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=Pg.util.createBuffer(),this._partialBytes=0};Xs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Fit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.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}Uit(this._inBlock)};Xs.ctr.prototype.decrypt=Xs.ctr.prototype.encrypt;Xs.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=Pg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Pg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Pg.util.createBuffer(t.additionalData):r=Pg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Pg.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(lrr(n*8)))}this._inBlock=this._j0.slice(0),Uit(this._inBlock),this._partialBytes=0,r=Pg.util.createBuffer(r),this._aDataLength=lrr(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()])};Xs.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),Uit(this._inBlock)};Xs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Uit(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)};Xs.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};Xs.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)};Xs.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=Pg.util.createBuffer();for(var n=0;n{p();var Iu=As();Bit();urr();cc();KBn.exports=Iu.aes=Iu.aes||{};Iu.aes.startEncrypting=function(t,e,r,n){var o=Qit({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Iu.aes.createEncryptionCipher=function(t,e){return Qit({key:t,output:null,decrypt:!1,mode:e})};Iu.aes.startDecrypting=function(t,e,r,n){var o=Qit({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Iu.aes.createDecryptionCipher=function(t,e){return Qit({key:t,output:null,decrypt:!0,mode:e})};Iu.aes.Algorithm=function(t,e){prr||zBn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return frr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return frr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Iu.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=Iu.util.createBuffer(e);else if(Iu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Iu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,av[r]=l,drr[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)dZ[h][r]=d,C2[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(zBn,"initialize");function YBn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Qfe*c,u=s;u>>16&255]<<24^av[n>>>8&255]<<16^av[n&255]<<8^av[n>>>24]^WBn[o]<<24,o++):s>6&&u%s===4&&(n=av[n>>>24]<<24^av[n>>>16&255]<<16^av[n>>>8&255]<<8^av[n&255]),r[u]=r[u-s]^n;if(e){var d,f=C2[0],h=C2[1],m=C2[2],g=C2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Qfe;u>>24]]^h[av[d>>>16&255]]^m[av[d>>>8&255]]^g[av[d&255]];r=A}return r}a(YBn,"_expandKey");function frr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=C2[0],c=C2[1],l=C2[2],u=C2[3],d=drr):(s=dZ[0],c=dZ[1],l=dZ[2],u=dZ[3],d=av);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(frr,"_updateBlock");function Qit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Iu.cipher.createDecipher(r,t.key):n=Iu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Iu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Qit,"_createCipher")});var Rj=I((Vnf,JBn)=>{p();var Xke=As();Xke.pki=Xke.pki||{};var hrr=JBn.exports=Xke.pki.oids=Xke.oids=Xke.oids||{};function ir(t,e){hrr[t]=e,hrr[e]=t}a(ir,"_IN");function Uc(t,e){hrr[t]=e}a(Uc,"_I_");ir("1.2.840.113549.1.1.1","rsaEncryption");ir("1.2.840.113549.1.1.4","md5WithRSAEncryption");ir("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ir("1.2.840.113549.1.1.7","RSAES-OAEP");ir("1.2.840.113549.1.1.8","mgf1");ir("1.2.840.113549.1.1.9","pSpecified");ir("1.2.840.113549.1.1.10","RSASSA-PSS");ir("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ir("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ir("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ir("1.3.101.112","EdDSA25519");ir("1.2.840.10040.4.3","dsa-with-sha1");ir("1.3.14.3.2.7","desCBC");ir("1.3.14.3.2.26","sha1");ir("1.3.14.3.2.29","sha1WithRSASignature");ir("2.16.840.1.101.3.4.2.1","sha256");ir("2.16.840.1.101.3.4.2.2","sha384");ir("2.16.840.1.101.3.4.2.3","sha512");ir("2.16.840.1.101.3.4.2.4","sha224");ir("2.16.840.1.101.3.4.2.5","sha512-224");ir("2.16.840.1.101.3.4.2.6","sha512-256");ir("1.2.840.113549.2.2","md2");ir("1.2.840.113549.2.5","md5");ir("1.2.840.113549.1.7.1","data");ir("1.2.840.113549.1.7.2","signedData");ir("1.2.840.113549.1.7.3","envelopedData");ir("1.2.840.113549.1.7.4","signedAndEnvelopedData");ir("1.2.840.113549.1.7.5","digestedData");ir("1.2.840.113549.1.7.6","encryptedData");ir("1.2.840.113549.1.9.1","emailAddress");ir("1.2.840.113549.1.9.2","unstructuredName");ir("1.2.840.113549.1.9.3","contentType");ir("1.2.840.113549.1.9.4","messageDigest");ir("1.2.840.113549.1.9.5","signingTime");ir("1.2.840.113549.1.9.6","counterSignature");ir("1.2.840.113549.1.9.7","challengePassword");ir("1.2.840.113549.1.9.8","unstructuredAddress");ir("1.2.840.113549.1.9.14","extensionRequest");ir("1.2.840.113549.1.9.20","friendlyName");ir("1.2.840.113549.1.9.21","localKeyId");ir("1.2.840.113549.1.9.22.1","x509Certificate");ir("1.2.840.113549.1.12.10.1.1","keyBag");ir("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ir("1.2.840.113549.1.12.10.1.3","certBag");ir("1.2.840.113549.1.12.10.1.4","crlBag");ir("1.2.840.113549.1.12.10.1.5","secretBag");ir("1.2.840.113549.1.12.10.1.6","safeContentsBag");ir("1.2.840.113549.1.5.13","pkcs5PBES2");ir("1.2.840.113549.1.5.12","pkcs5PBKDF2");ir("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ir("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ir("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ir("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ir("1.2.840.113549.2.7","hmacWithSHA1");ir("1.2.840.113549.2.8","hmacWithSHA224");ir("1.2.840.113549.2.9","hmacWithSHA256");ir("1.2.840.113549.2.10","hmacWithSHA384");ir("1.2.840.113549.2.11","hmacWithSHA512");ir("1.2.840.113549.3.7","des-EDE3-CBC");ir("2.16.840.1.101.3.4.1.2","aes128-CBC");ir("2.16.840.1.101.3.4.1.22","aes192-CBC");ir("2.16.840.1.101.3.4.1.42","aes256-CBC");ir("2.5.4.3","commonName");ir("2.5.4.4","surname");ir("2.5.4.5","serialNumber");ir("2.5.4.6","countryName");ir("2.5.4.7","localityName");ir("2.5.4.8","stateOrProvinceName");ir("2.5.4.9","streetAddress");ir("2.5.4.10","organizationName");ir("2.5.4.11","organizationalUnitName");ir("2.5.4.12","title");ir("2.5.4.13","description");ir("2.5.4.15","businessCategory");ir("2.5.4.17","postalCode");ir("2.5.4.42","givenName");ir("2.5.4.65","pseudonym");ir("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ir("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ir("2.16.840.1.113730.1.1","nsCertType");ir("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");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("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");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");ir("1.3.6.1.4.1.11129.2.4.2","timestampList");ir("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ir("1.3.6.1.5.5.7.3.1","serverAuth");ir("1.3.6.1.5.5.7.3.2","clientAuth");ir("1.3.6.1.5.5.7.3.3","codeSigning");ir("1.3.6.1.5.5.7.3.4","emailProtection");ir("1.3.6.1.5.5.7.3.8","timeStamping")});var b2=I((Ynf,XBn)=>{p();var cd=As();cc();Rj();var rn=XBn.exports=cd.asn1=cd.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(cd.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(ePe,"_checkBufferLength");var uCs=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;ePe(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=cd.util.createBuffer(t));var r=t.length(),n=qit(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 qit(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;ePe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=uCs(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(ePe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(qit(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(qit(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&&(ePe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=qit(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)ePe(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(qit,"_fromDer");rn.toDer=function(t){var e=cd.util.createBuffer(),r=t.tagClass|t.type,n=cd.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=cd.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=cd.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=cd.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&&cd.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` `);for(var o="",s=0;s1?n+="0x"+ad.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)WBn.test(t.value)||(n+="("+t.value+") "),n+="0x"+ad.util.bytesToHex(t.value);else if(t.type===rn.Type.UTF8)try{n+=ad.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+ad.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:WBn.test(t.value)?n+="0x"+ad.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var E5=I((Dnf,YBn)=>{p();var Lit=As();YBn.exports=Lit.md=Lit.md||{};Lit.md.algorithms=Lit.md.algorithms||{}});var qfe=I((Mnf,KBn)=>{p();var FF=As();E5();ac();var Kvs=KBn.exports=FF.hmac=FF.hmac||{};Kvs.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 FF.md.algorithms)e=FF.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=FF.util.createBuffer(c);else if(FF.util.isArray(c)){var l=c;c=FF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=FF.util.createBuffer(),n=FF.util.createBuffer(),d=c.length();for(var u=0;u{p();var _5=As();E5();ac();var ZBn=e3n.exports=_5.md5=_5.md5||{};_5.md.md5=_5.md.algorithms.md5=ZBn;ZBn.create=function(){XBn||Jvs();var t=null,e=_5.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),JBn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=_5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(drr.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};JBn(f,r,o);var h=_5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var drr=null,Bit=null,Zke=null,jfe=null,XBn=!1;function Jvs(){drr="\x80",drr+=_5.util.fillString("\0",64),Bit=[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],Zke=[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],jfe=new Array(64);for(var t=0;t<64;++t)jfe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);XBn=!0}a(Jvs,"_init");function JBn(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+jfe[f]+e[f],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+jfe[f]+e[Bit[f]],d=Zke[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(JBn,"_update")});var uZ=I((Unf,r3n)=>{p();var Qit=As();ac();var t3n=r3n.exports=Qit.pem=Qit.pem||{};t3n.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+=Uit(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Uit(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Uit(n)),t.headers)for(var o=0;o1?n+="0x"+cd.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)ZBn.test(t.value)||(n+="("+t.value+") "),n+="0x"+cd.util.bytesToHex(t.value);else if(t.type===rn.Type.UTF8)try{n+=cd.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+cd.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:ZBn.test(t.value)?n+="0x"+cd.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var v5=I((Znf,e3n)=>{p();var jit=As();e3n.exports=jit.md=jit.md||{};jit.md.algorithms=jit.md.algorithms||{}});var jfe=I((eif,t3n)=>{p();var QF=As();v5();cc();var dCs=t3n.exports=QF.hmac=QF.hmac||{};dCs.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 QF.md.algorithms)e=QF.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=QF.util.createBuffer(c);else if(QF.util.isArray(c)){var l=c;c=QF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=QF.util.createBuffer(),n=QF.util.createBuffer(),d=c.length();for(var u=0;u{p();var C5=As();v5();cc();var n3n=o3n.exports=C5.md5=C5.md5||{};C5.md.md5=C5.md.algorithms.md5=n3n;n3n.create=function(){i3n||fCs();var t=null,e=C5.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),r3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=C5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(mrr.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};r3n(f,r,o);var h=C5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var mrr=null,Hit=null,tPe=null,Hfe=null,i3n=!1;function fCs(){mrr="\x80",mrr+=C5.util.fillString("\0",64),Hit=[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],tPe=[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],Hfe=new Array(64);for(var t=0;t<64;++t)Hfe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);i3n=!0}a(fCs,"_init");function r3n(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+Hfe[f]+e[f],d=tPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+Hfe[f]+e[Hit[f]],d=tPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+Hfe[f]+e[Hit[f]],d=tPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+Hfe[f]+e[Hit[f]],d=tPe[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(r3n,"_update")});var fZ=I((oif,a3n)=>{p();var Vit=As();cc();var s3n=a3n.exports=Vit.pem=Vit.pem||{};s3n.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+=$it(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=$it(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=$it(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(Uit,"foldHeader");function Zvs(t){return t.replace(/^\s+/,"")}a(Zvs,"ltrim")});var Xke=I((jnf,i3n)=>{p();var $d=As();Pit();srr();ac();i3n.exports=$d.des=$d.des||{};$d.des.startEncrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createEncryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!1,mode:e})};$d.des.startDecrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createDecryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!0,mode:e})};$d.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return n3n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return n3n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};$d.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=$d.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=aCs(e),this._init=!0}};v5("DES-ECB",$d.cipher.modes.ecb);v5("DES-CBC",$d.cipher.modes.cbc);v5("DES-CFB",$d.cipher.modes.cfb);v5("DES-OFB",$d.cipher.modes.ofb);v5("DES-CTR",$d.cipher.modes.ctr);v5("3DES-ECB",$d.cipher.modes.ecb);v5("3DES-CBC",$d.cipher.modes.cbc);v5("3DES-CFB",$d.cipher.modes.cfb);v5("3DES-OFB",$d.cipher.modes.ofb);v5("3DES-CTR",$d.cipher.modes.ctr);function v5(t,e){var r=a(function(){return new $d.des.Algorithm(t,e)},"factory");$d.cipher.registerAlgorithm(t,r)}a(v5,"registerAlgorithm");var Xvs=[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],eCs=[-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],tCs=[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],rCs=[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],nCs=[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],iCs=[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],oCs=[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],sCs=[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 aCs(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(aCs,"_createKeys");function n3n(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^(eCs[g>>>24&63]|rCs[g>>>16&63]|iCs[g>>>8&63]|sCs[g&63]|Xvs[A>>>24&63]|tCs[A>>>16&63]|nCs[A>>>8&63]|oCs[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(n3n,"_updateBlock");function qit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=$d.cipher.createDecipher(r,t.key):n=$d.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof $d.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(qit,"_createCipher")});var jit=I(($nf,o3n)=>{p();var sv=As();qfe();E5();ac();var cCs=sv.pkcs5=sv.pkcs5||{},UF;sv.util.isNodejs&&!sv.options.usePureJavaScript&&(UF=require("crypto"));o3n.exports=sv.pbkdf2=cCs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),sv.util.isNodejs&&!sv.options.usePureJavaScript&&UF.pbkdf2&&(o===null||typeof o!="object")&&(UF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?UF.pbkdf2Sync.length===4?UF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):UF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):UF.pbkdf2Sync.length===4?UF.pbkdf2Sync(t,e,r,n).toString("binary"):UF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in sv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=sv.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=sv.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(sv.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=sv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(sv.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=sv.util.xorBytes(m,g,c),A=g,++E,sv.util.setImmediate(v);h+=y{p();var C5=As();E5();ac();var a3n=u3n.exports=C5.sha256=C5.sha256||{};C5.md.sha256=C5.md.algorithms.sha256=a3n;a3n.create=function(){c3n||lCs();var t=null,e=C5.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),s3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=C5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(frr.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};s3n(h,r,o);var m=C5.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 frr=null,c3n=!1,l3n=null;function lCs(){frr="\x80",frr+=C5.util.fillString("\0",64),l3n=[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],c3n=!0}a(lCs,"_init");function s3n(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+l3n[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(s3n,"_update")});var hrr=I((Jnf,d3n)=>{p();var b5=As();ac();var Hit=null;b5.util.isNodejs&&!b5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Hit=require("crypto"));var uCs=d3n.exports=b5.prng=b5.prng||{};uCs.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=b5.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 b5.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)),b5.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=b5.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=b5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=b5.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"),Hit?(e.seedFile=function(d,f){Hit.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Hit.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 xw=I((eif,mrr)=>{p();var Pg=As();Tj();prr();hrr();ac();(function(){if(Pg.random&&Pg.random.getBytes){mrr.exports=Pg.random;return}(function(t){var e={},r=new Array(4),n=Pg.util.createBuffer();e.formatKey=function(h){var m=Pg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),Pg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=Pg.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 Pg.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=Pg.md.sha256;function o(){var h=Pg.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=Pg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),Pg.options.usePureJavaScript||!Pg.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(!Pg.random)Pg.random=s;else for(var f in s)Pg.random[f]=s[f];Pg.random.createInstance=o,mrr.exports=Pg.random})(typeof jQuery<"u"?jQuery:null)})()});var Arr=I((nif,h3n)=>{p();var lb=As();ac();var grr=[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],f3n=[1,2,3,5],dCs=a(function(t,e){return t<>16-e},"rol"),fCs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");h3n.exports=lb.rc2=lb.rc2||{};lb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lb.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(grr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,grr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,grr[r.at(l+1)^r.at(l+s)]);return r};var p3n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=lb.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]=dCs(A[d],f3n[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]=fCs(A[d],f3n[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");lb.rc2.startEncrypting=function(t,e,r){var n=lb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createEncryptionCipher=function(t,e){return p3n(t,e,!0)};lb.rc2.startDecrypting=function(t,e,r){var n=lb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createDecryptionCipher=function(t,e){return p3n(t,e,!1)}});var tPe=I((sif,C3n)=>{p();var yrr=As();C3n.exports=yrr.jsbn=yrr.jsbn||{};var QF,pCs=0xdeadbeefcafe,m3n=(pCs&16777215)==15715070;function zt(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(zt,"BigInteger");yrr.jsbn.BigInteger=zt;function Va(){return new zt(null)}a(Va,"nbi");function hCs(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(hCs,"am1");function mCs(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(mCs,"am2");function g3n(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(g3n,"am3");typeof navigator>"u"?(zt.prototype.am=g3n,QF=28):m3n&&navigator.appName=="Microsoft Internet Explorer"?(zt.prototype.am=mCs,QF=30):m3n&&navigator.appName!="Netscape"?(zt.prototype.am=hCs,QF=26):(zt.prototype.am=g3n,QF=28);zt.prototype.DB=QF;zt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(ACs,"bnpCopyTo");function yCs(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(yCs,"bnpFromInt");function xj(t){var e=Va();return e.fromInt(t),e}a(xj,"nbv");function ECs(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:y3n(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(_Cs,"bnpClamp");function vCs(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=A3n(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+=A3n(n));return o?s:"0"}a(vCs,"bnToString");function CCs(){var t=Va();return zt.ZERO.subTo(this,t),t}a(CCs,"bnNegate");function bCs(){return this.s<0?this.negate():this}a(bCs,"bnAbs");function SCs(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(SCs,"bnCompareTo");function $it(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($it,"nbits");function TCs(){return this.t<=0?0:this.DB*(this.t-1)+$it(this.data[this.t-1]^this.s&this.DM)}a(TCs,"bnBitLength");function ICs(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(ICs,"bnpDLShiftTo");function xCs(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(wCs,"bnpLShiftTo");function RCs(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(kCs,"bnpSubTo");function PCs(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(DCs,"bnpSquareTo");function NCs(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)),zt.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&&zt.ZERO.subTo(r,r)}}}a(NCs,"bnpDivRemTo");function MCs(t){var e=Va();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(zt.ZERO)>0&&t.subTo(e,e),e}a(MCs,"bnMod");function dZ(t){this.m=t}a(dZ,"Classic");function OCs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(OCs,"cConvert");function LCs(t){return t}a(LCs,"cRevert");function BCs(t){t.divRemTo(this.m,null,t)}a(BCs,"cReduce");function FCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(FCs,"cMulTo");function UCs(t,e){t.squareTo(e),this.reduce(e)}a(UCs,"cSqrTo");dZ.prototype.convert=OCs;dZ.prototype.revert=LCs;dZ.prototype.reduce=BCs;dZ.prototype.mulTo=FCs;dZ.prototype.sqrTo=UCs;function QCs(){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(QCs,"bnpInvDigit");function fZ(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(qCs,"montConvert");function jCs(t){var e=Va();return t.copyTo(e),this.reduce(e),e}a(jCs,"montRevert");function HCs(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(HCs,"montReduce");function GCs(t,e){t.squareTo(e),this.reduce(e)}a(GCs,"montSqrTo");function $Cs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a($Cs,"montMulTo");fZ.prototype.convert=qCs;fZ.prototype.revert=jCs;fZ.prototype.reduce=HCs;fZ.prototype.mulTo=$Cs;fZ.prototype.sqrTo=GCs;function VCs(){return(this.t>0?this.data[0]&1:this.s)==0}a(VCs,"bnpIsEven");function WCs(t,e){if(t>4294967295||t<1)return zt.ONE;var r=Va(),n=Va(),o=e.convert(this),s=$it(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(WCs,"bnpExp");function zCs(t,e){var r;return t<256||e.isEven()?r=new dZ(e):r=new fZ(e),this.exp(t,r)}a(zCs,"bnModPowInt");zt.prototype.copyTo=ACs;zt.prototype.fromInt=yCs;zt.prototype.fromString=ECs;zt.prototype.clamp=_Cs;zt.prototype.dlShiftTo=ICs;zt.prototype.drShiftTo=xCs;zt.prototype.lShiftTo=wCs;zt.prototype.rShiftTo=RCs;zt.prototype.subTo=kCs;zt.prototype.multiplyTo=PCs;zt.prototype.squareTo=DCs;zt.prototype.divRemTo=NCs;zt.prototype.invDigit=QCs;zt.prototype.isEven=VCs;zt.prototype.exp=WCs;zt.prototype.toString=vCs;zt.prototype.negate=CCs;zt.prototype.abs=bCs;zt.prototype.compareTo=SCs;zt.prototype.bitLength=TCs;zt.prototype.mod=MCs;zt.prototype.modPowInt=zCs;zt.ZERO=xj(0);zt.ONE=xj(1);function YCs(){var t=Va();return this.copyTo(t),t}a(YCs,"bnClone");function KCs(){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(JCs,"bnByteValue");function ZCs(){return this.t==0?this.s:this.data[0]<<16>>16}a(ZCs,"bnShortValue");function XCs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(XCs,"bnpChunkSize");function ebs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(ebs,"bnSigNum");function tbs(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=xj(r),o=Va(),s=Va(),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(tbs,"bnpToRadix");function rbs(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&&zt.ZERO.subTo(this,this)}a(rbs,"bnpFromRadix");function nbs(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(zt.ONE.shiftLeft(t-1),_rr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(zt.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(ibs,"bnToByteArray");function obs(t){return this.compareTo(t)==0}a(obs,"bnEquals");function sbs(t){return this.compareTo(t)<0?this:t}a(sbs,"bnMin");function abs(t){return this.compareTo(t)>0?this:t}a(abs,"bnMax");function cbs(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(Abs,"lbit");function ybs(){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(Ibs,"bnpAddTo");function xbs(t){var e=Va();return this.addTo(t,e),e}a(xbs,"bnAdd");function wbs(t){var e=Va();return this.subTo(t,e),e}a(wbs,"bnSubtract");function Rbs(t){var e=Va();return this.multiplyTo(t,e),e}a(Rbs,"bnMultiply");function kbs(){var t=Va();return this.squareTo(t),t}a(kbs,"bnSquare");function Pbs(t){var e=Va();return this.divRemTo(t,e,null),e}a(Pbs,"bnDivide");function Dbs(t){var e=Va();return this.divRemTo(t,null,e),e}a(Dbs,"bnRemainder");function Nbs(t){var e=Va(),r=Va();return this.divRemTo(t,e,r),new Array(e,r)}a(Nbs,"bnDivideAndRemainder");function Mbs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Mbs,"bnpDMultiply");function Obs(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(Obs,"bnpDAddOffset");function ePe(){}a(ePe,"NullExp");function v3n(t){return t}a(v3n,"nNop");function Lbs(t,e,r){t.multiplyTo(e,r)}a(Lbs,"nMulTo");function Bbs(t,e){t.squareTo(e)}a(Bbs,"nSqrTo");ePe.prototype.convert=v3n;ePe.prototype.revert=v3n;ePe.prototype.mulTo=Lbs;ePe.prototype.sqrTo=Bbs;function Fbs(t){return this.exp(t,new ePe)}a(Fbs,"bnPow");function Ubs(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=Va();return t.copyTo(e),this.reduce(e),e}a(qbs,"barrettConvert");function jbs(t){return t}a(jbs,"barrettRevert");function Hbs(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(Hbs,"barrettReduce");function Gbs(t,e){t.squareTo(e),this.reduce(e)}a(Gbs,"barrettSqrTo");function $bs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a($bs,"barrettMulTo");Gfe.prototype.convert=qbs;Gfe.prototype.revert=jbs;Gfe.prototype.reduce=Hbs;Gfe.prototype.mulTo=$bs;Gfe.prototype.sqrTo=Gbs;function Vbs(t,e){var r=t.bitLength(),n,o=xj(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 dZ(e):e.isEven()?s=new Gfe(e):s=new fZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Va();for(s.sqrTo(c[1],f);l<=d;)c[l]=Va(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Va(),y;for(r=$it(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(Wbs,"bnGCD");function zbs(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(zbs,"bnpModInt");function Ybs(t){if(this.signum()==0)return zt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return zt.ZERO;for(var r=t.clone(),n=this.clone(),o=xj(1),s=xj(0),c=xj(0),l=xj(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(zt.ONE)!=0)return zt.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(Ybs,"bnModInverse");var C2=[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],Kbs=(1<<26)/C2[C2.length-1];function Jbs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=C2[C2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(zt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var S5=As();E5();ac();var S3n=I3n.exports=S5.sha1=S5.sha1||{};S5.md.sha1=S5.md.algorithms.sha1=S3n;S3n.create=function(){T3n||e1s();var t=null,e=S5.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),b3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=S5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(vrr.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};b3n(h,r,o);var m=S5.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 vrr=null,T3n=!1;function e1s(){vrr="\x80",vrr+=S5.util.fillString("\0",64),T3n=!0}a(e1s,"_init");function b3n(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(b3n,"_update")});var Crr=I((fif,w3n)=>{p();var T5=As();ac();xw();$fe();var x3n=w3n.exports=T5.pkcs1=T5.pkcs1||{};x3n.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=T5.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(Vit,"rsa_mgf1")});var Srr=I((mif,brr)=>{p();var wj=As();ac();tPe();xw();(function(){if(wj.prime){brr.exports=wj.prime;return}var t=brr.exports=wj.prime=wj.prime||{},e=wj.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||wj.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 wj.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 rPe=I((yif,O3n)=>{p();var Ci=As();v2();tPe();Ij();Crr();Srr();xw();ac();typeof Wa>"u"&&(Wa=Ci.jsbn.BigInteger);var Wa,Trr=Ci.util.isNodejs?require("crypto"):null,pt=Ci.asn1,Rw=Ci.util;Ci.pki=Ci.pki||{};O3n.exports=Ci.pki.rsa=Ci.rsa=Ci.rsa||{};var qo=Ci.pki,t1s=[6,4,2,4,2,4,6,2],r1s={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"}]},n1s={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"}]},i1s={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"}]},o1s=Ci.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"}]}]},s1s={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"}]},a1s=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=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"),N3n=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(Wa.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Wa.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Wa(Ci.util.bytesToHex(Ci.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Wa.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=M3n(t,e,r)):(o=Ci.util.createBuffer(),o.putBytes(t));for(var c=new Wa(o.toHex(),16),l=N3n(c,e,n),u=l.toString(16),d=Ci.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.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 Wa(Ci.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=N3n(c,e,r),u=l.toString(16),d=Ci.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),n!==!1?Wit(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||Ci.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 Wa(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(l1s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(t1s[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.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(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Wa.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),!Ci.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(R3n("generateKeyPair"))return Trr.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(k3n("generateKey")&&k3n("exportKey"))return Rw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:D3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return Rw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=qo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(l)));n(null,{privateKey:u,publicKey:qo.setRsaPublicKey(u.n,u.e)})}});if(P3n("generateKey")&&P3n("exportKey")){var o=Rw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:D3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=Rw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=qo.privateKeyFromAsn1(pt.fromDer(Ci.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(R3n("generateKeyPairSync")){var s=Trr.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;c1s(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 M3n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ci.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=Wit(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,s1s,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===Ci.oids.md2||A===Ci.oids.md5||A===Ci.oids.sha1||A===Ci.oids.sha224||A===Ci.oids.sha256||A===Ci.oids.sha384||A===Ci.oids.sha512||A===Ci.oids["sha512-224"]||A===Ci.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ci.oids.md2||A===Ci.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=Wit(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:Wit};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ci.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:a1s},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 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(qo.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())])};qo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,r1s,e,r)&&(t=pt.fromDer(Ci.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,n1s,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=Ci.util.createBuffer(e.privateKeyModulus).toHex(),s=Ci.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ci.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ci.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ci.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ci.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ci.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ci.util.createBuffer(e.privateKeyCoefficient).toHex(),qo.setRsaPrivateKey(new Wa(o,16),new Wa(s,16),new Wa(c,16),new Wa(l,16),new Wa(u,16),new Wa(d,16),new Wa(f,16),new Wa(h,16))};qo.privateKeyToAsn1=qo.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,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.qInv))])};qo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,o1s,e,r)){var n=pt.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=[],!pt.validate(t,i1s,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=Ci.util.createBuffer(e.publicKeyModulus).toHex(),c=Ci.util.createBuffer(e.publicKeyExponent).toHex();return qo.setRsaPublicKey(new Wa(s,16),new Wa(c,16))};qo.publicKeyToAsn1=qo.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(qo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[qo.publicKeyToRSAPublicKey(t)])])};qo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e))])};function M3n(t,e,r){var n=Ci.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=Ci.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(Wit,"_decodePkcs1_v1_5");function c1s(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){Ci.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(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Wa.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(c1s,"_generateKeyPair");function I5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ci.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(I5,"_bnToBytes");function l1s(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(l1s,"_getMillerRabinTests");function R3n(t){return Ci.util.isNodejs&&typeof Trr[t]=="function"}a(R3n,"_detectNodeCrypto");function k3n(t){return typeof Rw.globalScope<"u"&&typeof Rw.globalScope.crypto=="object"&&typeof Rw.globalScope.crypto.subtle=="object"&&typeof Rw.globalScope.crypto.subtle[t]=="function"}a(k3n,"_detectSubtleCrypto");function P3n(t){return typeof Rw.globalScope<"u"&&typeof Rw.globalScope.msCrypto=="object"&&typeof Rw.globalScope.msCrypto.subtle=="object"&&typeof Rw.globalScope.msCrypto.subtle[t]=="function"}a(P3n,"_detectSubtleMsCrypto");function D3n(t){for(var e=Ci.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var _n=As();Tj();v2();Xke();E5();Ij();jit();uZ();xw();Arr();rPe();ac();typeof L3n>"u"&&(L3n=_n.jsbn.BigInteger);var L3n,Nt=_n.asn1,as=_n.pki=_n.pki||{};Q3n.exports=as.pbe=_n.pbe=_n.pbe||{};var pZ=as.oids,u1s={name:"EncryptedPrivateKeyInfo",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},d1s={name:"PBES2Algorithms",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f1s={name:"pkcs-12PbeParams",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"iterations"}]};as.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=_n.random.getBytesSync(r.saltSize),o=r.count,s=Nt.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=pZ["aes128-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=pZ["aes192-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=pZ["aes256-CBC"],h=_n.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=pZ.desCBC,h=_n.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=U3n(g),y=_n.pkcs5.pbkdf2(e,n,o,c,A),E=_n.random.getBytesSync(d),_=h(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes();var v=p1s(n,s,c,g);l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBES2).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBKDF2).getBytes()),v]),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(f).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new _n.util.ByteBuffer(n),y=as.pbe.generatePkcs12Key(e,b,1,o,c),E=as.pbe.generatePkcs12Key(e,b,2,o,c),_=_n.des.createEncryptionCipher(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,n),Nt.create(Nt.Class.UNIVERSAL,Nt.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=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[l,Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,u)]);return T};as.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Nt.validate(t,u1s,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=Nt.derToOid(n.encryptionOid),l=as.pbe.getCipher(c,n.encryptionParams,e),u=_n.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Nt.fromDer(l.output)),r};as.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Nt.toDer(t).getBytes()};return _n.pem.encode(r,{maxline:e})};as.encryptedPrivateKeyFromPem=function(t){var e=_n.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 Nt.fromDer(e.body)};as.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=as.wrapRsaPrivateKey(as.privateKeyToAsn1(t));return n=as.encryptPrivateKeyInfo(n,e,r),as.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=_n.random.getBytesSync(8),l=_n.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=_n.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Nt.toDer(as.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:_n.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return _n.pem.encode(h)};as.decryptRsaPrivateKey=function(t,e){var r=null,n=_n.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=_n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=_n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=_n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=_n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=_n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return _n.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return _n.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return _n.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=_n.util.hexToBytes(n.dekInfo.parameters),u=_n.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(_n.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=as.decryptPrivateKeyInfo(Nt.fromDer(r),e):r=Nt.fromDer(r),r!==null&&(r=as.privateKeyFromAsn1(r)),r};as.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in _n.md))throw new Error('"sha1" hash algorithm unavailable.');s=_n.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new _n.util.ByteBuffer,h=new _n.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=P.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};as.pbe.getCipher=function(t,e,r){switch(t){case as.oids.pkcs5PBES2:return as.pbe.getCipherForPBES2(t,e,r);case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case as.oids["pbewithSHAAnd40BitRC2-CBC"]:return as.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}};as.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Nt.validate(e,d1s,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=Nt.derToOid(n.kdfOid),t!==as.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=Nt.derToOid(n.encOid),t!==as.oids["aes128-CBC"]&&t!==as.oids["aes192-CBC"]&&t!==as.oids["aes256-CBC"]&&t!==as.oids["des-EDE3-CBC"]&&t!==as.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=_n.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(as.oids[t]){case"aes128-CBC":u=16,d=_n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=_n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=_n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=_n.des.createDecryptionCipher;break;case"desCBC":u=8,d=_n.des.createDecryptionCipher;break}var f=F3n(n.prfOid),h=_n.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};as.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Nt.validate(e,f1s,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=_n.util.createBuffer(n.salt),l=_n.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=_n.des.startDecrypting;break;case as.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=_n.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=F3n(n.prfOid),m=as.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=as.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};as.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in _n.md))throw new Error('"md5" hash algorithm unavailable.');n=_n.md.md5.create()}e===null&&(e="");for(var o=[B3n(n,t+e)],s=16,c=1;s{p();var Vfe=As();v2();ac();var fn=Vfe.asn1,Wfe=H3n.exports=Vfe.pkcs7asn1=Vfe.pkcs7asn1||{};Vfe.pkcs7=Vfe.pkcs7||{};Vfe.pkcs7.asn1=Wfe;var q3n={name:"ContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Wfe.contentInfoValidator=q3n;var j3n={name:"EncryptedContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Wfe.envelopedDataValidator={name:"EnvelopedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(j3n)};Wfe.encryptedDataValidator={name:"EncryptedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"}].concat(j3n)};var h1s={name:"SignerInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Wfe.signedDataValidator={name:"SignedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},q3n,{name:"SignedData.Certificates",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,capture:"signerInfos",optional:!0,value:[h1s]}]};Wfe.recipientInfoValidator={name:"RecipientInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var wrr=I((Iif,G3n)=>{p();var hZ=As();ac();hZ.mgf=hZ.mgf||{};var m1s=G3n.exports=hZ.mgf.mgf1=hZ.mgf1=hZ.mgf1||{};m1s.create=function(t){var e={generate:a(function(r,n){for(var o=new hZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var zit=As();wrr();$3n.exports=zit.mgf=zit.mgf||{};zit.mgf.mgf1=zit.mgf1});var Yit=I((Pif,W3n)=>{p();var mZ=As();xw();ac();var g1s=W3n.exports=mZ.pss=mZ.pss||{};g1s.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=mZ.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||mZ.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 bi=As();Tj();v2();Xke();E5();V3n();Ij();uZ();Yit();rPe();ac();var Ae=bi.asn1,Dr=Z3n.exports=bi.pki=bi.pki||{},za=Dr.oids,fp={};fp.CN=za.commonName;fp.commonName="CN";fp.C=za.countryName;fp.countryName="C";fp.L=za.localityName;fp.localityName="L";fp.ST=za.stateOrProvinceName;fp.stateOrProvinceName="ST";fp.O=za.organizationName;fp.organizationName="O";fp.OU=za.organizationalUnitName;fp.organizationalUnitName="OU";fp.E=za.emailAddress;fp.emailAddress="E";var Y3n=bi.pki.rsa.publicKeyValidator,A1s={name:"Certificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},Y3n,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},y1s={name:"rsapss",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},E1s={name:"CertificationRequestInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},Y3n,{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SET,constructed:!0}]}]}]},_1s={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[E1s,{name:"CertificationRequest.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Dr.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=Jit({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=bi.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Rj(c.issuer,A)},c.issuer.addField=function(A){kw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Dr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=bi.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Rj(c.subject,A)},c.subject.addField=function(A){kw([A]),c.subject.attributes.push(A)},c.subject.attributes=Dr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Dr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Dr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Dr.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=Ae.fromDer(e.value);r.value.length>0&&r.value[0].type===Ae.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===Ae.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=Ae.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=Ae.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=Ae.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Dr.oids?e.name=Dr.oids[e.type]:e.shortName&&e.shortName in fp&&(e.name=Dr.oids[fp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Dr.oids)e.type=Dr.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 fp&&(e.shortName=fp[e.name]),e.type===za.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=Ae.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(kw,"_fillMissingFields");function J3n(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Dr.oids&&(t.name=Dr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Dr.oids)t.id=Dr.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=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in za?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(za[u]).getBytes())):u.indexOf(".")!==-1&&l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.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=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[Ae.create(Ae.Class.CONTEXT_SPECIFIC,4,!0,[zfe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=bi.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),E=Ae.create(Ae.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(J3n,"_fillMissingExtensionFields");function Rrr(t,e){if(t===za["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(e.saltLength).getBytes())])),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,r)}else return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")}a(Rrr,"_signatureParametersToAsn1");function v1s(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=C1s&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.getCertificationRequestInfo=function(t){var e=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.version).getBytes()),zfe(t.subject),Dr.publicKeyToAsn1(t.publicKey),v1s(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return zfe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.getTBSCertificate(t);return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[e,Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(t.signatureOid).getBytes()),Rrr(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.certificateExtensionsToAsn1=function(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Ae.create(Ae.Class.UNIVERSAL,Ae.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:Dr.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;bi.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:Dr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Dr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Dr.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:Dr.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:Dr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!bi.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 Prr=I((Lif,eFn)=>{p();var xu=As();v2();qfe();Ij();xrr();Irr();xw();rPe();$fe();ac();Zit();var Ke=xu.asn1,ea=xu.pki,iPe=eFn.exports=xu.pkcs12=xu.pkcs12||{},X3n={name:"ContentInfo",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},S1s={name:"PFX",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,capture:"version"},X3n,{name:"PFX.macData",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ke.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},T1s={name:"SafeBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},I1s={name:"Attribute",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,capture:"values"}]},x1s={name:"CertBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ke.Class.UNIVERSAL,type:Ke.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function nPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(nPe,"_getBagsByAttribute");iPe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ke.validate(t,S1s,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=xu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=nPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=nPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=nPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return nPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return nPe(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(Ke.derToOid(n.contentType)!==ea.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ke.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ke.Class.UNIVERSAL||l.type!==Ke.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=krr(l),n.mac){var u=null,d=0,f=Ke.derToOid(n.macAlgorithm);switch(f){case ea.oids.sha1:u=xu.md.sha1.create(),d=20;break;case ea.oids.sha256:u=xu.md.sha256.create(),d=32;break;case ea.oids.sha384:u=xu.md.sha384.create(),d=48;break;case ea.oids.sha512:u=xu.md.sha512.create(),d=64;break;case ea.oids.md5:u=xu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new xu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(xu.util.bytesToHex(n.macIterations),16):1,g=iPe.generateKey(r,h,3,m,d,u),A=xu.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 w1s(c,l.value,e,r),c};function krr(t){if(t.composed||t.constructed){for(var e=xu.util.createBuffer(),r=0;r0&&(s=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SET,!0,u));var d=[],f=[];e!==null&&(xu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,h),_=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=ea.wrapRsaPrivateKey(ea.privateKeyToAsn1(t));r===null?v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.keyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.pkcs8ShroudedKeyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[ea.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[v]),w=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(T).getBytes())])]);d.push(w)}var R=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=xu.md.sha1.create(),P=new xu.util.ByteBuffer(xu.random.getBytes(n.saltSize)),D=n.count,t=iPe.generateKey(r,P,3,D,20),N=xu.hmac.create();N.start(l,t),N.update(Ke.toDer(R).getBytes());var L=N.getMac();x=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.sha1).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.NULL,!1,"")]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,L.getBytes())]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,P.getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(D).getBytes())])}return Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(3).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(R).getBytes())])]),x])};iPe.generateKey=xu.pbe.generatePkcs12Key});var Nrr=I((Uif,tFn)=>{p();var kj=As();v2();Ij();Irr();uZ();jit();Prr();Yit();rPe();ac();Zit();var Drr=kj.asn1,Yfe=tFn.exports=kj.pki=kj.pki||{};Yfe.pemToDer=function(t){var e=kj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return kj.util.createBuffer(e.body)};Yfe.privateKeyFromPem=function(t){var e=kj.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=Drr.fromDer(e.body);return Yfe.privateKeyFromAsn1(n)};Yfe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Drr.toDer(Yfe.privateKeyToAsn1(t)).getBytes()};return kj.pem.encode(r,{maxline:e})};Yfe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Drr.toDer(t).getBytes()};return kj.pem.encode(r,{maxline:e})}});var Urr=I((qif,lFn)=>{p();var Jt=As();v2();qfe();Fit();uZ();Nrr();xw();$fe();ac();var rot=a(function(t,e,r,n){var o=Jt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Jt.util.createBuffer(),f=Jt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Jt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(_e.queue(t,_e.createAlert(t,{level:_e.Alert.Level.warning,description:_e.Alert.Description.no_renegotiation})),_e.flush(t)),t.process()};_e.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Jt.util.createBuffer(s.getBytes(32)),session_id:mT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=mT(s,2),n.compression_methods=mT(s,1)),c=r-(c-s.length()),c>0){for(var l=mT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:mT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(mT(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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=_e.getCipherSuite(n.cipher_suite);else for(var m=Jt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure},cipherSuite:Jt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=_e.CompressionMethod.none}return n};_e.createSecurityParameters=function(t,e){var r=t.entity===_e.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:_e.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:_e.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}};_e.handleServerHello=function(t,e,r){var n=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=iFn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=L1s,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.session.id=o,t.process()}};_e.handleClientHello=function(t,e,r){var n=_e.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=Jt.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;l<_e.SupportedVersions.length&&(c=_e.SupportedVersions[l],!(c.minor<=n.version.minor));++l);t.version={major:c.major,minor:c.minor},t.session.version=t.version}s!==null?(t.expect=Brr,t.session.resuming=!0,t.session.sp.client_random=n.random.bytes()):(t.expect=t.verifyClient!==!1?H1s:Lrr,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.open=!0,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHello(t)})),t.session.resuming?(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.pending=_e.createConnectionState(t),t.state.current.write=t.state.pending.write,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))):(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)})),t.fail||(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerKeyExchange(t)})),t.verifyClient!==!1&&_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificateRequest(t)})),_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHelloDone(t)})))),_e.flush(t),t.process()}};_e.handleCertificate=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_list:mT(n,3)},s,c,l=[];try{for(;o.certificate_list.length()>0;)s=mT(o.certificate_list,3),c=Jt.asn1.fromDer(s),s=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_certificate}})}var u=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?rFn:Lrr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],_e.verifyCertificateChain(t,l)&&(t.expect=u?rFn:Lrr)),t.process()};_e.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});t.expect=B1s,t.process()};_e.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:mT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Jt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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=Jt.random.getBytes(48)}t.expect=Brr,t.session.clientCertificate!==null&&(t.expect=G1s),t.process()};_e.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:mT(n,1),certificate_authorities:mT(n,2)};t.session.certificateRequest=o,t.expect=F1s,t.process()};_e.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:mT(n,2).getBytes()},c=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure}})}t.expect=Brr,t.process()};_e.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Jt.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=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)}),_e.queue(t,e)),e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createClientKeyExchange(t)}),_e.queue(t,e),t.expect=q1s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createCertificateVerify(l,u)})),_e.queue(l,_e.createRecord(l,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),l.state.pending=_e.createConnectionState(l),l.state.current.write=l.state.pending.write,_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createFinished(l)})),l.expect=iFn,_e.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);_e.getClientSignature(t,c)};_e.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var r=t.entity===_e.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=_e.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?U1s:$1s,t.process()};_e.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=Jt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===_e.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=rot;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:_e.Alert.Level.fatal,description:_e.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))),t.expect=c?Q1s:V1s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,_e.flush(t),t.isConnected=!0,t.connected(t),t.process()};_e.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case _e.Alert.Description.close_notify:o="Connection closed.";break;case _e.Alert.Description.unexpected_message:o="Unexpected message.";break;case _e.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case _e.Alert.Description.decryption_failed:o="Decryption failed.";break;case _e.Alert.Description.record_overflow:o="Record overflow.";break;case _e.Alert.Description.decompression_failure:o="Decompression failed.";break;case _e.Alert.Description.handshake_failure:o="Handshake failure.";break;case _e.Alert.Description.bad_certificate:o="Bad certificate.";break;case _e.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case _e.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case _e.Alert.Description.certificate_expired:o="Certificate expired.";break;case _e.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case _e.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case _e.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case _e.Alert.Description.access_denied:o="Access denied.";break;case _e.Alert.Description.decode_error:o="Decode error.";break;case _e.Alert.Description.decrypt_error:o="Decrypt error.";break;case _e.Alert.Description.export_restriction:o="Export restriction.";break;case _e.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case _e.Alert.Description.insufficient_security:o="Insufficient security.";break;case _e.Alert.Description.internal_error:o="Internal error.";break;case _e.Alert.Description.user_canceled:o="User canceled.";break;case _e.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===_e.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===_e.ConnectionEnd.client?"server":"client",alert:n}),t.process()};_e.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Jt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in tot[t.entity][t.expect]?(t.entity===_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()}),n!==_e.HandshakeType.hello_request&&n!==_e.HandshakeType.certificate_verify&&n!==_e.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),tot[t.entity][t.expect][n](t,e,o)):_e.handleUnexpected(t,e)};_e.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};_e.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===_e.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();_e.queue(t,_e.createRecord(t,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_response,s)})),_e.flush(t)}else if(n===_e.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Jt.util.createBuffer(s))}t.process()};var O1s=0,L1s=1,rFn=2,B1s=3,F1s=4,iFn=5,U1s=6,Q1s=7,q1s=8,j1s=0,H1s=1,Lrr=2,G1s=3,Brr=4,$1s=5,V1s=6,Ee=_e.handleUnexpected,oFn=_e.handleChangeCipherSpec,jA=_e.handleAlert,av=_e.handleHandshake,sFn=_e.handleApplicationData,HA=_e.handleHeartbeat,Frr=[];Frr[_e.ConnectionEnd.client]=[[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[oFn,jA,Ee,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,sFn,HA],[Ee,jA,av,Ee,HA]];Frr[_e.ConnectionEnd.server]=[[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[oFn,jA,Ee,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,sFn,HA],[Ee,jA,av,Ee,HA]];var Pj=_e.handleHelloRequest,W1s=_e.handleServerHello,aFn=_e.handleCertificate,nFn=_e.handleServerKeyExchange,Mrr=_e.handleCertificateRequest,Xit=_e.handleServerHelloDone,cFn=_e.handleFinished,tot=[];tot[_e.ConnectionEnd.client]=[[Ee,Ee,W1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,aFn,nFn,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,nFn,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];var z1s=_e.handleClientHello,Y1s=_e.handleClientKeyExchange,K1s=_e.handleCertificateVerify;tot[_e.ConnectionEnd.server]=[[Ee,z1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,aFn,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Y1s,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,K1s,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];_e.generateKeys=function(t,e){var r=rot,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===_e.Versions.TLS_1_0.major&&t.version.minor===_e.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};_e.createConnectionState=function(t){var e=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=_e.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 _e.CompressionMethod.none:break;case _e.CompressionMethod.deflate:n.read.compressFunction=M1s,n.write.compressFunction=N1s;break;default:throw new Error("Unsupported compression algorithm.")}}return n};_e.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Jt.util.createBuffer();return r.putInt32(e),r.putBytes(Jt.random.getBytes(28)),r};_e.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};_e.createAlert=function(t,e){var r=Jt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),_e.createRecord(t,{type:_e.ContentType.alert,data:r})};_e.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Jt.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=Jt.util.createBuffer();return A.putByte(_e.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Pw(A,1,Jt.util.createBuffer(m)),Pw(A,2,e),Pw(A,1,s),h>0&&Pw(A,2,l),A};_e.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Pw(n,1,Jt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};_e.createCertificate=function(t){var e=t.entity===_e.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=Jt.util.createBuffer();if(r!==null)try{Jt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(_e.HandshakeType.server_key_exchange),r.putInt24(e)),r};_e.getClientSignature=function(t,e){var r=Jt.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=Jt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};_e.createCertificateVerify=function(t,e){var r=e.length+2,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};_e.createCertificateRequest=function(t){var e=Jt.util.createBuffer();e.putByte(1);var r=Jt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Jt.pki.distinguishedNameToAsn1(o.subject),c=Jt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Jt.util.createBuffer();return u.putByte(_e.HandshakeType.certificate_request),u.putInt24(l),Pw(u,1,e),Pw(u,2,r),u};_e.createServerHelloDone=function(t){var e=Jt.util.createBuffer();return e.putByte(_e.HandshakeType.server_hello_done),e.putInt24(0),e};_e.createChangeCipherSpec=function(){var t=Jt.util.createBuffer();return t.putByte(1),t};_e.createFinished=function(t){var e=Jt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===_e.ConnectionEnd.client,n=t.session.sp,o=12,s=rot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Jt.util.createBuffer();return l.putByte(_e.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};_e.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Jt.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(Jt.random.getBytes(s)),n};_e.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===_e.ContentType.handshake||e.type===_e.ContentType.alert||e.type===_e.ContentType.change_cipher_spec))){if(e.type===_e.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()<=_e.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>_e.MaxFragment;)n.push(_e.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o.slice(0,_e.MaxFragment))})),o=o.slice(_e.MaxFragment);o.length>0&&n.push(_e.createRecord(t,{type:e.type,data:Jt.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=Jt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};_e.createConnection=function(t){var e=null;t.caStore?Jt.util.isArray(t.caStore)?e=Jt.pki.createCaStore(t.caStore):e=t.caStore:e=Jt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in _e.CipherSuites)r.push(_e.CipherSuites[n])}var o=t.server?_e.ConnectionEnd.server:_e.ConnectionEnd.client,s=t.sessionCache?_e.createSessionCache(t.sessionCache):null,c={version:{major:_e.Version.major,minor:_e.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:Jt.util.createBuffer(),tlsData:Jt.util.createBuffer(),data:Jt.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===_e.ConnectionEnd.client?"client":"server"),h.send&&(_e.queue(f,_e.createAlert(f,h.alert)),_e.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:_e.Version.major,minor:_e.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===_e.ConnectionEnd.client?O1s:j1s,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=_e.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-_e.ContentType.change_cipher_spec,g=Frr[f.entity][f.expect];m in g?g[m](f,h):_e.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:Jt.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:_e.Alert.Level.fatal,description:_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=_e.createRandom().getBytes(),c.open=!0,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.handshake,data:_e.createClientHello(c)})),_e.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 _e.queue(c,_e.createRecord(c,{type:_e.ContentType.application_data,data:Jt.util.createBuffer(f)})),_e.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Jt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_request,f,h)})),_e.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,_e.queue(c,_e.createAlert(c,{level:_e.Alert.Level.warning,description:_e.Alert.Description.close_notify})),_e.flush(c)),c.closed(c)),c.reset(f)},c};lFn.exports=Jt.tls=Jt.tls||{};for(eot in _e)typeof _e[eot]!="function"&&(Jt.tls[eot]=_e[eot]);var eot;Jt.tls.prf_tls1=rot;Jt.tls.hmac_sha1=D1s;Jt.tls.createSessionCache=_e.createSessionCache;Jt.tls.createConnection=_e.createConnection});var fFn=I((Gif,dFn)=>{p();var Dj=As();Tj();Urr();var Dw=dFn.exports=Dj.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:uFn};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:uFn};function uFn(t,e,r){var n=e.entity===Dj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Dj.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:Dj.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=tSs,t.write.cipherFunction=Z1s,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Dw.hmac_sha1}a(uFn,"initConnectionState");function Z1s(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=Dj.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(X1s)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(Z1s,"encrypt_aes_cbc_sha1");function X1s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(X1s,"encrypt_aes_cbc_sha1_padding");function eSs(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=Dj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=rSs(e.macKey,c,u)&&r,r}a(tSs,"decrypt_aes_cbc_sha1");function rSs(t,e,r){var n=Dj.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(rSs,"compareMacs")});var jrr=I((Wif,gFn)=>{p();var cd=As();E5();ac();var oPe=gFn.exports=cd.sha512=cd.sha512||{};cd.md.sha512=cd.md.algorithms.sha512=oPe;var hFn=cd.sha384=cd.sha512.sha384=cd.sha512.sha384||{};hFn.create=function(){return oPe.create("SHA-384")};cd.md.sha384=cd.md.algorithms.sha384=hFn;cd.sha512.sha256=cd.sha512.sha256||{create:a(function(){return oPe.create("SHA-512/256")},"create")};cd.md["sha512/256"]=cd.md.algorithms["sha512/256"]=cd.sha512.sha256;cd.sha512.sha224=cd.sha512.sha224||{create:a(function(){return oPe.create("SHA-512/224")},"create")};cd.md["sha512/224"]=cd.md.algorithms["sha512/224"]=cd.sha512.sha224;oPe.create=function(t){if(mFn||nSs(),typeof t>"u"&&(t="SHA-512"),!(t in gZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=gZ[t],r=null,n=cd.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),pFn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=cd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Qrr.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],j=U[0],Q=U[1],n=((j>>>19|Q<<13)^(Q>>>29|j<<3)^j>>>6)>>>0,o=((j<<13|Q>>>19)^(Q<<3|j>>>29)^(j<<26|Q>>>6))>>>0,W=e[O-15],j=W[0],Q=W[1],s=((j>>>1|Q<<31)^(j>>>8|Q<<24)^j>>>7)>>>0,c=((j<<31|Q>>>1)^(j<<24|Q>>>8)^(j<<25|Q>>>7))>>>0,Y=e[O-7],V=e[O-16],Q=o+Y[1]+c+V[1],e[O][0]=n+Y[0]+s+V[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],L=t[6][0],B=t[6][1],q=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=(L^x&(D^L))>>>0,m=(B^P&(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,Q=M+f+m+qrr[O][1]+e[O][1],n=q+d+h+qrr[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,q=L,M=B,L=D,B=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]+B,t[6][0]=t[6][0]+L+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+q+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,z-=128}}a(pFn,"_update")});var AFn=I(Hrr=>{p();var iSs=As();v2();var Dg=iSs.asn1;Hrr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Hrr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var kFn=I((Zif,RFn)=>{p();var GA=As();tPe();xw();jrr();ac();var bFn=AFn(),oSs=bFn.publicKeyValidator,sSs=bFn.privateKeyValidator;typeof yFn>"u"&&(yFn=GA.jsbn.BigInteger);var yFn,$rr=GA.util.ByteBuffer,ub=typeof Buffer>"u"?Uint8Array:Buffer;GA.pki=GA.pki||{};RFn.exports=GA.pki.ed25519=GA.ed25519=GA.ed25519||{};var ta=GA.ed25519;ta.constants={};ta.constants.PUBLIC_KEY_BYTE_LENGTH=32;ta.constants.PRIVATE_KEY_BYTE_LENGTH=64;ta.constants.SEED_BYTE_LENGTH=32;ta.constants.SIGN_BYTE_LENGTH=64;ta.constants.HASH_BYTE_LENGTH=64;ta.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=GA.random.getBytesSync(ta.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==ta.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ta.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=qF({message:e,encoding:"binary"});for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=new ub(ta.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return uSs(r,n),{publicKey:r,privateKey:n}};ta.privateKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,sSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.privateKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=qF({message:GA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};ta.publicKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,oSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.publicKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==ta.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return qF({message:l,encoding:"binary"})};ta.publicKeyFromPrivateKey=function(t){t=t||{};var e=qF({message:t.privateKey,encoding:"binary"});if(e.length!==ta.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ta.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function qF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof ub)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 $rr(e,r)}else if(!(e instanceof $rr))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 ub(e.length()),o=0;o=0;--r){if(t[e+r]sPe[r])return!1}return!1}a(pSs,"_isCanonicalSignatureScalar");function SFn(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)*sPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*sPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(SFn,"modL");function Wrr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;SFn(t,e)}a(Wrr,"reduce");function zrr(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i(),d=$i(),f=$i();Jfe(r,t[1],t[0]),Jfe(f,e[1],e[0]),Wl(r,r,f),Kfe(n,t[0],t[1]),Kfe(f,e[0],e[1]),Wl(n,n,f),Wl(o,t[3],e[3]),Wl(o,o,cSs),Wl(s,t[2],e[2]),Kfe(s,s,s),Jfe(c,n,r),Jfe(l,s,o),Kfe(u,s,o),Kfe(d,n,r),Wl(t[0],c,l),Wl(t[1],d,u),Wl(t[2],u,l),Wl(t[3],c,d)}a(zrr,"add");function vFn(t,e,r){for(var n=0;n<4;++n)wFn(t[n],e[n],r)}a(vFn,"cswap");function Yrr(t,e){var r=$i(),n=$i(),o=$i();ySs(o,e[2]),Wl(r,e[0],o),Wl(n,e[1],o),iot(t,n),t[31]^=IFn(r)<<7}a(Yrr,"pack");function iot(t,e){var r,n,o,s=$i(),c=$i();for(r=0;r<16;++r)c[r]=e[r];for(Grr(c),Grr(c),Grr(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,wFn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(iot,"pack25519");function hSs(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i();return Nj(t[2],not),mSs(t[1],e),AZ(o,t[1]),Wl(s,o,aSs),Jfe(o,o,t[2]),Kfe(s,t[2],s),AZ(c,s),AZ(l,c),Wl(u,l,c),Wl(r,u,o),Wl(r,r,s),gSs(r,r),Wl(r,r,o),Wl(r,r,s),Wl(r,r,s),Wl(t[0],r,s),AZ(n,t[0]),Wl(n,n,s),CFn(n,o)&&Wl(t[0],t[0],lSs),AZ(n,t[0]),Wl(n,n,s),CFn(n,o)?-1:(IFn(t[0])===e[31]>>7&&Jfe(t[0],Vrr,t[0]),Wl(t[3],t[0],t[1]),0)}a(hSs,"unpackneg");function mSs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(mSs,"unpack25519");function gSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)AZ(r,r),n!==1&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(gSs,"pow2523");function CFn(t,e){var r=new ub(32),n=new ub(32);return iot(r,t),iot(n,e),TFn(r,0,n,0)}a(CFn,"neq25519");function TFn(t,e,r,n){return ASs(t,e,r,n,32)}a(TFn,"crypto_verify_32");function ASs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(ASs,"vn");function IFn(t){var e=new ub(32);return iot(e,t),e[0]&1}a(IFn,"par25519");function xFn(t,e,r){var n,o;for(Nj(t[0],Vrr),Nj(t[1],not),Nj(t[2],not),Nj(t[3],Vrr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,vFn(t,e,n),zrr(e,t),zrr(t,t),vFn(t,e,n)}a(xFn,"scalarmult");function Krr(t,e){var r=[$i(),$i(),$i(),$i()];Nj(r[0],EFn),Nj(r[1],_Fn),Nj(r[2],not),Wl(r[3],EFn,_Fn),xFn(t,r,e)}a(Krr,"scalarbase");function Nj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Nj,"set25519");function ySs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)AZ(r,r),n!==2&&n!==4&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(ySs,"inv25519");function Grr(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(Grr,"car25519");function wFn(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(wFn,"sel25519");function $i(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var gT=As();ac();xw();tPe();NFn.exports=gT.kem=gT.kem||{};var PFn=gT.jsbn.BigInteger;gT.kem.rsa={};gT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||gT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new PFn(gT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(PFn.ONE)<=0);l=gT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=gT.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};gT.kem.kdf1=function(t,e){DFn(this,t,0,e||t.digestLength)};gT.kem.kdf2=function(t,e){DFn(this,t,1,e||t.digestLength)};function DFn(t,e,r,n){t.generate=function(o,s){for(var c=new gT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new gT.util.ByteBuffer,d=r;d{p();var ha=As();ac();BFn.exports=ha.log=ha.log||{};ha.log.levels=["none","error","warning","info","debug","verbose","max"];var oot={},Xrr=[],lPe=null;ha.log.LEVEL_LOCKED=2;ha.log.NO_LEVEL_CHECK=4;ha.log.INTERPOLATE=8;for(x5=0;x5"u"||e?t.flags|=ha.log.LEVEL_LOCKED:t.flags&=~ha.log.LEVEL_LOCKED};ha.log.addLogger=function(t){Xrr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(OFn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},uPe=a(function(t,e){ha.log.prepareStandard(e);var r=OFn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Zfe=ha.log.makeLogger(uPe)):(uPe=a(function(e,r){ha.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Zfe=ha.log.makeLogger(uPe)),ha.log.setLevel(Zfe,"debug"),ha.log.addLogger(Zfe),lPe=Zfe):console={log:a(function(){},"log")};var Zfe,OFn,uPe;lPe!==null&&typeof window<"u"&&window.location&&(cPe=new URL(window.location.href).searchParams,cPe.has("console.level")&&ha.log.setLevel(lPe,cPe.get("console.level").slice(-1)[0]),cPe.has("console.lock")&&(LFn=cPe.get("console.lock").slice(-1)[0],LFn=="true"&&ha.log.lock(lPe)));var cPe,LFn;ha.log.consoleLogger=lPe});var QFn=I((aof,UFn)=>{p();UFn.exports=E5();Fit();$fe();prr();jrr()});var HFn=I((lof,jFn)=>{p();var Xr=As();Tj();v2();Xke();Ij();uZ();xrr();xw();ac();Zit();var Xe=Xr.asn1,cv=jFn.exports=Xr.pkcs7=Xr.pkcs7||{};cv.messageFromPem=function(t){var e=Xr.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=Xe.fromDer(e.body);return cv.messageFromAsn1(n)};cv.messageToPem=function(t,e){var r={type:"PKCS7",body:Xe.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};cv.messageFromAsn1=function(t){var e={},r=[];if(!Xe.validate(t,cv.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=Xe.derToOid(e.contentType),s;switch(o){case Xr.pki.oids.envelopedData:s=cv.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=cv.createEncryptedData();break;case Xr.pki.oids.signedData:s=cv.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};cv.createSignedData=function(){var t=null;return t={type:Xr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(tnr(t,n,cv.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(Xe.create(Xe.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SET,!0,t.signerInfos)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.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=Xr.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=Xr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Xr.pki.oids.sha1;switch(u){case Xr.pki.oids.sha1:case Xr.pki.oids.sha256:case Xr.pki.oids.sha384:case Xr.pki.oids.sha512:case Xr.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=Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var cm=As();Tj();qfe();Fit();$fe();ac();var aot=GFn.exports=cm.ssh=cm.ssh||{};aot.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($it,"foldHeader");function pCs(t){return t.replace(/^\s+/,"")}a(pCs,"ltrim")});var rPe=I((cif,l3n)=>{p();var Wd=As();Bit();urr();cc();l3n.exports=Wd.des=Wd.des||{};Wd.des.startEncrypting=function(t,e,r,n){var o=Wit({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Wd.des.createEncryptionCipher=function(t,e){return Wit({key:t,output:null,decrypt:!1,mode:e})};Wd.des.startDecrypting=function(t,e,r,n){var o=Wit({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Wd.des.createDecryptionCipher=function(t,e){return Wit({key:t,output:null,decrypt:!0,mode:e})};Wd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return c3n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return c3n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};Wd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Wd.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=CCs(e),this._init=!0}};b5("DES-ECB",Wd.cipher.modes.ecb);b5("DES-CBC",Wd.cipher.modes.cbc);b5("DES-CFB",Wd.cipher.modes.cfb);b5("DES-OFB",Wd.cipher.modes.ofb);b5("DES-CTR",Wd.cipher.modes.ctr);b5("3DES-ECB",Wd.cipher.modes.ecb);b5("3DES-CBC",Wd.cipher.modes.cbc);b5("3DES-CFB",Wd.cipher.modes.cfb);b5("3DES-OFB",Wd.cipher.modes.ofb);b5("3DES-CTR",Wd.cipher.modes.ctr);function b5(t,e){var r=a(function(){return new Wd.des.Algorithm(t,e)},"factory");Wd.cipher.registerAlgorithm(t,r)}a(b5,"registerAlgorithm");var hCs=[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],mCs=[-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],gCs=[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],ACs=[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],yCs=[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],ECs=[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],_Cs=[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],vCs=[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 CCs(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(CCs,"_createKeys");function c3n(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^(mCs[g>>>24&63]|ACs[g>>>16&63]|ECs[g>>>8&63]|vCs[g&63]|hCs[A>>>24&63]|gCs[A>>>16&63]|yCs[A>>>8&63]|_Cs[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(c3n,"_updateBlock");function Wit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=Wd.cipher.createDecipher(r,t.key):n=Wd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Wd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Wit,"_createCipher")});var zit=I((dif,u3n)=>{p();var cv=As();jfe();v5();cc();var bCs=cv.pkcs5=cv.pkcs5||{},qF;cv.util.isNodejs&&!cv.options.usePureJavaScript&&(qF=require("crypto"));u3n.exports=cv.pbkdf2=bCs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),cv.util.isNodejs&&!cv.options.usePureJavaScript&&qF.pbkdf2&&(o===null||typeof o!="object")&&(qF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?qF.pbkdf2Sync.length===4?qF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):qF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):qF.pbkdf2Sync.length===4?qF.pbkdf2Sync(t,e,r,n).toString("binary"):qF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in cv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=cv.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=cv.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(cv.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=cv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(cv.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=cv.util.xorBytes(m,g,c),A=g,++E,cv.util.setImmediate(v);h+=y{p();var S5=As();v5();cc();var f3n=m3n.exports=S5.sha256=S5.sha256||{};S5.md.sha256=S5.md.algorithms.sha256=f3n;f3n.create=function(){p3n||SCs();var t=null,e=S5.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),d3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=S5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(grr.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};d3n(h,r,o);var m=S5.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 grr=null,p3n=!1,h3n=null;function SCs(){grr="\x80",grr+=S5.util.fillString("\0",64),h3n=[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],p3n=!0}a(SCs,"_init");function d3n(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+h3n[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(d3n,"_update")});var yrr=I((Aif,g3n)=>{p();var T5=As();cc();var Yit=null;T5.util.isNodejs&&!T5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Yit=require("crypto"));var TCs=g3n.exports=T5.prng=T5.prng||{};TCs.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=T5.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 T5.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)),T5.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=T5.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=T5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=T5.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"),Yit?(e.seedFile=function(d,f){Yit.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Yit.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 Rw=I((_if,Err)=>{p();var Dg=As();wj();Arr();yrr();cc();(function(){if(Dg.random&&Dg.random.getBytes){Err.exports=Dg.random;return}(function(t){var e={},r=new Array(4),n=Dg.util.createBuffer();e.formatKey=function(h){var m=Dg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),Dg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=Dg.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 Dg.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=Dg.md.sha256;function o(){var h=Dg.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=Dg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),Dg.options.usePureJavaScript||!Dg.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(!Dg.random)Dg.random=s;else for(var f in s)Dg.random[f]=s[f];Dg.random.createInstance=o,Err.exports=Dg.random})(typeof jQuery<"u"?jQuery:null)})()});var vrr=I((bif,E3n)=>{p();var lb=As();cc();var _rr=[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],A3n=[1,2,3,5],ICs=a(function(t,e){return t<>16-e},"rol"),xCs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");E3n.exports=lb.rc2=lb.rc2||{};lb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lb.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(_rr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,_rr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,_rr[r.at(l+1)^r.at(l+s)]);return r};var y3n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=lb.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]=ICs(A[d],A3n[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]=xCs(A[d],A3n[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");lb.rc2.startEncrypting=function(t,e,r){var n=lb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createEncryptionCipher=function(t,e){return y3n(t,e,!0)};lb.rc2.startDecrypting=function(t,e,r){var n=lb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createDecryptionCipher=function(t,e){return y3n(t,e,!1)}});var iPe=I((Iif,x3n)=>{p();var Crr=As();x3n.exports=Crr.jsbn=Crr.jsbn||{};var jF,wCs=0xdeadbeefcafe,_3n=(wCs&16777215)==15715070;function zt(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(zt,"BigInteger");Crr.jsbn.BigInteger=zt;function Wa(){return new zt(null)}a(Wa,"nbi");function RCs(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(RCs,"am1");function kCs(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(kCs,"am2");function v3n(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(v3n,"am3");typeof navigator>"u"?(zt.prototype.am=v3n,jF=28):_3n&&navigator.appName=="Microsoft Internet Explorer"?(zt.prototype.am=kCs,jF=30):_3n&&navigator.appName!="Netscape"?(zt.prototype.am=RCs,jF=26):(zt.prototype.am=v3n,jF=28);zt.prototype.DB=jF;zt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(DCs,"bnpCopyTo");function NCs(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(NCs,"bnpFromInt");function kj(t){var e=Wa();return e.fromInt(t),e}a(kj,"nbv");function MCs(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:b3n(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(OCs,"bnpClamp");function LCs(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=C3n(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+=C3n(n));return o?s:"0"}a(LCs,"bnToString");function BCs(){var t=Wa();return zt.ZERO.subTo(this,t),t}a(BCs,"bnNegate");function FCs(){return this.s<0?this.negate():this}a(FCs,"bnAbs");function UCs(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(UCs,"bnCompareTo");function Jit(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(Jit,"nbits");function QCs(){return this.t<=0?0:this.DB*(this.t-1)+Jit(this.data[this.t-1]^this.s&this.DM)}a(QCs,"bnBitLength");function qCs(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(qCs,"bnpDLShiftTo");function jCs(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(HCs,"bnpLShiftTo");function GCs(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($Cs,"bnpSubTo");function VCs(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(WCs,"bnpSquareTo");function zCs(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)),zt.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&&zt.ZERO.subTo(r,r)}}}a(zCs,"bnpDivRemTo");function YCs(t){var e=Wa();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(zt.ZERO)>0&&t.subTo(e,e),e}a(YCs,"bnMod");function pZ(t){this.m=t}a(pZ,"Classic");function KCs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(KCs,"cConvert");function JCs(t){return t}a(JCs,"cRevert");function ZCs(t){t.divRemTo(this.m,null,t)}a(ZCs,"cReduce");function XCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(XCs,"cMulTo");function ebs(t,e){t.squareTo(e),this.reduce(e)}a(ebs,"cSqrTo");pZ.prototype.convert=KCs;pZ.prototype.revert=JCs;pZ.prototype.reduce=ZCs;pZ.prototype.mulTo=XCs;pZ.prototype.sqrTo=ebs;function tbs(){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(tbs,"bnpInvDigit");function hZ(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(rbs,"montConvert");function nbs(t){var e=Wa();return t.copyTo(e),this.reduce(e),e}a(nbs,"montRevert");function ibs(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(ibs,"montReduce");function obs(t,e){t.squareTo(e),this.reduce(e)}a(obs,"montSqrTo");function sbs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(sbs,"montMulTo");hZ.prototype.convert=rbs;hZ.prototype.revert=nbs;hZ.prototype.reduce=ibs;hZ.prototype.mulTo=sbs;hZ.prototype.sqrTo=obs;function abs(){return(this.t>0?this.data[0]&1:this.s)==0}a(abs,"bnpIsEven");function cbs(t,e){if(t>4294967295||t<1)return zt.ONE;var r=Wa(),n=Wa(),o=e.convert(this),s=Jit(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(cbs,"bnpExp");function lbs(t,e){var r;return t<256||e.isEven()?r=new pZ(e):r=new hZ(e),this.exp(t,r)}a(lbs,"bnModPowInt");zt.prototype.copyTo=DCs;zt.prototype.fromInt=NCs;zt.prototype.fromString=MCs;zt.prototype.clamp=OCs;zt.prototype.dlShiftTo=qCs;zt.prototype.drShiftTo=jCs;zt.prototype.lShiftTo=HCs;zt.prototype.rShiftTo=GCs;zt.prototype.subTo=$Cs;zt.prototype.multiplyTo=VCs;zt.prototype.squareTo=WCs;zt.prototype.divRemTo=zCs;zt.prototype.invDigit=tbs;zt.prototype.isEven=abs;zt.prototype.exp=cbs;zt.prototype.toString=LCs;zt.prototype.negate=BCs;zt.prototype.abs=FCs;zt.prototype.compareTo=UCs;zt.prototype.bitLength=QCs;zt.prototype.mod=YCs;zt.prototype.modPowInt=lbs;zt.ZERO=kj(0);zt.ONE=kj(1);function ubs(){var t=Wa();return this.copyTo(t),t}a(ubs,"bnClone");function dbs(){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(fbs,"bnByteValue");function pbs(){return this.t==0?this.s:this.data[0]<<16>>16}a(pbs,"bnShortValue");function hbs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(hbs,"bnpChunkSize");function mbs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(mbs,"bnSigNum");function gbs(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=kj(r),o=Wa(),s=Wa(),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(gbs,"bnpToRadix");function Abs(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&&zt.ZERO.subTo(this,this)}a(Abs,"bnpFromRadix");function ybs(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(zt.ONE.shiftLeft(t-1),Srr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(zt.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(Ebs,"bnToByteArray");function _bs(t){return this.compareTo(t)==0}a(_bs,"bnEquals");function vbs(t){return this.compareTo(t)<0?this:t}a(vbs,"bnMin");function Cbs(t){return this.compareTo(t)>0?this:t}a(Cbs,"bnMax");function bbs(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(Dbs,"lbit");function Nbs(){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(qbs,"bnpAddTo");function jbs(t){var e=Wa();return this.addTo(t,e),e}a(jbs,"bnAdd");function Hbs(t){var e=Wa();return this.subTo(t,e),e}a(Hbs,"bnSubtract");function Gbs(t){var e=Wa();return this.multiplyTo(t,e),e}a(Gbs,"bnMultiply");function $bs(){var t=Wa();return this.squareTo(t),t}a($bs,"bnSquare");function Vbs(t){var e=Wa();return this.divRemTo(t,e,null),e}a(Vbs,"bnDivide");function Wbs(t){var e=Wa();return this.divRemTo(t,null,e),e}a(Wbs,"bnRemainder");function zbs(t){var e=Wa(),r=Wa();return this.divRemTo(t,e,r),new Array(e,r)}a(zbs,"bnDivideAndRemainder");function Ybs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Ybs,"bnpDMultiply");function Kbs(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(Kbs,"bnpDAddOffset");function nPe(){}a(nPe,"NullExp");function I3n(t){return t}a(I3n,"nNop");function Jbs(t,e,r){t.multiplyTo(e,r)}a(Jbs,"nMulTo");function Zbs(t,e){t.squareTo(e)}a(Zbs,"nSqrTo");nPe.prototype.convert=I3n;nPe.prototype.revert=I3n;nPe.prototype.mulTo=Jbs;nPe.prototype.sqrTo=Zbs;function Xbs(t){return this.exp(t,new nPe)}a(Xbs,"bnPow");function e1s(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=Wa();return t.copyTo(e),this.reduce(e),e}a(r1s,"barrettConvert");function n1s(t){return t}a(n1s,"barrettRevert");function i1s(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(i1s,"barrettReduce");function o1s(t,e){t.squareTo(e),this.reduce(e)}a(o1s,"barrettSqrTo");function s1s(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(s1s,"barrettMulTo");$fe.prototype.convert=r1s;$fe.prototype.revert=n1s;$fe.prototype.reduce=i1s;$fe.prototype.mulTo=s1s;$fe.prototype.sqrTo=o1s;function a1s(t,e){var r=t.bitLength(),n,o=kj(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 pZ(e):e.isEven()?s=new $fe(e):s=new hZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Wa();for(s.sqrTo(c[1],f);l<=d;)c[l]=Wa(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Wa(),y;for(r=Jit(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(c1s,"bnGCD");function l1s(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(l1s,"bnpModInt");function u1s(t){if(this.signum()==0)return zt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return zt.ZERO;for(var r=t.clone(),n=this.clone(),o=kj(1),s=kj(0),c=kj(0),l=kj(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(zt.ONE)!=0)return zt.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(u1s,"bnModInverse");var S2=[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],d1s=(1<<26)/S2[S2.length-1];function f1s(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=S2[S2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(zt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var I5=As();v5();cc();var R3n=P3n.exports=I5.sha1=I5.sha1||{};I5.md.sha1=I5.md.algorithms.sha1=R3n;R3n.create=function(){k3n||m1s();var t=null,e=I5.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),w3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=I5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Trr.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};w3n(h,r,o);var m=I5.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 Trr=null,k3n=!1;function m1s(){Trr="\x80",Trr+=I5.util.fillString("\0",64),k3n=!0}a(m1s,"_init");function w3n(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(w3n,"_update")});var Irr=I((Dif,N3n)=>{p();var x5=As();cc();Rw();Vfe();var D3n=N3n.exports=x5.pkcs1=x5.pkcs1||{};D3n.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=x5.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(Zit,"rsa_mgf1")});var wrr=I((Oif,xrr)=>{p();var Pj=As();cc();iPe();Rw();(function(){if(Pj.prime){xrr.exports=Pj.prime;return}var t=xrr.exports=Pj.prime=Pj.prime||{},e=Pj.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||Pj.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 Pj.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 oPe=I((Fif,Q3n)=>{p();var Ci=As();b2();iPe();Rj();Irr();wrr();Rw();cc();typeof za>"u"&&(za=Ci.jsbn.BigInteger);var za,Rrr=Ci.util.isNodejs?require("crypto"):null,pt=Ci.asn1,Pw=Ci.util;Ci.pki=Ci.pki||{};Q3n.exports=Ci.pki.rsa=Ci.rsa=Ci.rsa||{};var jo=Ci.pki,g1s=[6,4,2,4,2,4,6,2],A1s={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"}]},y1s={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"}]},E1s={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"}]},_1s=Ci.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"}]}]},v1s={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"}]},C1s=a(function(t){var e;if(t.algorithm in jo.oids)e=jo.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"),F3n=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(za.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(za.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new za(Ci.util.bytesToHex(Ci.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(za.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");jo.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=U3n(t,e,r)):(o=Ci.util.createBuffer(),o.putBytes(t));for(var c=new za(o.toHex(),16),l=F3n(c,e,n),u=l.toString(16),d=Ci.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),d.getBytes()};jo.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 za(Ci.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=F3n(c,e,r),u=l.toString(16),d=Ci.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),n!==!1?Xit(d.getBytes(),e,r):d.getBytes()};jo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||Ci.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};jo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new za(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(S1s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(g1s[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(za.ONE).gcd(t.e).compareTo(za.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(za.ONE),t.q1=t.q.subtract(za.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(za.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:jo.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:jo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};jo.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),!Ci.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(M3n("generateKeyPair"))return Rrr.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:jo.privateKeyFromPem(d),publicKey:jo.publicKeyFromPem(u)})});if(O3n("generateKey")&&O3n("exportKey"))return Pw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:B3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return Pw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=jo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(l)));n(null,{privateKey:u,publicKey:jo.setRsaPublicKey(u.n,u.e)})}});if(L3n("generateKey")&&L3n("exportKey")){var o=Pw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:B3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=Pw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=jo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(h)));n(null,{privateKey:m,publicKey:jo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(M3n("generateKeyPairSync")){var s=Rrr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:jo.privateKeyFromPem(s.privateKey),publicKey:jo.publicKeyFromPem(s.publicKey)}}}var c=jo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return jo.rsa.stepKeyPairGenerationState(c,0),c.keys;b1s(c,r,n)};jo.setRsaPublicKey=jo.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 U3n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ci.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 jo.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=Xit(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,v1s,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===Ci.oids.md2||A===Ci.oids.md5||A===Ci.oids.sha1||A===Ci.oids.sha224||A===Ci.oids.sha256||A===Ci.oids.sha384||A===Ci.oids.sha512||A===Ci.oids["sha512-224"]||A===Ci.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ci.oids.md2||A===Ci.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=Xit(d,r,!0,void 0,c),u===d},"verify")});var l=jo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};jo.setRsaPrivateKey=jo.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=jo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:Xit};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ci.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:C1s},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 jo.rsa.encrypt(m,u,h)},u};jo.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(jo.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())])};jo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,A1s,e,r)&&(t=pt.fromDer(Ci.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,y1s,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=Ci.util.createBuffer(e.privateKeyModulus).toHex(),s=Ci.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ci.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ci.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ci.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ci.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ci.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ci.util.createBuffer(e.privateKeyCoefficient).toHex(),jo.setRsaPrivateKey(new za(o,16),new za(s,16),new za(c,16),new za(l,16),new za(u,16),new za(d,16),new za(f,16),new za(h,16))};jo.privateKeyToAsn1=jo.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,w5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.qInv))])};jo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,_1s,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==jo.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,E1s,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=Ci.util.createBuffer(e.publicKeyModulus).toHex(),c=Ci.util.createBuffer(e.publicKeyExponent).toHex();return jo.setRsaPublicKey(new za(s,16),new za(c,16))};jo.publicKeyToAsn1=jo.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(jo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[jo.publicKeyToRSAPublicKey(t)])])};jo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,w5(t.e))])};function U3n(t,e,r){var n=Ci.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=Ci.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(Xit,"_decodePkcs1_v1_5");function b1s(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){Ci.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(za.ONE).gcd(t.e).compareTo(za.ONE)!==0){t.p=null,o();return}if(t.q.subtract(za.ONE).gcd(t.e).compareTo(za.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(za.ONE),t.q1=t.q.subtract(za.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(za.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:jo.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:jo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(b1s,"_generateKeyPair");function w5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ci.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(w5,"_bnToBytes");function S1s(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(S1s,"_getMillerRabinTests");function M3n(t){return Ci.util.isNodejs&&typeof Rrr[t]=="function"}a(M3n,"_detectNodeCrypto");function O3n(t){return typeof Pw.globalScope<"u"&&typeof Pw.globalScope.crypto=="object"&&typeof Pw.globalScope.crypto.subtle=="object"&&typeof Pw.globalScope.crypto.subtle[t]=="function"}a(O3n,"_detectSubtleCrypto");function L3n(t){return typeof Pw.globalScope<"u"&&typeof Pw.globalScope.msCrypto=="object"&&typeof Pw.globalScope.msCrypto.subtle=="object"&&typeof Pw.globalScope.msCrypto.subtle[t]=="function"}a(L3n,"_detectSubtleMsCrypto");function B3n(t){for(var e=Ci.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var _n=As();wj();b2();rPe();v5();Rj();zit();fZ();Rw();vrr();oPe();cc();typeof q3n>"u"&&(q3n=_n.jsbn.BigInteger);var q3n,Nt=_n.asn1,as=_n.pki=_n.pki||{};$3n.exports=as.pbe=_n.pbe=_n.pbe||{};var mZ=as.oids,T1s={name:"EncryptedPrivateKeyInfo",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},I1s={name:"PBES2Algorithms",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},x1s={name:"pkcs-12PbeParams",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"iterations"}]};as.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=_n.random.getBytesSync(r.saltSize),o=r.count,s=Nt.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=mZ["aes128-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=mZ["aes192-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=mZ["aes256-CBC"],h=_n.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=mZ.desCBC,h=_n.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=G3n(g),y=_n.pkcs5.pbkdf2(e,n,o,c,A),E=_n.random.getBytesSync(d),_=h(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes();var v=w1s(n,s,c,g);l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(mZ.pkcs5PBES2).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(mZ.pkcs5PBKDF2).getBytes()),v]),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(f).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new _n.util.ByteBuffer(n),y=as.pbe.generatePkcs12Key(e,b,1,o,c),E=as.pbe.generatePkcs12Key(e,b,2,o,c),_=_n.des.createEncryptionCipher(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(mZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,n),Nt.create(Nt.Class.UNIVERSAL,Nt.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=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[l,Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,u)]);return T};as.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Nt.validate(t,T1s,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=Nt.derToOid(n.encryptionOid),l=as.pbe.getCipher(c,n.encryptionParams,e),u=_n.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Nt.fromDer(l.output)),r};as.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Nt.toDer(t).getBytes()};return _n.pem.encode(r,{maxline:e})};as.encryptedPrivateKeyFromPem=function(t){var e=_n.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 Nt.fromDer(e.body)};as.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=as.wrapRsaPrivateKey(as.privateKeyToAsn1(t));return n=as.encryptPrivateKeyInfo(n,e,r),as.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=_n.random.getBytesSync(8),l=_n.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=_n.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Nt.toDer(as.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:_n.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return _n.pem.encode(h)};as.decryptRsaPrivateKey=function(t,e){var r=null,n=_n.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=_n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=_n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=_n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=_n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=_n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return _n.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return _n.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return _n.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=_n.util.hexToBytes(n.dekInfo.parameters),u=_n.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(_n.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=as.decryptPrivateKeyInfo(Nt.fromDer(r),e):r=Nt.fromDer(r),r!==null&&(r=as.privateKeyFromAsn1(r)),r};as.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in _n.md))throw new Error('"sha1" hash algorithm unavailable.');s=_n.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new _n.util.ByteBuffer,h=new _n.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=P.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};as.pbe.getCipher=function(t,e,r){switch(t){case as.oids.pkcs5PBES2:return as.pbe.getCipherForPBES2(t,e,r);case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case as.oids["pbewithSHAAnd40BitRC2-CBC"]:return as.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}};as.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Nt.validate(e,I1s,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=Nt.derToOid(n.kdfOid),t!==as.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=Nt.derToOid(n.encOid),t!==as.oids["aes128-CBC"]&&t!==as.oids["aes192-CBC"]&&t!==as.oids["aes256-CBC"]&&t!==as.oids["des-EDE3-CBC"]&&t!==as.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=_n.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(as.oids[t]){case"aes128-CBC":u=16,d=_n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=_n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=_n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=_n.des.createDecryptionCipher;break;case"desCBC":u=8,d=_n.des.createDecryptionCipher;break}var f=H3n(n.prfOid),h=_n.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};as.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Nt.validate(e,x1s,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=_n.util.createBuffer(n.salt),l=_n.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=_n.des.startDecrypting;break;case as.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=_n.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=H3n(n.prfOid),m=as.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=as.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};as.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in _n.md))throw new Error('"md5" hash algorithm unavailable.');n=_n.md.md5.create()}e===null&&(e="");for(var o=[j3n(n,t+e)],s=16,c=1;s{p();var Wfe=As();b2();cc();var fn=Wfe.asn1,zfe=z3n.exports=Wfe.pkcs7asn1=Wfe.pkcs7asn1||{};Wfe.pkcs7=Wfe.pkcs7||{};Wfe.pkcs7.asn1=zfe;var V3n={name:"ContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};zfe.contentInfoValidator=V3n;var W3n={name:"EncryptedContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};zfe.envelopedDataValidator={name:"EnvelopedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(W3n)};zfe.encryptedDataValidator={name:"EncryptedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"}].concat(W3n)};var R1s={name:"SignerInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};zfe.signedDataValidator={name:"SignedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},V3n,{name:"SignedData.Certificates",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,capture:"signerInfos",optional:!0,value:[R1s]}]};zfe.recipientInfoValidator={name:"RecipientInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var Drr=I((Vif,Y3n)=>{p();var gZ=As();cc();gZ.mgf=gZ.mgf||{};var k1s=Y3n.exports=gZ.mgf.mgf1=gZ.mgf1=gZ.mgf1||{};k1s.create=function(t){var e={generate:a(function(r,n){for(var o=new gZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var eot=As();Drr();K3n.exports=eot.mgf=eot.mgf||{};eot.mgf.mgf1=eot.mgf1});var tot=I((Jif,Z3n)=>{p();var AZ=As();Rw();cc();var P1s=Z3n.exports=AZ.pss=AZ.pss||{};P1s.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=AZ.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||AZ.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 bi=As();wj();b2();rPe();v5();J3n();Rj();fZ();tot();oPe();cc();var Ae=bi.asn1,Dr=nFn.exports=bi.pki=bi.pki||{},Ya=Dr.oids,hp={};hp.CN=Ya.commonName;hp.commonName="CN";hp.C=Ya.countryName;hp.countryName="C";hp.L=Ya.localityName;hp.localityName="L";hp.ST=Ya.stateOrProvinceName;hp.stateOrProvinceName="ST";hp.O=Ya.organizationName;hp.organizationName="O";hp.OU=Ya.organizationalUnitName;hp.organizationalUnitName="OU";hp.E=Ya.emailAddress;hp.emailAddress="E";var eFn=bi.pki.rsa.publicKeyValidator,D1s={name:"Certificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},eFn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},N1s={name:"rsapss",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},M1s={name:"CertificationRequestInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},eFn,{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SET,constructed:!0}]}]}]},O1s={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[M1s,{name:"CertificationRequest.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Dr.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=not({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=bi.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Dj(c.issuer,A)},c.issuer.addField=function(A){Dw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Dr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=bi.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Dj(c.subject,A)},c.subject.addField=function(A){Dw([A]),c.subject.attributes.push(A)},c.subject.attributes=Dr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Dr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Dr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Dr.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=Ae.fromDer(e.value);r.value.length>0&&r.value[0].type===Ae.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===Ae.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=Ae.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=Ae.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=Ae.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Dr.oids?e.name=Dr.oids[e.type]:e.shortName&&e.shortName in hp&&(e.name=Dr.oids[hp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Dr.oids)e.type=Dr.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 hp&&(e.shortName=hp[e.name]),e.type===Ya.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=Ae.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(Dw,"_fillMissingFields");function rFn(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Dr.oids&&(t.name=Dr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Dr.oids)t.id=Dr.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=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in Ya?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(Ya[u]).getBytes())):u.indexOf(".")!==-1&&l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.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=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[Ae.create(Ae.Class.CONTEXT_SPECIFIC,4,!0,[Yfe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=bi.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),E=Ae.create(Ae.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(rFn,"_fillMissingExtensionFields");function Nrr(t,e){if(t===Ya["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(e.saltLength).getBytes())])),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,r)}else return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")}a(Nrr,"_signatureParametersToAsn1");function L1s(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=B1s&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.getCertificationRequestInfo=function(t){var e=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.version).getBytes()),Yfe(t.subject),Dr.publicKeyToAsn1(t.publicKey),L1s(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return Yfe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.getTBSCertificate(t);return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[e,Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(t.signatureOid).getBytes()),Nrr(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.certificateExtensionsToAsn1=function(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Ae.create(Ae.Class.UNIVERSAL,Ae.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:Dr.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;bi.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:Dr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Dr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Dr.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:Dr.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:Dr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!bi.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 Orr=I((rof,oFn)=>{p();var xu=As();b2();jfe();Rj();Prr();krr();Rw();oPe();Vfe();cc();iot();var Ke=xu.asn1,ea=xu.pki,aPe=oFn.exports=xu.pkcs12=xu.pkcs12||{},iFn={name:"ContentInfo",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},U1s={name:"PFX",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,capture:"version"},iFn,{name:"PFX.macData",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ke.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},Q1s={name:"SafeBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},q1s={name:"Attribute",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,capture:"values"}]},j1s={name:"CertBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ke.Class.UNIVERSAL,type:Ke.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function sPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(sPe,"_getBagsByAttribute");aPe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ke.validate(t,U1s,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=xu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=sPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=sPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=sPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return sPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return sPe(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(Ke.derToOid(n.contentType)!==ea.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ke.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ke.Class.UNIVERSAL||l.type!==Ke.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=Mrr(l),n.mac){var u=null,d=0,f=Ke.derToOid(n.macAlgorithm);switch(f){case ea.oids.sha1:u=xu.md.sha1.create(),d=20;break;case ea.oids.sha256:u=xu.md.sha256.create(),d=32;break;case ea.oids.sha384:u=xu.md.sha384.create(),d=48;break;case ea.oids.sha512:u=xu.md.sha512.create(),d=64;break;case ea.oids.md5:u=xu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new xu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(xu.util.bytesToHex(n.macIterations),16):1,g=aPe.generateKey(r,h,3,m,d,u),A=xu.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 H1s(c,l.value,e,r),c};function Mrr(t){if(t.composed||t.constructed){for(var e=xu.util.createBuffer(),r=0;r0&&(s=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SET,!0,u));var d=[],f=[];e!==null&&(xu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,h),_=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=ea.wrapRsaPrivateKey(ea.privateKeyToAsn1(t));r===null?v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.keyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.pkcs8ShroudedKeyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[ea.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[v]),w=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(T).getBytes())])]);d.push(w)}var R=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=xu.md.sha1.create(),P=new xu.util.ByteBuffer(xu.random.getBytes(n.saltSize)),D=n.count,t=aPe.generateKey(r,P,3,D,20),N=xu.hmac.create();N.start(l,t),N.update(Ke.toDer(R).getBytes());var L=N.getMac();x=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.sha1).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.NULL,!1,"")]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,L.getBytes())]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,P.getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(D).getBytes())])}return Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(3).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(R).getBytes())])]),x])};aPe.generateKey=xu.pbe.generatePkcs12Key});var Brr=I((oof,sFn)=>{p();var Nj=As();b2();Rj();krr();fZ();zit();Orr();tot();oPe();cc();iot();var Lrr=Nj.asn1,Kfe=sFn.exports=Nj.pki=Nj.pki||{};Kfe.pemToDer=function(t){var e=Nj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Nj.util.createBuffer(e.body)};Kfe.privateKeyFromPem=function(t){var e=Nj.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=Lrr.fromDer(e.body);return Kfe.privateKeyFromAsn1(n)};Kfe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Lrr.toDer(Kfe.privateKeyToAsn1(t)).getBytes()};return Nj.pem.encode(r,{maxline:e})};Kfe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Lrr.toDer(t).getBytes()};return Nj.pem.encode(r,{maxline:e})}});var Hrr=I((aof,hFn)=>{p();var Jt=As();b2();jfe();Git();fZ();Brr();Rw();Vfe();cc();var cot=a(function(t,e,r,n){var o=Jt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Jt.util.createBuffer(),f=Jt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Jt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(_e.queue(t,_e.createAlert(t,{level:_e.Alert.Level.warning,description:_e.Alert.Description.no_renegotiation})),_e.flush(t)),t.process()};_e.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Jt.util.createBuffer(s.getBytes(32)),session_id:AT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=AT(s,2),n.compression_methods=AT(s,1)),c=r-(c-s.length()),c>0){for(var l=AT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:AT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(AT(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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=_e.getCipherSuite(n.cipher_suite);else for(var m=Jt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure},cipherSuite:Jt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=_e.CompressionMethod.none}return n};_e.createSecurityParameters=function(t,e){var r=t.entity===_e.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:_e.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:_e.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}};_e.handleServerHello=function(t,e,r){var n=_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=lFn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=J1s,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.session.id=o,t.process()}};_e.handleClientHello=function(t,e,r){var n=_e.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=Jt.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;l<_e.SupportedVersions.length&&(c=_e.SupportedVersions[l],!(c.minor<=n.version.minor));++l);t.version={major:c.major,minor:c.minor},t.session.version=t.version}s!==null?(t.expect=qrr,t.session.resuming=!0,t.session.sp.client_random=n.random.bytes()):(t.expect=t.verifyClient!==!1?iSs:Qrr,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.open=!0,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHello(t)})),t.session.resuming?(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.pending=_e.createConnectionState(t),t.state.current.write=t.state.pending.write,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))):(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)})),t.fail||(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerKeyExchange(t)})),t.verifyClient!==!1&&_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificateRequest(t)})),_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHelloDone(t)})))),_e.flush(t),t.process()}};_e.handleCertificate=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_list:AT(n,3)},s,c,l=[];try{for(;o.certificate_list.length()>0;)s=AT(o.certificate_list,3),c=Jt.asn1.fromDer(s),s=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_certificate}})}var u=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?aFn:Qrr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],_e.verifyCertificateChain(t,l)&&(t.expect=u?aFn:Qrr)),t.process()};_e.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});t.expect=Z1s,t.process()};_e.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:AT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Jt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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=Jt.random.getBytes(48)}t.expect=qrr,t.session.clientCertificate!==null&&(t.expect=oSs),t.process()};_e.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:AT(n,1),certificate_authorities:AT(n,2)};t.session.certificateRequest=o,t.expect=X1s,t.process()};_e.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:AT(n,2).getBytes()},c=Jt.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:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure}})}t.expect=qrr,t.process()};_e.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Jt.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=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)}),_e.queue(t,e)),e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createClientKeyExchange(t)}),_e.queue(t,e),t.expect=rSs;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createCertificateVerify(l,u)})),_e.queue(l,_e.createRecord(l,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),l.state.pending=_e.createConnectionState(l),l.state.current.write=l.state.pending.write,_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createFinished(l)})),l.expect=lFn,_e.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);_e.getClientSignature(t,c)};_e.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var r=t.entity===_e.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=_e.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?eSs:sSs,t.process()};_e.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=Jt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===_e.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=cot;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:_e.Alert.Level.fatal,description:_e.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))),t.expect=c?tSs:aSs,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,_e.flush(t),t.isConnected=!0,t.connected(t),t.process()};_e.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case _e.Alert.Description.close_notify:o="Connection closed.";break;case _e.Alert.Description.unexpected_message:o="Unexpected message.";break;case _e.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case _e.Alert.Description.decryption_failed:o="Decryption failed.";break;case _e.Alert.Description.record_overflow:o="Record overflow.";break;case _e.Alert.Description.decompression_failure:o="Decompression failed.";break;case _e.Alert.Description.handshake_failure:o="Handshake failure.";break;case _e.Alert.Description.bad_certificate:o="Bad certificate.";break;case _e.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case _e.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case _e.Alert.Description.certificate_expired:o="Certificate expired.";break;case _e.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case _e.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case _e.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case _e.Alert.Description.access_denied:o="Access denied.";break;case _e.Alert.Description.decode_error:o="Decode error.";break;case _e.Alert.Description.decrypt_error:o="Decrypt error.";break;case _e.Alert.Description.export_restriction:o="Export restriction.";break;case _e.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case _e.Alert.Description.insufficient_security:o="Insufficient security.";break;case _e.Alert.Description.internal_error:o="Internal error.";break;case _e.Alert.Description.user_canceled:o="User canceled.";break;case _e.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===_e.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===_e.ConnectionEnd.client?"server":"client",alert:n}),t.process()};_e.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Jt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in aot[t.entity][t.expect]?(t.entity===_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()}),n!==_e.HandshakeType.hello_request&&n!==_e.HandshakeType.certificate_verify&&n!==_e.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),aot[t.entity][t.expect][n](t,e,o)):_e.handleUnexpected(t,e)};_e.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};_e.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===_e.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();_e.queue(t,_e.createRecord(t,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_response,s)})),_e.flush(t)}else if(n===_e.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Jt.util.createBuffer(s))}t.process()};var K1s=0,J1s=1,aFn=2,Z1s=3,X1s=4,lFn=5,eSs=6,tSs=7,rSs=8,nSs=0,iSs=1,Qrr=2,oSs=3,qrr=4,sSs=5,aSs=6,Ee=_e.handleUnexpected,uFn=_e.handleChangeCipherSpec,HA=_e.handleAlert,lv=_e.handleHandshake,dFn=_e.handleApplicationData,GA=_e.handleHeartbeat,jrr=[];jrr[_e.ConnectionEnd.client]=[[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[uFn,HA,Ee,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,dFn,GA],[Ee,HA,lv,Ee,GA]];jrr[_e.ConnectionEnd.server]=[[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,Ee,GA],[uFn,HA,Ee,Ee,GA],[Ee,HA,lv,Ee,GA],[Ee,HA,lv,dFn,GA],[Ee,HA,lv,Ee,GA]];var Mj=_e.handleHelloRequest,cSs=_e.handleServerHello,fFn=_e.handleCertificate,cFn=_e.handleServerKeyExchange,Frr=_e.handleCertificateRequest,oot=_e.handleServerHelloDone,pFn=_e.handleFinished,aot=[];aot[_e.ConnectionEnd.client]=[[Ee,Ee,cSs,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,fFn,cFn,Frr,oot,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn,Frr,oot,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Frr,oot,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,oot,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,pFn],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Mj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];var lSs=_e.handleClientHello,uSs=_e.handleClientKeyExchange,dSs=_e.handleCertificateVerify;aot[_e.ConnectionEnd.server]=[[Ee,lSs,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,fFn,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,uSs,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,dSs,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,pFn],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];_e.generateKeys=function(t,e){var r=cot,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===_e.Versions.TLS_1_0.major&&t.version.minor===_e.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};_e.createConnectionState=function(t){var e=t.entity===_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.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:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=_e.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 _e.CompressionMethod.none:break;case _e.CompressionMethod.deflate:n.read.compressFunction=Y1s,n.write.compressFunction=z1s;break;default:throw new Error("Unsupported compression algorithm.")}}return n};_e.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Jt.util.createBuffer();return r.putInt32(e),r.putBytes(Jt.random.getBytes(28)),r};_e.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};_e.createAlert=function(t,e){var r=Jt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),_e.createRecord(t,{type:_e.ContentType.alert,data:r})};_e.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Jt.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=Jt.util.createBuffer();return A.putByte(_e.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Nw(A,1,Jt.util.createBuffer(m)),Nw(A,2,e),Nw(A,1,s),h>0&&Nw(A,2,l),A};_e.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Nw(n,1,Jt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};_e.createCertificate=function(t){var e=t.entity===_e.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=Jt.util.createBuffer();if(r!==null)try{Jt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(_e.HandshakeType.server_key_exchange),r.putInt24(e)),r};_e.getClientSignature=function(t,e){var r=Jt.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=Jt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};_e.createCertificateVerify=function(t,e){var r=e.length+2,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};_e.createCertificateRequest=function(t){var e=Jt.util.createBuffer();e.putByte(1);var r=Jt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Jt.pki.distinguishedNameToAsn1(o.subject),c=Jt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Jt.util.createBuffer();return u.putByte(_e.HandshakeType.certificate_request),u.putInt24(l),Nw(u,1,e),Nw(u,2,r),u};_e.createServerHelloDone=function(t){var e=Jt.util.createBuffer();return e.putByte(_e.HandshakeType.server_hello_done),e.putInt24(0),e};_e.createChangeCipherSpec=function(){var t=Jt.util.createBuffer();return t.putByte(1),t};_e.createFinished=function(t){var e=Jt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===_e.ConnectionEnd.client,n=t.session.sp,o=12,s=cot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Jt.util.createBuffer();return l.putByte(_e.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};_e.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Jt.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(Jt.random.getBytes(s)),n};_e.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===_e.ContentType.handshake||e.type===_e.ContentType.alert||e.type===_e.ContentType.change_cipher_spec))){if(e.type===_e.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()<=_e.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>_e.MaxFragment;)n.push(_e.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o.slice(0,_e.MaxFragment))})),o=o.slice(_e.MaxFragment);o.length>0&&n.push(_e.createRecord(t,{type:e.type,data:Jt.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=Jt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};_e.createConnection=function(t){var e=null;t.caStore?Jt.util.isArray(t.caStore)?e=Jt.pki.createCaStore(t.caStore):e=t.caStore:e=Jt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in _e.CipherSuites)r.push(_e.CipherSuites[n])}var o=t.server?_e.ConnectionEnd.server:_e.ConnectionEnd.client,s=t.sessionCache?_e.createSessionCache(t.sessionCache):null,c={version:{major:_e.Version.major,minor:_e.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:Jt.util.createBuffer(),tlsData:Jt.util.createBuffer(),data:Jt.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===_e.ConnectionEnd.client?"client":"server"),h.send&&(_e.queue(f,_e.createAlert(f,h.alert)),_e.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:_e.Version.major,minor:_e.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===_e.ConnectionEnd.client?K1s:nSs,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=_e.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-_e.ContentType.change_cipher_spec,g=jrr[f.entity][f.expect];m in g?g[m](f,h):_e.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:Jt.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:_e.Alert.Level.fatal,description:_e.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:Jt.md.md5.create(),sha1:Jt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=_e.createRandom().getBytes(),c.open=!0,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.handshake,data:_e.createClientHello(c)})),_e.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 _e.queue(c,_e.createRecord(c,{type:_e.ContentType.application_data,data:Jt.util.createBuffer(f)})),_e.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Jt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_request,f,h)})),_e.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,_e.queue(c,_e.createAlert(c,{level:_e.Alert.Level.warning,description:_e.Alert.Description.close_notify})),_e.flush(c)),c.closed(c)),c.reset(f)},c};hFn.exports=Jt.tls=Jt.tls||{};for(sot in _e)typeof _e[sot]!="function"&&(Jt.tls[sot]=_e[sot]);var sot;Jt.tls.prf_tls1=cot;Jt.tls.hmac_sha1=W1s;Jt.tls.createSessionCache=_e.createSessionCache;Jt.tls.createConnection=_e.createConnection});var AFn=I((uof,gFn)=>{p();var Oj=As();wj();Hrr();var Mw=gFn.exports=Oj.tls;Mw.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=Mw.BulkCipherAlgorithm.aes,t.cipher_type=Mw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Mw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:mFn};Mw.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=Mw.BulkCipherAlgorithm.aes,t.cipher_type=Mw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Mw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:mFn};function mFn(t,e,r){var n=e.entity===Oj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Oj.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:Oj.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=gSs,t.write.cipherFunction=pSs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Mw.hmac_sha1}a(mFn,"initConnectionState");function pSs(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===Mw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Oj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=Mw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(hSs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(pSs,"encrypt_aes_cbc_sha1");function hSs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(hSs,"encrypt_aes_cbc_sha1_padding");function mSs(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=Oj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=ASs(e.macKey,c,u)&&r,r}a(gSs,"decrypt_aes_cbc_sha1");function ASs(t,e,r){var n=Oj.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(ASs,"compareMacs")});var Vrr=I((pof,vFn)=>{p();var ld=As();v5();cc();var cPe=vFn.exports=ld.sha512=ld.sha512||{};ld.md.sha512=ld.md.algorithms.sha512=cPe;var EFn=ld.sha384=ld.sha512.sha384=ld.sha512.sha384||{};EFn.create=function(){return cPe.create("SHA-384")};ld.md.sha384=ld.md.algorithms.sha384=EFn;ld.sha512.sha256=ld.sha512.sha256||{create:a(function(){return cPe.create("SHA-512/256")},"create")};ld.md["sha512/256"]=ld.md.algorithms["sha512/256"]=ld.sha512.sha256;ld.sha512.sha224=ld.sha512.sha224||{create:a(function(){return cPe.create("SHA-512/224")},"create")};ld.md["sha512/224"]=ld.md.algorithms["sha512/224"]=ld.sha512.sha224;cPe.create=function(t){if(_Fn||ySs(),typeof t>"u"&&(t="SHA-512"),!(t in yZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=yZ[t],r=null,n=ld.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),yFn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=ld.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Grr.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],j=U[0],Q=U[1],n=((j>>>19|Q<<13)^(Q>>>29|j<<3)^j>>>6)>>>0,o=((j<<13|Q>>>19)^(Q<<3|j>>>29)^(j<<26|Q>>>6))>>>0,W=e[O-15],j=W[0],Q=W[1],s=((j>>>1|Q<<31)^(j>>>8|Q<<24)^j>>>7)>>>0,c=((j<<31|Q>>>1)^(j<<24|Q>>>8)^(j<<25|Q>>>7))>>>0,Y=e[O-7],V=e[O-16],Q=o+Y[1]+c+V[1],e[O][0]=n+Y[0]+s+V[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],L=t[6][0],B=t[6][1],q=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=(L^x&(D^L))>>>0,m=(B^P&(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,Q=M+f+m+$rr[O][1]+e[O][1],n=q+d+h+$rr[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,q=L,M=B,L=D,B=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]+B,t[6][0]=t[6][0]+L+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+q+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,z-=128}}a(yFn,"_update")});var CFn=I(Wrr=>{p();var ESs=As();b2();var Ng=ESs.asn1;Wrr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Wrr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ng.Class.UNIVERSAL,type:Ng.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var OFn=I((yof,MFn)=>{p();var $A=As();iPe();Rw();Vrr();cc();var wFn=CFn(),_Ss=wFn.publicKeyValidator,vSs=wFn.privateKeyValidator;typeof bFn>"u"&&(bFn=$A.jsbn.BigInteger);var bFn,Yrr=$A.util.ByteBuffer,ub=typeof Buffer>"u"?Uint8Array:Buffer;$A.pki=$A.pki||{};MFn.exports=$A.pki.ed25519=$A.ed25519=$A.ed25519||{};var ta=$A.ed25519;ta.constants={};ta.constants.PUBLIC_KEY_BYTE_LENGTH=32;ta.constants.PRIVATE_KEY_BYTE_LENGTH=64;ta.constants.SEED_BYTE_LENGTH=32;ta.constants.SIGN_BYTE_LENGTH=64;ta.constants.HASH_BYTE_LENGTH=64;ta.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=$A.random.getBytesSync(ta.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==ta.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ta.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=HF({message:e,encoding:"binary"});for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=new ub(ta.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return TSs(r,n),{publicKey:r,privateKey:n}};ta.privateKeyFromAsn1=function(t){var e={},r=[],n=$A.asn1.validate(t,vSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=$A.asn1.derToOid(e.privateKeyOid),c=$A.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=HF({message:$A.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};ta.publicKeyFromAsn1=function(t){var e={},r=[],n=$A.asn1.validate(t,_Ss,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=$A.asn1.derToOid(e.publicKeyOid),c=$A.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==ta.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return HF({message:l,encoding:"binary"})};ta.publicKeyFromPrivateKey=function(t){t=t||{};var e=HF({message:t.privateKey,encoding:"binary"});if(e.length!==ta.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ta.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function HF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof ub)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 Yrr(e,r)}else if(!(e instanceof Yrr))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 ub(e.length()),o=0;o=0;--r){if(t[e+r]lPe[r])return!1}return!1}a(wSs,"_isCanonicalSignatureScalar");function RFn(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)*lPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*lPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(RFn,"modL");function Jrr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;RFn(t,e)}a(Jrr,"reduce");function Zrr(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i(),d=$i(),f=$i();Zfe(r,t[1],t[0]),Zfe(f,e[1],e[0]),zl(r,r,f),Jfe(n,t[0],t[1]),Jfe(f,e[0],e[1]),zl(n,n,f),zl(o,t[3],e[3]),zl(o,o,bSs),zl(s,t[2],e[2]),Jfe(s,s,s),Zfe(c,n,r),Zfe(l,s,o),Jfe(u,s,o),Jfe(d,n,r),zl(t[0],c,l),zl(t[1],d,u),zl(t[2],u,l),zl(t[3],c,d)}a(Zrr,"add");function IFn(t,e,r){for(var n=0;n<4;++n)NFn(t[n],e[n],r)}a(IFn,"cswap");function Xrr(t,e){var r=$i(),n=$i(),o=$i();NSs(o,e[2]),zl(r,e[0],o),zl(n,e[1],o),uot(t,n),t[31]^=PFn(r)<<7}a(Xrr,"pack");function uot(t,e){var r,n,o,s=$i(),c=$i();for(r=0;r<16;++r)c[r]=e[r];for(zrr(c),zrr(c),zrr(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,NFn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(uot,"pack25519");function RSs(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i();return Lj(t[2],lot),kSs(t[1],e),EZ(o,t[1]),zl(s,o,CSs),Zfe(o,o,t[2]),Jfe(s,t[2],s),EZ(c,s),EZ(l,c),zl(u,l,c),zl(r,u,o),zl(r,r,s),PSs(r,r),zl(r,r,o),zl(r,r,s),zl(r,r,s),zl(t[0],r,s),EZ(n,t[0]),zl(n,n,s),xFn(n,o)&&zl(t[0],t[0],SSs),EZ(n,t[0]),zl(n,n,s),xFn(n,o)?-1:(PFn(t[0])===e[31]>>7&&Zfe(t[0],Krr,t[0]),zl(t[3],t[0],t[1]),0)}a(RSs,"unpackneg");function kSs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(kSs,"unpack25519");function PSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)EZ(r,r),n!==1&&zl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(PSs,"pow2523");function xFn(t,e){var r=new ub(32),n=new ub(32);return uot(r,t),uot(n,e),kFn(r,0,n,0)}a(xFn,"neq25519");function kFn(t,e,r,n){return DSs(t,e,r,n,32)}a(kFn,"crypto_verify_32");function DSs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(DSs,"vn");function PFn(t){var e=new ub(32);return uot(e,t),e[0]&1}a(PFn,"par25519");function DFn(t,e,r){var n,o;for(Lj(t[0],Krr),Lj(t[1],lot),Lj(t[2],lot),Lj(t[3],Krr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,IFn(t,e,n),Zrr(e,t),Zrr(t,t),IFn(t,e,n)}a(DFn,"scalarmult");function enr(t,e){var r=[$i(),$i(),$i(),$i()];Lj(r[0],SFn),Lj(r[1],TFn),Lj(r[2],lot),zl(r[3],SFn,TFn),DFn(t,r,e)}a(enr,"scalarbase");function Lj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Lj,"set25519");function NSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)EZ(r,r),n!==2&&n!==4&&zl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(NSs,"inv25519");function zrr(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(zrr,"car25519");function NFn(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(NFn,"sel25519");function $i(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var yT=As();cc();Rw();iPe();FFn.exports=yT.kem=yT.kem||{};var LFn=yT.jsbn.BigInteger;yT.kem.rsa={};yT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||yT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new LFn(yT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(LFn.ONE)<=0);l=yT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=yT.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};yT.kem.kdf1=function(t,e){BFn(this,t,0,e||t.digestLength)};yT.kem.kdf2=function(t,e){BFn(this,t,1,e||t.digestLength)};function BFn(t,e,r,n){t.generate=function(o,s){for(var c=new yT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new yT.util.ByteBuffer,d=r;d{p();var ma=As();cc();jFn.exports=ma.log=ma.log||{};ma.log.levels=["none","error","warning","info","debug","verbose","max"];var dot={},nnr=[],fPe=null;ma.log.LEVEL_LOCKED=2;ma.log.NO_LEVEL_CHECK=4;ma.log.INTERPOLATE=8;for(R5=0;R5"u"||e?t.flags|=ma.log.LEVEL_LOCKED:t.flags&=~ma.log.LEVEL_LOCKED};ma.log.addLogger=function(t){nnr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(QFn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},pPe=a(function(t,e){ma.log.prepareStandard(e);var r=QFn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Xfe=ma.log.makeLogger(pPe)):(pPe=a(function(e,r){ma.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Xfe=ma.log.makeLogger(pPe)),ma.log.setLevel(Xfe,"debug"),ma.log.addLogger(Xfe),fPe=Xfe):console={log:a(function(){},"log")};var Xfe,QFn,pPe;fPe!==null&&typeof window<"u"&&window.location&&(dPe=new URL(window.location.href).searchParams,dPe.has("console.level")&&ma.log.setLevel(fPe,dPe.get("console.level").slice(-1)[0]),dPe.has("console.lock")&&(qFn=dPe.get("console.lock").slice(-1)[0],qFn=="true"&&ma.log.lock(fPe)));var dPe,qFn;ma.log.consoleLogger=fPe});var $Fn=I((xof,GFn)=>{p();GFn.exports=v5();Git();Vfe();Arr();Vrr()});var zFn=I((Rof,WFn)=>{p();var Xr=As();wj();b2();rPe();Rj();fZ();Prr();Rw();cc();iot();var Xe=Xr.asn1,uv=WFn.exports=Xr.pkcs7=Xr.pkcs7||{};uv.messageFromPem=function(t){var e=Xr.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=Xe.fromDer(e.body);return uv.messageFromAsn1(n)};uv.messageToPem=function(t,e){var r={type:"PKCS7",body:Xe.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};uv.messageFromAsn1=function(t){var e={},r=[];if(!Xe.validate(t,uv.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=Xe.derToOid(e.contentType),s;switch(o){case Xr.pki.oids.envelopedData:s=uv.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=uv.createEncryptedData();break;case Xr.pki.oids.signedData:s=uv.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};uv.createSignedData=function(){var t=null;return t={type:Xr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(onr(t,n,uv.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(Xe.create(Xe.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SET,!0,t.signerInfos)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.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=Xr.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=Xr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Xr.pki.oids.sha1;switch(u){case Xr.pki.oids.sha1:case Xr.pki.oids.sha256:case Xr.pki.oids.sha384:case Xr.pki.oids.sha512:case Xr.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=Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var um=As();wj();jfe();Git();Vfe();cc();var pot=YFn.exports=um.ssh=um.ssh||{};pot.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=cm.util.createBuffer();Xfe(c,n),w5(c,t.e),w5(c,t.n);var l=cm.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r -`,s+=l;var d=cm.util.createBuffer();w5(d,t.d),w5(d,t.p),w5(d,t.q),w5(d,t.qInv);var f;if(!e)f=cm.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=sot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=cm.util.createBuffer();g.putBuffer(sot("\0\0\0\0",e)),g.putBuffer(sot("\0\0\0",e));var A=cm.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(cm.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=cm.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r +`;var c=um.util.createBuffer();epe(c,n),k5(c,t.e),k5(c,t.n);var l=um.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r +`,s+=l;var d=um.util.createBuffer();k5(d,t.d),k5(d,t.p),k5(d,t.q),k5(d,t.qInv);var f;if(!e)f=um.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=fot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=um.util.createBuffer();g.putBuffer(fot("\0\0\0\0",e)),g.putBuffer(fot("\0\0\0",e));var A=um.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(um.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=um.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r Private-Lines: `+u+`\r -`,s+=f;var E=sot("putty-private-key-file-mac-key",e),_=cm.util.createBuffer();Xfe(_,n),Xfe(_,o),Xfe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=cm.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r +`,s+=f;var E=fot("putty-private-key-file-mac-key",e),_=um.util.createBuffer();epe(_,n),epe(_,o),epe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=um.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r Private-MAC: `+v.digest().toHex()+`\r -`,s};aot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=cm.util.createBuffer();return Xfe(n,r),w5(n,t.e),w5(n,t.n),r+" "+cm.util.encode64(n.bytes())+" "+e};aot.privateKeyToOpenSSH=function(t,e){return e?cm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):cm.pki.privateKeyToPem(t)};aot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||cm.md.md5.create(),n="ssh-rsa",o=cm.util.createBuffer();Xfe(o,n),w5(o,t.e),w5(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 w5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=cm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(w5,"_addBigIntegerToBuffer");function Xfe(t,e){t.putInt32(e.length),t.putString(e)}a(Xfe,"_addStringToBuffer");function sot(){for(var t=cm.md.sha1.create(),e=arguments.length,r=0;r{p();VFn.exports=As();Tj();fFn();v2();Pit();Xke();kFn();qfe();MFn();FFn();QFn();wrr();jit();uZ();Crr();Prr();HFn();Nrr();Srr();hrr();Yit();xw();Arr();$Fn();Urr();ac()});var KFn=I(yZ=>{"use strict";p();Object.defineProperty(yZ,"__esModule",{value:!0});yZ.convert=yZ.Format=void 0;var dPe=WFn(),Mj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Mj=yZ.Format||(yZ.Format={}));function zFn(t){var e=dPe.pki.pemToDer(t),r=dPe.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(zFn,"myASN");function ISs(t){var e=zFn(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(ISs,"txtFormat");function YFn(t,e){switch(e){case Mj.der:return dPe.pki.pemToDer(t);case Mj.pem:return t;case Mj.txt:return ISs(t);case Mj.asn1:return zFn(t);case Mj.fingerprint:var r=dPe.md.sha1.create(),n=YFn(t,Mj.der);return r.update(n.getBytes()),r.digest().toHex();case Mj.x509:return dPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(YFn,"convert");yZ.convert=YFn});var r8n=I(db=>{"use strict";p();var Oj=db&&db.__assign||function(){return Oj=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})(rnr.Agent),(0,ZFn.setGlobalDispatcher)(new ZFn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");db.addToGlobalAgent=wSs});var n8n=I((bof,nnr)=>{p();function RSs(){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(RSs,"all");process.platform!=="win32"?nnr.exports.all=()=>[]:nnr.exports.all=RSs});var al=I((kof,l8n)=>{"use strict";p();l8n.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 ynr=I((Dof,p8n)=>{"use strict";p();var tpe=0,fnr=1e3,pnr=(fnr>>1)-1,Lj,hnr=Symbol("kFastTimer"),HF=[],mnr=-2,gnr=-1,d8n=0,u8n=1;function Anr(){tpe+=pnr;let t=0,e=HF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=gnr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===gnr?(r._state=mnr,--e!==0&&(HF[t]=HF[e])):++t}HF.length=e,HF.length!==0&&f8n()}a(Anr,"onTick");function f8n(){Lj?.refresh?Lj.refresh():(clearTimeout(Lj),Lj=setTimeout(Anr,pnr),Lj?.unref())}a(f8n,"refreshTimeout");var pot=class{static{a(this,"FastTimer")}[hnr]=!0;_state=mnr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===mnr&&HF.push(this),(!Lj||HF.length===1)&&f8n(),this._state=d8n}clear(){this._state=gnr,this._idleStart=-1}};p8n.exports={setTimeout(t,e,r){return e<=fnr?setTimeout(t,e,r):new pot(t,e,r)},clearTimeout(t){t[hnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new pot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return tpe},tick(t=0){tpe+=t-fnr+1,Anr(),Anr()},reset(){tpe=0,HF.length=0,clearTimeout(Lj),Lj=null},kFastTimer:hnr}});var ao=I((Oof,F8n)=>{"use strict";p();var h8n=Symbol.for("undici.error.UND_ERR"),ld=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[h8n]===!0}get[h8n](){return!0}},m8n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),Enr=class extends ld{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[m8n]===!0}get[m8n](){return!0}},g8n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),_nr=class extends ld{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[g8n]===!0}get[g8n](){return!0}},A8n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),vnr=class extends ld{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[A8n]===!0}get[A8n](){return!0}},y8n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Cnr=class extends ld{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[y8n]===!0}get[y8n](){return!0}},E8n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),bnr=class extends ld{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[E8n]===!0}get[E8n](){return!0}},_8n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Snr=class extends ld{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[_8n]===!0}get[_8n](){return!0}},v8n=Symbol.for("undici.error.UND_ERR_ABORT"),hot=class extends ld{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[v8n]===!0}get[v8n](){return!0}},C8n=Symbol.for("undici.error.UND_ERR_ABORTED"),Tnr=class extends hot{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[C8n]===!0}get[C8n](){return!0}},b8n=Symbol.for("undici.error.UND_ERR_INFO"),Inr=class extends ld{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[b8n]===!0}get[b8n](){return!0}},S8n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),xnr=class extends ld{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[S8n]===!0}get[S8n](){return!0}},T8n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),wnr=class extends ld{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[T8n]===!0}get[T8n](){return!0}},I8n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Rnr=class extends ld{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[I8n]===!0}get[I8n](){return!0}},x8n=Symbol.for("undici.error.UND_ERR_CLOSED"),knr=class extends ld{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[x8n]===!0}get[x8n](){return!0}},w8n=Symbol.for("undici.error.UND_ERR_SOCKET"),Pnr=class extends ld{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[w8n]===!0}get[w8n](){return!0}},R8n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Dnr=class extends ld{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[R8n]===!0}get[R8n](){return!0}},k8n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Nnr=class extends ld{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[k8n]===!0}get[k8n](){return!0}},P8n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Mnr=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[P8n]===!0}get[P8n](){return!0}},D8n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Onr=class extends ld{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[D8n]===!0}get[D8n](){return!0}},N8n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Lnr=class extends ld{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[N8n]===!0}get[N8n](){return!0}},M8n=Symbol.for("undici.error.UND_ERR_RESPONSE"),Bnr=class extends ld{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[M8n]===!0}get[M8n](){return!0}},O8n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Fnr=class extends ld{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[O8n]===!0}get[O8n](){return!0}},L8n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Unr=class extends ld{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[L8n]===!0}get[L8n](){return!0}},Qnr=class extends ld{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},B8n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),qnr=class extends ld{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[B8n]===!0}get[B8n](){return!0}};F8n.exports={AbortError:hot,HTTPParserError:Mnr,UndiciError:ld,HeadersTimeoutError:_nr,HeadersOverflowError:vnr,BodyTimeoutError:Cnr,RequestContentLengthMismatchError:xnr,ConnectTimeoutError:Enr,InvalidArgumentError:bnr,InvalidReturnValueError:Snr,RequestAbortedError:Tnr,ClientDestroyedError:Rnr,ClientClosedError:knr,InformationalError:Inr,SocketError:Pnr,NotSupportedError:Dnr,ResponseContentLengthMismatchError:wnr,BalancedPoolMissingUpstreamError:Nnr,ResponseExceededMaxSizeError:Onr,RequestRetryError:Lnr,ResponseError:Bnr,SecureProxyConnectionError:Fnr,MaxOriginsReachedError:Unr,Socks5ProxyError:Qnr,MessageSizeExceededError:qnr}});var got=I((Fof,Q8n)=>{"use strict";p();var jnr=["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"],mot={};Object.setPrototypeOf(mot,null);var U8n={};Object.setPrototypeOf(U8n,null);function PSs(t){let e=U8n[t];return e===void 0&&(e=Buffer.from(t)),e}a(PSs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:q8n,headerNameLowerCasedRecord:DSs}=got(),Hnr=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 fPe=require("node:assert"),{kDestroyed:z8n,kBodyUsed:rpe,kListeners:Eot,kBody:$8n}=al(),{IncomingMessage:NSs}=require("node:http"),Y8n=require("node:stream"),MSs=require("node:net"),{stringify:OSs}=require("node:querystring"),{EventEmitter:LSs}=require("node:events"),yot=ynr(),{InvalidArgumentError:Ng,ConnectTimeoutError:BSs}=ao(),{headerNameLowerCasedRecord:FSs}=got(),{tree:K8n}=G8n(),[USs,QSs]=process.versions.node.split(".",2).map(t=>Number(t)),vot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[$8n]=e,this[rpe]=!1}async*[Symbol.asyncIterator](){fPe(!this[rpe],"disturbed"),this[rpe]=!0,yield*this[$8n]}};function V8n(){}a(V8n,"noop");function qSs(t){return Cot(t)?(r6n(t)===0&&t.on("data",function(){fPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[rpe]=!1,LSs.prototype.on.call(t,"data",function(){this[rpe]=!0})),t):t&&typeof t.pipeTo=="function"?new vot(t):t&&a6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&t6n(t)?new vot(t):t}a(qSs,"wrapRequestBody");function Cot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Cot,"isStream");function J8n(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(J8n,"isBlobLike");function Z8n(t){return t.includes("?")||t.includes("#")}a(Z8n,"pathHasQueryOrFragment");function jSs(t,e){if(Z8n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=OSs(e);return r&&(t+="?"+r),t}a(jSs,"serializePathWithQuery");function X8n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(X8n,"isValidPort");function _ot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(_ot,"isHttpOrHttpsPrefixed");function e6n(t){if(typeof t=="string"){if(t=new URL(t),!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Ng("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&X8n(t.port)===!1)throw new Ng("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 Ng("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Ng("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Ng("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Ng("Invalid URL origin: the origin must be a string or null/undefined.");if(!_ot(t.origin||t.protocol))throw new Ng("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(!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(e6n,"parseURL");function HSs(t){if(t=e6n(t),t.pathname!=="/"||t.search||t.hash)throw new Ng("invalid url");return t}a(HSs,"parseOrigin");function GSs(t){if(t[0]==="["){let r=t.indexOf("]");return fPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(GSs,"getHostname");function $Ss(t){if(!t)return null;fPe(typeof t=="string");let e=GSs(t);return MSs.isIP(e)?"":e}a($Ss,"getServerName");function VSs(t){return JSON.parse(JSON.stringify(t))}a(VSs,"deepClone");function WSs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(WSs,"isAsyncIterable");function t6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(t6n,"isIterable");function zSs(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(zSs,"hasSafeIterator");function r6n(t){if(t==null)return 0;if(Cot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(J8n(t))return t.size!=null?t.size:null;if(s6n(t))return t.byteLength}return null}a(r6n,"bodyLength");function n6n(t){return t&&!!(t.destroyed||t[z8n]||Y8n.isDestroyed?.(t))}a(n6n,"isDestroyed");function i6n(t,e){t==null||!Cot(t)||n6n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===NSs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[z8n]=!0))}a(i6n,"destroy");var YSs=/timeout=(\d+)/;function KSs(t){let e=t.match(YSs);return e?parseInt(e[1],10)*1e3:null}a(KSs,"parseKeepAliveTimeout");function o6n(t){return typeof t=="string"?FSs[t]??t.toLowerCase():K8n.lookup(t)??t.toString("latin1").toLowerCase()}a(o6n,"headerNameToString");function JSs(t){return K8n.lookup(t)??t.toString("latin1").toLowerCase()}a(JSs,"bufferToLowerCasedHeaderName");function ZSs(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(ZSs,"parseHeaders");function XSs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(eTs,"encodeRawHeaders");function s6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(s6n,"isBuffer");function tTs(t,e,r){if(!t||typeof t!="object")throw new Ng("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Ng("invalid onConnect method");if(typeof t.onError!="function")throw new Ng("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Ng("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Ng("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Ng("invalid onHeaders method");if(typeof t.onData!="function")throw new Ng("invalid onData method");if(typeof t.onComplete!="function")throw new Ng("invalid onComplete method")}}}a(tTs,"assertRequestHandler");function rTs(t){return!!(t&&(Y8n.isDisturbed(t)||t[rpe]))}a(rTs,"isDisturbed");function nTs(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(nTs,"getSocketInfo");function iTs(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(iTs,"ReadableStreamFrom");function a6n(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(a6n,"isFormDataLike");function oTs(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(oTs,"addAbortListener");var c6n=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 sTs(t){return c6n[t]===1}a(sTs,"isTokenCharCode");var aTs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function cTs(t){if(t.length>=12)return aTs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return V8n;let r=null,n=null,o=yot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>W8n(t.deref(),e))})},e.timeout);return()=>{yot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return V8n;let r=null,n=yot.setFastTimeout(()=>{r=setImmediate(()=>{W8n(t.deref(),e)})},e.timeout);return()=>{yot.clearFastTimeout(n),clearImmediate(r)}};function W8n(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)`,i6n(t,new BSs(r))}a(W8n,"onConnectTimeout");function ATs(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(ATs,"getProtocolFromUrlString");var l6n=Object.create(null);l6n.enumerable=!0;var Gnr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},u6n={...Gnr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Gnr,null);Object.setPrototypeOf(u6n,null);d6n.exports={kEnumerableProperty:l6n,isDisturbed:rTs,isBlobLike:J8n,parseOrigin:HSs,parseURL:e6n,getServerName:$Ss,isStream:Cot,isIterable:t6n,hasSafeIterator:zSs,isAsyncIterable:WSs,isDestroyed:n6n,headerNameToString:o6n,bufferToLowerCasedHeaderName:JSs,addListener:pTs,removeAllListeners:hTs,errorRequest:mTs,parseRawHeaders:XSs,encodeRawHeaders:eTs,parseHeaders:ZSs,parseKeepAliveTimeout:KSs,destroy:i6n,bodyLength:r6n,deepClone:VSs,ReadableStreamFrom:iTs,isBuffer:s6n,assertRequestHandler:tTs,getSocketInfo:nTs,isFormDataLike:a6n,pathHasQueryOrFragment:Z8n,serializePathWithQuery:jSs,addAbortListener:oTs,isValidHTTPToken:cTs,isValidHeaderValue:uTs,isTokenCharCode:sTs,parseRangeHeader:fTs,normalizedMethodRecordsBase:Gnr,normalizedMethodRecords:u6n,isValidPort:X8n,isHttpOrHttpsPrefixed:_ot,nodeMajor:USs,nodeMinor:QSs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:qSs,setupConnectTimeout:gTs,getProtocolFromUrlString:ATs}});var Wnr=I((Wof,g6n)=>{"use strict";p();var{kConnected:f6n,kPending:p6n,kRunning:h6n,kSize:m6n,kFree:yTs,kQueued:ETs}=al(),$nr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[f6n],this.pending=e[p6n],this.running=e[h6n],this.size=e[m6n]}},Vnr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[f6n],this.free=e[yTs],this.pending=e[p6n],this.queued=e[ETs],this.running=e[h6n],this.size=e[m6n]}};g6n.exports={ClientStats:$nr,PoolStats:Vnr}});var Bj=I((Kof,y6n)=>{"use strict";p();var cl=require("node:diagnostics_channel"),Jnr=require("node:util"),EZ=Jnr.debuglog("undici"),pPe=Jnr.debuglog("fetch"),bot=Jnr.debuglog("websocket"),AT={beforeConnect:cl.channel("undici:client:beforeConnect"),connected:cl.channel("undici:client:connected"),connectError:cl.channel("undici:client:connectError"),sendHeaders:cl.channel("undici:client:sendHeaders"),create:cl.channel("undici:request:create"),bodySent:cl.channel("undici:request:bodySent"),bodyChunkSent:cl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:cl.channel("undici:request:bodyChunkReceived"),headers:cl.channel("undici:request:headers"),trailers:cl.channel("undici:request:trailers"),error:cl.channel("undici:request:error"),open:cl.channel("undici:websocket:open"),close:cl.channel("undici:websocket:close"),socketError:cl.channel("undici:websocket:socket_error"),ping:cl.channel("undici:websocket:ping"),pong:cl.channel("undici:websocket:pong"),proxyConnected:cl.channel("undici:proxy:connected")},znr=!1;function A6n(t=EZ){if(!znr){if(AT.beforeConnect.hasSubscribers||AT.connected.hasSubscribers||AT.connectError.hasSubscribers||AT.sendHeaders.hasSubscribers){znr=!0;return}znr=!0,cl.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)}),cl.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)}),cl.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)}),cl.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(A6n,"trackClientEvents");var Ynr=!1;function _Ts(t=EZ){if(!Ynr){if(AT.headers.hasSubscribers||AT.trailers.hasSubscribers||AT.error.hasSubscribers){Ynr=!0;return}Ynr=!0,cl.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)}),cl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),cl.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(_Ts,"trackRequestEvents");var Knr=!1;function vTs(t=bot){if(!Knr){if(AT.open.hasSubscribers||AT.close.hasSubscribers||AT.socketError.hasSubscribers||AT.ping.hasSubscribers||AT.pong.hasSubscribers){Knr=!0;return}Knr=!0,cl.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")}),cl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),cl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),cl.subscribe("undici:websocket:ping",e=>{t("ping received")}),cl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(vTs,"trackWebSocketEvents");(EZ.enabled||pPe.enabled)&&(A6n(pPe.enabled?pPe:EZ),_Ts(pPe.enabled?pPe:EZ));bot.enabled&&(A6n(EZ.enabled?EZ:bot),vTs(bot));y6n.exports={channels:AT}});var v6n=I((Xof,_6n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:CTs}=ao(),R5=require("node:assert"),{isValidHTTPToken:Znr,isValidHeaderValue:Xnr,isStream:bTs,destroy:STs,isBuffer:TTs,isFormDataLike:ITs,isIterable:xTs,hasSafeIterator:wTs,isBlobLike:RTs,serializePathWithQuery:kTs,assertRequestHandler:PTs,getServerName:DTs,normalizedMethodRecords:NTs,getProtocolFromUrlString:MTs}=Po(),{channels:fb}=Bj(),{headerNameLowerCasedRecord:E6n}=got(),OTs=/[^\u0021-\u00ff]/;function LTs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(LTs,"isValidContentLengthHeaderValue");var Nw=Symbol("handler"),eir=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(OTs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(NTs[n]===void 0&&!Znr(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!Xnr(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(bTs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){STs(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(TTs(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(ITs(o)||xTs(o)||RTs(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?kTs(r,c):r,this.origin=e,this.protocol=MTs(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:BTs}=ao();b6n.exports=class C6n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new C6n(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"),tir(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"),tir(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"),tir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new BTs("invalid onError method");this.#e.onError?.(r)}};function tir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(tir,"toRawHeaderValue")});var mPe=I((osf,S6n)=>{"use strict";p();var FTs=require("node:events"),UTs=hPe(),QTs=a(t=>(e,r)=>t(e,UTs.wrap(r)),"wrapInterceptor"),rir=class extends FTs{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=QTs(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")})}};S6n.exports=rir});var x6n=I((csf,I6n)=>{"use strict";p();var{parseHeaders:nir}=Po(),{InvalidArgumentError:qTs}=ao(),iir=Symbol("resume"),oir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[iir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[iir]?.())}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}};I6n.exports=class T6n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new T6n(e):e}onConnect(e,r){this.#t=new oir(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#t.rawHeaders=r,this.#e.onRequestUpgrade?.(this.#t,e,nir(r),n)}onHeaders(e,r,n,o){return this.#t[iir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,nir(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#t.rawTrailers=e,this.#e.onResponseEnd?.(this.#t,nir(e))}onError(e){if(!this.#e.onResponseError)throw new qTs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var vZ=I((dsf,w6n)=>{"use strict";p();var jTs=mPe(),HTs=x6n(),{ClientDestroyedError:sir,ClientClosedError:GTs,InvalidArgumentError:Tot}=ao(),{kDestroy:$Ts,kClose:VTs,kClosed:gPe,kDestroyed:npe,kDispatch:WTs}=al(),Fj=Symbol("onDestroyed"),_Z=Symbol("onClosed"),air=Symbol("webSocketOptions"),cir=class extends jTs{static{a(this,"DispatcherBase")}[npe]=!1;[Fj]=null;[gPe]=!1;[_Z]=null;constructor(e){super(),this[air]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[air].maxFragments??131072,maxPayloadSize:this[air].maxPayloadSize??128*1024*1024}}get destroyed(){return this[npe]}get closed(){return this[gPe]}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 Tot("invalid callback");if(this[npe]){let n=new sir;queueMicrotask(()=>e(n,null));return}if(this[gPe]){this[_Z]?this[_Z].push(e):queueMicrotask(()=>e(null,null));return}this[gPe]=!0,this[_Z]??=[],this[_Z].push(e);let r=a(()=>{let n=this[_Z];this[_Z]=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 Tot("invalid callback");if(this[npe]){this[Fj]?this[Fj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new sir),this[npe]=!0,this[Fj]??=[],this[Fj].push(r);let n=a(()=>{let o=this[Fj];this[Fj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new Tot("handler must be an object");r=HTs.unwrap(r);try{if(!e||typeof e!="object")throw new Tot("opts must be an object.");if(this[npe]||this[Fj])throw new sir;if(this[gPe])throw new GTs;return this[WTs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};w6n.exports=cir});var CZ=I((msf,P6n)=>{"use strict";p();var zTs=require("node:net"),R6n=require("node:assert"),k6n=Po(),{InvalidArgumentError:YTs}=ao(),lir,KTs=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 JTs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new YTs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new KTs(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:"){lir||(lir=require("node:tls")),A=A||l.servername||k6n.getServerName(h)||null;let T=A||f;R6n(T);let w=s||u.get(T)||null;g=g||443,v=lir.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 R6n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=zTs.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=k6n.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(JTs,"buildConnector");P6n.exports=JTs});var D6n=I(uir=>{"use strict";p();Object.defineProperty(uir,"__esModule",{value:!0});uir.enumToMap=ZTs;function ZTs(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(ZTs,"enumToMap")});var N6n=I(je=>{"use strict";p();Object.defineProperty(je,"__esModule",{value:!0});je.SPECIAL_HEADERS=je.MINOR=je.MAJOR=je.HTAB_SP_VCHAR_OBS_TEXT=je.QUOTED_STRING=je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS=je.TOKEN=je.HEX=je.URL_CHAR=je.USERINFO_CHARS=je.MARK=je.ALPHANUM=je.NUM=je.HEX_MAP=je.NUM_MAP=je.ALPHA=je.STATUSES_HTTP=je.H_METHOD_MAP=je.METHOD_MAP=je.METHODS_RTSP=je.METHODS_ICE=je.METHODS_HTTP=je.HEADER_STATE=je.FINISH=je.STATUSES=je.METHODS=je.LENIENT_FLAGS=je.FLAGS=je.TYPE=je.ERROR=void 0;var XTs=D6n();je.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};je.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};je.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};je.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};je.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};je.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};je.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};je.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};je.METHODS_HTTP=[je.METHODS.DELETE,je.METHODS.GET,je.METHODS.HEAD,je.METHODS.POST,je.METHODS.PUT,je.METHODS.CONNECT,je.METHODS.OPTIONS,je.METHODS.TRACE,je.METHODS.COPY,je.METHODS.LOCK,je.METHODS.MKCOL,je.METHODS.MOVE,je.METHODS.PROPFIND,je.METHODS.PROPPATCH,je.METHODS.SEARCH,je.METHODS.UNLOCK,je.METHODS.BIND,je.METHODS.REBIND,je.METHODS.UNBIND,je.METHODS.ACL,je.METHODS.REPORT,je.METHODS.MKACTIVITY,je.METHODS.CHECKOUT,je.METHODS.MERGE,je.METHODS["M-SEARCH"],je.METHODS.NOTIFY,je.METHODS.SUBSCRIBE,je.METHODS.UNSUBSCRIBE,je.METHODS.PATCH,je.METHODS.PURGE,je.METHODS.MKCALENDAR,je.METHODS.LINK,je.METHODS.UNLINK,je.METHODS.PRI,je.METHODS.SOURCE,je.METHODS.QUERY];je.METHODS_ICE=[je.METHODS.SOURCE];je.METHODS_RTSP=[je.METHODS.OPTIONS,je.METHODS.DESCRIBE,je.METHODS.ANNOUNCE,je.METHODS.SETUP,je.METHODS.PLAY,je.METHODS.PAUSE,je.METHODS.TEARDOWN,je.METHODS.GET_PARAMETER,je.METHODS.SET_PARAMETER,je.METHODS.REDIRECT,je.METHODS.RECORD,je.METHODS.FLUSH,je.METHODS.GET,je.METHODS.POST];je.METHOD_MAP=(0,XTs.enumToMap)(je.METHODS);je.H_METHOD_MAP=Object.fromEntries(Object.entries(je.METHODS).filter(([t])=>t.startsWith("H")));je.STATUSES_HTTP=[je.STATUSES.CONTINUE,je.STATUSES.SWITCHING_PROTOCOLS,je.STATUSES.PROCESSING,je.STATUSES.EARLY_HINTS,je.STATUSES.RESPONSE_IS_STALE,je.STATUSES.REVALIDATION_FAILED,je.STATUSES.DISCONNECTED_OPERATION,je.STATUSES.HEURISTIC_EXPIRATION,je.STATUSES.MISCELLANEOUS_WARNING,je.STATUSES.OK,je.STATUSES.CREATED,je.STATUSES.ACCEPTED,je.STATUSES.NON_AUTHORITATIVE_INFORMATION,je.STATUSES.NO_CONTENT,je.STATUSES.RESET_CONTENT,je.STATUSES.PARTIAL_CONTENT,je.STATUSES.MULTI_STATUS,je.STATUSES.ALREADY_REPORTED,je.STATUSES.TRANSFORMATION_APPLIED,je.STATUSES.IM_USED,je.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,je.STATUSES.MULTIPLE_CHOICES,je.STATUSES.MOVED_PERMANENTLY,je.STATUSES.FOUND,je.STATUSES.SEE_OTHER,je.STATUSES.NOT_MODIFIED,je.STATUSES.USE_PROXY,je.STATUSES.SWITCH_PROXY,je.STATUSES.TEMPORARY_REDIRECT,je.STATUSES.PERMANENT_REDIRECT,je.STATUSES.BAD_REQUEST,je.STATUSES.UNAUTHORIZED,je.STATUSES.PAYMENT_REQUIRED,je.STATUSES.FORBIDDEN,je.STATUSES.NOT_FOUND,je.STATUSES.METHOD_NOT_ALLOWED,je.STATUSES.NOT_ACCEPTABLE,je.STATUSES.PROXY_AUTHENTICATION_REQUIRED,je.STATUSES.REQUEST_TIMEOUT,je.STATUSES.CONFLICT,je.STATUSES.GONE,je.STATUSES.LENGTH_REQUIRED,je.STATUSES.PRECONDITION_FAILED,je.STATUSES.PAYLOAD_TOO_LARGE,je.STATUSES.URI_TOO_LONG,je.STATUSES.UNSUPPORTED_MEDIA_TYPE,je.STATUSES.RANGE_NOT_SATISFIABLE,je.STATUSES.EXPECTATION_FAILED,je.STATUSES.IM_A_TEAPOT,je.STATUSES.PAGE_EXPIRED,je.STATUSES.ENHANCE_YOUR_CALM,je.STATUSES.MISDIRECTED_REQUEST,je.STATUSES.UNPROCESSABLE_ENTITY,je.STATUSES.LOCKED,je.STATUSES.FAILED_DEPENDENCY,je.STATUSES.TOO_EARLY,je.STATUSES.UPGRADE_REQUIRED,je.STATUSES.PRECONDITION_REQUIRED,je.STATUSES.TOO_MANY_REQUESTS,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,je.STATUSES.LOGIN_TIMEOUT,je.STATUSES.NO_RESPONSE,je.STATUSES.RETRY_WITH,je.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,je.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,je.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,je.STATUSES.INVALID_X_FORWARDED_FOR,je.STATUSES.REQUEST_HEADER_TOO_LARGE,je.STATUSES.SSL_CERTIFICATE_ERROR,je.STATUSES.SSL_CERTIFICATE_REQUIRED,je.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,je.STATUSES.INVALID_TOKEN,je.STATUSES.CLIENT_CLOSED_REQUEST,je.STATUSES.INTERNAL_SERVER_ERROR,je.STATUSES.NOT_IMPLEMENTED,je.STATUSES.BAD_GATEWAY,je.STATUSES.SERVICE_UNAVAILABLE,je.STATUSES.GATEWAY_TIMEOUT,je.STATUSES.HTTP_VERSION_NOT_SUPPORTED,je.STATUSES.VARIANT_ALSO_NEGOTIATES,je.STATUSES.INSUFFICIENT_STORAGE,je.STATUSES.LOOP_DETECTED,je.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,je.STATUSES.NOT_EXTENDED,je.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,je.STATUSES.WEB_SERVER_UNKNOWN_ERROR,je.STATUSES.WEB_SERVER_IS_DOWN,je.STATUSES.CONNECTION_TIMEOUT,je.STATUSES.ORIGIN_IS_UNREACHABLE,je.STATUSES.TIMEOUT_OCCURED,je.STATUSES.SSL_HANDSHAKE_FAILED,je.STATUSES.INVALID_SSL_CERTIFICATE,je.STATUSES.RAILGUN_ERROR,je.STATUSES.SITE_IS_OVERLOADED,je.STATUSES.SITE_IS_FROZEN,je.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,je.STATUSES.NETWORK_READ_TIMEOUT,je.STATUSES.NETWORK_CONNECT_TIMEOUT];je.ALPHA=[];for(let t=65;t<=90;t++)je.ALPHA.push(String.fromCharCode(t)),je.ALPHA.push(String.fromCharCode(t+32));je.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};je.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};je.NUM=["0","1","2","3","4","5","6","7","8","9"];je.ALPHANUM=je.ALPHA.concat(je.NUM);je.MARK=["-","_",".","!","~","*","'","(",")"];je.USERINFO_CHARS=je.ALPHANUM.concat(je.MARK).concat(["%",";",":","&","=","+","$",","]);je.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(je.ALPHANUM);je.HEX=je.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);je.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(je.ALPHANUM);je.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&je.HEADER_CHARS.push(t);je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS.filter(t=>t!==44);je.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&je.QUOTED_STRING.push(t);je.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);je.MAJOR=je.NUM_MAP;je.MINOR=je.MAJOR;je.SPECIAL_HEADERS={connection:je.HEADER_STATE.CONNECTION,"content-length":je.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":je.HEADER_STATE.CONNECTION,"transfer-encoding":je.HEADER_STATE.TRANSFER_ENCODING,upgrade:je.HEADER_STATE.UPGRADE};je.default={ERROR:je.ERROR,TYPE:je.TYPE,FLAGS:je.FLAGS,LENIENT_FLAGS:je.LENIENT_FLAGS,METHODS:je.METHODS,STATUSES:je.STATUSES,FINISH:je.FINISH,HEADER_STATE:je.HEADER_STATE,ALPHA:je.ALPHA,NUM_MAP:je.NUM_MAP,HEX_MAP:je.HEX_MAP,NUM:je.NUM,ALPHANUM:je.ALPHANUM,MARK:je.MARK,USERINFO_CHARS:je.USERINFO_CHARS,URL_CHAR:je.URL_CHAR,HEX:je.HEX,TOKEN:je.TOKEN,HEADER_CHARS:je.HEADER_CHARS,CONNECTION_TOKEN_CHARS:je.CONNECTION_TOKEN_CHARS,QUOTED_STRING:je.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:je.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:je.MAJOR,MINOR:je.MINOR,SPECIAL_HEADERS:je.SPECIAL_HEADERS,METHODS_HTTP:je.METHODS_HTTP,METHODS_ICE:je.METHODS_ICE,METHODS_RTSP:je.METHODS_RTSP,METHOD_MAP:je.METHOD_MAP,H_METHOD_MAP:je.H_METHOD_MAP,STATUSES_HTTP:je.STATUSES_HTTP}});var fir=I((bsf,M6n)=>{"use strict";p();var{Buffer:eIs}=require("node:buffer"),tIs="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==",dir;Object.defineProperty(M6n,"exports",{get:a(()=>dir||(dir=eIs.from(tIs,"base64")),"get")})});var L6n=I((Isf,O6n)=>{"use strict";p();var{Buffer:rIs}=require("node:buffer"),nIs="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==",pir;Object.defineProperty(O6n,"exports",{get:a(()=>pir||(pir=rIs.from(nIs,"base64")),"get")})});var APe=I((Rsf,G6n)=>{"use strict";p();var B6n=["GET","HEAD","POST"],iIs=new Set(B6n),oIs=[101,204,205,304],F6n=[301,302,303,307,308],sIs=new Set(F6n),U6n=["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"],aIs=new Set(U6n),Q6n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],cIs=["",...Q6n],lIs=new Set(Q6n),uIs=["follow","manual","error"],q6n=["GET","HEAD","OPTIONS","TRACE"],dIs=new Set(q6n),fIs=["navigate","same-origin","no-cors","cors"],pIs=["omit","same-origin","include"],hIs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],mIs=["content-encoding","content-language","content-location","content-type","content-length"],gIs=["half"],j6n=["CONNECT","TRACE","TRACK"],AIs=new Set(j6n),H6n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],yIs=new Set(H6n);G6n.exports={subresource:H6n,forbiddenMethods:j6n,requestBodyHeader:mIs,referrerPolicy:cIs,requestRedirect:uIs,requestMode:fIs,requestCredentials:pIs,requestCache:hIs,redirectStatus:F6n,corsSafeListedMethods:B6n,nullBodyStatus:oIs,safeMethods:q6n,badPorts:U6n,requestDuplex:gIs,subresourceSet:yIs,badPortsSet:aIs,redirectStatusSet:sIs,corsSafeListedMethodsSet:iIs,safeMethodsSet:dIs,forbiddenMethodsSet:AIs,referrerPolicyTokens:lIs}});var mir=I((Psf,$6n)=>{"use strict";p();var hir=Symbol.for("undici.globalOrigin.1");function EIs(){return globalThis[hir]}a(EIs,"getGlobalOrigin");function _Is(t){if(t===void 0){Object.defineProperty(globalThis,hir,{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,hir,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(_Is,"setGlobalOrigin");$6n.exports={getGlobalOrigin:EIs,setGlobalOrigin:_Is}});var Iot=I((Msf,V6n)=>{"use strict";p();var vIs=new TextDecoder;function CIs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),vIs.decode(t))}a(CIs,"utf8DecodeBytes");V6n.exports={utf8DecodeBytes:CIs}});var GF=I((Bsf,K6n)=>{"use strict";p();var W6n=require("node:assert"),{utf8DecodeBytes:bIs}=Iot();function SIs(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(wIs,"isomorphicDecode");var RIs=/[^\x00-\xFF]/;function kIs(t){return W6n(!RIs.test(t)),t}a(kIs,"isomorphicEncode");function PIs(t){return JSON.parse(bIs(t))}a(PIs,"parseJSONFromBytes");function DIs(t,e=!0,r=!0){return Y6n(t,e,r,z6n)}a(DIs,"removeASCIIWhitespace");function Y6n(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(Y6n,"removeChars");function NIs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return W6n(typeof e=="string"),e}a(NIs,"serializeJavascriptValueToJSONString");K6n.exports={collectASequenceOfCodePoints:SIs,collectASequenceOfCodePointsFast:TIs,forgivingBase64:xIs,isASCIIWhitespace:z6n,isomorphicDecode:wIs,isomorphicEncode:kIs,parseJSONFromBytes:PIs,removeASCIIWhitespace:DIs,removeChars:Y6n,serializeJavascriptValueToJSONString:NIs}});var Mw=I((Qsf,r9n)=>{"use strict";p();var wot=require("node:assert"),{forgivingBase64:MIs,collectASequenceOfCodePoints:gir,collectASequenceOfCodePointsFast:yPe,isomorphicDecode:OIs,removeASCIIWhitespace:LIs,removeChars:BIs}=GF(),FIs=new TextEncoder,EPe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,UIs=/[\u000A\u000D\u0009\u0020]/u,QIs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function qIs(t){wot(t.protocol==="data:");let e=X6n(t,!0);e=e.slice(5);let r={position:0},n=yPe(",",e,r),o=n.length;if(n=LIs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=e9n(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=OIs(c);if(c=MIs(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=Air(n);return l==="failure"&&(l=Air("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(qIs,"dataURLProcessor");function X6n(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(X6n,"URLSerializer");function e9n(t){let e=FIs.encode(t);return jIs(e)}a(e9n,"stringPercentDecode");function J6n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(J6n,"isHexCharByte");function Z6n(t){return t>=48&&t<=57?t-48:(t&223)-55}a(Z6n,"hexByteToNumber");function jIs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=yPe(";",t,e);if(n=xot(n,!1,!0),n.length===0||!EPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionUIs.test(d),t,e);let l=gir(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=t9n(t,e,!0),yPe(";",t,e);else if(u=yPe(";",t,e),u=xot(u,!1,!0),u.length===0)continue;l.length!==0&&EPe.test(l)&&(u.length===0||QIs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Air,"parseMIMEType");function t9n(t,e,r=!1){let n=e.position,o="";for(wot(t[e.position]==='"'),e.position++;o+=gir(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{wot(s==='"');break}}return r?o:t.slice(n,e.position)}a(t9n,"collectAnHTTPQuotedString");function HIs(t){wot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",EPe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(HIs,"serializeAMimeType");function GIs(t){return t===13||t===10||t===9||t===32}a(GIs,"isHTTPWhiteSpace");function xot(t,e=!0,r=!0){return BIs(t,e,r,GIs)}a(xot,"removeHTTPWhitespace");function $Is(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($Is,"minimizeSupportedMimeType");r9n.exports={dataURLProcessor:qIs,URLSerializer:X6n,stringPercentDecode:e9n,parseMIMEType:Air,collectAnHTTPQuotedString:t9n,serializeAMimeType:HIs,removeHTTPWhitespace:xot,minimizeSupportedMimeType:$Is,HTTP_TOKEN_CODEPOINTS:EPe}});var $F=I((Hsf,Eir)=>{"use strict";p();var n9n={__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 VIs(t){try{return n9n[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(VIs,"detectRuntimeFeatureByNodeModule");function WIs(t,e){return typeof n9n[t]()[e]<"u"}a(WIs,"detectRuntimeFeatureByExportedProperty");var i9n=["markAsUncloneable","zstd"],zIs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},o9n=["crypto","sqlite"],YIs=[...o9n,...i9n];function KIs(t){if(o9n.includes(t))return VIs(`node:${t}`);if(i9n.includes(t)){let[e,r]=zIs[t];return WIs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(KIs,"detectRuntimeFeature");var yir=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(YIs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=KIs(e);return this.#e.set(e,r),r}},s9n=new yir;Eir.exports.runtimeFeatures=s9n;Eir.exports.default=s9n});var $A=I((Vsf,c9n)=>{"use strict";p();var JIs=require("node:assert"),{types:hp,inspect:ZIs}=require("node:util"),{runtimeFeatures:XIs}=$F(),_ir=1,vir=2,Rot=3,kot=4,Cir=5,Pot=6,bir=7,yT=8,a9n=Function.call.bind(Function.prototype[Symbol.hasInstance]),ut={converters:{},util:{},errors:{},is:{}};ut.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};ut.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 ut.errors.exception({header:t.prefix,message:r})};ut.errors.invalidArgument=function(t){return ut.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};ut.brandCheck=function(t,e){if(!a9n(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};ut.brandCheckMultiple=function(t){let e=t.map(r=>ut.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};ut.argumentLengthCheck=function({length:t},e,r){if(ta9n(t,e)};ut.util.Type=function(t){switch(typeof t){case"undefined":return _ir;case"boolean":return vir;case"string":return Rot;case"symbol":return kot;case"number":return Cir;case"bigint":return Pot;case"function":case"object":return t===null?bir:yT}};ut.util.Types={UNDEFINED:_ir,BOOLEAN:vir,STRING:Rot,SYMBOL:kot,NUMBER:Cir,BIGINT:Pot,NULL:bir,OBJECT:yT};ut.util.TypeValueToString=function(t){switch(ut.util.Type(t)){case _ir:return"Undefined";case vir:return"Boolean";case Rot:return"String";case kot:return"Symbol";case Cir:return"Number";case Pot:return"BigInt";case bir:return"Null";case yT:return"Object"}};ut.util.markAsUncloneable=XIs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};ut.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),ut.util.HasFlag(n,ut.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw ut.errors.exception({header:"Integer conversion",message:`Could not convert ${ut.util.Stringify(t)} to an integer.`});if(c=ut.util.IntegerPart(c),co)throw ut.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&ut.util.HasFlag(n,ut.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=ut.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};ut.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};ut.util.Stringify=function(t){switch(ut.util.Type(t)){case kot:return`Symbol(${t.description})`;case yT:return ZIs(t);case Rot:return`"${t}"`;case Pot:return`${t}n`;default:return`${t}`}};ut.util.IsResizableArrayBuffer=function(t){if(hp.isArrayBuffer(t))return t.resizable;if(hp.isSharedArrayBuffer(t))return t.growable;throw ut.errors.exception({header:"IsResizableArrayBuffer",message:`"${ut.util.Stringify(t)}" is not an array buffer.`})};ut.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};ut.sequenceConverter=function(t){return(e,r,n,o)=>{if(ut.util.Type(e)!==yT)throw ut.errors.exception({header:r,message:`${n} (${ut.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 ut.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}};ut.recordConverter=function(t,e){return(r,n,o)=>{if(ut.util.Type(r)!==yT)throw ut.errors.exception({header:n,message:`${o} ("${ut.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!hp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=ut.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}};ut.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw ut.errors.exception({header:n,message:`Expected ${o} ("${ut.util.Stringify(r)}") to be an instance of ${e}.`});return r}};ut.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&ut.util.Type(e)!==yT)throw ut.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 ut.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 ut.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};ut.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};ut.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};ut.is.ReadableStream=ut.util.MakeTypeAssertion(ReadableStream);ut.is.Blob=ut.util.MakeTypeAssertion(Blob);ut.is.URLSearchParams=ut.util.MakeTypeAssertion(URLSearchParams);ut.is.File=ut.util.MakeTypeAssertion(File);ut.is.URL=ut.util.MakeTypeAssertion(URL);ut.is.AbortSignal=ut.util.MakeTypeAssertion(AbortSignal);ut.is.MessagePort=ut.util.MakeTypeAssertion(MessagePort);ut.is.BufferSource=function(t){return hp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&hp.isArrayBuffer(t.buffer)};ut.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(hp.isTypedArray(e)||hp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(JIs(hp.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};ut.converters.DOMString=function(t,e,r,n){if(t===null&&ut.util.HasFlag(n,ut.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};ut.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw ut.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};ut.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};ut.converters.boolean=function(t){return!!t};ut.converters.any=function(t){return t};ut.converters["long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"signed",0,e,r)};ut.converters["unsigned long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"unsigned",0,e,r)};ut.converters["unsigned long"]=function(t,e,r){return ut.util.ConvertToInt(t,32,"unsigned",0,e,r)};ut.converters["unsigned short"]=function(t,e,r,n){return ut.util.ConvertToInt(t,16,"unsigned",n,e,r)};ut.converters.ArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};ut.converters.SharedArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isSharedArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};ut.converters.TypedArray=function(t,e,r,n,o){if(ut.util.Type(t)!==yT||!hp.isTypedArray(t)||t.constructor.name!==e.name)throw ut.errors.conversionFailed({prefix:r,argument:`${n} ("${ut.util.Stringify(t)}")`,types:[e.name]});if(!ut.util.HasFlag(o,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(o,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};ut.converters.DataView=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isDataView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["DataView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.ArrayBufferView=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isArrayBufferView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.BufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n&=~ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw hp.isSharedArrayBuffer(t)?ut.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};ut.converters.AllowSharedBufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isSharedArrayBuffer(t))return ut.converters.SharedArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n|=ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};ut.converters["sequence"]=ut.sequenceConverter(ut.converters.ByteString);ut.converters["sequence>"]=ut.sequenceConverter(ut.converters["sequence"]);ut.converters["record"]=ut.recordConverter(ut.converters.ByteString,ut.converters.ByteString);ut.converters.Blob=ut.interfaceConverter(ut.is.Blob,"Blob");ut.converters.AbortSignal=ut.interfaceConverter(ut.is.AbortSignal,"AbortSignal");ut.converters.EventHandlerNonNull=function(t){return ut.util.Type(t)!==yT?null:typeof t=="function"?t:()=>{}};ut.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};c9n.exports={webidl:ut}});var ET=I((zsf,C9n)=>{"use strict";p();var{Transform:exs}=require("node:stream"),l9n=require("node:zlib"),{redirectStatusSet:txs,referrerPolicyTokens:rxs,badPortsSet:nxs}=APe(),{getGlobalOrigin:u9n}=mir(),{collectAnHTTPQuotedString:ixs,parseMIMEType:oxs}=Mw(),{performance:sxs}=require("node:perf_hooks"),{ReadableStreamFrom:axs,isValidHTTPToken:d9n,normalizedMethodRecordsBase:cxs}=Po(),vPe=require("node:assert"),{isUint8Array:lxs}=require("node:util/types"),{webidl:Uj}=$A(),{isomorphicEncode:Sir,collectASequenceOfCodePoints:bZ,removeChars:uxs}=GF();function f9n(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(f9n,"responseURL");function dxs(t,e){if(!txs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&h9n(r)&&(p9n(r)||(r=fxs(r)),r=new URL(r,f9n(t))),r&&!r.hash&&(r.hash=e),r}a(dxs,"responseLocationURL");function p9n(t){for(let e=0;e126||r<32)return!1}return!0}a(p9n,"isValidEncodedURL");function fxs(t){return Buffer.from(t,"binary").toString("utf8")}a(fxs,"normalizeBinaryStringToUtf8");function TZ(t){return t.urlList[t.urlList.length-1]}a(TZ,"requestCurrentURL");function pxs(t){let e=TZ(t);return _9n(e)&&nxs.has(e.port)?"blocked":"allowed"}a(pxs,"requestBadPort");function hxs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(hxs,"isErrorLike");function mxs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(mxs,"isValidReasonPhrase");var gxs=d9n;function h9n(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(h9n,"isValidHeaderValue");function Axs(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(rxs.has(o)){r=o;break}}return r}a(Axs,"parseReferrerPolicy");function yxs(t,e){let r=Axs(e);r!==""&&(t.referrerPolicy=r)}a(yxs,"setRequestReferrerPolicyOnRedirect");function Exs(){return"allowed"}a(Exs,"crossOriginResourcePolicyCheck");function _xs(){return"success"}a(_xs,"corsCheck");function vxs(){return"success"}a(vxs,"TAOCheck");function Cxs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Cxs,"appendFetchMetadata");function bxs(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&&Iir(t.origin)&&!Iir(TZ(t))&&(e=null);break;case"same-origin":_Pe(t,TZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(bxs,"appendRequestOriginHeader");function ipe(t,e){return t}a(ipe,"coarsenTime");function Sxs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Tir(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=TZ(t);return _Pe(n,s)?n:SZ(n)&&!SZ(s)?"no-referrer":o}case"same-origin":return _Pe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return _Pe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":n}}}a(wxs,"determineRequestsReferrer");function Tir(t,e=!1){return vPe(Uj.is.URL(t)),t=new URL(t),E9n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Tir,"stripURLForReferrer");var Rxs=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)$/),kxs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function g9n(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),kxs(t)):Rxs(t)}a(g9n,"isOriginIPPotentiallyTrustworthy");function Pxs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||g9n(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Pxs,"isOriginPotentiallyTrustworthy");function SZ(t){return Uj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Pxs(t.origin):!1}a(SZ,"isURLPotentiallyTrustworthy");function Dxs(t){}a(Dxs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function _Pe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(_Pe,"sameOrigin");function Nxs(t){return t.controller.state==="aborted"}a(Nxs,"isAborted");function Mxs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Mxs,"isCancelled");function Oxs(t){return cxs[t.toLowerCase()]??t}a(Oxs,"normalizeMethod");var Lxs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function A9n(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,Lxs),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(A9n,"createIterator");function Bxs(t,e,r,n=0,o=1){let s=A9n(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(Bxs,"iteratorMixin");function Fxs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();y9n(s,n,o)}catch(s){o(s)}}a(Fxs,"fullyReadBody");function Uxs(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(Uxs,"readableStreamClose");async function y9n(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(!lxs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(y9n,"readAllBytes");function E9n(t){vPe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(E9n,"urlIsLocal");function Iir(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(Iir,"urlHasHttpsScheme");function _9n(t){vPe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(_9n,"urlIsHttpHttpsScheme");function Qxs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&bZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&bZ(u=>u===" "||u===" ",r,n);let o=bZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&bZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&bZ(u=>u===" "||u===" ",r,n);let c=bZ(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(Qxs,"simpleRangeHeaderValue");function qxs(t,e,r){let n="bytes ";return n+=Sir(`${t}`),n+="-",n+=Sir(`${e}`),n+="/",n+=Sir(`${r}`),n}a(qxs,"buildContentRange");var xir=class extends exs{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?l9n.createInflate(this.#e):l9n.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 jxs(t){return new xir(t)}a(jxs,"createInflate");function Hxs(t){let e=null,r=null,n=null,o=v9n("content-type",t);if(o===null)return"failure";for(let s of o){let c=oxs(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(Hxs,"extractMimeType");function Gxs(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(Gxs,"gettingDecodingSplitting");function v9n(t,e){let r=e.get(t,!0);return r===null?null:Gxs(r)}a(v9n,"getDecodeSplit");function $xs(t){return!1}a($xs,"hasAuthenticationEntry");function Vxs(t){return!!(t.username||t.password)}a(Vxs,"includesCredentials");function Wxs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(Wxs,"isTraversableNavigable");var wir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return u9n()}get origin(){return this.baseUrl?.origin}policyContainer=m9n()},Rir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new wir},zxs=new Rir;C9n.exports={isAborted:Nxs,isCancelled:Mxs,isValidEncodedURL:p9n,ReadableStreamFrom:axs,tryUpgradeRequestToAPotentiallyTrustworthyURL:Dxs,clampAndCoarsenConnectionTimingInfo:Sxs,coarsenedSharedCurrentTime:Txs,determineRequestsReferrer:wxs,makePolicyContainer:m9n,clonePolicyContainer:xxs,appendFetchMetadata:Cxs,appendRequestOriginHeader:bxs,TAOCheck:vxs,corsCheck:_xs,crossOriginResourcePolicyCheck:Exs,createOpaqueTimingInfo:Ixs,setRequestReferrerPolicyOnRedirect:yxs,isValidHTTPToken:d9n,requestBadPort:pxs,requestCurrentURL:TZ,responseURL:f9n,responseLocationURL:dxs,isURLPotentiallyTrustworthy:SZ,isValidReasonPhrase:mxs,sameOrigin:_Pe,normalizeMethod:Oxs,iteratorMixin:Bxs,createIterator:A9n,isValidHeaderName:gxs,isValidHeaderValue:h9n,isErrorLike:hxs,fullyReadBody:Fxs,readableStreamClose:Uxs,urlIsLocal:E9n,urlHasHttpsScheme:Iir,urlIsHttpHttpsScheme:_9n,readAllBytes:y9n,simpleRangeHeaderValue:Qxs,buildContentRange:qxs,createInflate:jxs,extractMimeType:Hxs,getDecodeSplit:v9n,environmentSettingsObject:zxs,isOriginIPPotentiallyTrustworthy:g9n,hasAuthenticationEntry:$xs,includesCredentials:Vxs,isTraversableNavigable:Wxs}});var Dot=I((Jsf,S9n)=>{"use strict";p();var{iteratorMixin:Yxs}=ET(),{kEnumerableProperty:ope}=Po(),{webidl:Rc}=$A(),b9n=require("node:util"),VF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Rc.util.markAsUncloneable(this),e!==void 0)throw Rc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.append";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=kir(e,r,n);this.#e.push(s)}delete(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Rc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.get"),e=Rc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Rc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.has"),e=Rc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.set";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=kir(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)}[b9n.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=b9n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:Kxs,setFormDataState:Jxs}=VF;Reflect.deleteProperty(VF,"getFormDataState");Reflect.deleteProperty(VF,"setFormDataState");Yxs("FormData",VF,Kxs,"name","value");Object.defineProperties(VF.prototype,{append:ope,delete:ope,get:ope,getAll:ope,has:ope,set:ope,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function kir(t,e,r){if(typeof e!="string"){if(Rc.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(kir,"makeEntry");Rc.is.FormData=Rc.util.MakeTypeAssertion(VF);S9n.exports={FormData:VF,makeEntry:kir,setFormDataState:Jxs}});var x9n=I((eaf,I9n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Zxs}=Po(),{HTTP_TOKEN_CODEPOINTS:Xxs}=Mw(),{makeEntry:ews}=Dot(),{webidl:Pir}=$A(),Dir=require("node:assert"),{isomorphicDecode:T9n}=GF(),tws=Buffer.from("--"),Nir=new TextDecoder,rws=new TextDecoder("utf-8",{ignoreBOM:!0});function nws(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(iws,"validateBoundary");function ows(t,e){Dir(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw pb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw pb("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 pb("expected a value starting with -- and the boundary");if(cws(t,tws,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw pb("expected CRLF");s.position+=2;let l=aws(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 pb("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 pb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",nws(f)||(f=""),g=new File([m],d,{type:f})):g=rws.decode(Buffer.from(m)),Dir(Pir.is.USVString(u)),Dir(typeof g=="string"&&Pir.is.USVString(g)||Pir.is.File(g)),o.push(ews(u,g,d))}}a(ows,"multipartFormDataParser");function sws(t,e){t[e.position]===59&&e.position++,Ow(c=>c===32||c===9,t,e);let r=Ow(c=>Oir(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++,Ow(c=>c===32||c===9,t,e);let s;if(o){let c=Ow(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 pb("unknown encoding, expected utf-8''");s=decodeURIComponent(Nir.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Ow(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw pb("Closing quote not found");e.position++,s=Nir.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Ow(l=>Oir(l)&&l!==59,t,e);s=Nir.decode(c)}return{name:n,value:s,extended:o}}a(sws,"parseContentDispositionAttribute");function aws(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 pb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Ow(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Mir(c,!0,!0,l=>l===9||l===32),!Xxs.test(c.toString()))throw pb("header name does not match the field-name token production");if(t[e.position]!==58)throw pb("expected :");switch(e.position++,Ow(l=>l===32||l===9,t,e),Zxs(c)){case"content-disposition":{r=n=null;let l=!1;if(Ow(d=>Oir(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw pb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Mir(l,!1,!0,u=>u===9||u===32),o=T9n(l);break}case"content-transfer-encoding":{let l=Ow(u=>u!==10&&u!==13,t,e);l=Mir(l,!1,!0,u=>u===9||u===32),s=T9n(l);break}default:Ow(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw pb("expected CRLF");e.position+=2}}a(aws,"parseMultipartFormDataHeaders");function Ow(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(Mir,"removeChars");function cws(t,e,r){if(t.length{"use strict";p();function dws(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(dws,"createDeferredPromise");w9n.exports={createDeferredPromise:dws}});var ape=I((saf,N9n)=>{"use strict";p();var Fir=Po(),{ReadableStreamFrom:fws,readableStreamClose:pws,fullyReadBody:hws,extractMimeType:mws}=ET(),{FormData:R9n,setFormDataState:gws}=Dot(),{webidl:b2}=$A(),Lir=require("node:assert"),{isErrored:Bir,isDisturbed:Aws}=require("node:stream"),{isUint8Array:yws}=require("node:util/types"),{serializeAMimeType:Ews}=Mw(),{multipartFormDataParser:_ws}=x9n(),{createDeferredPromise:vws}=CPe(),{parseJSONFromBytes:Cws}=GF(),{utf8DecodeBytes:bws}=Iot(),{runtimeFeatures:Sws}=$F(),Tws=Sws.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Not=new TextEncoder;function Iws(){}a(Iws,"noop");var xws=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Aws(e)&&!Bir(e)&&e.cancel("Response object has been garbage collected").catch(Iws)});function P9n(t,e=!1){let r=null,n=null;b2.is.ReadableStream(t)?r=t:b2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Lir(b2.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(b2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(b2.is.BufferSource(t))s=b2.util.getCopyOfBytesHeldByBufferSource(t);else if(b2.is.FormData(t)){let d=`----formdata-undici-0${`${Tws(1e11)}`.padStart(11,"0")}`,f=`--${d}\r +`,s};pot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=um.util.createBuffer();return epe(n,r),k5(n,t.e),k5(n,t.n),r+" "+um.util.encode64(n.bytes())+" "+e};pot.privateKeyToOpenSSH=function(t,e){return e?um.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):um.pki.privateKeyToPem(t)};pot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||um.md.md5.create(),n="ssh-rsa",o=um.util.createBuffer();epe(o,n),k5(o,t.e),k5(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 k5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=um.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(k5,"_addBigIntegerToBuffer");function epe(t,e){t.putInt32(e.length),t.putString(e)}a(epe,"_addStringToBuffer");function fot(){for(var t=um.md.sha1.create(),e=arguments.length,r=0;r{p();JFn.exports=As();wj();AFn();b2();Bit();rPe();OFn();jfe();UFn();HFn();$Fn();Drr();zit();fZ();Irr();Orr();zFn();Brr();wrr();yrr();tot();Rw();vrr();KFn();Hrr();cc()});var t8n=I(_Z=>{"use strict";p();Object.defineProperty(_Z,"__esModule",{value:!0});_Z.convert=_Z.Format=void 0;var hPe=ZFn(),Bj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Bj=_Z.Format||(_Z.Format={}));function XFn(t){var e=hPe.pki.pemToDer(t),r=hPe.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(XFn,"myASN");function qSs(t){var e=XFn(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(qSs,"txtFormat");function e8n(t,e){switch(e){case Bj.der:return hPe.pki.pemToDer(t);case Bj.pem:return t;case Bj.txt:return qSs(t);case Bj.asn1:return XFn(t);case Bj.fingerprint:var r=hPe.md.sha1.create(),n=e8n(t,Bj.der);return r.update(n.getBytes()),r.digest().toHex();case Bj.x509:return hPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(e8n,"convert");_Z.convert=e8n});var a8n=I(db=>{"use strict";p();var Fj=db&&db.__assign||function(){return Fj=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})(snr.Agent),(0,n8n.setGlobalDispatcher)(new n8n.Agent({connect:{ca:e}}))}},"addToGlobalAgent");db.addToGlobalAgent=HSs});var c8n=I((Hof,anr)=>{p();function GSs(){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(GSs,"all");process.platform!=="win32"?anr.exports.all=()=>[]:anr.exports.all=GSs});var al=I((Kof,h8n)=>{"use strict";p();h8n.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 Cnr=I((Zof,y8n)=>{"use strict";p();var rpe=0,gnr=1e3,Anr=(gnr>>1)-1,Uj,ynr=Symbol("kFastTimer"),$F=[],Enr=-2,_nr=-1,g8n=0,m8n=1;function vnr(){rpe+=Anr;let t=0,e=$F.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=_nr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===_nr?(r._state=Enr,--e!==0&&($F[t]=$F[e])):++t}$F.length=e,$F.length!==0&&A8n()}a(vnr,"onTick");function A8n(){Uj?.refresh?Uj.refresh():(clearTimeout(Uj),Uj=setTimeout(vnr,Anr),Uj?.unref())}a(A8n,"refreshTimeout");var Eot=class{static{a(this,"FastTimer")}[ynr]=!0;_state=Enr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===Enr&&$F.push(this),(!Uj||$F.length===1)&&A8n(),this._state=g8n}clear(){this._state=_nr,this._idleStart=-1}};y8n.exports={setTimeout(t,e,r){return e<=gnr?setTimeout(t,e,r):new Eot(t,e,r)},clearTimeout(t){t[ynr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Eot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return rpe},tick(t=0){rpe+=t-gnr+1,vnr(),vnr()},reset(){rpe=0,$F.length=0,clearTimeout(Uj),Uj=null},kFastTimer:ynr}});var ao=I((tsf,H8n)=>{"use strict";p();var E8n=Symbol.for("undici.error.UND_ERR"),ud=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[E8n]===!0}get[E8n](){return!0}},_8n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),bnr=class extends ud{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[_8n]===!0}get[_8n](){return!0}},v8n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),Snr=class extends ud{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[v8n]===!0}get[v8n](){return!0}},C8n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),Tnr=class extends ud{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[C8n]===!0}get[C8n](){return!0}},b8n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Inr=class extends ud{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[b8n]===!0}get[b8n](){return!0}},S8n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),xnr=class extends ud{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[S8n]===!0}get[S8n](){return!0}},T8n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),wnr=class extends ud{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[T8n]===!0}get[T8n](){return!0}},I8n=Symbol.for("undici.error.UND_ERR_ABORT"),_ot=class extends ud{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[I8n]===!0}get[I8n](){return!0}},x8n=Symbol.for("undici.error.UND_ERR_ABORTED"),Rnr=class extends _ot{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[x8n]===!0}get[x8n](){return!0}},w8n=Symbol.for("undici.error.UND_ERR_INFO"),knr=class extends ud{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[w8n]===!0}get[w8n](){return!0}},R8n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),Pnr=class extends ud{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[R8n]===!0}get[R8n](){return!0}},k8n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),Dnr=class extends ud{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[k8n]===!0}get[k8n](){return!0}},P8n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Nnr=class extends ud{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[P8n]===!0}get[P8n](){return!0}},D8n=Symbol.for("undici.error.UND_ERR_CLOSED"),Mnr=class extends ud{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[D8n]===!0}get[D8n](){return!0}},N8n=Symbol.for("undici.error.UND_ERR_SOCKET"),Onr=class extends ud{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[N8n]===!0}get[N8n](){return!0}},M8n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Lnr=class extends ud{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[M8n]===!0}get[M8n](){return!0}},O8n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Bnr=class extends ud{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[O8n]===!0}get[O8n](){return!0}},L8n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Fnr=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[L8n]===!0}get[L8n](){return!0}},B8n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Unr=class extends ud{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[B8n]===!0}get[B8n](){return!0}},F8n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Qnr=class extends ud{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[F8n]===!0}get[F8n](){return!0}},U8n=Symbol.for("undici.error.UND_ERR_RESPONSE"),qnr=class extends ud{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[U8n]===!0}get[U8n](){return!0}},Q8n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),jnr=class extends ud{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[Q8n]===!0}get[Q8n](){return!0}},q8n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Hnr=class extends ud{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[q8n]===!0}get[q8n](){return!0}},Gnr=class extends ud{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},j8n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),$nr=class extends ud{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[j8n]===!0}get[j8n](){return!0}};H8n.exports={AbortError:_ot,HTTPParserError:Fnr,UndiciError:ud,HeadersTimeoutError:Snr,HeadersOverflowError:Tnr,BodyTimeoutError:Inr,RequestContentLengthMismatchError:Pnr,ConnectTimeoutError:bnr,InvalidArgumentError:xnr,InvalidReturnValueError:wnr,RequestAbortedError:Rnr,ClientDestroyedError:Nnr,ClientClosedError:Mnr,InformationalError:knr,SocketError:Onr,NotSupportedError:Lnr,ResponseContentLengthMismatchError:Dnr,BalancedPoolMissingUpstreamError:Bnr,ResponseExceededMaxSizeError:Unr,RequestRetryError:Qnr,ResponseError:qnr,SecureProxyConnectionError:jnr,MaxOriginsReachedError:Hnr,Socks5ProxyError:Gnr,MessageSizeExceededError:$nr}});var Cot=I((isf,$8n)=>{"use strict";p();var Vnr=["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"],vot={};Object.setPrototypeOf(vot,null);var G8n={};Object.setPrototypeOf(G8n,null);function VSs(t){let e=G8n[t];return e===void 0&&(e=Buffer.from(t)),e}a(VSs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:V8n,headerNameLowerCasedRecord:WSs}=Cot(),Wnr=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 mPe=require("node:assert"),{kDestroyed:X8n,kBodyUsed:npe,kListeners:Tot,kBody:K8n}=al(),{IncomingMessage:zSs}=require("node:http"),e6n=require("node:stream"),YSs=require("node:net"),{stringify:KSs}=require("node:querystring"),{EventEmitter:JSs}=require("node:events"),Sot=Cnr(),{InvalidArgumentError:Mg,ConnectTimeoutError:ZSs}=ao(),{headerNameLowerCasedRecord:XSs}=Cot(),{tree:t6n}=Y8n(),[eTs,tTs]=process.versions.node.split(".",2).map(t=>Number(t)),xot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[K8n]=e,this[npe]=!1}async*[Symbol.asyncIterator](){mPe(!this[npe],"disturbed"),this[npe]=!0,yield*this[K8n]}};function J8n(){}a(J8n,"noop");function rTs(t){return wot(t)?(a6n(t)===0&&t.on("data",function(){mPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[npe]=!1,JSs.prototype.on.call(t,"data",function(){this[npe]=!0})),t):t&&typeof t.pipeTo=="function"?new xot(t):t&&f6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&s6n(t)?new xot(t):t}a(rTs,"wrapRequestBody");function wot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(wot,"isStream");function r6n(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(r6n,"isBlobLike");function n6n(t){return t.includes("?")||t.includes("#")}a(n6n,"pathHasQueryOrFragment");function nTs(t,e){if(n6n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=KSs(e);return r&&(t+="?"+r),t}a(nTs,"serializePathWithQuery");function i6n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(i6n,"isValidPort");function Iot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Iot,"isHttpOrHttpsPrefixed");function o6n(t){if(typeof t=="string"){if(t=new URL(t),!Iot(t.origin||t.protocol))throw new Mg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Mg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&i6n(t.port)===!1)throw new Mg("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 Mg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Mg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Mg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Mg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Iot(t.origin||t.protocol))throw new Mg("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(!Iot(t.origin||t.protocol))throw new Mg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(o6n,"parseURL");function iTs(t){if(t=o6n(t),t.pathname!=="/"||t.search||t.hash)throw new Mg("invalid url");return t}a(iTs,"parseOrigin");function oTs(t){if(t[0]==="["){let r=t.indexOf("]");return mPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(oTs,"getHostname");function sTs(t){if(!t)return null;mPe(typeof t=="string");let e=oTs(t);return YSs.isIP(e)?"":e}a(sTs,"getServerName");function aTs(t){return JSON.parse(JSON.stringify(t))}a(aTs,"deepClone");function cTs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(cTs,"isAsyncIterable");function s6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(s6n,"isIterable");function lTs(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(lTs,"hasSafeIterator");function a6n(t){if(t==null)return 0;if(wot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(r6n(t))return t.size!=null?t.size:null;if(d6n(t))return t.byteLength}return null}a(a6n,"bodyLength");function c6n(t){return t&&!!(t.destroyed||t[X8n]||e6n.isDestroyed?.(t))}a(c6n,"isDestroyed");function l6n(t,e){t==null||!wot(t)||c6n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===zSs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[X8n]=!0))}a(l6n,"destroy");var uTs=/timeout=(\d+)/;function dTs(t){let e=t.match(uTs);return e?parseInt(e[1],10)*1e3:null}a(dTs,"parseKeepAliveTimeout");function u6n(t){return typeof t=="string"?XSs[t]??t.toLowerCase():t6n.lookup(t)??t.toString("latin1").toLowerCase()}a(u6n,"headerNameToString");function fTs(t){return t6n.lookup(t)??t.toString("latin1").toLowerCase()}a(fTs,"bufferToLowerCasedHeaderName");function pTs(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(pTs,"parseHeaders");function hTs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(mTs,"encodeRawHeaders");function d6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(d6n,"isBuffer");function gTs(t,e,r){if(!t||typeof t!="object")throw new Mg("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Mg("invalid onConnect method");if(typeof t.onError!="function")throw new Mg("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Mg("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Mg("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Mg("invalid onHeaders method");if(typeof t.onData!="function")throw new Mg("invalid onData method");if(typeof t.onComplete!="function")throw new Mg("invalid onComplete method")}}}a(gTs,"assertRequestHandler");function ATs(t){return!!(t&&(e6n.isDisturbed(t)||t[npe]))}a(ATs,"isDisturbed");function yTs(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(yTs,"getSocketInfo");function ETs(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(ETs,"ReadableStreamFrom");function f6n(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(f6n,"isFormDataLike");function _Ts(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(_Ts,"addAbortListener");var p6n=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 vTs(t){return p6n[t]===1}a(vTs,"isTokenCharCode");var CTs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function bTs(t){if(t.length>=12)return CTs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return J8n;let r=null,n=null,o=Sot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>Z8n(t.deref(),e))})},e.timeout);return()=>{Sot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return J8n;let r=null,n=Sot.setFastTimeout(()=>{r=setImmediate(()=>{Z8n(t.deref(),e)})},e.timeout);return()=>{Sot.clearFastTimeout(n),clearImmediate(r)}};function Z8n(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)`,l6n(t,new ZSs(r))}a(Z8n,"onConnectTimeout");function DTs(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(DTs,"getProtocolFromUrlString");var h6n=Object.create(null);h6n.enumerable=!0;var znr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},m6n={...znr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(znr,null);Object.setPrototypeOf(m6n,null);g6n.exports={kEnumerableProperty:h6n,isDisturbed:ATs,isBlobLike:r6n,parseOrigin:iTs,parseURL:o6n,getServerName:sTs,isStream:wot,isIterable:s6n,hasSafeIterator:lTs,isAsyncIterable:cTs,isDestroyed:c6n,headerNameToString:u6n,bufferToLowerCasedHeaderName:fTs,addListener:wTs,removeAllListeners:RTs,errorRequest:kTs,parseRawHeaders:hTs,encodeRawHeaders:mTs,parseHeaders:pTs,parseKeepAliveTimeout:dTs,destroy:l6n,bodyLength:a6n,deepClone:aTs,ReadableStreamFrom:ETs,isBuffer:d6n,assertRequestHandler:gTs,getSocketInfo:yTs,isFormDataLike:f6n,pathHasQueryOrFragment:n6n,serializePathWithQuery:nTs,addAbortListener:_Ts,isValidHTTPToken:bTs,isValidHeaderValue:TTs,isTokenCharCode:vTs,parseRangeHeader:xTs,normalizedMethodRecordsBase:znr,normalizedMethodRecords:m6n,isValidPort:i6n,isHttpOrHttpsPrefixed:Iot,nodeMajor:eTs,nodeMinor:tTs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:rTs,setupConnectTimeout:PTs,getProtocolFromUrlString:DTs}});var Jnr=I((psf,v6n)=>{"use strict";p();var{kConnected:A6n,kPending:y6n,kRunning:E6n,kSize:_6n,kFree:NTs,kQueued:MTs}=al(),Ynr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[A6n],this.pending=e[y6n],this.running=e[E6n],this.size=e[_6n]}},Knr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[A6n],this.free=e[NTs],this.pending=e[y6n],this.queued=e[MTs],this.running=e[E6n],this.size=e[_6n]}};v6n.exports={ClientStats:Ynr,PoolStats:Knr}});var Qj=I((gsf,b6n)=>{"use strict";p();var cl=require("node:diagnostics_channel"),tir=require("node:util"),vZ=tir.debuglog("undici"),gPe=tir.debuglog("fetch"),Rot=tir.debuglog("websocket"),ET={beforeConnect:cl.channel("undici:client:beforeConnect"),connected:cl.channel("undici:client:connected"),connectError:cl.channel("undici:client:connectError"),sendHeaders:cl.channel("undici:client:sendHeaders"),create:cl.channel("undici:request:create"),bodySent:cl.channel("undici:request:bodySent"),bodyChunkSent:cl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:cl.channel("undici:request:bodyChunkReceived"),headers:cl.channel("undici:request:headers"),trailers:cl.channel("undici:request:trailers"),error:cl.channel("undici:request:error"),open:cl.channel("undici:websocket:open"),close:cl.channel("undici:websocket:close"),socketError:cl.channel("undici:websocket:socket_error"),ping:cl.channel("undici:websocket:ping"),pong:cl.channel("undici:websocket:pong"),proxyConnected:cl.channel("undici:proxy:connected")},Znr=!1;function C6n(t=vZ){if(!Znr){if(ET.beforeConnect.hasSubscribers||ET.connected.hasSubscribers||ET.connectError.hasSubscribers||ET.sendHeaders.hasSubscribers){Znr=!0;return}Znr=!0,cl.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)}),cl.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)}),cl.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)}),cl.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(C6n,"trackClientEvents");var Xnr=!1;function OTs(t=vZ){if(!Xnr){if(ET.headers.hasSubscribers||ET.trailers.hasSubscribers||ET.error.hasSubscribers){Xnr=!0;return}Xnr=!0,cl.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)}),cl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),cl.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(OTs,"trackRequestEvents");var eir=!1;function LTs(t=Rot){if(!eir){if(ET.open.hasSubscribers||ET.close.hasSubscribers||ET.socketError.hasSubscribers||ET.ping.hasSubscribers||ET.pong.hasSubscribers){eir=!0;return}eir=!0,cl.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")}),cl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),cl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),cl.subscribe("undici:websocket:ping",e=>{t("ping received")}),cl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(LTs,"trackWebSocketEvents");(vZ.enabled||gPe.enabled)&&(C6n(gPe.enabled?gPe:vZ),OTs(gPe.enabled?gPe:vZ));Rot.enabled&&(C6n(vZ.enabled?vZ:Rot),LTs(Rot));b6n.exports={channels:ET}});var I6n=I((Esf,T6n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:BTs}=ao(),P5=require("node:assert"),{isValidHTTPToken:rir,isValidHeaderValue:nir,isStream:FTs,destroy:UTs,isBuffer:QTs,isFormDataLike:qTs,isIterable:jTs,hasSafeIterator:HTs,isBlobLike:GTs,serializePathWithQuery:$Ts,assertRequestHandler:VTs,getServerName:WTs,normalizedMethodRecords:zTs,getProtocolFromUrlString:YTs}=Do(),{channels:fb}=Qj(),{headerNameLowerCasedRecord:S6n}=Cot(),KTs=/[^\u0021-\u00ff]/;function JTs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(JTs,"isValidContentLengthHeaderValue");var Ow=Symbol("handler"),iir=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(KTs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(zTs[n]===void 0&&!rir(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!nir(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(FTs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){UTs(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(QTs(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(qTs(o)||jTs(o)||GTs(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?$Ts(r,c):r,this.origin=e,this.protocol=YTs(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:ZTs}=ao();w6n.exports=class x6n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new x6n(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"),oir(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"),oir(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"),oir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new ZTs("invalid onError method");this.#e.onError?.(r)}};function oir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(oir,"toRawHeaderValue")});var yPe=I((Tsf,R6n)=>{"use strict";p();var XTs=require("node:events"),eIs=APe(),tIs=a(t=>(e,r)=>t(e,eIs.wrap(r)),"wrapInterceptor"),sir=class extends XTs{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=tIs(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")})}};R6n.exports=sir});var D6n=I((wsf,P6n)=>{"use strict";p();var{parseHeaders:air}=Do(),{InvalidArgumentError:rIs}=ao(),cir=Symbol("resume"),lir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[cir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[cir]?.())}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}};P6n.exports=class k6n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new k6n(e):e}onConnect(e,r){this.#t=new lir(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#t.rawHeaders=r,this.#e.onRequestUpgrade?.(this.#t,e,air(r),n)}onHeaders(e,r,n,o){return this.#t[cir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,air(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#t.rawTrailers=e,this.#e.onResponseEnd?.(this.#t,air(e))}onError(e){if(!this.#e.onResponseError)throw new rIs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var bZ=I((Psf,N6n)=>{"use strict";p();var nIs=yPe(),iIs=D6n(),{ClientDestroyedError:uir,ClientClosedError:oIs,InvalidArgumentError:Pot}=ao(),{kDestroy:sIs,kClose:aIs,kClosed:EPe,kDestroyed:ipe,kDispatch:cIs}=al(),qj=Symbol("onDestroyed"),CZ=Symbol("onClosed"),dir=Symbol("webSocketOptions"),fir=class extends nIs{static{a(this,"DispatcherBase")}[ipe]=!1;[qj]=null;[EPe]=!1;[CZ]=null;constructor(e){super(),this[dir]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[dir].maxFragments??131072,maxPayloadSize:this[dir].maxPayloadSize??128*1024*1024}}get destroyed(){return this[ipe]}get closed(){return this[EPe]}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 Pot("invalid callback");if(this[ipe]){let n=new uir;queueMicrotask(()=>e(n,null));return}if(this[EPe]){this[CZ]?this[CZ].push(e):queueMicrotask(()=>e(null,null));return}this[EPe]=!0,this[CZ]??=[],this[CZ].push(e);let r=a(()=>{let n=this[CZ];this[CZ]=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 Pot("invalid callback");if(this[ipe]){this[qj]?this[qj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new uir),this[ipe]=!0,this[qj]??=[],this[qj].push(r);let n=a(()=>{let o=this[qj];this[qj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new Pot("handler must be an object");r=iIs.unwrap(r);try{if(!e||typeof e!="object")throw new Pot("opts must be an object.");if(this[ipe]||this[qj])throw new uir;if(this[EPe])throw new oIs;return this[cIs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};N6n.exports=fir});var SZ=I((Osf,L6n)=>{"use strict";p();var lIs=require("node:net"),M6n=require("node:assert"),O6n=Do(),{InvalidArgumentError:uIs}=ao(),pir,dIs=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 fIs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new uIs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new dIs(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:"){pir||(pir=require("node:tls")),A=A||l.servername||O6n.getServerName(h)||null;let T=A||f;M6n(T);let w=s||u.get(T)||null;g=g||443,v=pir.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 M6n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=lIs.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=O6n.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(fIs,"buildConnector");L6n.exports=fIs});var B6n=I(hir=>{"use strict";p();Object.defineProperty(hir,"__esModule",{value:!0});hir.enumToMap=pIs;function pIs(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(pIs,"enumToMap")});var F6n=I(je=>{"use strict";p();Object.defineProperty(je,"__esModule",{value:!0});je.SPECIAL_HEADERS=je.MINOR=je.MAJOR=je.HTAB_SP_VCHAR_OBS_TEXT=je.QUOTED_STRING=je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS=je.TOKEN=je.HEX=je.URL_CHAR=je.USERINFO_CHARS=je.MARK=je.ALPHANUM=je.NUM=je.HEX_MAP=je.NUM_MAP=je.ALPHA=je.STATUSES_HTTP=je.H_METHOD_MAP=je.METHOD_MAP=je.METHODS_RTSP=je.METHODS_ICE=je.METHODS_HTTP=je.HEADER_STATE=je.FINISH=je.STATUSES=je.METHODS=je.LENIENT_FLAGS=je.FLAGS=je.TYPE=je.ERROR=void 0;var hIs=B6n();je.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};je.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};je.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};je.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};je.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};je.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};je.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};je.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};je.METHODS_HTTP=[je.METHODS.DELETE,je.METHODS.GET,je.METHODS.HEAD,je.METHODS.POST,je.METHODS.PUT,je.METHODS.CONNECT,je.METHODS.OPTIONS,je.METHODS.TRACE,je.METHODS.COPY,je.METHODS.LOCK,je.METHODS.MKCOL,je.METHODS.MOVE,je.METHODS.PROPFIND,je.METHODS.PROPPATCH,je.METHODS.SEARCH,je.METHODS.UNLOCK,je.METHODS.BIND,je.METHODS.REBIND,je.METHODS.UNBIND,je.METHODS.ACL,je.METHODS.REPORT,je.METHODS.MKACTIVITY,je.METHODS.CHECKOUT,je.METHODS.MERGE,je.METHODS["M-SEARCH"],je.METHODS.NOTIFY,je.METHODS.SUBSCRIBE,je.METHODS.UNSUBSCRIBE,je.METHODS.PATCH,je.METHODS.PURGE,je.METHODS.MKCALENDAR,je.METHODS.LINK,je.METHODS.UNLINK,je.METHODS.PRI,je.METHODS.SOURCE,je.METHODS.QUERY];je.METHODS_ICE=[je.METHODS.SOURCE];je.METHODS_RTSP=[je.METHODS.OPTIONS,je.METHODS.DESCRIBE,je.METHODS.ANNOUNCE,je.METHODS.SETUP,je.METHODS.PLAY,je.METHODS.PAUSE,je.METHODS.TEARDOWN,je.METHODS.GET_PARAMETER,je.METHODS.SET_PARAMETER,je.METHODS.REDIRECT,je.METHODS.RECORD,je.METHODS.FLUSH,je.METHODS.GET,je.METHODS.POST];je.METHOD_MAP=(0,hIs.enumToMap)(je.METHODS);je.H_METHOD_MAP=Object.fromEntries(Object.entries(je.METHODS).filter(([t])=>t.startsWith("H")));je.STATUSES_HTTP=[je.STATUSES.CONTINUE,je.STATUSES.SWITCHING_PROTOCOLS,je.STATUSES.PROCESSING,je.STATUSES.EARLY_HINTS,je.STATUSES.RESPONSE_IS_STALE,je.STATUSES.REVALIDATION_FAILED,je.STATUSES.DISCONNECTED_OPERATION,je.STATUSES.HEURISTIC_EXPIRATION,je.STATUSES.MISCELLANEOUS_WARNING,je.STATUSES.OK,je.STATUSES.CREATED,je.STATUSES.ACCEPTED,je.STATUSES.NON_AUTHORITATIVE_INFORMATION,je.STATUSES.NO_CONTENT,je.STATUSES.RESET_CONTENT,je.STATUSES.PARTIAL_CONTENT,je.STATUSES.MULTI_STATUS,je.STATUSES.ALREADY_REPORTED,je.STATUSES.TRANSFORMATION_APPLIED,je.STATUSES.IM_USED,je.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,je.STATUSES.MULTIPLE_CHOICES,je.STATUSES.MOVED_PERMANENTLY,je.STATUSES.FOUND,je.STATUSES.SEE_OTHER,je.STATUSES.NOT_MODIFIED,je.STATUSES.USE_PROXY,je.STATUSES.SWITCH_PROXY,je.STATUSES.TEMPORARY_REDIRECT,je.STATUSES.PERMANENT_REDIRECT,je.STATUSES.BAD_REQUEST,je.STATUSES.UNAUTHORIZED,je.STATUSES.PAYMENT_REQUIRED,je.STATUSES.FORBIDDEN,je.STATUSES.NOT_FOUND,je.STATUSES.METHOD_NOT_ALLOWED,je.STATUSES.NOT_ACCEPTABLE,je.STATUSES.PROXY_AUTHENTICATION_REQUIRED,je.STATUSES.REQUEST_TIMEOUT,je.STATUSES.CONFLICT,je.STATUSES.GONE,je.STATUSES.LENGTH_REQUIRED,je.STATUSES.PRECONDITION_FAILED,je.STATUSES.PAYLOAD_TOO_LARGE,je.STATUSES.URI_TOO_LONG,je.STATUSES.UNSUPPORTED_MEDIA_TYPE,je.STATUSES.RANGE_NOT_SATISFIABLE,je.STATUSES.EXPECTATION_FAILED,je.STATUSES.IM_A_TEAPOT,je.STATUSES.PAGE_EXPIRED,je.STATUSES.ENHANCE_YOUR_CALM,je.STATUSES.MISDIRECTED_REQUEST,je.STATUSES.UNPROCESSABLE_ENTITY,je.STATUSES.LOCKED,je.STATUSES.FAILED_DEPENDENCY,je.STATUSES.TOO_EARLY,je.STATUSES.UPGRADE_REQUIRED,je.STATUSES.PRECONDITION_REQUIRED,je.STATUSES.TOO_MANY_REQUESTS,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,je.STATUSES.LOGIN_TIMEOUT,je.STATUSES.NO_RESPONSE,je.STATUSES.RETRY_WITH,je.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,je.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,je.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,je.STATUSES.INVALID_X_FORWARDED_FOR,je.STATUSES.REQUEST_HEADER_TOO_LARGE,je.STATUSES.SSL_CERTIFICATE_ERROR,je.STATUSES.SSL_CERTIFICATE_REQUIRED,je.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,je.STATUSES.INVALID_TOKEN,je.STATUSES.CLIENT_CLOSED_REQUEST,je.STATUSES.INTERNAL_SERVER_ERROR,je.STATUSES.NOT_IMPLEMENTED,je.STATUSES.BAD_GATEWAY,je.STATUSES.SERVICE_UNAVAILABLE,je.STATUSES.GATEWAY_TIMEOUT,je.STATUSES.HTTP_VERSION_NOT_SUPPORTED,je.STATUSES.VARIANT_ALSO_NEGOTIATES,je.STATUSES.INSUFFICIENT_STORAGE,je.STATUSES.LOOP_DETECTED,je.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,je.STATUSES.NOT_EXTENDED,je.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,je.STATUSES.WEB_SERVER_UNKNOWN_ERROR,je.STATUSES.WEB_SERVER_IS_DOWN,je.STATUSES.CONNECTION_TIMEOUT,je.STATUSES.ORIGIN_IS_UNREACHABLE,je.STATUSES.TIMEOUT_OCCURED,je.STATUSES.SSL_HANDSHAKE_FAILED,je.STATUSES.INVALID_SSL_CERTIFICATE,je.STATUSES.RAILGUN_ERROR,je.STATUSES.SITE_IS_OVERLOADED,je.STATUSES.SITE_IS_FROZEN,je.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,je.STATUSES.NETWORK_READ_TIMEOUT,je.STATUSES.NETWORK_CONNECT_TIMEOUT];je.ALPHA=[];for(let t=65;t<=90;t++)je.ALPHA.push(String.fromCharCode(t)),je.ALPHA.push(String.fromCharCode(t+32));je.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};je.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};je.NUM=["0","1","2","3","4","5","6","7","8","9"];je.ALPHANUM=je.ALPHA.concat(je.NUM);je.MARK=["-","_",".","!","~","*","'","(",")"];je.USERINFO_CHARS=je.ALPHANUM.concat(je.MARK).concat(["%",";",":","&","=","+","$",","]);je.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(je.ALPHANUM);je.HEX=je.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);je.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(je.ALPHANUM);je.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&je.HEADER_CHARS.push(t);je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS.filter(t=>t!==44);je.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&je.QUOTED_STRING.push(t);je.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);je.MAJOR=je.NUM_MAP;je.MINOR=je.MAJOR;je.SPECIAL_HEADERS={connection:je.HEADER_STATE.CONNECTION,"content-length":je.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":je.HEADER_STATE.CONNECTION,"transfer-encoding":je.HEADER_STATE.TRANSFER_ENCODING,upgrade:je.HEADER_STATE.UPGRADE};je.default={ERROR:je.ERROR,TYPE:je.TYPE,FLAGS:je.FLAGS,LENIENT_FLAGS:je.LENIENT_FLAGS,METHODS:je.METHODS,STATUSES:je.STATUSES,FINISH:je.FINISH,HEADER_STATE:je.HEADER_STATE,ALPHA:je.ALPHA,NUM_MAP:je.NUM_MAP,HEX_MAP:je.HEX_MAP,NUM:je.NUM,ALPHANUM:je.ALPHANUM,MARK:je.MARK,USERINFO_CHARS:je.USERINFO_CHARS,URL_CHAR:je.URL_CHAR,HEX:je.HEX,TOKEN:je.TOKEN,HEADER_CHARS:je.HEADER_CHARS,CONNECTION_TOKEN_CHARS:je.CONNECTION_TOKEN_CHARS,QUOTED_STRING:je.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:je.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:je.MAJOR,MINOR:je.MINOR,SPECIAL_HEADERS:je.SPECIAL_HEADERS,METHODS_HTTP:je.METHODS_HTTP,METHODS_ICE:je.METHODS_ICE,METHODS_RTSP:je.METHODS_RTSP,METHOD_MAP:je.METHOD_MAP,H_METHOD_MAP:je.H_METHOD_MAP,STATUSES_HTTP:je.STATUSES_HTTP}});var gir=I((Hsf,U6n)=>{"use strict";p();var{Buffer:mIs}=require("node:buffer"),gIs="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==",mir;Object.defineProperty(U6n,"exports",{get:a(()=>mir||(mir=mIs.from(gIs,"base64")),"get")})});var q6n=I((Vsf,Q6n)=>{"use strict";p();var{Buffer:AIs}=require("node:buffer"),yIs="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==",Air;Object.defineProperty(Q6n,"exports",{get:a(()=>Air||(Air=AIs.from(yIs,"base64")),"get")})});var _Pe=I((Ysf,Y6n)=>{"use strict";p();var j6n=["GET","HEAD","POST"],EIs=new Set(j6n),_Is=[101,204,205,304],H6n=[301,302,303,307,308],vIs=new Set(H6n),G6n=["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"],CIs=new Set(G6n),$6n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],bIs=["",...$6n],SIs=new Set($6n),TIs=["follow","manual","error"],V6n=["GET","HEAD","OPTIONS","TRACE"],IIs=new Set(V6n),xIs=["navigate","same-origin","no-cors","cors"],wIs=["omit","same-origin","include"],RIs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],kIs=["content-encoding","content-language","content-location","content-type","content-length"],PIs=["half"],W6n=["CONNECT","TRACE","TRACK"],DIs=new Set(W6n),z6n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],NIs=new Set(z6n);Y6n.exports={subresource:z6n,forbiddenMethods:W6n,requestBodyHeader:kIs,referrerPolicy:bIs,requestRedirect:TIs,requestMode:xIs,requestCredentials:wIs,requestCache:RIs,redirectStatus:H6n,corsSafeListedMethods:j6n,nullBodyStatus:_Is,safeMethods:V6n,badPorts:G6n,requestDuplex:PIs,subresourceSet:NIs,badPortsSet:CIs,redirectStatusSet:vIs,corsSafeListedMethodsSet:EIs,safeMethodsSet:IIs,forbiddenMethodsSet:DIs,referrerPolicyTokens:SIs}});var Eir=I((Jsf,K6n)=>{"use strict";p();var yir=Symbol.for("undici.globalOrigin.1");function MIs(){return globalThis[yir]}a(MIs,"getGlobalOrigin");function OIs(t){if(t===void 0){Object.defineProperty(globalThis,yir,{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,yir,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(OIs,"setGlobalOrigin");K6n.exports={getGlobalOrigin:MIs,setGlobalOrigin:OIs}});var Dot=I((eaf,J6n)=>{"use strict";p();var LIs=new TextDecoder;function BIs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),LIs.decode(t))}a(BIs,"utf8DecodeBytes");J6n.exports={utf8DecodeBytes:BIs}});var VF=I((naf,t9n)=>{"use strict";p();var Z6n=require("node:assert"),{utf8DecodeBytes:FIs}=Dot();function UIs(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(HIs,"isomorphicDecode");var GIs=/[^\x00-\xFF]/;function $Is(t){return Z6n(!GIs.test(t)),t}a($Is,"isomorphicEncode");function VIs(t){return JSON.parse(FIs(t))}a(VIs,"parseJSONFromBytes");function WIs(t,e=!0,r=!0){return e9n(t,e,r,X6n)}a(WIs,"removeASCIIWhitespace");function e9n(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(e9n,"removeChars");function zIs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return Z6n(typeof e=="string"),e}a(zIs,"serializeJavascriptValueToJSONString");t9n.exports={collectASequenceOfCodePoints:UIs,collectASequenceOfCodePointsFast:QIs,forgivingBase64:jIs,isASCIIWhitespace:X6n,isomorphicDecode:HIs,isomorphicEncode:$Is,parseJSONFromBytes:VIs,removeASCIIWhitespace:WIs,removeChars:e9n,serializeJavascriptValueToJSONString:zIs}});var Lw=I((saf,a9n)=>{"use strict";p();var Mot=require("node:assert"),{forgivingBase64:YIs,collectASequenceOfCodePoints:_ir,collectASequenceOfCodePointsFast:vPe,isomorphicDecode:KIs,removeASCIIWhitespace:JIs,removeChars:ZIs}=VF(),XIs=new TextEncoder,CPe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,exs=/[\u000A\u000D\u0009\u0020]/u,txs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function rxs(t){Mot(t.protocol==="data:");let e=i9n(t,!0);e=e.slice(5);let r={position:0},n=vPe(",",e,r),o=n.length;if(n=JIs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=o9n(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=KIs(c);if(c=YIs(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=vir(n);return l==="failure"&&(l=vir("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(rxs,"dataURLProcessor");function i9n(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(i9n,"URLSerializer");function o9n(t){let e=XIs.encode(t);return nxs(e)}a(o9n,"stringPercentDecode");function r9n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(r9n,"isHexCharByte");function n9n(t){return t>=48&&t<=57?t-48:(t&223)-55}a(n9n,"hexByteToNumber");function nxs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=vPe(";",t,e);if(n=Not(n,!1,!0),n.length===0||!CPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionexs.test(d),t,e);let l=_ir(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=s9n(t,e,!0),vPe(";",t,e);else if(u=vPe(";",t,e),u=Not(u,!1,!0),u.length===0)continue;l.length!==0&&CPe.test(l)&&(u.length===0||txs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(vir,"parseMIMEType");function s9n(t,e,r=!1){let n=e.position,o="";for(Mot(t[e.position]==='"'),e.position++;o+=_ir(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{Mot(s==='"');break}}return r?o:t.slice(n,e.position)}a(s9n,"collectAnHTTPQuotedString");function ixs(t){Mot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",CPe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(ixs,"serializeAMimeType");function oxs(t){return t===13||t===10||t===9||t===32}a(oxs,"isHTTPWhiteSpace");function Not(t,e=!0,r=!0){return ZIs(t,e,r,oxs)}a(Not,"removeHTTPWhitespace");function sxs(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(sxs,"minimizeSupportedMimeType");a9n.exports={dataURLProcessor:rxs,URLSerializer:i9n,stringPercentDecode:o9n,parseMIMEType:vir,collectAnHTTPQuotedString:s9n,serializeAMimeType:ixs,removeHTTPWhitespace:Not,minimizeSupportedMimeType:sxs,HTTP_TOKEN_CODEPOINTS:CPe}});var WF=I((laf,bir)=>{"use strict";p();var c9n={__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 axs(t){try{return c9n[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(axs,"detectRuntimeFeatureByNodeModule");function cxs(t,e){return typeof c9n[t]()[e]<"u"}a(cxs,"detectRuntimeFeatureByExportedProperty");var l9n=["markAsUncloneable","zstd"],lxs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},u9n=["crypto","sqlite"],uxs=[...u9n,...l9n];function dxs(t){if(u9n.includes(t))return axs(`node:${t}`);if(l9n.includes(t)){let[e,r]=lxs[t];return cxs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(dxs,"detectRuntimeFeature");var Cir=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(uxs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=dxs(e);return this.#e.set(e,r),r}},d9n=new Cir;bir.exports.runtimeFeatures=d9n;bir.exports.default=d9n});var VA=I((faf,p9n)=>{"use strict";p();var fxs=require("node:assert"),{types:gp,inspect:pxs}=require("node:util"),{runtimeFeatures:hxs}=WF(),Sir=1,Tir=2,Oot=3,Lot=4,Iir=5,Bot=6,xir=7,_T=8,f9n=Function.call.bind(Function.prototype[Symbol.hasInstance]),ut={converters:{},util:{},errors:{},is:{}};ut.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};ut.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 ut.errors.exception({header:t.prefix,message:r})};ut.errors.invalidArgument=function(t){return ut.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};ut.brandCheck=function(t,e){if(!f9n(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};ut.brandCheckMultiple=function(t){let e=t.map(r=>ut.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};ut.argumentLengthCheck=function({length:t},e,r){if(tf9n(t,e)};ut.util.Type=function(t){switch(typeof t){case"undefined":return Sir;case"boolean":return Tir;case"string":return Oot;case"symbol":return Lot;case"number":return Iir;case"bigint":return Bot;case"function":case"object":return t===null?xir:_T}};ut.util.Types={UNDEFINED:Sir,BOOLEAN:Tir,STRING:Oot,SYMBOL:Lot,NUMBER:Iir,BIGINT:Bot,NULL:xir,OBJECT:_T};ut.util.TypeValueToString=function(t){switch(ut.util.Type(t)){case Sir:return"Undefined";case Tir:return"Boolean";case Oot:return"String";case Lot:return"Symbol";case Iir:return"Number";case Bot:return"BigInt";case xir:return"Null";case _T:return"Object"}};ut.util.markAsUncloneable=hxs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};ut.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),ut.util.HasFlag(n,ut.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw ut.errors.exception({header:"Integer conversion",message:`Could not convert ${ut.util.Stringify(t)} to an integer.`});if(c=ut.util.IntegerPart(c),co)throw ut.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&ut.util.HasFlag(n,ut.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=ut.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};ut.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};ut.util.Stringify=function(t){switch(ut.util.Type(t)){case Lot:return`Symbol(${t.description})`;case _T:return pxs(t);case Oot:return`"${t}"`;case Bot:return`${t}n`;default:return`${t}`}};ut.util.IsResizableArrayBuffer=function(t){if(gp.isArrayBuffer(t))return t.resizable;if(gp.isSharedArrayBuffer(t))return t.growable;throw ut.errors.exception({header:"IsResizableArrayBuffer",message:`"${ut.util.Stringify(t)}" is not an array buffer.`})};ut.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};ut.sequenceConverter=function(t){return(e,r,n,o)=>{if(ut.util.Type(e)!==_T)throw ut.errors.exception({header:r,message:`${n} (${ut.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 ut.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}};ut.recordConverter=function(t,e){return(r,n,o)=>{if(ut.util.Type(r)!==_T)throw ut.errors.exception({header:n,message:`${o} ("${ut.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!gp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=ut.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}};ut.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw ut.errors.exception({header:n,message:`Expected ${o} ("${ut.util.Stringify(r)}") to be an instance of ${e}.`});return r}};ut.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&ut.util.Type(e)!==_T)throw ut.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 ut.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 ut.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};ut.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};ut.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};ut.is.ReadableStream=ut.util.MakeTypeAssertion(ReadableStream);ut.is.Blob=ut.util.MakeTypeAssertion(Blob);ut.is.URLSearchParams=ut.util.MakeTypeAssertion(URLSearchParams);ut.is.File=ut.util.MakeTypeAssertion(File);ut.is.URL=ut.util.MakeTypeAssertion(URL);ut.is.AbortSignal=ut.util.MakeTypeAssertion(AbortSignal);ut.is.MessagePort=ut.util.MakeTypeAssertion(MessagePort);ut.is.BufferSource=function(t){return gp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&gp.isArrayBuffer(t.buffer)};ut.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(gp.isTypedArray(e)||gp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(fxs(gp.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};ut.converters.DOMString=function(t,e,r,n){if(t===null&&ut.util.HasFlag(n,ut.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};ut.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw ut.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};ut.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};ut.converters.boolean=function(t){return!!t};ut.converters.any=function(t){return t};ut.converters["long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"signed",0,e,r)};ut.converters["unsigned long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"unsigned",0,e,r)};ut.converters["unsigned long"]=function(t,e,r){return ut.util.ConvertToInt(t,32,"unsigned",0,e,r)};ut.converters["unsigned short"]=function(t,e,r,n){return ut.util.ConvertToInt(t,16,"unsigned",n,e,r)};ut.converters.ArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==_T||!gp.isArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};ut.converters.SharedArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==_T||!gp.isSharedArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};ut.converters.TypedArray=function(t,e,r,n,o){if(ut.util.Type(t)!==_T||!gp.isTypedArray(t)||t.constructor.name!==e.name)throw ut.errors.conversionFailed({prefix:r,argument:`${n} ("${ut.util.Stringify(t)}")`,types:[e.name]});if(!ut.util.HasFlag(o,ut.attributes.AllowShared)&&gp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(o,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};ut.converters.DataView=function(t,e,r,n){if(ut.util.Type(t)!==_T||!gp.isDataView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["DataView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&gp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.ArrayBufferView=function(t,e,r,n){if(ut.util.Type(t)!==_T||!gp.isArrayBufferView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&gp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.BufferSource=function(t,e,r,n){if(gp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(gp.isArrayBufferView(t))return n&=~ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw gp.isSharedArrayBuffer(t)?ut.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};ut.converters.AllowSharedBufferSource=function(t,e,r,n){if(gp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(gp.isSharedArrayBuffer(t))return ut.converters.SharedArrayBuffer(t,e,r,n);if(gp.isArrayBufferView(t))return n|=ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};ut.converters["sequence"]=ut.sequenceConverter(ut.converters.ByteString);ut.converters["sequence>"]=ut.sequenceConverter(ut.converters["sequence"]);ut.converters["record"]=ut.recordConverter(ut.converters.ByteString,ut.converters.ByteString);ut.converters.Blob=ut.interfaceConverter(ut.is.Blob,"Blob");ut.converters.AbortSignal=ut.interfaceConverter(ut.is.AbortSignal,"AbortSignal");ut.converters.EventHandlerNonNull=function(t){return ut.util.Type(t)!==_T?null:typeof t=="function"?t:()=>{}};ut.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};p9n.exports={webidl:ut}});var vT=I((haf,x9n)=>{"use strict";p();var{Transform:mxs}=require("node:stream"),h9n=require("node:zlib"),{redirectStatusSet:gxs,referrerPolicyTokens:Axs,badPortsSet:yxs}=_Pe(),{getGlobalOrigin:m9n}=Eir(),{collectAnHTTPQuotedString:Exs,parseMIMEType:_xs}=Lw(),{performance:vxs}=require("node:perf_hooks"),{ReadableStreamFrom:Cxs,isValidHTTPToken:g9n,normalizedMethodRecordsBase:bxs}=Do(),SPe=require("node:assert"),{isUint8Array:Sxs}=require("node:util/types"),{webidl:jj}=VA(),{isomorphicEncode:wir,collectASequenceOfCodePoints:TZ,removeChars:Txs}=VF();function A9n(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(A9n,"responseURL");function Ixs(t,e){if(!gxs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&E9n(r)&&(y9n(r)||(r=xxs(r)),r=new URL(r,A9n(t))),r&&!r.hash&&(r.hash=e),r}a(Ixs,"responseLocationURL");function y9n(t){for(let e=0;e126||r<32)return!1}return!0}a(y9n,"isValidEncodedURL");function xxs(t){return Buffer.from(t,"binary").toString("utf8")}a(xxs,"normalizeBinaryStringToUtf8");function xZ(t){return t.urlList[t.urlList.length-1]}a(xZ,"requestCurrentURL");function wxs(t){let e=xZ(t);return T9n(e)&&yxs.has(e.port)?"blocked":"allowed"}a(wxs,"requestBadPort");function Rxs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Rxs,"isErrorLike");function kxs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(kxs,"isValidReasonPhrase");var Pxs=g9n;function E9n(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(E9n,"isValidHeaderValue");function Dxs(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(Axs.has(o)){r=o;break}}return r}a(Dxs,"parseReferrerPolicy");function Nxs(t,e){let r=Dxs(e);r!==""&&(t.referrerPolicy=r)}a(Nxs,"setRequestReferrerPolicyOnRedirect");function Mxs(){return"allowed"}a(Mxs,"crossOriginResourcePolicyCheck");function Oxs(){return"success"}a(Oxs,"corsCheck");function Lxs(){return"success"}a(Lxs,"TAOCheck");function Bxs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Bxs,"appendFetchMetadata");function Fxs(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&&kir(t.origin)&&!kir(xZ(t))&&(e=null);break;case"same-origin":bPe(t,xZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Fxs,"appendRequestOriginHeader");function ope(t,e){return t}a(ope,"coarsenTime");function Uxs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Rir(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=xZ(t);return IZ(n)&&!IZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=xZ(t);return bPe(n,s)?n:IZ(n)&&!IZ(s)?"no-referrer":o}case"same-origin":return bPe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return bPe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=xZ(t);return IZ(n)&&!IZ(s)?"no-referrer":n}}}a(Hxs,"determineRequestsReferrer");function Rir(t,e=!1){return SPe(jj.is.URL(t)),t=new URL(t),S9n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Rir,"stripURLForReferrer");var Gxs=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)$/),$xs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function v9n(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),$xs(t)):Gxs(t)}a(v9n,"isOriginIPPotentiallyTrustworthy");function Vxs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||v9n(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Vxs,"isOriginPotentiallyTrustworthy");function IZ(t){return jj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Vxs(t.origin):!1}a(IZ,"isURLPotentiallyTrustworthy");function Wxs(t){}a(Wxs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function bPe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(bPe,"sameOrigin");function zxs(t){return t.controller.state==="aborted"}a(zxs,"isAborted");function Yxs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Yxs,"isCancelled");function Kxs(t){return bxs[t.toLowerCase()]??t}a(Kxs,"normalizeMethod");var Jxs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function C9n(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,Jxs),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(C9n,"createIterator");function Zxs(t,e,r,n=0,o=1){let s=C9n(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return jj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return jj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return jj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(jj.brandCheck(this,e),jj.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(Zxs,"iteratorMixin");function Xxs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();b9n(s,n,o)}catch(s){o(s)}}a(Xxs,"fullyReadBody");function ews(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(ews,"readableStreamClose");async function b9n(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(!Sxs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(b9n,"readAllBytes");function S9n(t){SPe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(S9n,"urlIsLocal");function kir(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(kir,"urlHasHttpsScheme");function T9n(t){SPe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(T9n,"urlIsHttpHttpsScheme");function tws(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&TZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&TZ(u=>u===" "||u===" ",r,n);let o=TZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&TZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&TZ(u=>u===" "||u===" ",r,n);let c=TZ(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(tws,"simpleRangeHeaderValue");function rws(t,e,r){let n="bytes ";return n+=wir(`${t}`),n+="-",n+=wir(`${e}`),n+="/",n+=wir(`${r}`),n}a(rws,"buildContentRange");var Pir=class extends mxs{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?h9n.createInflate(this.#e):h9n.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 nws(t){return new Pir(t)}a(nws,"createInflate");function iws(t){let e=null,r=null,n=null,o=I9n("content-type",t);if(o===null)return"failure";for(let s of o){let c=_xs(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(iws,"extractMimeType");function ows(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(ows,"gettingDecodingSplitting");function I9n(t,e){let r=e.get(t,!0);return r===null?null:ows(r)}a(I9n,"getDecodeSplit");function sws(t){return!1}a(sws,"hasAuthenticationEntry");function aws(t){return!!(t.username||t.password)}a(aws,"includesCredentials");function cws(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(cws,"isTraversableNavigable");var Dir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return m9n()}get origin(){return this.baseUrl?.origin}policyContainer=_9n()},Nir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new Dir},lws=new Nir;x9n.exports={isAborted:zxs,isCancelled:Yxs,isValidEncodedURL:y9n,ReadableStreamFrom:Cxs,tryUpgradeRequestToAPotentiallyTrustworthyURL:Wxs,clampAndCoarsenConnectionTimingInfo:Uxs,coarsenedSharedCurrentTime:Qxs,determineRequestsReferrer:Hxs,makePolicyContainer:_9n,clonePolicyContainer:jxs,appendFetchMetadata:Bxs,appendRequestOriginHeader:Fxs,TAOCheck:Lxs,corsCheck:Oxs,crossOriginResourcePolicyCheck:Mxs,createOpaqueTimingInfo:qxs,setRequestReferrerPolicyOnRedirect:Nxs,isValidHTTPToken:g9n,requestBadPort:wxs,requestCurrentURL:xZ,responseURL:A9n,responseLocationURL:Ixs,isURLPotentiallyTrustworthy:IZ,isValidReasonPhrase:kxs,sameOrigin:bPe,normalizeMethod:Kxs,iteratorMixin:Zxs,createIterator:C9n,isValidHeaderName:Pxs,isValidHeaderValue:E9n,isErrorLike:Rxs,fullyReadBody:Xxs,readableStreamClose:ews,urlIsLocal:S9n,urlHasHttpsScheme:kir,urlIsHttpHttpsScheme:T9n,readAllBytes:b9n,simpleRangeHeaderValue:tws,buildContentRange:rws,createInflate:nws,extractMimeType:iws,getDecodeSplit:I9n,environmentSettingsObject:lws,isOriginIPPotentiallyTrustworthy:v9n,hasAuthenticationEntry:sws,includesCredentials:aws,isTraversableNavigable:cws}});var Fot=I((Aaf,R9n)=>{"use strict";p();var{iteratorMixin:uws}=vT(),{kEnumerableProperty:spe}=Do(),{webidl:Rc}=VA(),w9n=require("node:util"),zF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Rc.util.markAsUncloneable(this),e!==void 0)throw Rc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.append";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=Mir(e,r,n);this.#e.push(s)}delete(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Rc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.get"),e=Rc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Rc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.has"),e=Rc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.set";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=Mir(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)}[w9n.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=w9n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:dws,setFormDataState:fws}=zF;Reflect.deleteProperty(zF,"getFormDataState");Reflect.deleteProperty(zF,"setFormDataState");uws("FormData",zF,dws,"name","value");Object.defineProperties(zF.prototype,{append:spe,delete:spe,get:spe,getAll:spe,has:spe,set:spe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Mir(t,e,r){if(typeof e!="string"){if(Rc.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(Mir,"makeEntry");Rc.is.FormData=Rc.util.MakeTypeAssertion(zF);R9n.exports={FormData:zF,makeEntry:Mir,setFormDataState:fws}});var D9n=I((_af,P9n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:pws}=Do(),{HTTP_TOKEN_CODEPOINTS:hws}=Lw(),{makeEntry:mws}=Fot(),{webidl:Oir}=VA(),Lir=require("node:assert"),{isomorphicDecode:k9n}=VF(),gws=Buffer.from("--"),Bir=new TextDecoder,Aws=new TextDecoder("utf-8",{ignoreBOM:!0});function yws(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(Ews,"validateBoundary");function _ws(t,e){Lir(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw pb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw pb("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 pb("expected a value starting with -- and the boundary");if(bws(t,gws,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw pb("expected CRLF");s.position+=2;let l=Cws(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 pb("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 pb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",yws(f)||(f=""),g=new File([m],d,{type:f})):g=Aws.decode(Buffer.from(m)),Lir(Oir.is.USVString(u)),Lir(typeof g=="string"&&Oir.is.USVString(g)||Oir.is.File(g)),o.push(mws(u,g,d))}}a(_ws,"multipartFormDataParser");function vws(t,e){t[e.position]===59&&e.position++,Bw(c=>c===32||c===9,t,e);let r=Bw(c=>Uir(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++,Bw(c=>c===32||c===9,t,e);let s;if(o){let c=Bw(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 pb("unknown encoding, expected utf-8''");s=decodeURIComponent(Bir.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Bw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw pb("Closing quote not found");e.position++,s=Bir.decode(c).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Bw(l=>Uir(l)&&l!==59,t,e);s=Bir.decode(c)}return{name:n,value:s,extended:o}}a(vws,"parseContentDispositionAttribute");function Cws(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 pb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Bw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Fir(c,!0,!0,l=>l===9||l===32),!hws.test(c.toString()))throw pb("header name does not match the field-name token production");if(t[e.position]!==58)throw pb("expected :");switch(e.position++,Bw(l=>l===32||l===9,t,e),pws(c)){case"content-disposition":{r=n=null;let l=!1;if(Bw(d=>Uir(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw pb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Fir(l,!1,!0,u=>u===9||u===32),o=k9n(l);break}case"content-transfer-encoding":{let l=Bw(u=>u!==10&&u!==13,t,e);l=Fir(l,!1,!0,u=>u===9||u===32),s=k9n(l);break}default:Bw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw pb("expected CRLF");e.position+=2}}a(Cws,"parseMultipartFormDataHeaders");function Bw(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(Fir,"removeChars");function bws(t,e,r){if(t.length{"use strict";p();function Iws(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(Iws,"createDeferredPromise");N9n.exports={createDeferredPromise:Iws}});var cpe=I((Iaf,F9n)=>{"use strict";p();var jir=Do(),{ReadableStreamFrom:xws,readableStreamClose:wws,fullyReadBody:Rws,extractMimeType:kws}=vT(),{FormData:M9n,setFormDataState:Pws}=Fot(),{webidl:T2}=VA(),Qir=require("node:assert"),{isErrored:qir,isDisturbed:Dws}=require("node:stream"),{isUint8Array:Nws}=require("node:util/types"),{serializeAMimeType:Mws}=Lw(),{multipartFormDataParser:Ows}=D9n(),{createDeferredPromise:Lws}=TPe(),{parseJSONFromBytes:Bws}=VF(),{utf8DecodeBytes:Fws}=Dot(),{runtimeFeatures:Uws}=WF(),Qws=Uws.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Uot=new TextEncoder;function qws(){}a(qws,"noop");var jws=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Dws(e)&&!qir(e)&&e.cancel("Response object has been garbage collected").catch(qws)});function L9n(t,e=!1){let r=null,n=null;T2.is.ReadableStream(t)?r=t:T2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Qir(T2.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(T2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(T2.is.BufferSource(t))s=T2.util.getCopyOfBytesHeldByBufferSource(t);else if(T2.is.FormData(t)){let d=`----formdata-undici-0${`${Qws(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=Not.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=Uot.encode(f+`; name="${h(m(_))}"\r \r ${m(v)}\r -`);g.push(b),c+=b.byteLength}else{let b=Not.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r +`);g.push(b),c+=b.byteLength}else{let b=Uot.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=Not.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(b2.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(Fir.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=b2.is.ReadableStream(t)?t:fws(t)}return(typeof s=="string"||yws(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(Bir(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Bir(r)&&n.enqueue(typeof d=="string"?Not.encode(d):new Uint8Array(d));queueMicrotask(()=>pws(n))})(),[{stream:r,source:s,length:c},l]}a(P9n,"extractBody");function wws(t,e=!1){return b2.is.ReadableStream(t)&&(Lir(!Fir.isDisturbed(t),"The body has already been consumed."),Lir(!t.locked,"The stream is locked.")),P9n(t,e)}a(wws,"safelyExtractBody");function Rws(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(Rws,"cloneBody");function kws(t,e){return{blob(){return spe(this,n=>{let o=k9n(e(this));return o===null?o="":o&&(o=Ews(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return spe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return spe(this,bws,t,e)},json(){return spe(this,Cws,t,e)},formData(){return spe(this,n=>{let o=k9n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=_ws(n,o),c=new R9n;return gws(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new R9n;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 spe(this,n=>new Uint8Array(n),t,e)}}}a(kws,"bodyMixinMethods");function Pws(t,e){Object.assign(t.prototype,kws(t,e))}a(Pws,"mixinBody");function spe(t,e,r,n){try{b2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),D9n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=vws(),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):(hws(t.body,c,s),o.promise)}a(spe,"consumeBody");function D9n(t){let e=t.body;return e!=null&&(e.stream.locked||Fir.isDisturbed(e.stream))}a(D9n,"bodyUnusable");function k9n(t){let e=t.headersList,r=mws(e);return r==="failure"?null:r}a(k9n,"bodyMimeType");N9n.exports={extractBody:P9n,safelyExtractBody:wws,cloneBody:Rws,mixinBody:Pws,streamRegistry:xws,bodyUnusable:D9n}});var z9n=I((laf,W9n)=>{"use strict";p();var Oi=require("node:assert"),Ti=Po(),{channels:M9n}=Bj(),Uir=ynr(),{RequestContentLengthMismatchError:IZ,ResponseContentLengthMismatchError:O9n,RequestAbortedError:H9n,HeadersTimeoutError:Dws,HeadersOverflowError:Nws,SocketError:xZ,InformationalError:cpe,BodyTimeoutError:Mws,HTTPParserError:Ows,ResponseExceededMaxSizeError:Lws}=ao(),{kUrl:G9n,kReset:hb,kClient:Fot,kParser:ud,kBlocking:TPe,kRunning:lm,kPending:Vir,kSize:L9n,kWriting:Qj,kQueue:S2,kNoRef:bPe,kKeepAliveDefaultTimeout:Bws,kHostHeader:Fws,kPendingIdx:Uws,kRunningIdx:Lw,kError:lv,kPipelining:Lot,kSocket:RZ,kKeepAliveTimeoutValue:Uot,kMaxHeadersSize:Qws,kKeepAliveMaxTimeout:qws,kKeepAliveTimeoutThreshold:jws,kHeadersTimeout:Hws,kBodyTimeout:Gws,kStrictContentLength:jir,kMaxRequests:B9n,kCounter:$ws,kMaxResponseSize:Vws,kOnError:F9n,kResume:WF,kHTTPContext:$9n,kClosed:Hir}=al(),_T=N6n(),U9n=Buffer.alloc(0),Mot=Buffer[Symbol.species],Wws=Ti.removeAllListeners,kZ=Symbol("kIdleSocketValidation"),wZ=Symbol("kIdleSocketValidationTimeout"),Wir=Symbol("kSocketUsed"),Qir;function zws(){let t=process.env.JEST_WORKER_ID?fir():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(L6n())}catch{}return e||(e=new WebAssembly.Module(t||fir())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onStatus(new Mot(k5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Oi(mp.ptr===n),mp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderField(new Mot(k5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderValue(new Mot(k5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Oi(mp.ptr===n),mp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onBody(new Mot(k5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Oi(mp.ptr===n),mp.onMessageComplete()),"wasm_on_message_complete")}})}a(zws,"lazyllhttp");var qir=null,mp=null,k5=null,Oot=0,P5=null,Yws=0,SPe=1,lpe=2|SPe,Bot=4|SPe,Gir=8|Yws,$ir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(_T.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[Qws],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Vws]}setTimeout(e,r){e!==this.timeoutValue||r&SPe^this.timeoutType&SPe?(this.timeout&&(Uir.clearTimeout(this.timeout),this.timeout=null),e&&(r&SPe?this.timeout=Uir.setFastTimeout(Q9n,e,this.timeoutWeakRef):(this.timeout=setTimeout(Q9n,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||(Oi(this.ptr!=null),Oi(mp===null),this.llhttp.llhttp_resume(this.ptr),Oi(this.timeoutType===Bot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||U9n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Oot&&(P5&&n.free(P5),Oot=Math.ceil(e.length/4096)*4096,P5=n.malloc(Oot)),new Uint8Array(n.memory.buffer,P5,Oot).set(e);try{let o;try{k5=e,mp=this,o=n.llhttp_execute(this.ptr,P5,e.length)}finally{mp=null,k5=null}if(o!==_T.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-P5);if(o===_T.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===_T.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{llhttp:e}=this,r;try{mp=this,r=e.llhttp_finish(this.ptr)}finally{mp=null}return r===_T.ERROR.OK?null:r===_T.ERROR.PAUSED||r===_T.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,U9n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new O9n;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 Ows(l,_T.ERROR[e],r)}destroy(){Oi(mp===null),Oi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Uir.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;if(r[lm]===0)return Ti.destroy(e,new xZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[S2][r[Lw]];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=Ti.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ti.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ti.destroy(this.socket,new Nws)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Oi(r),Oi(n[RZ]===o),Oi(!o.destroyed),Oi(!this.paused),Oi((s.length&1)===0);let l=n[S2][n[Lw]];Oi(l),Oi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[ud].destroy(),o[ud]=null,o[Fot]=null,o[lv]=null,Wws(o),n[RZ]=null,n[$9n]=null,n[S2][n[Lw]++]=null,n.emit("disconnect",n[G9n],[n],new cpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[WF]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[lm]===0)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[S2][o[Lw]];if(!u)return-1;if(Oi(!this.upgrade),Oi(this.statusCode<200),e===100)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new xZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Oi(this.timeoutType===lpe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[hb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Gws];this.setTimeout(f,Bot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Oi(o[lm]===1),this.upgrade=!0,2;if(r)return Oi(o[lm]===1),this.upgrade=!0,2;if(Oi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Lot]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[jws],o[qws]);h<=0?s[hb]=!0:o[Uot]=h}else o[Uot]=o[Bws]}else s[hb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[TPe]&&(s[TPe]=!1,o[WF]()),d?_T.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[S2][r[Lw]];return Oi(c),Oi(this.timeoutType===Bot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Oi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new Lws),-1):(this.bytesRead+=e.length,c.onData(e)===!1?_T.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;Oi(n>=100),Oi((this.headers.length&1)===0);let d=e[S2][e[Lw]];if(Oi(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 Ti.destroy(r,new O9n),-1;if(d.onComplete(s),e[S2][e[Lw]++]=null,r[Wir]=e[Vir]===0,r[Qj])return Oi(e[lm]===0),Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;if(u){if(r[hb]&&e[lm]===0)return Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;e[Lot]==null||e[Lot]===1?setImmediate(e[WF]):e[WF]()}else return Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;return 0}};function Q9n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===lpe?(!r[Qj]||r.writableNeedDrain||o[lm]>1)&&(Oi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new Dws)):n===Bot?s||Ti.destroy(r,new Mws):n===Gir&&(Oi(o[lm]===0&&o[Uot]),Ti.destroy(r,new cpe("socket idle timeout")))}a(Q9n,"onParserTimeout");function Kws(t,e){if(t[RZ]=e,qir||(qir=zws()),e.errored)throw e.errored;if(e.destroyed)throw new xZ("destroyed");return e[bPe]=!1,e[Qj]=!1,e[hb]=!1,e[TPe]=!1,e[kZ]=0,e[wZ]=null,e[Wir]=!1,e[ud]=new $ir(t,e,qir),Ti.addListener(e,"error",Jws),Ti.addListener(e,"readable",Zws),Ti.addListener(e,"end",Xws),Ti.addListener(e,"close",eRs),e[Hir]=!1,e.on("close",tRs),{version:"h1",defaultPipelining:1,write(r){return oRs(t,r)},resume(){nRs(t)},destroy(r,n){e[Hir]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[Qj]||e[hb]||e[TPe]||e[kZ]===1||r&&(t[lm]>0&&!r.idempotent||t[lm]>0&&(r.upgrade||r.method==="CONNECT")||t[lm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(Kws,"connectH1");function Jws(t){Oi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[ud];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[lv]=r,this[Fot][F9n](r));return}this[lv]=t,this[Fot][F9n](t)}a(Jws,"onHttpSocketError");function Zws(){this[ud]?.readMore()}a(Zws,"onHttpSocketReadable");function Xws(){let t=this[ud];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new xZ("other side closed",Ti.getSocketInfo(this)))}a(Xws,"onHttpSocketEnd");function eRs(){let t=this[ud];V9n(this),t&&(!this[lv]&&t.statusCode&&!t.shouldKeepAlive&&(this[lv]=t.finish()||this[lv]),this[ud].destroy(),this[ud]=null);let e=this[lv]||new xZ("closed",Ti.getSocketInfo(this)),r=this[Fot];if(r[RZ]=null,r[$9n]=null,r.destroyed){Oi(r[Vir]===0);let n=r[S2].splice(r[Lw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[S2][r[Lw]];r[S2][r[Lw]++]=null,Ti.errorRequest(r,n,e)}r[Uws]=r[Lw],Oi(r[lm]===0),r.emit("disconnect",r[G9n],[r],e),r[WF]()}a(eRs,"onHttpSocketClose");function tRs(){this[Hir]=!0}a(tRs,"onSocketClose");function V9n(t){t[wZ]&&(clearTimeout(t[wZ]),t[wZ]=null),t[kZ]=0}a(V9n,"clearIdleSocketValidation");function rRs(t,e){e[kZ]=1,e[wZ]=setTimeout(()=>{e[wZ]=null,e[kZ]=2,t[RZ]===e&&!e.destroyed&&t[WF]()},0),e[wZ].unref?.()}a(rRs,"scheduleIdleSocketValidation");function nRs(t){let e=t[RZ];if(e&&!e.destroyed){if(t[L9n]===0?!e[bPe]&&e.unref&&(e.unref(),e[bPe]=!0):e[bPe]&&e.ref&&(e.ref(),e[bPe]=!1),t[lm]===0&&t[Vir]>0&&e[Wir]){if(e[kZ]===0)return rRs(t,e),e[ud].readMore(),e.destroyed,void 0;if(e[kZ]===1)return e[ud].readMore(),e.destroyed,void 0}if(t[lm]===0&&(e[ud].readMore(),e.destroyed))return;if(t[L9n]===0)e[ud].timeoutType!==Gir&&e[ud].setTimeout(t[Uot],Gir);else if(t[lm]>0&&e[ud].statusCode<200&&e[ud].timeoutType!==lpe){let r=t[S2][t[Lw]],n=r.headersTimeout!=null?r.headersTimeout:t[Hws];e[ud].setTimeout(n,lpe)}}}a(nRs,"resumeH1");function iRs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(iRs,"shouldSendContentLength");function oRs(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(Ti.isFormDataLike(u)){Qir||(Qir=ape().extractBody);let[E,_]=Qir(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ti.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ti.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),iRs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[jir])return Ti.errorRequest(t,e,new IZ),!1;process.emitWarning(new IZ)}let g=t[RZ];V9n(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new H9n),Ti.destroy(u),Ti.destroy(g,new cpe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[hb]=!0),(s||r==="CONNECT")&&(g[hb]=!0),l!=null&&(g[hb]=l),t[B9n]&&g[$ws]++>=t[B9n]&&(g[hb]=!0),c&&(g[TPe]=!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=Uot.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(T2.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(jir.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=T2.is.ReadableStream(t)?t:xws(t)}return(typeof s=="string"||Nws(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(qir(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!qir(r)&&n.enqueue(typeof d=="string"?Uot.encode(d):new Uint8Array(d));queueMicrotask(()=>wws(n))})(),[{stream:r,source:s,length:c},l]}a(L9n,"extractBody");function Hws(t,e=!1){return T2.is.ReadableStream(t)&&(Qir(!jir.isDisturbed(t),"The body has already been consumed."),Qir(!t.locked,"The stream is locked.")),L9n(t,e)}a(Hws,"safelyExtractBody");function Gws(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(Gws,"cloneBody");function $ws(t,e){return{blob(){return ape(this,n=>{let o=O9n(e(this));return o===null?o="":o&&(o=Mws(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return ape(this,n=>new Uint8Array(n).buffer,t,e)},text(){return ape(this,Fws,t,e)},json(){return ape(this,Bws,t,e)},formData(){return ape(this,n=>{let o=O9n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=Ows(n,o),c=new M9n;return Pws(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new M9n;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 ape(this,n=>new Uint8Array(n),t,e)}}}a($ws,"bodyMixinMethods");function Vws(t,e){Object.assign(t.prototype,$ws(t,e))}a(Vws,"mixinBody");function ape(t,e,r,n){try{T2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),B9n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=Lws(),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):(Rws(t.body,c,s),o.promise)}a(ape,"consumeBody");function B9n(t){let e=t.body;return e!=null&&(e.stream.locked||jir.isDisturbed(e.stream))}a(B9n,"bodyUnusable");function O9n(t){let e=t.headersList,r=kws(e);return r==="failure"?null:r}a(O9n,"bodyMimeType");F9n.exports={extractBody:L9n,safelyExtractBody:Hws,cloneBody:Gws,mixinBody:Vws,streamRegistry:jws,bodyUnusable:B9n}});var X9n=I((Raf,Z9n)=>{"use strict";p();var Oi=require("node:assert"),Ti=Do(),{channels:U9n}=Qj(),Hir=Cnr(),{RequestContentLengthMismatchError:wZ,ResponseContentLengthMismatchError:Q9n,RequestAbortedError:z9n,HeadersTimeoutError:Wws,HeadersOverflowError:zws,SocketError:RZ,InformationalError:lpe,BodyTimeoutError:Yws,HTTPParserError:Kws,ResponseExceededMaxSizeError:Jws}=ao(),{kUrl:Y9n,kReset:hb,kClient:Got,kParser:dd,kBlocking:wPe,kRunning:dm,kPending:Kir,kSize:q9n,kWriting:Hj,kQueue:I2,kNoRef:IPe,kKeepAliveDefaultTimeout:Zws,kHostHeader:Xws,kPendingIdx:eRs,kRunningIdx:Fw,kError:dv,kPipelining:jot,kSocket:PZ,kKeepAliveTimeoutValue:$ot,kMaxHeadersSize:tRs,kKeepAliveMaxTimeout:rRs,kKeepAliveTimeoutThreshold:nRs,kHeadersTimeout:iRs,kBodyTimeout:oRs,kStrictContentLength:Vir,kMaxRequests:j9n,kCounter:sRs,kMaxResponseSize:aRs,kOnError:H9n,kResume:YF,kHTTPContext:K9n,kClosed:Wir}=al(),CT=F6n(),G9n=Buffer.alloc(0),Qot=Buffer[Symbol.species],cRs=Ti.removeAllListeners,DZ=Symbol("kIdleSocketValidation"),kZ=Symbol("kIdleSocketValidationTimeout"),Jir=Symbol("kSocketUsed"),Gir;function lRs(){let t=process.env.JEST_WORKER_ID?gir():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(q6n())}catch{}return e||(e=new WebAssembly.Module(t||gir())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Oi(Ap.ptr===n);let c=o-N5+D5.byteOffset;return Ap.onStatus(new Qot(D5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Oi(Ap.ptr===n),Ap.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Oi(Ap.ptr===n);let c=o-N5+D5.byteOffset;return Ap.onHeaderField(new Qot(D5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Oi(Ap.ptr===n);let c=o-N5+D5.byteOffset;return Ap.onHeaderValue(new Qot(D5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Oi(Ap.ptr===n),Ap.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Oi(Ap.ptr===n);let c=o-N5+D5.byteOffset;return Ap.onBody(new Qot(D5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Oi(Ap.ptr===n),Ap.onMessageComplete()),"wasm_on_message_complete")}})}a(lRs,"lazyllhttp");var $ir=null,Ap=null,D5=null,qot=0,N5=null,uRs=0,xPe=1,upe=2|xPe,Hot=4|xPe,zir=8|uRs,Yir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(CT.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[tRs],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[aRs]}setTimeout(e,r){e!==this.timeoutValue||r&xPe^this.timeoutType&xPe?(this.timeout&&(Hir.clearTimeout(this.timeout),this.timeout=null),e&&(r&xPe?this.timeout=Hir.setFastTimeout($9n,e,this.timeoutWeakRef):(this.timeout=setTimeout($9n,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||(Oi(this.ptr!=null),Oi(Ap===null),this.llhttp.llhttp_resume(this.ptr),Oi(this.timeoutType===Hot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||G9n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Oi(Ap===null),Oi(this.ptr!=null),Oi(!this.paused);let{socket:r,llhttp:n}=this;e.length>qot&&(N5&&n.free(N5),qot=Math.ceil(e.length/4096)*4096,N5=n.malloc(qot)),new Uint8Array(n.memory.buffer,N5,qot).set(e);try{let o;try{D5=e,Ap=this,o=n.llhttp_execute(this.ptr,N5,e.length)}finally{Ap=null,D5=null}if(o!==CT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-N5);if(o===CT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===CT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Oi(Ap===null),Oi(this.ptr!=null),Oi(!this.paused);let{llhttp:e}=this,r;try{Ap=this,r=e.llhttp_finish(this.ptr)}finally{Ap=null}return r===CT.ERROR.OK?null:r===CT.ERROR.PAUSED||r===CT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,G9n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new Q9n;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 Kws(l,CT.ERROR[e],r)}destroy(){Oi(Ap===null),Oi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Hir.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;if(r[dm]===0)return Ti.destroy(e,new RZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[I2][r[Fw]];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=Ti.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ti.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ti.destroy(this.socket,new zws)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Oi(r),Oi(n[PZ]===o),Oi(!o.destroyed),Oi(!this.paused),Oi((s.length&1)===0);let l=n[I2][n[Fw]];Oi(l),Oi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[dd].destroy(),o[dd]=null,o[Got]=null,o[dv]=null,cRs(o),n[PZ]=null,n[K9n]=null,n[I2][n[Fw]++]=null,n.emit("disconnect",n[Y9n],[n],new lpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[YF]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[dm]===0)return Ti.destroy(s,new RZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[I2][o[Fw]];if(!u)return-1;if(Oi(!this.upgrade),Oi(this.statusCode<200),e===100)return Ti.destroy(s,new RZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new RZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Oi(this.timeoutType===upe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[hb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[oRs];this.setTimeout(f,Hot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Oi(o[dm]===1),this.upgrade=!0,2;if(r)return Oi(o[dm]===1),this.upgrade=!0,2;if(Oi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[jot]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[nRs],o[rRs]);h<=0?s[hb]=!0:o[$ot]=h}else o[$ot]=o[Zws]}else s[hb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[wPe]&&(s[wPe]=!1,o[YF]()),d?CT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[I2][r[Fw]];return Oi(c),Oi(this.timeoutType===Hot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Oi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new Jws),-1):(this.bytesRead+=e.length,c.onData(e)===!1?CT.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;Oi(n>=100),Oi((this.headers.length&1)===0);let d=e[I2][e[Fw]];if(Oi(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 Ti.destroy(r,new Q9n),-1;if(d.onComplete(s),e[I2][e[Fw]++]=null,r[Jir]=e[Kir]===0,r[Hj])return Oi(e[dm]===0),Ti.destroy(r,new lpe("reset")),CT.ERROR.PAUSED;if(u){if(r[hb]&&e[dm]===0)return Ti.destroy(r,new lpe("reset")),CT.ERROR.PAUSED;e[jot]==null||e[jot]===1?setImmediate(e[YF]):e[YF]()}else return Ti.destroy(r,new lpe("reset")),CT.ERROR.PAUSED;return 0}};function $9n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===upe?(!r[Hj]||r.writableNeedDrain||o[dm]>1)&&(Oi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new Wws)):n===Hot?s||Ti.destroy(r,new Yws):n===zir&&(Oi(o[dm]===0&&o[$ot]),Ti.destroy(r,new lpe("socket idle timeout")))}a($9n,"onParserTimeout");function dRs(t,e){if(t[PZ]=e,$ir||($ir=lRs()),e.errored)throw e.errored;if(e.destroyed)throw new RZ("destroyed");return e[IPe]=!1,e[Hj]=!1,e[hb]=!1,e[wPe]=!1,e[DZ]=0,e[kZ]=null,e[Jir]=!1,e[dd]=new Yir(t,e,$ir),Ti.addListener(e,"error",fRs),Ti.addListener(e,"readable",pRs),Ti.addListener(e,"end",hRs),Ti.addListener(e,"close",mRs),e[Wir]=!1,e.on("close",gRs),{version:"h1",defaultPipelining:1,write(r){return _Rs(t,r)},resume(){yRs(t)},destroy(r,n){e[Wir]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[Hj]||e[hb]||e[wPe]||e[DZ]===1||r&&(t[dm]>0&&!r.idempotent||t[dm]>0&&(r.upgrade||r.method==="CONNECT")||t[dm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(dRs,"connectH1");function fRs(t){Oi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[dd];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[dv]=r,this[Got][H9n](r));return}this[dv]=t,this[Got][H9n](t)}a(fRs,"onHttpSocketError");function pRs(){this[dd]?.readMore()}a(pRs,"onHttpSocketReadable");function hRs(){let t=this[dd];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new RZ("other side closed",Ti.getSocketInfo(this)))}a(hRs,"onHttpSocketEnd");function mRs(){let t=this[dd];J9n(this),t&&(!this[dv]&&t.statusCode&&!t.shouldKeepAlive&&(this[dv]=t.finish()||this[dv]),this[dd].destroy(),this[dd]=null);let e=this[dv]||new RZ("closed",Ti.getSocketInfo(this)),r=this[Got];if(r[PZ]=null,r[K9n]=null,r.destroyed){Oi(r[Kir]===0);let n=r[I2].splice(r[Fw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[I2][r[Fw]];r[I2][r[Fw]++]=null,Ti.errorRequest(r,n,e)}r[eRs]=r[Fw],Oi(r[dm]===0),r.emit("disconnect",r[Y9n],[r],e),r[YF]()}a(mRs,"onHttpSocketClose");function gRs(){this[Wir]=!0}a(gRs,"onSocketClose");function J9n(t){t[kZ]&&(clearTimeout(t[kZ]),t[kZ]=null),t[DZ]=0}a(J9n,"clearIdleSocketValidation");function ARs(t,e){e[DZ]=1,e[kZ]=setTimeout(()=>{e[kZ]=null,e[DZ]=2,t[PZ]===e&&!e.destroyed&&t[YF]()},0),e[kZ].unref?.()}a(ARs,"scheduleIdleSocketValidation");function yRs(t){let e=t[PZ];if(e&&!e.destroyed){if(t[q9n]===0?!e[IPe]&&e.unref&&(e.unref(),e[IPe]=!0):e[IPe]&&e.ref&&(e.ref(),e[IPe]=!1),t[dm]===0&&t[Kir]>0&&e[Jir]){if(e[DZ]===0)return ARs(t,e),e[dd].readMore(),e.destroyed,void 0;if(e[DZ]===1)return e[dd].readMore(),e.destroyed,void 0}if(t[dm]===0&&(e[dd].readMore(),e.destroyed))return;if(t[q9n]===0)e[dd].timeoutType!==zir&&e[dd].setTimeout(t[$ot],zir);else if(t[dm]>0&&e[dd].statusCode<200&&e[dd].timeoutType!==upe){let r=t[I2][t[Fw]],n=r.headersTimeout!=null?r.headersTimeout:t[iRs];e[dd].setTimeout(n,upe)}}}a(yRs,"resumeH1");function ERs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(ERs,"shouldSendContentLength");function _Rs(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(Ti.isFormDataLike(u)){Gir||(Gir=cpe().extractBody);let[E,_]=Gir(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ti.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ti.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),ERs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Vir])return Ti.errorRequest(t,e,new wZ),!1;process.emitWarning(new wZ)}let g=t[PZ];J9n(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new z9n),Ti.destroy(u),Ti.destroy(g,new lpe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[hb]=!0),(s||r==="CONNECT")&&(g[hb]=!0),l!=null&&(g[hb]=l),t[j9n]&&g[sRs]++>=t[j9n]&&(g[hb]=!0),c&&(g[wPe]=!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[Fws],s?y+=`connection: upgrade\r +`:y+=t[Xws],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Lot]&&!g[hb]?y+=`connection: keep-alive\r +`:t[jot]&&!g[hb]?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 H9n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Oi(o.destroyed||o[Qj]&&r[lm]<=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")?Ti.destroy(e,A):Ti.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(sRs,"writeStream");function q9n(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Oi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return U9n.sendHeaders.hasSubscribers&&U9n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?V9n(A,null,t,e,g,f,y,h):Ti.isBuffer(u)?V9n(A,u,t,e,g,f,y,h):Ti.isBlobLike(u)?typeof u.stream=="function"?W9n(A,u.stream(),t,e,g,f,y,h):CRs(A,u,t,e,g,f,y,h):Ti.isStream(u)?vRs(A,u,t,e,g,f,y,h):Ti.isIterable(u)?W9n(A,u,t,e,g,f,y,h):Oi(!1),!0}a(_Rs,"writeH1");function vRs(t,e,r,n,o,s,c,l){Oi(s!==0||r[dm]===0,"stream body cannot be pipelined");let u=!1,d=new Vot({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){Ti.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 z9n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Oi(o.destroyed||o[Hj]&&r[dm]<=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")?Ti.destroy(e,A):Ti.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(vRs,"writeStream");function V9n(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Oi(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[hb]=!0)):s===0?o.write(`${c}content-length: 0\r \r `,"latin1"):(Oi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[WF]()}catch(u){t(u)}}a(q9n,"writeBuffer");async function aRs(t,e,r,n,o,s,c,l){Oi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new IZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1")),n.onRequestSent(),r[YF]()}catch(u){t(u)}}a(V9n,"writeBuffer");async function CRs(t,e,r,n,o,s,c,l){Oi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new wZ;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[hb]=!0),r[WF]()}catch(u){t(u)}}a(aRs,"writeBlob");async function j9n(t,e,r,n,o,s,c,l){Oi(s!==0||r[lm]===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)=>{Oi(u===null),o[lv]?g(o[lv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Qot({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[lv])throw o[lv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(j9n,"writeIterable");var Qot=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[Qj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[lv])throw r[lv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[jir])throw new IZ;process.emitWarning(new IZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[hb]=!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[hb]=!0),r[YF]()}catch(u){t(u)}}a(CRs,"writeBlob");async function W9n(t,e,r,n,o,s,c,l){Oi(s!==0||r[dm]===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)=>{Oi(u===null),o[dv]?g(o[dv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Vot({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[dv])throw o[dv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(W9n,"writeIterable");var Vot=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[Hj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[dv])throw r[dv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Vir])throw new wZ;process.emitWarning(new wZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[hb]=!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[ud].timeout&&r[ud].timeoutType===lpe&&r[ud].timeout.refresh&&r[ud].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Qj]=!1,e[lv])throw e[lv];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[dd].timeout&&r[dd].timeoutType===upe&&r[dd].timeout.refresh&&r[dd].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Hj]=!1,e[dv])throw e[dv];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[jir])throw new IZ;process.emitWarning(new IZ)}e[ud].timeout&&e[ud].timeoutType===lpe&&e[ud].timeout.refresh&&e[ud].timeout.refresh(),n[WF]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Qj]=!1,e&&(Oi(n[lm]<=1,"pipeline should only contain this request"),o(e))}};W9n.exports=Kws});var nUn=I((faf,rUn)=>{"use strict";p();var Fw=require("node:assert"),{pipeline:cRs}=require("node:stream"),ys=Po(),{RequestContentLengthMismatchError:Jir,RequestAbortedError:lRs,SocketError:RPe,InformationalError:qj,InvalidArgumentError:uRs}=ao(),{kUrl:wPe,kReset:Got,kClient:vT,kRunning:kPe,kPending:dRs,kQueue:jj,kPendingIdx:Xir,kRunningIdx:T2,kError:CT,kSocket:xf,kStrictContentLength:fRs,kOnError:upe,kMaxConcurrentStreams:jot,kPingInterval:Y9n,kHTTP2Session:zF,kHTTP2InitialWindowSize:pRs,kHTTP2ConnectionWindowSize:hRs,kResume:D5,kSize:mRs,kHTTPContext:eor,kClosed:Zir,kBodyTimeout:gRs,kEnableConnectProtocol:IPe,kRemoteSettings:xPe,kHTTP2Stream:qot,kHTTP2SessionState:tor}=al(),{channels:K9n}=Bj(),Bw=Symbol("open streams"),J9n,Hot;try{Hot=require("node:http2")}catch{Hot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:ARs,HTTP2_HEADER_METHOD:Z9n,HTTP2_HEADER_PATH:X9n,HTTP2_HEADER_SCHEME:zir,HTTP2_HEADER_CONTENT_LENGTH:yRs,HTTP2_HEADER_EXPECT:ERs,HTTP2_HEADER_STATUS:Yir,HTTP2_HEADER_PROTOCOL:_Rs,NGHTTP2_REFUSED_STREAM:vRs,NGHTTP2_CANCEL:CRs}}=Hot;function Kir(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(Kir,"parseH2Headers");function bRs(t,e){t[xf]=e;let r=t[pRs],n=t[hRs],o=Hot.connect(t[wPe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[jot],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[xf]=e,o[Bw]=0,o[vT]=t,o[xf]=e,o[tor]={ping:{interval:t[Y9n]===0?null:setInterval(xRs,t[Y9n],o).unref()}},o[IPe]=!1,o[xPe]=!1,n&&ys.addListener(o,"connect",TRs.bind(o,n)),ys.addListener(o,"error",wRs),ys.addListener(o,"frameError",RRs),ys.addListener(o,"end",kRs),ys.addListener(o,"goaway",PRs),ys.addListener(o,"close",DRs),ys.addListener(o,"remoteSettings",IRs),o.unref(),t[zF]=o,e[zF]=o,ys.addListener(e,"error",MRs),ys.addListener(e,"end",ORs),ys.addListener(e,"close",NRs),e[Zir]=!1,e.on("close",LRs),{version:"h2",defaultPipelining:1/0,write(s){return FRs(t,s)},resume(){SRs(t)},destroy(s,c){e[Zir]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[kPe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1||ys.bodyLength(s.body)!==0&&(ys.isStream(s.body)||ys.isAsyncIterable(s.body)||ys.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1;return!1}}}a(bRs,"connectH2");function SRs(t){let e=t[xf];e?.destroyed===!1&&(t[mRs]===0||t[jot]===0?(e.unref(),t[zF].unref()):(e.ref(),t[zF].ref()))}a(SRs,"resumeH2");function TRs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(TRs,"applyConnectionWindowSize");function IRs(t){if(this[vT][jot]=t.maxConcurrentStreams??this[vT][jot],this[xPe]===!0&&this[IPe]===!0&&t.enableConnectProtocol===!1){let e=new qj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[xf][CT]=e,this[vT][upe](e);return}this[IPe]=t.enableConnectProtocol??this[IPe],this[xPe]=!0,this[vT][D5]()}a(IRs,"onHttp2RemoteSettings");function xRs(t){let e=t[tor];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[vT],c=this[vT];if(n!=null){let l=new qj(`HTTP/2: "PING" errored - type ${n.message}`);c[CT]=l,s[upe](l)}else s.emit("ping",o)}a(r,"onPing")}a(xRs,"onHttp2SendPing");function wRs(t){Fw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[xf][CT]=t,this[vT][upe](t)}a(wRs,"onHttp2SessionError");function RRs(t,e,r){if(r===0){let n=new qj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[xf][CT]=n,this[vT][upe](n)}}a(RRs,"onHttp2FrameError");function kRs(){let t=new RPe("other side closed",ys.getSocketInfo(this[xf]));this.destroy(t),ys.destroy(this[xf],t)}a(kRs,"onHttp2SessionEnd");function PRs(t){let e=this[CT]||new RPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ys.getSocketInfo(this[xf])),r=this[vT];if(r[xf]=null,r[eor]=null,this.close(),this[zF]=null,ys.destroy(this[xf],e),r[T2]{e.aborted||e.completed||(x=x||new lRs,ys.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[upe](x),t[D5]()),ys.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ys.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[IPe]===!1?(ys.errorRequest(t,e,new qj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[Z9n]="CONNECT",g[_Rs]="websocket",g[X9n]=s,f==="ws:"||f==="wss:"?g[zir]=f==="ws:"?"http":"https":g[zir]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[qot]=!0,A.once("response",(x,P)=>{let{[Yir]:D,...N}=x;e.onUpgrade(D,Kir(N),A),++n[Bw],t[jj][t[T2]++]=null}),A.on("error",()=>{(A.rstCode===vRs||A.rstCode===CRs)&&_(new qj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[Bw]-=1,n[Bw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[qot]=!0,A.on("response",x=>{let{[Yir]:P,...D}=x;e.onUpgrade(P,Kir(D),A),++n[Bw],t[jj][t[T2]++]=null}),A.once("close",()=>{n[Bw]-=1,n[Bw]===0&&n.unref()}),A.setTimeout(r),!0);g[X9n]=s,g[zir]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ys.bodyLength(m);if(ys.isFormDataLike(m)){J9n??=ape().extractBody;let[x,P]=J9n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),BRs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[fRs])return ys.errorRequest(t,e,new Jir),!1;process.emitWarning(new Jir)}if(b!=null&&(Fw(m||b===0,"no body must not have content length"),g[yRs]=`${b}`),n.ref(),K9n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r -`;K9n.sendHeaders.publish({request:e,headers:x,socket:n[xf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[ERs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[qot]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[qot]=!0,R()),++n[Bw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Yir]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Kir(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[jj][t[T2]++]=null,t[D5]()):(_(new qj("HTTP/2: stream half-closed (remote)")),t[jj][t[T2]++]=null,t[Xir]=t[T2],t[D5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[Bw]-=1,n[Bw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new qj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new qj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[Bw]-=1,n[Bw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?eUn(_,A,null,t,e,t[xf],b,v):ys.isBuffer(m)?eUn(_,A,m,t,e,t[xf],b,v):ys.isBlobLike(m)?typeof m.stream=="function"?tUn(_,A,m.stream(),t,e,t[xf],b,v):QRs(_,A,m,t,e,t[xf],b,v):ys.isStream(m)?URs(_,t[xf],v,A,m,t,e,b):ys.isIterable(m)?tUn(_,A,m,t,e,t[xf],b,v):Fw(!1)}a(R,"writeBodyH2")}a(FRs,"writeH2");function eUn(t,e,r,n,o,s,c,l){try{r!=null&&ys.isBuffer(r)&&(Fw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Got]=!0),o.onRequestSent(),n[D5]()}catch(u){t(u)}}a(eUn,"writeBuffer");function URs(t,e,r,n,o,s,c,l){Fw(l!==0||s[kPe]===0,"stream body cannot be pipelined");let u=cRs(o,n,f=>{f?(ys.destroy(u,f),t(f)):(ys.removeAllListeners(u),c.onRequestSent(),r||(e[Got]=!0),s[D5]())});ys.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(URs,"writeStream");async function QRs(t,e,r,n,o,s,c,l){Fw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Jir;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Got]=!0),n[D5]()}catch(u){t(u)}}a(QRs,"writeBlob");async function tUn(t,e,r,n,o,s,c,l){Fw(c!==0||n[kPe]===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)=>{Fw(u===null),s[CT]?m(s[CT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[CT])throw s[CT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Got]=!0),n[D5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(tUn,"writeIterable");rUn.exports=bRs});var Vj=I((maf,dUn)=>{"use strict";p();var YF=require("node:assert"),aUn=require("node:net"),PPe=require("node:http"),PZ=Po(),{ClientStats:qRs}=Wnr(),{channels:dpe}=Bj(),jRs=v6n(),HRs=vZ(),{InvalidArgumentError:dd,InformationalError:GRs,ClientDestroyedError:$Rs}=ao(),VRs=CZ(),{kUrl:N5,kServerName:$j,kClient:WRs,kBusy:nor,kConnect:zRs,kResuming:DZ,kRunning:OPe,kPending:LPe,kSize:DPe,kQueue:I2,kConnected:YRs,kConnecting:fpe,kNeedDrain:Gj,kKeepAliveDefaultTimeout:iUn,kHostHeader:KRs,kPendingIdx:x2,kRunningIdx:JF,kError:JRs,kPipelining:$ot,kKeepAliveTimeoutValue:ZRs,kMaxHeadersSize:XRs,kKeepAliveMaxTimeout:eks,kKeepAliveTimeoutThreshold:tks,kHeadersTimeout:rks,kBodyTimeout:nks,kStrictContentLength:iks,kConnector:NPe,kMaxRequests:ior,kCounter:oks,kClose:sks,kDestroy:aks,kDispatch:cks,kLocalAddress:MPe,kMaxResponseSize:lks,kOnError:uks,kHTTPContext:ch,kMaxConcurrentStreams:dks,kHTTP2InitialWindowSize:fks,kHTTP2ConnectionWindowSize:pks,kResume:KF,kPingInterval:hks}=al(),mks=z9n(),gks=nUn(),Hj=Symbol("kClosedResolve"),Aks=PPe&&PPe.maxHeaderSize&&Number.isInteger(PPe.maxHeaderSize)&&PPe.maxHeaderSize>0?()=>PPe.maxHeaderSize:()=>{throw new dd("http module not available or http.maxHeaderSize invalid")},oUn=a(()=>{},"noop");function cUn(t){return t[$ot]??t[ch]?.defaultPipelining??1}a(cUn,"getPipelining");var oor=class extends HRs{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:L,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new dd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new dd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new dd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new dd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new dd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new dd("invalid maxHeaderSize")}else r=Aks();if(A!=null&&typeof A!="string")throw new dd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new dd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new dd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new dd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new dd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new dd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new dd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new dd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new dd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||aUn.isIP(w)===0))throw new dd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new dd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new dd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new dd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new dd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new dd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new dd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new dd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new dd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=VRs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let j=b;b=a((Q,U)=>j({...Q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},U),"connect")}this[N5]=PZ.parseOrigin(e),this[NPe]=b,this[$ot]=y??1,this[XRs]=r,this[iUn]=f??4e3,this[eks]=m??6e5,this[tks]=g??2e3,this[ZRs]=this[iUn],this[$j]=null,this[MPe]=w??null,this[DZ]=0,this[Gj]=0,this[KRs]=`host: ${this[N5].hostname}${this[N5].port?`:${this[N5].port}`:""}\r -`,this[nks]=l??3e5,this[rks]=n??3e5,this[iks]=_??!0,this[ior]=T,this[Hj]=null,this[lks]=R>-1?R:-1,this[ch]=null,this[dks]=D??100,this[fks]=B??262144,this[pks]=q??524288,this[hks]=M??6e4,this[I2]=[],this[JF]=0,this[x2]=0,this[KF]=j=>sor(this,j),this[uks]=j=>lUn(this,j)}get pipelining(){return this[$ot]}set pipelining(e){this[$ot]=e,this[KF](!0)}get stats(){return new qRs(this)}get[LPe](){return this[I2].length-this[x2]}get[OPe](){return this[x2]-this[JF]}get[DPe](){return this[I2].length-this[JF]}get[YRs](){return!!this[ch]&&!this[fpe]&&!this[ch].destroyed}get[nor](){return!!(this[ch]?.busy(null)||this[DPe]>=(cUn(this)||1)||this[LPe]>0)}[zRs](e){uUn(this),this.once("connect",e)}[cks](e,r){let n=new jRs(this[N5].origin,e,r);return this[I2].push(n),this[DZ]||(PZ.bodyLength(n.body)==null&&PZ.isIterable(n.body)?(this[DZ]=1,queueMicrotask(()=>sor(this))):this[KF](!0)),this[DZ]&&this[Gj]!==2&&this[nor]&&(this[Gj]=2),this[Gj]<2}[sks](){return new Promise(e=>{this[DPe]?this[Hj]=e:e(null)})}[aks](e){return new Promise(r=>{let n=this[I2].splice(this[x2]);for(let s=0;s{this[Hj]&&(this[Hj](),this[Hj]=null),r(null)},"callback");this[ch]?(this[ch].destroy(e,o),this[ch]=null):queueMicrotask(o),this[KF]()})}};function lUn(t,e){if(t[OPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){YF(t[x2]===t[JF]);let r=t[I2].splice(t[JF]);for(let n=0;n{if(s){ror(t,s,{host:e,hostname:r,protocol:n,port:o}),t[KF]();return}if(t.destroyed){PZ.destroy(c.on("error",oUn),new $Rs),t[KF]();return}YF(c);try{t[ch]=c.alpnProtocol==="h2"?gks(t,c):mks(t,c)}catch(l){c.destroy().on("error",oUn),ror(t,l,{host:e,hostname:r,protocol:n,port:o}),t[KF]();return}t[fpe]=!1,c[oks]=0,c[ior]=t[ior],c[WRs]=t,c[JRs]=null,dpe.connected.hasSubscribers&&dpe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ch]?.version,servername:t[$j],localAddress:t[MPe]},connector:t[NPe],socket:c}),t.emit("connect",t[N5],[t]),t[KF]()})}catch(s){ror(t,s,{host:e,hostname:r,protocol:n,port:o}),t[KF]()}}a(uUn,"connect");function ror(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[fpe]=!1,dpe.connectError.hasSubscribers&&dpe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[ch]?.version,servername:t[$j],localAddress:t[MPe]},connector:t[NPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(YF(t[OPe]===0);t[LPe]>0&&t[I2][t[x2]].servername===t[$j];){let c=t[I2][t[x2]++];PZ.errorRequest(t,c,e)}else lUn(t,e);t.emit("connectionError",t[N5],[t],e)}}a(ror,"handleConnectError");function sUn(t){t[Gj]=0,t.emit("drain",t[N5],[t])}a(sUn,"emitDrain");function sor(t,e){t[DZ]!==2&&(t[DZ]=2,yks(t,e),t[DZ]=0,t[JF]>256&&(t[I2].splice(0,t[JF]),t[x2]-=t[JF],t[JF]=0))}a(sor,"resume");function yks(t,e){for(;;){if(t.destroyed){YF(t[LPe]===0);return}if(t[Hj]&&!t[DPe]){t[Hj](),t[Hj]=null;return}if(t[ch]&&t[ch].resume(),t[nor])t[Gj]=2;else if(t[Gj]===2){e?(t[Gj]=1,queueMicrotask(()=>sUn(t))):sUn(t);continue}if(t[LPe]===0||t[OPe]>=(cUn(t)||1))return;let r=t[I2][t[x2]];if(r===null)return;if(t[N5].protocol==="https:"&&t[$j]!==r.servername){if(t[OPe]>0)return;t[$j]=r.servername,t[ch]?.destroy(new GRs("servername changed"),()=>{t[ch]=null,sor(t)})}if(t[fpe])return;if(!t[ch]){uUn(t);return}if(t[ch].destroyed||t[ch].busy(r))return;!r.aborted&&t[ch].write(r)?t[x2]++:t[I2].splice(t[x2],1)}}a(yks,"_resume");dUn.exports=oor});var aor=I((Eaf,fUn)=>{"use strict";p();var Vot=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)}};fUn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Vot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Vot),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 Wot=I((Caf,vUn)=>{"use strict";p();var{PoolStats:Eks}=Wnr(),_ks=vZ(),vks=aor(),{kConnected:cor,kSize:pUn,kRunning:hUn,kPending:mUn,kQueued:BPe,kBusy:Cks,kFree:bks,kUrl:Sks,kClose:Tks,kDestroy:Iks,kDispatch:xks}=al(),Mg=Symbol("clients"),uv=Symbol("needDrain"),FPe=Symbol("queue"),lor=Symbol("closed resolve"),uor=Symbol("onDrain"),gUn=Symbol("onConnect"),AUn=Symbol("onDisconnect"),yUn=Symbol("onConnectionError"),dor=Symbol("get dispatcher"),EUn=Symbol("add client"),_Un=Symbol("remove client"),por=class extends _ks{static{a(this,"PoolBase")}[FPe]=new vks;[BPe]=0;[Mg]=[];[uv]=!1;[uor](e,r,n){let o=this[FPe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[BPe]--,s=!e.dispatch(c.opts,c.handler)}if(e[uv]=s,!s&&this[uv]&&(this[uv]=!1,this.emit("drain",r,[this,...n])),this[lor]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[AUn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[yUn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[Cks](){return this[uv]}get[cor](){let e=0;for(let{[cor]:r}of this[Mg])e+=r;return e}get[bks](){let e=0;for(let{[cor]:r,[uv]:n}of this[Mg])e+=r&&!n;return e}get[mUn](){let e=this[BPe];for(let{[mUn]:r}of this[Mg])e+=r;return e}get[hUn](){let e=0;for(let{[hUn]:r}of this[Mg])e+=r;return e}get[pUn](){let e=this[BPe];for(let{[pUn]:r}of this[Mg])e+=r;return e}get stats(){return new Eks(this)}[Tks](){if(this[FPe].isEmpty()){let e=[];for(let r=0;r{this[lor]=e})}[Iks](e){for(;;){let n=this[FPe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Mg].length);for(let n=0;n{this[uv]&&this[uor](e,e[Sks],[e,this])}),this}[_Un](e){e.close(()=>{let r=this[Mg].indexOf(e);r!==-1&&this[Mg].splice(r,1)}),this[uv]=this[Mg].some(r=>!r[uv]&&r.closed!==!0&&r.destroyed!==!0)}};vUn.exports={PoolBase:por,kClients:Mg,kNeedDrain:uv,kAddClient:EUn,kRemoveClient:_Un,kGetDispatcher:dor}});var NZ=I((Taf,TUn)=>{"use strict";p();var{PoolBase:wks,kClients:zot,kNeedDrain:Rks,kAddClient:kks,kGetDispatcher:Pks,kRemoveClient:Dks}=Wot(),Nks=Vj(),{InvalidArgumentError:hor}=ao(),CUn=Po(),{kUrl:bUn}=al(),Mks=CZ(),Yot=Symbol("options"),mor=Symbol("connections"),SUn=Symbol("factory");function Oks(t,e){return new Nks(t,e)}a(Oks,"defaultFactory");var gor=class extends wks{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Oks,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 hor("invalid connections");if(typeof n!="function")throw new hor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new hor("connect must be a function or an object");typeof o!="function"&&(o=Mks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[mor]=r||null,this[bUn]=CUn.parseOrigin(e),this[Yot]={...CUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Yot].interceptors=g.interceptors?{...g.interceptors}:void 0,this[SUn]=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[zot].indexOf(_);v!==-1&&this[zot].splice(v,1)}})}[Pks](){let e=this[Yot].clientTtl;for(let r of this[zot])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Dks](r);else if(!r[Rks])return r;if(!this[mor]||this[zot].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Lks,InvalidArgumentError:Bks}=ao(),{PoolBase:Fks,kClients:VA,kNeedDrain:UPe,kAddClient:Uks,kRemoveClient:Qks,kGetDispatcher:qks}=Wot(),jks=NZ(),{kUrl:Kot}=al(),Jot=Po(),IUn=Symbol("factory"),QPe=Symbol("options"),xUn=Symbol("kGreatestCommonDivisor"),MZ=Symbol("kCurrentWeight"),OZ=Symbol("kIndex"),Uw=Symbol("kWeight"),Zot=Symbol("kMaxWeightPerServer"),Xot=Symbol("kErrorPenalty");function Hks(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Hks,"getGreatestCommonDivisor");function Gks(t,e){return new jks(t,e)}a(Gks,"defaultFactory");var Aor=class extends Fks{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Gks,...n}={}){if(typeof r!="function")throw new Bks("factory must be a function.");super(n),this[QPe]={...Jot.deepClone(n)},this[QPe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[OZ]=-1,this[MZ]=0,this[Zot]=this[QPe].maxWeightPerServer||100,this[Xot]=this[QPe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[IUn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Jot.parseOrigin(e).origin;if(this[VA].find(o=>o[Kot].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[IUn](r,this[QPe]);this[Uks](n),n.on("connect",()=>{n[Uw]=Math.min(this[Zot],n[Uw]+this[Xot])}),n.on("connectionError",()=>{n[Uw]=Math.max(1,n[Uw]-this[Xot]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Uw]=Math.max(1,n[Uw]-this[Xot]),this._updateBalancedPoolStats())});for(let o of this[VA])o[Uw]=this[Zot];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Kot].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Qks](n),this}getUpstream(e){let r=Jot.parseOrigin(e).origin;return this[VA].find(n=>n[Kot].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[VA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Kot].origin)}[qks](){if(this[VA].length===0)throw new Lks;if(!this[VA].find(s=>!s[UPe]&&s.closed!==!0&&s.destroyed!==!0)||this[VA].map(s=>s[UPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[VA].findIndex(s=>!s[UPe]);for(;n++this[VA][o][Uw]&&!s[UPe]&&(o=this[OZ]),this[OZ]===0&&(this[MZ]=this[MZ]-this[xUn],this[MZ]<=0&&(this[MZ]=this[Zot])),s[Uw]>=this[MZ]&&!s[UPe])return s}return this[MZ]=this[VA][o][Uw],this[OZ]=o,this[VA][o]}};wUn.exports=Aor});var NUn=I((Paf,DUn)=>{"use strict";p();var{PoolBase:$ks,kClients:est,kNeedDrain:Vks,kAddClient:kUn,kGetDispatcher:Wks,kRemoveClient:zks}=Wot(),Yks=Vj(),{InvalidArgumentError:yor}=ao(),PUn=Po(),{kUrl:Eor}=al(),Kks=CZ(),qPe=Symbol("options"),_or=Symbol("connections"),vor=Symbol("factory"),tst=Symbol("index");function Jks(t,e){return new Yks(t,e)}a(Jks,"defaultFactory");var Cor=class extends $ks{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=Jks,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 yor("invalid connections");if(typeof n!="function")throw new yor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new yor("connect must be a function or an object");typeof o!="function"&&(o=Kks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[_or]=r||null,this[Eor]=PUn.parseOrigin(e),this[qPe]={...PUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[qPe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[vor]=n,this[tst]=-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[est].indexOf(_);v!==-1&&this[est].splice(v,1)}})}[Wks](){let e=this[qPe].clientTtl,r=this[est].length;if(r===0){let o=this[vor](this[Eor],this[qPe]);return this[kUn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[zks](o),n++;continue}if(!o[Vks])return o;n++}if(!this[_or]||r{"use strict";p();var{InvalidArgumentError:rst,MaxOriginsReachedError:Zks}=ao(),{kClients:Qw,kRunning:MUn,kClose:Xks,kDestroy:ePs,kDispatch:tPs,kUrl:rPs}=al(),nPs=vZ(),iPs=NZ(),oPs=Vj(),sPs=Po(),OUn=Symbol("onConnect"),LUn=Symbol("onDisconnect"),BUn=Symbol("onConnectionError"),FUn=Symbol("onDrain"),UUn=Symbol("factory"),bor=Symbol("options"),jPe=Symbol("origins");function aPs(t,e){return e&&e.connections===1?new oPs(t,e):new iPs(t,e)}a(aPs,"defaultFactory");var Sor=class extends nPs{static{a(this,"Agent")}constructor({factory:e=aPs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new rst("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new rst("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new rst("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[bor]={...sPs.deepClone(o),maxOrigins:r,connect:n},this[UUn]=e,this[Qw]=new Map,this[jPe]=new Set,this[FUn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[OUn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[LUn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[BUn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[MUn](){let e=0;for(let{dispatcher:r}of this[Qw].values())e+=r[MUn];return e}[tPs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new rst("opts.origin must be a non-empty string or URL.");if(this[jPe].size>=this[bor].maxOrigins&&!this[jPe].has(n))throw new Zks;let o=this[Qw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[Qw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[Qw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[jPe].delete(n))},"closeClientIfUnused");s=this[UUn](e.origin,this[bor]).on("drain",this[FUn]).on("connect",(l,u)=>{let d=this[Qw].get(n);d&&(d.count+=1),this[OUn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[LUn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[BUn](l,u,d)}),this[Qw].set(n,{count:0,dispatcher:s}),this[jPe].add(n)}return s.dispatch(e,r)}[Xks](){let e=[];for(let{dispatcher:r}of this[Qw].values())e.push(r.close());return this[Qw].clear(),Promise.all(e)}[ePs](e){let r=[];for(let{dispatcher:n}of this[Qw].values())r.push(n.destroy(e));return this[Qw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[Qw].values())r.stats&&(e[r[rPs].origin]=r.stats);return e}};QUn.exports=Sor});var HUn=I((Baf,jUn)=>{"use strict";p();var{Buffer:zj}=require("node:buffer"),Tor=require("node:net"),{InvalidArgumentError:Wj}=ao();function cPs(t){if(Tor.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:zj.from(r)}}if(Tor.isIPv6(t))return{type:4,buffer:qUn(t)};let e=zj.from(t,"utf8");if(e.length>255)throw new Wj("Domain name too long (max 255 bytes)");return{type:3,buffer:zj.concat([zj.from([e.length]),e])}}a(cPs,"parseAddress");function qUn(t){let e=zj.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Tor.isIPv4(s)){let c=s.split(".").map(Number),l=(c[0]<<8|c[1]).toString(16),u=(c[2]<<8|c[3]).toString(16);r=`${t.slice(0,o)}:${l}:${u}`}}let n=r.indexOf("::");if(n!==-1){let o=r.slice(0,n),s=r.slice(n+2),c=o===""?[]:o.split(":"),l=s===""?[]:s.split(":"),u=0;for(let d of c)e.writeUInt16BE(parseInt(d,16),u),u+=2;u=16-l.length*2;for(let d of l)e.writeUInt16BE(parseInt(d,16),u),u+=2}else{let o=r.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:fPs}=require("node:events"),{Buffer:BZ}=require("node:buffer"),{InvalidArgumentError:ppe,Socks5ProxyError:Yj}=ao(),{debuglog:pPs}=require("node:util"),{parseAddress:hPs}=HUn(),ZF=pPs("undici:socks5"),GUn=BZ.alloc(0),nst=5,hpe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},$Un={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},FZ={IPV4:1,DOMAIN:3,IPV6:4},M5={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},vE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Ior=class extends fPs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new ppe("socket is required");this.socket=e,this.options=r,this.state=vE.INITIAL,this.buffer=GUn,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(hpe.USERNAME_PASSWORD),this.authMethods.push(hpe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){ZF("received data",e.length,"bytes in state",this.state),this.buffer=BZ.concat([this.buffer,e]);try{switch(this.state){case vE.HANDSHAKING:this.handleHandshakeResponse();break;case vE.AUTHENTICATING:this.handleAuthResponse();break;case vE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){ZF("socket error",e),this.state=vE.ERROR,this.emit("error",e),this.destroy()}onClose(){ZF("socket closed"),this.state=vE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=vE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==vE.INITIAL)throw new ppe("Handshake already started");ZF("starting handshake with",this.authMethods.length,"auth methods"),this.state=vE.HANDSHAKING;let e=BZ.alloc(2+this.authMethods.length);e[0]=nst,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!==nst)throw new Yj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===hpe.NO_ACCEPTABLE)throw new Yj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),ZF("server selected auth method",r),r===hpe.NO_AUTH)this.markAuthenticated();else if(r===hpe.USERNAME_PASSWORD)this.state=vE.AUTHENTICATING,this.sendAuthRequest();else throw new Yj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new ppe("Username and password required for authentication");ZF("sending username/password auth");let n=BZ.from(e),o=BZ.from(r);if(n.length>255||o.length>255)throw new ppe("Username or password too long");let s=BZ.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 Yj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Yj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),ZF("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===vE.CONNECTING||this.state===vE.CONNECTED)throw new ppe("Connection already in progress");if(this.state!==vE.AUTHENTICATED)throw new ppe("Client must be authenticated before CONNECT");ZF("connecting to",e,r),this.state=vE.CONNECTING;let n=this.buildConnectRequest($Un.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=hPs(r),c=BZ.alloc(4+s.length+2);return c[0]=nst,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!==nst)throw new Yj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===FZ.IPV4)o+=6;else if(n===FZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===FZ.IPV6)o+=18;else throw new Yj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:zUn}=require("node:url"),xor,mPs=vZ(),{InvalidArgumentError:YUn}=ao(),{Socks5Client:gPs,STATES:APs}=WUn(),{kDispatch:KUn,kClose:yPs,kDestroy:EPs}=al(),_Ps=NZ(),vPs=CZ(),{debuglog:CPs}=require("node:util"),Kj=CPs("undici:socks5-proxy"),wor=Symbol("proxy url"),bPs=Symbol("proxy headers"),JUn=Symbol("proxy auth"),ZUn=Symbol("proxy protocol"),UZ=Symbol("pools"),XUn=Symbol("connector"),Ror=Symbol("request tls settings"),e7n=!1,kor=class extends mPs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),e7n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),e7n=!0),!e)throw new YUn("Proxy URL is mandatory");let n=typeof e=="string"?new zUn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new YUn("Proxy URL must use socks5:// or socks:// protocol");this[wor]=n,this[bPs]=r.headers||{},this[ZUn]=r.proxyTls?"https:":"http:",this[Ror]=r.requestTls,this[JUn]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[XUn]=r.connect||vPs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[UZ]=new Map}async createSocks5Connection(e,r){let n=this[wor].hostname,o=parseInt(this[wor].port)||1080;Kj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[XUn]({hostname:n,host:n,port:o,protocol:this[ZUn]},(d,f)=>{d?u(d):l(f)})}),c=new gPs(s,this[JUn]);return c.on("error",l=>{Kj("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===APs.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=>{Kj("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}[KUn](e,r){let{origin:n}=e;Kj("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[UZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new _Ps(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new zUn(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);Kj("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(xor||(xor=require("node:tls")),Kj("upgrading to TLS"),m=xor.connect({...this[Ror],socket:h,servername:this[Ror]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){Kj("SOCKS5 connection error:",u),l(u)}},"connect")}),this[UZ].set(o,s)),s[KUn](e,r)}catch(o){if(Kj("dispatch error:",o),typeof r.onResponseError=="function")return r.onResponseError(null,o),!1;if(typeof r.onError=="function")return r.onError(o),!1;throw o}}async[yPs](){let e=[];for(let r of this[UZ].values())e.push(r.close());this[UZ].clear(),await Promise.all(e)}async[EPs](e){let r=[];for(let n of this[UZ].values())r.push(n.destroy(e));this[UZ].clear(),await Promise.all(r)}};t7n.exports=kor});var Oor=I((Vaf,p7n)=>{"use strict";p();var{kProxy:mpe,kClose:c7n,kDestroy:l7n,kDispatch:r7n}=al(),SPs=LZ(),u7n=NZ(),d7n=vZ(),{InvalidArgumentError:QZ,RequestAbortedError:TPs,SecureProxyConnectionError:IPs}=ao(),n7n=CZ(),f7n=Vj(),{channels:i7n}=Bj(),xPs=Por(),ist=Symbol("proxy agent"),Jj=Symbol("proxy client"),XF=Symbol("proxy headers"),Dor=Symbol("request tls settings"),o7n=Symbol("proxy tls settings"),s7n=Symbol("connect endpoint function"),a7n=Symbol("tunnel proxy");function wPs(t){return t==="https:"?443:80}a(wPs,"defaultProtocolPort");function RPs(t,e){return new u7n(t,e)}a(RPs,"defaultFactory");var kPs=a(()=>{},"noop");function PPs(t,e){return e.connections===1?new f7n(t,e):new u7n(t,e)}a(PPs,"defaultAgentFactory");var Nor=class extends d7n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new QZ("Proxy URL is mandatory");super(),this[XF]=r,o?this.#e=o(e,{connect:n}):this.#e=new f7n(e,{connect:n})}[r7n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new QZ("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[XF],...c},this.#e[r7n](e,r)}[c7n](){return this.#e.close()}[l7n](e){return this.#e.destroy(e)}},Mor=class extends d7n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new QZ("Proxy uri is mandatory");let{clientFactory:r=RPs}=e;if(typeof r!="function")throw new QZ("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[mpe]={uri:s,protocol:u},this[Dor]=e.requestTls,this[o7n]=e.proxyTls,this[XF]=e.headers||{},this[a7n]=n,e.auth&&e.token)throw new QZ("opts.auth cannot be used in combination with opts.token");e.auth?this[XF]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[XF]["proxy-authorization"]=e.token:d&&f&&(this[XF]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=n7n({...e.proxyTls});this[s7n]=n7n({...e.requestTls});let g=e.factory||PPs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[mpe].protocol==="socks5:"||this[mpe].protocol==="socks:"?new xPs(this[mpe].uri,{headers:this[XF],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[a7n]&&_==="http:"&&this[mpe].protocol==="http:"?new Nor(this[mpe].uri,{headers:this[XF],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[Jj]=null:this[Jj]=r(o,{connect:m}),this[ist]=new SPs({...e,factory:A,connect:a(async(y,E)=>{if(!this[Jj]){E(new QZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${wPs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[XF],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[o7n]?.servername||h},{socket:b,statusCode:T}=await this[Jj].connect(v);if(T!==200){b.on("error",kPs).destroy(),E(new TPs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(i7n.proxyConnected.hasSubscribers&&i7n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Dor]?w=this[Dor].servername:w=y.servername,this[s7n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new IPs(v)):E(v)}},"connect")})}dispatch(e,r){let n=DPs(e.headers);if(NPs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[ist].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[c7n](){let e=[this[ist].close()];return this[Jj]&&e.push(this[Jj].close()),Promise.all(e)}[l7n](){let e=[this[ist].destroy()];return this[Jj]&&e.push(this[Jj].destroy()),Promise.all(e)}};function DPs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new QZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(NPs,"throwIfProxyAuthIsSent");p7n.exports=Mor});var y7n=I((Yaf,A7n)=>{"use strict";p();var MPs=vZ(),{kClose:OPs,kDestroy:LPs,kClosed:h7n,kDestroyed:m7n,kDispatch:BPs,kNoProxyAgent:HPe,kHttpProxyAgent:Zj,kHttpsProxyAgent:qZ}=al(),g7n=Oor(),FPs=LZ(),UPs={"http:":80,"https:":443},Lor=class extends MPs{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[HPe]=new FPs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Zj]=new g7n({...s,uri:c}):this[Zj]=this[HPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[qZ]=new g7n({...s,uri:l}):this[qZ]=this[Zj],this.#o()}[BPs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[OPs](){return Promise.all([this[HPe].close(),!this[Zj][h7n]&&this[Zj].close(),!this[qZ][h7n]&&this[qZ].close()])}[LPs](e){return Promise.all([this[HPe].destroy(e),!this[Zj][m7n]&&this[Zj].destroy(e),!this[qZ][m7n]&&this[qZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||UPs[r]||0,this.#i(n,o)?r==="https:"?this[qZ]:this[Zj]:this[HPe]}#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 gpe=require("node:assert"),{kRetryHandlerDefaultRetry:E7n}=al(),{RequestRetryError:GPe}=ao(),QPs=hPe(),{isDisturbed:_7n,parseRangeHeader:v7n,wrapRequestBody:qPs}=Po();function jPs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(jPs,"calculateRetryAfterHeader");var Bor=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=QPs.wrap(n),this.opts={...s,body:qPs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[E7n],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(_7n(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[E7n](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)?jPs(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 GPe("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 GPe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=v7n(n["content-range"]);if(!s)throw new GPe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new GPe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;gpe(this.start===c,"content-range mismatch"),gpe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=v7n(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;gpe(c!=null&&Number.isFinite(c),"content-range mismatch"),gpe(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}gpe(Number.isFinite(this.start)),gpe(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 GPe("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||_7n(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))}};C7n.exports=Bor});var S7n=I((tcf,b7n)=>{"use strict";p();var HPs=mPe(),GPs=ost(),For=class extends HPs{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 GPs({...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()}};b7n.exports=For});var x7n=I((icf,I7n)=>{"use strict";p();var{InvalidArgumentError:T7n}=ao(),$Ps=Vj(),Uor=class extends $Ps{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new T7n("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 T7n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};I7n.exports=Uor});var L7n=I((acf,O7n)=>{"use strict";p();var P7n=require("node:assert"),{Readable:VPs}=require("node:stream"),{RequestAbortedError:D7n,NotSupportedError:WPs,InvalidArgumentError:zPs,AbortError:sst}=ao(),N7n=Po(),{ReadableStreamFrom:YPs}=Po(),bT=Symbol("kConsume"),ast=Symbol("kReading"),jZ=Symbol("kBody"),w7n=Symbol("kAbort"),M7n=Symbol("kContentType"),Qor=Symbol("kContentLength"),qor=Symbol("kUsed"),cst=Symbol("kBytesRead"),KPs=a(()=>{},"noop"),jor=class extends VPs{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[w7n]=r,this[bT]=null,this[cst]=0,this[jZ]=null,this[qor]=!1,this[M7n]=n,this[Qor]=Number.isFinite(o)?o:null,this[ast]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new D7n),e&&this[w7n](),this[qor]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[ast]=!0,this[qor]=!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[ast]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[cst]+=e.length,this[bT])?(Gor(this[bT],e),this[ast]?super.push(e):!0):super.push(e)}text(){return $Pe(this,"text")}json(){return $Pe(this,"json")}blob(){return $Pe(this,"blob")}bytes(){return $Pe(this,"bytes")}arrayBuffer(){return $Pe(this,"arrayBuffer")}async formData(){throw new WPs}get bodyUsed(){return N7n.isDisturbed(this)}get body(){return this[jZ]||(this[jZ]=YPs(this),this[bT]&&(this[jZ].getReader(),P7n(this[jZ].locked))),this[jZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new zPs("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 sst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Qor]&&this[Qor]>n||this[cst]>n)&&this.destroy(new sst),r){let c=a(()=>{this.destroy(r.reason??new sst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new sst):o(null)})}else this.on("close",o);this.on("error",KPs).on("data",()=>{this[cst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function JPs(t){return t[jZ]?.locked===!0||t[bT]!==null}a(JPs,"isLocked");function ZPs(t){return N7n.isDisturbed(t)||JPs(t)}a(ZPs,"isUnusable");function $Pe(t,e){return P7n(!t[bT]),new Promise((r,n)=>{if(ZPs(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[bT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){$or(this[bT],o)}).on("close",function(){this[bT].body!==null&&$or(this[bT],new D7n)}),XPs(t[bT])})})}a($Pe,"consume");function XPs(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(Hor,"chunksDecode");function R7n(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 e2s=require("node:assert"),{AsyncResource:t2s}=require("node:async_hooks"),{Readable:r2s}=L7n(),{InvalidArgumentError:Ape,RequestAbortedError:B7n}=ao(),qw=Po();function VPe(){}a(VPe,"noop");var lst=class extends t2s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ape("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 Ape("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Ape("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ape("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Ape("invalid method");if(l&&typeof l!="function")throw new Ape("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw qw.isStream(c)&&qw.destroy(c.on("error",VPe),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 B7n:n&&(this.removeAbortListener=qw.addAbortListener(n,()=>{this.reason=n.reason??new B7n,this.res?qw.destroy(this.res.on("error",VPe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}e2s(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"?qw.parseRawHeaders(r):qw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?qw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new r2s({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,qw.destroy(y.on("error",VPe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){qw.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(()=>{qw.destroy(r.on("error",VPe),e)})),o&&(this.body=null,qw.isStream(o)&&(o.on("error",VPe),qw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function F7n(t,e){if(e===void 0)return new Promise((r,n)=>{F7n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new lst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(F7n,"request");Vor.exports=F7n;Vor.exports.RequestHandler=lst});var WPe=I((pcf,j7n)=>{"use strict";p();var{addAbortListener:n2s}=Po(),{RequestAbortedError:i2s}=ao(),ype=Symbol("kListener"),O5=Symbol("kSignal");function Q7n(t){t.abort?t.abort(t[O5]?.reason):t.reason=t[O5]?.reason??new i2s,q7n(t)}a(Q7n,"abort");function o2s(t,e){if(t.reason=null,t[O5]=null,t[ype]=null,!!e){if(e.aborted){Q7n(t);return}t[O5]=e,t[ype]=()=>{Q7n(t)},n2s(t[O5],t[ype])}}a(o2s,"addSignal");function q7n(t){t[O5]&&("removeEventListener"in t[O5]?t[O5].removeEventListener("abort",t[ype]):t[O5].removeListener("abort",t[ype]),t[O5]=null,t[ype]=null)}a(q7n,"removeSignal");j7n.exports={addSignal:o2s,removeSignal:q7n}});var V7n=I((gcf,$7n)=>{"use strict";p();var s2s=require("node:assert"),{finished:a2s}=require("node:stream"),{AsyncResource:c2s}=require("node:async_hooks"),{InvalidArgumentError:Epe,InvalidReturnValueError:l2s}=ao(),e8=Po(),{addSignal:u2s,removeSignal:H7n}=WPe();function d2s(){}a(d2s,"noop");var Wor=class extends c2s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Epe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Epe("invalid callback");if(typeof r!="function")throw new Epe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Epe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Epe("invalid method");if(u&&typeof u!="function")throw new Epe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw e8.isStream(l)&&e8.destroy(l.on("error",d2s),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,e8.isStream(l)&&l.on("error",f=>{this.onError(f)}),u2s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}s2s(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"?e8.parseRawHeaders(r):e8.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 l2s("expected Writable");return a2s(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&e8.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;H7n(this),r&&(this.trailers=e8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;H7n(this),this.factory=null,r?(this.res=null,e8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,e8.destroy(s,e))}};function G7n(t,e,r){if(r===void 0)return new Promise((n,o)=>{G7n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Wor(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(G7n,"stream");$7n.exports=G7n});var K7n=I((Ecf,Y7n)=>{"use strict";p();var{Readable:z7n,Duplex:f2s,PassThrough:p2s}=require("node:stream"),h2s=require("node:assert"),{AsyncResource:m2s}=require("node:async_hooks"),{InvalidArgumentError:zPe,InvalidReturnValueError:g2s,RequestAbortedError:zor}=ao(),L5=Po(),{addSignal:A2s,removeSignal:y2s}=WPe();function W7n(){}a(W7n,"noop");var _pe=Symbol("resume"),Yor=class extends z7n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[_pe]=null}_read(){let{[_pe]:e}=this;e&&(this[_pe]=null,e())}_destroy(e,r){this._read(),r(e)}},Kor=class extends z7n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[_pe]=e}_read(){this[_pe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new zor),r(e)}},Jor=class extends m2s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new zPe("invalid opts");if(typeof r!="function")throw new zPe("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 zPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new zPe("invalid method");if(c&&typeof c!="function")throw new zPe("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 Yor().on("error",W7n),this.ret=new f2s({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[_pe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new zor),A&&u&&A(),L5.destroy(f,u),L5.destroy(h,u),L5.destroy(m,u),y2s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,A2s(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}h2s(!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"?L5.parseRawHeaders(r):L5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Kor(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?L5.parseRawHeaders(r):L5.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",W7n),u}if(!l||typeof l.on!="function")throw new g2s("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;L5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||L5.destroy(u,new zor)}),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,L5.destroy(r,e)}};function E2s(t,e){try{let r=new Jor(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new p2s().destroy(r)}}a(E2s,"pipeline");Y7n.exports=E2s});var rQn=I((Ccf,tQn)=>{"use strict";p();var{InvalidArgumentError:Zor,SocketError:_2s}=ao(),{AsyncResource:v2s}=require("node:async_hooks"),J7n=require("node:assert"),Z7n=Po(),{kHTTP2Stream:C2s}=al(),{addSignal:b2s,removeSignal:X7n}=WPe(),Xor=class extends v2s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Zor("invalid opts");if(typeof r!="function")throw new Zor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Zor("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,b2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}J7n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new _2s("bad upgrade",null)}onUpgrade(e,r,n){J7n(n[C2s]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;X7n(this),this.callback=null;let l=this.responseHeaders==="raw"?Z7n.parseRawHeaders(r):Z7n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;X7n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function eQn(t,e){if(e===void 0)return new Promise((r,n)=>{eQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Xor(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(eQn,"upgrade");tQn.exports=eQn});var aQn=I((Tcf,sQn)=>{"use strict";p();var S2s=require("node:assert"),{AsyncResource:T2s}=require("node:async_hooks"),{InvalidArgumentError:esr,SocketError:I2s}=ao(),nQn=Po(),{addSignal:x2s,removeSignal:iQn}=WPe(),tsr=class extends T2s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new esr("invalid opts");if(typeof r!="function")throw new esr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new esr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,x2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}S2s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new I2s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;iQn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?nQn.parseRawHeaders(r):nQn.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;iQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function oQn(t,e){if(e===void 0)return new Promise((r,n)=>{oQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new tsr(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(oQn,"connect");sQn.exports=oQn});var cQn=I((wcf,vpe)=>{"use strict";p();vpe.exports.request=U7n();vpe.exports.stream=V7n();vpe.exports.pipeline=K7n();vpe.exports.upgrade=rQn();vpe.exports.connect=aQn()});var nsr=I((kcf,uQn)=>{"use strict";p();var{UndiciError:w2s}=ao(),lQn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),rsr=class extends w2s{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[lQn]===!0}get[lQn](){return!0}};uQn.exports={MockNotMatchedError:rsr}});var HZ=I((Ncf,dQn)=>{"use strict";p();dQn.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 YPe=I((Ocf,CQn)=>{"use strict";p();var{MockNotMatchedError:Cpe}=nsr(),{kDispatches:GZ,kMockAgent:R2s,kOriginalDispatch:k2s,kOrigin:P2s,kGetNetConnect:D2s,kTotalDispatchCount:ssr}=HZ(),{serializePathWithQuery:N2s}=Po(),{STATUS_CODES:M2s}=require("node:http"),{types:{isPromise:O2s}}=require("node:util"),{InvalidArgumentError:isr}=ao();function B5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(B5,"matchValue");function pQn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(pQn,"lowerCaseEntries");function hQn(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=hQn(e,r);if(!B5(n,o))return!1}return!0}a(mQn,"matchHeaders");function L2s(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(L2s,"normalizeSearchParams");function osr(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(osr,"safeUrl");function B2s(t,{path:e,method:r,body:n,headers:o}){let s=B5(t.path,e),c=B5(t.method,r),l=typeof t.body<"u"?B5(t.body,n):!0,u=mQn(t,o);return s&&c&&l&&u}a(B2s,"matchKey");function gQn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(gQn,"getResponseData");function AQn(t,e){let r=e.query?N2s(e.path,e.query):e.path,n=typeof r=="string"?osr(r):r,o=fQn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?B5(fQn(osr(c)),o):B5(osr(c),n));if(s.length===0)throw new Cpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>B5(c,e.method)),s.length===0)throw new Cpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?B5(c,e.body):!0),s.length===0)throw new Cpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>mQn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Cpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(AQn,"getMockDispatch");function F2s(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[ssr]=(t[ssr]||0)+1,c}a(F2s,"addMockDispatch");function asr(t,e){let r=t.findIndex(n=>n.consumed?B2s(n,e):!1);r!==-1&&t.splice(r,1)}a(asr,"deleteMockDispatch");function fQn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(fQn,"removeTrailingSlash");function yQn(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(yQn,"buildKey");function csr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[GZ])},d):E(this[GZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?lsr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(O2s(w))return w.then(D=>E(v,D));if(g)return;let R=gQn(w),x=csr(c),P=csr(l);e.onHeaders?.(o,x,_,EQn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),asr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(_Qn,"mockDispatch");function Q2s(){let t=this[R2s],e=this[P2s],r=this[k2s];return a(function(o,s){if(t.isMockActive)try{_Qn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[D2s](),u=this[GZ][ssr]||this[GZ].length,f=`, ${this[GZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Cpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(vQn(l,e))r.call(this,o,s);else throw new Cpe(`${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(Q2s,"buildMockDispatch");function vQn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>B5(n,r.host)))}a(vQn,"checkNetConnect");function q2s(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(q2s,"normalizeOrigin");function j2s(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new isr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new isr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new isr("options.ignoreTrailingSlash must to be a boolean");return r}a(j2s,"buildAndValidateMockOptions");CQn.exports={getResponseData:gQn,getMockDispatch:AQn,addMockDispatch:F2s,deleteMockDispatch:asr,buildKey:yQn,generateKeyValues:csr,matchValue:B5,getResponse:U2s,getStatusText:EQn,mockDispatch:_Qn,buildMockDispatch:Q2s,checkNetConnect:vQn,buildAndValidateMockOptions:j2s,getHeaderByName:hQn,buildHeadersFromArray:lsr,normalizeSearchParams:L2s,normalizeOrigin:q2s}});var gsr=I((Fcf,msr)=>{"use strict";p();var{getResponseData:H2s,buildKey:G2s,addMockDispatch:usr}=YPe(),{kDispatches:ust,kDispatchKey:dst,kDefaultHeaders:dsr,kDefaultTrailers:fsr,kContentLength:psr,kMockDispatch:fst,kIgnoreTrailingSlash:pst}=HZ(),{InvalidArgumentError:F5}=ao(),{serializePathWithQuery:$2s}=Po(),bpe=class{static{a(this,"MockScope")}constructor(e){this[fst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("waitInMs must be a valid integer > 0");return this[fst].delay=e,this}persist(){return this[fst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("repeatTimes must be a valid integer > 0");return this[fst].times=e,this}},hsr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new F5("opts must be an object");if(typeof e.path>"u")throw new F5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=$2s(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[dst]=G2s(e),this[ust]=r,this[pst]=e.ignoreTrailingSlash??!1,this[dsr]={},this[fsr]={},this[psr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=H2s(r),s=this[psr]?{"content-length":o.length}:{},c={...this[dsr],...s,...n.headers},l={...this[fsr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new F5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new F5("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 F5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=usr(this[ust],this[dst],s,{ignoreTrailingSlash:this[pst]});return new bpe(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=usr(this[ust],this[dst],n,{ignoreTrailingSlash:this[pst]});return new bpe(o)}replyWithError(e){if(typeof e>"u")throw new F5("error must be defined");let r=usr(this[ust],this[dst],{error:e},{ignoreTrailingSlash:this[pst]});return new bpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new F5("headers must be defined");return this[dsr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new F5("trailers must be defined");return this[fsr]=e,this}replyContentLength(){return this[psr]=!0,this}};msr.exports.MockInterceptor=hsr;msr.exports.MockScope=bpe});var _sr=I((qcf,RQn)=>{"use strict";p();var{promisify:V2s}=require("node:util"),W2s=Vj(),{buildMockDispatch:z2s}=YPe(),{kDispatches:Asr,kMockAgent:bQn,kClose:SQn,kOriginalClose:TQn,kOrigin:IQn,kOriginalDispatch:Y2s,kConnected:ysr,kIgnoreTrailingSlash:xQn}=HZ(),{MockInterceptor:K2s}=gsr(),wQn=al(),{InvalidArgumentError:J2s}=ao(),Esr=class extends W2s{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new J2s("Argument opts.agent must implement Agent");super(e,r),this[bQn]=r.agent,this[IQn]=e,this[xQn]=r.ignoreTrailingSlash??!1,this[Asr]=[],this[ysr]=1,this[Y2s]=this.dispatch,this[TQn]=this.close.bind(this),this.dispatch=z2s.call(this),this.close=this[SQn]}get[wQn.kConnected](){return this[ysr]}intercept(e){return new K2s(e&&{ignoreTrailingSlash:this[xQn],...e},this[Asr])}cleanMocks(){this[Asr]=[]}async[SQn](){await V2s(this[TQn])(),this[ysr]=0,this[bQn][wQn.kClients].delete(this[IQn])}};RQn.exports=Esr});var bsr=I((Gcf,Csr)=>{"use strict";p();var{kMockCallHistoryAddLog:Z2s}=HZ(),{InvalidArgumentError:tH}=ao();function Xj(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 tH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Xj,"handleFilterCallsWithOptions");function X2s(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new tH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(X2s,"buildAndValidateFilterCallsOptions");function eH(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 tH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(eH,"makeFilterCalls");function eDs(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 tH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(eDs,"computeUrlWithMaybeSearchParameters");var hst=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=eDs(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)}},vsr=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 tH("nthCall must be called with a number");if(!Number.isInteger(e))throw new tH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new tH("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",...X2s(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Xj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Xj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Xj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Xj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Xj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Xj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Xj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Xj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new tH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=eH.call(this,"protocol");filterCallsByHost=eH.call(this,"host");filterCallsByPort=eH.call(this,"port");filterCallsByOrigin=eH.call(this,"origin");filterCallsByPath=eH.call(this,"path");filterCallsByHash=eH.call(this,"hash");filterCallsByFullUrl=eH.call(this,"fullUrl");filterCallsByMethod=eH.call(this,"method");clear(){this.logs=[]}[Z2s](e){let r=new hst(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Csr.exports.MockCallHistory=vsr;Csr.exports.MockCallHistoryLog=hst});var xsr=I((Wcf,LQn)=>{"use strict";p();var{promisify:tDs}=require("node:util"),rDs=NZ(),{buildMockDispatch:nDs}=YPe(),{kDispatches:Ssr,kMockAgent:kQn,kClose:PQn,kOriginalClose:DQn,kOrigin:NQn,kOriginalDispatch:iDs,kConnected:Tsr,kIgnoreTrailingSlash:MQn}=HZ(),{MockInterceptor:oDs}=gsr(),OQn=al(),{InvalidArgumentError:sDs}=ao(),Isr=class extends rDs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new sDs("Argument opts.agent must implement Agent");super(e,r),this[kQn]=r.agent,this[NQn]=e,this[MQn]=r.ignoreTrailingSlash??!1,this[Ssr]=[],this[Tsr]=1,this[iDs]=this.dispatch,this[DQn]=this.close.bind(this),this.dispatch=nDs.call(this),this.close=this[PQn]}get[OQn.kConnected](){return this[Tsr]}intercept(e){return new oDs(e&&{ignoreTrailingSlash:this[MQn],...e},this[Ssr])}cleanMocks(){this[Ssr]=[]}async[PQn](){await tDs(this[DQn])(),this[Tsr]=0,this[kQn][OQn.kClients].delete(this[NQn])}};LQn.exports=Isr});var FQn=I((Jcf,BQn)=>{"use strict";p();var{Transform:aDs}=require("node:stream"),{Console:cDs}=require("node:console"),lDs=process.versions.icu?"\u2705":"Y ",uDs=process.versions.icu?"\u274C":"N ";BQn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new aDs({transform(r,n,o){o(null,r)}}),this.logger=new cDs({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?lDs:uDs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Dsr=I((elf,$Qn)=>{"use strict";p();var{kClients:$Z}=al(),dDs=LZ(),{kAgent:wsr,kMockAgentSet:mst,kMockAgentGet:UQn,kDispatches:Rsr,kIsMockActive:gst,kNetConnect:VZ,kGetNetConnect:fDs,kOptions:Ast,kFactory:yst,kMockAgentRegisterCallHistory:ksr,kMockAgentIsCallHistoryEnabled:KPe,kMockAgentAddCallHistoryLog:QQn,kMockAgentMockCallHistoryInstance:Spe,kMockAgentAcceptsNonStandardSearchParameters:qQn,kMockCallHistoryAddLog:pDs,kIgnoreTrailingSlash:jQn}=HZ(),hDs=_sr(),mDs=xsr(),{matchValue:gDs,normalizeSearchParams:ADs,buildAndValidateMockOptions:yDs,normalizeOrigin:HQn}=YPe(),{InvalidArgumentError:GQn,UndiciError:EDs}=ao(),_Ds=mPe(),vDs=FQn(),{MockCallHistory:CDs}=bsr(),Psr=class extends _Ds{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=yDs(e);if(this[VZ]=!0,this[gst]=!0,this[KPe]=r.enableCallHistory??!1,this[qQn]=r.acceptNonStandardSearchParameters??!1,this[jQn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new GQn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new dDs(e);this[wsr]=n,this[$Z]=n[$Z],this[Ast]=r,this[KPe]&&this[ksr]()}get(e){let r=HQn(e),n=this[jQn]?r.replace(/\/$/,""):r,o=this[UQn](n);return o||(o=this[yst](n),this[mst](n,o)),o}dispatch(e,r){e.origin=HQn(e.origin),this.get(e.origin),this[QQn](e);let n=this[qQn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=ADs(c,n);o.path=`${s}?${l}`}return this[wsr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[wsr].close(),this[$Z].clear()}deactivate(){this[gst]=!1}activate(){this[gst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[VZ])?this[VZ].push(e):this[VZ]=[e];else if(typeof e>"u")this[VZ]=!0;else throw new GQn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[VZ]=!1}enableCallHistory(){return this[KPe]=!0,this}disableCallHistory(){return this[KPe]=!1,this}getCallHistory(){return this[Spe]}clearCallHistory(){this[Spe]!==void 0&&this[Spe].clear()}get isMockActive(){return this[gst]}[ksr](){this[Spe]===void 0&&(this[Spe]=new CDs)}[QQn](e){this[KPe]&&(this[ksr](),this[Spe][pDs](e))}[mst](e,r){this[$Z].set(e,{count:0,dispatcher:r})}[yst](e){let r=Object.assign({agent:this},this[Ast]);return this[Ast]&&this[Ast].connections===1?new hDs(e,r):new mDs(e,r)}[UQn](e){let r=this[$Z].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[yst]("http://localhost:9999");return this[mst](e,n),n}for(let[n,o]of Array.from(this[$Z]))if(o&&typeof n!="string"&&gDs(n,e)){let s=this[yst](e);return this[mst](e,s),s[Rsr]=o.dispatcher[Rsr],s}}[fDs](){return this[VZ]}pendingInterceptors(){let e=this[$Z];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Rsr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new vDs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new EDs(r.length===1?`1 interceptor is pending: +`,"latin1"),r!==null&&o!==r){if(n[Vir])throw new wZ;process.emitWarning(new wZ)}e[dd].timeout&&e[dd].timeoutType===upe&&e[dd].timeout.refresh&&e[dd].timeout.refresh(),n[YF]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Hj]=!1,e&&(Oi(n[dm]<=1,"pipeline should only contain this request"),o(e))}};Z9n.exports=dRs});var cUn=I((Daf,aUn)=>{"use strict";p();var Qw=require("node:assert"),{pipeline:bRs}=require("node:stream"),ys=Do(),{RequestContentLengthMismatchError:tor,RequestAbortedError:SRs,SocketError:DPe,InformationalError:Gj,InvalidArgumentError:TRs}=ao(),{kUrl:PPe,kReset:Kot,kClient:bT,kRunning:NPe,kPending:IRs,kQueue:$j,kPendingIdx:nor,kRunningIdx:x2,kError:ST,kSocket:Rf,kStrictContentLength:xRs,kOnError:dpe,kMaxConcurrentStreams:zot,kPingInterval:eUn,kHTTP2Session:KF,kHTTP2InitialWindowSize:wRs,kHTTP2ConnectionWindowSize:RRs,kResume:M5,kSize:kRs,kHTTPContext:ior,kClosed:ror,kBodyTimeout:PRs,kEnableConnectProtocol:RPe,kRemoteSettings:kPe,kHTTP2Stream:Wot,kHTTP2SessionState:oor}=al(),{channels:tUn}=Qj(),Uw=Symbol("open streams"),rUn,Yot;try{Yot=require("node:http2")}catch{Yot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:DRs,HTTP2_HEADER_METHOD:nUn,HTTP2_HEADER_PATH:iUn,HTTP2_HEADER_SCHEME:Zir,HTTP2_HEADER_CONTENT_LENGTH:NRs,HTTP2_HEADER_EXPECT:MRs,HTTP2_HEADER_STATUS:Xir,HTTP2_HEADER_PROTOCOL:ORs,NGHTTP2_REFUSED_STREAM:LRs,NGHTTP2_CANCEL:BRs}}=Yot;function eor(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(eor,"parseH2Headers");function FRs(t,e){t[Rf]=e;let r=t[wRs],n=t[RRs],o=Yot.connect(t[PPe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[zot],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[Rf]=e,o[Uw]=0,o[bT]=t,o[Rf]=e,o[oor]={ping:{interval:t[eUn]===0?null:setInterval(jRs,t[eUn],o).unref()}},o[RPe]=!1,o[kPe]=!1,n&&ys.addListener(o,"connect",QRs.bind(o,n)),ys.addListener(o,"error",HRs),ys.addListener(o,"frameError",GRs),ys.addListener(o,"end",$Rs),ys.addListener(o,"goaway",VRs),ys.addListener(o,"close",WRs),ys.addListener(o,"remoteSettings",qRs),o.unref(),t[KF]=o,e[KF]=o,ys.addListener(e,"error",YRs),ys.addListener(e,"end",KRs),ys.addListener(e,"close",zRs),e[ror]=!1,e.on("close",JRs),{version:"h2",defaultPipelining:1/0,write(s){return XRs(t,s)},resume(){URs(t)},destroy(s,c){e[ror]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[NPe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[kPe]===!1||ys.bodyLength(s.body)!==0&&(ys.isStream(s.body)||ys.isAsyncIterable(s.body)||ys.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[kPe]===!1;return!1}}}a(FRs,"connectH2");function URs(t){let e=t[Rf];e?.destroyed===!1&&(t[kRs]===0||t[zot]===0?(e.unref(),t[KF].unref()):(e.ref(),t[KF].ref()))}a(URs,"resumeH2");function QRs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(QRs,"applyConnectionWindowSize");function qRs(t){if(this[bT][zot]=t.maxConcurrentStreams??this[bT][zot],this[kPe]===!0&&this[RPe]===!0&&t.enableConnectProtocol===!1){let e=new Gj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[Rf][ST]=e,this[bT][dpe](e);return}this[RPe]=t.enableConnectProtocol??this[RPe],this[kPe]=!0,this[bT][M5]()}a(qRs,"onHttp2RemoteSettings");function jRs(t){let e=t[oor];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[bT],c=this[bT];if(n!=null){let l=new Gj(`HTTP/2: "PING" errored - type ${n.message}`);c[ST]=l,s[dpe](l)}else s.emit("ping",o)}a(r,"onPing")}a(jRs,"onHttp2SendPing");function HRs(t){Qw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Rf][ST]=t,this[bT][dpe](t)}a(HRs,"onHttp2SessionError");function GRs(t,e,r){if(r===0){let n=new Gj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Rf][ST]=n,this[bT][dpe](n)}}a(GRs,"onHttp2FrameError");function $Rs(){let t=new DPe("other side closed",ys.getSocketInfo(this[Rf]));this.destroy(t),ys.destroy(this[Rf],t)}a($Rs,"onHttp2SessionEnd");function VRs(t){let e=this[ST]||new DPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ys.getSocketInfo(this[Rf])),r=this[bT];if(r[Rf]=null,r[ior]=null,this.close(),this[KF]=null,ys.destroy(this[Rf],e),r[x2]{e.aborted||e.completed||(x=x||new SRs,ys.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[dpe](x),t[M5]()),ys.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ys.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[RPe]===!1?(ys.errorRequest(t,e,new Gj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[nUn]="CONNECT",g[ORs]="websocket",g[iUn]=s,f==="ws:"||f==="wss:"?g[Zir]=f==="ws:"?"http":"https":g[Zir]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[Wot]=!0,A.once("response",(x,P)=>{let{[Xir]:D,...N}=x;e.onUpgrade(D,eor(N),A),++n[Uw],t[$j][t[x2]++]=null}),A.on("error",()=>{(A.rstCode===LRs||A.rstCode===BRs)&&_(new Gj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[Uw]-=1,n[Uw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[Wot]=!0,A.on("response",x=>{let{[Xir]:P,...D}=x;e.onUpgrade(P,eor(D),A),++n[Uw],t[$j][t[x2]++]=null}),A.once("close",()=>{n[Uw]-=1,n[Uw]===0&&n.unref()}),A.setTimeout(r),!0);g[iUn]=s,g[Zir]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ys.bodyLength(m);if(ys.isFormDataLike(m)){rUn??=cpe().extractBody;let[x,P]=rUn(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),ZRs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[xRs])return ys.errorRequest(t,e,new tor),!1;process.emitWarning(new tor)}if(b!=null&&(Qw(m||b===0,"no body must not have content length"),g[NRs]=`${b}`),n.ref(),tUn.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r +`;tUn.sendHeaders.publish({request:e,headers:x,socket:n[Rf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[MRs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[Wot]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[Wot]=!0,R()),++n[Uw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Xir]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),eor(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[$j][t[x2]++]=null,t[M5]()):(_(new Gj("HTTP/2: stream half-closed (remote)")),t[$j][t[x2]++]=null,t[nor]=t[x2],t[M5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[Uw]-=1,n[Uw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new Gj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new Gj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[Uw]-=1,n[Uw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?oUn(_,A,null,t,e,t[Rf],b,v):ys.isBuffer(m)?oUn(_,A,m,t,e,t[Rf],b,v):ys.isBlobLike(m)?typeof m.stream=="function"?sUn(_,A,m.stream(),t,e,t[Rf],b,v):tks(_,A,m,t,e,t[Rf],b,v):ys.isStream(m)?eks(_,t[Rf],v,A,m,t,e,b):ys.isIterable(m)?sUn(_,A,m,t,e,t[Rf],b,v):Qw(!1)}a(R,"writeBodyH2")}a(XRs,"writeH2");function oUn(t,e,r,n,o,s,c,l){try{r!=null&&ys.isBuffer(r)&&(Qw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Kot]=!0),o.onRequestSent(),n[M5]()}catch(u){t(u)}}a(oUn,"writeBuffer");function eks(t,e,r,n,o,s,c,l){Qw(l!==0||s[NPe]===0,"stream body cannot be pipelined");let u=bRs(o,n,f=>{f?(ys.destroy(u,f),t(f)):(ys.removeAllListeners(u),c.onRequestSent(),r||(e[Kot]=!0),s[M5]())});ys.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(eks,"writeStream");async function tks(t,e,r,n,o,s,c,l){Qw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new tor;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Kot]=!0),n[M5]()}catch(u){t(u)}}a(tks,"writeBlob");async function sUn(t,e,r,n,o,s,c,l){Qw(c!==0||n[NPe]===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)=>{Qw(u===null),s[ST]?m(s[ST]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[ST])throw s[ST];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Kot]=!0),n[M5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(sUn,"writeIterable");aUn.exports=FRs});var Yj=I((Oaf,gUn)=>{"use strict";p();var JF=require("node:assert"),fUn=require("node:net"),MPe=require("node:http"),NZ=Do(),{ClientStats:rks}=Jnr(),{channels:fpe}=Qj(),nks=I6n(),iks=bZ(),{InvalidArgumentError:fd,InformationalError:oks,ClientDestroyedError:sks}=ao(),aks=SZ(),{kUrl:O5,kServerName:zj,kClient:cks,kBusy:aor,kConnect:lks,kResuming:MZ,kRunning:FPe,kPending:UPe,kSize:OPe,kQueue:w2,kConnected:uks,kConnecting:ppe,kNeedDrain:Wj,kKeepAliveDefaultTimeout:lUn,kHostHeader:dks,kPendingIdx:R2,kRunningIdx:XF,kError:fks,kPipelining:Jot,kKeepAliveTimeoutValue:pks,kMaxHeadersSize:hks,kKeepAliveMaxTimeout:mks,kKeepAliveTimeoutThreshold:gks,kHeadersTimeout:Aks,kBodyTimeout:yks,kStrictContentLength:Eks,kConnector:LPe,kMaxRequests:cor,kCounter:_ks,kClose:vks,kDestroy:Cks,kDispatch:bks,kLocalAddress:BPe,kMaxResponseSize:Sks,kOnError:Tks,kHTTPContext:uh,kMaxConcurrentStreams:Iks,kHTTP2InitialWindowSize:xks,kHTTP2ConnectionWindowSize:wks,kResume:ZF,kPingInterval:Rks}=al(),kks=X9n(),Pks=cUn(),Vj=Symbol("kClosedResolve"),Dks=MPe&&MPe.maxHeaderSize&&Number.isInteger(MPe.maxHeaderSize)&&MPe.maxHeaderSize>0?()=>MPe.maxHeaderSize:()=>{throw new fd("http module not available or http.maxHeaderSize invalid")},uUn=a(()=>{},"noop");function pUn(t){return t[Jot]??t[uh]?.defaultPipelining??1}a(pUn,"getPipelining");var lor=class extends iks{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:L,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new fd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new fd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new fd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new fd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new fd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new fd("invalid maxHeaderSize")}else r=Dks();if(A!=null&&typeof A!="string")throw new fd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new fd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new fd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new fd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new fd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new fd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new fd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new fd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new fd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||fUn.isIP(w)===0))throw new fd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new fd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new fd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new fd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new fd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new fd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new fd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new fd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new fd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=aks({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let j=b;b=a((Q,U)=>j({...Q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},U),"connect")}this[O5]=NZ.parseOrigin(e),this[LPe]=b,this[Jot]=y??1,this[hks]=r,this[lUn]=f??4e3,this[mks]=m??6e5,this[gks]=g??2e3,this[pks]=this[lUn],this[zj]=null,this[BPe]=w??null,this[MZ]=0,this[Wj]=0,this[dks]=`host: ${this[O5].hostname}${this[O5].port?`:${this[O5].port}`:""}\r +`,this[yks]=l??3e5,this[Aks]=n??3e5,this[Eks]=_??!0,this[cor]=T,this[Vj]=null,this[Sks]=R>-1?R:-1,this[uh]=null,this[Iks]=D??100,this[xks]=B??262144,this[wks]=q??524288,this[Rks]=M??6e4,this[w2]=[],this[XF]=0,this[R2]=0,this[ZF]=j=>uor(this,j),this[Tks]=j=>hUn(this,j)}get pipelining(){return this[Jot]}set pipelining(e){this[Jot]=e,this[ZF](!0)}get stats(){return new rks(this)}get[UPe](){return this[w2].length-this[R2]}get[FPe](){return this[R2]-this[XF]}get[OPe](){return this[w2].length-this[XF]}get[uks](){return!!this[uh]&&!this[ppe]&&!this[uh].destroyed}get[aor](){return!!(this[uh]?.busy(null)||this[OPe]>=(pUn(this)||1)||this[UPe]>0)}[lks](e){mUn(this),this.once("connect",e)}[bks](e,r){let n=new nks(this[O5].origin,e,r);return this[w2].push(n),this[MZ]||(NZ.bodyLength(n.body)==null&&NZ.isIterable(n.body)?(this[MZ]=1,queueMicrotask(()=>uor(this))):this[ZF](!0)),this[MZ]&&this[Wj]!==2&&this[aor]&&(this[Wj]=2),this[Wj]<2}[vks](){return new Promise(e=>{this[OPe]?this[Vj]=e:e(null)})}[Cks](e){return new Promise(r=>{let n=this[w2].splice(this[R2]);for(let s=0;s{this[Vj]&&(this[Vj](),this[Vj]=null),r(null)},"callback");this[uh]?(this[uh].destroy(e,o),this[uh]=null):queueMicrotask(o),this[ZF]()})}};function hUn(t,e){if(t[FPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){JF(t[R2]===t[XF]);let r=t[w2].splice(t[XF]);for(let n=0;n{if(s){sor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[ZF]();return}if(t.destroyed){NZ.destroy(c.on("error",uUn),new sks),t[ZF]();return}JF(c);try{t[uh]=c.alpnProtocol==="h2"?Pks(t,c):kks(t,c)}catch(l){c.destroy().on("error",uUn),sor(t,l,{host:e,hostname:r,protocol:n,port:o}),t[ZF]();return}t[ppe]=!1,c[_ks]=0,c[cor]=t[cor],c[cks]=t,c[fks]=null,fpe.connected.hasSubscribers&&fpe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[uh]?.version,servername:t[zj],localAddress:t[BPe]},connector:t[LPe],socket:c}),t.emit("connect",t[O5],[t]),t[ZF]()})}catch(s){sor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[ZF]()}}a(mUn,"connect");function sor(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[ppe]=!1,fpe.connectError.hasSubscribers&&fpe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[uh]?.version,servername:t[zj],localAddress:t[BPe]},connector:t[LPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(JF(t[FPe]===0);t[UPe]>0&&t[w2][t[R2]].servername===t[zj];){let c=t[w2][t[R2]++];NZ.errorRequest(t,c,e)}else hUn(t,e);t.emit("connectionError",t[O5],[t],e)}}a(sor,"handleConnectError");function dUn(t){t[Wj]=0,t.emit("drain",t[O5],[t])}a(dUn,"emitDrain");function uor(t,e){t[MZ]!==2&&(t[MZ]=2,Nks(t,e),t[MZ]=0,t[XF]>256&&(t[w2].splice(0,t[XF]),t[R2]-=t[XF],t[XF]=0))}a(uor,"resume");function Nks(t,e){for(;;){if(t.destroyed){JF(t[UPe]===0);return}if(t[Vj]&&!t[OPe]){t[Vj](),t[Vj]=null;return}if(t[uh]&&t[uh].resume(),t[aor])t[Wj]=2;else if(t[Wj]===2){e?(t[Wj]=1,queueMicrotask(()=>dUn(t))):dUn(t);continue}if(t[UPe]===0||t[FPe]>=(pUn(t)||1))return;let r=t[w2][t[R2]];if(r===null)return;if(t[O5].protocol==="https:"&&t[zj]!==r.servername){if(t[FPe]>0)return;t[zj]=r.servername,t[uh]?.destroy(new oks("servername changed"),()=>{t[uh]=null,uor(t)})}if(t[ppe])return;if(!t[uh]){mUn(t);return}if(t[uh].destroyed||t[uh].busy(r))return;!r.aborted&&t[uh].write(r)?t[R2]++:t[w2].splice(t[R2],1)}}a(Nks,"_resume");gUn.exports=lor});var dor=I((Uaf,AUn)=>{"use strict";p();var Zot=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)}};AUn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Zot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Zot),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 Xot=I((jaf,IUn)=>{"use strict";p();var{PoolStats:Mks}=Jnr(),Oks=bZ(),Lks=dor(),{kConnected:por,kSize:yUn,kRunning:EUn,kPending:_Un,kQueued:QPe,kBusy:Bks,kFree:Fks,kUrl:Uks,kClose:Qks,kDestroy:qks,kDispatch:jks}=al(),Og=Symbol("clients"),fv=Symbol("needDrain"),qPe=Symbol("queue"),hor=Symbol("closed resolve"),mor=Symbol("onDrain"),vUn=Symbol("onConnect"),CUn=Symbol("onDisconnect"),bUn=Symbol("onConnectionError"),gor=Symbol("get dispatcher"),SUn=Symbol("add client"),TUn=Symbol("remove client"),Aor=class extends Oks{static{a(this,"PoolBase")}[qPe]=new Lks;[QPe]=0;[Og]=[];[fv]=!1;[mor](e,r,n){let o=this[qPe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[QPe]--,s=!e.dispatch(c.opts,c.handler)}if(e[fv]=s,!s&&this[fv]&&(this[fv]=!1,this.emit("drain",r,[this,...n])),this[hor]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[CUn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[bUn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[Bks](){return this[fv]}get[por](){let e=0;for(let{[por]:r}of this[Og])e+=r;return e}get[Fks](){let e=0;for(let{[por]:r,[fv]:n}of this[Og])e+=r&&!n;return e}get[_Un](){let e=this[QPe];for(let{[_Un]:r}of this[Og])e+=r;return e}get[EUn](){let e=0;for(let{[EUn]:r}of this[Og])e+=r;return e}get[yUn](){let e=this[QPe];for(let{[yUn]:r}of this[Og])e+=r;return e}get stats(){return new Mks(this)}[Qks](){if(this[qPe].isEmpty()){let e=[];for(let r=0;r{this[hor]=e})}[qks](e){for(;;){let n=this[qPe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Og].length);for(let n=0;n{this[fv]&&this[mor](e,e[Uks],[e,this])}),this}[TUn](e){e.close(()=>{let r=this[Og].indexOf(e);r!==-1&&this[Og].splice(r,1)}),this[fv]=this[Og].some(r=>!r[fv]&&r.closed!==!0&&r.destroyed!==!0)}};IUn.exports={PoolBase:Aor,kClients:Og,kNeedDrain:fv,kAddClient:SUn,kRemoveClient:TUn,kGetDispatcher:gor}});var OZ=I(($af,kUn)=>{"use strict";p();var{PoolBase:Hks,kClients:est,kNeedDrain:Gks,kAddClient:$ks,kGetDispatcher:Vks,kRemoveClient:Wks}=Xot(),zks=Yj(),{InvalidArgumentError:yor}=ao(),xUn=Do(),{kUrl:wUn}=al(),Yks=SZ(),tst=Symbol("options"),Eor=Symbol("connections"),RUn=Symbol("factory");function Kks(t,e){return new zks(t,e)}a(Kks,"defaultFactory");var _or=class extends Hks{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Kks,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 yor("invalid connections");if(typeof n!="function")throw new yor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new yor("connect must be a function or an object");typeof o!="function"&&(o=Yks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[Eor]=r||null,this[wUn]=xUn.parseOrigin(e),this[tst]={...xUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[tst].interceptors=g.interceptors?{...g.interceptors}:void 0,this[RUn]=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[est].indexOf(_);v!==-1&&this[est].splice(v,1)}})}[Vks](){let e=this[tst].clientTtl;for(let r of this[est])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Wks](r);else if(!r[Gks])return r;if(!this[Eor]||this[est].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Jks,InvalidArgumentError:Zks}=ao(),{PoolBase:Xks,kClients:WA,kNeedDrain:jPe,kAddClient:ePs,kRemoveClient:tPs,kGetDispatcher:rPs}=Xot(),nPs=OZ(),{kUrl:rst}=al(),nst=Do(),PUn=Symbol("factory"),HPe=Symbol("options"),DUn=Symbol("kGreatestCommonDivisor"),LZ=Symbol("kCurrentWeight"),BZ=Symbol("kIndex"),qw=Symbol("kWeight"),ist=Symbol("kMaxWeightPerServer"),ost=Symbol("kErrorPenalty");function iPs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(iPs,"getGreatestCommonDivisor");function oPs(t,e){return new nPs(t,e)}a(oPs,"defaultFactory");var vor=class extends Xks{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=oPs,...n}={}){if(typeof r!="function")throw new Zks("factory must be a function.");super(n),this[HPe]={...nst.deepClone(n)},this[HPe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[BZ]=-1,this[LZ]=0,this[ist]=this[HPe].maxWeightPerServer||100,this[ost]=this[HPe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[PUn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=nst.parseOrigin(e).origin;if(this[WA].find(o=>o[rst].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[PUn](r,this[HPe]);this[ePs](n),n.on("connect",()=>{n[qw]=Math.min(this[ist],n[qw]+this[ost])}),n.on("connectionError",()=>{n[qw]=Math.max(1,n[qw]-this[ost]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[qw]=Math.max(1,n[qw]-this[ost]),this._updateBalancedPoolStats())});for(let o of this[WA])o[qw]=this[ist];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[rst].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[tPs](n),this}getUpstream(e){let r=nst.parseOrigin(e).origin;return this[WA].find(n=>n[rst].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[WA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[rst].origin)}[rPs](){if(this[WA].length===0)throw new Jks;if(!this[WA].find(s=>!s[jPe]&&s.closed!==!0&&s.destroyed!==!0)||this[WA].map(s=>s[jPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[WA].findIndex(s=>!s[jPe]);for(;n++this[WA][o][qw]&&!s[jPe]&&(o=this[BZ]),this[BZ]===0&&(this[LZ]=this[LZ]-this[DUn],this[LZ]<=0&&(this[LZ]=this[ist])),s[qw]>=this[LZ]&&!s[jPe])return s}return this[LZ]=this[WA][o][qw],this[BZ]=o,this[WA][o]}};NUn.exports=vor});var FUn=I((Jaf,BUn)=>{"use strict";p();var{PoolBase:sPs,kClients:sst,kNeedDrain:aPs,kAddClient:OUn,kGetDispatcher:cPs,kRemoveClient:lPs}=Xot(),uPs=Yj(),{InvalidArgumentError:Cor}=ao(),LUn=Do(),{kUrl:bor}=al(),dPs=SZ(),GPe=Symbol("options"),Sor=Symbol("connections"),Tor=Symbol("factory"),ast=Symbol("index");function fPs(t,e){return new uPs(t,e)}a(fPs,"defaultFactory");var Ior=class extends sPs{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=fPs,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 Cor("invalid connections");if(typeof n!="function")throw new Cor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new Cor("connect must be a function or an object");typeof o!="function"&&(o=dPs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[Sor]=r||null,this[bor]=LUn.parseOrigin(e),this[GPe]={...LUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[GPe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[Tor]=n,this[ast]=-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[sst].indexOf(_);v!==-1&&this[sst].splice(v,1)}})}[cPs](){let e=this[GPe].clientTtl,r=this[sst].length;if(r===0){let o=this[Tor](this[bor],this[GPe]);return this[OUn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[lPs](o),n++;continue}if(!o[aPs])return o;n++}if(!this[Sor]||r{"use strict";p();var{InvalidArgumentError:cst,MaxOriginsReachedError:pPs}=ao(),{kClients:jw,kRunning:UUn,kClose:hPs,kDestroy:mPs,kDispatch:gPs,kUrl:APs}=al(),yPs=bZ(),EPs=OZ(),_Ps=Yj(),vPs=Do(),QUn=Symbol("onConnect"),qUn=Symbol("onDisconnect"),jUn=Symbol("onConnectionError"),HUn=Symbol("onDrain"),GUn=Symbol("factory"),xor=Symbol("options"),$Pe=Symbol("origins");function CPs(t,e){return e&&e.connections===1?new _Ps(t,e):new EPs(t,e)}a(CPs,"defaultFactory");var wor=class extends yPs{static{a(this,"Agent")}constructor({factory:e=CPs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new cst("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new cst("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new cst("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[xor]={...vPs.deepClone(o),maxOrigins:r,connect:n},this[GUn]=e,this[jw]=new Map,this[$Pe]=new Set,this[HUn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[QUn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[qUn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[jUn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[UUn](){let e=0;for(let{dispatcher:r}of this[jw].values())e+=r[UUn];return e}[gPs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new cst("opts.origin must be a non-empty string or URL.");if(this[$Pe].size>=this[xor].maxOrigins&&!this[$Pe].has(n))throw new pPs;let o=this[jw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[jw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[jw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[$Pe].delete(n))},"closeClientIfUnused");s=this[GUn](e.origin,this[xor]).on("drain",this[HUn]).on("connect",(l,u)=>{let d=this[jw].get(n);d&&(d.count+=1),this[QUn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[qUn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[jUn](l,u,d)}),this[jw].set(n,{count:0,dispatcher:s}),this[$Pe].add(n)}return s.dispatch(e,r)}[hPs](){let e=[];for(let{dispatcher:r}of this[jw].values())e.push(r.close());return this[jw].clear(),Promise.all(e)}[mPs](e){let r=[];for(let{dispatcher:n}of this[jw].values())r.push(n.destroy(e));return this[jw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[jw].values())r.stats&&(e[r[APs].origin]=r.stats);return e}};$Un.exports=wor});var zUn=I((ncf,WUn)=>{"use strict";p();var{Buffer:Jj}=require("node:buffer"),Ror=require("node:net"),{InvalidArgumentError:Kj}=ao();function bPs(t){if(Ror.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:Jj.from(r)}}if(Ror.isIPv6(t))return{type:4,buffer:VUn(t)};let e=Jj.from(t,"utf8");if(e.length>255)throw new Kj("Domain name too long (max 255 bytes)");return{type:3,buffer:Jj.concat([Jj.from([e.length]),e])}}a(bPs,"parseAddress");function VUn(t){let e=Jj.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Ror.isIPv4(s)){let c=s.split(".").map(Number),l=(c[0]<<8|c[1]).toString(16),u=(c[2]<<8|c[3]).toString(16);r=`${t.slice(0,o)}:${l}:${u}`}}let n=r.indexOf("::");if(n!==-1){let o=r.slice(0,n),s=r.slice(n+2),c=o===""?[]:o.split(":"),l=s===""?[]:s.split(":"),u=0;for(let d of c)e.writeUInt16BE(parseInt(d,16),u),u+=2;u=16-l.length*2;for(let d of l)e.writeUInt16BE(parseInt(d,16),u),u+=2}else{let o=r.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:xPs}=require("node:events"),{Buffer:UZ}=require("node:buffer"),{InvalidArgumentError:hpe,Socks5ProxyError:Zj}=ao(),{debuglog:wPs}=require("node:util"),{parseAddress:RPs}=zUn(),e8=wPs("undici:socks5"),YUn=UZ.alloc(0),lst=5,mpe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},KUn={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},QZ={IPV4:1,DOMAIN:3,IPV6:4},L5={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},CE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},kor=class extends xPs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new hpe("socket is required");this.socket=e,this.options=r,this.state=CE.INITIAL,this.buffer=YUn,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(mpe.USERNAME_PASSWORD),this.authMethods.push(mpe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){e8("received data",e.length,"bytes in state",this.state),this.buffer=UZ.concat([this.buffer,e]);try{switch(this.state){case CE.HANDSHAKING:this.handleHandshakeResponse();break;case CE.AUTHENTICATING:this.handleAuthResponse();break;case CE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){e8("socket error",e),this.state=CE.ERROR,this.emit("error",e),this.destroy()}onClose(){e8("socket closed"),this.state=CE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=CE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==CE.INITIAL)throw new hpe("Handshake already started");e8("starting handshake with",this.authMethods.length,"auth methods"),this.state=CE.HANDSHAKING;let e=UZ.alloc(2+this.authMethods.length);e[0]=lst,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!==lst)throw new Zj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===mpe.NO_ACCEPTABLE)throw new Zj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),e8("server selected auth method",r),r===mpe.NO_AUTH)this.markAuthenticated();else if(r===mpe.USERNAME_PASSWORD)this.state=CE.AUTHENTICATING,this.sendAuthRequest();else throw new Zj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new hpe("Username and password required for authentication");e8("sending username/password auth");let n=UZ.from(e),o=UZ.from(r);if(n.length>255||o.length>255)throw new hpe("Username or password too long");let s=UZ.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 Zj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Zj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),e8("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===CE.CONNECTING||this.state===CE.CONNECTED)throw new hpe("Connection already in progress");if(this.state!==CE.AUTHENTICATED)throw new hpe("Client must be authenticated before CONNECT");e8("connecting to",e,r),this.state=CE.CONNECTING;let n=this.buildConnectRequest(KUn.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=RPs(r),c=UZ.alloc(4+s.length+2);return c[0]=lst,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!==lst)throw new Zj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===QZ.IPV4)o+=6;else if(n===QZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===QZ.IPV6)o+=18;else throw new Zj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:XUn}=require("node:url"),Por,kPs=bZ(),{InvalidArgumentError:e7n}=ao(),{Socks5Client:PPs,STATES:DPs}=ZUn(),{kDispatch:t7n,kClose:NPs,kDestroy:MPs}=al(),OPs=OZ(),LPs=SZ(),{debuglog:BPs}=require("node:util"),Xj=BPs("undici:socks5-proxy"),Dor=Symbol("proxy url"),FPs=Symbol("proxy headers"),r7n=Symbol("proxy auth"),n7n=Symbol("proxy protocol"),qZ=Symbol("pools"),i7n=Symbol("connector"),Nor=Symbol("request tls settings"),o7n=!1,Mor=class extends kPs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),o7n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),o7n=!0),!e)throw new e7n("Proxy URL is mandatory");let n=typeof e=="string"?new XUn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new e7n("Proxy URL must use socks5:// or socks:// protocol");this[Dor]=n,this[FPs]=r.headers||{},this[n7n]=r.proxyTls?"https:":"http:",this[Nor]=r.requestTls,this[r7n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[i7n]=r.connect||LPs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[qZ]=new Map}async createSocks5Connection(e,r){let n=this[Dor].hostname,o=parseInt(this[Dor].port)||1080;Xj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[i7n]({hostname:n,host:n,port:o,protocol:this[n7n]},(d,f)=>{d?u(d):l(f)})}),c=new PPs(s,this[r7n]);return c.on("error",l=>{Xj("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===DPs.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=>{Xj("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}[t7n](e,r){let{origin:n}=e;Xj("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[qZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new OPs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new XUn(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);Xj("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(Por||(Por=require("node:tls")),Xj("upgrading to TLS"),m=Por.connect({...this[Nor],socket:h,servername:this[Nor]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){Xj("SOCKS5 connection error:",u),l(u)}},"connect")}),this[qZ].set(o,s)),s[t7n](e,r)}catch(o){if(Xj("dispatch error:",o),typeof r.onResponseError=="function")return r.onResponseError(null,o),!1;if(typeof r.onError=="function")return r.onError(o),!1;throw o}}async[NPs](){let e=[];for(let r of this[qZ].values())e.push(r.close());this[qZ].clear(),await Promise.all(e)}async[MPs](e){let r=[];for(let n of this[qZ].values())r.push(n.destroy(e));this[qZ].clear(),await Promise.all(r)}};s7n.exports=Mor});var Uor=I((fcf,y7n)=>{"use strict";p();var{kProxy:gpe,kClose:p7n,kDestroy:h7n,kDispatch:a7n}=al(),UPs=FZ(),m7n=OZ(),g7n=bZ(),{InvalidArgumentError:jZ,RequestAbortedError:QPs,SecureProxyConnectionError:qPs}=ao(),c7n=SZ(),A7n=Yj(),{channels:l7n}=Qj(),jPs=Oor(),ust=Symbol("proxy agent"),eH=Symbol("proxy client"),t8=Symbol("proxy headers"),Lor=Symbol("request tls settings"),u7n=Symbol("proxy tls settings"),d7n=Symbol("connect endpoint function"),f7n=Symbol("tunnel proxy");function HPs(t){return t==="https:"?443:80}a(HPs,"defaultProtocolPort");function GPs(t,e){return new m7n(t,e)}a(GPs,"defaultFactory");var $Ps=a(()=>{},"noop");function VPs(t,e){return e.connections===1?new A7n(t,e):new m7n(t,e)}a(VPs,"defaultAgentFactory");var Bor=class extends g7n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new jZ("Proxy URL is mandatory");super(),this[t8]=r,o?this.#e=o(e,{connect:n}):this.#e=new A7n(e,{connect:n})}[a7n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new jZ("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[t8],...c},this.#e[a7n](e,r)}[p7n](){return this.#e.close()}[h7n](e){return this.#e.destroy(e)}},For=class extends g7n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new jZ("Proxy uri is mandatory");let{clientFactory:r=GPs}=e;if(typeof r!="function")throw new jZ("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[gpe]={uri:s,protocol:u},this[Lor]=e.requestTls,this[u7n]=e.proxyTls,this[t8]=e.headers||{},this[f7n]=n,e.auth&&e.token)throw new jZ("opts.auth cannot be used in combination with opts.token");e.auth?this[t8]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[t8]["proxy-authorization"]=e.token:d&&f&&(this[t8]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=c7n({...e.proxyTls});this[d7n]=c7n({...e.requestTls});let g=e.factory||VPs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[gpe].protocol==="socks5:"||this[gpe].protocol==="socks:"?new jPs(this[gpe].uri,{headers:this[t8],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[f7n]&&_==="http:"&&this[gpe].protocol==="http:"?new Bor(this[gpe].uri,{headers:this[t8],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[eH]=null:this[eH]=r(o,{connect:m}),this[ust]=new UPs({...e,factory:A,connect:a(async(y,E)=>{if(!this[eH]){E(new jZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${HPs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[t8],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[u7n]?.servername||h},{socket:b,statusCode:T}=await this[eH].connect(v);if(T!==200){b.on("error",$Ps).destroy(),E(new QPs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(l7n.proxyConnected.hasSubscribers&&l7n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Lor]?w=this[Lor].servername:w=y.servername,this[d7n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new qPs(v)):E(v)}},"connect")})}dispatch(e,r){let n=WPs(e.headers);if(zPs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[ust].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[p7n](){let e=[this[ust].close()];return this[eH]&&e.push(this[eH].close()),Promise.all(e)}[h7n](){let e=[this[ust].destroy()];return this[eH]&&e.push(this[eH].destroy()),Promise.all(e)}};function WPs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new jZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(zPs,"throwIfProxyAuthIsSent");y7n.exports=For});var b7n=I((mcf,C7n)=>{"use strict";p();var YPs=bZ(),{kClose:KPs,kDestroy:JPs,kClosed:E7n,kDestroyed:_7n,kDispatch:ZPs,kNoProxyAgent:VPe,kHttpProxyAgent:tH,kHttpsProxyAgent:HZ}=al(),v7n=Uor(),XPs=FZ(),e2s={"http:":80,"https:":443},Qor=class extends YPs{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[VPe]=new XPs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[tH]=new v7n({...s,uri:c}):this[tH]=this[VPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[HZ]=new v7n({...s,uri:l}):this[HZ]=this[tH],this.#o()}[ZPs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[KPs](){return Promise.all([this[VPe].close(),!this[tH][E7n]&&this[tH].close(),!this[HZ][E7n]&&this[HZ].close()])}[JPs](e){return Promise.all([this[VPe].destroy(e),!this[tH][_7n]&&this[tH].destroy(e),!this[HZ][_7n]&&this[HZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||e2s[r]||0,this.#i(n,o)?r==="https:"?this[HZ]:this[tH]:this[VPe]}#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 Ape=require("node:assert"),{kRetryHandlerDefaultRetry:S7n}=al(),{RequestRetryError:WPe}=ao(),t2s=APe(),{isDisturbed:T7n,parseRangeHeader:I7n,wrapRequestBody:r2s}=Do();function n2s(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(n2s,"calculateRetryAfterHeader");var qor=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=t2s.wrap(n),this.opts={...s,body:r2s(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[S7n],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(T7n(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[S7n](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)?n2s(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 WPe("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 WPe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=I7n(n["content-range"]);if(!s)throw new WPe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new WPe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;Ape(this.start===c,"content-range mismatch"),Ape(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=I7n(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;Ape(c!=null&&Number.isFinite(c),"content-range mismatch"),Ape(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}Ape(Number.isFinite(this.start)),Ape(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 WPe("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||T7n(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))}};x7n.exports=qor});var R7n=I((vcf,w7n)=>{"use strict";p();var i2s=yPe(),o2s=dst(),jor=class extends i2s{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 o2s({...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()}};w7n.exports=jor});var D7n=I((Scf,P7n)=>{"use strict";p();var{InvalidArgumentError:k7n}=ao(),s2s=Yj(),Hor=class extends s2s{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new k7n("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 k7n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};P7n.exports=Hor});var q7n=I((xcf,Q7n)=>{"use strict";p();var L7n=require("node:assert"),{Readable:a2s}=require("node:stream"),{RequestAbortedError:B7n,NotSupportedError:c2s,InvalidArgumentError:l2s,AbortError:fst}=ao(),F7n=Do(),{ReadableStreamFrom:u2s}=Do(),TT=Symbol("kConsume"),pst=Symbol("kReading"),GZ=Symbol("kBody"),N7n=Symbol("kAbort"),U7n=Symbol("kContentType"),Gor=Symbol("kContentLength"),$or=Symbol("kUsed"),hst=Symbol("kBytesRead"),d2s=a(()=>{},"noop"),Vor=class extends a2s{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[N7n]=r,this[TT]=null,this[hst]=0,this[GZ]=null,this[$or]=!1,this[U7n]=n,this[Gor]=Number.isFinite(o)?o:null,this[pst]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new B7n),e&&this[N7n](),this[$or]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[pst]=!0,this[$or]=!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[pst]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[hst]+=e.length,this[TT])?(zor(this[TT],e),this[pst]?super.push(e):!0):super.push(e)}text(){return zPe(this,"text")}json(){return zPe(this,"json")}blob(){return zPe(this,"blob")}bytes(){return zPe(this,"bytes")}arrayBuffer(){return zPe(this,"arrayBuffer")}async formData(){throw new c2s}get bodyUsed(){return F7n.isDisturbed(this)}get body(){return this[GZ]||(this[GZ]=u2s(this),this[TT]&&(this[GZ].getReader(),L7n(this[GZ].locked))),this[GZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new l2s("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 fst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Gor]&&this[Gor]>n||this[hst]>n)&&this.destroy(new fst),r){let c=a(()=>{this.destroy(r.reason??new fst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new fst):o(null)})}else this.on("close",o);this.on("error",d2s).on("data",()=>{this[hst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function f2s(t){return t[GZ]?.locked===!0||t[TT]!==null}a(f2s,"isLocked");function p2s(t){return F7n.isDisturbed(t)||f2s(t)}a(p2s,"isUnusable");function zPe(t,e){return L7n(!t[TT]),new Promise((r,n)=>{if(p2s(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[TT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Yor(this[TT],o)}).on("close",function(){this[TT].body!==null&&Yor(this[TT],new B7n)}),h2s(t[TT])})})}a(zPe,"consume");function h2s(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(Wor,"chunksDecode");function M7n(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 m2s=require("node:assert"),{AsyncResource:g2s}=require("node:async_hooks"),{Readable:A2s}=q7n(),{InvalidArgumentError:ype,RequestAbortedError:j7n}=ao(),Hw=Do();function YPe(){}a(YPe,"noop");var mst=class extends g2s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new ype("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 ype("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new ype("invalid highWaterMark");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(l&&typeof l!="function")throw new ype("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw Hw.isStream(c)&&Hw.destroy(c.on("error",YPe),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 j7n:n&&(this.removeAbortListener=Hw.addAbortListener(n,()=>{this.reason=n.reason??new j7n,this.res?Hw.destroy(this.res.on("error",YPe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}m2s(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"?Hw.parseRawHeaders(r):Hw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?Hw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new A2s({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,Hw.destroy(y.on("error",YPe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){Hw.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(()=>{Hw.destroy(r.on("error",YPe),e)})),o&&(this.body=null,Hw.isStream(o)&&(o.on("error",YPe),Hw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function H7n(t,e){if(e===void 0)return new Promise((r,n)=>{H7n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new mst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(H7n,"request");Kor.exports=H7n;Kor.exports.RequestHandler=mst});var KPe=I((Ncf,W7n)=>{"use strict";p();var{addAbortListener:y2s}=Do(),{RequestAbortedError:E2s}=ao(),Epe=Symbol("kListener"),B5=Symbol("kSignal");function $7n(t){t.abort?t.abort(t[B5]?.reason):t.reason=t[B5]?.reason??new E2s,V7n(t)}a($7n,"abort");function _2s(t,e){if(t.reason=null,t[B5]=null,t[Epe]=null,!!e){if(e.aborted){$7n(t);return}t[B5]=e,t[Epe]=()=>{$7n(t)},y2s(t[B5],t[Epe])}}a(_2s,"addSignal");function V7n(t){t[B5]&&("removeEventListener"in t[B5]?t[B5].removeEventListener("abort",t[Epe]):t[B5].removeListener("abort",t[Epe]),t[B5]=null,t[Epe]=null)}a(V7n,"removeSignal");W7n.exports={addSignal:_2s,removeSignal:V7n}});var J7n=I((Lcf,K7n)=>{"use strict";p();var v2s=require("node:assert"),{finished:C2s}=require("node:stream"),{AsyncResource:b2s}=require("node:async_hooks"),{InvalidArgumentError:_pe,InvalidReturnValueError:S2s}=ao(),r8=Do(),{addSignal:T2s,removeSignal:z7n}=KPe();function I2s(){}a(I2s,"noop");var Jor=class extends b2s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new _pe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new _pe("invalid callback");if(typeof r!="function")throw new _pe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new _pe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new _pe("invalid method");if(u&&typeof u!="function")throw new _pe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw r8.isStream(l)&&r8.destroy(l.on("error",I2s),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,r8.isStream(l)&&l.on("error",f=>{this.onError(f)}),T2s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}v2s(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"?r8.parseRawHeaders(r):r8.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 S2s("expected Writable");return C2s(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&r8.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;z7n(this),r&&(this.trailers=r8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;z7n(this),this.factory=null,r?(this.res=null,r8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,r8.destroy(s,e))}};function Y7n(t,e,r){if(r===void 0)return new Promise((n,o)=>{Y7n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Jor(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(Y7n,"stream");K7n.exports=Y7n});var tQn=I((Ucf,eQn)=>{"use strict";p();var{Readable:X7n,Duplex:x2s,PassThrough:w2s}=require("node:stream"),R2s=require("node:assert"),{AsyncResource:k2s}=require("node:async_hooks"),{InvalidArgumentError:JPe,InvalidReturnValueError:P2s,RequestAbortedError:Zor}=ao(),F5=Do(),{addSignal:D2s,removeSignal:N2s}=KPe();function Z7n(){}a(Z7n,"noop");var vpe=Symbol("resume"),Xor=class extends X7n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[vpe]=null}_read(){let{[vpe]:e}=this;e&&(this[vpe]=null,e())}_destroy(e,r){this._read(),r(e)}},esr=class extends X7n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[vpe]=e}_read(){this[vpe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Zor),r(e)}},tsr=class extends k2s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new JPe("invalid opts");if(typeof r!="function")throw new JPe("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 JPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new JPe("invalid method");if(c&&typeof c!="function")throw new JPe("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 Xor().on("error",Z7n),this.ret=new x2s({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[vpe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Zor),A&&u&&A(),F5.destroy(f,u),F5.destroy(h,u),F5.destroy(m,u),N2s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,D2s(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}R2s(!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"?F5.parseRawHeaders(r):F5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new esr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?F5.parseRawHeaders(r):F5.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",Z7n),u}if(!l||typeof l.on!="function")throw new P2s("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;F5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||F5.destroy(u,new Zor)}),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,F5.destroy(r,e)}};function M2s(t,e){try{let r=new tsr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new w2s().destroy(r)}}a(M2s,"pipeline");eQn.exports=M2s});var aQn=I((jcf,sQn)=>{"use strict";p();var{InvalidArgumentError:rsr,SocketError:O2s}=ao(),{AsyncResource:L2s}=require("node:async_hooks"),rQn=require("node:assert"),nQn=Do(),{kHTTP2Stream:B2s}=al(),{addSignal:F2s,removeSignal:iQn}=KPe(),nsr=class extends L2s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new rsr("invalid opts");if(typeof r!="function")throw new rsr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new rsr("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,F2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}rQn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new O2s("bad upgrade",null)}onUpgrade(e,r,n){rQn(n[B2s]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;iQn(this),this.callback=null;let l=this.responseHeaders==="raw"?nQn.parseRawHeaders(r):nQn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;iQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function oQn(t,e){if(e===void 0)return new Promise((r,n)=>{oQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new nsr(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(oQn,"upgrade");sQn.exports=oQn});var fQn=I(($cf,dQn)=>{"use strict";p();var U2s=require("node:assert"),{AsyncResource:Q2s}=require("node:async_hooks"),{InvalidArgumentError:isr,SocketError:q2s}=ao(),cQn=Do(),{addSignal:j2s,removeSignal:lQn}=KPe(),osr=class extends Q2s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new isr("invalid opts");if(typeof r!="function")throw new isr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new isr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,j2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}U2s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new q2s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;lQn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?cQn.parseRawHeaders(r):cQn.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;lQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function uQn(t,e){if(e===void 0)return new Promise((r,n)=>{uQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new osr(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(uQn,"connect");dQn.exports=uQn});var pQn=I((zcf,Cpe)=>{"use strict";p();Cpe.exports.request=G7n();Cpe.exports.stream=J7n();Cpe.exports.pipeline=tQn();Cpe.exports.upgrade=aQn();Cpe.exports.connect=fQn()});var asr=I((Kcf,mQn)=>{"use strict";p();var{UndiciError:H2s}=ao(),hQn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),ssr=class extends H2s{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[hQn]===!0}get[hQn](){return!0}};mQn.exports={MockNotMatchedError:ssr}});var $Z=I((Xcf,gQn)=>{"use strict";p();gQn.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 ZPe=I((tlf,xQn)=>{"use strict";p();var{MockNotMatchedError:bpe}=asr(),{kDispatches:VZ,kMockAgent:G2s,kOriginalDispatch:$2s,kOrigin:V2s,kGetNetConnect:W2s,kTotalDispatchCount:usr}=$Z(),{serializePathWithQuery:z2s}=Do(),{STATUS_CODES:Y2s}=require("node:http"),{types:{isPromise:K2s}}=require("node:util"),{InvalidArgumentError:csr}=ao();function U5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(U5,"matchValue");function yQn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(yQn,"lowerCaseEntries");function EQn(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=EQn(e,r);if(!U5(n,o))return!1}return!0}a(_Qn,"matchHeaders");function J2s(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(J2s,"normalizeSearchParams");function lsr(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(lsr,"safeUrl");function Z2s(t,{path:e,method:r,body:n,headers:o}){let s=U5(t.path,e),c=U5(t.method,r),l=typeof t.body<"u"?U5(t.body,n):!0,u=_Qn(t,o);return s&&c&&l&&u}a(Z2s,"matchKey");function vQn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(vQn,"getResponseData");function CQn(t,e){let r=e.query?z2s(e.path,e.query):e.path,n=typeof r=="string"?lsr(r):r,o=AQn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?U5(AQn(lsr(c)),o):U5(lsr(c),n));if(s.length===0)throw new bpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>U5(c,e.method)),s.length===0)throw new bpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?U5(c,e.body):!0),s.length===0)throw new bpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>_Qn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new bpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(CQn,"getMockDispatch");function X2s(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[usr]=(t[usr]||0)+1,c}a(X2s,"addMockDispatch");function dsr(t,e){let r=t.findIndex(n=>n.consumed?Z2s(n,e):!1);r!==-1&&t.splice(r,1)}a(dsr,"deleteMockDispatch");function AQn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(AQn,"removeTrailingSlash");function bQn(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(bQn,"buildKey");function fsr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[VZ])},d):E(this[VZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?psr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(K2s(w))return w.then(D=>E(v,D));if(g)return;let R=vQn(w),x=fsr(c),P=fsr(l);e.onHeaders?.(o,x,_,SQn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),dsr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(TQn,"mockDispatch");function tDs(){let t=this[G2s],e=this[V2s],r=this[$2s];return a(function(o,s){if(t.isMockActive)try{TQn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[W2s](),u=this[VZ][usr]||this[VZ].length,f=`, ${this[VZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new bpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(IQn(l,e))r.call(this,o,s);else throw new bpe(`${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(tDs,"buildMockDispatch");function IQn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>U5(n,r.host)))}a(IQn,"checkNetConnect");function rDs(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(rDs,"normalizeOrigin");function nDs(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new csr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new csr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new csr("options.ignoreTrailingSlash must to be a boolean");return r}a(nDs,"buildAndValidateMockOptions");xQn.exports={getResponseData:vQn,getMockDispatch:CQn,addMockDispatch:X2s,deleteMockDispatch:dsr,buildKey:bQn,generateKeyValues:fsr,matchValue:U5,getResponse:eDs,getStatusText:SQn,mockDispatch:TQn,buildMockDispatch:tDs,checkNetConnect:IQn,buildAndValidateMockOptions:nDs,getHeaderByName:EQn,buildHeadersFromArray:psr,normalizeSearchParams:J2s,normalizeOrigin:rDs}});var _sr=I((ilf,Esr)=>{"use strict";p();var{getResponseData:iDs,buildKey:oDs,addMockDispatch:hsr}=ZPe(),{kDispatches:gst,kDispatchKey:Ast,kDefaultHeaders:msr,kDefaultTrailers:gsr,kContentLength:Asr,kMockDispatch:yst,kIgnoreTrailingSlash:Est}=$Z(),{InvalidArgumentError:Q5}=ao(),{serializePathWithQuery:sDs}=Do(),Spe=class{static{a(this,"MockScope")}constructor(e){this[yst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new Q5("waitInMs must be a valid integer > 0");return this[yst].delay=e,this}persist(){return this[yst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new Q5("repeatTimes must be a valid integer > 0");return this[yst].times=e,this}},ysr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new Q5("opts must be an object");if(typeof e.path>"u")throw new Q5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=sDs(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[Ast]=oDs(e),this[gst]=r,this[Est]=e.ignoreTrailingSlash??!1,this[msr]={},this[gsr]={},this[Asr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=iDs(r),s=this[Asr]?{"content-length":o.length}:{},c={...this[msr],...s,...n.headers},l={...this[gsr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new Q5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new Q5("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 Q5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=hsr(this[gst],this[Ast],s,{ignoreTrailingSlash:this[Est]});return new Spe(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=hsr(this[gst],this[Ast],n,{ignoreTrailingSlash:this[Est]});return new Spe(o)}replyWithError(e){if(typeof e>"u")throw new Q5("error must be defined");let r=hsr(this[gst],this[Ast],{error:e},{ignoreTrailingSlash:this[Est]});return new Spe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new Q5("headers must be defined");return this[msr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new Q5("trailers must be defined");return this[gsr]=e,this}replyContentLength(){return this[Asr]=!0,this}};Esr.exports.MockInterceptor=ysr;Esr.exports.MockScope=Spe});var Ssr=I((alf,MQn)=>{"use strict";p();var{promisify:aDs}=require("node:util"),cDs=Yj(),{buildMockDispatch:lDs}=ZPe(),{kDispatches:vsr,kMockAgent:wQn,kClose:RQn,kOriginalClose:kQn,kOrigin:PQn,kOriginalDispatch:uDs,kConnected:Csr,kIgnoreTrailingSlash:DQn}=$Z(),{MockInterceptor:dDs}=_sr(),NQn=al(),{InvalidArgumentError:fDs}=ao(),bsr=class extends cDs{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new fDs("Argument opts.agent must implement Agent");super(e,r),this[wQn]=r.agent,this[PQn]=e,this[DQn]=r.ignoreTrailingSlash??!1,this[vsr]=[],this[Csr]=1,this[uDs]=this.dispatch,this[kQn]=this.close.bind(this),this.dispatch=lDs.call(this),this.close=this[RQn]}get[NQn.kConnected](){return this[Csr]}intercept(e){return new dDs(e&&{ignoreTrailingSlash:this[DQn],...e},this[vsr])}cleanMocks(){this[vsr]=[]}async[RQn](){await aDs(this[kQn])(),this[Csr]=0,this[wQn][NQn.kClients].delete(this[PQn])}};MQn.exports=bsr});var xsr=I((ulf,Isr)=>{"use strict";p();var{kMockCallHistoryAddLog:pDs}=$Z(),{InvalidArgumentError:iH}=ao();function rH(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 iH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(rH,"handleFilterCallsWithOptions");function hDs(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new iH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(hDs,"buildAndValidateFilterCallsOptions");function nH(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 iH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(nH,"makeFilterCalls");function mDs(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 iH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(mDs,"computeUrlWithMaybeSearchParameters");var _st=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=mDs(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)}},Tsr=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 iH("nthCall must be called with a number");if(!Number.isInteger(e))throw new iH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new iH("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",...hDs(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=rH(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=rH(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=rH(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=rH(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=rH(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=rH(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=rH(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=rH(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new iH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=nH.call(this,"protocol");filterCallsByHost=nH.call(this,"host");filterCallsByPort=nH.call(this,"port");filterCallsByOrigin=nH.call(this,"origin");filterCallsByPath=nH.call(this,"path");filterCallsByHash=nH.call(this,"hash");filterCallsByFullUrl=nH.call(this,"fullUrl");filterCallsByMethod=nH.call(this,"method");clear(){this.logs=[]}[pDs](e){let r=new _st(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Isr.exports.MockCallHistory=Tsr;Isr.exports.MockCallHistoryLog=_st});var Psr=I((plf,qQn)=>{"use strict";p();var{promisify:gDs}=require("node:util"),ADs=OZ(),{buildMockDispatch:yDs}=ZPe(),{kDispatches:wsr,kMockAgent:OQn,kClose:LQn,kOriginalClose:BQn,kOrigin:FQn,kOriginalDispatch:EDs,kConnected:Rsr,kIgnoreTrailingSlash:UQn}=$Z(),{MockInterceptor:_Ds}=_sr(),QQn=al(),{InvalidArgumentError:vDs}=ao(),ksr=class extends ADs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new vDs("Argument opts.agent must implement Agent");super(e,r),this[OQn]=r.agent,this[FQn]=e,this[UQn]=r.ignoreTrailingSlash??!1,this[wsr]=[],this[Rsr]=1,this[EDs]=this.dispatch,this[BQn]=this.close.bind(this),this.dispatch=yDs.call(this),this.close=this[LQn]}get[QQn.kConnected](){return this[Rsr]}intercept(e){return new _Ds(e&&{ignoreTrailingSlash:this[UQn],...e},this[wsr])}cleanMocks(){this[wsr]=[]}async[LQn](){await gDs(this[BQn])(),this[Rsr]=0,this[OQn][QQn.kClients].delete(this[FQn])}};qQn.exports=ksr});var HQn=I((Alf,jQn)=>{"use strict";p();var{Transform:CDs}=require("node:stream"),{Console:bDs}=require("node:console"),SDs=process.versions.icu?"\u2705":"Y ",TDs=process.versions.icu?"\u274C":"N ";jQn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new CDs({transform(r,n,o){o(null,r)}}),this.logger=new bDs({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?SDs:TDs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Lsr=I((_lf,KQn)=>{"use strict";p();var{kClients:WZ}=al(),IDs=FZ(),{kAgent:Dsr,kMockAgentSet:vst,kMockAgentGet:GQn,kDispatches:Nsr,kIsMockActive:Cst,kNetConnect:zZ,kGetNetConnect:xDs,kOptions:bst,kFactory:Sst,kMockAgentRegisterCallHistory:Msr,kMockAgentIsCallHistoryEnabled:XPe,kMockAgentAddCallHistoryLog:$Qn,kMockAgentMockCallHistoryInstance:Tpe,kMockAgentAcceptsNonStandardSearchParameters:VQn,kMockCallHistoryAddLog:wDs,kIgnoreTrailingSlash:WQn}=$Z(),RDs=Ssr(),kDs=Psr(),{matchValue:PDs,normalizeSearchParams:DDs,buildAndValidateMockOptions:NDs,normalizeOrigin:zQn}=ZPe(),{InvalidArgumentError:YQn,UndiciError:MDs}=ao(),ODs=yPe(),LDs=HQn(),{MockCallHistory:BDs}=xsr(),Osr=class extends ODs{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=NDs(e);if(this[zZ]=!0,this[Cst]=!0,this[XPe]=r.enableCallHistory??!1,this[VQn]=r.acceptNonStandardSearchParameters??!1,this[WQn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new YQn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new IDs(e);this[Dsr]=n,this[WZ]=n[WZ],this[bst]=r,this[XPe]&&this[Msr]()}get(e){let r=zQn(e),n=this[WQn]?r.replace(/\/$/,""):r,o=this[GQn](n);return o||(o=this[Sst](n),this[vst](n,o)),o}dispatch(e,r){e.origin=zQn(e.origin),this.get(e.origin),this[$Qn](e);let n=this[VQn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=DDs(c,n);o.path=`${s}?${l}`}return this[Dsr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[Dsr].close(),this[WZ].clear()}deactivate(){this[Cst]=!1}activate(){this[Cst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[zZ])?this[zZ].push(e):this[zZ]=[e];else if(typeof e>"u")this[zZ]=!0;else throw new YQn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[zZ]=!1}enableCallHistory(){return this[XPe]=!0,this}disableCallHistory(){return this[XPe]=!1,this}getCallHistory(){return this[Tpe]}clearCallHistory(){this[Tpe]!==void 0&&this[Tpe].clear()}get isMockActive(){return this[Cst]}[Msr](){this[Tpe]===void 0&&(this[Tpe]=new BDs)}[$Qn](e){this[XPe]&&(this[Msr](),this[Tpe][wDs](e))}[vst](e,r){this[WZ].set(e,{count:0,dispatcher:r})}[Sst](e){let r=Object.assign({agent:this},this[bst]);return this[bst]&&this[bst].connections===1?new RDs(e,r):new kDs(e,r)}[GQn](e){let r=this[WZ].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[Sst]("http://localhost:9999");return this[vst](e,n),n}for(let[n,o]of Array.from(this[WZ]))if(o&&typeof n!="string"&&PDs(n,e)){let s=this[Sst](e);return this[vst](e,s),s[Nsr]=o.dispatcher[Nsr],s}}[xDs](){return this[zZ]}pendingInterceptors(){let e=this[WZ];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Nsr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new LDs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new MDs(r.length===1?`1 interceptor is pending: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p();var{InvalidArgumentError:bDs}=ao(),{runtimeFeatures:SDs}=$F();function TDs(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(TDs,"createHeaderFilters");var VQn=SDs.has("crypto")?require("node:crypto"):null,IDs=VQn?.hash?t=>VQn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function zQn(t){return Array.isArray(t)&&(t.length&1)===0}a(zQn,"isUndiciHeaders");function xDs(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(xDs,"isUrlExcludedFactory");function wDs(t){let e={};if(!t)return e;if(zQn(t)){for(let r=0;r{"use strict";p();var{writeFile:kDs,readFile:PDs,mkdir:DDs}=require("node:fs/promises"),{dirname:NDs,resolve:KQn}=require("node:path"),{setTimeout:MDs,clearTimeout:JQn}=require("node:timers"),{InvalidArgumentError:ZQn,UndiciError:ODs}=ao(),{hashId:LDs,isUrlExcludedFactory:BDs,normalizeHeaders:XQn,createHeaderFilters:eqn}=Nsr();function JPe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||XQn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:tqn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(JPe,"formatRequestKey");function tqn(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(tqn,"filterHeadersForMatching");function rqn(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(rqn,"filterHeadersForStorage");function ZPe(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 LDs(r)}a(ZPe,"createRequestHash");var Msr=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=eqn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=BDs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=JPe(e,this.#s,this.matchOptions),o=ZPe(n),s=XQn(r.headers),c={statusCode:r.statusCode,headers:rqn(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=JPe(e,this.#s,this.matchOptions),n=ZPe(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 ZQn("Snapshot path is required");try{let n=await PDs(KQn(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 ODs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new ZQn("Snapshot path is required");let n=KQn(r);await DDs(NDs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await kDs(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=JPe(e,this.#s,this.matchOptions),n=ZPe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=JPe(e,this.#s,this.matchOptions),n=ZPe(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&&(JQn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=MDs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(JQn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};nqn.exports={SnapshotRecorder:Msr,formatRequestKey:JPe,createRequestHash:ZPe,filterHeadersForMatching:tqn,filterHeadersForStorage:rqn,createHeaderFilters:eqn}});var aqn=I((llf,sqn)=>{"use strict";p();var FDs=LZ(),UDs=Dsr(),{SnapshotRecorder:QDs}=iqn(),qDs=hPe(),{InvalidArgumentError:jDs,UndiciError:HDs}=ao(),{validateSnapshotMode:GDs}=Nsr(),mb=Symbol("kSnapshotRecorder"),U5=Symbol("kSnapshotMode"),XPe=Symbol("kSnapshotPath"),Osr=Symbol("kSnapshotLoaded"),Est=Symbol("kRealAgent"),oqn=!1,Lsr=class extends UDs{static{a(this,"SnapshotAgent")}constructor(e={}){oqn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),oqn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),GDs(r),(r==="playback"||r==="update")&&!n)throw new jDs(`snapshotPath is required when mode is '${r}'`);this[U5]=r,this[XPe]=n,this[mb]=new QDs({snapshotPath:this[XPe],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[Osr]=!1,(this[U5]==="record"||this[U5]==="update"||this[U5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Est]=new FDs(e)),(this[U5]==="playback"||this[U5]==="update")&&this[XPe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=qDs.wrap(r);let n=this[U5];if(this[mb].isUrlExcluded(e))return this[Est].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Osr])return this.#e(e,r);let o=this[mb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new HDs(`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[mb].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[Est].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[mb].loadSnapshots(e||this[XPe]),this[Osr]=!0,this[U5]==="playback"&&this.#n()}async saveSnapshots(e){return this[mb].saveSnapshots(e||this[XPe])}#n(){for(let e of this[mb].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[mb]}getMode(){return this[U5]}clearSnapshots(){this[mb].clear()}resetCallCounts(){this[mb].resetCallCounts()}deleteSnapshot(e){return this[mb].deleteSnapshot(e)}getSnapshotInfo(e){return this[mb].getSnapshotInfo(e)}replaceSnapshots(e){this[mb].replaceSnapshots(e)}async close(){await this[mb].close(),await this[Est]?.close(),await super.close()}};sqn.exports=Lsr});var _st=I((flf,dqn)=>{"use strict";p();var $Ds=Symbol.for("undici.globalDispatcher.2"),cqn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:VDs}=ao(),WDs=LZ();uqn()===void 0&&lqn(new WDs);function lqn(t){if(!t||typeof t.dispatch!="function")throw new VDs("Argument agent must implement Agent");Object.defineProperty(globalThis,$Ds,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,cqn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(lqn,"setGlobalDispatcher");function uqn(){return globalThis[cqn]}a(uqn,"getGlobalDispatcher");var zDs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];dqn.exports={setGlobalDispatcher:lqn,getGlobalDispatcher:uqn,installedExports:zDs}});var Tpe=I((glf,fqn)=>{"use strict";p();var t8=require("node:assert"),YDs=hPe();fqn.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=YDs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return t8(!this.#t),t8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return t8(!this.#t),t8(!this.#r),t8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return t8(!this.#t),t8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return t8(!this.#t),t8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Qsr=I((Elf,gqn)=>{"use strict";p();var gb=Po(),{kBodyUsed:e2e}=al(),Usr=require("node:assert"),{InvalidArgumentError:Bsr}=ao(),KDs=require("node:events"),JDs=[300,301,302,303,307,308],pqn=Symbol("body"),hqn=a(()=>{},"noop"),vst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[pqn]=e,this[e2e]=!1}async*[Symbol.asyncIterator](){Usr(!this[e2e],"disturbed"),this[e2e]=!0,yield*this[pqn]}},Fsr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Bsr("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 Bsr("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=[],gb.isStream(this.opts.body)?(gb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Usr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[e2e]=!1,KDs.prototype.on.call(this.opts.body,"data",function(){this[e2e]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new vst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&gb.isIterable(this.opts.body)&&!gb.isFormDataLike(this.opts.body)&&(this.opts.body=new vst(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",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",hqn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",hqn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||gb.isDisturbed(this.opts.body)||JDs.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}=gb.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 Bsr(`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=ZDs(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 mqn(t,e,r){if(t.length===4)return gb.headerNameToString(t)==="host";if(e&&gb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=gb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(mqn,"shouldRemoveHeader");function ZDs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var XDs=Qsr();function eNs({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 XDs(e,s,l,o);return e(l,u)},"Intercept")}a(eNs,"createRedirectInterceptor");Aqn.exports=eNs});var _qn=I((Tlf,Eqn)=>{"use strict";p();var tNs=Tpe(),{ResponseError:rNs}=ao(),qsr=class extends tNs{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 rNs("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)}};Eqn.exports=()=>t=>a(function(r,n){return t(r,new qsr(r,{handler:n}))},"Intercept")});var Cqn=I((wlf,vqn)=>{"use strict";p();var nNs=ost();vqn.exports=t=>e=>a(function(n,o){return e(n,new nNs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var Sqn=I((Plf,bqn)=>{"use strict";p();var{InvalidArgumentError:iNs,RequestAbortedError:oNs}=ao(),sNs=Tpe(),jsr=class extends sNs{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 iNs("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 oNs(`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 aNs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new jsr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(aNs,"createDumpInterceptor");bqn.exports=aNs});var wqn=I((Mlf,xqn)=>{"use strict";p();var{isIP:cNs}=require("node:net"),{lookup:lNs}=require("node:dns"),uNs=Tpe(),{InvalidArgumentError:WZ,InformationalError:dNs}=ao(),Hsr=Math.pow(2,31)-1;function fNs(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(fNs,"hasSafeIterator");function Tqn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(Tqn,"isHostHeader");function pNs(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"&&fNs(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(pNs,"normalizeHeaders");function hNs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},$sr=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 Gsr(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 dNs("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){lNs(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===Hsr?(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===Hsr?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===Hsr?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 Vsr(this,e,r)}},Vsr=class extends uNs{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:Iqn(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}}};xqn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new WZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new WZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new WZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new WZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new WZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new WZ("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 WZ("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 $sr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return cNs(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:Iqn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Ipe=I((Blf,kqn)=>{"use strict";p();var{safeHTTPMethods:Rqn,pathHasQueryOrFragment:mNs,hasSafeIterator:gNs}=Po(),{serializePathWithQuery:ANs}=Po();function yNs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!mNs(e)&&(e=ANs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(yNs,"makeCacheKey");function ENs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},gNs(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(ENs,"normalizeHeaders");function _Ns(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(_Ns,"assertCacheKey");function vNs(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(vNs,"assertCacheValue");function CNs(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 wNs(t){switch(t[3]){case",":return RNs(t);case" ":return kNs(t);default:return PNs(t)}}a(wNs,"parseHttpDate");function RNs(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(RNs,"parseImfDate");function kNs(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(kNs,"parseAscTimeDate");function PNs(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(PNs,"parseRfc850Date");Pqn.exports={parseHttpDate:wNs}});var Lqn=I((Hlf,Oqn)=>{"use strict";p();var DNs=Po(),{parseCacheControlHeader:NNs,parseVaryHeader:MNs,isEtagUsable:ONs}=Ipe(),{parseHttpDate:Nqn}=Dqn();function LNs(){}a(LNs,"noop");var Mqn=[200,203,204,206,300,301,308,404,405,410,414,501],BNs=[206],FNs=2147483647e3,Wsr=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(!DNs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(LNs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&Mqn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?NNs(l):{};if(!UNs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?QNs(n.age):void 0;if(h&&h>=FNs)return s();let m=typeof n.date=="string"?Nqn(n.date):void 0,g=qNs(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=MNs(n.vary,this.#e.headers),!E))return s();let _=jNs(A,d,y),v=HNs(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"&&ONs(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 UNs(t,e,r,n,o){return!(e<200||BNs.includes(e)||!Mqn.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(UNs,"canCacheResponse");function QNs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(QNs,"getAge");function qNs(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=Nqn(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(GNs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(qNs,"determineStaleAt");function jNs(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(jNs,"determineDeleteAt");function HNs(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(HNs,"stripNecessaryHeaders");function GNs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(GNs,"isValidDate");Oqn.exports=Wsr});var Ysr=I((Vlf,Uqn)=>{"use strict";p();var{Writable:$Ns}=require("node:stream"),{EventEmitter:VNs}=require("node:events"),{assertCacheKey:Bqn,assertCacheValue:WNs}=Ipe(),zsr=class extends VNs{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){Bqn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?Fqn(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){Bqn(e),WNs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new $Ns({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=Fqn(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(Fqn,"findEntry");Uqn.exports=zsr});var qqn=I((Ylf,Qqn)=>{"use strict";p();var zNs=require("node:assert"),Ksr=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(zNs(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}};Qqn.exports=Ksr});var $qn=I((Zlf,Gqn)=>{"use strict";p();var jqn=require("node:assert"),{Readable:YNs}=require("node:stream"),xpe=Po(),t2e=Lqn(),KNs=Ysr(),JNs=qqn(),{assertCacheStore:ZNs,assertCacheMethods:XNs,makeCacheKey:eMs,normalizeHeaders:tMs,parseCacheControlHeader:rMs}=Ipe(),{AbortError:nMs}=ao();function iMs(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 oMs(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(oMs,"needsRevalidation");function sMs(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(sMs,"isStale");function aMs(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(aMs,"withinStaleWhileRevalidateWindow");function cMs(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,[],Zsr,"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 t2e(e,r,n))}a(cMs,"handleUncachedResponse");function Jsr(t,e,r,n,o,s){let c=xpe.isStream(r.body)?r.body:YNs.from(r.body??[]);jqn(!c.destroyed,"stream should not be destroyed"),jqn(!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 nMs)}};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(Jsr,"sendCachedValue");function Hqn(t,e,r,n,o,s,c){if(!c)return cMs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new t2e(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=sMs(c,s),f=oMs(c,s,o);if(d||f){if(xpe.isStream(o.body)&&xpe.bodyLength(o.body)!==0)return t(o,new t2e(e,r,n));if(!f&&aMs(c))return Jsr(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 t2e(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?Jsr(n,o,c,u,y,d):xpe.isStream(c.body)&&c.body.on("error",Zsr).destroy()},new t2e(e,r,n),h))}xpe.isStream(o.body)&&o.body.on("error",Zsr).destroy(),Jsr(n,o,c,u,null,!1)}a(Hqn,"handleResult");Gqn.exports=(t={})=>{let{store:e=new KNs,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(ZNs(e,"opts.store"),XNs(r,"opts.methods"),iMs(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=xpe.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;EHqn(u,c,m,f,d,h,A)):Hqn(u,c,m,f,d,h,g)}}});var Kqn=I((tuf,Yqn)=>{"use strict";p();var{createInflate:Xsr,createGunzip:Vqn,createBrotliDecompress:lMs,createZstdDecompress:uMs}=require("node:zlib"),{pipeline:dMs}=require("node:stream"),fMs=Tpe(),{runtimeFeatures:pMs}=$F(),Wqn={gzip:Vqn,"x-gzip":Vqn,br:lMs,deflate:Xsr,compress:Xsr,"x-compress":Xsr,...pMs.has("zstd")?{zstd:uMs}:{}},hMs=[204,304],zqn=!1,ear=class extends fMs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=hMs,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(!Wqn[c])return o.length=0,o;o.push(Wqn[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),dMs(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 mMs(t={}){return zqn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),zqn=!0),e=>(r,n)=>{let o=new ear(n,t);return e(r,o)}}a(mMs,"createDecompressInterceptor");Yqn.exports=mMs});var Xqn=I((iuf,Zqn)=>{"use strict";p();var{RequestAbortedError:gMs}=ao(),Jqn=5*1024*1024,tar=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=Jqn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=Jqn){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 gMs(`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)}};Zqn.exports=tar});var tjn=I((auf,ejn)=>{"use strict";p();var AMs=require("node:diagnostics_channel"),yMs=Po(),EMs=Xqn(),{normalizeHeaders:_Ms,makeCacheKey:vMs,makeDeduplicationKey:CMs}=Ipe(),Cst=AMs.channel("undici:request:pending-requests");ejn.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(!yMs.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:_Ms(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=vMs(d),m=CMs(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new EMs(f,()=>{l.delete(m),Cst.hasSubscribers&&Cst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Cst.hasSubscribers&&Cst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var ijn=I((uuf,njn)=>{"use strict";p();var{Writable:bMs}=require("node:stream"),{assertCacheKey:rar,assertCacheValue:SMs}=Ipe(),nar,ST=3,rjn=2*1e3*1e3*1e3;njn.exports=class{static{a(this,"SqliteCacheStore")}#e=rjn;#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>rjn)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}}nar||(nar=require("node:sqlite").DatabaseSync),this.#r=new nar(e?.location??":memory:"),this.#r.exec(` +${e.format(r)}`.trim())}};KQn.exports=Osr});var Bsr=I((blf,eqn)=>{"use strict";p();var{InvalidArgumentError:FDs}=ao(),{runtimeFeatures:UDs}=WF();function QDs(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(QDs,"createHeaderFilters");var JQn=UDs.has("crypto")?require("node:crypto"):null,qDs=JQn?.hash?t=>JQn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function XQn(t){return Array.isArray(t)&&(t.length&1)===0}a(XQn,"isUndiciHeaders");function jDs(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(jDs,"isUrlExcludedFactory");function HDs(t){let e={};if(!t)return e;if(XQn(t)){for(let r=0;r{"use strict";p();var{writeFile:$Ds,readFile:VDs,mkdir:WDs}=require("node:fs/promises"),{dirname:zDs,resolve:tqn}=require("node:path"),{setTimeout:YDs,clearTimeout:rqn}=require("node:timers"),{InvalidArgumentError:nqn,UndiciError:KDs}=ao(),{hashId:JDs,isUrlExcludedFactory:ZDs,normalizeHeaders:iqn,createHeaderFilters:oqn}=Bsr();function e2e(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||iqn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:sqn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(e2e,"formatRequestKey");function sqn(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(sqn,"filterHeadersForMatching");function aqn(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(aqn,"filterHeadersForStorage");function t2e(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 JDs(r)}a(t2e,"createRequestHash");var Fsr=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=oqn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=ZDs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=e2e(e,this.#s,this.matchOptions),o=t2e(n),s=iqn(r.headers),c={statusCode:r.statusCode,headers:aqn(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=e2e(e,this.#s,this.matchOptions),n=t2e(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 nqn("Snapshot path is required");try{let n=await VDs(tqn(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 KDs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new nqn("Snapshot path is required");let n=tqn(r);await WDs(zDs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await $Ds(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=e2e(e,this.#s,this.matchOptions),n=t2e(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=e2e(e,this.#s,this.matchOptions),n=t2e(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&&(rqn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=YDs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(rqn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};cqn.exports={SnapshotRecorder:Fsr,formatRequestKey:e2e,createRequestHash:t2e,filterHeadersForMatching:sqn,filterHeadersForStorage:aqn,createHeaderFilters:oqn}});var fqn=I((Rlf,dqn)=>{"use strict";p();var XDs=FZ(),eNs=Lsr(),{SnapshotRecorder:tNs}=lqn(),rNs=APe(),{InvalidArgumentError:nNs,UndiciError:iNs}=ao(),{validateSnapshotMode:oNs}=Bsr(),mb=Symbol("kSnapshotRecorder"),q5=Symbol("kSnapshotMode"),r2e=Symbol("kSnapshotPath"),Usr=Symbol("kSnapshotLoaded"),Tst=Symbol("kRealAgent"),uqn=!1,Qsr=class extends eNs{static{a(this,"SnapshotAgent")}constructor(e={}){uqn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),uqn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),oNs(r),(r==="playback"||r==="update")&&!n)throw new nNs(`snapshotPath is required when mode is '${r}'`);this[q5]=r,this[r2e]=n,this[mb]=new tNs({snapshotPath:this[r2e],mode:this[q5],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[Usr]=!1,(this[q5]==="record"||this[q5]==="update"||this[q5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Tst]=new XDs(e)),(this[q5]==="playback"||this[q5]==="update")&&this[r2e]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=rNs.wrap(r);let n=this[q5];if(this[mb].isUrlExcluded(e))return this[Tst].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Usr])return this.#e(e,r);let o=this[mb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new iNs(`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[mb].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[Tst].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[mb].loadSnapshots(e||this[r2e]),this[Usr]=!0,this[q5]==="playback"&&this.#n()}async saveSnapshots(e){return this[mb].saveSnapshots(e||this[r2e])}#n(){for(let e of this[mb].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[mb]}getMode(){return this[q5]}clearSnapshots(){this[mb].clear()}resetCallCounts(){this[mb].resetCallCounts()}deleteSnapshot(e){return this[mb].deleteSnapshot(e)}getSnapshotInfo(e){return this[mb].getSnapshotInfo(e)}replaceSnapshots(e){this[mb].replaceSnapshots(e)}async close(){await this[mb].close(),await this[Tst]?.close(),await super.close()}};dqn.exports=Qsr});var Ist=I((Dlf,gqn)=>{"use strict";p();var sNs=Symbol.for("undici.globalDispatcher.2"),pqn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:aNs}=ao(),cNs=FZ();mqn()===void 0&&hqn(new cNs);function hqn(t){if(!t||typeof t.dispatch!="function")throw new aNs("Argument agent must implement Agent");Object.defineProperty(globalThis,sNs,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,pqn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(hqn,"setGlobalDispatcher");function mqn(){return globalThis[pqn]}a(mqn,"getGlobalDispatcher");var lNs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];gqn.exports={setGlobalDispatcher:hqn,getGlobalDispatcher:mqn,installedExports:lNs}});var Ipe=I((Llf,Aqn)=>{"use strict";p();var n8=require("node:assert"),uNs=APe();Aqn.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=uNs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return n8(!this.#t),n8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return n8(!this.#t),n8(!this.#r),n8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return n8(!this.#t),n8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return n8(!this.#t),n8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Gsr=I((Ulf,vqn)=>{"use strict";p();var gb=Do(),{kBodyUsed:n2e}=al(),Hsr=require("node:assert"),{InvalidArgumentError:qsr}=ao(),dNs=require("node:events"),fNs=[300,301,302,303,307,308],yqn=Symbol("body"),Eqn=a(()=>{},"noop"),xst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[yqn]=e,this[n2e]=!1}async*[Symbol.asyncIterator](){Hsr(!this[n2e],"disturbed"),this[n2e]=!0,yield*this[yqn]}},jsr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new qsr("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 qsr("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=[],gb.isStream(this.opts.body)?(gb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Hsr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[n2e]=!1,dNs.prototype.on.call(this.opts.body,"data",function(){this[n2e]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new xst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&gb.isIterable(this.opts.body)&&!gb.isFormDataLike(this.opts.body)&&(this.opts.body=new xst(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",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",Eqn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",Eqn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||gb.isDisturbed(this.opts.body)||fNs.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}=gb.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 qsr(`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=pNs(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 _qn(t,e,r){if(t.length===4)return gb.headerNameToString(t)==="host";if(e&&gb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=gb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(_qn,"shouldRemoveHeader");function pNs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var hNs=Gsr();function mNs({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 hNs(e,s,l,o);return e(l,u)},"Intercept")}a(mNs,"createRedirectInterceptor");Cqn.exports=mNs});var Tqn=I(($lf,Sqn)=>{"use strict";p();var gNs=Ipe(),{ResponseError:ANs}=ao(),$sr=class extends gNs{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 ANs("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)}};Sqn.exports=()=>t=>a(function(r,n){return t(r,new $sr(r,{handler:n}))},"Intercept")});var xqn=I((zlf,Iqn)=>{"use strict";p();var yNs=dst();Iqn.exports=t=>e=>a(function(n,o){return e(n,new yNs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var Rqn=I((Jlf,wqn)=>{"use strict";p();var{InvalidArgumentError:ENs,RequestAbortedError:_Ns}=ao(),vNs=Ipe(),Vsr=class extends vNs{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 ENs("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 _Ns(`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 CNs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Vsr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(CNs,"createDumpInterceptor");wqn.exports=CNs});var Nqn=I((euf,Dqn)=>{"use strict";p();var{isIP:bNs}=require("node:net"),{lookup:SNs}=require("node:dns"),TNs=Ipe(),{InvalidArgumentError:YZ,InformationalError:INs}=ao(),Wsr=Math.pow(2,31)-1;function xNs(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(xNs,"hasSafeIterator");function kqn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(kqn,"isHostHeader");function wNs(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"&&xNs(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(wNs,"normalizeHeaders");function RNs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Ysr=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 zsr(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 INs("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){SNs(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===Wsr?(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===Wsr?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===Wsr?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 Ksr(this,e,r)}},Ksr=class extends TNs{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:Pqn(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}}};Dqn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new YZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new YZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new YZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new YZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new YZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new YZ("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 YZ("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 Ysr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return bNs(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:Pqn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var xpe=I((nuf,Oqn)=>{"use strict";p();var{safeHTTPMethods:Mqn,pathHasQueryOrFragment:kNs,hasSafeIterator:PNs}=Do(),{serializePathWithQuery:DNs}=Do();function NNs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!kNs(e)&&(e=DNs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(NNs,"makeCacheKey");function MNs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},PNs(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(MNs,"normalizeHeaders");function ONs(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(ONs,"assertCacheKey");function LNs(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(LNs,"assertCacheValue");function BNs(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 HNs(t){switch(t[3]){case",":return GNs(t);case" ":return $Ns(t);default:return VNs(t)}}a(HNs,"parseHttpDate");function GNs(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(GNs,"parseImfDate");function $Ns(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($Ns,"parseAscTimeDate");function VNs(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(VNs,"parseRfc850Date");Lqn.exports={parseHttpDate:HNs}});var qqn=I((luf,Qqn)=>{"use strict";p();var WNs=Do(),{parseCacheControlHeader:zNs,parseVaryHeader:YNs,isEtagUsable:KNs}=xpe(),{parseHttpDate:Fqn}=Bqn();function JNs(){}a(JNs,"noop");var Uqn=[200,203,204,206,300,301,308,404,405,410,414,501],ZNs=[206],XNs=2147483647e3,Jsr=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(!WNs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(JNs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&Uqn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?zNs(l):{};if(!eMs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?tMs(n.age):void 0;if(h&&h>=XNs)return s();let m=typeof n.date=="string"?Fqn(n.date):void 0,g=rMs(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=YNs(n.vary,this.#e.headers),!E))return s();let _=nMs(A,d,y),v=iMs(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"&&KNs(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 eMs(t,e,r,n,o){return!(e<200||ZNs.includes(e)||!Uqn.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(eMs,"canCacheResponse");function tMs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(tMs,"getAge");function rMs(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=Fqn(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(oMs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(rMs,"determineStaleAt");function nMs(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(nMs,"determineDeleteAt");function iMs(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(iMs,"stripNecessaryHeaders");function oMs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(oMs,"isValidDate");Qqn.exports=Jsr});var Xsr=I((fuf,Gqn)=>{"use strict";p();var{Writable:sMs}=require("node:stream"),{EventEmitter:aMs}=require("node:events"),{assertCacheKey:jqn,assertCacheValue:cMs}=xpe(),Zsr=class extends aMs{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){jqn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?Hqn(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){jqn(e),cMs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new sMs({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=Hqn(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(Hqn,"findEntry");Gqn.exports=Zsr});var Vqn=I((muf,$qn)=>{"use strict";p();var lMs=require("node:assert"),ear=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(lMs(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}};$qn.exports=ear});var Kqn=I((yuf,Yqn)=>{"use strict";p();var Wqn=require("node:assert"),{Readable:uMs}=require("node:stream"),wpe=Do(),i2e=qqn(),dMs=Xsr(),fMs=Vqn(),{assertCacheStore:pMs,assertCacheMethods:hMs,makeCacheKey:mMs,normalizeHeaders:gMs,parseCacheControlHeader:AMs}=xpe(),{AbortError:yMs}=ao();function EMs(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 _Ms(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(_Ms,"needsRevalidation");function vMs(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(vMs,"isStale");function CMs(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(CMs,"withinStaleWhileRevalidateWindow");function bMs(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,[],rar,"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 i2e(e,r,n))}a(bMs,"handleUncachedResponse");function tar(t,e,r,n,o,s){let c=wpe.isStream(r.body)?r.body:uMs.from(r.body??[]);Wqn(!c.destroyed,"stream should not be destroyed"),Wqn(!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 yMs)}};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(tar,"sendCachedValue");function zqn(t,e,r,n,o,s,c){if(!c)return bMs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new i2e(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=vMs(c,s),f=_Ms(c,s,o);if(d||f){if(wpe.isStream(o.body)&&wpe.bodyLength(o.body)!==0)return t(o,new i2e(e,r,n));if(!f&&CMs(c))return tar(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 i2e(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?tar(n,o,c,u,y,d):wpe.isStream(c.body)&&c.body.on("error",rar).destroy()},new i2e(e,r,n),h))}wpe.isStream(o.body)&&o.body.on("error",rar).destroy(),tar(n,o,c,u,null,!1)}a(zqn,"handleResult");Yqn.exports=(t={})=>{let{store:e=new dMs,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(pMs(e,"opts.store"),hMs(r,"opts.methods"),EMs(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=wpe.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;Ezqn(u,c,m,f,d,h,A)):zqn(u,c,m,f,d,h,g)}}});var tjn=I((vuf,ejn)=>{"use strict";p();var{createInflate:nar,createGunzip:Jqn,createBrotliDecompress:SMs,createZstdDecompress:TMs}=require("node:zlib"),{pipeline:IMs}=require("node:stream"),xMs=Ipe(),{runtimeFeatures:wMs}=WF(),Zqn={gzip:Jqn,"x-gzip":Jqn,br:SMs,deflate:nar,compress:nar,"x-compress":nar,...wMs.has("zstd")?{zstd:TMs}:{}},RMs=[204,304],Xqn=!1,iar=class extends xMs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=RMs,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(!Zqn[c])return o.length=0,o;o.push(Zqn[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),IMs(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 kMs(t={}){return Xqn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),Xqn=!0),e=>(r,n)=>{let o=new iar(n,t);return e(r,o)}}a(kMs,"createDecompressInterceptor");ejn.exports=kMs});var ijn=I((Suf,njn)=>{"use strict";p();var{RequestAbortedError:PMs}=ao(),rjn=5*1024*1024,oar=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=rjn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=rjn){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 PMs(`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)}};njn.exports=oar});var sjn=I((xuf,ojn)=>{"use strict";p();var DMs=require("node:diagnostics_channel"),NMs=Do(),MMs=ijn(),{normalizeHeaders:OMs,makeCacheKey:LMs,makeDeduplicationKey:BMs}=xpe(),wst=DMs.channel("undici:request:pending-requests");ojn.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(!NMs.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:OMs(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=LMs(d),m=BMs(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new MMs(f,()=>{l.delete(m),wst.hasSubscribers&&wst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),wst.hasSubscribers&&wst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var ljn=I((kuf,cjn)=>{"use strict";p();var{Writable:FMs}=require("node:stream"),{assertCacheKey:sar,assertCacheValue:UMs}=xpe(),aar,IT=3,ajn=2*1e3*1e3*1e3;cjn.exports=class{static{a(this,"SqliteCacheStore")}#e=ajn;#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>ajn)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}}aar||(aar=require("node:sqlite").DatabaseSync),this.#r=new aar(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${ST} ( + CREATE TABLE IF NOT EXISTS cacheInterceptorV${IT} ( -- Data specific to us id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL, @@ -241,8 +241,8 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p staleAt INTEGER NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${ST}_getValuesQuery ON cacheInterceptorV${ST}(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${ST}_deleteByUrlQuery ON cacheInterceptorV${ST}(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, @@ -256,14 +256,14 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p vary, cachedAt, staleAt - FROM cacheInterceptorV${ST} + FROM cacheInterceptorV${IT} WHERE url = ? AND method = ? ORDER BY deleteAt ASC `),this.#i=this.#r.prepare(` - UPDATE cacheInterceptorV${ST} SET + UPDATE cacheInterceptorV${IT} SET body = ?, deleteAt = ?, statusCode = ?, @@ -276,7 +276,7 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p WHERE id = ? `),this.#o=this.#r.prepare(` - INSERT INTO cacheInterceptorV${ST} ( + INSERT INTO cacheInterceptorV${IT} ( url, method, body, @@ -290,121 +290,121 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p cachedAt, staleAt ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${ST} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${ST}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${ST} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` - DELETE FROM cacheInterceptorV${ST} + `),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${ST} + FROM cacheInterceptorV${IT} ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){rar(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){rar(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){rar(e),SMs(r);let n=0,o=[],s=this;return new bMs({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(!TMs(o[h],f[h])){d=!1;break}}if(d)return u}}};function TMs(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(TMs,"headerValueEquals")});var zZ=I((puf,djn)=>{"use strict";p();var{kConstruct:IMs}=al(),{kEnumerableProperty:wpe}=Po(),{iteratorMixin:xMs,isValidHeaderName:r2e,isValidHeaderValue:sjn}=ET(),{webidl:Pa}=$A(),iar=require("node:assert"),bst=require("node:util");function ojn(t){return t===10||t===13||t===9||t===32}a(ojn,"isHTTPWhiteSpaceCharCode");function ajn(t){let e=0,r=t.length;for(;r>e&&ojn(t.charCodeAt(r-1));)--r;for(;r>e&&ojn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(ajn,"headerValueNormalize");function cjn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(cjn,"fill");function oar(t,e,r){if(r=ajn(r),r2e(e)){if(!sjn(r))throw Pa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(ujn(t)==="immutable")throw new TypeError("immutable");return Tst(t).append(e,r,!1)}a(oar,"appendHeader");function wMs(t){let e=Tst(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],iar(s!==null);return r.sort(ljn)}}},w2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Pa.util.markAsUncloneable(this),e!==IMs&&(this.#t=new Sst,this.#e="none",e!==void 0&&(e=Pa.converters.HeadersInit(e,"Headers constructor","init"),cjn(this,e)))}append(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),oar(this,e,r)}delete(e){if(Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.delete"),e=Pa.converters.ByteString(e,"Headers.delete","name"),!r2e(e))throw Pa.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){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Pa.converters.ByteString(e,r,"name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Pa.converters.ByteString(e,r,"name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),r=ajn(r),r2e(e)){if(!sjn(r))throw Pa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Pa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[bst.inspect.custom](e,r){return r.depth??=e,`Headers ${bst.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:ujn,setHeadersGuard:RMs,getHeadersList:Tst,setHeadersList:kMs}=w2;Reflect.deleteProperty(w2,"getHeadersGuard");Reflect.deleteProperty(w2,"setHeadersGuard");Reflect.deleteProperty(w2,"getHeadersList");Reflect.deleteProperty(w2,"setHeadersList");xMs("Headers",w2,wMs,0,1);Object.defineProperties(w2.prototype,{append:wpe,delete:wpe,get:wpe,has:wpe,set:wpe,getSetCookie:wpe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[bst.inspect.custom]:{enumerable:!1}});Pa.converters.HeadersInit=function(t,e,r){if(Pa.util.Type(t)===Pa.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!bst.types.isProxy(t)&&n===w2.prototype.entries)try{return Tst(t).entriesList}catch{}return typeof n=="function"?Pa.converters["sequence>"](t,e,r,n.bind(t)):Pa.converters["record"](t,e,r)}throw Pa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};djn.exports={fill:cjn,compareHeaderName:ljn,Headers:w2,HeadersList:Sst,getHeadersGuard:ujn,setHeadersGuard:RMs,setHeadersList:kMs,getHeadersList:Tst}});var i2e=I((guf,bjn)=>{"use strict";p();var{Headers:Ajn,HeadersList:fjn,fill:PMs,getHeadersGuard:DMs,setHeadersGuard:yjn,setHeadersList:Ejn}=zZ(),{extractBody:pjn,cloneBody:NMs,mixinBody:MMs,streamRegistry:_jn,bodyUnusable:OMs}=ape(),vjn=Po(),hjn=require("node:util"),{kEnumerableProperty:TT}=vjn,{isValidReasonPhrase:LMs,isCancelled:BMs,isAborted:FMs,isErrorLike:UMs,environmentSettingsObject:QMs}=ET(),{redirectStatusSet:qMs,nullBodyStatus:jMs}=APe(),{webidl:ra}=$A(),{URLSerializer:mjn}=Mw(),{kConstruct:xst}=al(),sar=require("node:assert"),{isomorphicEncode:HMs,serializeJavascriptValueToJSONString:GMs}=GF(),$Ms=new TextEncoder("utf-8"),IT=class t{static{a(this,"Response")}#e;#t;static error(){return n2e(wst(),"immutable")}static json(e,r=void 0){ra.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ra.converters.ResponseInit(r));let n=$Ms.encode(GMs(e)),o=pjn(n),s=n2e(Rpe({}),"response");return gjn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ra.argumentLengthCheck(arguments,1,"Response.redirect"),e=ra.converters.USVString(e),r=ra.converters["unsigned short"](r);let n;try{n=new URL(e,QMs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!qMs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=n2e(Rpe({}),"immutable");o.#t.status=r;let s=HMs(mjn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(ra.util.markAsUncloneable(this),e===xst)return;e!==null&&(e=ra.converters.BodyInit(e,"Response","body")),r=ra.converters.ResponseInit(r),this.#t=Rpe({}),this.#e=new Ajn(xst),yjn(this.#e,"response"),Ejn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=pjn(e);n={body:o,type:s}}gjn(this,r,n)}get type(){return ra.brandCheck(this,t),this.#t.type}get url(){ra.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":mjn(r,!0)}get redirected(){return ra.brandCheck(this,t),this.#t.urlList.length>1}get status(){return ra.brandCheck(this,t),this.#t.status}get ok(){return ra.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return ra.brandCheck(this,t),this.#t.statusText}get headers(){return ra.brandCheck(this,t),this.#e}get body(){return ra.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return ra.brandCheck(this,t),!!this.#t.body&&vjn.isDisturbed(this.#t.body.stream)}clone(){if(ra.brandCheck(this,t),OMs(this.#t))throw ra.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=aar(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&_jn.register(this,new WeakRef(this.#t.body.stream)),n2e(e,DMs(this.#e))}[hjn.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 ${hjn.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:VMs,setResponseHeaders:WMs,getResponseState:YZ,setResponseState:zMs}=IT;Reflect.deleteProperty(IT,"getResponseHeaders");Reflect.deleteProperty(IT,"setResponseHeaders");Reflect.deleteProperty(IT,"getResponseState");Reflect.deleteProperty(IT,"setResponseState");MMs(IT,YZ);Object.defineProperties(IT.prototype,{type:TT,url:TT,status:TT,ok:TT,redirected:TT,statusText:TT,headers:TT,clone:TT,body:TT,bodyUsed:TT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(IT,{json:TT,redirect:TT,error:TT});function aar(t){if(t.internalResponse)return Cjn(aar(t.internalResponse),t.type);let e=Rpe({...t,body:null});return t.body!=null&&(e.body=NMs(t.body)),e}a(aar,"cloneResponse");function Rpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new fjn(t?.headersList):new fjn,urlList:t?.urlList?[...t.urlList]:[]}}a(Rpe,"makeResponse");function wst(t){let e=UMs(t);return Rpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(wst,"makeNetworkError");function YMs(t){return t.type==="error"&&t.status===0}a(YMs,"isNetworkError");function Ist(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 sar(!(n in e)),r[n]=o,!0}})}a(Ist,"makeFilteredResponse");function Cjn(t,e){if(e==="basic")return Ist(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Ist(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Ist(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Ist(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});sar(!1)}a(Cjn,"filterResponse");function KMs(t,e=null){return sar(BMs(t)),FMs(t)?wst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):wst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(KMs,"makeAppropriateNetworkError");function gjn(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&&!LMs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(YZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(YZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&PMs(VMs(t),e.headers),r){if(jMs.includes(t.status))throw ra.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});YZ(t).body=r.body,r.type!=null&&!YZ(t).headersList.contains("content-type",!0)&&YZ(t).headersList.append("content-type",r.type,!0)}}a(gjn,"initializeResponse");function n2e(t,e){let r=new IT(xst);zMs(r,t);let n=new Ajn(xst);return WMs(r,n),Ejn(n,t.headersList),yjn(n,e),t.urlList.length!==0&&t.body?.stream&&_jn.register(r,new WeakRef(t.body.stream)),r}a(n2e,"fromInnerResponse");ra.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ra.converters.USVString(t,e,r):ra.is.Blob(t)||ra.is.BufferSource(t)||ra.is.FormData(t)||ra.is.URLSearchParams(t)?t:ra.converters.DOMString(t,e,r)};ra.converters.BodyInit=function(t,e,r){return ra.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:ra.converters.XMLHttpRequestBodyInit(t,e,r)};ra.converters.ResponseInit=ra.dictionaryConverter([{key:"status",converter:ra.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ra.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ra.converters.HeadersInit}]);ra.is.Response=ra.util.MakeTypeAssertion(IT);bjn.exports={isNetworkError:YMs,makeNetworkError:wst,makeResponse:Rpe,makeAppropriateNetworkError:KMs,filterResponse:Cjn,Response:IT,cloneResponse:aar,fromInnerResponse:n2e,getResponseState:YZ}});var kpe=I((Euf,Bjn)=>{"use strict";p();var{extractBody:JMs,mixinBody:ZMs,cloneBody:XMs,bodyUnusable:Sjn}=ape(),{Headers:kjn,fill:eOs,HeadersList:Pst,setHeadersGuard:car,getHeadersGuard:tOs,setHeadersList:Pjn,getHeadersList:Tjn}=zZ(),kst=Po(),Ijn=require("node:util"),{isValidHTTPToken:rOs,sameOrigin:xjn,environmentSettingsObject:Rst}=ET(),{forbiddenMethodsSet:nOs,corsSafeListedMethodsSet:iOs,referrerPolicy:oOs,requestRedirect:sOs,requestMode:aOs,requestCredentials:cOs,requestCache:lOs,requestDuplex:uOs}=APe(),{kEnumerableProperty:um,normalizedMethodRecordsBase:dOs,normalizedMethodRecords:fOs}=kst,{webidl:Li}=$A(),{URLSerializer:pOs}=Mw(),{kConstruct:Dst}=al(),hOs=require("node:assert"),{getMaxListeners:Djn,setMaxListeners:mOs,defaultMaxListeners:gOs}=require("node:events"),AOs=Symbol("abortController"),Njn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Nst=new WeakMap,lar;try{lar=Djn(new AbortController().signal)>0}catch{lar=!1}function wjn(t){return e;function e(){let r=t.deref();if(r!==void 0){Njn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Nst.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()}Nst.delete(r.signal)}}}}a(wjn,"buildAbort");var Rjn=!1,Ab=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Li.util.markAsUncloneable(this),e===Dst)return;Li.argumentLengthCheck(arguments,1,"Request constructor"),e=Li.converters.RequestInfo(e),r=Li.converters.RequestInit(r);let o=null,s=null,c=Rst.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=Mst({urlList:[_]}),s="cors"}else hOs(Li.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Rst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&xjn(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=Mst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Rst.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&&!xjn(v,Rst.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 Li.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=fOs[_];if(v!==void 0)o.method=v;else{if(!rOs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(nOs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=dOs[b]??_,o.method=_}!Rjn&&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"}),Rjn=!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[AOs]=m;let _=new WeakRef(m),v=wjn(_);lar&&Djn(l)===gOs&&mOs(1500,l),kst.addAbortListener(l,v),Njn.register(m,{signal:l,abort:v},v)}if(this.#r=new kjn(Dst),Pjn(this.#r,o.headersList),car(this.#r,"request"),h==="no-cors"){if(!iOs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);car(this.#r,"request-no-cors")}if(f){let _=Tjn(this.#r),v=r.headers!==void 0?r.headers:new Pst(_);if(_.clear(),v instanceof Pst){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else eOs(this.#r,v)}let g=Li.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]=JMs(r.body,o.keepalive);A=_,v&&!Tjn(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(Sjn(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 Li.brandCheck(this,t),this.#n.method}get url(){return Li.brandCheck(this,t),pOs(this.#n.url)}get headers(){return Li.brandCheck(this,t),this.#r}get destination(){return Li.brandCheck(this,t),this.#n.destination}get referrer(){return Li.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Li.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Li.brandCheck(this,t),this.#n.mode}get credentials(){return Li.brandCheck(this,t),this.#n.credentials}get cache(){return Li.brandCheck(this,t),this.#n.cache}get redirect(){return Li.brandCheck(this,t),this.#n.redirect}get integrity(){return Li.brandCheck(this,t),this.#n.integrity}get keepalive(){return Li.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Li.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Li.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Li.brandCheck(this,t),this.#e}get body(){return Li.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Li.brandCheck(this,t),!!this.#n.body&&kst.isDisturbed(this.#n.body.stream)}get duplex(){return Li.brandCheck(this,t),"half"}clone(){if(Li.brandCheck(this,t),Sjn(this.#n))throw new TypeError("unusable");let e=Ojn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Nst.get(this.signal);n===void 0&&(n=new Set,Nst.set(this.signal,n));let o=new WeakRef(r);n.add(o),kst.addAbortListener(r.signal,wjn(o))}return Ljn(e,this.#t,r.signal,tOs(this.#r))}[Ijn.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 ${Ijn.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:yOs,getRequestDispatcher:EOs,setRequestDispatcher:_Os,setRequestHeaders:vOs,getRequestState:Mjn,setRequestState:COs}=Ab;Reflect.deleteProperty(Ab,"setRequestSignal");Reflect.deleteProperty(Ab,"getRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestHeaders");Reflect.deleteProperty(Ab,"getRequestState");Reflect.deleteProperty(Ab,"setRequestState");ZMs(Ab,Mjn);function Mst(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 Pst(t.headersList):new Pst}}a(Mst,"makeRequest");function Ojn(t){let e=Mst({...t,body:null});return t.body!=null&&(e.body=XMs(t.body)),e}a(Ojn,"cloneRequest");function Ljn(t,e,r,n){let o=new Ab(Dst);COs(o,t),_Os(o,e),yOs(o,r);let s=new kjn(Dst);return vOs(o,s),Pjn(s,t.headersList),car(s,n),o}a(Ljn,"fromInnerRequest");Object.defineProperties(Ab.prototype,{method:um,url:um,headers:um,redirect:um,clone:um,signal:um,duplex:um,destination:um,body:um,bodyUsed:um,isHistoryNavigation:um,isReloadNavigation:um,keepalive:um,integrity:um,cache:um,credentials:um,attribute:um,referrerPolicy:um,referrer:um,mode:um,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Li.is.Request=Li.util.MakeTypeAssertion(Ab);Li.converters.RequestInfo=function(t){return typeof t=="string"?Li.converters.USVString(t):Li.is.Request(t)?t:Li.converters.USVString(t)};Li.converters.RequestInit=Li.dictionaryConverter([{key:"method",converter:Li.converters.ByteString},{key:"headers",converter:Li.converters.HeadersInit},{key:"body",converter:Li.nullableConverter(Li.converters.BodyInit)},{key:"referrer",converter:Li.converters.USVString},{key:"referrerPolicy",converter:Li.converters.DOMString,allowedValues:oOs},{key:"mode",converter:Li.converters.DOMString,allowedValues:aOs},{key:"credentials",converter:Li.converters.DOMString,allowedValues:cOs},{key:"cache",converter:Li.converters.DOMString,allowedValues:lOs},{key:"redirect",converter:Li.converters.DOMString,allowedValues:sOs},{key:"integrity",converter:Li.converters.DOMString},{key:"keepalive",converter:Li.converters.boolean},{key:"signal",converter:Li.nullableConverter(t=>Li.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Li.converters.any},{key:"duplex",converter:Li.converters.DOMString,allowedValues:uOs},{key:"dispatcher",converter:Li.converters.any},{key:"priority",converter:Li.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);Bjn.exports={Request:Ab,makeRequest:Mst,fromInnerRequest:Ljn,cloneRequest:Ojn,getRequestDispatcher:EOs,getRequestState:Mjn}});var $jn=I((Cuf,Gjn)=>{"use strict";p();var bOs=require("node:assert"),{runtimeFeatures:Ujn}=$F(),KZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),uar;if(Ujn.has("crypto")){uar=require("node:crypto");let t=uar.getHashes();t.length===0&&KZ.clear();for(let e of KZ.keys())t.includes(e)===!1&&KZ.delete(e)}else KZ.clear();var Fjn=Map.prototype.get.bind(KZ),dar=Map.prototype.has.bind(KZ),SOs=Ujn.has("crypto")===!1||KZ.size===0?()=>!0:(t,e)=>{let r=qjn(e);if(r.length===0)return!0;let n=Qjn(r);for(let o of n){let s=o.alg,c=o.val,l=jjn(s,t);if(Hjn(l,c))return!0}return!1};function Qjn(t){let e=[],r=null;for(let n of t){if(bOs(dar(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=Fjn(o),c=n.alg,l=Fjn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(Qjn,"getStrongestMetadata");function qjn(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(!dar(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(qjn,"parseMetadata");var jjn=a((t,e)=>uar.hash(t,e,"base64"),"applyAlgorithmToBytes");function Hjn(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:ll,makeAppropriateNetworkError:o2e,filterResponse:far,makeResponse:Ost,fromInnerResponse:TOs,getResponseState:IOs}=i2e(),{HeadersList:par}=zZ(),{Request:xOs,cloneRequest:wOs,getRequestDispatcher:ROs,getRequestState:kOs}=kpe(),R2=require("node:zlib"),{makePolicyContainer:POs,clonePolicyContainer:DOs,requestBadPort:NOs,TAOCheck:MOs,appendRequestOriginHeader:OOs,responseLocationURL:LOs,requestCurrentURL:xT,setRequestReferrerPolicyOnRedirect:BOs,tryUpgradeRequestToAPotentiallyTrustworthyURL:FOs,createOpaqueTimingInfo:Ear,appendFetchMetadata:UOs,corsCheck:QOs,crossOriginResourcePolicyCheck:qOs,determineRequestsReferrer:jOs,coarsenedSharedCurrentTime:s2e,sameOrigin:Aar,isCancelled:rH,isAborted:Vjn,isErrorLike:HOs,fullyReadBody:GOs,readableStreamClose:$Os,urlIsLocal:VOs,urlIsHttpHttpsScheme:Ust,urlHasHttpsScheme:WOs,clampAndCoarsenConnectionTimingInfo:zOs,simpleRangeHeaderValue:YOs,buildContentRange:KOs,createInflate:JOs,extractMimeType:ZOs,hasAuthenticationEntry:XOs,includesCredentials:Wjn,isTraversableNavigable:e5s}=ET(),JZ=require("node:assert"),{safelyExtractBody:Qst,extractBody:zjn}=ape(),{redirectStatusSet:Zjn,nullBodyStatus:Xjn,safeMethodsSet:t5s,requestBodyHeader:r5s,subresourceSet:n5s}=APe(),i5s=require("node:events"),{Readable:o5s,pipeline:s5s,finished:a5s,isErrored:c5s,isReadable:Lst}=require("node:stream"),{addAbortListener:l5s,bufferToLowerCasedHeaderName:Yjn}=Po(),{dataURLProcessor:u5s,serializeAMimeType:d5s,minimizeSupportedMimeType:f5s}=Mw(),{getGlobalDispatcher:p5s}=_st(),{webidl:_ar}=$A(),{STATUS_CODES:Kjn}=require("node:http"),{bytesMatch:h5s}=$jn(),{createDeferredPromise:m5s}=CPe(),{isomorphicEncode:Bst}=GF(),{runtimeFeatures:g5s}=$F(),A5s=g5s.has("zstd"),y5s=["GET","HEAD"],E5s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",har,Fst=class extends i5s{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 _5s(t){eHn(t,"fetch")}a(_5s,"handleFetchDone");function v5s(t,e=void 0){_ar.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=m5s(),n;try{n=new xOs(t,e)}catch(f){return r.reject(f),r.promise}let o=kOs(n);if(n.signal.aborted)return mar(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 l5s(n.signal,()=>{l=!0,JZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();mar(r,o,f,n.signal.reason,u.controller)}),u=rHn({request:o,processResponseEndOfBody:_5s,processResponse:a(f=>{if(!l){if(f.aborted){mar(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(TOs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:ROs(n),requestObject:n}),r.promise}a(v5s,"fetch");function eHn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Ust(r)&&n!==null&&(t.timingAllowPassed||(n=Ear({startTime:n.startTime}),o=""),n.endTime=s2e(),t.timingInfo=n,tHn(n,r.href,e,globalThis,o,"",t.status))}a(eHn,"finalizeAndReportTiming");var tHn=performance.markResourceTiming;function mar(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&Lst(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=IOs(r);s.body?.stream!=null&&Lst(s.body.stream)&&o.error(n)}a(mar,"abortFetch");function rHn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=p5s(),requestObject:u=null}){JZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=s2e(f),m=Ear({startTime:h}),g={controller:new Fst(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return JZ(!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=DOs(t.client.policyContainer):t.policyContainer=POs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,n5s.has(t.destination),nHn(g,!1),g.controller}a(rHn,"fetching");async function nHn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!VOs(xT(r))&&(n=ll("local URLs only")),FOs(r),NOs(r)==="blocked"&&(n=ll("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=jOs(r)),n===null){let s=xT(r);Aar(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await Jjn(t)):r.mode==="same-origin"?n=ll('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ll('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await Jjn(t)):Ust(xT(r))?(r.responseTainting="cors",n=await iHn(t)):n=ll("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=far(n,"basic"):r.responseTainting==="cors"?n=far(n,"cors"):r.responseTainting==="opaque"?n=far(n,"opaque"):JZ(!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=ll()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||Xjn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>gar(t,ll(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!h5s(l,r.integrity)){s("integrity mismatch");return}n.body=Qst(l)[0],gar(t,n)},"processBody");GOs(n.body,c,s)}else gar(t,n)}catch(r){t.controller.terminate(r)}}a(nHn,"mainFetch");function Jjn(t){if(rH(t)&&t.request.redirectCount===0)return Promise.resolve(o2e(t));let{request:e}=t,{protocol:r}=xT(e);switch(r){case"about:":return Promise.resolve(ll("about scheme is not supported"));case"blob:":{har||(har=require("node:buffer").resolveObjectURL);let n=xT(e);if(n.search.length!==0)return Promise.resolve(ll("NetworkError when attempting to fetch resource."));let o=har(n.toString());if(e.method!=="GET"||!_ar.is.Blob(o))return Promise.resolve(ll("invalid method"));let s=Ost(),c=o.size,l=Bst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=YOs(d,!0);if(f==="failure")return Promise.resolve(ll("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(ll("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=zjn(g);s.body=A[0];let y=Bst(`${g.size}`),E=KOs(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=zjn(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=xT(e),o=u5s(n);if(o==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let s=d5s(o.mimeType);return Promise.resolve(Ost({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Qst(o.body)[0]}))}case"file:":return Promise.resolve(ll("not implemented... yet..."));case"http:":case"https:":return iHn(t).catch(n=>ll(n));default:return Promise.resolve(ll("unknown scheme"))}}a(Jjn,"schemeFetch");function C5s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(C5s,"finalizeResponse");function gar(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Ust(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Ear(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=ZOs(e.headersList);f!=="failure"&&(u.contentType=f5s(f))}t.request.initiatorType!=null&&tHn(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():a5s(o.body.stream,()=>{n()})}a(gar,"fetchFinale");async function iHn(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 yar(t),e.responseTainting==="cors"&&QOs(e,r)==="failure")return ll("cors failure");MOs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&qOs(e.origin,e.client,e.destination,n)==="blocked"?ll("blocked"):(Zjn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ll("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await b5s(t,r):JZ(!1)),r.timingInfo=o,r)}a(iHn,"httpFetch");function b5s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=LOs(n,xT(r).hash),o==null)return e}catch(c){return Promise.resolve(ll(c))}if(!Ust(o))return Promise.resolve(ll("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ll("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Aar(r,o))return Promise.resolve(ll('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ll('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ll());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!y5s.includes(r.method)){r.method="GET",r.body=null;for(let c of r5s)r.headersList.delete(c)}Aar(xT(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&&(JZ(r.body.source!=null),r.body=Qst(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=s2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),BOs(r,n),nHn(t,!0)}a(b5s,"httpRedirectFetch");async function yar(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=wOs(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=Bst(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,_ar.is.URL(s.referrer)&&s.headersList.append("referer",Bst(s.referrer.href),!0),OOs(s),UOs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",E5s,!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)||(WOs(xT(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(!(XOs(s)&&(s.useURLCredentials===void 0||!Wjn(xT(s))))){if(Wjn(xT(s))&&e){let{username:g,password:A}=xT(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 ll("only if cached");let m=await S5s(o,d,r);!t5s.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||e5s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Qst(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return rH(t)?o2e(t):c;t.controller.connection.destroy(),c=await yar(t,!0)}if(c.status===407)return n.window==="no-window"?ll():rH(t)?o2e(t):ll("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(rH(t))return o2e(t);t.controller.connection.destroy(),c=await yar(t,e,!0)}return c}a(yar,"httpNetworkOrCacheFetch");async function S5s(t,e=!1,r=!1){JZ(!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*(_){rH(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{rH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{rH(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=Ost({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Ost({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),o2e(t,A)):ll(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{rH(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(Vjn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){$Os(t.controller.controller),C5s(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),c5s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){Vjn(t)?(o.aborted=!0,Lst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Lst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:HOs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=xT(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=zOs(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=s2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=s2e(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new par;for(let M=0;Mj)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${j}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")B.push(R2.createGunzip({flush:R2.constants.Z_SYNC_FLUSH,finishFlush:R2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(JOs({flush:R2.constants.Z_SYNC_FLUSH,finishFlush:R2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(R2.createBrotliDecompress({flush:R2.constants.BROTLI_OPERATION_FLUSH,finishFlush:R2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&A5s)B.push(R2.createZstdDecompress({flush:R2.constants.ZSTD_e_continue,finishFlush:R2.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:B.length?s5s(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,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new par;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:Kjn[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 par;for(let D=0;D{"use strict";p();var T5s=require("node:assert"),{URLSerializer:sHn}=Mw(),{isValidHeaderName:I5s}=ET();function x5s(t,e,r=!1){let n=sHn(t,r),o=sHn(e,r);return n===o}a(x5s,"urlEquals");function w5s(t){T5s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),I5s(r)&&e.push(r);return e}a(w5s,"getFieldValues");aHn.exports={urlEquals:x5s,getFieldValues:w5s}});var fHn=I((Puf,dHn)=>{"use strict";p();var Car=require("node:assert"),{kConstruct:R5s}=al(),{urlEquals:k5s,getFieldValues:bar}=cHn(),{kEnumerableProperty:ZZ,isDisturbed:P5s}=Po(),{webidl:Xn}=$A(),{cloneResponse:lHn,fromInnerResponse:D5s,getResponseState:N5s}=i2e(),{Request:c2e,fromInnerRequest:M5s,getRequestState:Q5}=kpe(),{fetching:O5s}=a2e(),{urlIsHttpHttpsScheme:qst,readAllBytes:L5s}=ET(),{createDeferredPromise:Ppe}=CPe(),jst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==R5s&&Xn.illegalConstructor(),Xn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Xn.brandCheck(this,t);let n="Cache.match";Xn.argumentLengthCheck(arguments,1,n),e=Xn.converters.RequestInfo(e),r=Xn.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={}){Xn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Xn.converters.RequestInfo(e)),r=Xn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Xn.brandCheck(this,t),Xn.argumentLengthCheck(arguments,1,"Cache.add"),e=Xn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Xn.brandCheck(this,t);let r="Cache.addAll";Xn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Xn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Xn.converters.RequestInfo(m),typeof m=="string")continue;let g=Q5(m);if(!qst(g.url)||g.method!=="GET")throw Xn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=Q5(new c2e(m));if(!qst(g.url))throw Xn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Ppe();s.push(O5s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Xn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=bar(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Xn.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=Ppe(),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){Xn.brandCheck(this,t);let n="Cache.put";Xn.argumentLengthCheck(arguments,2,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.Response(r,n,"response");let o=null;if(Xn.is.Request(e)?o=Q5(e):o=Q5(new c2e(e)),!qst(o.url)||o.method!=="GET")throw Xn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=N5s(r);if(s.status===206)throw Xn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=bar(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Xn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(P5s(s.body.stream)||s.body.stream.locked))throw Xn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=lHn(s),l=Ppe();if(s.body!=null){let A=s.body.stream.getReader();L5s(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=Ppe(),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={}){Xn.brandCheck(this,t);let n="Cache.delete";Xn.argumentLengthCheck(arguments,1,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Car(typeof e=="string"),o=Q5(new c2e(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Ppe(),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={}){Xn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Xn.converters.RequestInfo(e)),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(e)));let s=Ppe(),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=M5s(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 Xn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Xn.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);Car(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!qst(u.url))throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Xn.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);Car(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=""),!k5s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=bar(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(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(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=D5s(lHn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(jst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:ZZ,matchAll:ZZ,add:ZZ,addAll:ZZ,put:ZZ,delete:ZZ,keys:ZZ});var uHn=[{key:"ignoreSearch",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Xn.converters.CacheQueryOptions=Xn.dictionaryConverter(uHn);Xn.converters.MultiCacheQueryOptions=Xn.dictionaryConverter([...uHn,{key:"cacheName",converter:Xn.converters.DOMString}]);Xn.converters.Response=Xn.interfaceConverter(Xn.is.Response,"Response");Xn.converters["sequence"]=Xn.sequenceConverter(Xn.converters.RequestInfo);dHn.exports={Cache:jst}});var hHn=I((Muf,pHn)=>{"use strict";p();var{Cache:Hst}=fHn(),{webidl:CE}=$A(),{kEnumerableProperty:l2e}=Po(),{kConstruct:u2e}=al(),Gst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==u2e&&CE.illegalConstructor(),CE.util.markAsUncloneable(this)}async match(e,r={}){if(CE.brandCheck(this,t),CE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=CE.converters.RequestInfo(e),r=CE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Hst(u2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Hst(u2e,n).match(e,r);if(s!==void 0)return s}}async has(e){CE.brandCheck(this,t);let r="CacheStorage.has";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){CE.brandCheck(this,t);let r="CacheStorage.open";if(CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Hst(u2e,o)}let n=[];return this.#e.set(e,n),new Hst(u2e,n)}async delete(e){CE.brandCheck(this,t);let r="CacheStorage.delete";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return CE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Gst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:l2e,has:l2e,open:l2e,delete:l2e,keys:l2e});pHn.exports={CacheStorage:Gst}});var gHn=I((Buf,mHn)=>{"use strict";p();mHn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Sar=I((Uuf,vHn)=>{"use strict";p();function B5s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(B5s,"isCTLExcludingHtab");function AHn(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(AHn,"validateCookieName");function yHn(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(yHn,"validateCookieValue");function EHn(t){for(let e=0;ee.toString().padStart(2,"0"));function _Hn(t){return typeof t=="number"&&(t=new Date(t)),`${U5s[t.getUTCDay()]}, ${$st[t.getUTCDate()]} ${Q5s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${$st[t.getUTCHours()]}:${$st[t.getUTCMinutes()]}:${$st[t.getUTCSeconds()]} GMT`}a(_Hn,"toIMFDate");function q5s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(q5s,"validateCookieMaxAge");function j5s(t){if(t.name.length===0)return null;AHn(t.name),yHn(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"&&(q5s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(F5s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(EHn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${_Hn(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(j5s,"stringify");vHn.exports={isCTLExcludingHtab:B5s,validateCookieName:AHn,validateCookiePath:EHn,validateCookieValue:yHn,toIMFDate:_Hn,stringify:j5s}});var bHn=I((juf,CHn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Vst}=GF(),{maxNameValuePairSize:H5s,maxAttributeValueSize:G5s}=gHn(),{isCTLExcludingHtab:$5s}=Sar(),V5s=require("node:assert");function W5s(t){if($5s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Vst(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Vst("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>H5s?null:{name:n,value:o,...Dpe(r)}}a(W5s,"parseSetCookie");function Dpe(t,e={}){if(t.length===0)return e;V5s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Vst(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Vst("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>G5s)return Dpe(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 Dpe(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=o.toLowerCase();c==="none"?e.sameSite="None":c==="strict"?e.sameSite="Strict":c==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Dpe(t,e)}a(Dpe,"parseUnparsedAttributes");CHn.exports={parseSetCookie:W5s,parseUnparsedAttributes:Dpe}});var xHn=I(($uf,IHn)=>{"use strict";p();var{parseSetCookie:SHn}=bHn(),{stringify:z5s}=Sar(),{webidl:Ya}=$A(),{Headers:Y5s}=zZ(),Wst=Ya.brandCheckMultiple([Y5s,globalThis.Headers].filter(Boolean));function K5s(t){Ya.argumentLengthCheck(arguments,1,"getCookies"),Wst(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(K5s,"getCookies");function J5s(t,e,r){Wst(t);let n="deleteCookie";Ya.argumentLengthCheck(arguments,2,n),e=Ya.converters.DOMString(e,n,"name"),r=Ya.converters.DeleteCookieAttributes(r),THn(t,{name:e,value:"",expires:new Date(0),...r})}a(J5s,"deleteCookie");function Z5s(t){Ya.argumentLengthCheck(arguments,1,"getSetCookies"),Wst(t);let e=t.getSetCookie();return e?e.map(r=>SHn(r)):[]}a(Z5s,"getSetCookies");function X5s(t){return t=Ya.converters.DOMString(t),SHn(t)}a(X5s,"parseCookie");function THn(t,e){Ya.argumentLengthCheck(arguments,2,"setCookie"),Wst(t),e=Ya.converters.Cookie(e);let r=z5s(e);r&&t.append("set-cookie",r,!0)}a(THn,"setCookie");Ya.converters.DeleteCookieAttributes=Ya.dictionaryConverter([{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ya.converters.Cookie=Ya.dictionaryConverter([{converter:Ya.converters.DOMString,key:"name"},{converter:Ya.converters.DOMString,key:"value"},{converter:Ya.nullableConverter(t=>typeof t=="number"?Ya.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ya.sequenceConverter(Ya.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);IHn.exports={getCookies:K5s,deleteCookie:J5s,getSetCookies:Z5s,setCookie:THn,parseCookie:X5s}});var Kst=I((zuf,RHn)=>{"use strict";p();var{webidl:li}=$A(),{kEnumerableProperty:yb}=Po(),{kConstruct:wHn}=al(),Npe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===wHn){super(arguments[1],arguments[2]),li.util.markAsUncloneable(this);return}let n="MessageEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get data(){return li.brandCheck(this,t),this.#e.data}get origin(){return li.brandCheck(this,t),this.#e.origin}get lastEventId(){return li.brandCheck(this,t),this.#e.lastEventId}get source(){return li.brandCheck(this,t),this.#e.source}get ports(){return li.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 li.brandCheck(this,t),li.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(wHn,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:e4s}=Npe;delete Npe.createFastMessageEvent;var zst=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.CloseEventInit(r),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get wasClean(){return li.brandCheck(this,t),this.#e.wasClean}get code(){return li.brandCheck(this,t),this.#e.code}get reason(){return li.brandCheck(this,t),this.#e.reason}},Yst=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";li.argumentLengthCheck(arguments,1,n),super(e,r),li.util.markAsUncloneable(this),e=li.converters.DOMString(e,n,"type"),r=li.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return li.brandCheck(this,t),this.#e.message}get filename(){return li.brandCheck(this,t),this.#e.filename}get lineno(){return li.brandCheck(this,t),this.#e.lineno}get colno(){return li.brandCheck(this,t),this.#e.colno}get error(){return li.brandCheck(this,t),this.#e.error}};Object.defineProperties(Npe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:yb,origin:yb,lastEventId:yb,source:yb,ports:yb,initMessageEvent:yb});Object.defineProperties(zst.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:yb,code:yb,wasClean:yb});Object.defineProperties(Yst.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:yb,filename:yb,lineno:yb,colno:yb,error:yb});li.converters.MessagePort=li.interfaceConverter(li.is.MessagePort,"MessagePort");li.converters["sequence"]=li.sequenceConverter(li.converters.MessagePort);var Tar=[{key:"bubbles",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];li.converters.MessageEventInit=li.dictionaryConverter([...Tar,{key:"data",converter:li.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:li.nullableConverter(li.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:li.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);li.converters.CloseEventInit=li.dictionaryConverter([...Tar,{key:"wasClean",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:li.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);li.converters.ErrorEventInit=li.dictionaryConverter([...Tar,{key:"message",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:li.converters.any}]);RHn.exports={MessageEvent:Npe,CloseEvent:zst,ErrorEvent:Yst,createFastMessageEvent:e4s}});var nH=I((Juf,kHn)=>{"use strict";p();var t4s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",r4s={enumerable:!0,writable:!1,configurable:!1},n4s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},i4s={SENT:1,RECEIVED:2},o4s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},s4s=65535,a4s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},c4s=Buffer.allocUnsafe(0),l4s={text:1,typedArray:2,arrayBuffer:3,blob:4};kHn.exports={uid:t4s,sentCloseFrameState:i4s,staticPropertyDescriptors:r4s,states:n4s,opcodes:o4s,maxUnsigned16Bit:s4s,parserStates:a4s,emptyBuffer:c4s,sendHints:l4s}});var XZ=I((Xuf,OHn)=>{"use strict";p();var{states:Jst,opcodes:Mpe}=nH(),{isUtf8:u4s}=require("node:buffer"),{removeHTTPWhitespace:PHn}=Mw(),{collectASequenceOfCodePointsFast:d4s}=GF();function f4s(t){return t===Jst.CONNECTING}a(f4s,"isConnecting");function p4s(t){return t===Jst.OPEN}a(p4s,"isEstablished");function h4s(t){return t===Jst.CLOSING}a(h4s,"isClosing");function m4s(t){return t===Jst.CLOSED}a(m4s,"isClosed");function g4s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(g4s,"fireEvent");function A4s(t,e,r){t.onMessage(e,r)}a(A4s,"websocketMessageReceived");function y4s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(y4s,"toArrayBuffer");function E4s(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(E4s,"isValidSubprotocol");function _4s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(_4s,"isValidStatusCode");function DHn(t){return t===Mpe.CLOSE||t===Mpe.PING||t===Mpe.PONG}a(DHn,"isControlFrame");function NHn(t){return t===Mpe.CONTINUATION}a(NHn,"isContinuationFrame");function MHn(t){return t===Mpe.TEXT||t===Mpe.BINARY}a(MHn,"isTextBinaryFrame");function v4s(t){return MHn(t)||NHn(t)||DHn(t)}a(v4s,"isValidOpcode");function C4s(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(b4s,"isValidClientWindowBits");function S4s(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(S4s,"getURLRecord");function T4s(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(T4s,"validateCloseCodeAndReason");var I4s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(u4s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();OHn.exports={isConnecting:f4s,isEstablished:p4s,isClosing:h4s,isClosed:m4s,fireEvent:g4s,isValidSubprotocol:E4s,isValidStatusCode:_4s,websocketMessageReceived:A4s,utf8Decode:I4s,isControlFrame:DHn,isContinuationFrame:NHn,isTextBinaryFrame:MHn,isValidOpcode:v4s,parseExtensions:C4s,isValidClientWindowBits:b4s,toArrayBuffer:y4s,getURLRecord:S4s,validateCloseCodeAndReason:T4s}});var Lpe=I((rdf,BHn)=>{"use strict";p();var{runtimeFeatures:x4s}=$F(),{maxUnsigned16Bit:LHn,opcodes:w4s}=nH(),Zst=8*1024,d2e=null,Ope=Zst,R4s=x4s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oLHn?(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;uLHn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|w4s.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]}};BHn.exports={WebsocketFrameSend:xar,generateMask:Iar}});var Xst=I((odf,HHn)=>{"use strict";p();var{uid:k4s,states:war,sentCloseFrameState:Rar,emptyBuffer:FHn,opcodes:P4s}=nH(),{parseExtensions:D4s,isClosed:N4s,isClosing:M4s,isEstablished:qHn,isConnecting:O4s,validateCloseCodeAndReason:L4s}=XZ(),{makeRequest:B4s}=kpe(),{fetching:F4s}=a2e(),{Headers:U4s,getHeadersList:Q4s}=zZ(),{getDecodeSplit:q4s}=ET(),{WebsocketFrameSend:j4s}=Lpe(),H4s=require("node:assert"),{runtimeFeatures:G4s}=$F(),UHn=G4s.has("crypto")?require("node:crypto"):null,QHn=!1;function $4s(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=B4s({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=Q4s(new U4s(o.headers));c.headersList=f}let l=UHn.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),F4s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){q5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){q5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(QHn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),QHn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){q5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){q5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){q5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=UHn.hash("sha1",l+k4s,"base64");if(h!==m){q5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=D4s(g),!A.has("permessage-deflate"))){q5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!q4s("sec-websocket-protocol",c.headersList).includes(y)){q5(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($4s,"establishWebSocketConnection");function jHn(t,e,r,n=!1){if(e??=null,r??="",n&&L4s(e,r),!(N4s(t.readyState)||M4s(t.readyState)))if(!qHn(t.readyState))q5(t),t.readyState=war.CLOSING;else if(!t.closeState.has(Rar.SENT)&&!t.closeState.has(Rar.RECEIVED)){let o=new j4s;r.length!==0&&e===null&&(e=1e3),H4s(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=FHn: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=FHn,t.socket.write(o.createFrame(P4s.CLOSE)),t.closeState.add(Rar.SENT),t.readyState=war.CLOSING}else t.readyState=war.CLOSING}a(jHn,"closeWebSocketConnection");function q5(t,e,r,n){qHn(t.readyState)&&jHn(t,e,r,!1),t.controller.abort(),O4s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(q5,"failWebsocketConnection");HHn.exports={establishWebSocketConnection:$4s,failWebsocketConnection:q5,closeWebSocketConnection:jHn}});var $Hn=I((cdf,GHn)=>{"use strict";p();var{createInflateRaw:V4s,Z_DEFAULT_WINDOWBITS:W4s}=require("node:zlib"),{isValidClientWindowBits:z4s}=XZ(),{MessageSizeExceededError:Y4s}=ao(),K4s=Buffer.from([0,0,255,255]),eat=Symbol("kBuffer"),f2e=Symbol("kLength"),kar=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=0;constructor(e,r){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#r=r.maxPayloadSize}decompress(e,r,n){if(!this.#e){let o=W4s;if(this.#t.serverMaxWindowBits){if(!z4s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=V4s({windowBits:o})}catch(s){n(s);return}this.#e[eat]=[],this.#e[f2e]=0,this.#e.on("data",s=>{if(this.#e[f2e]+=s.length,this.#r>0&&this.#e[f2e]>this.#r){n(new Y4s),this.#e.removeAllListeners(),this.#e=null;return}this.#e[eat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(K4s),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[eat],this.#e[f2e]);this.#e[eat].length=0,this.#e[f2e]=0,n(null,o)})}};GHn.exports={PerMessageDeflate:kar}});var Mar=I((ddf,KHn)=>{"use strict";p();var{Writable:J4s}=require("node:stream"),Z4s=require("node:assert"),{parserStates:Eb,opcodes:Bpe,states:X4s,emptyBuffer:VHn,sentCloseFrameState:p2e}=nH(),{isValidStatusCode:eLs,isValidOpcode:tLs,websocketMessageReceived:WHn,utf8Decode:rLs,isControlFrame:Par,isTextBinaryFrame:Dar,isContinuationFrame:nLs}=XZ(),{failWebsocketConnection:bE}=Xst(),{WebsocketFrameSend:zHn}=Lpe(),{PerMessageDeflate:iLs}=$Hn(),{MessageSizeExceededError:YHn}=ao(),Nar=class extends J4s{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Eb.INFO;#o={};#s=[];#a;#c;#u;#l;constructor(e,r,n={}){super(),this.#c=e,this.#a=r??new Map,this.#u=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new iLs(r,n))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}#p(){return this.#l>0&&!Par(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(bE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Eb.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!==Bpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!tLs(o))return bE(this.#c,1002,"Invalid opcode received"),e();if(s)return bE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){bE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){bE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Dar(o)){bE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Dar(o)&&this.#s.length>0){bE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){bE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&Par(o)){bE(this.#c,1002,"Control frame either too large or fragmented");return}if(nLs(o)&&this.#s.length===0&&!this.#o.compressed){bE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Eb.READ_DATA,!this.#p())return}else l===126?this.#i=Eb.PAYLOADLENGTH_16:l===127&&(this.#i=Eb.PAYLOADLENGTH_64);Dar(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===Eb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.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){bE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.READ_DATA){if(this.#r{if(n){let s=n instanceof YHn?1009:1007;bE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){bE(this.#c,1009,new YHn().message);return}if(!this.#o.fin){this.#i=Eb.INFO,this.#n=!0,this.run(e);return}WHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Eb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&WHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Eb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return VHn;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){return this.#u>0&&this.#s.length===this.#u?(bE(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#s.push(e),!0)}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&&!eLs(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=rLs(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===Bpe.CLOSE){if(n===1)return bE(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 bE(this.#c,o,s),!1}if(!this.#c.closeState.has(p2e.SENT)&&!this.#c.closeState.has(p2e.RECEIVED)){let o=VHn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new zHn(o);this.#c.socket.write(s.createFrame(Bpe.CLOSE)),this.#c.closeState.add(p2e.SENT)}return this.#c.readyState=X4s.CLOSING,this.#c.closeState.add(p2e.RECEIVED),!1}else if(r===Bpe.PING){if(!this.#c.closeState.has(p2e.RECEIVED)){let o=new zHn(e);this.#c.socket.write(o.createFrame(Bpe.PONG)),this.#c.onPing(e)}}else r===Bpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};KHn.exports={ByteParser:Nar}});var eGn=I((hdf,XHn)=>{"use strict";p();var{WebsocketFrameSend:ZHn}=Lpe(),{opcodes:JHn,sendHints:eX}=nH(),oLs=aor(),Lar=class{static{a(this,"SendQueue")}#e=new oLs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==eX.blob){if(this.#t){let s={promise:null,callback:r,frame:Oar(e,n)};this.#e.push(s)}else if(n===eX.text){let{0:s,1:c}=ZHn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Oar(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Oar(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 Oar(t,e){return new ZHn(sLs(t,e)).createFrame(e===eX.text?JHn.TEXT:JHn.BINARY)}a(Oar,"createFrame");function sLs(t,e){switch(e){case eX.text:case eX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case eX.arrayBuffer:case eX.blob:return new Uint8Array(t)}}a(sLs,"toBuffer");XHn.exports={SendQueue:Lar}});var sGn=I((Adf,oGn)=>{"use strict";p();var{isArrayBuffer:aLs}=require("node:util/types"),{webidl:mi}=$A(),{URLSerializer:cLs}=Mw(),{environmentSettingsObject:tGn}=ET(),{staticPropertyDescriptors:iH,states:r8,sentCloseFrameState:Bar,sendHints:tat,opcodes:Far}=nH(),{isConnecting:lLs,isEstablished:rGn,isClosing:nGn,isClosed:uLs,isValidSubprotocol:dLs,fireEvent:rat,utf8Decode:fLs,toArrayBuffer:pLs,getURLRecord:hLs}=XZ(),{establishWebSocketConnection:mLs,closeWebSocketConnection:gLs,failWebsocketConnection:iGn}=Xst(),{ByteParser:ALs}=Mar(),{kEnumerableProperty:jw}=Po(),{getGlobalDispatcher:yLs}=_st(),{ErrorEvent:ELs,CloseEvent:_Ls,createFastMessageEvent:vLs}=Kst(),{SendQueue:CLs}=eGn(),{WebsocketFrameSend:bLs}=Lpe(),{channels:j5}=Bj();function SLs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(SLs,"getSocketAddress");var dv=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=>iGn(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=r8.CLOSING,j5.socketError.hasSubscribers&&j5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{j5.ping.hasSubscribers&&j5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{j5.pong.hasSubscribers&&j5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:r8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),mi.util.markAsUncloneable(this);let n="WebSocket constructor";mi.argumentLengthCheck(arguments,1,n);let o=mi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=mi.converters.USVString(e),r=o.protocols;let s=tGn.settingsObject.baseUrl,c=hLs(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=>dLs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=tGn.settingsObject;this.#o.controller=mLs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){mi.brandCheck(this,t),e!==void 0&&(e=mi.converters["unsigned short"](e,"WebSocket.close","code",mi.attributes.Clamp)),r!==void 0&&(r=mi.converters.USVString(r)),e??=null,r??="",gLs(this.#o,e,r,!0)}send(e){mi.brandCheck(this,t);let r="WebSocket.send";if(mi.argumentLengthCheck(arguments,1,r),e=mi.converters.WebSocketSendData(e,r,"data"),lLs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!rGn(this.#o.readyState)||nGn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},tat.text)}else aLs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.typedArray)):mi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},tat.blob))}get readyState(){return mi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return mi.brandCheck(this,t),this.#t}get url(){return mi.brandCheck(this,t),cLs(this.#s)}get extensions(){return mi.brandCheck(this,t),this.#n}get protocol(){return mi.brandCheck(this,t),this.#r}get onopen(){return mi.brandCheck(this,t),this.#e.open}set onopen(e){mi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return mi.brandCheck(this,t),this.#e.error}set onerror(e){mi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return mi.brandCheck(this,t),this.#e.close}set onclose(e){mi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return mi.brandCheck(this,t),this.#e.message}set onmessage(e){mi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return mi.brandCheck(this,t),this.#a}set binaryType(e){mi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=this.#o.controller.dispatcher?.webSocketOptions,o=n?.maxFragments,s=n?.maxPayloadSize,c=new ALs(this.#o,r,{maxFragments:o,maxPayloadSize:s});c.on("drain",()=>this.#o.onParserDrain()),c.on("error",d=>this.#o.onParserError(d)),this.#c=c,this.#i=new CLs(e.socket),this.#o.readyState=r8.OPEN;let l=e.headersList.get("sec-websocket-extensions");l!==null&&(this.#n=l);let u=e.headersList.get("sec-websocket-protocol");if(u!==null&&(this.#r=u),rat("open",this),j5.open.hasSubscribers){let d=e.headersList.entries;j5.open.publish({address:SLs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:d}})}}#l(e,r){if(this.#o.readyState!==r8.OPEN)return;let n;if(e===Far.TEXT)try{n=fLs(r)}catch{iGn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Far.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=pLs(r));rat("message",this,vLs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Bar.SENT)&&this.#o.closeState.has(Bar.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=r8.CLOSED,this.#o.closeState.has(Bar.RECEIVED)||(r=1006,rat("error",this,(s,c)=>new ELs(s,c),{error:new TypeError(n)})),rat("close",this,(s,c)=>new _Ls(s,c),{wasClean:e,code:r,reason:n}),j5.close.hasSubscribers&&j5.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(rGn(n)&&!nGn(n)&&!uLs(n)){let o=new bLs(r);e.#o.socket.write(o.createFrame(Far.PING))}}},{ping:TLs}=dv;Reflect.deleteProperty(dv,"ping");dv.CONNECTING=dv.prototype.CONNECTING=r8.CONNECTING;dv.OPEN=dv.prototype.OPEN=r8.OPEN;dv.CLOSING=dv.prototype.CLOSING=r8.CLOSING;dv.CLOSED=dv.prototype.CLOSED=r8.CLOSED;Object.defineProperties(dv.prototype,{CONNECTING:iH,OPEN:iH,CLOSING:iH,CLOSED:iH,url:jw,readyState:jw,bufferedAmount:jw,onopen:jw,onerror:jw,onclose:jw,close:jw,onmessage:jw,binaryType:jw,send:jw,extensions:jw,protocol:jw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(dv,{CONNECTING:iH,OPEN:iH,CLOSING:iH,CLOSED:iH});mi.converters["sequence"]=mi.sequenceConverter(mi.converters.DOMString);mi.converters["DOMString or sequence"]=function(t,e,r){return mi.util.Type(t)===mi.util.Types.OBJECT&&Symbol.iterator in t?mi.converters["sequence"](t):mi.converters.DOMString(t,e,r)};mi.converters.WebSocketInit=mi.dictionaryConverter([{key:"protocols",converter:mi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:mi.converters.any,defaultValue:a(()=>yLs(),"defaultValue")},{key:"headers",converter:mi.nullableConverter(mi.converters.HeadersInit)}]);mi.converters["DOMString or sequence or WebSocketInit"]=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&!(Symbol.iterator in t)?mi.converters.WebSocketInit(t):{protocols:mi.converters["DOMString or sequence"](t)}};mi.converters.WebSocketSendData=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&(mi.is.Blob(t)||mi.is.BufferSource(t))?t:mi.converters.USVString(t)};oGn.exports={WebSocket:dv,ping:TLs}});var Uar=I((_df,lGn)=>{"use strict";p();var{webidl:nat}=$A(),{validateCloseCodeAndReason:ILs}=XZ(),{kConstruct:aGn}=al(),{kEnumerableProperty:cGn}=Po();function xLs(){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(xLs,"createInheritableDOMException");var tX=class t extends xLs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=nat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===aGn)return;r!==null&&(r=nat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";ILs(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,aGn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:wLs}=tX;delete tX.createUnvalidatedWebSocketError;Object.defineProperties(tX.prototype,{closeCode:cGn,reason:cGn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});nat.is.WebSocketError=nat.util.MakeTypeAssertion(tX);lGn.exports={WebSocketError:tX,createUnvalidatedWebSocketError:wLs}});var hGn=I((bdf,pGn)=>{"use strict";p();var{createDeferredPromise:Qar}=CPe(),{environmentSettingsObject:uGn}=ET(),{states:Fpe,opcodes:iat,sentCloseFrameState:Upe}=nH(),{webidl:gp}=$A(),{getURLRecord:RLs,isValidSubprotocol:kLs,isEstablished:PLs,utf8Decode:DLs}=XZ(),{establishWebSocketConnection:NLs,failWebsocketConnection:qar,closeWebSocketConnection:jar}=Xst(),{channels:dGn}=Bj(),{WebsocketFrameSend:MLs}=Lpe(),{ByteParser:OLs}=Mar(),{WebSocketError:LLs,createUnvalidatedWebSocketError:BLs}=Uar(),{kEnumerableProperty:oat}=Po(),{utf8DecodeBytes:FLs}=Iot(),fGn=!1,sat=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=>qar(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=Fpe.CLOSING,dGn.socketError.hasSubscribers&&dGn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Fpe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){fGn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),fGn=!0),gp.argumentLengthCheck(arguments,1,"WebSocket"),e=gp.converters.USVString(e),r!==null&&(r=gp.converters.WebSocketStreamOptions(r));let n=uGn.settingsObject.baseUrl,o=RLs(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=>kLs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Qar(),this.#r=Qar(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{PLs(this.#a.readyState)||(qar(this.#a),this.#a.readyState=Fpe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=uGn.settingsObject;this.#a.controller=NLs(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=gp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;jar(this.#a,r,n,!0)}#u(e){e=gp.converters.WebSocketStreamWrite(e);let r=Qar(),n=null,o=null;if(gp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=iat.BINARY;else{let s;try{s=gp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=iat.TEXT}if(!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)){let s=new MLs(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=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,o=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new OLs(this.#a,r,{maxFragments:n,maxPayloadSize:o});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",f=>this.#a.onParserError(f)),this.#c=s,this.#a.readyState=Fpe.OPEN;let c=r??"",l=e.headersList.get("sec-websocket-protocol")??"",u=new ReadableStream({start:a(f=>{this.#i=f},"start"),cancel:a(f=>this.#h(f),"cancel")}),d=new WritableStream({write:a(f=>this.#u(f),"write"),close:a(()=>jar(this.#a,null,null),"close"),abort:a(f=>this.#A(f),"abort")});this.#n=u,this.#o=d,this.#t.resolve({extensions:c,protocol:l,readable:u,writable:d})}#p(e,r){if(this.#a.readyState!==Fpe.OPEN)return;let n;if(e===iat.TEXT)try{n=DLs(r)}catch{qar(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===iat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Upe.SENT)&&this.#a.closeState.has(Upe.RECEIVED);if(this.#a.readyState=Fpe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new LLs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":FLs(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=BLs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";gp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),jar(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(sat.prototype,{url:oat,opened:oat,closed:oat,close:oat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});gp.converters.WebSocketStreamOptions=gp.dictionaryConverter([{key:"protocols",converter:gp.sequenceConverter(gp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:gp.nullableConverter(gp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);gp.converters.WebSocketCloseInfo=gp.dictionaryConverter([{key:"closeCode",converter:a(t=>gp.converters["unsigned short"](t,gp.attributes.EnforceRange),"converter")},{key:"reason",converter:gp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);gp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?gp.converters.USVString(t):gp.converters.BufferSource(t)};pGn.exports={WebSocketStream:sat}});var gGn=I((Idf,mGn)=>{"use strict";p();function ULs(t){return t.indexOf("\0")===-1}a(ULs,"isValidLastEventId");function QLs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(QLs,"isASCIINumber");mGn.exports={isValidLastEventId:ULs,isASCIINumber:QLs}});var _Gn=I((Rdf,EGn)=>{"use strict";p();var{Transform:qLs}=require("node:stream"),{isASCIINumber:AGn,isValidLastEventId:yGn}=gGn(),n8=[239,187,191],Har=10,aat=13,jLs=58,HLs=32,Gar=class extends qLs{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]===n8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]&&this.buffer[2]===n8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]&&this.buffer[2]===n8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&AGn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&yGn(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}}};EGn.exports={EventSourceStream:Gar}});var wGn=I((Ddf,xGn)=>{"use strict";p();var{pipeline:GLs}=require("node:stream"),{fetching:$Ls}=a2e(),{makeRequest:VLs}=kpe(),{webidl:fv}=$A(),{EventSourceStream:WLs}=_Gn(),{parseMIMEType:zLs}=Mw(),{createFastMessageEvent:YLs}=Kst(),{isNetworkError:vGn}=i2e(),{kEnumerableProperty:rX}=Po(),{environmentSettingsObject:CGn}=ET(),bGn=!1,SGn=3e3,h2e=0,TGn=1,m2e=2,KLs="anonymous",JLs="use-credentials",Qpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=h2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),fv.util.markAsUncloneable(this);let n="EventSource constructor";fv.argumentLengthCheck(arguments,1,n),bGn||(bGn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=fv.converters.USVString(e),r=fv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=CGn,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=KLs;r.withCredentials===!0&&(c=JLs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=CGn.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=VLs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===m2e)return;this.#n=h2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!vGn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(vGn(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?zLs(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=TGn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new WLs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(YLs(u.type,u.options))},"push")});GLs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=$Ls(e)}#u(){this.#n!==m2e&&(this.#n=h2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===h2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){fv.brandCheck(this,t),this.#n!==m2e&&(this.#n=m2e,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=fv.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=fv.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=fv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},IGn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:TGn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:m2e,writable:!1}};Object.defineProperties(Qpe,IGn);Object.defineProperties(Qpe.prototype,IGn);Object.defineProperties(Qpe.prototype,{close:rX,onerror:rX,onmessage:rX,onopen:rX,readyState:rX,url:rX,withCredentials:rX});fv.converters.EventSourceInitDict=fv.dictionaryConverter([{key:"withCredentials",converter:fv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:fv.converters.any},{key:"node",converter:fv.dictionaryConverter([{key:"reconnectionTime",converter:fv.converters["unsigned long"],defaultValue:a(()=>SGn,"defaultValue")},{key:"dispatcher",converter:fv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);xGn.exports={EventSource:Qpe,defaultReconnectionTime:SGn}});var $ar=I((Odf,vn)=>{"use strict";p();var ZLs=Vj(),kGn=mPe(),XLs=NZ(),eBs=RUn(),tBs=NUn(),rBs=LZ(),nBs=Oor(),iBs=Por(),oBs=y7n(),sBs=S7n(),aBs=x7n(),PGn=ao(),lat=Po(),{InvalidArgumentError:cat}=PGn,qpe=cQn(),cBs=CZ(),lBs=_sr(),{MockCallHistory:uBs,MockCallHistoryLog:dBs}=bsr(),fBs=Dsr(),pBs=xsr(),hBs=aqn(),mBs=nsr(),gBs=ost(),{getGlobalDispatcher:DGn,setGlobalDispatcher:ABs}=_st(),yBs=Tpe(),EBs=Qsr();Object.assign(kGn.prototype,qpe);vn.exports.Dispatcher=kGn;vn.exports.Client=ZLs;vn.exports.Pool=XLs;vn.exports.BalancedPool=eBs;vn.exports.RoundRobinPool=tBs;vn.exports.Agent=rBs;vn.exports.ProxyAgent=nBs;vn.exports.Socks5ProxyAgent=iBs;vn.exports.EnvHttpProxyAgent=oBs;vn.exports.RetryAgent=sBs;vn.exports.H2CClient=aBs;vn.exports.RetryHandler=gBs;vn.exports.DecoratorHandler=yBs;vn.exports.RedirectHandler=EBs;vn.exports.interceptors={redirect:yqn(),responseError:_qn(),retry:Cqn(),dump:Sqn(),dns:wqn(),cache:$qn(),decompress:Kqn(),deduplicate:tjn()};vn.exports.cacheStores={MemoryCacheStore:Ysr()};var _Bs=ijn();vn.exports.cacheStores.SqliteCacheStore=_Bs;vn.exports.buildConnector=cBs;vn.exports.errors=PGn;vn.exports.util={parseHeaders:lat.parseHeaders,headerNameToString:lat.headerNameToString};function g2e(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 cat("invalid url");if(r!=null&&typeof r!="object")throw new cat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new cat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(lat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=lat.parseURL(e);let{agent:o,dispatcher:s=DGn()}=r;if(o)throw new cat("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(g2e,"makeDispatcher");vn.exports.setGlobalDispatcher=ABs;vn.exports.getGlobalDispatcher=DGn;var vBs=a2e().fetch,RGn=typeof __filename<"u"?__filename:void 0;function NGn(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,NGn),!o.stack)return;let s=o.stack.split(` + `)}close(){this.#r.close()}get(e){sar(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){sar(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){sar(e),UMs(r);let n=0,o=[],s=this;return new FMs({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(!QMs(o[h],f[h])){d=!1;break}}if(d)return u}}};function QMs(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(QMs,"headerValueEquals")});var KZ=I((Nuf,gjn)=>{"use strict";p();var{kConstruct:qMs}=al(),{kEnumerableProperty:Rpe}=Do(),{iteratorMixin:jMs,isValidHeaderName:o2e,isValidHeaderValue:djn}=vT(),{webidl:Da}=VA(),car=require("node:assert"),Rst=require("node:util");function ujn(t){return t===10||t===13||t===9||t===32}a(ujn,"isHTTPWhiteSpaceCharCode");function fjn(t){let e=0,r=t.length;for(;r>e&&ujn(t.charCodeAt(r-1));)--r;for(;r>e&&ujn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(fjn,"headerValueNormalize");function pjn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(pjn,"fill");function lar(t,e,r){if(r=fjn(r),o2e(e)){if(!djn(r))throw Da.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Da.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(mjn(t)==="immutable")throw new TypeError("immutable");return Pst(t).append(e,r,!1)}a(lar,"appendHeader");function HMs(t){let e=Pst(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],car(s!==null);return r.sort(hjn)}}},k2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Da.util.markAsUncloneable(this),e!==qMs&&(this.#t=new kst,this.#e="none",e!==void 0&&(e=Da.converters.HeadersInit(e,"Headers constructor","init"),pjn(this,e)))}append(e,r){Da.brandCheck(this,t),Da.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Da.converters.ByteString(e,n,"name"),r=Da.converters.ByteString(r,n,"value"),lar(this,e,r)}delete(e){if(Da.brandCheck(this,t),Da.argumentLengthCheck(arguments,1,"Headers.delete"),e=Da.converters.ByteString(e,"Headers.delete","name"),!o2e(e))throw Da.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){Da.brandCheck(this,t),Da.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Da.converters.ByteString(e,r,"name"),!o2e(e))throw Da.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Da.brandCheck(this,t),Da.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Da.converters.ByteString(e,r,"name"),!o2e(e))throw Da.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Da.brandCheck(this,t),Da.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Da.converters.ByteString(e,n,"name"),r=Da.converters.ByteString(r,n,"value"),r=fjn(r),o2e(e)){if(!djn(r))throw Da.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Da.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Da.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[Rst.inspect.custom](e,r){return r.depth??=e,`Headers ${Rst.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:mjn,setHeadersGuard:GMs,getHeadersList:Pst,setHeadersList:$Ms}=k2;Reflect.deleteProperty(k2,"getHeadersGuard");Reflect.deleteProperty(k2,"setHeadersGuard");Reflect.deleteProperty(k2,"getHeadersList");Reflect.deleteProperty(k2,"setHeadersList");jMs("Headers",k2,HMs,0,1);Object.defineProperties(k2.prototype,{append:Rpe,delete:Rpe,get:Rpe,has:Rpe,set:Rpe,getSetCookie:Rpe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Rst.inspect.custom]:{enumerable:!1}});Da.converters.HeadersInit=function(t,e,r){if(Da.util.Type(t)===Da.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!Rst.types.isProxy(t)&&n===k2.prototype.entries)try{return Pst(t).entriesList}catch{}return typeof n=="function"?Da.converters["sequence>"](t,e,r,n.bind(t)):Da.converters["record"](t,e,r)}throw Da.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};gjn.exports={fill:pjn,compareHeaderName:hjn,Headers:k2,HeadersList:kst,getHeadersGuard:mjn,setHeadersGuard:GMs,setHeadersList:$Ms,getHeadersList:Pst}});var a2e=I((Luf,wjn)=>{"use strict";p();var{Headers:Cjn,HeadersList:Ajn,fill:VMs,getHeadersGuard:WMs,setHeadersGuard:bjn,setHeadersList:Sjn}=KZ(),{extractBody:yjn,cloneBody:zMs,mixinBody:YMs,streamRegistry:Tjn,bodyUnusable:KMs}=cpe(),Ijn=Do(),Ejn=require("node:util"),{kEnumerableProperty:xT}=Ijn,{isValidReasonPhrase:JMs,isCancelled:ZMs,isAborted:XMs,isErrorLike:eOs,environmentSettingsObject:tOs}=vT(),{redirectStatusSet:rOs,nullBodyStatus:nOs}=_Pe(),{webidl:ra}=VA(),{URLSerializer:_jn}=Lw(),{kConstruct:Nst}=al(),uar=require("node:assert"),{isomorphicEncode:iOs,serializeJavascriptValueToJSONString:oOs}=VF(),sOs=new TextEncoder("utf-8"),wT=class t{static{a(this,"Response")}#e;#t;static error(){return s2e(Mst(),"immutable")}static json(e,r=void 0){ra.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ra.converters.ResponseInit(r));let n=sOs.encode(oOs(e)),o=yjn(n),s=s2e(kpe({}),"response");return vjn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ra.argumentLengthCheck(arguments,1,"Response.redirect"),e=ra.converters.USVString(e),r=ra.converters["unsigned short"](r);let n;try{n=new URL(e,tOs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!rOs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=s2e(kpe({}),"immutable");o.#t.status=r;let s=iOs(_jn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(ra.util.markAsUncloneable(this),e===Nst)return;e!==null&&(e=ra.converters.BodyInit(e,"Response","body")),r=ra.converters.ResponseInit(r),this.#t=kpe({}),this.#e=new Cjn(Nst),bjn(this.#e,"response"),Sjn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=yjn(e);n={body:o,type:s}}vjn(this,r,n)}get type(){return ra.brandCheck(this,t),this.#t.type}get url(){ra.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":_jn(r,!0)}get redirected(){return ra.brandCheck(this,t),this.#t.urlList.length>1}get status(){return ra.brandCheck(this,t),this.#t.status}get ok(){return ra.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return ra.brandCheck(this,t),this.#t.statusText}get headers(){return ra.brandCheck(this,t),this.#e}get body(){return ra.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return ra.brandCheck(this,t),!!this.#t.body&&Ijn.isDisturbed(this.#t.body.stream)}clone(){if(ra.brandCheck(this,t),KMs(this.#t))throw ra.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=dar(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&Tjn.register(this,new WeakRef(this.#t.body.stream)),s2e(e,WMs(this.#e))}[Ejn.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 ${Ejn.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:aOs,setResponseHeaders:cOs,getResponseState:JZ,setResponseState:lOs}=wT;Reflect.deleteProperty(wT,"getResponseHeaders");Reflect.deleteProperty(wT,"setResponseHeaders");Reflect.deleteProperty(wT,"getResponseState");Reflect.deleteProperty(wT,"setResponseState");YMs(wT,JZ);Object.defineProperties(wT.prototype,{type:xT,url:xT,status:xT,ok:xT,redirected:xT,statusText:xT,headers:xT,clone:xT,body:xT,bodyUsed:xT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(wT,{json:xT,redirect:xT,error:xT});function dar(t){if(t.internalResponse)return xjn(dar(t.internalResponse),t.type);let e=kpe({...t,body:null});return t.body!=null&&(e.body=zMs(t.body)),e}a(dar,"cloneResponse");function kpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new Ajn(t?.headersList):new Ajn,urlList:t?.urlList?[...t.urlList]:[]}}a(kpe,"makeResponse");function Mst(t){let e=eOs(t);return kpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Mst,"makeNetworkError");function uOs(t){return t.type==="error"&&t.status===0}a(uOs,"isNetworkError");function Dst(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 uar(!(n in e)),r[n]=o,!0}})}a(Dst,"makeFilteredResponse");function xjn(t,e){if(e==="basic")return Dst(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Dst(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Dst(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Dst(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});uar(!1)}a(xjn,"filterResponse");function dOs(t,e=null){return uar(ZMs(t)),XMs(t)?Mst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Mst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(dOs,"makeAppropriateNetworkError");function vjn(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&&!JMs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(JZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(JZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&VMs(aOs(t),e.headers),r){if(nOs.includes(t.status))throw ra.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});JZ(t).body=r.body,r.type!=null&&!JZ(t).headersList.contains("content-type",!0)&&JZ(t).headersList.append("content-type",r.type,!0)}}a(vjn,"initializeResponse");function s2e(t,e){let r=new wT(Nst);lOs(r,t);let n=new Cjn(Nst);return cOs(r,n),Sjn(n,t.headersList),bjn(n,e),t.urlList.length!==0&&t.body?.stream&&Tjn.register(r,new WeakRef(t.body.stream)),r}a(s2e,"fromInnerResponse");ra.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ra.converters.USVString(t,e,r):ra.is.Blob(t)||ra.is.BufferSource(t)||ra.is.FormData(t)||ra.is.URLSearchParams(t)?t:ra.converters.DOMString(t,e,r)};ra.converters.BodyInit=function(t,e,r){return ra.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:ra.converters.XMLHttpRequestBodyInit(t,e,r)};ra.converters.ResponseInit=ra.dictionaryConverter([{key:"status",converter:ra.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ra.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ra.converters.HeadersInit}]);ra.is.Response=ra.util.MakeTypeAssertion(wT);wjn.exports={isNetworkError:uOs,makeNetworkError:Mst,makeResponse:kpe,makeAppropriateNetworkError:dOs,filterResponse:xjn,Response:wT,cloneResponse:dar,fromInnerResponse:s2e,getResponseState:JZ}});var Ppe=I((Uuf,jjn)=>{"use strict";p();var{extractBody:fOs,mixinBody:pOs,cloneBody:hOs,bodyUnusable:Rjn}=cpe(),{Headers:Ojn,fill:mOs,HeadersList:Bst,setHeadersGuard:far,getHeadersGuard:gOs,setHeadersList:Ljn,getHeadersList:kjn}=KZ(),Lst=Do(),Pjn=require("node:util"),{isValidHTTPToken:AOs,sameOrigin:Djn,environmentSettingsObject:Ost}=vT(),{forbiddenMethodsSet:yOs,corsSafeListedMethodsSet:EOs,referrerPolicy:_Os,requestRedirect:vOs,requestMode:COs,requestCredentials:bOs,requestCache:SOs,requestDuplex:TOs}=_Pe(),{kEnumerableProperty:fm,normalizedMethodRecordsBase:IOs,normalizedMethodRecords:xOs}=Lst,{webidl:Li}=VA(),{URLSerializer:wOs}=Lw(),{kConstruct:Fst}=al(),ROs=require("node:assert"),{getMaxListeners:Bjn,setMaxListeners:kOs,defaultMaxListeners:POs}=require("node:events"),DOs=Symbol("abortController"),Fjn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Ust=new WeakMap,par;try{par=Bjn(new AbortController().signal)>0}catch{par=!1}function Njn(t){return e;function e(){let r=t.deref();if(r!==void 0){Fjn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Ust.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()}Ust.delete(r.signal)}}}}a(Njn,"buildAbort");var Mjn=!1,Ab=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Li.util.markAsUncloneable(this),e===Fst)return;Li.argumentLengthCheck(arguments,1,"Request constructor"),e=Li.converters.RequestInfo(e),r=Li.converters.RequestInit(r);let o=null,s=null,c=Ost.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=Qst({urlList:[_]}),s="cors"}else ROs(Li.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Ost.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&Djn(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=Qst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Ost.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&&!Djn(v,Ost.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 Li.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=xOs[_];if(v!==void 0)o.method=v;else{if(!AOs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(yOs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=IOs[b]??_,o.method=_}!Mjn&&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"}),Mjn=!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[DOs]=m;let _=new WeakRef(m),v=Njn(_);par&&Bjn(l)===POs&&kOs(1500,l),Lst.addAbortListener(l,v),Fjn.register(m,{signal:l,abort:v},v)}if(this.#r=new Ojn(Fst),Ljn(this.#r,o.headersList),far(this.#r,"request"),h==="no-cors"){if(!EOs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);far(this.#r,"request-no-cors")}if(f){let _=kjn(this.#r),v=r.headers!==void 0?r.headers:new Bst(_);if(_.clear(),v instanceof Bst){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else mOs(this.#r,v)}let g=Li.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]=fOs(r.body,o.keepalive);A=_,v&&!kjn(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(Rjn(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 Li.brandCheck(this,t),this.#n.method}get url(){return Li.brandCheck(this,t),wOs(this.#n.url)}get headers(){return Li.brandCheck(this,t),this.#r}get destination(){return Li.brandCheck(this,t),this.#n.destination}get referrer(){return Li.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Li.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Li.brandCheck(this,t),this.#n.mode}get credentials(){return Li.brandCheck(this,t),this.#n.credentials}get cache(){return Li.brandCheck(this,t),this.#n.cache}get redirect(){return Li.brandCheck(this,t),this.#n.redirect}get integrity(){return Li.brandCheck(this,t),this.#n.integrity}get keepalive(){return Li.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Li.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Li.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Li.brandCheck(this,t),this.#e}get body(){return Li.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Li.brandCheck(this,t),!!this.#n.body&&Lst.isDisturbed(this.#n.body.stream)}get duplex(){return Li.brandCheck(this,t),"half"}clone(){if(Li.brandCheck(this,t),Rjn(this.#n))throw new TypeError("unusable");let e=Qjn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Ust.get(this.signal);n===void 0&&(n=new Set,Ust.set(this.signal,n));let o=new WeakRef(r);n.add(o),Lst.addAbortListener(r.signal,Njn(o))}return qjn(e,this.#t,r.signal,gOs(this.#r))}[Pjn.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 ${Pjn.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:NOs,getRequestDispatcher:MOs,setRequestDispatcher:OOs,setRequestHeaders:LOs,getRequestState:Ujn,setRequestState:BOs}=Ab;Reflect.deleteProperty(Ab,"setRequestSignal");Reflect.deleteProperty(Ab,"getRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestHeaders");Reflect.deleteProperty(Ab,"getRequestState");Reflect.deleteProperty(Ab,"setRequestState");pOs(Ab,Ujn);function Qst(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 Bst(t.headersList):new Bst}}a(Qst,"makeRequest");function Qjn(t){let e=Qst({...t,body:null});return t.body!=null&&(e.body=hOs(t.body)),e}a(Qjn,"cloneRequest");function qjn(t,e,r,n){let o=new Ab(Fst);BOs(o,t),OOs(o,e),NOs(o,r);let s=new Ojn(Fst);return LOs(o,s),Ljn(s,t.headersList),far(s,n),o}a(qjn,"fromInnerRequest");Object.defineProperties(Ab.prototype,{method:fm,url:fm,headers:fm,redirect:fm,clone:fm,signal:fm,duplex:fm,destination:fm,body:fm,bodyUsed:fm,isHistoryNavigation:fm,isReloadNavigation:fm,keepalive:fm,integrity:fm,cache:fm,credentials:fm,attribute:fm,referrerPolicy:fm,referrer:fm,mode:fm,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Li.is.Request=Li.util.MakeTypeAssertion(Ab);Li.converters.RequestInfo=function(t){return typeof t=="string"?Li.converters.USVString(t):Li.is.Request(t)?t:Li.converters.USVString(t)};Li.converters.RequestInit=Li.dictionaryConverter([{key:"method",converter:Li.converters.ByteString},{key:"headers",converter:Li.converters.HeadersInit},{key:"body",converter:Li.nullableConverter(Li.converters.BodyInit)},{key:"referrer",converter:Li.converters.USVString},{key:"referrerPolicy",converter:Li.converters.DOMString,allowedValues:_Os},{key:"mode",converter:Li.converters.DOMString,allowedValues:COs},{key:"credentials",converter:Li.converters.DOMString,allowedValues:bOs},{key:"cache",converter:Li.converters.DOMString,allowedValues:SOs},{key:"redirect",converter:Li.converters.DOMString,allowedValues:vOs},{key:"integrity",converter:Li.converters.DOMString},{key:"keepalive",converter:Li.converters.boolean},{key:"signal",converter:Li.nullableConverter(t=>Li.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Li.converters.any},{key:"duplex",converter:Li.converters.DOMString,allowedValues:TOs},{key:"dispatcher",converter:Li.converters.any},{key:"priority",converter:Li.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);jjn.exports={Request:Ab,makeRequest:Qst,fromInnerRequest:qjn,cloneRequest:Qjn,getRequestDispatcher:MOs,getRequestState:Ujn}});var Kjn=I((juf,Yjn)=>{"use strict";p();var FOs=require("node:assert"),{runtimeFeatures:Gjn}=WF(),ZZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),har;if(Gjn.has("crypto")){har=require("node:crypto");let t=har.getHashes();t.length===0&&ZZ.clear();for(let e of ZZ.keys())t.includes(e)===!1&&ZZ.delete(e)}else ZZ.clear();var Hjn=Map.prototype.get.bind(ZZ),mar=Map.prototype.has.bind(ZZ),UOs=Gjn.has("crypto")===!1||ZZ.size===0?()=>!0:(t,e)=>{let r=Vjn(e);if(r.length===0)return!0;let n=$jn(r);for(let o of n){let s=o.alg,c=o.val,l=Wjn(s,t);if(zjn(l,c))return!0}return!1};function $jn(t){let e=[],r=null;for(let n of t){if(FOs(mar(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=Hjn(o),c=n.alg,l=Hjn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a($jn,"getStrongestMetadata");function Vjn(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(!mar(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(Vjn,"parseMetadata");var Wjn=a((t,e)=>har.hash(t,e,"base64"),"applyAlgorithmToBytes");function zjn(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:ll,makeAppropriateNetworkError:c2e,filterResponse:gar,makeResponse:qst,fromInnerResponse:QOs,getResponseState:qOs}=a2e(),{HeadersList:Aar}=KZ(),{Request:jOs,cloneRequest:HOs,getRequestDispatcher:GOs,getRequestState:$Os}=Ppe(),P2=require("node:zlib"),{makePolicyContainer:VOs,clonePolicyContainer:WOs,requestBadPort:zOs,TAOCheck:YOs,appendRequestOriginHeader:KOs,responseLocationURL:JOs,requestCurrentURL:RT,setRequestReferrerPolicyOnRedirect:ZOs,tryUpgradeRequestToAPotentiallyTrustworthyURL:XOs,createOpaqueTimingInfo:Sar,appendFetchMetadata:e5s,corsCheck:t5s,crossOriginResourcePolicyCheck:r5s,determineRequestsReferrer:n5s,coarsenedSharedCurrentTime:l2e,sameOrigin:Car,isCancelled:oH,isAborted:Jjn,isErrorLike:i5s,fullyReadBody:o5s,readableStreamClose:s5s,urlIsLocal:a5s,urlIsHttpHttpsScheme:$st,urlHasHttpsScheme:c5s,clampAndCoarsenConnectionTimingInfo:l5s,simpleRangeHeaderValue:u5s,buildContentRange:d5s,createInflate:f5s,extractMimeType:p5s,hasAuthenticationEntry:h5s,includesCredentials:Zjn,isTraversableNavigable:m5s}=vT(),XZ=require("node:assert"),{safelyExtractBody:Vst,extractBody:Xjn}=cpe(),{redirectStatusSet:nHn,nullBodyStatus:iHn,safeMethodsSet:g5s,requestBodyHeader:A5s,subresourceSet:y5s}=_Pe(),E5s=require("node:events"),{Readable:_5s,pipeline:v5s,finished:C5s,isErrored:b5s,isReadable:jst}=require("node:stream"),{addAbortListener:S5s,bufferToLowerCasedHeaderName:eHn}=Do(),{dataURLProcessor:T5s,serializeAMimeType:I5s,minimizeSupportedMimeType:x5s}=Lw(),{getGlobalDispatcher:w5s}=Ist(),{webidl:Tar}=VA(),{STATUS_CODES:tHn}=require("node:http"),{bytesMatch:R5s}=Kjn(),{createDeferredPromise:k5s}=TPe(),{isomorphicEncode:Hst}=VF(),{runtimeFeatures:P5s}=WF(),D5s=P5s.has("zstd"),N5s=["GET","HEAD"],M5s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",yar,Gst=class extends E5s{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 O5s(t){oHn(t,"fetch")}a(O5s,"handleFetchDone");function L5s(t,e=void 0){Tar.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=k5s(),n;try{n=new jOs(t,e)}catch(f){return r.reject(f),r.promise}let o=$Os(n);if(n.signal.aborted)return Ear(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 S5s(n.signal,()=>{l=!0,XZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Ear(r,o,f,n.signal.reason,u.controller)}),u=aHn({request:o,processResponseEndOfBody:O5s,processResponse:a(f=>{if(!l){if(f.aborted){Ear(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(QOs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:GOs(n),requestObject:n}),r.promise}a(L5s,"fetch");function oHn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;$st(r)&&n!==null&&(t.timingAllowPassed||(n=Sar({startTime:n.startTime}),o=""),n.endTime=l2e(),t.timingInfo=n,sHn(n,r.href,e,globalThis,o,"",t.status))}a(oHn,"finalizeAndReportTiming");var sHn=performance.markResourceTiming;function Ear(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&jst(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=qOs(r);s.body?.stream!=null&&jst(s.body.stream)&&o.error(n)}a(Ear,"abortFetch");function aHn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=w5s(),requestObject:u=null}){XZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=l2e(f),m=Sar({startTime:h}),g={controller:new Gst(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return XZ(!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=WOs(t.client.policyContainer):t.policyContainer=VOs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,y5s.has(t.destination),cHn(g,!1),g.controller}a(aHn,"fetching");async function cHn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!a5s(RT(r))&&(n=ll("local URLs only")),XOs(r),zOs(r)==="blocked"&&(n=ll("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=n5s(r)),n===null){let s=RT(r);Car(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await rHn(t)):r.mode==="same-origin"?n=ll('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ll('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await rHn(t)):$st(RT(r))?(r.responseTainting="cors",n=await lHn(t)):n=ll("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=gar(n,"basic"):r.responseTainting==="cors"?n=gar(n,"cors"):r.responseTainting==="opaque"?n=gar(n,"opaque"):XZ(!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=ll()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||iHn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>_ar(t,ll(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!R5s(l,r.integrity)){s("integrity mismatch");return}n.body=Vst(l)[0],_ar(t,n)},"processBody");o5s(n.body,c,s)}else _ar(t,n)}catch(r){t.controller.terminate(r)}}a(cHn,"mainFetch");function rHn(t){if(oH(t)&&t.request.redirectCount===0)return Promise.resolve(c2e(t));let{request:e}=t,{protocol:r}=RT(e);switch(r){case"about:":return Promise.resolve(ll("about scheme is not supported"));case"blob:":{yar||(yar=require("node:buffer").resolveObjectURL);let n=RT(e);if(n.search.length!==0)return Promise.resolve(ll("NetworkError when attempting to fetch resource."));let o=yar(n.toString());if(e.method!=="GET"||!Tar.is.Blob(o))return Promise.resolve(ll("invalid method"));let s=qst(),c=o.size,l=Hst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=u5s(d,!0);if(f==="failure")return Promise.resolve(ll("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(ll("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=Xjn(g);s.body=A[0];let y=Hst(`${g.size}`),E=d5s(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=Xjn(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=RT(e),o=T5s(n);if(o==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let s=I5s(o.mimeType);return Promise.resolve(qst({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Vst(o.body)[0]}))}case"file:":return Promise.resolve(ll("not implemented... yet..."));case"http:":case"https:":return lHn(t).catch(n=>ll(n));default:return Promise.resolve(ll("unknown scheme"))}}a(rHn,"schemeFetch");function B5s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(B5s,"finalizeResponse");function _ar(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!$st(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Sar(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=p5s(e.headersList);f!=="failure"&&(u.contentType=x5s(f))}t.request.initiatorType!=null&&sHn(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():C5s(o.body.stream,()=>{n()})}a(_ar,"fetchFinale");async function lHn(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 bar(t),e.responseTainting==="cors"&&t5s(e,r)==="failure")return ll("cors failure");YOs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&r5s(e.origin,e.client,e.destination,n)==="blocked"?ll("blocked"):(nHn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ll("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await F5s(t,r):XZ(!1)),r.timingInfo=o,r)}a(lHn,"httpFetch");function F5s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=JOs(n,RT(r).hash),o==null)return e}catch(c){return Promise.resolve(ll(c))}if(!$st(o))return Promise.resolve(ll("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ll("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Car(r,o))return Promise.resolve(ll('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ll('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ll());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!N5s.includes(r.method)){r.method="GET",r.body=null;for(let c of A5s)r.headersList.delete(c)}Car(RT(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&&(XZ(r.body.source!=null),r.body=Vst(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=l2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),ZOs(r,n),cHn(t,!0)}a(F5s,"httpRedirectFetch");async function bar(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=HOs(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=Hst(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,Tar.is.URL(s.referrer)&&s.headersList.append("referer",Hst(s.referrer.href),!0),KOs(s),e5s(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",M5s,!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)||(c5s(RT(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(!(h5s(s)&&(s.useURLCredentials===void 0||!Zjn(RT(s))))){if(Zjn(RT(s))&&e){let{username:g,password:A}=RT(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 ll("only if cached");let m=await U5s(o,d,r);!g5s.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||m5s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Vst(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return oH(t)?c2e(t):c;t.controller.connection.destroy(),c=await bar(t,!0)}if(c.status===407)return n.window==="no-window"?ll():oH(t)?c2e(t):ll("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(oH(t))return c2e(t);t.controller.connection.destroy(),c=await bar(t,e,!0)}return c}a(bar,"httpNetworkOrCacheFetch");async function U5s(t,e=!1,r=!1){XZ(!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*(_){oH(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{oH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{oH(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=qst({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=qst({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),c2e(t,A)):ll(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{oH(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(Jjn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){s5s(t.controller.controller),B5s(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),b5s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){Jjn(t)?(o.aborted=!0,jst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):jst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:i5s(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=RT(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=l5s(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=l2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=l2e(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new Aar;for(let M=0;Mj)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${j}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")B.push(P2.createGunzip({flush:P2.constants.Z_SYNC_FLUSH,finishFlush:P2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(f5s({flush:P2.constants.Z_SYNC_FLUSH,finishFlush:P2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(P2.createBrotliDecompress({flush:P2.constants.BROTLI_OPERATION_FLUSH,finishFlush:P2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&D5s)B.push(P2.createZstdDecompress({flush:P2.constants.ZSTD_e_continue,finishFlush:P2.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:B.length?v5s(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,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new Aar;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:tHn[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 Aar;for(let D=0;D{"use strict";p();var Q5s=require("node:assert"),{URLSerializer:dHn}=Lw(),{isValidHeaderName:q5s}=vT();function j5s(t,e,r=!1){let n=dHn(t,r),o=dHn(e,r);return n===o}a(j5s,"urlEquals");function H5s(t){Q5s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),q5s(r)&&e.push(r);return e}a(H5s,"getFieldValues");fHn.exports={urlEquals:j5s,getFieldValues:H5s}});var AHn=I((Juf,gHn)=>{"use strict";p();var Iar=require("node:assert"),{kConstruct:G5s}=al(),{urlEquals:$5s,getFieldValues:xar}=pHn(),{kEnumerableProperty:eX,isDisturbed:V5s}=Do(),{webidl:Jn}=VA(),{cloneResponse:hHn,fromInnerResponse:W5s,getResponseState:z5s}=a2e(),{Request:d2e,fromInnerRequest:Y5s,getRequestState:j5}=Ppe(),{fetching:K5s}=u2e(),{urlIsHttpHttpsScheme:Wst,readAllBytes:J5s}=vT(),{createDeferredPromise:Dpe}=TPe(),zst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==G5s&&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=j5(m);if(!Wst(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=j5(new d2e(m));if(!Wst(g.url))throw Jn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Dpe();s.push(K5s({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=xar(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=Dpe(),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=j5(e):o=j5(new d2e(e)),!Wst(o.url)||o.method!=="GET")throw Jn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=z5s(r);if(s.status===206)throw Jn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=xar(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&&(V5s(s.body.stream)||s.body.stream.locked))throw Jn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=hHn(s),l=Dpe();if(s.body!=null){let A=s.body.stream.getReader();J5s(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=Dpe(),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=j5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Iar(typeof e=="string"),o=j5(new d2e(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Dpe(),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=j5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=j5(new d2e(e)));let s=Dpe(),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=Y5s(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);Iar(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(!Wst(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);Iar(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=""),!$5s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=xar(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=j5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=j5(new d2e(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=W5s(hHn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(zst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:eX,matchAll:eX,add:eX,addAll:eX,put:eX,delete:eX,keys:eX});var mHn=[{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(mHn);Jn.converters.MultiCacheQueryOptions=Jn.dictionaryConverter([...mHn,{key:"cacheName",converter:Jn.converters.DOMString}]);Jn.converters.Response=Jn.interfaceConverter(Jn.is.Response,"Response");Jn.converters["sequence"]=Jn.sequenceConverter(Jn.converters.RequestInfo);gHn.exports={Cache:zst}});var EHn=I((edf,yHn)=>{"use strict";p();var{Cache:Yst}=AHn(),{webidl:bE}=VA(),{kEnumerableProperty:f2e}=Do(),{kConstruct:p2e}=al(),Kst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==p2e&&bE.illegalConstructor(),bE.util.markAsUncloneable(this)}async match(e,r={}){if(bE.brandCheck(this,t),bE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=bE.converters.RequestInfo(e),r=bE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Yst(p2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Yst(p2e,n).match(e,r);if(s!==void 0)return s}}async has(e){bE.brandCheck(this,t);let r="CacheStorage.has";return bE.argumentLengthCheck(arguments,1,r),e=bE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){bE.brandCheck(this,t);let r="CacheStorage.open";if(bE.argumentLengthCheck(arguments,1,r),e=bE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Yst(p2e,o)}let n=[];return this.#e.set(e,n),new Yst(p2e,n)}async delete(e){bE.brandCheck(this,t);let r="CacheStorage.delete";return bE.argumentLengthCheck(arguments,1,r),e=bE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return bE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Kst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:f2e,has:f2e,open:f2e,delete:f2e,keys:f2e});yHn.exports={CacheStorage:Kst}});var vHn=I((ndf,_Hn)=>{"use strict";p();_Hn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var war=I((odf,IHn)=>{"use strict";p();function Z5s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(Z5s,"isCTLExcludingHtab");function CHn(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(CHn,"validateCookieName");function bHn(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(bHn,"validateCookieValue");function SHn(t){for(let e=0;ee.toString().padStart(2,"0"));function THn(t){return typeof t=="number"&&(t=new Date(t)),`${e4s[t.getUTCDay()]}, ${Jst[t.getUTCDate()]} ${t4s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Jst[t.getUTCHours()]}:${Jst[t.getUTCMinutes()]}:${Jst[t.getUTCSeconds()]} GMT`}a(THn,"toIMFDate");function r4s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(r4s,"validateCookieMaxAge");function n4s(t){if(t.name.length===0)return null;CHn(t.name),bHn(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"&&(r4s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(X5s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(SHn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${THn(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(n4s,"stringify");IHn.exports={isCTLExcludingHtab:Z5s,validateCookieName:CHn,validateCookiePath:SHn,validateCookieValue:bHn,toIMFDate:THn,stringify:n4s}});var wHn=I((cdf,xHn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Zst}=VF(),{maxNameValuePairSize:i4s,maxAttributeValueSize:o4s}=vHn(),{isCTLExcludingHtab:s4s}=war(),a4s=require("node:assert");function c4s(t){if(s4s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Zst(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Zst("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>i4s?null:{name:n,value:o,...Npe(r)}}a(c4s,"parseSetCookie");function Npe(t,e={}){if(t.length===0)return e;a4s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Zst(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Zst("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>o4s)return Npe(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 Npe(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=o.toLowerCase();c==="none"?e.sameSite="None":c==="strict"?e.sameSite="Strict":c==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Npe(t,e)}a(Npe,"parseUnparsedAttributes");xHn.exports={parseSetCookie:c4s,parseUnparsedAttributes:Npe}});var DHn=I((ddf,PHn)=>{"use strict";p();var{parseSetCookie:RHn}=wHn(),{stringify:l4s}=war(),{webidl:Ka}=VA(),{Headers:u4s}=KZ(),Xst=Ka.brandCheckMultiple([u4s,globalThis.Headers].filter(Boolean));function d4s(t){Ka.argumentLengthCheck(arguments,1,"getCookies"),Xst(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(d4s,"getCookies");function f4s(t,e,r){Xst(t);let n="deleteCookie";Ka.argumentLengthCheck(arguments,2,n),e=Ka.converters.DOMString(e,n,"name"),r=Ka.converters.DeleteCookieAttributes(r),kHn(t,{name:e,value:"",expires:new Date(0),...r})}a(f4s,"deleteCookie");function p4s(t){Ka.argumentLengthCheck(arguments,1,"getSetCookies"),Xst(t);let e=t.getSetCookie();return e?e.map(r=>RHn(r)):[]}a(p4s,"getSetCookies");function h4s(t){return t=Ka.converters.DOMString(t),RHn(t)}a(h4s,"parseCookie");function kHn(t,e){Ka.argumentLengthCheck(arguments,2,"setCookie"),Xst(t),e=Ka.converters.Cookie(e);let r=l4s(e);r&&t.append("set-cookie",r,!0)}a(kHn,"setCookie");Ka.converters.DeleteCookieAttributes=Ka.dictionaryConverter([{converter:Ka.nullableConverter(Ka.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.nullableConverter(Ka.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ka.converters.Cookie=Ka.dictionaryConverter([{converter:Ka.converters.DOMString,key:"name"},{converter:Ka.converters.DOMString,key:"value"},{converter:Ka.nullableConverter(t=>typeof t=="number"?Ka.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.nullableConverter(Ka.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.nullableConverter(Ka.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.nullableConverter(Ka.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.nullableConverter(Ka.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.nullableConverter(Ka.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ka.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ka.sequenceConverter(Ka.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);PHn.exports={getCookies:d4s,deleteCookie:f4s,getSetCookies:p4s,setCookie:kHn,parseCookie:h4s}});var rat=I((hdf,MHn)=>{"use strict";p();var{webidl:li}=VA(),{kEnumerableProperty:yb}=Do(),{kConstruct:NHn}=al(),Mpe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===NHn){super(arguments[1],arguments[2]),li.util.markAsUncloneable(this);return}let n="MessageEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get data(){return li.brandCheck(this,t),this.#e.data}get origin(){return li.brandCheck(this,t),this.#e.origin}get lastEventId(){return li.brandCheck(this,t),this.#e.lastEventId}get source(){return li.brandCheck(this,t),this.#e.source}get ports(){return li.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 li.brandCheck(this,t),li.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(NHn,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:m4s}=Mpe;delete Mpe.createFastMessageEvent;var eat=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.CloseEventInit(r),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get wasClean(){return li.brandCheck(this,t),this.#e.wasClean}get code(){return li.brandCheck(this,t),this.#e.code}get reason(){return li.brandCheck(this,t),this.#e.reason}},tat=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";li.argumentLengthCheck(arguments,1,n),super(e,r),li.util.markAsUncloneable(this),e=li.converters.DOMString(e,n,"type"),r=li.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return li.brandCheck(this,t),this.#e.message}get filename(){return li.brandCheck(this,t),this.#e.filename}get lineno(){return li.brandCheck(this,t),this.#e.lineno}get colno(){return li.brandCheck(this,t),this.#e.colno}get error(){return li.brandCheck(this,t),this.#e.error}};Object.defineProperties(Mpe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:yb,origin:yb,lastEventId:yb,source:yb,ports:yb,initMessageEvent:yb});Object.defineProperties(eat.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:yb,code:yb,wasClean:yb});Object.defineProperties(tat.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:yb,filename:yb,lineno:yb,colno:yb,error:yb});li.converters.MessagePort=li.interfaceConverter(li.is.MessagePort,"MessagePort");li.converters["sequence"]=li.sequenceConverter(li.converters.MessagePort);var Rar=[{key:"bubbles",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];li.converters.MessageEventInit=li.dictionaryConverter([...Rar,{key:"data",converter:li.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:li.nullableConverter(li.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:li.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);li.converters.CloseEventInit=li.dictionaryConverter([...Rar,{key:"wasClean",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:li.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);li.converters.ErrorEventInit=li.dictionaryConverter([...Rar,{key:"message",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:li.converters.any}]);MHn.exports={MessageEvent:Mpe,CloseEvent:eat,ErrorEvent:tat,createFastMessageEvent:m4s}});var sH=I((Adf,OHn)=>{"use strict";p();var g4s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",A4s={enumerable:!0,writable:!1,configurable:!1},y4s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},E4s={SENT:1,RECEIVED:2},_4s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},v4s=65535,C4s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},b4s=Buffer.allocUnsafe(0),S4s={text:1,typedArray:2,arrayBuffer:3,blob:4};OHn.exports={uid:g4s,sentCloseFrameState:E4s,staticPropertyDescriptors:A4s,states:y4s,opcodes:_4s,maxUnsigned16Bit:v4s,parserStates:C4s,emptyBuffer:b4s,sendHints:S4s}});var tX=I((Edf,QHn)=>{"use strict";p();var{states:nat,opcodes:Ope}=sH(),{isUtf8:T4s}=require("node:buffer"),{removeHTTPWhitespace:LHn}=Lw(),{collectASequenceOfCodePointsFast:I4s}=VF();function x4s(t){return t===nat.CONNECTING}a(x4s,"isConnecting");function w4s(t){return t===nat.OPEN}a(w4s,"isEstablished");function R4s(t){return t===nat.CLOSING}a(R4s,"isClosing");function k4s(t){return t===nat.CLOSED}a(k4s,"isClosed");function P4s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(P4s,"fireEvent");function D4s(t,e,r){t.onMessage(e,r)}a(D4s,"websocketMessageReceived");function N4s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(N4s,"toArrayBuffer");function M4s(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(M4s,"isValidSubprotocol");function O4s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(O4s,"isValidStatusCode");function BHn(t){return t===Ope.CLOSE||t===Ope.PING||t===Ope.PONG}a(BHn,"isControlFrame");function FHn(t){return t===Ope.CONTINUATION}a(FHn,"isContinuationFrame");function UHn(t){return t===Ope.TEXT||t===Ope.BINARY}a(UHn,"isTextBinaryFrame");function L4s(t){return UHn(t)||FHn(t)||BHn(t)}a(L4s,"isValidOpcode");function B4s(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(F4s,"isValidClientWindowBits");function U4s(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(U4s,"getURLRecord");function Q4s(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(Q4s,"validateCloseCodeAndReason");var q4s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(T4s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();QHn.exports={isConnecting:x4s,isEstablished:w4s,isClosing:R4s,isClosed:k4s,fireEvent:P4s,isValidSubprotocol:M4s,isValidStatusCode:O4s,websocketMessageReceived:D4s,utf8Decode:q4s,isControlFrame:BHn,isContinuationFrame:FHn,isTextBinaryFrame:UHn,isValidOpcode:L4s,parseExtensions:B4s,isValidClientWindowBits:F4s,toArrayBuffer:N4s,getURLRecord:U4s,validateCloseCodeAndReason:Q4s}});var Bpe=I((Cdf,jHn)=>{"use strict";p();var{runtimeFeatures:j4s}=WF(),{maxUnsigned16Bit:qHn,opcodes:H4s}=sH(),iat=8*1024,h2e=null,Lpe=iat,G4s=j4s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oqHn?(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;uqHn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|H4s.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]}};jHn.exports={WebsocketFrameSend:Par,generateMask:kar}});var oat=I((Tdf,zHn)=>{"use strict";p();var{uid:$4s,states:Dar,sentCloseFrameState:Nar,emptyBuffer:HHn,opcodes:V4s}=sH(),{parseExtensions:W4s,isClosed:z4s,isClosing:Y4s,isEstablished:VHn,isConnecting:K4s,validateCloseCodeAndReason:J4s}=tX(),{makeRequest:Z4s}=Ppe(),{fetching:X4s}=u2e(),{Headers:eLs,getHeadersList:tLs}=KZ(),{getDecodeSplit:rLs}=vT(),{WebsocketFrameSend:nLs}=Bpe(),iLs=require("node:assert"),{runtimeFeatures:oLs}=WF(),GHn=oLs.has("crypto")?require("node:crypto"):null,$Hn=!1;function sLs(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=Z4s({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=tLs(new eLs(o.headers));c.headersList=f}let l=GHn.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),X4s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){H5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){H5(n,1002,"Received network error or non-200 status code.",f.error);return}}if($Hn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),$Hn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){H5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){H5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){H5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=GHn.hash("sha1",l+$4s,"base64");if(h!==m){H5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=W4s(g),!A.has("permessage-deflate"))){H5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!rLs("sec-websocket-protocol",c.headersList).includes(y)){H5(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(sLs,"establishWebSocketConnection");function WHn(t,e,r,n=!1){if(e??=null,r??="",n&&J4s(e,r),!(z4s(t.readyState)||Y4s(t.readyState)))if(!VHn(t.readyState))H5(t),t.readyState=Dar.CLOSING;else if(!t.closeState.has(Nar.SENT)&&!t.closeState.has(Nar.RECEIVED)){let o=new nLs;r.length!==0&&e===null&&(e=1e3),iLs(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=HHn: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=HHn,t.socket.write(o.createFrame(V4s.CLOSE)),t.closeState.add(Nar.SENT),t.readyState=Dar.CLOSING}else t.readyState=Dar.CLOSING}a(WHn,"closeWebSocketConnection");function H5(t,e,r,n){VHn(t.readyState)&&WHn(t,e,r,!1),t.controller.abort(),K4s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(H5,"failWebsocketConnection");zHn.exports={establishWebSocketConnection:sLs,failWebsocketConnection:H5,closeWebSocketConnection:WHn}});var KHn=I((wdf,YHn)=>{"use strict";p();var{createInflateRaw:aLs,Z_DEFAULT_WINDOWBITS:cLs}=require("node:zlib"),{isValidClientWindowBits:lLs}=tX(),{MessageSizeExceededError:uLs}=ao(),dLs=Buffer.from([0,0,255,255]),sat=Symbol("kBuffer"),m2e=Symbol("kLength"),Mar=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=0;constructor(e,r){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#r=r.maxPayloadSize}decompress(e,r,n){if(!this.#e){let o=cLs;if(this.#t.serverMaxWindowBits){if(!lLs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=aLs({windowBits:o})}catch(s){n(s);return}this.#e[sat]=[],this.#e[m2e]=0,this.#e.on("data",s=>{if(this.#e[m2e]+=s.length,this.#r>0&&this.#e[m2e]>this.#r){n(new uLs),this.#e.removeAllListeners(),this.#e=null;return}this.#e[sat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(dLs),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[sat],this.#e[m2e]);this.#e[sat].length=0,this.#e[m2e]=0,n(null,o)})}};YHn.exports={PerMessageDeflate:Mar}});var Far=I((Pdf,tGn)=>{"use strict";p();var{Writable:fLs}=require("node:stream"),pLs=require("node:assert"),{parserStates:Eb,opcodes:Fpe,states:hLs,emptyBuffer:JHn,sentCloseFrameState:g2e}=sH(),{isValidStatusCode:mLs,isValidOpcode:gLs,websocketMessageReceived:ZHn,utf8Decode:ALs,isControlFrame:Oar,isTextBinaryFrame:Lar,isContinuationFrame:yLs}=tX(),{failWebsocketConnection:SE}=oat(),{WebsocketFrameSend:XHn}=Bpe(),{PerMessageDeflate:ELs}=KHn(),{MessageSizeExceededError:eGn}=ao(),Bar=class extends fLs{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Eb.INFO;#o={};#s=[];#a;#c;#u;#l;constructor(e,r,n={}){super(),this.#c=e,this.#a=r??new Map,this.#u=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new ELs(r,n))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}#p(){return this.#l>0&&!Oar(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(SE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Eb.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!==Fpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!gLs(o))return SE(this.#c,1002,"Invalid opcode received"),e();if(s)return SE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){SE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){SE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Lar(o)){SE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Lar(o)&&this.#s.length>0){SE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){SE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&Oar(o)){SE(this.#c,1002,"Control frame either too large or fragmented");return}if(yLs(o)&&this.#s.length===0&&!this.#o.compressed){SE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Eb.READ_DATA,!this.#p())return}else l===126?this.#i=Eb.PAYLOADLENGTH_16:l===127&&(this.#i=Eb.PAYLOADLENGTH_64);Lar(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===Eb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.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){SE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.READ_DATA){if(this.#r{if(n){let s=n instanceof eGn?1009:1007;SE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){SE(this.#c,1009,new eGn().message);return}if(!this.#o.fin){this.#i=Eb.INFO,this.#n=!0,this.run(e);return}ZHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Eb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&ZHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Eb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return JHn;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){return this.#u>0&&this.#s.length===this.#u?(SE(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#s.push(e),!0)}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&&!mLs(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=ALs(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===Fpe.CLOSE){if(n===1)return SE(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 SE(this.#c,o,s),!1}if(!this.#c.closeState.has(g2e.SENT)&&!this.#c.closeState.has(g2e.RECEIVED)){let o=JHn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new XHn(o);this.#c.socket.write(s.createFrame(Fpe.CLOSE)),this.#c.closeState.add(g2e.SENT)}return this.#c.readyState=hLs.CLOSING,this.#c.closeState.add(g2e.RECEIVED),!1}else if(r===Fpe.PING){if(!this.#c.closeState.has(g2e.RECEIVED)){let o=new XHn(e);this.#c.socket.write(o.createFrame(Fpe.PONG)),this.#c.onPing(e)}}else r===Fpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};tGn.exports={ByteParser:Bar}});var oGn=I((Mdf,iGn)=>{"use strict";p();var{WebsocketFrameSend:nGn}=Bpe(),{opcodes:rGn,sendHints:rX}=sH(),_Ls=dor(),Qar=class{static{a(this,"SendQueue")}#e=new _Ls;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==rX.blob){if(this.#t){let s={promise:null,callback:r,frame:Uar(e,n)};this.#e.push(s)}else if(n===rX.text){let{0:s,1:c}=nGn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Uar(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Uar(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 Uar(t,e){return new nGn(vLs(t,e)).createFrame(e===rX.text?rGn.TEXT:rGn.BINARY)}a(Uar,"createFrame");function vLs(t,e){switch(e){case rX.text:case rX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case rX.arrayBuffer:case rX.blob:return new Uint8Array(t)}}a(vLs,"toBuffer");iGn.exports={SendQueue:Qar}});var dGn=I((Bdf,uGn)=>{"use strict";p();var{isArrayBuffer:CLs}=require("node:util/types"),{webidl:mi}=VA(),{URLSerializer:bLs}=Lw(),{environmentSettingsObject:sGn}=vT(),{staticPropertyDescriptors:aH,states:i8,sentCloseFrameState:qar,sendHints:aat,opcodes:jar}=sH(),{isConnecting:SLs,isEstablished:aGn,isClosing:cGn,isClosed:TLs,isValidSubprotocol:ILs,fireEvent:cat,utf8Decode:xLs,toArrayBuffer:wLs,getURLRecord:RLs}=tX(),{establishWebSocketConnection:kLs,closeWebSocketConnection:PLs,failWebsocketConnection:lGn}=oat(),{ByteParser:DLs}=Far(),{kEnumerableProperty:Gw}=Do(),{getGlobalDispatcher:NLs}=Ist(),{ErrorEvent:MLs,CloseEvent:OLs,createFastMessageEvent:LLs}=rat(),{SendQueue:BLs}=oGn(),{WebsocketFrameSend:FLs}=Bpe(),{channels:G5}=Qj();function ULs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(ULs,"getSocketAddress");var pv=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=>lGn(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=i8.CLOSING,G5.socketError.hasSubscribers&&G5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{G5.ping.hasSubscribers&&G5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{G5.pong.hasSubscribers&&G5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:i8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),mi.util.markAsUncloneable(this);let n="WebSocket constructor";mi.argumentLengthCheck(arguments,1,n);let o=mi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=mi.converters.USVString(e),r=o.protocols;let s=sGn.settingsObject.baseUrl,c=RLs(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=>ILs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=sGn.settingsObject;this.#o.controller=kLs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){mi.brandCheck(this,t),e!==void 0&&(e=mi.converters["unsigned short"](e,"WebSocket.close","code",mi.attributes.Clamp)),r!==void 0&&(r=mi.converters.USVString(r)),e??=null,r??="",PLs(this.#o,e,r,!0)}send(e){mi.brandCheck(this,t);let r="WebSocket.send";if(mi.argumentLengthCheck(arguments,1,r),e=mi.converters.WebSocketSendData(e,r,"data"),SLs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!aGn(this.#o.readyState)||cGn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},aat.text)}else CLs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},aat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},aat.typedArray)):mi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},aat.blob))}get readyState(){return mi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return mi.brandCheck(this,t),this.#t}get url(){return mi.brandCheck(this,t),bLs(this.#s)}get extensions(){return mi.brandCheck(this,t),this.#n}get protocol(){return mi.brandCheck(this,t),this.#r}get onopen(){return mi.brandCheck(this,t),this.#e.open}set onopen(e){mi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return mi.brandCheck(this,t),this.#e.error}set onerror(e){mi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return mi.brandCheck(this,t),this.#e.close}set onclose(e){mi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return mi.brandCheck(this,t),this.#e.message}set onmessage(e){mi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return mi.brandCheck(this,t),this.#a}set binaryType(e){mi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=this.#o.controller.dispatcher?.webSocketOptions,o=n?.maxFragments,s=n?.maxPayloadSize,c=new DLs(this.#o,r,{maxFragments:o,maxPayloadSize:s});c.on("drain",()=>this.#o.onParserDrain()),c.on("error",d=>this.#o.onParserError(d)),this.#c=c,this.#i=new BLs(e.socket),this.#o.readyState=i8.OPEN;let l=e.headersList.get("sec-websocket-extensions");l!==null&&(this.#n=l);let u=e.headersList.get("sec-websocket-protocol");if(u!==null&&(this.#r=u),cat("open",this),G5.open.hasSubscribers){let d=e.headersList.entries;G5.open.publish({address:ULs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:d}})}}#l(e,r){if(this.#o.readyState!==i8.OPEN)return;let n;if(e===jar.TEXT)try{n=xLs(r)}catch{lGn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===jar.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=wLs(r));cat("message",this,LLs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(qar.SENT)&&this.#o.closeState.has(qar.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=i8.CLOSED,this.#o.closeState.has(qar.RECEIVED)||(r=1006,cat("error",this,(s,c)=>new MLs(s,c),{error:new TypeError(n)})),cat("close",this,(s,c)=>new OLs(s,c),{wasClean:e,code:r,reason:n}),G5.close.hasSubscribers&&G5.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(aGn(n)&&!cGn(n)&&!TLs(n)){let o=new FLs(r);e.#o.socket.write(o.createFrame(jar.PING))}}},{ping:QLs}=pv;Reflect.deleteProperty(pv,"ping");pv.CONNECTING=pv.prototype.CONNECTING=i8.CONNECTING;pv.OPEN=pv.prototype.OPEN=i8.OPEN;pv.CLOSING=pv.prototype.CLOSING=i8.CLOSING;pv.CLOSED=pv.prototype.CLOSED=i8.CLOSED;Object.defineProperties(pv.prototype,{CONNECTING:aH,OPEN:aH,CLOSING:aH,CLOSED:aH,url:Gw,readyState:Gw,bufferedAmount:Gw,onopen:Gw,onerror:Gw,onclose:Gw,close:Gw,onmessage:Gw,binaryType:Gw,send:Gw,extensions:Gw,protocol:Gw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(pv,{CONNECTING:aH,OPEN:aH,CLOSING:aH,CLOSED:aH});mi.converters["sequence"]=mi.sequenceConverter(mi.converters.DOMString);mi.converters["DOMString or sequence"]=function(t,e,r){return mi.util.Type(t)===mi.util.Types.OBJECT&&Symbol.iterator in t?mi.converters["sequence"](t):mi.converters.DOMString(t,e,r)};mi.converters.WebSocketInit=mi.dictionaryConverter([{key:"protocols",converter:mi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:mi.converters.any,defaultValue:a(()=>NLs(),"defaultValue")},{key:"headers",converter:mi.nullableConverter(mi.converters.HeadersInit)}]);mi.converters["DOMString or sequence or WebSocketInit"]=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&!(Symbol.iterator in t)?mi.converters.WebSocketInit(t):{protocols:mi.converters["DOMString or sequence"](t)}};mi.converters.WebSocketSendData=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&(mi.is.Blob(t)||mi.is.BufferSource(t))?t:mi.converters.USVString(t)};uGn.exports={WebSocket:pv,ping:QLs}});var Har=I((Qdf,hGn)=>{"use strict";p();var{webidl:lat}=VA(),{validateCloseCodeAndReason:qLs}=tX(),{kConstruct:fGn}=al(),{kEnumerableProperty:pGn}=Do();function jLs(){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(jLs,"createInheritableDOMException");var nX=class t extends jLs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=lat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===fGn)return;r!==null&&(r=lat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";qLs(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,fGn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:HLs}=nX;delete nX.createUnvalidatedWebSocketError;Object.defineProperties(nX.prototype,{closeCode:pGn,reason:pGn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});lat.is.WebSocketError=lat.util.MakeTypeAssertion(nX);hGn.exports={WebSocketError:nX,createUnvalidatedWebSocketError:HLs}});var EGn=I((Hdf,yGn)=>{"use strict";p();var{createDeferredPromise:Gar}=TPe(),{environmentSettingsObject:mGn}=vT(),{states:Upe,opcodes:uat,sentCloseFrameState:Qpe}=sH(),{webidl:yp}=VA(),{getURLRecord:GLs,isValidSubprotocol:$Ls,isEstablished:VLs,utf8Decode:WLs}=tX(),{establishWebSocketConnection:zLs,failWebsocketConnection:$ar,closeWebSocketConnection:Var}=oat(),{channels:gGn}=Qj(),{WebsocketFrameSend:YLs}=Bpe(),{ByteParser:KLs}=Far(),{WebSocketError:JLs,createUnvalidatedWebSocketError:ZLs}=Har(),{kEnumerableProperty:dat}=Do(),{utf8DecodeBytes:XLs}=Dot(),AGn=!1,fat=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=>$ar(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=Upe.CLOSING,gGn.socketError.hasSubscribers&&gGn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Upe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){AGn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),AGn=!0),yp.argumentLengthCheck(arguments,1,"WebSocket"),e=yp.converters.USVString(e),r!==null&&(r=yp.converters.WebSocketStreamOptions(r));let n=mGn.settingsObject.baseUrl,o=GLs(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=>$Ls(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Gar(),this.#r=Gar(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{VLs(this.#a.readyState)||($ar(this.#a),this.#a.readyState=Upe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=mGn.settingsObject;this.#a.controller=zLs(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=yp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Var(this.#a,r,n,!0)}#u(e){e=yp.converters.WebSocketStreamWrite(e);let r=Gar(),n=null,o=null;if(yp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=uat.BINARY;else{let s;try{s=yp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=uat.TEXT}if(!this.#a.closeState.has(Qpe.SENT)&&!this.#a.closeState.has(Qpe.RECEIVED)){let s=new YLs(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=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,o=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new KLs(this.#a,r,{maxFragments:n,maxPayloadSize:o});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",f=>this.#a.onParserError(f)),this.#c=s,this.#a.readyState=Upe.OPEN;let c=r??"",l=e.headersList.get("sec-websocket-protocol")??"",u=new ReadableStream({start:a(f=>{this.#i=f},"start"),cancel:a(f=>this.#h(f),"cancel")}),d=new WritableStream({write:a(f=>this.#u(f),"write"),close:a(()=>Var(this.#a,null,null),"close"),abort:a(f=>this.#A(f),"abort")});this.#n=u,this.#o=d,this.#t.resolve({extensions:c,protocol:l,readable:u,writable:d})}#p(e,r){if(this.#a.readyState!==Upe.OPEN)return;let n;if(e===uat.TEXT)try{n=WLs(r)}catch{$ar(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===uat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Qpe.SENT)&&this.#a.closeState.has(Qpe.RECEIVED);if(this.#a.readyState=Upe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new JLs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Qpe.SENT)&&!this.#a.closeState.has(Qpe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":XLs(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=ZLs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";yp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Var(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(fat.prototype,{url:dat,opened:dat,closed:dat,close:dat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});yp.converters.WebSocketStreamOptions=yp.dictionaryConverter([{key:"protocols",converter:yp.sequenceConverter(yp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:yp.nullableConverter(yp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);yp.converters.WebSocketCloseInfo=yp.dictionaryConverter([{key:"closeCode",converter:a(t=>yp.converters["unsigned short"](t,yp.attributes.EnforceRange),"converter")},{key:"reason",converter:yp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);yp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?yp.converters.USVString(t):yp.converters.BufferSource(t)};yGn.exports={WebSocketStream:fat}});var vGn=I((Vdf,_Gn)=>{"use strict";p();function eBs(t){return t.indexOf("\0")===-1}a(eBs,"isValidLastEventId");function tBs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(tBs,"isASCIINumber");_Gn.exports={isValidLastEventId:eBs,isASCIINumber:tBs}});var TGn=I((Ydf,SGn)=>{"use strict";p();var{Transform:rBs}=require("node:stream"),{isASCIINumber:CGn,isValidLastEventId:bGn}=vGn(),o8=[239,187,191],War=10,pat=13,nBs=58,iBs=32,zar=class extends rBs{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]===o8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===o8[0]&&this.buffer[1]===o8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===o8[0]&&this.buffer[1]===o8[1]&&this.buffer[2]===o8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===o8[0]&&this.buffer[1]===o8[1]&&this.buffer[2]===o8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&CGn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&bGn(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}}};SGn.exports={EventSourceStream:zar}});var NGn=I((Zdf,DGn)=>{"use strict";p();var{pipeline:oBs}=require("node:stream"),{fetching:sBs}=u2e(),{makeRequest:aBs}=Ppe(),{webidl:hv}=VA(),{EventSourceStream:cBs}=TGn(),{parseMIMEType:lBs}=Lw(),{createFastMessageEvent:uBs}=rat(),{isNetworkError:IGn}=a2e(),{kEnumerableProperty:iX}=Do(),{environmentSettingsObject:xGn}=vT(),wGn=!1,RGn=3e3,A2e=0,kGn=1,y2e=2,dBs="anonymous",fBs="use-credentials",qpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=A2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),hv.util.markAsUncloneable(this);let n="EventSource constructor";hv.argumentLengthCheck(arguments,1,n),wGn||(wGn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=hv.converters.USVString(e),r=hv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=xGn,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=dBs;r.withCredentials===!0&&(c=fBs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=xGn.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=aBs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===y2e)return;this.#n=A2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!IGn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(IGn(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?lBs(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=kGn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new cBs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(uBs(u.type,u.options))},"push")});oBs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=sBs(e)}#u(){this.#n!==y2e&&(this.#n=A2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===A2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){hv.brandCheck(this,t),this.#n!==y2e&&(this.#n=y2e,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=hv.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=hv.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=hv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},PGn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:A2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:kGn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:y2e,writable:!1}};Object.defineProperties(qpe,PGn);Object.defineProperties(qpe.prototype,PGn);Object.defineProperties(qpe.prototype,{close:iX,onerror:iX,onmessage:iX,onopen:iX,readyState:iX,url:iX,withCredentials:iX});hv.converters.EventSourceInitDict=hv.dictionaryConverter([{key:"withCredentials",converter:hv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:hv.converters.any},{key:"node",converter:hv.dictionaryConverter([{key:"reconnectionTime",converter:hv.converters["unsigned long"],defaultValue:a(()=>RGn,"defaultValue")},{key:"dispatcher",converter:hv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);DGn.exports={EventSource:qpe,defaultReconnectionTime:RGn}});var Yar=I((tff,vn)=>{"use strict";p();var pBs=Yj(),OGn=yPe(),hBs=OZ(),mBs=MUn(),gBs=FUn(),ABs=FZ(),yBs=Uor(),EBs=Oor(),_Bs=b7n(),vBs=R7n(),CBs=D7n(),LGn=ao(),mat=Do(),{InvalidArgumentError:hat}=LGn,jpe=pQn(),bBs=SZ(),SBs=Ssr(),{MockCallHistory:TBs,MockCallHistoryLog:IBs}=xsr(),xBs=Lsr(),wBs=Psr(),RBs=fqn(),kBs=asr(),PBs=dst(),{getGlobalDispatcher:BGn,setGlobalDispatcher:DBs}=Ist(),NBs=Ipe(),MBs=Gsr();Object.assign(OGn.prototype,jpe);vn.exports.Dispatcher=OGn;vn.exports.Client=pBs;vn.exports.Pool=hBs;vn.exports.BalancedPool=mBs;vn.exports.RoundRobinPool=gBs;vn.exports.Agent=ABs;vn.exports.ProxyAgent=yBs;vn.exports.Socks5ProxyAgent=EBs;vn.exports.EnvHttpProxyAgent=_Bs;vn.exports.RetryAgent=vBs;vn.exports.H2CClient=CBs;vn.exports.RetryHandler=PBs;vn.exports.DecoratorHandler=NBs;vn.exports.RedirectHandler=MBs;vn.exports.interceptors={redirect:bqn(),responseError:Tqn(),retry:xqn(),dump:Rqn(),dns:Nqn(),cache:Kqn(),decompress:tjn(),deduplicate:sjn()};vn.exports.cacheStores={MemoryCacheStore:Xsr()};var OBs=ljn();vn.exports.cacheStores.SqliteCacheStore=OBs;vn.exports.buildConnector=bBs;vn.exports.errors=LGn;vn.exports.util={parseHeaders:mat.parseHeaders,headerNameToString:mat.headerNameToString};function E2e(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 hat("invalid url");if(r!=null&&typeof r!="object")throw new hat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new hat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(mat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=mat.parseURL(e);let{agent:o,dispatcher:s=BGn()}=r;if(o)throw new hat("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(E2e,"makeDispatcher");vn.exports.setGlobalDispatcher=DBs;vn.exports.getGlobalDispatcher=BGn;var LBs=u2e().fetch,MGn=typeof __filename<"u"?__filename:void 0;function FGn(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,FGn),!o.stack)return;let s=o.stack.split(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(NGn,"appendFetchStackTrace");vn.exports.fetch=a(function(e,r=void 0){return vBs(e,r).catch(n=>{throw RGn?NGn(n,RGn):n&&typeof n=="object"&&Error.captureStackTrace(n,vn.exports.fetch),n})},"fetch");vn.exports.Headers=zZ().Headers;vn.exports.Response=i2e().Response;vn.exports.Request=kpe().Request;vn.exports.FormData=Dot().FormData;var{setGlobalOrigin:CBs,getGlobalOrigin:bBs}=mir();vn.exports.setGlobalOrigin=CBs;vn.exports.getGlobalOrigin=bBs;var{CacheStorage:SBs}=hHn(),{kConstruct:TBs}=al();vn.exports.caches=new SBs(TBs);var{deleteCookie:IBs,getCookies:xBs,getSetCookies:wBs,setCookie:RBs,parseCookie:kBs}=xHn();vn.exports.deleteCookie=IBs;vn.exports.getCookies=xBs;vn.exports.getSetCookies=wBs;vn.exports.setCookie=RBs;vn.exports.parseCookie=kBs;var{parseMIMEType:PBs,serializeAMimeType:DBs}=Mw();vn.exports.parseMIMEType=PBs;vn.exports.serializeAMimeType=DBs;var{CloseEvent:NBs,ErrorEvent:MBs,MessageEvent:OBs}=Kst(),{WebSocket:LBs,ping:BBs}=sGn();vn.exports.WebSocket=LBs;vn.exports.CloseEvent=NBs;vn.exports.ErrorEvent=MBs;vn.exports.MessageEvent=OBs;vn.exports.ping=BBs;vn.exports.WebSocketStream=hGn().WebSocketStream;vn.exports.WebSocketError=Uar().WebSocketError;vn.exports.request=g2e(qpe.request);vn.exports.stream=g2e(qpe.stream);vn.exports.pipeline=g2e(qpe.pipeline);vn.exports.connect=g2e(qpe.connect);vn.exports.upgrade=g2e(qpe.upgrade);vn.exports.MockClient=lBs;vn.exports.MockCallHistory=uBs;vn.exports.MockCallHistoryLog=dBs;vn.exports.MockPool=pBs;vn.exports.MockAgent=fBs;vn.exports.SnapshotAgent=hBs;vn.exports.mockErrors=mBs;var{EventSource:FBs}=wGn();vn.exports.EventSource=FBs;function UBs(){globalThis.fetch=vn.exports.fetch,globalThis.Headers=vn.exports.Headers,globalThis.Response=vn.exports.Response,globalThis.Request=vn.exports.Request,globalThis.FormData=vn.exports.FormData,globalThis.WebSocket=vn.exports.WebSocket,globalThis.CloseEvent=vn.exports.CloseEvent,globalThis.ErrorEvent=vn.exports.ErrorEvent,globalThis.MessageEvent=vn.exports.MessageEvent,globalThis.EventSource=vn.exports.EventSource}a(UBs,"install");vn.exports.install=UBs});var ZGn,XGn=ve(()=>{p();ZGn=typeof globalThis=="object"?globalThis:global});var e$n=ve(()=>{p();XGn()});var t$n=ve(()=>{p();e$n()});var i8,icr=ve(()=>{p();i8="1.9.0"});function f3s(t){var e=new Set([t]),r=new Set,n=t.match(r$n);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(r$n);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 r$n,n$n,i$n=ve(()=>{p();icr();r$n=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(f3s,"_makeCompatibilityCheck");n$n=f3s(i8)});function G5(t,e,r,n){var o;n===void 0&&(n=!1);var s=E2e[y2e]=(o=E2e[y2e])!==null&&o!==void 0?o:{version:i8};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!==i8){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+i8);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+i8+"."),!0}function RT(t){var e,r,n=(e=E2e[y2e])===null||e===void 0?void 0:e.version;if(!(!n||!n$n(n)))return(r=E2e[y2e])===null||r===void 0?void 0:r[t]}function $5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+i8+".");var r=E2e[y2e];r&&delete r[t]}var p3s,y2e,E2e,iX=ve(()=>{p();t$n();icr();i$n();p3s=i8.split(".")[0],y2e=Symbol.for("opentelemetry.js.api."+p3s),E2e=ZGn;a(G5,"registerGlobal");a(RT,"getGlobal");a($5,"unregisterGlobal")});function _2e(t,e,r){var n=RT("diag");if(n)return r.unshift(e),n[t].apply(n,m3s([],h3s(r),!1))}var h3s,m3s,o$n,s$n=ve(()=>{p();iX();h3s=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},m3s=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 a$n(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 c$n=ve(()=>{p();Aat();a(a$n,"createLogLevelDiagLogger")});var g3s,A3s,y3s,SE,oX=ve(()=>{p();s$n();c$n();Aat();iX();g3s=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},A3s=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 G5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){$5(y3s,r)},r.createComponentLogger=function(o){return new o$n(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 E3s,_3s,l$n,u$n=ve(()=>{p();E3s=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},_3s=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.")},l$n=(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=E3s(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();d$n=Symbol("BaggageEntryMetadata")});function p$n(t){return t===void 0&&(t={}),new l$n(new Map(Object.entries(t)))}function Hpe(t){return typeof t!="string"&&(v3s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:d$n,toString:a(function(){return t},"toString")}}var v3s,ocr=ve(()=>{p();oX();u$n();f$n();v3s=SE.instance();a(p$n,"createBaggage");a(Hpe,"baggageEntryMetadataFromString")});function _b(t){return Symbol.for(t)}var C3s,yat,v2e=ve(()=>{p();a(_b,"createContextKey");C3s=(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})(),yat=new C3s});var scr,h$n,m$n=ve(()=>{p();scr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],h$n=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();sX=(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)}})(),b3s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return D3s},t.prototype.createHistogram=function(e,r){return N3s},t.prototype.createCounter=function(e,r){return P3s},t.prototype.createUpDownCounter=function(e,r){return M3s},t.prototype.createObservableGauge=function(e,r){return L3s},t.prototype.createObservableCounter=function(e,r){return O3s},t.prototype.createObservableUpDownCounter=function(e,r){return B3s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Eat=(function(){function t(){}return a(t,"NoopMetric"),t})(),S3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Eat),T3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Eat),I3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Eat),x3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Eat),acr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),w3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(acr),R3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(acr),k3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(acr),ccr=new b3s,P3s=new S3s,D3s=new I3s,N3s=new x3s,M3s=new T3s,O3s=new w3s,L3s=new R3s,B3s=new k3s;a(g$n,"createNoopMeter")});var _at,A$n=ve(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(_at||(_at={}))});var vat,Cat,ucr=ve(()=>{p();vat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Cat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var F3s,U3s,y$n,E$n=ve(()=>{p();v2e();F3s=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},U3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();E$n();iX();oX();Q3s=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},q3s=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"})(wf||(wf={}))});var b2e,S2e,Gpe,bat=ve(()=>{p();fcr();b2e="0000000000000000",S2e="00000000000000000000000000000000",Gpe={traceId:S2e,spanId:b2e,traceFlags:wf.NONE}});var aH,Sat=ve(()=>{p();bat();aH=(function(){function t(e){e===void 0&&(e=Gpe),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 Tat(t){return t.getValue(pcr)||void 0}function _$n(){return Tat(sH.getInstance().active())}function T2e(t,e){return t.setValue(pcr,e)}function v$n(t){return t.deleteValue(pcr)}function C$n(t,e){return T2e(t,new aH(e))}function Iat(t){var e;return(e=Tat(t))===null||e===void 0?void 0:e.spanContext()}var pcr,hcr=ve(()=>{p();v2e();Sat();C2e();pcr=_b("OpenTelemetry Context Key SPAN");a(Tat,"getSpan");a(_$n,"getActiveSpan");a(T2e,"setSpan");a(v$n,"deleteSpan");a(C$n,"setSpanContext");a(Iat,"getSpanContext")});function aX(t){return H3s.test(t)&&t!==S2e}function mcr(t){return G3s.test(t)&&t!==b2e}function vb(t){return aX(t.traceId)&&mcr(t.spanId)}function b$n(t){return new aH(t)}var H3s,G3s,xat=ve(()=>{p();bat();Sat();H3s=/^([0-9a-f]{32})$/i,G3s=/^[0-9a-f]{16}$/i;a(aX,"isValidTraceId");a(mcr,"isValidSpanId");a(vb,"isSpanContextValid");a(b$n,"wrapSpanContext")});function $3s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var gcr,wat,Acr=ve(()=>{p();C2e();hcr();Sat();xat();gcr=sH.getInstance(),wat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=gcr.active());var o=!!r?.root;if(o)return new aH;var s=n&&Iat(n);return $3s(s)&&vb(s)?new aH(s):new aH},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??gcr.active(),d=this.startSpan(e,s,u),f=T2e(u,d);return gcr.with(f,l,void 0,d)}},t})();a($3s,"isSpanContext")});var V3s,Rat,ycr=ve(()=>{p();Acr();V3s=new wat,Rat=(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):V3s},t})()});var S$n,T$n=ve(()=>{p();Acr();S$n=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new wat},t})()});var W3s,I2e,Ecr=ve(()=>{p();ycr();T$n();W3s=new S$n,I2e=(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 Rat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:W3s},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 Cb,I$n=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Cb||(Cb={}))});var $pe,x$n=ve(()=>{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"})($pe||($pe={}))});var Vpe,w$n=ve(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Vpe||(Vpe={}))});function R$n(t){return K3s.test(t)}function k$n(t){return J3s.test(t)&&!Z3s.test(t)}var _cr,z3s,Y3s,K3s,J3s,Z3s,P$n=ve(()=>{p();_cr="[_0-9a-z-*/]",z3s="[a-z]"+_cr+"{0,255}",Y3s="[a-z0-9]"+_cr+"{0,240}@[a-z]"+_cr+"{0,13}",K3s=new RegExp("^(?:"+z3s+"|"+Y3s+")$"),J3s=/^[ -~]{0,255}[!-~]$/,Z3s=/,|=/;a(R$n,"validateKey");a(k$n,"validateValue")});var D$n,X3s,N$n,M$n,O$n,L$n=ve(()=>{p();P$n();D$n=32,X3s=512,N$n=",",M$n="=",O$n=(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+M$n+e.get(n)),r},[]).join(N$n)},t.prototype._parse=function(e){e.length>X3s||(this._internalState=e.split(N$n).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(M$n);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);R$n(c)&&k$n(l)&&r.set(c,l)}return r},new Map),this._internalState.size>D$n&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,D$n))))},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 B$n(t){return new O$n(t)}var F$n=ve(()=>{p();L$n();a(B$n,"createTraceState")});var Og,U$n=ve(()=>{p();C2e();Og=sH.getInstance()});var Dn,Q$n=ve(()=>{p();oX();Dn=SE.instance()});var eFs,q$n,j$n=ve(()=>{p();lcr();eFs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return ccr},t})(),q$n=new eFs});var vcr,H$n,G$n=ve(()=>{p();j$n();iX();oX();vcr="metrics",H$n=(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 G5(vcr,e,SE.instance())},t.prototype.getMeterProvider=function(){return RT(vcr)||q$n},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){$5(vcr,SE.instance())},t})()});var cX,$$n=ve(()=>{p();G$n();cX=H$n.getInstance()});var V$n,W$n=ve(()=>{p();V$n=(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 bcr(t){return t.getValue(Ccr)||void 0}function z$n(){return bcr(sH.getInstance().active())}function Y$n(t,e){return t.setValue(Ccr,e)}function K$n(t){return t.deleteValue(Ccr)}var Ccr,J$n=ve(()=>{p();C2e();v2e();Ccr=_b("OpenTelemetry Baggage Key");a(bcr,"getBaggage");a(z$n,"getActiveBaggage");a(Y$n,"setBaggage");a(K$n,"deleteBaggage")});var Scr,tFs,Z$n,X$n=ve(()=>{p();iX();W$n();ucr();J$n();ocr();oX();Scr="propagation",tFs=new V$n,Z$n=(function(){function t(){this.createBaggage=p$n,this.getBaggage=bcr,this.getActiveBaggage=z$n,this.setBaggage=Y$n,this.deleteBaggage=K$n}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return G5(Scr,e,SE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Cat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=vat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){$5(Scr,SE.instance())},t.prototype._getGlobalPropagator=function(){return RT(Scr)||tFs},t})()});var kT,eVn=ve(()=>{p();X$n();kT=Z$n.getInstance()});var Tcr,tVn,rVn=ve(()=>{p();iX();Ecr();xat();hcr();oX();Tcr="trace",tVn=(function(){function t(){this._proxyTracerProvider=new I2e,this.wrapSpanContext=b$n,this.isSpanContextValid=vb,this.deleteSpan=v$n,this.getSpan=Tat,this.getActiveSpan=_$n,this.getSpanContext=Iat,this.setSpan=T2e,this.setSpanContext=C$n}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=G5(Tcr,this._proxyTracerProvider,SE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return RT(Tcr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){$5(Tcr,SE.instance()),this._proxyTracerProvider=new I2e},t})()});var wu,nVn=ve(()=>{p();rVn();wu=tVn.getInstance()});var V5={};ki(V5,{DiagConsoleLogger:()=>h$n,DiagLogLevel:()=>Da,INVALID_SPANID:()=>b2e,INVALID_SPAN_CONTEXT:()=>Gpe,INVALID_TRACEID:()=>S2e,ProxyTracer:()=>Rat,ProxyTracerProvider:()=>I2e,ROOT_CONTEXT:()=>yat,SamplingDecision:()=>Cb,SpanKind:()=>$pe,SpanStatusCode:()=>Vpe,TraceFlags:()=>wf,ValueType:()=>_at,baggageEntryMetadataFromString:()=>Hpe,context:()=>Og,createContextKey:()=>_b,createNoopMeter:()=>g$n,createTraceState:()=>B$n,default:()=>rFs,defaultTextMapGetter:()=>vat,defaultTextMapSetter:()=>Cat,diag:()=>Dn,isSpanContextValid:()=>vb,isValidSpanId:()=>mcr,isValidTraceId:()=>aX,metrics:()=>cX,propagation:()=>kT,trace:()=>wu});var rFs,co=ve(()=>{p();ocr();v2e();m$n();Aat();lcr();A$n();ucr();ycr();Ecr();I$n();x$n();w$n();fcr();F$n();xat();bat();U$n();Q$n();$$n();eVn();nVn();rFs={context:Og,diag:Dn,metrics:cX,propagation:kT,trace:wu}});var eDe=I(cc=>{"use strict";p();Object.defineProperty(cc,"__esModule",{value:!0});cc.regexpCode=cc.getEsmExportName=cc.getProperty=cc.safeStringify=cc.stringify=cc.strConcat=cc.addCodeArg=cc.str=cc._=cc.nil=cc._Code=cc.Name=cc.IDENTIFIER=cc._CodeOrName=void 0;var Z2e=class{static{a(this,"_CodeOrName")}};cc._CodeOrName=Z2e;cc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var AX=class extends Z2e{static{a(this,"Name")}constructor(e){if(super(),!cc.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}}};cc.Name=AX;var Ww=class extends Z2e{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 AX&&(r[n.str]=(r[n.str]||0)+1),r),{})}};cc._Code=Ww;cc.nil=new Ww("");function qVn(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 bb=eDe(),alr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vat;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Vat||(Sb.UsedValueState=Vat={}));Sb.varKinds={const:new bb.Name("const"),let:new bb.Name("let"),var:new bb.Name("var")};var Wat=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof bb.Name?e:this.name(e)}name(e){return new bb.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=Wat;var zat=class extends bb.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,bb._)`.${new bb.Name(r)}[${n}]`}};Sb.ValueScopeName=zat;var f6s=(0,bb._)`\n`,clr=class extends Wat{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?f6s:bb.nil}}get(){return this._scope}name(e){return new zat(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,bb._)`${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=bb.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,Vat.Started);let f=r(d);if(f){let h=this.opts.es5?Sb.varKinds.var:Sb.varKinds.const;s=(0,bb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,bb._)`${s}${f}${this.opts._n}`;else throw new alr(d);u.set(d,Vat.Completed)})}return s}};Sb.ValueScope=clr});var Es=I(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.or=Ps.and=Ps.not=Ps.CodeGen=Ps.operators=Ps.varKinds=Ps.ValueScopeName=Ps.ValueScope=Ps.Scope=Ps.Name=Ps.regexpCode=Ps.stringify=Ps.getProperty=Ps.nil=Ps.strConcat=Ps.str=Ps._=void 0;var Na=eDe(),D2=llr(),fH=eDe();Object.defineProperty(Ps,"_",{enumerable:!0,get:a(function(){return fH._},"get")});Object.defineProperty(Ps,"str",{enumerable:!0,get:a(function(){return fH.str},"get")});Object.defineProperty(Ps,"strConcat",{enumerable:!0,get:a(function(){return fH.strConcat},"get")});Object.defineProperty(Ps,"nil",{enumerable:!0,get:a(function(){return fH.nil},"get")});Object.defineProperty(Ps,"getProperty",{enumerable:!0,get:a(function(){return fH.getProperty},"get")});Object.defineProperty(Ps,"stringify",{enumerable:!0,get:a(function(){return fH.stringify},"get")});Object.defineProperty(Ps,"regexpCode",{enumerable:!0,get:a(function(){return fH.regexpCode},"get")});Object.defineProperty(Ps,"Name",{enumerable:!0,get:a(function(){return fH.Name},"get")});var Zat=llr();Object.defineProperty(Ps,"Scope",{enumerable:!0,get:a(function(){return Zat.Scope},"get")});Object.defineProperty(Ps,"ValueScope",{enumerable:!0,get:a(function(){return Zat.ValueScope},"get")});Object.defineProperty(Ps,"ValueScopeName",{enumerable:!0,get:a(function(){return Zat.ValueScopeName},"get")});Object.defineProperty(Ps,"varKinds",{enumerable:!0,get:a(function(){return Zat.varKinds},"get")});Ps.operators={GT:new Na._Code(">"),GTE:new Na._Code(">="),LT:new Na._Code("<"),LTE:new Na._Code("<="),EQ:new Na._Code("==="),NEQ:new Na._Code("!=="),NOT:new Na._Code("!"),OR:new Na._Code("||"),AND:new Na._Code("&&"),ADD:new Na._Code("+")};var d8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},ulr=class extends d8{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?D2.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=Zpe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Na._CodeOrName?this.rhs.names:{}}},Yat=class extends d8{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 Na.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zpe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Na.Name?{}:{...this.lhs.names};return Jat(e,this.rhs)}},dlr=class extends Yat{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}},flr=class extends d8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},plr=class extends d8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},hlr=class extends d8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},mlr=class extends d8{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=Zpe(this.code,e,r),this}get names(){return this.code instanceof Na._CodeOrName?this.code.names:{}}},tDe=class extends d8{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)||(p6s(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>_X(e,r.names),{})}},f8=class extends tDe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},glr=class extends tDe{static{a(this,"Root")}},Jpe=class extends f8{static{a(this,"Else")}};Jpe.kind="else";var yX=class t extends f8{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 Jpe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(HVn(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=Zpe(this.condition,e,r),this}get names(){let e=super.names;return Jat(e,this.condition),this.else&&_X(e,this.else.names),e}};yX.kind="if";var EX=class extends f8{static{a(this,"For")}};EX.kind="for";var Alr=class extends EX{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=Zpe(this.iteration,e,r),this}get names(){return _X(super.names,this.iteration.names)}},ylr=class extends EX{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?D2.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=Jat(super.names,this.from);return Jat(e,this.to)}},Kat=class extends EX{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=Zpe(this.iterable,e,r),this}get names(){return _X(super.names,this.iterable.names)}},rDe=class extends f8{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)}};rDe.kind="func";var nDe=class extends tDe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};nDe.kind="return";var Elr=class extends f8{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&&_X(e,this.catch.names),this.finally&&_X(e,this.finally.names),e}},iDe=class extends f8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};iDe.kind="catch";var oDe=class extends f8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};oDe.kind="finally";var _lr=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 D2.Scope({parent:e}),this._nodes=[new glr]}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 ulr(e,s,n)),s}const(e,r,n){return this._def(D2.varKinds.const,e,r,n)}let(e,r,n){return this._def(D2.varKinds.let,e,r,n)}var(e,r,n){return this._def(D2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Yat(e,r,n))}add(e,r){return this._leafNode(new dlr(e,Ps.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Na.nil&&this._leafNode(new mlr(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,Na.addCodeArg)(r,o));return r.push("}"),new Na._Code(r)}if(e,r,n){if(this._blockNode(new yX(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 yX(e))}else(){return this._elseNode(new Jpe)}endIf(){return this._endBlockNode(yX,Jpe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Alr(e),r)}forRange(e,r,n,o,s=this.opts.es5?D2.varKinds.var:D2.varKinds.let){let c=this._scope.toName(e);return this._for(new ylr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=D2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Na.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Na._)`${c}.length`,l=>{this.var(s,(0,Na._)`${c}[${l}]`),n(s)})}return this._for(new Kat("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?D2.varKinds.var:D2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Na._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Kat("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(EX)}label(e){return this._leafNode(new flr(e))}break(e){return this._leafNode(new plr(e))}return(e){let r=new nDe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nDe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Elr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new iDe(s),r(s)}return n&&(this._currNode=o.finally=new oDe,this.code(n)),this._endBlockNode(iDe,oDe)}throw(e){return this._leafNode(new hlr(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=Na.nil,n,o){return this._blockNode(new rDe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(rDe)}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 yX))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}};Ps.CodeGen=_lr;function _X(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(_X,"addNames");function Jat(t,e){return e instanceof Na._CodeOrName?_X(t,e.names):t}a(Jat,"addExprNames");function Zpe(t,e,r){if(t instanceof Na.Name)return n(t);if(!o(t))return t;return new Na._Code(t._items.reduce((s,c)=>(c instanceof Na.Name&&(c=n(c)),c instanceof Na._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 Na._Code&&s._items.some(c=>c instanceof Na.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Zpe,"optimizeExpr");function p6s(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(p6s,"subtractNames");function HVn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Na._)`!${vlr(t)}`}a(HVn,"not");Ps.not=HVn;var h6s=GVn(Ps.operators.AND);function m6s(...t){return t.reduce(h6s)}a(m6s,"and");Ps.and=m6s;var g6s=GVn(Ps.operators.OR);function A6s(...t){return t.reduce(g6s)}a(A6s,"or");Ps.or=A6s;function GVn(t){return(e,r)=>e===Na.nil?r:r===Na.nil?e:(0,Na._)`${vlr(e)} ${t} ${vlr(r)}`}a(GVn,"mappend");function vlr(t){return t instanceof Na.Name?t:(0,Na._)`(${t})`}a(vlr,"par")});var Ka=I(js=>{"use strict";p();Object.defineProperty(js,"__esModule",{value:!0});js.checkStrictMode=js.getErrorPath=js.Type=js.useFunc=js.setEvaluated=js.evaluatedPropsToName=js.mergeEvaluated=js.eachItem=js.unescapeJsonPointer=js.escapeJsonPointer=js.escapeFragment=js.unescapeFragment=js.schemaRefOrVal=js.schemaHasRulesButRef=js.schemaHasRules=js.checkUnknownRules=js.alwaysValidSchema=js.toHash=void 0;var Yl=Es(),y6s=eDe();function E6s(t){let e={};for(let r of t)e[r]=!0;return e}a(E6s,"toHash");js.toHash=E6s;function _6s(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(WVn(t,e),!zVn(e,t.self.RULES.all))}a(_6s,"alwaysValidSchema");js.alwaysValidSchema=_6s;function WVn(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]||JVn(t,`unknown keyword: "${s}"`)}a(WVn,"checkUnknownRules");js.checkUnknownRules=WVn;function zVn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(zVn,"schemaHasRules");js.schemaHasRules=zVn;function v6s(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(v6s,"schemaHasRulesButRef");js.schemaHasRulesButRef=v6s;function C6s({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Yl._)`${r}`}return(0,Yl._)`${t}${e}${(0,Yl.getProperty)(n)}`}a(C6s,"schemaRefOrVal");js.schemaRefOrVal=C6s;function b6s(t){return YVn(decodeURIComponent(t))}a(b6s,"unescapeFragment");js.unescapeFragment=b6s;function S6s(t){return encodeURIComponent(blr(t))}a(S6s,"escapeFragment");js.escapeFragment=S6s;function blr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(blr,"escapeJsonPointer");js.escapeJsonPointer=blr;function YVn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(YVn,"unescapeJsonPointer");js.unescapeJsonPointer=YVn;function T6s(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(T6s,"eachItem");js.eachItem=T6s;function $Vn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Yl.Name?(s instanceof Yl.Name?t(o,s,c):e(o,s,c),c):s instanceof Yl.Name?(e(o,c,s),s):r(s,c);return l===Yl.Name&&!(u instanceof Yl.Name)?n(o,u):u}}a($Vn,"makeMergeEvaluated");js.mergeEvaluated={props:$Vn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Yl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Yl._)`${r} || {}`).code((0,Yl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Yl._)`${r} || {}`),Slr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:KVn}),items:$Vn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Yl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Yl._)`${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 KVn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Yl._)`{}`);return e!==void 0&&Slr(t,r,e),r}a(KVn,"evaluatedPropsToName");js.evaluatedPropsToName=KVn;function Slr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Yl._)`${e}${(0,Yl.getProperty)(n)}`,!0))}a(Slr,"setEvaluated");js.setEvaluated=Slr;var VVn={};function I6s(t,e){return t.scopeValue("func",{ref:e,code:VVn[e.code]||(VVn[e.code]=new y6s._Code(e.code))})}a(I6s,"useFunc");js.useFunc=I6s;var Clr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Clr||(js.Type=Clr={}));function x6s(t,e,r){if(t instanceof Yl.Name){let n=e===Clr.Num;return r?n?(0,Yl._)`"[" + ${t} + "]"`:(0,Yl._)`"['" + ${t} + "']"`:n?(0,Yl._)`"/" + ${t}`:(0,Yl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Yl.getProperty)(t).toString():"/"+blr(t)}a(x6s,"getErrorPath");js.getErrorPath=x6s;function JVn(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(JVn,"checkStrictMode");js.checkStrictMode=JVn});var p8=I(Tlr=>{"use strict";p();Object.defineProperty(Tlr,"__esModule",{value:!0});var TE=Es(),w6s={data:new TE.Name("data"),valCxt:new TE.Name("valCxt"),instancePath:new TE.Name("instancePath"),parentData:new TE.Name("parentData"),parentDataProperty:new TE.Name("parentDataProperty"),rootData:new TE.Name("rootData"),dynamicAnchors:new TE.Name("dynamicAnchors"),vErrors:new TE.Name("vErrors"),errors:new TE.Name("errors"),this:new TE.Name("this"),self:new TE.Name("self"),scope:new TE.Name("scope"),json:new TE.Name("json"),jsonPos:new TE.Name("jsonPos"),jsonLen:new TE.Name("jsonLen"),jsonPart:new TE.Name("jsonPart")};Tlr.default=w6s});var sDe=I(IE=>{"use strict";p();Object.defineProperty(IE,"__esModule",{value:!0});IE.extendErrors=IE.resetErrorsCount=IE.reportExtraError=IE.reportError=IE.keyword$DataError=IE.keywordError=void 0;var Ja=Es(),Xat=Ka(),hv=p8();IE.keywordError={message:a(({keyword:t})=>(0,Ja.str)`must pass "${t}" keyword validation`,"message")};IE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ja.str)`"${t}" keyword must be ${e} ($data)`:(0,Ja.str)`"${t}" keyword is invalid ($data)`,"message")};function R6s(t,e=IE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=eWn(t,e,r);n??(c||l)?ZVn(s,u):XVn(o,(0,Ja._)`[${u}]`)}a(R6s,"reportError");IE.reportError=R6s;function k6s(t,e=IE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=eWn(t,e,r);ZVn(o,l),s||c||XVn(n,hv.default.vErrors)}a(k6s,"reportExtraError");IE.reportExtraError=k6s;function P6s(t,e){t.assign(hv.default.errors,e),t.if((0,Ja._)`${hv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ja._)`${hv.default.vErrors}.length`,e),()=>t.assign(hv.default.vErrors,null)))}a(P6s,"resetErrorsCount");IE.resetErrorsCount=P6s;function D6s({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,hv.default.errors,l=>{t.const(c,(0,Ja._)`${hv.default.vErrors}[${l}]`),t.if((0,Ja._)`${c}.instancePath === undefined`,()=>t.assign((0,Ja._)`${c}.instancePath`,(0,Ja.strConcat)(hv.default.instancePath,s.errorPath))),t.assign((0,Ja._)`${c}.schemaPath`,(0,Ja.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ja._)`${c}.schema`,r),t.assign((0,Ja._)`${c}.data`,n))})}a(D6s,"extendErrors");IE.extendErrors=D6s;function ZVn(t,e){let r=t.const("err",e);t.if((0,Ja._)`${hv.default.vErrors} === null`,()=>t.assign(hv.default.vErrors,(0,Ja._)`[${r}]`),(0,Ja._)`${hv.default.vErrors}.push(${r})`),t.code((0,Ja._)`${hv.default.errors}++`)}a(ZVn,"addError");function XVn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ja._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ja._)`${n}.errors`,e),r.return(!1))}a(XVn,"returnErrors");var vX={keyword:new Ja.Name("keyword"),schemaPath:new Ja.Name("schemaPath"),params:new Ja.Name("params"),propertyName:new Ja.Name("propertyName"),message:new Ja.Name("message"),schema:new Ja.Name("schema"),parentSchema:new Ja.Name("parentSchema")};function eWn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ja._)`{}`:N6s(t,e,r)}a(eWn,"errorObjectCode");function N6s(t,e,r={}){let{gen:n,it:o}=t,s=[M6s(o,r),O6s(t,r)];return L6s(t,e,s),n.object(...s)}a(N6s,"errorObject");function M6s({errorPath:t},{instancePath:e}){let r=e?(0,Ja.str)`${t}${(0,Xat.getErrorPath)(e,Xat.Type.Str)}`:t;return[hv.default.instancePath,(0,Ja.strConcat)(hv.default.instancePath,r)]}a(M6s,"errorInstancePath");function O6s({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ja.str)`${e}/${t}`;return r&&(o=(0,Ja.str)`${o}${(0,Xat.getErrorPath)(r,Xat.Type.Str)}`),[vX.schemaPath,o]}a(O6s,"errorSchemaPath");function L6s(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([vX.keyword,o],[vX.params,typeof e=="function"?e(t):e||(0,Ja._)`{}`]),u.messages&&n.push([vX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([vX.schema,c],[vX.parentSchema,(0,Ja._)`${f}${h}`],[hv.default.data,s]),d&&n.push([vX.propertyName,d])}a(L6s,"extraErrorProps")});var rWn=I(Xpe=>{"use strict";p();Object.defineProperty(Xpe,"__esModule",{value:!0});Xpe.boolOrEmptySchema=Xpe.topBoolOrEmptySchema=void 0;var B6s=sDe(),F6s=Es(),U6s=p8(),Q6s={message:"boolean schema is false"};function q6s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?tWn(t,!1):typeof r=="object"&&r.$async===!0?e.return(U6s.default.data):(e.assign((0,F6s._)`${n}.errors`,null),e.return(!0))}a(q6s,"topBoolOrEmptySchema");Xpe.topBoolOrEmptySchema=q6s;function j6s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),tWn(t)):r.var(e,!0)}a(j6s,"boolOrEmptySchema");Xpe.boolOrEmptySchema=j6s;function tWn(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,B6s.reportError)(o,Q6s,void 0,e)}a(tWn,"falseSchemaError")});var Ilr=I(ehe=>{"use strict";p();Object.defineProperty(ehe,"__esModule",{value:!0});ehe.getRules=ehe.isJSONType=void 0;var H6s=["string","number","integer","boolean","null","object","array"],G6s=new Set(H6s);function $6s(t){return typeof t=="string"&&G6s.has(t)}a($6s,"isJSONType");ehe.isJSONType=$6s;function V6s(){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(V6s,"getRules");ehe.getRules=V6s});var xlr=I(pH=>{"use strict";p();Object.defineProperty(pH,"__esModule",{value:!0});pH.shouldUseRule=pH.shouldUseGroup=pH.schemaHasRulesForType=void 0;function W6s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&nWn(t,n)}a(W6s,"schemaHasRulesForType");pH.schemaHasRulesForType=W6s;function nWn(t,e){return e.rules.some(r=>iWn(t,r))}a(nWn,"shouldUseGroup");pH.shouldUseGroup=nWn;function iWn(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(iWn,"shouldUseRule");pH.shouldUseRule=iWn});var aDe=I(xE=>{"use strict";p();Object.defineProperty(xE,"__esModule",{value:!0});xE.reportTypeError=xE.checkDataTypes=xE.checkDataType=xE.coerceAndCheckDataType=xE.getJSONTypes=xE.getSchemaTypes=xE.DataType=void 0;var z6s=Ilr(),Y6s=xlr(),K6s=sDe(),cs=Es(),oWn=Ka(),the;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(the||(xE.DataType=the={}));function J6s(t){let e=sWn(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(J6s,"getSchemaTypes");xE.getSchemaTypes=J6s;function sWn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(z6s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(sWn,"getJSONTypes");xE.getJSONTypes=sWn;function Z6s(t,e){let{gen:r,data:n,opts:o}=t,s=X6s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,Y6s.schemaHasRulesForType)(t,e[0]));if(c){let l=Rlr(e,n,o.strictNumbers,the.Wrong);r.if(l,()=>{s.length?e9s(t,e,s):klr(t)})}return c}a(Z6s,"coerceAndCheckDataType");xE.coerceAndCheckDataType=Z6s;var aWn=new Set(["string","number","integer","boolean","null"]);function X6s(t,e){return e?t.filter(r=>aWn.has(r)||e==="array"&&r==="array"):[]}a(X6s,"coerceToTypes");function e9s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,cs._)`typeof ${o}`),l=n.let("coerced",(0,cs._)`undefined`);s.coerceTypes==="array"&&n.if((0,cs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,cs._)`${o}[0]`).assign(c,(0,cs._)`typeof ${o}`).if(Rlr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,cs._)`${l} !== undefined`);for(let d of r)(aWn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),klr(t),n.endIf(),n.if((0,cs._)`${l} !== undefined`,()=>{n.assign(o,l),t9s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,cs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,cs._)`"" + ${o}`).elseIf((0,cs._)`${o} === null`).assign(l,(0,cs._)`""`);return;case"number":n.elseIf((0,cs._)`${c} == "boolean" || ${o} === null +${s}`:o.stack}a(FGn,"appendFetchStackTrace");vn.exports.fetch=a(function(e,r=void 0){return LBs(e,r).catch(n=>{throw MGn?FGn(n,MGn):n&&typeof n=="object"&&Error.captureStackTrace(n,vn.exports.fetch),n})},"fetch");vn.exports.Headers=KZ().Headers;vn.exports.Response=a2e().Response;vn.exports.Request=Ppe().Request;vn.exports.FormData=Fot().FormData;var{setGlobalOrigin:BBs,getGlobalOrigin:FBs}=Eir();vn.exports.setGlobalOrigin=BBs;vn.exports.getGlobalOrigin=FBs;var{CacheStorage:UBs}=EHn(),{kConstruct:QBs}=al();vn.exports.caches=new UBs(QBs);var{deleteCookie:qBs,getCookies:jBs,getSetCookies:HBs,setCookie:GBs,parseCookie:$Bs}=DHn();vn.exports.deleteCookie=qBs;vn.exports.getCookies=jBs;vn.exports.getSetCookies=HBs;vn.exports.setCookie=GBs;vn.exports.parseCookie=$Bs;var{parseMIMEType:VBs,serializeAMimeType:WBs}=Lw();vn.exports.parseMIMEType=VBs;vn.exports.serializeAMimeType=WBs;var{CloseEvent:zBs,ErrorEvent:YBs,MessageEvent:KBs}=rat(),{WebSocket:JBs,ping:ZBs}=dGn();vn.exports.WebSocket=JBs;vn.exports.CloseEvent=zBs;vn.exports.ErrorEvent=YBs;vn.exports.MessageEvent=KBs;vn.exports.ping=ZBs;vn.exports.WebSocketStream=EGn().WebSocketStream;vn.exports.WebSocketError=Har().WebSocketError;vn.exports.request=E2e(jpe.request);vn.exports.stream=E2e(jpe.stream);vn.exports.pipeline=E2e(jpe.pipeline);vn.exports.connect=E2e(jpe.connect);vn.exports.upgrade=E2e(jpe.upgrade);vn.exports.MockClient=SBs;vn.exports.MockCallHistory=TBs;vn.exports.MockCallHistoryLog=IBs;vn.exports.MockPool=wBs;vn.exports.MockAgent=xBs;vn.exports.SnapshotAgent=RBs;vn.exports.mockErrors=kBs;var{EventSource:XBs}=NGn();vn.exports.EventSource=XBs;function e3s(){globalThis.fetch=vn.exports.fetch,globalThis.Headers=vn.exports.Headers,globalThis.Response=vn.exports.Response,globalThis.Request=vn.exports.Request,globalThis.FormData=vn.exports.FormData,globalThis.WebSocket=vn.exports.WebSocket,globalThis.CloseEvent=vn.exports.CloseEvent,globalThis.ErrorEvent=vn.exports.ErrorEvent,globalThis.MessageEvent=vn.exports.MessageEvent,globalThis.EventSource=vn.exports.EventSource}a(e3s,"install");vn.exports.install=e3s});var n$n,i$n=ve(()=>{p();n$n=typeof globalThis=="object"?globalThis:global});var o$n=ve(()=>{p();i$n()});var s$n=ve(()=>{p();o$n()});var s8,ccr=ve(()=>{p();s8="1.9.0"});function x3s(t){var e=new Set([t]),r=new Set,n=t.match(a$n);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(a$n);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 a$n,c$n,l$n=ve(()=>{p();ccr();a$n=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(x3s,"_makeCompatibilityCheck");c$n=x3s(s8)});function V5(t,e,r,n){var o;n===void 0&&(n=!1);var s=C2e[v2e]=(o=C2e[v2e])!==null&&o!==void 0?o:{version:s8};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!==s8){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+s8);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+s8+"."),!0}function PT(t){var e,r,n=(e=C2e[v2e])===null||e===void 0?void 0:e.version;if(!(!n||!c$n(n)))return(r=C2e[v2e])===null||r===void 0?void 0:r[t]}function W5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+s8+".");var r=C2e[v2e];r&&delete r[t]}var w3s,v2e,C2e,sX=ve(()=>{p();s$n();ccr();l$n();w3s=s8.split(".")[0],v2e=Symbol.for("opentelemetry.js.api."+w3s),C2e=n$n;a(V5,"registerGlobal");a(PT,"getGlobal");a(W5,"unregisterGlobal")});function b2e(t,e,r){var n=PT("diag");if(n)return r.unshift(e),n[t].apply(n,k3s([],R3s(r),!1))}var R3s,k3s,u$n,d$n=ve(()=>{p();sX();R3s=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},k3s=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"})(Na||(Na={}))});function f$n(t,e){tNa.ALL&&(t=Na.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",Na.ERROR),warn:r("warn",Na.WARN),info:r("info",Na.INFO),debug:r("debug",Na.DEBUG),verbose:r("verbose",Na.VERBOSE)}}var p$n=ve(()=>{p();bat();a(f$n,"createLogLevelDiagLogger")});var P3s,D3s,N3s,TE,aX=ve(()=>{p();d$n();p$n();bat();sX();P3s=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},D3s=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 V5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){W5(N3s,r)},r.createComponentLogger=function(o){return new u$n(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 M3s,O3s,h$n,m$n=ve(()=>{p();M3s=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},O3s=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.")},h$n=(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=M3s(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();g$n=Symbol("BaggageEntryMetadata")});function y$n(t){return t===void 0&&(t={}),new h$n(new Map(Object.entries(t)))}function Gpe(t){return typeof t!="string"&&(L3s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:g$n,toString:a(function(){return t},"toString")}}var L3s,lcr=ve(()=>{p();aX();m$n();A$n();L3s=TE.instance();a(y$n,"createBaggage");a(Gpe,"baggageEntryMetadataFromString")});function _b(t){return Symbol.for(t)}var B3s,Sat,S2e=ve(()=>{p();a(_b,"createContextKey");B3s=(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})(),Sat=new B3s});var ucr,E$n,_$n=ve(()=>{p();ucr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],E$n=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();cX=(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)}})(),F3s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return W3s},t.prototype.createHistogram=function(e,r){return z3s},t.prototype.createCounter=function(e,r){return V3s},t.prototype.createUpDownCounter=function(e,r){return Y3s},t.prototype.createObservableGauge=function(e,r){return J3s},t.prototype.createObservableCounter=function(e,r){return K3s},t.prototype.createObservableUpDownCounter=function(e,r){return Z3s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Tat=(function(){function t(){}return a(t,"NoopMetric"),t})(),U3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Tat),Q3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Tat),q3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Tat),j3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Tat),dcr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),H3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(dcr),G3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(dcr),$3s=(function(t){cX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(dcr),fcr=new F3s,V3s=new U3s,W3s=new q3s,z3s=new j3s,Y3s=new Q3s,K3s=new H3s,J3s=new G3s,Z3s=new $3s;a(v$n,"createNoopMeter")});var Iat,C$n=ve(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Iat||(Iat={}))});var xat,wat,hcr=ve(()=>{p();xat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},wat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var X3s,eFs,b$n,S$n=ve(()=>{p();S2e();X3s=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},eFs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();S$n();sX();aX();tFs=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},rFs=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"})(kf||(kf={}))});var I2e,x2e,$pe,Rat=ve(()=>{p();gcr();I2e="0000000000000000",x2e="00000000000000000000000000000000",$pe={traceId:x2e,spanId:I2e,traceFlags:kf.NONE}});var uH,kat=ve(()=>{p();Rat();uH=(function(){function t(e){e===void 0&&(e=$pe),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 Pat(t){return t.getValue(Acr)||void 0}function T$n(){return Pat(lH.getInstance().active())}function w2e(t,e){return t.setValue(Acr,e)}function I$n(t){return t.deleteValue(Acr)}function x$n(t,e){return w2e(t,new uH(e))}function Dat(t){var e;return(e=Pat(t))===null||e===void 0?void 0:e.spanContext()}var Acr,ycr=ve(()=>{p();S2e();kat();T2e();Acr=_b("OpenTelemetry Context Key SPAN");a(Pat,"getSpan");a(T$n,"getActiveSpan");a(w2e,"setSpan");a(I$n,"deleteSpan");a(x$n,"setSpanContext");a(Dat,"getSpanContext")});function lX(t){return iFs.test(t)&&t!==x2e}function Ecr(t){return oFs.test(t)&&t!==I2e}function vb(t){return lX(t.traceId)&&Ecr(t.spanId)}function w$n(t){return new uH(t)}var iFs,oFs,Nat=ve(()=>{p();Rat();kat();iFs=/^([0-9a-f]{32})$/i,oFs=/^[0-9a-f]{16}$/i;a(lX,"isValidTraceId");a(Ecr,"isValidSpanId");a(vb,"isSpanContextValid");a(w$n,"wrapSpanContext")});function sFs(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var _cr,Mat,vcr=ve(()=>{p();T2e();ycr();kat();Nat();_cr=lH.getInstance(),Mat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=_cr.active());var o=!!r?.root;if(o)return new uH;var s=n&&Dat(n);return sFs(s)&&vb(s)?new uH(s):new uH},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??_cr.active(),d=this.startSpan(e,s,u),f=w2e(u,d);return _cr.with(f,l,void 0,d)}},t})();a(sFs,"isSpanContext")});var aFs,Oat,Ccr=ve(()=>{p();vcr();aFs=new Mat,Oat=(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):aFs},t})()});var R$n,k$n=ve(()=>{p();vcr();R$n=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new Mat},t})()});var cFs,R2e,bcr=ve(()=>{p();Ccr();k$n();cFs=new R$n,R2e=(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 Oat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:cFs},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 Cb,P$n=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Cb||(Cb={}))});var Vpe,D$n=ve(()=>{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"})(Vpe||(Vpe={}))});var Wpe,N$n=ve(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Wpe||(Wpe={}))});function M$n(t){return dFs.test(t)}function O$n(t){return fFs.test(t)&&!pFs.test(t)}var Scr,lFs,uFs,dFs,fFs,pFs,L$n=ve(()=>{p();Scr="[_0-9a-z-*/]",lFs="[a-z]"+Scr+"{0,255}",uFs="[a-z0-9]"+Scr+"{0,240}@[a-z]"+Scr+"{0,13}",dFs=new RegExp("^(?:"+lFs+"|"+uFs+")$"),fFs=/^[ -~]{0,255}[!-~]$/,pFs=/,|=/;a(M$n,"validateKey");a(O$n,"validateValue")});var B$n,hFs,F$n,U$n,Q$n,q$n=ve(()=>{p();L$n();B$n=32,hFs=512,F$n=",",U$n="=",Q$n=(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+U$n+e.get(n)),r},[]).join(F$n)},t.prototype._parse=function(e){e.length>hFs||(this._internalState=e.split(F$n).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(U$n);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);M$n(c)&&O$n(l)&&r.set(c,l)}return r},new Map),this._internalState.size>B$n&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,B$n))))},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 j$n(t){return new Q$n(t)}var H$n=ve(()=>{p();q$n();a(j$n,"createTraceState")});var Lg,G$n=ve(()=>{p();T2e();Lg=lH.getInstance()});var Dn,$$n=ve(()=>{p();aX();Dn=TE.instance()});var mFs,V$n,W$n=ve(()=>{p();pcr();mFs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return fcr},t})(),V$n=new mFs});var Tcr,z$n,Y$n=ve(()=>{p();W$n();sX();aX();Tcr="metrics",z$n=(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 V5(Tcr,e,TE.instance())},t.prototype.getMeterProvider=function(){return PT(Tcr)||V$n},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){W5(Tcr,TE.instance())},t})()});var uX,K$n=ve(()=>{p();Y$n();uX=z$n.getInstance()});var J$n,Z$n=ve(()=>{p();J$n=(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 xcr(t){return t.getValue(Icr)||void 0}function X$n(){return xcr(lH.getInstance().active())}function eVn(t,e){return t.setValue(Icr,e)}function tVn(t){return t.deleteValue(Icr)}var Icr,rVn=ve(()=>{p();T2e();S2e();Icr=_b("OpenTelemetry Baggage Key");a(xcr,"getBaggage");a(X$n,"getActiveBaggage");a(eVn,"setBaggage");a(tVn,"deleteBaggage")});var wcr,gFs,nVn,iVn=ve(()=>{p();sX();Z$n();hcr();rVn();lcr();aX();wcr="propagation",gFs=new J$n,nVn=(function(){function t(){this.createBaggage=y$n,this.getBaggage=xcr,this.getActiveBaggage=X$n,this.setBaggage=eVn,this.deleteBaggage=tVn}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return V5(wcr,e,TE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=wat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=xat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){W5(wcr,TE.instance())},t.prototype._getGlobalPropagator=function(){return PT(wcr)||gFs},t})()});var DT,oVn=ve(()=>{p();iVn();DT=nVn.getInstance()});var Rcr,sVn,aVn=ve(()=>{p();sX();bcr();Nat();ycr();aX();Rcr="trace",sVn=(function(){function t(){this._proxyTracerProvider=new R2e,this.wrapSpanContext=w$n,this.isSpanContextValid=vb,this.deleteSpan=I$n,this.getSpan=Pat,this.getActiveSpan=T$n,this.getSpanContext=Dat,this.setSpan=w2e,this.setSpanContext=x$n}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=V5(Rcr,this._proxyTracerProvider,TE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return PT(Rcr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){W5(Rcr,TE.instance()),this._proxyTracerProvider=new R2e},t})()});var wu,cVn=ve(()=>{p();aVn();wu=sVn.getInstance()});var z5={};ki(z5,{DiagConsoleLogger:()=>E$n,DiagLogLevel:()=>Na,INVALID_SPANID:()=>I2e,INVALID_SPAN_CONTEXT:()=>$pe,INVALID_TRACEID:()=>x2e,ProxyTracer:()=>Oat,ProxyTracerProvider:()=>R2e,ROOT_CONTEXT:()=>Sat,SamplingDecision:()=>Cb,SpanKind:()=>Vpe,SpanStatusCode:()=>Wpe,TraceFlags:()=>kf,ValueType:()=>Iat,baggageEntryMetadataFromString:()=>Gpe,context:()=>Lg,createContextKey:()=>_b,createNoopMeter:()=>v$n,createTraceState:()=>j$n,default:()=>AFs,defaultTextMapGetter:()=>xat,defaultTextMapSetter:()=>wat,diag:()=>Dn,isSpanContextValid:()=>vb,isValidSpanId:()=>Ecr,isValidTraceId:()=>lX,metrics:()=>uX,propagation:()=>DT,trace:()=>wu});var AFs,co=ve(()=>{p();lcr();S2e();_$n();bat();pcr();C$n();hcr();Ccr();bcr();P$n();D$n();N$n();gcr();H$n();Nat();Rat();G$n();$$n();K$n();oVn();cVn();AFs={context:Lg,diag:Dn,metrics:uX,propagation:DT,trace:wu}});var nDe=I(lc=>{"use strict";p();Object.defineProperty(lc,"__esModule",{value:!0});lc.regexpCode=lc.getEsmExportName=lc.getProperty=lc.safeStringify=lc.stringify=lc.strConcat=lc.addCodeArg=lc.str=lc._=lc.nil=lc._Code=lc.Name=lc.IDENTIFIER=lc._CodeOrName=void 0;var tDe=class{static{a(this,"_CodeOrName")}};lc._CodeOrName=tDe;lc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var EX=class extends tDe{static{a(this,"Name")}constructor(e){if(super(),!lc.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}}};lc.Name=EX;var Yw=class extends tDe{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 EX&&(r[n.str]=(r[n.str]||0)+1),r),{})}};lc._Code=Yw;lc.nil=new Yw("");function VVn(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 bb=nDe(),dlr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Zat;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Zat||(Sb.UsedValueState=Zat={}));Sb.varKinds={const:new bb.Name("const"),let:new bb.Name("let"),var:new bb.Name("var")};var Xat=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof bb.Name?e:this.name(e)}name(e){return new bb.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=Xat;var ect=class extends bb.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,bb._)`.${new bb.Name(r)}[${n}]`}};Sb.ValueScopeName=ect;var x6s=(0,bb._)`\n`,flr=class extends Xat{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?x6s:bb.nil}}get(){return this._scope}name(e){return new ect(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,bb._)`${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=bb.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,Zat.Started);let f=r(d);if(f){let h=this.opts.es5?Sb.varKinds.var:Sb.varKinds.const;s=(0,bb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,bb._)`${s}${f}${this.opts._n}`;else throw new dlr(d);u.set(d,Zat.Completed)})}return s}};Sb.ValueScope=flr});var Es=I(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.or=Ps.and=Ps.not=Ps.CodeGen=Ps.operators=Ps.varKinds=Ps.ValueScopeName=Ps.ValueScope=Ps.Scope=Ps.Name=Ps.regexpCode=Ps.stringify=Ps.getProperty=Ps.nil=Ps.strConcat=Ps.str=Ps._=void 0;var Ma=nDe(),M2=plr(),mH=nDe();Object.defineProperty(Ps,"_",{enumerable:!0,get:a(function(){return mH._},"get")});Object.defineProperty(Ps,"str",{enumerable:!0,get:a(function(){return mH.str},"get")});Object.defineProperty(Ps,"strConcat",{enumerable:!0,get:a(function(){return mH.strConcat},"get")});Object.defineProperty(Ps,"nil",{enumerable:!0,get:a(function(){return mH.nil},"get")});Object.defineProperty(Ps,"getProperty",{enumerable:!0,get:a(function(){return mH.getProperty},"get")});Object.defineProperty(Ps,"stringify",{enumerable:!0,get:a(function(){return mH.stringify},"get")});Object.defineProperty(Ps,"regexpCode",{enumerable:!0,get:a(function(){return mH.regexpCode},"get")});Object.defineProperty(Ps,"Name",{enumerable:!0,get:a(function(){return mH.Name},"get")});var ict=plr();Object.defineProperty(Ps,"Scope",{enumerable:!0,get:a(function(){return ict.Scope},"get")});Object.defineProperty(Ps,"ValueScope",{enumerable:!0,get:a(function(){return ict.ValueScope},"get")});Object.defineProperty(Ps,"ValueScopeName",{enumerable:!0,get:a(function(){return ict.ValueScopeName},"get")});Object.defineProperty(Ps,"varKinds",{enumerable:!0,get:a(function(){return ict.varKinds},"get")});Ps.operators={GT:new Ma._Code(">"),GTE:new Ma._Code(">="),LT:new Ma._Code("<"),LTE:new Ma._Code("<="),EQ:new Ma._Code("==="),NEQ:new Ma._Code("!=="),NOT:new Ma._Code("!"),OR:new Ma._Code("||"),AND:new Ma._Code("&&"),ADD:new Ma._Code("+")};var p8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},hlr=class extends p8{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?M2.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=Xpe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ma._CodeOrName?this.rhs.names:{}}},tct=class extends p8{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 Ma.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Xpe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ma.Name?{}:{...this.lhs.names};return nct(e,this.rhs)}},mlr=class extends tct{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}},glr=class extends p8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Alr=class extends p8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},ylr=class extends p8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Elr=class extends p8{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=Xpe(this.code,e,r),this}get names(){return this.code instanceof Ma._CodeOrName?this.code.names:{}}},iDe=class extends p8{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)||(w6s(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>CX(e,r.names),{})}},h8=class extends iDe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},_lr=class extends iDe{static{a(this,"Root")}},Zpe=class extends h8{static{a(this,"Else")}};Zpe.kind="else";var _X=class t extends h8{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 Zpe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(zVn(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=Xpe(this.condition,e,r),this}get names(){let e=super.names;return nct(e,this.condition),this.else&&CX(e,this.else.names),e}};_X.kind="if";var vX=class extends h8{static{a(this,"For")}};vX.kind="for";var vlr=class extends vX{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=Xpe(this.iteration,e,r),this}get names(){return CX(super.names,this.iteration.names)}},Clr=class extends vX{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?M2.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=nct(super.names,this.from);return nct(e,this.to)}},rct=class extends vX{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=Xpe(this.iterable,e,r),this}get names(){return CX(super.names,this.iterable.names)}},oDe=class extends h8{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)}};oDe.kind="func";var sDe=class extends iDe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};sDe.kind="return";var blr=class extends h8{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&&CX(e,this.catch.names),this.finally&&CX(e,this.finally.names),e}},aDe=class extends h8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};aDe.kind="catch";var cDe=class extends h8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};cDe.kind="finally";var Slr=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 M2.Scope({parent:e}),this._nodes=[new _lr]}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 hlr(e,s,n)),s}const(e,r,n){return this._def(M2.varKinds.const,e,r,n)}let(e,r,n){return this._def(M2.varKinds.let,e,r,n)}var(e,r,n){return this._def(M2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new tct(e,r,n))}add(e,r){return this._leafNode(new mlr(e,Ps.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ma.nil&&this._leafNode(new Elr(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,Ma.addCodeArg)(r,o));return r.push("}"),new Ma._Code(r)}if(e,r,n){if(this._blockNode(new _X(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 _X(e))}else(){return this._elseNode(new Zpe)}endIf(){return this._endBlockNode(_X,Zpe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new vlr(e),r)}forRange(e,r,n,o,s=this.opts.es5?M2.varKinds.var:M2.varKinds.let){let c=this._scope.toName(e);return this._for(new Clr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=M2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Ma.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ma._)`${c}.length`,l=>{this.var(s,(0,Ma._)`${c}[${l}]`),n(s)})}return this._for(new rct("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?M2.varKinds.var:M2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ma._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new rct("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(vX)}label(e){return this._leafNode(new glr(e))}break(e){return this._leafNode(new Alr(e))}return(e){let r=new sDe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(sDe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new blr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new aDe(s),r(s)}return n&&(this._currNode=o.finally=new cDe,this.code(n)),this._endBlockNode(aDe,cDe)}throw(e){return this._leafNode(new ylr(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=Ma.nil,n,o){return this._blockNode(new oDe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(oDe)}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 _X))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}};Ps.CodeGen=Slr;function CX(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(CX,"addNames");function nct(t,e){return e instanceof Ma._CodeOrName?CX(t,e.names):t}a(nct,"addExprNames");function Xpe(t,e,r){if(t instanceof Ma.Name)return n(t);if(!o(t))return t;return new Ma._Code(t._items.reduce((s,c)=>(c instanceof Ma.Name&&(c=n(c)),c instanceof Ma._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 Ma._Code&&s._items.some(c=>c instanceof Ma.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Xpe,"optimizeExpr");function w6s(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(w6s,"subtractNames");function zVn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ma._)`!${Tlr(t)}`}a(zVn,"not");Ps.not=zVn;var R6s=YVn(Ps.operators.AND);function k6s(...t){return t.reduce(R6s)}a(k6s,"and");Ps.and=k6s;var P6s=YVn(Ps.operators.OR);function D6s(...t){return t.reduce(P6s)}a(D6s,"or");Ps.or=D6s;function YVn(t){return(e,r)=>e===Ma.nil?r:r===Ma.nil?e:(0,Ma._)`${Tlr(e)} ${t} ${Tlr(r)}`}a(YVn,"mappend");function Tlr(t){return t instanceof Ma.Name?t:(0,Ma._)`(${t})`}a(Tlr,"par")});var Ja=I(js=>{"use strict";p();Object.defineProperty(js,"__esModule",{value:!0});js.checkStrictMode=js.getErrorPath=js.Type=js.useFunc=js.setEvaluated=js.evaluatedPropsToName=js.mergeEvaluated=js.eachItem=js.unescapeJsonPointer=js.escapeJsonPointer=js.escapeFragment=js.unescapeFragment=js.schemaRefOrVal=js.schemaHasRulesButRef=js.schemaHasRules=js.checkUnknownRules=js.alwaysValidSchema=js.toHash=void 0;var Yl=Es(),N6s=nDe();function M6s(t){let e={};for(let r of t)e[r]=!0;return e}a(M6s,"toHash");js.toHash=M6s;function O6s(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(ZVn(t,e),!XVn(e,t.self.RULES.all))}a(O6s,"alwaysValidSchema");js.alwaysValidSchema=O6s;function ZVn(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]||rWn(t,`unknown keyword: "${s}"`)}a(ZVn,"checkUnknownRules");js.checkUnknownRules=ZVn;function XVn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(XVn,"schemaHasRules");js.schemaHasRules=XVn;function L6s(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(L6s,"schemaHasRulesButRef");js.schemaHasRulesButRef=L6s;function B6s({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Yl._)`${r}`}return(0,Yl._)`${t}${e}${(0,Yl.getProperty)(n)}`}a(B6s,"schemaRefOrVal");js.schemaRefOrVal=B6s;function F6s(t){return eWn(decodeURIComponent(t))}a(F6s,"unescapeFragment");js.unescapeFragment=F6s;function U6s(t){return encodeURIComponent(xlr(t))}a(U6s,"escapeFragment");js.escapeFragment=U6s;function xlr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(xlr,"escapeJsonPointer");js.escapeJsonPointer=xlr;function eWn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(eWn,"unescapeJsonPointer");js.unescapeJsonPointer=eWn;function Q6s(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(Q6s,"eachItem");js.eachItem=Q6s;function KVn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Yl.Name?(s instanceof Yl.Name?t(o,s,c):e(o,s,c),c):s instanceof Yl.Name?(e(o,c,s),s):r(s,c);return l===Yl.Name&&!(u instanceof Yl.Name)?n(o,u):u}}a(KVn,"makeMergeEvaluated");js.mergeEvaluated={props:KVn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Yl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Yl._)`${r} || {}`).code((0,Yl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Yl._)`${r} || {}`),wlr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:tWn}),items:KVn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Yl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Yl._)`${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 tWn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Yl._)`{}`);return e!==void 0&&wlr(t,r,e),r}a(tWn,"evaluatedPropsToName");js.evaluatedPropsToName=tWn;function wlr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Yl._)`${e}${(0,Yl.getProperty)(n)}`,!0))}a(wlr,"setEvaluated");js.setEvaluated=wlr;var JVn={};function q6s(t,e){return t.scopeValue("func",{ref:e,code:JVn[e.code]||(JVn[e.code]=new N6s._Code(e.code))})}a(q6s,"useFunc");js.useFunc=q6s;var Ilr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Ilr||(js.Type=Ilr={}));function j6s(t,e,r){if(t instanceof Yl.Name){let n=e===Ilr.Num;return r?n?(0,Yl._)`"[" + ${t} + "]"`:(0,Yl._)`"['" + ${t} + "']"`:n?(0,Yl._)`"/" + ${t}`:(0,Yl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Yl.getProperty)(t).toString():"/"+xlr(t)}a(j6s,"getErrorPath");js.getErrorPath=j6s;function rWn(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(rWn,"checkStrictMode");js.checkStrictMode=rWn});var m8=I(Rlr=>{"use strict";p();Object.defineProperty(Rlr,"__esModule",{value:!0});var IE=Es(),H6s={data:new IE.Name("data"),valCxt:new IE.Name("valCxt"),instancePath:new IE.Name("instancePath"),parentData:new IE.Name("parentData"),parentDataProperty:new IE.Name("parentDataProperty"),rootData:new IE.Name("rootData"),dynamicAnchors:new IE.Name("dynamicAnchors"),vErrors:new IE.Name("vErrors"),errors:new IE.Name("errors"),this:new IE.Name("this"),self:new IE.Name("self"),scope:new IE.Name("scope"),json:new IE.Name("json"),jsonPos:new IE.Name("jsonPos"),jsonLen:new IE.Name("jsonLen"),jsonPart:new IE.Name("jsonPart")};Rlr.default=H6s});var lDe=I(xE=>{"use strict";p();Object.defineProperty(xE,"__esModule",{value:!0});xE.extendErrors=xE.resetErrorsCount=xE.reportExtraError=xE.reportError=xE.keyword$DataError=xE.keywordError=void 0;var Za=Es(),oct=Ja(),gv=m8();xE.keywordError={message:a(({keyword:t})=>(0,Za.str)`must pass "${t}" keyword validation`,"message")};xE.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 G6s(t,e=xE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=oWn(t,e,r);n??(c||l)?nWn(s,u):iWn(o,(0,Za._)`[${u}]`)}a(G6s,"reportError");xE.reportError=G6s;function $6s(t,e=xE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=oWn(t,e,r);nWn(o,l),s||c||iWn(n,gv.default.vErrors)}a($6s,"reportExtraError");xE.reportExtraError=$6s;function V6s(t,e){t.assign(gv.default.errors,e),t.if((0,Za._)`${gv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Za._)`${gv.default.vErrors}.length`,e),()=>t.assign(gv.default.vErrors,null)))}a(V6s,"resetErrorsCount");xE.resetErrorsCount=V6s;function W6s({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,gv.default.errors,l=>{t.const(c,(0,Za._)`${gv.default.vErrors}[${l}]`),t.if((0,Za._)`${c}.instancePath === undefined`,()=>t.assign((0,Za._)`${c}.instancePath`,(0,Za.strConcat)(gv.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(W6s,"extendErrors");xE.extendErrors=W6s;function nWn(t,e){let r=t.const("err",e);t.if((0,Za._)`${gv.default.vErrors} === null`,()=>t.assign(gv.default.vErrors,(0,Za._)`[${r}]`),(0,Za._)`${gv.default.vErrors}.push(${r})`),t.code((0,Za._)`${gv.default.errors}++`)}a(nWn,"addError");function iWn(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(iWn,"returnErrors");var bX={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 oWn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Za._)`{}`:z6s(t,e,r)}a(oWn,"errorObjectCode");function z6s(t,e,r={}){let{gen:n,it:o}=t,s=[Y6s(o,r),K6s(t,r)];return J6s(t,e,s),n.object(...s)}a(z6s,"errorObject");function Y6s({errorPath:t},{instancePath:e}){let r=e?(0,Za.str)`${t}${(0,oct.getErrorPath)(e,oct.Type.Str)}`:t;return[gv.default.instancePath,(0,Za.strConcat)(gv.default.instancePath,r)]}a(Y6s,"errorInstancePath");function K6s({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,oct.getErrorPath)(r,oct.Type.Str)}`),[bX.schemaPath,o]}a(K6s,"errorSchemaPath");function J6s(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([bX.keyword,o],[bX.params,typeof e=="function"?e(t):e||(0,Za._)`{}`]),u.messages&&n.push([bX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([bX.schema,c],[bX.parentSchema,(0,Za._)`${f}${h}`],[gv.default.data,s]),d&&n.push([bX.propertyName,d])}a(J6s,"extraErrorProps")});var aWn=I(ehe=>{"use strict";p();Object.defineProperty(ehe,"__esModule",{value:!0});ehe.boolOrEmptySchema=ehe.topBoolOrEmptySchema=void 0;var Z6s=lDe(),X6s=Es(),e9s=m8(),t9s={message:"boolean schema is false"};function r9s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?sWn(t,!1):typeof r=="object"&&r.$async===!0?e.return(e9s.default.data):(e.assign((0,X6s._)`${n}.errors`,null),e.return(!0))}a(r9s,"topBoolOrEmptySchema");ehe.topBoolOrEmptySchema=r9s;function n9s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),sWn(t)):r.var(e,!0)}a(n9s,"boolOrEmptySchema");ehe.boolOrEmptySchema=n9s;function sWn(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,Z6s.reportError)(o,t9s,void 0,e)}a(sWn,"falseSchemaError")});var klr=I(the=>{"use strict";p();Object.defineProperty(the,"__esModule",{value:!0});the.getRules=the.isJSONType=void 0;var i9s=["string","number","integer","boolean","null","object","array"],o9s=new Set(i9s);function s9s(t){return typeof t=="string"&&o9s.has(t)}a(s9s,"isJSONType");the.isJSONType=s9s;function a9s(){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(a9s,"getRules");the.getRules=a9s});var Plr=I(gH=>{"use strict";p();Object.defineProperty(gH,"__esModule",{value:!0});gH.shouldUseRule=gH.shouldUseGroup=gH.schemaHasRulesForType=void 0;function c9s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&cWn(t,n)}a(c9s,"schemaHasRulesForType");gH.schemaHasRulesForType=c9s;function cWn(t,e){return e.rules.some(r=>lWn(t,r))}a(cWn,"shouldUseGroup");gH.shouldUseGroup=cWn;function lWn(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(lWn,"shouldUseRule");gH.shouldUseRule=lWn});var uDe=I(wE=>{"use strict";p();Object.defineProperty(wE,"__esModule",{value:!0});wE.reportTypeError=wE.checkDataTypes=wE.checkDataType=wE.coerceAndCheckDataType=wE.getJSONTypes=wE.getSchemaTypes=wE.DataType=void 0;var l9s=klr(),u9s=Plr(),d9s=lDe(),cs=Es(),uWn=Ja(),rhe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(rhe||(wE.DataType=rhe={}));function f9s(t){let e=dWn(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(f9s,"getSchemaTypes");wE.getSchemaTypes=f9s;function dWn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(l9s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(dWn,"getJSONTypes");wE.getJSONTypes=dWn;function p9s(t,e){let{gen:r,data:n,opts:o}=t,s=h9s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,u9s.schemaHasRulesForType)(t,e[0]));if(c){let l=Nlr(e,n,o.strictNumbers,rhe.Wrong);r.if(l,()=>{s.length?m9s(t,e,s):Mlr(t)})}return c}a(p9s,"coerceAndCheckDataType");wE.coerceAndCheckDataType=p9s;var fWn=new Set(["string","number","integer","boolean","null"]);function h9s(t,e){return e?t.filter(r=>fWn.has(r)||e==="array"&&r==="array"):[]}a(h9s,"coerceToTypes");function m9s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,cs._)`typeof ${o}`),l=n.let("coerced",(0,cs._)`undefined`);s.coerceTypes==="array"&&n.if((0,cs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,cs._)`${o}[0]`).assign(c,(0,cs._)`typeof ${o}`).if(Nlr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,cs._)`${l} !== undefined`);for(let d of r)(fWn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),Mlr(t),n.endIf(),n.if((0,cs._)`${l} !== undefined`,()=>{n.assign(o,l),g9s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,cs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,cs._)`"" + ${o}`).elseIf((0,cs._)`${o} === null`).assign(l,(0,cs._)`""`);return;case"number":n.elseIf((0,cs._)`${c} == "boolean" || ${o} === null || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,cs._)`+${o}`);return;case"integer":n.elseIf((0,cs._)`${c} === "boolean" || ${o} === null || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,cs._)`+${o}`);return;case"boolean":n.elseIf((0,cs._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,cs._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,cs._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,cs._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,cs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(e9s,"coerceData");function t9s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,cs._)`${e} !== undefined`,()=>t.assign((0,cs._)`${e}[${r}]`,n))}a(t9s,"assignParentData");function wlr(t,e,r,n=the.Correct){let o=n===the.Correct?cs.operators.EQ:cs.operators.NEQ,s;switch(t){case"null":return(0,cs._)`${e} ${o} null`;case"array":s=(0,cs._)`Array.isArray(${e})`;break;case"object":s=(0,cs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,cs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,cs._)`typeof ${e} ${o} ${t}`}return n===the.Correct?s:(0,cs.not)(s);function c(l=cs.nil){return(0,cs.and)((0,cs._)`typeof ${e} == "number"`,l,r?(0,cs._)`isFinite(${e})`:cs.nil)}}a(wlr,"checkDataType");xE.checkDataType=wlr;function Rlr(t,e,r,n){if(t.length===1)return wlr(t[0],e,r,n);let o,s=(0,oWn.toHash)(t);if(s.array&&s.object){let c=(0,cs._)`typeof ${e} != "object"`;o=s.null?c:(0,cs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=cs.nil;s.number&&delete s.integer;for(let c in s)o=(0,cs.and)(o,wlr(c,e,r,n));return o}a(Rlr,"checkDataTypes");xE.checkDataTypes=Rlr;var r9s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,cs._)`{type: ${t}}`:(0,cs._)`{type: ${e}}`,"params")};function klr(t){let e=n9s(t);(0,K6s.reportError)(e,r9s)}a(klr,"reportTypeError");xE.reportTypeError=klr;function n9s(t){let{gen:e,data:r,schema:n}=t,o=(0,oWn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(n9s,"getTypeErrorContext")});var lWn=I(ect=>{"use strict";p();Object.defineProperty(ect,"__esModule",{value:!0});ect.assignDefaults=void 0;var rhe=Es(),i9s=Ka();function o9s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)cWn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>cWn(t,s,o.default))}a(o9s,"assignDefaults");ect.assignDefaults=o9s;function cWn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,rhe._)`${s}${(0,rhe.getProperty)(e)}`;if(o){(0,i9s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,rhe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,rhe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,rhe._)`${l} = ${(0,rhe.stringify)(r)}`)}a(cWn,"assignDefault")});var zw=I(Rl=>{"use strict";p();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.validateUnion=Rl.validateArray=Rl.usePattern=Rl.callValidateCode=Rl.schemaProperties=Rl.allSchemaProperties=Rl.noPropertyInData=Rl.propertyInData=Rl.isOwnProperty=Rl.hasPropFunc=Rl.reportMissingProp=Rl.checkMissingProp=Rl.checkReportMissingProp=void 0;var fd=Es(),Plr=Ka(),hH=p8(),s9s=Ka();function a9s(t,e){let{gen:r,data:n,it:o}=t;r.if(Nlr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fd._)`${e}`},!0),t.error()})}a(a9s,"checkReportMissingProp");Rl.checkReportMissingProp=a9s;function c9s({gen:t,data:e,it:{opts:r}},n,o){return(0,fd.or)(...n.map(s=>(0,fd.and)(Nlr(t,e,s,r.ownProperties),(0,fd._)`${o} = ${s}`)))}a(c9s,"checkMissingProp");Rl.checkMissingProp=c9s;function l9s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(l9s,"reportMissingProp");Rl.reportMissingProp=l9s;function uWn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fd._)`Object.prototype.hasOwnProperty`})}a(uWn,"hasPropFunc");Rl.hasPropFunc=uWn;function Dlr(t,e,r){return(0,fd._)`${uWn(t)}.call(${e}, ${r})`}a(Dlr,"isOwnProperty");Rl.isOwnProperty=Dlr;function u9s(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} !== undefined`;return n?(0,fd._)`${o} && ${Dlr(t,e,r)}`:o}a(u9s,"propertyInData");Rl.propertyInData=u9s;function Nlr(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} === undefined`;return n?(0,fd.or)(o,(0,fd.not)(Dlr(t,e,r))):o}a(Nlr,"noPropertyInData");Rl.noPropertyInData=Nlr;function dWn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(dWn,"allSchemaProperties");Rl.allSchemaProperties=dWn;function d9s(t,e){return dWn(e).filter(r=>!(0,Plr.alwaysValidSchema)(t,e[r]))}a(d9s,"schemaProperties");Rl.schemaProperties=d9s;function f9s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,fd._)`${t}, ${e}, ${n}${o}`:e,h=[[hH.default.instancePath,(0,fd.strConcat)(hH.default.instancePath,s)],[hH.default.parentData,c.parentData],[hH.default.parentDataProperty,c.parentDataProperty],[hH.default.rootData,hH.default.rootData]];c.opts.dynamicRef&&h.push([hH.default.dynamicAnchors,hH.default.dynamicAnchors]);let m=(0,fd._)`${f}, ${r.object(...h)}`;return u!==fd.nil?(0,fd._)`${l}.call(${u}, ${m})`:(0,fd._)`${l}(${m})`}a(f9s,"callValidateCode");Rl.callValidateCode=f9s;var p9s=(0,fd._)`new RegExp`;function h9s({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,fd._)`${o.code==="new RegExp"?p9s:(0,s9s.useFunc)(t,o)}(${r}, ${n})`})}a(h9s,"usePattern");Rl.usePattern=h9s;function m9s(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,fd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Plr.Type.Num},s),e.if((0,fd.not)(s),l)})}a(c,"validateItems")}a(m9s,"validateArray");Rl.validateArray=m9s;function g9s(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,Plr.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,fd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,fd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(g9s,"validateUnion");Rl.validateUnion=g9s});var hWn=I(z5=>{"use strict";p();Object.defineProperty(z5,"__esModule",{value:!0});z5.validateKeywordUsage=z5.validSchemaType=z5.funcKeywordCode=z5.macroKeywordCode=void 0;var mv=Es(),CX=p8(),A9s=zw(),y9s=sDe();function E9s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=pWn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:mv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(E9s,"macroKeywordCode");z5.macroKeywordCode=E9s;function _9s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;C9s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=pWn(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&&fWn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&fWn(t),E(()=>v9s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,mv._)`await `),v=>n.assign(h,!1).if((0,mv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,mv._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,mv._)`${f}.errors`;return n.assign(_,null),y(mv.nil),_}a(A,"validateSync");function y(_=e.async?(0,mv._)`await `:mv.nil){let v=u.opts.passContext?CX.default.this:CX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,mv._)`${_}${(0,A9s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,mv.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(_9s,"funcKeywordCode");z5.funcKeywordCode=_9s;function fWn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,mv._)`${n.parentData}[${n.parentDataProperty}]`))}a(fWn,"modifyData");function v9s(t,e){let{gen:r}=t;r.if((0,mv._)`Array.isArray(${e})`,()=>{r.assign(CX.default.vErrors,(0,mv._)`${CX.default.vErrors} === null ? ${e} : ${CX.default.vErrors}.concat(${e})`).assign(CX.default.errors,(0,mv._)`${CX.default.vErrors}.length`),(0,y9s.extendErrors)(t)},()=>t.error())}a(v9s,"addErrs");function C9s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(C9s,"checkAsyncKeyword");function pWn(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,mv.stringify)(r)})}a(pWn,"useKeyword");function b9s(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(b9s,"validSchemaType");z5.validSchemaType=b9s;function S9s({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(S9s,"validateKeywordUsage");z5.validateKeywordUsage=S9s});var gWn=I(mH=>{"use strict";p();Object.defineProperty(mH,"__esModule",{value:!0});mH.extendSubschemaMode=mH.extendSubschemaData=mH.getSubschema=void 0;var Y5=Es(),mWn=Ka();function T9s(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,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}${(0,Y5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,mWn.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(T9s,"getSubschema");mH.getSubschema=T9s;function I9s(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,Y5._)`${e.data}${(0,Y5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,Y5.str)`${d}${(0,mWn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Y5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof Y5.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(I9s,"extendSubschemaData");mH.extendSubschemaData=I9s;function x9s(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(x9s,"extendSubschemaMode");mH.extendSubschemaMode=x9s});var Mlr=I((pCf,AWn)=>{"use strict";p();AWn.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 EWn=I((gCf,yWn)=>{"use strict";p();var gH=yWn.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(){};tct(e,n,o,t,"",t)};gH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};gH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};gH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};gH.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 tct(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 gH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.getSchemaRefs=Tb.resolveUrl=Tb.normalizeId=Tb._getFullPath=Tb.getFullPath=Tb.inlineRef=void 0;var R9s=Ka(),k9s=Mlr(),P9s=EWn(),D9s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function N9s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Olr(t):e?_Wn(t)<=e:!1}a(N9s,"inlineRef");Tb.inlineRef=N9s;var M9s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Olr(t){for(let e in t){if(M9s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Olr)||typeof r=="object"&&Olr(r))return!0}return!1}a(Olr,"hasRef");function _Wn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!D9s.has(r)&&(typeof t[r]=="object"&&(0,R9s.eachItem)(t[r],n=>e+=_Wn(n)),e===1/0))return 1/0}return e}a(_Wn,"countKeys");function vWn(t,e="",r){r!==!1&&(e=nhe(e));let n=t.parse(e);return CWn(t,n)}a(vWn,"getFullPath");Tb.getFullPath=vWn;function CWn(t,e){return t.serialize(e).split("#")[0]+"#"}a(CWn,"_getFullPath");Tb._getFullPath=CWn;var O9s=/#\/?$/;function nhe(t){return t?t.replace(O9s,""):""}a(nhe,"normalizeId");Tb.normalizeId=nhe;function L9s(t,e,r){return r=nhe(r),t.resolve(e,r)}a(L9s,"resolveUrl");Tb.resolveUrl=L9s;var B9s=/^[a-z_][-a-z0-9._]*$/i;function F9s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=nhe(t[r]||e),s={"":o},c=vWn(n,o,!1),l={},u=new Set;return P9s(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=nhe(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!==nhe(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(!B9s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!k9s(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(F9s,"getSchemaRefs");Tb.getSchemaRefs=F9s});var dDe=I(AH=>{"use strict";p();Object.defineProperty(AH,"__esModule",{value:!0});AH.getData=AH.KeywordCxt=AH.validateFunctionCode=void 0;var xWn=rWn(),bWn=aDe(),Blr=xlr(),rct=aDe(),U9s=lWn(),uDe=hWn(),Llr=gWn(),oi=Es(),po=p8(),Q9s=cDe(),h8=Ka(),lDe=sDe();function q9s(t){if(kWn(t)&&(PWn(t),RWn(t))){G9s(t);return}wWn(t,()=>(0,xWn.topBoolOrEmptySchema)(t))}a(q9s,"validateFunctionCode");AH.validateFunctionCode=q9s;function wWn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,oi._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,oi._)`"use strict"; ${SWn(r,o)}`),H9s(t,o),t.code(s)}):t.func(e,(0,oi._)`${po.default.data}, ${j9s(o)}`,n.$async,()=>t.code(SWn(r,o)).code(s))}a(wWn,"validateFunction");function j9s(t){return(0,oi._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,oi._)`, ${po.default.dynamicAnchors}={}`:oi.nil}}={}`}a(j9s,"destructureValCxt");function H9s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,oi._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,oi._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,oi._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,oi._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,oi._)`""`),t.var(po.default.parentData,(0,oi._)`undefined`),t.var(po.default.parentDataProperty,(0,oi._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`{}`)})}a(H9s,"destructureValCxtES5");function G9s(t){let{schema:e,opts:r,gen:n}=t;wWn(t,()=>{r.$comment&&e.$comment&&NWn(t),Y9s(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&$9s(t),DWn(t),Z9s(t)})}a(G9s,"topSchemaObjCode");function $9s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oi._)`${r}.evaluated`),e.if((0,oi._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oi._)`${t.evaluated}.props`,(0,oi._)`undefined`)),e.if((0,oi._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oi._)`${t.evaluated}.items`,(0,oi._)`undefined`))}a($9s,"resetEvaluated");function SWn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oi._)`/*# sourceURL=${r} */`:oi.nil}a(SWn,"funcSourceUrl");function V9s(t,e){if(kWn(t)&&(PWn(t),RWn(t))){W9s(t,e);return}(0,xWn.boolOrEmptySchema)(t,e)}a(V9s,"subschemaCode");function RWn({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(RWn,"schemaCxtHasRules");function kWn(t){return typeof t.schema!="boolean"}a(kWn,"isSchemaObj");function W9s(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&NWn(t),K9s(t),J9s(t);let s=n.const("_errs",po.default.errors);DWn(t,s),n.var(e,(0,oi._)`${s} === ${po.default.errors}`)}a(W9s,"subSchemaObjCode");function PWn(t){(0,h8.checkUnknownRules)(t),z9s(t)}a(PWn,"checkKeywords");function DWn(t,e){if(t.opts.jtd)return TWn(t,[],!1,e);let r=(0,bWn.getSchemaTypes)(t.schema),n=(0,bWn.coerceAndCheckDataType)(t,r);TWn(t,r,!n,e)}a(DWn,"typeAndKeywords");function z9s(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,h8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(z9s,"checkRefsAndKeywords");function Y9s(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,h8.checkStrictMode)(t,"default is ignored in the schema root")}a(Y9s,"checkNoDefault");function K9s(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Q9s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(K9s,"updateContext");function J9s(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(J9s,"checkAsyncSchema");function NWn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,oi._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,oi.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,oi._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(NWn,"commentKeyword");function Z9s(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,oi._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,oi._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,oi._)`${n}.errors`,po.default.vErrors),s.unevaluated&&X9s(t),e.return((0,oi._)`${po.default.errors} === 0`))}a(Z9s,"returnResults");function X9s({gen:t,evaluated:e,props:r,items:n}){r instanceof oi.Name&&t.assign((0,oi._)`${e}.props`,r),n instanceof oi.Name&&t.assign((0,oi._)`${e}.items`,n)}a(X9s,"assignEvaluated");function TWn(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,h8.schemaHasRulesButRef)(s,f))){o.block(()=>OWn(t,"$ref",f.all.$ref.definition));return}u.jtd||eUs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Blr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,rct.checkDataType)(m.type,c,u.strictNumbers)),IWn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,rct.reportTypeError)(t)),o.endIf()):IWn(t,m),l||o.if((0,oi._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(TWn,"schemaKeywords");function IWn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,U9s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Blr.shouldUseRule)(n,s)&&OWn(t,s.keyword,s.definition,e.type)})}a(IWn,"iterateKeywords");function eUs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(tUs(t,e),t.opts.allowUnionTypes||rUs(t,e),nUs(t,t.dataTypes))}a(eUs,"checkStrictTypes");function tUs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{MWn(t.dataTypes,r)||Flr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),oUs(t,e)}}a(tUs,"checkContextTypes");function rUs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Flr(t,"use allowUnionTypes to allow union type keyword")}a(rUs,"checkMultipleTypes");function nUs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Blr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>iUs(e,c))&&Flr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(nUs,"checkKeywordTypes");function iUs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(iUs,"hasApplicableType");function MWn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(MWn,"includesType");function oUs(t,e){let r=[];for(let n of t.dataTypes)MWn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(oUs,"narrowSchemaTypes");function Flr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,h8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Flr,"strictTypesError");var nct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,uDe.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,h8.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",LWn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,uDe.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,oi.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,oi.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,oi._)`${r} !== undefined && (${(0,oi.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?lDe.reportExtraError:lDe.reportError)(this,this.def.error,r)}$dataError(){(0,lDe.reportError)(this,this.def.$dataError||lDe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lDe.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=oi.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oi.nil,r=oi.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,oi.or)((0,oi._)`${o} === undefined`,r)),e!==oi.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oi.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,oi.or)(c(),l());function c(){if(n.length){if(!(r instanceof oi.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,oi._)`${(0,rct.checkDataTypes)(u,r,s.opts.strictNumbers,rct.DataType.Wrong)}`}return oi.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,oi._)`!${u}(${r})`}return oi.nil}}subschema(e,r){let n=(0,Llr.getSubschema)(this.it,e);(0,Llr.extendSubschemaData)(n,this.it,e),(0,Llr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return V9s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=h8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=h8.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,oi.Name)),!0}};AH.KeywordCxt=nct;function OWn(t,e,r,n){let o=new nct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,uDe.funcKeywordCode)(o,r):"macro"in r?(0,uDe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,uDe.funcKeywordCode)(o,r)}a(OWn,"keywordCode");var sUs=/^\/(?:[^~]|~0|~1)*$/,aUs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function LWn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!sUs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=aUs.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,oi._)`${s}${(0,oi.getProperty)((0,h8.unescapeJsonPointer)(d))}`,c=(0,oi._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(LWn,"getData");AH.getData=LWn});var ict=I(Qlr=>{"use strict";p();Object.defineProperty(Qlr,"__esModule",{value:!0});var Ulr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Qlr.default=Ulr});var fDe=I(Hlr=>{"use strict";p();Object.defineProperty(Hlr,"__esModule",{value:!0});var qlr=cDe(),jlr=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,qlr.resolveUrl)(e,r,n),this.missingSchema=(0,qlr.normalizeId)((0,qlr.getFullPath)(e,this.missingRef))}};Hlr.default=jlr});var sct=I(Yw=>{"use strict";p();Object.defineProperty(Yw,"__esModule",{value:!0});Yw.resolveSchema=Yw.getCompilingSchema=Yw.resolveRef=Yw.compileSchema=Yw.SchemaEnv=void 0;var N2=Es(),cUs=ict(),bX=p8(),M2=cDe(),BWn=Ka(),lUs=dDe(),ihe=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,M2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Yw.SchemaEnv=ihe;function $lr(t){let e=FWn.call(this,t);if(e)return e;let r=(0,M2.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:cUs.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:bX.default.data,parentData:bX.default.parentData,parentDataProperty:bX.default.parentDataProperty,dataNames:[bX.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,lUs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(bX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${bX.default.self}`,`${bX.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($lr,"compileSchema");Yw.compileSchema=$lr;function uUs(t,e,r){var n;r=(0,M2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=pUs.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 ihe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=dUs.call(this,s)}a(uUs,"resolveRef");Yw.resolveRef=uUs;function dUs(t){return(0,M2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:$lr.call(this,t)}a(dUs,"inlineOrCompile");function FWn(t){for(let e of this._compilations)if(fUs(e,t))return e}a(FWn,"getCompilingSchema");Yw.getCompilingSchema=FWn;function fUs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(fUs,"sameSchemaEnv");function pUs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||oct.call(this,t,e)}a(pUs,"resolve");function oct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,M2._getFullPath)(this.opts.uriResolver,r),o=(0,M2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Glr.call(this,r,t);let s=(0,M2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=oct.call(this,t,c);return typeof l?.schema!="object"?void 0:Glr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||$lr.call(this,c),s===(0,M2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,M2.resolveUrl)(this.opts.uriResolver,o,d)),new ihe({schema:l,schemaId:u,root:t,baseId:o})}return Glr.call(this,r,c)}}a(oct,"resolveSchema");Yw.resolveSchema=oct;var hUs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Glr(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,BWn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!hUs.has(l)&&d&&(e=(0,M2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,BWn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,M2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=oct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new ihe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(Glr,"getJsonPointer")});var UWn=I((MCf,mUs)=>{mUs.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 zlr=I((OCf,$Wn)=>{"use strict";p();var gUs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qWn=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),Vlr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),jWn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),AUs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Wlr(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(Wlr,"stringArrayToHexStripped");var yUs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function QWn(t){return t.length=0,!0}a(QWn,"consumeIsZone");function EUs(t,e,r){if(t.length){let n=Wlr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(EUs,"consumeHextets");function _Us(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=EUs;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=QWn}else{o.push(d);continue}}return o.length&&(l===QWn?r.zone=o.join(""):c?n.push(o.join("")):n.push(Wlr(o))),r.address=n.join(""),r}a(_Us,"getIPV6");function HWn(t){if(vUs(t,":")<2)return{host:t,isIPV6:!1};let e=_Us(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(HWn,"normalizeIPv6");function vUs(t,e){let r=0;for(let n=0;nbUs[n])}a(GWn,"reescapeHostDelimiters");function IUs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:kUs}=zlr(),PUs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,DUs=["http","https","ws","wss","urn","urn:uuid"];function NUs(t){return DUs.indexOf(t)!==-1}a(NUs,"isValidSchemeName");function Ylr(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(Ylr,"wsIsSecure");function VWn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(VWn,"httpParse");function WWn(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(WWn,"httpSerialize");function MUs(t){return t.secure=Ylr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(MUs,"wsParse");function OUs(t){if((t.port===(Ylr(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(OUs,"wsSerialize");function LUs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(PUs);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=Klr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(LUs,"urnParse");function BUs(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=Klr(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(BUs,"urnSerialize");function FUs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!kUs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(FUs,"urnuuidParse");function UUs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(UUs,"urnuuidSerialize");var zWn={scheme:"http",domainHost:!0,parse:VWn,serialize:WWn},QUs={scheme:"https",domainHost:zWn.domainHost,parse:VWn,serialize:WWn},act={scheme:"ws",domainHost:!0,parse:MUs,serialize:OUs},qUs={scheme:"wss",domainHost:act.domainHost,parse:act.parse,serialize:act.serialize},jUs={scheme:"urn",parse:LUs,serialize:BUs,skipNormalize:!0},HUs={scheme:"urn:uuid",parse:FUs,serialize:UUs,skipNormalize:!0},cct={http:zWn,https:QUs,ws:act,wss:qUs,urn:jUs,"urn:uuid":HUs};Object.setPrototypeOf(cct,null);function Klr(t){return t&&(cct[t]||cct[t.toLowerCase()])||void 0}a(Klr,"getSchemeHandler");YWn.exports={wsIsSecure:Ylr,SCHEMES:cct,isValidSchemeName:NUs,getSchemeHandler:Klr}});var rzn=I((qCf,lct)=>{"use strict";p();var{normalizeIPv6:GUs,removeDotSegments:pDe,recomposeAuthority:$Us,normalizePercentEncoding:VUs,normalizePathEncoding:WUs,escapePreservingEscapes:zUs,reescapeHostDelimiters:YUs,isIPv4:KUs,nonSimpleDomain:JUs}=zlr(),{SCHEMES:ZUs,getSchemeHandler:ZWn}=KWn();function XUs(t,e){return typeof t=="string"?t=i7s(t,e):typeof t=="object"&&(t=ohe(SX(t,e),e)),t}a(XUs,"normalize");function e7s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=XWn(ohe(t,n),ohe(e,n),n,!0);return n.skipEscape=!0,SX(o,n)}a(e7s,"resolve");function XWn(t,e,r,n){let o={};return n||(t=ohe(SX(t,r),r),e=ohe(SX(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=pDe(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=pDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=pDe(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=pDe(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(XWn,"resolveComponent");function t7s(t,e,r){let n=JWn(t,r),o=JWn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(t7s,"equal");function SX(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=ZWn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=VUs(r.path):(r.path=zUs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=$Us(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=pDe(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(SX,"serialize");var r7s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function n7s(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(n7s,"getParseError");function ezn(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(r7s);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=n7s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(KUs(n.host)===!1){let f=GUs(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=ZWn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&JUs(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=YUs(unescape(n.host),s))),n.path&&(n.path=WUs(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(ezn,"parseWithStatus");function ohe(t,e){return ezn(t,e).parsed}a(ohe,"parse");function i7s(t,e){return tzn(t,e).normalized}a(i7s,"normalizeString");function tzn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=ezn(t,e);return{normalized:n?t:SX(r,e),malformedAuthorityOrPort:n}}a(tzn,"normalizeStringWithStatus");function JWn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=tzn(t,e);return n?void 0:r}if(typeof t=="object")return SX(t,e)}a(JWn,"normalizeComparableURI");var Jlr={SCHEMES:ZUs,normalize:XUs,resolve:e7s,resolveComponent:XWn,equal:t7s,serialize:SX,parse:ohe};lct.exports=Jlr;lct.exports.default=Jlr;lct.exports.fastUri=Jlr});var izn=I(Zlr=>{"use strict";p();Object.defineProperty(Zlr,"__esModule",{value:!0});var nzn=rzn();nzn.code='require("ajv/dist/runtime/uri").default';Zlr.default=nzn});var fzn=I(ZA=>{"use strict";p();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.CodeGen=ZA.Name=ZA.nil=ZA.stringify=ZA.str=ZA._=ZA.KeywordCxt=void 0;var o7s=dDe();Object.defineProperty(ZA,"KeywordCxt",{enumerable:!0,get:a(function(){return o7s.KeywordCxt},"get")});var she=Es();Object.defineProperty(ZA,"_",{enumerable:!0,get:a(function(){return she._},"get")});Object.defineProperty(ZA,"str",{enumerable:!0,get:a(function(){return she.str},"get")});Object.defineProperty(ZA,"stringify",{enumerable:!0,get:a(function(){return she.stringify},"get")});Object.defineProperty(ZA,"nil",{enumerable:!0,get:a(function(){return she.nil},"get")});Object.defineProperty(ZA,"Name",{enumerable:!0,get:a(function(){return she.Name},"get")});Object.defineProperty(ZA,"CodeGen",{enumerable:!0,get:a(function(){return she.CodeGen},"get")});var s7s=ict(),lzn=fDe(),a7s=Ilr(),hDe=sct(),c7s=Es(),mDe=cDe(),uct=aDe(),eur=Ka(),ozn=UWn(),l7s=izn(),uzn=a((t,e)=>new RegExp(t,e),"defaultRegExp");uzn.code="new RegExp";var u7s=["removeAdditional","useDefaults","coerceTypes"],d7s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f7s={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."},p7s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},szn=200;function h7s(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,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:uzn,M=(o=t.uriResolver)!==null&&o!==void 0?o:l7s.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:szn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:szn,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(h7s,"requiredOptions");var gDe=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,...h7s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new c7s.ValueScope({scope:{},prefixes:d7s,es5:r,lines:n}),this.logger=_7s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a7s.getRules)(),azn.call(this,f7s,e,"NOT SUPPORTED"),azn.call(this,p7s,e,"DEPRECATED","warn"),this._metaOpts=y7s.call(this),e.formats&&g7s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A7s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),m7s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=ozn;n==="id"&&(o={...ozn},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 lzn.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,mDe.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=czn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new hDe.SchemaEnv({schema:{},schemaId:n});if(r=hDe.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=czn.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,mDe.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(C7s.call(this,n,r),!r)return(0,eur.eachItem)(n,s=>Xlr.call(this,s)),this;S7s.call(this,r);let o={...r,type:(0,uct.getJSONTypes)(r.type),schemaType:(0,uct.getJSONTypes)(r.schemaType)};return(0,eur.eachItem)(n,o.type.length===0?s=>Xlr.call(this,s,o):s=>o.type.forEach(c=>Xlr.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]=dzn(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,mDe.normalizeId)(c||n);let d=mDe.getSchemaRefs.call(this,e,n);return u=new hDe.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):hDe.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{hDe.compileSchema.call(this,e)}finally{this.opts=r}}};gDe.ValidationError=s7s.default;gDe.MissingRefError=lzn.default;ZA.default=gDe;function azn(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(azn,"checkOptions");function czn(t){return t=(0,mDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(czn,"getSchEnv");function m7s(){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(m7s,"addInitialSchemas");function g7s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(g7s,"addInitialFormats");function A7s(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(A7s,"addInitialKeywords");function y7s(){let t={...this.opts};for(let e of u7s)delete t[e];return t}a(y7s,"getMetaSchemaOptions");var E7s={log(){},warn(){},error(){}};function _7s(t){if(t===!1)return E7s;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(_7s,"getLogger");var v7s=/^[a-z_$][a-z0-9_$:-]*$/i;function C7s(t,e){let{RULES:r}=this;if((0,eur.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!v7s.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(C7s,"checkKeyword");function Xlr(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,uct.getJSONTypes)(e.type),schemaType:(0,uct.getJSONTypes)(e.schemaType)}};e.before?b7s.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(Xlr,"addRule");function b7s(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(b7s,"addBeforeRule");function S7s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=dzn(e)),t.validateSchema=this.compile(e,!0))}a(S7s,"keywordMetaschema");var T7s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dzn(t){return{anyOf:[t,T7s]}}a(dzn,"schemaOrData")});var pzn=I(tur=>{"use strict";p();Object.defineProperty(tur,"__esModule",{value:!0});var I7s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};tur.default=I7s});var Azn=I(TX=>{"use strict";p();Object.defineProperty(TX,"__esModule",{value:!0});TX.callRef=TX.getValidate=void 0;var x7s=fDe(),hzn=zw(),Ib=Es(),ahe=p8(),mzn=sct(),dct=Ka(),w7s={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=mzn.resolveRef.call(u,d,o,r);if(f===void 0)throw new x7s.default(n.opts.uriResolver,o,r);if(f instanceof mzn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return fct(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return fct(t,(0,Ib._)`${A}.validate`,d,d.$async)}function m(A){let y=gzn(t,A);fct(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Ib.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:Ib.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function gzn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ib._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(gzn,"getValidate");TX.getValidate=gzn;function fct(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?ahe.default.this:Ib.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,Ib._)`await ${(0,hzn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Ib._)`!(${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,hzn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Ib._)`${A}.errors`;o.assign(ahe.default.vErrors,(0,Ib._)`${ahe.default.vErrors} === null ? ${y} : ${ahe.default.vErrors}.concat(${y})`),o.assign(ahe.default.errors,(0,Ib._)`${ahe.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=dct.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,Ib._)`${A}.evaluated.props`);s.props=dct.mergeEvaluated.props(o,_,s.props,Ib.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=dct.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,Ib._)`${A}.evaluated.items`);s.items=dct.mergeEvaluated.items(o,_,s.items,Ib.Name)}}a(g,"addEvaluatedFrom")}a(fct,"callRef");TX.callRef=fct;TX.default=w7s});var yzn=I(rur=>{"use strict";p();Object.defineProperty(rur,"__esModule",{value:!0});var R7s=pzn(),k7s=Azn(),P7s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",R7s.default,k7s.default];rur.default=P7s});var Ezn=I(nur=>{"use strict";p();Object.defineProperty(nur,"__esModule",{value:!0});var pct=Es(),yH=pct.operators,hct={maximum:{okStr:"<=",ok:yH.LTE,fail:yH.GT},minimum:{okStr:">=",ok:yH.GTE,fail:yH.LT},exclusiveMaximum:{okStr:"<",ok:yH.LT,fail:yH.GTE},exclusiveMinimum:{okStr:">",ok:yH.GT,fail:yH.LTE}},D7s={message:a(({keyword:t,schemaCode:e})=>(0,pct.str)`must be ${hct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,pct._)`{comparison: ${hct[t].okStr}, limit: ${e}}`,"params")},N7s={keyword:Object.keys(hct),type:"number",schemaType:"number",$data:!0,error:D7s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,pct._)`${r} ${hct[e].fail} ${n} || isNaN(${r})`)}};nur.default=N7s});var _zn=I(iur=>{"use strict";p();Object.defineProperty(iur,"__esModule",{value:!0});var ADe=Es(),M7s={message:a(({schemaCode:t})=>(0,ADe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,ADe._)`{multipleOf: ${t}}`,"params")},O7s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:M7s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,ADe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,ADe._)`${c} !== parseInt(${c})`;t.fail$data((0,ADe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};iur.default=O7s});var Czn=I(our=>{"use strict";p();Object.defineProperty(our,"__esModule",{value:!0});function vzn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(sur,"__esModule",{value:!0});var IX=Es(),L7s=Ka(),B7s=Czn(),F7s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,IX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,IX._)`{limit: ${t}}`,"params")},U7s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:F7s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?IX.operators.GT:IX.operators.LT,c=o.opts.unicode===!1?(0,IX._)`${r}.length`:(0,IX._)`${(0,L7s.useFunc)(t.gen,B7s.default)}(${r})`;t.fail$data((0,IX._)`${c} ${s} ${n}`)}};sur.default=U7s});var Szn=I(aur=>{"use strict";p();Object.defineProperty(aur,"__esModule",{value:!0});var Q7s=zw(),q7s=Ka(),che=Es(),j7s={message:a(({schemaCode:t})=>(0,che.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,che._)`{pattern: ${t}}`,"params")},H7s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:j7s,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,che._)`new RegExp`:(0,q7s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,che._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,che._)`!${f}`)}else{let u=(0,Q7s.usePattern)(t,o);t.fail$data((0,che._)`!${u}.test(${r})`)}}};aur.default=H7s});var Tzn=I(cur=>{"use strict";p();Object.defineProperty(cur,"__esModule",{value:!0});var yDe=Es(),G7s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,yDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,yDe._)`{limit: ${t}}`,"params")},$7s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:G7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?yDe.operators.GT:yDe.operators.LT;t.fail$data((0,yDe._)`Object.keys(${r}).length ${o} ${n}`)}};cur.default=$7s});var Izn=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});var EDe=zw(),_De=Es(),V7s=Ka(),W7s={message:a(({params:{missingProperty:t}})=>(0,_De.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,_De._)`{missingProperty: ${t}}`,"params")},z7s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:W7s,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,V7s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(_De.nil,h);else for(let g of r)(0,EDe.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,EDe.checkMissingProp)(t,r,g)),(0,EDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,EDe.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,EDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,_De.not)(A),()=>{t.error(),e.break()})},_De.nil)}a(m,"loopUntilMissing")}};lur.default=z7s});var xzn=I(uur=>{"use strict";p();Object.defineProperty(uur,"__esModule",{value:!0});var vDe=Es(),Y7s={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,vDe._)`{limit: ${t}}`,"params")},K7s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Y7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?vDe.operators.GT:vDe.operators.LT;t.fail$data((0,vDe._)`${r}.length ${o} ${n}`)}};uur.default=K7s});var mct=I(dur=>{"use strict";p();Object.defineProperty(dur,"__esModule",{value:!0});var wzn=Mlr();wzn.code='require("ajv/dist/runtime/equal").default';dur.default=wzn});var Rzn=I(pur=>{"use strict";p();Object.defineProperty(pur,"__esModule",{value:!0});var fur=aDe(),XA=Es(),J7s=Ka(),Z7s=mct(),X7s={message:a(({params:{i:t,j:e}})=>(0,XA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,XA._)`{i: ${t}, j: ${e}}`,"params")},eQs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:X7s,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,fur.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,XA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,XA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,XA._)`${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,fur.checkDataTypes)(d,E,l.opts.strictNumbers,fur.DataType.Wrong),v=e.const("indices",(0,XA._)`{}`);e.for((0,XA._)`;${A}--;`,()=>{e.let(E,(0,XA._)`${r}[${A}]`),e.if(_,(0,XA._)`continue`),d.length>1&&e.if((0,XA._)`typeof ${E} == "string"`,(0,XA._)`${E} += "_"`),e.if((0,XA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,XA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,XA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,J7s.useFunc)(e,Z7s.default),_=e.name("outer");e.label(_).for((0,XA._)`;${A}--;`,()=>e.for((0,XA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,XA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};pur.default=eQs});var kzn=I(mur=>{"use strict";p();Object.defineProperty(mur,"__esModule",{value:!0});var hur=Es(),tQs=Ka(),rQs=mct(),nQs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,hur._)`{allowedValue: ${t}}`,"params")},iQs={keyword:"const",$data:!0,error:nQs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,hur._)`!${(0,tQs.useFunc)(e,rQs.default)}(${r}, ${o})`):t.fail((0,hur._)`${s} !== ${r}`)}};mur.default=iQs});var Pzn=I(gur=>{"use strict";p();Object.defineProperty(gur,"__esModule",{value:!0});var CDe=Es(),oQs=Ka(),sQs=mct(),aQs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,CDe._)`{allowedValues: ${t}}`,"params")},cQs={keyword:"enum",schemaType:"array",$data:!0,error:aQs,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,oQs.useFunc)(e,sQs.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,CDe.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,CDe._)`${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,CDe._)`${d()}(${r}, ${g}[${A}])`:(0,CDe._)`${r} === ${y}`}a(m,"equalCode")}};gur.default=cQs});var Dzn=I(Aur=>{"use strict";p();Object.defineProperty(Aur,"__esModule",{value:!0});var lQs=Ezn(),uQs=_zn(),dQs=bzn(),fQs=Szn(),pQs=Tzn(),hQs=Izn(),mQs=xzn(),gQs=Rzn(),AQs=kzn(),yQs=Pzn(),EQs=[lQs.default,uQs.default,dQs.default,fQs.default,pQs.default,hQs.default,mQs.default,gQs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},AQs.default,yQs.default];Aur.default=EQs});var Eur=I(bDe=>{"use strict";p();Object.defineProperty(bDe,"__esModule",{value:!0});bDe.validateAdditionalItems=void 0;var xX=Es(),yur=Ka(),_Qs={message:a(({params:{len:t}})=>(0,xX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,xX._)`{limit: ${t}}`,"params")},vQs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_Qs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,yur.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Nzn(t,n)}};function Nzn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,xX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,xX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,yur.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,xX._)`${l} <= ${e.length}`);r.if((0,xX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:yur.Type.Num},d),c.allErrors||r.if((0,xX.not)(d),()=>r.break())})}a(u,"validateItems")}a(Nzn,"validateAdditionalItems");bDe.validateAdditionalItems=Nzn;bDe.default=vQs});var _ur=I(SDe=>{"use strict";p();Object.defineProperty(SDe,"__esModule",{value:!0});SDe.validateTuple=void 0;var Mzn=Es(),gct=Ka(),CQs=zw(),bQs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Ozn(t,"additionalItems",e);r.items=!0,!(0,gct.alwaysValidSchema)(r,e)&&t.ok((0,CQs.validateArray)(t))}};function Ozn(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=gct.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,Mzn._)`${s}.length`);r.forEach((h,m)=>{(0,gct.alwaysValidSchema)(l,h)||(n.if((0,Mzn._)`${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,gct.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(Ozn,"validateTuple");SDe.validateTuple=Ozn;SDe.default=bQs});var Lzn=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});var SQs=_ur(),TQs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,SQs.validateTuple)(t,"items"),"code")};vur.default=TQs});var Fzn=I(Cur=>{"use strict";p();Object.defineProperty(Cur,"__esModule",{value:!0});var Bzn=Es(),IQs=Ka(),xQs=zw(),wQs=Eur(),RQs={message:a(({params:{len:t}})=>(0,Bzn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Bzn._)`{limit: ${t}}`,"params")},kQs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:RQs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,IQs.alwaysValidSchema)(n,e)&&(o?(0,wQs.validateAdditionalItems)(t,o):t.ok((0,xQs.validateArray)(t)))}};Cur.default=kQs});var Uzn=I(bur=>{"use strict";p();Object.defineProperty(bur,"__esModule",{value:!0});var Kw=Es(),Act=Ka(),PQs={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")},DQs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PQs,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,Act.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Act.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Act.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:Act.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")}};bur.default=DQs});var jzn=I(K5=>{"use strict";p();Object.defineProperty(K5,"__esModule",{value:!0});K5.validateSchemaDeps=K5.validatePropertyDeps=K5.error=void 0;var Sur=Es(),NQs=Ka(),TDe=zw();K5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Sur.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Sur._)`{property: ${t}, + || ${c} === "boolean" || ${o} === null`).assign(l,(0,cs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(m9s,"coerceData");function g9s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,cs._)`${e} !== undefined`,()=>t.assign((0,cs._)`${e}[${r}]`,n))}a(g9s,"assignParentData");function Dlr(t,e,r,n=rhe.Correct){let o=n===rhe.Correct?cs.operators.EQ:cs.operators.NEQ,s;switch(t){case"null":return(0,cs._)`${e} ${o} null`;case"array":s=(0,cs._)`Array.isArray(${e})`;break;case"object":s=(0,cs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,cs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,cs._)`typeof ${e} ${o} ${t}`}return n===rhe.Correct?s:(0,cs.not)(s);function c(l=cs.nil){return(0,cs.and)((0,cs._)`typeof ${e} == "number"`,l,r?(0,cs._)`isFinite(${e})`:cs.nil)}}a(Dlr,"checkDataType");wE.checkDataType=Dlr;function Nlr(t,e,r,n){if(t.length===1)return Dlr(t[0],e,r,n);let o,s=(0,uWn.toHash)(t);if(s.array&&s.object){let c=(0,cs._)`typeof ${e} != "object"`;o=s.null?c:(0,cs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=cs.nil;s.number&&delete s.integer;for(let c in s)o=(0,cs.and)(o,Dlr(c,e,r,n));return o}a(Nlr,"checkDataTypes");wE.checkDataTypes=Nlr;var A9s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,cs._)`{type: ${t}}`:(0,cs._)`{type: ${e}}`,"params")};function Mlr(t){let e=y9s(t);(0,d9s.reportError)(e,A9s)}a(Mlr,"reportTypeError");wE.reportTypeError=Mlr;function y9s(t){let{gen:e,data:r,schema:n}=t,o=(0,uWn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(y9s,"getTypeErrorContext")});var hWn=I(sct=>{"use strict";p();Object.defineProperty(sct,"__esModule",{value:!0});sct.assignDefaults=void 0;var nhe=Es(),E9s=Ja();function _9s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)pWn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>pWn(t,s,o.default))}a(_9s,"assignDefaults");sct.assignDefaults=_9s;function pWn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,nhe._)`${s}${(0,nhe.getProperty)(e)}`;if(o){(0,E9s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,nhe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,nhe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,nhe._)`${l} = ${(0,nhe.stringify)(r)}`)}a(pWn,"assignDefault")});var Kw=I(kl=>{"use strict";p();Object.defineProperty(kl,"__esModule",{value:!0});kl.validateUnion=kl.validateArray=kl.usePattern=kl.callValidateCode=kl.schemaProperties=kl.allSchemaProperties=kl.noPropertyInData=kl.propertyInData=kl.isOwnProperty=kl.hasPropFunc=kl.reportMissingProp=kl.checkMissingProp=kl.checkReportMissingProp=void 0;var pd=Es(),Olr=Ja(),AH=m8(),v9s=Ja();function C9s(t,e){let{gen:r,data:n,it:o}=t;r.if(Blr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,pd._)`${e}`},!0),t.error()})}a(C9s,"checkReportMissingProp");kl.checkReportMissingProp=C9s;function b9s({gen:t,data:e,it:{opts:r}},n,o){return(0,pd.or)(...n.map(s=>(0,pd.and)(Blr(t,e,s,r.ownProperties),(0,pd._)`${o} = ${s}`)))}a(b9s,"checkMissingProp");kl.checkMissingProp=b9s;function S9s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(S9s,"reportMissingProp");kl.reportMissingProp=S9s;function mWn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,pd._)`Object.prototype.hasOwnProperty`})}a(mWn,"hasPropFunc");kl.hasPropFunc=mWn;function Llr(t,e,r){return(0,pd._)`${mWn(t)}.call(${e}, ${r})`}a(Llr,"isOwnProperty");kl.isOwnProperty=Llr;function T9s(t,e,r,n){let o=(0,pd._)`${e}${(0,pd.getProperty)(r)} !== undefined`;return n?(0,pd._)`${o} && ${Llr(t,e,r)}`:o}a(T9s,"propertyInData");kl.propertyInData=T9s;function Blr(t,e,r,n){let o=(0,pd._)`${e}${(0,pd.getProperty)(r)} === undefined`;return n?(0,pd.or)(o,(0,pd.not)(Llr(t,e,r))):o}a(Blr,"noPropertyInData");kl.noPropertyInData=Blr;function gWn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(gWn,"allSchemaProperties");kl.allSchemaProperties=gWn;function I9s(t,e){return gWn(e).filter(r=>!(0,Olr.alwaysValidSchema)(t,e[r]))}a(I9s,"schemaProperties");kl.schemaProperties=I9s;function x9s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,pd._)`${t}, ${e}, ${n}${o}`:e,h=[[AH.default.instancePath,(0,pd.strConcat)(AH.default.instancePath,s)],[AH.default.parentData,c.parentData],[AH.default.parentDataProperty,c.parentDataProperty],[AH.default.rootData,AH.default.rootData]];c.opts.dynamicRef&&h.push([AH.default.dynamicAnchors,AH.default.dynamicAnchors]);let m=(0,pd._)`${f}, ${r.object(...h)}`;return u!==pd.nil?(0,pd._)`${l}.call(${u}, ${m})`:(0,pd._)`${l}(${m})`}a(x9s,"callValidateCode");kl.callValidateCode=x9s;var w9s=(0,pd._)`new RegExp`;function R9s({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,pd._)`${o.code==="new RegExp"?w9s:(0,v9s.useFunc)(t,o)}(${r}, ${n})`})}a(R9s,"usePattern");kl.usePattern=R9s;function k9s(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,pd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Olr.Type.Num},s),e.if((0,pd.not)(s),l)})}a(c,"validateItems")}a(k9s,"validateArray");kl.validateArray=k9s;function P9s(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,Olr.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,pd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,pd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(P9s,"validateUnion");kl.validateUnion=P9s});var EWn=I(Y5=>{"use strict";p();Object.defineProperty(Y5,"__esModule",{value:!0});Y5.validateKeywordUsage=Y5.validSchemaType=Y5.funcKeywordCode=Y5.macroKeywordCode=void 0;var Av=Es(),SX=m8(),D9s=Kw(),N9s=lDe();function M9s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=yWn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Av.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(M9s,"macroKeywordCode");Y5.macroKeywordCode=M9s;function O9s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;B9s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=yWn(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&&AWn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&AWn(t),E(()=>L9s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,Av._)`await `),v=>n.assign(h,!1).if((0,Av._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,Av._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,Av._)`${f}.errors`;return n.assign(_,null),y(Av.nil),_}a(A,"validateSync");function y(_=e.async?(0,Av._)`await `:Av.nil){let v=u.opts.passContext?SX.default.this:SX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Av._)`${_}${(0,D9s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,Av.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(O9s,"funcKeywordCode");Y5.funcKeywordCode=O9s;function AWn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Av._)`${n.parentData}[${n.parentDataProperty}]`))}a(AWn,"modifyData");function L9s(t,e){let{gen:r}=t;r.if((0,Av._)`Array.isArray(${e})`,()=>{r.assign(SX.default.vErrors,(0,Av._)`${SX.default.vErrors} === null ? ${e} : ${SX.default.vErrors}.concat(${e})`).assign(SX.default.errors,(0,Av._)`${SX.default.vErrors}.length`),(0,N9s.extendErrors)(t)},()=>t.error())}a(L9s,"addErrs");function B9s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(B9s,"checkAsyncKeyword");function yWn(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,Av.stringify)(r)})}a(yWn,"useKeyword");function F9s(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(F9s,"validSchemaType");Y5.validSchemaType=F9s;function U9s({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(U9s,"validateKeywordUsage");Y5.validateKeywordUsage=U9s});var vWn=I(yH=>{"use strict";p();Object.defineProperty(yH,"__esModule",{value:!0});yH.extendSubschemaMode=yH.extendSubschemaData=yH.getSubschema=void 0;var K5=Es(),_Wn=Ja();function Q9s(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,K5._)`${t.schemaPath}${(0,K5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,K5._)`${t.schemaPath}${(0,K5.getProperty)(e)}${(0,K5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,_Wn.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(Q9s,"getSubschema");yH.getSubschema=Q9s;function q9s(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,K5._)`${e.data}${(0,K5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,K5.str)`${d}${(0,_Wn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,K5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof K5.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(q9s,"extendSubschemaData");yH.extendSubschemaData=q9s;function j9s(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(j9s,"extendSubschemaMode");yH.extendSubschemaMode=j9s});var Flr=I((wCf,CWn)=>{"use strict";p();CWn.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 SWn=I((PCf,bWn)=>{"use strict";p();var EH=bWn.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(){};act(e,n,o,t,"",t)};EH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};EH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};EH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};EH.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 act(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 EH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.getSchemaRefs=Tb.resolveUrl=Tb.normalizeId=Tb._getFullPath=Tb.getFullPath=Tb.inlineRef=void 0;var G9s=Ja(),$9s=Flr(),V9s=SWn(),W9s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function z9s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ulr(t):e?TWn(t)<=e:!1}a(z9s,"inlineRef");Tb.inlineRef=z9s;var Y9s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ulr(t){for(let e in t){if(Y9s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ulr)||typeof r=="object"&&Ulr(r))return!0}return!1}a(Ulr,"hasRef");function TWn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!W9s.has(r)&&(typeof t[r]=="object"&&(0,G9s.eachItem)(t[r],n=>e+=TWn(n)),e===1/0))return 1/0}return e}a(TWn,"countKeys");function IWn(t,e="",r){r!==!1&&(e=ihe(e));let n=t.parse(e);return xWn(t,n)}a(IWn,"getFullPath");Tb.getFullPath=IWn;function xWn(t,e){return t.serialize(e).split("#")[0]+"#"}a(xWn,"_getFullPath");Tb._getFullPath=xWn;var K9s=/#\/?$/;function ihe(t){return t?t.replace(K9s,""):""}a(ihe,"normalizeId");Tb.normalizeId=ihe;function J9s(t,e,r){return r=ihe(r),t.resolve(e,r)}a(J9s,"resolveUrl");Tb.resolveUrl=J9s;var Z9s=/^[a-z_][-a-z0-9._]*$/i;function X9s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=ihe(t[r]||e),s={"":o},c=IWn(n,o,!1),l={},u=new Set;return V9s(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=ihe(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!==ihe(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(!Z9s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!$9s(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(X9s,"getSchemaRefs");Tb.getSchemaRefs=X9s});var hDe=I(_H=>{"use strict";p();Object.defineProperty(_H,"__esModule",{value:!0});_H.getData=_H.KeywordCxt=_H.validateFunctionCode=void 0;var DWn=aWn(),wWn=uDe(),qlr=Plr(),cct=uDe(),eUs=hWn(),pDe=EWn(),Qlr=vWn(),ii=Es(),po=m8(),tUs=dDe(),g8=Ja(),fDe=lDe();function rUs(t){if(OWn(t)&&(LWn(t),MWn(t))){oUs(t);return}NWn(t,()=>(0,DWn.topBoolOrEmptySchema)(t))}a(rUs,"validateFunctionCode");_H.validateFunctionCode=rUs;function NWn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ii._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,ii._)`"use strict"; ${RWn(r,o)}`),iUs(t,o),t.code(s)}):t.func(e,(0,ii._)`${po.default.data}, ${nUs(o)}`,n.$async,()=>t.code(RWn(r,o)).code(s))}a(NWn,"validateFunction");function nUs(t){return(0,ii._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,ii._)`, ${po.default.dynamicAnchors}={}`:ii.nil}}={}`}a(nUs,"destructureValCxt");function iUs(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,ii._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,ii._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,ii._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,ii._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ii._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,ii._)`""`),t.var(po.default.parentData,(0,ii._)`undefined`),t.var(po.default.parentDataProperty,(0,ii._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ii._)`{}`)})}a(iUs,"destructureValCxtES5");function oUs(t){let{schema:e,opts:r,gen:n}=t;NWn(t,()=>{r.$comment&&e.$comment&&FWn(t),uUs(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&sUs(t),BWn(t),pUs(t)})}a(oUs,"topSchemaObjCode");function sUs(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ii._)`${r}.evaluated`),e.if((0,ii._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ii._)`${t.evaluated}.props`,(0,ii._)`undefined`)),e.if((0,ii._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ii._)`${t.evaluated}.items`,(0,ii._)`undefined`))}a(sUs,"resetEvaluated");function RWn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ii._)`/*# sourceURL=${r} */`:ii.nil}a(RWn,"funcSourceUrl");function aUs(t,e){if(OWn(t)&&(LWn(t),MWn(t))){cUs(t,e);return}(0,DWn.boolOrEmptySchema)(t,e)}a(aUs,"subschemaCode");function MWn({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(MWn,"schemaCxtHasRules");function OWn(t){return typeof t.schema!="boolean"}a(OWn,"isSchemaObj");function cUs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&FWn(t),dUs(t),fUs(t);let s=n.const("_errs",po.default.errors);BWn(t,s),n.var(e,(0,ii._)`${s} === ${po.default.errors}`)}a(cUs,"subSchemaObjCode");function LWn(t){(0,g8.checkUnknownRules)(t),lUs(t)}a(LWn,"checkKeywords");function BWn(t,e){if(t.opts.jtd)return kWn(t,[],!1,e);let r=(0,wWn.getSchemaTypes)(t.schema),n=(0,wWn.coerceAndCheckDataType)(t,r);kWn(t,r,!n,e)}a(BWn,"typeAndKeywords");function lUs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,g8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(lUs,"checkRefsAndKeywords");function uUs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,g8.checkStrictMode)(t,"default is ignored in the schema root")}a(uUs,"checkNoDefault");function dUs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,tUs.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(dUs,"updateContext");function fUs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(fUs,"checkAsyncSchema");function FWn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ii._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ii.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ii._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(FWn,"commentKeyword");function pUs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ii._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,ii._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,ii._)`${n}.errors`,po.default.vErrors),s.unevaluated&&hUs(t),e.return((0,ii._)`${po.default.errors} === 0`))}a(pUs,"returnResults");function hUs({gen:t,evaluated:e,props:r,items:n}){r instanceof ii.Name&&t.assign((0,ii._)`${e}.props`,r),n instanceof ii.Name&&t.assign((0,ii._)`${e}.items`,n)}a(hUs,"assignEvaluated");function kWn(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,g8.schemaHasRulesButRef)(s,f))){o.block(()=>QWn(t,"$ref",f.all.$ref.definition));return}u.jtd||mUs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,qlr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,cct.checkDataType)(m.type,c,u.strictNumbers)),PWn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,cct.reportTypeError)(t)),o.endIf()):PWn(t,m),l||o.if((0,ii._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(kWn,"schemaKeywords");function PWn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,eUs.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,qlr.shouldUseRule)(n,s)&&QWn(t,s.keyword,s.definition,e.type)})}a(PWn,"iterateKeywords");function mUs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(gUs(t,e),t.opts.allowUnionTypes||AUs(t,e),yUs(t,t.dataTypes))}a(mUs,"checkStrictTypes");function gUs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{UWn(t.dataTypes,r)||jlr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),_Us(t,e)}}a(gUs,"checkContextTypes");function AUs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&jlr(t,"use allowUnionTypes to allow union type keyword")}a(AUs,"checkMultipleTypes");function yUs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,qlr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>EUs(e,c))&&jlr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(yUs,"checkKeywordTypes");function EUs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(EUs,"hasApplicableType");function UWn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(UWn,"includesType");function _Us(t,e){let r=[];for(let n of t.dataTypes)UWn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(_Us,"narrowSchemaTypes");function jlr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,g8.checkStrictMode)(t,e,t.opts.strictTypes)}a(jlr,"strictTypesError");var lct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,pDe.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,g8.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",qWn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,pDe.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,ii.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,ii.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,ii._)`${r} !== undefined && (${(0,ii.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?fDe.reportExtraError:fDe.reportError)(this,this.def.error,r)}$dataError(){(0,fDe.reportError)(this,this.def.$dataError||fDe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,fDe.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=ii.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ii.nil,r=ii.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ii.or)((0,ii._)`${o} === undefined`,r)),e!==ii.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ii.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ii.or)(c(),l());function c(){if(n.length){if(!(r instanceof ii.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ii._)`${(0,cct.checkDataTypes)(u,r,s.opts.strictNumbers,cct.DataType.Wrong)}`}return ii.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ii._)`!${u}(${r})`}return ii.nil}}subschema(e,r){let n=(0,Qlr.getSubschema)(this.it,e);(0,Qlr.extendSubschemaData)(n,this.it,e),(0,Qlr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return aUs(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=g8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=g8.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,ii.Name)),!0}};_H.KeywordCxt=lct;function QWn(t,e,r,n){let o=new lct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,pDe.funcKeywordCode)(o,r):"macro"in r?(0,pDe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,pDe.funcKeywordCode)(o,r)}a(QWn,"keywordCode");var vUs=/^\/(?:[^~]|~0|~1)*$/,CUs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function qWn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!vUs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=CUs.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,ii._)`${s}${(0,ii.getProperty)((0,g8.unescapeJsonPointer)(d))}`,c=(0,ii._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(qWn,"getData");_H.getData=qWn});var uct=I(Glr=>{"use strict";p();Object.defineProperty(Glr,"__esModule",{value:!0});var Hlr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Glr.default=Hlr});var mDe=I(Wlr=>{"use strict";p();Object.defineProperty(Wlr,"__esModule",{value:!0});var $lr=dDe(),Vlr=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,$lr.resolveUrl)(e,r,n),this.missingSchema=(0,$lr.normalizeId)((0,$lr.getFullPath)(e,this.missingRef))}};Wlr.default=Vlr});var fct=I(Jw=>{"use strict";p();Object.defineProperty(Jw,"__esModule",{value:!0});Jw.resolveSchema=Jw.getCompilingSchema=Jw.resolveRef=Jw.compileSchema=Jw.SchemaEnv=void 0;var O2=Es(),bUs=uct(),TX=m8(),L2=dDe(),jWn=Ja(),SUs=hDe(),ohe=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,L2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Jw.SchemaEnv=ohe;function Ylr(t){let e=HWn.call(this,t);if(e)return e;let r=(0,L2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new O2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:bUs.default,code:(0,O2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:TX.default.data,parentData:TX.default.parentData,parentDataProperty:TX.default.parentDataProperty,dataNames:[TX.default.data],dataPathArr:[O2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,O2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:O2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,O2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,SUs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(TX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${TX.default.self}`,`${TX.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 O2.Name?void 0:A,items:y instanceof O2.Name?void 0:y,dynamicProps:A instanceof O2.Name,dynamicItems:y instanceof O2.Name},g.source&&(g.source.evaluated=(0,O2.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(Ylr,"compileSchema");Jw.compileSchema=Ylr;function TUs(t,e,r){var n;r=(0,L2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=wUs.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 ohe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=IUs.call(this,s)}a(TUs,"resolveRef");Jw.resolveRef=TUs;function IUs(t){return(0,L2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Ylr.call(this,t)}a(IUs,"inlineOrCompile");function HWn(t){for(let e of this._compilations)if(xUs(e,t))return e}a(HWn,"getCompilingSchema");Jw.getCompilingSchema=HWn;function xUs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(xUs,"sameSchemaEnv");function wUs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||dct.call(this,t,e)}a(wUs,"resolve");function dct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,L2._getFullPath)(this.opts.uriResolver,r),o=(0,L2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return zlr.call(this,r,t);let s=(0,L2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=dct.call(this,t,c);return typeof l?.schema!="object"?void 0:zlr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||Ylr.call(this,c),s===(0,L2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,L2.resolveUrl)(this.opts.uriResolver,o,d)),new ohe({schema:l,schemaId:u,root:t,baseId:o})}return zlr.call(this,r,c)}}a(dct,"resolveSchema");Jw.resolveSchema=dct;var RUs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zlr(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,jWn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!RUs.has(l)&&d&&(e=(0,L2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,jWn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,L2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=dct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new ohe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(zlr,"getJsonPointer")});var GWn=I((YCf,kUs)=>{kUs.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 Zlr=I((KCf,KWn)=>{"use strict";p();var PUs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),VWn=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),Klr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),WWn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),DUs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Jlr(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(Jlr,"stringArrayToHexStripped");var NUs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function $Wn(t){return t.length=0,!0}a($Wn,"consumeIsZone");function MUs(t,e,r){if(t.length){let n=Jlr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(MUs,"consumeHextets");function OUs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=MUs;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=$Wn}else{o.push(d);continue}}return o.length&&(l===$Wn?r.zone=o.join(""):c?n.push(o.join("")):n.push(Jlr(o))),r.address=n.join(""),r}a(OUs,"getIPV6");function zWn(t){if(LUs(t,":")<2)return{host:t,isIPV6:!1};let e=OUs(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(zWn,"normalizeIPv6");function LUs(t,e){let r=0;for(let n=0;nFUs[n])}a(YWn,"reescapeHostDelimiters");function qUs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:$Us}=Zlr(),VUs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,WUs=["http","https","ws","wss","urn","urn:uuid"];function zUs(t){return WUs.indexOf(t)!==-1}a(zUs,"isValidSchemeName");function Xlr(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(Xlr,"wsIsSecure");function JWn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(JWn,"httpParse");function ZWn(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(ZWn,"httpSerialize");function YUs(t){return t.secure=Xlr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(YUs,"wsParse");function KUs(t){if((t.port===(Xlr(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(KUs,"wsSerialize");function JUs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(VUs);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=eur(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(JUs,"urnParse");function ZUs(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=eur(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(ZUs,"urnSerialize");function XUs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!$Us(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(XUs,"urnuuidParse");function e7s(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(e7s,"urnuuidSerialize");var XWn={scheme:"http",domainHost:!0,parse:JWn,serialize:ZWn},t7s={scheme:"https",domainHost:XWn.domainHost,parse:JWn,serialize:ZWn},pct={scheme:"ws",domainHost:!0,parse:YUs,serialize:KUs},r7s={scheme:"wss",domainHost:pct.domainHost,parse:pct.parse,serialize:pct.serialize},n7s={scheme:"urn",parse:JUs,serialize:ZUs,skipNormalize:!0},i7s={scheme:"urn:uuid",parse:XUs,serialize:e7s,skipNormalize:!0},hct={http:XWn,https:t7s,ws:pct,wss:r7s,urn:n7s,"urn:uuid":i7s};Object.setPrototypeOf(hct,null);function eur(t){return t&&(hct[t]||hct[t.toLowerCase()])||void 0}a(eur,"getSchemeHandler");ezn.exports={wsIsSecure:Xlr,SCHEMES:hct,isValidSchemeName:zUs,getSchemeHandler:eur}});var azn=I((rbf,mct)=>{"use strict";p();var{normalizeIPv6:o7s,removeDotSegments:gDe,recomposeAuthority:s7s,normalizePercentEncoding:a7s,normalizePathEncoding:c7s,escapePreservingEscapes:l7s,reescapeHostDelimiters:u7s,isIPv4:d7s,nonSimpleDomain:f7s}=Zlr(),{SCHEMES:p7s,getSchemeHandler:nzn}=tzn();function h7s(t,e){return typeof t=="string"?t=E7s(t,e):typeof t=="object"&&(t=she(IX(t,e),e)),t}a(h7s,"normalize");function m7s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=izn(she(t,n),she(e,n),n,!0);return n.skipEscape=!0,IX(o,n)}a(m7s,"resolve");function izn(t,e,r,n){let o={};return n||(t=she(IX(t,r),r),e=she(IX(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=gDe(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=gDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=gDe(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=gDe(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(izn,"resolveComponent");function g7s(t,e,r){let n=rzn(t,r),o=rzn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(g7s,"equal");function IX(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=nzn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=a7s(r.path):(r.path=l7s(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=s7s(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=gDe(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(IX,"serialize");var A7s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function y7s(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(y7s,"getParseError");function ozn(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(A7s);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=y7s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(d7s(n.host)===!1){let f=o7s(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=nzn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&f7s(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=u7s(unescape(n.host),s))),n.path&&(n.path=c7s(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(ozn,"parseWithStatus");function she(t,e){return ozn(t,e).parsed}a(she,"parse");function E7s(t,e){return szn(t,e).normalized}a(E7s,"normalizeString");function szn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=ozn(t,e);return{normalized:n?t:IX(r,e),malformedAuthorityOrPort:n}}a(szn,"normalizeStringWithStatus");function rzn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=szn(t,e);return n?void 0:r}if(typeof t=="object")return IX(t,e)}a(rzn,"normalizeComparableURI");var tur={SCHEMES:p7s,normalize:h7s,resolve:m7s,resolveComponent:izn,equal:g7s,serialize:IX,parse:she};mct.exports=tur;mct.exports.default=tur;mct.exports.fastUri=tur});var lzn=I(rur=>{"use strict";p();Object.defineProperty(rur,"__esModule",{value:!0});var czn=azn();czn.code='require("ajv/dist/runtime/uri").default';rur.default=czn});var Azn=I(XA=>{"use strict";p();Object.defineProperty(XA,"__esModule",{value:!0});XA.CodeGen=XA.Name=XA.nil=XA.stringify=XA.str=XA._=XA.KeywordCxt=void 0;var _7s=hDe();Object.defineProperty(XA,"KeywordCxt",{enumerable:!0,get:a(function(){return _7s.KeywordCxt},"get")});var ahe=Es();Object.defineProperty(XA,"_",{enumerable:!0,get:a(function(){return ahe._},"get")});Object.defineProperty(XA,"str",{enumerable:!0,get:a(function(){return ahe.str},"get")});Object.defineProperty(XA,"stringify",{enumerable:!0,get:a(function(){return ahe.stringify},"get")});Object.defineProperty(XA,"nil",{enumerable:!0,get:a(function(){return ahe.nil},"get")});Object.defineProperty(XA,"Name",{enumerable:!0,get:a(function(){return ahe.Name},"get")});Object.defineProperty(XA,"CodeGen",{enumerable:!0,get:a(function(){return ahe.CodeGen},"get")});var v7s=uct(),hzn=mDe(),C7s=klr(),ADe=fct(),b7s=Es(),yDe=dDe(),gct=uDe(),iur=Ja(),uzn=GWn(),S7s=lzn(),mzn=a((t,e)=>new RegExp(t,e),"defaultRegExp");mzn.code="new RegExp";var T7s=["removeAdditional","useDefaults","coerceTypes"],I7s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x7s={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."},w7s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},dzn=200;function R7s(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,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:mzn,M=(o=t.uriResolver)!==null&&o!==void 0?o:S7s.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:dzn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:dzn,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(R7s,"requiredOptions");var EDe=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,...R7s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new b7s.ValueScope({scope:{},prefixes:I7s,es5:r,lines:n}),this.logger=O7s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,C7s.getRules)(),fzn.call(this,x7s,e,"NOT SUPPORTED"),fzn.call(this,w7s,e,"DEPRECATED","warn"),this._metaOpts=N7s.call(this),e.formats&&P7s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&D7s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),k7s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=uzn;n==="id"&&(o={...uzn},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 hzn.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,yDe.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=pzn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new ADe.SchemaEnv({schema:{},schemaId:n});if(r=ADe.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=pzn.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,yDe.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(B7s.call(this,n,r),!r)return(0,iur.eachItem)(n,s=>nur.call(this,s)),this;U7s.call(this,r);let o={...r,type:(0,gct.getJSONTypes)(r.type),schemaType:(0,gct.getJSONTypes)(r.schemaType)};return(0,iur.eachItem)(n,o.type.length===0?s=>nur.call(this,s,o):s=>o.type.forEach(c=>nur.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]=gzn(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,yDe.normalizeId)(c||n);let d=yDe.getSchemaRefs.call(this,e,n);return u=new ADe.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):ADe.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{ADe.compileSchema.call(this,e)}finally{this.opts=r}}};EDe.ValidationError=v7s.default;EDe.MissingRefError=hzn.default;XA.default=EDe;function fzn(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(fzn,"checkOptions");function pzn(t){return t=(0,yDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(pzn,"getSchEnv");function k7s(){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(k7s,"addInitialSchemas");function P7s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(P7s,"addInitialFormats");function D7s(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(D7s,"addInitialKeywords");function N7s(){let t={...this.opts};for(let e of T7s)delete t[e];return t}a(N7s,"getMetaSchemaOptions");var M7s={log(){},warn(){},error(){}};function O7s(t){if(t===!1)return M7s;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(O7s,"getLogger");var L7s=/^[a-z_$][a-z0-9_$:-]*$/i;function B7s(t,e){let{RULES:r}=this;if((0,iur.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!L7s.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(B7s,"checkKeyword");function nur(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,gct.getJSONTypes)(e.type),schemaType:(0,gct.getJSONTypes)(e.schemaType)}};e.before?F7s.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(nur,"addRule");function F7s(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(F7s,"addBeforeRule");function U7s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=gzn(e)),t.validateSchema=this.compile(e,!0))}a(U7s,"keywordMetaschema");var Q7s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function gzn(t){return{anyOf:[t,Q7s]}}a(gzn,"schemaOrData")});var yzn=I(our=>{"use strict";p();Object.defineProperty(our,"__esModule",{value:!0});var q7s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};our.default=q7s});var Czn=I(xX=>{"use strict";p();Object.defineProperty(xX,"__esModule",{value:!0});xX.callRef=xX.getValidate=void 0;var j7s=mDe(),Ezn=Kw(),Ib=Es(),che=m8(),_zn=fct(),Act=Ja(),H7s={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=_zn.resolveRef.call(u,d,o,r);if(f===void 0)throw new j7s.default(n.opts.uriResolver,o,r);if(f instanceof _zn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return yct(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return yct(t,(0,Ib._)`${A}.validate`,d,d.$async)}function m(A){let y=vzn(t,A);yct(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Ib.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:Ib.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function vzn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ib._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(vzn,"getValidate");xX.getValidate=vzn;function yct(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?che.default.this:Ib.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,Ib._)`await ${(0,Ezn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Ib._)`!(${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,Ezn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Ib._)`${A}.errors`;o.assign(che.default.vErrors,(0,Ib._)`${che.default.vErrors} === null ? ${y} : ${che.default.vErrors}.concat(${y})`),o.assign(che.default.errors,(0,Ib._)`${che.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=Act.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,Ib._)`${A}.evaluated.props`);s.props=Act.mergeEvaluated.props(o,_,s.props,Ib.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Act.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,Ib._)`${A}.evaluated.items`);s.items=Act.mergeEvaluated.items(o,_,s.items,Ib.Name)}}a(g,"addEvaluatedFrom")}a(yct,"callRef");xX.callRef=yct;xX.default=H7s});var bzn=I(sur=>{"use strict";p();Object.defineProperty(sur,"__esModule",{value:!0});var G7s=yzn(),$7s=Czn(),V7s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",G7s.default,$7s.default];sur.default=V7s});var Szn=I(aur=>{"use strict";p();Object.defineProperty(aur,"__esModule",{value:!0});var Ect=Es(),vH=Ect.operators,_ct={maximum:{okStr:"<=",ok:vH.LTE,fail:vH.GT},minimum:{okStr:">=",ok:vH.GTE,fail:vH.LT},exclusiveMaximum:{okStr:"<",ok:vH.LT,fail:vH.GTE},exclusiveMinimum:{okStr:">",ok:vH.GT,fail:vH.LTE}},W7s={message:a(({keyword:t,schemaCode:e})=>(0,Ect.str)`must be ${_ct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,Ect._)`{comparison: ${_ct[t].okStr}, limit: ${e}}`,"params")},z7s={keyword:Object.keys(_ct),type:"number",schemaType:"number",$data:!0,error:W7s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Ect._)`${r} ${_ct[e].fail} ${n} || isNaN(${r})`)}};aur.default=z7s});var Tzn=I(cur=>{"use strict";p();Object.defineProperty(cur,"__esModule",{value:!0});var _De=Es(),Y7s={message:a(({schemaCode:t})=>(0,_De.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,_De._)`{multipleOf: ${t}}`,"params")},K7s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Y7s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,_De._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,_De._)`${c} !== parseInt(${c})`;t.fail$data((0,_De._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};cur.default=K7s});var xzn=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});function Izn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(uur,"__esModule",{value:!0});var wX=Es(),J7s=Ja(),Z7s=xzn(),X7s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,wX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,wX._)`{limit: ${t}}`,"params")},eQs={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:X7s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?wX.operators.GT:wX.operators.LT,c=o.opts.unicode===!1?(0,wX._)`${r}.length`:(0,wX._)`${(0,J7s.useFunc)(t.gen,Z7s.default)}(${r})`;t.fail$data((0,wX._)`${c} ${s} ${n}`)}};uur.default=eQs});var Rzn=I(dur=>{"use strict";p();Object.defineProperty(dur,"__esModule",{value:!0});var tQs=Kw(),rQs=Ja(),lhe=Es(),nQs={message:a(({schemaCode:t})=>(0,lhe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,lhe._)`{pattern: ${t}}`,"params")},iQs={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:nQs,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,lhe._)`new RegExp`:(0,rQs.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,lhe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,lhe._)`!${f}`)}else{let u=(0,tQs.usePattern)(t,o);t.fail$data((0,lhe._)`!${u}.test(${r})`)}}};dur.default=iQs});var kzn=I(fur=>{"use strict";p();Object.defineProperty(fur,"__esModule",{value:!0});var vDe=Es(),oQs={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,vDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,vDe._)`{limit: ${t}}`,"params")},sQs={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:oQs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?vDe.operators.GT:vDe.operators.LT;t.fail$data((0,vDe._)`Object.keys(${r}).length ${o} ${n}`)}};fur.default=sQs});var Pzn=I(pur=>{"use strict";p();Object.defineProperty(pur,"__esModule",{value:!0});var CDe=Kw(),bDe=Es(),aQs=Ja(),cQs={message:a(({params:{missingProperty:t}})=>(0,bDe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,bDe._)`{missingProperty: ${t}}`,"params")},lQs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cQs,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,aQs.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(bDe.nil,h);else for(let g of r)(0,CDe.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,CDe.checkMissingProp)(t,r,g)),(0,CDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,CDe.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,CDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,bDe.not)(A),()=>{t.error(),e.break()})},bDe.nil)}a(m,"loopUntilMissing")}};pur.default=lQs});var Dzn=I(hur=>{"use strict";p();Object.defineProperty(hur,"__esModule",{value:!0});var SDe=Es(),uQs={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,SDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,SDe._)`{limit: ${t}}`,"params")},dQs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:uQs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?SDe.operators.GT:SDe.operators.LT;t.fail$data((0,SDe._)`${r}.length ${o} ${n}`)}};hur.default=dQs});var vct=I(mur=>{"use strict";p();Object.defineProperty(mur,"__esModule",{value:!0});var Nzn=Flr();Nzn.code='require("ajv/dist/runtime/equal").default';mur.default=Nzn});var Mzn=I(Aur=>{"use strict";p();Object.defineProperty(Aur,"__esModule",{value:!0});var gur=uDe(),ey=Es(),fQs=Ja(),pQs=vct(),hQs={message:a(({params:{i:t,j:e}})=>(0,ey.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,ey._)`{i: ${t}, j: ${e}}`,"params")},mQs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:hQs,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,gur.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,ey._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,ey._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,ey._)`${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,gur.checkDataTypes)(d,E,l.opts.strictNumbers,gur.DataType.Wrong),v=e.const("indices",(0,ey._)`{}`);e.for((0,ey._)`;${A}--;`,()=>{e.let(E,(0,ey._)`${r}[${A}]`),e.if(_,(0,ey._)`continue`),d.length>1&&e.if((0,ey._)`typeof ${E} == "string"`,(0,ey._)`${E} += "_"`),e.if((0,ey._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,ey._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,ey._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,fQs.useFunc)(e,pQs.default),_=e.name("outer");e.label(_).for((0,ey._)`;${A}--;`,()=>e.for((0,ey._)`${y} = ${A}; ${y}--;`,()=>e.if((0,ey._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};Aur.default=mQs});var Ozn=I(Eur=>{"use strict";p();Object.defineProperty(Eur,"__esModule",{value:!0});var yur=Es(),gQs=Ja(),AQs=vct(),yQs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,yur._)`{allowedValue: ${t}}`,"params")},EQs={keyword:"const",$data:!0,error:yQs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,yur._)`!${(0,gQs.useFunc)(e,AQs.default)}(${r}, ${o})`):t.fail((0,yur._)`${s} !== ${r}`)}};Eur.default=EQs});var Lzn=I(_ur=>{"use strict";p();Object.defineProperty(_ur,"__esModule",{value:!0});var TDe=Es(),_Qs=Ja(),vQs=vct(),CQs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,TDe._)`{allowedValues: ${t}}`,"params")},bQs={keyword:"enum",schemaType:"array",$data:!0,error:CQs,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,_Qs.useFunc)(e,vQs.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,TDe.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,TDe._)`${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,TDe._)`${d()}(${r}, ${g}[${A}])`:(0,TDe._)`${r} === ${y}`}a(m,"equalCode")}};_ur.default=bQs});var Bzn=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});var SQs=Szn(),TQs=Tzn(),IQs=wzn(),xQs=Rzn(),wQs=kzn(),RQs=Pzn(),kQs=Dzn(),PQs=Mzn(),DQs=Ozn(),NQs=Lzn(),MQs=[SQs.default,TQs.default,IQs.default,xQs.default,wQs.default,RQs.default,kQs.default,PQs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DQs.default,NQs.default];vur.default=MQs});var bur=I(IDe=>{"use strict";p();Object.defineProperty(IDe,"__esModule",{value:!0});IDe.validateAdditionalItems=void 0;var RX=Es(),Cur=Ja(),OQs={message:a(({params:{len:t}})=>(0,RX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,RX._)`{limit: ${t}}`,"params")},LQs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:OQs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Cur.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Fzn(t,n)}};function Fzn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,RX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,RX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Cur.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,RX._)`${l} <= ${e.length}`);r.if((0,RX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Cur.Type.Num},d),c.allErrors||r.if((0,RX.not)(d),()=>r.break())})}a(u,"validateItems")}a(Fzn,"validateAdditionalItems");IDe.validateAdditionalItems=Fzn;IDe.default=LQs});var Sur=I(xDe=>{"use strict";p();Object.defineProperty(xDe,"__esModule",{value:!0});xDe.validateTuple=void 0;var Uzn=Es(),Cct=Ja(),BQs=Kw(),FQs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Qzn(t,"additionalItems",e);r.items=!0,!(0,Cct.alwaysValidSchema)(r,e)&&t.ok((0,BQs.validateArray)(t))}};function Qzn(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=Cct.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,Uzn._)`${s}.length`);r.forEach((h,m)=>{(0,Cct.alwaysValidSchema)(l,h)||(n.if((0,Uzn._)`${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,Cct.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(Qzn,"validateTuple");xDe.validateTuple=Qzn;xDe.default=FQs});var qzn=I(Tur=>{"use strict";p();Object.defineProperty(Tur,"__esModule",{value:!0});var UQs=Sur(),QQs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,UQs.validateTuple)(t,"items"),"code")};Tur.default=QQs});var Hzn=I(Iur=>{"use strict";p();Object.defineProperty(Iur,"__esModule",{value:!0});var jzn=Es(),qQs=Ja(),jQs=Kw(),HQs=bur(),GQs={message:a(({params:{len:t}})=>(0,jzn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,jzn._)`{limit: ${t}}`,"params")},$Qs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:GQs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,qQs.alwaysValidSchema)(n,e)&&(o?(0,HQs.validateAdditionalItems)(t,o):t.ok((0,jQs.validateArray)(t)))}};Iur.default=$Qs});var Gzn=I(xur=>{"use strict";p();Object.defineProperty(xur,"__esModule",{value:!0});var Zw=Es(),bct=Ja(),VQs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,Zw.str)`must contain at least ${t} valid item(s)`:(0,Zw.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,Zw._)`{minContains: ${t}}`:(0,Zw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},WQs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:VQs,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,Zw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,bct.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,bct.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,bct.alwaysValidSchema)(s,r)){let y=(0,Zw._)`${f} >= ${c}`;l!==void 0&&(y=(0,Zw._)`${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,Zw._)`${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:bct.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,Zw._)`${y}++`),l===void 0?e.if((0,Zw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,Zw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,Zw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};xur.default=WQs});var Wzn=I(J5=>{"use strict";p();Object.defineProperty(J5,"__esModule",{value:!0});J5.validateSchemaDeps=J5.validatePropertyDeps=J5.error=void 0;var wur=Es(),zQs=Ja(),wDe=Kw();J5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,wur.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,wur._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`,"params")};var MQs={keyword:"dependencies",type:"object",schemaType:"object",error:K5.error,code(t){let[e,r]=OQs(t);Qzn(t,e),qzn(t,r)}};function OQs({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(OQs,"splitDependencies");function Qzn(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,TDe.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,TDe.checkReportMissingProp)(t,d)}):(r.if((0,Sur._)`${u} && (${(0,TDe.checkMissingProp)(t,l,s)})`),(0,TDe.reportMissingProp)(t,s),r.else())}}a(Qzn,"validatePropertyDeps");K5.validatePropertyDeps=Qzn;function qzn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,NQs.alwaysValidSchema)(s,e[l])||(r.if((0,TDe.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(qzn,"validateSchemaDeps");K5.validateSchemaDeps=qzn;K5.default=MQs});var Gzn=I(Tur=>{"use strict";p();Object.defineProperty(Tur,"__esModule",{value:!0});var Hzn=Es(),LQs=Ka(),BQs={message:"property name must be valid",params:a(({params:t})=>(0,Hzn._)`{propertyName: ${t.propertyName}}`,"params")},FQs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:BQs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,LQs.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,Hzn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Tur.default=FQs});var xur=I(Iur=>{"use strict";p();Object.defineProperty(Iur,"__esModule",{value:!0});var yct=zw(),O2=Es(),UQs=p8(),Ect=Ka(),QQs={message:"must NOT have additional properties",params:a(({params:t})=>(0,O2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},qQs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QQs,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,Ect.alwaysValidSchema)(c,r))return;let d=(0,yct.allSchemaProperties)(n.properties),f=(0,yct.allSchemaProperties)(n.patternProperties);h(),t.ok((0,O2._)`${s} === ${UQs.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,Ect.schemaRefOrVal)(c,n.properties,"properties");_=(0,yct.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,yct.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,Ect.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:Ect.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Iur.default=qQs});var Wzn=I(Rur=>{"use strict";p();Object.defineProperty(Rur,"__esModule",{value:!0});var jQs=dDe(),$zn=zw(),wur=Ka(),Vzn=xur(),HQs={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&&Vzn.default.code(new jQs.KeywordCxt(s,Vzn.default,"additionalProperties"));let c=(0,$zn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=wur.mergeEvaluated.props(e,(0,wur.toHash)(c),s.props));let l=c.filter(h=>!(0,wur.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,$zn.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")}};Rur.default=HQs});var Jzn=I(kur=>{"use strict";p();Object.defineProperty(kur,"__esModule",{value:!0});var zzn=zw(),_ct=Es(),Yzn=Ka(),Kzn=Ka(),GQs={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,zzn.allSchemaProperties)(r),u=l.filter(y=>(0,Yzn.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 _ct.Name)&&(s.props=(0,Kzn.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,Yzn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,_ct._)`${(0,zzn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:Kzn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,_ct._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,_ct.not)(f),()=>e.break())})})}a(A,"validateProperties")}};kur.default=GQs});var Zzn=I(Pur=>{"use strict";p();Object.defineProperty(Pur,"__esModule",{value:!0});var $Qs=Ka(),VQs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,$Qs.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"}};Pur.default=VQs});var Xzn=I(Dur=>{"use strict";p();Object.defineProperty(Dur,"__esModule",{value:!0});var WQs=zw(),zQs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WQs.validateUnion,error:{message:"must match a schema in anyOf"}};Dur.default=zQs});var eYn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});var vct=Es(),YQs=Ka(),KQs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,vct._)`{passingSchemas: ${t.passing}}`,"params")},JQs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:KQs,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,YQs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,vct._)`${u} && ${c}`).assign(c,!1).assign(l,(0,vct._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,vct.Name)})})}a(d,"validateOneOf")}};Nur.default=JQs});var tYn=I(Mur=>{"use strict";p();Object.defineProperty(Mur,"__esModule",{value:!0});var ZQs=Ka(),XQs={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,ZQs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Mur.default=XQs});var iYn=I(Our=>{"use strict";p();Object.defineProperty(Our,"__esModule",{value:!0});var Cct=Es(),nYn=Ka(),eqs={message:a(({params:t})=>(0,Cct.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Cct._)`{failingKeyword: ${t.ifClause}}`,"params")},tqs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:eqs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,nYn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=rYn(n,"then"),s=rYn(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,Cct.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,Cct._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function rYn(t,e){let r=t.schema[e];return r!==void 0&&!(0,nYn.alwaysValidSchema)(t,r)}a(rYn,"hasSchema");Our.default=tqs});var oYn=I(Lur=>{"use strict";p();Object.defineProperty(Lur,"__esModule",{value:!0});var rqs=Ka(),nqs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,rqs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Lur.default=nqs});var sYn=I(Bur=>{"use strict";p();Object.defineProperty(Bur,"__esModule",{value:!0});var iqs=Eur(),oqs=Lzn(),sqs=_ur(),aqs=Fzn(),cqs=Uzn(),lqs=jzn(),uqs=Gzn(),dqs=xur(),fqs=Wzn(),pqs=Jzn(),hqs=Zzn(),mqs=Xzn(),gqs=eYn(),Aqs=tYn(),yqs=iYn(),Eqs=oYn();function _qs(t=!1){let e=[hqs.default,mqs.default,gqs.default,Aqs.default,yqs.default,Eqs.default,uqs.default,dqs.default,lqs.default,fqs.default,pqs.default];return t?e.push(oqs.default,aqs.default):e.push(iqs.default,sqs.default),e.push(cqs.default),e}a(_qs,"getApplicator");Bur.default=_qs});var aYn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});var uh=Es(),vqs={message:a(({schemaCode:t})=>(0,uh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,uh._)`{format: ${t}}`,"params")},Cqs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:vqs,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,uh._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,uh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,uh._)`${y}.type || "string"`).assign(_,(0,uh._)`${y}.validate`),()=>r.assign(E,(0,uh._)`"string"`).assign(_,y)),t.fail$data((0,uh.or)(v(),b()));function v(){return u.strictSchema===!1?uh.nil:(0,uh._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,uh._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,uh._)`${_}(${n})`,w=(0,uh._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,uh._)`${_} && ${_} !== 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,uh.regexpCode)(w):u.code.formats?(0,uh._)`${u.code.formats}${(0,uh.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,uh._)`${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,uh._)`await ${_}(${n})`}return typeof E=="function"?(0,uh._)`${_}(${n})`:(0,uh._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Fur.default=Cqs});var cYn=I(Uur=>{"use strict";p();Object.defineProperty(Uur,"__esModule",{value:!0});var bqs=aYn(),Sqs=[bqs.default];Uur.default=Sqs});var lYn=I(lhe=>{"use strict";p();Object.defineProperty(lhe,"__esModule",{value:!0});lhe.contentVocabulary=lhe.metadataVocabulary=void 0;lhe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];lhe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var dYn=I(Qur=>{"use strict";p();Object.defineProperty(Qur,"__esModule",{value:!0});var Tqs=yzn(),Iqs=Dzn(),xqs=sYn(),wqs=cYn(),uYn=lYn(),Rqs=[Tqs.default,Iqs.default,(0,xqs.default)(),wqs.default,uYn.metadataVocabulary,uYn.contentVocabulary];Qur.default=Rqs});var pYn=I(bct=>{"use strict";p();Object.defineProperty(bct,"__esModule",{value:!0});bct.DiscrError=void 0;var fYn;(function(t){t.Tag="tag",t.Mapping="mapping"})(fYn||(bct.DiscrError=fYn={}))});var mYn=I(jur=>{"use strict";p();Object.defineProperty(jur,"__esModule",{value:!0});var uhe=Es(),qur=pYn(),hYn=sct(),kqs=fDe(),Pqs=Ka(),Dqs={message:a(({params:{discrError:t,tagName:e}})=>t===qur.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,uhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Nqs={keyword:"discriminator",type:"object",schemaType:"object",error:Dqs,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,uhe._)`${r}${(0,uhe.getProperty)(l)}`);e.if((0,uhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:qur.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,uhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:qur.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,uhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{Mqs.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 Gur=I((pd,Hur)=>{"use strict";p();Object.defineProperty(pd,"__esModule",{value:!0});pd.MissingRefError=pd.ValidationError=pd.CodeGen=pd.Name=pd.nil=pd.stringify=pd.str=pd._=pd.KeywordCxt=pd.Ajv=void 0;var Oqs=fzn(),Lqs=dYn(),Bqs=mYn(),AYn=gYn(),Fqs=["/properties"],Sct="http://json-schema.org/draft-07/schema",dhe=class extends Oqs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Lqs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Bqs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(AYn,Fqs):AYn;this.addMetaSchema(e,Sct,!1),this.refs["http://json-schema.org/schema"]=Sct}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sct)?Sct:void 0)}};pd.Ajv=dhe;Hur.exports=pd=dhe;Hur.exports.Ajv=dhe;Object.defineProperty(pd,"__esModule",{value:!0});pd.default=dhe;var Uqs=dDe();Object.defineProperty(pd,"KeywordCxt",{enumerable:!0,get:a(function(){return Uqs.KeywordCxt},"get")});var fhe=Es();Object.defineProperty(pd,"_",{enumerable:!0,get:a(function(){return fhe._},"get")});Object.defineProperty(pd,"str",{enumerable:!0,get:a(function(){return fhe.str},"get")});Object.defineProperty(pd,"stringify",{enumerable:!0,get:a(function(){return fhe.stringify},"get")});Object.defineProperty(pd,"nil",{enumerable:!0,get:a(function(){return fhe.nil},"get")});Object.defineProperty(pd,"Name",{enumerable:!0,get:a(function(){return fhe.Name},"get")});Object.defineProperty(pd,"CodeGen",{enumerable:!0,get:a(function(){return fhe.CodeGen},"get")});var Qqs=ict();Object.defineProperty(pd,"ValidationError",{enumerable:!0,get:a(function(){return Qqs.default},"get")});var qqs=fDe();Object.defineProperty(pd,"MissingRefError",{enumerable:!0,get:a(function(){return qqs.default},"get")})});var TYn=I(Z5=>{"use strict";p();Object.defineProperty(Z5,"__esModule",{value:!0});Z5.formatNames=Z5.fastFormats=Z5.fullFormats=void 0;function J5(t,e){return{validate:t,compare:e}}a(J5,"fmtDef");Z5.fullFormats={date:J5(vYn,zur),time:J5(Vur(!0),Yur),"date-time":J5(yYn(!0),bYn),"iso-time":J5(Vur(),CYn),"iso-date-time":J5(yYn(),SYn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Wqs,"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:ejs,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:zqs,int32:{type:"number",validate:Jqs},int64:{type:"number",validate:Zqs},float:{type:"number",validate:_Yn},double:{type:"number",validate:_Yn},password:!0,binary:!0};Z5.fastFormats={...Z5.fullFormats,date:J5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,zur),time:J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Yur),"date-time":J5(/^\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,bYn),"iso-time":J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CYn),"iso-date-time":J5(/^\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,SYn),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};Z5.formatNames=Object.keys(Z5.fullFormats);function jqs(t){return t%4===0&&(t%100!==0||t%400===0)}a(jqs,"isLeapYear");var Hqs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Gqs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function vYn(t){let e=Hqs.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&&jqs(r)?29:Gqs[n])}a(vYn,"date");function zur(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(Vur,"getTime");function Yur(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(Yur,"compareTime");function CYn(t,e){if(!(t&&e))return;let r=$ur.exec(t),n=$ur.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=Yqs}a(Jqs,"validateInt32");function Zqs(t){return Number.isInteger(t)}a(Zqs,"validateInt64");function _Yn(){return!0}a(_Yn,"validateNumber");var Xqs=/[^\\]\\Z/;function ejs(t){if(Xqs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(ejs,"regex")});var IYn=I(phe=>{"use strict";p();Object.defineProperty(phe,"__esModule",{value:!0});phe.formatLimitDefinition=void 0;var tjs=Gur(),L2=Es(),EH=L2.operators,Tct={formatMaximum:{okStr:"<=",ok:EH.LTE,fail:EH.GT},formatMinimum:{okStr:">=",ok:EH.GTE,fail:EH.LT},formatExclusiveMaximum:{okStr:"<",ok:EH.LT,fail:EH.GTE},formatExclusiveMinimum:{okStr:">",ok:EH.GT,fail:EH.LTE}},rjs={message:a(({keyword:t,schemaCode:e})=>(0,L2.str)`should be ${Tct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,L2._)`{comparison: ${Tct[t].okStr}, limit: ${e}}`,"params")};phe.formatLimitDefinition={keyword:Object.keys(Tct),type:"string",schemaType:"string",$data:!0,error:rjs,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 tjs.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}) ${Tct[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var njs=a(t=>(t.addKeyword(phe.formatLimitDefinition),t),"formatLimitPlugin");phe.default=njs});var kYn=I((IDe,RYn)=>{"use strict";p();Object.defineProperty(IDe,"__esModule",{value:!0});var hhe=TYn(),ijs=IYn(),Kur=Es(),xYn=new Kur.Name("fullFormats"),ojs=new Kur.Name("fastFormats"),Jur=a((t,e={keywords:!0})=>{if(Array.isArray(e))return wYn(t,e,hhe.fullFormats,xYn),t;let[r,n]=e.mode==="fast"?[hhe.fastFormats,ojs]:[hhe.fullFormats,xYn],o=e.formats||hhe.formatNames;return wYn(t,o,r,n),e.keywords&&(0,ijs.default)(t),t},"formatsPlugin");Jur.get=(t,e="full")=>{let n=(e==="fast"?hhe.fastFormats:hhe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function wYn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Kur._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(wYn,"addFormats");RYn.exports=IDe=Jur;Object.defineProperty(IDe,"__esModule",{value:!0});IDe.default=Jur});var oKn=I((bIf,iKn)=>{p();iKn.exports=nKn;nKn.sync=mjs;var tKn=require("fs");function hjs(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();lKn.exports=aKn;aKn.sync=gjs;var sKn=require("fs");function aKn(t,e,r){sKn.stat(t,function(n,o){r(n,n?!1:cKn(o,e))})}a(aKn,"isexe");function gjs(t,e){return cKn(sKn.statSync(t),e)}a(gjs,"sync");function cKn(t,e){return t.isFile()&&Ajs(t,e)}a(cKn,"checkStat");function Ajs(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(Ajs,"checkMode")});var fKn=I((kIf,dKn)=>{p();var RIf=require("fs"),qct;process.platform==="win32"||global.TESTING_WINDOWS?qct=oKn():qct=uKn();dKn.exports=pdr;pdr.sync=yjs;function pdr(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){pdr(t,e||{},function(s,c){s?o(s):n(c)})})}qct(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(pdr,"isexe");function yjs(t,e){try{return qct.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(yjs,"sync")});var EKn=I((NIf,yKn)=>{p();var The=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pKn=require("path"),Ejs=The?";":":",hKn=fKn(),mKn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),gKn=a((t,e)=>{let r=e.colon||Ejs,n=t.match(/\//)||The&&t.match(/\\/)?[""]:[...The?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=The?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=The?o.split(r):[""];return The&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),AKn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=gKn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(mKn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=pKn.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];hKn(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"),_js=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=gKn(t,e),s=[];for(let c=0;c{"use strict";p();var _Kn=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");hdr.exports=_Kn;hdr.exports.default=_Kn});var TKn=I((UIf,SKn)=>{"use strict";p();var CKn=require("path"),vjs=EKn(),Cjs=vKn();function bKn(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=vjs.sync(t.command,{path:r[Cjs({env:r})],pathExt:e?CKn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=CKn.resolve(o?t.options.cwd:"",c)),c}a(bKn,"resolveCommandAttempt");function bjs(t){return bKn(t)||bKn(t,!0)}a(bjs,"resolveCommand");SKn.exports=bjs});var IKn=I((jIf,gdr)=>{"use strict";p();var mdr=/([()\][%!^"`<>&|;, *?])/g;function Sjs(t){return t=t.replace(mdr,"^$1"),t}a(Sjs,"escapeCommand");function Tjs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(mdr,"^$1"),e&&(t=t.replace(mdr,"^$1")),t}a(Tjs,"escapeArgument");gdr.exports.command=Sjs;gdr.exports.argument=Tjs});var wKn=I(($If,xKn)=>{"use strict";p();xKn.exports=/^#!(.*)/});var kKn=I((WIf,RKn)=>{"use strict";p();var Ijs=wKn();RKn.exports=(t="")=>{let e=t.match(Ijs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var DKn=I((YIf,PKn)=>{"use strict";p();var Adr=require("fs"),xjs=kKn();function wjs(t){let r=Buffer.alloc(150),n;try{n=Adr.openSync(t,"r"),Adr.readSync(n,r,0,150,0),Adr.closeSync(n)}catch{}return xjs(r.toString())}a(wjs,"readShebang");PKn.exports=wjs});var LKn=I((ZIf,OKn)=>{"use strict";p();var Rjs=require("path"),NKn=TKn(),MKn=IKn(),kjs=DKn(),Pjs=process.platform==="win32",Djs=/\.(?:com|exe)$/i,Njs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Mjs(t){t.file=NKn(t);let e=t.file&&kjs(t.file);return e?(t.args.unshift(t.file),t.command=e,NKn(t)):t.file}a(Mjs,"detectShebang");function Ojs(t){if(!Pjs)return t;let e=Mjs(t),r=!Djs.test(e);if(t.options.forceShell||r){let n=Njs.test(e);t.command=Rjs.normalize(t.command),t.command=MKn.command(t.command),t.args=t.args.map(s=>MKn.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(Ojs,"parseNonShell");function Ljs(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:Ojs(n)}a(Ljs,"parse");OKn.exports=Ljs});var UKn=I((txf,FKn)=>{"use strict";p();var ydr=process.platform==="win32";function Edr(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(Edr,"notFoundError");function Bjs(t,e){if(!ydr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=BKn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(Bjs,"hookChildProcess");function BKn(t,e){return ydr&&t===1&&!e.file?Edr(e.original,"spawn"):null}a(BKn,"verifyENOENT");function Fjs(t,e){return ydr&&t===1&&!e.file?Edr(e.original,"spawnSync"):null}a(Fjs,"verifyENOENTSync");FKn.exports={hookChildProcess:Bjs,verifyENOENT:BKn,verifyENOENTSync:Fjs,notFoundError:Edr}});var jKn=I((ixf,Ihe)=>{"use strict";p();var QKn=require("child_process"),_dr=LKn(),vdr=UKn();function qKn(t,e,r){let n=_dr(t,e,r),o=QKn.spawn(n.command,n.args,n.options);return vdr.hookChildProcess(o,n),o}a(qKn,"spawn");function Ujs(t,e,r){let n=_dr(t,e,r),o=QKn.spawnSync(n.command,n.args,n.options);return o.error=o.error||vdr.verifyENOENTSync(o.status,n),o}a(Ujs,"spawnSync");Ihe.exports=qKn;Ihe.exports.spawn=qKn;Ihe.exports.sync=Ujs;Ihe.exports._parse=_dr;Ihe.exports._enoent=vdr});function BX(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(GDe(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(Fdr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(Fdr(b));return c=15}if(GDe(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 Fdr(t){return t===32||t===9}function GDe(t){return t===10||t===13}function khe(t){return t>=48&&t<=57}var _Jn,rlt=ve(()=>{"use strict";p();a(BX,"createScanner");a(Fdr,"isWhiteSpace");a(GDe,"isLineBreak");a(khe,"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"})(_Jn||(_Jn={}))});var BT,Phe,Udr,vJn,CJn=ve(()=>{p();BT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),Phe=200,Udr={" ":{"\n":new Array(Phe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(Phe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Phe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}," ":{"\n":new Array(Phe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(Phe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Phe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},vJn=[` + deps: ${r}}`,"params")};var YQs={keyword:"dependencies",type:"object",schemaType:"object",error:J5.error,code(t){let[e,r]=KQs(t);$zn(t,e),Vzn(t,r)}};function KQs({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(KQs,"splitDependencies");function $zn(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,wDe.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,wDe.checkReportMissingProp)(t,d)}):(r.if((0,wur._)`${u} && (${(0,wDe.checkMissingProp)(t,l,s)})`),(0,wDe.reportMissingProp)(t,s),r.else())}}a($zn,"validatePropertyDeps");J5.validatePropertyDeps=$zn;function Vzn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,zQs.alwaysValidSchema)(s,e[l])||(r.if((0,wDe.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(Vzn,"validateSchemaDeps");J5.validateSchemaDeps=Vzn;J5.default=YQs});var Yzn=I(Rur=>{"use strict";p();Object.defineProperty(Rur,"__esModule",{value:!0});var zzn=Es(),JQs=Ja(),ZQs={message:"property name must be valid",params:a(({params:t})=>(0,zzn._)`{propertyName: ${t.propertyName}}`,"params")},XQs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ZQs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,JQs.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,zzn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Rur.default=XQs});var Pur=I(kur=>{"use strict";p();Object.defineProperty(kur,"__esModule",{value:!0});var Sct=Kw(),B2=Es(),eqs=m8(),Tct=Ja(),tqs={message:"must NOT have additional properties",params:a(({params:t})=>(0,B2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},rqs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:tqs,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,Tct.alwaysValidSchema)(c,r))return;let d=(0,Sct.allSchemaProperties)(n.properties),f=(0,Sct.allSchemaProperties)(n.patternProperties);h(),t.ok((0,B2._)`${s} === ${eqs.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,Tct.schemaRefOrVal)(c,n.properties,"properties");_=(0,Sct.isOwnProperty)(e,v,E)}else d.length?_=(0,B2.or)(...d.map(v=>(0,B2._)`${E} === ${v}`)):_=B2.nil;return f.length&&(_=(0,B2.or)(_,...f.map(v=>(0,B2._)`${(0,Sct.usePattern)(t,v)}.test(${E})`))),(0,B2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,B2._)`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,Tct.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,B2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,B2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:Tct.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};kur.default=rqs});var Zzn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});var nqs=hDe(),Kzn=Kw(),Dur=Ja(),Jzn=Pur(),iqs={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&&Jzn.default.code(new nqs.KeywordCxt(s,Jzn.default,"additionalProperties"));let c=(0,Kzn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Dur.mergeEvaluated.props(e,(0,Dur.toHash)(c),s.props));let l=c.filter(h=>!(0,Dur.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,Kzn.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")}};Nur.default=iqs});var rYn=I(Mur=>{"use strict";p();Object.defineProperty(Mur,"__esModule",{value:!0});var Xzn=Kw(),Ict=Es(),eYn=Ja(),tYn=Ja(),oqs={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,Xzn.allSchemaProperties)(r),u=l.filter(y=>(0,eYn.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 Ict.Name)&&(s.props=(0,tYn.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,eYn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,Ict._)`${(0,Xzn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:tYn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,Ict._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,Ict.not)(f),()=>e.break())})})}a(A,"validateProperties")}};Mur.default=oqs});var nYn=I(Our=>{"use strict";p();Object.defineProperty(Our,"__esModule",{value:!0});var sqs=Ja(),aqs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,sqs.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"}};Our.default=aqs});var iYn=I(Lur=>{"use strict";p();Object.defineProperty(Lur,"__esModule",{value:!0});var cqs=Kw(),lqs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cqs.validateUnion,error:{message:"must match a schema in anyOf"}};Lur.default=lqs});var oYn=I(Bur=>{"use strict";p();Object.defineProperty(Bur,"__esModule",{value:!0});var xct=Es(),uqs=Ja(),dqs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,xct._)`{passingSchemas: ${t.passing}}`,"params")},fqs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dqs,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,uqs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,xct._)`${u} && ${c}`).assign(c,!1).assign(l,(0,xct._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,xct.Name)})})}a(d,"validateOneOf")}};Bur.default=fqs});var sYn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});var pqs=Ja(),hqs={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,pqs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Fur.default=hqs});var lYn=I(Uur=>{"use strict";p();Object.defineProperty(Uur,"__esModule",{value:!0});var wct=Es(),cYn=Ja(),mqs={message:a(({params:t})=>(0,wct.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,wct._)`{failingKeyword: ${t.ifClause}}`,"params")},gqs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:mqs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,cYn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=aYn(n,"then"),s=aYn(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,wct.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,wct._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function aYn(t,e){let r=t.schema[e];return r!==void 0&&!(0,cYn.alwaysValidSchema)(t,r)}a(aYn,"hasSchema");Uur.default=gqs});var uYn=I(Qur=>{"use strict";p();Object.defineProperty(Qur,"__esModule",{value:!0});var Aqs=Ja(),yqs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Aqs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Qur.default=yqs});var dYn=I(qur=>{"use strict";p();Object.defineProperty(qur,"__esModule",{value:!0});var Eqs=bur(),_qs=qzn(),vqs=Sur(),Cqs=Hzn(),bqs=Gzn(),Sqs=Wzn(),Tqs=Yzn(),Iqs=Pur(),xqs=Zzn(),wqs=rYn(),Rqs=nYn(),kqs=iYn(),Pqs=oYn(),Dqs=sYn(),Nqs=lYn(),Mqs=uYn();function Oqs(t=!1){let e=[Rqs.default,kqs.default,Pqs.default,Dqs.default,Nqs.default,Mqs.default,Tqs.default,Iqs.default,Sqs.default,xqs.default,wqs.default];return t?e.push(_qs.default,Cqs.default):e.push(Eqs.default,vqs.default),e.push(bqs.default),e}a(Oqs,"getApplicator");qur.default=Oqs});var fYn=I(jur=>{"use strict";p();Object.defineProperty(jur,"__esModule",{value:!0});var fh=Es(),Lqs={message:a(({schemaCode:t})=>(0,fh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,fh._)`{format: ${t}}`,"params")},Bqs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Lqs,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,fh._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,fh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,fh._)`${y}.type || "string"`).assign(_,(0,fh._)`${y}.validate`),()=>r.assign(E,(0,fh._)`"string"`).assign(_,y)),t.fail$data((0,fh.or)(v(),b()));function v(){return u.strictSchema===!1?fh.nil:(0,fh._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,fh._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,fh._)`${_}(${n})`,w=(0,fh._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,fh._)`${_} && ${_} !== 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,fh.regexpCode)(w):u.code.formats?(0,fh._)`${u.code.formats}${(0,fh.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,fh._)`${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,fh._)`await ${_}(${n})`}return typeof E=="function"?(0,fh._)`${_}(${n})`:(0,fh._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};jur.default=Bqs});var pYn=I(Hur=>{"use strict";p();Object.defineProperty(Hur,"__esModule",{value:!0});var Fqs=fYn(),Uqs=[Fqs.default];Hur.default=Uqs});var hYn=I(uhe=>{"use strict";p();Object.defineProperty(uhe,"__esModule",{value:!0});uhe.contentVocabulary=uhe.metadataVocabulary=void 0;uhe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];uhe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var gYn=I(Gur=>{"use strict";p();Object.defineProperty(Gur,"__esModule",{value:!0});var Qqs=bzn(),qqs=Bzn(),jqs=dYn(),Hqs=pYn(),mYn=hYn(),Gqs=[Qqs.default,qqs.default,(0,jqs.default)(),Hqs.default,mYn.metadataVocabulary,mYn.contentVocabulary];Gur.default=Gqs});var yYn=I(Rct=>{"use strict";p();Object.defineProperty(Rct,"__esModule",{value:!0});Rct.DiscrError=void 0;var AYn;(function(t){t.Tag="tag",t.Mapping="mapping"})(AYn||(Rct.DiscrError=AYn={}))});var _Yn=I(Vur=>{"use strict";p();Object.defineProperty(Vur,"__esModule",{value:!0});var dhe=Es(),$ur=yYn(),EYn=fct(),$qs=mDe(),Vqs=Ja(),Wqs={message:a(({params:{discrError:t,tagName:e}})=>t===$ur.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,dhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},zqs={keyword:"discriminator",type:"object",schemaType:"object",error:Wqs,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,dhe._)`${r}${(0,dhe.getProperty)(l)}`);e.if((0,dhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:$ur.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,dhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:$ur.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,dhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{Yqs.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 zur=I((hd,Wur)=>{"use strict";p();Object.defineProperty(hd,"__esModule",{value:!0});hd.MissingRefError=hd.ValidationError=hd.CodeGen=hd.Name=hd.nil=hd.stringify=hd.str=hd._=hd.KeywordCxt=hd.Ajv=void 0;var Kqs=Azn(),Jqs=gYn(),Zqs=_Yn(),CYn=vYn(),Xqs=["/properties"],kct="http://json-schema.org/draft-07/schema",fhe=class extends Kqs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Jqs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Zqs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(CYn,Xqs):CYn;this.addMetaSchema(e,kct,!1),this.refs["http://json-schema.org/schema"]=kct}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(kct)?kct:void 0)}};hd.Ajv=fhe;Wur.exports=hd=fhe;Wur.exports.Ajv=fhe;Object.defineProperty(hd,"__esModule",{value:!0});hd.default=fhe;var ejs=hDe();Object.defineProperty(hd,"KeywordCxt",{enumerable:!0,get:a(function(){return ejs.KeywordCxt},"get")});var phe=Es();Object.defineProperty(hd,"_",{enumerable:!0,get:a(function(){return phe._},"get")});Object.defineProperty(hd,"str",{enumerable:!0,get:a(function(){return phe.str},"get")});Object.defineProperty(hd,"stringify",{enumerable:!0,get:a(function(){return phe.stringify},"get")});Object.defineProperty(hd,"nil",{enumerable:!0,get:a(function(){return phe.nil},"get")});Object.defineProperty(hd,"Name",{enumerable:!0,get:a(function(){return phe.Name},"get")});Object.defineProperty(hd,"CodeGen",{enumerable:!0,get:a(function(){return phe.CodeGen},"get")});var tjs=uct();Object.defineProperty(hd,"ValidationError",{enumerable:!0,get:a(function(){return tjs.default},"get")});var rjs=mDe();Object.defineProperty(hd,"MissingRefError",{enumerable:!0,get:a(function(){return rjs.default},"get")})});var kYn=I(X5=>{"use strict";p();Object.defineProperty(X5,"__esModule",{value:!0});X5.formatNames=X5.fastFormats=X5.fullFormats=void 0;function Z5(t,e){return{validate:t,compare:e}}a(Z5,"fmtDef");X5.fullFormats={date:Z5(IYn,Zur),time:Z5(Kur(!0),Xur),"date-time":Z5(bYn(!0),wYn),"iso-time":Z5(Kur(),xYn),"iso-date-time":Z5(bYn(),RYn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:cjs,"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:mjs,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:ljs,int32:{type:"number",validate:fjs},int64:{type:"number",validate:pjs},float:{type:"number",validate:TYn},double:{type:"number",validate:TYn},password:!0,binary:!0};X5.fastFormats={...X5.fullFormats,date:Z5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Zur),time:Z5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xur),"date-time":Z5(/^\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,wYn),"iso-time":Z5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,xYn),"iso-date-time":Z5(/^\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,RYn),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};X5.formatNames=Object.keys(X5.fullFormats);function njs(t){return t%4===0&&(t%100!==0||t%400===0)}a(njs,"isLeapYear");var ijs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ojs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function IYn(t){let e=ijs.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&&njs(r)?29:ojs[n])}a(IYn,"date");function Zur(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(Kur,"getTime");function Xur(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(Xur,"compareTime");function xYn(t,e){if(!(t&&e))return;let r=Yur.exec(t),n=Yur.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=ujs}a(fjs,"validateInt32");function pjs(t){return Number.isInteger(t)}a(pjs,"validateInt64");function TYn(){return!0}a(TYn,"validateNumber");var hjs=/[^\\]\\Z/;function mjs(t){if(hjs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(mjs,"regex")});var PYn=I(hhe=>{"use strict";p();Object.defineProperty(hhe,"__esModule",{value:!0});hhe.formatLimitDefinition=void 0;var gjs=zur(),F2=Es(),CH=F2.operators,Pct={formatMaximum:{okStr:"<=",ok:CH.LTE,fail:CH.GT},formatMinimum:{okStr:">=",ok:CH.GTE,fail:CH.LT},formatExclusiveMaximum:{okStr:"<",ok:CH.LT,fail:CH.GTE},formatExclusiveMinimum:{okStr:">",ok:CH.GT,fail:CH.LTE}},Ajs={message:a(({keyword:t,schemaCode:e})=>(0,F2.str)`should be ${Pct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,F2._)`{comparison: ${Pct[t].okStr}, limit: ${e}}`,"params")};hhe.formatLimitDefinition={keyword:Object.keys(Pct),type:"string",schemaType:"string",$data:!0,error:Ajs,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 gjs.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,F2._)`${m}[${u.schemaCode}]`);t.fail$data((0,F2.or)((0,F2._)`typeof ${g} != "object"`,(0,F2._)`${g} instanceof RegExp`,(0,F2._)`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,F2._)`${c.code.formats}${(0,F2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,F2._)`${m}.compare(${r}, ${n}) ${Pct[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var yjs=a(t=>(t.addKeyword(hhe.formatLimitDefinition),t),"formatLimitPlugin");hhe.default=yjs});var OYn=I((RDe,MYn)=>{"use strict";p();Object.defineProperty(RDe,"__esModule",{value:!0});var mhe=kYn(),Ejs=PYn(),edr=Es(),DYn=new edr.Name("fullFormats"),_js=new edr.Name("fastFormats"),tdr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return NYn(t,e,mhe.fullFormats,DYn),t;let[r,n]=e.mode==="fast"?[mhe.fastFormats,_js]:[mhe.fullFormats,DYn],o=e.formats||mhe.formatNames;return NYn(t,o,r,n),e.keywords&&(0,Ejs.default)(t),t},"formatsPlugin");tdr.get=(t,e="full")=>{let n=(e==="fast"?mhe.fastFormats:mhe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function NYn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,edr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(NYn,"addFormats");MYn.exports=RDe=tdr;Object.defineProperty(RDe,"__esModule",{value:!0});RDe.default=tdr});var uKn=I((UIf,lKn)=>{p();lKn.exports=cKn;cKn.sync=kjs;var sKn=require("fs");function Rjs(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();hKn.exports=fKn;fKn.sync=Pjs;var dKn=require("fs");function fKn(t,e,r){dKn.stat(t,function(n,o){r(n,n?!1:pKn(o,e))})}a(fKn,"isexe");function Pjs(t,e){return pKn(dKn.statSync(t),e)}a(Pjs,"sync");function pKn(t,e){return t.isFile()&&Djs(t,e)}a(pKn,"checkStat");function Djs(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(Djs,"checkMode")});var AKn=I((VIf,gKn)=>{p();var $If=require("fs"),Wct;process.platform==="win32"||global.TESTING_WINDOWS?Wct=uKn():Wct=mKn();gKn.exports=Adr;Adr.sync=Njs;function Adr(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){Adr(t,e||{},function(s,c){s?o(s):n(c)})})}Wct(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(Adr,"isexe");function Njs(t,e){try{return Wct.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(Njs,"sync")});var SKn=I((YIf,bKn)=>{p();var Ihe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",yKn=require("path"),Mjs=Ihe?";":":",EKn=AKn(),_Kn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),vKn=a((t,e)=>{let r=e.colon||Mjs,n=t.match(/\//)||Ihe&&t.match(/\\/)?[""]:[...Ihe?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=Ihe?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ihe?o.split(r):[""];return Ihe&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),CKn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=vKn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(_Kn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=yKn.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];EKn(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"),Ojs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=vKn(t,e),s=[];for(let c=0;c{"use strict";p();var TKn=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");ydr.exports=TKn;ydr.exports.default=TKn});var kKn=I((txf,RKn)=>{"use strict";p();var xKn=require("path"),Ljs=SKn(),Bjs=IKn();function wKn(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=Ljs.sync(t.command,{path:r[Bjs({env:r})],pathExt:e?xKn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=xKn.resolve(o?t.options.cwd:"",c)),c}a(wKn,"resolveCommandAttempt");function Fjs(t){return wKn(t)||wKn(t,!0)}a(Fjs,"resolveCommand");RKn.exports=Fjs});var PKn=I((ixf,_dr)=>{"use strict";p();var Edr=/([()\][%!^"`<>&|;, *?])/g;function Ujs(t){return t=t.replace(Edr,"^$1"),t}a(Ujs,"escapeCommand");function Qjs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Edr,"^$1"),e&&(t=t.replace(Edr,"^$1")),t}a(Qjs,"escapeArgument");_dr.exports.command=Ujs;_dr.exports.argument=Qjs});var NKn=I((axf,DKn)=>{"use strict";p();DKn.exports=/^#!(.*)/});var OKn=I((lxf,MKn)=>{"use strict";p();var qjs=NKn();MKn.exports=(t="")=>{let e=t.match(qjs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var BKn=I((dxf,LKn)=>{"use strict";p();var vdr=require("fs"),jjs=OKn();function Hjs(t){let r=Buffer.alloc(150),n;try{n=vdr.openSync(t,"r"),vdr.readSync(n,r,0,150,0),vdr.closeSync(n)}catch{}return jjs(r.toString())}a(Hjs,"readShebang");LKn.exports=Hjs});var qKn=I((hxf,QKn)=>{"use strict";p();var Gjs=require("path"),FKn=kKn(),UKn=PKn(),$js=BKn(),Vjs=process.platform==="win32",Wjs=/\.(?:com|exe)$/i,zjs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Yjs(t){t.file=FKn(t);let e=t.file&&$js(t.file);return e?(t.args.unshift(t.file),t.command=e,FKn(t)):t.file}a(Yjs,"detectShebang");function Kjs(t){if(!Vjs)return t;let e=Yjs(t),r=!Wjs.test(e);if(t.options.forceShell||r){let n=zjs.test(e);t.command=Gjs.normalize(t.command),t.command=UKn.command(t.command),t.args=t.args.map(s=>UKn.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(Kjs,"parseNonShell");function Jjs(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:Kjs(n)}a(Jjs,"parse");QKn.exports=Jjs});var GKn=I((Axf,HKn)=>{"use strict";p();var Cdr=process.platform==="win32";function bdr(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(bdr,"notFoundError");function Zjs(t,e){if(!Cdr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=jKn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(Zjs,"hookChildProcess");function jKn(t,e){return Cdr&&t===1&&!e.file?bdr(e.original,"spawn"):null}a(jKn,"verifyENOENT");function Xjs(t,e){return Cdr&&t===1&&!e.file?bdr(e.original,"spawnSync"):null}a(Xjs,"verifyENOENTSync");HKn.exports={hookChildProcess:Zjs,verifyENOENT:jKn,verifyENOENTSync:Xjs,notFoundError:bdr}});var WKn=I((_xf,xhe)=>{"use strict";p();var $Kn=require("child_process"),Sdr=qKn(),Tdr=GKn();function VKn(t,e,r){let n=Sdr(t,e,r),o=$Kn.spawn(n.command,n.args,n.options);return Tdr.hookChildProcess(o,n),o}a(VKn,"spawn");function eHs(t,e,r){let n=Sdr(t,e,r),o=$Kn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Tdr.verifyENOENTSync(o.status,n),o}a(eHs,"spawnSync");xhe.exports=VKn;xhe.exports.spawn=VKn;xhe.exports.sync=eHs;xhe.exports._parse=Sdr;xhe.exports._enoent=Tdr});function FX(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(zDe(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(jdr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(jdr(b));return c=15}if(zDe(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 jdr(t){return t===32||t===9}function zDe(t){return t===10||t===13}function Phe(t){return t>=48&&t<=57}var TJn,alt=ve(()=>{"use strict";p();a(FX,"createScanner");a(jdr,"isWhiteSpace");a(zDe,"isLineBreak");a(Phe,"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"})(TJn||(TJn={}))});var UT,Dhe,Hdr,IJn,xJn=ve(()=>{p();UT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),Dhe=200,Hdr={" ":{"\n":new Array(Dhe).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(Dhe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Dhe).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}," ":{"\n":new Array(Dhe).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(Dhe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Dhe).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}},IJn=[` `,"\r",`\r -`]});function nlt(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!$De(t,s-1);)s--;let w=l;for(;w1)return Dhe(u,f)+Dhe(m,n+h);let w=m.length*(n+h);return!d||w>Udr[g][u].length?u+Dhe(m,n+h):w<=0?u:Udr[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(Dhe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?BT[m.length*n]:Dhe(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(BT[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=BT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=BT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=BT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=BT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=BT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=BT[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=BT[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 Dhe(t,e){let r="";for(let n=0;n0&&!YDe(t,s-1);)s--;let w=l;for(;w1)return Nhe(u,f)+Nhe(m,n+h);let w=m.length*(n+h);return!d||w>Hdr[g][u].length?u+Nhe(m,n+h):w<=0?u:Hdr[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(Nhe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?UT[m.length*n]:Nhe(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(UT[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=UT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=UT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=UT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=UT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=UT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=UT[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=UT[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 Nhe(t,e){let r="";for(let n=0;n{"use strict";p();rlt();CJn();a(nlt,"format");a(Dhe,"repeat");a(UHs,"computeIndentLevel");a(QHs,"getEOL");a($De,"isEOL")});function bJn(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{zDe(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 olt(t,e=[],r=VDe.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"),zDe(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:IJn(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 WDe(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 qdr(t){if(!t.parent||!t.parent.children)return[];let e=qdr(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 ilt(t){switch(t.type){case"array":return t.children.map(ilt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=ilt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function jHs(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=[],j=[]){if(b(M),O.length+j.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(j.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(),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 P(!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 TJn(t,e){let r=BX(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 IJn(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 VDe,Hdr=ve(()=>{"use strict";p();rlt();(function(t){t.DEFAULT={allowTrailingComma:!1}})(VDe||(VDe={}));a(bJn,"getLocation");a(SJn,"parse");a(olt,"parseTree");a(WDe,"findNodeAtLocation");a(qdr,"getNodePath");a(ilt,"getNodeValue");a(jHs,"contains");a(jdr,"findNodeAtOffset");a(zDe,"visit");a(TJn,"stripComments");a(IJn,"getNodeType")});function xJn(t,e,r,n){let o=e.slice(),c=olt(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=WDe(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=WDe(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 FX(t,{offset:h,length:m-h,content:""},n)}else return FX(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 FX(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 FX(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 FX(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 FX(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 FX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function FX(t,e,r){if(!r.formattingOptions)return[e];let n=slt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!$De(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=slt(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 slt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var wJn=ve(()=>{"use strict";p();Qdr();Hdr();a(xJn,"setProperty");a(FX,"withFormatting");a(slt,"applyEdit")});var RJn={};ki(RJn,{ParseErrorCode:()=>Vdr,ScanError:()=>Gdr,SyntaxKind:()=>$dr,applyEdits:()=>nGs,createScanner:()=>$Hs,findNodeAtLocation:()=>zHs,findNodeAtOffset:()=>YHs,format:()=>tGs,getLocation:()=>VHs,getNodePath:()=>KHs,getNodeValue:()=>JHs,modify:()=>rGs,parse:()=>Wdr,parseTree:()=>WHs,printParseErrorCode:()=>eGs,stripComments:()=>XHs,visit:()=>ZHs});function eGs(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 tGs(t,e,r){return nlt(t,e,r)}function rGs(t,e,r,n){return xJn(t,e,r,n)}function nGs(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=slt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var $Hs,Gdr,$dr,VHs,Wdr,WHs,zHs,YHs,KHs,JHs,ZHs,XHs,Vdr,zdr=ve(()=>{"use strict";p();Qdr();wJn();rlt();Hdr();$Hs=BX;(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"})(Gdr||(Gdr={}));(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"})($dr||($dr={}));VHs=bJn,Wdr=SJn,WHs=olt,zHs=WDe,YHs=jdr,KHs=qdr,JHs=ilt,ZHs=zDe,XHs=TJn;(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"})(Vdr||(Vdr={}));a(eGs,"printParseErrorCode");a(tGs,"format");a(rGs,"modify");a(nGs,"applyEdits")});var UT=I(YX=>{"use strict";p();Object.defineProperty(YX,"__esModule",{value:!0});YX.DebugNameData=void 0;YX.getDebugName=Eei;YX.getClassName=_ei;YX.getFunctionName=vei;var tpr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return Eei(e,this)}};YX.DebugNameData=tpr;var gei=new Map,rpr=new WeakMap;function Eei(t,e){let r=rpr.get(t);if(r)return r;let n=DWs(t,e);if(n){let o=gei.get(n)??0;o++,gei.set(n,o);let s=o===1?n:`${n}#${o}`;return rpr.set(t,s),s}}a(Eei,"getDebugName");function DWs(t,e){let r=rpr.get(t);if(r)return r;let n=e.owner?MWs(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=vei(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=NWs(e.owner,t);if(l!==void 0)return n+l}}a(DWs,"computeDebugName");function NWs(t,e){for(let r in t)if(t[r]===e)return r}a(NWs,"findKey");var Aei=new Map,yei=new WeakMap;function MWs(t){let e=yei.get(t);if(e)return e;let r=_ei(t)??"Object",n=Aei.get(r)??0;n++,Aei.set(r,n);let o=n===1?r:`${r}#${n}`;return yei.set(t,o),o}a(MWs,"formatOwner");function _ei(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(_ei,"getClassName");function vei(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(vei,"getFunctionName")});var Mei=I(_p=>{"use strict";p();var OWs=_p&&_p.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LWs=_p&&_p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BWs=_p&&_p.__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(Tei,"strictEqualsC");function Iei(t,e,r){return Sei.equals(t,e,r??fut)}a(Iei,"arrayEquals");function xei(t){return(e,r)=>Sei.equals(e,r,t??fut)}a(xei,"arrayEqualsC");function mNe(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;rmNe(t,e)}a(wei,"structuralEqualsC");function FWs(t){return JSON.stringify(npr(t))}a(FWs,"getStructuralKey");var UWs=0,Cei=new WeakMap;function npr(t){if(Array.isArray(t))return t.map(npr);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]=npr(e[n]);return r}else{let e=Cei.get(t);return e===void 0&&(e=UWs++,Cei.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(npr,"toNormalizedJsonStructure");function Rei(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Rei,"jsonStringifyEquals");function kei(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(kei,"jsonStringifyEqualsC");function Pei(){return(t,e)=>t.equals(e)}a(Pei,"thisEqualsC");function Dei(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Dei,"equalsIfDefined");function Nei(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(Nei,"equalsIfDefinedC");var bei;(function(t){t.strict=fut,t.strictC=Tei,t.array=Iei,t.arrayC=xei,t.structural=mNe,t.structuralC=wei,t.jsonStringify=Rei,t.jsonStringifyC=kei,t.thisC=Pei,t.ifDefined=Dei,t.ifDefinedC=Nei})(bei||(_p.equals=bei={}))});var gv=I(vp=>{"use strict";p();Object.defineProperty(vp,"__esModule",{value:!0});vp.trackDisposable=vp.toDisposable=vp.markAsDisposed=vp.DisposableStore=vp.Event=vp.onUnexpectedError=vp.onBugIndicatingError=vp.BugIndicatingError=vp.strictEquals=vp.assertFn=void 0;var QWs=rd();Object.defineProperty(vp,"assertFn",{enumerable:!0,get:a(function(){return QWs.assertFn},"get")});var qWs=Mei();Object.defineProperty(vp,"strictEquals",{enumerable:!0,get:a(function(){return qWs.strictEquals},"get")});var ipr=Rs();Object.defineProperty(vp,"BugIndicatingError",{enumerable:!0,get:a(function(){return ipr.BugIndicatingError},"get")});Object.defineProperty(vp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return ipr.onBugIndicatingError},"get")});Object.defineProperty(vp,"onUnexpectedError",{enumerable:!0,get:a(function(){return ipr.onUnexpectedError},"get")});var jWs=Ic();Object.defineProperty(vp,"Event",{enumerable:!0,get:a(function(){return jWs.Event},"get")});var put=Ro();Object.defineProperty(vp,"DisposableStore",{enumerable:!0,get:a(function(){return put.DisposableStore},"get")});Object.defineProperty(vp,"markAsDisposed",{enumerable:!0,get:a(function(){return put.markAsDisposed},"get")});Object.defineProperty(vp,"toDisposable",{enumerable:!0,get:a(function(){return put.toDisposable},"get")});Object.defineProperty(vp,"trackDisposable",{enumerable:!0,get:a(function(){return put.trackDisposable},"get")})});var Oei=I(opr=>{"use strict";p();Object.defineProperty(opr,"__esModule",{value:!0});opr.handleBugIndicatingErrorRecovery=GWs;var HWs=gv();function GWs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,HWs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(GWs,"handleBugIndicatingErrorRecovery")});var o4=I(cme=>{"use strict";p();Object.defineProperty(cme,"__esModule",{value:!0});cme.addLogger=$Ws;cme.getLogger=VWs;cme.setLogObservableFn=WWs;cme.logObservable=zWs;var KX;function $Ws(t){KX?KX instanceof hut?KX.loggers.push(t):KX=new hut([KX,t]):KX=t}a($Ws,"addLogger");function VWs(){return KX}a(VWs,"getLogger");var spr;function WWs(t){spr=t}a(WWs,"setLogObservableFn");function zWs(t){spr&&spr(t)}a(zWs,"logObservable");var hut=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 _8=I(DH=>{"use strict";p();Object.defineProperty(DH,"__esModule",{value:!0});DH.TransactionImpl=void 0;DH.transaction=apr;DH.globalTransaction=KWs;DH.asyncTransaction=JWs;DH.subtransaction=ZWs;var Lei=Oei(),YWs=UT(),Bei=o4();function apr(t,e){let r=new lme(t,e);try{t(r)}finally{r.finish()}}a(apr,"transaction");var mut;function KWs(t){if(mut)t(mut);else{let e=new lme(t,void 0);mut=e;try{t(e)}finally{e.finish(),mut=void 0}}}a(KWs,"globalTransaction");async function JWs(t,e){let r=new lme(t,e);try{await t(r)}finally{r.finish()}}a(JWs,"asyncTransaction");function ZWs(t,e,r){t?e(t):apr(e,r)}a(ZWs,"subtransaction");var lme=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,Bei.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,YWs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Lei.handleBugIndicatingErrorRecovery)("Transaction already finished!"),apr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Lei.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(gut,"__esModule",{value:!0});gut.DebugLocation=void 0;var Fei;(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,cpr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(Fei||(gut.DebugLocation=Fei={}));var cpr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=XWs(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 XWs(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(XWs,"parseLine")});var H2=I(s4=>{"use strict";p();Object.defineProperty(s4,"__esModule",{value:!0});s4.BaseObservable=s4.ConvenientObservable=void 0;s4._setDerivedOpts=tzs;s4._setRecomputeInitiallyAndOnChange=rzs;s4._setKeepObserved=nzs;s4._setDebugGetObservableGraph=izs;var Uei=QT(),ezs=UT(),ume=o4(),lpr;function tzs(t){lpr=t}a(tzs,"_setDerivedOpts");var Qei;function rzs(t){Qei=t}a(rzs,"_setRecomputeInitiallyAndOnChange");var qei;function nzs(t){qei=t}a(nzs,"_setKeepObserved");var upr;function izs(t){upr=t}a(izs,"_setDebugGetObservableGraph");var Aut=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=Uei.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return lpr({owner:o,debugName:a(()=>{let c=(0,ezs.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 lpr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(Qei(this,r)),this}keepObserved(e){return e.add(qei(this)),this}get debugValue(){return this.get()}get debug(){return new dpr(this)}};s4.ConvenientObservable=Aut;var dpr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return upr(this.observable,{type:"dependencies"})}getObserverGraph(){return upr(this.observable,{type:"observers"})}},fpr=class extends Aut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,ume.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,ume.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,ume.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,ume.getLogger)();return(0,ume.logObservable)(this),e||(0,ume.getLogger)()?.handleObservableCreated(this,Uei.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};s4.BaseObservable=fpr});var v8=I(NH=>{"use strict";p();Object.defineProperty(NH,"__esModule",{value:!0});NH.DisposableObservableValue=NH.ObservableValue=void 0;NH.observableValue=azs;NH.disposableObservableValue=czs;var ozs=_8(),szs=H2(),Hei=gv(),yut=UT(),jei=o4(),Gei=QT();function azs(t,e,r=Gei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new yut.DebugNameData(void 0,t,void 0):n=new yut.DebugNameData(t,void 0,void 0),new gNe(n,e,Hei.strictEquals,r)}a(azs,"observableValue");var gNe=class extends szs.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,jei.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 ozs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,jei.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}};NH.ObservableValue=gNe;function czs(t,e,r=Gei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new yut.DebugNameData(void 0,t,void 0):n=new yut.DebugNameData(t,void 0,void 0),new Eut(n,e,Hei.strictEquals,r)}a(czs,"disposableObservableValue");var Eut=class extends gNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};NH.DisposableObservableValue=Eut});var Vei=I(_ut=>{"use strict";p();Object.defineProperty(_ut,"__esModule",{value:!0});_ut.LazyObservableValue=void 0;var lzs=_8(),$ei=o4(),uzs=H2(),ppr=class extends uzs.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,$ei.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,$ei.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 lzs.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}};_ut.LazyObservableValue=ppr});var vut=I(hpr=>{"use strict";p();Object.defineProperty(hpr,"__esModule",{value:!0});hpr.observableValueOpts=hzs;var Wei=UT(),zei=gv(),dzs=v8(),fzs=Vei(),pzs=QT();function hzs(t,e,r=pzs.DebugLocation.ofCaller()){return t.lazy?new fzs.LazyObservableValue(new Wei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??zei.strictEquals,r):new dzs.ObservableValue(new Wei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??zei.strictEquals,r)}a(hzs,"observableValueOpts")});var but=I(Cut=>{"use strict";p();Object.defineProperty(Cut,"__esModule",{value:!0});Cut.AutorunObserver=void 0;var tR=gv(),ANe=o4();function mzs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(mzs,"autorunStateToString");var mpr=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,ANe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,tR.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,ANe.getLogger)()?.handleAutorunDisposed(this),(0,tR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,ANe.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,tR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,ANe.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,tR.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,ANe.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,tR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new tR.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 tR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new tR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new tR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new tR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:mzs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,tR.onBugIndicatingError)(new tR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Cut.AutorunObserver=mpr});var JX=I(rR=>{"use strict";p();Object.defineProperty(rR,"__esModule",{value:!0});rR.autorun=ypr;rR.autorunOpts=yNe;rR.autorunHandleChanges=Yei;rR.autorunWithStoreHandleChanges=yzs;rR.autorunWithStore=Ezs;rR.autorunDelta=_zs;rR.autorunIterableDelta=vzs;rR.autorunPerKeyedItem=Czs;rR.autorunSelfDisposable=bzs;rR.registerAutorunSelfDisposable=Szs;var dme=gv(),gpr=UT(),Apr=but(),fme=QT(),gzs=v8(),Azs=_8();function ypr(t,e=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(ypr,"autorun");function yNe(t,e,r=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(yNe,"autorunOpts");function Yei(t,e,r=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Yei,"autorunHandleChanges");function yzs(t,e){let r=new dme.DisposableStore,n=Yei({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,dme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(yzs,"autorunWithStoreHandleChanges");function Ezs(t){let e=new dme.DisposableStore,r=yNe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,dme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(Ezs,"autorunWithStore");function _zs(t,e){let r;return yNe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(_zs,"autorunDelta");function vzs(t,e,r=n=>n){let n=new Map;return yNe({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(vzs,"autorunIterableDelta");function Czs(t,e,r,n=fme.DebugLocation.ofCaller()){let o=new Map,s=yNe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Azs.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 dme.DisposableStore,E={value:(0,gzs.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,dme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(Czs,"autorunPerKeyedItem");function bzs(t,e=fme.DebugLocation.ofCaller()){let r,n=!1;return r=ypr(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(bzs,"autorunSelfDisposable");function Szs(t,e,r=fme.DebugLocation.ofCaller()){let n,o=!1;n=ypr(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(Szs,"registerAutorunSelfDisposable")});var hme=I(pme=>{"use strict";p();Object.defineProperty(pme,"__esModule",{value:!0});pme.DerivedWithSetter=pme.Derived=void 0;var Tzs=H2(),ZX=gv(),Epr=o4();function Izs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Izs,"derivedStateToString");var Sut=class extends Tzs.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,Epr.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,Epr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,ZX.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 ZX.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,ZX.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,Epr.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,ZX.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 ZX.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 ZX.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new ZX.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:Izs(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)}};pme.Derived=Sut;var _pr=class extends Sut{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};pme.DerivedWithSetter=_pr});var Tut=I(MH=>{"use strict";p();Object.defineProperty(MH,"__esModule",{value:!0});MH.derived=wzs;MH.derivedWithSetter=Rzs;MH.derivedOpts=Kei;MH.derivedHandleChanges=kzs;MH.derivedWithStore=Pzs;MH.derivedDisposable=Dzs;var a4=gv(),mme=QT(),eee=UT(),xzs=H2(),tee=hme();function wzs(t,e,r=mme.DebugLocation.ofCaller()){return e!==void 0?new tee.Derived(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r):new tee.Derived(new eee.DebugNameData(void 0,void 0,t),t,void 0,void 0,a4.strictEquals,r)}a(wzs,"derived");function Rzs(t,e,r,n=mme.DebugLocation.ofCaller()){return new tee.DerivedWithSetter(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r,n)}a(Rzs,"derivedWithSetter");function Kei(t,e,r=mme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??a4.strictEquals,r)}a(Kei,"derivedOpts");(0,xzs._setDerivedOpts)(Kei);function kzs(t,e,r=mme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??a4.strictEquals,r)}a(kzs,"derivedHandleChanges");function Pzs(t,e,r=mme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new a4.DisposableStore;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new a4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),a4.strictEquals,r)}a(Pzs,"derivedWithStore");function Dzs(t,e,r=mme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new a4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},a4.strictEquals,r)}a(Dzs,"derivedDisposable")});var Xei=I(nR=>{"use strict";p();Object.defineProperty(nR,"__esModule",{value:!0});nR.ObservableLazyPromise=nR.ObservableResolvedPromise=nR.PromiseResult=nR.ObservablePromise=nR.ObservableLazy=void 0;var Nzs=JX(),Jei=_8(),Zei=Tut(),Iut=v8(),xut=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,Iut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};nR.ObservableLazy=xut;var wut=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,Iut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,Zei.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,Jei.transaction)(n=>{this._value.set(new ENe(r,void 0),n)}),r),r=>{throw(0,Jei.transaction)(n=>{this._value.set(new ENe(void 0,r),n)}),r})}};nR.ObservablePromise=wut;var ENe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};nR.PromiseResult=ENe;var vpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,Iut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,Iut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Nzs.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)}))}};nR.ObservableResolvedPromise=vpr;var Cpr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new xut(()=>new wut(this._computePromise())),this.cachedPromiseResult=(0,Zei.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};nR.ObservableLazyPromise=Cpr});var Spr=I(c4=>{"use strict";p();Object.defineProperty(c4,"__esModule",{value:!0});c4.cancelOnDispose=c4.CancellationTokenSource=c4.CancellationToken=c4.CancellationError=void 0;var Mzs=Rs();Object.defineProperty(c4,"CancellationError",{enumerable:!0,get:a(function(){return Mzs.CancellationError},"get")});var bpr=YP();Object.defineProperty(c4,"CancellationToken",{enumerable:!0,get:a(function(){return bpr.CancellationToken},"get")});Object.defineProperty(c4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return bpr.CancellationTokenSource},"get")});Object.defineProperty(c4,"cancelOnDispose",{enumerable:!0,get:a(function(){return bpr.cancelOnDispose},"get")})});var eti=I(Rut=>{"use strict";p();Object.defineProperty(Rut,"__esModule",{value:!0});Rut.waitForState=Qzs;Rut.derivedWithCancellationToken=qzs;var Ozs=UT(),Tpr=Spr(),Lzs=gv(),Bzs=JX(),Fzs=hme(),Uzs=QT();function Qzs(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,Bzs.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 Tpr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Tpr.CancellationError);return}}c=!1,l&&d.dispose()})}a(Qzs,"waitForState");function qzs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new Fzs.Derived(new Ozs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Tpr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Lzs.strictEquals,Uzs.DebugLocation.ofCaller())}a(qzs,"derivedWithCancellationToken")});var OH=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.FromEventObservable=void 0;ree.observableFromEvent=Ipr;ree.observableFromEventOpts=Gzs;var jzs=_8(),rti=gv(),nti=UT(),tti=o4(),Hzs=H2(),iti=QT();function Ipr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new G2(new nti.DebugNameData(e,void 0,n),r,n,()=>G2.globalTransaction,rti.strictEquals,o??iti.DebugLocation.ofCaller())}a(Ipr,"observableFromEvent");function Gzs(t,e,r,n=iti.DebugLocation.ofCaller()){return new G2(new nti.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??G2.globalTransaction,t.equalsFn??rti.strictEquals,n)}a(Gzs,"observableFromEventOpts");var G2=class extends Hzs.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,jzs.subtransaction)(this._getTransaction(),m=>{(0,tti.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,tti.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}}};ree.FromEventObservable=G2;(function(t){t.Observer=G2;function e(r,n){let o=!1;G2.globalTransaction===void 0&&(G2.globalTransaction=r,o=!0);try{n()}finally{o&&(G2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Ipr||(ree.observableFromEvent=Ipr={}))});var wpr=I(xpr=>{"use strict";p();Object.defineProperty(xpr,"__esModule",{value:!0});xpr.observableSignal=Yzs;var $zs=_8(),Vzs=UT(),Wzs=H2(),zzs=QT();function Yzs(t,e=zzs.DebugLocation.ofCaller()){return typeof t=="string"?new kut(t,void 0,e):new kut(void 0,t,e)}a(Yzs,"observableSignal");var kut=class extends Wzs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Vzs.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,$zs.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 Dut=I(RE=>{"use strict";p();Object.defineProperty(RE,"__esModule",{value:!0});RE.KeepAliveObserver=void 0;RE.observableFromPromise=Kzs;RE.signalFromObservable=Jzs;RE.debouncedObservable=Zzs;RE.throttledObservable=Xzs;RE.debouncedObservable2=eYs;RE.wasEventTriggeredRecently=tYs;RE.keepObserved=uti;RE.recomputeInitiallyAndOnChange=dti;RE.derivedObservableWithCache=rYs;RE.derivedObservableWithWritableCache=nYs;RE.mapObservableArrayCached=iYs;RE.isObservable=oYs;var oti=JX(),sti=v8(),Rpr=gv(),vNe=Tut(),ati=OH(),cti=wpr(),lti=H2(),kpr=QT();function Kzs(t){let e=(0,sti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(Kzs,"observableFromPromise");function Jzs(t,e){return(0,vNe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(Jzs,"signalFromObservable");function Zzs(t,e,r=kpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,ati.observableFromEvent)(void 0,c=>{let l=(0,oti.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(Zzs,"debouncedObservable");function Xzs(t,e,r=kpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,ati.observableFromEvent)(void 0,c=>{let l=(0,oti.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(Xzs,"throttledObservable");function eYs(t,e,r=kpr.DebugLocation.ofCaller()){let n=(0,cti.observableSignal)("handleTimeout"),o,s;return(0,vNe.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(eYs,"debouncedObservable2");function tYs(t,e,r){let n=(0,sti.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(tYs,"wasEventTriggeredRecently");function uti(t){let e=new _Ne(!1,void 0);return t.addObserver(e),(0,Rpr.toDisposable)(()=>{t.removeObserver(e)})}a(uti,"keepObserved");(0,lti._setKeepObserved)(uti);function dti(t,e){let r=new _Ne(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Rpr.toDisposable)(()=>{t.removeObserver(r)})}a(dti,"recomputeInitiallyAndOnChange");(0,lti._setRecomputeInitiallyAndOnChange)(dti);var _Ne=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){}};RE.KeepAliveObserver=_Ne;function rYs(t,e){let r;return(0,vNe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(rYs,"derivedObservableWithCache");function nYs(t,e){let r,n=(0,cti.observableSignal)("derivedObservableWithWritableCache"),o=(0,vNe.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(nYs,"derivedObservableWithWritableCache");function iYs(t,e,r,n){let o=new Put(r,n);return(0,vNe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Put(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(iYs,"mapObservableArrayCached");var Put=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 Rpr.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 oYs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(oYs,"isObservable")});var pti=I(Nut=>{"use strict";p();Object.defineProperty(Nut,"__esModule",{value:!0});Nut.recordChanges=sYs;Nut.recordChangesLazy=aYs;var fti=gv();function sYs(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 fti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(sYs,"recordChanges");function aYs(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 fti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(aYs,"recordChangesLazy")});var hti=I(Dpr=>{"use strict";p();Object.defineProperty(Dpr,"__esModule",{value:!0});Dpr.constObservable=lYs;var cYs=H2();function lYs(t){return new Ppr(t)}a(lYs,"constObservable");var Ppr=class extends cYs.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 mti=I(Mpr=>{"use strict";p();Object.defineProperty(Mpr,"__esModule",{value:!0});Mpr.observableSignalFromEvent=hYs;var uYs=_8(),dYs=UT(),fYs=H2(),pYs=QT();function hYs(t,e,r=pYs.DebugLocation.ofCaller()){return new Npr(typeof t=="string"?t:new dYs.DebugNameData(t,void 0,void 0),e,r)}a(hYs,"observableSignalFromEvent");var Npr=class extends fYs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,uYs.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 gti=I(CNe=>{"use strict";p();Object.defineProperty(CNe,"__esModule",{value:!0});CNe.ValueWithChangeEventFromObservable=void 0;CNe.observableFromValueWithChangeEvent=AYs;var mYs=gv(),gYs=OH(),Mut=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return mYs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};CNe.ValueWithChangeEventFromObservable=Mut;function AYs(t,e){return e instanceof Mut?e.observable:(0,gYs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(AYs,"observableFromValueWithChangeEvent")});var Eti=I(bNe=>{"use strict";p();Object.defineProperty(bNe,"__esModule",{value:!0});bNe.runOnChange=Ati;bNe.runOnChangeWithStore=yti;bNe.runOnChangeWithCancellationToken=vYs;var yYs=Spr(),EYs=gv(),_Ys=JX();function Ati(t,e){let r,n=!0;return(0,_Ys.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(Ati,"runOnChange");function yti(t,e){let r=new EYs.DisposableStore,n=Ati(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(yti,"runOnChangeWithStore");function vYs(t,e){return yti(t,(r,n,o,s)=>{e(r,n,o,(0,yYs.cancelOnDispose)(s))})}a(vYs,"runOnChangeWithCancellationToken")});var Cti=I(Out=>{"use strict";p();Object.defineProperty(Out,"__esModule",{value:!0});Out.latestChangedValue=TYs;Out.derivedConstOnceDefined=IYs;var _ti=gv(),vti=UT(),CYs=OH(),bYs=JX(),SYs=Dut();function TYs(t,e){if(e.length===0)throw new _ti.BugIndicatingError;let r=!1,n,o=(0,CYs.observableFromEvent)(t,s=>{let c=new _ti.DisposableStore;for(let l of e)c.add((0,bYs.autorunOpts)({debugName:a(()=>(0,vti.getDebugName)(o,new vti.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(TYs,"latestChangedValue");function IYs(t,e){return(0,SYs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(IYs,"derivedConstOnceDefined")});var bti=I(Lut=>{"use strict";p();Object.defineProperty(Lut,"__esModule",{value:!0});Lut.ObservableSet=void 0;var xYs=vut(),Opr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,xYs.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"}};Lut.ObservableSet=Opr});var Sti=I(But=>{"use strict";p();Object.defineProperty(But,"__esModule",{value:!0});But.ObservableMap=void 0;var wYs=vut(),Lpr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,wYs.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"}};But.ObservableMap=Lpr});var Qut=I(Eme=>{"use strict";p();Object.defineProperty(Eme,"__esModule",{value:!0});Eme.ConsoleObservableLogger=void 0;Eme.logObservableToConsole=PYs;Eme.formatValue=yme;var RYs=o4(),kYs=UT(),Tti=hme(),Fut;function PYs(t){Fut||(Fut=new Uut,(0,RYs.addLogger)(Fut)),Fut.addFilteredObj(t)}a(PYs,"logObservableToConsole");var Uut=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 DYs([gme(OYs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[gme(" "),iR(yme(e.oldValue,70),{color:"red",strikeThrough:!0}),gme(" "),iR(yme(e.newValue,60),{color:"green"})]:[gme(" (unchanged)")]:[gme(" "),iR(yme(e.newValue,60),{color:"green"}),gme(" (initial)")]}handleObservableCreated(e){if(e instanceof Tti.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 Tti.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Ame("observable value changed"),iR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return iR(" (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([Ame("derived recomputed"),iR(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([Ame("derived cleared"),iR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ame("observable from event triggered"),iR(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([Ame("autorun"),iR(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([Ame("transaction"),iR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Eme.ConsoleObservableLogger=Uut;function DYs(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(DYs,"consoleTextToArgs");function gme(t){return iR(t,{color:"black"})}a(gme,"normalText");function Ame(t){return iR(LYs(`${t}: `,10),{color:"black",bold:!0})}a(Ame,"formatKind");function iR(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(iR,"styled");function yme(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)?NYs(t,e):MYs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(yme,"formatValue");function NYs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${yme(o,e-r.length)}`}return r+=" ]",r}a(NYs,"formatArray");function MYs(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,kYs.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}: ${yme(c,e-n.length)}`}return n+=r?")":" }",n}a(MYs,"formatObject");function OYs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(OYs,"repeat");function LYs(t,e){for(;t.length{"use strict";p();Object.defineProperty(qut,"__esModule",{value:!0});qut.SimpleTypedRpcConnection=void 0;var Bpr=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}}};qut.SimpleTypedRpcConnection=Bpr});var xti=I(Fpr=>{"use strict";p();Object.defineProperty(Fpr,"__esModule",{value:!0});Fpr.registerDebugChannel=FYs;var BYs=Iti();function FYs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=UYs({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},BYs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(FYs,"registerDebugChannel");function UYs(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(UYs,"createChannelFactoryFromDebugChannel")});var kti=I(LH=>{"use strict";p();Object.defineProperty(LH,"__esModule",{value:!0});LH.Throttler=LH.Debouncer=void 0;LH.deepAssign=wti;LH.deepAssignDeleteNulls=Rti;var Upr=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)}};LH.Debouncer=Upr;var Qpr=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)}};LH.Throttler=Qpr;function wti(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?wti(t[r],e[r]):t[r]=e[r]}a(wti,"deepAssign");function Rti(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"?Rti(t[r],e[r]):t[r]=e[r]}a(Rti,"deepAssignDeleteNulls")});var Nti=I(Hut=>{"use strict";p();Object.defineProperty(Hut,"__esModule",{value:!0});Hut.DevToolsLogger=void 0;var Pti=but(),jut=Qut(),QYs=xti(),qpr=kti(),SNe=KS(),qYs=OH(),nee=Rs(),iee=hme(),Dti=v8(),jYs=QT(),jpr=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,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof iee.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(SNe.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 Pti.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 iee.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,QYs.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(SNe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(SNe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(SNe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(SNe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof iee.Derived)n.debugSetValue(r);else if(n instanceof Dti.ObservableValue)n.debugSetValue(r);else if(n instanceof qYs.FromEventObservable)n.debugSetValue(r);else throw new nee.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 iee.Derived)return(0,jut.formatValue)(r.debugGetState().value,200);if(r instanceof Dti.ObservableValue)return(0,jut.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 nee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iee.Derived)r.debugRecompute();else if(r instanceof Pti.AutorunObserver)r.debugRerun();else throw new nee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new qpr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},jYs.DebugLocation.enable()}_handleChange(e){(0,qpr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,qpr.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 iee.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 iee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,jut.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,jut.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)}};Hut.DevToolsLogger=jpr});var Bti=I(Hpr=>{"use strict";p();Object.defineProperty(Hpr,"__esModule",{value:!0});Hpr.debugGetObservableGraph=WYs;var HYs=hme(),GYs=OH(),$Ys=v8(),VYs=but(),Mti=Qut();function WYs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=oee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Lti(n,0,o,e).trim():Oti(n,0,o,e).trim()}a(WYs,"debugGetObservableGraph");function Oti(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,Mti.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=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Oti(u,e+1,r,n))}}return s.join(` -`)}a(Oti,"formatObservableInfoWithDependencies");function Lti(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,Mti.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=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Lti(u,e+1,r,n))}}return s.join(` -`)}a(Lti,"formatObservableInfoWithObservers");var oee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof VYs.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 HYs.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 $Ys.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof GYs.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 C8=I(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ValueWithChangeEventFromObservable=Ut.observableFromValueWithChangeEvent=Ut.TransactionImpl=Ut.transaction=Ut.subtransaction=Ut.globalTransaction=Ut.asyncTransaction=Ut.observableSignalFromEvent=Ut.observableFromEventOpts=Ut.observableSignal=Ut.constObservable=Ut.recordChangesLazy=Ut.recordChanges=Ut.isObservable=Ut.wasEventTriggeredRecently=Ut.throttledObservable=Ut.signalFromObservable=Ut.recomputeInitiallyAndOnChange=Ut.observableFromPromise=Ut.mapObservableArrayCached=Ut.keepObserved=Ut.derivedObservableWithWritableCache=Ut.derivedObservableWithCache=Ut.debouncedObservable2=Ut.debouncedObservable=Ut.waitForState=Ut.derivedWithCancellationToken=Ut.PromiseResult=Ut.ObservableResolvedPromise=Ut.ObservablePromise=Ut.ObservableLazyPromise=Ut.ObservableLazy=Ut.derivedWithStore=Ut.derivedWithSetter=Ut.derivedOpts=Ut.derivedHandleChanges=Ut.derivedDisposable=Ut.derived=Ut.disposableObservableValue=Ut.registerAutorunSelfDisposable=Ut.autorunSelfDisposable=Ut.autorunPerKeyedItem=Ut.autorunIterableDelta=Ut.autorunWithStoreHandleChanges=Ut.autorunWithStore=Ut.autorunOpts=Ut.autorunHandleChanges=Ut.autorunDelta=Ut.autorun=Ut.observableValueOpts=void 0;Ut.DebugLocation=Ut.ObservableMap=Ut.ObservableSet=Ut.observableValue=Ut.observableFromEvent=Ut.latestChangedValue=Ut.derivedConstOnceDefined=Ut.runOnChangeWithStore=Ut.runOnChangeWithCancellationToken=Ut.runOnChange=void 0;var zYs=vut();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return zYs.observableValueOpts},"get")});var l4=JX();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return l4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return l4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return l4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return l4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return l4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return l4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.registerAutorunSelfDisposable},"get")});var YYs=v8();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return YYs.disposableObservableValue},"get")});var _me=Tut();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return _me.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return _me.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return _me.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return _me.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return _me.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return _me.derivedWithStore},"get")});var TNe=Xei();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return TNe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return TNe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return TNe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return TNe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return TNe.PromiseResult},"get")});var Uti=eti();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Uti.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return Uti.waitForState},"get")});var oR=Dut();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return oR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return oR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return oR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return oR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return oR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return oR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return oR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return oR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return oR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return oR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return oR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return oR.isObservable},"get")});var Qti=pti();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return Qti.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return Qti.recordChangesLazy},"get")});var KYs=hti();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return KYs.constObservable},"get")});var JYs=wpr();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return JYs.observableSignal},"get")});var ZYs=OH();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return ZYs.observableFromEventOpts},"get")});var XYs=mti();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return XYs.observableSignalFromEvent},"get")});var INe=_8();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return INe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return INe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return INe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return INe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return INe.TransactionImpl},"get")});var qti=gti();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return qti.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return qti.ValueWithChangeEventFromObservable},"get")});var Gpr=Eti();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return Gpr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Gpr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Gpr.runOnChangeWithStore},"get")});var jti=Cti();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return jti.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return jti.latestChangedValue},"get")});var eKs=OH();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return eKs.observableFromEvent},"get")});var tKs=v8();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return tKs.observableValue},"get")});var rKs=bti();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return rKs.ObservableSet},"get")});var nKs=Sti();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return nKs.ObservableMap},"get")});var iKs=QT();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return iKs.DebugLocation},"get")});var $pr=o4(),Hti=Qut(),oKs=Nti(),Fti=owe(),sKs=H2(),aKs=Bti();(0,sKs._setDebugGetObservableGraph)(aKs.debugGetObservableGraph);(0,$pr.setLogObservableFn)(Hti.logObservableToConsole);var cKs=!1;cKs&&(0,$pr.addLogger)(new Hti.ConsoleObservableLogger);Fti.env&&Fti.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,$pr.addLogger)(oKs.DevToolsLogger.getInstance())});var hd=I(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.OffsetRangeSet=vme.OffsetRange=void 0;var Gut=Rs(),$ut=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 Gut.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 Gut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Gut.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)}};vme.OffsetRangeSet=Vpr});var $2=I(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.LineRangeSet=Sme.LineRange=void 0;var Gti=Rs(),lKs=hd(),$ti=eh(),Cme=xq(),Vti=Sl(),bme=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,Vti.compareBy)(e=>e.startLineNumber,Vti.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new Gti.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,Cme.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,Cme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Cme.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 bme(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,Cme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Cme.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 bme(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Sme.LineRangeSet=xNe});var Tme=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.TextLength=void 0;var uKs=$2(),Wti=q_(),Vut=eh(),Wpr=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 Vut.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Vut.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Vut.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return uKs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new Wti.Position(e.lineNumber,e.column+this.columnCount):new Wti.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Vut.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Wut.TextLength=Wpr});var Yut=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.PositionOffsetTransformer=see.PositionOffsetTransformerBase=void 0;see._setPositionOffsetTransformerDependencies=hKs;var dKs=xq(),fKs=hd(),wNe=q_(),pKs=eh(),zut=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new fKs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return pKs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new b8.deps.StringEdit(r)}getStringReplacement(e){return new b8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new b8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new b8.deps.TextEdit(r)}};see.PositionOffsetTransformerBase=zut;var b8=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 hKs(t){b8._deps=t}a(hKs,"_setPositionOffsetTransformerDependencies");var zpr=class extends zut{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 wNe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new wNe.Position(r,o+1)}if(e.column<1)return new wNe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new wNe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,dKs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new wNe.Position(n,o)}getTextLength(e){return b8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new b8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};see.PositionOffsetTransformer=zpr});var qT=I(u4=>{"use strict";p();Object.defineProperty(u4,"__esModule",{value:!0});u4.StringText=u4.ArrayText=u4.LineBasedText=u4.AbstractText=void 0;var mKs=rd(),gKs=em(),AKs=q_(),zti=eh(),yKs=Tme(),Yti=Yut(),RNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new AKs.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 zti.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Yti.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new zti.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,gKs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};u4.AbstractText=RNe;var Kut=class extends RNe{static{a(this,"LineBasedText")}constructor(e,r){(0,mKs.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{"use strict";p();alt();xJn();a(clt,"format");a(Nhe,"repeat");a(eGs,"computeIndentLevel");a(tGs,"getEOL");a(YDe,"isEOL")});function wJn(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{ZDe(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 ult(t,e=[],r=KDe.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"),ZDe(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:PJn(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 JDe(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 $dr(t){if(!t.parent||!t.parent.children)return[];let e=$dr(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 llt(t){switch(t.type){case"array":return t.children.map(llt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=llt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function nGs(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=[],j=[]){if(b(M),O.length+j.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(j.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(),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 P(!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 kJn(t,e){let r=FX(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 PJn(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 KDe,Wdr=ve(()=>{"use strict";p();alt();(function(t){t.DEFAULT={allowTrailingComma:!1}})(KDe||(KDe={}));a(wJn,"getLocation");a(RJn,"parse");a(ult,"parseTree");a(JDe,"findNodeAtLocation");a($dr,"getNodePath");a(llt,"getNodeValue");a(nGs,"contains");a(Vdr,"findNodeAtOffset");a(ZDe,"visit");a(kJn,"stripComments");a(PJn,"getNodeType")});function DJn(t,e,r,n){let o=e.slice(),c=ult(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=JDe(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=JDe(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 UX(t,{offset:h,length:m-h,content:""},n)}else return UX(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 UX(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 UX(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 UX(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 UX(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 UX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function UX(t,e,r){if(!r.formattingOptions)return[e];let n=dlt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!YDe(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=dlt(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 dlt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var NJn=ve(()=>{"use strict";p();Gdr();Wdr();a(DJn,"setProperty");a(UX,"withFormatting");a(dlt,"applyEdit")});var MJn={};ki(MJn,{ParseErrorCode:()=>Kdr,ScanError:()=>zdr,SyntaxKind:()=>Ydr,applyEdits:()=>yGs,createScanner:()=>sGs,findNodeAtLocation:()=>lGs,findNodeAtOffset:()=>uGs,format:()=>gGs,getLocation:()=>aGs,getNodePath:()=>dGs,getNodeValue:()=>fGs,modify:()=>AGs,parse:()=>Jdr,parseTree:()=>cGs,printParseErrorCode:()=>mGs,stripComments:()=>hGs,visit:()=>pGs});function mGs(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 gGs(t,e,r){return clt(t,e,r)}function AGs(t,e,r,n){return DJn(t,e,r,n)}function yGs(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=dlt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var sGs,zdr,Ydr,aGs,Jdr,cGs,lGs,uGs,dGs,fGs,pGs,hGs,Kdr,Zdr=ve(()=>{"use strict";p();Gdr();NJn();alt();Wdr();sGs=FX;(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"})(zdr||(zdr={}));(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"})(Ydr||(Ydr={}));aGs=wJn,Jdr=RJn,cGs=ult,lGs=JDe,uGs=Vdr,dGs=$dr,fGs=llt,pGs=ZDe,hGs=kJn;(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"})(Kdr||(Kdr={}));a(mGs,"printParseErrorCode");a(gGs,"format");a(AGs,"modify");a(yGs,"applyEdits")});var qT=I(KX=>{"use strict";p();Object.defineProperty(KX,"__esModule",{value:!0});KX.DebugNameData=void 0;KX.getDebugName=xei;KX.getClassName=wei;KX.getFunctionName=Rei;var opr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return xei(e,this)}};KX.DebugNameData=opr;var Sei=new Map,spr=new WeakMap;function xei(t,e){let r=spr.get(t);if(r)return r;let n=zWs(t,e);if(n){let o=Sei.get(n)??0;o++,Sei.set(n,o);let s=o===1?n:`${n}#${o}`;return spr.set(t,s),s}}a(xei,"getDebugName");function zWs(t,e){let r=spr.get(t);if(r)return r;let n=e.owner?KWs(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=Rei(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=YWs(e.owner,t);if(l!==void 0)return n+l}}a(zWs,"computeDebugName");function YWs(t,e){for(let r in t)if(t[r]===e)return r}a(YWs,"findKey");var Tei=new Map,Iei=new WeakMap;function KWs(t){let e=Iei.get(t);if(e)return e;let r=wei(t)??"Object",n=Tei.get(r)??0;n++,Tei.set(r,n);let o=n===1?r:`${r}#${n}`;return Iei.set(t,o),o}a(KWs,"formatOwner");function wei(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(wei,"getClassName");function Rei(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(Rei,"getFunctionName")});var jei=I(Cp=>{"use strict";p();var JWs=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]})),ZWs=Cp&&Cp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XWs=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;ot===e}a(Nei,"strictEqualsC");function Mei(t,e,r){return Dei.equals(t,e,r??gut)}a(Mei,"arrayEquals");function Oei(t){return(e,r)=>Dei.equals(e,r,t??gut)}a(Oei,"arrayEqualsC");function _Ne(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;r_Ne(t,e)}a(Lei,"structuralEqualsC");function ezs(t){return JSON.stringify(apr(t))}a(ezs,"getStructuralKey");var tzs=0,kei=new WeakMap;function apr(t){if(Array.isArray(t))return t.map(apr);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]=apr(e[n]);return r}else{let e=kei.get(t);return e===void 0&&(e=tzs++,kei.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(apr,"toNormalizedJsonStructure");function Bei(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Bei,"jsonStringifyEquals");function Fei(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(Fei,"jsonStringifyEqualsC");function Uei(){return(t,e)=>t.equals(e)}a(Uei,"thisEqualsC");function Qei(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Qei,"equalsIfDefined");function qei(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(qei,"equalsIfDefinedC");var Pei;(function(t){t.strict=gut,t.strictC=Nei,t.array=Mei,t.arrayC=Oei,t.structural=_Ne,t.structuralC=Lei,t.jsonStringify=Bei,t.jsonStringifyC=Fei,t.thisC=Uei,t.ifDefined=Qei,t.ifDefinedC=qei})(Pei||(Cp.equals=Pei={}))});var yv=I(bp=>{"use strict";p();Object.defineProperty(bp,"__esModule",{value:!0});bp.trackDisposable=bp.toDisposable=bp.markAsDisposed=bp.DisposableStore=bp.Event=bp.onUnexpectedError=bp.onBugIndicatingError=bp.BugIndicatingError=bp.strictEquals=bp.assertFn=void 0;var rzs=nd();Object.defineProperty(bp,"assertFn",{enumerable:!0,get:a(function(){return rzs.assertFn},"get")});var nzs=jei();Object.defineProperty(bp,"strictEquals",{enumerable:!0,get:a(function(){return nzs.strictEquals},"get")});var cpr=Rs();Object.defineProperty(bp,"BugIndicatingError",{enumerable:!0,get:a(function(){return cpr.BugIndicatingError},"get")});Object.defineProperty(bp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return cpr.onBugIndicatingError},"get")});Object.defineProperty(bp,"onUnexpectedError",{enumerable:!0,get:a(function(){return cpr.onUnexpectedError},"get")});var izs=Ic();Object.defineProperty(bp,"Event",{enumerable:!0,get:a(function(){return izs.Event},"get")});var Aut=ko();Object.defineProperty(bp,"DisposableStore",{enumerable:!0,get:a(function(){return Aut.DisposableStore},"get")});Object.defineProperty(bp,"markAsDisposed",{enumerable:!0,get:a(function(){return Aut.markAsDisposed},"get")});Object.defineProperty(bp,"toDisposable",{enumerable:!0,get:a(function(){return Aut.toDisposable},"get")});Object.defineProperty(bp,"trackDisposable",{enumerable:!0,get:a(function(){return Aut.trackDisposable},"get")})});var Hei=I(lpr=>{"use strict";p();Object.defineProperty(lpr,"__esModule",{value:!0});lpr.handleBugIndicatingErrorRecovery=szs;var ozs=yv();function szs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,ozs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(szs,"handleBugIndicatingErrorRecovery")});var s4=I(ume=>{"use strict";p();Object.defineProperty(ume,"__esModule",{value:!0});ume.addLogger=azs;ume.getLogger=czs;ume.setLogObservableFn=lzs;ume.logObservable=uzs;var JX;function azs(t){JX?JX instanceof yut?JX.loggers.push(t):JX=new yut([JX,t]):JX=t}a(azs,"addLogger");function czs(){return JX}a(czs,"getLogger");var upr;function lzs(t){upr=t}a(lzs,"setLogObservableFn");function uzs(t){upr&&upr(t)}a(uzs,"logObservable");var yut=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 C8=I(LH=>{"use strict";p();Object.defineProperty(LH,"__esModule",{value:!0});LH.TransactionImpl=void 0;LH.transaction=dpr;LH.globalTransaction=fzs;LH.asyncTransaction=pzs;LH.subtransaction=hzs;var Gei=Hei(),dzs=qT(),$ei=s4();function dpr(t,e){let r=new dme(t,e);try{t(r)}finally{r.finish()}}a(dpr,"transaction");var Eut;function fzs(t){if(Eut)t(Eut);else{let e=new dme(t,void 0);Eut=e;try{t(e)}finally{e.finish(),Eut=void 0}}}a(fzs,"globalTransaction");async function pzs(t,e){let r=new dme(t,e);try{await t(r)}finally{r.finish()}}a(pzs,"asyncTransaction");function hzs(t,e,r){t?e(t):dpr(e,r)}a(hzs,"subtransaction");var dme=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,$ei.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,dzs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Gei.handleBugIndicatingErrorRecovery)("Transaction already finished!"),dpr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Gei.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(_ut,"__esModule",{value:!0});_ut.DebugLocation=void 0;var Vei;(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,fpr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(Vei||(_ut.DebugLocation=Vei={}));var fpr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` +`),o=mzs(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 mzs(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(mzs,"parseLine")});var V2=I(a4=>{"use strict";p();Object.defineProperty(a4,"__esModule",{value:!0});a4.BaseObservable=a4.ConvenientObservable=void 0;a4._setDerivedOpts=Azs;a4._setRecomputeInitiallyAndOnChange=yzs;a4._setKeepObserved=Ezs;a4._setDebugGetObservableGraph=_zs;var Wei=jT(),gzs=qT(),fme=s4(),ppr;function Azs(t){ppr=t}a(Azs,"_setDerivedOpts");var zei;function yzs(t){zei=t}a(yzs,"_setRecomputeInitiallyAndOnChange");var Yei;function Ezs(t){Yei=t}a(Ezs,"_setKeepObserved");var hpr;function _zs(t){hpr=t}a(_zs,"_setDebugGetObservableGraph");var vut=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=Wei.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return ppr({owner:o,debugName:a(()=>{let c=(0,gzs.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 ppr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(zei(this,r)),this}keepObserved(e){return e.add(Yei(this)),this}get debugValue(){return this.get()}get debug(){return new mpr(this)}};a4.ConvenientObservable=vut;var mpr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return hpr(this.observable,{type:"dependencies"})}getObserverGraph(){return hpr(this.observable,{type:"observers"})}},gpr=class extends vut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,fme.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,fme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,fme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,fme.getLogger)();return(0,fme.logObservable)(this),e||(0,fme.getLogger)()?.handleObservableCreated(this,Wei.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};a4.BaseObservable=gpr});var b8=I(BH=>{"use strict";p();Object.defineProperty(BH,"__esModule",{value:!0});BH.DisposableObservableValue=BH.ObservableValue=void 0;BH.observableValue=bzs;BH.disposableObservableValue=Szs;var vzs=C8(),Czs=V2(),Jei=yv(),Cut=qT(),Kei=s4(),Zei=jT();function bzs(t,e,r=Zei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Cut.DebugNameData(void 0,t,void 0):n=new Cut.DebugNameData(t,void 0,void 0),new vNe(n,e,Jei.strictEquals,r)}a(bzs,"observableValue");var vNe=class extends Czs.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,Kei.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 vzs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,Kei.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}};BH.ObservableValue=vNe;function Szs(t,e,r=Zei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Cut.DebugNameData(void 0,t,void 0):n=new Cut.DebugNameData(t,void 0,void 0),new but(n,e,Jei.strictEquals,r)}a(Szs,"disposableObservableValue");var but=class extends vNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};BH.DisposableObservableValue=but});var eti=I(Sut=>{"use strict";p();Object.defineProperty(Sut,"__esModule",{value:!0});Sut.LazyObservableValue=void 0;var Tzs=C8(),Xei=s4(),Izs=V2(),Apr=class extends Izs.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,Xei.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,Xei.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 Tzs.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}};Sut.LazyObservableValue=Apr});var Tut=I(ypr=>{"use strict";p();Object.defineProperty(ypr,"__esModule",{value:!0});ypr.observableValueOpts=kzs;var tti=qT(),rti=yv(),xzs=b8(),wzs=eti(),Rzs=jT();function kzs(t,e,r=Rzs.DebugLocation.ofCaller()){return t.lazy?new wzs.LazyObservableValue(new tti.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??rti.strictEquals,r):new xzs.ObservableValue(new tti.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??rti.strictEquals,r)}a(kzs,"observableValueOpts")});var xut=I(Iut=>{"use strict";p();Object.defineProperty(Iut,"__esModule",{value:!0});Iut.AutorunObserver=void 0;var nR=yv(),CNe=s4();function Pzs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Pzs,"autorunStateToString");var Epr=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,CNe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,nR.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,CNe.getLogger)()?.handleAutorunDisposed(this),(0,nR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,CNe.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,nR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,CNe.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,nR.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,CNe.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,nR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new nR.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 nR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new nR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new nR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new nR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Pzs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,nR.onBugIndicatingError)(new nR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Iut.AutorunObserver=Epr});var ZX=I(iR=>{"use strict";p();Object.defineProperty(iR,"__esModule",{value:!0});iR.autorun=Cpr;iR.autorunOpts=bNe;iR.autorunHandleChanges=nti;iR.autorunWithStoreHandleChanges=Mzs;iR.autorunWithStore=Ozs;iR.autorunDelta=Lzs;iR.autorunIterableDelta=Bzs;iR.autorunPerKeyedItem=Fzs;iR.autorunSelfDisposable=Uzs;iR.registerAutorunSelfDisposable=Qzs;var pme=yv(),_pr=qT(),vpr=xut(),hme=jT(),Dzs=b8(),Nzs=C8();function Cpr(t,e=hme.DebugLocation.ofCaller()){return new vpr.AutorunObserver(new _pr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(Cpr,"autorun");function bNe(t,e,r=hme.DebugLocation.ofCaller()){return new vpr.AutorunObserver(new _pr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(bNe,"autorunOpts");function nti(t,e,r=hme.DebugLocation.ofCaller()){return new vpr.AutorunObserver(new _pr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(nti,"autorunHandleChanges");function Mzs(t,e){let r=new pme.DisposableStore,n=nti({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,pme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(Mzs,"autorunWithStoreHandleChanges");function Ozs(t){let e=new pme.DisposableStore,r=bNe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,pme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(Ozs,"autorunWithStore");function Lzs(t,e){let r;return bNe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(Lzs,"autorunDelta");function Bzs(t,e,r=n=>n){let n=new Map;return bNe({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(Bzs,"autorunIterableDelta");function Fzs(t,e,r,n=hme.DebugLocation.ofCaller()){let o=new Map,s=bNe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Nzs.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 pme.DisposableStore,E={value:(0,Dzs.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,pme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(Fzs,"autorunPerKeyedItem");function Uzs(t,e=hme.DebugLocation.ofCaller()){let r,n=!1;return r=Cpr(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(Uzs,"autorunSelfDisposable");function Qzs(t,e,r=hme.DebugLocation.ofCaller()){let n,o=!1;n=Cpr(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(Qzs,"registerAutorunSelfDisposable")});var gme=I(mme=>{"use strict";p();Object.defineProperty(mme,"__esModule",{value:!0});mme.DerivedWithSetter=mme.Derived=void 0;var qzs=V2(),eee=yv(),bpr=s4();function jzs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(jzs,"derivedStateToString");var wut=class extends qzs.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,bpr.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,bpr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,eee.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 eee.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,eee.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,bpr.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,eee.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 eee.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 eee.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new eee.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:jzs(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)}};mme.Derived=wut;var Spr=class extends wut{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};mme.DerivedWithSetter=Spr});var Rut=I(FH=>{"use strict";p();Object.defineProperty(FH,"__esModule",{value:!0});FH.derived=Gzs;FH.derivedWithSetter=$zs;FH.derivedOpts=iti;FH.derivedHandleChanges=Vzs;FH.derivedWithStore=Wzs;FH.derivedDisposable=zzs;var c4=yv(),Ame=jT(),tee=qT(),Hzs=V2(),ree=gme();function Gzs(t,e,r=Ame.DebugLocation.ofCaller()){return e!==void 0?new ree.Derived(new tee.DebugNameData(t,void 0,e),e,void 0,void 0,c4.strictEquals,r):new ree.Derived(new tee.DebugNameData(void 0,void 0,t),t,void 0,void 0,c4.strictEquals,r)}a(Gzs,"derived");function $zs(t,e,r,n=Ame.DebugLocation.ofCaller()){return new ree.DerivedWithSetter(new tee.DebugNameData(t,void 0,e),e,void 0,void 0,c4.strictEquals,r,n)}a($zs,"derivedWithSetter");function iti(t,e,r=Ame.DebugLocation.ofCaller()){return new ree.Derived(new tee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??c4.strictEquals,r)}a(iti,"derivedOpts");(0,Hzs._setDerivedOpts)(iti);function Vzs(t,e,r=Ame.DebugLocation.ofCaller()){return new ree.Derived(new tee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??c4.strictEquals,r)}a(Vzs,"derivedHandleChanges");function Wzs(t,e,r=Ame.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new c4.DisposableStore;return new ree.Derived(new tee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new c4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),c4.strictEquals,r)}a(Wzs,"derivedWithStore");function zzs(t,e,r=Ame.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new ree.Derived(new tee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new c4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},c4.strictEquals,r)}a(zzs,"derivedDisposable")});var ati=I(oR=>{"use strict";p();Object.defineProperty(oR,"__esModule",{value:!0});oR.ObservableLazyPromise=oR.ObservableResolvedPromise=oR.PromiseResult=oR.ObservablePromise=oR.ObservableLazy=void 0;var Yzs=ZX(),oti=C8(),sti=Rut(),kut=b8(),Put=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,kut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};oR.ObservableLazy=Put;var Dut=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,kut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,sti.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,oti.transaction)(n=>{this._value.set(new SNe(r,void 0),n)}),r),r=>{throw(0,oti.transaction)(n=>{this._value.set(new SNe(void 0,r),n)}),r})}};oR.ObservablePromise=Dut;var SNe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};oR.PromiseResult=SNe;var Tpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,kut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,kut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Yzs.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)}))}};oR.ObservableResolvedPromise=Tpr;var Ipr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Put(()=>new Dut(this._computePromise())),this.cachedPromiseResult=(0,sti.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};oR.ObservableLazyPromise=Ipr});var wpr=I(l4=>{"use strict";p();Object.defineProperty(l4,"__esModule",{value:!0});l4.cancelOnDispose=l4.CancellationTokenSource=l4.CancellationToken=l4.CancellationError=void 0;var Kzs=Rs();Object.defineProperty(l4,"CancellationError",{enumerable:!0,get:a(function(){return Kzs.CancellationError},"get")});var xpr=JP();Object.defineProperty(l4,"CancellationToken",{enumerable:!0,get:a(function(){return xpr.CancellationToken},"get")});Object.defineProperty(l4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return xpr.CancellationTokenSource},"get")});Object.defineProperty(l4,"cancelOnDispose",{enumerable:!0,get:a(function(){return xpr.cancelOnDispose},"get")})});var cti=I(Nut=>{"use strict";p();Object.defineProperty(Nut,"__esModule",{value:!0});Nut.waitForState=rYs;Nut.derivedWithCancellationToken=nYs;var Jzs=qT(),Rpr=wpr(),Zzs=yv(),Xzs=ZX(),eYs=gme(),tYs=jT();function rYs(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,Xzs.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 Rpr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Rpr.CancellationError);return}}c=!1,l&&d.dispose()})}a(rYs,"waitForState");function nYs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new eYs.Derived(new Jzs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Rpr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Zzs.strictEquals,tYs.DebugLocation.ofCaller())}a(nYs,"derivedWithCancellationToken")});var UH=I(nee=>{"use strict";p();Object.defineProperty(nee,"__esModule",{value:!0});nee.FromEventObservable=void 0;nee.observableFromEvent=kpr;nee.observableFromEventOpts=sYs;var iYs=C8(),uti=yv(),dti=qT(),lti=s4(),oYs=V2(),fti=jT();function kpr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new W2(new dti.DebugNameData(e,void 0,n),r,n,()=>W2.globalTransaction,uti.strictEquals,o??fti.DebugLocation.ofCaller())}a(kpr,"observableFromEvent");function sYs(t,e,r,n=fti.DebugLocation.ofCaller()){return new W2(new dti.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??W2.globalTransaction,t.equalsFn??uti.strictEquals,n)}a(sYs,"observableFromEventOpts");var W2=class extends oYs.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,iYs.subtransaction)(this._getTransaction(),m=>{(0,lti.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,lti.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}}};nee.FromEventObservable=W2;(function(t){t.Observer=W2;function e(r,n){let o=!1;W2.globalTransaction===void 0&&(W2.globalTransaction=r,o=!0);try{n()}finally{o&&(W2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(kpr||(nee.observableFromEvent=kpr={}))});var Dpr=I(Ppr=>{"use strict";p();Object.defineProperty(Ppr,"__esModule",{value:!0});Ppr.observableSignal=dYs;var aYs=C8(),cYs=qT(),lYs=V2(),uYs=jT();function dYs(t,e=uYs.DebugLocation.ofCaller()){return typeof t=="string"?new Mut(t,void 0,e):new Mut(void 0,t,e)}a(dYs,"observableSignal");var Mut=class extends lYs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new cYs.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,aYs.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 Lut=I(kE=>{"use strict";p();Object.defineProperty(kE,"__esModule",{value:!0});kE.KeepAliveObserver=void 0;kE.observableFromPromise=fYs;kE.signalFromObservable=pYs;kE.debouncedObservable=hYs;kE.throttledObservable=mYs;kE.debouncedObservable2=gYs;kE.wasEventTriggeredRecently=AYs;kE.keepObserved=yti;kE.recomputeInitiallyAndOnChange=Eti;kE.derivedObservableWithCache=yYs;kE.derivedObservableWithWritableCache=EYs;kE.mapObservableArrayCached=_Ys;kE.isObservable=vYs;var pti=ZX(),hti=b8(),Npr=yv(),INe=Rut(),mti=UH(),gti=Dpr(),Ati=V2(),Mpr=jT();function fYs(t){let e=(0,hti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(fYs,"observableFromPromise");function pYs(t,e){return(0,INe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(pYs,"signalFromObservable");function hYs(t,e,r=Mpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,mti.observableFromEvent)(void 0,c=>{let l=(0,pti.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(hYs,"debouncedObservable");function mYs(t,e,r=Mpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,mti.observableFromEvent)(void 0,c=>{let l=(0,pti.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(mYs,"throttledObservable");function gYs(t,e,r=Mpr.DebugLocation.ofCaller()){let n=(0,gti.observableSignal)("handleTimeout"),o,s;return(0,INe.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(gYs,"debouncedObservable2");function AYs(t,e,r){let n=(0,hti.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(AYs,"wasEventTriggeredRecently");function yti(t){let e=new TNe(!1,void 0);return t.addObserver(e),(0,Npr.toDisposable)(()=>{t.removeObserver(e)})}a(yti,"keepObserved");(0,Ati._setKeepObserved)(yti);function Eti(t,e){let r=new TNe(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Npr.toDisposable)(()=>{t.removeObserver(r)})}a(Eti,"recomputeInitiallyAndOnChange");(0,Ati._setRecomputeInitiallyAndOnChange)(Eti);var TNe=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){}};kE.KeepAliveObserver=TNe;function yYs(t,e){let r;return(0,INe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(yYs,"derivedObservableWithCache");function EYs(t,e){let r,n=(0,gti.observableSignal)("derivedObservableWithWritableCache"),o=(0,INe.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(EYs,"derivedObservableWithWritableCache");function _Ys(t,e,r,n){let o=new Out(r,n);return(0,INe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Out(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(_Ys,"mapObservableArrayCached");var Out=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 Npr.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 vYs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(vYs,"isObservable")});var vti=I(But=>{"use strict";p();Object.defineProperty(But,"__esModule",{value:!0});But.recordChanges=CYs;But.recordChangesLazy=bYs;var _ti=yv();function CYs(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 _ti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(CYs,"recordChanges");function bYs(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 _ti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(bYs,"recordChangesLazy")});var Cti=I(Lpr=>{"use strict";p();Object.defineProperty(Lpr,"__esModule",{value:!0});Lpr.constObservable=TYs;var SYs=V2();function TYs(t){return new Opr(t)}a(TYs,"constObservable");var Opr=class extends SYs.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 bti=I(Fpr=>{"use strict";p();Object.defineProperty(Fpr,"__esModule",{value:!0});Fpr.observableSignalFromEvent=kYs;var IYs=C8(),xYs=qT(),wYs=V2(),RYs=jT();function kYs(t,e,r=RYs.DebugLocation.ofCaller()){return new Bpr(typeof t=="string"?t:new xYs.DebugNameData(t,void 0,void 0),e,r)}a(kYs,"observableSignalFromEvent");var Bpr=class extends wYs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,IYs.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 Sti=I(xNe=>{"use strict";p();Object.defineProperty(xNe,"__esModule",{value:!0});xNe.ValueWithChangeEventFromObservable=void 0;xNe.observableFromValueWithChangeEvent=NYs;var PYs=yv(),DYs=UH(),Fut=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return PYs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};xNe.ValueWithChangeEventFromObservable=Fut;function NYs(t,e){return e instanceof Fut?e.observable:(0,DYs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(NYs,"observableFromValueWithChangeEvent")});var xti=I(wNe=>{"use strict";p();Object.defineProperty(wNe,"__esModule",{value:!0});wNe.runOnChange=Tti;wNe.runOnChangeWithStore=Iti;wNe.runOnChangeWithCancellationToken=BYs;var MYs=wpr(),OYs=yv(),LYs=ZX();function Tti(t,e){let r,n=!0;return(0,LYs.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(Tti,"runOnChange");function Iti(t,e){let r=new OYs.DisposableStore,n=Tti(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(Iti,"runOnChangeWithStore");function BYs(t,e){return Iti(t,(r,n,o,s)=>{e(r,n,o,(0,MYs.cancelOnDispose)(s))})}a(BYs,"runOnChangeWithCancellationToken")});var kti=I(Uut=>{"use strict";p();Object.defineProperty(Uut,"__esModule",{value:!0});Uut.latestChangedValue=qYs;Uut.derivedConstOnceDefined=jYs;var wti=yv(),Rti=qT(),FYs=UH(),UYs=ZX(),QYs=Lut();function qYs(t,e){if(e.length===0)throw new wti.BugIndicatingError;let r=!1,n,o=(0,FYs.observableFromEvent)(t,s=>{let c=new wti.DisposableStore;for(let l of e)c.add((0,UYs.autorunOpts)({debugName:a(()=>(0,Rti.getDebugName)(o,new Rti.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(qYs,"latestChangedValue");function jYs(t,e){return(0,QYs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(jYs,"derivedConstOnceDefined")});var Pti=I(Qut=>{"use strict";p();Object.defineProperty(Qut,"__esModule",{value:!0});Qut.ObservableSet=void 0;var HYs=Tut(),Upr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,HYs.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"}};Qut.ObservableSet=Upr});var Dti=I(qut=>{"use strict";p();Object.defineProperty(qut,"__esModule",{value:!0});qut.ObservableMap=void 0;var GYs=Tut(),Qpr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,GYs.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"}};qut.ObservableMap=Qpr});var Gut=I(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.ConsoleObservableLogger=void 0;vme.logObservableToConsole=WYs;vme.formatValue=_me;var $Ys=s4(),VYs=qT(),Nti=gme(),jut;function WYs(t){jut||(jut=new Hut,(0,$Ys.addLogger)(jut)),jut.addFilteredObj(t)}a(WYs,"logObservableToConsole");var Hut=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 zYs([yme(JYs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[yme(" "),sR(_me(e.oldValue,70),{color:"red",strikeThrough:!0}),yme(" "),sR(_me(e.newValue,60),{color:"green"})]:[yme(" (unchanged)")]:[yme(" "),sR(_me(e.newValue,60),{color:"green"}),yme(" (initial)")]}handleObservableCreated(e){if(e instanceof Nti.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 Nti.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Eme("observable value changed"),sR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return sR(" (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([Eme("derived recomputed"),sR(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([Eme("derived cleared"),sR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Eme("observable from event triggered"),sR(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([Eme("autorun"),sR(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([Eme("transaction"),sR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};vme.ConsoleObservableLogger=Hut;function zYs(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(zYs,"consoleTextToArgs");function yme(t){return sR(t,{color:"black"})}a(yme,"normalText");function Eme(t){return sR(ZYs(`${t}: `,10),{color:"black",bold:!0})}a(Eme,"formatKind");function sR(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(sR,"styled");function _me(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)?YYs(t,e):KYs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(_me,"formatValue");function YYs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${_me(o,e-r.length)}`}return r+=" ]",r}a(YYs,"formatArray");function KYs(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,VYs.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}: ${_me(c,e-n.length)}`}return n+=r?")":" }",n}a(KYs,"formatObject");function JYs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(JYs,"repeat");function ZYs(t,e){for(;t.length{"use strict";p();Object.defineProperty($ut,"__esModule",{value:!0});$ut.SimpleTypedRpcConnection=void 0;var qpr=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}}};$ut.SimpleTypedRpcConnection=qpr});var Oti=I(jpr=>{"use strict";p();Object.defineProperty(jpr,"__esModule",{value:!0});jpr.registerDebugChannel=eKs;var XYs=Mti();function eKs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=tKs({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},XYs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(eKs,"registerDebugChannel");function tKs(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(tKs,"createChannelFactoryFromDebugChannel")});var Fti=I(QH=>{"use strict";p();Object.defineProperty(QH,"__esModule",{value:!0});QH.Throttler=QH.Debouncer=void 0;QH.deepAssign=Lti;QH.deepAssignDeleteNulls=Bti;var Hpr=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)}};QH.Debouncer=Hpr;var Gpr=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)}};QH.Throttler=Gpr;function Lti(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?Lti(t[r],e[r]):t[r]=e[r]}a(Lti,"deepAssign");function Bti(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"?Bti(t[r],e[r]):t[r]=e[r]}a(Bti,"deepAssignDeleteNulls")});var qti=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.DevToolsLogger=void 0;var Uti=xut(),Vut=Gut(),rKs=Oti(),$pr=Fti(),RNe=ZS(),nKs=UH(),iee=Rs(),oee=gme(),Qti=b8(),iKs=jT(),Vpr=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,iee.onUnexpectedError)(new iee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,iee.onUnexpectedError)(new iee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof oee.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(RNe.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 Uti.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 oee.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,rKs.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(RNe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(RNe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(RNe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(RNe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof oee.Derived)n.debugSetValue(r);else if(n instanceof Qti.ObservableValue)n.debugSetValue(r);else if(n instanceof nKs.FromEventObservable)n.debugSetValue(r);else throw new iee.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 oee.Derived)return(0,Vut.formatValue)(r.debugGetState().value,200);if(r instanceof Qti.ObservableValue)return(0,Vut.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 iee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof oee.Derived)r.debugRecompute();else if(r instanceof Uti.AutorunObserver)r.debugRerun();else throw new iee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new $pr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},iKs.DebugLocation.enable()}_handleChange(e){(0,$pr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,$pr.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 oee.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 oee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,Vut.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,Vut.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)}};Wut.DevToolsLogger=Vpr});var $ti=I(Wpr=>{"use strict";p();Object.defineProperty(Wpr,"__esModule",{value:!0});Wpr.debugGetObservableGraph=lKs;var oKs=gme(),sKs=UH(),aKs=b8(),cKs=xut(),jti=Gut();function lKs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=see.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Gti(n,0,o,e).trim():Hti(n,0,o,e).trim()}a(lKs,"debugGetObservableGraph");function Hti(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,jti.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=see.from(l,n.debugNamePostProcessor??(d=>d))??see.unknown(l);s.push(Hti(u,e+1,r,n))}}return s.join(` +`)}a(Hti,"formatObservableInfoWithDependencies");function Gti(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,jti.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=see.from(l,n.debugNamePostProcessor??(d=>d))??see.unknown(l);s.push(Gti(u,e+1,r,n))}}return s.join(` +`)}a(Gti,"formatObservableInfoWithObservers");var see=class t{static{a(this,"Info")}static from(e,r){if(e instanceof cKs.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 oKs.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 aKs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof sKs.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 S8=I(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ValueWithChangeEventFromObservable=Ut.observableFromValueWithChangeEvent=Ut.TransactionImpl=Ut.transaction=Ut.subtransaction=Ut.globalTransaction=Ut.asyncTransaction=Ut.observableSignalFromEvent=Ut.observableFromEventOpts=Ut.observableSignal=Ut.constObservable=Ut.recordChangesLazy=Ut.recordChanges=Ut.isObservable=Ut.wasEventTriggeredRecently=Ut.throttledObservable=Ut.signalFromObservable=Ut.recomputeInitiallyAndOnChange=Ut.observableFromPromise=Ut.mapObservableArrayCached=Ut.keepObserved=Ut.derivedObservableWithWritableCache=Ut.derivedObservableWithCache=Ut.debouncedObservable2=Ut.debouncedObservable=Ut.waitForState=Ut.derivedWithCancellationToken=Ut.PromiseResult=Ut.ObservableResolvedPromise=Ut.ObservablePromise=Ut.ObservableLazyPromise=Ut.ObservableLazy=Ut.derivedWithStore=Ut.derivedWithSetter=Ut.derivedOpts=Ut.derivedHandleChanges=Ut.derivedDisposable=Ut.derived=Ut.disposableObservableValue=Ut.registerAutorunSelfDisposable=Ut.autorunSelfDisposable=Ut.autorunPerKeyedItem=Ut.autorunIterableDelta=Ut.autorunWithStoreHandleChanges=Ut.autorunWithStore=Ut.autorunOpts=Ut.autorunHandleChanges=Ut.autorunDelta=Ut.autorun=Ut.observableValueOpts=void 0;Ut.DebugLocation=Ut.ObservableMap=Ut.ObservableSet=Ut.observableValue=Ut.observableFromEvent=Ut.latestChangedValue=Ut.derivedConstOnceDefined=Ut.runOnChangeWithStore=Ut.runOnChangeWithCancellationToken=Ut.runOnChange=void 0;var uKs=Tut();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return uKs.observableValueOpts},"get")});var u4=ZX();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return u4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return u4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return u4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return u4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return u4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return u4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return u4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return u4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return u4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return u4.registerAutorunSelfDisposable},"get")});var dKs=b8();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return dKs.disposableObservableValue},"get")});var Cme=Rut();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return Cme.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return Cme.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return Cme.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return Cme.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return Cme.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return Cme.derivedWithStore},"get")});var kNe=ati();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return kNe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return kNe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return kNe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return kNe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return kNe.PromiseResult},"get")});var Wti=cti();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Wti.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return Wti.waitForState},"get")});var aR=Lut();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return aR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return aR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return aR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return aR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return aR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return aR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return aR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return aR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return aR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return aR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return aR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return aR.isObservable},"get")});var zti=vti();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return zti.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return zti.recordChangesLazy},"get")});var fKs=Cti();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return fKs.constObservable},"get")});var pKs=Dpr();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return pKs.observableSignal},"get")});var hKs=UH();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return hKs.observableFromEventOpts},"get")});var mKs=bti();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return mKs.observableSignalFromEvent},"get")});var PNe=C8();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return PNe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return PNe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return PNe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return PNe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return PNe.TransactionImpl},"get")});var Yti=Sti();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return Yti.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return Yti.ValueWithChangeEventFromObservable},"get")});var zpr=xti();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return zpr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return zpr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return zpr.runOnChangeWithStore},"get")});var Kti=kti();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return Kti.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return Kti.latestChangedValue},"get")});var gKs=UH();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return gKs.observableFromEvent},"get")});var AKs=b8();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return AKs.observableValue},"get")});var yKs=Pti();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return yKs.ObservableSet},"get")});var EKs=Dti();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return EKs.ObservableMap},"get")});var _Ks=jT();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return _Ks.DebugLocation},"get")});var Ypr=s4(),Jti=Gut(),vKs=qti(),Vti=cwe(),CKs=V2(),bKs=$ti();(0,CKs._setDebugGetObservableGraph)(bKs.debugGetObservableGraph);(0,Ypr.setLogObservableFn)(Jti.logObservableToConsole);var SKs=!1;SKs&&(0,Ypr.addLogger)(new Jti.ConsoleObservableLogger);Vti.env&&Vti.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,Ypr.addLogger)(vKs.DevToolsLogger.getInstance())});var gd=I(bme=>{"use strict";p();Object.defineProperty(bme,"__esModule",{value:!0});bme.OffsetRangeSet=bme.OffsetRange=void 0;var zut=Rs(),Yut=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 zut.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 zut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new zut.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)}};bme.OffsetRangeSet=Kpr});var z2=I(Ime=>{"use strict";p();Object.defineProperty(Ime,"__esModule",{value:!0});Ime.LineRangeSet=Ime.LineRange=void 0;var Zti=Rs(),TKs=gd(),Xti=rh(),Sme=kq(),eri=Tl(),Tme=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,eri.compareBy)(e=>e.startLineNumber,eri.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new Zti.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,Sme.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,Sme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Sme.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 Tme(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,Sme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Sme.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 Tme(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Ime.LineRangeSet=DNe});var xme=I(Jut=>{"use strict";p();Object.defineProperty(Jut,"__esModule",{value:!0});Jut.TextLength=void 0;var IKs=z2(),tri=j_(),Kut=rh(),Jpr=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 Kut.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Kut.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Kut.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return IKs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new tri.Position(e.lineNumber,e.column+this.columnCount):new tri.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Kut.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Jut.TextLength=Jpr});var Xut=I(aee=>{"use strict";p();Object.defineProperty(aee,"__esModule",{value:!0});aee.PositionOffsetTransformer=aee.PositionOffsetTransformerBase=void 0;aee._setPositionOffsetTransformerDependencies=kKs;var xKs=kq(),wKs=gd(),NNe=j_(),RKs=rh(),Zut=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new wKs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return RKs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new T8.deps.StringEdit(r)}getStringReplacement(e){return new T8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new T8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new T8.deps.TextEdit(r)}};aee.PositionOffsetTransformerBase=Zut;var T8=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 kKs(t){T8._deps=t}a(kKs,"_setPositionOffsetTransformerDependencies");var Zpr=class extends Zut{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 NNe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new NNe.Position(r,o+1)}if(e.column<1)return new NNe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new NNe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,xKs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new NNe.Position(n,o)}getTextLength(e){return T8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new T8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};aee.PositionOffsetTransformer=Zpr});var HT=I(d4=>{"use strict";p();Object.defineProperty(d4,"__esModule",{value:!0});d4.StringText=d4.ArrayText=d4.LineBasedText=d4.AbstractText=void 0;var PKs=nd(),DKs=rm(),NKs=j_(),rri=rh(),MKs=xme(),nri=Xut(),MNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new NKs.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 rri.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new nri.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new rri.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,DKs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};d4.AbstractText=MNe;var edt=class extends MNe{static{a(this,"LineBasedText")}constructor(e,r){(0,PKs.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)}};u4.ArrayText=Ypr;var Kpr=class extends RNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new Yti.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};u4.StringText=Kpr});var Jti=I(d4=>{"use strict";p();Object.defineProperty(d4,"__esModule",{value:!0});d4.AnnotationReplacement=d4.Edit=d4.BaseReplacement=d4.BaseEdit=void 0;var EKs=Sl(),Kti=Rs(),sR=hd(),Jut=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 Kti.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(sR.OffsetRange.emptyAt(h),new sR.OffsetRange(0,m));s.push(E)}if(!f)throw new Kti.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(sR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new sR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new sR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new sR.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 sR.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(sR.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,EKs.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 sR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};d4.BaseReplacement=Zut;var Jpr=class t extends Jut{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)}};d4.Edit=Jpr;var Zpr=class t extends Zut{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)}};d4.AnnotationReplacement=Zpr});var kE=I(ny=>{"use strict";p();Object.defineProperty(ny,"__esModule",{value:!0});ny.AnnotatedStringReplacement=ny.AnnotatedStringEdit=ny.VoidEditData=ny.StringReplacement=ny.StringEdit=ny.BaseStringReplacement=ny.BaseStringEdit=void 0;ny.applyEditsToRanges=vKs;var Xut=em(),V2=hd(),_Ks=qT(),Xti=Jti(),kNe=class extends Xti.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(Av.replace(V2.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 f4(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 f4(r)}normalizeEOL(e){return new f4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Av.replace(V2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?f4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new _Ks.StringText(this.apply(e.value))}mapData(e){return new edt(this.replacements.map(r=>new aee(r.replaceRange,r.newText,e(r))))}};ny.BaseStringEdit=kNe;var PNe=class extends Xti.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,Xut.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,Xut.commonSuffixLength)(r,this.newText)),s=new V2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Av(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Av(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,Xut.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new V2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,Xut.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new V2.OffsetRange(0,this.newText.length-n))}toEdit(){return new f4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};ny.BaseStringReplacement=PNe;var f4=class t extends kNe{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 Av(new V2.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 Av(e,r)])}static insert(e,r){return new t([new Av(V2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Av(e,"")])}static fromJson(e){return new t(e.map(Av.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(vKs,"applyEditsToRanges");var Xpr=class{static{a(this,"VoidEditData")}join(e){return this}};ny.VoidEditData=Xpr;var edt=class t extends kNe{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 aee(e,r,n)])}static insert(e,r,n){return new t([new aee(V2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new aee(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(tdt,"__esModule",{value:!0});tdt.LanguageId=void 0;var eri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(eri||(tdt.LanguageId=eri={}))});var rri=I(BH=>{"use strict";p();Object.defineProperty(BH,"__esModule",{value:!0});BH.EditReasons=BH.TextModelEditReason=BH.EditReason=void 0;var ehr=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 DNe(this.metadata,tri).toKey(e)}};BH.EditReason=ehr;var tri=Symbol("TextModelEditReason"),DNe=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("-")}};BH.TextModelEditReason=DNe;function aR(t){return new DNe(t,tri)}a(aR,"createEditReason");BH.EditReasons={unknown(t){return aR({source:"unknown",name:t.name})},chatApplyEdits(t){return aR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return aR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return aR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return aR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>aR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return aR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>aR({source:"setValue"}),"setValue"),eolChange:a(()=>aR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>aR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>aR({source:"snippet"}),"snippet"),suggest:a(t=>aR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var cee=I(p4=>{"use strict";p();Object.defineProperty(p4,"__esModule",{value:!0});p4.MutableObservableDocument=p4.MutableObservableWorkspace=p4.StringEditWithReason=p4.ObservableWorkspace=void 0;var bKs=rd(),nri=Ro(),yv=C8(),ori=kE(),SKs=hd(),TKs=qT(),IKs=rdt(),iri=rri(),ndt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,yv.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,yv.derivedWithStore)((e,r)=>{let n=(0,yv.observableValue)("lastActiveDocument",void 0);return r.add((0,yv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,yv.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)}};p4.ObservableWorkspace=ndt;var Ime=class extends ori.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};p4.StringEditWithReason=Ime;var thr=class extends ndt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,yv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,bKs.assert)(!this._documents.has(e.id));let n=new idt(e.id,new TKs.StringText(e.initialValue??""),[],e.languageId??IKs.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}};p4.MutableObservableWorkspace=thr;var idt=class extends nri.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,yv.observableValue)(this,r),this._selection=(0,yv.observableValue)(this,n),this._primarySelectionLine=(0,yv.observableValue)(this,void 0),this._visibleRanges=(0,yv.observableValue)(this,[]),this._languageId=(0,yv.observableValue)(this,o),this._version=(0,yv.observableValue)(this,c),this._diagnostics=(0,yv.observableValue)(this,[]),this._register((0,nri.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 Ime?e:new Ime(e.replacements,iri.EditReason.unknown);(0,yv.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=iri.EditReason.unknown,s=new Ime([ori.StringReplacement.replace(new SKs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,yv.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)}};p4.MutableObservableDocument=idt});var W2=I(lee=>{"use strict";p();var xKs=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]})),wKs=lee&&lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xKs(e,t,r)};Object.defineProperty(lee,"__esModule",{value:!0});wKs(C8(),lee)});var h4=I(rhr=>{"use strict";p();Object.defineProperty(rhr,"__esModule",{value:!0});rhr.autorunWithChanges=kKs;var RKs=W2();function kKs(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,RKs.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(kKs,"autorunWithChanges")});var Za=I(oy=>{"use strict";p();var Phr=Symbol.for("yaml.alias"),hni=Symbol.for("yaml.document"),$dt=Symbol.for("yaml.map"),mni=Symbol.for("yaml.pair"),Dhr=Symbol.for("yaml.scalar"),Vdt=Symbol.for("yaml.seq"),x8=Symbol.for("yaml.node.type"),dZs=a(t=>!!t&&typeof t=="object"&&t[x8]===Phr,"isAlias"),fZs=a(t=>!!t&&typeof t=="object"&&t[x8]===hni,"isDocument"),pZs=a(t=>!!t&&typeof t=="object"&&t[x8]===$dt,"isMap"),hZs=a(t=>!!t&&typeof t=="object"&&t[x8]===mni,"isPair"),gni=a(t=>!!t&&typeof t=="object"&&t[x8]===Dhr,"isScalar"),mZs=a(t=>!!t&&typeof t=="object"&&t[x8]===Vdt,"isSeq");function Ani(t){if(t&&typeof t=="object")switch(t[x8]){case $dt:case Vdt:return!0}return!1}a(Ani,"isCollection");function gZs(t){if(t&&typeof t=="object")switch(t[x8]){case Phr:case $dt:case Dhr:case Vdt:return!0}return!1}a(gZs,"isNode");var AZs=a(t=>(gni(t)||Ani(t))&&!!t.anchor,"hasAnchor");oy.ALIAS=Phr;oy.DOC=hni;oy.MAP=$dt;oy.NODE_TYPE=x8;oy.PAIR=mni;oy.SCALAR=Dhr;oy.SEQ=Vdt;oy.hasAnchor=AZs;oy.isAlias=dZs;oy.isCollection=Ani;oy.isDocument=fZs;oy.isMap=pZs;oy.isNode=gZs;oy.isPair=hZs;oy.isScalar=gni;oy.isSeq=mZs});var HNe=I(Nhr=>{"use strict";p();var C0=Za(),Lb=Symbol("break visit"),yni=Symbol("skip children"),y4=Symbol("remove node");function Wdt(t,e){let r=Eni(e);C0.isDocument(t)?Nme(null,t.contents,r,Object.freeze([t]))===y4&&(t.contents=null):Nme(null,t,r,Object.freeze([]))}a(Wdt,"visit");Wdt.BREAK=Lb;Wdt.SKIP=yni;Wdt.REMOVE=y4;function Nme(t,e,r,n){let o=_ni(t,e,r,n);if(C0.isNode(o)||C0.isPair(o))return vni(t,n,o),Nme(t,o,r,n);if(typeof o!="symbol"){if(C0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var Cni=Za(),yZs=HNe(),EZs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_Zs=a(t=>t.replace(/[!,[\]{}]/g,e=>EZs[e]),"escapeTagName"),GNe=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+_Zs(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&&Cni.isNode(e.contents)){let s={};yZs.visit(e.contents,(c,l)=>{Cni.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(` -`)}};GNe.defaultYaml={explicit:!1,version:"1.2"};GNe.defaultTags={"!!":"tag:yaml.org,2002:"};bni.Directives=GNe});var Ydt=I($Ne=>{"use strict";p();var Sni=Za(),vZs=HNe();function CZs(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(CZs,"anchorIsValid");function Tni(t){let e=new Set;return vZs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(Tni,"anchorNames");function Ini(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(Ini,"findNewAnchor");function bZs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=Tni(t));let c=Ini(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&&(Sni.isScalar(c.node)||Sni.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(bZs,"createNodeAnchors");$Ne.anchorIsValid=CZs;$Ne.anchorNames=Tni;$Ne.createNodeAnchors=bZs;$Ne.findNewAnchor=Ini});var Ohr=I(xni=>{"use strict";p();function VNe(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 SZs=Za();function wni(t,e,r){if(Array.isArray(t))return t.map((n,o)=>wni(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!SZs.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(wni,"toJS");Rni.toJS=wni});var Kdt=I(Pni=>{"use strict";p();var TZs=Ohr(),kni=Za(),IZs=qH(),Lhr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,kni.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(!kni.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=IZs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?TZs.applyReviver(s,{"":l},"",l):l}};Pni.NodeBase=Lhr});var WNe=I(Dni=>{"use strict";p();var xZs=Ydt(),wZs=HNe(),Ome=Za(),RZs=Kdt(),kZs=qH(),Bhr=class extends RZs.NodeBase{static{a(this,"Alias")}constructor(e){super(Ome.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=[],wZs.visit(e,{Node:a((s,c)=>{(Ome.isAlias(c)||Ome.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||(kZs.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=Jdt(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(xZs.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 Jdt(t,e,r){if(Ome.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Ome.isCollection(e)){let n=0;for(let o of e.items){let s=Jdt(t,o,r);s>n&&(n=s)}return n}else if(Ome.isPair(e)){let n=Jdt(t,e.key,r),o=Jdt(t,e.value,r);return Math.max(n,o)}return 1}a(Jdt,"getAliasCount");Dni.Alias=Bhr});var mm=I(Fhr=>{"use strict";p();var PZs=Za(),DZs=Kdt(),NZs=qH(),MZs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),jH=class extends DZs.NodeBase{static{a(this,"Scalar")}constructor(e){super(PZs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:NZs.toJS(this.value,e,r)}toString(){return String(this.value)}};jH.BLOCK_FOLDED="BLOCK_FOLDED";jH.BLOCK_LITERAL="BLOCK_LITERAL";jH.PLAIN="PLAIN";jH.QUOTE_DOUBLE="QUOTE_DOUBLE";jH.QUOTE_SINGLE="QUOTE_SINGLE";Fhr.Scalar=jH;Fhr.isScalarValue=MZs});var zNe=I(Mni=>{"use strict";p();var OZs=WNe(),mee=Za(),Nni=mm(),LZs="tag:yaml.org,2002:";function BZs(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(BZs,"findTagObject");function FZs(t,e,r){if(mee.isDocument(t)&&(t=t.contents),mee.isNode(t))return t;if(mee.isPair(t)){let h=r.schema[mee.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 OZs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=LZs+e.slice(2));let d=BZs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Nni.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[mee.MAP]:Symbol.iterator in Object(t)?c[mee.SEQ]:c[mee.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 Nni.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(FZs,"createNode");Mni.createNode=FZs});var Xdt=I(Zdt=>{"use strict";p();var UZs=zNe(),E4=Za(),QZs=Kdt();function Uhr(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 UZs.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(Uhr,"collectionFromPath");var Oni=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Qhr=class extends QZs.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=>E4.isNode(n)||E4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Oni(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(E4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Uhr(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(E4.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&&E4.isScalar(s)?s.value:s:E4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!E4.isPair(r))return!1;let n=r.value;return n==null||e&&E4.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 E4.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(E4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Uhr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Zdt.Collection=Qhr;Zdt.collectionFromPath=Uhr;Zdt.isEmptyPath=Oni});var YNe=I(eft=>{"use strict";p();var qZs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function qhr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(qhr,"indentComment");var jZs=a((t,e,r)=>t.endsWith(` -`)?qhr(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 MKs.TextLength(this._lineCount-1,e.length)}};d4.LineBasedText=edt;var Xpr=class extends edt{static{a(this,"ArrayText")}constructor(e){super(r=>e[r-1],e.length)}};d4.ArrayText=Xpr;var ehr=class extends MNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new nri.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};d4.StringText=ehr});var ori=I(f4=>{"use strict";p();Object.defineProperty(f4,"__esModule",{value:!0});f4.AnnotationReplacement=f4.Edit=f4.BaseReplacement=f4.BaseEdit=void 0;var OKs=Tl(),iri=Rs(),cR=gd(),tdt=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 iri.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(cR.OffsetRange.emptyAt(h),new cR.OffsetRange(0,m));s.push(E)}if(!f)throw new iri.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(cR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new cR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new cR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new cR.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 cR.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(cR.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,OKs.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 cR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};f4.BaseReplacement=rdt;var thr=class t extends tdt{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)}};f4.Edit=thr;var rhr=class t extends rdt{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)}};f4.AnnotationReplacement=rhr});var PE=I(iy=>{"use strict";p();Object.defineProperty(iy,"__esModule",{value:!0});iy.AnnotatedStringReplacement=iy.AnnotatedStringEdit=iy.VoidEditData=iy.StringReplacement=iy.StringEdit=iy.BaseStringReplacement=iy.BaseStringEdit=void 0;iy.applyEditsToRanges=BKs;var ndt=rm(),Y2=gd(),LKs=HT(),ari=ori(),ONe=class extends ari.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(Ev.replace(Y2.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 p4(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 p4(r)}normalizeEOL(e){return new p4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Ev.replace(Y2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?p4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new LKs.StringText(this.apply(e.value))}mapData(e){return new idt(this.replacements.map(r=>new cee(r.replaceRange,r.newText,e(r))))}};iy.BaseStringEdit=ONe;var LNe=class extends ari.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,ndt.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,ndt.commonSuffixLength)(r,this.newText)),s=new Y2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Ev(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Ev(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,ndt.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new Y2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,ndt.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new Y2.OffsetRange(0,this.newText.length-n))}toEdit(){return new p4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};iy.BaseStringReplacement=LNe;var p4=class t extends ONe{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 Ev(new Y2.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 Ev(e,r)])}static insert(e,r){return new t([new Ev(Y2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Ev(e,"")])}static fromJson(e){return new t(e.map(Ev.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(BKs,"applyEditsToRanges");var nhr=class{static{a(this,"VoidEditData")}join(e){return this}};iy.VoidEditData=nhr;var idt=class t extends ONe{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 cee(e,r,n)])}static insert(e,r,n){return new t([new cee(Y2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new cee(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(odt,"__esModule",{value:!0});odt.LanguageId=void 0;var cri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(cri||(odt.LanguageId=cri={}))});var uri=I(qH=>{"use strict";p();Object.defineProperty(qH,"__esModule",{value:!0});qH.EditReasons=qH.TextModelEditReason=qH.EditReason=void 0;var ihr=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 BNe(this.metadata,lri).toKey(e)}};qH.EditReason=ihr;var lri=Symbol("TextModelEditReason"),BNe=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("-")}};qH.TextModelEditReason=BNe;function lR(t){return new BNe(t,lri)}a(lR,"createEditReason");qH.EditReasons={unknown(t){return lR({source:"unknown",name:t.name})},chatApplyEdits(t){return lR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return lR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return lR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return lR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>lR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return lR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>lR({source:"setValue"}),"setValue"),eolChange:a(()=>lR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>lR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>lR({source:"snippet"}),"snippet"),suggest:a(t=>lR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var lee=I(h4=>{"use strict";p();Object.defineProperty(h4,"__esModule",{value:!0});h4.MutableObservableDocument=h4.MutableObservableWorkspace=h4.StringEditWithReason=h4.ObservableWorkspace=void 0;var UKs=nd(),dri=ko(),_v=S8(),pri=PE(),QKs=gd(),qKs=HT(),jKs=sdt(),fri=uri(),adt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,_v.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,_v.derivedWithStore)((e,r)=>{let n=(0,_v.observableValue)("lastActiveDocument",void 0);return r.add((0,_v.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,_v.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)}};h4.ObservableWorkspace=adt;var wme=class extends pri.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};h4.StringEditWithReason=wme;var ohr=class extends adt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,_v.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,UKs.assert)(!this._documents.has(e.id));let n=new cdt(e.id,new qKs.StringText(e.initialValue??""),[],e.languageId??jKs.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}};h4.MutableObservableWorkspace=ohr;var cdt=class extends dri.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,_v.observableValue)(this,r),this._selection=(0,_v.observableValue)(this,n),this._primarySelectionLine=(0,_v.observableValue)(this,void 0),this._visibleRanges=(0,_v.observableValue)(this,[]),this._languageId=(0,_v.observableValue)(this,o),this._version=(0,_v.observableValue)(this,c),this._diagnostics=(0,_v.observableValue)(this,[]),this._register((0,dri.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 wme?e:new wme(e.replacements,fri.EditReason.unknown);(0,_v.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=fri.EditReason.unknown,s=new wme([pri.StringReplacement.replace(new QKs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,_v.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)}};h4.MutableObservableDocument=cdt});var K2=I(uee=>{"use strict";p();var HKs=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]})),GKs=uee&&uee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HKs(e,t,r)};Object.defineProperty(uee,"__esModule",{value:!0});GKs(S8(),uee)});var m4=I(shr=>{"use strict";p();Object.defineProperty(shr,"__esModule",{value:!0});shr.autorunWithChanges=VKs;var $Ks=K2();function VKs(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,$Ks.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(VKs,"autorunWithChanges")});var Xa=I(sy=>{"use strict";p();var Ohr=Symbol.for("yaml.alias"),Cni=Symbol.for("yaml.document"),Ydt=Symbol.for("yaml.map"),bni=Symbol.for("yaml.pair"),Lhr=Symbol.for("yaml.scalar"),Kdt=Symbol.for("yaml.seq"),R8=Symbol.for("yaml.node.type"),xZs=a(t=>!!t&&typeof t=="object"&&t[R8]===Ohr,"isAlias"),wZs=a(t=>!!t&&typeof t=="object"&&t[R8]===Cni,"isDocument"),RZs=a(t=>!!t&&typeof t=="object"&&t[R8]===Ydt,"isMap"),kZs=a(t=>!!t&&typeof t=="object"&&t[R8]===bni,"isPair"),Sni=a(t=>!!t&&typeof t=="object"&&t[R8]===Lhr,"isScalar"),PZs=a(t=>!!t&&typeof t=="object"&&t[R8]===Kdt,"isSeq");function Tni(t){if(t&&typeof t=="object")switch(t[R8]){case Ydt:case Kdt:return!0}return!1}a(Tni,"isCollection");function DZs(t){if(t&&typeof t=="object")switch(t[R8]){case Ohr:case Ydt:case Lhr:case Kdt:return!0}return!1}a(DZs,"isNode");var NZs=a(t=>(Sni(t)||Tni(t))&&!!t.anchor,"hasAnchor");sy.ALIAS=Ohr;sy.DOC=Cni;sy.MAP=Ydt;sy.NODE_TYPE=R8;sy.PAIR=bni;sy.SCALAR=Lhr;sy.SEQ=Kdt;sy.hasAnchor=NZs;sy.isAlias=xZs;sy.isCollection=Tni;sy.isDocument=wZs;sy.isMap=RZs;sy.isNode=DZs;sy.isPair=kZs;sy.isScalar=Sni;sy.isSeq=PZs});var zNe=I(Bhr=>{"use strict";p();var b0=Xa(),Lb=Symbol("break visit"),Ini=Symbol("skip children"),E4=Symbol("remove node");function Jdt(t,e){let r=xni(e);b0.isDocument(t)?Ome(null,t.contents,r,Object.freeze([t]))===E4&&(t.contents=null):Ome(null,t,r,Object.freeze([]))}a(Jdt,"visit");Jdt.BREAK=Lb;Jdt.SKIP=Ini;Jdt.REMOVE=E4;function Ome(t,e,r,n){let o=wni(t,e,r,n);if(b0.isNode(o)||b0.isPair(o))return Rni(t,n,o),Ome(t,o,r,n);if(typeof o!="symbol"){if(b0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var kni=Xa(),MZs=zNe(),OZs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},LZs=a(t=>t.replace(/[!,[\]{}]/g,e=>OZs[e]),"escapeTagName"),YNe=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+LZs(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&&kni.isNode(e.contents)){let s={};MZs.visit(e.contents,(c,l)=>{kni.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(` +`)}};YNe.defaultYaml={explicit:!1,version:"1.2"};YNe.defaultTags={"!!":"tag:yaml.org,2002:"};Pni.Directives=YNe});var Xdt=I(KNe=>{"use strict";p();var Dni=Xa(),BZs=zNe();function FZs(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(FZs,"anchorIsValid");function Nni(t){let e=new Set;return BZs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(Nni,"anchorNames");function Mni(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(Mni,"findNewAnchor");function UZs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=Nni(t));let c=Mni(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&&(Dni.isScalar(c.node)||Dni.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(UZs,"createNodeAnchors");KNe.anchorIsValid=FZs;KNe.anchorNames=Nni;KNe.createNodeAnchors=UZs;KNe.findNewAnchor=Mni});var Uhr=I(Oni=>{"use strict";p();function JNe(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 QZs=Xa();function Lni(t,e,r){if(Array.isArray(t))return t.map((n,o)=>Lni(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!QZs.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(Lni,"toJS");Bni.toJS=Lni});var eft=I(Uni=>{"use strict";p();var qZs=Uhr(),Fni=Xa(),jZs=$H(),Qhr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,Fni.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(!Fni.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=jZs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?qZs.applyReviver(s,{"":l},"",l):l}};Uni.NodeBase=Qhr});var ZNe=I(Qni=>{"use strict";p();var HZs=Xdt(),GZs=zNe(),Bme=Xa(),$Zs=eft(),VZs=$H(),qhr=class extends $Zs.NodeBase{static{a(this,"Alias")}constructor(e){super(Bme.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=[],GZs.visit(e,{Node:a((s,c)=>{(Bme.isAlias(c)||Bme.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||(VZs.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=tft(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(HZs.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 tft(t,e,r){if(Bme.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Bme.isCollection(e)){let n=0;for(let o of e.items){let s=tft(t,o,r);s>n&&(n=s)}return n}else if(Bme.isPair(e)){let n=tft(t,e.key,r),o=tft(t,e.value,r);return Math.max(n,o)}return 1}a(tft,"getAliasCount");Qni.Alias=qhr});var Am=I(jhr=>{"use strict";p();var WZs=Xa(),zZs=eft(),YZs=$H(),KZs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),VH=class extends zZs.NodeBase{static{a(this,"Scalar")}constructor(e){super(WZs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:YZs.toJS(this.value,e,r)}toString(){return String(this.value)}};VH.BLOCK_FOLDED="BLOCK_FOLDED";VH.BLOCK_LITERAL="BLOCK_LITERAL";VH.PLAIN="PLAIN";VH.QUOTE_DOUBLE="QUOTE_DOUBLE";VH.QUOTE_SINGLE="QUOTE_SINGLE";jhr.Scalar=VH;jhr.isScalarValue=KZs});var XNe=I(jni=>{"use strict";p();var JZs=ZNe(),gee=Xa(),qni=Am(),ZZs="tag:yaml.org,2002:";function XZs(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(XZs,"findTagObject");function eXs(t,e,r){if(gee.isDocument(t)&&(t=t.contents),gee.isNode(t))return t;if(gee.isPair(t)){let h=r.schema[gee.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 JZs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=ZZs+e.slice(2));let d=XZs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new qni.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[gee.MAP]:Symbol.iterator in Object(t)?c[gee.SEQ]:c[gee.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 qni.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(eXs,"createNode");jni.createNode=eXs});var nft=I(rft=>{"use strict";p();var tXs=XNe(),_4=Xa(),rXs=eft();function Hhr(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 tXs.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(Hhr,"collectionFromPath");var Hni=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Ghr=class extends rXs.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=>_4.isNode(n)||_4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Hni(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(_4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Hhr(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(_4.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&&_4.isScalar(s)?s.value:s:_4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!_4.isPair(r))return!1;let n=r.value;return n==null||e&&_4.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 _4.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(_4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Hhr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};rft.Collection=Ghr;rft.collectionFromPath=Hhr;rft.isEmptyPath=Hni});var eMe=I(ift=>{"use strict";p();var nXs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function $hr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a($hr,"indentComment");var iXs=a((t,e,r)=>t.endsWith(` +`)?$hr(r,e):r.includes(` `)?` -`+qhr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");eft.indentComment=qhr;eft.lineComment=jZs;eft.stringifyComment=qZs});var Bni=I(KNe=>{"use strict";p();var HZs="flow",jhr="block",tft="quoted";function GZs(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===jhr&&(y=Lni(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===tft&&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===jhr&&(y=Lni(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` +`+$hr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");ift.indentComment=$hr;ift.lineComment=iXs;ift.stringifyComment=nXs});var $ni=I(tMe=>{"use strict";p();var oXs="flow",Vhr="block",oft="quoted";function sXs(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===Vhr&&(y=Gni(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===oft&&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===Vhr&&(y=Gni(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===tft){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 J2=mm(),HH=Bni(),nft=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),ift=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function $Zs(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($Zs,"lineLengthOverLimit");function JNe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(ift(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===oft){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 eD=Am(),WH=$ni(),aft=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),cft=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function aXs(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(aXs,"lineLengthOverLimit");function rMe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(cft(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(Ghr,`$&${d}`));let y=!1,E,_=-1;for(E=0;E{R=!0});let P=HH.foldFlowLines(`${v}${w}${g}`,d,HH.FOLD_BLOCK,x);if(!R)return`>${T} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),R=!1,x=aft(n,!0);c!=="folded"&&e!==eD.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let P=WH.foldFlowLines(`${v}${w}${g}`,d,WH.FOLD_BLOCK,x);if(!R)return`>${T} ${d}${P}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(rft,"blockString");function VZs(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 Lme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?Lme(s,e):rft(t,e,r,n);if(!l&&!f&&o!==J2.Scalar.PLAIN&&s.includes(` -`))return rft(t,e,r,n);if(ift(s)){if(u==="")return e.forceBlockIndent=!0,rft(t,e,r,n);if(l&&u===d)return Lme(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 Lme(s,e)}return l?h:HH.foldFlowLines(h,u,HH.FOLD_FLOW,nft(e,!1))}a(VZs,"plainString");function WZs(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!==J2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=J2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case J2.Scalar.BLOCK_FOLDED:case J2.Scalar.BLOCK_LITERAL:return o||s?Lme(c.value,e):rft(c,e,r,n);case J2.Scalar.QUOTE_DOUBLE:return JNe(c.value,e);case J2.Scalar.QUOTE_SINGLE:return Hhr(c.value,e);case J2.Scalar.PLAIN:return VZs(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(WZs,"stringifyString");Fni.stringifyString=WZs});var XNe=I($hr=>{"use strict";p();var zZs=Ydt(),GH=Za(),YZs=YNe(),KZs=ZNe();function JZs(t,e){let r=Object.assign({blockQuote:!0,commentString:YZs.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(JZs,"createStringifyContext");function ZZs(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(GH.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(ZZs,"getTagObject");function XZs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(GH.isScalar(t)||GH.isCollection(t))&&t.anchor;s&&zZs.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(XZs,"stringifyProps");function eXs(t,e,r,n){if(GH.isPair(t))return t.toString(e,r,n);if(GH.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=GH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=ZZs(e.doc.schema.tags,s));let c=XZs(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):GH.isScalar(s)?KZs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?GH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(eXs,"stringify");$hr.createStringifyContext=JZs;$hr.stringify=eXs});var jni=I(qni=>{"use strict";p();var w8=Za(),Uni=mm(),Qni=XNe(),eMe=YNe();function tXs({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=w8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(w8.isCollection(t)||!w8.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||w8.isCollection(t)||(w8.isScalar(t)?t.type===Uni.Scalar.BLOCK_FOLDED||t.type===Uni.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=Qni.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+=eMe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=eMe.lineComment(E,r.indent,d(m))),E=`? ${E} -${l}:`):(E=`${E}:`,m&&(E+=eMe.lineComment(E,r.indent,d(m))));let _,v,b;w8.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&&w8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&w8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=Qni.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` +${d}${v}${r}${g}`}a(sft,"blockString");function cXs(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 Fme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` +`)?Fme(s,e):sft(t,e,r,n);if(!l&&!f&&o!==eD.Scalar.PLAIN&&s.includes(` +`))return sft(t,e,r,n);if(cft(s)){if(u==="")return e.forceBlockIndent=!0,sft(t,e,r,n);if(l&&u===d)return Fme(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 Fme(s,e)}return l?h:WH.foldFlowLines(h,u,WH.FOLD_FLOW,aft(e,!1))}a(cXs,"plainString");function lXs(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!==eD.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=eD.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case eD.Scalar.BLOCK_FOLDED:case eD.Scalar.BLOCK_LITERAL:return o||s?Fme(c.value,e):sft(c,e,r,n);case eD.Scalar.QUOTE_DOUBLE:return rMe(c.value,e);case eD.Scalar.QUOTE_SINGLE:return Whr(c.value,e);case eD.Scalar.PLAIN:return cXs(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(lXs,"stringifyString");Vni.stringifyString=lXs});var iMe=I(Yhr=>{"use strict";p();var uXs=Xdt(),zH=Xa(),dXs=eMe(),fXs=nMe();function pXs(t,e){let r=Object.assign({blockQuote:!0,commentString:dXs.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(pXs,"createStringifyContext");function hXs(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(zH.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(hXs,"getTagObject");function mXs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(zH.isScalar(t)||zH.isCollection(t))&&t.anchor;s&&uXs.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(mXs,"stringifyProps");function gXs(t,e,r,n){if(zH.isPair(t))return t.toString(e,r,n);if(zH.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=zH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=hXs(e.doc.schema.tags,s));let c=mXs(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):zH.isScalar(s)?fXs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?zH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} +${e.indent}${l}`:l}a(gXs,"stringify");Yhr.createStringifyContext=pXs;Yhr.stringify=gXs});var Kni=I(Yni=>{"use strict";p();var k8=Xa(),Wni=Am(),zni=iMe(),oMe=eMe();function AXs({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=k8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(k8.isCollection(t)||!k8.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||k8.isCollection(t)||(k8.isScalar(t)?t.type===Wni.Scalar.BLOCK_FOLDED||t.type===Wni.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=zni.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+=oMe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=oMe.lineComment(E,r.indent,d(m))),E=`? ${E} +${l}:`):(E=`${E}:`,m&&(E+=oMe.lineComment(E,r.indent,d(m))));let _,v,b;k8.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&&k8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&k8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=zni.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` `:"",v){let x=d(v);R+=` -${eMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` +${oMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&b&&(R=` `):R+=` -${r.indent}`}else if(!g&&w8.isCollection(e)){let x=w[0],P=w.indexOf(` +${r.indent}`}else if(!g&&k8.isCollection(e)){let x=w[0],P=w.indexOf(` `),D=P!==-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 Hni=require("process");function rXs(t,...e){t==="debug"&&console.log(...e)}a(rXs,"debug");function nXs(t,e){(t==="debug"||t==="warn")&&(typeof Hni.emitWarning=="function"?Hni.emitWarning(e):console.warn(e))}a(nXs,"warn");Vhr.debug=rXs;Vhr.warn=nXs});var cft=I(aft=>{"use strict";p();var tMe=Za(),Gni=mm(),oft="<<",sft={identify:a(t=>t===oft||typeof t=="symbol"&&t.description===oft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new Gni.Scalar(Symbol(oft)),{addToJSMap:$ni}),"resolve"),stringify:a(()=>oft,"stringify")},iXs=a((t,e)=>(sft.identify(e)||tMe.isScalar(e)&&(!e.type||e.type===Gni.Scalar.PLAIN)&&sft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===sft.tag&&r.default),"isMergeKey");function $ni(t,e,r){if(r=t&&tMe.isAlias(r)?r.resolve(t.doc):r,tMe.isSeq(r))for(let n of r.items)zhr(t,e,n);else if(Array.isArray(r))for(let n of r)zhr(t,e,n);else zhr(t,e,r)}a($ni,"addMergeToJSMap");function zhr(t,e,r){let n=t&&tMe.isAlias(r)?r.resolve(t.doc):r;if(!tMe.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(zhr,"mergeValue");aft.addMergeToJSMap=$ni;aft.isMergeKey=iXs;aft.merge=sft});var Khr=I(zni=>{"use strict";p();var oXs=Whr(),Vni=cft(),sXs=XNe(),Wni=Za(),Yhr=qH();function aXs(t,e,{key:r,value:n}){if(Wni.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Vni.isMergeKey(t,r))Vni.addMergeToJSMap(t,e,n);else{let o=Yhr.toJS(r,"",t);if(e instanceof Map)e.set(o,Yhr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=cXs(r,o,t),c=Yhr.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(aXs,"addPairToJSMap");function cXs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Wni.isNode(t)&&r?.doc){let n=sXs.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)+'..."'),oXs.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(cXs,"stringifyKey");zni.addPairToJSMap=aXs});var $H=I(Jhr=>{"use strict";p();var Yni=zNe(),lXs=jni(),uXs=Khr(),lft=Za();function dXs(t,e,r){let n=Yni.createNode(t,void 0,r),o=Yni.createNode(e,void 0,r);return new uft(n,o)}a(dXs,"createPair");var uft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,lft.NODE_TYPE,{value:lft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return lft.isNode(r)&&(r=r.clone(e)),lft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return uXs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?lXs.stringifyPair(this,e,r,n):JSON.stringify(this)}};Jhr.Pair=uft;Jhr.createPair=dXs});var Zhr=I(Jni=>{"use strict";p();var gee=Za(),Kni=XNe(),dft=YNe();function fXs(t,e,r){return(e.inFlow??t.flow?hXs:pXs)(t,e,r)}a(fXs,"stringifyCollection");function pXs({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&&(_+=dft.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 Jni=require("process");function yXs(t,...e){t==="debug"&&console.log(...e)}a(yXs,"debug");function EXs(t,e){(t==="debug"||t==="warn")&&(typeof Jni.emitWarning=="function"?Jni.emitWarning(e):console.warn(e))}a(EXs,"warn");Khr.debug=yXs;Khr.warn=EXs});var fft=I(dft=>{"use strict";p();var sMe=Xa(),Zni=Am(),lft="<<",uft={identify:a(t=>t===lft||typeof t=="symbol"&&t.description===lft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new Zni.Scalar(Symbol(lft)),{addToJSMap:Xni}),"resolve"),stringify:a(()=>lft,"stringify")},_Xs=a((t,e)=>(uft.identify(e)||sMe.isScalar(e)&&(!e.type||e.type===Zni.Scalar.PLAIN)&&uft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===uft.tag&&r.default),"isMergeKey");function Xni(t,e,r){if(r=t&&sMe.isAlias(r)?r.resolve(t.doc):r,sMe.isSeq(r))for(let n of r.items)Zhr(t,e,n);else if(Array.isArray(r))for(let n of r)Zhr(t,e,n);else Zhr(t,e,r)}a(Xni,"addMergeToJSMap");function Zhr(t,e,r){let n=t&&sMe.isAlias(r)?r.resolve(t.doc):r;if(!sMe.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(Zhr,"mergeValue");dft.addMergeToJSMap=Xni;dft.isMergeKey=_Xs;dft.merge=uft});var emr=I(rii=>{"use strict";p();var vXs=Jhr(),eii=fft(),CXs=iMe(),tii=Xa(),Xhr=$H();function bXs(t,e,{key:r,value:n}){if(tii.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(eii.isMergeKey(t,r))eii.addMergeToJSMap(t,e,n);else{let o=Xhr.toJS(r,"",t);if(e instanceof Map)e.set(o,Xhr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=SXs(r,o,t),c=Xhr.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(bXs,"addPairToJSMap");function SXs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(tii.isNode(t)&&r?.doc){let n=CXs.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)+'..."'),vXs.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(SXs,"stringifyKey");rii.addPairToJSMap=bXs});var YH=I(tmr=>{"use strict";p();var nii=XNe(),TXs=Kni(),IXs=emr(),pft=Xa();function xXs(t,e,r){let n=nii.createNode(t,void 0,r),o=nii.createNode(e,void 0,r);return new hft(n,o)}a(xXs,"createPair");var hft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,pft.NODE_TYPE,{value:pft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return pft.isNode(r)&&(r=r.clone(e)),pft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return IXs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?TXs.stringifyPair(this,e,r,n):JSON.stringify(this)}};tmr.Pair=hft;tmr.createPair=xXs});var rmr=I(oii=>{"use strict";p();var Aee=Xa(),iii=iMe(),mft=eMe();function wXs(t,e,r){return(e.inFlow??t.flow?kXs:RXs)(t,e,r)}a(wXs,"stringifyCollection");function RXs({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&&(_+=mft.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&&(_+=dft.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?` +`+mft.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(RXs,"stringifyBlockCollection");function kXs({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&&(_+=mft.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(hXs,"stringifyFlowCollection");function fft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=dft.indentComment(e(n),t);r.push(s.trimStart())}}a(fft,"addCommentBefore");Jni.stringifyCollection=fXs});var WH=I(emr=>{"use strict";p();var mXs=Zhr(),gXs=Khr(),AXs=Xdt(),VH=Za(),pft=$H(),yXs=mm();function rMe(t,e){let r=VH.isScalar(e)?e.value:e;for(let n of t)if(VH.isPair(n)&&(n.key===e||n.key===r||VH.isScalar(n.key)&&n.key.value===r))return n}a(rMe,"findPair");var Xhr=class extends AXs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(VH.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(pft.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;VH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new pft.Pair(e,e?.value):n=new pft.Pair(e.key,e.value);let o=rMe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);VH.isScalar(o.value)&&yXs.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=rMe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=rMe(this.items,e)?.value;return(!r&&VH.isScalar(o)?o.value:o)??void 0}has(e){return!!rMe(this.items,e)}set(e,r){this.add(new pft.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)gXs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!VH.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})),mXs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};emr.YAMLMap=Xhr;emr.findPair=rMe});var Bme=I(Xni=>{"use strict";p();var EXs=Za(),Zni=WH(),_Xs={collection:"map",default:!0,nodeClass:Zni.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return EXs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>Zni.YAMLMap.from(t,e,r),"createNode")};Xni.map=_Xs});var zH=I(eii=>{"use strict";p();var vXs=zNe(),CXs=Zhr(),bXs=Xdt(),mft=Za(),SXs=mm(),TXs=qH(),tmr=class extends bXs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(mft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=hft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=hft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&mft.isScalar(o)?o.value:o}has(e){let r=hft(e);return typeof r=="number"&&r=0?e:null}a(hft,"asItemIndex");eii.YAMLSeq=tmr});var Fme=I(rii=>{"use strict";p();var IXs=Za(),tii=zH(),xXs={collection:"seq",default:!0,nodeClass:tii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return IXs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>tii.YAMLSeq.from(t,e,r),"createNode")};rii.seq=xXs});var nMe=I(nii=>{"use strict";p();var wXs=ZNe(),RXs={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),wXs.stringifyString(t,e,r,n)}};nii.string=RXs});var gft=I(sii=>{"use strict";p();var iii=mm(),oii={identify:a(t=>t==null,"identify"),createNode:a(()=>new iii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new iii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&oii.test.test(t)?t:e.options.nullStr,"stringify")};sii.nullTag=oii});var rmr=I(cii=>{"use strict";p();var kXs=mm(),aii={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 kXs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&aii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};cii.boolTag=aii});var Ume=I(lii=>{"use strict";p();function PXs({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(PXs,"stringifyNumber");lii.stringifyNumber=PXs});var imr=I(Aft=>{"use strict";p();var DXs=mm(),nmr=Ume(),NXs={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:nmr.stringifyNumber},MXs={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():nmr.stringifyNumber(t)}},OXs={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 DXs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:nmr.stringifyNumber};Aft.float=OXs;Aft.floatExp=MXs;Aft.floatNaN=NXs});var smr=I(Eft=>{"use strict";p();var uii=Ume(),yft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),omr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function dii(t,e,r){let{value:n}=t;return yft(n)&&n>=0?r+n.toString(e):uii.stringifyNumber(t)}a(dii,"intStringify");var LXs={identify:a(t=>yft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>omr(t,2,8,r),"resolve"),stringify:a(t=>dii(t,8,"0o"),"stringify")},BXs={identify:yft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>omr(t,0,10,r),"resolve"),stringify:uii.stringifyNumber},FXs={identify:a(t=>yft(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)=>omr(t,2,16,r),"resolve"),stringify:a(t=>dii(t,16,"0x"),"stringify")};Eft.int=BXs;Eft.intHex=FXs;Eft.intOct=LXs});var pii=I(fii=>{"use strict";p();var UXs=Bme(),QXs=gft(),qXs=Fme(),jXs=nMe(),HXs=rmr(),amr=imr(),cmr=smr(),GXs=[UXs.map,qXs.seq,jXs.string,QXs.nullTag,HXs.boolTag,cmr.intOct,cmr.int,cmr.intHex,amr.floatNaN,amr.floatExp,amr.float];fii.schema=GXs});var gii=I(mii=>{"use strict";p();var $Xs=mm(),VXs=Bme(),WXs=Fme();function hii(t){return typeof t=="bigint"||Number.isInteger(t)}a(hii,"intIdentify");var _ft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),zXs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:_ft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new $Xs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:_ft},{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:_ft},{identify:hii,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})=>hii(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:_ft}],YXs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},KXs=[VXs.map,WXs.seq].concat(zXs,YXs);mii.schema=KXs});var umr=I(Aii=>{"use strict";p();var iMe=require("buffer"),lmr=mm(),JXs=ZNe(),ZXs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof iMe.Buffer=="function")return iMe.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 vft=Za(),dmr=$H(),XXs=mm(),eea=zH();function yii(t,e){if(vft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new dmr.Pair(new XXs.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(kXs,"stringifyFlowCollection");function gft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=mft.indentComment(e(n),t);r.push(s.trimStart())}}a(gft,"addCommentBefore");oii.stringifyCollection=wXs});var JH=I(imr=>{"use strict";p();var PXs=rmr(),DXs=emr(),NXs=nft(),KH=Xa(),Aft=YH(),MXs=Am();function aMe(t,e){let r=KH.isScalar(e)?e.value:e;for(let n of t)if(KH.isPair(n)&&(n.key===e||n.key===r||KH.isScalar(n.key)&&n.key.value===r))return n}a(aMe,"findPair");var nmr=class extends NXs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(KH.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(Aft.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;KH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Aft.Pair(e,e?.value):n=new Aft.Pair(e.key,e.value);let o=aMe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);KH.isScalar(o.value)&&MXs.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=aMe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=aMe(this.items,e)?.value;return(!r&&KH.isScalar(o)?o.value:o)??void 0}has(e){return!!aMe(this.items,e)}set(e,r){this.add(new Aft.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)DXs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!KH.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})),PXs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};imr.YAMLMap=nmr;imr.findPair=aMe});var Ume=I(aii=>{"use strict";p();var OXs=Xa(),sii=JH(),LXs={collection:"map",default:!0,nodeClass:sii.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return OXs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>sii.YAMLMap.from(t,e,r),"createNode")};aii.map=LXs});var ZH=I(cii=>{"use strict";p();var BXs=XNe(),FXs=rmr(),UXs=nft(),Eft=Xa(),QXs=Am(),qXs=$H(),omr=class extends UXs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Eft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=yft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=yft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&Eft.isScalar(o)?o.value:o}has(e){let r=yft(e);return typeof r=="number"&&r=0?e:null}a(yft,"asItemIndex");cii.YAMLSeq=omr});var Qme=I(uii=>{"use strict";p();var jXs=Xa(),lii=ZH(),HXs={collection:"seq",default:!0,nodeClass:lii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return jXs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>lii.YAMLSeq.from(t,e,r),"createNode")};uii.seq=HXs});var cMe=I(dii=>{"use strict";p();var GXs=nMe(),$Xs={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),GXs.stringifyString(t,e,r,n)}};dii.string=$Xs});var _ft=I(hii=>{"use strict";p();var fii=Am(),pii={identify:a(t=>t==null,"identify"),createNode:a(()=>new fii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new fii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&pii.test.test(t)?t:e.options.nullStr,"stringify")};hii.nullTag=pii});var smr=I(gii=>{"use strict";p();var VXs=Am(),mii={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 VXs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&mii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};gii.boolTag=mii});var qme=I(Aii=>{"use strict";p();function WXs({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(WXs,"stringifyNumber");Aii.stringifyNumber=WXs});var cmr=I(vft=>{"use strict";p();var zXs=Am(),amr=qme(),YXs={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:amr.stringifyNumber},KXs={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():amr.stringifyNumber(t)}},JXs={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 zXs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:amr.stringifyNumber};vft.float=JXs;vft.floatExp=KXs;vft.floatNaN=YXs});var umr=I(bft=>{"use strict";p();var yii=qme(),Cft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),lmr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function Eii(t,e,r){let{value:n}=t;return Cft(n)&&n>=0?r+n.toString(e):yii.stringifyNumber(t)}a(Eii,"intStringify");var ZXs={identify:a(t=>Cft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>lmr(t,2,8,r),"resolve"),stringify:a(t=>Eii(t,8,"0o"),"stringify")},XXs={identify:Cft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>lmr(t,0,10,r),"resolve"),stringify:yii.stringifyNumber},eea={identify:a(t=>Cft(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)=>lmr(t,2,16,r),"resolve"),stringify:a(t=>Eii(t,16,"0x"),"stringify")};bft.int=XXs;bft.intHex=eea;bft.intOct=ZXs});var vii=I(_ii=>{"use strict";p();var tea=Ume(),rea=_ft(),nea=Qme(),iea=cMe(),oea=smr(),dmr=cmr(),fmr=umr(),sea=[tea.map,nea.seq,iea.string,rea.nullTag,oea.boolTag,fmr.intOct,fmr.int,fmr.intHex,dmr.floatNaN,dmr.floatExp,dmr.float];_ii.schema=sea});var Sii=I(bii=>{"use strict";p();var aea=Am(),cea=Ume(),lea=Qme();function Cii(t){return typeof t=="bigint"||Number.isInteger(t)}a(Cii,"intIdentify");var Sft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),uea=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:Sft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new aea.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:Sft},{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:Sft},{identify:Cii,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})=>Cii(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:Sft}],dea={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},fea=[cea.map,lea.seq].concat(uea,dea);bii.schema=fea});var hmr=I(Tii=>{"use strict";p();var lMe=require("buffer"),pmr=Am(),pea=nMe(),hea={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof lMe.Buffer=="function")return lMe.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 Tft=Xa(),mmr=YH(),mea=Am(),gea=ZH();function Iii(t,e){if(Tft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new mmr.Pair(new mea.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]=vft.isPair(n)?n:new dmr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(yii,"resolvePairs");function Eii(t,e,r){let{replacer:n}=r,o=new eea.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(dmr.createPair(l,u,r))}return o}a(Eii,"createPairs");var tea={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:yii,createNode:Eii};Cft.createPairs=Eii;Cft.pairs=tea;Cft.resolvePairs=yii});var hmr=I(pmr=>{"use strict";p();var _ii=Za(),fmr=qH(),oMe=WH(),rea=zH(),vii=bft(),Aee=class t extends rea.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=oMe.YAMLMap.prototype.add.bind(this),this.delete=oMe.YAMLMap.prototype.delete.bind(this),this.get=oMe.YAMLMap.prototype.get.bind(this),this.has=oMe.YAMLMap.prototype.has.bind(this),this.set=oMe.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(_ii.isPair(o)?(s=fmr.toJS(o.key,"",r),c=fmr.toJS(o.value,s,r)):s=fmr.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=vii.createPairs(e,r,n),s=new this;return s.items=o.items,s}};Aee.tag="tag:yaml.org,2002:omap";var nea={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:Aee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=vii.resolvePairs(t,e),n=[];for(let{key:o}of r.items)_ii.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new Aee,r)},createNode:a((t,e,r)=>Aee.from(t,e,r),"createNode")};pmr.YAMLOMap=Aee;pmr.omap=nea});var Iii=I(mmr=>{"use strict";p();var Cii=mm();function bii({value:t,source:e},r){return e&&(t?Sii:Tii).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(bii,"boolStringify");var Sii={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 Cii.Scalar(!0),"resolve"),stringify:bii},Tii={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 Cii.Scalar(!1),"resolve"),stringify:bii};mmr.falseTag=Tii;mmr.trueTag=Sii});var xii=I(Sft=>{"use strict";p();var iea=mm(),gmr=Ume(),oea={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:gmr.stringifyNumber},sea={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():gmr.stringifyNumber(t)}},aea={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 iea.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:gmr.stringifyNumber};Sft.float=aea;Sft.floatExp=sea;Sft.floatNaN=oea});var Rii=I(aMe=>{"use strict";p();var wii=Ume(),sMe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Tft(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(Tft,"intResolve");function Amr(t,e,r){let{value:n}=t;if(sMe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return wii.stringifyNumber(t)}a(Amr,"intStringify");var cea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Tft(t,2,2,r),"resolve"),stringify:a(t=>Amr(t,2,"0b"),"stringify")},lea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Tft(t,1,8,r),"resolve"),stringify:a(t=>Amr(t,8,"0"),"stringify")},uea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Tft(t,0,10,r),"resolve"),stringify:wii.stringifyNumber},dea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Tft(t,2,16,r),"resolve"),stringify:a(t=>Amr(t,16,"0x"),"stringify")};aMe.int=uea;aMe.intBin=cea;aMe.intHex=dea;aMe.intOct=lea});var Emr=I(ymr=>{"use strict";p();var wft=Za(),Ift=$H(),xft=WH(),yee=class t extends xft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;wft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ift.Pair(e.key,null):r=new Ift.Pair(e,null),xft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=xft.findPair(this.items,e);return!r&&wft.isPair(n)?wft.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=xft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ift.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(Ift.createPair(c,null,n));return s}};yee.tag="tag:yaml.org,2002:set";var fea={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:yee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>yee.from(t,e,r),"createNode"),resolve(t,e){if(wft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new yee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ymr.YAMLSet=yee;ymr.set=fea});var vmr=I(Rft=>{"use strict";p();var pea=Ume();function _mr(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(_mr,"parseSexagesimal");function kii(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 pea.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(kii,"stringifySexagesimal");var hea={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})=>_mr(t,r),"resolve"),stringify:kii},mea={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=>_mr(t,!1),"resolve"),stringify:kii},Pii={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(Pii.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=_mr(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")};Rft.floatTime=mea;Rft.intTime=hea;Rft.timestamp=Pii});var Mii=I(Nii=>{"use strict";p();var gea=Bme(),Aea=gft(),yea=Fme(),Eea=nMe(),_ea=umr(),Dii=Iii(),Cmr=xii(),kft=Rii(),vea=cft(),Cea=hmr(),bea=bft(),Sea=Emr(),bmr=vmr(),Tea=[gea.map,yea.seq,Eea.string,Aea.nullTag,Dii.trueTag,Dii.falseTag,kft.intBin,kft.intOct,kft.int,kft.intHex,Cmr.floatNaN,Cmr.floatExp,Cmr.float,_ea.binary,vea.merge,Cea.omap,bea.pairs,Sea.set,bmr.intTime,bmr.floatTime,bmr.timestamp];Nii.schema=Tea});var Gii=I(Imr=>{"use strict";p();var Fii=Bme(),Iea=gft(),Uii=Fme(),xea=nMe(),wea=rmr(),Smr=imr(),Tmr=smr(),Rea=pii(),kea=gii(),Qii=umr(),cMe=cft(),qii=hmr(),jii=bft(),Oii=Mii(),Hii=Emr(),Pft=vmr(),Lii=new Map([["core",Rea.schema],["failsafe",[Fii.map,Uii.seq,xea.string]],["json",kea.schema],["yaml11",Oii.schema],["yaml-1.1",Oii.schema]]),Bii={binary:Qii.binary,bool:wea.boolTag,float:Smr.float,floatExp:Smr.floatExp,floatNaN:Smr.floatNaN,floatTime:Pft.floatTime,int:Tmr.int,intHex:Tmr.intHex,intOct:Tmr.intOct,intTime:Pft.intTime,map:Fii.map,merge:cMe.merge,null:Iea.nullTag,omap:qii.omap,pairs:jii.pairs,seq:Uii.seq,set:Hii.set,timestamp:Pft.timestamp},Pea={"tag:yaml.org,2002:binary":Qii.binary,"tag:yaml.org,2002:merge":cMe.merge,"tag:yaml.org,2002:omap":qii.omap,"tag:yaml.org,2002:pairs":jii.pairs,"tag:yaml.org,2002:set":Hii.set,"tag:yaml.org,2002:timestamp":Pft.timestamp};function Dea(t,e,r){let n=Lii.get(e);if(n&&!t)return r&&!n.includes(cMe.merge)?n.concat(cMe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Lii.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(cMe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?Bii[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(Bii).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(Dea,"getTags");Imr.coreKnownTags=Pea;Imr.getTags=Dea});var Rmr=I($ii=>{"use strict";p();var xmr=Za(),Nea=Bme(),Mea=Fme(),Oea=nMe(),Dft=Gii(),Lea=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),wmr=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)?Dft.getTags(e,"compat"):e?Dft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Dft.coreKnownTags:{},this.tags=Dft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,xmr.MAP,{value:Nea.map}),Object.defineProperty(this,xmr.SCALAR,{value:Oea.string}),Object.defineProperty(this,xmr.SEQ,{value:Mea.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Lea:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$ii.Schema=wmr});var Wii=I(Vii=>{"use strict";p();var Bea=Za(),kmr=XNe(),lMe=YNe();function Fea(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=kmr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(lMe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Bea.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(lMe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=kmr.stringify(t.contents,o,()=>l=null,u);l&&(d+=lMe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(kmr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` -`)?(r.push("..."),r.push(lMe.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(lMe.indentComment(s(u),"")))}return r.join(` +${s.comment}`:n.comment}n=o}t.items[r]=Tft.isPair(n)?n:new mmr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(Iii,"resolvePairs");function xii(t,e,r){let{replacer:n}=r,o=new gea.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(mmr.createPair(l,u,r))}return o}a(xii,"createPairs");var Aea={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Iii,createNode:xii};Ift.createPairs=xii;Ift.pairs=Aea;Ift.resolvePairs=Iii});var ymr=I(Amr=>{"use strict";p();var wii=Xa(),gmr=$H(),uMe=JH(),yea=ZH(),Rii=xft(),yee=class t extends yea.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=uMe.YAMLMap.prototype.add.bind(this),this.delete=uMe.YAMLMap.prototype.delete.bind(this),this.get=uMe.YAMLMap.prototype.get.bind(this),this.has=uMe.YAMLMap.prototype.has.bind(this),this.set=uMe.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(wii.isPair(o)?(s=gmr.toJS(o.key,"",r),c=gmr.toJS(o.value,s,r)):s=gmr.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=Rii.createPairs(e,r,n),s=new this;return s.items=o.items,s}};yee.tag="tag:yaml.org,2002:omap";var Eea={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:yee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Rii.resolvePairs(t,e),n=[];for(let{key:o}of r.items)wii.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new yee,r)},createNode:a((t,e,r)=>yee.from(t,e,r),"createNode")};Amr.YAMLOMap=yee;Amr.omap=Eea});var Mii=I(Emr=>{"use strict";p();var kii=Am();function Pii({value:t,source:e},r){return e&&(t?Dii:Nii).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(Pii,"boolStringify");var Dii={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 kii.Scalar(!0),"resolve"),stringify:Pii},Nii={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 kii.Scalar(!1),"resolve"),stringify:Pii};Emr.falseTag=Nii;Emr.trueTag=Dii});var Oii=I(wft=>{"use strict";p();var _ea=Am(),_mr=qme(),vea={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:_mr.stringifyNumber},Cea={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():_mr.stringifyNumber(t)}},bea={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 _ea.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:_mr.stringifyNumber};wft.float=bea;wft.floatExp=Cea;wft.floatNaN=vea});var Bii=I(fMe=>{"use strict";p();var Lii=qme(),dMe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Rft(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(Rft,"intResolve");function vmr(t,e,r){let{value:n}=t;if(dMe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return Lii.stringifyNumber(t)}a(vmr,"intStringify");var Sea={identify:dMe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Rft(t,2,2,r),"resolve"),stringify:a(t=>vmr(t,2,"0b"),"stringify")},Tea={identify:dMe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Rft(t,1,8,r),"resolve"),stringify:a(t=>vmr(t,8,"0"),"stringify")},Iea={identify:dMe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Rft(t,0,10,r),"resolve"),stringify:Lii.stringifyNumber},xea={identify:dMe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Rft(t,2,16,r),"resolve"),stringify:a(t=>vmr(t,16,"0x"),"stringify")};fMe.int=Iea;fMe.intBin=Sea;fMe.intHex=xea;fMe.intOct=Tea});var bmr=I(Cmr=>{"use strict";p();var Dft=Xa(),kft=YH(),Pft=JH(),Eee=class t extends Pft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Dft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new kft.Pair(e.key,null):r=new kft.Pair(e,null),Pft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Pft.findPair(this.items,e);return!r&&Dft.isPair(n)?Dft.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=Pft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new kft.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(kft.createPair(c,null,n));return s}};Eee.tag="tag:yaml.org,2002:set";var wea={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:Eee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>Eee.from(t,e,r),"createNode"),resolve(t,e){if(Dft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Eee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Cmr.YAMLSet=Eee;Cmr.set=wea});var Tmr=I(Nft=>{"use strict";p();var Rea=qme();function Smr(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(Smr,"parseSexagesimal");function Fii(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 Rea.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(Fii,"stringifySexagesimal");var kea={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})=>Smr(t,r),"resolve"),stringify:Fii},Pea={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=>Smr(t,!1),"resolve"),stringify:Fii},Uii={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(Uii.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=Smr(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")};Nft.floatTime=Pea;Nft.intTime=kea;Nft.timestamp=Uii});var jii=I(qii=>{"use strict";p();var Dea=Ume(),Nea=_ft(),Mea=Qme(),Oea=cMe(),Lea=hmr(),Qii=Mii(),Imr=Oii(),Mft=Bii(),Bea=fft(),Fea=ymr(),Uea=xft(),Qea=bmr(),xmr=Tmr(),qea=[Dea.map,Mea.seq,Oea.string,Nea.nullTag,Qii.trueTag,Qii.falseTag,Mft.intBin,Mft.intOct,Mft.int,Mft.intHex,Imr.floatNaN,Imr.floatExp,Imr.float,Lea.binary,Bea.merge,Fea.omap,Uea.pairs,Qea.set,xmr.intTime,xmr.floatTime,xmr.timestamp];qii.schema=qea});var Zii=I(kmr=>{"use strict";p();var Vii=Ume(),jea=_ft(),Wii=Qme(),Hea=cMe(),Gea=smr(),wmr=cmr(),Rmr=umr(),$ea=vii(),Vea=Sii(),zii=hmr(),pMe=fft(),Yii=ymr(),Kii=xft(),Hii=jii(),Jii=bmr(),Oft=Tmr(),Gii=new Map([["core",$ea.schema],["failsafe",[Vii.map,Wii.seq,Hea.string]],["json",Vea.schema],["yaml11",Hii.schema],["yaml-1.1",Hii.schema]]),$ii={binary:zii.binary,bool:Gea.boolTag,float:wmr.float,floatExp:wmr.floatExp,floatNaN:wmr.floatNaN,floatTime:Oft.floatTime,int:Rmr.int,intHex:Rmr.intHex,intOct:Rmr.intOct,intTime:Oft.intTime,map:Vii.map,merge:pMe.merge,null:jea.nullTag,omap:Yii.omap,pairs:Kii.pairs,seq:Wii.seq,set:Jii.set,timestamp:Oft.timestamp},Wea={"tag:yaml.org,2002:binary":zii.binary,"tag:yaml.org,2002:merge":pMe.merge,"tag:yaml.org,2002:omap":Yii.omap,"tag:yaml.org,2002:pairs":Kii.pairs,"tag:yaml.org,2002:set":Jii.set,"tag:yaml.org,2002:timestamp":Oft.timestamp};function zea(t,e,r){let n=Gii.get(e);if(n&&!t)return r&&!n.includes(pMe.merge)?n.concat(pMe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Gii.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(pMe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?$ii[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys($ii).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(zea,"getTags");kmr.coreKnownTags=Wea;kmr.getTags=zea});var Nmr=I(Xii=>{"use strict";p();var Pmr=Xa(),Yea=Ume(),Kea=Qme(),Jea=cMe(),Lft=Zii(),Zea=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Dmr=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)?Lft.getTags(e,"compat"):e?Lft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Lft.coreKnownTags:{},this.tags=Lft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Pmr.MAP,{value:Yea.map}),Object.defineProperty(this,Pmr.SCALAR,{value:Jea.string}),Object.defineProperty(this,Pmr.SEQ,{value:Kea.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Zea:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Xii.Schema=Dmr});var toi=I(eoi=>{"use strict";p();var Xea=Xa(),Mmr=iMe(),hMe=eMe();function eta(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=Mmr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(hMe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Xea.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(hMe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Mmr.stringify(t.contents,o,()=>l=null,u);l&&(d+=hMe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Mmr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` +`)?(r.push("..."),r.push(hMe.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(hMe.indentComment(s(u),"")))}return r.join(` `)+` -`}a(Fea,"stringifyDocument");Vii.stringifyDocument=Fea});var uMe=I(zii=>{"use strict";p();var Uea=WNe(),Qme=Xdt(),lR=Za(),Qea=$H(),qea=qH(),jea=Rmr(),Hea=Wii(),Pmr=Ydt(),Gea=Ohr(),$ea=zNe(),Dmr=Mhr(),Nmr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,lR.NODE_TYPE,{value:lR.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 Dmr.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,{[lR.NODE_TYPE]:{value:lR.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=lR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){qme(this.contents)&&this.contents.add(e)}addIn(e,r){qme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Pmr.anchorNames(this);e.anchor=!r||n.has(r)?Pmr.findNewAnchor(r||"a",n):r}return new Uea.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}=Pmr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=$ea.createNode(e,f,A);return l&&lR.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 Qea.Pair(o,s)}delete(e){return qme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):qme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return lR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Qme.isEmptyPath(e)?!r&&lR.isScalar(this.contents)?this.contents.value:this.contents:lR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return lR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Qme.isEmptyPath(e)?this.contents!==void 0:lR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Qme.collectionFromPath(this.schema,[e],r):qme(this.contents)&&this.contents.set(e,r)}setIn(e,r){Qme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Qme.collectionFromPath(this.schema,Array.from(e),r):qme(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 Dmr.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 Dmr.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 jea.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=qea.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"?Gea.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 Hea.stringifyDocument(this,e)}};function qme(t){if(lR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(qme,"assertCollection");zii.Document=Nmr});var pMe=I(fMe=>{"use strict";p();var dMe=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}},Mmr=class extends dMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Omr=class extends dMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Vea=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(eta,"stringifyDocument");eoi.stringifyDocument=eta});var mMe=I(roi=>{"use strict";p();var tta=ZNe(),jme=nft(),dR=Xa(),rta=YH(),nta=$H(),ita=Nmr(),ota=toi(),Omr=Xdt(),sta=Uhr(),ata=XNe(),Lmr=Fhr(),Bmr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,dR.NODE_TYPE,{value:dR.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 Lmr.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,{[dR.NODE_TYPE]:{value:dR.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=dR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Hme(this.contents)&&this.contents.add(e)}addIn(e,r){Hme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Omr.anchorNames(this);e.anchor=!r||n.has(r)?Omr.findNewAnchor(r||"a",n):r}return new tta.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}=Omr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=ata.createNode(e,f,A);return l&&dR.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 rta.Pair(o,s)}delete(e){return Hme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return jme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Hme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return dR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return jme.isEmptyPath(e)?!r&&dR.isScalar(this.contents)?this.contents.value:this.contents:dR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return dR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return jme.isEmptyPath(e)?this.contents!==void 0:dR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=jme.collectionFromPath(this.schema,[e],r):Hme(this.contents)&&this.contents.set(e,r)}setIn(e,r){jme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=jme.collectionFromPath(this.schema,Array.from(e),r):Hme(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 Lmr.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 Lmr.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 ita.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=nta.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"?sta.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 ota.stringifyDocument(this,e)}};function Hme(t){if(dR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(Hme,"assertCollection");roi.Document=Bmr});var yMe=I(AMe=>{"use strict";p();var gMe=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}},Fmr=class extends gMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Umr=class extends gMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},cta=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");fMe.YAMLError=dMe;fMe.YAMLParseError=Mmr;fMe.YAMLWarning=Omr;fMe.prettifyError=Vea});var hMe=I(Yii=>{"use strict";p();function Wea(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(Wea,"resolveProps");Yii.resolveProps=Wea});var Nft=I(Kii=>{"use strict";p();function Lmr(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(Lmr(e.key)||Lmr(e.value))return!0}return!1;default:return!0}}a(Lmr,"containsNewline");Kii.containsNewline=Lmr});var Bmr=I(Jii=>{"use strict";p();var zea=Nft();function Yea(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&zea.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Yea,"flowIndentCheck");Jii.flowIndentCheck=Yea});var Fmr=I(Xii=>{"use strict";p();var Zii=Za();function Kea(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||Zii.isScalar(s)&&Zii.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Kea,"mapIncludes");Xii.mapIncludes=Kea});var ooi=I(ioi=>{"use strict";p();var eoi=$H(),Jea=WH(),toi=hMe(),Zea=Nft(),roi=Bmr(),Xea=Fmr(),noi="All mapping items must start at the same column";function eta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Jea.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=toi.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",noi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Zea.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",noi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&roi.flowIndentCheck(n.indent,m,o),r.atKey=!1,Xea.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=toi.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 tta=zH(),rta=hMe(),nta=Bmr();function ita({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??tta.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=rta.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&&nta.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(ita,"resolveBlockSeq");soi.resolveBlockSeq=ita});var jme=I(coi=>{"use strict";p();function ota(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(ota,"resolveEnd");coi.resolveEnd=ota});var foi=I(doi=>{"use strict";p();var sta=Za(),ata=$H(),loi=WH(),cta=zH(),lta=jme(),uoi=hMe(),uta=Nft(),dta=Fmr(),Umr="Block collections are not allowed within flow collections",Qmr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function fta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?loi.YAMLMap:cta.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=lta.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(fta,"resolveFlowCollection");doi.resolveFlowCollection=fta});var hoi=I(poi=>{"use strict";p();var pta=Za(),hta=mm(),mta=WH(),gta=zH(),Ata=ooi(),yta=aoi(),Eta=foi();function qmr(t,e,r,n,o,s){let c=r.type==="block-map"?Ata.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?yta.resolveBlockSeq(t,e,r,n,s):Eta.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(qmr,"resolveCollection");function _ta(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),qmr(t,e,r,o,c)}let d=qmr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=pta.isNode(f)?f:new hta.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(_ta,"composeCollection");poi.composeCollection=_ta});var Hmr=I(moi=>{"use strict";p();var jmr=mm();function vta(t,e,r){let n=e.offset,o=Cta(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?jmr.Scalar.BLOCK_FOLDED:jmr.Scalar.BLOCK_LITERAL,c=e.source?bta(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");AMe.YAMLError=gMe;AMe.YAMLParseError=Fmr;AMe.YAMLWarning=Umr;AMe.prettifyError=cta});var EMe=I(noi=>{"use strict";p();function lta(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(lta,"resolveProps");noi.resolveProps=lta});var Bft=I(ioi=>{"use strict";p();function Qmr(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(Qmr(e.key)||Qmr(e.value))return!0}return!1;default:return!0}}a(Qmr,"containsNewline");ioi.containsNewline=Qmr});var qmr=I(ooi=>{"use strict";p();var uta=Bft();function dta(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&uta.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(dta,"flowIndentCheck");ooi.flowIndentCheck=dta});var jmr=I(aoi=>{"use strict";p();var soi=Xa();function fta(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||soi.isScalar(s)&&soi.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(fta,"mapIncludes");aoi.mapIncludes=fta});var poi=I(foi=>{"use strict";p();var coi=YH(),pta=JH(),loi=EMe(),hta=Bft(),uoi=qmr(),mta=jmr(),doi="All mapping items must start at the same column";function gta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??pta.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=loi.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",doi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` +`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||hta.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",doi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&uoi.flowIndentCheck(n.indent,m,o),r.atKey=!1,mta.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=loi.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 Ata=ZH(),yta=EMe(),Eta=qmr();function _ta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Ata.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=yta.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&&Eta.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(_ta,"resolveBlockSeq");hoi.resolveBlockSeq=_ta});var Gme=I(goi=>{"use strict";p();function vta(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(vta,"resolveEnd");goi.resolveEnd=vta});var _oi=I(Eoi=>{"use strict";p();var Cta=Xa(),bta=YH(),Aoi=JH(),Sta=ZH(),Tta=Gme(),yoi=EMe(),Ita=Bft(),xta=jmr(),Hmr="Block collections are not allowed within flow collections",Gmr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function wta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Aoi.YAMLMap:Sta.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=Tta.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(wta,"resolveFlowCollection");Eoi.resolveFlowCollection=wta});var Coi=I(voi=>{"use strict";p();var Rta=Xa(),kta=Am(),Pta=JH(),Dta=ZH(),Nta=poi(),Mta=moi(),Ota=_oi();function $mr(t,e,r,n,o,s){let c=r.type==="block-map"?Nta.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?Mta.resolveBlockSeq(t,e,r,n,s):Ota.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($mr,"resolveCollection");function Lta(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),$mr(t,e,r,o,c)}let d=$mr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=Rta.isNode(f)?f:new kta.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(Lta,"composeCollection");voi.composeCollection=Lta});var Wmr=I(boi=>{"use strict";p();var Vmr=Am();function Bta(t,e,r){let n=e.offset,o=Fta(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?Vmr.Scalar.BLOCK_FOLDED:Vmr.Scalar.BLOCK_LITERAL,c=e.source?Uta(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=` @@ -417,84 +417,84 @@ ${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(vta,"resolveBlockScalar");function Cta({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 Gmr=mm(),Sta=jme();function Tta(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=Gmr.Scalar.PLAIN,u=Ita(s,d);break;case"single-quoted-scalar":l=Gmr.Scalar.QUOTE_SINGLE,u=xta(s,d);break;case"double-quoted-scalar":l=Gmr.Scalar.QUOTE_DOUBLE,u=wta(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=Sta.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(Tta,"resolveFlowScalar");function Ita(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}`),goi(t)}a(Ita,"plainValue");function xta(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),goi(t.slice(1,-1)).replace(/''/g,"'")}a(xta,"singleQuotedValue");function goi(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";p();var zmr=Am(),Qta=Gme();function qta(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=zmr.Scalar.PLAIN,u=jta(s,d);break;case"single-quoted-scalar":l=zmr.Scalar.QUOTE_SINGLE,u=Hta(s,d);break;case"double-quoted-scalar":l=zmr.Scalar.QUOTE_DOUBLE,u=Gta(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=Qta.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(qta,"resolveFlowScalar");function jta(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}`),Soi(t)}a(jta,"plainValue");function Hta(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Soi(t.slice(1,-1)).replace(/''/g,"'")}a(Hta,"singleQuotedValue");function Soi(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(wta,"doubleQuotedValue");function Rta(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(Gta,"doubleQuotedValue");function $ta(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(Rta,"foldNewline");var kta={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Pta(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(Pta,"parseCharCode");Aoi.resolveFlowScalar=Tta});var _oi=I(Eoi=>{"use strict";p();var Eee=Za(),yoi=mm(),Dta=Hmr(),Nta=$mr();function Mta(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?Dta.resolveBlockScalar(t,e,n):Nta.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[Eee.SCALAR]:u?d=Ota(t.schema,o,u,r,n):e.type==="scalar"?d=Lta(t,o,e,n):d=t.schema[Eee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=Eee.isScalar(h)?h:new yoi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new yoi.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(Mta,"composeScalar");function Ota(t,e,r,n,o){if(r==="!")return t[Eee.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[Eee.SCALAR])}a(Ota,"findScalarTagByName");function Lta({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[Eee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[Eee.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(Lta,"findScalarTagByTest");Eoi.composeScalar=Mta});var Coi=I(voi=>{"use strict";p();function Bta(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(Bta,"emptyScalarPosition");voi.emptyScalarPosition=Bta});var Toi=I(Wmr=>{"use strict";p();var Fta=WNe(),Uta=Za(),Qta=hoi(),boi=_oi(),qta=jme(),jta=Coi(),Hta={composeNode:Soi,composeEmptyNode:Vmr};function Soi(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=Gta(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=boi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=Qta.composeCollection(Hta,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=Vmr(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&&(!Uta.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(Soi,"composeNode");function Vmr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:jta.emptyScalarPosition(e,r,n),indent:-1,source:""},h=boi.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(Vmr,"composeEmptyNode");function Gta({options:t},{offset:e,source:r,end:n},o){let s=new Fta.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=qta.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(Gta,"composeAlias");Wmr.composeEmptyNode=Vmr;Wmr.composeNode=Soi});var woi=I(xoi=>{"use strict";p();var $ta=uMe(),Ioi=Toi(),Vta=jme(),Wta=hMe();function zta(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new $ta.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Wta.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?Ioi.composeNode(d,o,f,c):Ioi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Vta.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(zta,"composeDoc");xoi.composeDoc=zta});var Ymr=I(Poi=>{"use strict";p();var Yta=require("process"),Kta=Mhr(),Jta=uMe(),mMe=pMe(),Roi=Za(),Zta=woi(),Xta=jme();function gMe(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(gMe,"getErrorPos");function koi(t){let e="",r=!1,n=!1;for(let o=0;o{"use strict";p();var _ee=Xa(),Ioi=Am(),zta=Wmr(),Yta=Ymr();function Kta(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?zta.resolveBlockScalar(t,e,n):Yta.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[_ee.SCALAR]:u?d=Jta(t.schema,o,u,r,n):e.type==="scalar"?d=Zta(t,o,e,n):d=t.schema[_ee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=_ee.isScalar(h)?h:new Ioi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Ioi.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(Kta,"composeScalar");function Jta(t,e,r,n,o){if(r==="!")return t[_ee.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[_ee.SCALAR])}a(Jta,"findScalarTagByName");function Zta({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[_ee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[_ee.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(Zta,"findScalarTagByTest");xoi.composeScalar=Kta});var koi=I(Roi=>{"use strict";p();function Xta(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(Xta,"emptyScalarPosition");Roi.emptyScalarPosition=Xta});var Noi=I(Jmr=>{"use strict";p();var era=ZNe(),tra=Xa(),rra=Coi(),Poi=woi(),nra=Gme(),ira=koi(),ora={composeNode:Doi,composeEmptyNode:Kmr};function Doi(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=sra(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=Poi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=rra.composeCollection(ora,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=Kmr(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&&(!tra.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(Doi,"composeNode");function Kmr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:ira.emptyScalarPosition(e,r,n),indent:-1,source:""},h=Poi.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(Kmr,"composeEmptyNode");function sra({options:t},{offset:e,source:r,end:n},o){let s=new era.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=nra.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(sra,"composeAlias");Jmr.composeEmptyNode=Kmr;Jmr.composeNode=Doi});var Loi=I(Ooi=>{"use strict";p();var ara=mMe(),Moi=Noi(),cra=Gme(),lra=EMe();function ura(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new ara.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=lra.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?Moi.composeNode(d,o,f,c):Moi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=cra.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(ura,"composeDoc");Ooi.composeDoc=ura});var Xmr=I(Uoi=>{"use strict";p();var dra=require("process"),fra=Fhr(),pra=mMe(),_Me=yMe(),Boi=Xa(),hra=Loi(),mra=Gme();function vMe(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(vMe,"getErrorPos");function Foi(t){let e="",r=!1,n=!1;for(let o=0;o{let c=gMe(r);s?this.warnings.push(new mMe.YAMLWarning(c,n,o)):this.errors.push(new mMe.YAMLParseError(c,n,o))},this.directives=new Kta.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=koi(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(Roi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];Roi.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(Foi,"parsePrelude");var Zmr=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=vMe(r);s?this.warnings.push(new _Me.YAMLWarning(c,n,o)):this.errors.push(new _Me.YAMLParseError(c,n,o))},this.directives=new fra.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Foi(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(Boi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];Boi.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:koi(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(Yta.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=gMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Zta.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 mMe.YAMLParseError(gMe(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 mMe.YAMLParseError(gMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Xta.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 mMe.YAMLParseError(gMe(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 Jta.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}}};Poi.Composer=zmr});var Moi=I(Mft=>{"use strict";p();var era=Hmr(),tra=$mr(),rra=pMe(),Doi=ZNe();function nra(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 rra.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return tra.resolveFlowScalar(t,e,n);case"block-scalar":return era.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(nra,"resolveAsScalar");function ira(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=Doi.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:Foi(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(dra.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=vMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=hra.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 _Me.YAMLParseError(vMe(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 _Me.YAMLParseError(vMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=mra.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 _Me.YAMLParseError(vMe(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 pra.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}}};Uoi.Composer=Zmr});var joi=I(Fft=>{"use strict";p();var gra=Wmr(),Ara=Ymr(),yra=yMe(),Qoi=nMe();function Era(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 yra.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ara.resolveFlowScalar(t,e,n);case"block-scalar":return gra.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(Era,"resolveAsScalar");function _ra(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=Qoi.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 Noi(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(ira,"createScalarToken");function ora(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=Doi.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">":sra(t,u);break;case'"':Kmr(t,u,"double-quoted-scalar");break;case"'":Kmr(t,u,"single-quoted-scalar");break;default:Kmr(t,u,"scalar")}}a(ora,"setScalarValue");function sra(t,e){let r=e.indexOf(` +`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return qoi(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(_ra,"createScalarToken");function vra(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=Qoi.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">":Cra(t,u);break;case'"':e0r(t,u,"double-quoted-scalar");break;case"'":e0r(t,u,"single-quoted-scalar");break;default:e0r(t,u,"scalar")}}a(vra,"setScalarValue");function Cra(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}];Noi(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(sra,"setBlockScalarValue");function Noi(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(Noi,"addEndtoBlockProps");function Kmr(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(Kmr,"setFlowScalarValue");Mft.createScalarToken=ira;Mft.resolveAsScalar=nra;Mft.setScalarValue=ora});var Loi=I(Ooi=>{"use strict";p();var ara=a(t=>"type"in t?Lft(t):Oft(t),"stringify");function Lft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Lft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Oft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Oft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Oft(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(Lft,"stringifyToken");function Oft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Lft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Lft(n)),o}a(Oft,"stringifyItem");Ooi.stringify=ara});var Qoi=I(Uoi=>{"use strict";p();var Jmr=Symbol("break visit"),cra=Symbol("skip children"),Boi=Symbol("remove item");function _ee(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Foi(Object.freeze([]),t,e)}a(_ee,"visit");_ee.BREAK=Jmr;_ee.SKIP=cra;_ee.REMOVE=Boi;_ee.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};_ee.parentCollection=(t,e)=>{let r=_ee.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 Foi(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 Zmr=Moi(),lra=Loi(),ura=Qoi(),Xmr="\uFEFF",e0r="",t0r="",r0r="",dra=a(t=>!!t&&"items"in t,"isCollection"),fra=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function pra(t){switch(t){case Xmr:return"";case e0r:return"";case t0r:return"";case r0r:return"";default:return JSON.stringify(t)}}a(pra,"prettyToken");function hra(t){switch(t){case Xmr:return"byte-order-mark";case e0r:return"doc-mode";case t0r:return"flow-error-end";case r0r: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}];qoi(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(Cra,"setBlockScalarValue");function qoi(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(qoi,"addEndtoBlockProps");function e0r(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(e0r,"setFlowScalarValue");Fft.createScalarToken=_ra;Fft.resolveAsScalar=Era;Fft.setScalarValue=vra});var Goi=I(Hoi=>{"use strict";p();var bra=a(t=>"type"in t?Qft(t):Uft(t),"stringify");function Qft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Qft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Uft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Uft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Uft(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(Qft,"stringifyToken");function Uft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Qft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Qft(n)),o}a(Uft,"stringifyItem");Hoi.stringify=bra});var zoi=I(Woi=>{"use strict";p();var t0r=Symbol("break visit"),Sra=Symbol("skip children"),$oi=Symbol("remove item");function vee(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Voi(Object.freeze([]),t,e)}a(vee,"visit");vee.BREAK=t0r;vee.SKIP=Sra;vee.REMOVE=$oi;vee.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};vee.parentCollection=(t,e)=>{let r=vee.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 Voi(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 r0r=joi(),Tra=Goi(),Ira=zoi(),n0r="\uFEFF",i0r="",o0r="",s0r="",xra=a(t=>!!t&&"items"in t,"isCollection"),wra=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function Rra(t){switch(t){case n0r:return"";case i0r:return"";case o0r:return"";case s0r:return"";default:return JSON.stringify(t)}}a(Rra,"prettyToken");function kra(t){switch(t){case n0r:return"byte-order-mark";case i0r:return"doc-mode";case o0r:return"flow-error-end";case s0r: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(hra,"tokenType");Bb.createScalarToken=Zmr.createScalarToken;Bb.resolveAsScalar=Zmr.resolveAsScalar;Bb.setScalarValue=Zmr.setScalarValue;Bb.stringify=lra.stringify;Bb.visit=ura.visit;Bb.BOM=Xmr;Bb.DOCUMENT=e0r;Bb.FLOW_END=t0r;Bb.SCALAR=r0r;Bb.isCollection=dra;Bb.isScalar=fra;Bb.prettyToken=pra;Bb.tokenType=hra});var o0r=I(joi=>{"use strict";p();var AMe=Bft();function Z2(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(Z2,"isEmpty");var qoi=new Set("0123456789ABCDEFabcdef"),mra=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Fft=new Set(",[]{}"),gra=new Set(` ,[]{} -\r `),n0r=a(t=>!t||gra.has(t),"isNotAnchorChar"),i0r=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(kra,"tokenType");Bb.createScalarToken=r0r.createScalarToken;Bb.resolveAsScalar=r0r.resolveAsScalar;Bb.setScalarValue=r0r.setScalarValue;Bb.stringify=Tra.stringify;Bb.visit=Ira.visit;Bb.BOM=n0r;Bb.DOCUMENT=i0r;Bb.FLOW_END=o0r;Bb.SCALAR=s0r;Bb.isCollection=xra;Bb.isScalar=wra;Bb.prettyToken=Rra;Bb.tokenType=kra});var l0r=I(Koi=>{"use strict";p();var CMe=qft();function tD(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}a(tD,"isEmpty");var Yoi=new Set("0123456789ABCDEFabcdef"),Pra=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),jft=new Set(",[]{}"),Dra=new Set(` ,[]{} +\r `),a0r=a(t=>!t||Dra.has(t),"isNotAnchorChar"),c0r=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==="...")&&Z2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Z2(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===":")&&Z2(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(n0r),"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==="...")&&tD(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!tD(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===":")&&tD(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(a0r),"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=>Z2(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=>tD(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 AMe.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(Z2(s)||e&&Fft.has(s))break;r=n}else if(Z2(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 CMe.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(tD(s)||e&&jft.has(s))break;r=n}else if(tD(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&Fft.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Fft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield AMe.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(n0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(Z2(r)||e&&Fft.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(;!Z2(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(mra.has(r))r=this.buffer[++e];else if(r==="%"&&qoi.has(this.buffer[e+1])&&qoi.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&&jft.has(s))break;if(o===` +`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&jft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield CMe.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(a0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(tD(r)||e&&jft.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(;!tD(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(Pra.has(r))r=this.buffer[++e];else if(r==="%"&&Yoi.has(this.buffer[e+1])&&Yoi.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)}};joi.Lexer=i0r});var a0r=I(Hoi=>{"use strict";p();var s0r=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 Ara=require("process"),Goi=Bft(),yra=o0r();function YH(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(Hme,"getFirstKeyStartProps");function Voi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!YH(e.start,"explicit-key-ind")&&!YH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Woi(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(Voi,"fixFlowSeqItems");var c0r=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 yra.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,Ara.env.LOG_TOKENS&&console.log("|",Goi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Goi.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"&&Voi(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&&$oi(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)}};Koi.Lexer=c0r});var d0r=I(Joi=>{"use strict";p();var u0r=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 Nra=require("process"),Zoi=qft(),Mra=l0r();function XH(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($me,"getFirstKeyStartProps");function esi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!XH(e.start,"explicit-key-ind")&&!XH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,tsi(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(esi,"fixFlowSeqItems");var f0r=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 Mra.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,Nra.env.LOG_TOKENS&&console.log("|",Zoi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Zoi.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"&&esi(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&&Xoi(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(YH(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(Woi(r.key)&&!YH(r.sep,"newline")){let c=Hme(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(YH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Hme(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]}):YH(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&&!YH(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||YH(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=Uft(n),s=Hme(o);Voi(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(XH(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(tsi(r.key)&&!XH(r.sep,"newline")){let c=$me(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(XH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=$me(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]}):XH(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&&!XH(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||XH(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=Hft(n),s=$me(o);esi(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=Uft(e),n=Hme(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=Uft(e),n=Hme(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())}}};zoi.Parser=c0r});var Xoi=I(EMe=>{"use strict";p();var Yoi=Ymr(),Era=uMe(),yMe=pMe(),_ra=Whr(),vra=Za(),Cra=a0r(),Koi=l0r();function Joi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cra.LineCounter||null,prettyErrors:e}}a(Joi,"parseOptions");function bra(t,e={}){let{lineCounter:r,prettyErrors:n}=Joi(e),o=new Koi.Parser(r?.addNewLine),s=new Yoi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(yMe.prettifyError(t,r)),l.warnings.forEach(yMe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(bra,"parseAllDocuments");function Zoi(t,e={}){let{lineCounter:r,prettyErrors:n}=Joi(e),o=new Koi.Parser(r?.addNewLine),s=new Yoi.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 yMe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(yMe.prettifyError(t,r)),c.warnings.forEach(yMe.prettifyError(t,r))),c}a(Zoi,"parseDocument");function Sra(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=Zoi(t,r);if(!o)return null;if(o.warnings.forEach(s=>_ra.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(Sra,"parse");function Tra(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 vra.isDocument(t)&&!n?t.toString(r):new Era.Document(t,n,r).toString(r)}a(Tra,"stringify");EMe.parse=Sra;EMe.parseAllDocuments=bra;EMe.parseDocument=Zoi;EMe.stringify=Tra});var tsi=I(Hc=>{"use strict";p();var Ira=Ymr(),xra=uMe(),wra=Rmr(),u0r=pMe(),Rra=WNe(),KH=Za(),kra=$H(),Pra=mm(),Dra=WH(),Nra=zH(),Mra=Bft(),Ora=o0r(),Lra=a0r(),Bra=l0r(),Qft=Xoi(),esi=HNe();Hc.Composer=Ira.Composer;Hc.Document=xra.Document;Hc.Schema=wra.Schema;Hc.YAMLError=u0r.YAMLError;Hc.YAMLParseError=u0r.YAMLParseError;Hc.YAMLWarning=u0r.YAMLWarning;Hc.Alias=Rra.Alias;Hc.isAlias=KH.isAlias;Hc.isCollection=KH.isCollection;Hc.isDocument=KH.isDocument;Hc.isMap=KH.isMap;Hc.isNode=KH.isNode;Hc.isPair=KH.isPair;Hc.isScalar=KH.isScalar;Hc.isSeq=KH.isSeq;Hc.Pair=kra.Pair;Hc.Scalar=Pra.Scalar;Hc.YAMLMap=Dra.YAMLMap;Hc.YAMLSeq=Nra.YAMLSeq;Hc.CST=Mra;Hc.Lexer=Ora.Lexer;Hc.LineCounter=Lra.LineCounter;Hc.Parser=Bra.Parser;Hc.parse=Qft.parse;Hc.parseAllDocuments=Qft.parseAllDocuments;Hc.parseDocument=Qft.parseDocument;Hc.stringify=Qft.stringify;Hc.visit=esi.visit;Hc.visitAsync=esi.visitAsync});var rsi=I(qft=>{"use strict";p();Object.defineProperty(qft,"__esModule",{value:!0});qft.FetchCancellationError=void 0;var Fra=Rs(),d0r=class extends Fra.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};qft.FetchCancellationError=d0r});var Gs=I(JH=>{"use strict";p();Object.defineProperty(JH,"__esModule",{value:!0});JH.IInstantiationService=JH._util=void 0;JH.createDecorator=nsi;JH.refineServiceDecorator=Qra;var R8;(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})(R8||(JH._util=R8={}));JH.IInstantiationService=nsi("instantiationService");function Ura(t,e,r){e[R8.DI_TARGET]===e?e[R8.DI_DEPENDENCIES].push({id:t,index:r}):(e[R8.DI_DEPENDENCIES]=[{id:t,index:r}],e[R8.DI_TARGET]=e)}a(Ura,"storeServiceDependency");function nsi(t){if(R8.serviceIds.has(t))return R8.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");Ura(e,r,o)},"id");return e.toString=()=>t,R8.serviceIds.set(t,e),e}a(nsi,"createDecorator");function Qra(t){return t}a(Qra,"refineServiceDecorator")});var Hft=I(jft=>{"use strict";p();Object.defineProperty(jft,"__esModule",{value:!0});jft.SyncDescriptor=void 0;var f0r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};jft.SyncDescriptor=f0r});var isi=I(Gme=>{"use strict";p();Object.defineProperty(Gme,"__esModule",{value:!0});Gme.Graph=Gme.Node=void 0;var Gft=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};Gme.Node=Gft;var p0r=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 Gft(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} +`,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=Hft(e),n=$me(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=Hft(e),n=$me(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())}}};rsi.Parser=f0r});var asi=I(SMe=>{"use strict";p();var nsi=Xmr(),Ora=mMe(),bMe=yMe(),Lra=Jhr(),Bra=Xa(),Fra=d0r(),isi=p0r();function osi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Fra.LineCounter||null,prettyErrors:e}}a(osi,"parseOptions");function Ura(t,e={}){let{lineCounter:r,prettyErrors:n}=osi(e),o=new isi.Parser(r?.addNewLine),s=new nsi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(bMe.prettifyError(t,r)),l.warnings.forEach(bMe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(Ura,"parseAllDocuments");function ssi(t,e={}){let{lineCounter:r,prettyErrors:n}=osi(e),o=new isi.Parser(r?.addNewLine),s=new nsi.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 bMe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(bMe.prettifyError(t,r)),c.warnings.forEach(bMe.prettifyError(t,r))),c}a(ssi,"parseDocument");function Qra(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=ssi(t,r);if(!o)return null;if(o.warnings.forEach(s=>Lra.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(Qra,"parse");function qra(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 Bra.isDocument(t)&&!n?t.toString(r):new Ora.Document(t,n,r).toString(r)}a(qra,"stringify");SMe.parse=Qra;SMe.parseAllDocuments=Ura;SMe.parseDocument=ssi;SMe.stringify=qra});var lsi=I(Hc=>{"use strict";p();var jra=Xmr(),Hra=mMe(),Gra=Nmr(),h0r=yMe(),$ra=ZNe(),eG=Xa(),Vra=YH(),Wra=Am(),zra=JH(),Yra=ZH(),Kra=qft(),Jra=l0r(),Zra=d0r(),Xra=p0r(),Gft=asi(),csi=zNe();Hc.Composer=jra.Composer;Hc.Document=Hra.Document;Hc.Schema=Gra.Schema;Hc.YAMLError=h0r.YAMLError;Hc.YAMLParseError=h0r.YAMLParseError;Hc.YAMLWarning=h0r.YAMLWarning;Hc.Alias=$ra.Alias;Hc.isAlias=eG.isAlias;Hc.isCollection=eG.isCollection;Hc.isDocument=eG.isDocument;Hc.isMap=eG.isMap;Hc.isNode=eG.isNode;Hc.isPair=eG.isPair;Hc.isScalar=eG.isScalar;Hc.isSeq=eG.isSeq;Hc.Pair=Vra.Pair;Hc.Scalar=Wra.Scalar;Hc.YAMLMap=zra.YAMLMap;Hc.YAMLSeq=Yra.YAMLSeq;Hc.CST=Kra;Hc.Lexer=Jra.Lexer;Hc.LineCounter=Zra.LineCounter;Hc.Parser=Xra.Parser;Hc.parse=Gft.parse;Hc.parseAllDocuments=Gft.parseAllDocuments;Hc.parseDocument=Gft.parseDocument;Hc.stringify=Gft.stringify;Hc.visit=csi.visit;Hc.visitAsync=csi.visitAsync});var usi=I($ft=>{"use strict";p();Object.defineProperty($ft,"__esModule",{value:!0});$ft.FetchCancellationError=void 0;var ena=Rs(),m0r=class extends ena.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};$ft.FetchCancellationError=m0r});var Gs=I(tG=>{"use strict";p();Object.defineProperty(tG,"__esModule",{value:!0});tG.IInstantiationService=tG._util=void 0;tG.createDecorator=dsi;tG.refineServiceDecorator=rna;var P8;(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})(P8||(tG._util=P8={}));tG.IInstantiationService=dsi("instantiationService");function tna(t,e,r){e[P8.DI_TARGET]===e?e[P8.DI_DEPENDENCIES].push({id:t,index:r}):(e[P8.DI_DEPENDENCIES]=[{id:t,index:r}],e[P8.DI_TARGET]=e)}a(tna,"storeServiceDependency");function dsi(t){if(P8.serviceIds.has(t))return P8.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");tna(e,r,o)},"id");return e.toString=()=>t,P8.serviceIds.set(t,e),e}a(dsi,"createDecorator");function rna(t){return t}a(rna,"refineServiceDecorator")});var Wft=I(Vft=>{"use strict";p();Object.defineProperty(Vft,"__esModule",{value:!0});Vft.SyncDescriptor=void 0;var g0r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};Vft.SyncDescriptor=g0r});var fsi=I(Vme=>{"use strict";p();Object.defineProperty(Vme,"__esModule",{value:!0});Vme.Graph=Vme.Node=void 0;var zft=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};Vme.Node=zft;var A0r=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 zft(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)}}};Gme.Graph=p0r});var m0r=I($ft=>{"use strict";p();Object.defineProperty($ft,"__esModule",{value:!0});$ft.ServiceCollection=void 0;var h0r=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)}};$ft.ServiceCollection=h0r});var ssi=I(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.Trace=Wme.InstantiationService=void 0;var qra=nl(),jra=Rs(),g0r=Ro(),$me=Hft(),osi=isi(),A0r=Gs(),Hra=m0r(),Gra=vue(),$ra=!1,Vft=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()}`}},y0r=class t{static{a(this,"InstantiationService")}constructor(e=new Hra.ServiceCollection,r=!1,n,o=$ra){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(A0r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new osi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,g0r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,g0r.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=Vme.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,jra.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 $me.SyncDescriptor?(n=Vme.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=Vme.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=A0r._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 $me.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 $me.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 osi.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 Vft(o);for(let d of A0r._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 $me.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 Vft(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof $me.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 $me.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 qra.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 Gra.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,g0r.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)}};Wme.InstantiationService=y0r;var Vme=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(` +`)}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)}}};Vme.Graph=A0r});var E0r=I(Yft=>{"use strict";p();Object.defineProperty(Yft,"__esModule",{value:!0});Yft.ServiceCollection=void 0;var y0r=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)}};Yft.ServiceCollection=y0r});var hsi=I(Yme=>{"use strict";p();Object.defineProperty(Yme,"__esModule",{value:!0});Yme.Trace=Yme.InstantiationService=void 0;var nna=nl(),ina=Rs(),_0r=ko(),Wme=Wft(),psi=fsi(),v0r=Gs(),ona=E0r(),sna=Cue(),ana=!1,Kft=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()}`}},C0r=class t{static{a(this,"InstantiationService")}constructor(e=new ona.ServiceCollection,r=!1,n,o=ana){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(v0r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new psi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,_0r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,_0r.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=zme.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,ina.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 Wme.SyncDescriptor?(n=zme.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=zme.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=v0r._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 Wme.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 Wme.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 psi.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 Kft(o);for(let d of v0r._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 Wme.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 Kft(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Wme.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 Wme.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 nna.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 sna.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,_0r.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)}};Yme.InstantiationService=C0r;var zme=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(` -`))}};Wme.Trace=Vme});var nn=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.InstantiationServiceBuilder=zme.createServiceIdentifier=void 0;var Vra=Gs();Object.defineProperty(zme,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Vra.createDecorator},"get")});var Wra=ssi(),asi=m0r(),E0r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new asi.ServiceCollection(...e):e??new asi.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 Wra.InstantiationService(this._collection,!0)}};zme.InstantiationServiceBuilder=E0r});var _Me=I(uR=>{"use strict";p();Object.defineProperty(uR,"__esModule",{value:!0});uR.NullLanguageContextService=uR.TriggerKind=uR.KnownSources=uR.ContextKind=uR.ILanguageContextService=void 0;var zra=nn();uR.ILanguageContextService=(0,zra.createServiceIdentifier)("ILanguageContextService");var csi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(csi||(uR.ContextKind=csi={}));var lsi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(lsi||(uR.KnownSources=lsi={}));var usi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(usi||(uR.TriggerKind=usi={}));var _0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};uR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new _0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var fsi=I(Wft=>{"use strict";p();Object.defineProperty(Wft,"__esModule",{value:!0});Wft.serializeLanguageContext=Kra;Wft.serializeFileDiagnostics=tna;var Yra=eh(),v0r=_Me();function Kra(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:Jra(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(Kra,"serializeLanguageContext");function Jra(t){switch(t.kind){case v0r.ContextKind.Snippet:return Zra(t);case v0r.ContextKind.Trait:return Xra(t);case v0r.ContextKind.DiagnosticBag:return ena(t)}}a(Jra,"serializeLanguageContextItem");function Zra(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(Zra,"serializeSnippetContext");function Xra(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(Xra,"serializeTraitContext");function ena(t){let e=t.values.map(r=>dsi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(ena,"serializeDiagnosticBagContext");function dsi(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 Yra.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(dsi,"serializeDiagnostic");function tna(t){return t.flatMap(([e,r])=>r.map(n=>dsi(n,e)))}a(tna,"serializeFileDiagnostics")});var b0r=I(C0r=>{"use strict";p();Object.defineProperty(C0r,"__esModule",{value:!0});C0r.stringifyChatMessages=rna;var zft=Io();function rna(t){return t.map(nna).join(` -`)}a(rna,"stringifyChatMessages");function nna({role:t,content:e}){if(t!==zft.Raw.ChatRole.User&&t!==zft.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===zft.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==zft.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`))}};Yme.Trace=zme});var nn=I(Kme=>{"use strict";p();Object.defineProperty(Kme,"__esModule",{value:!0});Kme.InstantiationServiceBuilder=Kme.createServiceIdentifier=void 0;var cna=Gs();Object.defineProperty(Kme,"createServiceIdentifier",{enumerable:!0,get:a(function(){return cna.createDecorator},"get")});var lna=hsi(),msi=E0r(),b0r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new msi.ServiceCollection(...e):e??new msi.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 lna.InstantiationService(this._collection,!0)}};Kme.InstantiationServiceBuilder=b0r});var TMe=I(fR=>{"use strict";p();Object.defineProperty(fR,"__esModule",{value:!0});fR.NullLanguageContextService=fR.TriggerKind=fR.KnownSources=fR.ContextKind=fR.ILanguageContextService=void 0;var una=nn();fR.ILanguageContextService=(0,una.createServiceIdentifier)("ILanguageContextService");var gsi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(gsi||(fR.ContextKind=gsi={}));var Asi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(Asi||(fR.KnownSources=Asi={}));var ysi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(ysi||(fR.TriggerKind=ysi={}));var S0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};fR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new S0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var _si=I(Jft=>{"use strict";p();Object.defineProperty(Jft,"__esModule",{value:!0});Jft.serializeLanguageContext=fna;Jft.serializeFileDiagnostics=Ana;var dna=rh(),T0r=TMe();function fna(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:pna(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(fna,"serializeLanguageContext");function pna(t){switch(t.kind){case T0r.ContextKind.Snippet:return hna(t);case T0r.ContextKind.Trait:return mna(t);case T0r.ContextKind.DiagnosticBag:return gna(t)}}a(pna,"serializeLanguageContextItem");function hna(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(hna,"serializeSnippetContext");function mna(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(mna,"serializeTraitContext");function gna(t){let e=t.values.map(r=>Esi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(gna,"serializeDiagnosticBagContext");function Esi(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 dna.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(Esi,"serializeDiagnostic");function Ana(t){return t.flatMap(([e,r])=>r.map(n=>Esi(n,e)))}a(Ana,"serializeFileDiagnostics")});var x0r=I(I0r=>{"use strict";p();Object.defineProperty(I0r,"__esModule",{value:!0});I0r.stringifyChatMessages=yna;var Zft=xo();function yna(t){return t.map(Ena).join(` +`)}a(yna,"stringifyChatMessages");function Ena({role:t,content:e}){if(t!==Zft.Raw.ChatRole.User&&t!==Zft.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===Zft.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==Zft.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} ------ ${n.text} -==================`}a(nna,"stringifyMessage")});var T0r=I(Yft=>{"use strict";p();Object.defineProperty(Yft,"__esModule",{value:!0});Yft.register=ona;Yft.getCodiconFontCharacters=sna;var ina=KS(),S0r=Object.create(null);function ona(t,e){if((0,ina.isString)(e)){let r=S0r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return S0r[t]=e,{id:t}}a(ona,"register");function sna(){return S0r}a(sna,"getCodiconFontCharacters")});var psi=I(Kft=>{"use strict";p();Object.defineProperty(Kft,"__esModule",{value:!0});Kft.codiconsLibrary=void 0;var $=T0r();Kft.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 I0r=I(k8=>{"use strict";p();Object.defineProperty(k8,"__esModule",{value:!0});k8.Codicon=k8.codiconsDerived=void 0;k8.getAllCodicons=cna;var Gc=T0r(),ana=psi();function cna(){return Object.values(k8.Codicon)}a(cna,"getAllCodicons");k8.codiconsDerived={dialogError:(0,Gc.register)("dialog-error","error"),dialogWarning:(0,Gc.register)("dialog-warning","warning"),dialogInfo:(0,Gc.register)("dialog-info","info"),dialogClose:(0,Gc.register)("dialog-close","close"),treeItemExpanded:(0,Gc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Gc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Gc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Gc.register)("tree-filter-clear","close"),treeItemLoading:(0,Gc.register)("tree-item-loading","loading"),menuSelection:(0,Gc.register)("menu-selection","check"),menuSubmenu:(0,Gc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Gc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Gc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Gc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Gc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Gc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Gc.register)("toolbar-more","more"),quickInputBack:(0,Gc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Gc.register)("drop-down-button",60084),symbolCustomColor:(0,Gc.register)("symbol-customcolor",60252),exportIcon:(0,Gc.register)("export",60332),workspaceUnspecified:(0,Gc.register)("workspace-unspecified",60355),newLine:(0,Gc.register)("newline",60394),thumbsDownFilled:(0,Gc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Gc.register)("thumbsup-filled",60436),gitFetch:(0,Gc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Gc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Gc.register)("debug-breakpoint-pending",60377),chatImport:(0,Gc.register)("chat-import",60550),chatExport:(0,Gc.register)("chat-export",60551)};k8.Codicon={...ana.codiconsLibrary,...k8.codiconsDerived}});var R0r=I(vee=>{"use strict";p();Object.defineProperty(vee,"__esModule",{value:!0});vee.ThemeIcon=vee.ThemeColor=void 0;vee.themeColorFromId=lna;var x0r=I0r(),w0r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(w0r||(vee.ThemeColor=w0r={}));function lna(t){return{id:t}}a(lna,"themeColorFromId");var hsi;(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(x0r.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"||w0r.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===x0r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===x0r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(hsi||(vee.ThemeIcon=hsi={}))});var vMe=I(ZH=>{"use strict";p();Object.defineProperty(ZH,"__esModule",{value:!0});ZH.Icon=void 0;ZH.overrideNowValue=una;ZH.now=dna;ZH.shortenOpportunityId=fna;ZH.checkIfCursorAtEndOfLine=pna;var P8=R0r(),k0r=-1;function una(t){k0r=t}a(una,"overrideNowValue");function dna(){return k0r!==-1?k0r:Date.now()}a(dna,"now");var msi;(function(t){t.circleSlash={themeIcon:P8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:P8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:P8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:P8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:P8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:P8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:P8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:P8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:P8.ThemeIcon.fromId("thumbsdown"),svg:''}})(msi||(ZH.Icon=msi={}));function fna(t){return t.substring(4,8)}a(fna,"shortenOpportunityId");function pna(t,e){return t.substring(e).match(/^\s*$/)!==null}a(pna,"checkIfCursorAtEndOfLine")});var Zft=I(_4=>{"use strict";p();var hna=_4&&_4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=_4&&_4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gna=_4&&_4.__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(Xft,"__esModule",{value:!0});Xft.register=vna;Xft.getCodiconFontCharacters=Cna;var _na=ZS(),w0r=Object.create(null);function vna(t,e){if((0,_na.isString)(e)){let r=w0r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return w0r[t]=e,{id:t}}a(vna,"register");function Cna(){return w0r}a(Cna,"getCodiconFontCharacters")});var vsi=I(ept=>{"use strict";p();Object.defineProperty(ept,"__esModule",{value:!0});ept.codiconsLibrary=void 0;var $=R0r();ept.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 k0r=I(D8=>{"use strict";p();Object.defineProperty(D8,"__esModule",{value:!0});D8.Codicon=D8.codiconsDerived=void 0;D8.getAllCodicons=Sna;var Gc=R0r(),bna=vsi();function Sna(){return Object.values(D8.Codicon)}a(Sna,"getAllCodicons");D8.codiconsDerived={dialogError:(0,Gc.register)("dialog-error","error"),dialogWarning:(0,Gc.register)("dialog-warning","warning"),dialogInfo:(0,Gc.register)("dialog-info","info"),dialogClose:(0,Gc.register)("dialog-close","close"),treeItemExpanded:(0,Gc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Gc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Gc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Gc.register)("tree-filter-clear","close"),treeItemLoading:(0,Gc.register)("tree-item-loading","loading"),menuSelection:(0,Gc.register)("menu-selection","check"),menuSubmenu:(0,Gc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Gc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Gc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Gc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Gc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Gc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Gc.register)("toolbar-more","more"),quickInputBack:(0,Gc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Gc.register)("drop-down-button",60084),symbolCustomColor:(0,Gc.register)("symbol-customcolor",60252),exportIcon:(0,Gc.register)("export",60332),workspaceUnspecified:(0,Gc.register)("workspace-unspecified",60355),newLine:(0,Gc.register)("newline",60394),thumbsDownFilled:(0,Gc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Gc.register)("thumbsup-filled",60436),gitFetch:(0,Gc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Gc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Gc.register)("debug-breakpoint-pending",60377),chatImport:(0,Gc.register)("chat-import",60550),chatExport:(0,Gc.register)("chat-export",60551)};D8.Codicon={...bna.codiconsLibrary,...D8.codiconsDerived}});var N0r=I(Cee=>{"use strict";p();Object.defineProperty(Cee,"__esModule",{value:!0});Cee.ThemeIcon=Cee.ThemeColor=void 0;Cee.themeColorFromId=Tna;var P0r=k0r(),D0r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(D0r||(Cee.ThemeColor=D0r={}));function Tna(t){return{id:t}}a(Tna,"themeColorFromId");var Csi;(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(P0r.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"||D0r.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===P0r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===P0r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(Csi||(Cee.ThemeIcon=Csi={}))});var IMe=I(rG=>{"use strict";p();Object.defineProperty(rG,"__esModule",{value:!0});rG.Icon=void 0;rG.overrideNowValue=Ina;rG.now=xna;rG.shortenOpportunityId=wna;rG.checkIfCursorAtEndOfLine=Rna;var N8=N0r(),M0r=-1;function Ina(t){M0r=t}a(Ina,"overrideNowValue");function xna(){return M0r!==-1?M0r:Date.now()}a(xna,"now");var bsi;(function(t){t.circleSlash={themeIcon:N8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:N8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:N8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:N8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:N8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:N8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:N8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:N8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:N8.ThemeIcon.fromId("thumbsdown"),svg:''}})(bsi||(rG.Icon=bsi={}));function wna(t){return t.substring(4,8)}a(wna,"shortenOpportunityId");function Rna(t,e){return t.substring(e).match(/^\s*$/)!==null}a(Rna,"checkIfCursorAtEndOfLine")});var rpt=I(v4=>{"use strict";p();var kna=v4&&v4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pna=v4&&v4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Dna=v4&&v4.__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(`- ${PE.Icon.lightbulbFull.svg} - model had suggestions -`),e.push(`- ${PE.Icon.circleSlash.svg} - model had NO suggestions -`),e.push(`- ${PE.Icon.database.svg} - response is from cache -`),e.push(`- ${PE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) -`),e.push(`- ${PE.Icon.error.svg} - error happened -`),e.push(`- ${PE.Icon.skipped.svg} - fetching started but got cancelled +`),e.push(`- ${DE.Icon.lightbulbFull.svg} - model had suggestions +`),e.push(`- ${DE.Icon.circleSlash.svg} - model had NO suggestions +`),e.push(`- ${DE.Icon.database.svg} - response is from cache +`),e.push(`- ${DE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) +`),e.push(`- ${DE.Icon.error.svg} - error happened +`),e.push(`- ${DE.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 @@ -510,11 +510,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(Jft.ErrorUtils.toString(Jft.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(tpt.ErrorUtils.toString(tpt.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(gsi.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(Ssi.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(` @@ -526,8 +526,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(Jft.ErrorUtils.toString(Jft.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,vna.stringifyChatMessages)(e)),this.fireDidChange()}get cursorJumpRawMessages(){return this._cursorJumpRawMessages}get cursorJumpKeptRange(){return this._cursorJumpKeptRange}setCursorJumpPrompt(e,r){this._cursorJumpRawMessages=e,this._cursorJumpKeptRange=r,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?PE.Icon.check:PE.Icon.loading;case"succeeded":return PE.Icon.lightbulbFull;case"noSuggestions":return PE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return PE.Icon.database;case"reusedInFlight":return PE.Icon.gitMerge;case"skipped":case"cancelled":return PE.Icon.skipped;case"errored":return PE.Icon.error;case"previouslyRejected":return PE.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 Ena.FetchCancellationError?this._setOutcome("skipped"):(0,Ana.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 | ${Cna(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(tpt.ErrorUtils.toString(tpt.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,Bna.stringifyChatMessages)(e)),this.fireDidChange()}get cursorJumpRawMessages(){return this._cursorJumpRawMessages}get cursorJumpKeptRange(){return this._cursorJumpKeptRange}setCursorJumpPrompt(e,r){this._cursorJumpRawMessages=e,this._cursorJumpKeptRange=r,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?DE.Icon.check:DE.Icon.loading;case"succeeded":return DE.Icon.lightbulbFull;case"noSuggestions":return DE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return DE.Icon.database;case"reusedInFlight":return DE.Icon.gitMerge;case"skipped":case"cancelled":return DE.Icon.skipped;case"errored":return DE.Icon.error;case"previouslyRejected":return DE.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 Ona.FetchCancellationError?this._setOutcome("skipped"):(0,Nna.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 | ${Fna(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:gsi.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,_na.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};_4.InlineEditRequestLogContext=P0r;function Cna(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(Cna,"basename")});var Asi=I(Xft=>{"use strict";p();Object.defineProperty(Xft,"__esModule",{value:!0});Xft.GhostTextLogContext=void 0;var bna=Zft(),Sna=NA(),D0r=class extends bna.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,Sna.basename)(this.filePath)} (v${this.version})`}};Xft.GhostTextLogContext=D0r});var XH=I(Yme=>{"use strict";p();Object.defineProperty(Yme,"__esModule",{value:!0});Yme.CopilotTokenStore=Yme.ICopilotTokenStore=void 0;var Tna=nn(),Ina=Ic(),xna=Ro();Yme.ICopilotTokenStore=(0,Tna.createServiceIdentifier)("ICopilotTokenStore");var N0r=class extends xna.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new Ina.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()}};Yme.CopilotTokenStore=N0r});var gm=I(sy=>{"use strict";p();var wna=sy&&sy.__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},Rna=sy&&sy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sy,"__esModule",{value:!0});sy.TelemetryTrustedValue=sy.ITelemetryService=sy.TelemetryUserConfigImpl=sy.ITelemetryUserConfig=void 0;sy.createTrackingIdGetter=Pna;sy.multiplexProperties=Nna;var ysi=nn(),kna=XH();sy.ITelemetryUserConfig=(0,ysi.createServiceIdentifier)("ITelemetryUserConfig");var M0r=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)}};sy.TelemetryUserConfigImpl=M0r;sy.TelemetryUserConfigImpl=M0r=wna([Rna(2,kna.ICopilotTokenStore)],M0r);function Pna(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(Pna,"createTrackingIdGetter");sy.ITelemetryService=(0,ysi.createServiceIdentifier)("ITelemetryService");var O0r=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};sy.TelemetryTrustedValue=O0r;var CMe=8192,Dna=50;function Nna(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>CMe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+CMe;o{"use strict";p();var Mna=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]})),Ona=jo&&jo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Lna=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)&&Mna(e,t,r);return Ona(e,t),e},L0r=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())})},B0r=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 Q0r=bee&&bee.__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())})},q0r=bee&&bee.__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,v4.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 Q0r(this,void 0,void 0,function(){var r,n,o;return q0r(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,v4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=Cee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,v4.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 v4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return Q0r(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return q0r(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,v4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return Cee.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 bsi=Csi(),Gna="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",$na="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Vna=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Wna.exports={}});var tpt=I(Kme=>{"use strict";p();var zna=Kme&&Kme.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kme,"__esModule",{value:!0});Kme.JsonConfig=void 0;var Yna=require("fs"),ept=require("path"),j0r=Kl(),Kna=zna(Tsi()),Jna="APPLICATIONINSIGHTS_CONFIGURATION_FILE",Zna="APPLICATIONINSIGHTS_CONNECTION_STRING",Isi="APPSETTING_",xsi="APPINSIGHTS_INSTRUMENTATIONKEY",wsi="APPINSIGHTS_INSTRUMENTATION_KEY",Xna="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",eia="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",tia="http_proxy",ria="https_proxy",nia="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",iia="APPLICATION_INSIGHTS_NO_STATSBEAT",oia="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",sia="APPLICATION_INSIGHTS_NO_PATCH_MODULES",aia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",cia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",lia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",uia="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",dia="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",fia=(function(){function t(){this.connectionString=process.env[Zna],this.instrumentationKey=process.env[xsi]||process.env[Isi+xsi]||process.env[wsi]||process.env[Isi+wsi],!this.connectionString&&this.instrumentationKey&&j0r.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[eia],this.extendedMetricDisablers=process.env[Xna],this.proxyHttpUrl=process.env[tia],this.proxyHttpsUrl=process.env[ria],this.noDiagnosticChannel=!!process.env[nia],this.disableStatsbeat=!!process.env[iia],this.noHttpAgentKeepAlive=!!process.env[oia],this.noPatchModules=process.env[sia]||"",this.enableWebInstrumentation=!!process.env[aia]||!!process.env[uia],this.webInstrumentationSrc=process.env[lia]||"",this.webInstrumentationConnectionString=process.env[cia]||process.env[dia]||"",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=ept.join(__dirname,"../../");this._tempDir=ept.join(o,n);var s=process.env[Jna];if(s){ept.isAbsolute(s)?this._tempDir=s:this._tempDir=ept.join(o,s);try{e=Yna.readFileSync(this._tempDir,"utf8")}catch(l){j0r.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Kna.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){j0r.warn("Invalid JSON config file: ",l)}},t})();Kme.JsonConfig=fia});var H0r=I(rpt=>{"use strict";p();Object.defineProperty(rpt,"__esModule",{value:!0});rpt.makePatchingRequire=void 0;var pia=require("path"),hia=AP(),Rsi=Cp(),Psi=require("module"),mia=Object.keys(process.binding("natives")),ksi=Psi.prototype.require;function gia(t){var e={};return a(function(n){var o=ksi.apply(this,arguments);if(t[n]){var s=Psi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(mia.indexOf(n)<0)try{c=ksi.call(this,pia.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{Aia.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 Cp=I(dR=>{"use strict";p();Object.defineProperty(dR,"__esModule",{value:!0});dR.channel=dR.ContextPreservingEventEmitter=dR.trueFilter=dR.makePatchingRequire=void 0;var yia=H0r(),Eia=H0r();Object.defineProperty(dR,"makePatchingRequire",{enumerable:!0,get:a(function(){return Eia.makePatchingRequire},"get")});var _ia=a(function(t){return!0},"trueFilter");dR.trueFilter=_ia;var Msi=(function(){function t(){this.version=Dsi().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=dR.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=dR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();G0r=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Jme,"suppressTracing");a(Osi,"unsuppressTracing");a(eG,"isTracingSuppressed")});var Lsi,npt,Zme,ipt,Bsi,Fsi,Usi,$0r=ve(()=>{p();Lsi="=",npt=";",Zme=",",ipt="baggage",Bsi=180,Fsi=4096,Usi=8192});function opt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Zme:"")+r;return n.length>Usi?e:n},"")}function spt(t){return t.getAllEntries().map(function(e){var r=via(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=npt+o.metadata.toString()),s})}function SMe(t){var e=t.split(npt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Lsi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Hpe(e.join(npt))),{key:o,value:s,metadata:c}}}}}function Qsi(t){return typeof t!="string"||t.length===0?{}:t.split(Zme).map(function(e){return SMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var via,V0r=ve(()=>{p();co();$0r();via=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(opt,"serializeKeyPairs");a(spt,"getKeyPairs");a(SMe,"parsePairKeyValue");a(Qsi,"parseKeyPairsIntoRecord")});var apt,qsi=ve(()=>{p();co();bMe();$0r();V0r();apt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=kT.getBaggage(e);if(!(!o||eG(e))){var s=spt(o).filter(function(l){return l.length<=Fsi}).slice(0,Bsi),c=opt(s);c.length>0&&n.set(r,ipt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,ipt),s=Array.isArray(o)?o.join(Zme):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Zme);return l.forEach(function(u){var d=SMe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:kT.setBaggage(e,kT.createBaggage(c))},t.prototype.fields=function(){return[ipt]},t})()});var jsi,Hsi=ve(()=>{p();jsi=(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 tG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Gsi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=Cia(s.value,2),l=c[0],u=c[1];if(!W0r(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!TMe(u)){Dn.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 W0r(t){return typeof t=="string"&&t.length>0}function TMe(t){return t==null?!0:Array.isArray(t)?bia(t):$si(t)}function bia(t){var e,r,n;try{for(var o=Gsi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if($si(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 $si(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Gsi,Cia,Vsi=ve(()=>{p();co();Gsi=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.")},Cia=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(tG,"sanitizeAttributes");a(W0r,"isAttributeKey");a(TMe,"isAttributeValue");a(bia,"isHomogeneousAttributeValueArray");a($si,"isValidPrimitiveAttributeValue")});function cpt(){return function(t){Dn.error(Sia(t))}}function Sia(t){return typeof t=="string"?t:JSON.stringify(Tia(t))}function Tia(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 z0r=ve(()=>{p();co();a(cpt,"loggingErrorHandler");a(Sia,"stringifyException");a(Tia,"flattenException")});function zsi(t){Wsi=t}function Ev(t){try{Wsi(t)}catch{}}var Wsi,Y0r=ve(()=>{p();z0r();Wsi=cpt();a(zsi,"setGlobalErrorHandler");a(Ev,"globalErrorHandler")});var Fb,K0r=ve(()=>{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"})(Fb||(Fb={}))});function wia(t){return xia.indexOf(t)>-1}function kia(t){return Ria.indexOf(t)>-1}function Dia(t){return Pia.indexOf(t)>-1}function Nia(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Mia(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 Oia(t,e,r,n){n===void 0&&(n=Iia);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Bia(t,e,r){var n=r[t];if(typeof n=="string"){var o=Lia[n.toUpperCase()];o!=null&&(e[t]=o)}}function xMe(t){var e={};for(var r in IMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":Bia(n,e,t);break;default:if(wia(n))Nia(n,e,t);else if(kia(n))Mia(n,e,t);else if(Dia(n))Oia(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var Iia,xia,Ria,Pia,See,Tee,J0r,Z0r,IMe,Lia,X0r=ve(()=>{p();co();K0r();Iia=",",xia=["OTEL_SDK_DISABLED"];a(wia,"isEnvVarABoolean");Ria=["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(kia,"isEnvVarANumber");Pia=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(Dia,"isEnvVarAList");See=1/0,Tee=128,J0r=128,Z0r=128,IMe={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:See,OTEL_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:J0r,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Z0r,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Fb.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(Nia,"parseBoolean");a(Mia,"parseNumber");a(Oia,"parseStringList");Lia={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Bia,"setLogLevelFromEnv");a(xMe,"parseEnvironment")});function fR(){var t=xMe(process.env);return Object.assign({},IMe,t)}function Xme(){return xMe(process.env)}var Ysi=ve(()=>{p();X0r();a(fR,"getEnv");a(Xme,"getEnvWithoutDefaults")});var lpt,Ksi=ve(()=>{p();lpt=typeof globalThis=="object"?globalThis:global});function Jsi(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function upt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Jsi,"intValue");a(upt,"hexToBinary")});function dpt(t){return Buffer.from(upt(t)).toString("base64")}var Zsi=ve(()=>{p();egr();a(dpt,"hexToBase64")});function Xsi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(fpt[t-1]=1);return fpt.toString("hex",0,t)},"generateId")}var Fia,eai,ppt,fpt,tai=ve(()=>{p();Fia=8,eai=16,ppt=(function(){function t(){this.generateTraceId=Xsi(eai),this.generateSpanId=Xsi(Fia)}return a(t,"RandomIdGenerator"),t})(),fpt=Buffer.allocUnsafe(eai);a(Xsi,"getIdGenerator")});var rai,pR,nai=ve(()=>{p();rai=require("perf_hooks"),pR=rai.performance});var hpt,tgr=ve(()=>{p();hpt="1.30.1"});var iai=ve(()=>{p()});var oai=ve(()=>{p();iai()});var Uia,Qia,qia,jia,sai,aai,cai,lai,Hia,uai,dai=ve(()=>{p();Uia="process.runtime.name",Qia="telemetry.sdk.name",qia="telemetry.sdk.language",jia="telemetry.sdk.version",sai=Uia,aai=Qia,cai=qia,lai=jia,Hia="nodejs",uai=Hia});var fai=ve(()=>{p();dai()});var pai=ve(()=>{p()});var hai=ve(()=>{p()});var mai=ve(()=>{p();oai();fai();pai();hai()});var e0e,rG,gai=ve(()=>{p();tgr();mai();rG=(e0e={},e0e[aai]="opentelemetry",e0e[sai]="node",e0e[cai]=uai,e0e[lai]=hpt,e0e)});function t0e(t){t.unref()}var Aai=ve(()=>{p();a(t0e,"unrefTimer")});var yai=ve(()=>{p();Ysi();Ksi();Zsi();tai();nai();gai();Aai()});var rgr=ve(()=>{p();yai()});function eD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*$ia);return[r,n]}function r0e(){var t=pR.timeOrigin;if(typeof t!="number"){var e=pR;t=e.timing&&e.timing.fetchStart}return t}function wMe(t){var e=eD(r0e()),r=eD(typeof t=="number"?t:pR.now());return PMe(e,r)}function _ai(t){if(n0e(t))return t;if(typeof t=="number")return t=mpt&&(r[1]-=mpt,r[0]+=1),r}var Eai,Gia,$ia,mpt,Sai=ve(()=>{p();rgr();Eai=9,Gia=6,$ia=Math.pow(10,Gia),mpt=Math.pow(10,Eai);a(eD,"millisToHrTime");a(r0e,"getTimeOrigin");a(wMe,"hrTime");a(_ai,"timeInputToHrTime");a(gpt,"hrTimeDuration");a(vai,"hrTimeToTimeStamp");a(Cai,"hrTimeToNanoseconds");a(bai,"hrTimeToMilliseconds");a(RMe,"hrTimeToMicroseconds");a(n0e,"isTimeInputHrTime");a(kMe,"isTimeInput");a(PMe,"addHrTimes")});var GT,Tai=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(GT||(GT={}))});var Via,Apt,Iai=ve(()=>{p();co();Via=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.")},Apt=(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=Via(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Dn.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){Dn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function xai(t){return Yia.test(t)}function wai(t){return Kia.test(t)&&!Jia.test(t)}var ngr,Wia,zia,Yia,Kia,Jia,Rai=ve(()=>{p();ngr="[_0-9a-z-*/]",Wia="[a-z]"+ngr+"{0,255}",zia="[a-z0-9]"+ngr+"{0,240}@[a-z]"+ngr+"{0,13}",Yia=new RegExp("^(?:"+Wia+"|"+zia+")$"),Kia=/^[ -~]{0,255}[!-~]$/,Jia=/,|=/;a(xai,"validateKey");a(wai,"validateValue")});var kai,Zia,Pai,Dai,ypt,igr=ve(()=>{p();Rai();kai=32,Zia=512,Pai=",",Dai="=",ypt=(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+Dai+e.get(n)),r},[]).join(Pai)},t.prototype._parse=function(e){e.length>Zia||(this._internalState=e.split(Pai).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Dai);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);xai(c)&&wai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>kai&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,kai))))},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 ogr(t){var e=ioa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var DMe,NMe,Xia,eoa,toa,roa,noa,ioa,Ept,Nai=ve(()=>{p();co();bMe();igr();DMe="traceparent",NMe="tracestate",Xia="00",eoa="(?!ff)[\\da-f]{2}",toa="(?![0]{32})[\\da-f]{32}",roa="(?![0]{16})[\\da-f]{16}",noa="[\\da-f]{2}",ioa=new RegExp("^\\s?("+eoa+")-("+toa+")-("+roa+")-("+noa+")(-.*)?\\s?$");a(ogr,"parseTraceParent");Ept=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=wu.getSpanContext(e);if(!(!o||eG(e)||!vb(o))){var s=Xia+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||wf.NONE).toString(16);n.set(r,DMe,s),o.traceState&&n.set(r,NMe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,DMe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=ogr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,NMe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new ypt(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)},t.prototype.fields=function(){return[DMe,NMe]},t})()});function Mai(t,e){return t.setValue(sgr,e)}function Oai(t){return t.deleteValue(sgr)}function Lai(t){return t.getValue(sgr)}var sgr,_pt,Bai=ve(()=>{p();co();sgr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(_pt||(_pt={}));a(Mai,"setRPCMetadata");a(Oai,"deleteRPCMetadata");a(Lai,"getRPCMetadata")});var MMe,agr=ve(()=>{p();co();MMe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:Cb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var i0e,cgr=ve(()=>{p();co();i0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:Cb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Fai,Uai=ve(()=>{p();co();Y0r();agr();cgr();Fai=(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 i0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new i0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new MMe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new i0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new MMe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.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 Qai,qai=ve(()=>{p();co();Qai=(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:aX(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 doa(t,e){return function(r){return t(e(r))}}function lgr(t){if(!foa(t)||poa(t)!==ooa)return!1;var e=uoa(t);if(e===null)return!0;var r=Gai.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&jai.call(r)===loa}function foa(t){return t!=null&&typeof t=="object"}function poa(t){return t==null?t===void 0?aoa:soa:Iee&&Iee in Object(t)?hoa(t):moa(t)}function hoa(t){var e=Gai.call(t,Iee),r=t[Iee],n=!1;try{t[Iee]=void 0,n=!0}catch{}var o=$ai.call(t);return n&&(e?t[Iee]=r:delete t[Iee]),o}function moa(t){return $ai.call(t)}var ooa,soa,aoa,coa,jai,loa,uoa,Hai,Gai,Iee,$ai,Vai=ve(()=>{p();ooa="[object Object]",soa="[object Null]",aoa="[object Undefined]",coa=Function.prototype,jai=coa.toString,loa=jai.call(Object),uoa=doa(Object.getPrototypeOf,Object),Hai=Object.prototype,Gai=Hai.hasOwnProperty,Iee=Symbol?Symbol.toStringTag:void 0,$ai=Hai.toString;a(doa,"overArg");a(lgr,"isPlainObject");a(foa,"isObjectLike");a(poa,"baseGetTag");a(hoa,"getRawTag");a(moa,"objectToString")});function bpt(){for(var t=[],e=0;e0;)r=zai(r,t.shift(),0,n);return r}function ugr(t){return Cpt(t)?t.slice():t}function zai(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>goa)){if(r++,vpt(t)||vpt(e)||Yai(e))o=ugr(e);else if(Cpt(t)){if(o=t.slice(),Cpt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Wai(t,u,n)||Wai(e,u,n))delete o[u];else{if(OMe(f)&&OMe(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]=zai(o[u],d,r,n)}}}}else o=e;return o}}function Wai(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 Aoa(t,e){return!(!lgr(t)||!lgr(e))}var goa,Kai=ve(()=>{p();Vai();goa=20;a(bpt,"merge");a(ugr,"takeValue");a(zai,"mergeTwoObjects");a(Wai,"wasObjectReferenced");a(Cpt,"isArray");a(Yai,"isFunction");a(OMe,"isObject");a(vpt,"isPrimitive");a(Aoa,"shouldMerge")});function Jai(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new dgr("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 yoa,dgr,Zai=ve(()=>{p();yoa=(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)}})(),dgr=(function(t){yoa(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(Jai,"callWithTimeout")});function fgr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Xai(t,e){var r,n;if(!e)return!1;try{for(var o=Eoa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(fgr(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 Eoa,eci=ve(()=>{p();Eoa=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(fgr,"urlMatches");a(Xai,"isUrlIgnored")});function tci(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var rci=ve(()=>{p();a(tci,"isWrapped")});var nci,ici=ve(()=>{p();nci=(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 _oa,voa,o0e,oci=ve(()=>{p();ici();_oa=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},voa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();bMe();a(sci,"_export")});var cci={};ki(cci,{AlwaysOffSampler:()=>MMe,AlwaysOnSampler:()=>i0e,AnchoredClock:()=>jsi,BindOnceFuture:()=>o0e,CompositePropagator:()=>Apt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>See,DEFAULT_ENVIRONMENT:()=>IMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>J0r,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Z0r,ExportResultCode:()=>GT,ParentBasedSampler:()=>Fai,RPCType:()=>_pt,RandomIdGenerator:()=>ppt,SDK_INFO:()=>rG,TRACE_PARENT_HEADER:()=>DMe,TRACE_STATE_HEADER:()=>NMe,TimeoutError:()=>dgr,TraceIdRatioBasedSampler:()=>Qai,TraceState:()=>ypt,TracesSamplerValues:()=>Fb,VERSION:()=>hpt,W3CBaggagePropagator:()=>apt,W3CTraceContextPropagator:()=>Ept,_globalThis:()=>lpt,addHrTimes:()=>PMe,baggageUtils:()=>Coa,callWithTimeout:()=>Jai,deleteRPCMetadata:()=>Oai,getEnv:()=>fR,getEnvWithoutDefaults:()=>Xme,getRPCMetadata:()=>Lai,getTimeOrigin:()=>r0e,globalErrorHandler:()=>Ev,hexToBase64:()=>dpt,hexToBinary:()=>upt,hrTime:()=>wMe,hrTimeDuration:()=>gpt,hrTimeToMicroseconds:()=>RMe,hrTimeToMilliseconds:()=>bai,hrTimeToNanoseconds:()=>Cai,hrTimeToTimeStamp:()=>vai,internal:()=>pgr,isAttributeKey:()=>W0r,isAttributeValue:()=>TMe,isTimeInput:()=>kMe,isTimeInputHrTime:()=>n0e,isTracingSuppressed:()=>eG,isUrlIgnored:()=>Xai,isWrapped:()=>tci,loggingErrorHandler:()=>cpt,merge:()=>bpt,millisToHrTime:()=>eD,otperformance:()=>pR,parseEnvironment:()=>xMe,parseTraceParent:()=>ogr,sanitizeAttributes:()=>tG,setGlobalErrorHandler:()=>zsi,setRPCMetadata:()=>Mai,suppressTracing:()=>Jme,timeInputToHrTime:()=>_ai,unrefTimer:()=>t0e,unsuppressTracing:()=>Osi,urlMatches:()=>fgr});var Coa,pgr,Ub=ve(()=>{p();qsi();Hsi();Vsi();Y0r();z0r();Sai();egr();Tai();V0r();rgr();Iai();Nai();Bai();agr();cgr();Uai();qai();bMe();igr();X0r();Kai();K0r();Zai();eci();rci();oci();tgr();aci();Coa={getKeyPairs:spt,serializeKeyPairs:opt,parseKeyPairsIntoRecord:Qsi,parsePairKeyValue:SMe},pgr={_export:sci}});var boa,Soa,Toa,Spt,Tpt,lci,uci=ve(()=>{p();boa="exception.type",Soa="exception.message",Toa="exception.stacktrace",Spt=boa,Tpt=Soa,lci=Toa});var dci=ve(()=>{p();uci()});var fci=ve(()=>{p()});var pci=ve(()=>{p();fci()});var hci=ve(()=>{p()});var mci=ve(()=>{p()});var gci=ve(()=>{p();dci();pci();hci();mci()});var Aci,yci=ve(()=>{p();Aci="exception"});var hgr,Ioa,Eci,xoa,Ipt,mgr=ve(()=>{p();co();Ub();gci();yci();hgr=function(){return hgr=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.")},Eci=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},xoa=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):(Dn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=Ioa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Eci(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 Dn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Dn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),kMe(r)&&(kMe(n)||(n=r),r=void 0);var o=tG(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,xoa([],Eci(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=hgr({},e),this.status.message!=null&&typeof e.message!="string"&&(Dn.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()){Dn.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=gpt(this.startTime,this.endTime),this._duration[0]<0&&(Dn.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&&Dn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=pR.now())return wMe(e+this._performanceOffset);if(typeof e=="number")return eD(e);if(e instanceof Date)return eD(e.getTime());if(n0e(e))return e;if(this._startTimeProvided)return eD(Date.now());var r=pR.now()-this._performanceStartTime;return PMe(this.startTime,eD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Tpt]=e:e&&(e.code?n[Spt]=e.code.toString():e.name&&(n[Spt]=e.name),e.message&&(n[Tpt]=e.message),e.stack&&(n[lci]=e.stack)),n[Spt]||n[Tpt]?this.addEvent(Aci,n,r):Dn.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&&Dn.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?(Dn.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 tD,LMe=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(tD||(tD={}))});var nG,xpt=ve(()=>{p();LMe();nG=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:tD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var C4,wpt=ve(()=>{p();LMe();C4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:tD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var s0e,ggr=ve(()=>{p();co();Ub();xpt();wpt();s0e=(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 C4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new C4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new nG,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new C4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new nG}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.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 BMe,Agr=ve(()=>{p();co();LMe();BMe=(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:aX(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 Rpt(){var t=fR();return{sampler:ygr(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 ygr(t){switch(t===void 0&&(t=fR()),t.OTEL_TRACES_SAMPLER){case Fb.AlwaysOn:return new C4;case Fb.AlwaysOff:return new nG;case Fb.ParentBasedAlwaysOn:return new s0e({root:new C4});case Fb.ParentBasedAlwaysOff:return new s0e({root:new nG});case Fb.TraceIdRatio:return new BMe(_ci(t));case Fb.ParentBasedTraceIdRatio:return new s0e({root:new BMe(_ci(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+woa+'".'),new C4}}function _ci(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Dn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+a0e+"."),a0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+a0e+"."),a0e):e<0||e>1?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+a0e+"."),a0e):e}var woa,a0e,Egr=ve(()=>{p();co();Ub();xpt();wpt();ggr();Agr();woa=Fb.AlwaysOn,a0e=1;a(Rpt,"loadDefaultConfig");a(ygr,"buildSamplerFromEnv");a(_ci,"getSamplerProbabilityFromEnv")});function vci(t){var e={sampler:ygr()},r=Rpt(),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 Cci(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=Xme();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:Tee,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:See,Object.assign({},t,{spanLimits:g})}var _gr=ve(()=>{p();Egr();Ub();a(vci,"mergeConfig");a(Cci,"reconfigureLimits")});var bci,Sci=ve(()=>{p();co();Ub();bci=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=fR();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 o0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Dn.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&wf.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&&Dn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Dn.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),t0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var Roa,c0e,Tci=ve(()=>{p();Sci();Roa=(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)}})(),c0e=(function(t){Roa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(bci)});function Ici(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(kpt[t-1]=1);return kpt.toString("hex",0,t)},"generateId")}var koa,xci,l0e,kpt,wci=ve(()=>{p();koa=8,xci=16,l0e=(function(){function t(){this.generateTraceId=Ici(xci),this.generateSpanId=Ici(koa)}return a(t,"RandomIdGenerator"),t})(),kpt=Buffer.allocUnsafe(xci);a(Ici,"getIdGenerator")});var Rci=ve(()=>{p();Tci();wci()});var Ppt=ve(()=>{p();Rci()});var Dpt,vgr=ve(()=>{p();co();Ub();mgr();_gr();Ppt();Dpt=(function(){function t(e,r,n){this._tracerProvider=n;var o=vci(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new l0e,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=Og.active()),r.root&&(n=wu.deleteSpan(n));var l=wu.getSpan(n);if(eG(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=wu.wrapSpanContext(Gpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!wu.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:$pe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:tG(R.attributes)}}),E=tG(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===Cb.RECORD_AND_SAMPLED?wf.SAMPLED:wf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===Cb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=wu.wrapSpanContext(b);return u}var T=tG(Object.assign(E,_.attributes)),w=new Ipt(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??Og.active(),d=this.startSpan(e,s,u),f=wu.setSpan(u,d);return Og.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 kci=ve(()=>{p()});var Pci=ve(()=>{p();kci()});var Poa,Doa,Noa,Moa,Dci,Cgr,bgr,Sgr,Nci=ve(()=>{p();Poa="service.name",Doa="telemetry.sdk.name",Noa="telemetry.sdk.language",Moa="telemetry.sdk.version",Dci=Poa,Cgr=Doa,bgr=Noa,Sgr=Moa});var Mci=ve(()=>{p();Nci()});var Oci=ve(()=>{p()});var Lci=ve(()=>{p()});var Bci=ve(()=>{p();Pci();Mci();Oci();Lci()});function Npt(){return"unknown_service:"+process.argv0}var Fci=ve(()=>{p();a(Npt,"defaultServiceName")});var Uci=ve(()=>{p();Fci()});var Qci=ve(()=>{p();Uci()});var iG,Ooa,Loa,Boa,Mpt,qci=ve(()=>{p();co();Bci();Ub();Qci();iG=function(){return iG=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},Mpt=(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 Dn.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[Dci]=Npt(),e[bgr]=rG[bgr],e[Cgr]=rG[Cgr],e[Sgr]=rG[Sgr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Dn.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 Ooa(this,void 0,void 0,function(){return Loa(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=iG(iG({},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=Boa(c,2),d=u[0],f=u[1];return iG(iG(iG(iG({},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 jci=ve(()=>{p();qci()});var Opt,Tgr,Hci=ve(()=>{p();Ub();Opt=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.")},Tgr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Opt(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=Opt(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=Opt(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=Opt(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 Lpt,Igr=ve(()=>{p();Lpt=(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 Foa,Uoa,N8,Gci,$ci=ve(()=>{p();co();Ub();jci();vgr();Egr();Hci();Igr();Ppt();_gr();Foa=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},Uoa=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(fR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Dn.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 Apt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=fR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Dn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Ept}],["baggage",function(){return new apt}]]),t._registeredExporters=new Map,t})()});var Qoa,Vci,Wci=ve(()=>{p();Ub();Qoa=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.")},Vci=(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:RMe(e.startTime),duration:RMe(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=Qoa(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:GT.SUCCESS})},t})()});var qoa,joa,zci,Yci=ve(()=>{p();Ub();qoa=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},joa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();Ub();Hoa=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())})},Goa=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]nG,AlwaysOnSampler:()=>C4,BasicTracerProvider:()=>Gci,BatchSpanProcessor:()=>c0e,ConsoleSpanExporter:()=>Vci,ForceFlushState:()=>N8,InMemorySpanExporter:()=>zci,NoopSpanProcessor:()=>Lpt,ParentBasedSampler:()=>s0e,RandomIdGenerator:()=>l0e,SamplingDecision:()=>tD,SimpleSpanProcessor:()=>Kci,Span:()=>Ipt,TraceIdRatioBasedSampler:()=>BMe,Tracer:()=>Dpt});var Xci=ve(()=>{p();vgr();$ci();Ppt();Wci();Yci();Jci();Igr();xpt();wpt();ggr();Agr();LMe();mgr()});var FMe,eli,xgr=ve(()=>{p();FMe=class{static{a(this,"NoopLogger")}emit(e){}},eli=new FMe});var wgr,Bpt,Rgr=ve(()=>{p();xgr();wgr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new FMe}},Bpt=new wgr});var Fpt,tli=ve(()=>{p();xgr();Fpt=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):eli}}});var UMe,rli=ve(()=>{p();Rgr();tli();UMe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Fpt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Bpt}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 Upt,nli=ve(()=>{p();Upt=typeof globalThis=="object"?globalThis:global});var ili=ve(()=>{p();nli()});var oli=ve(()=>{p();ili()});function sli(t,e,r){return n=>n===t?e:r}var QMe,u0e,kgr,ali=ve(()=>{p();oli();QMe=Symbol.for("io.opentelemetry.js.api.logs"),u0e=Upt;a(sli,"makeGetter");kgr=1});var Qpt,cli=ve(()=>{p();ali();Rgr();rli();Qpt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new UMe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return u0e[QMe]?this.getLoggerProvider():(u0e[QMe]=sli(kgr,e,Bpt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=u0e[QMe])===null||e===void 0?void 0:e.call(u0e,kgr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete u0e[QMe],this._proxyLoggerProvider=new UMe}}});var qpt,Pgr=ve(()=>{p();cli();qpt=Qpt.getInstance()});function lli(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var dli=ve(()=>{p();a(lli,"enableInstrumentations");a(uli,"disableInstrumentations")});function fli(t){let e=t.tracerProvider||wu.getTracerProvider(),r=t.meterProvider||cX.getMeterProvider(),n=t.loggerProvider||qpt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return lli(o,e,r,n),()=>{uli(o)}}var pli=ve(()=>{p();co();Pgr();dli();a(fli,"registerInstrumentations")});function Eli(t,e,r){if(!Woa(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=Joa(t);if(!n)return!1;let o=[],s=_li(n,e,o,r);return s&&!r?.includePrerelease?Yoa(n,o):s}function Woa(t){return typeof t=="string"&&yli.test(t)}function _li(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Dgr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=ysa(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Dgr(t,s,r,n))return!1;return!0}return Dgr(t,e,r,n)}function Dgr(t,e,r,n){if(e=Koa(e,n),e.includes(" "))return _li(t,e,r,n);{let o=Zoa(e);return r.push(o),zoa(t,o)}}function zoa(t,e){if(e.invalid)return!1;if(!e.version||Mgr(e.version))return!0;let r=mli(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=mli(n,o)}return Voa[e.op]?.includes(r)}function Yoa(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function Koa(t,e){return t=t.trim(),t=gsa(t,e),t=msa(t),t=Asa(t,e),t=t.trim(),t}function _v(t){return!t||t.toLowerCase()==="x"||t==="*"}function Joa(t){let e=t.match(yli);if(!e){Dn.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 Zoa(t){if(!t)return{};let e=t.match($oa);if(!e)return Dn.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 Mgr(t){return t==="*"||t==="x"||t==="X"}function hli(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Xoa(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 esa(t,e){if(Mgr(t)||Mgr(e))return 0;let[r,n]=Xoa(hli(t),hli(e));return r>n?1:r{let l;return _v(n)?l="":_v(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:_v(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 gsa(t,e){let r=hsa,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return _v(s)?d="":_v(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:_v(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 Asa(t,e){let r=ssa;return t.replace(r,(n,o,s,c,l,u)=>{let d=_v(s),f=d||_v(c),h=f||_v(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 ysa(t,e){let r=csa;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(_v(s)?o="":_v(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:_v(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,_v(h)?f="":_v(m)?f=`<${+h+1}.0.0-0`:_v(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 yli,$oa,Voa,vli,Cli,tsa,rsa,gli,nsa,Ali,isa,Ngr,qMe,osa,ssa,asa,csa,lsa,usa,dsa,fsa,psa,hsa,bli=ve(()=>{p();co();yli=/^(?: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-]+)*))?$/,$oa=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,Voa={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Eli,"satisfies");a(Woa,"_validateVersion");a(_li,"_doSatisfies");a(Dgr,"_checkRange");a(zoa,"_satisfies");a(Yoa,"_doPreleaseCheck");a(Koa,"_normalizeRange");a(_v,"isX");a(Joa,"_parseVersion");a(Zoa,"_parseRange");a(Mgr,"_isWildcard");a(hli,"_parseVersionString");a(Xoa,"_normalizeVersionType");a(esa,"_compareVersionStrings");a(mli,"_compareVersionSegments");vli="[a-zA-Z0-9-]",Cli="0|[1-9]\\d*",tsa=`\\d*[a-zA-Z-]${vli}*`,rsa="((?:<|>)?=?)",gli=`(?:${Cli}|${tsa})`,nsa=`(?:-(${gli}(?:\\.${gli})*))`,Ali=`${vli}+`,isa=`(?:\\+(${Ali}(?:\\.${Ali})*))`,Ngr=`${Cli}|x|X|\\*`,qMe=`[v=\\s]*(${Ngr})(?:\\.(${Ngr})(?:\\.(${Ngr})(?:${nsa})?${isa}?)?)?`,osa=`^${rsa}\\s*${qMe}$`,ssa=new RegExp(osa),asa=`^\\s*(${qMe})\\s+-\\s+(${qMe})\\s*$`,csa=new RegExp(asa),lsa="(?:~>?)",usa=`^${lsa}${qMe}$`,dsa=new RegExp(usa),fsa="(?:\\^)",psa=`^${fsa}${qMe}$`,hsa=new RegExp(psa);a(msa,"replaceTilde");a(gsa,"replaceCaret");a(Asa,"replaceXRange");a(ysa,"replaceHyphen")});var d0e=I((Jsp,Ili)=>{"use strict";p();function Ogr(t){return typeof t=="function"}a(Ogr,"isFunction");var vv=console.error.bind(console);function jMe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(jMe,"defineProperty");function HMe(t){t&&t.logger&&(Ogr(t.logger)?vv=t.logger:vv("new logger isn't a function, not replacing"))}a(HMe,"shimmer");function Sli(t,e,r){if(!t||!t[e]){vv("no original function "+e+" to wrap");return}if(!r){vv("no wrapper function"),vv(new Error().stack);return}if(!Ogr(t[e])||!Ogr(r)){vv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return jMe(o,"__original",n),jMe(o,"__unwrap",function(){t[e]===o&&jMe(t,e,n)}),jMe(o,"__wrapped",!0),jMe(t,e,o),o}a(Sli,"wrap");function Esa(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{vv("must provide one or more modules to patch"),vv(new Error().stack);return}if(!(e&&Array.isArray(e))){vv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Sli(n,o,r)})})}a(Esa,"massWrap");function Tli(t,e){if(!t||!t[e]){vv("no function to unwrap."),vv(new Error().stack);return}if(!t[e].__unwrap)vv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Tli,"unwrap");function _sa(t,e){if(t)Array.isArray(t)||(t=[t]);else{vv("must provide one or more modules to patch"),vv(new Error().stack);return}if(!(e&&Array.isArray(e))){vv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Tli(r,n)})})}a(_sa,"massUnwrap");HMe.wrap=Sli;HMe.massWrap=Esa;HMe.unwrap=Tli;HMe.massUnwrap=_sa;Ili.exports=HMe});var oG,jpt,xli=ve(()=>{p();co();Pgr();oG=de(d0e()),jpt=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=Dn.createComponentLogger({namespace:e}),this._tracer=wu.getTracer(e,r),this._meter=cX.getMeter(e,r),this._logger=qpt.getLogger(e,r),this._updateMetricInstruments()}_wrap=oG.wrap;_unwrap=oG.unwrap;_massWrap=oG.massWrap;_massUnwrap=oG.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 Rli=I((oap,wli)=>{p();var f0e=1e3,p0e=f0e*60,h0e=p0e*60,xee=h0e*24,vsa=xee*7,Csa=xee*365.25;wli.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return bsa(t);if(r==="number"&&isFinite(t))return e.long?Tsa(t):Ssa(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bsa(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*Csa;case"weeks":case"week":case"w":return r*vsa;case"days":case"day":case"d":return r*xee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*h0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*p0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*f0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(bsa,"parse");function Ssa(t){var e=Math.abs(t);return e>=xee?Math.round(t/xee)+"d":e>=h0e?Math.round(t/h0e)+"h":e>=p0e?Math.round(t/p0e)+"m":e>=f0e?Math.round(t/f0e)+"s":t+"ms"}a(Ssa,"fmtShort");function Tsa(t){var e=Math.abs(t);return e>=xee?Hpt(t,e,xee,"day"):e>=h0e?Hpt(t,e,h0e,"hour"):e>=p0e?Hpt(t,e,p0e,"minute"):e>=f0e?Hpt(t,e,f0e,"second"):t+" ms"}a(Tsa,"fmtLong");function Hpt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Hpt,"plural")});var Lgr=I((cap,kli)=>{p();function Isa(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Rli(),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(Isa,"setup");kli.exports=Isa});var Pli=I((Qb,Gpt)=>{p();Qb.formatArgs=wsa;Qb.save=Rsa;Qb.load=ksa;Qb.useColors=xsa;Qb.storage=Psa();Qb.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`."))}})();Qb.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 xsa(){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(xsa,"useColors");function wsa(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gpt.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(wsa,"formatArgs");Qb.log=console.debug||console.log||(()=>{});function Rsa(t){try{t?Qb.storage.setItem("debug",t):Qb.storage.removeItem("debug")}catch{}}a(Rsa,"save");function ksa(){let t;try{t=Qb.storage.getItem("debug")||Qb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(ksa,"load");function Psa(){try{return localStorage}catch{}}a(Psa,"localstorage");Gpt.exports=Lgr()(Qb);var{formatters:Dsa}=Gpt.exports;Dsa.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Nli=I((jg,Vpt)=>{p();var Nsa=require("tty"),$pt=require("util");jg.init=Qsa;jg.log=Bsa;jg.formatArgs=Osa;jg.save=Fsa;jg.load=Usa;jg.useColors=Msa;jg.destroy=$pt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");jg.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(jg.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{}jg.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 Msa(){return"colors"in jg.inspectOpts?!!jg.inspectOpts.colors:Nsa.isatty(process.stderr.fd)}a(Msa,"useColors");function Osa(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:Ssi.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,Lna.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};v4.InlineEditRequestLogContext=O0r;function Fna(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(Fna,"basename")});var Tsi=I(npt=>{"use strict";p();Object.defineProperty(npt,"__esModule",{value:!0});npt.GhostTextLogContext=void 0;var Una=rpt(),Qna=MA(),L0r=class extends Una.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,Qna.basename)(this.filePath)} (v${this.version})`}};npt.GhostTextLogContext=L0r});var nG=I(Jme=>{"use strict";p();Object.defineProperty(Jme,"__esModule",{value:!0});Jme.CopilotTokenStore=Jme.ICopilotTokenStore=void 0;var qna=nn(),jna=Ic(),Hna=ko();Jme.ICopilotTokenStore=(0,qna.createServiceIdentifier)("ICopilotTokenStore");var B0r=class extends Hna.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new jna.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()}};Jme.CopilotTokenStore=B0r});var ym=I(ay=>{"use strict";p();var Gna=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},$na=ay&&ay.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ay,"__esModule",{value:!0});ay.TelemetryTrustedValue=ay.ITelemetryService=ay.TelemetryUserConfigImpl=ay.ITelemetryUserConfig=void 0;ay.createTrackingIdGetter=Wna;ay.multiplexProperties=Yna;var Isi=nn(),Vna=nG();ay.ITelemetryUserConfig=(0,Isi.createServiceIdentifier)("ITelemetryUserConfig");var F0r=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)}};ay.TelemetryUserConfigImpl=F0r;ay.TelemetryUserConfigImpl=F0r=Gna([$na(2,Vna.ICopilotTokenStore)],F0r);function Wna(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(Wna,"createTrackingIdGetter");ay.ITelemetryService=(0,Isi.createServiceIdentifier)("ITelemetryService");var U0r=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};ay.TelemetryTrustedValue=U0r;var xMe=8192,zna=50;function Yna(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>xMe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+xMe;o{"use strict";p();var Kna=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]})),Jna=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Zna=Ho&&Ho.__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)&&Kna(e,t,r);return Jna(e,t),e},Q0r=Ho&&Ho.__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())})},q0r=Ho&&Ho.__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 G0r=See&&See.__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())})},$0r=See&&See.__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,C4.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 G0r(this,void 0,void 0,function(){var r,n,o;return $0r(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,C4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=bee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,C4.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 C4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return G0r(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return $0r(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,C4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return bee.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 Psi=ksi(),sia="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",aia="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",cia=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{lia.exports={}});var opt=I(Zme=>{"use strict";p();var uia=Zme&&Zme.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zme,"__esModule",{value:!0});Zme.JsonConfig=void 0;var dia=require("fs"),ipt=require("path"),V0r=Kl(),fia=uia(Nsi()),pia="APPLICATIONINSIGHTS_CONFIGURATION_FILE",hia="APPLICATIONINSIGHTS_CONNECTION_STRING",Msi="APPSETTING_",Osi="APPINSIGHTS_INSTRUMENTATIONKEY",Lsi="APPINSIGHTS_INSTRUMENTATION_KEY",mia="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",gia="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",Aia="http_proxy",yia="https_proxy",Eia="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",_ia="APPLICATION_INSIGHTS_NO_STATSBEAT",via="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",Cia="APPLICATION_INSIGHTS_NO_PATCH_MODULES",bia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",Sia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",Tia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",Iia="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",xia="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",wia=(function(){function t(){this.connectionString=process.env[hia],this.instrumentationKey=process.env[Osi]||process.env[Msi+Osi]||process.env[Lsi]||process.env[Msi+Lsi],!this.connectionString&&this.instrumentationKey&&V0r.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[gia],this.extendedMetricDisablers=process.env[mia],this.proxyHttpUrl=process.env[Aia],this.proxyHttpsUrl=process.env[yia],this.noDiagnosticChannel=!!process.env[Eia],this.disableStatsbeat=!!process.env[_ia],this.noHttpAgentKeepAlive=!!process.env[via],this.noPatchModules=process.env[Cia]||"",this.enableWebInstrumentation=!!process.env[bia]||!!process.env[Iia],this.webInstrumentationSrc=process.env[Tia]||"",this.webInstrumentationConnectionString=process.env[Sia]||process.env[xia]||"",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=ipt.join(__dirname,"../../");this._tempDir=ipt.join(o,n);var s=process.env[pia];if(s){ipt.isAbsolute(s)?this._tempDir=s:this._tempDir=ipt.join(o,s);try{e=dia.readFileSync(this._tempDir,"utf8")}catch(l){V0r.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(fia.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){V0r.warn("Invalid JSON config file: ",l)}},t})();Zme.JsonConfig=wia});var W0r=I(spt=>{"use strict";p();Object.defineProperty(spt,"__esModule",{value:!0});spt.makePatchingRequire=void 0;var Ria=require("path"),kia=EP(),Bsi=Sp(),Usi=require("module"),Pia=Object.keys(process.binding("natives")),Fsi=Usi.prototype.require;function Dia(t){var e={};return a(function(n){var o=Fsi.apply(this,arguments);if(t[n]){var s=Usi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(Pia.indexOf(n)<0)try{c=Fsi.call(this,Ria.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{Nia.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 Sp=I(pR=>{"use strict";p();Object.defineProperty(pR,"__esModule",{value:!0});pR.channel=pR.ContextPreservingEventEmitter=pR.trueFilter=pR.makePatchingRequire=void 0;var Mia=W0r(),Oia=W0r();Object.defineProperty(pR,"makePatchingRequire",{enumerable:!0,get:a(function(){return Oia.makePatchingRequire},"get")});var Lia=a(function(t){return!0},"trueFilter");pR.trueFilter=Lia;var jsi=(function(){function t(){this.version=Qsi().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=pR.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=pR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();z0r=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Xme,"suppressTracing");a(Hsi,"unsuppressTracing");a(iG,"isTracingSuppressed")});var Gsi,apt,e0e,cpt,$si,Vsi,Wsi,Y0r=ve(()=>{p();Gsi="=",apt=";",e0e=",",cpt="baggage",$si=180,Vsi=4096,Wsi=8192});function lpt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?e0e:"")+r;return n.length>Wsi?e:n},"")}function upt(t){return t.getAllEntries().map(function(e){var r=Bia(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=apt+o.metadata.toString()),s})}function RMe(t){var e=t.split(apt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Gsi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Gpe(e.join(apt))),{key:o,value:s,metadata:c}}}}}function zsi(t){return typeof t!="string"||t.length===0?{}:t.split(e0e).map(function(e){return RMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var Bia,K0r=ve(()=>{p();co();Y0r();Bia=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(lpt,"serializeKeyPairs");a(upt,"getKeyPairs");a(RMe,"parsePairKeyValue");a(zsi,"parseKeyPairsIntoRecord")});var dpt,Ysi=ve(()=>{p();co();wMe();Y0r();K0r();dpt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=DT.getBaggage(e);if(!(!o||iG(e))){var s=upt(o).filter(function(l){return l.length<=Vsi}).slice(0,$si),c=lpt(s);c.length>0&&n.set(r,cpt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,cpt),s=Array.isArray(o)?o.join(e0e):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(e0e);return l.forEach(function(u){var d=RMe(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[cpt]},t})()});var Ksi,Jsi=ve(()=>{p();Ksi=(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 oG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Zsi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=Fia(s.value,2),l=c[0],u=c[1];if(!J0r(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!kMe(u)){Dn.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 J0r(t){return typeof t=="string"&&t.length>0}function kMe(t){return t==null?!0:Array.isArray(t)?Uia(t):Xsi(t)}function Uia(t){var e,r,n;try{for(var o=Zsi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Xsi(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 Xsi(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Zsi,Fia,eai=ve(()=>{p();co();Zsi=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.")},Fia=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(oG,"sanitizeAttributes");a(J0r,"isAttributeKey");a(kMe,"isAttributeValue");a(Uia,"isHomogeneousAttributeValueArray");a(Xsi,"isValidPrimitiveAttributeValue")});function fpt(){return function(t){Dn.error(Qia(t))}}function Qia(t){return typeof t=="string"?t:JSON.stringify(qia(t))}function qia(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 Z0r=ve(()=>{p();co();a(fpt,"loggingErrorHandler");a(Qia,"stringifyException");a(qia,"flattenException")});function rai(t){tai=t}function vv(t){try{tai(t)}catch{}}var tai,X0r=ve(()=>{p();Z0r();tai=fpt();a(rai,"setGlobalErrorHandler");a(vv,"globalErrorHandler")});var Fb,egr=ve(()=>{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"})(Fb||(Fb={}))});function Gia(t){return Hia.indexOf(t)>-1}function Via(t){return $ia.indexOf(t)>-1}function zia(t){return Wia.indexOf(t)>-1}function Yia(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Kia(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 Jia(t,e,r,n){n===void 0&&(n=jia);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Xia(t,e,r){var n=r[t];if(typeof n=="string"){var o=Zia[n.toUpperCase()];o!=null&&(e[t]=o)}}function DMe(t){var e={};for(var r in PMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":Xia(n,e,t);break;default:if(Gia(n))Yia(n,e,t);else if(Via(n))Kia(n,e,t);else if(zia(n))Jia(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var jia,Hia,$ia,Wia,Tee,Iee,tgr,rgr,PMe,Zia,ngr=ve(()=>{p();co();egr();jia=",",Hia=["OTEL_SDK_DISABLED"];a(Gia,"isEnvVarABoolean");$ia=["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(Via,"isEnvVarANumber");Wia=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(zia,"isEnvVarAList");Tee=1/0,Iee=128,tgr=128,rgr=128,PMe={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:Na.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Tee,OTEL_ATTRIBUTE_COUNT_LIMIT:Iee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Tee,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Iee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Tee,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Iee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:tgr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:rgr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Fb.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(Yia,"parseBoolean");a(Kia,"parseNumber");a(Jia,"parseStringList");Zia={ALL:Na.ALL,VERBOSE:Na.VERBOSE,DEBUG:Na.DEBUG,INFO:Na.INFO,WARN:Na.WARN,ERROR:Na.ERROR,NONE:Na.NONE};a(Xia,"setLogLevelFromEnv");a(DMe,"parseEnvironment")});function hR(){var t=DMe(process.env);return Object.assign({},PMe,t)}function t0e(){return DMe(process.env)}var nai=ve(()=>{p();ngr();a(hR,"getEnv");a(t0e,"getEnvWithoutDefaults")});var ppt,iai=ve(()=>{p();ppt=typeof globalThis=="object"?globalThis:global});function oai(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function hpt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(oai,"intValue");a(hpt,"hexToBinary")});function mpt(t){return Buffer.from(hpt(t)).toString("base64")}var sai=ve(()=>{p();igr();a(mpt,"hexToBase64")});function aai(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(gpt[t-1]=1);return gpt.toString("hex",0,t)},"generateId")}var eoa,cai,Apt,gpt,lai=ve(()=>{p();eoa=8,cai=16,Apt=(function(){function t(){this.generateTraceId=aai(cai),this.generateSpanId=aai(eoa)}return a(t,"RandomIdGenerator"),t})(),gpt=Buffer.allocUnsafe(cai);a(aai,"getIdGenerator")});var uai,mR,dai=ve(()=>{p();uai=require("perf_hooks"),mR=uai.performance});var ypt,ogr=ve(()=>{p();ypt="1.30.1"});var fai=ve(()=>{p()});var pai=ve(()=>{p();fai()});var toa,roa,noa,ioa,hai,mai,gai,Aai,ooa,yai,Eai=ve(()=>{p();toa="process.runtime.name",roa="telemetry.sdk.name",noa="telemetry.sdk.language",ioa="telemetry.sdk.version",hai=toa,mai=roa,gai=noa,Aai=ioa,ooa="nodejs",yai=ooa});var _ai=ve(()=>{p();Eai()});var vai=ve(()=>{p()});var Cai=ve(()=>{p()});var bai=ve(()=>{p();pai();_ai();vai();Cai()});var r0e,sG,Sai=ve(()=>{p();ogr();bai();sG=(r0e={},r0e[mai]="opentelemetry",r0e[hai]="node",r0e[gai]=yai,r0e[Aai]=ypt,r0e)});function n0e(t){t.unref()}var Tai=ve(()=>{p();a(n0e,"unrefTimer")});var Iai=ve(()=>{p();nai();iai();sai();lai();dai();Sai();Tai()});var sgr=ve(()=>{p();Iai()});function nD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*aoa);return[r,n]}function i0e(){var t=mR.timeOrigin;if(typeof t!="number"){var e=mR;t=e.timing&&e.timing.fetchStart}return t}function NMe(t){var e=nD(i0e()),r=nD(typeof t=="number"?t:mR.now());return LMe(e,r)}function wai(t){if(o0e(t))return t;if(typeof t=="number")return t=Ept&&(r[1]-=Ept,r[0]+=1),r}var xai,soa,aoa,Ept,Dai=ve(()=>{p();sgr();xai=9,soa=6,aoa=Math.pow(10,soa),Ept=Math.pow(10,xai);a(nD,"millisToHrTime");a(i0e,"getTimeOrigin");a(NMe,"hrTime");a(wai,"timeInputToHrTime");a(_pt,"hrTimeDuration");a(Rai,"hrTimeToTimeStamp");a(kai,"hrTimeToNanoseconds");a(Pai,"hrTimeToMilliseconds");a(MMe,"hrTimeToMicroseconds");a(o0e,"isTimeInputHrTime");a(OMe,"isTimeInput");a(LMe,"addHrTimes")});var VT,Nai=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(VT||(VT={}))});var coa,vpt,Mai=ve(()=>{p();co();coa=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.")},vpt=(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=coa(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Dn.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){Dn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function Oai(t){return doa.test(t)}function Lai(t){return foa.test(t)&&!poa.test(t)}var agr,loa,uoa,doa,foa,poa,Bai=ve(()=>{p();agr="[_0-9a-z-*/]",loa="[a-z]"+agr+"{0,255}",uoa="[a-z0-9]"+agr+"{0,240}@[a-z]"+agr+"{0,13}",doa=new RegExp("^(?:"+loa+"|"+uoa+")$"),foa=/^[ -~]{0,255}[!-~]$/,poa=/,|=/;a(Oai,"validateKey");a(Lai,"validateValue")});var Fai,hoa,Uai,Qai,Cpt,cgr=ve(()=>{p();Bai();Fai=32,hoa=512,Uai=",",Qai="=",Cpt=(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+Qai+e.get(n)),r},[]).join(Uai)},t.prototype._parse=function(e){e.length>hoa||(this._internalState=e.split(Uai).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Qai);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Oai(c)&&Lai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Fai&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Fai))))},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 lgr(t){var e=_oa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var BMe,FMe,moa,goa,Aoa,yoa,Eoa,_oa,bpt,qai=ve(()=>{p();co();wMe();cgr();BMe="traceparent",FMe="tracestate",moa="00",goa="(?!ff)[\\da-f]{2}",Aoa="(?![0]{32})[\\da-f]{32}",yoa="(?![0]{16})[\\da-f]{16}",Eoa="[\\da-f]{2}",_oa=new RegExp("^\\s?("+goa+")-("+Aoa+")-("+yoa+")-("+Eoa+")(-.*)?\\s?$");a(lgr,"parseTraceParent");bpt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=wu.getSpanContext(e);if(!(!o||iG(e)||!vb(o))){var s=moa+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||kf.NONE).toString(16);n.set(r,BMe,s),o.traceState&&n.set(r,FMe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,BMe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=lgr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,FMe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new Cpt(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)},t.prototype.fields=function(){return[BMe,FMe]},t})()});function jai(t,e){return t.setValue(ugr,e)}function Hai(t){return t.deleteValue(ugr)}function Gai(t){return t.getValue(ugr)}var ugr,Spt,$ai=ve(()=>{p();co();ugr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Spt||(Spt={}));a(jai,"setRPCMetadata");a(Hai,"deleteRPCMetadata");a(Gai,"getRPCMetadata")});var UMe,dgr=ve(()=>{p();co();UMe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:Cb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var s0e,fgr=ve(()=>{p();co();s0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:Cb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Vai,Wai=ve(()=>{p();co();X0r();dgr();fgr();Vai=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(vv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new s0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new s0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new UMe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new s0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new UMe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&kf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&kf.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 zai,Yai=ve(()=>{p();co();zai=(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:lX(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 xoa(t,e){return function(r){return t(e(r))}}function pgr(t){if(!woa(t)||Roa(t)!==voa)return!1;var e=Ioa(t);if(e===null)return!0;var r=Zai.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Kai.call(r)===Toa}function woa(t){return t!=null&&typeof t=="object"}function Roa(t){return t==null?t===void 0?boa:Coa:xee&&xee in Object(t)?koa(t):Poa(t)}function koa(t){var e=Zai.call(t,xee),r=t[xee],n=!1;try{t[xee]=void 0,n=!0}catch{}var o=Xai.call(t);return n&&(e?t[xee]=r:delete t[xee]),o}function Poa(t){return Xai.call(t)}var voa,Coa,boa,Soa,Kai,Toa,Ioa,Jai,Zai,xee,Xai,eci=ve(()=>{p();voa="[object Object]",Coa="[object Null]",boa="[object Undefined]",Soa=Function.prototype,Kai=Soa.toString,Toa=Kai.call(Object),Ioa=xoa(Object.getPrototypeOf,Object),Jai=Object.prototype,Zai=Jai.hasOwnProperty,xee=Symbol?Symbol.toStringTag:void 0,Xai=Jai.toString;a(xoa,"overArg");a(pgr,"isPlainObject");a(woa,"isObjectLike");a(Roa,"baseGetTag");a(koa,"getRawTag");a(Poa,"objectToString")});function xpt(){for(var t=[],e=0;e0;)r=rci(r,t.shift(),0,n);return r}function hgr(t){return Ipt(t)?t.slice():t}function rci(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>Doa)){if(r++,Tpt(t)||Tpt(e)||nci(e))o=hgr(e);else if(Ipt(t)){if(o=t.slice(),Ipt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(tci(t,u,n)||tci(e,u,n))delete o[u];else{if(QMe(f)&&QMe(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]=rci(o[u],d,r,n)}}}}else o=e;return o}}function tci(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 Noa(t,e){return!(!pgr(t)||!pgr(e))}var Doa,ici=ve(()=>{p();eci();Doa=20;a(xpt,"merge");a(hgr,"takeValue");a(rci,"mergeTwoObjects");a(tci,"wasObjectReferenced");a(Ipt,"isArray");a(nci,"isFunction");a(QMe,"isObject");a(Tpt,"isPrimitive");a(Noa,"shouldMerge")});function oci(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new mgr("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 Moa,mgr,sci=ve(()=>{p();Moa=(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)}})(),mgr=(function(t){Moa(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(oci,"callWithTimeout")});function ggr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function aci(t,e){var r,n;if(!e)return!1;try{for(var o=Ooa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(ggr(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 Ooa,cci=ve(()=>{p();Ooa=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(ggr,"urlMatches");a(aci,"isUrlIgnored")});function lci(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var uci=ve(()=>{p();a(lci,"isWrapped")});var dci,fci=ve(()=>{p();dci=(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 Loa,Boa,a0e,pci=ve(()=>{p();fci();Loa=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},Boa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();wMe();a(hci,"_export")});var gci={};ki(gci,{AlwaysOffSampler:()=>UMe,AlwaysOnSampler:()=>s0e,AnchoredClock:()=>Ksi,BindOnceFuture:()=>a0e,CompositePropagator:()=>vpt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Iee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>Tee,DEFAULT_ENVIRONMENT:()=>PMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>tgr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>rgr,ExportResultCode:()=>VT,ParentBasedSampler:()=>Vai,RPCType:()=>Spt,RandomIdGenerator:()=>Apt,SDK_INFO:()=>sG,TRACE_PARENT_HEADER:()=>BMe,TRACE_STATE_HEADER:()=>FMe,TimeoutError:()=>mgr,TraceIdRatioBasedSampler:()=>zai,TraceState:()=>Cpt,TracesSamplerValues:()=>Fb,VERSION:()=>ypt,W3CBaggagePropagator:()=>dpt,W3CTraceContextPropagator:()=>bpt,_globalThis:()=>ppt,addHrTimes:()=>LMe,baggageUtils:()=>Foa,callWithTimeout:()=>oci,deleteRPCMetadata:()=>Hai,getEnv:()=>hR,getEnvWithoutDefaults:()=>t0e,getRPCMetadata:()=>Gai,getTimeOrigin:()=>i0e,globalErrorHandler:()=>vv,hexToBase64:()=>mpt,hexToBinary:()=>hpt,hrTime:()=>NMe,hrTimeDuration:()=>_pt,hrTimeToMicroseconds:()=>MMe,hrTimeToMilliseconds:()=>Pai,hrTimeToNanoseconds:()=>kai,hrTimeToTimeStamp:()=>Rai,internal:()=>Agr,isAttributeKey:()=>J0r,isAttributeValue:()=>kMe,isTimeInput:()=>OMe,isTimeInputHrTime:()=>o0e,isTracingSuppressed:()=>iG,isUrlIgnored:()=>aci,isWrapped:()=>lci,loggingErrorHandler:()=>fpt,merge:()=>xpt,millisToHrTime:()=>nD,otperformance:()=>mR,parseEnvironment:()=>DMe,parseTraceParent:()=>lgr,sanitizeAttributes:()=>oG,setGlobalErrorHandler:()=>rai,setRPCMetadata:()=>jai,suppressTracing:()=>Xme,timeInputToHrTime:()=>wai,unrefTimer:()=>n0e,unsuppressTracing:()=>Hsi,urlMatches:()=>ggr});var Foa,Agr,Ub=ve(()=>{p();Ysi();Jsi();eai();X0r();Z0r();Dai();igr();Nai();K0r();sgr();Mai();qai();$ai();dgr();fgr();Wai();Yai();wMe();cgr();ngr();ici();egr();sci();cci();uci();pci();ogr();mci();Foa={getKeyPairs:upt,serializeKeyPairs:lpt,parseKeyPairsIntoRecord:zsi,parsePairKeyValue:RMe},Agr={_export:hci}});var Uoa,Qoa,qoa,wpt,Rpt,Aci,yci=ve(()=>{p();Uoa="exception.type",Qoa="exception.message",qoa="exception.stacktrace",wpt=Uoa,Rpt=Qoa,Aci=qoa});var Eci=ve(()=>{p();yci()});var _ci=ve(()=>{p()});var vci=ve(()=>{p();_ci()});var Cci=ve(()=>{p()});var bci=ve(()=>{p()});var Sci=ve(()=>{p();Eci();vci();Cci();bci()});var Tci,Ici=ve(()=>{p();Tci="exception"});var ygr,joa,xci,Hoa,kpt,Egr=ve(()=>{p();co();Ub();Sci();Ici();ygr=function(){return ygr=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.")},xci=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},Hoa=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):(Dn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=joa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=xci(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 Dn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Dn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),OMe(r)&&(OMe(n)||(n=r),r=void 0);var o=oG(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,Hoa([],xci(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=ygr({},e),this.status.message!=null&&typeof e.message!="string"&&(Dn.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()){Dn.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=_pt(this.startTime,this.endTime),this._duration[0]<0&&(Dn.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&&Dn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=mR.now())return NMe(e+this._performanceOffset);if(typeof e=="number")return nD(e);if(e instanceof Date)return nD(e.getTime());if(o0e(e))return e;if(this._startTimeProvided)return nD(Date.now());var r=mR.now()-this._performanceStartTime;return LMe(this.startTime,nD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Rpt]=e:e&&(e.code?n[wpt]=e.code.toString():e.name&&(n[wpt]=e.name),e.message&&(n[Rpt]=e.message),e.stack&&(n[Aci]=e.stack)),n[wpt]||n[Rpt]?this.addEvent(Tci,n,r):Dn.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&&Dn.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?(Dn.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 iD,qMe=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(iD||(iD={}))});var aG,Ppt=ve(()=>{p();qMe();aG=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:iD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var b4,Dpt=ve(()=>{p();qMe();b4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:iD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var c0e,_gr=ve(()=>{p();co();Ub();Ppt();Dpt();c0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(vv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new b4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new b4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new aG,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new b4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new aG}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&kf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&kf.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 jMe,vgr=ve(()=>{p();co();qMe();jMe=(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:lX(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 Npt(){var t=hR();return{sampler:Cgr(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 Cgr(t){switch(t===void 0&&(t=hR()),t.OTEL_TRACES_SAMPLER){case Fb.AlwaysOn:return new b4;case Fb.AlwaysOff:return new aG;case Fb.ParentBasedAlwaysOn:return new c0e({root:new b4});case Fb.ParentBasedAlwaysOff:return new c0e({root:new aG});case Fb.TraceIdRatio:return new jMe(wci(t));case Fb.ParentBasedTraceIdRatio:return new c0e({root:new jMe(wci(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Goa+'".'),new b4}}function wci(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Dn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+l0e+"."),l0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+l0e+"."),l0e):e<0||e>1?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+l0e+"."),l0e):e}var Goa,l0e,bgr=ve(()=>{p();co();Ub();Ppt();Dpt();_gr();vgr();Goa=Fb.AlwaysOn,l0e=1;a(Npt,"loadDefaultConfig");a(Cgr,"buildSamplerFromEnv");a(wci,"getSamplerProbabilityFromEnv")});function Rci(t){var e={sampler:Cgr()},r=Npt(),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 kci(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=t0e();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:Iee,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:Tee,Object.assign({},t,{spanLimits:g})}var Sgr=ve(()=>{p();bgr();Ub();a(Rci,"mergeConfig");a(kci,"reconfigureLimits")});var Pci,Dci=ve(()=>{p();co();Ub();Pci=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=hR();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 a0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Dn.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&kf.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&&Dn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Dn.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,vv(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),n0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var $oa,u0e,Nci=ve(()=>{p();Dci();$oa=(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)}})(),u0e=(function(t){$oa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(Pci)});function Mci(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Mpt[t-1]=1);return Mpt.toString("hex",0,t)},"generateId")}var Voa,Oci,d0e,Mpt,Lci=ve(()=>{p();Voa=8,Oci=16,d0e=(function(){function t(){this.generateTraceId=Mci(Oci),this.generateSpanId=Mci(Voa)}return a(t,"RandomIdGenerator"),t})(),Mpt=Buffer.allocUnsafe(Oci);a(Mci,"getIdGenerator")});var Bci=ve(()=>{p();Nci();Lci()});var Opt=ve(()=>{p();Bci()});var Lpt,Tgr=ve(()=>{p();co();Ub();Egr();Sgr();Opt();Lpt=(function(){function t(e,r,n){this._tracerProvider=n;var o=Rci(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new d0e,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=Lg.active()),r.root&&(n=wu.deleteSpan(n));var l=wu.getSpan(n);if(iG(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=wu.wrapSpanContext($pe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!wu.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:Vpe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:oG(R.attributes)}}),E=oG(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===Cb.RECORD_AND_SAMPLED?kf.SAMPLED:kf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===Cb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=wu.wrapSpanContext(b);return u}var T=oG(Object.assign(E,_.attributes)),w=new kpt(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??Lg.active(),d=this.startSpan(e,s,u),f=wu.setSpan(u,d);return Lg.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 Fci=ve(()=>{p()});var Uci=ve(()=>{p();Fci()});var Woa,zoa,Yoa,Koa,Qci,Igr,xgr,wgr,qci=ve(()=>{p();Woa="service.name",zoa="telemetry.sdk.name",Yoa="telemetry.sdk.language",Koa="telemetry.sdk.version",Qci=Woa,Igr=zoa,xgr=Yoa,wgr=Koa});var jci=ve(()=>{p();qci()});var Hci=ve(()=>{p()});var Gci=ve(()=>{p()});var $ci=ve(()=>{p();Uci();jci();Hci();Gci()});function Bpt(){return"unknown_service:"+process.argv0}var Vci=ve(()=>{p();a(Bpt,"defaultServiceName")});var Wci=ve(()=>{p();Vci()});var zci=ve(()=>{p();Wci()});var cG,Joa,Zoa,Xoa,Fpt,Yci=ve(()=>{p();co();$ci();Ub();zci();cG=function(){return cG=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},Fpt=(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 Dn.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[Qci]=Bpt(),e[xgr]=sG[xgr],e[Igr]=sG[Igr],e[wgr]=sG[wgr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Dn.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 Joa(this,void 0,void 0,function(){return Zoa(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=cG(cG({},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=Xoa(c,2),d=u[0],f=u[1];return cG(cG(cG(cG({},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 Kci=ve(()=>{p();Yci()});var Upt,Rgr,Jci=ve(()=>{p();Ub();Upt=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.")},Rgr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Upt(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){vv(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Upt(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=Upt(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=Upt(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 Qpt,kgr=ve(()=>{p();Qpt=(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 esa,tsa,O8,Zci,Xci=ve(()=>{p();co();Ub();Kci();Tgr();bgr();Jci();kgr();Opt();Sgr();esa=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},tsa=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(hR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Dn.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 vpt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=hR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Dn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new bpt}],["baggage",function(){return new dpt}]]),t._registeredExporters=new Map,t})()});var rsa,eli,tli=ve(()=>{p();Ub();rsa=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.")},eli=(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:MMe(e.startTime),duration:MMe(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=rsa(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:VT.SUCCESS})},t})()});var nsa,isa,rli,nli=ve(()=>{p();Ub();nsa=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},isa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();Ub();osa=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())})},ssa=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]aG,AlwaysOnSampler:()=>b4,BasicTracerProvider:()=>Zci,BatchSpanProcessor:()=>u0e,ConsoleSpanExporter:()=>eli,ForceFlushState:()=>O8,InMemorySpanExporter:()=>rli,NoopSpanProcessor:()=>Qpt,ParentBasedSampler:()=>c0e,RandomIdGenerator:()=>d0e,SamplingDecision:()=>iD,SimpleSpanProcessor:()=>ili,Span:()=>kpt,TraceIdRatioBasedSampler:()=>jMe,Tracer:()=>Lpt});var ali=ve(()=>{p();Tgr();Xci();Opt();tli();nli();oli();kgr();Ppt();Dpt();_gr();vgr();qMe();Egr()});var HMe,cli,Pgr=ve(()=>{p();HMe=class{static{a(this,"NoopLogger")}emit(e){}},cli=new HMe});var Dgr,qpt,Ngr=ve(()=>{p();Pgr();Dgr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new HMe}},qpt=new Dgr});var jpt,lli=ve(()=>{p();Pgr();jpt=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):cli}}});var GMe,uli=ve(()=>{p();Ngr();lli();GMe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new jpt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:qpt}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 Hpt,dli=ve(()=>{p();Hpt=typeof globalThis=="object"?globalThis:global});var fli=ve(()=>{p();dli()});var pli=ve(()=>{p();fli()});function hli(t,e,r){return n=>n===t?e:r}var $Me,f0e,Mgr,mli=ve(()=>{p();pli();$Me=Symbol.for("io.opentelemetry.js.api.logs"),f0e=Hpt;a(hli,"makeGetter");Mgr=1});var Gpt,gli=ve(()=>{p();mli();Ngr();uli();Gpt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new GMe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return f0e[$Me]?this.getLoggerProvider():(f0e[$Me]=hli(Mgr,e,qpt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=f0e[$Me])===null||e===void 0?void 0:e.call(f0e,Mgr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete f0e[$Me],this._proxyLoggerProvider=new GMe}}});var $pt,Ogr=ve(()=>{p();gli();$pt=Gpt.getInstance()});function Ali(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var Eli=ve(()=>{p();a(Ali,"enableInstrumentations");a(yli,"disableInstrumentations")});function _li(t){let e=t.tracerProvider||wu.getTracerProvider(),r=t.meterProvider||uX.getMeterProvider(),n=t.loggerProvider||$pt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return Ali(o,e,r,n),()=>{yli(o)}}var vli=ve(()=>{p();co();Ogr();Eli();a(_li,"registerInstrumentations")});function xli(t,e,r){if(!lsa(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=psa(t);if(!n)return!1;let o=[],s=wli(n,e,o,r);return s&&!r?.includePrerelease?dsa(n,o):s}function lsa(t){return typeof t=="string"&&Ili.test(t)}function wli(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Lgr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=Msa(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Lgr(t,s,r,n))return!1;return!0}return Lgr(t,e,r,n)}function Lgr(t,e,r,n){if(e=fsa(e,n),e.includes(" "))return wli(t,e,r,n);{let o=hsa(e);return r.push(o),usa(t,o)}}function usa(t,e){if(e.invalid)return!1;if(!e.version||Fgr(e.version))return!0;let r=bli(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=bli(n,o)}return csa[e.op]?.includes(r)}function dsa(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function fsa(t,e){return t=t.trim(),t=Dsa(t,e),t=Psa(t),t=Nsa(t,e),t=t.trim(),t}function Cv(t){return!t||t.toLowerCase()==="x"||t==="*"}function psa(t){let e=t.match(Ili);if(!e){Dn.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 hsa(t){if(!t)return{};let e=t.match(asa);if(!e)return Dn.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 Fgr(t){return t==="*"||t==="x"||t==="X"}function Cli(t){let e=parseInt(t,10);return isNaN(e)?t:e}function msa(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 gsa(t,e){if(Fgr(t)||Fgr(e))return 0;let[r,n]=msa(Cli(t),Cli(e));return r>n?1:r{let l;return Cv(n)?l="":Cv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:Cv(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 Dsa(t,e){let r=ksa,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return Cv(s)?d="":Cv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Cv(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 Nsa(t,e){let r=Csa;return t.replace(r,(n,o,s,c,l,u)=>{let d=Cv(s),f=d||Cv(c),h=f||Cv(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 Msa(t,e){let r=Ssa;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(Cv(s)?o="":Cv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Cv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Cv(h)?f="":Cv(m)?f=`<${+h+1}.0.0-0`:Cv(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 Ili,asa,csa,Rli,kli,Asa,ysa,Sli,Esa,Tli,_sa,Bgr,VMe,vsa,Csa,bsa,Ssa,Tsa,Isa,xsa,wsa,Rsa,ksa,Pli=ve(()=>{p();co();Ili=/^(?: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-]+)*))?$/,asa=/^(?<|>|=|==|<=|>=|~|\^|~>)?\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-]+)*))?$/,csa={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(xli,"satisfies");a(lsa,"_validateVersion");a(wli,"_doSatisfies");a(Lgr,"_checkRange");a(usa,"_satisfies");a(dsa,"_doPreleaseCheck");a(fsa,"_normalizeRange");a(Cv,"isX");a(psa,"_parseVersion");a(hsa,"_parseRange");a(Fgr,"_isWildcard");a(Cli,"_parseVersionString");a(msa,"_normalizeVersionType");a(gsa,"_compareVersionStrings");a(bli,"_compareVersionSegments");Rli="[a-zA-Z0-9-]",kli="0|[1-9]\\d*",Asa=`\\d*[a-zA-Z-]${Rli}*`,ysa="((?:<|>)?=?)",Sli=`(?:${kli}|${Asa})`,Esa=`(?:-(${Sli}(?:\\.${Sli})*))`,Tli=`${Rli}+`,_sa=`(?:\\+(${Tli}(?:\\.${Tli})*))`,Bgr=`${kli}|x|X|\\*`,VMe=`[v=\\s]*(${Bgr})(?:\\.(${Bgr})(?:\\.(${Bgr})(?:${Esa})?${_sa}?)?)?`,vsa=`^${ysa}\\s*${VMe}$`,Csa=new RegExp(vsa),bsa=`^\\s*(${VMe})\\s+-\\s+(${VMe})\\s*$`,Ssa=new RegExp(bsa),Tsa="(?:~>?)",Isa=`^${Tsa}${VMe}$`,xsa=new RegExp(Isa),wsa="(?:\\^)",Rsa=`^${wsa}${VMe}$`,ksa=new RegExp(Rsa);a(Psa,"replaceTilde");a(Dsa,"replaceCaret");a(Nsa,"replaceXRange");a(Msa,"replaceHyphen")});var p0e=I((Eap,Mli)=>{"use strict";p();function Ugr(t){return typeof t=="function"}a(Ugr,"isFunction");var bv=console.error.bind(console);function WMe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(WMe,"defineProperty");function zMe(t){t&&t.logger&&(Ugr(t.logger)?bv=t.logger:bv("new logger isn't a function, not replacing"))}a(zMe,"shimmer");function Dli(t,e,r){if(!t||!t[e]){bv("no original function "+e+" to wrap");return}if(!r){bv("no wrapper function"),bv(new Error().stack);return}if(!Ugr(t[e])||!Ugr(r)){bv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return WMe(o,"__original",n),WMe(o,"__unwrap",function(){t[e]===o&&WMe(t,e,n)}),WMe(o,"__wrapped",!0),WMe(t,e,o),o}a(Dli,"wrap");function Osa(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{bv("must provide one or more modules to patch"),bv(new Error().stack);return}if(!(e&&Array.isArray(e))){bv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Dli(n,o,r)})})}a(Osa,"massWrap");function Nli(t,e){if(!t||!t[e]){bv("no function to unwrap."),bv(new Error().stack);return}if(!t[e].__unwrap)bv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Nli,"unwrap");function Lsa(t,e){if(t)Array.isArray(t)||(t=[t]);else{bv("must provide one or more modules to patch"),bv(new Error().stack);return}if(!(e&&Array.isArray(e))){bv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Nli(r,n)})})}a(Lsa,"massUnwrap");zMe.wrap=Dli;zMe.massWrap=Osa;zMe.unwrap=Nli;zMe.massUnwrap=Lsa;Mli.exports=zMe});var lG,Vpt,Oli=ve(()=>{p();co();Ogr();lG=de(p0e()),Vpt=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=Dn.createComponentLogger({namespace:e}),this._tracer=wu.getTracer(e,r),this._meter=uX.getMeter(e,r),this._logger=$pt.getLogger(e,r),this._updateMetricInstruments()}_wrap=lG.wrap;_unwrap=lG.unwrap;_massWrap=lG.massWrap;_massUnwrap=lG.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 Bli=I((xap,Lli)=>{p();var h0e=1e3,m0e=h0e*60,g0e=m0e*60,wee=g0e*24,Bsa=wee*7,Fsa=wee*365.25;Lli.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Usa(t);if(r==="number"&&isFinite(t))return e.long?qsa(t):Qsa(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Usa(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*Fsa;case"weeks":case"week":case"w":return r*Bsa;case"days":case"day":case"d":return r*wee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*g0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*m0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*h0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Usa,"parse");function Qsa(t){var e=Math.abs(t);return e>=wee?Math.round(t/wee)+"d":e>=g0e?Math.round(t/g0e)+"h":e>=m0e?Math.round(t/m0e)+"m":e>=h0e?Math.round(t/h0e)+"s":t+"ms"}a(Qsa,"fmtShort");function qsa(t){var e=Math.abs(t);return e>=wee?Wpt(t,e,wee,"day"):e>=g0e?Wpt(t,e,g0e,"hour"):e>=m0e?Wpt(t,e,m0e,"minute"):e>=h0e?Wpt(t,e,h0e,"second"):t+" ms"}a(qsa,"fmtLong");function Wpt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Wpt,"plural")});var Qgr=I((kap,Fli)=>{p();function jsa(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Bli(),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(jsa,"setup");Fli.exports=jsa});var Uli=I((Qb,zpt)=>{p();Qb.formatArgs=Gsa;Qb.save=$sa;Qb.load=Vsa;Qb.useColors=Hsa;Qb.storage=Wsa();Qb.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`."))}})();Qb.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 Hsa(){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(Hsa,"useColors");function Gsa(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+zpt.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(Gsa,"formatArgs");Qb.log=console.debug||console.log||(()=>{});function $sa(t){try{t?Qb.storage.setItem("debug",t):Qb.storage.removeItem("debug")}catch{}}a($sa,"save");function Vsa(){let t;try{t=Qb.storage.getItem("debug")||Qb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Vsa,"load");function Wsa(){try{return localStorage}catch{}}a(Wsa,"localstorage");zpt.exports=Qgr()(Qb);var{formatters:zsa}=zpt.exports;zsa.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var qli=I((Hg,Kpt)=>{p();var Ysa=require("tty"),Ypt=require("util");Hg.init=raa;Hg.log=Xsa;Hg.formatArgs=Jsa;Hg.save=eaa;Hg.load=taa;Hg.useColors=Ksa;Hg.destroy=Ypt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Hg.colors=[6,2,3,4,5,1];try{let t=qGe();t&&(t.stderr||t).level>=2&&(Hg.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{}Hg.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 Ksa(){return"colors"in Hg.inspectOpts?!!Hg.inspectOpts.colors:Ysa.isatty(process.stderr.fd)}a(Ksa,"useColors");function Jsa(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+"+Vpt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Lsa()+e+" "+t[0]}a(Osa,"formatArgs");function Lsa(){return jg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Lsa,"getDate");function Bsa(...t){return process.stderr.write($pt.formatWithOptions(jg.inspectOpts,...t)+` -`)}a(Bsa,"log");function Fsa(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(Fsa,"save");function Usa(){return process.env.DEBUG}a(Usa,"load");function Qsa(t){t.inspectOpts={};let e=Object.keys(jg.inspectOpts);for(let r=0;re.trim()).join(" ")};Dli.O=function(t){return this.inspectOpts.colors=this.useColors,$pt.inspect(t,this.inspectOpts)}});var Mli=I((map,Bgr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Bgr.exports=Pli():Bgr.exports=Nli()});var Ugr=I((Aap,Oli)=>{"use strict";p();var Fgr=require("path").sep;Oli.exports=function(t){var e=t.split(Fgr),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]+Fgr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Fgr;return{name:o,basedir:c,path:d}}}});var Qgr=I((Eap,Lli)=>{"use strict";p();var qsa=require("os");Lli.exports=qsa.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 qgr=I((Cap,Bli)=>{p();Bli.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 Fli=I((Sap,GMe)=>{"use strict";p();var jsa=process.platform==="win32",Hsa=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,jgr={};function Gsa(t){return Hsa.exec(t).slice(1)}a(Gsa,"win32SplitPath");jgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Gsa(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 $sa=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Hgr={};function Vsa(t){return $sa.exec(t).slice(1)}a(Vsa,"posixSplitPath");Hgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Vsa(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]}};jsa?GMe.exports=jgr.parse:GMe.exports=Hgr.parse;GMe.exports.posix=Hgr.parse;GMe.exports.win32=jgr.parse});var Ggr=I((xap,jli)=>{p();var qli=require("path"),Uli=qli.parse||Fli(),Qli=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Uli(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Uli(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return qli.resolve(n,l,u)}))},[])},"getNodeModulesDirs");jli.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 Qli(e,o)},r);var s=Qli(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var $gr=I((kap,Hli)=>{p();Hli.exports=function(t,e){return e||{}}});var Vli=I((Dap,$li)=>{"use strict";p();var Wsa="Function.prototype.bind called on incompatible ",zsa=Object.prototype.toString,Ysa=Math.max,Ksa="[object Function]",Gli=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Xsa=Vli();Wli.exports=Function.prototype.bind||Xsa});var Kli=I((Fap,Yli)=>{"use strict";p();var eaa=Function.prototype.call,taa=Object.prototype.hasOwnProperty,raa=zli();Yli.exports=raa.call(eaa,taa)});var Jli=I((Qap,naa)=>{naa.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 $Me=I((qap,eui)=>{"use strict";p();var iaa=Kli();function oaa(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(oaa,"specifierIncluded");function Zli(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 wee=require("fs"),aaa=Qgr(),Am=require("path"),caa=qgr(),laa=Ggr(),uaa=$gr(),daa=$Me(),faa=process.platform!=="win32"&&wee.realpath&&typeof wee.realpath.native=="function"?wee.realpath.native:wee.realpath,tui=aaa(),paa=a(function(){return[Am.join(tui,".node_modules"),Am.join(tui,".node_libraries")]},"defaultPaths"),haa=a(function(e,r){wee.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"),maa=a(function(e,r){wee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),gaa=a(function(e,r){faa(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),VMe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Aaa=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"),yaa=a(function(e,r,n){for(var o=laa(r,n,e),s=0;s{Eaa.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 cui=I((zap,aui)=>{"use strict";p();var _aa=$Me(),oui=iui(),sui={};for(Wpt in oui)Object.prototype.hasOwnProperty.call(oui,Wpt)&&(sui[Wpt]=_aa(Wpt));var Wpt;aui.exports=sui});var uui=I((Kap,lui)=>{p();var vaa=$Me();lui.exports=a(function(e){return vaa(e)},"isCore")});var pui=I((Xap,fui)=>{p();var Caa=$Me(),Ree=require("fs"),DE=require("path"),baa=Qgr(),Saa=qgr(),Taa=Ggr(),Iaa=$gr(),xaa=process.platform!=="win32"&&Ree.realpathSync&&typeof Ree.realpathSync.native=="function"?Ree.realpathSync.native:Ree.realpathSync,dui=baa(),waa=a(function(){return[DE.join(dui,".node_modules"),DE.join(dui,".node_libraries")]},"defaultPaths"),Raa=a(function(e){try{var r=Ree.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"),kaa=a(function(e){try{var r=Ree.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Paa=a(function(e){try{return xaa(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),WMe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),Daa=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Naa=a(function(e,r,n){for(var o=Taa(r,n,e),s=0;s{p();var zpt=nui();zpt.core=cui();zpt.isCore=uui();zpt.sync=pui();hui.exports=zpt});var mui=I((icp,Maa)=>{Maa.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 Kgr=I((ocp,Ygr)=>{"use strict";p();var g0e=require("path"),rD=require("module"),dh=Mli()("require-in-the-middle"),Oaa=Ugr();Ygr.exports=zMe;Ygr.exports.Hook=zMe;var Wgr,m0e;if(rD.isBuiltin)m0e=rD.isBuiltin;else if(rD.builtinModules)m0e=a(t=>t.startsWith("node:")?!0:(Wgr===void 0&&(Wgr=new Set(rD.builtinModules)),Wgr.has(t)),"isCore");else{let t=Vgr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?m0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):m0e=a(n=>!!t.core[n],"isCore")}var Ypt;function Laa(t,e){if(!Ypt)if(require.resolve&&require.resolve.paths)Ypt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Vgr();Ypt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Ypt(t,e)}a(Laa,"resolve");var Baa=/([/\\]index)?(\.js)?$/,zgr=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:(dh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function zMe(t,e,r){if(!(this instanceof zMe))return new zMe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof rD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof rD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,mui().bugs.url);return}this._cache=new zgr,this._unhooked=!1,this._origRequire=rD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);dh("registering require hook"),this._require=rD.prototype.require=function(u){return n._unhooked===!0?(dh("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?(dh("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=m0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);m0e(v)&&(m=v)}}else{if(d)return dh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=rD._resolveFilename(f,this)}catch(v){return dh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(dh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return dh("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 dh("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 dh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=g0e.parse(m);g=v.name,A=v.dir}else{let v=Oaa(m);if(v===void 0)return dh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=Faa(v);dh("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=Laa(g,A)}catch{return dh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+g0e.sep+g0e.relative(A,m),dh("preparing to process require of internal file: %s",g);else return dh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),dh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),dh("returning module: %s",g),_}a(l,"patchedRequire")}a(zMe,"Hook");zMe.prototype.unhook=function(){this._unhooked=!0,this._require===rD.prototype.require?(rD.prototype.require=this._origRequire,dh("require unhook successful")):dh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,dh("process.getBuiltinModule unhook successful")):dh("process.getBuiltinModule unhook unsuccessful"))};function Faa(t){let e=g0e.sep!=="/"?t.path.split(g0e.sep).join("/"):t.path;return g0e.posix.join(t.name,e).replace(Baa,"")}a(Faa,"resolveModuleName")});var Kpt,Jpt,gui=ve(()=>{p();Kpt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Jpt=class{static{a(this,"ModuleNameTrie")}_trie=new Kpt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Kpt,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 Qaa(t){return Jgr.sep!=="/"?t.split(Jgr.sep).join("/"):t}var yui,Jgr,Uaa,Zpt,Eui=ve(()=>{p();yui=de(Kgr()),Jgr=de(require("path"));gui();Uaa=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Zpt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Jpt;static _instance;constructor(){this._initialize()}_initialize(){new yui.Hook(null,{internals:!0},(e,r,n)=>{let o=Qaa(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 Uaa?new t:this._instance=this._instance??new t}};a(Qaa,"normalizePathSeparators")});var Tui=I(kee=>{p();var _ui=[],Zgr=new WeakMap,vui=new WeakMap,Cui=new Map,bui=[],qaa={set(t,e,r){return Zgr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=vui.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 Zgr.get(t)[e](r.value)}};function jaa(t,e,r,n,o){Cui.set(t,o),Zgr.set(e,r),vui.set(e,n);let s=new Proxy(e,qaa);_ui.forEach(c=>c(t,s)),bui.push([t,s])}a(jaa,"register");var Sui=!1;function Haa(){return Sui}a(Haa,"getExperimentalPatchInternals");function Gaa(t){Sui=t}a(Gaa,"setExperimentalPatchInternals");kee.register=jaa;kee.importHooks=_ui;kee.specifiers=Cui;kee.toHook=bui;kee.getExperimentalPatchInternals=Haa;kee.setExperimentalPatchInternals=Gaa});var Pui=I((ycp,A0e)=>{p();var Iui=require("path"),$aa=Ugr(),{fileURLToPath:xui}=require("url"),{MessageChannel:Vaa}=require("worker_threads"),{importHooks:Xgr,specifiers:Waa,toHook:zaa,getExperimentalPatchInternals:Yaa}=Tui();function Rui(t){Xgr.push(t),zaa.forEach(([e,r])=>t(e,r))}a(Rui,"addHook");function kui(t){let e=Xgr.indexOf(t);e>-1&&Xgr.splice(e,1)}a(kui,"removeHook");function wui(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(wui,"callHookFn");var eAr;function Kaa(){let{port1:t,port2:e}=new Vaa,r=0,n;eAr=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(Kaa,"createAddHookMessageChannel");function YMe(t,e,r){if(!(this instanceof YMe))return new YMe(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;eAr&&Array.isArray(t)&&eAr(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=xui(o)}catch{}let d=$aa(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+Iui.sep+Iui.relative(u,xui(c));else if(!Yaa()&&!u.endsWith(Waa.get(c)))continue}wui(r,s,o,u)}}else wui(r,s,o,u)},Rui(this._iitmHook)}a(YMe,"Hook");YMe.prototype.unhook=function(){kui(this._iitmHook)};A0e.exports=YMe;A0e.exports.Hook=YMe;A0e.exports.addHook=Rui;A0e.exports.removeHook=kui;A0e.exports.createAddHookMessageChannel=Kaa});function Dui(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 Nui(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 Xpt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var tAr=ve(()=>{p();a(Dui,"safeExecuteInTheMiddle");a(Nui,"safeExecuteInTheMiddleAsync");a(Xpt,"isWrapped")});function Mui(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Eli(e,n,{includePrerelease:r}))}var M8,rAr,KMe,Oui,Lui,Bui,y0e,Fui=ve(()=>{p();M8=de(require("path")),rAr=require("util");bli();KMe=de(d0e());xli();Eui();Oui=de(Pui());co();Lui=de(Kgr()),Bui=require("fs");tAr();y0e=class extends jpt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Zpt.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(Xpt(e[r])&&this._unwrap(e,r),rAr.types.isProxy(e)){let o=(0,KMe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,KMe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>rAr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,KMe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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,Bui.readFileSync)(M8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Dn.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 Mui(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=M8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Mui(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&&M8.isAbsolute(l)){let d=M8.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=M8.isAbsolute(e.name)?new Lui.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Oui.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(Mui,"isSupported")});var JMe,Uui=ve(()=>{p();JMe=require("path")});var Qui=ve(()=>{p();Fui();Uui()});var nAr=ve(()=>{p();Qui()});var eht,qui=ve(()=>{p();eht=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 tht,jui=ve(()=>{p();nAr();tht=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,JMe.normalize)(e)}}});var iAr={};ki(iAr,{InstrumentationBase:()=>y0e,InstrumentationNodeModuleDefinition:()=>eht,InstrumentationNodeModuleFile:()=>tht,isWrapped:()=>Xpt,registerInstrumentations:()=>fli,safeExecuteInTheMiddle:()=>Dui,safeExecuteInTheMiddleAsync:()=>Nui});var oAr=ve(()=>{p();pli();nAr();qui();jui();tAr()});var Gui=I(sAr=>{"use strict";p();Object.defineProperty(sAr,"__esModule",{value:!0});sAr.log=eca;var Hui=(m3(),ba(iQ)),Jaa=require("node:os"),Zaa=Hui.__importDefault(require("node:util")),Xaa=Hui.__importStar(require("node:process"));function eca(t,...e){Xaa.stderr.write(`${Zaa.default.format(t,...e)}${Jaa.EOL}`)}a(eca,"log")});var Yui=I(dAr=>{"use strict";p();Object.defineProperty(dAr,"__esModule",{value:!0});var tca=Gui(),$ui=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Vui,aAr=[],cAr=[],rht=[];$ui&&lAr($ui);var Wui=Object.assign(t=>zui(t),{enable:lAr,enabled:uAr,disable:rca,log:tca.log});function lAr(t){Vui=t,aAr=[],cAr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?cAr.push(new RegExp(`^${n.substr(1)}$`)):aAr.push(new RegExp(`^${n}$`));for(let n of rht)n.enabled=uAr(n.namespace)}a(lAr,"enable");function uAr(t){if(t.endsWith("*"))return!0;for(let e of cAr)if(e.test(t))return!1;for(let e of aAr)if(e.test(t))return!0;return!1}a(uAr,"enabled");function rca(){let t=Vui||"";return lAr(""),t}a(rca,"disable");function zui(t){let e=Object.assign(r,{enabled:uAr(t),destroy:nca,log:Wui.log,namespace:t,extend:ica});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),rht.push(e),e}a(zui,"createDebugger");function nca(){let t=rht.indexOf(this);return t>=0?(rht.splice(t,1),!0):!1}a(nca,"destroy");function ica(t){let e=zui(`${this.namespace}:${t}`);return e.log=this.log,e}a(ica,"extend");dAr.default=Wui});var sht=I(b4=>{"use strict";p();Object.defineProperty(b4,"__esModule",{value:!0});b4.AzureLogger=void 0;b4.setLogLevel=Zui;b4.getLogLevel=sca;b4.createClientLogger=aca;var oca=(m3(),ba(iQ)),ZMe=oca.__importDefault(Yui()),Jui=new Set,nht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,oht;b4.AzureLogger=(0,ZMe.default)("azure");b4.AzureLogger.log=(...t)=>{ZMe.default.log(...t)};var fAr=["verbose","info","warning","error"];nht&&(tdi(nht)?Zui(nht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${nht}'; logging is not enabled. Acceptable values: ${fAr.join(", ")}.`));function Zui(t){if(t&&!tdi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${fAr.join(",")}`);oht=t;let e=[];for(let r of Jui)edi(r)&&e.push(r.namespace);ZMe.default.enable(e.join(","))}a(Zui,"setLogLevel");function sca(){return oht}a(sca,"getLogLevel");var Kui={verbose:400,info:300,warning:200,error:100};function aca(t){let e=b4.AzureLogger.extend(t);return Xui(b4.AzureLogger,e),{error:iht(e,"error"),warning:iht(e,"warning"),info:iht(e,"info"),verbose:iht(e,"verbose")}}a(aca,"createClientLogger");function Xui(t,e){e.log=(...r)=>{t.log(...r)}}a(Xui,"patchLogMethod");function iht(t,e){let r=Object.assign(t.extend(e),{level:e});if(Xui(t,r),edi(r)){let n=ZMe.default.disable();ZMe.default.enable(n+","+r.namespace)}return Jui.add(r),r}a(iht,"createLogger");function edi(t){return!!(oht&&Kui[t.level]<=Kui[oht])}a(edi,"shouldEnable");function tdi(t){return fAr.includes(t)}a(tdi,"isAzureLogLevel")});var pAr=I(aht=>{"use strict";p();Object.defineProperty(aht,"__esModule",{value:!0});aht.logger=void 0;var cca=sht();aht.logger=(0,cca.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function cht(t){return t.setValue(hAr,!0)}function rdi(t){return t.deleteValue(hAr)}function E0e(t){return t.getValue(hAr)===!0}var hAr,XMe=ve(()=>{p();co();hAr=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(cht,"suppressTracing");a(rdi,"unsuppressTracing");a(E0e,"isTracingSuppressed")});var lht,ndi=ve(()=>{p();lht="baggage"});function odi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function sdi(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 mAr(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=Hpe(e.join(";"))),{key:o,value:s,metadata:c}}function adi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=mAr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var gAr=ve(()=>{p();co();a(odi,"serializeKeyPairs");a(sdi,"getKeyPairs");a(mAr,"parsePairKeyValue");a(adi,"parseKeyPairsIntoRecord")});var dht,cdi=ve(()=>{p();co();XMe();ndi();gAr();dht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=kT.getBaggage(e);if(!o||E0e(e))return;let s=sdi(o).filter(l=>l.length<=4096).slice(0,180),c=odi(s);c.length>0&&n.set(r,lht,c)}extract(e,r,n){let o=n.get(r,lht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=mAr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:kT.setBaggage(e,kT.createBaggage(c))}fields(){return[lht]}}});var fht,ldi=ve(()=>{p();fht=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 udi(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(!dca(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!AAr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function dca(t){return typeof t=="string"&&t!==""}function AAr(t){return t==null?!0:Array.isArray(t)?fca(t):ddi(typeof t)}function fca(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(ddi(n)){e=n;continue}return!1}return!1}}return!0}function ddi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var fdi=ve(()=>{p();co();a(udi,"sanitizeAttributes");a(dca,"isAttributeKey");a(AAr,"isAttributeValue");a(fca,"isHomogeneousAttributeValueArray");a(ddi,"isValidPrimitiveAttributeValueType")});function pht(){return t=>{Dn.error(pca(t))}}function pca(t){return typeof t=="string"?t:JSON.stringify(hca(t))}function hca(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 yAr=ve(()=>{p();co();a(pht,"loggingErrorHandler");a(pca,"stringifyException");a(hca,"flattenException")});function hdi(t){pdi=t}function mdi(t){try{pdi(t)}catch{}}var pdi,gdi=ve(()=>{p();yAr();pdi=pht();a(hdi,"setGlobalErrorHandler");a(mdi,"globalErrorHandler")});function hht(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,EAr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function eOe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function mht(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,EAr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function ght(t){return eOe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var EAr,Adi=ve(()=>{p();co();EAr=require("util");a(hht,"getNumberFromEnv");a(eOe,"getStringFromEnv");a(mht,"getBooleanFromEnv");a(ght,"getStringListFromEnv")});var Aht,ydi=ve(()=>{p();Aht=typeof globalThis=="object"?globalThis:global});var Edi,sG,_di=ve(()=>{p();Edi=require("perf_hooks"),sG=Edi.performance});var vdi,Cdi=ve(()=>{p();vdi="2.2.0"});function fh(t){let e={},r=t.length;for(let n=0;n{p();a(fh,"createConstMap")});var bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,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,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,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,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,mca,gca,Aca,yca,Eca,_ca,vca,Cca,bca,Sca,Tca,Ica,xca,wca,Rca,kca,Pca,Dca,Nca,Mca,Oca,Lca,Bca,Fca,Uca,Qca,qca,jca,Hca,Gca,$ca,Vca,Wca,zca,Yca,Kca,Jca,Zca,Xca,ela,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Ela,_la,vla,Cla,bla,Sla,Tla,Ila,xla,wla,Rla,kla,Pla,Dla,Nla,Mla,Ola,Lla,Bla,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,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lua,Bua,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,Ida,xda,wda,Rda,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,kda,Pda,Dda,Nda,Mda,Oda,Lda,Bda,Fda,Uda,Qda,qda,Whi,zhi,Yhi,Khi,Jhi,jda,Hda,Gda,$da,Vda,Wda,Zhi,Xhi,emi,zda,Yda,Kda,Jda,tmi,rmi,nmi,imi,Zda,Xda,efa,tfa,rfa,omi,smi,ami,cmi,lmi,umi,dmi,nfa,ifa,ofa,sfa,afa,cfa,lfa,ufa,fmi,pmi,hmi,mmi,gmi,dfa,ffa,pfa,hfa,mfa,gfa,Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Afa,yfa,Efa,_fa,vfa,Cfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Lfa,Bfa,Ffa,Fmi,Umi,Qmi,qmi,jmi,Ufa,Qfa,qfa,jfa,Hfa,Gfa,Hmi,Gmi,$fa,Vfa,Wfa,$mi,Vmi,zfa,Yfa,Kfa,Wmi,zmi,Ymi,Kmi,Jmi,Zmi,Xmi,e0i,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,u0i,d0i,mpa,gpa,Apa,f0i=ve(()=>{p();_Ar();bdi="aws.lambda.invoked_arn",Sdi="db.system",Tdi="db.connection_string",Idi="db.user",xdi="db.jdbc.driver_classname",wdi="db.name",Rdi="db.statement",kdi="db.operation",Pdi="db.mssql.instance_name",Ddi="db.cassandra.keyspace",Ndi="db.cassandra.page_size",Mdi="db.cassandra.consistency_level",Odi="db.cassandra.table",Ldi="db.cassandra.idempotence",Bdi="db.cassandra.speculative_execution_count",Fdi="db.cassandra.coordinator.id",Udi="db.cassandra.coordinator.dc",Qdi="db.hbase.namespace",qdi="db.redis.database_index",jdi="db.mongodb.collection",Hdi="db.sql.table",Gdi="exception.type",$di="exception.message",Vdi="exception.stacktrace",Wdi="exception.escaped",zdi="faas.trigger",Ydi="faas.execution",Kdi="faas.document.collection",Jdi="faas.document.operation",Zdi="faas.document.time",Xdi="faas.document.name",efi="faas.time",tfi="faas.cron",rfi="faas.coldstart",nfi="faas.invoked_name",ifi="faas.invoked_provider",ofi="faas.invoked_region",sfi="net.transport",afi="net.peer.ip",cfi="net.peer.port",lfi="net.peer.name",ufi="net.host.ip",dfi="net.host.port",ffi="net.host.name",pfi="net.host.connection.type",hfi="net.host.connection.subtype",mfi="net.host.carrier.name",gfi="net.host.carrier.mcc",Afi="net.host.carrier.mnc",yfi="net.host.carrier.icc",Efi="peer.service",_fi="enduser.id",vfi="enduser.role",Cfi="enduser.scope",bfi="thread.id",Sfi="thread.name",Tfi="code.function",Ifi="code.namespace",xfi="code.filepath",wfi="code.lineno",Rfi="http.method",kfi="http.url",Pfi="http.target",Dfi="http.host",Nfi="http.scheme",Mfi="http.status_code",Ofi="http.flavor",Lfi="http.user_agent",Bfi="http.request_content_length",Ffi="http.request_content_length_uncompressed",Ufi="http.response_content_length",Qfi="http.response_content_length_uncompressed",qfi="http.server_name",jfi="http.route",Hfi="http.client_ip",Gfi="aws.dynamodb.table_names",$fi="aws.dynamodb.consumed_capacity",Vfi="aws.dynamodb.item_collection_metrics",Wfi="aws.dynamodb.provisioned_read_capacity",zfi="aws.dynamodb.provisioned_write_capacity",Yfi="aws.dynamodb.consistent_read",Kfi="aws.dynamodb.projection",Jfi="aws.dynamodb.limit",Zfi="aws.dynamodb.attributes_to_get",Xfi="aws.dynamodb.index_name",epi="aws.dynamodb.select",tpi="aws.dynamodb.global_secondary_indexes",rpi="aws.dynamodb.local_secondary_indexes",npi="aws.dynamodb.exclusive_start_table",ipi="aws.dynamodb.table_count",opi="aws.dynamodb.scan_forward",spi="aws.dynamodb.segment",api="aws.dynamodb.total_segments",cpi="aws.dynamodb.count",lpi="aws.dynamodb.scanned_count",upi="aws.dynamodb.attribute_definitions",dpi="aws.dynamodb.global_secondary_index_updates",fpi="messaging.system",ppi="messaging.destination",hpi="messaging.destination_kind",mpi="messaging.temp_destination",gpi="messaging.protocol",Api="messaging.protocol_version",ypi="messaging.url",Epi="messaging.message_id",_pi="messaging.conversation_id",vpi="messaging.message_payload_size_bytes",Cpi="messaging.message_payload_compressed_size_bytes",bpi="messaging.operation",Spi="messaging.consumer_id",Tpi="messaging.rabbitmq.routing_key",Ipi="messaging.kafka.message_key",xpi="messaging.kafka.consumer_group",wpi="messaging.kafka.client_id",Rpi="messaging.kafka.partition",kpi="messaging.kafka.tombstone",Ppi="rpc.system",Dpi="rpc.service",Npi="rpc.method",Mpi="rpc.grpc.status_code",Opi="rpc.jsonrpc.version",Lpi="rpc.jsonrpc.request_id",Bpi="rpc.jsonrpc.error_code",Fpi="rpc.jsonrpc.error_message",Upi="message.type",Qpi="message.id",qpi="message.compressed_size",jpi="message.uncompressed_size",mca=bdi,gca=Sdi,Aca=Tdi,yca=Idi,Eca=xdi,_ca=wdi,vca=Rdi,Cca=kdi,bca=Pdi,Sca=Ddi,Tca=Ndi,Ica=Mdi,xca=Odi,wca=Ldi,Rca=Bdi,kca=Fdi,Pca=Udi,Dca=Qdi,Nca=qdi,Mca=jdi,Oca=Hdi,Lca=Gdi,Bca=$di,Fca=Vdi,Uca=Wdi,Qca=zdi,qca=Ydi,jca=Kdi,Hca=Jdi,Gca=Zdi,$ca=Xdi,Vca=efi,Wca=tfi,zca=rfi,Yca=nfi,Kca=ifi,Jca=ofi,Zca=sfi,Xca=afi,ela=cfi,tla=lfi,rla=ufi,nla=dfi,ila=ffi,ola=pfi,sla=hfi,ala=mfi,cla=gfi,lla=Afi,ula=yfi,dla=Efi,fla=_fi,pla=vfi,hla=Cfi,mla=bfi,gla=Sfi,Ala=Tfi,yla=Ifi,Ela=xfi,_la=wfi,vla=Rfi,Cla=kfi,bla=Pfi,Sla=Dfi,Tla=Nfi,Ila=Mfi,xla=Ofi,wla=Lfi,Rla=Bfi,kla=Ffi,Pla=Ufi,Dla=Qfi,Nla=qfi,Mla=jfi,Ola=Hfi,Lla=Gfi,Bla=$fi,Fla=Vfi,Ula=Wfi,Qla=zfi,qla=Yfi,jla=Kfi,Hla=Jfi,Gla=Zfi,$la=Xfi,Vla=epi,Wla=tpi,zla=rpi,Yla=npi,Kla=ipi,Jla=opi,Zla=spi,Xla=api,eua=cpi,tua=lpi,rua=upi,nua=dpi,iua=fpi,oua=ppi,sua=hpi,aua=mpi,cua=gpi,lua=Api,uua=ypi,dua=Epi,fua=_pi,pua=vpi,hua=Cpi,mua=bpi,gua=Spi,Aua=Tpi,yua=Ipi,Eua=xpi,_ua=wpi,vua=Rpi,Cua=kpi,bua=Ppi,Sua=Dpi,Tua=Npi,Iua=Mpi,xua=Opi,wua=Lpi,Rua=Bpi,kua=Fpi,Pua=Upi,Dua=Qpi,Nua=qpi,Mua=jpi,Oua=fh([bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,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,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,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,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi]),Hpi="other_sql",Gpi="mssql",$pi="mysql",Vpi="oracle",Wpi="db2",zpi="postgresql",Ypi="redshift",Kpi="hive",Jpi="cloudscape",Zpi="hsqldb",Xpi="progress",ehi="maxdb",thi="hanadb",rhi="ingres",nhi="firstsql",ihi="edb",ohi="cache",shi="adabas",ahi="firebird",chi="derby",lhi="filemaker",uhi="informix",dhi="instantdb",fhi="interbase",phi="mariadb",hhi="netezza",mhi="pervasive",ghi="pointbase",Ahi="sqlite",yhi="sybase",Ehi="teradata",_hi="vertica",vhi="h2",Chi="coldfusion",bhi="cassandra",Shi="hbase",Thi="mongodb",Ihi="redis",xhi="couchbase",whi="couchdb",Rhi="cosmosdb",khi="dynamodb",Phi="neo4j",Dhi="geode",Nhi="elasticsearch",Mhi="memcached",Ohi="cockroachdb",Lua=Hpi,Bua=Gpi,Fua=$pi,Uua=Vpi,Qua=Wpi,qua=zpi,jua=Ypi,Hua=Kpi,Gua=Jpi,$ua=Zpi,Vua=Xpi,Wua=ehi,zua=thi,Yua=rhi,Kua=nhi,Jua=ihi,Zua=ohi,Xua=shi,eda=ahi,tda=chi,rda=lhi,nda=uhi,ida=dhi,oda=fhi,sda=phi,ada=hhi,cda=mhi,lda=ghi,uda=Ahi,dda=yhi,fda=Ehi,pda=_hi,hda=vhi,mda=Chi,gda=bhi,Ada=Shi,yda=Thi,Eda=Ihi,_da=xhi,vda=whi,Cda=Rhi,bda=khi,Sda=Phi,Tda=Dhi,Ida=Nhi,xda=Mhi,wda=Ohi,Rda=fh([Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi]),Lhi="all",Bhi="each_quorum",Fhi="quorum",Uhi="local_quorum",Qhi="one",qhi="two",jhi="three",Hhi="local_one",Ghi="any",$hi="serial",Vhi="local_serial",kda=Lhi,Pda=Bhi,Dda=Fhi,Nda=Uhi,Mda=Qhi,Oda=qhi,Lda=jhi,Bda=Hhi,Fda=Ghi,Uda=$hi,Qda=Vhi,qda=fh([Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi]),Whi="datasource",zhi="http",Yhi="pubsub",Khi="timer",Jhi="other",jda=Whi,Hda=zhi,Gda=Yhi,$da=Khi,Vda=Jhi,Wda=fh([Whi,zhi,Yhi,Khi,Jhi]),Zhi="insert",Xhi="edit",emi="delete",zda=Zhi,Yda=Xhi,Kda=emi,Jda=fh([Zhi,Xhi,emi]),tmi="alibaba_cloud",rmi="aws",nmi="azure",imi="gcp",Zda=tmi,Xda=rmi,efa=nmi,tfa=imi,rfa=fh([tmi,rmi,nmi,imi]),omi="ip_tcp",smi="ip_udp",ami="ip",cmi="unix",lmi="pipe",umi="inproc",dmi="other",nfa=omi,ifa=smi,ofa=ami,sfa=cmi,afa=lmi,cfa=umi,lfa=dmi,ufa=fh([omi,smi,ami,cmi,lmi,umi,dmi]),fmi="wifi",pmi="wired",hmi="cell",mmi="unavailable",gmi="unknown",dfa=fmi,ffa=pmi,pfa=hmi,hfa=mmi,mfa=gmi,gfa=fh([fmi,pmi,hmi,mmi,gmi]),Ami="gprs",ymi="edge",Emi="umts",_mi="cdma",vmi="evdo_0",Cmi="evdo_a",bmi="cdma2000_1xrtt",Smi="hsdpa",Tmi="hsupa",Imi="hspa",xmi="iden",wmi="evdo_b",Rmi="lte",kmi="ehrpd",Pmi="hspap",Dmi="gsm",Nmi="td_scdma",Mmi="iwlan",Omi="nr",Lmi="nrnsa",Bmi="lte_ca",Afa=Ami,yfa=ymi,Efa=Emi,_fa=_mi,vfa=vmi,Cfa=Cmi,bfa=bmi,Sfa=Smi,Tfa=Tmi,Ifa=Imi,xfa=xmi,wfa=wmi,Rfa=Rmi,kfa=kmi,Pfa=Pmi,Dfa=Dmi,Nfa=Nmi,Mfa=Mmi,Ofa=Omi,Lfa=Lmi,Bfa=Bmi,Ffa=fh([Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi]),Fmi="1.0",Umi="1.1",Qmi="2.0",qmi="SPDY",jmi="QUIC",Ufa=Fmi,Qfa=Umi,qfa=Qmi,jfa=qmi,Hfa=jmi,Gfa={HTTP_1_0:Fmi,HTTP_1_1:Umi,HTTP_2_0:Qmi,SPDY:qmi,QUIC:jmi},Hmi="queue",Gmi="topic",$fa=Hmi,Vfa=Gmi,Wfa=fh([Hmi,Gmi]),$mi="receive",Vmi="process",zfa=$mi,Yfa=Vmi,Kfa=fh([$mi,Vmi]),Wmi=0,zmi=1,Ymi=2,Kmi=3,Jmi=4,Zmi=5,Xmi=6,e0i=7,t0i=8,r0i=9,n0i=10,i0i=11,o0i=12,s0i=13,a0i=14,c0i=15,l0i=16,Jfa=Wmi,Zfa=zmi,Xfa=Ymi,epa=Kmi,tpa=Jmi,rpa=Zmi,npa=Xmi,ipa=e0i,opa=t0i,spa=r0i,apa=n0i,cpa=i0i,lpa=o0i,upa=s0i,dpa=a0i,fpa=c0i,ppa=l0i,hpa={OK:Wmi,CANCELLED:zmi,UNKNOWN:Ymi,INVALID_ARGUMENT:Kmi,DEADLINE_EXCEEDED:Jmi,NOT_FOUND:Zmi,ALREADY_EXISTS:Xmi,PERMISSION_DENIED:e0i,RESOURCE_EXHAUSTED:t0i,FAILED_PRECONDITION:r0i,ABORTED:n0i,OUT_OF_RANGE:i0i,UNIMPLEMENTED:o0i,INTERNAL:s0i,UNAVAILABLE:a0i,DATA_LOSS:c0i,UNAUTHENTICATED:l0i},u0i="SENT",d0i="RECEIVED",mpa=u0i,gpa=d0i,Apa=fh([u0i,d0i])});var p0i=ve(()=>{p();f0i()});var h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,ypa,Epa,_pa,vpa,Cpa,bpa,Spa,Tpa,Ipa,xpa,wpa,Rpa,kpa,Ppa,Dpa,Npa,Mpa,Opa,Lpa,Bpa,Fpa,Upa,Qpa,qpa,jpa,Hpa,Gpa,$pa,Vpa,Wpa,zpa,Ypa,Kpa,Jpa,Zpa,Xpa,eha,tha,rha,nha,iha,oha,sha,aha,cha,lha,uha,dha,fha,pha,hha,mha,gha,Aha,yha,Eha,_ha,vha,Cha,bha,Sha,Tha,Iha,xha,wha,Rha,kha,Pha,Dha,Nha,Mha,Oha,Lha,Bha,Fha,Uha,Qha,qha,jha,Hha,Gha,$ha,qgi,jgi,Hgi,Ggi,Vha,Wha,zha,Yha,Kha,$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,Jha,Zha,Xha,ema,tma,rma,nma,ima,oma,sma,ama,cma,lma,uma,dma,fma,pma,hma,cAi,lAi,mma,gma,Ama,uAi,dAi,fAi,pAi,hAi,mAi,gAi,yma,Ema,_ma,vma,Cma,bma,Sma,Tma,AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi,Ima,xma,wma,Rma,kma,Pma,Dma,Nma,Mma,Oma,Lma,Bma,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi,Fma,Uma,Qma,qma,jma,Hma,Gma,$ma,Vma,Wma,zma,FAi=ve(()=>{p();_Ar();h0i="cloud.provider",m0i="cloud.account.id",g0i="cloud.region",A0i="cloud.availability_zone",y0i="cloud.platform",E0i="aws.ecs.container.arn",_0i="aws.ecs.cluster.arn",v0i="aws.ecs.launchtype",C0i="aws.ecs.task.arn",b0i="aws.ecs.task.family",S0i="aws.ecs.task.revision",T0i="aws.eks.cluster.arn",I0i="aws.log.group.names",x0i="aws.log.group.arns",w0i="aws.log.stream.names",R0i="aws.log.stream.arns",k0i="container.name",P0i="container.id",D0i="container.runtime",N0i="container.image.name",M0i="container.image.tag",O0i="deployment.environment",L0i="device.id",B0i="device.model.identifier",F0i="device.model.name",U0i="faas.name",Q0i="faas.id",q0i="faas.version",j0i="faas.instance",H0i="faas.max_memory",G0i="host.id",$0i="host.name",V0i="host.type",W0i="host.arch",z0i="host.image.name",Y0i="host.image.id",K0i="host.image.version",J0i="k8s.cluster.name",Z0i="k8s.node.name",X0i="k8s.node.uid",egi="k8s.namespace.name",tgi="k8s.pod.uid",rgi="k8s.pod.name",ngi="k8s.container.name",igi="k8s.replicaset.uid",ogi="k8s.replicaset.name",sgi="k8s.deployment.uid",agi="k8s.deployment.name",cgi="k8s.statefulset.uid",lgi="k8s.statefulset.name",ugi="k8s.daemonset.uid",dgi="k8s.daemonset.name",fgi="k8s.job.uid",pgi="k8s.job.name",hgi="k8s.cronjob.uid",mgi="k8s.cronjob.name",ggi="os.type",Agi="os.description",ygi="os.name",Egi="os.version",_gi="process.pid",vgi="process.executable.name",Cgi="process.executable.path",bgi="process.command",Sgi="process.command_line",Tgi="process.command_args",Igi="process.owner",xgi="process.runtime.name",wgi="process.runtime.version",Rgi="process.runtime.description",kgi="service.name",Pgi="service.namespace",Dgi="service.instance.id",Ngi="service.version",Mgi="telemetry.sdk.name",Ogi="telemetry.sdk.language",Lgi="telemetry.sdk.version",Bgi="telemetry.auto.version",Fgi="webengine.name",Ugi="webengine.version",Qgi="webengine.description",ypa=h0i,Epa=m0i,_pa=g0i,vpa=A0i,Cpa=y0i,bpa=E0i,Spa=_0i,Tpa=v0i,Ipa=C0i,xpa=b0i,wpa=S0i,Rpa=T0i,kpa=I0i,Ppa=x0i,Dpa=w0i,Npa=R0i,Mpa=k0i,Opa=P0i,Lpa=D0i,Bpa=N0i,Fpa=M0i,Upa=O0i,Qpa=L0i,qpa=B0i,jpa=F0i,Hpa=U0i,Gpa=Q0i,$pa=q0i,Vpa=j0i,Wpa=H0i,zpa=G0i,Ypa=$0i,Kpa=V0i,Jpa=W0i,Zpa=z0i,Xpa=Y0i,eha=K0i,tha=J0i,rha=Z0i,nha=X0i,iha=egi,oha=tgi,sha=rgi,aha=ngi,cha=igi,lha=ogi,uha=sgi,dha=agi,fha=cgi,pha=lgi,hha=ugi,mha=dgi,gha=fgi,Aha=pgi,yha=hgi,Eha=mgi,_ha=ggi,vha=Agi,Cha=ygi,bha=Egi,Sha=_gi,Tha=vgi,Iha=Cgi,xha=bgi,wha=Sgi,Rha=Tgi,kha=Igi,Pha=xgi,Dha=wgi,Nha=Rgi,Mha=kgi,Oha=Pgi,Lha=Dgi,Bha=Ngi,Fha=Mgi,Uha=Ogi,Qha=Lgi,qha=Bgi,jha=Fgi,Hha=Ugi,Gha=Qgi,$ha=fh([h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi]),qgi="alibaba_cloud",jgi="aws",Hgi="azure",Ggi="gcp",Vha=qgi,Wha=jgi,zha=Hgi,Yha=Ggi,Kha=fh([qgi,jgi,Hgi,Ggi]),$gi="alibaba_cloud_ecs",Vgi="alibaba_cloud_fc",Wgi="aws_ec2",zgi="aws_ecs",Ygi="aws_eks",Kgi="aws_lambda",Jgi="aws_elastic_beanstalk",Zgi="azure_vm",Xgi="azure_container_instances",eAi="azure_aks",tAi="azure_functions",rAi="azure_app_service",nAi="gcp_compute_engine",iAi="gcp_cloud_run",oAi="gcp_kubernetes_engine",sAi="gcp_cloud_functions",aAi="gcp_app_engine",Jha=$gi,Zha=Vgi,Xha=Wgi,ema=zgi,tma=Ygi,rma=Kgi,nma=Jgi,ima=Zgi,oma=Xgi,sma=eAi,ama=tAi,cma=rAi,lma=nAi,uma=iAi,dma=oAi,fma=sAi,pma=aAi,hma=fh([$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi]),cAi="ec2",lAi="fargate",mma=cAi,gma=lAi,Ama=fh([cAi,lAi]),uAi="amd64",dAi="arm32",fAi="arm64",pAi="ia64",hAi="ppc32",mAi="ppc64",gAi="x86",yma=uAi,Ema=dAi,_ma=fAi,vma=pAi,Cma=hAi,bma=mAi,Sma=gAi,Tma=fh([uAi,dAi,fAi,pAi,hAi,mAi,gAi]),AAi="windows",yAi="linux",EAi="darwin",_Ai="freebsd",vAi="netbsd",CAi="openbsd",bAi="dragonflybsd",SAi="hpux",TAi="aix",IAi="solaris",xAi="z_os",Ima=AAi,xma=yAi,wma=EAi,Rma=_Ai,kma=vAi,Pma=CAi,Dma=bAi,Nma=SAi,Mma=TAi,Oma=IAi,Lma=xAi,Bma=fh([AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi]),wAi="cpp",RAi="dotnet",kAi="erlang",PAi="go",DAi="java",NAi="nodejs",MAi="php",OAi="python",LAi="ruby",BAi="webjs",Fma=wAi,Uma=RAi,Qma=kAi,qma=PAi,jma=DAi,Hma=NAi,Gma=MAi,$ma=OAi,Vma=LAi,Wma=BAi,zma=fh([wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi])});var UAi=ve(()=>{p();FAi()});var Yma,Kma,Jma,Zma,Xma,e0a,t0a,r0a,n0a,i0a,o0a,s0a,a0a,c0a,l0a,u0a,d0a,f0a,p0a,h0a,m0a,g0a,A0a,y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,k0a,P0a,D0a,N0a,M0a,O0a,L0a,gup,Aup,B0a,F0a,U0a,Q0a,q0a,j0a,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,ega,tga,rga,nga,iga,oga,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,gga,Aga,yga,Ega,_ga,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,kga,Pga,Dga,Nga,Mga,Oga,Lga,Bga,Fga,Uga,Qga,qga,jga,Hga,Gga,$ga,Vga,Wga,zga,Yga,Kga,Jga,Zga,vAr,Xga,eAa,tAa,rAa,nAa,CAr,iAa,oAa,sAa,aAa,cAa,lAa,bAr,SAr,uAa,dAa,fAa,pAa,hAa,mAa,QAi=ve(()=>{p();Yma="aspnetcore.diagnostics.exception.result",Kma="aborted",Jma="handled",Zma="skipped",Xma="unhandled",e0a="aspnetcore.diagnostics.handler.type",t0a="aspnetcore.rate_limiting.policy",r0a="aspnetcore.rate_limiting.result",n0a="acquired",i0a="endpoint_limiter",o0a="global_limiter",s0a="request_canceled",a0a="aspnetcore.request.is_unhandled",c0a="aspnetcore.routing.is_fallback",l0a="aspnetcore.routing.match_status",u0a="failure",d0a="success",f0a="aspnetcore.user.is_authenticated",p0a="client.address",h0a="client.port",m0a="code.column.number",g0a="code.file.path",A0a="code.function.name",y0a="code.line.number",E0a="code.stacktrace",_0a="db.collection.name",v0a="db.namespace",C0a="db.operation.batch.size",b0a="db.operation.name",S0a="db.query.summary",T0a="db.query.text",I0a="db.response.status_code",x0a="db.stored_procedure.name",w0a="db.system.name",R0a="mariadb",k0a="microsoft.sql_server",P0a="mysql",D0a="postgresql",N0a="dotnet.gc.heap.generation",M0a="gen0",O0a="gen1",L0a="gen2",gup="loh",Aup="poh",B0a="error.type",F0a="_OTHER",U0a="exception.escaped",Q0a="exception.message",q0a="exception.stacktrace",j0a="exception.type",H0a=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),G0a="http.request.method",$0a="_OTHER",V0a="CONNECT",W0a="DELETE",z0a="GET",Y0a="HEAD",K0a="OPTIONS",J0a="PATCH",Z0a="POST",X0a="PUT",ega="TRACE",tga="http.request.method_original",rga="http.request.resend_count",nga=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),iga="http.response.status_code",oga="http.route",sga="jvm.gc.action",aga="jvm.gc.name",cga="jvm.memory.pool.name",lga="jvm.memory.type",uga="heap",dga="non_heap",fga="jvm.thread.daemon",pga="jvm.thread.state",hga="blocked",mga="new",gga="runnable",Aga="terminated",yga="timed_waiting",Ega="waiting",_ga="network.local.address",vga="network.local.port",Cga="network.peer.address",bga="network.peer.port",Sga="network.protocol.name",Tga="network.protocol.version",Iga="network.transport",xga="pipe",wga="quic",Rga="tcp",kga="udp",Pga="unix",Dga="network.type",Nga="ipv4",Mga="ipv6",Oga="otel.scope.name",Lga="otel.scope.version",Bga="otel.status_code",Fga="ERROR",Uga="OK",Qga="otel.status_description",qga="server.address",jga="server.port",Hga="service.name",Gga="service.version",$ga="signalr.connection.status",Vga="app_shutdown",Wga="normal_closure",zga="timeout",Yga="signalr.transport",Kga="long_polling",Jga="server_sent_events",Zga="web_sockets",vAr="telemetry.sdk.language",Xga="cpp",eAa="dotnet",tAa="erlang",rAa="go",nAa="java",CAr="nodejs",iAa="php",oAa="python",sAa="ruby",aAa="rust",cAa="swift",lAa="webjs",bAr="telemetry.sdk.name",SAr="telemetry.sdk.version",uAa="url.fragment",dAa="url.full",fAa="url.path",pAa="url.query",hAa="url.scheme",mAa="user_agent.original"});var gAa,AAa,yAa,EAa,_Aa,vAa,CAa,bAa,SAa,TAa,IAa,xAa,wAa,RAa,kAa,PAa,DAa,NAa,MAa,OAa,LAa,BAa,FAa,UAa,QAa,qAa,jAa,HAa,GAa,$Aa,VAa,WAa,zAa,YAa,KAa,JAa,ZAa,XAa,eya,tya,rya,nya,iya,oya,sya,aya,cya,lya,uya,dya,fya,qAi=ve(()=>{p();gAa="aspnetcore.diagnostics.exceptions",AAa="aspnetcore.rate_limiting.active_request_leases",yAa="aspnetcore.rate_limiting.queued_requests",EAa="aspnetcore.rate_limiting.request.time_in_queue",_Aa="aspnetcore.rate_limiting.request_lease.duration",vAa="aspnetcore.rate_limiting.requests",CAa="aspnetcore.routing.match_attempts",bAa="db.client.operation.duration",SAa="dotnet.assembly.count",TAa="dotnet.exceptions",IAa="dotnet.gc.collections",xAa="dotnet.gc.heap.total_allocated",wAa="dotnet.gc.last_collection.heap.fragmentation.size",RAa="dotnet.gc.last_collection.heap.size",kAa="dotnet.gc.last_collection.memory.committed_size",PAa="dotnet.gc.pause.time",DAa="dotnet.jit.compilation.time",NAa="dotnet.jit.compiled_il.size",MAa="dotnet.jit.compiled_methods",OAa="dotnet.monitor.lock_contentions",LAa="dotnet.process.cpu.count",BAa="dotnet.process.cpu.time",FAa="dotnet.process.memory.working_set",UAa="dotnet.thread_pool.queue.length",QAa="dotnet.thread_pool.thread.count",qAa="dotnet.thread_pool.work_item.count",jAa="dotnet.timer.count",HAa="http.client.request.duration",GAa="http.server.request.duration",$Aa="jvm.class.count",VAa="jvm.class.loaded",WAa="jvm.class.unloaded",zAa="jvm.cpu.count",YAa="jvm.cpu.recent_utilization",KAa="jvm.cpu.time",JAa="jvm.gc.duration",ZAa="jvm.memory.committed",XAa="jvm.memory.limit",eya="jvm.memory.used",tya="jvm.memory.used_after_last_gc",rya="jvm.thread.count",nya="kestrel.active_connections",iya="kestrel.active_tls_handshakes",oya="kestrel.connection.duration",sya="kestrel.queued_connections",aya="kestrel.queued_requests",cya="kestrel.rejected_connections",lya="kestrel.tls_handshake.duration",uya="kestrel.upgraded_connections",dya="signalr.server.active_connections",fya="signalr.server.connection.duration"});var pya,jAi=ve(()=>{p();pya="exception"});var TAr={};ki(TAr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Kma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Jma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Zma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Xma,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>n0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>i0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>o0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>s0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>u0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>d0a,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Yma,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>e0a,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>t0a,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>r0a,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>a0a,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>c0a,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>l0a,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>f0a,ATTR_CLIENT_ADDRESS:()=>p0a,ATTR_CLIENT_PORT:()=>h0a,ATTR_CODE_COLUMN_NUMBER:()=>m0a,ATTR_CODE_FILE_PATH:()=>g0a,ATTR_CODE_FUNCTION_NAME:()=>A0a,ATTR_CODE_LINE_NUMBER:()=>y0a,ATTR_CODE_STACKTRACE:()=>E0a,ATTR_DB_COLLECTION_NAME:()=>_0a,ATTR_DB_NAMESPACE:()=>v0a,ATTR_DB_OPERATION_BATCH_SIZE:()=>C0a,ATTR_DB_OPERATION_NAME:()=>b0a,ATTR_DB_QUERY_SUMMARY:()=>S0a,ATTR_DB_QUERY_TEXT:()=>T0a,ATTR_DB_RESPONSE_STATUS_CODE:()=>I0a,ATTR_DB_STORED_PROCEDURE_NAME:()=>x0a,ATTR_DB_SYSTEM_NAME:()=>w0a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>N0a,ATTR_ERROR_TYPE:()=>B0a,ATTR_EXCEPTION_ESCAPED:()=>U0a,ATTR_EXCEPTION_MESSAGE:()=>Q0a,ATTR_EXCEPTION_STACKTRACE:()=>q0a,ATTR_EXCEPTION_TYPE:()=>j0a,ATTR_HTTP_REQUEST_HEADER:()=>H0a,ATTR_HTTP_REQUEST_METHOD:()=>G0a,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>tga,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>rga,ATTR_HTTP_RESPONSE_HEADER:()=>nga,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>iga,ATTR_HTTP_ROUTE:()=>oga,ATTR_JVM_GC_ACTION:()=>sga,ATTR_JVM_GC_NAME:()=>aga,ATTR_JVM_MEMORY_POOL_NAME:()=>cga,ATTR_JVM_MEMORY_TYPE:()=>lga,ATTR_JVM_THREAD_DAEMON:()=>fga,ATTR_JVM_THREAD_STATE:()=>pga,ATTR_NETWORK_LOCAL_ADDRESS:()=>_ga,ATTR_NETWORK_LOCAL_PORT:()=>vga,ATTR_NETWORK_PEER_ADDRESS:()=>Cga,ATTR_NETWORK_PEER_PORT:()=>bga,ATTR_NETWORK_PROTOCOL_NAME:()=>Sga,ATTR_NETWORK_PROTOCOL_VERSION:()=>Tga,ATTR_NETWORK_TRANSPORT:()=>Iga,ATTR_NETWORK_TYPE:()=>Dga,ATTR_OTEL_SCOPE_NAME:()=>Oga,ATTR_OTEL_SCOPE_VERSION:()=>Lga,ATTR_OTEL_STATUS_CODE:()=>Bga,ATTR_OTEL_STATUS_DESCRIPTION:()=>Qga,ATTR_SERVER_ADDRESS:()=>qga,ATTR_SERVER_PORT:()=>jga,ATTR_SERVICE_NAME:()=>Hga,ATTR_SERVICE_VERSION:()=>Gga,ATTR_SIGNALR_CONNECTION_STATUS:()=>$ga,ATTR_SIGNALR_TRANSPORT:()=>Yga,ATTR_TELEMETRY_SDK_LANGUAGE:()=>vAr,ATTR_TELEMETRY_SDK_NAME:()=>bAr,ATTR_TELEMETRY_SDK_VERSION:()=>SAr,ATTR_URL_FRAGMENT:()=>uAa,ATTR_URL_FULL:()=>dAa,ATTR_URL_PATH:()=>fAa,ATTR_URL_QUERY:()=>pAa,ATTR_URL_SCHEME:()=>hAa,ATTR_USER_AGENT_ORIGINAL:()=>mAa,AWSECSLAUNCHTYPEVALUES_EC2:()=>mma,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>gma,AwsEcsLaunchtypeValues:()=>Ama,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Jha,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Zha,CLOUDPLATFORMVALUES_AWS_EC2:()=>Xha,CLOUDPLATFORMVALUES_AWS_ECS:()=>ema,CLOUDPLATFORMVALUES_AWS_EKS:()=>tma,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>nma,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>rma,CLOUDPLATFORMVALUES_AZURE_AKS:()=>sma,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>cma,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>oma,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ama,CLOUDPLATFORMVALUES_AZURE_VM:()=>ima,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>pma,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>fma,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>uma,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>lma,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>dma,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Vha,CLOUDPROVIDERVALUES_AWS:()=>Wha,CLOUDPROVIDERVALUES_AZURE:()=>zha,CLOUDPROVIDERVALUES_GCP:()=>Yha,CloudPlatformValues:()=>hma,CloudProviderValues:()=>Kha,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>kda,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Fda,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Pda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Bda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Nda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Qda,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Mda,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Dda,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Uda,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Lda,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Oda,DBSYSTEMVALUES_ADABAS:()=>Xua,DBSYSTEMVALUES_CACHE:()=>Zua,DBSYSTEMVALUES_CASSANDRA:()=>gda,DBSYSTEMVALUES_CLOUDSCAPE:()=>Gua,DBSYSTEMVALUES_COCKROACHDB:()=>wda,DBSYSTEMVALUES_COLDFUSION:()=>mda,DBSYSTEMVALUES_COSMOSDB:()=>Cda,DBSYSTEMVALUES_COUCHBASE:()=>_da,DBSYSTEMVALUES_COUCHDB:()=>vda,DBSYSTEMVALUES_DB2:()=>Qua,DBSYSTEMVALUES_DERBY:()=>tda,DBSYSTEMVALUES_DYNAMODB:()=>bda,DBSYSTEMVALUES_EDB:()=>Jua,DBSYSTEMVALUES_ELASTICSEARCH:()=>Ida,DBSYSTEMVALUES_FILEMAKER:()=>rda,DBSYSTEMVALUES_FIREBIRD:()=>eda,DBSYSTEMVALUES_FIRSTSQL:()=>Kua,DBSYSTEMVALUES_GEODE:()=>Tda,DBSYSTEMVALUES_H2:()=>hda,DBSYSTEMVALUES_HANADB:()=>zua,DBSYSTEMVALUES_HBASE:()=>Ada,DBSYSTEMVALUES_HIVE:()=>Hua,DBSYSTEMVALUES_HSQLDB:()=>$ua,DBSYSTEMVALUES_INFORMIX:()=>nda,DBSYSTEMVALUES_INGRES:()=>Yua,DBSYSTEMVALUES_INSTANTDB:()=>ida,DBSYSTEMVALUES_INTERBASE:()=>oda,DBSYSTEMVALUES_MARIADB:()=>sda,DBSYSTEMVALUES_MAXDB:()=>Wua,DBSYSTEMVALUES_MEMCACHED:()=>xda,DBSYSTEMVALUES_MONGODB:()=>yda,DBSYSTEMVALUES_MSSQL:()=>Bua,DBSYSTEMVALUES_MYSQL:()=>Fua,DBSYSTEMVALUES_NEO4J:()=>Sda,DBSYSTEMVALUES_NETEZZA:()=>ada,DBSYSTEMVALUES_ORACLE:()=>Uua,DBSYSTEMVALUES_OTHER_SQL:()=>Lua,DBSYSTEMVALUES_PERVASIVE:()=>cda,DBSYSTEMVALUES_POINTBASE:()=>lda,DBSYSTEMVALUES_POSTGRESQL:()=>qua,DBSYSTEMVALUES_PROGRESS:()=>Vua,DBSYSTEMVALUES_REDIS:()=>Eda,DBSYSTEMVALUES_REDSHIFT:()=>jua,DBSYSTEMVALUES_SQLITE:()=>uda,DBSYSTEMVALUES_SYBASE:()=>dda,DBSYSTEMVALUES_TERADATA:()=>fda,DBSYSTEMVALUES_VERTICA:()=>pda,DB_SYSTEM_NAME_VALUE_MARIADB:()=>R0a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>k0a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>P0a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>D0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>M0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>O0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>L0a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>gup,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Aup,DbCassandraConsistencyLevelValues:()=>qda,DbSystemValues:()=>Rda,ERROR_TYPE_VALUE_OTHER:()=>F0a,EVENT_EXCEPTION:()=>pya,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Kda,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Yda,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>zda,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Zda,FAASINVOKEDPROVIDERVALUES_AWS:()=>Xda,FAASINVOKEDPROVIDERVALUES_AZURE:()=>efa,FAASINVOKEDPROVIDERVALUES_GCP:()=>tfa,FAASTRIGGERVALUES_DATASOURCE:()=>jda,FAASTRIGGERVALUES_HTTP:()=>Hda,FAASTRIGGERVALUES_OTHER:()=>Vda,FAASTRIGGERVALUES_PUBSUB:()=>Gda,FAASTRIGGERVALUES_TIMER:()=>$da,FaasDocumentOperationValues:()=>Jda,FaasInvokedProviderValues:()=>rfa,FaasTriggerValues:()=>Wda,HOSTARCHVALUES_AMD64:()=>yma,HOSTARCHVALUES_ARM32:()=>Ema,HOSTARCHVALUES_ARM64:()=>_ma,HOSTARCHVALUES_IA64:()=>vma,HOSTARCHVALUES_PPC32:()=>Cma,HOSTARCHVALUES_PPC64:()=>bma,HOSTARCHVALUES_X86:()=>Sma,HTTPFLAVORVALUES_HTTP_1_0:()=>Ufa,HTTPFLAVORVALUES_HTTP_1_1:()=>Qfa,HTTPFLAVORVALUES_HTTP_2_0:()=>qfa,HTTPFLAVORVALUES_QUIC:()=>Hfa,HTTPFLAVORVALUES_SPDY:()=>jfa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>V0a,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>W0a,HTTP_REQUEST_METHOD_VALUE_GET:()=>z0a,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Y0a,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>K0a,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>$0a,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>J0a,HTTP_REQUEST_METHOD_VALUE_POST:()=>Z0a,HTTP_REQUEST_METHOD_VALUE_PUT:()=>X0a,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>ega,HostArchValues:()=>Tma,HttpFlavorValues:()=>Gfa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>uga,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>dga,JVM_THREAD_STATE_VALUE_BLOCKED:()=>hga,JVM_THREAD_STATE_VALUE_NEW:()=>mga,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>gga,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Aga,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>yga,JVM_THREAD_STATE_VALUE_WAITING:()=>Ega,MESSAGETYPEVALUES_RECEIVED:()=>gpa,MESSAGETYPEVALUES_SENT:()=>mpa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>$fa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Vfa,MESSAGINGOPERATIONVALUES_PROCESS:()=>Yfa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>zfa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>gAa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>AAa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>yAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>vAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>_Aa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>EAa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>CAa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>bAa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>SAa,METRIC_DOTNET_EXCEPTIONS:()=>TAa,METRIC_DOTNET_GC_COLLECTIONS:()=>IAa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>xAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>wAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>RAa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>kAa,METRIC_DOTNET_GC_PAUSE_TIME:()=>PAa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>DAa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>NAa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>MAa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>OAa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>LAa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>BAa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>FAa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>UAa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>QAa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>qAa,METRIC_DOTNET_TIMER_COUNT:()=>jAa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>HAa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>GAa,METRIC_JVM_CLASS_COUNT:()=>$Aa,METRIC_JVM_CLASS_LOADED:()=>VAa,METRIC_JVM_CLASS_UNLOADED:()=>WAa,METRIC_JVM_CPU_COUNT:()=>zAa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>YAa,METRIC_JVM_CPU_TIME:()=>KAa,METRIC_JVM_GC_DURATION:()=>JAa,METRIC_JVM_MEMORY_COMMITTED:()=>ZAa,METRIC_JVM_MEMORY_LIMIT:()=>XAa,METRIC_JVM_MEMORY_USED:()=>eya,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>tya,METRIC_JVM_THREAD_COUNT:()=>rya,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>nya,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>iya,METRIC_KESTREL_CONNECTION_DURATION:()=>oya,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>sya,METRIC_KESTREL_QUEUED_REQUESTS:()=>aya,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>cya,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>lya,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>uya,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>dya,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>fya,MessageTypeValues:()=>Apa,MessagingDestinationKindValues:()=>Wfa,MessagingOperationValues:()=>Kfa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>_fa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>bfa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>yfa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>kfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>vfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Cfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>wfa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Afa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Dfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Sfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Ifa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Pfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Tfa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>xfa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Mfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Rfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Bfa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Ofa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Lfa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Nfa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Efa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>pfa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>hfa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>mfa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>dfa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>ffa,NETTRANSPORTVALUES_INPROC:()=>cfa,NETTRANSPORTVALUES_IP:()=>ofa,NETTRANSPORTVALUES_IP_TCP:()=>nfa,NETTRANSPORTVALUES_IP_UDP:()=>ifa,NETTRANSPORTVALUES_OTHER:()=>lfa,NETTRANSPORTVALUES_PIPE:()=>afa,NETTRANSPORTVALUES_UNIX:()=>sfa,NETWORK_TRANSPORT_VALUE_PIPE:()=>xga,NETWORK_TRANSPORT_VALUE_QUIC:()=>wga,NETWORK_TRANSPORT_VALUE_TCP:()=>Rga,NETWORK_TRANSPORT_VALUE_UDP:()=>kga,NETWORK_TRANSPORT_VALUE_UNIX:()=>Pga,NETWORK_TYPE_VALUE_IPV4:()=>Nga,NETWORK_TYPE_VALUE_IPV6:()=>Mga,NetHostConnectionSubtypeValues:()=>Ffa,NetHostConnectionTypeValues:()=>gfa,NetTransportValues:()=>ufa,OSTYPEVALUES_AIX:()=>Mma,OSTYPEVALUES_DARWIN:()=>wma,OSTYPEVALUES_DRAGONFLYBSD:()=>Dma,OSTYPEVALUES_FREEBSD:()=>Rma,OSTYPEVALUES_HPUX:()=>Nma,OSTYPEVALUES_LINUX:()=>xma,OSTYPEVALUES_NETBSD:()=>kma,OSTYPEVALUES_OPENBSD:()=>Pma,OSTYPEVALUES_SOLARIS:()=>Oma,OSTYPEVALUES_WINDOWS:()=>Ima,OSTYPEVALUES_Z_OS:()=>Lma,OTEL_STATUS_CODE_VALUE_ERROR:()=>Fga,OTEL_STATUS_CODE_VALUE_OK:()=>Uga,OsTypeValues:()=>Bma,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>apa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>npa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Zfa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>fpa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>tpa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>spa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>upa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>epa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>rpa,RPCGRPCSTATUSCODEVALUES_OK:()=>Jfa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>cpa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>ipa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>opa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>ppa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>dpa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>lpa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Xfa,RpcGrpcStatusCodeValues:()=>hpa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Gla,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>rua,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>qla,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Bla,SEMATTRS_AWS_DYNAMODB_COUNT:()=>eua,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Yla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Wla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>nua,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>$la,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Fla,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Hla,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>zla,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>jla,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Ula,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Qla,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>tua,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Jla,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Zla,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Vla,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Kla,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Lla,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Xla,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>mca,SEMATTRS_CODE_FILEPATH:()=>Ela,SEMATTRS_CODE_FUNCTION:()=>Ala,SEMATTRS_CODE_LINENO:()=>_la,SEMATTRS_CODE_NAMESPACE:()=>yla,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Ica,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Pca,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>kca,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>wca,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Sca,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Tca,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Rca,SEMATTRS_DB_CASSANDRA_TABLE:()=>xca,SEMATTRS_DB_CONNECTION_STRING:()=>Aca,SEMATTRS_DB_HBASE_NAMESPACE:()=>Dca,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Eca,SEMATTRS_DB_MONGODB_COLLECTION:()=>Mca,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>bca,SEMATTRS_DB_NAME:()=>_ca,SEMATTRS_DB_OPERATION:()=>Cca,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Nca,SEMATTRS_DB_SQL_TABLE:()=>Oca,SEMATTRS_DB_STATEMENT:()=>vca,SEMATTRS_DB_SYSTEM:()=>gca,SEMATTRS_DB_USER:()=>yca,SEMATTRS_ENDUSER_ID:()=>fla,SEMATTRS_ENDUSER_ROLE:()=>pla,SEMATTRS_ENDUSER_SCOPE:()=>hla,SEMATTRS_EXCEPTION_ESCAPED:()=>Uca,SEMATTRS_EXCEPTION_MESSAGE:()=>Bca,SEMATTRS_EXCEPTION_STACKTRACE:()=>Fca,SEMATTRS_EXCEPTION_TYPE:()=>Lca,SEMATTRS_FAAS_COLDSTART:()=>zca,SEMATTRS_FAAS_CRON:()=>Wca,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>jca,SEMATTRS_FAAS_DOCUMENT_NAME:()=>$ca,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Hca,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Gca,SEMATTRS_FAAS_EXECUTION:()=>qca,SEMATTRS_FAAS_INVOKED_NAME:()=>Yca,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Kca,SEMATTRS_FAAS_INVOKED_REGION:()=>Jca,SEMATTRS_FAAS_TIME:()=>Vca,SEMATTRS_FAAS_TRIGGER:()=>Qca,SEMATTRS_HTTP_CLIENT_IP:()=>Ola,SEMATTRS_HTTP_FLAVOR:()=>xla,SEMATTRS_HTTP_HOST:()=>Sla,SEMATTRS_HTTP_METHOD:()=>vla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Rla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>kla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Pla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Dla,SEMATTRS_HTTP_ROUTE:()=>Mla,SEMATTRS_HTTP_SCHEME:()=>Tla,SEMATTRS_HTTP_SERVER_NAME:()=>Nla,SEMATTRS_HTTP_STATUS_CODE:()=>Ila,SEMATTRS_HTTP_TARGET:()=>bla,SEMATTRS_HTTP_URL:()=>Cla,SEMATTRS_HTTP_USER_AGENT:()=>wla,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Nua,SEMATTRS_MESSAGE_ID:()=>Dua,SEMATTRS_MESSAGE_TYPE:()=>Pua,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Mua,SEMATTRS_MESSAGING_CONSUMER_ID:()=>gua,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>fua,SEMATTRS_MESSAGING_DESTINATION:()=>oua,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>sua,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_ua,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Eua,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>yua,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>vua,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Cua,SEMATTRS_MESSAGING_MESSAGE_ID:()=>dua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>hua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>pua,SEMATTRS_MESSAGING_OPERATION:()=>mua,SEMATTRS_MESSAGING_PROTOCOL:()=>cua,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>lua,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Aua,SEMATTRS_MESSAGING_SYSTEM:()=>iua,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>aua,SEMATTRS_MESSAGING_URL:()=>uua,SEMATTRS_NET_HOST_CARRIER_ICC:()=>ula,SEMATTRS_NET_HOST_CARRIER_MCC:()=>cla,SEMATTRS_NET_HOST_CARRIER_MNC:()=>lla,SEMATTRS_NET_HOST_CARRIER_NAME:()=>ala,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>sla,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>ola,SEMATTRS_NET_HOST_IP:()=>rla,SEMATTRS_NET_HOST_NAME:()=>ila,SEMATTRS_NET_HOST_PORT:()=>nla,SEMATTRS_NET_PEER_IP:()=>Xca,SEMATTRS_NET_PEER_NAME:()=>tla,SEMATTRS_NET_PEER_PORT:()=>ela,SEMATTRS_NET_TRANSPORT:()=>Zca,SEMATTRS_PEER_SERVICE:()=>dla,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Iua,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Rua,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>kua,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>wua,SEMATTRS_RPC_JSONRPC_VERSION:()=>xua,SEMATTRS_RPC_METHOD:()=>Tua,SEMATTRS_RPC_SERVICE:()=>Sua,SEMATTRS_RPC_SYSTEM:()=>bua,SEMATTRS_THREAD_ID:()=>mla,SEMATTRS_THREAD_NAME:()=>gla,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Spa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>bpa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Tpa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Ipa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>xpa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>wpa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Rpa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Ppa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>kpa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Npa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Dpa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Epa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>vpa,SEMRESATTRS_CLOUD_PLATFORM:()=>Cpa,SEMRESATTRS_CLOUD_PROVIDER:()=>ypa,SEMRESATTRS_CLOUD_REGION:()=>_pa,SEMRESATTRS_CONTAINER_ID:()=>Opa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Bpa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Fpa,SEMRESATTRS_CONTAINER_NAME:()=>Mpa,SEMRESATTRS_CONTAINER_RUNTIME:()=>Lpa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Upa,SEMRESATTRS_DEVICE_ID:()=>Qpa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>qpa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>jpa,SEMRESATTRS_FAAS_ID:()=>Gpa,SEMRESATTRS_FAAS_INSTANCE:()=>Vpa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Wpa,SEMRESATTRS_FAAS_NAME:()=>Hpa,SEMRESATTRS_FAAS_VERSION:()=>$pa,SEMRESATTRS_HOST_ARCH:()=>Jpa,SEMRESATTRS_HOST_ID:()=>zpa,SEMRESATTRS_HOST_IMAGE_ID:()=>Xpa,SEMRESATTRS_HOST_IMAGE_NAME:()=>Zpa,SEMRESATTRS_HOST_IMAGE_VERSION:()=>eha,SEMRESATTRS_HOST_NAME:()=>Ypa,SEMRESATTRS_HOST_TYPE:()=>Kpa,SEMRESATTRS_K8S_CLUSTER_NAME:()=>tha,SEMRESATTRS_K8S_CONTAINER_NAME:()=>aha,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Eha,SEMRESATTRS_K8S_CRONJOB_UID:()=>yha,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>mha,SEMRESATTRS_K8S_DAEMONSET_UID:()=>hha,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>dha,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>uha,SEMRESATTRS_K8S_JOB_NAME:()=>Aha,SEMRESATTRS_K8S_JOB_UID:()=>gha,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>iha,SEMRESATTRS_K8S_NODE_NAME:()=>rha,SEMRESATTRS_K8S_NODE_UID:()=>nha,SEMRESATTRS_K8S_POD_NAME:()=>sha,SEMRESATTRS_K8S_POD_UID:()=>oha,SEMRESATTRS_K8S_REPLICASET_NAME:()=>lha,SEMRESATTRS_K8S_REPLICASET_UID:()=>cha,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>pha,SEMRESATTRS_K8S_STATEFULSET_UID:()=>fha,SEMRESATTRS_OS_DESCRIPTION:()=>vha,SEMRESATTRS_OS_NAME:()=>Cha,SEMRESATTRS_OS_TYPE:()=>_ha,SEMRESATTRS_OS_VERSION:()=>bha,SEMRESATTRS_PROCESS_COMMAND:()=>xha,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Rha,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>wha,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Tha,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Iha,SEMRESATTRS_PROCESS_OWNER:()=>kha,SEMRESATTRS_PROCESS_PID:()=>Sha,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Nha,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Pha,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Dha,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Lha,SEMRESATTRS_SERVICE_NAME:()=>Mha,SEMRESATTRS_SERVICE_NAMESPACE:()=>Oha,SEMRESATTRS_SERVICE_VERSION:()=>Bha,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>qha,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Uha,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Fha,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Qha,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Gha,SEMRESATTRS_WEBENGINE_NAME:()=>jha,SEMRESATTRS_WEBENGINE_VERSION:()=>Hha,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Vga,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Wga,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>zga,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Kga,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Jga,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Zga,SemanticAttributes:()=>Oua,SemanticResourceAttributes:()=>$ha,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Fma,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Uma,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Qma,TELEMETRYSDKLANGUAGEVALUES_GO:()=>qma,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>jma,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Hma,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Gma,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>$ma,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Vma,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Wma,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Xga,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>eAa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>tAa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>rAa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>nAa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>CAr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>iAa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>oAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>sAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>aAa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>cAa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>lAa,TelemetrySdkLanguageValues:()=>zma});var yht=ve(()=>{p();p0i();UAi();QAi();qAi();jAi()});var HAi,GAi=ve(()=>{p();HAi="process.runtime.name"});var Eht,$Ai=ve(()=>{p();Cdi();yht();GAi();Eht={[bAr]:"opentelemetry",[HAi]:"node",[vAr]:CAr,[SAr]:vdi}});var VAi=ve(()=>{p();Adi();ydi();_di();$Ai()});var IAr=ve(()=>{p();VAi()});function _0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*mya);return[r,n]}function vht(){let t=sG.timeOrigin;if(typeof t!="number"){let e=sG;t=e.timing&&e.timing.fetchStart}return t}function xAr(t){let e=_0e(vht()),r=_0e(typeof t=="number"?t:sG.now());return wAr(e,r)}function zAi(t){if(Cht(t))return t;if(typeof t=="number")return t=_ht&&(r[1]-=_ht,r[0]+=1),r}var WAi,hya,mya,_ht,tyi=ve(()=>{p();IAr();WAi=9,hya=6,mya=Math.pow(10,hya),_ht=Math.pow(10,WAi);a(_0e,"millisToHrTime");a(vht,"getTimeOrigin");a(xAr,"hrTime");a(zAi,"timeInputToHrTime");a(YAi,"hrTimeDuration");a(KAi,"hrTimeToTimeStamp");a(JAi,"hrTimeToNanoseconds");a(ZAi,"hrTimeToMilliseconds");a(XAi,"hrTimeToMicroseconds");a(Cht,"isTimeInputHrTime");a(eyi,"isTimeInput");a(wAr,"addHrTimes")});function ryi(t){typeof t!="number"&&t.unref()}var nyi=ve(()=>{p();a(ryi,"unrefTimer")});var bht,iyi=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(bht||(bht={}))});var Sht,oyi=ve(()=>{p();co();Sht=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){Dn.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){Dn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function syi(t){return yya.test(t)}function ayi(t){return Eya.test(t)&&!_ya.test(t)}var RAr,gya,Aya,yya,Eya,_ya,cyi=ve(()=>{p();RAr="[_0-9a-z-*/]",gya=`[a-z]${RAr}{0,255}`,Aya=`[a-z0-9]${RAr}{0,240}@[a-z]${RAr}{0,13}`,yya=new RegExp(`^(?:${gya}|${Aya})$`),Eya=/^[ -~]{0,255}[!-~]$/,_ya=/,|=/;a(syi,"validateKey");a(ayi,"validateValue")});var lyi,vya,uyi,dyi,v0e,kAr=ve(()=>{p();cyi();lyi=32,vya=512,uyi=",",dyi="=",v0e=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+dyi+this.get(r)),e),[]).join(uyi)}_parse(e){e.length>vya||(this._internalState=e.split(uyi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(dyi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);syi(c)&&ayi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>lyi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,lyi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function PAr(t){let e=xya.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var tOe,rOe,Cya,bya,Sya,Tya,Iya,xya,Tht,fyi=ve(()=>{p();co();XMe();kAr();tOe="traceparent",rOe="tracestate",Cya="00",bya="(?!ff)[\\da-f]{2}",Sya="(?![0]{32})[\\da-f]{32}",Tya="(?![0]{16})[\\da-f]{16}",Iya="[\\da-f]{2}",xya=new RegExp(`^\\s?(${bya})-(${Sya})-(${Tya})-(${Iya})(-.*)?\\s?$`);a(PAr,"parseTraceParent");Tht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=wu.getSpanContext(e);if(!o||E0e(e)||!vb(o))return;let s=`${Cya}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||wf.NONE).toString(16)}`;n.set(r,tOe,s),o.traceState&&n.set(r,rOe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,tOe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=PAr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,rOe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new v0e(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)}fields(){return[tOe,rOe]}}});function pyi(t,e){return t.setValue(DAr,e)}function hyi(t){return t.deleteValue(DAr)}function myi(t){return t.getValue(DAr)}var DAr,Iht,gyi=ve(()=>{p();co();DAr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Iht||(Iht={}));a(pyi,"setRPCMetadata");a(hyi,"deleteRPCMetadata");a(myi,"getRPCMetadata")});function NAr(t){if(!Mya(t)||Oya(t)!==wya)return!1;let e=Nya(t);if(e===null)return!0;let r=Eyi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ayi.call(r)===Dya}function Mya(t){return t!=null&&typeof t=="object"}function Oya(t){return t==null?t===void 0?kya:Rya:Pee&&Pee in Object(t)?Lya(t):Bya(t)}function Lya(t){let e=Eyi.call(t,Pee),r=t[Pee],n=!1;try{t[Pee]=void 0,n=!0}catch{}let o=_yi.call(t);return n&&(e?t[Pee]=r:delete t[Pee]),o}function Bya(t){return _yi.call(t)}var wya,Rya,kya,Pya,Ayi,Dya,Nya,yyi,Eyi,Pee,_yi,vyi=ve(()=>{p();wya="[object Object]",Rya="[object Null]",kya="[object Undefined]",Pya=Function.prototype,Ayi=Pya.toString,Dya=Ayi.call(Object),Nya=Object.getPrototypeOf,yyi=Object.prototype,Eyi=yyi.hasOwnProperty,Pee=Symbol?Symbol.toStringTag:void 0,_yi=yyi.toString;a(NAr,"isPlainObject");a(Mya,"isObjectLike");a(Oya,"baseGetTag");a(Lya,"getRawTag");a(Bya,"objectToString")});function byi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Syi(e,t.shift(),0,r);return e}function MAr(t){return wht(t)?t.slice():t}function Syi(t,e,r=0,n){let o;if(!(r>Fya)){if(r++,xht(t)||xht(e)||Tyi(e))o=MAr(e);else if(wht(t)){if(o=t.slice(),wht(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Cyi(t,u,n)||Cyi(e,u,n))delete o[u];else{if(nOe(f)&&nOe(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]=Syi(o[u],d,r,n)}}}}else o=e;return o}}function Cyi(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 Uya(t,e){return!(!NAr(t)||!NAr(e))}var Fya,Iyi=ve(()=>{p();vyi();Fya=20;a(byi,"merge");a(MAr,"takeValue");a(Syi,"mergeTwoObjects");a(Cyi,"wasObjectReferenced");a(wht,"isArray");a(Tyi,"isFunction");a(nOe,"isObject");a(xht,"isPrimitive");a(Uya,"shouldMerge")});function xyi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new iOe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var iOe,wyi=ve(()=>{p();iOe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(xyi,"callWithTimeout")});function OAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Ryi(t,e){if(!e)return!1;for(let r of e)if(OAr(t,r))return!0;return!1}var kyi=ve(()=>{p();a(OAr,"urlMatches");a(Ryi,"isUrlIgnored")});var Rht,Pyi=ve(()=>{p();Rht=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 kht,Dyi=ve(()=>{p();Pyi();kht=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new Rht;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 Myi(t){if(t==null)return;let e=Nyi[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Nyi)}, using default`),Da.INFO)}var Nyi,Oyi=ve(()=>{p();co();Nyi={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Myi,"diagLogLevelFromString")});function Lyi(t,e){return new Promise(r=>{Og.with(cht(Og.active()),()=>{t.export(e,n=>{r(n)})})})}var Byi=ve(()=>{p();co();XMe();a(Lyi,"_export")});var Pht={};ki(Pht,{AnchoredClock:()=>fht,BindOnceFuture:()=>kht,CompositePropagator:()=>Sht,ExportResultCode:()=>bht,RPCType:()=>Iht,SDK_INFO:()=>Eht,TRACE_PARENT_HEADER:()=>tOe,TRACE_STATE_HEADER:()=>rOe,TimeoutError:()=>iOe,TraceState:()=>v0e,W3CBaggagePropagator:()=>dht,W3CTraceContextPropagator:()=>Tht,_globalThis:()=>Aht,addHrTimes:()=>wAr,callWithTimeout:()=>xyi,deleteRPCMetadata:()=>hyi,diagLogLevelFromString:()=>Myi,getBooleanFromEnv:()=>mht,getNumberFromEnv:()=>hht,getRPCMetadata:()=>myi,getStringFromEnv:()=>eOe,getStringListFromEnv:()=>ght,getTimeOrigin:()=>vht,globalErrorHandler:()=>mdi,hrTime:()=>xAr,hrTimeDuration:()=>YAi,hrTimeToMicroseconds:()=>XAi,hrTimeToMilliseconds:()=>ZAi,hrTimeToNanoseconds:()=>JAi,hrTimeToTimeStamp:()=>KAi,internal:()=>Qya,isAttributeValue:()=>AAr,isTimeInput:()=>eyi,isTimeInputHrTime:()=>Cht,isTracingSuppressed:()=>E0e,isUrlIgnored:()=>Ryi,loggingErrorHandler:()=>pht,merge:()=>byi,millisToHrTime:()=>_0e,otperformance:()=>sG,parseKeyPairsIntoRecord:()=>adi,parseTraceParent:()=>PAr,sanitizeAttributes:()=>udi,setGlobalErrorHandler:()=>hdi,setRPCMetadata:()=>pyi,suppressTracing:()=>cht,timeInputToHrTime:()=>zAi,unrefTimer:()=>ryi,unsuppressTracing:()=>rdi,urlMatches:()=>OAr});var Qya,Dht=ve(()=>{p();cdi();ldi();fdi();gdi();yAr();tyi();nyi();iyi();gAr();IAr();oyi();fyi();gyi();XMe();kAr();Iyi();wyi();kyi();Dyi();Oyi();Byi();Qya={_export:Lyi}});var Qyi=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.OpenTelemetrySpanWrapper=void 0;var Fyi=(co(),ba(V5)),Uyi=(Dht(),ba(Pht)),qya=pAr(),LAr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&jya(e.error)?e.error?(this._span.setStatus({code:Fyi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:Fyi.SpanStatusCode.ERROR}):e.status==="success"&&qya.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,Uyi.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,Uyi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Nht.OpenTelemetrySpanWrapper=LAr;function jya(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(jya,"isRecordableError")});var BAr=I(S4=>{"use strict";p();Object.defineProperty(S4,"__esModule",{value:!0});S4.environmentCache=S4.SDK_VERSION=void 0;S4.envVarToBoolean=Hya;S4.SDK_VERSION="1.0.0-beta.9";S4.environmentCache=new Map;function Hya(t){var e;S4.environmentCache.has(t)||Gya(t);let r=((e=S4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(Hya,"envVarToBoolean");function Gya(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];S4.environmentCache.set(t,r)}}a(Gya,"loadEnvironmentVariable")});var Gyi=I(Mht=>{"use strict";p();Object.defineProperty(Mht,"__esModule",{value:!0});Mht.toOpenTelemetrySpanKind=Hyi;Mht.toSpanOptions=Vya;var qyi=(co(),ba(V5)),jyi=(Dht(),ba(Pht));function Hyi(t){let e=(t||"internal").toUpperCase();return qyi.SpanKind[e]}a(Hyi,"toOpenTelemetrySpanKind");function $ya(t=[]){return t.reduce((e,r)=>{let n=qyi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,jyi.sanitizeAttributes)(r.attributes)}),e},[])}a($ya,"toOpenTelemetryLinks");function Vya(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,jyi.sanitizeAttributes)(e),s=Hyi(n),c=$ya(r);return{attributes:o,kind:s,links:c}}a(Vya,"toSpanOptions")});var Wyi=I(aG=>{"use strict";p();Object.defineProperty(aG,"__esModule",{value:!0});aG.OpenTelemetryInstrumenter=aG.propagator=void 0;var T4=(co(),ba(V5)),Vyi=(Dht(),ba(Pht)),Wya=Qyi(),$yi=BAr(),zya=Gyi();aG.propagator=new Vyi.W3CTraceContextPropagator;var FAr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||T4.context.active(),o;return(0,$yi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=T4.trace.wrapSpanContext(T4.INVALID_SPAN_CONTEXT):(o=T4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,zya.toSpanOptions)(r),n),(0,$yi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,Vyi.suppressTracing)(n))),{span:new Wya.OpenTelemetrySpanWrapper(o),tracingContext:T4.trace.setSpan(n,o)}}withContext(e,r,...n){return T4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return aG.propagator.extract(T4.context.active(),{traceparent:e},T4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return aG.propagator.inject(e||T4.context.active(),r,T4.defaultTextMapSetter),r}};aG.OpenTelemetryInstrumenter=FAr});var Yyi=I(oOe=>{"use strict";p();Object.defineProperty(oOe,"__esModule",{value:!0});oOe.AzureSdkInstrumentation=void 0;oOe.createAzureSdkInstrumentation=Jya;var zyi=(oAr(),ba(iAr)),Yya=Wyi(),Kya=BAr(),Oht=class extends zyi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",Kya.SDK_VERSION,Object.assign({},e))}init(){let e=new zyi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Yya.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};oOe.AzureSdkInstrumentation=Oht;function Jya(t={}){return new Oht(t)}a(Jya,"createAzureSdkInstrumentation")});var Jyi=I(Lht=>{"use strict";p();Object.defineProperty(Lht,"__esModule",{value:!0});var Kyi=(m3(),ba(iQ));Kyi.__exportStar(pAr(),Lht);Kyi.__exportStar(Yyi(),Lht)});var Xyi=I(hR=>{"use strict";p();Object.defineProperty(hR,"__esModule",{value:!0});hR.enable=hR.azureCoreTracing=hR.AzureMonitorSymbol=void 0;var UAr=Cp();hR.AzureMonitorSymbol="Azure_Monitor_Tracer";var QAr="azure-coretracing",Zyi=!1,Zya=a(function(t){if(Zyi)return t;try{var e=(Xci(),ba(Zci)),r=(co(),ba(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 UAr.channel.publish(QAr,A),E},A},d[hR.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[hR.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 UAr.channel.publish(QAr,v),T},v},g[hR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(oAr(),ba(iAr)),u=Jyi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}Zyi=!0}catch{}return t},"azureCoreTracingPatchFunction");hR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Zya,publisherName:QAr};function Xya(){UAr.channel.registerMonkeyPatch("@azure/core-tracing",hR.azureCoreTracing)}a(Xya,"enable");hR.enable=Xya});var tEi=I(Dee=>{"use strict";p();Object.defineProperty(Dee,"__esModule",{value:!0});Dee.enable=Dee.bunyan=void 0;var eEi=Cp(),eEa=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)),eEi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");Dee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:eEa};function tEa(){eEi.channel.registerMonkeyPatch("bunyan",Dee.bunyan)}a(tEa,"enable");Dee.enable=tEa});var nEi=I(Nee=>{"use strict";p();Object.defineProperty(Nee,"__esModule",{value:!0});Nee.enable=Nee.console=void 0;var qAr=Cp(),rEi=require("stream"),rEa=a(function(t){var e=new rEi.Writable,r=new rEi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return qAr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return qAr.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:rEa};function nEa(){qAr.channel.registerMonkeyPatch("console",Nee.console),require("console")}a(nEa,"enable");Nee.enable=nEa});var iEi=I(Mee=>{"use strict";p();Object.defineProperty(Mee,"__esModule",{value:!0});Mee.enable=Mee.mongoCore=void 0;var jAr=Cp(),iEa=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]=jAr.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]=jAr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Mee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:iEa};function oEa(){jAr.channel.registerMonkeyPatch("mongodb-core",Mee.mongoCore)}a(oEa,"enable");Mee.enable=oEa});var oEi=I(Cv=>{"use strict";p();var C0e=Cv&&Cv.__assign||function(){return C0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:sEa};Cv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:aEa};Cv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:lEa};function uEa(){NE.channel.registerMonkeyPatch("mongodb",Cv.mongo2),NE.channel.registerMonkeyPatch("mongodb",Cv.mongo3),NE.channel.registerMonkeyPatch("mongodb",Cv.mongo330)}a(uEa,"enable");Cv.enable=uEa});var aEi=I(Oee=>{"use strict";p();Object.defineProperty(Oee,"__esModule",{value:!0});Oee.enable=Oee.mysql=void 0;var Bht=Cp(),sEi=require("path"),dEa=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]=Bht.channel.bindToContext(h(_,E))):arguments[A]=Bht.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(sEi.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;Bht.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(sEi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Oee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:dEa};function fEa(){Bht.channel.registerMonkeyPatch("mysql",Oee.mysql)}a(fEa,"enable");Oee.enable=fEa});var lEi=I(Lee=>{"use strict";p();Object.defineProperty(Lee,"__esModule",{value:!0});Lee.enable=Lee.postgresPool1=void 0;var cEi=Cp();function pEa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=cEi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(pEa,"postgresPool1PatchFunction");Lee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:pEa};function hEa(){cEi.channel.registerMonkeyPatch("pg-pool",Lee.postgresPool1)}a(hEa,"enable");Lee.enable=hEa});var dEi=I(I4=>{"use strict";p();Object.defineProperty(I4,"__esModule",{value:!0});I4.enable=I4.postgres=I4.postgres6=void 0;var b0e=Cp(),uEi=require("events"),HAr="postgres";function mEa(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=b0e.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),b0e.channel.publish(HAr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof uEi.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(mEa,"postgres6PatchFunction");function gEa(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=b0e.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),b0e.channel.publish(HAr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof uEi.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(gEa,"postgresLatestPatchFunction");I4.postgres6={versionSpecifier:"6.*",patch:mEa};I4.postgres={versionSpecifier:">=7.* <=8.*",patch:gEa,publisherName:HAr};function AEa(){b0e.channel.registerMonkeyPatch("pg",I4.postgres6),b0e.channel.registerMonkeyPatch("pg",I4.postgres)}a(AEa,"enable");I4.enable=AEa});var fEi=I(Bee=>{"use strict";p();Object.defineProperty(Bee,"__esModule",{value:!0});Bee.enable=Bee.redis=void 0;var GAr=Cp(),yEa=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=GAr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;GAr.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");Bee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:yEa};function EEa(){GAr.channel.registerMonkeyPatch("redis",Bee.redis)}a(EEa,"enable");Bee.enable=EEa});var pEi=I(O8=>{"use strict";p();var Fht=O8&&O8.__assign||function(){return Fht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:_Ea};function vEa(){$Ar.channel.registerMonkeyPatch("tedious",O8.tedious)}a(vEa,"enable");O8.enable=vEa});var hEi=I(qb=>{"use strict";p();var CEa=qb&&qb.__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)}})(),bEa=qb&&qb.__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");qb.winston3={versionSpecifier:"3.x",patch:TEa};qb.winston2={versionSpecifier:"2.x",patch:SEa};function IEa(){Uht.channel.registerMonkeyPatch("winston",qb.winston2),Uht.channel.registerMonkeyPatch("winston",qb.winston3)}a(IEa,"enable");qb.enable=IEa});var IEi=I(ku=>{"use strict";p();Object.defineProperty(ku,"__esModule",{value:!0});ku.enable=ku.tedious=ku.pgPool=ku.pg=ku.winston=ku.redis=ku.mysql=ku.mongodb=ku.mongodbCore=ku.console=ku.bunyan=ku.azuresdk=void 0;var mEi=Xyi();ku.azuresdk=mEi;var gEi=tEi();ku.bunyan=gEi;var AEi=nEi();ku.console=AEi;var yEi=iEi();ku.mongodbCore=yEi;var EEi=oEi();ku.mongodb=EEi;var _Ei=aEi();ku.mysql=_Ei;var vEi=lEi();ku.pgPool=vEi;var CEi=dEi();ku.pg=CEi;var bEi=fEi();ku.redis=bEi;var SEi=pEi();ku.tedious=SEi;var TEi=hEi();ku.winston=TEi;function xEa(){gEi.enable(),AEi.enable(),yEi.enable(),EEi.enable(),_Ei.enable(),CEi.enable(),vEi.enable(),bEi.enable(),TEi.enable(),mEi.enable(),SEi.enable()}a(xEa,"enable");ku.enable=xEa});var jht=I(Fee=>{"use strict";p();Object.defineProperty(Fee,"__esModule",{value:!0});Fee.IsInitialized=void 0;Fee.registerContextPreservation=wEa;var VAr=Kl(),wEi=tpt();Fee.IsInitialized=!wEi.JsonConfig.getInstance().noDiagnosticChannel;var WAr="DiagnosticChannel";if(Fee.IsInitialized){nD=IEi(),xEi=wEi.JsonConfig.getInstance().noPatchModules,Qht=xEi.split(","),zAr={bunyan:nD.bunyan,console:nD.console,mongodb:nD.mongodb,mongodbCore:nD.mongodbCore,mysql:nD.mysql,redis:nD.redis,pg:nD.pg,pgPool:nD.pgPool,winston:nD.winston,azuresdk:nD.azuresdk};for(qht in zAr)Qht.indexOf(qht)===-1&&(zAr[qht].enable(),VAr.info(WAr,"Subscribed to ".concat(qht," events")));Qht.length>0&&VAr.info(WAr,"Some modules will not be patched",Qht)}else VAr.info(WAr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var nD,xEi,Qht,zAr,qht;function wEa(t){if(Fee.IsInitialized){var e=Cp();e.channel.addContextPreservation(t)}}a(wEa,"registerContextPreservation")});var S0e=I((Cpp,REi)=>{"use strict";p();REi.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 ay=I((JAr,kEi)=>{"use strict";p();var lG=JAr&&JAr.__assign||function(){return lG=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"){Uee.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"){Uee.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+")",Uee.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 ZAr=ay(),DEa=(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"|"+ZAr.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=ZAr.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=ZAr.randomu32(),t})();PEi.exports=DEa});var Hht=I((Rpp,DEi)=>{"use strict";p();var cy=ay(),NEa=Qee(),MEa=(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=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=cy.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=cy.w3cTraceId().substr(0,16),this.traceId=cy.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=NEa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=cy.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=cy.w3cTraceId(),this.spanId=cy.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=cy.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();DEi.exports=MEa});var XAr=I((Dpp,NEi)=>{"use strict";p();var OEa=(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 LEa=(function(){function t(){}return a(t,"Domain"),t})();MEi.exports=LEa});var LEi=I((eyr,OEi)=>{"use strict";p();var BEa=eyr&&eyr.__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)}})(),FEa=L8(),UEa=(function(t){BEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(FEa);OEi.exports=UEa});var tyr=I((Qpp,BEi)=>{"use strict";p();var QEa=(function(){function t(){}return a(t,"Base"),t})();BEi.exports=QEa});var UEi=I((Hpp,FEi)=>{"use strict";p();var qEa=(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})();FEi.exports=qEa});var qEi=I((ryr,QEi)=>{"use strict";p();var jEa=ryr&&ryr.__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)}})(),HEa=tyr(),GEa=(function(t){jEa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(HEa);QEi.exports=GEa});var iyr=I((zpp,jEi)=>{"use strict";p();var nyr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(nyr||(nyr={}));jEi.exports=nyr});var GEi=I((Kpp,HEi)=>{"use strict";p();var $Ea=iyr(),VEa=(function(){function t(){this.kind=$Ea.Measurement}return a(t,"DataPoint"),t})();HEi.exports=VEa});var VEi=I((Xpp,$Ei)=>{"use strict";p();var WEa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();$Ei.exports=WEa});var syr=I((oyr,WEi)=>{"use strict";p();var zEa=oyr&&oyr.__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)}})(),YEa=L8(),KEa=(function(t){zEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(YEa);WEi.exports=KEa});var YEi=I((ayr,zEi)=>{"use strict";p();var JEa=ayr&&ayr.__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)}})(),ZEa=L8(),XEa=(function(t){JEa(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})(ZEa);zEi.exports=XEa});var JEi=I((shp,KEi)=>{"use strict";p();var e_a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();KEi.exports=e_a});var XEi=I((cyr,ZEi)=>{"use strict";p();var t_a=cyr&&cyr.__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)}})(),r_a=L8(),n_a=(function(t){t_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(r_a);ZEi.exports=n_a});var t_i=I((lyr,e_i)=>{"use strict";p();var i_a=lyr&&lyr.__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)}})(),o_a=L8(),s_a=(function(t){i_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(o_a);e_i.exports=s_a});var n_i=I((uyr,r_i)=>{"use strict";p();var a_a=uyr&&uyr.__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)}})(),c_a=syr(),l_a=(function(t){a_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(c_a);r_i.exports=l_a});var o_i=I((dyr,i_i)=>{"use strict";p();var u_a=dyr&&dyr.__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)}})(),d_a=L8(),f_a=(function(t){u_a(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})(d_a);i_i.exports=f_a});var a_i=I((fyr,s_i)=>{"use strict";p();var p_a=fyr&&fyr.__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)}})(),h_a=L8(),m_a=(function(t){p_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(h_a);s_i.exports=m_a});var l_i=I((Ehp,c_i)=>{"use strict";p();var pyr;(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"})(pyr||(pyr={}));c_i.exports=pyr});var d_i=I((vhp,u_i)=>{"use strict";p();var g_a=(function(){function t(){}return a(t,"StackFrame"),t})();u_i.exports=g_a});var hyr=I(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.AvailabilityData=LEi();ym.Base=tyr();ym.ContextTagKeys=UEi();ym.Data=qEi();ym.DataPoint=GEi();ym.DataPointType=iyr();ym.Domain=L8();ym.Envelope=VEi();ym.EventData=syr();ym.ExceptionData=YEi();ym.ExceptionDetails=JEi();ym.MessageData=XEi();ym.MetricData=t_i();ym.PageViewData=n_i();ym.RemoteDependencyData=o_i();ym.RequestData=a_i();ym.SeverityLevel=l_i();ym.StackFrame=d_i()});var f_i=I(sOe=>{"use strict";p();Object.defineProperty(sOe,"__esModule",{value:!0});sOe.RemoteDependencyDataConstants=void 0;sOe.domainSupportsProperties=y_a;var qee=hyr(),A_a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();sOe.RemoteDependencyDataConstants=A_a;function y_a(t){return"properties"in t||t instanceof qee.EventData||t instanceof qee.ExceptionData||t instanceof qee.MessageData||t instanceof qee.MetricData||t instanceof qee.PageViewData||t instanceof qee.RemoteDependencyData||t instanceof qee.RequestData}a(y_a,"domainSupportsProperties")});var h_i=I(p_i=>{"use strict";p();Object.defineProperty(p_i,"__esModule",{value:!0})});var g_i=I(m_i=>{"use strict";p();Object.defineProperty(m_i,"__esModule",{value:!0})});var y_i=I(A_i=>{"use strict";p();Object.defineProperty(A_i,"__esModule",{value:!0})});var __i=I(E_i=>{"use strict";p();Object.defineProperty(E_i,"__esModule",{value:!0})});var C_i=I(v_i=>{"use strict";p();Object.defineProperty(v_i,"__esModule",{value:!0})});var S_i=I(b_i=>{"use strict";p();Object.defineProperty(b_i,"__esModule",{value:!0})});var I_i=I(T_i=>{"use strict";p();Object.defineProperty(T_i,"__esModule",{value:!0})});var w_i=I(x_i=>{"use strict";p();Object.defineProperty(x_i,"__esModule",{value:!0})});var k_i=I(R_i=>{"use strict";p();Object.defineProperty(R_i,"__esModule",{value:!0})});var D_i=I(P_i=>{"use strict";p();Object.defineProperty(P_i,"__esModule",{value:!0})});var M_i=I(N_i=>{"use strict";p();Object.defineProperty(N_i,"__esModule",{value:!0})});var L_i=I(O_i=>{"use strict";p();Object.defineProperty(O_i,"__esModule",{value:!0})});var B_i=I(uG=>{"use strict";p();Object.defineProperty(uG,"__esModule",{value:!0});uG.TelemetryType=uG.TelemetryTypeString=void 0;uG.telemetryTypeToBaseType=E_a;uG.baseTypeToTelemetryType=__a;function E_a(t){switch(t){case Hg.Event:return"EventData";case Hg.Exception:return"ExceptionData";case Hg.Trace:return"MessageData";case Hg.Metric:return"MetricData";case Hg.Request:return"RequestData";case Hg.Dependency:return"RemoteDependencyData";case Hg.Availability:return"AvailabilityData";case Hg.PageView:return"PageViewData"}}a(E_a,"telemetryTypeToBaseType");function __a(t){switch(t){case"EventData":return Hg.Event;case"ExceptionData":return Hg.Exception;case"MessageData":return Hg.Trace;case"MetricData":return Hg.Metric;case"RequestData":return Hg.Request;case"RemoteDependencyData":return Hg.Dependency;case"AvailabilityData":return Hg.Availability;case"PageViewData":return Hg.PageView}}a(__a,"baseTypeToTelemetryType");uG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Hg;(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"})(Hg||(uG.TelemetryType=Hg={}))});var F_i=I(b0=>{"use strict";p();var v_a=b0&&b0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$T=b0&&b0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v_a(e,t,r)};Object.defineProperty(b0,"__esModule",{value:!0});$T(h_i(),b0);$T(g_i(),b0);$T(y_i(),b0);$T(__i(),b0);$T(C_i(),b0);$T(S_i(),b0);$T(I_i(),b0);$T(w_i(),b0);$T(k_i(),b0);$T(D_i(),b0);$T(M_i(),b0);$T(L_i(),b0);$T(B_i(),b0)});var Q_i=I(U_i=>{"use strict";p();Object.defineProperty(U_i,"__esModule",{value:!0})});var j_i=I(q_i=>{"use strict";p();Object.defineProperty(q_i,"__esModule",{value:!0})});var G_i=I(H_i=>{"use strict";p();Object.defineProperty(H_i,"__esModule",{value:!0})});var V_i=I($_i=>{"use strict";p();Object.defineProperty($_i,"__esModule",{value:!0})});var z_i=I(W_i=>{"use strict";p();Object.defineProperty(W_i,"__esModule",{value:!0})});var K_i=I(Y_i=>{"use strict";p();Object.defineProperty(Y_i,"__esModule",{value:!0})});var Z_i=I(J_i=>{"use strict";p();Object.defineProperty(J_i,"__esModule",{value:!0})});var evi=I(X_i=>{"use strict";p();Object.defineProperty(X_i,"__esModule",{value:!0})});var tvi=I(jb=>{"use strict";p();var C_a=jb&&jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dG=jb&&jb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C_a(e,t,r)};Object.defineProperty(jb,"__esModule",{value:!0});dG(Q_i(),jb);dG(j_i(),jb);dG(G_i(),jb);dG(V_i(),jb);dG(z_i(),jb);dG(K_i(),jb);dG(Z_i(),jb);dG(evi(),jb)});var ME=I(x4=>{"use strict";p();var b_a=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]})),Ght=x4&&x4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b_a(e,t,r)};Object.defineProperty(x4,"__esModule",{value:!0});Ght(f_i(),x4);Ght(hyr(),x4);Ght(F_i(),x4);Ght(tvi(),x4)});var myr=I((xmp,rvi)=>{"use strict";p();var S_a=(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 iD;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 ly;(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"})(ly||(jr.QuickPulseCounter=ly={}));var aOe;(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"})(aOe||(jr.PerformanceCounter=aOe={}));var nvi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(nvi||(jr.MetricId=nvi={}));jr.PerformanceToQuickPulseCounter=(iD={},iD[aOe.PROCESSOR_TIME]=ly.PROCESSOR_TIME,iD[aOe.REQUEST_RATE]=ly.REQUEST_RATE,iD[aOe.REQUEST_DURATION]=ly.REQUEST_DURATION,iD[ly.COMMITTED_BYTES]=ly.COMMITTED_BYTES,iD[ly.REQUEST_FAILURE_RATE]=ly.REQUEST_FAILURE_RATE,iD[ly.DEPENDENCY_RATE]=ly.DEPENDENCY_RATE,iD[ly.DEPENDENCY_FAILURE_RATE]=ly.DEPENDENCY_FAILURE_RATE,iD[ly.DEPENDENCY_DURATION]=ly.DEPENDENCY_DURATION,iD[ly.EXCEPTION_RATE]=ly.EXCEPTION_RATE,iD);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 ivi;(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"})(ivi||(jr.StatsbeatFeature=ivi={}));var ovi;(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"})(ovi||(jr.StatsbeatInstrumentation=ovi={}));var svi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(svi||(jr.StatsbeatFeatureType=svi={}));var avi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(avi||(jr.StatsbeatNetworkCategory=avi={}));var cvi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(cvi||(jr.HttpRequestCookieNames=cvi={}));var lvi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(lvi||(jr.AttachTypePrefix=lvi={}));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 Eyr=I((yyr,uvi)=>{"use strict";p();var T_a=yyr&&yyr.__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)}})(),$ht=require("url"),I_a=ME(),gyr=ay(),VT=S0e(),x_a=myr(),fG=Qee(),w_a=XAr(),Ayr=Hht(),R_a=Kl(),Vht=md(),k_a=(function(t){T_a(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 $ht.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(Vht.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Vht.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Vht.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 $ht.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 $ht.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=$ht.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===Vht.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",R_a.warn("Could not decode the auth cookie with error: ",gyr.dumpObj(s))}var o=e.parseId(gyr.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=gyr.getCorrelationContextTarget(r,VT.requestContextSourceKey),r.headers){var o=r.headers[VT.traceStateHeader]?r.headers[VT.traceStateHeader].toString():null,s=r.headers[VT.traceparentHeader]?r.headers[VT.traceparentHeader].toString():null,c=r.headers[VT.requestIdHeader]?r.headers[VT.requestIdHeader].toString():null,l=r.headers[VT.parentIdHeader]?r.headers[VT.parentIdHeader].toString():null,u=r.headers[VT.rootIdHeader]?r.headers[VT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[VT.correlationContextHeader]?r.headers[VT.correlationContextHeader].toString():null,fG.w3cEnabled&&(s||o)?(this.traceparent=new Ayr(s?s.toString():null),this.tracestate=s&&o&&new w_a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?fG.w3cEnabled?(this.traceparent=new Ayr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=fG.generateRequestId(this.parentId),this.operationId=fG.getRootId(this.requestId)):fG.w3cEnabled?(this.traceparent=new Ayr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=fG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=fG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=fG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new I_a.ContextTagKeys,e})(x_a);uvi.exports=k_a});var xvi=I((yo,Ivi)=>{p();yo=Ivi.exports=Ma;var dl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?dl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):dl=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var cOe=256,Wht=Number.MAX_SAFE_INTEGER||9007199254740991,_yr=16,P_a=cOe-6,lOe=yo.re=[],Pu=yo.safeRe=[],rr=yo.src=[],ma=0,Tyr="[a-zA-Z0-9-]",vyr=[["\\s",1],["\\d",cOe],[Tyr,P_a]];function Xht(t){for(var e=0;e)?=?)";var zht=ma++;rr[zht]=rr[x0e]+"|x|X|\\*";var Yht=ma++;rr[Yht]=rr[I0e]+"|x|X|\\*";var jee=ma++;rr[jee]="[v=\\s]*("+rr[Yht]+")(?:\\.("+rr[Yht]+")(?:\\.("+rr[Yht]+")(?:"+rr[xyr]+")?"+rr[dOe]+"?)?)?";var R0e=ma++;rr[R0e]="[v=\\s]*("+rr[zht]+")(?:\\.("+rr[zht]+")(?:\\.("+rr[zht]+")(?:"+rr[wyr]+")?"+rr[dOe]+"?)?)?";var mvi=ma++;rr[mvi]="^"+rr[D0e]+"\\s*"+rr[jee]+"$";var gvi=ma++;rr[gvi]="^"+rr[D0e]+"\\s*"+rr[R0e]+"$";var Avi=ma++;rr[Avi]="(?:^|[^\\d])(\\d{1,"+_yr+"})(?:\\.(\\d{1,"+_yr+"}))?(?:\\.(\\d{1,"+_yr+"}))?(?:$|[^\\d])";var emt=ma++;rr[emt]="(?:~>?)";var k0e=ma++;rr[k0e]="(\\s*)"+rr[emt]+"\\s+";lOe[k0e]=new RegExp(rr[k0e],"g");Pu[k0e]=new RegExp(Xht(rr[k0e]),"g");var D_a="$1~",yvi=ma++;rr[yvi]="^"+rr[emt]+rr[jee]+"$";var Evi=ma++;rr[Evi]="^"+rr[emt]+rr[R0e]+"$";var tmt=ma++;rr[tmt]="(?:\\^)";var P0e=ma++;rr[P0e]="(\\s*)"+rr[tmt]+"\\s+";lOe[P0e]=new RegExp(rr[P0e],"g");Pu[P0e]=new RegExp(Xht(rr[P0e]),"g");var N_a="$1^",_vi=ma++;rr[_vi]="^"+rr[tmt]+rr[jee]+"$";var vvi=ma++;rr[vvi]="^"+rr[tmt]+rr[R0e]+"$";var Dyr=ma++;rr[Dyr]="^"+rr[D0e]+"\\s*("+kyr+")$|^$";var Nyr=ma++;rr[Nyr]="^"+rr[D0e]+"\\s*("+hvi+")$|^$";var Hee=ma++;rr[Hee]="(\\s*)"+rr[D0e]+"\\s*("+kyr+"|"+rr[jee]+")";lOe[Hee]=new RegExp(rr[Hee],"g");Pu[Hee]=new RegExp(Xht(rr[Hee]),"g");var M_a="$1$2$3",Cvi=ma++;rr[Cvi]="^\\s*("+rr[jee]+")\\s+-\\s+("+rr[jee]+")\\s*$";var bvi=ma++;rr[bvi]="^\\s*("+rr[R0e]+")\\s+-\\s+("+rr[R0e]+")\\s*$";var Svi=ma++;rr[Svi]="(<|>)?=?\\s*\\*";for(w4=0;w4cOe)return null;var r=e.loose?Pu[Pyr]:Pu[Ryr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(Gee,"parse");yo.valid=O_a;function O_a(t,e){var r=Gee(t,e);return r?r.version:null}a(O_a,"valid");yo.clean=L_a;function L_a(t,e){var r=Gee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(L_a,"clean");yo.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>cOe)throw new TypeError("version is longer than "+cOe+" characters");if(!(this instanceof Ma))return new Ma(t,e);dl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Pu[Pyr]:Pu[Ryr]);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>Wht||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Wht||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Wht||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=B_a;function B_a(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(B_a,"inc");yo.diff=F_a;function F_a(t,e){if(Myr(t,e))return null;var r=Gee(t),n=Gee(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(F_a,"diff");yo.compareIdentifiers=w0e;var dvi=/^[0-9]+$/;function w0e(t,e){var r=dvi.test(t),n=dvi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(uOe,"gt");yo.lt=Kht;function Kht(t,e,r){return B8(t,e,r)<0}a(Kht,"lt");yo.eq=Myr;function Myr(t,e,r){return B8(t,e,r)===0}a(Myr,"eq");yo.neq=Tvi;function Tvi(t,e,r){return B8(t,e,r)!==0}a(Tvi,"neq");yo.gte=Oyr;function Oyr(t,e,r){return B8(t,e,r)>=0}a(Oyr,"gte");yo.lte=Lyr;function Lyr(t,e,r){return B8(t,e,r)<=0}a(Lyr,"lte");yo.cmp=Jht;function Jht(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 Myr(t,r,n);case"!=":return Tvi(t,r,n);case">":return uOe(t,r,n);case">=":return Oyr(t,r,n);case"<":return Kht(t,r,n);case"<=":return Lyr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Jht,"cmp");yo.Comparator=mR;function mR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof mR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof mR))return new mR(t,e);t=t.trim().split(/\s+/).join(" "),dl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===fOe?this.value="":this.value=this.operator+this.semver.version,dl("comp",this)}a(mR,"Comparator");var fOe={};mR.prototype.parse=function(t){var e=this.options.loose?Pu[Dyr]:Pu[Nyr],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=fOe};mR.prototype.toString=function(){return this.value};mR.prototype.test=function(t){return dl("Comparator.test",t,this.options.loose),this.semver===fOe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),Jht(t,this.operator,this.semver,this.options))};mR.prototype.intersects=function(t,e){if(!(t instanceof mR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Rf(t.value,e),Zht(this.value,r,e);if(t.operator==="")return r=new Rf(this.value,e),Zht(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=Jht(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Jht(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=Rf;function Rf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Rf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Rf(t.raw,e);if(t instanceof mR)return new Rf(t.value,e);if(!(this instanceof Rf))return new Rf(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(Rf,"Range");Rf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Rf.prototype.toString=function(){return this.range};Rf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Pu[bvi]:Pu[Cvi];t=t.replace(r,rva),dl("hyphen replace",t),t=t.replace(Pu[Hee],M_a),dl("comparator trim",t,Pu[Hee]),t=t.replace(Pu[k0e],D_a),t=t.replace(Pu[P0e],N_a);var n=e?Pu[Dyr]:Pu[Nyr],o=t.split(" ").map(function(s){return z_a(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 mR(s,this.options)},this),o};Rf.prototype.intersects=function(t,e){if(!(t instanceof Rf))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=W_a;function W_a(t,e){return new Rf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(W_a,"toComparators");function z_a(t,e){return dl("comp",t,e),t=J_a(t,e),dl("caret",t),t=Y_a(t,e),dl("tildes",t),t=X_a(t,e),dl("xrange",t),t=tva(t,e),dl("stars",t),t}a(z_a,"parseComparator");function bv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(bv,"isX");function Y_a(t,e){return t.trim().split(/\s+/).map(function(r){return K_a(r,e)}).join(" ")}a(Y_a,"replaceTildes");function K_a(t,e){var r=e.loose?Pu[Evi]:Pu[yvi];return t.replace(r,function(n,o,s,c,l){dl("tilde",t,n,o,s,c,l);var u;return bv(o)?u="":bv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":bv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(dl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",dl("tilde return",u),u})}a(K_a,"replaceTilde");function J_a(t,e){return t.trim().split(/\s+/).map(function(r){return Z_a(r,e)}).join(" ")}a(J_a,"replaceCarets");function Z_a(t,e){dl("caret",t,e);var r=e.loose?Pu[vvi]:Pu[_vi];return t.replace(r,function(n,o,s,c,l){dl("caret",t,n,o,s,c,l);var u;return bv(o)?u="":bv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":bv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(dl("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"):(dl("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"),dl("caret return",u),u})}a(Z_a,"replaceCaret");function X_a(t,e){return dl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return eva(r,e)}).join(" ")}a(X_a,"replaceXRanges");function eva(t,e){t=t.trim();var r=e.loose?Pu[gvi]:Pu[mvi];return t.replace(r,function(n,o,s,c,l,u){dl("xRange",t,n,o,s,c,l,u);var d=bv(s),f=d||bv(c),h=f||bv(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"),dl("xRange return",n),n})}a(eva,"replaceXRange");function tva(t,e){return dl("replaceStars",t,e),t.trim().replace(Pu[Svi],"")}a(tva,"replaceStars");function rva(t,e,r,n,o,s,c,l,u,d,f,h,m){return bv(r)?e="":bv(n)?e=">="+r+".0.0":bv(o)?e=">="+r+"."+n+".0":e=">="+e,bv(u)?l="":bv(d)?l="<"+(+u+1)+".0.0":bv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(rva,"hyphenReplace");Rf.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(nva,"testSet");yo.satisfies=Zht;function Zht(t,e,r){try{e=new Rf(e,r)}catch{return!1}return e.test(t)}a(Zht,"satisfies");yo.maxSatisfying=iva;function iva(t,e,r){var n=null,o=null;try{var s=new Rf(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(iva,"maxSatisfying");yo.minSatisfying=ova;function ova(t,e,r){var n=null,o=null;try{var s=new Rf(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(ova,"minSatisfying");yo.minVersion=sva;function sva(t,e){t=new Rf(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||uOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(sva,"minVersion");yo.validRange=ava;function ava(t,e){try{return new Rf(t,e).range||"*"}catch{return null}}a(ava,"validRange");yo.ltr=cva;function cva(t,e,r){return Byr(t,e,"<",r)}a(cva,"ltr");yo.gtr=lva;function lva(t,e,r){return Byr(t,e,">",r)}a(lva,"gtr");yo.outside=Byr;function Byr(t,e,r,n){t=new Ma(t,n),e=new Rf(e,n);var o,s,c,l,u;switch(r){case">":o=uOe,s=Lyr,c=Kht,l=">",u=">=";break;case"<":o=Kht,s=Oyr,c=uOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Zht(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(Byr,"outside");yo.prerelease=uva;function uva(t,e){var r=Gee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(uva,"prerelease");yo.intersects=dva;function dva(t,e,r){return t=new Rf(t,r),e=new Rf(e,r),t.intersects(e)}a(dva,"intersects");yo.coerce=fva;function fva(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Pu[Avi]);return e==null?null:Gee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(fva,"coerce")});var imt=I((Lmp,Pvi)=>{"use strict";p();var Rvi=d0e(),N0e=Rvi.wrap,rmt=Rvi.unwrap,F8="wrap@before";function nmt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(nmt,"defineProperty");function pva(t,e){for(var r=e.length,n=0;n0&&pva(t,o)}a(hva,"_findAndProcess");function wvi(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 Pc=require("util"),U8=require("assert"),mva=imt(),gd=require("async_hooks"),pOe="cls@contexts",hOe="error@context",kf=process.env.DEBUG_CLS_HOOKED,kc=-1;Mvi.exports={getNamespace:Dvi,createNamespace:gva,destroyNamespace:Nvi,reset:Ava,ERROR_SYMBOL:hOe};function gR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(gR,"Namespace");gR.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,kf){let n=" ".repeat(this._indent<0?0:this._indent);zd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");gR.prototype.get=a(function(e){if(!this.active){if(kf){let r=gd.currentId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),zd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Pc.inspect(this.active)}`)}return this.active[e]},"get");gR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=kc,kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Pc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");gR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Pc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[hOe]=r),n}finally{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Pc.inspect(r)}`)}this.exit(r)}},"run");gR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");gR.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 kf&&zd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),n.then(o=>(kf&&zd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[hOe]=r,kf&&zd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o})},"runPromise");gR.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[hOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");gR.prototype.enter=a(function(e){if(U8.ok(e,"context must be provided for entering"),kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Pc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");gR.prototype.exit=a(function(e){if(U8.ok(e,"context must be provided for exiting"),kf){let n=gd.executionAsyncId(),o=gd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${kc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Pc.inspect(e)}`)}if(this.active===e){U8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(kf&&zd("??ERROR?? context exiting but not entered - ignoring: "+Pc.inspect(e)),U8.ok(r>=0,`context not currently entered; can't exit. +`+s),t.push(o+"m+"+Kpt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Zsa()+e+" "+t[0]}a(Jsa,"formatArgs");function Zsa(){return Hg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Zsa,"getDate");function Xsa(...t){return process.stderr.write(Ypt.formatWithOptions(Hg.inspectOpts,...t)+` +`)}a(Xsa,"log");function eaa(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(eaa,"save");function taa(){return process.env.DEBUG}a(taa,"load");function raa(t){t.inspectOpts={};let e=Object.keys(Hg.inspectOpts);for(let r=0;re.trim()).join(" ")};Qli.O=function(t){return this.inspectOpts.colors=this.useColors,Ypt.inspect(t,this.inspectOpts)}});var jli=I((Fap,qgr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qgr.exports=Uli():qgr.exports=qli()});var Hgr=I((Qap,Hli)=>{"use strict";p();var jgr=require("path").sep;Hli.exports=function(t){var e=t.split(jgr),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]+jgr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+jgr;return{name:o,basedir:c,path:d}}}});var Ggr=I((jap,Gli)=>{"use strict";p();var naa=require("os");Gli.exports=naa.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 $gr=I(($ap,$li)=>{p();$li.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 Vli=I((Wap,YMe)=>{"use strict";p();var iaa=process.platform==="win32",oaa=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Vgr={};function saa(t){return oaa.exec(t).slice(1)}a(saa,"win32SplitPath");Vgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=saa(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 aaa=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Wgr={};function caa(t){return aaa.exec(t).slice(1)}a(caa,"posixSplitPath");Wgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=caa(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]}};iaa?YMe.exports=Vgr.parse:YMe.exports=Wgr.parse;YMe.exports.posix=Wgr.parse;YMe.exports.win32=Vgr.parse});var zgr=I((Kap,Kli)=>{p();var Yli=require("path"),Wli=Yli.parse||Vli(),zli=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Wli(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Wli(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return Yli.resolve(n,l,u)}))},[])},"getNodeModulesDirs");Kli.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 zli(e,o)},r);var s=zli(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Ygr=I((Xap,Jli)=>{p();Jli.exports=function(t,e){return e||{}}});var eui=I((tcp,Xli)=>{"use strict";p();var laa="Function.prototype.bind called on incompatible ",uaa=Object.prototype.toString,daa=Math.max,faa="[object Function]",Zli=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var maa=eui();tui.exports=Function.prototype.bind||maa});var iui=I((scp,nui)=>{"use strict";p();var gaa=Function.prototype.call,Aaa=Object.prototype.hasOwnProperty,yaa=rui();nui.exports=yaa.call(gaa,Aaa)});var oui=I((ccp,Eaa)=>{Eaa.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 KMe=I((lcp,cui)=>{"use strict";p();var _aa=iui();function vaa(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(vaa,"specifierIncluded");function sui(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 Ree=require("fs"),baa=Ggr(),Em=require("path"),Saa=$gr(),Taa=zgr(),Iaa=Ygr(),xaa=KMe(),waa=process.platform!=="win32"&&Ree.realpath&&typeof Ree.realpath.native=="function"?Ree.realpath.native:Ree.realpath,lui=baa(),Raa=a(function(){return[Em.join(lui,".node_modules"),Em.join(lui,".node_libraries")]},"defaultPaths"),kaa=a(function(e,r){Ree.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"),Paa=a(function(e,r){Ree.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),Daa=a(function(e,r){waa(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),JMe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Naa=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"),Maa=a(function(e,r,n){for(var o=Taa(r,n,e),s=0;s{Oaa.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 gui=I((gcp,mui)=>{"use strict";p();var Laa=KMe(),pui=fui(),hui={};for(Jpt in pui)Object.prototype.hasOwnProperty.call(pui,Jpt)&&(hui[Jpt]=Laa(Jpt));var Jpt;mui.exports=hui});var yui=I((ycp,Aui)=>{p();var Baa=KMe();Aui.exports=a(function(e){return Baa(e)},"isCore")});var vui=I((vcp,_ui)=>{p();var Faa=KMe(),kee=require("fs"),NE=require("path"),Uaa=Ggr(),Qaa=$gr(),qaa=zgr(),jaa=Ygr(),Haa=process.platform!=="win32"&&kee.realpathSync&&typeof kee.realpathSync.native=="function"?kee.realpathSync.native:kee.realpathSync,Eui=Uaa(),Gaa=a(function(){return[NE.join(Eui,".node_modules"),NE.join(Eui,".node_libraries")]},"defaultPaths"),$aa=a(function(e){try{var r=kee.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"),Vaa=a(function(e){try{var r=kee.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Waa=a(function(e){try{return Haa(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),ZMe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),zaa=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Yaa=a(function(e,r,n){for(var o=qaa(r,n,e),s=0;s{p();var Zpt=dui();Zpt.core=gui();Zpt.isCore=yui();Zpt.sync=vui();Cui.exports=Zpt});var bui=I((Icp,Kaa)=>{Kaa.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 eAr=I((xcp,Xgr)=>{"use strict";p();var y0e=require("path"),oD=require("module"),ph=jli()("require-in-the-middle"),Jaa=Hgr();Xgr.exports=XMe;Xgr.exports.Hook=XMe;var Jgr,A0e;if(oD.isBuiltin)A0e=oD.isBuiltin;else if(oD.builtinModules)A0e=a(t=>t.startsWith("node:")?!0:(Jgr===void 0&&(Jgr=new Set(oD.builtinModules)),Jgr.has(t)),"isCore");else{let t=Kgr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?A0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):A0e=a(n=>!!t.core[n],"isCore")}var Xpt;function Zaa(t,e){if(!Xpt)if(require.resolve&&require.resolve.paths)Xpt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Kgr();Xpt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Xpt(t,e)}a(Zaa,"resolve");var Xaa=/([/\\]index)?(\.js)?$/,Zgr=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:(ph('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function XMe(t,e,r){if(!(this instanceof XMe))return new XMe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof oD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof oD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,bui().bugs.url);return}this._cache=new Zgr,this._unhooked=!1,this._origRequire=oD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);ph("registering require hook"),this._require=oD.prototype.require=function(u){return n._unhooked===!0?(ph("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?(ph("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=A0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);A0e(v)&&(m=v)}}else{if(d)return ph("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=oD._resolveFilename(f,this)}catch(v){return ph('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(ph("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return ph("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 ph("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 ph("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=y0e.parse(m);g=v.name,A=v.dir}else{let v=Jaa(m);if(v===void 0)return ph("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=eca(v);ph("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=Zaa(g,A)}catch{return ph("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+y0e.sep+y0e.relative(A,m),ph("preparing to process require of internal file: %s",g);else return ph("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),ph("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),ph("returning module: %s",g),_}a(l,"patchedRequire")}a(XMe,"Hook");XMe.prototype.unhook=function(){this._unhooked=!0,this._require===oD.prototype.require?(oD.prototype.require=this._origRequire,ph("require unhook successful")):ph("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ph("process.getBuiltinModule unhook successful")):ph("process.getBuiltinModule unhook unsuccessful"))};function eca(t){let e=y0e.sep!=="/"?t.path.split(y0e.sep).join("/"):t.path;return y0e.posix.join(t.name,e).replace(Xaa,"")}a(eca,"resolveModuleName")});var eht,tht,Sui=ve(()=>{p();eht=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},tht=class{static{a(this,"ModuleNameTrie")}_trie=new eht;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new eht,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 rca(t){return tAr.sep!=="/"?t.split(tAr.sep).join("/"):t}var Iui,tAr,tca,rht,xui=ve(()=>{p();Iui=de(eAr()),tAr=de(require("path"));Sui();tca=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),rht=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new tht;static _instance;constructor(){this._initialize()}_initialize(){new Iui.Hook(null,{internals:!0},(e,r,n)=>{let o=rca(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 tca?new t:this._instance=this._instance??new t}};a(rca,"normalizePathSeparators")});var Nui=I(Pee=>{p();var wui=[],rAr=new WeakMap,Rui=new WeakMap,kui=new Map,Pui=[],nca={set(t,e,r){return rAr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=Rui.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 rAr.get(t)[e](r.value)}};function ica(t,e,r,n,o){kui.set(t,o),rAr.set(e,r),Rui.set(e,n);let s=new Proxy(e,nca);wui.forEach(c=>c(t,s)),Pui.push([t,s])}a(ica,"register");var Dui=!1;function oca(){return Dui}a(oca,"getExperimentalPatchInternals");function sca(t){Dui=t}a(sca,"setExperimentalPatchInternals");Pee.register=ica;Pee.importHooks=wui;Pee.specifiers=kui;Pee.toHook=Pui;Pee.getExperimentalPatchInternals=oca;Pee.setExperimentalPatchInternals=sca});var Uui=I((Qcp,E0e)=>{p();var Mui=require("path"),aca=Hgr(),{fileURLToPath:Oui}=require("url"),{MessageChannel:cca}=require("worker_threads"),{importHooks:nAr,specifiers:lca,toHook:uca,getExperimentalPatchInternals:dca}=Nui();function Bui(t){nAr.push(t),uca.forEach(([e,r])=>t(e,r))}a(Bui,"addHook");function Fui(t){let e=nAr.indexOf(t);e>-1&&nAr.splice(e,1)}a(Fui,"removeHook");function Lui(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(Lui,"callHookFn");var iAr;function fca(){let{port1:t,port2:e}=new cca,r=0,n;iAr=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(fca,"createAddHookMessageChannel");function eOe(t,e,r){if(!(this instanceof eOe))return new eOe(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;iAr&&Array.isArray(t)&&iAr(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=Oui(o)}catch{}let d=aca(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+Mui.sep+Mui.relative(u,Oui(c));else if(!dca()&&!u.endsWith(lca.get(c)))continue}Lui(r,s,o,u)}}else Lui(r,s,o,u)},Bui(this._iitmHook)}a(eOe,"Hook");eOe.prototype.unhook=function(){Fui(this._iitmHook)};E0e.exports=eOe;E0e.exports.Hook=eOe;E0e.exports.addHook=Bui;E0e.exports.removeHook=Fui;E0e.exports.createAddHookMessageChannel=fca});function Qui(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 qui(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 nht(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var oAr=ve(()=>{p();a(Qui,"safeExecuteInTheMiddle");a(qui,"safeExecuteInTheMiddleAsync");a(nht,"isWrapped")});function jui(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>xli(e,n,{includePrerelease:r}))}var L8,sAr,tOe,Hui,Gui,$ui,_0e,Vui=ve(()=>{p();L8=de(require("path")),sAr=require("util");Pli();tOe=de(p0e());Oli();xui();Hui=de(Uui());co();Gui=de(eAr()),$ui=require("fs");oAr();_0e=class extends Vpt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=rht.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(nht(e[r])&&this._unwrap(e,r),sAr.types.isProxy(e)){let o=(0,tOe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,tOe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>sAr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,tOe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.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,$ui.readFileSync)(L8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Dn.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 jui(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=L8.normalize(n);return c.filter(d=>d.name===l).filter(d=>jui(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&&L8.isAbsolute(l)){let d=L8.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=L8.isAbsolute(e.name)?new Gui.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Hui.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(jui,"isSupported")});var rOe,Wui=ve(()=>{p();rOe=require("path")});var zui=ve(()=>{p();Vui();Wui()});var aAr=ve(()=>{p();zui()});var iht,Yui=ve(()=>{p();iht=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 oht,Kui=ve(()=>{p();aAr();oht=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,rOe.normalize)(e)}}});var cAr={};ki(cAr,{InstrumentationBase:()=>_0e,InstrumentationNodeModuleDefinition:()=>iht,InstrumentationNodeModuleFile:()=>oht,isWrapped:()=>nht,registerInstrumentations:()=>_li,safeExecuteInTheMiddle:()=>Qui,safeExecuteInTheMiddleAsync:()=>qui});var lAr=ve(()=>{p();vli();aAr();Yui();Kui();oAr()});var Zui=I(uAr=>{"use strict";p();Object.defineProperty(uAr,"__esModule",{value:!0});uAr.log=gca;var Jui=(g3(),Sa(sQ)),pca=require("node:os"),hca=Jui.__importDefault(require("node:util")),mca=Jui.__importStar(require("node:process"));function gca(t,...e){mca.stderr.write(`${hca.default.format(t,...e)}${pca.EOL}`)}a(gca,"log")});var ndi=I(mAr=>{"use strict";p();Object.defineProperty(mAr,"__esModule",{value:!0});var Aca=Zui(),Xui=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,edi,dAr=[],fAr=[],sht=[];Xui&&pAr(Xui);var tdi=Object.assign(t=>rdi(t),{enable:pAr,enabled:hAr,disable:yca,log:Aca.log});function pAr(t){edi=t,dAr=[],fAr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?fAr.push(new RegExp(`^${n.substr(1)}$`)):dAr.push(new RegExp(`^${n}$`));for(let n of sht)n.enabled=hAr(n.namespace)}a(pAr,"enable");function hAr(t){if(t.endsWith("*"))return!0;for(let e of fAr)if(e.test(t))return!1;for(let e of dAr)if(e.test(t))return!0;return!1}a(hAr,"enabled");function yca(){let t=edi||"";return pAr(""),t}a(yca,"disable");function rdi(t){let e=Object.assign(r,{enabled:hAr(t),destroy:Eca,log:tdi.log,namespace:t,extend:_ca});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),sht.push(e),e}a(rdi,"createDebugger");function Eca(){let t=sht.indexOf(this);return t>=0?(sht.splice(t,1),!0):!1}a(Eca,"destroy");function _ca(t){let e=rdi(`${this.namespace}:${t}`);return e.log=this.log,e}a(_ca,"extend");mAr.default=tdi});var uht=I(S4=>{"use strict";p();Object.defineProperty(S4,"__esModule",{value:!0});S4.AzureLogger=void 0;S4.setLogLevel=sdi;S4.getLogLevel=Cca;S4.createClientLogger=bca;var vca=(g3(),Sa(sQ)),nOe=vca.__importDefault(ndi()),odi=new Set,aht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,lht;S4.AzureLogger=(0,nOe.default)("azure");S4.AzureLogger.log=(...t)=>{nOe.default.log(...t)};var gAr=["verbose","info","warning","error"];aht&&(ldi(aht)?sdi(aht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${aht}'; logging is not enabled. Acceptable values: ${gAr.join(", ")}.`));function sdi(t){if(t&&!ldi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${gAr.join(",")}`);lht=t;let e=[];for(let r of odi)cdi(r)&&e.push(r.namespace);nOe.default.enable(e.join(","))}a(sdi,"setLogLevel");function Cca(){return lht}a(Cca,"getLogLevel");var idi={verbose:400,info:300,warning:200,error:100};function bca(t){let e=S4.AzureLogger.extend(t);return adi(S4.AzureLogger,e),{error:cht(e,"error"),warning:cht(e,"warning"),info:cht(e,"info"),verbose:cht(e,"verbose")}}a(bca,"createClientLogger");function adi(t,e){e.log=(...r)=>{t.log(...r)}}a(adi,"patchLogMethod");function cht(t,e){let r=Object.assign(t.extend(e),{level:e});if(adi(t,r),cdi(r)){let n=nOe.default.disable();nOe.default.enable(n+","+r.namespace)}return odi.add(r),r}a(cht,"createLogger");function cdi(t){return!!(lht&&idi[t.level]<=idi[lht])}a(cdi,"shouldEnable");function ldi(t){return gAr.includes(t)}a(ldi,"isAzureLogLevel")});var AAr=I(dht=>{"use strict";p();Object.defineProperty(dht,"__esModule",{value:!0});dht.logger=void 0;var Sca=uht();dht.logger=(0,Sca.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function fht(t){return t.setValue(yAr,!0)}function udi(t){return t.deleteValue(yAr)}function v0e(t){return t.getValue(yAr)===!0}var yAr,iOe=ve(()=>{p();co();yAr=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(fht,"suppressTracing");a(udi,"unsuppressTracing");a(v0e,"isTracingSuppressed")});var pht,ddi=ve(()=>{p();pht="baggage"});function pdi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function hdi(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 EAr(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=Gpe(e.join(";"))),{key:o,value:s,metadata:c}}function mdi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=EAr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var _Ar=ve(()=>{p();co();a(pdi,"serializeKeyPairs");a(hdi,"getKeyPairs");a(EAr,"parsePairKeyValue");a(mdi,"parseKeyPairsIntoRecord")});var mht,gdi=ve(()=>{p();co();iOe();ddi();_Ar();mht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=DT.getBaggage(e);if(!o||v0e(e))return;let s=hdi(o).filter(l=>l.length<=4096).slice(0,180),c=pdi(s);c.length>0&&n.set(r,pht,c)}extract(e,r,n){let o=n.get(r,pht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=EAr(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[pht]}}});var ght,Adi=ve(()=>{p();ght=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 ydi(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(!xca(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!vAr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function xca(t){return typeof t=="string"&&t!==""}function vAr(t){return t==null?!0:Array.isArray(t)?wca(t):Edi(typeof t)}function wca(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(Edi(n)){e=n;continue}return!1}return!1}}return!0}function Edi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var _di=ve(()=>{p();co();a(ydi,"sanitizeAttributes");a(xca,"isAttributeKey");a(vAr,"isAttributeValue");a(wca,"isHomogeneousAttributeValueArray");a(Edi,"isValidPrimitiveAttributeValueType")});function Aht(){return t=>{Dn.error(Rca(t))}}function Rca(t){return typeof t=="string"?t:JSON.stringify(kca(t))}function kca(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 CAr=ve(()=>{p();co();a(Aht,"loggingErrorHandler");a(Rca,"stringifyException");a(kca,"flattenException")});function Cdi(t){vdi=t}function bdi(t){try{vdi(t)}catch{}}var vdi,Sdi=ve(()=>{p();CAr();vdi=Aht();a(Cdi,"setGlobalErrorHandler");a(bdi,"globalErrorHandler")});function yht(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,bAr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function oOe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function Eht(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,bAr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function _ht(t){return oOe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var bAr,Tdi=ve(()=>{p();co();bAr=require("util");a(yht,"getNumberFromEnv");a(oOe,"getStringFromEnv");a(Eht,"getBooleanFromEnv");a(_ht,"getStringListFromEnv")});var vht,Idi=ve(()=>{p();vht=typeof globalThis=="object"?globalThis:global});var xdi,uG,wdi=ve(()=>{p();xdi=require("perf_hooks"),uG=xdi.performance});var Rdi,kdi=ve(()=>{p();Rdi="2.2.0"});function hh(t){let e={},r=t.length;for(let n=0;n{p();a(hh,"createConstMap")});var Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,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,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,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,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Pca,Dca,Nca,Mca,Oca,Lca,Bca,Fca,Uca,Qca,qca,jca,Hca,Gca,$ca,Vca,Wca,zca,Yca,Kca,Jca,Zca,Xca,ela,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Ela,_la,vla,Cla,bla,Sla,Tla,Ila,xla,wla,Rla,kla,Pla,Dla,Nla,Mla,Ola,Lla,Bla,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,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Lua,Bua,Fua,Uua,Qua,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,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,Ida,xda,wda,Rda,kda,Pda,Dda,Nda,Mda,Oda,Lda,Bda,Fda,Uda,Qda,qda,jda,Hda,Gda,$da,Ghi,$hi,Vhi,Whi,zhi,Yhi,Khi,Jhi,Zhi,Xhi,emi,Vda,Wda,zda,Yda,Kda,Jda,Zda,Xda,efa,tfa,rfa,nfa,tmi,rmi,nmi,imi,omi,ifa,ofa,sfa,afa,cfa,lfa,smi,ami,cmi,ufa,dfa,ffa,pfa,lmi,umi,dmi,fmi,hfa,mfa,gfa,Afa,yfa,pmi,hmi,mmi,gmi,Ami,ymi,Emi,Efa,_fa,vfa,Cfa,bfa,Sfa,Tfa,Ifa,_mi,vmi,Cmi,bmi,Smi,xfa,wfa,Rfa,kfa,Pfa,Dfa,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Fmi,Umi,Qmi,qmi,jmi,Hmi,Gmi,$mi,Nfa,Mfa,Ofa,Lfa,Bfa,Ffa,Ufa,Qfa,qfa,jfa,Hfa,Gfa,$fa,Vfa,Wfa,zfa,Yfa,Kfa,Jfa,Zfa,Xfa,epa,Vmi,Wmi,zmi,Ymi,Kmi,tpa,rpa,npa,ipa,opa,spa,Jmi,Zmi,apa,cpa,lpa,Xmi,e0i,upa,dpa,fpa,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,u0i,d0i,f0i,p0i,h0i,m0i,g0i,A0i,ppa,hpa,mpa,gpa,Apa,ypa,Epa,_pa,vpa,Cpa,bpa,Spa,Tpa,Ipa,xpa,wpa,Rpa,kpa,y0i,E0i,Ppa,Dpa,Npa,_0i=ve(()=>{p();SAr();Pdi="aws.lambda.invoked_arn",Ddi="db.system",Ndi="db.connection_string",Mdi="db.user",Odi="db.jdbc.driver_classname",Ldi="db.name",Bdi="db.statement",Fdi="db.operation",Udi="db.mssql.instance_name",Qdi="db.cassandra.keyspace",qdi="db.cassandra.page_size",jdi="db.cassandra.consistency_level",Hdi="db.cassandra.table",Gdi="db.cassandra.idempotence",$di="db.cassandra.speculative_execution_count",Vdi="db.cassandra.coordinator.id",Wdi="db.cassandra.coordinator.dc",zdi="db.hbase.namespace",Ydi="db.redis.database_index",Kdi="db.mongodb.collection",Jdi="db.sql.table",Zdi="exception.type",Xdi="exception.message",efi="exception.stacktrace",tfi="exception.escaped",rfi="faas.trigger",nfi="faas.execution",ifi="faas.document.collection",ofi="faas.document.operation",sfi="faas.document.time",afi="faas.document.name",cfi="faas.time",lfi="faas.cron",ufi="faas.coldstart",dfi="faas.invoked_name",ffi="faas.invoked_provider",pfi="faas.invoked_region",hfi="net.transport",mfi="net.peer.ip",gfi="net.peer.port",Afi="net.peer.name",yfi="net.host.ip",Efi="net.host.port",_fi="net.host.name",vfi="net.host.connection.type",Cfi="net.host.connection.subtype",bfi="net.host.carrier.name",Sfi="net.host.carrier.mcc",Tfi="net.host.carrier.mnc",Ifi="net.host.carrier.icc",xfi="peer.service",wfi="enduser.id",Rfi="enduser.role",kfi="enduser.scope",Pfi="thread.id",Dfi="thread.name",Nfi="code.function",Mfi="code.namespace",Ofi="code.filepath",Lfi="code.lineno",Bfi="http.method",Ffi="http.url",Ufi="http.target",Qfi="http.host",qfi="http.scheme",jfi="http.status_code",Hfi="http.flavor",Gfi="http.user_agent",$fi="http.request_content_length",Vfi="http.request_content_length_uncompressed",Wfi="http.response_content_length",zfi="http.response_content_length_uncompressed",Yfi="http.server_name",Kfi="http.route",Jfi="http.client_ip",Zfi="aws.dynamodb.table_names",Xfi="aws.dynamodb.consumed_capacity",epi="aws.dynamodb.item_collection_metrics",tpi="aws.dynamodb.provisioned_read_capacity",rpi="aws.dynamodb.provisioned_write_capacity",npi="aws.dynamodb.consistent_read",ipi="aws.dynamodb.projection",opi="aws.dynamodb.limit",spi="aws.dynamodb.attributes_to_get",api="aws.dynamodb.index_name",cpi="aws.dynamodb.select",lpi="aws.dynamodb.global_secondary_indexes",upi="aws.dynamodb.local_secondary_indexes",dpi="aws.dynamodb.exclusive_start_table",fpi="aws.dynamodb.table_count",ppi="aws.dynamodb.scan_forward",hpi="aws.dynamodb.segment",mpi="aws.dynamodb.total_segments",gpi="aws.dynamodb.count",Api="aws.dynamodb.scanned_count",ypi="aws.dynamodb.attribute_definitions",Epi="aws.dynamodb.global_secondary_index_updates",_pi="messaging.system",vpi="messaging.destination",Cpi="messaging.destination_kind",bpi="messaging.temp_destination",Spi="messaging.protocol",Tpi="messaging.protocol_version",Ipi="messaging.url",xpi="messaging.message_id",wpi="messaging.conversation_id",Rpi="messaging.message_payload_size_bytes",kpi="messaging.message_payload_compressed_size_bytes",Ppi="messaging.operation",Dpi="messaging.consumer_id",Npi="messaging.rabbitmq.routing_key",Mpi="messaging.kafka.message_key",Opi="messaging.kafka.consumer_group",Lpi="messaging.kafka.client_id",Bpi="messaging.kafka.partition",Fpi="messaging.kafka.tombstone",Upi="rpc.system",Qpi="rpc.service",qpi="rpc.method",jpi="rpc.grpc.status_code",Hpi="rpc.jsonrpc.version",Gpi="rpc.jsonrpc.request_id",$pi="rpc.jsonrpc.error_code",Vpi="rpc.jsonrpc.error_message",Wpi="message.type",zpi="message.id",Ypi="message.compressed_size",Kpi="message.uncompressed_size",Pca=Pdi,Dca=Ddi,Nca=Ndi,Mca=Mdi,Oca=Odi,Lca=Ldi,Bca=Bdi,Fca=Fdi,Uca=Udi,Qca=Qdi,qca=qdi,jca=jdi,Hca=Hdi,Gca=Gdi,$ca=$di,Vca=Vdi,Wca=Wdi,zca=zdi,Yca=Ydi,Kca=Kdi,Jca=Jdi,Zca=Zdi,Xca=Xdi,ela=efi,tla=tfi,rla=rfi,nla=nfi,ila=ifi,ola=ofi,sla=sfi,ala=afi,cla=cfi,lla=lfi,ula=ufi,dla=dfi,fla=ffi,pla=pfi,hla=hfi,mla=mfi,gla=gfi,Ala=Afi,yla=yfi,Ela=Efi,_la=_fi,vla=vfi,Cla=Cfi,bla=bfi,Sla=Sfi,Tla=Tfi,Ila=Ifi,xla=xfi,wla=wfi,Rla=Rfi,kla=kfi,Pla=Pfi,Dla=Dfi,Nla=Nfi,Mla=Mfi,Ola=Ofi,Lla=Lfi,Bla=Bfi,Fla=Ffi,Ula=Ufi,Qla=Qfi,qla=qfi,jla=jfi,Hla=Hfi,Gla=Gfi,$la=$fi,Vla=Vfi,Wla=Wfi,zla=zfi,Yla=Yfi,Kla=Kfi,Jla=Jfi,Zla=Zfi,Xla=Xfi,eua=epi,tua=tpi,rua=rpi,nua=npi,iua=ipi,oua=opi,sua=spi,aua=api,cua=cpi,lua=lpi,uua=upi,dua=dpi,fua=fpi,pua=ppi,hua=hpi,mua=mpi,gua=gpi,Aua=Api,yua=ypi,Eua=Epi,_ua=_pi,vua=vpi,Cua=Cpi,bua=bpi,Sua=Spi,Tua=Tpi,Iua=Ipi,xua=xpi,wua=wpi,Rua=Rpi,kua=kpi,Pua=Ppi,Dua=Dpi,Nua=Npi,Mua=Mpi,Oua=Opi,Lua=Lpi,Bua=Bpi,Fua=Fpi,Uua=Upi,Qua=Qpi,qua=qpi,jua=jpi,Hua=Hpi,Gua=Gpi,$ua=$pi,Vua=Vpi,Wua=Wpi,zua=zpi,Yua=Ypi,Kua=Kpi,Jua=hh([Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,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,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,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,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi]),Jpi="other_sql",Zpi="mssql",Xpi="mysql",ehi="oracle",thi="db2",rhi="postgresql",nhi="redshift",ihi="hive",ohi="cloudscape",shi="hsqldb",ahi="progress",chi="maxdb",lhi="hanadb",uhi="ingres",dhi="firstsql",fhi="edb",phi="cache",hhi="adabas",mhi="firebird",ghi="derby",Ahi="filemaker",yhi="informix",Ehi="instantdb",_hi="interbase",vhi="mariadb",Chi="netezza",bhi="pervasive",Shi="pointbase",Thi="sqlite",Ihi="sybase",xhi="teradata",whi="vertica",Rhi="h2",khi="coldfusion",Phi="cassandra",Dhi="hbase",Nhi="mongodb",Mhi="redis",Ohi="couchbase",Lhi="couchdb",Bhi="cosmosdb",Fhi="dynamodb",Uhi="neo4j",Qhi="geode",qhi="elasticsearch",jhi="memcached",Hhi="cockroachdb",Zua=Jpi,Xua=Zpi,eda=Xpi,tda=ehi,rda=thi,nda=rhi,ida=nhi,oda=ihi,sda=ohi,ada=shi,cda=ahi,lda=chi,uda=lhi,dda=uhi,fda=dhi,pda=fhi,hda=phi,mda=hhi,gda=mhi,Ada=ghi,yda=Ahi,Eda=yhi,_da=Ehi,vda=_hi,Cda=vhi,bda=Chi,Sda=bhi,Tda=Shi,Ida=Thi,xda=Ihi,wda=xhi,Rda=whi,kda=Rhi,Pda=khi,Dda=Phi,Nda=Dhi,Mda=Nhi,Oda=Mhi,Lda=Ohi,Bda=Lhi,Fda=Bhi,Uda=Fhi,Qda=Uhi,qda=Qhi,jda=qhi,Hda=jhi,Gda=Hhi,$da=hh([Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi]),Ghi="all",$hi="each_quorum",Vhi="quorum",Whi="local_quorum",zhi="one",Yhi="two",Khi="three",Jhi="local_one",Zhi="any",Xhi="serial",emi="local_serial",Vda=Ghi,Wda=$hi,zda=Vhi,Yda=Whi,Kda=zhi,Jda=Yhi,Zda=Khi,Xda=Jhi,efa=Zhi,tfa=Xhi,rfa=emi,nfa=hh([Ghi,$hi,Vhi,Whi,zhi,Yhi,Khi,Jhi,Zhi,Xhi,emi]),tmi="datasource",rmi="http",nmi="pubsub",imi="timer",omi="other",ifa=tmi,ofa=rmi,sfa=nmi,afa=imi,cfa=omi,lfa=hh([tmi,rmi,nmi,imi,omi]),smi="insert",ami="edit",cmi="delete",ufa=smi,dfa=ami,ffa=cmi,pfa=hh([smi,ami,cmi]),lmi="alibaba_cloud",umi="aws",dmi="azure",fmi="gcp",hfa=lmi,mfa=umi,gfa=dmi,Afa=fmi,yfa=hh([lmi,umi,dmi,fmi]),pmi="ip_tcp",hmi="ip_udp",mmi="ip",gmi="unix",Ami="pipe",ymi="inproc",Emi="other",Efa=pmi,_fa=hmi,vfa=mmi,Cfa=gmi,bfa=Ami,Sfa=ymi,Tfa=Emi,Ifa=hh([pmi,hmi,mmi,gmi,Ami,ymi,Emi]),_mi="wifi",vmi="wired",Cmi="cell",bmi="unavailable",Smi="unknown",xfa=_mi,wfa=vmi,Rfa=Cmi,kfa=bmi,Pfa=Smi,Dfa=hh([_mi,vmi,Cmi,bmi,Smi]),Tmi="gprs",Imi="edge",xmi="umts",wmi="cdma",Rmi="evdo_0",kmi="evdo_a",Pmi="cdma2000_1xrtt",Dmi="hsdpa",Nmi="hsupa",Mmi="hspa",Omi="iden",Lmi="evdo_b",Bmi="lte",Fmi="ehrpd",Umi="hspap",Qmi="gsm",qmi="td_scdma",jmi="iwlan",Hmi="nr",Gmi="nrnsa",$mi="lte_ca",Nfa=Tmi,Mfa=Imi,Ofa=xmi,Lfa=wmi,Bfa=Rmi,Ffa=kmi,Ufa=Pmi,Qfa=Dmi,qfa=Nmi,jfa=Mmi,Hfa=Omi,Gfa=Lmi,$fa=Bmi,Vfa=Fmi,Wfa=Umi,zfa=Qmi,Yfa=qmi,Kfa=jmi,Jfa=Hmi,Zfa=Gmi,Xfa=$mi,epa=hh([Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Fmi,Umi,Qmi,qmi,jmi,Hmi,Gmi,$mi]),Vmi="1.0",Wmi="1.1",zmi="2.0",Ymi="SPDY",Kmi="QUIC",tpa=Vmi,rpa=Wmi,npa=zmi,ipa=Ymi,opa=Kmi,spa={HTTP_1_0:Vmi,HTTP_1_1:Wmi,HTTP_2_0:zmi,SPDY:Ymi,QUIC:Kmi},Jmi="queue",Zmi="topic",apa=Jmi,cpa=Zmi,lpa=hh([Jmi,Zmi]),Xmi="receive",e0i="process",upa=Xmi,dpa=e0i,fpa=hh([Xmi,e0i]),t0i=0,r0i=1,n0i=2,i0i=3,o0i=4,s0i=5,a0i=6,c0i=7,l0i=8,u0i=9,d0i=10,f0i=11,p0i=12,h0i=13,m0i=14,g0i=15,A0i=16,ppa=t0i,hpa=r0i,mpa=n0i,gpa=i0i,Apa=o0i,ypa=s0i,Epa=a0i,_pa=c0i,vpa=l0i,Cpa=u0i,bpa=d0i,Spa=f0i,Tpa=p0i,Ipa=h0i,xpa=m0i,wpa=g0i,Rpa=A0i,kpa={OK:t0i,CANCELLED:r0i,UNKNOWN:n0i,INVALID_ARGUMENT:i0i,DEADLINE_EXCEEDED:o0i,NOT_FOUND:s0i,ALREADY_EXISTS:a0i,PERMISSION_DENIED:c0i,RESOURCE_EXHAUSTED:l0i,FAILED_PRECONDITION:u0i,ABORTED:d0i,OUT_OF_RANGE:f0i,UNIMPLEMENTED:p0i,INTERNAL:h0i,UNAVAILABLE:m0i,DATA_LOSS:g0i,UNAUTHENTICATED:A0i},y0i="SENT",E0i="RECEIVED",Ppa=y0i,Dpa=E0i,Npa=hh([y0i,E0i])});var v0i=ve(()=>{p();_0i()});var C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,qgi,jgi,Hgi,Ggi,$gi,Vgi,Wgi,zgi,Mpa,Opa,Lpa,Bpa,Fpa,Upa,Qpa,qpa,jpa,Hpa,Gpa,$pa,Vpa,Wpa,zpa,Ypa,Kpa,Jpa,Zpa,Xpa,eha,tha,rha,nha,iha,oha,sha,aha,cha,lha,uha,dha,fha,pha,hha,mha,gha,Aha,yha,Eha,_ha,vha,Cha,bha,Sha,Tha,Iha,xha,wha,Rha,kha,Pha,Dha,Nha,Mha,Oha,Lha,Bha,Fha,Uha,Qha,qha,jha,Hha,Gha,$ha,Vha,Wha,zha,Yha,Kha,Jha,Zha,Xha,ema,tma,rma,nma,ima,oma,sma,ama,Ygi,Kgi,Jgi,Zgi,cma,lma,uma,dma,fma,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,cAi,lAi,uAi,dAi,fAi,pAi,hAi,mAi,pma,hma,mma,gma,Ama,yma,Ema,_ma,vma,Cma,bma,Sma,Tma,Ima,xma,wma,Rma,kma,gAi,AAi,Pma,Dma,Nma,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,Mma,Oma,Lma,Bma,Fma,Uma,Qma,qma,TAi,IAi,xAi,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,jma,Hma,Gma,$ma,Vma,Wma,zma,Yma,Kma,Jma,Zma,Xma,LAi,BAi,FAi,UAi,QAi,qAi,jAi,HAi,GAi,$Ai,e0a,t0a,r0a,n0a,i0a,o0a,s0a,a0a,c0a,l0a,u0a,VAi=ve(()=>{p();SAr();C0i="cloud.provider",b0i="cloud.account.id",S0i="cloud.region",T0i="cloud.availability_zone",I0i="cloud.platform",x0i="aws.ecs.container.arn",w0i="aws.ecs.cluster.arn",R0i="aws.ecs.launchtype",k0i="aws.ecs.task.arn",P0i="aws.ecs.task.family",D0i="aws.ecs.task.revision",N0i="aws.eks.cluster.arn",M0i="aws.log.group.names",O0i="aws.log.group.arns",L0i="aws.log.stream.names",B0i="aws.log.stream.arns",F0i="container.name",U0i="container.id",Q0i="container.runtime",q0i="container.image.name",j0i="container.image.tag",H0i="deployment.environment",G0i="device.id",$0i="device.model.identifier",V0i="device.model.name",W0i="faas.name",z0i="faas.id",Y0i="faas.version",K0i="faas.instance",J0i="faas.max_memory",Z0i="host.id",X0i="host.name",egi="host.type",tgi="host.arch",rgi="host.image.name",ngi="host.image.id",igi="host.image.version",ogi="k8s.cluster.name",sgi="k8s.node.name",agi="k8s.node.uid",cgi="k8s.namespace.name",lgi="k8s.pod.uid",ugi="k8s.pod.name",dgi="k8s.container.name",fgi="k8s.replicaset.uid",pgi="k8s.replicaset.name",hgi="k8s.deployment.uid",mgi="k8s.deployment.name",ggi="k8s.statefulset.uid",Agi="k8s.statefulset.name",ygi="k8s.daemonset.uid",Egi="k8s.daemonset.name",_gi="k8s.job.uid",vgi="k8s.job.name",Cgi="k8s.cronjob.uid",bgi="k8s.cronjob.name",Sgi="os.type",Tgi="os.description",Igi="os.name",xgi="os.version",wgi="process.pid",Rgi="process.executable.name",kgi="process.executable.path",Pgi="process.command",Dgi="process.command_line",Ngi="process.command_args",Mgi="process.owner",Ogi="process.runtime.name",Lgi="process.runtime.version",Bgi="process.runtime.description",Fgi="service.name",Ugi="service.namespace",Qgi="service.instance.id",qgi="service.version",jgi="telemetry.sdk.name",Hgi="telemetry.sdk.language",Ggi="telemetry.sdk.version",$gi="telemetry.auto.version",Vgi="webengine.name",Wgi="webengine.version",zgi="webengine.description",Mpa=C0i,Opa=b0i,Lpa=S0i,Bpa=T0i,Fpa=I0i,Upa=x0i,Qpa=w0i,qpa=R0i,jpa=k0i,Hpa=P0i,Gpa=D0i,$pa=N0i,Vpa=M0i,Wpa=O0i,zpa=L0i,Ypa=B0i,Kpa=F0i,Jpa=U0i,Zpa=Q0i,Xpa=q0i,eha=j0i,tha=H0i,rha=G0i,nha=$0i,iha=V0i,oha=W0i,sha=z0i,aha=Y0i,cha=K0i,lha=J0i,uha=Z0i,dha=X0i,fha=egi,pha=tgi,hha=rgi,mha=ngi,gha=igi,Aha=ogi,yha=sgi,Eha=agi,_ha=cgi,vha=lgi,Cha=ugi,bha=dgi,Sha=fgi,Tha=pgi,Iha=hgi,xha=mgi,wha=ggi,Rha=Agi,kha=ygi,Pha=Egi,Dha=_gi,Nha=vgi,Mha=Cgi,Oha=bgi,Lha=Sgi,Bha=Tgi,Fha=Igi,Uha=xgi,Qha=wgi,qha=Rgi,jha=kgi,Hha=Pgi,Gha=Dgi,$ha=Ngi,Vha=Mgi,Wha=Ogi,zha=Lgi,Yha=Bgi,Kha=Fgi,Jha=Ugi,Zha=Qgi,Xha=qgi,ema=jgi,tma=Hgi,rma=Ggi,nma=$gi,ima=Vgi,oma=Wgi,sma=zgi,ama=hh([C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,qgi,jgi,Hgi,Ggi,$gi,Vgi,Wgi,zgi]),Ygi="alibaba_cloud",Kgi="aws",Jgi="azure",Zgi="gcp",cma=Ygi,lma=Kgi,uma=Jgi,dma=Zgi,fma=hh([Ygi,Kgi,Jgi,Zgi]),Xgi="alibaba_cloud_ecs",eAi="alibaba_cloud_fc",tAi="aws_ec2",rAi="aws_ecs",nAi="aws_eks",iAi="aws_lambda",oAi="aws_elastic_beanstalk",sAi="azure_vm",aAi="azure_container_instances",cAi="azure_aks",lAi="azure_functions",uAi="azure_app_service",dAi="gcp_compute_engine",fAi="gcp_cloud_run",pAi="gcp_kubernetes_engine",hAi="gcp_cloud_functions",mAi="gcp_app_engine",pma=Xgi,hma=eAi,mma=tAi,gma=rAi,Ama=nAi,yma=iAi,Ema=oAi,_ma=sAi,vma=aAi,Cma=cAi,bma=lAi,Sma=uAi,Tma=dAi,Ima=fAi,xma=pAi,wma=hAi,Rma=mAi,kma=hh([Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,cAi,lAi,uAi,dAi,fAi,pAi,hAi,mAi]),gAi="ec2",AAi="fargate",Pma=gAi,Dma=AAi,Nma=hh([gAi,AAi]),yAi="amd64",EAi="arm32",_Ai="arm64",vAi="ia64",CAi="ppc32",bAi="ppc64",SAi="x86",Mma=yAi,Oma=EAi,Lma=_Ai,Bma=vAi,Fma=CAi,Uma=bAi,Qma=SAi,qma=hh([yAi,EAi,_Ai,vAi,CAi,bAi,SAi]),TAi="windows",IAi="linux",xAi="darwin",wAi="freebsd",RAi="netbsd",kAi="openbsd",PAi="dragonflybsd",DAi="hpux",NAi="aix",MAi="solaris",OAi="z_os",jma=TAi,Hma=IAi,Gma=xAi,$ma=wAi,Vma=RAi,Wma=kAi,zma=PAi,Yma=DAi,Kma=NAi,Jma=MAi,Zma=OAi,Xma=hh([TAi,IAi,xAi,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi]),LAi="cpp",BAi="dotnet",FAi="erlang",UAi="go",QAi="java",qAi="nodejs",jAi="php",HAi="python",GAi="ruby",$Ai="webjs",e0a=LAi,t0a=BAi,r0a=FAi,n0a=UAi,i0a=QAi,o0a=qAi,s0a=jAi,a0a=HAi,c0a=GAi,l0a=$Ai,u0a=hh([LAi,BAi,FAi,UAi,QAi,qAi,jAi,HAi,GAi,$Ai])});var WAi=ve(()=>{p();VAi()});var d0a,f0a,p0a,h0a,m0a,g0a,A0a,y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,k0a,P0a,D0a,N0a,M0a,O0a,L0a,B0a,F0a,U0a,Q0a,q0a,j0a,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,Fup,Uup,X0a,ega,tga,rga,nga,iga,oga,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,gga,Aga,yga,Ega,_ga,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,kga,Pga,Dga,Nga,Mga,Oga,Lga,Bga,Fga,Uga,Qga,qga,jga,Hga,Gga,$ga,Vga,Wga,zga,Yga,Kga,Jga,Zga,Xga,eAa,tAa,rAa,nAa,iAa,oAa,sAa,aAa,cAa,lAa,uAa,dAa,fAa,pAa,hAa,TAr,mAa,gAa,AAa,yAa,EAa,IAr,_Aa,vAa,CAa,bAa,SAa,TAa,xAr,wAr,IAa,xAa,wAa,RAa,kAa,PAa,zAi=ve(()=>{p();d0a="aspnetcore.diagnostics.exception.result",f0a="aborted",p0a="handled",h0a="skipped",m0a="unhandled",g0a="aspnetcore.diagnostics.handler.type",A0a="aspnetcore.rate_limiting.policy",y0a="aspnetcore.rate_limiting.result",E0a="acquired",_0a="endpoint_limiter",v0a="global_limiter",C0a="request_canceled",b0a="aspnetcore.request.is_unhandled",S0a="aspnetcore.routing.is_fallback",T0a="aspnetcore.routing.match_status",I0a="failure",x0a="success",w0a="aspnetcore.user.is_authenticated",R0a="client.address",k0a="client.port",P0a="code.column.number",D0a="code.file.path",N0a="code.function.name",M0a="code.line.number",O0a="code.stacktrace",L0a="db.collection.name",B0a="db.namespace",F0a="db.operation.batch.size",U0a="db.operation.name",Q0a="db.query.summary",q0a="db.query.text",j0a="db.response.status_code",H0a="db.stored_procedure.name",G0a="db.system.name",$0a="mariadb",V0a="microsoft.sql_server",W0a="mysql",z0a="postgresql",Y0a="dotnet.gc.heap.generation",K0a="gen0",J0a="gen1",Z0a="gen2",Fup="loh",Uup="poh",X0a="error.type",ega="_OTHER",tga="exception.escaped",rga="exception.message",nga="exception.stacktrace",iga="exception.type",oga=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),sga="http.request.method",aga="_OTHER",cga="CONNECT",lga="DELETE",uga="GET",dga="HEAD",fga="OPTIONS",pga="PATCH",hga="POST",mga="PUT",gga="TRACE",Aga="http.request.method_original",yga="http.request.resend_count",Ega=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),_ga="http.response.status_code",vga="http.route",Cga="jvm.gc.action",bga="jvm.gc.name",Sga="jvm.memory.pool.name",Tga="jvm.memory.type",Iga="heap",xga="non_heap",wga="jvm.thread.daemon",Rga="jvm.thread.state",kga="blocked",Pga="new",Dga="runnable",Nga="terminated",Mga="timed_waiting",Oga="waiting",Lga="network.local.address",Bga="network.local.port",Fga="network.peer.address",Uga="network.peer.port",Qga="network.protocol.name",qga="network.protocol.version",jga="network.transport",Hga="pipe",Gga="quic",$ga="tcp",Vga="udp",Wga="unix",zga="network.type",Yga="ipv4",Kga="ipv6",Jga="otel.scope.name",Zga="otel.scope.version",Xga="otel.status_code",eAa="ERROR",tAa="OK",rAa="otel.status_description",nAa="server.address",iAa="server.port",oAa="service.name",sAa="service.version",aAa="signalr.connection.status",cAa="app_shutdown",lAa="normal_closure",uAa="timeout",dAa="signalr.transport",fAa="long_polling",pAa="server_sent_events",hAa="web_sockets",TAr="telemetry.sdk.language",mAa="cpp",gAa="dotnet",AAa="erlang",yAa="go",EAa="java",IAr="nodejs",_Aa="php",vAa="python",CAa="ruby",bAa="rust",SAa="swift",TAa="webjs",xAr="telemetry.sdk.name",wAr="telemetry.sdk.version",IAa="url.fragment",xAa="url.full",wAa="url.path",RAa="url.query",kAa="url.scheme",PAa="user_agent.original"});var DAa,NAa,MAa,OAa,LAa,BAa,FAa,UAa,QAa,qAa,jAa,HAa,GAa,$Aa,VAa,WAa,zAa,YAa,KAa,JAa,ZAa,XAa,eya,tya,rya,nya,iya,oya,sya,aya,cya,lya,uya,dya,fya,pya,hya,mya,gya,Aya,yya,Eya,_ya,vya,Cya,bya,Sya,Tya,Iya,xya,wya,YAi=ve(()=>{p();DAa="aspnetcore.diagnostics.exceptions",NAa="aspnetcore.rate_limiting.active_request_leases",MAa="aspnetcore.rate_limiting.queued_requests",OAa="aspnetcore.rate_limiting.request.time_in_queue",LAa="aspnetcore.rate_limiting.request_lease.duration",BAa="aspnetcore.rate_limiting.requests",FAa="aspnetcore.routing.match_attempts",UAa="db.client.operation.duration",QAa="dotnet.assembly.count",qAa="dotnet.exceptions",jAa="dotnet.gc.collections",HAa="dotnet.gc.heap.total_allocated",GAa="dotnet.gc.last_collection.heap.fragmentation.size",$Aa="dotnet.gc.last_collection.heap.size",VAa="dotnet.gc.last_collection.memory.committed_size",WAa="dotnet.gc.pause.time",zAa="dotnet.jit.compilation.time",YAa="dotnet.jit.compiled_il.size",KAa="dotnet.jit.compiled_methods",JAa="dotnet.monitor.lock_contentions",ZAa="dotnet.process.cpu.count",XAa="dotnet.process.cpu.time",eya="dotnet.process.memory.working_set",tya="dotnet.thread_pool.queue.length",rya="dotnet.thread_pool.thread.count",nya="dotnet.thread_pool.work_item.count",iya="dotnet.timer.count",oya="http.client.request.duration",sya="http.server.request.duration",aya="jvm.class.count",cya="jvm.class.loaded",lya="jvm.class.unloaded",uya="jvm.cpu.count",dya="jvm.cpu.recent_utilization",fya="jvm.cpu.time",pya="jvm.gc.duration",hya="jvm.memory.committed",mya="jvm.memory.limit",gya="jvm.memory.used",Aya="jvm.memory.used_after_last_gc",yya="jvm.thread.count",Eya="kestrel.active_connections",_ya="kestrel.active_tls_handshakes",vya="kestrel.connection.duration",Cya="kestrel.queued_connections",bya="kestrel.queued_requests",Sya="kestrel.rejected_connections",Tya="kestrel.tls_handshake.duration",Iya="kestrel.upgraded_connections",xya="signalr.server.active_connections",wya="signalr.server.connection.duration"});var Rya,KAi=ve(()=>{p();Rya="exception"});var RAr={};ki(RAr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>f0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>p0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>h0a,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>m0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>E0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>_0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>v0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>C0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>I0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>x0a,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>d0a,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>g0a,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>A0a,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>y0a,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>b0a,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>S0a,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>T0a,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>w0a,ATTR_CLIENT_ADDRESS:()=>R0a,ATTR_CLIENT_PORT:()=>k0a,ATTR_CODE_COLUMN_NUMBER:()=>P0a,ATTR_CODE_FILE_PATH:()=>D0a,ATTR_CODE_FUNCTION_NAME:()=>N0a,ATTR_CODE_LINE_NUMBER:()=>M0a,ATTR_CODE_STACKTRACE:()=>O0a,ATTR_DB_COLLECTION_NAME:()=>L0a,ATTR_DB_NAMESPACE:()=>B0a,ATTR_DB_OPERATION_BATCH_SIZE:()=>F0a,ATTR_DB_OPERATION_NAME:()=>U0a,ATTR_DB_QUERY_SUMMARY:()=>Q0a,ATTR_DB_QUERY_TEXT:()=>q0a,ATTR_DB_RESPONSE_STATUS_CODE:()=>j0a,ATTR_DB_STORED_PROCEDURE_NAME:()=>H0a,ATTR_DB_SYSTEM_NAME:()=>G0a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Y0a,ATTR_ERROR_TYPE:()=>X0a,ATTR_EXCEPTION_ESCAPED:()=>tga,ATTR_EXCEPTION_MESSAGE:()=>rga,ATTR_EXCEPTION_STACKTRACE:()=>nga,ATTR_EXCEPTION_TYPE:()=>iga,ATTR_HTTP_REQUEST_HEADER:()=>oga,ATTR_HTTP_REQUEST_METHOD:()=>sga,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Aga,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>yga,ATTR_HTTP_RESPONSE_HEADER:()=>Ega,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>_ga,ATTR_HTTP_ROUTE:()=>vga,ATTR_JVM_GC_ACTION:()=>Cga,ATTR_JVM_GC_NAME:()=>bga,ATTR_JVM_MEMORY_POOL_NAME:()=>Sga,ATTR_JVM_MEMORY_TYPE:()=>Tga,ATTR_JVM_THREAD_DAEMON:()=>wga,ATTR_JVM_THREAD_STATE:()=>Rga,ATTR_NETWORK_LOCAL_ADDRESS:()=>Lga,ATTR_NETWORK_LOCAL_PORT:()=>Bga,ATTR_NETWORK_PEER_ADDRESS:()=>Fga,ATTR_NETWORK_PEER_PORT:()=>Uga,ATTR_NETWORK_PROTOCOL_NAME:()=>Qga,ATTR_NETWORK_PROTOCOL_VERSION:()=>qga,ATTR_NETWORK_TRANSPORT:()=>jga,ATTR_NETWORK_TYPE:()=>zga,ATTR_OTEL_SCOPE_NAME:()=>Jga,ATTR_OTEL_SCOPE_VERSION:()=>Zga,ATTR_OTEL_STATUS_CODE:()=>Xga,ATTR_OTEL_STATUS_DESCRIPTION:()=>rAa,ATTR_SERVER_ADDRESS:()=>nAa,ATTR_SERVER_PORT:()=>iAa,ATTR_SERVICE_NAME:()=>oAa,ATTR_SERVICE_VERSION:()=>sAa,ATTR_SIGNALR_CONNECTION_STATUS:()=>aAa,ATTR_SIGNALR_TRANSPORT:()=>dAa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>TAr,ATTR_TELEMETRY_SDK_NAME:()=>xAr,ATTR_TELEMETRY_SDK_VERSION:()=>wAr,ATTR_URL_FRAGMENT:()=>IAa,ATTR_URL_FULL:()=>xAa,ATTR_URL_PATH:()=>wAa,ATTR_URL_QUERY:()=>RAa,ATTR_URL_SCHEME:()=>kAa,ATTR_USER_AGENT_ORIGINAL:()=>PAa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Pma,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Dma,AwsEcsLaunchtypeValues:()=>Nma,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>pma,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>hma,CLOUDPLATFORMVALUES_AWS_EC2:()=>mma,CLOUDPLATFORMVALUES_AWS_ECS:()=>gma,CLOUDPLATFORMVALUES_AWS_EKS:()=>Ama,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Ema,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>yma,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Cma,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Sma,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>vma,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>bma,CLOUDPLATFORMVALUES_AZURE_VM:()=>_ma,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Rma,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>wma,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Ima,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Tma,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>xma,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>cma,CLOUDPROVIDERVALUES_AWS:()=>lma,CLOUDPROVIDERVALUES_AZURE:()=>uma,CLOUDPROVIDERVALUES_GCP:()=>dma,CloudPlatformValues:()=>kma,CloudProviderValues:()=>fma,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Vda,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>efa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Wda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Xda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Yda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>rfa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Kda,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>zda,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>tfa,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Zda,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Jda,DBSYSTEMVALUES_ADABAS:()=>mda,DBSYSTEMVALUES_CACHE:()=>hda,DBSYSTEMVALUES_CASSANDRA:()=>Dda,DBSYSTEMVALUES_CLOUDSCAPE:()=>sda,DBSYSTEMVALUES_COCKROACHDB:()=>Gda,DBSYSTEMVALUES_COLDFUSION:()=>Pda,DBSYSTEMVALUES_COSMOSDB:()=>Fda,DBSYSTEMVALUES_COUCHBASE:()=>Lda,DBSYSTEMVALUES_COUCHDB:()=>Bda,DBSYSTEMVALUES_DB2:()=>rda,DBSYSTEMVALUES_DERBY:()=>Ada,DBSYSTEMVALUES_DYNAMODB:()=>Uda,DBSYSTEMVALUES_EDB:()=>pda,DBSYSTEMVALUES_ELASTICSEARCH:()=>jda,DBSYSTEMVALUES_FILEMAKER:()=>yda,DBSYSTEMVALUES_FIREBIRD:()=>gda,DBSYSTEMVALUES_FIRSTSQL:()=>fda,DBSYSTEMVALUES_GEODE:()=>qda,DBSYSTEMVALUES_H2:()=>kda,DBSYSTEMVALUES_HANADB:()=>uda,DBSYSTEMVALUES_HBASE:()=>Nda,DBSYSTEMVALUES_HIVE:()=>oda,DBSYSTEMVALUES_HSQLDB:()=>ada,DBSYSTEMVALUES_INFORMIX:()=>Eda,DBSYSTEMVALUES_INGRES:()=>dda,DBSYSTEMVALUES_INSTANTDB:()=>_da,DBSYSTEMVALUES_INTERBASE:()=>vda,DBSYSTEMVALUES_MARIADB:()=>Cda,DBSYSTEMVALUES_MAXDB:()=>lda,DBSYSTEMVALUES_MEMCACHED:()=>Hda,DBSYSTEMVALUES_MONGODB:()=>Mda,DBSYSTEMVALUES_MSSQL:()=>Xua,DBSYSTEMVALUES_MYSQL:()=>eda,DBSYSTEMVALUES_NEO4J:()=>Qda,DBSYSTEMVALUES_NETEZZA:()=>bda,DBSYSTEMVALUES_ORACLE:()=>tda,DBSYSTEMVALUES_OTHER_SQL:()=>Zua,DBSYSTEMVALUES_PERVASIVE:()=>Sda,DBSYSTEMVALUES_POINTBASE:()=>Tda,DBSYSTEMVALUES_POSTGRESQL:()=>nda,DBSYSTEMVALUES_PROGRESS:()=>cda,DBSYSTEMVALUES_REDIS:()=>Oda,DBSYSTEMVALUES_REDSHIFT:()=>ida,DBSYSTEMVALUES_SQLITE:()=>Ida,DBSYSTEMVALUES_SYBASE:()=>xda,DBSYSTEMVALUES_TERADATA:()=>wda,DBSYSTEMVALUES_VERTICA:()=>Rda,DB_SYSTEM_NAME_VALUE_MARIADB:()=>$0a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>V0a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>W0a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>z0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>K0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>J0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Z0a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Fup,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Uup,DbCassandraConsistencyLevelValues:()=>nfa,DbSystemValues:()=>$da,ERROR_TYPE_VALUE_OTHER:()=>ega,EVENT_EXCEPTION:()=>Rya,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>ffa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>dfa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>ufa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>hfa,FAASINVOKEDPROVIDERVALUES_AWS:()=>mfa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>gfa,FAASINVOKEDPROVIDERVALUES_GCP:()=>Afa,FAASTRIGGERVALUES_DATASOURCE:()=>ifa,FAASTRIGGERVALUES_HTTP:()=>ofa,FAASTRIGGERVALUES_OTHER:()=>cfa,FAASTRIGGERVALUES_PUBSUB:()=>sfa,FAASTRIGGERVALUES_TIMER:()=>afa,FaasDocumentOperationValues:()=>pfa,FaasInvokedProviderValues:()=>yfa,FaasTriggerValues:()=>lfa,HOSTARCHVALUES_AMD64:()=>Mma,HOSTARCHVALUES_ARM32:()=>Oma,HOSTARCHVALUES_ARM64:()=>Lma,HOSTARCHVALUES_IA64:()=>Bma,HOSTARCHVALUES_PPC32:()=>Fma,HOSTARCHVALUES_PPC64:()=>Uma,HOSTARCHVALUES_X86:()=>Qma,HTTPFLAVORVALUES_HTTP_1_0:()=>tpa,HTTPFLAVORVALUES_HTTP_1_1:()=>rpa,HTTPFLAVORVALUES_HTTP_2_0:()=>npa,HTTPFLAVORVALUES_QUIC:()=>opa,HTTPFLAVORVALUES_SPDY:()=>ipa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>cga,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>lga,HTTP_REQUEST_METHOD_VALUE_GET:()=>uga,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>dga,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>fga,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>aga,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>pga,HTTP_REQUEST_METHOD_VALUE_POST:()=>hga,HTTP_REQUEST_METHOD_VALUE_PUT:()=>mga,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>gga,HostArchValues:()=>qma,HttpFlavorValues:()=>spa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Iga,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>xga,JVM_THREAD_STATE_VALUE_BLOCKED:()=>kga,JVM_THREAD_STATE_VALUE_NEW:()=>Pga,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Dga,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Nga,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Mga,JVM_THREAD_STATE_VALUE_WAITING:()=>Oga,MESSAGETYPEVALUES_RECEIVED:()=>Dpa,MESSAGETYPEVALUES_SENT:()=>Ppa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>apa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>cpa,MESSAGINGOPERATIONVALUES_PROCESS:()=>dpa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>upa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>DAa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>NAa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>MAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>BAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>LAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>OAa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>FAa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>UAa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>QAa,METRIC_DOTNET_EXCEPTIONS:()=>qAa,METRIC_DOTNET_GC_COLLECTIONS:()=>jAa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>HAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>GAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>$Aa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>VAa,METRIC_DOTNET_GC_PAUSE_TIME:()=>WAa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>zAa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>YAa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>KAa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>JAa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>ZAa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>XAa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>eya,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>tya,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>rya,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>nya,METRIC_DOTNET_TIMER_COUNT:()=>iya,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>oya,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>sya,METRIC_JVM_CLASS_COUNT:()=>aya,METRIC_JVM_CLASS_LOADED:()=>cya,METRIC_JVM_CLASS_UNLOADED:()=>lya,METRIC_JVM_CPU_COUNT:()=>uya,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>dya,METRIC_JVM_CPU_TIME:()=>fya,METRIC_JVM_GC_DURATION:()=>pya,METRIC_JVM_MEMORY_COMMITTED:()=>hya,METRIC_JVM_MEMORY_LIMIT:()=>mya,METRIC_JVM_MEMORY_USED:()=>gya,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Aya,METRIC_JVM_THREAD_COUNT:()=>yya,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Eya,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>_ya,METRIC_KESTREL_CONNECTION_DURATION:()=>vya,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Cya,METRIC_KESTREL_QUEUED_REQUESTS:()=>bya,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Sya,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Tya,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Iya,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>xya,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>wya,MessageTypeValues:()=>Npa,MessagingDestinationKindValues:()=>lpa,MessagingOperationValues:()=>fpa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Lfa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Ufa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Mfa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Vfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Bfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Ffa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Gfa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Nfa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>zfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Qfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>jfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Wfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>qfa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Hfa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Kfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>$fa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Xfa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Jfa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Zfa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Yfa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Ofa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Rfa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>kfa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Pfa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>xfa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>wfa,NETTRANSPORTVALUES_INPROC:()=>Sfa,NETTRANSPORTVALUES_IP:()=>vfa,NETTRANSPORTVALUES_IP_TCP:()=>Efa,NETTRANSPORTVALUES_IP_UDP:()=>_fa,NETTRANSPORTVALUES_OTHER:()=>Tfa,NETTRANSPORTVALUES_PIPE:()=>bfa,NETTRANSPORTVALUES_UNIX:()=>Cfa,NETWORK_TRANSPORT_VALUE_PIPE:()=>Hga,NETWORK_TRANSPORT_VALUE_QUIC:()=>Gga,NETWORK_TRANSPORT_VALUE_TCP:()=>$ga,NETWORK_TRANSPORT_VALUE_UDP:()=>Vga,NETWORK_TRANSPORT_VALUE_UNIX:()=>Wga,NETWORK_TYPE_VALUE_IPV4:()=>Yga,NETWORK_TYPE_VALUE_IPV6:()=>Kga,NetHostConnectionSubtypeValues:()=>epa,NetHostConnectionTypeValues:()=>Dfa,NetTransportValues:()=>Ifa,OSTYPEVALUES_AIX:()=>Kma,OSTYPEVALUES_DARWIN:()=>Gma,OSTYPEVALUES_DRAGONFLYBSD:()=>zma,OSTYPEVALUES_FREEBSD:()=>$ma,OSTYPEVALUES_HPUX:()=>Yma,OSTYPEVALUES_LINUX:()=>Hma,OSTYPEVALUES_NETBSD:()=>Vma,OSTYPEVALUES_OPENBSD:()=>Wma,OSTYPEVALUES_SOLARIS:()=>Jma,OSTYPEVALUES_WINDOWS:()=>jma,OSTYPEVALUES_Z_OS:()=>Zma,OTEL_STATUS_CODE_VALUE_ERROR:()=>eAa,OTEL_STATUS_CODE_VALUE_OK:()=>tAa,OsTypeValues:()=>Xma,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>bpa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Epa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>hpa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>wpa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Apa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Cpa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Ipa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>gpa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>ypa,RPCGRPCSTATUSCODEVALUES_OK:()=>ppa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Spa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>_pa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>vpa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Rpa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>xpa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Tpa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>mpa,RpcGrpcStatusCodeValues:()=>kpa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>sua,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>yua,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>nua,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Xla,SEMATTRS_AWS_DYNAMODB_COUNT:()=>gua,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>dua,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>lua,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Eua,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>aua,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>eua,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>oua,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>uua,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>iua,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>tua,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>rua,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Aua,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>pua,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>hua,SEMATTRS_AWS_DYNAMODB_SELECT:()=>cua,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>fua,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Zla,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>mua,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Pca,SEMATTRS_CODE_FILEPATH:()=>Ola,SEMATTRS_CODE_FUNCTION:()=>Nla,SEMATTRS_CODE_LINENO:()=>Lla,SEMATTRS_CODE_NAMESPACE:()=>Mla,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>jca,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Wca,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Vca,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Gca,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Qca,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>qca,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>$ca,SEMATTRS_DB_CASSANDRA_TABLE:()=>Hca,SEMATTRS_DB_CONNECTION_STRING:()=>Nca,SEMATTRS_DB_HBASE_NAMESPACE:()=>zca,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Oca,SEMATTRS_DB_MONGODB_COLLECTION:()=>Kca,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Uca,SEMATTRS_DB_NAME:()=>Lca,SEMATTRS_DB_OPERATION:()=>Fca,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Yca,SEMATTRS_DB_SQL_TABLE:()=>Jca,SEMATTRS_DB_STATEMENT:()=>Bca,SEMATTRS_DB_SYSTEM:()=>Dca,SEMATTRS_DB_USER:()=>Mca,SEMATTRS_ENDUSER_ID:()=>wla,SEMATTRS_ENDUSER_ROLE:()=>Rla,SEMATTRS_ENDUSER_SCOPE:()=>kla,SEMATTRS_EXCEPTION_ESCAPED:()=>tla,SEMATTRS_EXCEPTION_MESSAGE:()=>Xca,SEMATTRS_EXCEPTION_STACKTRACE:()=>ela,SEMATTRS_EXCEPTION_TYPE:()=>Zca,SEMATTRS_FAAS_COLDSTART:()=>ula,SEMATTRS_FAAS_CRON:()=>lla,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>ila,SEMATTRS_FAAS_DOCUMENT_NAME:()=>ala,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>ola,SEMATTRS_FAAS_DOCUMENT_TIME:()=>sla,SEMATTRS_FAAS_EXECUTION:()=>nla,SEMATTRS_FAAS_INVOKED_NAME:()=>dla,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>fla,SEMATTRS_FAAS_INVOKED_REGION:()=>pla,SEMATTRS_FAAS_TIME:()=>cla,SEMATTRS_FAAS_TRIGGER:()=>rla,SEMATTRS_HTTP_CLIENT_IP:()=>Jla,SEMATTRS_HTTP_FLAVOR:()=>Hla,SEMATTRS_HTTP_HOST:()=>Qla,SEMATTRS_HTTP_METHOD:()=>Bla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>$la,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Vla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Wla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>zla,SEMATTRS_HTTP_ROUTE:()=>Kla,SEMATTRS_HTTP_SCHEME:()=>qla,SEMATTRS_HTTP_SERVER_NAME:()=>Yla,SEMATTRS_HTTP_STATUS_CODE:()=>jla,SEMATTRS_HTTP_TARGET:()=>Ula,SEMATTRS_HTTP_URL:()=>Fla,SEMATTRS_HTTP_USER_AGENT:()=>Gla,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Yua,SEMATTRS_MESSAGE_ID:()=>zua,SEMATTRS_MESSAGE_TYPE:()=>Wua,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Kua,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Dua,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>wua,SEMATTRS_MESSAGING_DESTINATION:()=>vua,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Cua,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Lua,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Oua,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Mua,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Bua,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Fua,SEMATTRS_MESSAGING_MESSAGE_ID:()=>xua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>kua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Rua,SEMATTRS_MESSAGING_OPERATION:()=>Pua,SEMATTRS_MESSAGING_PROTOCOL:()=>Sua,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Tua,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Nua,SEMATTRS_MESSAGING_SYSTEM:()=>_ua,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>bua,SEMATTRS_MESSAGING_URL:()=>Iua,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Ila,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Sla,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Tla,SEMATTRS_NET_HOST_CARRIER_NAME:()=>bla,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Cla,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>vla,SEMATTRS_NET_HOST_IP:()=>yla,SEMATTRS_NET_HOST_NAME:()=>_la,SEMATTRS_NET_HOST_PORT:()=>Ela,SEMATTRS_NET_PEER_IP:()=>mla,SEMATTRS_NET_PEER_NAME:()=>Ala,SEMATTRS_NET_PEER_PORT:()=>gla,SEMATTRS_NET_TRANSPORT:()=>hla,SEMATTRS_PEER_SERVICE:()=>xla,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>jua,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>$ua,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Vua,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Gua,SEMATTRS_RPC_JSONRPC_VERSION:()=>Hua,SEMATTRS_RPC_METHOD:()=>qua,SEMATTRS_RPC_SERVICE:()=>Qua,SEMATTRS_RPC_SYSTEM:()=>Uua,SEMATTRS_THREAD_ID:()=>Pla,SEMATTRS_THREAD_NAME:()=>Dla,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Qpa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Upa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>qpa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>jpa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Hpa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Gpa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>$pa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Wpa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Vpa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Ypa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>zpa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Opa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Bpa,SEMRESATTRS_CLOUD_PLATFORM:()=>Fpa,SEMRESATTRS_CLOUD_PROVIDER:()=>Mpa,SEMRESATTRS_CLOUD_REGION:()=>Lpa,SEMRESATTRS_CONTAINER_ID:()=>Jpa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Xpa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>eha,SEMRESATTRS_CONTAINER_NAME:()=>Kpa,SEMRESATTRS_CONTAINER_RUNTIME:()=>Zpa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>tha,SEMRESATTRS_DEVICE_ID:()=>rha,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>nha,SEMRESATTRS_DEVICE_MODEL_NAME:()=>iha,SEMRESATTRS_FAAS_ID:()=>sha,SEMRESATTRS_FAAS_INSTANCE:()=>cha,SEMRESATTRS_FAAS_MAX_MEMORY:()=>lha,SEMRESATTRS_FAAS_NAME:()=>oha,SEMRESATTRS_FAAS_VERSION:()=>aha,SEMRESATTRS_HOST_ARCH:()=>pha,SEMRESATTRS_HOST_ID:()=>uha,SEMRESATTRS_HOST_IMAGE_ID:()=>mha,SEMRESATTRS_HOST_IMAGE_NAME:()=>hha,SEMRESATTRS_HOST_IMAGE_VERSION:()=>gha,SEMRESATTRS_HOST_NAME:()=>dha,SEMRESATTRS_HOST_TYPE:()=>fha,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Aha,SEMRESATTRS_K8S_CONTAINER_NAME:()=>bha,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Oha,SEMRESATTRS_K8S_CRONJOB_UID:()=>Mha,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Pha,SEMRESATTRS_K8S_DAEMONSET_UID:()=>kha,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>xha,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Iha,SEMRESATTRS_K8S_JOB_NAME:()=>Nha,SEMRESATTRS_K8S_JOB_UID:()=>Dha,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>_ha,SEMRESATTRS_K8S_NODE_NAME:()=>yha,SEMRESATTRS_K8S_NODE_UID:()=>Eha,SEMRESATTRS_K8S_POD_NAME:()=>Cha,SEMRESATTRS_K8S_POD_UID:()=>vha,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Tha,SEMRESATTRS_K8S_REPLICASET_UID:()=>Sha,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Rha,SEMRESATTRS_K8S_STATEFULSET_UID:()=>wha,SEMRESATTRS_OS_DESCRIPTION:()=>Bha,SEMRESATTRS_OS_NAME:()=>Fha,SEMRESATTRS_OS_TYPE:()=>Lha,SEMRESATTRS_OS_VERSION:()=>Uha,SEMRESATTRS_PROCESS_COMMAND:()=>Hha,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>$ha,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Gha,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>qha,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>jha,SEMRESATTRS_PROCESS_OWNER:()=>Vha,SEMRESATTRS_PROCESS_PID:()=>Qha,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Yha,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Wha,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>zha,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Zha,SEMRESATTRS_SERVICE_NAME:()=>Kha,SEMRESATTRS_SERVICE_NAMESPACE:()=>Jha,SEMRESATTRS_SERVICE_VERSION:()=>Xha,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>nma,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>tma,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>ema,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>rma,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>sma,SEMRESATTRS_WEBENGINE_NAME:()=>ima,SEMRESATTRS_WEBENGINE_VERSION:()=>oma,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>cAa,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>lAa,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>uAa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>fAa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>pAa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>hAa,SemanticAttributes:()=>Jua,SemanticResourceAttributes:()=>ama,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>e0a,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>t0a,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>r0a,TELEMETRYSDKLANGUAGEVALUES_GO:()=>n0a,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>i0a,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>o0a,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>s0a,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>a0a,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>c0a,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>l0a,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>mAa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>gAa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>AAa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>yAa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>EAa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>IAr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>_Aa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>vAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>CAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>bAa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>SAa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>TAa,TelemetrySdkLanguageValues:()=>u0a});var Cht=ve(()=>{p();v0i();WAi();zAi();YAi();KAi()});var JAi,ZAi=ve(()=>{p();JAi="process.runtime.name"});var bht,XAi=ve(()=>{p();kdi();Cht();ZAi();bht={[xAr]:"opentelemetry",[JAi]:"node",[TAr]:IAr,[wAr]:Rdi}});var eyi=ve(()=>{p();Tdi();Idi();wdi();XAi()});var kAr=ve(()=>{p();eyi()});function C0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Pya);return[r,n]}function Tht(){let t=uG.timeOrigin;if(typeof t!="number"){let e=uG;t=e.timing&&e.timing.fetchStart}return t}function PAr(t){let e=C0e(Tht()),r=C0e(typeof t=="number"?t:uG.now());return DAr(e,r)}function ryi(t){if(Iht(t))return t;if(typeof t=="number")return t=Sht&&(r[1]-=Sht,r[0]+=1),r}var tyi,kya,Pya,Sht,lyi=ve(()=>{p();kAr();tyi=9,kya=6,Pya=Math.pow(10,kya),Sht=Math.pow(10,tyi);a(C0e,"millisToHrTime");a(Tht,"getTimeOrigin");a(PAr,"hrTime");a(ryi,"timeInputToHrTime");a(nyi,"hrTimeDuration");a(iyi,"hrTimeToTimeStamp");a(oyi,"hrTimeToNanoseconds");a(syi,"hrTimeToMilliseconds");a(ayi,"hrTimeToMicroseconds");a(Iht,"isTimeInputHrTime");a(cyi,"isTimeInput");a(DAr,"addHrTimes")});function uyi(t){typeof t!="number"&&t.unref()}var dyi=ve(()=>{p();a(uyi,"unrefTimer")});var xht,fyi=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(xht||(xht={}))});var wht,pyi=ve(()=>{p();co();wht=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){Dn.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){Dn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function hyi(t){return Mya.test(t)}function myi(t){return Oya.test(t)&&!Lya.test(t)}var NAr,Dya,Nya,Mya,Oya,Lya,gyi=ve(()=>{p();NAr="[_0-9a-z-*/]",Dya=`[a-z]${NAr}{0,255}`,Nya=`[a-z0-9]${NAr}{0,240}@[a-z]${NAr}{0,13}`,Mya=new RegExp(`^(?:${Dya}|${Nya})$`),Oya=/^[ -~]{0,255}[!-~]$/,Lya=/,|=/;a(hyi,"validateKey");a(myi,"validateValue")});var Ayi,Bya,yyi,Eyi,b0e,MAr=ve(()=>{p();gyi();Ayi=32,Bya=512,yyi=",",Eyi="=",b0e=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+Eyi+this.get(r)),e),[]).join(yyi)}_parse(e){e.length>Bya||(this._internalState=e.split(yyi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(Eyi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);hyi(c)&&myi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Ayi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Ayi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function OAr(t){let e=Hya.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sOe,aOe,Fya,Uya,Qya,qya,jya,Hya,Rht,_yi=ve(()=>{p();co();iOe();MAr();sOe="traceparent",aOe="tracestate",Fya="00",Uya="(?!ff)[\\da-f]{2}",Qya="(?![0]{32})[\\da-f]{32}",qya="(?![0]{16})[\\da-f]{16}",jya="[\\da-f]{2}",Hya=new RegExp(`^\\s?(${Uya})-(${Qya})-(${qya})-(${jya})(-.*)?\\s?$`);a(OAr,"parseTraceParent");Rht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=wu.getSpanContext(e);if(!o||v0e(e)||!vb(o))return;let s=`${Fya}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||kf.NONE).toString(16)}`;n.set(r,sOe,s),o.traceState&&n.set(r,aOe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,sOe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=OAr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,aOe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new b0e(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)}fields(){return[sOe,aOe]}}});function vyi(t,e){return t.setValue(LAr,e)}function Cyi(t){return t.deleteValue(LAr)}function byi(t){return t.getValue(LAr)}var LAr,kht,Syi=ve(()=>{p();co();LAr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(kht||(kht={}));a(vyi,"setRPCMetadata");a(Cyi,"deleteRPCMetadata");a(byi,"getRPCMetadata")});function BAr(t){if(!Kya(t)||Jya(t)!==Gya)return!1;let e=Yya(t);if(e===null)return!0;let r=xyi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Tyi.call(r)===zya}function Kya(t){return t!=null&&typeof t=="object"}function Jya(t){return t==null?t===void 0?Vya:$ya:Dee&&Dee in Object(t)?Zya(t):Xya(t)}function Zya(t){let e=xyi.call(t,Dee),r=t[Dee],n=!1;try{t[Dee]=void 0,n=!0}catch{}let o=wyi.call(t);return n&&(e?t[Dee]=r:delete t[Dee]),o}function Xya(t){return wyi.call(t)}var Gya,$ya,Vya,Wya,Tyi,zya,Yya,Iyi,xyi,Dee,wyi,Ryi=ve(()=>{p();Gya="[object Object]",$ya="[object Null]",Vya="[object Undefined]",Wya=Function.prototype,Tyi=Wya.toString,zya=Tyi.call(Object),Yya=Object.getPrototypeOf,Iyi=Object.prototype,xyi=Iyi.hasOwnProperty,Dee=Symbol?Symbol.toStringTag:void 0,wyi=Iyi.toString;a(BAr,"isPlainObject");a(Kya,"isObjectLike");a(Jya,"baseGetTag");a(Zya,"getRawTag");a(Xya,"objectToString")});function Pyi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Dyi(e,t.shift(),0,r);return e}function FAr(t){return Dht(t)?t.slice():t}function Dyi(t,e,r=0,n){let o;if(!(r>eEa)){if(r++,Pht(t)||Pht(e)||Nyi(e))o=FAr(e);else if(Dht(t)){if(o=t.slice(),Dht(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(kyi(t,u,n)||kyi(e,u,n))delete o[u];else{if(cOe(f)&&cOe(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]=Dyi(o[u],d,r,n)}}}}else o=e;return o}}function kyi(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 tEa(t,e){return!(!BAr(t)||!BAr(e))}var eEa,Myi=ve(()=>{p();Ryi();eEa=20;a(Pyi,"merge");a(FAr,"takeValue");a(Dyi,"mergeTwoObjects");a(kyi,"wasObjectReferenced");a(Dht,"isArray");a(Nyi,"isFunction");a(cOe,"isObject");a(Pht,"isPrimitive");a(tEa,"shouldMerge")});function Oyi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new lOe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var lOe,Lyi=ve(()=>{p();lOe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(Oyi,"callWithTimeout")});function UAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Byi(t,e){if(!e)return!1;for(let r of e)if(UAr(t,r))return!0;return!1}var Fyi=ve(()=>{p();a(UAr,"urlMatches");a(Byi,"isUrlIgnored")});var Nht,Uyi=ve(()=>{p();Nht=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 Mht,Qyi=ve(()=>{p();Uyi();Mht=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new Nht;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 jyi(t){if(t==null)return;let e=qyi[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(qyi)}, using default`),Na.INFO)}var qyi,Hyi=ve(()=>{p();co();qyi={ALL:Na.ALL,VERBOSE:Na.VERBOSE,DEBUG:Na.DEBUG,INFO:Na.INFO,WARN:Na.WARN,ERROR:Na.ERROR,NONE:Na.NONE};a(jyi,"diagLogLevelFromString")});function Gyi(t,e){return new Promise(r=>{Lg.with(fht(Lg.active()),()=>{t.export(e,n=>{r(n)})})})}var $yi=ve(()=>{p();co();iOe();a(Gyi,"_export")});var Oht={};ki(Oht,{AnchoredClock:()=>ght,BindOnceFuture:()=>Mht,CompositePropagator:()=>wht,ExportResultCode:()=>xht,RPCType:()=>kht,SDK_INFO:()=>bht,TRACE_PARENT_HEADER:()=>sOe,TRACE_STATE_HEADER:()=>aOe,TimeoutError:()=>lOe,TraceState:()=>b0e,W3CBaggagePropagator:()=>mht,W3CTraceContextPropagator:()=>Rht,_globalThis:()=>vht,addHrTimes:()=>DAr,callWithTimeout:()=>Oyi,deleteRPCMetadata:()=>Cyi,diagLogLevelFromString:()=>jyi,getBooleanFromEnv:()=>Eht,getNumberFromEnv:()=>yht,getRPCMetadata:()=>byi,getStringFromEnv:()=>oOe,getStringListFromEnv:()=>_ht,getTimeOrigin:()=>Tht,globalErrorHandler:()=>bdi,hrTime:()=>PAr,hrTimeDuration:()=>nyi,hrTimeToMicroseconds:()=>ayi,hrTimeToMilliseconds:()=>syi,hrTimeToNanoseconds:()=>oyi,hrTimeToTimeStamp:()=>iyi,internal:()=>rEa,isAttributeValue:()=>vAr,isTimeInput:()=>cyi,isTimeInputHrTime:()=>Iht,isTracingSuppressed:()=>v0e,isUrlIgnored:()=>Byi,loggingErrorHandler:()=>Aht,merge:()=>Pyi,millisToHrTime:()=>C0e,otperformance:()=>uG,parseKeyPairsIntoRecord:()=>mdi,parseTraceParent:()=>OAr,sanitizeAttributes:()=>ydi,setGlobalErrorHandler:()=>Cdi,setRPCMetadata:()=>vyi,suppressTracing:()=>fht,timeInputToHrTime:()=>ryi,unrefTimer:()=>uyi,unsuppressTracing:()=>udi,urlMatches:()=>UAr});var rEa,Lht=ve(()=>{p();gdi();Adi();_di();Sdi();CAr();lyi();dyi();fyi();_Ar();kAr();pyi();_yi();Syi();iOe();MAr();Myi();Lyi();Fyi();Qyi();Hyi();$yi();rEa={_export:Gyi}});var zyi=I(Bht=>{"use strict";p();Object.defineProperty(Bht,"__esModule",{value:!0});Bht.OpenTelemetrySpanWrapper=void 0;var Vyi=(co(),Sa(z5)),Wyi=(Lht(),Sa(Oht)),nEa=AAr(),QAr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&iEa(e.error)?e.error?(this._span.setStatus({code:Vyi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:Vyi.SpanStatusCode.ERROR}):e.status==="success"&&nEa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,Wyi.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,Wyi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Bht.OpenTelemetrySpanWrapper=QAr;function iEa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(iEa,"isRecordableError")});var qAr=I(T4=>{"use strict";p();Object.defineProperty(T4,"__esModule",{value:!0});T4.environmentCache=T4.SDK_VERSION=void 0;T4.envVarToBoolean=oEa;T4.SDK_VERSION="1.0.0-beta.9";T4.environmentCache=new Map;function oEa(t){var e;T4.environmentCache.has(t)||sEa(t);let r=((e=T4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(oEa,"envVarToBoolean");function sEa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];T4.environmentCache.set(t,r)}}a(sEa,"loadEnvironmentVariable")});var Zyi=I(Fht=>{"use strict";p();Object.defineProperty(Fht,"__esModule",{value:!0});Fht.toOpenTelemetrySpanKind=Jyi;Fht.toSpanOptions=cEa;var Yyi=(co(),Sa(z5)),Kyi=(Lht(),Sa(Oht));function Jyi(t){let e=(t||"internal").toUpperCase();return Yyi.SpanKind[e]}a(Jyi,"toOpenTelemetrySpanKind");function aEa(t=[]){return t.reduce((e,r)=>{let n=Yyi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,Kyi.sanitizeAttributes)(r.attributes)}),e},[])}a(aEa,"toOpenTelemetryLinks");function cEa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,Kyi.sanitizeAttributes)(e),s=Jyi(n),c=aEa(r);return{attributes:o,kind:s,links:c}}a(cEa,"toSpanOptions")});var tEi=I(dG=>{"use strict";p();Object.defineProperty(dG,"__esModule",{value:!0});dG.OpenTelemetryInstrumenter=dG.propagator=void 0;var I4=(co(),Sa(z5)),eEi=(Lht(),Sa(Oht)),lEa=zyi(),Xyi=qAr(),uEa=Zyi();dG.propagator=new eEi.W3CTraceContextPropagator;var jAr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||I4.context.active(),o;return(0,Xyi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=I4.trace.wrapSpanContext(I4.INVALID_SPAN_CONTEXT):(o=I4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,uEa.toSpanOptions)(r),n),(0,Xyi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,eEi.suppressTracing)(n))),{span:new lEa.OpenTelemetrySpanWrapper(o),tracingContext:I4.trace.setSpan(n,o)}}withContext(e,r,...n){return I4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return dG.propagator.extract(I4.context.active(),{traceparent:e},I4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return dG.propagator.inject(e||I4.context.active(),r,I4.defaultTextMapSetter),r}};dG.OpenTelemetryInstrumenter=jAr});var nEi=I(uOe=>{"use strict";p();Object.defineProperty(uOe,"__esModule",{value:!0});uOe.AzureSdkInstrumentation=void 0;uOe.createAzureSdkInstrumentation=pEa;var rEi=(lAr(),Sa(cAr)),dEa=tEi(),fEa=qAr(),Uht=class extends rEi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",fEa.SDK_VERSION,Object.assign({},e))}init(){let e=new rEi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new dEa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};uOe.AzureSdkInstrumentation=Uht;function pEa(t={}){return new Uht(t)}a(pEa,"createAzureSdkInstrumentation")});var oEi=I(Qht=>{"use strict";p();Object.defineProperty(Qht,"__esModule",{value:!0});var iEi=(g3(),Sa(sQ));iEi.__exportStar(AAr(),Qht);iEi.__exportStar(nEi(),Qht)});var aEi=I(gR=>{"use strict";p();Object.defineProperty(gR,"__esModule",{value:!0});gR.enable=gR.azureCoreTracing=gR.AzureMonitorSymbol=void 0;var HAr=Sp();gR.AzureMonitorSymbol="Azure_Monitor_Tracer";var GAr="azure-coretracing",sEi=!1,hEa=a(function(t){if(sEi)return t;try{var e=(ali(),Sa(sli)),r=(co(),Sa(z5)),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 HAr.channel.publish(GAr,A),E},A},d[gR.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[gR.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 HAr.channel.publish(GAr,v),T},v},g[gR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(lAr(),Sa(cAr)),u=oEi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}sEi=!0}catch{}return t},"azureCoreTracingPatchFunction");gR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:hEa,publisherName:GAr};function mEa(){HAr.channel.registerMonkeyPatch("@azure/core-tracing",gR.azureCoreTracing)}a(mEa,"enable");gR.enable=mEa});var lEi=I(Nee=>{"use strict";p();Object.defineProperty(Nee,"__esModule",{value:!0});Nee.enable=Nee.bunyan=void 0;var cEi=Sp(),gEa=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)),cEi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");Nee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:gEa};function AEa(){cEi.channel.registerMonkeyPatch("bunyan",Nee.bunyan)}a(AEa,"enable");Nee.enable=AEa});var dEi=I(Mee=>{"use strict";p();Object.defineProperty(Mee,"__esModule",{value:!0});Mee.enable=Mee.console=void 0;var $Ar=Sp(),uEi=require("stream"),yEa=a(function(t){var e=new uEi.Writable,r=new uEi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return $Ar.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return $Ar.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:yEa};function EEa(){$Ar.channel.registerMonkeyPatch("console",Mee.console),require("console")}a(EEa,"enable");Mee.enable=EEa});var fEi=I(Oee=>{"use strict";p();Object.defineProperty(Oee,"__esModule",{value:!0});Oee.enable=Oee.mongoCore=void 0;var VAr=Sp(),_Ea=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]=VAr.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]=VAr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Oee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:_Ea};function vEa(){VAr.channel.registerMonkeyPatch("mongodb-core",Oee.mongoCore)}a(vEa,"enable");Oee.enable=vEa});var pEi=I(Sv=>{"use strict";p();var S0e=Sv&&Sv.__assign||function(){return S0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:CEa};Sv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:bEa};Sv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:TEa};function IEa(){ME.channel.registerMonkeyPatch("mongodb",Sv.mongo2),ME.channel.registerMonkeyPatch("mongodb",Sv.mongo3),ME.channel.registerMonkeyPatch("mongodb",Sv.mongo330)}a(IEa,"enable");Sv.enable=IEa});var mEi=I(Lee=>{"use strict";p();Object.defineProperty(Lee,"__esModule",{value:!0});Lee.enable=Lee.mysql=void 0;var qht=Sp(),hEi=require("path"),xEa=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]=qht.channel.bindToContext(h(_,E))):arguments[A]=qht.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(hEi.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;qht.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(hEi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Lee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:xEa};function wEa(){qht.channel.registerMonkeyPatch("mysql",Lee.mysql)}a(wEa,"enable");Lee.enable=wEa});var AEi=I(Bee=>{"use strict";p();Object.defineProperty(Bee,"__esModule",{value:!0});Bee.enable=Bee.postgresPool1=void 0;var gEi=Sp();function REa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=gEi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(REa,"postgresPool1PatchFunction");Bee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:REa};function kEa(){gEi.channel.registerMonkeyPatch("pg-pool",Bee.postgresPool1)}a(kEa,"enable");Bee.enable=kEa});var EEi=I(x4=>{"use strict";p();Object.defineProperty(x4,"__esModule",{value:!0});x4.enable=x4.postgres=x4.postgres6=void 0;var T0e=Sp(),yEi=require("events"),WAr="postgres";function PEa(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=T0e.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),T0e.channel.publish(WAr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof yEi.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(PEa,"postgres6PatchFunction");function DEa(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=T0e.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),T0e.channel.publish(WAr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof yEi.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(DEa,"postgresLatestPatchFunction");x4.postgres6={versionSpecifier:"6.*",patch:PEa};x4.postgres={versionSpecifier:">=7.* <=8.*",patch:DEa,publisherName:WAr};function NEa(){T0e.channel.registerMonkeyPatch("pg",x4.postgres6),T0e.channel.registerMonkeyPatch("pg",x4.postgres)}a(NEa,"enable");x4.enable=NEa});var _Ei=I(Fee=>{"use strict";p();Object.defineProperty(Fee,"__esModule",{value:!0});Fee.enable=Fee.redis=void 0;var zAr=Sp(),MEa=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=zAr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;zAr.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");Fee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:MEa};function OEa(){zAr.channel.registerMonkeyPatch("redis",Fee.redis)}a(OEa,"enable");Fee.enable=OEa});var vEi=I(B8=>{"use strict";p();var jht=B8&&B8.__assign||function(){return jht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:LEa};function BEa(){YAr.channel.registerMonkeyPatch("tedious",B8.tedious)}a(BEa,"enable");B8.enable=BEa});var CEi=I(qb=>{"use strict";p();var FEa=qb&&qb.__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)}})(),UEa=qb&&qb.__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");qb.winston3={versionSpecifier:"3.x",patch:qEa};qb.winston2={versionSpecifier:"2.x",patch:QEa};function jEa(){Hht.channel.registerMonkeyPatch("winston",qb.winston2),Hht.channel.registerMonkeyPatch("winston",qb.winston3)}a(jEa,"enable");qb.enable=jEa});var MEi=I(ku=>{"use strict";p();Object.defineProperty(ku,"__esModule",{value:!0});ku.enable=ku.tedious=ku.pgPool=ku.pg=ku.winston=ku.redis=ku.mysql=ku.mongodb=ku.mongodbCore=ku.console=ku.bunyan=ku.azuresdk=void 0;var bEi=aEi();ku.azuresdk=bEi;var SEi=lEi();ku.bunyan=SEi;var TEi=dEi();ku.console=TEi;var IEi=fEi();ku.mongodbCore=IEi;var xEi=pEi();ku.mongodb=xEi;var wEi=mEi();ku.mysql=wEi;var REi=AEi();ku.pgPool=REi;var kEi=EEi();ku.pg=kEi;var PEi=_Ei();ku.redis=PEi;var DEi=vEi();ku.tedious=DEi;var NEi=CEi();ku.winston=NEi;function HEa(){SEi.enable(),TEi.enable(),IEi.enable(),xEi.enable(),wEi.enable(),kEi.enable(),REi.enable(),PEi.enable(),NEi.enable(),bEi.enable(),DEi.enable()}a(HEa,"enable");ku.enable=HEa});var Vht=I(Uee=>{"use strict";p();Object.defineProperty(Uee,"__esModule",{value:!0});Uee.IsInitialized=void 0;Uee.registerContextPreservation=GEa;var KAr=Kl(),LEi=opt();Uee.IsInitialized=!LEi.JsonConfig.getInstance().noDiagnosticChannel;var JAr="DiagnosticChannel";if(Uee.IsInitialized){sD=MEi(),OEi=LEi.JsonConfig.getInstance().noPatchModules,Ght=OEi.split(","),ZAr={bunyan:sD.bunyan,console:sD.console,mongodb:sD.mongodb,mongodbCore:sD.mongodbCore,mysql:sD.mysql,redis:sD.redis,pg:sD.pg,pgPool:sD.pgPool,winston:sD.winston,azuresdk:sD.azuresdk};for($ht in ZAr)Ght.indexOf($ht)===-1&&(ZAr[$ht].enable(),KAr.info(JAr,"Subscribed to ".concat($ht," events")));Ght.length>0&&KAr.info(JAr,"Some modules will not be patched",Ght)}else KAr.info(JAr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var sD,OEi,Ght,ZAr,$ht;function GEa(t){if(Uee.IsInitialized){var e=Sp();e.channel.addContextPreservation(t)}}a(GEa,"registerContextPreservation")});var I0e=I((Gpp,BEi)=>{"use strict";p();BEi.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 cy=I((tyr,FEi)=>{"use strict";p();var pG=tyr&&tyr.__assign||function(){return pG=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"){Qee.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"){Qee.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+")",Qee.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 ryr=cy(),zEa=(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"|"+ryr.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=ryr.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=ryr.randomu32(),t})();UEi.exports=zEa});var Wht=I((Jpp,QEi)=>{"use strict";p();var ly=cy(),YEa=qee(),KEa=(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=ly.w3cTraceId(),this.spanId=ly.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=ly.w3cTraceId(),this.spanId=ly.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=ly.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=ly.w3cTraceId(),this.spanId=ly.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=ly.w3cTraceId(),this.spanId=ly.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=ly.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=ly.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=ly.w3cTraceId().substr(0,16),this.traceId=ly.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=YEa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=ly.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=ly.w3cTraceId(),this.spanId=ly.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=ly.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();QEi.exports=KEa});var nyr=I((ehp,qEi)=>{"use strict";p();var JEa=(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 ZEa=(function(){function t(){}return a(t,"Domain"),t})();jEi.exports=ZEa});var GEi=I((iyr,HEi)=>{"use strict";p();var XEa=iyr&&iyr.__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)}})(),e_a=F8(),t_a=(function(t){XEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(e_a);HEi.exports=t_a});var oyr=I((chp,$Ei)=>{"use strict";p();var r_a=(function(){function t(){}return a(t,"Base"),t})();$Ei.exports=r_a});var WEi=I((dhp,VEi)=>{"use strict";p();var n_a=(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})();VEi.exports=n_a});var YEi=I((syr,zEi)=>{"use strict";p();var i_a=syr&&syr.__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)}})(),o_a=oyr(),s_a=(function(t){i_a(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(o_a);zEi.exports=s_a});var cyr=I((ghp,KEi)=>{"use strict";p();var ayr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(ayr||(ayr={}));KEi.exports=ayr});var ZEi=I((yhp,JEi)=>{"use strict";p();var a_a=cyr(),c_a=(function(){function t(){this.kind=a_a.Measurement}return a(t,"DataPoint"),t})();JEi.exports=c_a});var e_i=I((vhp,XEi)=>{"use strict";p();var l_a=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();XEi.exports=l_a});var uyr=I((lyr,t_i)=>{"use strict";p();var u_a=lyr&&lyr.__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)}})(),d_a=F8(),f_a=(function(t){u_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(d_a);t_i.exports=f_a});var n_i=I((dyr,r_i)=>{"use strict";p();var p_a=dyr&&dyr.__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)}})(),h_a=F8(),m_a=(function(t){p_a(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})(h_a);r_i.exports=m_a});var o_i=I((whp,i_i)=>{"use strict";p();var g_a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();i_i.exports=g_a});var a_i=I((fyr,s_i)=>{"use strict";p();var A_a=fyr&&fyr.__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)}})(),y_a=F8(),E_a=(function(t){A_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(y_a);s_i.exports=E_a});var l_i=I((pyr,c_i)=>{"use strict";p();var __a=pyr&&pyr.__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)}})(),v_a=F8(),C_a=(function(t){__a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(v_a);c_i.exports=C_a});var d_i=I((hyr,u_i)=>{"use strict";p();var b_a=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)}})(),S_a=uyr(),T_a=(function(t){b_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(S_a);u_i.exports=T_a});var p_i=I((myr,f_i)=>{"use strict";p();var I_a=myr&&myr.__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)}})(),x_a=F8(),w_a=(function(t){I_a(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})(x_a);f_i.exports=w_a});var m_i=I((gyr,h_i)=>{"use strict";p();var R_a=gyr&&gyr.__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)}})(),k_a=F8(),P_a=(function(t){R_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(k_a);h_i.exports=P_a});var A_i=I((qhp,g_i)=>{"use strict";p();var Ayr;(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"})(Ayr||(Ayr={}));g_i.exports=Ayr});var E_i=I((Hhp,y_i)=>{"use strict";p();var D_a=(function(){function t(){}return a(t,"StackFrame"),t})();y_i.exports=D_a});var yyr=I(_m=>{"use strict";p();Object.defineProperty(_m,"__esModule",{value:!0});_m.AvailabilityData=GEi();_m.Base=oyr();_m.ContextTagKeys=WEi();_m.Data=YEi();_m.DataPoint=ZEi();_m.DataPointType=cyr();_m.Domain=F8();_m.Envelope=e_i();_m.EventData=uyr();_m.ExceptionData=n_i();_m.ExceptionDetails=o_i();_m.MessageData=a_i();_m.MetricData=l_i();_m.PageViewData=d_i();_m.RemoteDependencyData=p_i();_m.RequestData=m_i();_m.SeverityLevel=A_i();_m.StackFrame=E_i()});var __i=I(dOe=>{"use strict";p();Object.defineProperty(dOe,"__esModule",{value:!0});dOe.RemoteDependencyDataConstants=void 0;dOe.domainSupportsProperties=M_a;var jee=yyr(),N_a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();dOe.RemoteDependencyDataConstants=N_a;function M_a(t){return"properties"in t||t instanceof jee.EventData||t instanceof jee.ExceptionData||t instanceof jee.MessageData||t instanceof jee.MetricData||t instanceof jee.PageViewData||t instanceof jee.RemoteDependencyData||t instanceof jee.RequestData}a(M_a,"domainSupportsProperties")});var C_i=I(v_i=>{"use strict";p();Object.defineProperty(v_i,"__esModule",{value:!0})});var S_i=I(b_i=>{"use strict";p();Object.defineProperty(b_i,"__esModule",{value:!0})});var I_i=I(T_i=>{"use strict";p();Object.defineProperty(T_i,"__esModule",{value:!0})});var w_i=I(x_i=>{"use strict";p();Object.defineProperty(x_i,"__esModule",{value:!0})});var k_i=I(R_i=>{"use strict";p();Object.defineProperty(R_i,"__esModule",{value:!0})});var D_i=I(P_i=>{"use strict";p();Object.defineProperty(P_i,"__esModule",{value:!0})});var M_i=I(N_i=>{"use strict";p();Object.defineProperty(N_i,"__esModule",{value:!0})});var L_i=I(O_i=>{"use strict";p();Object.defineProperty(O_i,"__esModule",{value:!0})});var F_i=I(B_i=>{"use strict";p();Object.defineProperty(B_i,"__esModule",{value:!0})});var Q_i=I(U_i=>{"use strict";p();Object.defineProperty(U_i,"__esModule",{value:!0})});var j_i=I(q_i=>{"use strict";p();Object.defineProperty(q_i,"__esModule",{value:!0})});var G_i=I(H_i=>{"use strict";p();Object.defineProperty(H_i,"__esModule",{value:!0})});var $_i=I(hG=>{"use strict";p();Object.defineProperty(hG,"__esModule",{value:!0});hG.TelemetryType=hG.TelemetryTypeString=void 0;hG.telemetryTypeToBaseType=O_a;hG.baseTypeToTelemetryType=L_a;function O_a(t){switch(t){case Gg.Event:return"EventData";case Gg.Exception:return"ExceptionData";case Gg.Trace:return"MessageData";case Gg.Metric:return"MetricData";case Gg.Request:return"RequestData";case Gg.Dependency:return"RemoteDependencyData";case Gg.Availability:return"AvailabilityData";case Gg.PageView:return"PageViewData"}}a(O_a,"telemetryTypeToBaseType");function L_a(t){switch(t){case"EventData":return Gg.Event;case"ExceptionData":return Gg.Exception;case"MessageData":return Gg.Trace;case"MetricData":return Gg.Metric;case"RequestData":return Gg.Request;case"RemoteDependencyData":return Gg.Dependency;case"AvailabilityData":return Gg.Availability;case"PageViewData":return Gg.PageView}}a(L_a,"baseTypeToTelemetryType");hG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Gg;(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"})(Gg||(hG.TelemetryType=Gg={}))});var V_i=I(S0=>{"use strict";p();var B_a=S0&&S0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WT=S0&&S0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B_a(e,t,r)};Object.defineProperty(S0,"__esModule",{value:!0});WT(C_i(),S0);WT(S_i(),S0);WT(I_i(),S0);WT(w_i(),S0);WT(k_i(),S0);WT(D_i(),S0);WT(M_i(),S0);WT(L_i(),S0);WT(F_i(),S0);WT(Q_i(),S0);WT(j_i(),S0);WT(G_i(),S0);WT($_i(),S0)});var z_i=I(W_i=>{"use strict";p();Object.defineProperty(W_i,"__esModule",{value:!0})});var K_i=I(Y_i=>{"use strict";p();Object.defineProperty(Y_i,"__esModule",{value:!0})});var Z_i=I(J_i=>{"use strict";p();Object.defineProperty(J_i,"__esModule",{value:!0})});var evi=I(X_i=>{"use strict";p();Object.defineProperty(X_i,"__esModule",{value:!0})});var rvi=I(tvi=>{"use strict";p();Object.defineProperty(tvi,"__esModule",{value:!0})});var ivi=I(nvi=>{"use strict";p();Object.defineProperty(nvi,"__esModule",{value:!0})});var svi=I(ovi=>{"use strict";p();Object.defineProperty(ovi,"__esModule",{value:!0})});var cvi=I(avi=>{"use strict";p();Object.defineProperty(avi,"__esModule",{value:!0})});var lvi=I(jb=>{"use strict";p();var F_a=jb&&jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=jb&&jb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&F_a(e,t,r)};Object.defineProperty(jb,"__esModule",{value:!0});mG(z_i(),jb);mG(K_i(),jb);mG(Z_i(),jb);mG(evi(),jb);mG(rvi(),jb);mG(ivi(),jb);mG(svi(),jb);mG(cvi(),jb)});var OE=I(w4=>{"use strict";p();var U_a=w4&&w4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zht=w4&&w4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U_a(e,t,r)};Object.defineProperty(w4,"__esModule",{value:!0});zht(__i(),w4);zht(yyr(),w4);zht(V_i(),w4);zht(lvi(),w4)});var Eyr=I((Ymp,uvi)=>{"use strict";p();var Q_a=(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 aD;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 uy;(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"})(uy||(jr.QuickPulseCounter=uy={}));var fOe;(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"})(fOe||(jr.PerformanceCounter=fOe={}));var dvi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(dvi||(jr.MetricId=dvi={}));jr.PerformanceToQuickPulseCounter=(aD={},aD[fOe.PROCESSOR_TIME]=uy.PROCESSOR_TIME,aD[fOe.REQUEST_RATE]=uy.REQUEST_RATE,aD[fOe.REQUEST_DURATION]=uy.REQUEST_DURATION,aD[uy.COMMITTED_BYTES]=uy.COMMITTED_BYTES,aD[uy.REQUEST_FAILURE_RATE]=uy.REQUEST_FAILURE_RATE,aD[uy.DEPENDENCY_RATE]=uy.DEPENDENCY_RATE,aD[uy.DEPENDENCY_FAILURE_RATE]=uy.DEPENDENCY_FAILURE_RATE,aD[uy.DEPENDENCY_DURATION]=uy.DEPENDENCY_DURATION,aD[uy.EXCEPTION_RATE]=uy.EXCEPTION_RATE,aD);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 fvi;(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"})(fvi||(jr.StatsbeatFeature=fvi={}));var pvi;(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"})(pvi||(jr.StatsbeatInstrumentation=pvi={}));var hvi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(hvi||(jr.StatsbeatFeatureType=hvi={}));var mvi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(mvi||(jr.StatsbeatNetworkCategory=mvi={}));var gvi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(gvi||(jr.HttpRequestCookieNames=gvi={}));var Avi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(Avi||(jr.AttachTypePrefix=Avi={}));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 byr=I((Cyr,yvi)=>{"use strict";p();var q_a=Cyr&&Cyr.__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)}})(),Yht=require("url"),j_a=OE(),_yr=cy(),zT=I0e(),H_a=Eyr(),gG=qee(),G_a=nyr(),vyr=Wht(),$_a=Kl(),Kht=Ad(),V_a=(function(t){q_a(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 Yht.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(Kht.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Kht.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Kht.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 Yht.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 Yht.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=Yht.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===Kht.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",$_a.warn("Could not decode the auth cookie with error: ",_yr.dumpObj(s))}var o=e.parseId(_yr.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=_yr.getCorrelationContextTarget(r,zT.requestContextSourceKey),r.headers){var o=r.headers[zT.traceStateHeader]?r.headers[zT.traceStateHeader].toString():null,s=r.headers[zT.traceparentHeader]?r.headers[zT.traceparentHeader].toString():null,c=r.headers[zT.requestIdHeader]?r.headers[zT.requestIdHeader].toString():null,l=r.headers[zT.parentIdHeader]?r.headers[zT.parentIdHeader].toString():null,u=r.headers[zT.rootIdHeader]?r.headers[zT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[zT.correlationContextHeader]?r.headers[zT.correlationContextHeader].toString():null,gG.w3cEnabled&&(s||o)?(this.traceparent=new vyr(s?s.toString():null),this.tracestate=s&&o&&new G_a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?gG.w3cEnabled?(this.traceparent=new vyr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=gG.generateRequestId(this.parentId),this.operationId=gG.getRootId(this.requestId)):gG.w3cEnabled?(this.traceparent=new vyr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=gG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=gG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=gG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new j_a.ContextTagKeys,e})(H_a);yvi.exports=V_a});var Ovi=I((Eo,Mvi)=>{p();Eo=Mvi.exports=Oa;var fl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?fl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):fl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var pOe=256,Jht=Number.MAX_SAFE_INTEGER||9007199254740991,Syr=16,W_a=pOe-6,hOe=Eo.re=[],Pu=Eo.safeRe=[],tr=Eo.src=[],ga=0,Ryr="[a-zA-Z0-9-]",Tyr=[["\\s",1],["\\d",pOe],[Ryr,W_a]];function nmt(t){for(var e=0;e)?=?)";var Zht=ga++;tr[Zht]=tr[R0e]+"|x|X|\\*";var Xht=ga++;tr[Xht]=tr[w0e]+"|x|X|\\*";var Hee=ga++;tr[Hee]="[v=\\s]*("+tr[Xht]+")(?:\\.("+tr[Xht]+")(?:\\.("+tr[Xht]+")(?:"+tr[Pyr]+")?"+tr[gOe]+"?)?)?";var P0e=ga++;tr[P0e]="[v=\\s]*("+tr[Zht]+")(?:\\.("+tr[Zht]+")(?:\\.("+tr[Zht]+")(?:"+tr[Dyr]+")?"+tr[gOe]+"?)?)?";var bvi=ga++;tr[bvi]="^"+tr[M0e]+"\\s*"+tr[Hee]+"$";var Svi=ga++;tr[Svi]="^"+tr[M0e]+"\\s*"+tr[P0e]+"$";var Tvi=ga++;tr[Tvi]="(?:^|[^\\d])(\\d{1,"+Syr+"})(?:\\.(\\d{1,"+Syr+"}))?(?:\\.(\\d{1,"+Syr+"}))?(?:$|[^\\d])";var imt=ga++;tr[imt]="(?:~>?)";var D0e=ga++;tr[D0e]="(\\s*)"+tr[imt]+"\\s+";hOe[D0e]=new RegExp(tr[D0e],"g");Pu[D0e]=new RegExp(nmt(tr[D0e]),"g");var z_a="$1~",Ivi=ga++;tr[Ivi]="^"+tr[imt]+tr[Hee]+"$";var xvi=ga++;tr[xvi]="^"+tr[imt]+tr[P0e]+"$";var omt=ga++;tr[omt]="(?:\\^)";var N0e=ga++;tr[N0e]="(\\s*)"+tr[omt]+"\\s+";hOe[N0e]=new RegExp(tr[N0e],"g");Pu[N0e]=new RegExp(nmt(tr[N0e]),"g");var Y_a="$1^",wvi=ga++;tr[wvi]="^"+tr[omt]+tr[Hee]+"$";var Rvi=ga++;tr[Rvi]="^"+tr[omt]+tr[P0e]+"$";var Lyr=ga++;tr[Lyr]="^"+tr[M0e]+"\\s*("+Myr+")$|^$";var Byr=ga++;tr[Byr]="^"+tr[M0e]+"\\s*("+Cvi+")$|^$";var Gee=ga++;tr[Gee]="(\\s*)"+tr[M0e]+"\\s*("+Myr+"|"+tr[Hee]+")";hOe[Gee]=new RegExp(tr[Gee],"g");Pu[Gee]=new RegExp(nmt(tr[Gee]),"g");var K_a="$1$2$3",kvi=ga++;tr[kvi]="^\\s*("+tr[Hee]+")\\s+-\\s+("+tr[Hee]+")\\s*$";var Pvi=ga++;tr[Pvi]="^\\s*("+tr[P0e]+")\\s+-\\s+("+tr[P0e]+")\\s*$";var Dvi=ga++;tr[Dvi]="(<|>)?=?\\s*\\*";for(R4=0;R4pOe)return null;var r=e.loose?Pu[Oyr]:Pu[Nyr];if(!r.test(t))return null;try{return new Oa(t,e)}catch{return null}}a($ee,"parse");Eo.valid=J_a;function J_a(t,e){var r=$ee(t,e);return r?r.version:null}a(J_a,"valid");Eo.clean=Z_a;function Z_a(t,e){var r=$ee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Z_a,"clean");Eo.SemVer=Oa;function Oa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Oa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>pOe)throw new TypeError("version is longer than "+pOe+" characters");if(!(this instanceof Oa))return new Oa(t,e);fl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Pu[Oyr]:Pu[Nyr]);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>Jht||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Jht||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Jht||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=X_a;function X_a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Oa(t,r).inc(e,n).version}catch{return null}}a(X_a,"inc");Eo.diff=eva;function eva(t,e){if(Fyr(t,e))return null;var r=$ee(t),n=$ee(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(eva,"diff");Eo.compareIdentifiers=k0e;var Evi=/^[0-9]+$/;function k0e(t,e){var r=Evi.test(t),n=Evi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(mOe,"gt");Eo.lt=emt;function emt(t,e,r){return U8(t,e,r)<0}a(emt,"lt");Eo.eq=Fyr;function Fyr(t,e,r){return U8(t,e,r)===0}a(Fyr,"eq");Eo.neq=Nvi;function Nvi(t,e,r){return U8(t,e,r)!==0}a(Nvi,"neq");Eo.gte=Uyr;function Uyr(t,e,r){return U8(t,e,r)>=0}a(Uyr,"gte");Eo.lte=Qyr;function Qyr(t,e,r){return U8(t,e,r)<=0}a(Qyr,"lte");Eo.cmp=tmt;function tmt(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 Fyr(t,r,n);case"!=":return Nvi(t,r,n);case">":return mOe(t,r,n);case">=":return Uyr(t,r,n);case"<":return emt(t,r,n);case"<=":return Qyr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(tmt,"cmp");Eo.Comparator=AR;function AR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof AR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof AR))return new AR(t,e);t=t.trim().split(/\s+/).join(" "),fl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===AOe?this.value="":this.value=this.operator+this.semver.version,fl("comp",this)}a(AR,"Comparator");var AOe={};AR.prototype.parse=function(t){var e=this.options.loose?Pu[Lyr]:Pu[Byr],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 Oa(r[2],this.options.loose):this.semver=AOe};AR.prototype.toString=function(){return this.value};AR.prototype.test=function(t){return fl("Comparator.test",t,this.options.loose),this.semver===AOe?!0:(typeof t=="string"&&(t=new Oa(t,this.options)),tmt(t,this.operator,this.semver,this.options))};AR.prototype.intersects=function(t,e){if(!(t instanceof AR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Pf(t.value,e),rmt(this.value,r,e);if(t.operator==="")return r=new Pf(this.value,e),rmt(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=tmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=tmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Pf;function Pf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Pf(t.raw,e);if(t instanceof AR)return new Pf(t.value,e);if(!(this instanceof Pf))return new Pf(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(Pf,"Range");Pf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Pf.prototype.toString=function(){return this.range};Pf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Pu[Pvi]:Pu[kvi];t=t.replace(r,yva),fl("hyphen replace",t),t=t.replace(Pu[Gee],K_a),fl("comparator trim",t,Pu[Gee]),t=t.replace(Pu[D0e],z_a),t=t.replace(Pu[N0e],Y_a);var n=e?Pu[Lyr]:Pu[Byr],o=t.split(" ").map(function(s){return uva(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 AR(s,this.options)},this),o};Pf.prototype.intersects=function(t,e){if(!(t instanceof Pf))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=lva;function lva(t,e){return new Pf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(lva,"toComparators");function uva(t,e){return fl("comp",t,e),t=pva(t,e),fl("caret",t),t=dva(t,e),fl("tildes",t),t=mva(t,e),fl("xrange",t),t=Ava(t,e),fl("stars",t),t}a(uva,"parseComparator");function Tv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Tv,"isX");function dva(t,e){return t.trim().split(/\s+/).map(function(r){return fva(r,e)}).join(" ")}a(dva,"replaceTildes");function fva(t,e){var r=e.loose?Pu[xvi]:Pu[Ivi];return t.replace(r,function(n,o,s,c,l){fl("tilde",t,n,o,s,c,l);var u;return Tv(o)?u="":Tv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Tv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(fl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",fl("tilde return",u),u})}a(fva,"replaceTilde");function pva(t,e){return t.trim().split(/\s+/).map(function(r){return hva(r,e)}).join(" ")}a(pva,"replaceCarets");function hva(t,e){fl("caret",t,e);var r=e.loose?Pu[Rvi]:Pu[wvi];return t.replace(r,function(n,o,s,c,l){fl("caret",t,n,o,s,c,l);var u;return Tv(o)?u="":Tv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Tv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(fl("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"):(fl("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"),fl("caret return",u),u})}a(hva,"replaceCaret");function mva(t,e){return fl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return gva(r,e)}).join(" ")}a(mva,"replaceXRanges");function gva(t,e){t=t.trim();var r=e.loose?Pu[Svi]:Pu[bvi];return t.replace(r,function(n,o,s,c,l,u){fl("xRange",t,n,o,s,c,l,u);var d=Tv(s),f=d||Tv(c),h=f||Tv(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"),fl("xRange return",n),n})}a(gva,"replaceXRange");function Ava(t,e){return fl("replaceStars",t,e),t.trim().replace(Pu[Dvi],"")}a(Ava,"replaceStars");function yva(t,e,r,n,o,s,c,l,u,d,f,h,m){return Tv(r)?e="":Tv(n)?e=">="+r+".0.0":Tv(o)?e=">="+r+"."+n+".0":e=">="+e,Tv(u)?l="":Tv(d)?l="<"+(+u+1)+".0.0":Tv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(yva,"hyphenReplace");Pf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Oa(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(Eva,"testSet");Eo.satisfies=rmt;function rmt(t,e,r){try{e=new Pf(e,r)}catch{return!1}return e.test(t)}a(rmt,"satisfies");Eo.maxSatisfying=_va;function _va(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Oa(n,r))}),n}a(_va,"maxSatisfying");Eo.minSatisfying=vva;function vva(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Oa(n,r))}),n}a(vva,"minSatisfying");Eo.minVersion=Cva;function Cva(t,e){t=new Pf(t,e);var r=new Oa("0.0.0");if(t.test(r)||(r=new Oa("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||mOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(Cva,"minVersion");Eo.validRange=bva;function bva(t,e){try{return new Pf(t,e).range||"*"}catch{return null}}a(bva,"validRange");Eo.ltr=Sva;function Sva(t,e,r){return qyr(t,e,"<",r)}a(Sva,"ltr");Eo.gtr=Tva;function Tva(t,e,r){return qyr(t,e,">",r)}a(Tva,"gtr");Eo.outside=qyr;function qyr(t,e,r,n){t=new Oa(t,n),e=new Pf(e,n);var o,s,c,l,u;switch(r){case">":o=mOe,s=Qyr,c=emt,l=">",u=">=";break;case"<":o=emt,s=Uyr,c=mOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(rmt(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(qyr,"outside");Eo.prerelease=Iva;function Iva(t,e){var r=$ee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(Iva,"prerelease");Eo.intersects=xva;function xva(t,e,r){return t=new Pf(t,r),e=new Pf(e,r),t.intersects(e)}a(xva,"intersects");Eo.coerce=wva;function wva(t){if(t instanceof Oa)return t;if(typeof t!="string")return null;var e=t.match(Pu[Tvi]);return e==null?null:$ee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(wva,"coerce")});var cmt=I((i0p,Uvi)=>{"use strict";p();var Bvi=p0e(),O0e=Bvi.wrap,smt=Bvi.unwrap,Q8="wrap@before";function amt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(amt,"defineProperty");function Rva(t,e){for(var r=e.length,n=0;n0&&Rva(t,o)}a(kva,"_findAndProcess");function Lvi(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 Pc=require("util"),q8=require("assert"),Pva=cmt(),yd=require("async_hooks"),yOe="cls@contexts",EOe="error@context",Df=process.env.DEBUG_CLS_HOOKED,kc=-1;jvi.exports={getNamespace:Qvi,createNamespace:Dva,destroyNamespace:qvi,reset:Nva,ERROR_SYMBOL:EOe};function yR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(yR,"Namespace");yR.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,Df){let n=" ".repeat(this._indent<0?0:this._indent);Kd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");yR.prototype.get=a(function(e){if(!this.active){if(Df){let r=yd.currentId(),n=yd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Kd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(Df){let r=yd.executionAsyncId(),n=yd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Kd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Kd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Pc.inspect(this.active)}`)}return this.active[e]},"get");yR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=kc,Df){let r=yd.executionAsyncId(),n=yd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Kd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Pc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");yR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(Df){let n=yd.triggerAsyncId(),o=yd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Kd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Pc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[EOe]=r),n}finally{if(Df){let n=yd.triggerAsyncId(),o=yd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Kd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Pc.inspect(r)}`)}this.exit(r)}},"run");yR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");yR.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 Df&&Kd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),n.then(o=>(Df&&Kd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[EOe]=r,Df&&Kd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o})},"runPromise");yR.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[EOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");yR.prototype.enter=a(function(e){if(q8.ok(e,"context must be provided for entering"),Df){let r=yd.executionAsyncId(),n=yd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Kd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Pc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");yR.prototype.exit=a(function(e){if(q8.ok(e,"context must be provided for exiting"),Df){let n=yd.executionAsyncId(),o=yd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Kd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${kc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Pc.inspect(e)}`)}if(this.active===e){q8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(Df&&Kd("??ERROR?? context exiting but not entered - ignoring: "+Pc.inspect(e)),q8.ok(r>=0,`context not currently entered; can't exit. `+Pc.inspect(this)+` -`+Pc.inspect(e))):(U8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");gR.prototype.bindEmitter=a(function(e){U8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[pOe]||(c[pOe]=Object.create(null)),c[pOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[pOe]))return c;let l=c,u=c[pOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),mva(e,o,s)},"bindEmitter");gR.prototype.fromException=a(function(e){return e[hOe]},"fromException");function Dvi(t){return process.namespaces[t]}a(Dvi,"getNamespace");function gva(t){U8.ok(t,"namespace must be given a name."),kf&&zd(`NS-CREATING NAMESPACE (${t})`);let e=new gR(t);return e.id=kc,gd.createHook({init(n,o,s,c){if(kc=gd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),kf){let l=" ".repeat(e._indent<0?0:e._indent);zd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kc===0){let l=gd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(kf&&o==="PROMISE"){zd(Pc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);zd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Pc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}e.exit(o)}else if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}},destroy(n){if(kc=gd.executionAsyncId(),kf){let o=gd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);zd(`${s}DESTROY (${t}) currentUid:${kc} asyncId:${n} triggerId:${o} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(e._contexts.get(kc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(gva,"createNamespace");function Nvi(t){let e=Dvi(t);U8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),U8.ok(e.id,"don't assign to process.namespaces directly! "+Pc.inspect(e)),process.namespaces[t]=null}a(Nvi,"destroyNamespace");function Ava(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Nvi(t)}),process.namespaces=Object.create(null)}a(Ava,"reset");process.namespaces={};function zd(...t){kf&&process._rawDebug(`${Pc.format(...t)}`)}a(zd,"debug2")});var Bvi=I((jmp,Lvi)=>{"use strict";p();function yva(){}a(yva,"NextTickWrap");Lvi.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 Uvi=I(($mp,Fvi)=>{"use strict";p();function Eva(){}a(Eva,"PromiseWrap");Fvi.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 Eva,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 qvi=I((zmp,Qvi)=>{"use strict";p();var WT=require("timers");function _va(){}a(_va,"TimeoutWrap");function vva(){}a(vva,"IntervalWrap");function Cva(){}a(Cva,"ImmediateWrap");var bva=new Map,Sva=new Map,Tva=new Map,Fyr=null,Uyr=!1;Qvi.exports=a(function(){Qyr(this._hooks,this._state,"setTimeout","clearTimeout",_va,bva,!0),Qyr(this._hooks,this._state,"setInterval","clearInterval",vva,Sva,!1),Qyr(this._hooks,this._state,"setImmediate","clearImmediate",Cva,Tva,!0),global.setTimeout=WT.setTimeout,global.setInterval=WT.setInterval,global.setImmediate=WT.setImmediate,global.clearTimeout=WT.clearTimeout,global.clearInterval=WT.clearInterval,global.clearImmediate=WT.clearImmediate},"patch");function Qyr(t,e,r,n,o,s,c){let l=WT[r],u=WT[n];WT[r]=function(){if(!e.enabled)return l.apply(WT,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),Fyr=null,(c||Uyr)&&(Uyr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(WT,d),s.set(g,m),g},WT[n]=function(d){if(Fyr===d&&d!==null)Uyr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(WT,arguments)}}a(Qyr,"patchTimer")});var qyr=I((Jmp,Iva)=>{Iva.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 Gvi=I((Zmp,Hvi)=>{"use strict";p();var gOe=process.binding("async_wrap"),xva=gOe.Providers.TIMERWRAP,jvi={nextTick:Bvi(),promise:Uvi(),timers:qvi()},mOe=new Set;function wva(){this.enabled=!1,this.counter=0}a(wva,"State");function jyr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===xva){mOe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!mOe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!mOe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(mOe.has(o)){mOe.delete(o);return}for(let s of n)s(o)}}a(jyr,"Hooks");jyr.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 omt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(omt,"removeElement");jyr.prototype.remove=function(t){t.init&&omt(this.initFns,t.init),t.pre&&omt(this.preFns,t.pre),t.post&&omt(this.postFns,t.post),t.destroy&&omt(this.destroyFns,t.destroy)};function AOe(){this._state=new wva,this._hooks=new jyr,this.version=qyr().version,this.providers=gOe.Providers;for(let t of Object.keys(jvi))jvi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),gOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(AOe,"AsyncHook");Hvi.exports=AOe;AOe.prototype.addHooks=function(t){this._hooks.add(t)};AOe.prototype.removeHooks=function(t){this._hooks.remove(t)};AOe.prototype.enable=function(){this._state.enabled=!0,gOe.enable()};AOe.prototype.disable=function(){this._state.enabled=!1,gOe.disable()}});var Hyr=I((t0p,Rva)=>{Rva.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 Vvi=I((r0p,$vi)=>{p();function kva(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(kva,"FormatErrorString");$vi.exports=a(function(e,r){var n=[];n.push(kva(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var Kvi=I((o0p,Yvi)=>{p();var smt=Vvi();function zvi(){this.extend=new yOe,this.filter=new yOe,this.format=new EOe,this.version=Hyr().version}a(zvi,"stackChain");var $yr=!1;zvi.prototype.callSite=a(function t(e){e||(e={}),$yr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return $yr=!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 pG=new zvi;function yOe(){this._modifiers=[]}a(yOe,"TraceModifier");yOe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Hyr().version)Vyr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Vyr.exports=global._stackChain=Kvi()});var Jvi=I((u0p,zyr)=>{"use strict";p();var Dva=Gvi();if(global._asyncHook)if(global._asyncHook.version===qyr().version)zyr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Wyr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),zyr.exports=global._asyncHook=new Dva});var nCi=I((f0p,rCi)=>{"use strict";p();var hh=require("util"),Q8=require("assert"),Nva=imt(),M0e=Jvi(),_Oe="cls@contexts",vOe="error@context",Xvi=[];for(let t in M0e.providers)Xvi[M0e.providers[t]]=t;var bp=process.env.DEBUG_CLS_HOOKED,Em=-1;rCi.exports={getNamespace:eCi,createNamespace:Mva,destroyNamespace:tCi,reset:Ova,ERROR_SYMBOL:vOe};function AR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(AR,"Namespace");AR.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 bp&&ph(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]=r,r},"set");AR.prototype.get=a(function(e){if(!this.active){bp&&ph(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0));return}return bp&&ph(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]},"get");AR.prototype.createContext=a(function(){bp&&ph(" CREATING Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" active:"+hh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Em,bp&&ph(" CREATED Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" context:"+hh.inspect(e,!0,2,!0)),e},"createContext");AR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return bp&&ph(" BEFORE RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),e(r),r}catch(n){throw n&&(n[vOe]=r),n}finally{bp&&ph(" AFTER RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r)}},"run");AR.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");AR.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 bp&&ph(" BEFORE runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),n.then(o=>(bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[vOe]=r,bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o})},"runPromise");AR.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[vOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");AR.prototype.enter=a(function(e){Q8.ok(e,"context must be provided for entering"),bp&&ph(" ENTER "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this._set.push(this.active),this.active=e},"enter");AR.prototype.exit=a(function(e){if(Q8.ok(e,"context must be provided for exiting"),bp&&ph(" EXIT "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this.active===e){Q8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(bp&&ph("??ERROR?? context exiting but not entered - ignoring: "+hh.inspect(e)),Q8.ok(r>=0,`context not currently entered; can't exit. -`+hh.inspect(this)+` -`+hh.inspect(e))):(Q8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");AR.prototype.bindEmitter=a(function(e){Q8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[_Oe]||(c[_Oe]=Object.create(null)),c[_Oe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[_Oe]))return c;let l=c,u=c[_Oe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Nva(e,o,s)},"bindEmitter");AR.prototype.fromException=a(function(e){return e[vOe]},"fromException");function eCi(t){return process.namespaces[t]}a(eCi,"getNamespace");function Mva(t){Q8.ok(t,"namespace must be given a name."),bp&&ph("CREATING NAMESPACE "+t);let e=new AR(t);return e.id=Em,M0e.addHooks({init(r,n,o,s,c){Em=r,s?(e._contexts.set(r,e._contexts.get(s)),bp&&ph("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(Em,e.active),bp&&ph("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+Xvi[o]+" active:"+hh.inspect(e.active,!0))},pre(r,n){Em=r;let o=e._contexts.get(r);o?(bp&&ph(" PRE "+t+" uid:"+r+" handle:"+amt(n)+" context:"+hh.inspect(o)),e.enter(o)):bp&&ph(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+amt(n))},post(r,n){Em=r;let o=e._contexts.get(r);o?(bp&&ph(" POST "+t+" uid:"+r+" handle:"+amt(n)+" context:"+hh.inspect(o)),e.exit(o)):bp&&ph(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+amt(n))},destroy(r){Em=r,bp&&ph("DESTROY "+t+" uid:"+r+" context:"+hh.inspect(e._contexts.get(Em))+" active:"+hh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Mva,"createNamespace");function tCi(t){let e=eCi(t);Q8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),Q8.ok(e.id,"don't assign to process.namespaces directly! "+hh.inspect(e)),process.namespaces[t]=null}a(tCi,"destroyNamespace");function Ova(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){tCi(t)}),process.namespaces=Object.create(null)}a(Ova,"reset");process.namespaces={};M0e._state&&!M0e._state.enabled&&M0e.enable();function ph(t){process.env.DEBUG&&process._rawDebug(t)}a(ph,"debug2");function amt(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(amt,"getFunctionName");if(bp){Yyr=Wyr();for(Zvi in Yyr.filter._modifiers)Yyr.filter.deattach(Zvi)}var Yyr,Zvi});var iCi=I((m0p,Kyr)=>{"use strict";p();var Lva=xvi();process&&Lva.gte(process.versions.node,"8.0.0")?Kyr.exports=Ovi():Kyr.exports=nCi()});var vCi=I((Eo,_Ci)=>{p();Eo=_Ci.exports=Oa;var fl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?fl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):fl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var COe=256,cmt=Number.MAX_SAFE_INTEGER||9007199254740991,Jyr=16,Bva=COe-6,bOe=Eo.re=[],Du=Eo.safeRe=[],nr=Eo.src=[],ga=0,rEr="[a-zA-Z0-9-]",Zyr=[["\\s",1],["\\d",COe],[rEr,Bva]];function hmt(t){for(var e=0;e)?=?)";var lmt=ga++;nr[lmt]=nr[L0e]+"|x|X|\\*";var umt=ga++;nr[umt]=nr[O0e]+"|x|X|\\*";var $ee=ga++;nr[$ee]="[v=\\s]*("+nr[umt]+")(?:\\.("+nr[umt]+")(?:\\.("+nr[umt]+")(?:"+nr[iEr]+")?"+nr[TOe]+"?)?)?";var F0e=ga++;nr[F0e]="[v=\\s]*("+nr[lmt]+")(?:\\.("+nr[lmt]+")(?:\\.("+nr[lmt]+")(?:"+nr[oEr]+")?"+nr[TOe]+"?)?)?";var lCi=ga++;nr[lCi]="^"+nr[q0e]+"\\s*"+nr[$ee]+"$";var uCi=ga++;nr[uCi]="^"+nr[q0e]+"\\s*"+nr[F0e]+"$";var dCi=ga++;nr[dCi]="(?:^|[^\\d])(\\d{1,"+Jyr+"})(?:\\.(\\d{1,"+Jyr+"}))?(?:\\.(\\d{1,"+Jyr+"}))?(?:$|[^\\d])";var mmt=ga++;nr[mmt]="(?:~>?)";var U0e=ga++;nr[U0e]="(\\s*)"+nr[mmt]+"\\s+";bOe[U0e]=new RegExp(nr[U0e],"g");Du[U0e]=new RegExp(hmt(nr[U0e]),"g");var Fva="$1~",fCi=ga++;nr[fCi]="^"+nr[mmt]+nr[$ee]+"$";var pCi=ga++;nr[pCi]="^"+nr[mmt]+nr[F0e]+"$";var gmt=ga++;nr[gmt]="(?:\\^)";var Q0e=ga++;nr[Q0e]="(\\s*)"+nr[gmt]+"\\s+";bOe[Q0e]=new RegExp(nr[Q0e],"g");Du[Q0e]=new RegExp(hmt(nr[Q0e]),"g");var Uva="$1^",hCi=ga++;nr[hCi]="^"+nr[gmt]+nr[$ee]+"$";var mCi=ga++;nr[mCi]="^"+nr[gmt]+nr[F0e]+"$";var lEr=ga++;nr[lEr]="^"+nr[q0e]+"\\s*("+aEr+")$|^$";var uEr=ga++;nr[uEr]="^"+nr[q0e]+"\\s*("+cCi+")$|^$";var Vee=ga++;nr[Vee]="(\\s*)"+nr[q0e]+"\\s*("+aEr+"|"+nr[$ee]+")";bOe[Vee]=new RegExp(nr[Vee],"g");Du[Vee]=new RegExp(hmt(nr[Vee]),"g");var Qva="$1$2$3",gCi=ga++;nr[gCi]="^\\s*("+nr[$ee]+")\\s+-\\s+("+nr[$ee]+")\\s*$";var ACi=ga++;nr[ACi]="^\\s*("+nr[F0e]+")\\s+-\\s+("+nr[F0e]+")\\s*$";var yCi=ga++;nr[yCi]="(<|>)?=?\\s*\\*";for(R4=0;R4COe)return null;var r=e.loose?Du[cEr]:Du[sEr];if(!r.test(t))return null;try{return new Oa(t,e)}catch{return null}}a(Wee,"parse");Eo.valid=qva;function qva(t,e){var r=Wee(t,e);return r?r.version:null}a(qva,"valid");Eo.clean=jva;function jva(t,e){var r=Wee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(jva,"clean");Eo.SemVer=Oa;function Oa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Oa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>COe)throw new TypeError("version is longer than "+COe+" characters");if(!(this instanceof Oa))return new Oa(t,e);fl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Du[cEr]:Du[sEr]);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>cmt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cmt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cmt||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=Hva;function Hva(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Oa(t,r).inc(e,n).version}catch{return null}}a(Hva,"inc");Eo.diff=Gva;function Gva(t,e){if(dEr(t,e))return null;var r=Wee(t),n=Wee(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(Gva,"diff");Eo.compareIdentifiers=B0e;var oCi=/^[0-9]+$/;function B0e(t,e){var r=oCi.test(t),n=oCi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(SOe,"gt");Eo.lt=dmt;function dmt(t,e,r){return q8(t,e,r)<0}a(dmt,"lt");Eo.eq=dEr;function dEr(t,e,r){return q8(t,e,r)===0}a(dEr,"eq");Eo.neq=ECi;function ECi(t,e,r){return q8(t,e,r)!==0}a(ECi,"neq");Eo.gte=fEr;function fEr(t,e,r){return q8(t,e,r)>=0}a(fEr,"gte");Eo.lte=pEr;function pEr(t,e,r){return q8(t,e,r)<=0}a(pEr,"lte");Eo.cmp=fmt;function fmt(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 dEr(t,r,n);case"!=":return ECi(t,r,n);case">":return SOe(t,r,n);case">=":return fEr(t,r,n);case"<":return dmt(t,r,n);case"<=":return pEr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(fmt,"cmp");Eo.Comparator=yR;function yR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof yR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof yR))return new yR(t,e);t=t.trim().split(/\s+/).join(" "),fl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===IOe?this.value="":this.value=this.operator+this.semver.version,fl("comp",this)}a(yR,"Comparator");var IOe={};yR.prototype.parse=function(t){var e=this.options.loose?Du[lEr]:Du[uEr],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 Oa(r[2],this.options.loose):this.semver=IOe};yR.prototype.toString=function(){return this.value};yR.prototype.test=function(t){return fl("Comparator.test",t,this.options.loose),this.semver===IOe?!0:(typeof t=="string"&&(t=new Oa(t,this.options)),fmt(t,this.operator,this.semver,this.options))};yR.prototype.intersects=function(t,e){if(!(t instanceof yR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Pf(t.value,e),pmt(this.value,r,e);if(t.operator==="")return r=new Pf(this.value,e),pmt(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=fmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=fmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Pf;function Pf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Pf(t.raw,e);if(t instanceof yR)return new Pf(t.value,e);if(!(this instanceof Pf))return new Pf(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(Pf,"Range");Pf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Pf.prototype.toString=function(){return this.range};Pf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Du[ACi]:Du[gCi];t=t.replace(r,cCa),fl("hyphen replace",t),t=t.replace(Du[Vee],Qva),fl("comparator trim",t,Du[Vee]),t=t.replace(Du[U0e],Fva),t=t.replace(Du[Q0e],Uva);var n=e?Du[lEr]:Du[uEr],o=t.split(" ").map(function(s){return eCa(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 yR(s,this.options)},this),o};Pf.prototype.intersects=function(t,e){if(!(t instanceof Pf))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=Xva;function Xva(t,e){return new Pf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Xva,"toComparators");function eCa(t,e){return fl("comp",t,e),t=nCa(t,e),fl("caret",t),t=tCa(t,e),fl("tildes",t),t=oCa(t,e),fl("xrange",t),t=aCa(t,e),fl("stars",t),t}a(eCa,"parseComparator");function Sv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Sv,"isX");function tCa(t,e){return t.trim().split(/\s+/).map(function(r){return rCa(r,e)}).join(" ")}a(tCa,"replaceTildes");function rCa(t,e){var r=e.loose?Du[pCi]:Du[fCi];return t.replace(r,function(n,o,s,c,l){fl("tilde",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(fl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",fl("tilde return",u),u})}a(rCa,"replaceTilde");function nCa(t,e){return t.trim().split(/\s+/).map(function(r){return iCa(r,e)}).join(" ")}a(nCa,"replaceCarets");function iCa(t,e){fl("caret",t,e);var r=e.loose?Du[mCi]:Du[hCi];return t.replace(r,function(n,o,s,c,l){fl("caret",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(fl("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"):(fl("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"),fl("caret return",u),u})}a(iCa,"replaceCaret");function oCa(t,e){return fl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return sCa(r,e)}).join(" ")}a(oCa,"replaceXRanges");function sCa(t,e){t=t.trim();var r=e.loose?Du[uCi]:Du[lCi];return t.replace(r,function(n,o,s,c,l,u){fl("xRange",t,n,o,s,c,l,u);var d=Sv(s),f=d||Sv(c),h=f||Sv(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"),fl("xRange return",n),n})}a(sCa,"replaceXRange");function aCa(t,e){return fl("replaceStars",t,e),t.trim().replace(Du[yCi],"")}a(aCa,"replaceStars");function cCa(t,e,r,n,o,s,c,l,u,d,f,h,m){return Sv(r)?e="":Sv(n)?e=">="+r+".0.0":Sv(o)?e=">="+r+"."+n+".0":e=">="+e,Sv(u)?l="":Sv(d)?l="<"+(+u+1)+".0.0":Sv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(cCa,"hyphenReplace");Pf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Oa(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(lCa,"testSet");Eo.satisfies=pmt;function pmt(t,e,r){try{e=new Pf(e,r)}catch{return!1}return e.test(t)}a(pmt,"satisfies");Eo.maxSatisfying=uCa;function uCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Oa(n,r))}),n}a(uCa,"maxSatisfying");Eo.minSatisfying=dCa;function dCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Oa(n,r))}),n}a(dCa,"minSatisfying");Eo.minVersion=fCa;function fCa(t,e){t=new Pf(t,e);var r=new Oa("0.0.0");if(t.test(r)||(r=new Oa("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||SOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(fCa,"minVersion");Eo.validRange=pCa;function pCa(t,e){try{return new Pf(t,e).range||"*"}catch{return null}}a(pCa,"validRange");Eo.ltr=hCa;function hCa(t,e,r){return hEr(t,e,"<",r)}a(hCa,"ltr");Eo.gtr=mCa;function mCa(t,e,r){return hEr(t,e,">",r)}a(mCa,"gtr");Eo.outside=hEr;function hEr(t,e,r,n){t=new Oa(t,n),e=new Pf(e,n);var o,s,c,l,u;switch(r){case">":o=SOe,s=pEr,c=dmt,l=">",u=">=";break;case"<":o=dmt,s=fEr,c=SOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(pmt(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(hEr,"outside");Eo.prerelease=gCa;function gCa(t,e){var r=Wee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(gCa,"prerelease");Eo.intersects=ACa;function ACa(t,e,r){return t=new Pf(t,r),e=new Pf(e,r),t.intersects(e)}a(ACa,"intersects");Eo.coerce=yCa;function yCa(t){if(t instanceof Oa)return t;if(typeof t!="string")return null;var e=t.match(Du[dCi]);return e==null?null:Wee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(yCa,"coerce")});var SCi=I((E0p,bCi)=>{p();var ECa=d0e().wrap,gEr=1,AEr=2,yEr=4,ymt=8,Jl=[],_Ca=0,OE=!1,hG=[],j0e,EEr;function _Er(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Jl=hG.pop()),H0e=void 0,n&&!OE},"asyncCatcher"),EEr=a(function(e,r,n){var o=[];OE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);OE=!1;var d=e.apply(this,arguments);for(OE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return OE=!1,Jl=hG.pop(),H0e=void 0,d}},"asyncWrap"),ECa(process,"_fatalException",function(t){return a(function(r){return j0e(r)||t(r)},"_asyncFatalException")})):(mEr=!1,j0e=a(function(e){if(mEr)throw e;for(var r=!1,n=Jl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);OE=!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]);OE=!1}Jl=hG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",j0e));var Amt,H0e,mEr;function vCa(t,e,r){OE=!0;for(var n=0;n0)return EEr(t,r,e);return vCa(t,r,e)}a(CCa,"wrapCallback");function k4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=gEr),typeof t.before=="function"&&(this.before=t.before,this.flags|=AEr),typeof t.after=="function"&&(this.after=t.after,this.flags|=yEr),typeof t.error=="function"&&(this.error=t.error,this.flags|=ymt),this.uid=++_Ca,this.data=e===void 0?null:e}a(k4,"AsyncListener");k4.prototype.create=void 0;k4.prototype.before=void 0;k4.prototype.after=void 0;k4.prototype.error=void 0;k4.prototype.data=void 0;k4.prototype.uid=0;k4.prototype.flags=0;function CCi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof k4?t:new k4(t,e)}a(CCi,"createAsyncListener");function bCa(t,e){var r;t instanceof k4?r=t:r=CCi(t,e);for(var n=!1,o=0;o{"use strict";p();TCi.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 NCi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var kCi=d0e(),_mt=vCi(),Hb=kCi.wrap,mG=kCi.massWrap,Df=SCi(),TCa=require("util"),ICa=_mt.gte(process.version,"6.0.0"),bEr=_mt.gte(process.version,"7.0.0"),xCa=_mt.gte(process.version,"8.0.0"),wCa=_mt.gte(process.version,"11.0.0"),P4=require("net");bEr&&!P4._normalizeArgs?P4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:NCa(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]}:!bEr&&!P4._normalizeConnectArgs&&(P4._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 P4.Server.prototype?Hb(P4.Server.prototype,"_setUpListenHandle",xCi):Hb(P4.Server.prototype,"_listen2",xCi);function xCi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Df(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Df(this._handle.onconnection))}}}a(xCi,"wrapSetUpListenHandle");function PCi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Df(e._originalOnread)}}a(PCi,"patchOnRead");Hb(P4.Socket.prototype,"connect",function(t){return function(){var e;xCa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=bEr?P4._normalizeArgs(arguments):P4._normalizeConnectArgs(arguments),e[1]&&(e[1]=Df(e[1]));var r=t.apply(this,e);return PCi(this),r}});var RCa=require("http");Hb(RCa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Df(function(n){return PCi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var vEr=require("child_process");function wCi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Df(e._handle.onread),Hb(e._handle,"close",vmt))}),t._handle&&(t._handle.onexit=Df(t._handle.onexit))}a(wCi,"wrapChildProcess");vEr.ChildProcess?Hb(vEr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return wCi(this),e}}):mG(vEr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return wCi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var IEr=[];process._nextDomainTick&&IEr.push("_nextDomainTick");process._tickDomainCallback&&IEr.push("_tickDomainCallback");mG(process,IEr,D4);Hb(process,"nextTick",vmt);var xEr=["setTimeout","setInterval"];global.setImmediate&&xEr.push("setImmediate");var DCi=require("timers"),kCa=global.setTimeout===DCi.setTimeout;mG(DCi,xEr,vmt);kCa&&mG(global,xEr,vmt);var SEr=require("dns");mG(SEr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],D4);SEr.resolveNaptr&&Hb(SEr,"resolveNaptr",D4);var Yee=require("fs");mG(Yee,["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"],D4);Yee.lchown&&Hb(Yee,"lchown",D4);Yee.lchmod&&Hb(Yee,"lchmod",D4);Yee.ftruncate&&Hb(Yee,"ftruncate",D4);var xOe;try{xOe=require("zlib")}catch{}xOe&&xOe.Deflate&&xOe.Deflate.prototype&&(zee=Object.getPrototypeOf(xOe.Deflate.prototype),zee._transform?Hb(zee,"_transform",D4):zee.write&&zee.flush&&zee.end&&mG(zee,["write","flush","end"],D4));var zee,TEr;try{TEr=require("crypto")}catch{}TEr&&(CEr=["pbkdf2","randomBytes"],wCa||CEr.push("pseudoRandomBytes"),mG(TEr,CEr,D4));var CEr,Emt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Emt&&(RCi=process.addAsyncListener({create:a(function(){Emt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Emt=!1},"notSync")),process.removeAsyncListener(RCi));var RCi;Emt&&PCa();function PCa(){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"),TCa.inherits(e,t),Hb(t.prototype,"then",s),t.prototype.chain&&Hb(t.prototype,"chain",s),ICa)global.Promise=ICi()(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=Df(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:Df(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(PCa,"wrapPromise");function D4(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(DCa,"toNumber");function NCa(t){return typeof t=="string"&&DCa(t)===!1}a(NCa,"isPipeName")});var FCi=I((k0p,BCi)=>{"use strict";p();var j8=require("assert"),MCa=imt(),wOe="cls@contexts",wEr="error@context";process.addAsyncListener||NCi();function oD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(oD,"Namespace");oD.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};oD.prototype.get=function(t){if(this.active)return this.active[t]};oD.prototype.createContext=function(){return Object.create(this.active)};oD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[wEr]=e),r}finally{this.exit(e)}};oD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};oD.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[wEr]=e),n}finally{r.exit(e)}}};oD.prototype.enter=function(t){j8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};oD.prototype.exit=function(t){if(j8.ok(t,"context must be provided for exiting"),this.active===t){j8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);j8.ok(e>=0,"context not currently entered; can't exit"),j8.ok(e,"can't remove top context"),this._set.splice(e,1)};oD.prototype.bindEmitter=function(t){j8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[wOe]||(s[wOe]=Object.create(null)),s[wOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[wOe]))return s;var c=s,l=s[wOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),MCa(t,n,o)};oD.prototype.fromException=function(t){return t[wEr]};function MCi(t){return process.namespaces[t]}a(MCi,"get");function OCa(t){j8.ok(t,"namespace must be given a name!");var e=new oD(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(OCa,"create");function OCi(t){var e=MCi(t);j8.ok(e,"can't delete nonexistent namespace!"),j8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(OCi,"destroy");function LCi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){OCi(t)}),process.namespaces=Object.create(null)}a(LCi,"reset");process.namespaces||LCi();BCi.exports={getNamespace:MCi,createNamespace:OCa,destroyNamespace:OCi,reset:LCi}});var AG=I(N4=>{"use strict";p();var LCa=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]})),BCa=N4&&N4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FCa=N4&&N4.__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)&&LCa(e,t,r);return BCa(e,t),e};Object.defineProperty(N4,"__esModule",{value:!0});N4.CorrelationContextManager=void 0;var gG=Kl(),UCa=FCa(jht()),Kee=Hht(),REr=XAr(),UCi=Eyr(),G0e=ay(),QCa=(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 qCa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new Kee;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=Kee.formatOpenTelemetryTraceFlags(e.traceFlags)||Kee.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){gG.warn("Error binding to session context",G0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){gG.warn("Error binding to session context",G0e.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){gG.warn("Error binding to session context",G0e.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=iCi():this.cls=FCi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){gG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",G0e.dumpObj(r)),this.enabled=!1;return}UCa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){gG.warn("Error binding to session context",G0e.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 Kee(f.headers.traceparent):f.headers["request-id"]&&(u=new Kee(null,f.headers["request-id"])),f.headers.tracestate&&(d=new REr(f.headers.tracestate)))}u||(u=new Kee(n.traceParent||n.traceparent)),d||(d=new REr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new UCi(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 Kee(c.traceparent?c.traceparent.toString():null),d=new REr(c.tracestate?c.tracestate.toString():null),m=new UCi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return gG.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){gG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",G0e.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})();N4.CorrelationContextManager=QCa;var qCa=(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=Uba;var Qba=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=Qba});var LEr=I((Agp,obi)=>{"use strict";p();var ibi=md(),qba=(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||ibi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||ibi.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})();obi.exports=qba});var sbi={};ki(sbi,{webSnippet:()=>jba});var jba,abi=ve(()=>{p();jba=`!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();function Mva(){}a(Mva,"NextTickWrap");Gvi.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 Wvi=I((p0p,Vvi)=>{"use strict";p();function Ova(){}a(Ova,"PromiseWrap");Vvi.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 Ova,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 Yvi=I((g0p,zvi)=>{"use strict";p();var YT=require("timers");function Lva(){}a(Lva,"TimeoutWrap");function Bva(){}a(Bva,"IntervalWrap");function Fva(){}a(Fva,"ImmediateWrap");var Uva=new Map,Qva=new Map,qva=new Map,jyr=null,Hyr=!1;zvi.exports=a(function(){Gyr(this._hooks,this._state,"setTimeout","clearTimeout",Lva,Uva,!0),Gyr(this._hooks,this._state,"setInterval","clearInterval",Bva,Qva,!1),Gyr(this._hooks,this._state,"setImmediate","clearImmediate",Fva,qva,!0),global.setTimeout=YT.setTimeout,global.setInterval=YT.setInterval,global.setImmediate=YT.setImmediate,global.clearTimeout=YT.clearTimeout,global.clearInterval=YT.clearInterval,global.clearImmediate=YT.clearImmediate},"patch");function Gyr(t,e,r,n,o,s,c){let l=YT[r],u=YT[n];YT[r]=function(){if(!e.enabled)return l.apply(YT,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),jyr=null,(c||Hyr)&&(Hyr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(YT,d),s.set(g,m),g},YT[n]=function(d){if(jyr===d&&d!==null)Hyr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(YT,arguments)}}a(Gyr,"patchTimer")});var $yr=I((E0p,jva)=>{jva.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 Zvi=I((_0p,Jvi)=>{"use strict";p();var vOe=process.binding("async_wrap"),Hva=vOe.Providers.TIMERWRAP,Kvi={nextTick:$vi(),promise:Wvi(),timers:Yvi()},_Oe=new Set;function Gva(){this.enabled=!1,this.counter=0}a(Gva,"State");function Vyr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Hva){_Oe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!_Oe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!_Oe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(_Oe.has(o)){_Oe.delete(o);return}for(let s of n)s(o)}}a(Vyr,"Hooks");Vyr.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 lmt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(lmt,"removeElement");Vyr.prototype.remove=function(t){t.init&&lmt(this.initFns,t.init),t.pre&&lmt(this.preFns,t.pre),t.post&&lmt(this.postFns,t.post),t.destroy&&lmt(this.destroyFns,t.destroy)};function COe(){this._state=new Gva,this._hooks=new Vyr,this.version=$yr().version,this.providers=vOe.Providers;for(let t of Object.keys(Kvi))Kvi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),vOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(COe,"AsyncHook");Jvi.exports=COe;COe.prototype.addHooks=function(t){this._hooks.add(t)};COe.prototype.removeHooks=function(t){this._hooks.remove(t)};COe.prototype.enable=function(){this._state.enabled=!0,vOe.enable()};COe.prototype.disable=function(){this._state.enabled=!1,vOe.disable()}});var Wyr=I((b0p,$va)=>{$va.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 eCi=I((S0p,Xvi)=>{p();function Vva(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(Vva,"FormatErrorString");Xvi.exports=a(function(e,r){var n=[];n.push(Vva(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` +`)},"FormatStackTrace")});var iCi=I((x0p,nCi)=>{p();var umt=eCi();function rCi(){this.extend=new bOe,this.filter=new bOe,this.format=new SOe,this.version=Wyr().version}a(rCi,"stackChain");var Yyr=!1;rCi.prototype.callSite=a(function t(e){e||(e={}),Yyr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Yyr=!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 AG=new rCi;function bOe(){this._modifiers=[]}a(bOe,"TraceModifier");bOe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Wyr().version)Kyr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Kyr.exports=global._stackChain=iCi()});var oCi=I((D0p,Zyr)=>{"use strict";p();var zva=Zvi();if(global._asyncHook)if(global._asyncHook.version===$yr().version)Zyr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Jyr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Zyr.exports=global._asyncHook=new zva});var dCi=I((M0p,uCi)=>{"use strict";p();var gh=require("util"),j8=require("assert"),Yva=cmt(),L0e=oCi(),TOe="cls@contexts",IOe="error@context",aCi=[];for(let t in L0e.providers)aCi[L0e.providers[t]]=t;var Tp=process.env.DEBUG_CLS_HOOKED,vm=-1;uCi.exports={getNamespace:cCi,createNamespace:Kva,destroyNamespace:lCi,reset:Jva,ERROR_SYMBOL:IOe};function ER(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(ER,"Namespace");ER.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 Tp&&mh(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+vm+" active:"+gh.inspect(this.active,!0)),this.active[e]=r,r},"set");ER.prototype.get=a(function(e){if(!this.active){Tp&&mh(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+vm+" active:"+gh.inspect(this.active,!0));return}return Tp&&mh(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+vm+" active:"+gh.inspect(this.active,!0)),this.active[e]},"get");ER.prototype.createContext=a(function(){Tp&&mh(" CREATING Context: "+this.name+" uid:"+vm+" len:"+this._set.length+" active:"+gh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=vm,Tp&&mh(" CREATED Context: "+this.name+" uid:"+vm+" len:"+this._set.length+" context:"+gh.inspect(e,!0,2,!0)),e},"createContext");ER.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return Tp&&mh(" BEFORE RUN: "+this.name+" uid:"+vm+" len:"+this._set.length+" "+gh.inspect(r)),e(r),r}catch(n){throw n&&(n[IOe]=r),n}finally{Tp&&mh(" AFTER RUN: "+this.name+" uid:"+vm+" len:"+this._set.length+" "+gh.inspect(r)),this.exit(r)}},"run");ER.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");ER.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 Tp&&mh(" BEFORE runPromise: "+this.name+" uid:"+vm+" len:"+this._set.length+" "+gh.inspect(r)),n.then(o=>(Tp&&mh(" AFTER runPromise: "+this.name+" uid:"+vm+" len:"+this._set.length+" "+gh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[IOe]=r,Tp&&mh(" AFTER runPromise: "+this.name+" uid:"+vm+" len:"+this._set.length+" "+gh.inspect(r)),this.exit(r),o})},"runPromise");ER.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[IOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");ER.prototype.enter=a(function(e){j8.ok(e,"context must be provided for entering"),Tp&&mh(" ENTER "+this.name+" uid:"+vm+" len:"+this._set.length+" context: "+gh.inspect(e)),this._set.push(this.active),this.active=e},"enter");ER.prototype.exit=a(function(e){if(j8.ok(e,"context must be provided for exiting"),Tp&&mh(" EXIT "+this.name+" uid:"+vm+" len:"+this._set.length+" context: "+gh.inspect(e)),this.active===e){j8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(Tp&&mh("??ERROR?? context exiting but not entered - ignoring: "+gh.inspect(e)),j8.ok(r>=0,`context not currently entered; can't exit. +`+gh.inspect(this)+` +`+gh.inspect(e))):(j8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");ER.prototype.bindEmitter=a(function(e){j8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[TOe]||(c[TOe]=Object.create(null)),c[TOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[TOe]))return c;let l=c,u=c[TOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Yva(e,o,s)},"bindEmitter");ER.prototype.fromException=a(function(e){return e[IOe]},"fromException");function cCi(t){return process.namespaces[t]}a(cCi,"getNamespace");function Kva(t){j8.ok(t,"namespace must be given a name."),Tp&&mh("CREATING NAMESPACE "+t);let e=new ER(t);return e.id=vm,L0e.addHooks({init(r,n,o,s,c){vm=r,s?(e._contexts.set(r,e._contexts.get(s)),Tp&&mh("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(vm,e.active),Tp&&mh("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+aCi[o]+" active:"+gh.inspect(e.active,!0))},pre(r,n){vm=r;let o=e._contexts.get(r);o?(Tp&&mh(" PRE "+t+" uid:"+r+" handle:"+dmt(n)+" context:"+gh.inspect(o)),e.enter(o)):Tp&&mh(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+dmt(n))},post(r,n){vm=r;let o=e._contexts.get(r);o?(Tp&&mh(" POST "+t+" uid:"+r+" handle:"+dmt(n)+" context:"+gh.inspect(o)),e.exit(o)):Tp&&mh(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+dmt(n))},destroy(r){vm=r,Tp&&mh("DESTROY "+t+" uid:"+r+" context:"+gh.inspect(e._contexts.get(vm))+" active:"+gh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Kva,"createNamespace");function lCi(t){let e=cCi(t);j8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),j8.ok(e.id,"don't assign to process.namespaces directly! "+gh.inspect(e)),process.namespaces[t]=null}a(lCi,"destroyNamespace");function Jva(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){lCi(t)}),process.namespaces=Object.create(null)}a(Jva,"reset");process.namespaces={};L0e._state&&!L0e._state.enabled&&L0e.enable();function mh(t){process.env.DEBUG&&process._rawDebug(t)}a(mh,"debug2");function dmt(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(dmt,"getFunctionName");if(Tp){Xyr=Jyr();for(sCi in Xyr.filter._modifiers)Xyr.filter.deattach(sCi)}var Xyr,sCi});var fCi=I((B0p,eEr)=>{"use strict";p();var Zva=Ovi();process&&Zva.gte(process.versions.node,"8.0.0")?eEr.exports=Hvi():eEr.exports=dCi()});var RCi=I((_o,wCi)=>{p();_o=wCi.exports=La;var pl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?pl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):pl=a(function(){},"debug");_o.SEMVER_SPEC_VERSION="2.0.0";var xOe=256,fmt=Number.MAX_SAFE_INTEGER||9007199254740991,tEr=16,Xva=xOe-6,wOe=_o.re=[],Du=_o.safeRe=[],rr=_o.src=[],Aa=0,sEr="[a-zA-Z0-9-]",rEr=[["\\s",1],["\\d",xOe],[sEr,Xva]];function ymt(t){for(var e=0;e)?=?)";var pmt=Aa++;rr[pmt]=rr[F0e]+"|x|X|\\*";var hmt=Aa++;rr[hmt]=rr[B0e]+"|x|X|\\*";var Vee=Aa++;rr[Vee]="[v=\\s]*("+rr[hmt]+")(?:\\.("+rr[hmt]+")(?:\\.("+rr[hmt]+")(?:"+rr[cEr]+")?"+rr[kOe]+"?)?)?";var Q0e=Aa++;rr[Q0e]="[v=\\s]*("+rr[pmt]+")(?:\\.("+rr[pmt]+")(?:\\.("+rr[pmt]+")(?:"+rr[lEr]+")?"+rr[kOe]+"?)?)?";var ACi=Aa++;rr[ACi]="^"+rr[H0e]+"\\s*"+rr[Vee]+"$";var yCi=Aa++;rr[yCi]="^"+rr[H0e]+"\\s*"+rr[Q0e]+"$";var ECi=Aa++;rr[ECi]="(?:^|[^\\d])(\\d{1,"+tEr+"})(?:\\.(\\d{1,"+tEr+"}))?(?:\\.(\\d{1,"+tEr+"}))?(?:$|[^\\d])";var Emt=Aa++;rr[Emt]="(?:~>?)";var q0e=Aa++;rr[q0e]="(\\s*)"+rr[Emt]+"\\s+";wOe[q0e]=new RegExp(rr[q0e],"g");Du[q0e]=new RegExp(ymt(rr[q0e]),"g");var eCa="$1~",_Ci=Aa++;rr[_Ci]="^"+rr[Emt]+rr[Vee]+"$";var vCi=Aa++;rr[vCi]="^"+rr[Emt]+rr[Q0e]+"$";var _mt=Aa++;rr[_mt]="(?:\\^)";var j0e=Aa++;rr[j0e]="(\\s*)"+rr[_mt]+"\\s+";wOe[j0e]=new RegExp(rr[j0e],"g");Du[j0e]=new RegExp(ymt(rr[j0e]),"g");var tCa="$1^",CCi=Aa++;rr[CCi]="^"+rr[_mt]+rr[Vee]+"$";var bCi=Aa++;rr[bCi]="^"+rr[_mt]+rr[Q0e]+"$";var pEr=Aa++;rr[pEr]="^"+rr[H0e]+"\\s*("+dEr+")$|^$";var hEr=Aa++;rr[hEr]="^"+rr[H0e]+"\\s*("+gCi+")$|^$";var Wee=Aa++;rr[Wee]="(\\s*)"+rr[H0e]+"\\s*("+dEr+"|"+rr[Vee]+")";wOe[Wee]=new RegExp(rr[Wee],"g");Du[Wee]=new RegExp(ymt(rr[Wee]),"g");var rCa="$1$2$3",SCi=Aa++;rr[SCi]="^\\s*("+rr[Vee]+")\\s+-\\s+("+rr[Vee]+")\\s*$";var TCi=Aa++;rr[TCi]="^\\s*("+rr[Q0e]+")\\s+-\\s+("+rr[Q0e]+")\\s*$";var ICi=Aa++;rr[ICi]="(<|>)?=?\\s*\\*";for(k4=0;k4xOe)return null;var r=e.loose?Du[fEr]:Du[uEr];if(!r.test(t))return null;try{return new La(t,e)}catch{return null}}a(zee,"parse");_o.valid=nCa;function nCa(t,e){var r=zee(t,e);return r?r.version:null}a(nCa,"valid");_o.clean=iCa;function iCa(t,e){var r=zee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(iCa,"clean");_o.SemVer=La;function La(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof La){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>xOe)throw new TypeError("version is longer than "+xOe+" characters");if(!(this instanceof La))return new La(t,e);pl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Du[fEr]:Du[uEr]);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>fmt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>fmt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>fmt||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=oCa;function oCa(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new La(t,r).inc(e,n).version}catch{return null}}a(oCa,"inc");_o.diff=sCa;function sCa(t,e){if(mEr(t,e))return null;var r=zee(t),n=zee(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(sCa,"diff");_o.compareIdentifiers=U0e;var pCi=/^[0-9]+$/;function U0e(t,e){var r=pCi.test(t),n=pCi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(ROe,"gt");_o.lt=mmt;function mmt(t,e,r){return H8(t,e,r)<0}a(mmt,"lt");_o.eq=mEr;function mEr(t,e,r){return H8(t,e,r)===0}a(mEr,"eq");_o.neq=xCi;function xCi(t,e,r){return H8(t,e,r)!==0}a(xCi,"neq");_o.gte=gEr;function gEr(t,e,r){return H8(t,e,r)>=0}a(gEr,"gte");_o.lte=AEr;function AEr(t,e,r){return H8(t,e,r)<=0}a(AEr,"lte");_o.cmp=gmt;function gmt(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 mEr(t,r,n);case"!=":return xCi(t,r,n);case">":return ROe(t,r,n);case">=":return gEr(t,r,n);case"<":return mmt(t,r,n);case"<=":return AEr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(gmt,"cmp");_o.Comparator=_R;function _R(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof _R){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof _R))return new _R(t,e);t=t.trim().split(/\s+/).join(" "),pl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===POe?this.value="":this.value=this.operator+this.semver.version,pl("comp",this)}a(_R,"Comparator");var POe={};_R.prototype.parse=function(t){var e=this.options.loose?Du[pEr]:Du[hEr],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 La(r[2],this.options.loose):this.semver=POe};_R.prototype.toString=function(){return this.value};_R.prototype.test=function(t){return pl("Comparator.test",t,this.options.loose),this.semver===POe?!0:(typeof t=="string"&&(t=new La(t,this.options)),gmt(t,this.operator,this.semver,this.options))};_R.prototype.intersects=function(t,e){if(!(t instanceof _R))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Nf(t.value,e),Amt(this.value,r,e);if(t.operator==="")return r=new Nf(this.value,e),Amt(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=gmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=gmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};_o.Range=Nf;function Nf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Nf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Nf(t.raw,e);if(t instanceof _R)return new Nf(t.value,e);if(!(this instanceof Nf))return new Nf(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(Nf,"Range");Nf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Nf.prototype.toString=function(){return this.range};Nf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Du[TCi]:Du[SCi];t=t.replace(r,SCa),pl("hyphen replace",t),t=t.replace(Du[Wee],rCa),pl("comparator trim",t,Du[Wee]),t=t.replace(Du[q0e],eCa),t=t.replace(Du[j0e],tCa);var n=e?Du[pEr]:Du[hEr],o=t.split(" ").map(function(s){return gCa(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 _R(s,this.options)},this),o};Nf.prototype.intersects=function(t,e){if(!(t instanceof Nf))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=mCa;function mCa(t,e){return new Nf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(mCa,"toComparators");function gCa(t,e){return pl("comp",t,e),t=ECa(t,e),pl("caret",t),t=ACa(t,e),pl("tildes",t),t=vCa(t,e),pl("xrange",t),t=bCa(t,e),pl("stars",t),t}a(gCa,"parseComparator");function Iv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Iv,"isX");function ACa(t,e){return t.trim().split(/\s+/).map(function(r){return yCa(r,e)}).join(" ")}a(ACa,"replaceTildes");function yCa(t,e){var r=e.loose?Du[vCi]:Du[_Ci];return t.replace(r,function(n,o,s,c,l){pl("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?(pl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",pl("tilde return",u),u})}a(yCa,"replaceTilde");function ECa(t,e){return t.trim().split(/\s+/).map(function(r){return _Ca(r,e)}).join(" ")}a(ECa,"replaceCarets");function _Ca(t,e){pl("caret",t,e);var r=e.loose?Du[bCi]:Du[CCi];return t.replace(r,function(n,o,s,c,l){pl("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?(pl("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"):(pl("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"),pl("caret return",u),u})}a(_Ca,"replaceCaret");function vCa(t,e){return pl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return CCa(r,e)}).join(" ")}a(vCa,"replaceXRanges");function CCa(t,e){t=t.trim();var r=e.loose?Du[yCi]:Du[ACi];return t.replace(r,function(n,o,s,c,l,u){pl("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"),pl("xRange return",n),n})}a(CCa,"replaceXRange");function bCa(t,e){return pl("replaceStars",t,e),t.trim().replace(Du[ICi],"")}a(bCa,"replaceStars");function SCa(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(SCa,"hyphenReplace");Nf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new La(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(TCa,"testSet");_o.satisfies=Amt;function Amt(t,e,r){try{e=new Nf(e,r)}catch{return!1}return e.test(t)}a(Amt,"satisfies");_o.maxSatisfying=ICa;function ICa(t,e,r){var n=null,o=null;try{var s=new Nf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new La(n,r))}),n}a(ICa,"maxSatisfying");_o.minSatisfying=xCa;function xCa(t,e,r){var n=null,o=null;try{var s=new Nf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new La(n,r))}),n}a(xCa,"minSatisfying");_o.minVersion=wCa;function wCa(t,e){t=new Nf(t,e);var r=new La("0.0.0");if(t.test(r)||(r=new La("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||ROe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(wCa,"minVersion");_o.validRange=RCa;function RCa(t,e){try{return new Nf(t,e).range||"*"}catch{return null}}a(RCa,"validRange");_o.ltr=kCa;function kCa(t,e,r){return yEr(t,e,"<",r)}a(kCa,"ltr");_o.gtr=PCa;function PCa(t,e,r){return yEr(t,e,">",r)}a(PCa,"gtr");_o.outside=yEr;function yEr(t,e,r,n){t=new La(t,n),e=new Nf(e,n);var o,s,c,l,u;switch(r){case">":o=ROe,s=AEr,c=mmt,l=">",u=">=";break;case"<":o=mmt,s=gEr,c=ROe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Amt(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(yEr,"outside");_o.prerelease=DCa;function DCa(t,e){var r=zee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(DCa,"prerelease");_o.intersects=NCa;function NCa(t,e,r){return t=new Nf(t,r),e=new Nf(e,r),t.intersects(e)}a(NCa,"intersects");_o.coerce=MCa;function MCa(t){if(t instanceof La)return t;if(typeof t!="string")return null;var e=t.match(Du[ECi]);return e==null?null:zee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(MCa,"coerce")});var DCi=I((q0p,PCi)=>{p();var OCa=p0e().wrap,_Er=1,vEr=2,CEr=4,Cmt=8,Jl=[],LCa=0,LE=!1,yG=[],G0e,bEr;function SEr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Jl=yG.pop()),$0e=void 0,n&&!LE},"asyncCatcher"),bEr=a(function(e,r,n){var o=[];LE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);LE=!1;var d=e.apply(this,arguments);for(LE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return LE=!1,Jl=yG.pop(),$0e=void 0,d}},"asyncWrap"),OCa(process,"_fatalException",function(t){return a(function(r){return G0e(r)||t(r)},"_asyncFatalException")})):(EEr=!1,G0e=a(function(e){if(EEr)throw e;for(var r=!1,n=Jl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);LE=!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]);LE=!1}Jl=yG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",G0e));var vmt,$0e,EEr;function BCa(t,e,r){LE=!0;for(var n=0;n0)return bEr(t,r,e);return BCa(t,r,e)}a(FCa,"wrapCallback");function P4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=_Er),typeof t.before=="function"&&(this.before=t.before,this.flags|=vEr),typeof t.after=="function"&&(this.after=t.after,this.flags|=CEr),typeof t.error=="function"&&(this.error=t.error,this.flags|=Cmt),this.uid=++LCa,this.data=e===void 0?null:e}a(P4,"AsyncListener");P4.prototype.create=void 0;P4.prototype.before=void 0;P4.prototype.after=void 0;P4.prototype.error=void 0;P4.prototype.data=void 0;P4.prototype.uid=0;P4.prototype.flags=0;function kCi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof P4?t:new P4(t,e)}a(kCi,"createAsyncListener");function UCa(t,e){var r;t instanceof P4?r=t:r=kCi(t,e);for(var n=!1,o=0;o{"use strict";p();NCi.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 qCi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var FCi=p0e(),Smt=RCi(),Hb=FCi.wrap,EG=FCi.massWrap,Mf=DCi(),qCa=require("util"),jCa=Smt.gte(process.version,"6.0.0"),xEr=Smt.gte(process.version,"7.0.0"),HCa=Smt.gte(process.version,"8.0.0"),GCa=Smt.gte(process.version,"11.0.0"),D4=require("net");xEr&&!D4._normalizeArgs?D4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:YCa(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]}:!xEr&&!D4._normalizeConnectArgs&&(D4._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 D4.Server.prototype?Hb(D4.Server.prototype,"_setUpListenHandle",OCi):Hb(D4.Server.prototype,"_listen2",OCi);function OCi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Mf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Mf(this._handle.onconnection))}}}a(OCi,"wrapSetUpListenHandle");function UCi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Mf(e._originalOnread)}}a(UCi,"patchOnRead");Hb(D4.Socket.prototype,"connect",function(t){return function(){var e;HCa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=xEr?D4._normalizeArgs(arguments):D4._normalizeConnectArgs(arguments),e[1]&&(e[1]=Mf(e[1]));var r=t.apply(this,e);return UCi(this),r}});var $Ca=require("http");Hb($Ca.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Mf(function(n){return UCi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var TEr=require("child_process");function LCi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Mf(e._handle.onread),Hb(e._handle,"close",Tmt))}),t._handle&&(t._handle.onexit=Mf(t._handle.onexit))}a(LCi,"wrapChildProcess");TEr.ChildProcess?Hb(TEr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return LCi(this),e}}):EG(TEr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return LCi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var kEr=[];process._nextDomainTick&&kEr.push("_nextDomainTick");process._tickDomainCallback&&kEr.push("_tickDomainCallback");EG(process,kEr,N4);Hb(process,"nextTick",Tmt);var PEr=["setTimeout","setInterval"];global.setImmediate&&PEr.push("setImmediate");var QCi=require("timers"),VCa=global.setTimeout===QCi.setTimeout;EG(QCi,PEr,Tmt);VCa&&EG(global,PEr,Tmt);var wEr=require("dns");EG(wEr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],N4);wEr.resolveNaptr&&Hb(wEr,"resolveNaptr",N4);var Kee=require("fs");EG(Kee,["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"],N4);Kee.lchown&&Hb(Kee,"lchown",N4);Kee.lchmod&&Hb(Kee,"lchmod",N4);Kee.ftruncate&&Hb(Kee,"ftruncate",N4);var DOe;try{DOe=require("zlib")}catch{}DOe&&DOe.Deflate&&DOe.Deflate.prototype&&(Yee=Object.getPrototypeOf(DOe.Deflate.prototype),Yee._transform?Hb(Yee,"_transform",N4):Yee.write&&Yee.flush&&Yee.end&&EG(Yee,["write","flush","end"],N4));var Yee,REr;try{REr=require("crypto")}catch{}REr&&(IEr=["pbkdf2","randomBytes"],GCa||IEr.push("pseudoRandomBytes"),EG(REr,IEr,N4));var IEr,bmt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";bmt&&(BCi=process.addAsyncListener({create:a(function(){bmt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){bmt=!1},"notSync")),process.removeAsyncListener(BCi));var BCi;bmt&&WCa();function WCa(){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"),qCa.inherits(e,t),Hb(t.prototype,"then",s),t.prototype.chain&&Hb(t.prototype,"chain",s),jCa)global.Promise=MCi()(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=Mf(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:Mf(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(WCa,"wrapPromise");function N4(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(zCa,"toNumber");function YCa(t){return typeof t=="string"&&zCa(t)===!1}a(YCa,"isPipeName")});var VCi=I((Z0p,$Ci)=>{"use strict";p();var G8=require("assert"),KCa=cmt(),NOe="cls@contexts",DEr="error@context";process.addAsyncListener||qCi();function cD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(cD,"Namespace");cD.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};cD.prototype.get=function(t){if(this.active)return this.active[t]};cD.prototype.createContext=function(){return Object.create(this.active)};cD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[DEr]=e),r}finally{this.exit(e)}};cD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};cD.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[DEr]=e),n}finally{r.exit(e)}}};cD.prototype.enter=function(t){G8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};cD.prototype.exit=function(t){if(G8.ok(t,"context must be provided for exiting"),this.active===t){G8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);G8.ok(e>=0,"context not currently entered; can't exit"),G8.ok(e,"can't remove top context"),this._set.splice(e,1)};cD.prototype.bindEmitter=function(t){G8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[NOe]||(s[NOe]=Object.create(null)),s[NOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[NOe]))return s;var c=s,l=s[NOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),KCa(t,n,o)};cD.prototype.fromException=function(t){return t[DEr]};function jCi(t){return process.namespaces[t]}a(jCi,"get");function JCa(t){G8.ok(t,"namespace must be given a name!");var e=new cD(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(JCa,"create");function HCi(t){var e=jCi(t);G8.ok(e,"can't delete nonexistent namespace!"),G8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(HCi,"destroy");function GCi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){HCi(t)}),process.namespaces=Object.create(null)}a(GCi,"reset");process.namespaces||GCi();$Ci.exports={getNamespace:jCi,createNamespace:JCa,destroyNamespace:HCi,reset:GCi}});var vG=I(M4=>{"use strict";p();var ZCa=M4&&M4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XCa=M4&&M4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eba=M4&&M4.__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)&&ZCa(e,t,r);return XCa(e,t),e};Object.defineProperty(M4,"__esModule",{value:!0});M4.CorrelationContextManager=void 0;var _G=Kl(),tba=eba(Vht()),Jee=Wht(),NEr=nyr(),WCi=byr(),V0e=cy(),rba=(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 nba(o)}:null},t.spanToContextObject=function(e,r,n){var o=new Jee;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=Jee.formatOpenTelemetryTraceFlags(e.traceFlags)||Jee.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){_G.warn("Error binding to session context",V0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){_G.warn("Error binding to session context",V0e.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){_G.warn("Error binding to session context",V0e.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=fCi():this.cls=VCi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){_G.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",V0e.dumpObj(r)),this.enabled=!1;return}tba.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){_G.warn("Error binding to session context",V0e.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 Jee(f.headers.traceparent):f.headers["request-id"]&&(u=new Jee(null,f.headers["request-id"])),f.headers.tracestate&&(d=new NEr(f.headers.tracestate)))}u||(u=new Jee(n.traceParent||n.traceparent)),d||(d=new NEr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new WCi(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 Jee(c.traceparent?c.traceparent.toString():null),d=new NEr(c.tracestate?c.tracestate.toString():null),m=new WCi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return _G.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){_G.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",V0e.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})();M4.CorrelationContextManager=rba;var nba=(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=t1a;var r1a=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=r1a});var QEr=I((Ugp,pbi)=>{"use strict";p();var fbi=Ad(),n1a=(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||fbi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||fbi.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})();pbi.exports=n1a});var hbi={};ki(hbi,{webSnippet:()=>i1a});var i1a,mbi=ve(()=>{p();i1a=`!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 cbi=require("http"),lbi=require("https"),z0e=require("zlib"),M4=Kl(),_R=nbi(),ubi=OEr(),kOe=md(),dbi=LEr(),Hba=(abi(),ba(sbi)),Gba=(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=kOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=kOe.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(kOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(kOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=dbi.parse(e),o=n.instrumentationkey||"";dbi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,M4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){M4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=ubi.getOsPrefix(),n=ubi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var vbi=I((Hgp,_bi)=>{"use strict";p();var gbi=require("http"),Abi=require("https"),K0e=require("zlib"),O4=Kl(),CR=dbi(),ybi=UEr(),OOe=Ad(),Ebi=QEr(),o1a=(mbi(),Sa(hbi)),s1a=(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=OOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=OOe.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(OOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(OOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=Ebi.parse(e),o=n.instrumentationkey||"";Ebi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,O4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){O4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=ybi.getOsPrefix(),n=ybi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=Hba.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(kOe.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=o1a.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(OOe.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,M4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=cbi.createServer,r=lbi.createServer,n=this._isEnabled;cbi.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=_R.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){M4.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=_R.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){M4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},lbi.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=_R.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){M4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=_R.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){M4.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=_R.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){M4.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=_R.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=_R.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){M4.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 _R.contentEncodingMethod.GZIP:var o=z0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=z0e.gzipSync(s)}break;case _R.contentEncodingMethod.DEFLATE:var c=z0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=z0e.deflateSync(l)}break;case _R.contentEncodingMethod.BR:var u=_R.getBrotliDecompressSync(z0e),d=_R.getBrotliCompressSync(z0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){M4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();fbi.exports=Gba});var mbi=I((FEr,hbi)=>{"use strict";p();var $ba=FEr&&FEr.__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)}})(),vR=require("url"),BEr=ME(),Vba=ay(),Wba=S0e(),zba=myr(),Yba=Qee(),Kba=(function(t){$ba(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=Vba.getCorrelationContextTarget(r,Wba.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=BEr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new vR.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=BEr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==Yba.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=BEr.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 vR.URL(r)}catch{}else try{var o=new vR.URL("http://"+r);o.port==="443"?r=new vR.URL("https://"+r):r=new vR.URL("http://"+r)}catch{}else{if(r&&typeof vR.URL=="function"&&r instanceof vR.URL)return vR.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 vR.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 vR.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 vR.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",vR.format(r)},e})(zba);hbi.exports=Kba});var gbi=I(Y0e=>{"use strict";p();var Lmt=Y0e&&Y0e.__assign||function(){return Lmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var t1a=$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]})),r1a=$8&&$8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n1a=$8&&$8.__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)&&t1a(e,t,r);return r1a(e,t),e};Object.defineProperty($8,"__esModule",{value:!0});$8.spanToTelemetryContract=u1a;var Abi=require("url"),sD=(co(),ba(V5)),_s=(yht(),ba(TAr)),G8=n1a(md()),i1a=gbi(),o1a=ay();function s1a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=o1a.stringify(s)),e}a(s1a,"createPropertiesFromSpan");function a1a(t){return t===_s.DbSystemValues.DB2||t===_s.DbSystemValues.DERBY||t===_s.DbSystemValues.MARIADB||t===_s.DbSystemValues.MSSQL||t===_s.DbSystemValues.ORACLE||t===_s.DbSystemValues.SQLITE||t===_s.DbSystemValues.OTHER_SQL||t===_s.DbSystemValues.HSQLDB||t===_s.DbSystemValues.H2}a(a1a,"isSqlDB");function ybi(t){var e=t.attributes[_s.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[_s.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[_s.SemanticAttributes.HTTP_SCHEME],o=t.attributes[_s.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[_s.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[_s.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[_s.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[_s.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(ybi,"getUrl");function QEr(t){var e=t.attributes[_s.SemanticAttributes.PEER_SERVICE],r=t.attributes[_s.SemanticAttributes.HTTP_HOST],n=t.attributes[_s.SemanticAttributes.HTTP_URL],o=t.attributes[_s.SemanticAttributes.NET_PEER_NAME],s=t.attributes[_s.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(QEr,"getDependencyTarget");function c1a(t){var e={name:t.name,success:t.status.code!=sD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===sD.SpanKind.PRODUCER&&(e.dependencyTypeName=G8.DependencyTypeName.QueueMessage),t.kind===sD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=G8.DependencyTypeName.InProc);var r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.DB_SYSTEM],o=t.attributes[_s.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=G8.DependencyTypeName.Http;var s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new Abi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=ybi(t);var u=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=QEr(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)===_s.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===_s.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===_s.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===_s.DbSystemValues.REDIS?e.dependencyTypeName="redis":a1a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[_s.SemanticAttributes.DB_STATEMENT],y=t.attributes[_s.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=QEr(t),E=t.attributes[_s.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=G8.DependencyTypeName.Grpc;var _=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=QEr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(c1a,"createDependencyData");function l1a(t){var e={name:t.name,success:t.status.code!=sD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==sD.SpanKind.SERVER){var o=t.attributes[_s.SemanticAttributes.HTTP_ROUTE],s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new Abi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=ybi(t);var l=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(l1a,"createRequestData");function u1a(t){var e;switch(t.kind){case sD.SpanKind.CLIENT:case sD.SpanKind.PRODUCER:case sD.SpanKind.INTERNAL:e=c1a(t);break;case sD.SpanKind.SERVER:case sD.SpanKind.CONSUMER:e=l1a(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=s1a(t),t.attributes[G8.AzNamespace]&&(t.kind===sD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(G8.DependencyTypeName.InProc," | ").concat(t.attributes[G8.AzNamespace])),t.attributes[G8.AzNamespace]===G8.MicrosoftEventHub&&(0,i1a.parseEventHubSpan)(t,e)),e}a(u1a,"spanToTelemetryContract")});var vbi=I(CG=>{"use strict";p();var K0e=CG&&CG.__assign||function(){return K0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var f1a=zT&&zT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p1a=zT&&zT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),h1a=zT&&zT.__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)&&f1a(e,t,r);return p1a(e,t),e};Object.defineProperty(zT,"__esModule",{value:!0});zT.subscriber=void 0;zT.enable=E1a;var DOe=(co(),ba(V5)),m1a=md(),qEr=Cp(),g1a=h1a(Ebi()),A1a=vbi(),Xee=[],y1a=a(function(t){try{var e=t.data,r=g1a.spanToTelemetryContract(e);A1a.AsyncScopeManager.with(e,function(){Xee.forEach(function(n){e.kind===DOe.SpanKind.SERVER||e.kind===DOe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===DOe.SpanKind.CLIENT||e.kind===DOe.SpanKind.INTERNAL||e.kind===DOe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");zT.subscriber=y1a;function E1a(t,e){if(t){var r=Xee.find(function(n){return n==e});if(r)return;Xee.length===0&&qEr.channel.subscribe("azure-coretracing",zT.subscriber,qEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(m1a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),Xee.push(e)}else Xee=Xee.filter(function(n){return n!=e}),Xee.length===0&&qEr.channel.unsubscribe("azure-coretracing",zT.subscriber)}a(E1a,"enable")});var bbi=I(tte=>{"use strict";p();Object.defineProperty(tte,"__esModule",{value:!0});tte.subscriber=void 0;tte.enable=C1a;var _1a=md(),jEr=Cp(),ete=[],v1a=a(function(t){t.data.event.commandName!=="ismaster"&&ete.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");tte.subscriber=v1a;function C1a(t,e){if(t){var r=ete.find(function(n){return n==e});if(r)return;ete.length===0&&jEr.channel.subscribe("mongodb",tte.subscriber,jEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(_1a.StatsbeatInstrumentation.MONGODB)}),ete.push(e)}else ete=ete.filter(function(n){return n!=e}),ete.length===0&&jEr.channel.unsubscribe("mongodb",tte.subscriber)}a(C1a,"enable")});var Sbi=I(nte=>{"use strict";p();Object.defineProperty(nte,"__esModule",{value:!0});nte.subscriber=void 0;nte.enable=T1a;var b1a=md(),HEr=Cp(),rte=[],S1a=a(function(t){rte.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");nte.subscriber=S1a;function T1a(t,e){if(t){var r=rte.find(function(n){return n==e});if(r)return;rte.length===0&&HEr.channel.subscribe("mysql",nte.subscriber,HEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(b1a.StatsbeatInstrumentation.MYSQL)}),rte.push(e)}else rte=rte.filter(function(n){return n!=e}),rte.length===0&&HEr.channel.unsubscribe("mysql",nte.subscriber)}a(T1a,"enable")});var Tbi=I(ote=>{"use strict";p();Object.defineProperty(ote,"__esModule",{value:!0});ote.subscriber=void 0;ote.enable=w1a;var I1a=md(),GEr=Cp(),ite=[],x1a=a(function(t){ite.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");ote.subscriber=x1a;function w1a(t,e){if(t){var r=ite.find(function(n){return n==e});if(r)return;ite.length===0&&GEr.channel.subscribe("redis",ote.subscriber,GEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(I1a.StatsbeatInstrumentation.REDIS)}),ite.push(e)}else ite=ite.filter(function(n){return n!=e}),ite.length===0&&GEr.channel.unsubscribe("redis",ote.subscriber)}a(w1a,"enable")});var Ibi=I(ate=>{"use strict";p();Object.defineProperty(ate,"__esModule",{value:!0});ate.subscriber=void 0;ate.enable=P1a;var R1a=md(),$Er=Cp(),ste=[],k1a=a(function(t){ste.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");ate.subscriber=k1a;function P1a(t,e){if(t){var r=ste.find(function(n){return n==e});if(r)return;ste.length===0&&$Er.channel.subscribe("postgres",ate.subscriber,$Er.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(R1a.StatsbeatInstrumentation.POSTGRES)}),ste.push(e)}else ste=ste.filter(function(n){return n!=e}),ste.length===0&&$Er.channel.unsubscribe("postgres",ate.subscriber)}a(P1a,"enable")});var X0e=I((V8,xbi)=>{"use strict";p();var D1a=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]})),N1a=V8&&V8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M1a=V8&&V8.__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)&&D1a(e,t,r);return N1a(e,t),e},Bmt=V8&&V8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var wbi=require("http"),Rbi=require("https"),kbi=Kl(),Pbi=ay(),F1a=S0e(),WEr=Eyr(),W8=AG(),U1a=kmt(),Q1a=(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||U1a.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?W8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&W8.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 W8.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 WEr(e),c=this._generateCorrelationContext(s);W8.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){W8.CorrelationContextManager.wrapEmitter(c),W8.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=wbi.createServer;wbi.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=Rbi.createServer;Rbi.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){kbi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=W8.CorrelationContextManager.getCurrentContext(),o=new WEr(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){kbi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=W8.CorrelationContextManager.getCurrentContext(),s=n||new WEr(r.request,o&&o.operation.parentId);Pbi.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(F1a.requestContextHeader);Pbi.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,W8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();Dbi.exports=Q1a});var Obi=I((KEr,Mbi)=>{"use strict";p();var CR=KEr&&KEr.__assign||function(){return CR=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:H1a,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 cte.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case cte.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case cte.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case cte.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case cte.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=CR(CR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=CR(CR({},r),{Message:e.data.baseData.message,SeverityLevel:cte.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=CR(CR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=CR(CR({},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=CR(CR({},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=Nbi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Nbi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):j1a.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 cte.ContextTagKeys,t})();Mbi.exports=G1a});var Bbi=I((nAp,Lbi)=>{"use strict";p();var $1a=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Lbi.exports={getTransmissionTime:$1a}});var qbi=I((OOe,Qbi)=>{"use strict";p();var Fbi=OOe&&OOe.__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())})},Ubi=OOe&&OOe.__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=bR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[bR.time]=z1a.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:",JEr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=ZEr.tlsRestrictedAgent,h=V1a.request(l,function(E){if(E.statusCode==200){var _=E.headers[bR.subscribed]==="true",v=null;try{v=E.headers[bR.endpointRedirect]?new Y1a.URL(E.headers[bR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+ZEr.dumpObj(T))}var b=E.headers[bR.pollingIntervalHint]?parseInt(E.headers[bR.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:"),JEr.warn(t.TAG,r,e)):JEr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();Qbi.exports=K1a});var Wbi=I((LOe,Vbi)=>{"use strict";p();var jbi=LOe&&LOe.__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())})},Hbi=LOe&&LOe.__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 jbi(this,void 0,void 0,function(){return Hbi(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&&(Gbi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,Gbi.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})();Vbi.exports=X1a});var Ybi=I(ege=>{"use strict";p();var Qmt=ege&&ege.__assign||function(){return Qmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var Kbi=SG&&SG.__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())})},Jbi=SG&&SG.__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 oSa=Qee(),Xbi=LEr(),sSa=Kl(),e1i=md(),aSa=require("url"),cSa=tpt(),lSa=(function(){function t(e){this._endpointBase=e1i.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=Xbi.parse(e),o=Xbi.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]||e1i.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new aSa.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=oSa.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)||sSa.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=cSa.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})();t1i.exports=lSa});var i_r=I(n_r=>{"use strict";p();Object.defineProperty(n_r,"__esModule",{value:!0});n_r.createEmptyPipeline=uSa;var r1i=new Set(["Deserialize","Serialize","Retry","Sign"]),r_r=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&&!r1i.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!r1i.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 uSa(){return r_r.create()}a(uSa,"createEmptyPipeline")});var lte=I(jmt=>{"use strict";p();Object.defineProperty(jmt,"__esModule",{value:!0});jmt.logger=void 0;var dSa=sht();jmt.logger=(0,dSa.createClientLogger)("core-rest-pipeline")});var s_r=I(o_r=>{"use strict";p();Object.defineProperty(o_r,"__esModule",{value:!0});o_r.getRandomIntegerInclusive=fSa;function fSa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(fSa,"getRandomIntegerInclusive")});var n1i=I(a_r=>{"use strict";p();Object.defineProperty(a_r,"__esModule",{value:!0});a_r.calculateRetryDelay=hSa;var pSa=s_r();function hSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,pSa.getRandomIntegerInclusive)(0,n/2)}}a(hSa,"calculateRetryDelay")});var Hmt=I(c_r=>{"use strict";p();Object.defineProperty(c_r,"__esModule",{value:!0});c_r.isObject=mSa;function mSa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(mSa,"isObject")});var i1i=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.isError=ASa;var gSa=Hmt();function ASa(t){if((0,gSa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(ASa,"isError")});var s1i=I(Gmt=>{"use strict";p();Object.defineProperty(Gmt,"__esModule",{value:!0});Gmt.computeSha256Hmac=ySa;Gmt.computeSha256Hash=ESa;var o1i=require("node:crypto");async function ySa(t,e,r){let n=Buffer.from(t,"base64");return(0,o1i.createHmac)("sha256",n).update(e).digest(r)}a(ySa,"computeSha256Hmac");async function ESa(t,e){return(0,o1i.createHash)("sha256").update(t).digest(e)}a(ESa,"computeSha256Hash")});var a1i=I(d_r=>{"use strict";p();var u_r;Object.defineProperty(d_r,"__esModule",{value:!0});d_r.randomUUID=CSa;var _Sa=require("node:crypto"),vSa=typeof((u_r=globalThis?.crypto)===null||u_r===void 0?void 0:u_r.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):_Sa.randomUUID;function CSa(){return vSa()}a(CSa,"randomUUID")});var c1i=I(S0=>{"use strict";p();var f_r,p_r,h_r,m_r;Object.defineProperty(S0,"__esModule",{value:!0});S0.isReactNative=S0.isNodeRuntime=S0.isNodeLike=S0.isBun=S0.isDeno=S0.isWebWorker=S0.isBrowser=void 0;S0.isBrowser=typeof window<"u"&&typeof window.document<"u";S0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((f_r=self.constructor)===null||f_r===void 0?void 0:f_r.name)==="DedicatedWorkerGlobalScope"||((p_r=self.constructor)===null||p_r===void 0?void 0:p_r.name)==="ServiceWorkerGlobalScope"||((h_r=self.constructor)===null||h_r===void 0?void 0:h_r.name)==="SharedWorkerGlobalScope");S0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";S0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";S0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((m_r=globalThis.process.versions)===null||m_r===void 0)&&m_r.node);S0.isNodeRuntime=S0.isNodeLike&&!S0.isBun&&!S0.isDeno;S0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var l1i=I($mt=>{"use strict";p();Object.defineProperty($mt,"__esModule",{value:!0});$mt.uint8ArrayToString=bSa;$mt.stringToUint8Array=SSa;function bSa(t,e){return Buffer.from(t).toString(e)}a(bSa,"uint8ArrayToString");function SSa(t,e){return Buffer.from(t,e)}a(SSa,"stringToUint8Array")});var u1i=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.Sanitizer=void 0;var TSa=Hmt(),g_r="REDACTED",ISa=["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"],xSa=["api-version"],A_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=ISa.concat(e),r=xSa.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,TSa.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,g_r);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]=g_r;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]=g_r;return r}};Vmt.Sanitizer=A_r});var Wmt=I(Aa=>{"use strict";p();Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Sanitizer=Aa.uint8ArrayToString=Aa.stringToUint8Array=Aa.isWebWorker=Aa.isReactNative=Aa.isDeno=Aa.isNodeRuntime=Aa.isNodeLike=Aa.isBun=Aa.isBrowser=Aa.randomUUID=Aa.computeSha256Hmac=Aa.computeSha256Hash=Aa.isError=Aa.isObject=Aa.getRandomIntegerInclusive=Aa.calculateRetryDelay=void 0;var wSa=n1i();Object.defineProperty(Aa,"calculateRetryDelay",{enumerable:!0,get:a(function(){return wSa.calculateRetryDelay},"get")});var RSa=s_r();Object.defineProperty(Aa,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return RSa.getRandomIntegerInclusive},"get")});var kSa=Hmt();Object.defineProperty(Aa,"isObject",{enumerable:!0,get:a(function(){return kSa.isObject},"get")});var PSa=i1i();Object.defineProperty(Aa,"isError",{enumerable:!0,get:a(function(){return PSa.isError},"get")});var d1i=s1i();Object.defineProperty(Aa,"computeSha256Hash",{enumerable:!0,get:a(function(){return d1i.computeSha256Hash},"get")});Object.defineProperty(Aa,"computeSha256Hmac",{enumerable:!0,get:a(function(){return d1i.computeSha256Hmac},"get")});var DSa=a1i();Object.defineProperty(Aa,"randomUUID",{enumerable:!0,get:a(function(){return DSa.randomUUID},"get")});var ute=c1i();Object.defineProperty(Aa,"isBrowser",{enumerable:!0,get:a(function(){return ute.isBrowser},"get")});Object.defineProperty(Aa,"isBun",{enumerable:!0,get:a(function(){return ute.isBun},"get")});Object.defineProperty(Aa,"isNodeLike",{enumerable:!0,get:a(function(){return ute.isNodeLike},"get")});Object.defineProperty(Aa,"isNodeRuntime",{enumerable:!0,get:a(function(){return ute.isNodeRuntime},"get")});Object.defineProperty(Aa,"isDeno",{enumerable:!0,get:a(function(){return ute.isDeno},"get")});Object.defineProperty(Aa,"isReactNative",{enumerable:!0,get:a(function(){return ute.isReactNative},"get")});Object.defineProperty(Aa,"isWebWorker",{enumerable:!0,get:a(function(){return ute.isWebWorker},"get")});var f1i=l1i();Object.defineProperty(Aa,"stringToUint8Array",{enumerable:!0,get:a(function(){return f1i.stringToUint8Array},"get")});Object.defineProperty(Aa,"uint8ArrayToString",{enumerable:!0,get:a(function(){return f1i.uint8ArrayToString},"get")});var NSa=u1i();Object.defineProperty(Aa,"Sanitizer",{enumerable:!0,get:a(function(){return NSa.Sanitizer},"get")})});var p1i=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.cancelablePromiseRace=MSa;async function MSa(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(MSa,"cancelablePromiseRace")});var h1i=I(zmt=>{"use strict";p();Object.defineProperty(zmt,"__esModule",{value:!0});zmt.AbortError=void 0;var E_r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};zmt.AbortError=E_r});var FOe=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.AbortError=void 0;var OSa=h1i();Object.defineProperty(Ymt,"AbortError",{enumerable:!0,get:a(function(){return OSa.AbortError},"get")})});var v_r=I(__r=>{"use strict";p();Object.defineProperty(__r,"__esModule",{value:!0});__r.createAbortablePromise=BSa;var LSa=FOe();function BSa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new LSa.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(BSa,"createAbortablePromise")});var m1i=I(Kmt=>{"use strict";p();Object.defineProperty(Kmt,"__esModule",{value:!0});Kmt.delay=qSa;Kmt.calculateRetryDelay=jSa;var FSa=v_r(),USa=Wmt(),QSa="The delay was aborted.";function qSa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,FSa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??QSa})}a(qSa,"delay");function jSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,USa.getRandomIntegerInclusive)(0,n/2)}}a(jSa,"calculateRetryDelay")});var g1i=I(C_r=>{"use strict";p();Object.defineProperty(C_r,"__esModule",{value:!0});C_r.getErrorMessage=GSa;var HSa=Wmt();function GSa(t){if((0,HSa.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(GSa,"getErrorMessage")});var y1i=I(UOe=>{"use strict";p();Object.defineProperty(UOe,"__esModule",{value:!0});UOe.isDefined=b_r;UOe.isObjectWithProperties=$Sa;UOe.objectHasProperty=A1i;function b_r(t){return typeof t<"u"&&t!==null}a(b_r,"isDefined");function $Sa(t,e){if(!b_r(t)||typeof t!="object")return!1;for(let r of e)if(!A1i(t,r))return!1;return!0}a($Sa,"isObjectWithProperties");function A1i(t,e){return b_r(t)&&typeof t=="object"&&e in t}a(A1i,"objectHasProperty")});var O4=I(ls=>{"use strict";p();Object.defineProperty(ls,"__esModule",{value:!0});ls.isWebWorker=ls.isReactNative=ls.isNodeRuntime=ls.isNodeLike=ls.isNode=ls.isDeno=ls.isBun=ls.isBrowser=ls.objectHasProperty=ls.isObjectWithProperties=ls.isDefined=ls.getErrorMessage=ls.delay=ls.createAbortablePromise=ls.cancelablePromiseRace=void 0;ls.calculateRetryDelay=JSa;ls.computeSha256Hash=ZSa;ls.computeSha256Hmac=XSa;ls.getRandomIntegerInclusive=eTa;ls.isError=tTa;ls.isObject=rTa;ls.randomUUID=nTa;ls.uint8ArrayToString=iTa;ls.stringToUint8Array=oTa;var VSa=(m3(),ba(iQ)),dy=VSa.__importStar(Wmt()),WSa=p1i();Object.defineProperty(ls,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return WSa.cancelablePromiseRace},"get")});var zSa=v_r();Object.defineProperty(ls,"createAbortablePromise",{enumerable:!0,get:a(function(){return zSa.createAbortablePromise},"get")});var YSa=m1i();Object.defineProperty(ls,"delay",{enumerable:!0,get:a(function(){return YSa.delay},"get")});var KSa=g1i();Object.defineProperty(ls,"getErrorMessage",{enumerable:!0,get:a(function(){return KSa.getErrorMessage},"get")});var S_r=y1i();Object.defineProperty(ls,"isDefined",{enumerable:!0,get:a(function(){return S_r.isDefined},"get")});Object.defineProperty(ls,"isObjectWithProperties",{enumerable:!0,get:a(function(){return S_r.isObjectWithProperties},"get")});Object.defineProperty(ls,"objectHasProperty",{enumerable:!0,get:a(function(){return S_r.objectHasProperty},"get")});function JSa(t,e){return dy.calculateRetryDelay(t,e)}a(JSa,"calculateRetryDelay");function ZSa(t,e){return dy.computeSha256Hash(t,e)}a(ZSa,"computeSha256Hash");function XSa(t,e,r){return dy.computeSha256Hmac(t,e,r)}a(XSa,"computeSha256Hmac");function eTa(t,e){return dy.getRandomIntegerInclusive(t,e)}a(eTa,"getRandomIntegerInclusive");function tTa(t){return dy.isError(t)}a(tTa,"isError");function rTa(t){return dy.isObject(t)}a(rTa,"isObject");function nTa(){return dy.randomUUID()}a(nTa,"randomUUID");ls.isBrowser=dy.isBrowser;ls.isBun=dy.isBun;ls.isDeno=dy.isDeno;ls.isNode=dy.isNodeLike;ls.isNodeLike=dy.isNodeLike;ls.isNodeRuntime=dy.isNodeRuntime;ls.isReactNative=dy.isReactNative;ls.isWebWorker=dy.isWebWorker;function iTa(t,e){return dy.uint8ArrayToString(t,e)}a(iTa,"uint8ArrayToString");function oTa(t,e){return dy.stringToUint8Array(t,e)}a(oTa,"stringToUint8Array")});var Zmt=I(Jmt=>{"use strict";p();Object.defineProperty(Jmt,"__esModule",{value:!0});Jmt.Sanitizer=void 0;var sTa=O4(),T_r="REDACTED",aTa=["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"],cTa=["api-version"],I_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=aTa.concat(e),r=cTa.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,sTa.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,T_r);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]=T_r;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]=T_r;return r}};Jmt.Sanitizer=I_r});var x_r=I(tge=>{"use strict";p();Object.defineProperty(tge,"__esModule",{value:!0});tge.logPolicyName=void 0;tge.logPolicy=dTa;var lTa=lte(),uTa=Zmt();tge.logPolicyName="logPolicy";function dTa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:lTa.logger.info,n=new uTa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:tge.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(dTa,"logPolicy")});var w_r=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.redirectPolicyName=void 0;rge.redirectPolicy=fTa;rge.redirectPolicyName="redirectPolicy";var E1i=["GET","HEAD"];function fTa(t={}){let{maxRetries:e=20}=t;return{name:rge.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return _1i(n,o,e)}}}a(fTa,"redirectPolicy");async function _1i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&E1i.includes(o.method)||s===302&&E1i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(Xmt,"__esModule",{value:!0});Xmt.getHeaderName=pTa;Xmt.setPlatformSpecificData=hTa;var v1i=(m3(),ba(iQ)),R_r=v1i.__importStar(require("node:os")),k_r=v1i.__importStar(require("node:process"));function pTa(){return"User-Agent"}a(pTa,"getHeaderName");async function hTa(t){if(k_r&&k_r.versions){let e=k_r.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",`(${R_r.arch()}-${R_r.type()}-${R_r.release()})`)}a(hTa,"setPlatformSpecificData")});var TG=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.DEFAULT_RETRY_POLICY_COUNT=nge.SDK_VERSION=void 0;nge.SDK_VERSION="1.16.3";nge.DEFAULT_RETRY_POLICY_COUNT=3});var P_r=I(e0t=>{"use strict";p();Object.defineProperty(e0t,"__esModule",{value:!0});e0t.getUserAgentHeaderName=ATa;e0t.getUserAgentValue=yTa;var b1i=C1i(),mTa=TG();function gTa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(gTa,"getUserAgentString");function ATa(){return(0,b1i.getHeaderName)()}a(ATa,"getUserAgentHeaderName");async function yTa(t){let e=new Map;e.set("core-rest-pipeline",mTa.SDK_VERSION),await(0,b1i.setPlatformSpecificData)(e);let r=gTa(e);return t?`${t} ${r}`:r}a(yTa,"getUserAgentValue")});var D_r=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.userAgentPolicyName=void 0;ige.userAgentPolicy=ETa;var T1i=P_r(),S1i=(0,T1i.getUserAgentHeaderName)();ige.userAgentPolicyName="userAgentPolicy";function ETa(t={}){let e=(0,T1i.getUserAgentValue)(t.userAgentPrefix);return{name:ige.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(S1i)||r.headers.set(S1i,await e),n(r)}}}a(ETa,"userAgentPolicy")});var t0t=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.isNodeReadableStream=I1i;oge.isWebReadableStream=x1i;oge.isReadableStream=_Ta;oge.isBlob=vTa;function I1i(t){return!!(t&&typeof t.pipe=="function")}a(I1i,"isNodeReadableStream");function x1i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(x1i,"isWebReadableStream");function _Ta(t){return I1i(t)||x1i(t)}a(_Ta,"isReadableStream");function vTa(t){return typeof t.stream=="function"}a(vTa,"isBlob")});var N_r=I(QOe=>{"use strict";p();Object.defineProperty(QOe,"__esModule",{value:!0});QOe.getRawContent=TTa;QOe.createFileFromStream=ITa;QOe.createFile=xTa;var CTa=O4(),bTa=t0t(),w1i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},r0t=Symbol("rawContent");function STa(t){return typeof t[r0t]=="function"}a(STa,"hasRawContent");function TTa(t){return STa(t)?t[r0t]():t.stream()}a(TTa,"getRawContent");function ITa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},w1i),{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,bTa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[r0t]:t})}a(ITa,"createFileFromStream");function xTa(t,e,r={}){var n,o,s;return CTa.isNodeLike?Object.assign(Object.assign({},w1i),{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"),[r0t]:()=>t}):new File([t],e,r)}a(xTa,"createFile")});var P1i=I(O_r=>{"use strict";p();Object.defineProperty(O_r,"__esModule",{value:!0});O_r.concat=DTa;var z8=(m3(),ba(iQ)),M_r=require("node:stream"),wTa=t0t(),RTa=N_r();function R1i(){return z8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield z8.__await(e.read());if(r)return yield z8.__await(void 0);yield yield z8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(R1i,"streamAsyncIterator");function kTa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=R1i.bind(t)),t.values||(t.values=R1i.bind(t))}a(kTa,"makeAsyncIterable");function PTa(t){return t instanceof ReadableStream?(kTa(t),M_r.Readable.fromWeb(t)):t}a(PTa,"ensureNodeStream");function k1i(t){return t instanceof Uint8Array?M_r.Readable.from(Buffer.from(t)):(0,wTa.isBlob)(t)?k1i((0,RTa.getRawContent)(t)):PTa(t)}a(k1i,"toStream");async function DTa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(k1i);return M_r.Readable.from((function(){return z8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,z8.__asyncValues(d)),u;u=yield z8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield z8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield z8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(DTa,"concat")});var L_r=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.multipartPolicyName=void 0;sge.multipartPolicy=HTa;var dte=O4(),NTa=P1i(),MTa=t0t();function OTa(){return`----AzSDKFormBoundary${(0,dte.randomUUID)()}`}a(OTa,"generateBoundary");function LTa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(LTa,"encodeHeaders");function BTa(t){return t instanceof Uint8Array?t.byteLength:(0,MTa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(BTa,"getLength");function FTa(t){let e=0;for(let r of t){let n=BTa(r);if(n===void 0)return;e+=n}return e}a(FTa,"getTotalLength");async function UTa(t,e,r){let n=[(0,dte.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,dte.stringToUint8Array)(`\r -`,"utf-8"),(0,dte.stringToUint8Array)(LTa(s.headers),"utf-8"),(0,dte.stringToUint8Array)(`\r -`,"utf-8"),s.body,(0,dte.stringToUint8Array)(`\r ---${r}`,"utf-8")]),(0,dte.stringToUint8Array)(`--\r +`),r+=c;break}}})}catch{this._isEnabled=!1,O4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=gbi.createServer,r=Abi.createServer,n=this._isEnabled;gbi.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=CR.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){O4.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=CR.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){O4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},Abi.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=CR.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){O4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=CR.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){O4.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=CR.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){O4.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=CR.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=CR.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){O4.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 CR.contentEncodingMethod.GZIP:var o=K0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=K0e.gzipSync(s)}break;case CR.contentEncodingMethod.DEFLATE:var c=K0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=K0e.deflateSync(l)}break;case CR.contentEncodingMethod.BR:var u=CR.getBrotliDecompressSync(K0e),d=CR.getBrotliCompressSync(K0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){O4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();_bi.exports=s1a});var bbi=I((jEr,Cbi)=>{"use strict";p();var a1a=jEr&&jEr.__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)}})(),bR=require("url"),qEr=OE(),c1a=cy(),l1a=I0e(),u1a=Eyr(),d1a=qee(),f1a=(function(t){a1a(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=c1a.getCorrelationContextTarget(r,l1a.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=qEr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new bR.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=qEr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==d1a.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=qEr.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 bR.URL(r)}catch{}else try{var o=new bR.URL("http://"+r);o.port==="443"?r=new bR.URL("https://"+r):r=new bR.URL("http://"+r)}catch{}else{if(r&&typeof bR.URL=="function"&&r instanceof bR.URL)return bR.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 bR.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 bR.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 bR.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",bR.format(r)},e})(u1a);Cbi.exports=f1a});var Sbi=I(J0e=>{"use strict";p();var Qmt=J0e&&J0e.__assign||function(){return Qmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var A1a=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]})),y1a=W8&&W8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E1a=W8&&W8.__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)&&A1a(e,t,r);return y1a(e,t),e};Object.defineProperty(W8,"__esModule",{value:!0});W8.spanToTelemetryContract=I1a;var Tbi=require("url"),lD=(co(),Sa(z5)),_s=(Cht(),Sa(RAr)),V8=E1a(Ad()),_1a=Sbi(),v1a=cy();function C1a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=v1a.stringify(s)),e}a(C1a,"createPropertiesFromSpan");function b1a(t){return t===_s.DbSystemValues.DB2||t===_s.DbSystemValues.DERBY||t===_s.DbSystemValues.MARIADB||t===_s.DbSystemValues.MSSQL||t===_s.DbSystemValues.ORACLE||t===_s.DbSystemValues.SQLITE||t===_s.DbSystemValues.OTHER_SQL||t===_s.DbSystemValues.HSQLDB||t===_s.DbSystemValues.H2}a(b1a,"isSqlDB");function Ibi(t){var e=t.attributes[_s.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[_s.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[_s.SemanticAttributes.HTTP_SCHEME],o=t.attributes[_s.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[_s.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[_s.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[_s.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[_s.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(Ibi,"getUrl");function GEr(t){var e=t.attributes[_s.SemanticAttributes.PEER_SERVICE],r=t.attributes[_s.SemanticAttributes.HTTP_HOST],n=t.attributes[_s.SemanticAttributes.HTTP_URL],o=t.attributes[_s.SemanticAttributes.NET_PEER_NAME],s=t.attributes[_s.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(GEr,"getDependencyTarget");function S1a(t){var e={name:t.name,success:t.status.code!=lD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===lD.SpanKind.PRODUCER&&(e.dependencyTypeName=V8.DependencyTypeName.QueueMessage),t.kind===lD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=V8.DependencyTypeName.InProc);var r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.DB_SYSTEM],o=t.attributes[_s.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=V8.DependencyTypeName.Http;var s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new Tbi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=Ibi(t);var u=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=GEr(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)===_s.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===_s.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===_s.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===_s.DbSystemValues.REDIS?e.dependencyTypeName="redis":b1a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[_s.SemanticAttributes.DB_STATEMENT],y=t.attributes[_s.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=GEr(t),E=t.attributes[_s.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=V8.DependencyTypeName.Grpc;var _=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=GEr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(S1a,"createDependencyData");function T1a(t){var e={name:t.name,success:t.status.code!=lD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==lD.SpanKind.SERVER){var o=t.attributes[_s.SemanticAttributes.HTTP_ROUTE],s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new Tbi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=Ibi(t);var l=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(T1a,"createRequestData");function I1a(t){var e;switch(t.kind){case lD.SpanKind.CLIENT:case lD.SpanKind.PRODUCER:case lD.SpanKind.INTERNAL:e=S1a(t);break;case lD.SpanKind.SERVER:case lD.SpanKind.CONSUMER:e=T1a(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=C1a(t),t.attributes[V8.AzNamespace]&&(t.kind===lD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(V8.DependencyTypeName.InProc," | ").concat(t.attributes[V8.AzNamespace])),t.attributes[V8.AzNamespace]===V8.MicrosoftEventHub&&(0,_1a.parseEventHubSpan)(t,e)),e}a(I1a,"spanToTelemetryContract")});var Rbi=I(IG=>{"use strict";p();var Z0e=IG&&IG.__assign||function(){return Z0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var w1a=KT&&KT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R1a=KT&&KT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),k1a=KT&&KT.__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)&&w1a(e,t,r);return R1a(e,t),e};Object.defineProperty(KT,"__esModule",{value:!0});KT.subscriber=void 0;KT.enable=O1a;var BOe=(co(),Sa(z5)),P1a=Ad(),$Er=Sp(),D1a=k1a(xbi()),N1a=Rbi(),ete=[],M1a=a(function(t){try{var e=t.data,r=D1a.spanToTelemetryContract(e);N1a.AsyncScopeManager.with(e,function(){ete.forEach(function(n){e.kind===BOe.SpanKind.SERVER||e.kind===BOe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===BOe.SpanKind.CLIENT||e.kind===BOe.SpanKind.INTERNAL||e.kind===BOe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");KT.subscriber=M1a;function O1a(t,e){if(t){var r=ete.find(function(n){return n==e});if(r)return;ete.length===0&&$Er.channel.subscribe("azure-coretracing",KT.subscriber,$Er.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(P1a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),ete.push(e)}else ete=ete.filter(function(n){return n!=e}),ete.length===0&&$Er.channel.unsubscribe("azure-coretracing",KT.subscriber)}a(O1a,"enable")});var Pbi=I(rte=>{"use strict";p();Object.defineProperty(rte,"__esModule",{value:!0});rte.subscriber=void 0;rte.enable=F1a;var L1a=Ad(),VEr=Sp(),tte=[],B1a=a(function(t){t.data.event.commandName!=="ismaster"&&tte.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");rte.subscriber=B1a;function F1a(t,e){if(t){var r=tte.find(function(n){return n==e});if(r)return;tte.length===0&&VEr.channel.subscribe("mongodb",rte.subscriber,VEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(L1a.StatsbeatInstrumentation.MONGODB)}),tte.push(e)}else tte=tte.filter(function(n){return n!=e}),tte.length===0&&VEr.channel.unsubscribe("mongodb",rte.subscriber)}a(F1a,"enable")});var Dbi=I(ite=>{"use strict";p();Object.defineProperty(ite,"__esModule",{value:!0});ite.subscriber=void 0;ite.enable=q1a;var U1a=Ad(),WEr=Sp(),nte=[],Q1a=a(function(t){nte.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");ite.subscriber=Q1a;function q1a(t,e){if(t){var r=nte.find(function(n){return n==e});if(r)return;nte.length===0&&WEr.channel.subscribe("mysql",ite.subscriber,WEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(U1a.StatsbeatInstrumentation.MYSQL)}),nte.push(e)}else nte=nte.filter(function(n){return n!=e}),nte.length===0&&WEr.channel.unsubscribe("mysql",ite.subscriber)}a(q1a,"enable")});var Nbi=I(ste=>{"use strict";p();Object.defineProperty(ste,"__esModule",{value:!0});ste.subscriber=void 0;ste.enable=G1a;var j1a=Ad(),zEr=Sp(),ote=[],H1a=a(function(t){ote.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");ste.subscriber=H1a;function G1a(t,e){if(t){var r=ote.find(function(n){return n==e});if(r)return;ote.length===0&&zEr.channel.subscribe("redis",ste.subscriber,zEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(j1a.StatsbeatInstrumentation.REDIS)}),ote.push(e)}else ote=ote.filter(function(n){return n!=e}),ote.length===0&&zEr.channel.unsubscribe("redis",ste.subscriber)}a(G1a,"enable")});var Mbi=I(cte=>{"use strict";p();Object.defineProperty(cte,"__esModule",{value:!0});cte.subscriber=void 0;cte.enable=W1a;var $1a=Ad(),YEr=Sp(),ate=[],V1a=a(function(t){ate.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");cte.subscriber=V1a;function W1a(t,e){if(t){var r=ate.find(function(n){return n==e});if(r)return;ate.length===0&&YEr.channel.subscribe("postgres",cte.subscriber,YEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation($1a.StatsbeatInstrumentation.POSTGRES)}),ate.push(e)}else ate=ate.filter(function(n){return n!=e}),ate.length===0&&YEr.channel.unsubscribe("postgres",cte.subscriber)}a(W1a,"enable")});var tge=I((z8,Obi)=>{"use strict";p();var z1a=z8&&z8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y1a=z8&&z8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K1a=z8&&z8.__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)&&z1a(e,t,r);return Y1a(e,t),e},qmt=z8&&z8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var Lbi=require("http"),Bbi=require("https"),Fbi=Kl(),Ubi=cy(),eSa=I0e(),JEr=byr(),Y8=vG(),tSa=Mmt(),rSa=(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||tSa.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?Y8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&Y8.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 Y8.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 JEr(e),c=this._generateCorrelationContext(s);Y8.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){Y8.CorrelationContextManager.wrapEmitter(c),Y8.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=Lbi.createServer;Lbi.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=Bbi.createServer;Bbi.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){Fbi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=Y8.CorrelationContextManager.getCurrentContext(),o=new JEr(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){Fbi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=Y8.CorrelationContextManager.getCurrentContext(),s=n||new JEr(r.request,o&&o.operation.parentId);Ubi.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(eSa.requestContextHeader);Ubi.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,Y8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();Qbi.exports=rSa});var Hbi=I((e_r,jbi)=>{"use strict";p();var SR=e_r&&e_r.__assign||function(){return SR=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:oSa,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 lte.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case lte.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case lte.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case lte.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case lte.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=SR(SR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=SR(SR({},r),{Message:e.data.baseData.message,SeverityLevel:lte.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=SR(SR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=SR(SR({},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=SR(SR({},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=qbi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=qbi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):iSa.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 lte.ContextTagKeys,t})();jbi.exports=sSa});var $bi=I((TAp,Gbi)=>{"use strict";p();var aSa=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Gbi.exports={getTransmissionTime:aSa}});var Ybi=I((QOe,zbi)=>{"use strict";p();var Vbi=QOe&&QOe.__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())})},Wbi=QOe&&QOe.__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=TR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[TR.time]=uSa.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:",t_r.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=r_r.tlsRestrictedAgent,h=cSa.request(l,function(E){if(E.statusCode==200){var _=E.headers[TR.subscribed]==="true",v=null;try{v=E.headers[TR.endpointRedirect]?new dSa.URL(E.headers[TR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+r_r.dumpObj(T))}var b=E.headers[TR.pollingIntervalHint]?parseInt(E.headers[TR.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:"),t_r.warn(t.TAG,r,e)):t_r.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();zbi.exports=fSa});var t1i=I((qOe,e1i)=>{"use strict";p();var Kbi=qOe&&qOe.__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())})},Jbi=qOe&&qOe.__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 Kbi(this,void 0,void 0,function(){return Jbi(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&&(Zbi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,Zbi.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})();e1i.exports=mSa});var n1i=I(rge=>{"use strict";p();var Gmt=rge&&rge.__assign||function(){return Gmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var i1i=wG&&wG.__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())})},o1i=wG&&wG.__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 vSa=qee(),a1i=QEr(),CSa=Kl(),c1i=Ad(),bSa=require("url"),SSa=opt(),TSa=(function(){function t(e){this._endpointBase=c1i.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=a1i.parse(e),o=a1i.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]||c1i.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new bSa.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=vSa.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)||CSa.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=SSa.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})();l1i.exports=TSa});var c_r=I(a_r=>{"use strict";p();Object.defineProperty(a_r,"__esModule",{value:!0});a_r.createEmptyPipeline=ISa;var u1i=new Set(["Deserialize","Serialize","Retry","Sign"]),s_r=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&&!u1i.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!u1i.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 ISa(){return s_r.create()}a(ISa,"createEmptyPipeline")});var ute=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.logger=void 0;var xSa=uht();Vmt.logger=(0,xSa.createClientLogger)("core-rest-pipeline")});var u_r=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.getRandomIntegerInclusive=wSa;function wSa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(wSa,"getRandomIntegerInclusive")});var d1i=I(d_r=>{"use strict";p();Object.defineProperty(d_r,"__esModule",{value:!0});d_r.calculateRetryDelay=kSa;var RSa=u_r();function kSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,RSa.getRandomIntegerInclusive)(0,n/2)}}a(kSa,"calculateRetryDelay")});var Wmt=I(f_r=>{"use strict";p();Object.defineProperty(f_r,"__esModule",{value:!0});f_r.isObject=PSa;function PSa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(PSa,"isObject")});var f1i=I(p_r=>{"use strict";p();Object.defineProperty(p_r,"__esModule",{value:!0});p_r.isError=NSa;var DSa=Wmt();function NSa(t){if((0,DSa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(NSa,"isError")});var h1i=I(zmt=>{"use strict";p();Object.defineProperty(zmt,"__esModule",{value:!0});zmt.computeSha256Hmac=MSa;zmt.computeSha256Hash=OSa;var p1i=require("node:crypto");async function MSa(t,e,r){let n=Buffer.from(t,"base64");return(0,p1i.createHmac)("sha256",n).update(e).digest(r)}a(MSa,"computeSha256Hmac");async function OSa(t,e){return(0,p1i.createHash)("sha256").update(t).digest(e)}a(OSa,"computeSha256Hash")});var m1i=I(m_r=>{"use strict";p();var h_r;Object.defineProperty(m_r,"__esModule",{value:!0});m_r.randomUUID=FSa;var LSa=require("node:crypto"),BSa=typeof((h_r=globalThis?.crypto)===null||h_r===void 0?void 0:h_r.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):LSa.randomUUID;function FSa(){return BSa()}a(FSa,"randomUUID")});var g1i=I(T0=>{"use strict";p();var g_r,A_r,y_r,E_r;Object.defineProperty(T0,"__esModule",{value:!0});T0.isReactNative=T0.isNodeRuntime=T0.isNodeLike=T0.isBun=T0.isDeno=T0.isWebWorker=T0.isBrowser=void 0;T0.isBrowser=typeof window<"u"&&typeof window.document<"u";T0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((g_r=self.constructor)===null||g_r===void 0?void 0:g_r.name)==="DedicatedWorkerGlobalScope"||((A_r=self.constructor)===null||A_r===void 0?void 0:A_r.name)==="ServiceWorkerGlobalScope"||((y_r=self.constructor)===null||y_r===void 0?void 0:y_r.name)==="SharedWorkerGlobalScope");T0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";T0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";T0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((E_r=globalThis.process.versions)===null||E_r===void 0)&&E_r.node);T0.isNodeRuntime=T0.isNodeLike&&!T0.isBun&&!T0.isDeno;T0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var A1i=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.uint8ArrayToString=USa;Ymt.stringToUint8Array=QSa;function USa(t,e){return Buffer.from(t).toString(e)}a(USa,"uint8ArrayToString");function QSa(t,e){return Buffer.from(t,e)}a(QSa,"stringToUint8Array")});var y1i=I(Kmt=>{"use strict";p();Object.defineProperty(Kmt,"__esModule",{value:!0});Kmt.Sanitizer=void 0;var qSa=Wmt(),__r="REDACTED",jSa=["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"],HSa=["api-version"],v_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=jSa.concat(e),r=HSa.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,qSa.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,__r);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]=__r;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]=__r;return r}};Kmt.Sanitizer=v_r});var Jmt=I(ya=>{"use strict";p();Object.defineProperty(ya,"__esModule",{value:!0});ya.Sanitizer=ya.uint8ArrayToString=ya.stringToUint8Array=ya.isWebWorker=ya.isReactNative=ya.isDeno=ya.isNodeRuntime=ya.isNodeLike=ya.isBun=ya.isBrowser=ya.randomUUID=ya.computeSha256Hmac=ya.computeSha256Hash=ya.isError=ya.isObject=ya.getRandomIntegerInclusive=ya.calculateRetryDelay=void 0;var GSa=d1i();Object.defineProperty(ya,"calculateRetryDelay",{enumerable:!0,get:a(function(){return GSa.calculateRetryDelay},"get")});var $Sa=u_r();Object.defineProperty(ya,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return $Sa.getRandomIntegerInclusive},"get")});var VSa=Wmt();Object.defineProperty(ya,"isObject",{enumerable:!0,get:a(function(){return VSa.isObject},"get")});var WSa=f1i();Object.defineProperty(ya,"isError",{enumerable:!0,get:a(function(){return WSa.isError},"get")});var E1i=h1i();Object.defineProperty(ya,"computeSha256Hash",{enumerable:!0,get:a(function(){return E1i.computeSha256Hash},"get")});Object.defineProperty(ya,"computeSha256Hmac",{enumerable:!0,get:a(function(){return E1i.computeSha256Hmac},"get")});var zSa=m1i();Object.defineProperty(ya,"randomUUID",{enumerable:!0,get:a(function(){return zSa.randomUUID},"get")});var dte=g1i();Object.defineProperty(ya,"isBrowser",{enumerable:!0,get:a(function(){return dte.isBrowser},"get")});Object.defineProperty(ya,"isBun",{enumerable:!0,get:a(function(){return dte.isBun},"get")});Object.defineProperty(ya,"isNodeLike",{enumerable:!0,get:a(function(){return dte.isNodeLike},"get")});Object.defineProperty(ya,"isNodeRuntime",{enumerable:!0,get:a(function(){return dte.isNodeRuntime},"get")});Object.defineProperty(ya,"isDeno",{enumerable:!0,get:a(function(){return dte.isDeno},"get")});Object.defineProperty(ya,"isReactNative",{enumerable:!0,get:a(function(){return dte.isReactNative},"get")});Object.defineProperty(ya,"isWebWorker",{enumerable:!0,get:a(function(){return dte.isWebWorker},"get")});var _1i=A1i();Object.defineProperty(ya,"stringToUint8Array",{enumerable:!0,get:a(function(){return _1i.stringToUint8Array},"get")});Object.defineProperty(ya,"uint8ArrayToString",{enumerable:!0,get:a(function(){return _1i.uint8ArrayToString},"get")});var YSa=y1i();Object.defineProperty(ya,"Sanitizer",{enumerable:!0,get:a(function(){return YSa.Sanitizer},"get")})});var v1i=I(C_r=>{"use strict";p();Object.defineProperty(C_r,"__esModule",{value:!0});C_r.cancelablePromiseRace=KSa;async function KSa(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(KSa,"cancelablePromiseRace")});var C1i=I(Zmt=>{"use strict";p();Object.defineProperty(Zmt,"__esModule",{value:!0});Zmt.AbortError=void 0;var b_r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};Zmt.AbortError=b_r});var HOe=I(Xmt=>{"use strict";p();Object.defineProperty(Xmt,"__esModule",{value:!0});Xmt.AbortError=void 0;var JSa=C1i();Object.defineProperty(Xmt,"AbortError",{enumerable:!0,get:a(function(){return JSa.AbortError},"get")})});var T_r=I(S_r=>{"use strict";p();Object.defineProperty(S_r,"__esModule",{value:!0});S_r.createAbortablePromise=XSa;var ZSa=HOe();function XSa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new ZSa.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(XSa,"createAbortablePromise")});var b1i=I(e0t=>{"use strict";p();Object.defineProperty(e0t,"__esModule",{value:!0});e0t.delay=nTa;e0t.calculateRetryDelay=iTa;var eTa=T_r(),tTa=Jmt(),rTa="The delay was aborted.";function nTa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,eTa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??rTa})}a(nTa,"delay");function iTa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,tTa.getRandomIntegerInclusive)(0,n/2)}}a(iTa,"calculateRetryDelay")});var S1i=I(I_r=>{"use strict";p();Object.defineProperty(I_r,"__esModule",{value:!0});I_r.getErrorMessage=sTa;var oTa=Jmt();function sTa(t){if((0,oTa.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(sTa,"getErrorMessage")});var I1i=I(GOe=>{"use strict";p();Object.defineProperty(GOe,"__esModule",{value:!0});GOe.isDefined=x_r;GOe.isObjectWithProperties=aTa;GOe.objectHasProperty=T1i;function x_r(t){return typeof t<"u"&&t!==null}a(x_r,"isDefined");function aTa(t,e){if(!x_r(t)||typeof t!="object")return!1;for(let r of e)if(!T1i(t,r))return!1;return!0}a(aTa,"isObjectWithProperties");function T1i(t,e){return x_r(t)&&typeof t=="object"&&e in t}a(T1i,"objectHasProperty")});var L4=I(ls=>{"use strict";p();Object.defineProperty(ls,"__esModule",{value:!0});ls.isWebWorker=ls.isReactNative=ls.isNodeRuntime=ls.isNodeLike=ls.isNode=ls.isDeno=ls.isBun=ls.isBrowser=ls.objectHasProperty=ls.isObjectWithProperties=ls.isDefined=ls.getErrorMessage=ls.delay=ls.createAbortablePromise=ls.cancelablePromiseRace=void 0;ls.calculateRetryDelay=pTa;ls.computeSha256Hash=hTa;ls.computeSha256Hmac=mTa;ls.getRandomIntegerInclusive=gTa;ls.isError=ATa;ls.isObject=yTa;ls.randomUUID=ETa;ls.uint8ArrayToString=_Ta;ls.stringToUint8Array=vTa;var cTa=(g3(),Sa(sQ)),fy=cTa.__importStar(Jmt()),lTa=v1i();Object.defineProperty(ls,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return lTa.cancelablePromiseRace},"get")});var uTa=T_r();Object.defineProperty(ls,"createAbortablePromise",{enumerable:!0,get:a(function(){return uTa.createAbortablePromise},"get")});var dTa=b1i();Object.defineProperty(ls,"delay",{enumerable:!0,get:a(function(){return dTa.delay},"get")});var fTa=S1i();Object.defineProperty(ls,"getErrorMessage",{enumerable:!0,get:a(function(){return fTa.getErrorMessage},"get")});var w_r=I1i();Object.defineProperty(ls,"isDefined",{enumerable:!0,get:a(function(){return w_r.isDefined},"get")});Object.defineProperty(ls,"isObjectWithProperties",{enumerable:!0,get:a(function(){return w_r.isObjectWithProperties},"get")});Object.defineProperty(ls,"objectHasProperty",{enumerable:!0,get:a(function(){return w_r.objectHasProperty},"get")});function pTa(t,e){return fy.calculateRetryDelay(t,e)}a(pTa,"calculateRetryDelay");function hTa(t,e){return fy.computeSha256Hash(t,e)}a(hTa,"computeSha256Hash");function mTa(t,e,r){return fy.computeSha256Hmac(t,e,r)}a(mTa,"computeSha256Hmac");function gTa(t,e){return fy.getRandomIntegerInclusive(t,e)}a(gTa,"getRandomIntegerInclusive");function ATa(t){return fy.isError(t)}a(ATa,"isError");function yTa(t){return fy.isObject(t)}a(yTa,"isObject");function ETa(){return fy.randomUUID()}a(ETa,"randomUUID");ls.isBrowser=fy.isBrowser;ls.isBun=fy.isBun;ls.isDeno=fy.isDeno;ls.isNode=fy.isNodeLike;ls.isNodeLike=fy.isNodeLike;ls.isNodeRuntime=fy.isNodeRuntime;ls.isReactNative=fy.isReactNative;ls.isWebWorker=fy.isWebWorker;function _Ta(t,e){return fy.uint8ArrayToString(t,e)}a(_Ta,"uint8ArrayToString");function vTa(t,e){return fy.stringToUint8Array(t,e)}a(vTa,"stringToUint8Array")});var r0t=I(t0t=>{"use strict";p();Object.defineProperty(t0t,"__esModule",{value:!0});t0t.Sanitizer=void 0;var CTa=L4(),R_r="REDACTED",bTa=["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"],STa=["api-version"],k_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=bTa.concat(e),r=STa.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,CTa.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,R_r);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]=R_r;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]=R_r;return r}};t0t.Sanitizer=k_r});var P_r=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.logPolicyName=void 0;nge.logPolicy=xTa;var TTa=ute(),ITa=r0t();nge.logPolicyName="logPolicy";function xTa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:TTa.logger.info,n=new ITa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:nge.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(xTa,"logPolicy")});var D_r=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.redirectPolicyName=void 0;ige.redirectPolicy=wTa;ige.redirectPolicyName="redirectPolicy";var x1i=["GET","HEAD"];function wTa(t={}){let{maxRetries:e=20}=t;return{name:ige.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return w1i(n,o,e)}}}a(wTa,"redirectPolicy");async function w1i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&x1i.includes(o.method)||s===302&&x1i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(n0t,"__esModule",{value:!0});n0t.getHeaderName=RTa;n0t.setPlatformSpecificData=kTa;var R1i=(g3(),Sa(sQ)),N_r=R1i.__importStar(require("node:os")),M_r=R1i.__importStar(require("node:process"));function RTa(){return"User-Agent"}a(RTa,"getHeaderName");async function kTa(t){if(M_r&&M_r.versions){let e=M_r.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",`(${N_r.arch()}-${N_r.type()}-${N_r.release()})`)}a(kTa,"setPlatformSpecificData")});var RG=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.DEFAULT_RETRY_POLICY_COUNT=oge.SDK_VERSION=void 0;oge.SDK_VERSION="1.16.3";oge.DEFAULT_RETRY_POLICY_COUNT=3});var O_r=I(i0t=>{"use strict";p();Object.defineProperty(i0t,"__esModule",{value:!0});i0t.getUserAgentHeaderName=NTa;i0t.getUserAgentValue=MTa;var P1i=k1i(),PTa=RG();function DTa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(DTa,"getUserAgentString");function NTa(){return(0,P1i.getHeaderName)()}a(NTa,"getUserAgentHeaderName");async function MTa(t){let e=new Map;e.set("core-rest-pipeline",PTa.SDK_VERSION),await(0,P1i.setPlatformSpecificData)(e);let r=DTa(e);return t?`${t} ${r}`:r}a(MTa,"getUserAgentValue")});var L_r=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.userAgentPolicyName=void 0;sge.userAgentPolicy=OTa;var N1i=O_r(),D1i=(0,N1i.getUserAgentHeaderName)();sge.userAgentPolicyName="userAgentPolicy";function OTa(t={}){let e=(0,N1i.getUserAgentValue)(t.userAgentPrefix);return{name:sge.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(D1i)||r.headers.set(D1i,await e),n(r)}}}a(OTa,"userAgentPolicy")});var o0t=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.isNodeReadableStream=M1i;age.isWebReadableStream=O1i;age.isReadableStream=LTa;age.isBlob=BTa;function M1i(t){return!!(t&&typeof t.pipe=="function")}a(M1i,"isNodeReadableStream");function O1i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(O1i,"isWebReadableStream");function LTa(t){return M1i(t)||O1i(t)}a(LTa,"isReadableStream");function BTa(t){return typeof t.stream=="function"}a(BTa,"isBlob")});var B_r=I($Oe=>{"use strict";p();Object.defineProperty($Oe,"__esModule",{value:!0});$Oe.getRawContent=qTa;$Oe.createFileFromStream=jTa;$Oe.createFile=HTa;var FTa=L4(),UTa=o0t(),L1i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},s0t=Symbol("rawContent");function QTa(t){return typeof t[s0t]=="function"}a(QTa,"hasRawContent");function qTa(t){return QTa(t)?t[s0t]():t.stream()}a(qTa,"getRawContent");function jTa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},L1i),{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,UTa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[s0t]:t})}a(jTa,"createFileFromStream");function HTa(t,e,r={}){var n,o,s;return FTa.isNodeLike?Object.assign(Object.assign({},L1i),{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"),[s0t]:()=>t}):new File([t],e,r)}a(HTa,"createFile")});var U1i=I(U_r=>{"use strict";p();Object.defineProperty(U_r,"__esModule",{value:!0});U_r.concat=zTa;var K8=(g3(),Sa(sQ)),F_r=require("node:stream"),GTa=o0t(),$Ta=B_r();function B1i(){return K8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield K8.__await(e.read());if(r)return yield K8.__await(void 0);yield yield K8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(B1i,"streamAsyncIterator");function VTa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=B1i.bind(t)),t.values||(t.values=B1i.bind(t))}a(VTa,"makeAsyncIterable");function WTa(t){return t instanceof ReadableStream?(VTa(t),F_r.Readable.fromWeb(t)):t}a(WTa,"ensureNodeStream");function F1i(t){return t instanceof Uint8Array?F_r.Readable.from(Buffer.from(t)):(0,GTa.isBlob)(t)?F1i((0,$Ta.getRawContent)(t)):WTa(t)}a(F1i,"toStream");async function zTa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(F1i);return F_r.Readable.from((function(){return K8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,K8.__asyncValues(d)),u;u=yield K8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield K8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield K8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(zTa,"concat")});var Q_r=I(cge=>{"use strict";p();Object.defineProperty(cge,"__esModule",{value:!0});cge.multipartPolicyName=void 0;cge.multipartPolicy=oIa;var fte=L4(),YTa=U1i(),KTa=o0t();function JTa(){return`----AzSDKFormBoundary${(0,fte.randomUUID)()}`}a(JTa,"generateBoundary");function ZTa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(ZTa,"encodeHeaders");function XTa(t){return t instanceof Uint8Array?t.byteLength:(0,KTa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(XTa,"getLength");function eIa(t){let e=0;for(let r of t){let n=XTa(r);if(n===void 0)return;e+=n}return e}a(eIa,"getTotalLength");async function tIa(t,e,r){let n=[(0,fte.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,fte.stringToUint8Array)(`\r +`,"utf-8"),(0,fte.stringToUint8Array)(ZTa(s.headers),"utf-8"),(0,fte.stringToUint8Array)(`\r +`,"utf-8"),s.body,(0,fte.stringToUint8Array)(`\r +--${r}`,"utf-8")]),(0,fte.stringToUint8Array)(`--\r \r -`,"utf-8")],o=FTa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,NTa.concat)(n)}a(UTa,"buildRequestBody");sge.multipartPolicyName="multipartPolicy";var QTa=70,qTa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function jTa(t){if(t.length>QTa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!qTa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(jTa,"assertValidBoundary");function HTa(){return{name:sge.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?jTa(n):n=OTa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await UTa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(HTa,"multipartPolicy")});var B_r=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.decompressResponsePolicyName=void 0;age.decompressResponsePolicy=GTa;age.decompressResponsePolicyName="decompressResponsePolicy";function GTa(){return{name:age.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(GTa,"decompressResponsePolicy")});var i0t=I(n0t=>{"use strict";p();Object.defineProperty(n0t,"__esModule",{value:!0});n0t.delay=WTa;n0t.parseHeaderValueAsNumber=zTa;var $Ta=FOe(),VTa="The operation was aborted.";function WTa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new $Ta.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:VTa)),"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(WTa,"delay");function zTa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(zTa,"parseHeaderValueAsNumber")});var s0t=I(o0t=>{"use strict";p();Object.defineProperty(o0t,"__esModule",{value:!0});o0t.isThrottlingRetryResponse=JTa;o0t.throttlingRetryStrategy=ZTa;var YTa=i0t(),F_r="Retry-After",KTa=["retry-after-ms","x-ms-retry-after-ms",F_r];function D1i(t){if(t&&[429,503].includes(t.status))try{for(let o of KTa){let s=(0,YTa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===F_r?1e3:1)}let e=t.headers.get(F_r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(D1i,"getRetryAfterInMs");function JTa(t){return Number.isFinite(D1i(t))}a(JTa,"isThrottlingRetryResponse");function ZTa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=D1i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(ZTa,"throttlingRetryStrategy")});var a0t=I(qOe=>{"use strict";p();Object.defineProperty(qOe,"__esModule",{value:!0});qOe.exponentialRetryStrategy=nIa;qOe.isExponentialRetryResponse=N1i;qOe.isSystemError=M1i;var XTa=O4(),eIa=s0t(),tIa=1e3,rIa=1e3*64;function nIa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:tIa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:rIa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=M1i(u),f=d&&t.ignoreSystemErrors,h=N1i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,eIa.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,XTa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(nIa,"exponentialRetryStrategy");function N1i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(N1i,"isExponentialRetryResponse");function M1i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(M1i,"isSystemError")});var cge=I(U_r=>{"use strict";p();Object.defineProperty(U_r,"__esModule",{value:!0});U_r.retryPolicy=cIa;var iIa=i0t(),oIa=sht(),sIa=FOe(),O1i=TG(),L1i=(0,oIa.createClientLogger)("core-rest-pipeline retryPolicy"),aIa="retryPolicy";function cIa(t,e={maxRetries:O1i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||L1i;return{name:aIa,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 sIa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:O1i.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||L1i;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,iIa.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(cIa,"retryPolicy")});var Q_r=I(lge=>{"use strict";p();Object.defineProperty(lge,"__esModule",{value:!0});lge.defaultRetryPolicyName=void 0;lge.defaultRetryPolicy=pIa;var lIa=a0t(),uIa=s0t(),dIa=cge(),fIa=TG();lge.defaultRetryPolicyName="defaultRetryPolicy";function pIa(t={}){var e;return{name:lge.defaultRetryPolicyName,sendRequest:(0,dIa.retryPolicy)([(0,uIa.throttlingRetryStrategy)(),(0,lIa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:fIa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(pIa,"defaultRetryPolicy")});var jOe=I(j_r=>{"use strict";p();Object.defineProperty(j_r,"__esModule",{value:!0});j_r.createHttpHeaders=mIa;function c0t(t){return t.toLowerCase()}a(c0t,"normalizeName");function*hIa(t){for(let e of t.values())yield[e.name,e.value]}a(hIa,"headerIterator");var q_r=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(c0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(c0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(c0t(e))}delete(e){this._headersMap.delete(c0t(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 hIa(this._headersMap)}};function mIa(t){return new q_r(t)}a(mIa,"createHttpHeaders")});var H_r=I(uge=>{"use strict";p();Object.defineProperty(uge,"__esModule",{value:!0});uge.formDataPolicyName=void 0;uge.formDataPolicy=AIa;var F1i=O4(),B1i=jOe();uge.formDataPolicyName="formDataPolicy";function gIa(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(gIa,"formDataToFormDataMap");function AIa(){return{name:uge.formDataPolicyName,async sendRequest(t,e){if(F1i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=gIa(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=yIa(t.formData):await EIa(t.formData,t),t.formData=void 0}return e(t)}}}a(AIa,"formDataPolicy");function yIa(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(yIa,"wwwFormUrlEncode");async function EIa(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,B1i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,F1i.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,B1i.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(EIa,"prepareFormData")});var G_r=I(SR=>{"use strict";p();Object.defineProperty(SR,"__esModule",{value:!0});SR.globalNoProxyList=SR.proxyPolicyName=void 0;SR.loadNoProxy=H1i;SR.getDefaultProxySettings=RIa;SR.proxyPolicy=PIa;var _Ia=W3t(),vIa=z3t(),CIa=lte(),bIa="HTTPS_PROXY",SIa="HTTP_PROXY",TIa="ALL_PROXY",IIa="NO_PROXY";SR.proxyPolicyName="proxyPolicy";SR.globalNoProxyList=[];var q1i=!1,xIa=new Map;function l0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(l0t,"getEnvironmentValue");function j1i(){if(!process)return;let t=l0t(bIa),e=l0t(TIa),r=l0t(SIa);return t||e||r}a(j1i,"loadEnvironmentProxyValue");function wIa(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(wIa,"isBypassed");function H1i(){let t=l0t(IIa);return q1i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(H1i,"loadNoProxy");function RIa(t){if(!t&&(t=j1i(),!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(RIa,"getDefaultProxySettings");function kIa(){let t=j1i();return t?new URL(t):void 0}a(kIa,"getDefaultProxySettingsInternal");function U1i(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(U1i,"getUrlFromProxySettings");function Q1i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&CIa.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 vIa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new _Ia.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Q1i,"setProxyAgentOnRequest");function PIa(t,e){q1i||SR.globalNoProxyList.push(...H1i());let r=t?U1i(t):kIa(),n={};return{name:SR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!wIa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:SR.globalNoProxyList,e?.customNoProxyList?void 0:xIa)?Q1i(o,n,r):o.proxySettings&&Q1i(o,n,U1i(o.proxySettings)),s(o)}}}a(PIa,"proxyPolicy")});var $_r=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.setClientRequestIdPolicyName=void 0;dge.setClientRequestIdPolicy=DIa;dge.setClientRequestIdPolicyName="setClientRequestIdPolicy";function DIa(t="x-ms-client-request-id"){return{name:dge.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(DIa,"setClientRequestIdPolicy")});var V_r=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.tlsPolicyName=void 0;fge.tlsPolicy=NIa;fge.tlsPolicyName="tlsPolicy";function NIa(t){return{name:fge.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(NIa,"tlsPolicy")});var W_r=I(Y8=>{"use strict";p();Object.defineProperty(Y8,"__esModule",{value:!0});Y8.TracingContextImpl=Y8.knownContextKeys=void 0;Y8.createTracingContext=MIa;Y8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function MIa(t={}){let e=new u0t(t.parentContext);return t.span&&(e=e.setValue(Y8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(Y8.knownContextKeys.namespace,t.namespace)),e}a(MIa,"createTracingContext");var u0t=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}};Y8.TracingContextImpl=u0t});var z_r=I(pge=>{"use strict";p();Object.defineProperty(pge,"__esModule",{value:!0});pge.createDefaultTracingSpan=G1i;pge.createDefaultInstrumenter=$1i;pge.useInstrumenter=LIa;pge.getInstrumenter=BIa;var OIa=W_r(),d0t=q5t();function G1i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(G1i,"createDefaultTracingSpan");function $1i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:G1i(),tracingContext:(0,OIa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a($1i,"createDefaultInstrumenter");function LIa(t){d0t.state.instrumenterImplementation=t}a(LIa,"useInstrumenter");function BIa(){return d0t.state.instrumenterImplementation||(d0t.state.instrumenterImplementation=$1i()),d0t.state.instrumenterImplementation}a(BIa,"getInstrumenter")});var V1i=I(K_r=>{"use strict";p();Object.defineProperty(K_r,"__esModule",{value:!0});K_r.createTracingClient=FIa;var f0t=z_r(),Y_r=W_r();function FIa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,f0t.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(Y_r.knownContextKeys.namespace)||(A=A.setValue(Y_r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(Y_r.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,f0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,f0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,f0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(FIa,"createTracingClient")});var W1i=I(hge=>{"use strict";p();Object.defineProperty(hge,"__esModule",{value:!0});hge.createTracingClient=hge.useInstrumenter=void 0;var UIa=z_r();Object.defineProperty(hge,"useInstrumenter",{enumerable:!0,get:a(function(){return UIa.useInstrumenter},"get")});var QIa=V1i();Object.defineProperty(hge,"createTracingClient",{enumerable:!0,get:a(function(){return QIa.createTracingClient},"get")})});var z1i=I(p0t=>{"use strict";p();Object.defineProperty(p0t,"__esModule",{value:!0});p0t.custom=void 0;var qIa=require("node:util");p0t.custom=qIa.inspect.custom});var h0t=I(HOe=>{"use strict";p();Object.defineProperty(HOe,"__esModule",{value:!0});HOe.RestError=void 0;HOe.isRestError=VIa;var jIa=O4(),HIa=z1i(),GIa=Zmt(),$Ia=new GIa.Sanitizer,mge=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)}[HIa.custom](){return`RestError: ${this.message} - ${$Ia.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};HOe.RestError=mge;mge.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";mge.PARSE_ERROR="PARSE_ERROR";function VIa(t){return t instanceof mge?!0:(0,jIa.isError)(t)&&t.name==="RestError"}a(VIa,"isRestError")});var J_r=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.tracingPolicyName=void 0;gge.tracingPolicy=ZIa;var WIa=W1i(),zIa=TG(),YIa=P_r(),m0t=lte(),GOe=O4(),KIa=h0t(),JIa=Zmt();gge.tracingPolicyName="tracingPolicy";function ZIa(t={}){let e=(0,YIa.getUserAgentValue)(t.userAgentPrefix),r=new JIa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=XIa();return{name:gge.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=exa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return rxa(f,m),m}catch(m){throw txa(f,m),m}}}}a(ZIa,"tracingPolicy");function XIa(){try{return(0,WIa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:zIa.SDK_VERSION})}catch(t){m0t.logger.warning(`Error when creating the TracingClient: ${(0,GOe.getErrorMessage)(t)}`);return}}a(XIa,"tryCreateTracingClient");function exa(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){m0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,GOe.getErrorMessage)(n)}`);return}}a(exa,"tryCreateSpan");function txa(t,e){try{t.setStatus({status:"error",error:(0,GOe.isError)(e)?e:void 0}),(0,KIa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){m0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,GOe.getErrorMessage)(r)}`)}}a(txa,"tryProcessError");function rxa(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){m0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,GOe.getErrorMessage)(r)}`)}}a(rxa,"tryProcessResponse")});var J1i=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.createPipelineFromOptions=hxa;var nxa=x_r(),ixa=i_r(),oxa=w_r(),sxa=D_r(),Y1i=L_r(),axa=B_r(),cxa=Q_r(),lxa=H_r(),K1i=O4(),uxa=G_r(),dxa=$_r(),fxa=V_r(),pxa=J_r();function hxa(t){var e;let r=(0,ixa.createEmptyPipeline)();return K1i.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,fxa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,uxa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,axa.decompressResponsePolicy)())),r.addPolicy((0,lxa.formDataPolicy)(),{beforePolicies:[Y1i.multipartPolicyName]}),r.addPolicy((0,sxa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,dxa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,Y1i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,cxa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,pxa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),K1i.isNodeLike&&r.addPolicy((0,oxa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,nxa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(hxa,"createPipelineFromOptions")});var nSi=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.getBodyLength=rSi;A0t.createNodeHttpClient=vxa;var rvr=(m3(),ba(iQ)),X_r=rvr.__importStar(require("node:http")),evr=rvr.__importStar(require("node:https")),Z1i=rvr.__importStar(require("node:zlib")),mxa=require("node:stream"),X1i=FOe(),gxa=jOe(),WOe=h0t(),$Oe=lte(),Axa={};function VOe(t){return t&&typeof t.pipe=="function"}a(VOe,"isReadableStream");function eSi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(eSi,"isStreamComplete");function tSi(t){return t&&typeof t.byteLength=="number"}a(tSi,"isArrayBuffer");var g0t=class extends mxa.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}},tvr=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 X1i.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=rSi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new g0t(E);_.on("error",v=>{$Oe.logger.error("Error in upload progress",v)}),VOe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=yxa(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?Exa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new g0t(y);E.on("error",_=>{$Oe.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 _xa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();VOe(d)&&(h=eSi(d));let m=Promise.resolve();VOe(f)&&(m=eSi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{$Oe.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?X_r.request(u,d):evr.request(u,d);h.once("error",m=>{var g;f(new WOe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:WOe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new X1i.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&VOe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):tSi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):($Oe.logger.error("Unrecognized body type",n),f(new WOe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?X_r.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new X_r.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return evr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Axa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||($Oe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new evr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function yxa(t){let e=(0,gxa.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(yxa,"getResponseHeaders");function Exa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Z1i.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Z1i.createInflate();return t.pipe(n),n}return t}a(Exa,"getDecodedResponseStream");function _xa(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 WOe.RestError(`Error reading response as text: ${o.message}`,{code:WOe.RestError.PARSE_ERROR}))})})}a(_xa,"streamToText");function rSi(t){return t?Buffer.isBuffer(t)?t.length:VOe(t)?null:tSi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(rSi,"getBodyLength");function vxa(){return new tvr}a(vxa,"createNodeHttpClient")});var iSi=I(nvr=>{"use strict";p();Object.defineProperty(nvr,"__esModule",{value:!0});nvr.createDefaultHttpClient=bxa;var Cxa=nSi();function bxa(){return(0,Cxa.createNodeHttpClient)()}a(bxa,"createDefaultHttpClient")});var oSi=I(ovr=>{"use strict";p();Object.defineProperty(ovr,"__esModule",{value:!0});ovr.createPipelineRequest=Ixa;var Sxa=jOe(),Txa=O4(),ivr=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,Sxa.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,Txa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function Ixa(t){return new ivr(t)}a(Ixa,"createPipelineRequest")});var sSi=I(zOe=>{"use strict";p();Object.defineProperty(zOe,"__esModule",{value:!0});zOe.exponentialRetryPolicyName=void 0;zOe.exponentialRetryPolicy=kxa;var xxa=a0t(),wxa=cge(),Rxa=TG();zOe.exponentialRetryPolicyName="exponentialRetryPolicy";function kxa(t={}){var e;return(0,wxa.retryPolicy)([(0,xxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Rxa.DEFAULT_RETRY_POLICY_COUNT})}a(kxa,"exponentialRetryPolicy")});var aSi=I(Age=>{"use strict";p();Object.defineProperty(Age,"__esModule",{value:!0});Age.systemErrorRetryPolicyName=void 0;Age.systemErrorRetryPolicy=Mxa;var Pxa=a0t(),Dxa=cge(),Nxa=TG();Age.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Mxa(t={}){var e;return{name:Age.systemErrorRetryPolicyName,sendRequest:(0,Dxa.retryPolicy)([(0,Pxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Nxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Mxa,"systemErrorRetryPolicy")});var cSi=I(yge=>{"use strict";p();Object.defineProperty(yge,"__esModule",{value:!0});yge.throttlingRetryPolicyName=void 0;yge.throttlingRetryPolicy=Fxa;var Oxa=s0t(),Lxa=cge(),Bxa=TG();yge.throttlingRetryPolicyName="throttlingRetryPolicy";function Fxa(t={}){var e;return{name:yge.throttlingRetryPolicyName,sendRequest:(0,Lxa.retryPolicy)([(0,Oxa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Bxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Fxa,"throttlingRetryPolicy")});var svr=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.DEFAULT_CYCLER_OPTIONS=void 0;Ege.createTokenCycler=qxa;var Uxa=i0t();Ege.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Qxa(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(qxa,"createTokenCycler")});var lSi=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.bearerTokenAuthenticationPolicyName=void 0;_ge.bearerTokenAuthenticationPolicy=Vxa;var jxa=svr(),Hxa=lte();_ge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Gxa(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(Gxa,"defaultAuthorizeRequest");function $xa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a($xa,"getChallenge");function Vxa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||Hxa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:Gxa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,jxa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:_ge.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&&$xa(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(Vxa,"bearerTokenAuthenticationPolicy")});var uSi=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.ndJsonPolicyName=void 0;vge.ndJsonPolicy=Wxa;vge.ndJsonPolicyName="ndJsonPolicy";function Wxa(){return{name:vge.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(Wxa,"ndJsonPolicy")});var fSi=I(fte=>{"use strict";p();Object.defineProperty(fte,"__esModule",{value:!0});fte.auxiliaryAuthenticationHeaderPolicyName=void 0;fte.auxiliaryAuthenticationHeaderPolicy=Jxa;var zxa=svr(),Yxa=lte();fte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var dSi="x-ms-authorization-auxiliary";async function Kxa(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(Kxa,"sendAuthorizeRequest");function Jxa(t){let{credentials:e,scopes:r}=t,n=t.logger||Yxa.logger,o=new WeakMap;return{name:fte.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(`${fte.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,zxa.createTokenCycler)(d),o.set(d,f)),l.push(Kxa({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. ${dSi} header will not be set.`),c(s)):(s.headers.set(dSi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(Jxa,"auxiliaryAuthenticationHeaderPolicy")});var kSi=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 Zxa=i_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return Zxa.createEmptyPipeline},"get")});var Xxa=J1i();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return Xxa.createPipelineFromOptions},"get")});var ewa=iSi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return ewa.createDefaultHttpClient},"get")});var twa=jOe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return twa.createHttpHeaders},"get")});var rwa=oSi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return rwa.createPipelineRequest},"get")});var pSi=h0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return pSi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return pSi.isRestError},"get")});var hSi=B_r();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return hSi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return hSi.decompressResponsePolicyName},"get")});var mSi=sSi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return mSi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return mSi.exponentialRetryPolicyName},"get")});var gSi=$_r();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return gSi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return gSi.setClientRequestIdPolicyName},"get")});var ASi=x_r();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return ASi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return ASi.logPolicyName},"get")});var ySi=L_r();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return ySi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return ySi.multipartPolicyName},"get")});var avr=G_r();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return avr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return avr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return avr.getDefaultProxySettings},"get")});var ESi=w_r();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return ESi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return ESi.redirectPolicyName},"get")});var _Si=aSi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return _Si.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return _Si.systemErrorRetryPolicyName},"get")});var vSi=cSi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return vSi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return vSi.throttlingRetryPolicyName},"get")});var nwa=cge();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return nwa.retryPolicy},"get")});var CSi=J_r();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return CSi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return CSi.tracingPolicyName},"get")});var iwa=Q_r();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return iwa.defaultRetryPolicy},"get")});var bSi=D_r();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return bSi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return bSi.userAgentPolicyName},"get")});var SSi=V_r();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return SSi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return SSi.tlsPolicyName},"get")});var TSi=H_r();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return TSi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return TSi.formDataPolicyName},"get")});var ISi=lSi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return ISi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return ISi.bearerTokenAuthenticationPolicyName},"get")});var xSi=uSi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return xSi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return xSi.ndJsonPolicyName},"get")});var wSi=fSi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return wSi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return wSi.auxiliaryAuthenticationHeaderPolicyName},"get")});var RSi=N_r();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return RSi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return RSi.createFileFromStream},"get")})});var DSi=I((KOe,PSi)=>{"use strict";p();var owa=KOe&&KOe.__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())})},swa=KOe&&KOe.__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 dwa=Kl(),fwa=ay(),pwa=(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){dwa.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||fwa.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})();NSi.exports=pwa});var OSi=I(cvr=>{"use strict";p();Object.defineProperty(cvr,"__esModule",{value:!0});cvr.azureRoleEnvironmentTelemetryProcessor=hwa;function hwa(t,e){}a(hwa,"azureRoleEnvironmentTelemetryProcessor")});var FSi=I(y0t=>{"use strict";p();Object.defineProperty(y0t,"__esModule",{value:!0});y0t.samplingTelemetryProcessor=mwa;y0t.getSamplingHashCode=BSi;var LSi=ME();function mwa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&LSi.TelemetryType.Metric===LSi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=BSi(e.correlationContext.operation.id){"use strict";p();var gwa=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]})),Awa=K8&&K8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ywa=K8&&K8.__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)&&gwa(e,t,r);return Awa(e,t),e};Object.defineProperty(K8,"__esModule",{value:!0});K8.performanceMetricsTelemetryProcessor=Ewa;var lvr=kmt(),uvr=ywa(ME());function Ewa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case uvr.TelemetryTypeString.Exception:lvr.countException();break;case uvr.TelemetryTypeString.Request:var r=t.data.baseData;lvr.countRequest(r.duration,r.success);break;case uvr.TelemetryTypeString.Dependency:var n=t.data.baseData;lvr.countDependency(n.duration,n.success);break}return!0}a(Ewa,"performanceMetricsTelemetryProcessor")});var QSi=I(aD=>{"use strict";p();var L4=aD&&aD.__assign||function(){return L4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Twa=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]})),_0t=B4&&B4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Twa(e,t,r)};Object.defineProperty(B4,"__esModule",{value:!0});_0t(OSi(),B4);_0t(FSi(),B4);_0t(USi(),B4);_0t(QSi(),B4)});var dvr=I((rvp,GSi)=>{"use strict";p();var Zi=ME(),Gb=ay(),jSi=AG(),Iwa=Kl(),xwa=(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=Gb.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=jSi.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=Gb.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=Gb.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=Gb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.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=Gb.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=jSi.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(HSi.regex.test(l)){var u=new HSi(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})(),HSi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Gb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Gb.trim(n[2])||this.method,this.fileName=Gb.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})();GSi.exports=xwa});var $Si=I(IG=>{"use strict";p();var wwa=IG&&IG.__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())})},Rwa=IG&&IG.__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 v0t=XOe&&XOe.__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())})},C0t=XOe&&XOe.__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&&!ZOe.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(xG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(xG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return v0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return C0t(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 Bwa.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(xG.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=$b.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),Owa.gzip(f,function(g,A){var y=A;g?(h._logWarn($b.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($b.dumpObj(s)),s[Lwa.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(qwa)&&b.statusCode===400&&(pvr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(Qwa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==Uwa||b.statusCode==Fwa?h._statsbeat.countThrottle(xG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(xG.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(xG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.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(xG.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=$b.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(xG.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,$b.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,$b.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r($b.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($b.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 v0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return C0t(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,J8.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: "+$b.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,ZOe.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: "+$b.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,J8.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: "+$b.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=pte.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,J8.writeFileAsync(l,$b.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: "+$b.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),fvr.existsSync(this._tempDir)||fvr.mkdirSync(this._tempDir),ZOe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=J8.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=pte.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),fvr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+$b.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return v0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return C0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,J8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return pte.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=pte.join(this._tempDir,r),[4,J8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,J8.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 v0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return C0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,J8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return pte.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=pte.join(this._tempDir,e[r]),[4,J8.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})();VSi.exports=jwa});var zSi=I(b0t=>{"use strict";p();Object.defineProperty(b0t,"__esModule",{value:!0});b0t.AzureVirtualMachine=void 0;var WSi=Kl(),Hwa=ay(),Gwa=X0e(),$wa="http://169.254.169.254/metadata/instance/compute",Vwa="api-version=2017-12-01",Wwa="format=json",zwa="UNREACH",Ywa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat($wa,"?").concat(Vwa,"&").concat(Wwa),l=(n={method:"GET"},n[Gwa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=Hwa.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){WSi.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(zwa)>-1?s.isVM=!1:WSi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();b0t.AzureVirtualMachine=Ywa});var YSi=I(S0t=>{"use strict";p();Object.defineProperty(S0t,"__esModule",{value:!0});S0t.NetworkStatsbeat=void 0;var Kwa=(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})();S0t.NetworkStatsbeat=Kwa});var eTi=I((hte,XSi)=>{"use strict";p();var F4=hte&&hte.__assign||function(){return F4=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:Ad.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:Ad.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(F4(F4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Ad.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})();XSi.exports=oRa});var nTi=I((yvp,rTi)=>{"use strict";p();var sRa=require("url"),aRa=t_r(),cRa=DSi(),lRa=V0e(),Z8=ME(),uRa=MSi(),Avr=qSi(),tTi=AG(),dRa=eTi(),fRa=hvr(),yvr=ay(),T0t=Kl(),pRa=dvr(),hRa=(function(){function t(e){this._telemetryProcessors=[];var r=new aRa(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 lRa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new dRa(this.config,this.context),this._statsbeat.enable(!0));var n=new fRa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new uRa(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,Z8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,Z8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,Z8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,Z8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!yvr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,Z8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,Z8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,Z8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new sRa.URL(e.data).host}catch(r){e.target=null,T0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,Z8.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&&Z8.telemetryTypeToBaseType(r)){var n=pRa.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&&Avr.samplingTelemetryProcessor(n,{correlationContext:tTi.CorrelationContextManager.getCurrentContext()}),Avr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(Avr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else T0t.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||(T0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new cRa(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=tTi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var mRa=Evr&&Evr.__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)}})(),gRa=nTi(),iTi=zEr(),ARa=X0e(),I0t=Kl(),yRa=(function(t){mRa(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?iTi.trackRequestSync(this,r):I0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&I0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?iTi.trackRequest(this,r):I0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?ARa.trackRequest(this,r):I0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(gRa);oTi.exports=yRa});var cTi=I(aTi=>{"use strict";p();Object.defineProperty(aTi,"__esModule",{value:!0})});var fTi=I(yt=>{"use strict";p();Object.defineProperty(yt,"__esModule",{value:!0});yt.Configuration=yt.liveMetricsClient=yt.defaultClient=yt.DistributedTracingModes=void 0;yt.setup=xRa;yt.start=dTi;yt.getCorrelationContext=RRa;yt.startOperation=kRa;yt.wrapWithCorrelationContext=PRa;yt.dispose=DRa;var vvr=AG(),ERa=GCi(),_Ra=VCi(),Cvr=kmt(),vRa=MEr(),CRa=rbi(),bRa=pbi(),SRa=X0e(),TRa=zEr(),lTi=Qee(),e5e=Kl(),uTi=Wbi(),bvr=Ybi(),IRa=Zbi();yt.TelemetryClient=sTi();yt.Contracts=ME();yt.azureFunctionsTypes=cTi();var _vr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(_vr||(yt.DistributedTracingModes=_vr={}));var t5e,r5e,n5e,i5e,o5e,bge,Sge,mte,s5e,a5e,YT=!1,x0t;function xRa(t){return yt.defaultClient?e5e.info("The default client is already setup"):(yt.defaultClient=new yt.TelemetryClient(t),t5e=new ERa(yt.defaultClient),r5e=new _Ra(yt.defaultClient),n5e=new Cvr(yt.defaultClient),i5e=new vRa(yt.defaultClient),o5e=new CRa(yt.defaultClient),bge=new bRa(yt.defaultClient),mte=new TRa(yt.defaultClient),s5e=new SRa(yt.defaultClient),Sge||(Sge=new bvr.AutoCollectNativePerformance(yt.defaultClient)),a5e=new IRa.AzureFunctionsHook(yt.defaultClient)),Svr}a(xRa,"setup");function wRa(){yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=!0),yt.defaultClient.config.enableAutoCollectConsole==null&&(yt.defaultClient.config.enableAutoCollectConsole=!1),yt.defaultClient.config.enableAutoCollectExceptions==null&&(yt.defaultClient.config.enableAutoCollectExceptions=!0),yt.defaultClient.config.enableAutoCollectPerformance==null&&(yt.defaultClient.config.enableAutoCollectPerformance=!0),yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),yt.defaultClient.config.enableAutoCollectHeartbeat==null&&(yt.defaultClient.config.enableAutoCollectHeartbeat=!0),yt.defaultClient.config.enableAutoCollectRequests==null&&(yt.defaultClient.config.enableAutoCollectRequests=!0),yt.defaultClient.config.enableAutoCollectDependencies==null&&(yt.defaultClient.config.enableAutoCollectDependencies=!0),yt.defaultClient.config.enableUseDiskRetryCaching==null&&(yt.defaultClient.config.enableUseDiskRetryCaching=!0),yt.defaultClient.config.enableAutoDependencyCorrelation==null&&(yt.defaultClient.config.enableAutoDependencyCorrelation=!0),yt.defaultClient.config.enableSendLiveMetrics==null&&(yt.defaultClient.config.enableSendLiveMetrics=!1),yt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(yt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),yt.defaultClient.config.enableWebInstrumentation==null&&(yt.defaultClient.config.enableWebInstrumentation=!1),yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(wRa,"_setDefaultConfig");function dTi(){if(yt.defaultClient){YT=!0,wRa(),t5e.enable(yt.defaultClient.config.enableAutoCollectExternalLoggers,yt.defaultClient.config.enableAutoCollectConsole),r5e.enable(yt.defaultClient.config.enableAutoCollectExceptions),n5e.enable(yt.defaultClient.config.enableAutoCollectPerformance),i5e.enable(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),o5e.enable(yt.defaultClient.config.enableAutoCollectHeartbeat),mte.useAutoCorrelation(yt.defaultClient.config.enableAutoDependencyCorrelation,yt.defaultClient.config.enableUseAsyncHooks),mte.enable(yt.defaultClient.config.enableAutoCollectRequests),s5e.enable(yt.defaultClient.config.enableAutoCollectDependencies),bge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString),yt.defaultClient.config.enableSendLiveMetrics&&(yt.liveMetricsClient||(yt.liveMetricsClient=new uTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),x0t=new Cvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(x0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient),yt.liveMetricsClient.enable(yt.defaultClient.config.enableSendLiveMetrics)),a5e.enable(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=bvr.AutoCollectNativePerformance.parseEnabled(yt.defaultClient.config.enableAutoCollectExtendedMetrics,yt.defaultClient.config);Sge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),yt.defaultClient&&yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)}else e5e.warn("Start cannot be called before setup");return Svr}a(dTi,"start");function RRa(){return vvr.CorrelationContextManager.getCurrentContext()}a(RRa,"getCorrelationContext");function kRa(t,e){return vvr.CorrelationContextManager.startOperation(t,e)}a(kRa,"startOperation");function PRa(t,e){return vvr.CorrelationContextManager.wrapCallback(t,e)}a(PRa,"wrapWithCorrelationContext");var Svr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return lTi.w3cEnabled=e===_vr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=e,yt.defaultClient.config.enableAutoCollectConsole=r,YT&&t5e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExceptions=e,YT&&r5e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),yt.defaultClient){yt.defaultClient.config.enableAutoCollectPerformance=e;var n=bvr.AutoCollectNativePerformance.parseEnabled(r,yt.defaultClient.config);yt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,YT&&(n5e.enable(e),Sge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,YT&&i5e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectHeartbeat=e,YT&&o5e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,YT&&bge.enable(yt.defaultClient.config.enableAutoWebSnippetInjection,yt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,YT&&bge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectRequests=e,YT&&mte.enable(e)),t},t.setAutoCollectDependencies=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectDependencies=e,YT&&s5e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableAutoDependencyCorrelation=e,yt.defaultClient.config.enableUseAsyncHooks=r,YT&&mte.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return yt.defaultClient&&(yt.defaultClient.config.enableUseDiskRetryCaching=e,yt.defaultClient.config.enableResendInterval=r,yt.defaultClient.config.enableMaxBytesOnDisk=n,yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),e5e.enableDebug=e,e5e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,YT&&a5e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),yt.defaultClient?(!yt.liveMetricsClient&&e?(yt.liveMetricsClient=new uTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),x0t=new Cvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(x0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient):yt.liveMetricsClient&&yt.liveMetricsClient.enable(e),yt.defaultClient.config.enableSendLiveMetrics=e,t):(e5e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=dTi,t})();yt.Configuration=Svr;function DRa(){lTi.w3cEnabled=!0,yt.defaultClient=null,YT=!1,t5e&&t5e.dispose(),r5e&&r5e.dispose(),n5e&&n5e.dispose(),i5e&&i5e.dispose(),o5e&&o5e.dispose(),bge&&bge.dispose(),Sge&&Sge.dispose(),mte&&mte.dispose(),s5e&&s5e.dispose(),yt.liveMetricsClient&&(yt.liveMetricsClient.enable(!1),yt.liveMetricsClient=void 0),a5e&&a5e.dispose()}a(DRa,"dispose")});var Ivr=I(TR=>{"use strict";p();var NRa=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]})),MRa=TR&&TR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pTi=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 FRa(e)?hTi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};TR.AzureInsightReporter=Tvr;function URa(t,e,r){let n=new ORa.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,mTi(t,e,n),n}a(URa,"createAppInsightsClient");function mTi(t,e,r){r.commonProperties=QRa(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(mTi,"configureReporter");function QRa(t,e){return t=t||{},t.common_os=w0t.platform(),t.common_platformversion=w0t.release(),t.common_arch=w0t.arch(),t.common_cpu=Array.from(new Set(w0t.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(QRa,"decorateWithCommonProperties")});var gTi=I((Pvp,qRa)=>{qRa.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.54.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.126.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=eIa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,YTa.concat)(n)}a(tIa,"buildRequestBody");cge.multipartPolicyName="multipartPolicy";var rIa=70,nIa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function iIa(t){if(t.length>rIa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!nIa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(iIa,"assertValidBoundary");function oIa(){return{name:cge.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?iIa(n):n=JTa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await tIa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(oIa,"multipartPolicy")});var q_r=I(lge=>{"use strict";p();Object.defineProperty(lge,"__esModule",{value:!0});lge.decompressResponsePolicyName=void 0;lge.decompressResponsePolicy=sIa;lge.decompressResponsePolicyName="decompressResponsePolicy";function sIa(){return{name:lge.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(sIa,"decompressResponsePolicy")});var c0t=I(a0t=>{"use strict";p();Object.defineProperty(a0t,"__esModule",{value:!0});a0t.delay=lIa;a0t.parseHeaderValueAsNumber=uIa;var aIa=HOe(),cIa="The operation was aborted.";function lIa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new aIa.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:cIa)),"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(lIa,"delay");function uIa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(uIa,"parseHeaderValueAsNumber")});var u0t=I(l0t=>{"use strict";p();Object.defineProperty(l0t,"__esModule",{value:!0});l0t.isThrottlingRetryResponse=pIa;l0t.throttlingRetryStrategy=hIa;var dIa=c0t(),j_r="Retry-After",fIa=["retry-after-ms","x-ms-retry-after-ms",j_r];function Q1i(t){if(t&&[429,503].includes(t.status))try{for(let o of fIa){let s=(0,dIa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===j_r?1e3:1)}let e=t.headers.get(j_r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Q1i,"getRetryAfterInMs");function pIa(t){return Number.isFinite(Q1i(t))}a(pIa,"isThrottlingRetryResponse");function hIa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Q1i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(hIa,"throttlingRetryStrategy")});var d0t=I(VOe=>{"use strict";p();Object.defineProperty(VOe,"__esModule",{value:!0});VOe.exponentialRetryStrategy=EIa;VOe.isExponentialRetryResponse=q1i;VOe.isSystemError=j1i;var mIa=L4(),gIa=u0t(),AIa=1e3,yIa=1e3*64;function EIa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:AIa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:yIa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=j1i(u),f=d&&t.ignoreSystemErrors,h=q1i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,gIa.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,mIa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(EIa,"exponentialRetryStrategy");function q1i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(q1i,"isExponentialRetryResponse");function j1i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(j1i,"isSystemError")});var uge=I(H_r=>{"use strict";p();Object.defineProperty(H_r,"__esModule",{value:!0});H_r.retryPolicy=SIa;var _Ia=c0t(),vIa=uht(),CIa=HOe(),H1i=RG(),G1i=(0,vIa.createClientLogger)("core-rest-pipeline retryPolicy"),bIa="retryPolicy";function SIa(t,e={maxRetries:H1i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||G1i;return{name:bIa,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 CIa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:H1i.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||G1i;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,_Ia.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(SIa,"retryPolicy")});var G_r=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.defaultRetryPolicyName=void 0;dge.defaultRetryPolicy=RIa;var TIa=d0t(),IIa=u0t(),xIa=uge(),wIa=RG();dge.defaultRetryPolicyName="defaultRetryPolicy";function RIa(t={}){var e;return{name:dge.defaultRetryPolicyName,sendRequest:(0,xIa.retryPolicy)([(0,IIa.throttlingRetryStrategy)(),(0,TIa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:wIa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(RIa,"defaultRetryPolicy")});var WOe=I(V_r=>{"use strict";p();Object.defineProperty(V_r,"__esModule",{value:!0});V_r.createHttpHeaders=PIa;function f0t(t){return t.toLowerCase()}a(f0t,"normalizeName");function*kIa(t){for(let e of t.values())yield[e.name,e.value]}a(kIa,"headerIterator");var $_r=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(f0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(f0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(f0t(e))}delete(e){this._headersMap.delete(f0t(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 kIa(this._headersMap)}};function PIa(t){return new $_r(t)}a(PIa,"createHttpHeaders")});var W_r=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.formDataPolicyName=void 0;fge.formDataPolicy=NIa;var V1i=L4(),$1i=WOe();fge.formDataPolicyName="formDataPolicy";function DIa(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(DIa,"formDataToFormDataMap");function NIa(){return{name:fge.formDataPolicyName,async sendRequest(t,e){if(V1i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=DIa(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=MIa(t.formData):await OIa(t.formData,t),t.formData=void 0}return e(t)}}}a(NIa,"formDataPolicy");function MIa(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(MIa,"wwwFormUrlEncode");async function OIa(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,$1i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,V1i.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,$1i.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(OIa,"prepareFormData")});var z_r=I(IR=>{"use strict";p();Object.defineProperty(IR,"__esModule",{value:!0});IR.globalNoProxyList=IR.proxyPolicyName=void 0;IR.loadNoProxy=J1i;IR.getDefaultProxySettings=$Ia;IR.proxyPolicy=WIa;var LIa=J3t(),BIa=Z3t(),FIa=ute(),UIa="HTTPS_PROXY",QIa="HTTP_PROXY",qIa="ALL_PROXY",jIa="NO_PROXY";IR.proxyPolicyName="proxyPolicy";IR.globalNoProxyList=[];var Y1i=!1,HIa=new Map;function p0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(p0t,"getEnvironmentValue");function K1i(){if(!process)return;let t=p0t(UIa),e=p0t(qIa),r=p0t(QIa);return t||e||r}a(K1i,"loadEnvironmentProxyValue");function GIa(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(GIa,"isBypassed");function J1i(){let t=p0t(jIa);return Y1i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(J1i,"loadNoProxy");function $Ia(t){if(!t&&(t=K1i(),!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($Ia,"getDefaultProxySettings");function VIa(){let t=K1i();return t?new URL(t):void 0}a(VIa,"getDefaultProxySettingsInternal");function W1i(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(W1i,"getUrlFromProxySettings");function z1i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&FIa.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 BIa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new LIa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(z1i,"setProxyAgentOnRequest");function WIa(t,e){Y1i||IR.globalNoProxyList.push(...J1i());let r=t?W1i(t):VIa(),n={};return{name:IR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!GIa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:IR.globalNoProxyList,e?.customNoProxyList?void 0:HIa)?z1i(o,n,r):o.proxySettings&&z1i(o,n,W1i(o.proxySettings)),s(o)}}}a(WIa,"proxyPolicy")});var Y_r=I(pge=>{"use strict";p();Object.defineProperty(pge,"__esModule",{value:!0});pge.setClientRequestIdPolicyName=void 0;pge.setClientRequestIdPolicy=zIa;pge.setClientRequestIdPolicyName="setClientRequestIdPolicy";function zIa(t="x-ms-client-request-id"){return{name:pge.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(zIa,"setClientRequestIdPolicy")});var K_r=I(hge=>{"use strict";p();Object.defineProperty(hge,"__esModule",{value:!0});hge.tlsPolicyName=void 0;hge.tlsPolicy=YIa;hge.tlsPolicyName="tlsPolicy";function YIa(t){return{name:hge.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(YIa,"tlsPolicy")});var J_r=I(J8=>{"use strict";p();Object.defineProperty(J8,"__esModule",{value:!0});J8.TracingContextImpl=J8.knownContextKeys=void 0;J8.createTracingContext=KIa;J8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function KIa(t={}){let e=new h0t(t.parentContext);return t.span&&(e=e.setValue(J8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(J8.knownContextKeys.namespace,t.namespace)),e}a(KIa,"createTracingContext");var h0t=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}};J8.TracingContextImpl=h0t});var Z_r=I(mge=>{"use strict";p();Object.defineProperty(mge,"__esModule",{value:!0});mge.createDefaultTracingSpan=Z1i;mge.createDefaultInstrumenter=X1i;mge.useInstrumenter=ZIa;mge.getInstrumenter=XIa;var JIa=J_r(),m0t=$5t();function Z1i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(Z1i,"createDefaultTracingSpan");function X1i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:Z1i(),tracingContext:(0,JIa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(X1i,"createDefaultInstrumenter");function ZIa(t){m0t.state.instrumenterImplementation=t}a(ZIa,"useInstrumenter");function XIa(){return m0t.state.instrumenterImplementation||(m0t.state.instrumenterImplementation=X1i()),m0t.state.instrumenterImplementation}a(XIa,"getInstrumenter")});var eSi=I(evr=>{"use strict";p();Object.defineProperty(evr,"__esModule",{value:!0});evr.createTracingClient=exa;var g0t=Z_r(),X_r=J_r();function exa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,g0t.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(X_r.knownContextKeys.namespace)||(A=A.setValue(X_r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(X_r.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,g0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,g0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,g0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(exa,"createTracingClient")});var tSi=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.createTracingClient=gge.useInstrumenter=void 0;var txa=Z_r();Object.defineProperty(gge,"useInstrumenter",{enumerable:!0,get:a(function(){return txa.useInstrumenter},"get")});var rxa=eSi();Object.defineProperty(gge,"createTracingClient",{enumerable:!0,get:a(function(){return rxa.createTracingClient},"get")})});var rSi=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.custom=void 0;var nxa=require("node:util");A0t.custom=nxa.inspect.custom});var y0t=I(zOe=>{"use strict";p();Object.defineProperty(zOe,"__esModule",{value:!0});zOe.RestError=void 0;zOe.isRestError=cxa;var ixa=L4(),oxa=rSi(),sxa=r0t(),axa=new sxa.Sanitizer,Age=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)}[oxa.custom](){return`RestError: ${this.message} + ${axa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};zOe.RestError=Age;Age.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";Age.PARSE_ERROR="PARSE_ERROR";function cxa(t){return t instanceof Age?!0:(0,ixa.isError)(t)&&t.name==="RestError"}a(cxa,"isRestError")});var tvr=I(yge=>{"use strict";p();Object.defineProperty(yge,"__esModule",{value:!0});yge.tracingPolicyName=void 0;yge.tracingPolicy=hxa;var lxa=tSi(),uxa=RG(),dxa=O_r(),E0t=ute(),YOe=L4(),fxa=y0t(),pxa=r0t();yge.tracingPolicyName="tracingPolicy";function hxa(t={}){let e=(0,dxa.getUserAgentValue)(t.userAgentPrefix),r=new pxa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=mxa();return{name:yge.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=gxa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return yxa(f,m),m}catch(m){throw Axa(f,m),m}}}}a(hxa,"tracingPolicy");function mxa(){try{return(0,lxa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:uxa.SDK_VERSION})}catch(t){E0t.logger.warning(`Error when creating the TracingClient: ${(0,YOe.getErrorMessage)(t)}`);return}}a(mxa,"tryCreateTracingClient");function gxa(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){E0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,YOe.getErrorMessage)(n)}`);return}}a(gxa,"tryCreateSpan");function Axa(t,e){try{t.setStatus({status:"error",error:(0,YOe.isError)(e)?e:void 0}),(0,fxa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){E0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,YOe.getErrorMessage)(r)}`)}}a(Axa,"tryProcessError");function yxa(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){E0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,YOe.getErrorMessage)(r)}`)}}a(yxa,"tryProcessResponse")});var oSi=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.createPipelineFromOptions=kxa;var Exa=P_r(),_xa=c_r(),vxa=D_r(),Cxa=L_r(),nSi=Q_r(),bxa=q_r(),Sxa=G_r(),Txa=W_r(),iSi=L4(),Ixa=z_r(),xxa=Y_r(),wxa=K_r(),Rxa=tvr();function kxa(t){var e;let r=(0,_xa.createEmptyPipeline)();return iSi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,wxa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,Ixa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,bxa.decompressResponsePolicy)())),r.addPolicy((0,Txa.formDataPolicy)(),{beforePolicies:[nSi.multipartPolicyName]}),r.addPolicy((0,Cxa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,xxa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,nSi.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,Sxa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,Rxa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),iSi.isNodeLike&&r.addPolicy((0,vxa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,Exa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(kxa,"createPipelineFromOptions")});var dSi=I(v0t=>{"use strict";p();Object.defineProperty(v0t,"__esModule",{value:!0});v0t.getBodyLength=uSi;v0t.createNodeHttpClient=Bxa;var svr=(g3(),Sa(sQ)),nvr=svr.__importStar(require("node:http")),ivr=svr.__importStar(require("node:https")),sSi=svr.__importStar(require("node:zlib")),Pxa=require("node:stream"),aSi=HOe(),Dxa=WOe(),ZOe=y0t(),KOe=ute(),Nxa={};function JOe(t){return t&&typeof t.pipe=="function"}a(JOe,"isReadableStream");function cSi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(cSi,"isStreamComplete");function lSi(t){return t&&typeof t.byteLength=="number"}a(lSi,"isArrayBuffer");var _0t=class extends Pxa.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}},ovr=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 aSi.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=uSi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new _0t(E);_.on("error",v=>{KOe.logger.error("Error in upload progress",v)}),JOe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=Mxa(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?Oxa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new _0t(y);E.on("error",_=>{KOe.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 Lxa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();JOe(d)&&(h=cSi(d));let m=Promise.resolve();JOe(f)&&(m=cSi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{KOe.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?nvr.request(u,d):ivr.request(u,d);h.once("error",m=>{var g;f(new ZOe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:ZOe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new aSi.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&JOe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):lSi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(KOe.logger.error("Unrecognized body type",n),f(new ZOe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?nvr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new nvr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return ivr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Nxa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(KOe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new ivr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function Mxa(t){let e=(0,Dxa.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(Mxa,"getResponseHeaders");function Oxa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=sSi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=sSi.createInflate();return t.pipe(n),n}return t}a(Oxa,"getDecodedResponseStream");function Lxa(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 ZOe.RestError(`Error reading response as text: ${o.message}`,{code:ZOe.RestError.PARSE_ERROR}))})})}a(Lxa,"streamToText");function uSi(t){return t?Buffer.isBuffer(t)?t.length:JOe(t)?null:lSi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(uSi,"getBodyLength");function Bxa(){return new ovr}a(Bxa,"createNodeHttpClient")});var fSi=I(avr=>{"use strict";p();Object.defineProperty(avr,"__esModule",{value:!0});avr.createDefaultHttpClient=Uxa;var Fxa=dSi();function Uxa(){return(0,Fxa.createNodeHttpClient)()}a(Uxa,"createDefaultHttpClient")});var pSi=I(lvr=>{"use strict";p();Object.defineProperty(lvr,"__esModule",{value:!0});lvr.createPipelineRequest=jxa;var Qxa=WOe(),qxa=L4(),cvr=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,Qxa.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,qxa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function jxa(t){return new cvr(t)}a(jxa,"createPipelineRequest")});var hSi=I(XOe=>{"use strict";p();Object.defineProperty(XOe,"__esModule",{value:!0});XOe.exponentialRetryPolicyName=void 0;XOe.exponentialRetryPolicy=Vxa;var Hxa=d0t(),Gxa=uge(),$xa=RG();XOe.exponentialRetryPolicyName="exponentialRetryPolicy";function Vxa(t={}){var e;return(0,Gxa.retryPolicy)([(0,Hxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:$xa.DEFAULT_RETRY_POLICY_COUNT})}a(Vxa,"exponentialRetryPolicy")});var mSi=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.systemErrorRetryPolicyName=void 0;Ege.systemErrorRetryPolicy=Kxa;var Wxa=d0t(),zxa=uge(),Yxa=RG();Ege.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Kxa(t={}){var e;return{name:Ege.systemErrorRetryPolicyName,sendRequest:(0,zxa.retryPolicy)([(0,Wxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Yxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Kxa,"systemErrorRetryPolicy")});var gSi=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.throttlingRetryPolicyName=void 0;_ge.throttlingRetryPolicy=ewa;var Jxa=u0t(),Zxa=uge(),Xxa=RG();_ge.throttlingRetryPolicyName="throttlingRetryPolicy";function ewa(t={}){var e;return{name:_ge.throttlingRetryPolicyName,sendRequest:(0,Zxa.retryPolicy)([(0,Jxa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Xxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(ewa,"throttlingRetryPolicy")});var uvr=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.DEFAULT_CYCLER_OPTIONS=void 0;vge.createTokenCycler=nwa;var twa=c0t();vge.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function rwa(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(nwa,"createTokenCycler")});var ASi=I(Cge=>{"use strict";p();Object.defineProperty(Cge,"__esModule",{value:!0});Cge.bearerTokenAuthenticationPolicyName=void 0;Cge.bearerTokenAuthenticationPolicy=cwa;var iwa=uvr(),owa=ute();Cge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function swa(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(swa,"defaultAuthorizeRequest");function awa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(awa,"getChallenge");function cwa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||owa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:swa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,iwa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:Cge.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&&awa(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(cwa,"bearerTokenAuthenticationPolicy")});var ySi=I(bge=>{"use strict";p();Object.defineProperty(bge,"__esModule",{value:!0});bge.ndJsonPolicyName=void 0;bge.ndJsonPolicy=lwa;bge.ndJsonPolicyName="ndJsonPolicy";function lwa(){return{name:bge.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(lwa,"ndJsonPolicy")});var _Si=I(pte=>{"use strict";p();Object.defineProperty(pte,"__esModule",{value:!0});pte.auxiliaryAuthenticationHeaderPolicyName=void 0;pte.auxiliaryAuthenticationHeaderPolicy=pwa;var uwa=uvr(),dwa=ute();pte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var ESi="x-ms-authorization-auxiliary";async function fwa(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(fwa,"sendAuthorizeRequest");function pwa(t){let{credentials:e,scopes:r}=t,n=t.logger||dwa.logger,o=new WeakMap;return{name:pte.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(`${pte.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,uwa.createTokenCycler)(d),o.set(d,f)),l.push(fwa({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. ${ESi} header will not be set.`),c(s)):(s.headers.set(ESi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(pwa,"auxiliaryAuthenticationHeaderPolicy")});var FSi=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 hwa=c_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return hwa.createEmptyPipeline},"get")});var mwa=oSi();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return mwa.createPipelineFromOptions},"get")});var gwa=fSi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return gwa.createDefaultHttpClient},"get")});var Awa=WOe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return Awa.createHttpHeaders},"get")});var ywa=pSi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return ywa.createPipelineRequest},"get")});var vSi=y0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return vSi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return vSi.isRestError},"get")});var CSi=q_r();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return CSi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return CSi.decompressResponsePolicyName},"get")});var bSi=hSi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return bSi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return bSi.exponentialRetryPolicyName},"get")});var SSi=Y_r();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return SSi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return SSi.setClientRequestIdPolicyName},"get")});var TSi=P_r();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return TSi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return TSi.logPolicyName},"get")});var ISi=Q_r();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return ISi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return ISi.multipartPolicyName},"get")});var dvr=z_r();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return dvr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return dvr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return dvr.getDefaultProxySettings},"get")});var xSi=D_r();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return xSi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return xSi.redirectPolicyName},"get")});var wSi=mSi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return wSi.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return wSi.systemErrorRetryPolicyName},"get")});var RSi=gSi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return RSi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return RSi.throttlingRetryPolicyName},"get")});var Ewa=uge();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return Ewa.retryPolicy},"get")});var kSi=tvr();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return kSi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return kSi.tracingPolicyName},"get")});var _wa=G_r();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return _wa.defaultRetryPolicy},"get")});var PSi=L_r();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return PSi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return PSi.userAgentPolicyName},"get")});var DSi=K_r();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return DSi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return DSi.tlsPolicyName},"get")});var NSi=W_r();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return NSi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return NSi.formDataPolicyName},"get")});var MSi=ASi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return MSi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return MSi.bearerTokenAuthenticationPolicyName},"get")});var OSi=ySi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return OSi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return OSi.ndJsonPolicyName},"get")});var LSi=_Si();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return LSi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return LSi.auxiliaryAuthenticationHeaderPolicyName},"get")});var BSi=B_r();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return BSi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return BSi.createFileFromStream},"get")})});var QSi=I((t5e,USi)=>{"use strict";p();var vwa=t5e&&t5e.__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())})},Cwa=t5e&&t5e.__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 xwa=Kl(),wwa=cy(),Rwa=(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){xwa.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||wwa.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})();qSi.exports=Rwa});var HSi=I(fvr=>{"use strict";p();Object.defineProperty(fvr,"__esModule",{value:!0});fvr.azureRoleEnvironmentTelemetryProcessor=kwa;function kwa(t,e){}a(kwa,"azureRoleEnvironmentTelemetryProcessor")});var VSi=I(C0t=>{"use strict";p();Object.defineProperty(C0t,"__esModule",{value:!0});C0t.samplingTelemetryProcessor=Pwa;C0t.getSamplingHashCode=$Si;var GSi=OE();function Pwa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&GSi.TelemetryType.Metric===GSi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=$Si(e.correlationContext.operation.id){"use strict";p();var Dwa=Z8&&Z8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Nwa=Z8&&Z8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Mwa=Z8&&Z8.__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)&&Dwa(e,t,r);return Nwa(e,t),e};Object.defineProperty(Z8,"__esModule",{value:!0});Z8.performanceMetricsTelemetryProcessor=Owa;var pvr=Mmt(),hvr=Mwa(OE());function Owa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case hvr.TelemetryTypeString.Exception:pvr.countException();break;case hvr.TelemetryTypeString.Request:var r=t.data.baseData;pvr.countRequest(r.duration,r.success);break;case hvr.TelemetryTypeString.Dependency:var n=t.data.baseData;pvr.countDependency(n.duration,n.success);break}return!0}a(Owa,"performanceMetricsTelemetryProcessor")});var zSi=I(uD=>{"use strict";p();var B4=uD&&uD.__assign||function(){return B4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var qwa=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]})),S0t=F4&&F4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qwa(e,t,r)};Object.defineProperty(F4,"__esModule",{value:!0});S0t(HSi(),F4);S0t(VSi(),F4);S0t(WSi(),F4);S0t(zSi(),F4)});var mvr=I((Svp,ZSi)=>{"use strict";p();var Zi=OE(),Gb=cy(),KSi=vG(),jwa=Kl(),Hwa=(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=Gb.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=KSi.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=Gb.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=Gb.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=Gb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.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=Gb.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=KSi.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(JSi.regex.test(l)){var u=new JSi(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})(),JSi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Gb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Gb.trim(n[2])||this.method,this.fileName=Gb.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})();ZSi.exports=Hwa});var XSi=I(kG=>{"use strict";p();var Gwa=kG&&kG.__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())})},$wa=kG&&kG.__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 T0t=i5e&&i5e.__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())})},I0t=i5e&&i5e.__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&&!n5e.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(PG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(PG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return T0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return I0t(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 Xwa.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(PG.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=$b.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),Jwa.gzip(f,function(g,A){var y=A;g?(h._logWarn($b.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($b.dumpObj(s)),s[Zwa.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(nRa)&&b.statusCode===400&&(Avr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(rRa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==tRa||b.statusCode==eRa?h._statsbeat.countThrottle(PG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(PG.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(PG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.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(PG.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=$b.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(PG.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,$b.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,$b.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r($b.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($b.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 T0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return I0t(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,X8.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: "+$b.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,n5e.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: "+$b.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,X8.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: "+$b.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=hte.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,X8.writeFileAsync(l,$b.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: "+$b.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),gvr.existsSync(this._tempDir)||gvr.mkdirSync(this._tempDir),n5e.FileAccessControl.applyACLRulesSync(this._tempDir);var r=X8.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=hte.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),gvr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+$b.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return T0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return I0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,X8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return hte.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=hte.join(this._tempDir,r),[4,X8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,X8.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 T0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return I0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,X8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return hte.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=hte.join(this._tempDir,e[r]),[4,X8.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})();eTi.exports=iRa});var rTi=I(x0t=>{"use strict";p();Object.defineProperty(x0t,"__esModule",{value:!0});x0t.AzureVirtualMachine=void 0;var tTi=Kl(),oRa=cy(),sRa=tge(),aRa="http://169.254.169.254/metadata/instance/compute",cRa="api-version=2017-12-01",lRa="format=json",uRa="UNREACH",dRa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(aRa,"?").concat(cRa,"&").concat(lRa),l=(n={method:"GET"},n[sRa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=oRa.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){tTi.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(uRa)>-1?s.isVM=!1:tTi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();x0t.AzureVirtualMachine=dRa});var nTi=I(w0t=>{"use strict";p();Object.defineProperty(w0t,"__esModule",{value:!0});w0t.NetworkStatsbeat=void 0;var fRa=(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})();w0t.NetworkStatsbeat=fRa});var cTi=I((mte,aTi)=>{"use strict";p();var U4=mte&&mte.__assign||function(){return U4=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:Ed.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:Ed.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(U4(U4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ed.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(U4(U4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ed.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(U4(U4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ed.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(U4(U4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Ed.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})();aTi.exports=vRa});var dTi=I((Qvp,uTi)=>{"use strict";p();var CRa=require("url"),bRa=o_r(),SRa=QSi(),TRa=z0e(),e6=OE(),IRa=jSi(),vvr=YSi(),lTi=vG(),xRa=cTi(),wRa=yvr(),Cvr=cy(),R0t=Kl(),RRa=mvr(),kRa=(function(){function t(e){this._telemetryProcessors=[];var r=new bRa(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 TRa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new xRa(this.config,this.context),this._statsbeat.enable(!0));var n=new wRa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new IRa(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,e6.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,e6.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,e6.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,e6.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!Cvr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,e6.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,e6.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,e6.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new CRa.URL(e.data).host}catch(r){e.target=null,R0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,e6.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&&e6.telemetryTypeToBaseType(r)){var n=RRa.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&&vvr.samplingTelemetryProcessor(n,{correlationContext:lTi.CorrelationContextManager.getCurrentContext()}),vvr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(vvr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else R0t.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||(R0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new SRa(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=lTi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var PRa=bvr&&bvr.__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)}})(),DRa=dTi(),fTi=ZEr(),NRa=tge(),k0t=Kl(),MRa=(function(t){PRa(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?fTi.trackRequestSync(this,r):k0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&k0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?fTi.trackRequest(this,r):k0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?NRa.trackRequest(this,r):k0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(DRa);pTi.exports=MRa});var gTi=I(mTi=>{"use strict";p();Object.defineProperty(mTi,"__esModule",{value:!0})});var _Ti=I(yt=>{"use strict";p();Object.defineProperty(yt,"__esModule",{value:!0});yt.Configuration=yt.liveMetricsClient=yt.defaultClient=yt.DistributedTracingModes=void 0;yt.setup=HRa;yt.start=ETi;yt.getCorrelationContext=$Ra;yt.startOperation=VRa;yt.wrapWithCorrelationContext=WRa;yt.dispose=zRa;var Tvr=vG(),ORa=ZCi(),LRa=ebi(),Ivr=Mmt(),BRa=FEr(),FRa=ubi(),URa=vbi(),QRa=tge(),qRa=ZEr(),ATi=qee(),o5e=Kl(),yTi=t1i(),xvr=n1i(),jRa=s1i();yt.TelemetryClient=hTi();yt.Contracts=OE();yt.azureFunctionsTypes=gTi();var Svr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(Svr||(yt.DistributedTracingModes=Svr={}));var s5e,a5e,c5e,l5e,u5e,Tge,Ige,gte,d5e,f5e,JT=!1,P0t;function HRa(t){return yt.defaultClient?o5e.info("The default client is already setup"):(yt.defaultClient=new yt.TelemetryClient(t),s5e=new ORa(yt.defaultClient),a5e=new LRa(yt.defaultClient),c5e=new Ivr(yt.defaultClient),l5e=new BRa(yt.defaultClient),u5e=new FRa(yt.defaultClient),Tge=new URa(yt.defaultClient),gte=new qRa(yt.defaultClient),d5e=new QRa(yt.defaultClient),Ige||(Ige=new xvr.AutoCollectNativePerformance(yt.defaultClient)),f5e=new jRa.AzureFunctionsHook(yt.defaultClient)),wvr}a(HRa,"setup");function GRa(){yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=!0),yt.defaultClient.config.enableAutoCollectConsole==null&&(yt.defaultClient.config.enableAutoCollectConsole=!1),yt.defaultClient.config.enableAutoCollectExceptions==null&&(yt.defaultClient.config.enableAutoCollectExceptions=!0),yt.defaultClient.config.enableAutoCollectPerformance==null&&(yt.defaultClient.config.enableAutoCollectPerformance=!0),yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),yt.defaultClient.config.enableAutoCollectHeartbeat==null&&(yt.defaultClient.config.enableAutoCollectHeartbeat=!0),yt.defaultClient.config.enableAutoCollectRequests==null&&(yt.defaultClient.config.enableAutoCollectRequests=!0),yt.defaultClient.config.enableAutoCollectDependencies==null&&(yt.defaultClient.config.enableAutoCollectDependencies=!0),yt.defaultClient.config.enableUseDiskRetryCaching==null&&(yt.defaultClient.config.enableUseDiskRetryCaching=!0),yt.defaultClient.config.enableAutoDependencyCorrelation==null&&(yt.defaultClient.config.enableAutoDependencyCorrelation=!0),yt.defaultClient.config.enableSendLiveMetrics==null&&(yt.defaultClient.config.enableSendLiveMetrics=!1),yt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(yt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),yt.defaultClient.config.enableWebInstrumentation==null&&(yt.defaultClient.config.enableWebInstrumentation=!1),yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(GRa,"_setDefaultConfig");function ETi(){if(yt.defaultClient){JT=!0,GRa(),s5e.enable(yt.defaultClient.config.enableAutoCollectExternalLoggers,yt.defaultClient.config.enableAutoCollectConsole),a5e.enable(yt.defaultClient.config.enableAutoCollectExceptions),c5e.enable(yt.defaultClient.config.enableAutoCollectPerformance),l5e.enable(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),u5e.enable(yt.defaultClient.config.enableAutoCollectHeartbeat),gte.useAutoCorrelation(yt.defaultClient.config.enableAutoDependencyCorrelation,yt.defaultClient.config.enableUseAsyncHooks),gte.enable(yt.defaultClient.config.enableAutoCollectRequests),d5e.enable(yt.defaultClient.config.enableAutoCollectDependencies),Tge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString),yt.defaultClient.config.enableSendLiveMetrics&&(yt.liveMetricsClient||(yt.liveMetricsClient=new yTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),P0t=new Ivr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(P0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient),yt.liveMetricsClient.enable(yt.defaultClient.config.enableSendLiveMetrics)),f5e.enable(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=xvr.AutoCollectNativePerformance.parseEnabled(yt.defaultClient.config.enableAutoCollectExtendedMetrics,yt.defaultClient.config);Ige.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),yt.defaultClient&&yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)}else o5e.warn("Start cannot be called before setup");return wvr}a(ETi,"start");function $Ra(){return Tvr.CorrelationContextManager.getCurrentContext()}a($Ra,"getCorrelationContext");function VRa(t,e){return Tvr.CorrelationContextManager.startOperation(t,e)}a(VRa,"startOperation");function WRa(t,e){return Tvr.CorrelationContextManager.wrapCallback(t,e)}a(WRa,"wrapWithCorrelationContext");var wvr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return ATi.w3cEnabled=e===Svr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=e,yt.defaultClient.config.enableAutoCollectConsole=r,JT&&s5e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExceptions=e,JT&&a5e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),yt.defaultClient){yt.defaultClient.config.enableAutoCollectPerformance=e;var n=xvr.AutoCollectNativePerformance.parseEnabled(r,yt.defaultClient.config);yt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,JT&&(c5e.enable(e),Ige.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,JT&&l5e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectHeartbeat=e,JT&&u5e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,JT&&Tge.enable(yt.defaultClient.config.enableAutoWebSnippetInjection,yt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,JT&&Tge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectRequests=e,JT&>e.enable(e)),t},t.setAutoCollectDependencies=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectDependencies=e,JT&&d5e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableAutoDependencyCorrelation=e,yt.defaultClient.config.enableUseAsyncHooks=r,JT&>e.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return yt.defaultClient&&(yt.defaultClient.config.enableUseDiskRetryCaching=e,yt.defaultClient.config.enableResendInterval=r,yt.defaultClient.config.enableMaxBytesOnDisk=n,yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),o5e.enableDebug=e,o5e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,JT&&f5e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),yt.defaultClient?(!yt.liveMetricsClient&&e?(yt.liveMetricsClient=new yTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),P0t=new Ivr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(P0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient):yt.liveMetricsClient&&yt.liveMetricsClient.enable(e),yt.defaultClient.config.enableSendLiveMetrics=e,t):(o5e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=ETi,t})();yt.Configuration=wvr;function zRa(){ATi.w3cEnabled=!0,yt.defaultClient=null,JT=!1,s5e&&s5e.dispose(),a5e&&a5e.dispose(),c5e&&c5e.dispose(),l5e&&l5e.dispose(),u5e&&u5e.dispose(),Tge&&Tge.dispose(),Ige&&Ige.dispose(),gte&>e.dispose(),d5e&&d5e.dispose(),yt.liveMetricsClient&&(yt.liveMetricsClient.enable(!1),yt.liveMetricsClient=void 0),f5e&&f5e.dispose()}a(zRa,"dispose")});var kvr=I(xR=>{"use strict";p();var YRa=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]})),KRa=xR&&xR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vTi=xR&&xR.__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 eka(e)?CTi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};xR.AzureInsightReporter=Rvr;function tka(t,e,r){let n=new JRa.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,bTi(t,e,n),n}a(tka,"createAppInsightsClient");function bTi(t,e,r){r.commonProperties=rka(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(bTi,"configureReporter");function rka(t,e){return t=t||{},t.common_os=D0t.platform(),t.common_platformversion=D0t.release(),t.common_arch=D0t.arch(),t.common_cpu=Array.from(new Set(D0t.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(rka,"decorateWithCommonProperties")});var STi=I((Xvp,nka)=>{nka.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.54.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.126.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. @@ -760,51 +760,51 @@ 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.sandbox.enabled":{type:"string",enum:["off","on","allowNetwork"],enumDescriptions:["%github.copilot.config.cli.sandbox.enabled.offDescription%","%github.copilot.config.cli.sandbox.enabled.onDescription%","%github.copilot.config.cli.sandbox.enabled.allowNetworkDescription%"],default:"off",markdownDescription:"%github.copilot.config.cli.sandbox.enabled%",tags:["advanced","experimental"]},"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:!0,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,scope:"application",markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. Configurable in user settings only. 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",scope:"application",markdownDescription:"OTel exporter type for Copilot Chat telemetry. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",scope:"application",markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Configurable in user settings only. Env var `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,scope:"application",markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Configurable in user settings only. Env var `COPILOT_OTEL_CAPTURE_CONTENT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,scope:"application",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]`. Configurable in user settings only. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",scope:"application",markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,scope:"application",markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. Configurable in user settings only. 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"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanCreatePullRequest && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanOpenPullRequest && !isSessionsWindow",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",when:"!chatIsAgentHostSession"}],"chat/input/status":[{command:"github.copilot.chat.otel.statusActive",when:"github.copilot.otel.enabledExplicitly && isSessionsWindow",group:"otel@1"}],"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.chat.otel.statusActive",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.chat.cloudSessions.createPullRequestForTask",when:"false"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",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 && chatSessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli && chatSessionProviderId == default-copilot",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 && ((isSessionsWindow && !config.chat.agents.claude.preferAgentHost) || (!isSessionsWindow && !config.chat.editor.claude.preferAgentHost))",canDelegate:!0,requiresCustomModels:!0,supportsAutoModel:!1,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",supportsAutoModel:!0,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",supportsAutoModel:!1,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","@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","@typescript/native-preview":"^7.0.0-dev.20260429","@vitest/coverage-v8":"^4.1.8","@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.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",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.16","ts-dedent":"^2.2.0",tsx:"^4.22.4",typescript:"^5.8.3","vite-plugin-wasm":"^3.6.0",vitest:"^4.1.8","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.64-0","@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",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:{string_decoder:"npm:string_decoder@1.2.0",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 c5e=I(Vb=>{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.vscodeEngineVersion=Vb.isPreRelease=Vb.isProduction=Vb.packageJson=void 0;Vb.packageJson=gTi();Vb.isProduction=Vb.packageJson.buildType!=="dev";Vb.isPreRelease=Vb.packageJson.isPreRelease||!Vb.isProduction;Vb.vscodeEngineVersion=Vb.packageJson.engines.vscode});var U4=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 yTi=nn(),ETi=owe(),Tge=c5e(),ATi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(ATi||(Wb.OperatingSystem=ATi={}));var xvr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Wb.NameAndVersion=xvr;Wb.IEnvService=(0,yTi.createServiceIdentifier)("IEnvService");Wb.INativeEnvService=(0,yTi.createServiceIdentifier)("INativeEnvService");var wvr=class{static{a(this,"AbstractEnvService")}isProduction(){return Tge.isProduction}isPreRelease(){return Tge.isPreRelease}isSimulation(){return ETi.env.SIMULATION==="1"}getBuildType(){return Tge.packageJson.buildType}getVersion(){return Tge.packageJson.version}getBuild(){return Tge.packageJson.build}getName(){return Tge.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Wb.AbstractEnvService=wvr;Wb.isScenarioAutomation=ETi.env.IS_SCENARIO_AUTOMATION==="1"});var T0=I(gte=>{"use strict";p();Object.defineProperty(gte,"__esModule",{value:!0});gte.generateUuid=void 0;gte.isUUID=HRa;gte.prefixedUuid=GRa;var jRa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function HRa(t){return jRa.test(t)}a(HRa,"isUUID");gte.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 GRa(t){return`${t}-${(0,gte.generateUuid)()}`}a(GRa,"prefixedUuid")});var _Ti=I(R0t=>{"use strict";p();Object.defineProperty(R0t,"__esModule",{value:!0});R0t.CopilotConfigPrefix=void 0;R0t.CopilotConfigPrefix="github.copilot"});var kvr=I(cD=>{"use strict";p();var $Ra=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]})),VRa=cD&&cD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),WRa=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;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(YRa,"transformEvent")});var LE=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.apiVersion=hn.ICompletionsEditorAndPluginInfo=hn.BuildInfo=hn.InMemoryConfigProvider=hn.DefaultsOnlyConfigProvider=hn.ConfigProvider=hn.ICompletionsConfigProvider=hn.BuildType=hn.BlockMode=hn.ConfigKey=hn.packageJson=void 0;hn.shouldDoServerTrimming=ZRa;hn.getConfigKeyRecursively=XRa;hn.getConfigDefaultForKey=CTi;hn.getOptionalConfigDefaultForKey=bTi;hn.getConfig=eka;hn.dumpForTelemetry=tka;hn.formatNameAndVersion=Mvr;hn.editorVersionHeaders=rka;var k0t=c5e();Object.defineProperty(hn,"packageJson",{enumerable:!0,get:a(function(){return k0t.packageJson},"get")});var vTi=nn(),KRa=_Ti(),JRa=kvr();hn.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 P0t;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(P0t||(hn.BlockMode=P0t={}));function ZRa(t){return[P0t.Server,P0t.ParsingAndServer].includes(t)}a(ZRa,"shouldDoServerTrimming");var Ate;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(Ate||(hn.BuildType=Ate={}));hn.ICompletionsConfigProvider=(0,vTi.createServiceIdentifier)("ICompletionsConfigProvider");var l5e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};hn.ConfigProvider=l5e;var Pvr=class extends l5e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return CTi(e)}getOptionalConfig(e){return bTi(e)}dumpForTelemetry(){return{}}};hn.DefaultsOnlyConfigProvider=Pvr;var Dvr=class extends l5e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new JRa.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[hn.ConfigKey.ShowEditorCompletions,hn.ConfigKey.EnableAutoCompletions,hn.ConfigKey.DelayCompletions,hn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};hn.InMemoryConfigProvider=Dvr;function XRa(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(XRa,"getConfigKeyRecursively");function CTi(t){if(Nvr.has(t))return Nvr.get(t);throw new Error(`Missing config default value: ${KRa.CopilotConfigPrefix}.${t}`)}a(CTi,"getConfigDefaultForKey");function bTi(t){return Nvr.get(t)}a(bTi,"getOptionalConfigDefaultForKey");var Nvr=new Map([[hn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[hn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[hn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[hn.ConfigKey.RelatedFilesVSCode,!1],[hn.ConfigKey.IncludeNeighboringFiles,!1],[hn.ConfigKey.ExcludeRelatedFiles,!1],[hn.ConfigKey.ContextProviders,[]],[hn.ConfigKey.DebugSnippyOverrideUrl,""],[hn.ConfigKey.UseSubsetMatching,null],[hn.ConfigKey.ContextProviderTimeBudget,void 0],[hn.ConfigKey.DebugOverrideCapiUrl,""],[hn.ConfigKey.DebugTestOverrideCapiUrl,""],[hn.ConfigKey.DebugOverrideProxyUrl,""],[hn.ConfigKey.DebugTestOverrideProxyUrl,""],[hn.ConfigKey.DebugOverrideEngine,""],[hn.ConfigKey.AlwaysRequestMultiline,void 0],[hn.ConfigKey.CompletionsDebounce,void 0],[hn.ConfigKey.CompletionsDelay,void 0],[hn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[hn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[hn.ConfigKey.ShowEditorCompletions,void 0],[hn.ConfigKey.EnableAutoCompletions,void 0],[hn.ConfigKey.DelayCompletions,void 0],[hn.ConfigKey.FilterCompletions,void 0],[hn.ConfigKey.UseSplitContextPrompt,!0],[hn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[hn.ConfigKey.UserSelectedCompletionModel,""],[hn.ConfigKey.DebugOverrideEngineLegacy,""],[hn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugFilterLogCategories,[]]]);function eka(t,e){return t.get(hn.ICompletionsConfigProvider).getConfig(e)}a(eka,"getConfig");function tka(t){try{return t.get(hn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(tka,"dumpForTelemetry");var D0t=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===Ate.NIGHTLY}static isProduction(){return this.getBuildType()!==Ate.DEV}static getBuildType(){return k0t.packageJson.buildType==="prod"?t.getVersion().length===15?Ate.NIGHTLY:Ate.PROD:Ate.DEV}static getVersion(){return k0t.packageJson.version}static getBuild(){return k0t.packageJson.build}};hn.BuildInfo=D0t;function Mvr({name:t,version:e}){return`${t}/${e}`}a(Mvr,"formatNameAndVersion");hn.ICompletionsEditorAndPluginInfo=(0,vTi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");hn.apiVersion="2025-05-01";function rka(t){let e=t.get(hn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Mvr(e.getEditorInfo()),"Editor-Plugin-Version":Mvr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":D0t.getVersion()}}a(rka,"editorVersionHeaders")});var Ovr=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.ExpServiceTelemetryNames=void 0;var STi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(STi||(N0t.ExpServiceTelemetryNames=STi={}))});var M0t=I(Ige=>{"use strict";p();Object.defineProperty(Ige,"__esModule",{value:!0});Ige.ExpConfig=Ige.ExpTreatmentVariables=void 0;var nka=$g(),ika=Ovr(),TTi;(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"})(TTi||(Ige.ExpTreatmentVariables=TTi={}));var Lvr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,nka.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[ika.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};Ige.ExpConfig=Lvr});var fy=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.ICompletionsFeaturesService=void 0;var oka=nn();O0t.ICompletionsFeaturesService=(0,oka.createServiceIdentifier)("ICompletionsFeaturesService")});var L0t=I(wG=>{"use strict";p();Object.defineProperty(wG,"__esModule",{value:!0});wG.FilterSettings=wG.Release=wG.Filter=void 0;var yte;(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"})(yte||(wG.Filter=yte={}));var ITi;(function(t){t.Stable="stable",t.Nightly="nightly"})(ITi||(wG.Release=ITi={}));var ska={[yte.CopilotClientTimeBucket]:"timeBucket",[yte.CopilotOverrideEngine]:"engine",[yte.CopilotRepository]:"repo",[yte.CopilotFileType]:"fileType",[yte.CopilotUserKind]:"userKind"},Bvr=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=ska[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};wG.FilterSettings=Bvr});var RTi=I(xge=>{"use strict";p();Object.defineProperty(xge,"__esModule",{value:!0});xge.JointCompletionsProviderTriggerChangeStrategy=xge.JointCompletionsProviderStrategy=void 0;var xTi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(xTi||(xge.JointCompletionsProviderStrategy=xTi={}));var wTi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(wTi||(xge.JointCompletionsProviderTriggerChangeStrategy=wTi={}))});var RG=I(I0=>{"use strict";p();Object.defineProperty(I0,"__esModule",{value:!0});I0.vString=cka;I0.vNumber=uka;I0.vBoolean=fka;I0.vObjAny=hka;I0.vUndefined=gka;I0.vNull=Aka;I0.vNullable=yka;I0.vUnchecked=PTi;I0.vUnknown=Eka;I0.vRequired=_ka;I0.vObj=vka;I0.vArray=Cka;I0.vTuple=bka;I0.vUnion=DTi;I0.vEnum=Ska;I0.vLiteral=Tka;I0.vLazy=Ika;var Ete=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}}},aka=new Ete("string");function cka(){return aka}a(cka,"vString");var lka=new Ete("number");function uka(){return lka}a(uka,"vNumber");var dka=new Ete("boolean");function fka(){return dka}a(fka,"vBoolean");var pka=new Ete("object");function hka(){return pka}a(hka,"vObjAny");var mka=new Ete("undefined");function gka(){return mka}a(gka,"vUndefined");var Fvr=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"}}},kTi=new Fvr;function Aka(){return kTi}a(Aka,"vNull");function yka(t){return DTi(t,kTi)}a(yka,"vNullable");function PTi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(PTi,"vUnchecked");function Eka(){return PTi()}a(Eka,"vUnknown");function _ka(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(_ka,"vRequired");function vka(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(vka,"vObj");function Cka(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(bka,"vTuple");function DTi(...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(DTi,"vUnion");function Ska(...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(Ska,"vEnum");function Tka(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(Tka,"vLiteral");function Ika(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(Ika,"vLazy")});var NTi=I(u5e=>{"use strict";p();Object.defineProperty(u5e,"__esModule",{value:!0});u5e.DocumentSwitchTriggerStrategy=void 0;var xka=RG(),B0t;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(B0t||(u5e.DocumentSwitchTriggerStrategy=B0t={}));(function(t){t.VALIDATOR=(0,xka.vEnum)(t.Always,t.AfterAcceptance)})(B0t||(u5e.DocumentSwitchTriggerStrategy=B0t={}))});var Uvr=I(d5e=>{"use strict";p();Object.defineProperty(d5e,"__esModule",{value:!0});d5e.DiffHistoryMergeStrategy=void 0;var wka=RG(),F0t;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(F0t||(d5e.DiffHistoryMergeStrategy=F0t={}));(function(t){t.VALIDATOR=(0,wka.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(F0t||(d5e.DiffHistoryMergeStrategy=F0t={}))});var Q0t=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.ImportChanges=void 0;var Rka=RG(),U0t;(function(t){t.All="all",t.None="none"})(U0t||(f5e.ImportChanges=U0t={}));(function(t){t.VALIDATOR=(0,Rka.vEnum)(t.All,t.None)})(U0t||(f5e.ImportChanges=U0t={}))});var py=I(mn=>{"use strict";p();Object.defineProperty(mn,"__esModule",{value:!0});mn.PatchModelPrediction=mn.SpeculativeRequestsAutoExpandEditWindowLines=mn.SpeculativeRequestsCursorPlacement=mn.DuplicateAdditionsMode=mn.SpeculativeRequestsEnablement=mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=mn.MODEL_CONFIGURATION_VALIDATOR=mn.LINT_OPTIONS_VALIDATOR=mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=mn.DEFAULT_OPTIONS=mn.ResponseFormat=mn.PromptingStrategy=mn.EditIntent=mn.EarlyDivergenceCancellationMode=mn.AggressivenessLevel=mn.AggressivenessSetting=mn.LintOptionShowCode=mn.LintOptionWarning=mn.CurrentFileOptions=mn.GlobalBudgetOptions=mn.NeighborFilesOptions=mn.RecentlyViewedDocumentsOptions=mn.RecentFileClippingStrategy=mn.IncludeLineNumbersOption=void 0;mn.isPromptingStrategy=kka;mn.isAggressivenessStrategy=Pka;mn.applyStrategyConfig=Nka;mn.parseLintOptionString=Mka;mn.parseUserHappinessScoreConfigurationString=Oka;var BTi=rd(),pn=RG(),Qvr=Q0t(),zb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(zb||(mn.IncludeLineNumbersOption=zb={}));var _te;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(_te||(mn.RecentFileClippingStrategy=_te={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.AroundEditRange,t.Proportional)})(_te||(mn.RecentFileClippingStrategy=_te={}));var qvr;(function(t){t.VALIDATOR=(0,pn.vObj)({nDocuments:(0,pn.vNumber)(),maxTokens:(0,pn.vNumber)(),includeViewedFiles:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),clippingStrategy:(0,pn.vEnum)(_te.AroundEditRange,_te.Proportional),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(qvr||(mn.RecentlyViewedDocumentsOptions=qvr={}));var MTi;(function(t){t.VALIDATOR=(0,pn.vObj)({enabled:(0,pn.vBoolean)(),maxTokens:(0,pn.vNumber)()})})(MTi||(mn.NeighborFilesOptions=MTi={}));var OTi;(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})(OTi||(mn.GlobalBudgetOptions=OTi={}));var jvr;(function(t){t.VALIDATOR=(0,pn.vObj)({maxTokens:(0,pn.vNumber)(),includeTags:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),includeCursorTag:(0,pn.vBoolean)(),prioritizeAboveCursor:(0,pn.vBoolean)(),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(jvr||(mn.CurrentFileOptions=jvr={}));var wge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(wge||(mn.LintOptionWarning=wge={}));var Rge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(Rge||(mn.LintOptionShowCode=Rge={}));var q0t;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(q0t||(mn.AggressivenessSetting=q0t={}));var kG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(kG||(mn.AggressivenessLevel=kG={}));var j0t;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(j0t||(mn.EarlyDivergenceCancellationMode=j0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(j0t||(mn.EarlyDivergenceCancellationMode=j0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return kG.Low;case t.Medium:return kG.Medium;case t.High:return kG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(q0t||(mn.AggressivenessSetting=q0t={}));var H0t;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(H0t||(mn.EditIntent=H0t={}));(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===kG.Medium||s===kG.High;case t.Low:return s===kG.High;default:(0,BTi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(H0t||(mn.EditIntent=H0t={}));var kl;(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"})(kl||(mn.PromptingStrategy=kl={}));function kka(t){return Object.values(kl).includes(t)}a(kka,"isPromptingStrategy");function Pka(t){return t===kl.XtabAggressiveness||t===kl.Xtab275Aggressiveness||t===kl.Xtab275AggressivenessHighLow||t===kl.Xtab275EditIntent||t===kl.Xtab275EditIntentShort}a(Pka,"isAggressivenessStrategy");var G0t;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(G0t||(mn.ResponseFormat=G0t={}));(function(t){function e(r){switch(r){case kl.UnifiedModel:case kl.Codexv21NesUnified:case kl.Nes41Miniv3:return t.UnifiedWithXml;case kl.Xtab275:case kl.XtabAggressiveness:case kl.Xtab275Aggressiveness:case kl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case kl.PatchBased:case kl.PatchBased01:case kl.PatchBased02:case kl.PatchBased02WithRecentLineNumbers:case kl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case kl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case kl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case kl.SimplifiedSystemPrompt:case kl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,BTi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(G0t||(mn.ResponseFormat=G0t={}));mn.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:zb.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:zb.None,clippingStrategy:_te.AroundEditRange,useLeftoverBudgetFromAbove:!1},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};mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:Rge.YES_WITH_SURROUNDING,tagName:"linter",warnings:wge.YES_IF_NO_ERRORS,nRecentFiles:0};mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var Dka={[kl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[kl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:Qvr.ImportChanges.All},[kl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.None},supportsNextCursorLinePrediction:!1,allowImportChanges:Qvr.ImportChanges.All}};function Nka(t){let e=t.promptingStrategy===void 0?void 0:Dka[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(Nka,"applyStrategyConfig");mn.LINT_OPTIONS_VALIDATOR=(0,pn.vObj)({tagName:(0,pn.vString)(),warnings:(0,pn.vEnum)(wge.YES,wge.NO,wge.YES_IF_NO_ERRORS),showCode:(0,pn.vEnum)(Rge.NO,Rge.YES,Rge.YES_WITH_SURROUNDING),maxLints:(0,pn.vNumber)(),maxLineDistance:(0,pn.vNumber)(),nRecentFiles:(0,pn.vNumber)()});mn.MODEL_CONFIGURATION_VALIDATOR=(0,pn.vObj)({modelName:(0,pn.vRequired)((0,pn.vString)()),promptingStrategy:(0,pn.vUnion)((0,pn.vEnum)(...Object.values(kl)),(0,pn.vUndefined)()),includeTagsInCurrentFile:(0,pn.vRequired)((0,pn.vBoolean)()),includePostScript:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),currentFile:(0,pn.vUnion)(jvr.VALIDATOR,(0,pn.vUndefined)()),recentlyViewedDocuments:(0,pn.vUnion)(qvr.VALIDATOR,(0,pn.vUndefined)()),lintOptions:(0,pn.vUnion)(mn.LINT_OPTIONS_VALIDATOR,(0,pn.vUndefined)()),supportsNextCursorLinePrediction:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),allowImportChanges:(0,pn.vUnion)(Qvr.ImportChanges.VALIDATOR,(0,pn.vUndefined)())});function Mka(t,e){try{let r=JSON.parse(t),n=mn.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(Mka,"parseLintOptionString");mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var LTi=(0,pn.vObj)({acceptedScore:(0,pn.vRequired)((0,pn.vNumber)()),rejectedScore:(0,pn.vRequired)((0,pn.vNumber)()),ignoredScore:(0,pn.vRequired)((0,pn.vNumber)()),highThreshold:(0,pn.vRequired)((0,pn.vNumber)()),mediumThreshold:(0,pn.vRequired)((0,pn.vNumber)()),includeIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),ignoredLimit:(0,pn.vRequired)((0,pn.vNumber)()),limitConsecutiveIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),limitTotalIgnored:(0,pn.vRequired)((0,pn.vBoolean)())});function p5e(t,e,r){return t>=e&&t<=r}a(p5e,"isInRange");mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=LTi.validate(t);if(e.error)return e;let r=e.content;return p5e(r.acceptedScore,0,1)?p5e(r.rejectedScore,0,1)?p5e(r.ignoredScore,0,1)?p5e(r.highThreshold,0,1)?p5e(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(kge,"__esModule",{value:!0});kge.TextReplacement=kge.TextEdit=void 0;var FTi=Sl(),UTi=rd(),Z0t=Rs(),K0t=em(),PG=q_(),_m=eh(),X0t=Tme(),QTi=qT(),egt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>Tv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new Tv(e,r)])}static delete(e){return new t([new Tv(e,"")])}static insert(e,r){return new t([new Tv(_m.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,FTi.compareBy)(n=>n.range,_m.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,UTi.assertFn)(()=>(0,UTi.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 Tv(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=X0t.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new PG.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return J0t(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 PG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof PG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof PG.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return J0t(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 PG.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=J0t(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=J0t(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new QTi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new Tv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=X0t.TextLength.ofText(s.text),l=PG.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 Z0t.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 QTi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=_m.Range.fromPositions(new PG.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=_m.Range.fromPositions(r.range.getEndPosition(),new PG.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(` -`)}};kge.TextEdit=egt;var Tv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Z0t.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 && chatSessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli && chatSessionProviderId == default-copilot",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 && ((isSessionsWindow && !config.chat.agents.claude.preferAgentHost) || (!isSessionsWindow && !config.chat.editor.claude.preferAgentHost))",canDelegate:!0,requiresCustomModels:!0,supportsAutoModel:!1,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",supportsAutoModel:!0,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",supportsAutoModel:!1,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","@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","@typescript/native-preview":"^7.0.0-dev.20260429","@vitest/coverage-v8":"^4.1.8","@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.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",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.16","ts-dedent":"^2.2.0",tsx:"^4.22.4",typescript:"^5.8.3","vite-plugin-wasm":"^3.6.0",vitest:"^4.1.8","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.64-0","@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",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:{string_decoder:"npm:string_decoder@1.2.0",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 p5e=I(Vb=>{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.vscodeEngineVersion=Vb.isPreRelease=Vb.isProduction=Vb.packageJson=void 0;Vb.packageJson=STi();Vb.isProduction=Vb.packageJson.buildType!=="dev";Vb.isPreRelease=Vb.packageJson.isPreRelease||!Vb.isProduction;Vb.vscodeEngineVersion=Vb.packageJson.engines.vscode});var Q4=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 ITi=nn(),xTi=cwe(),xge=p5e(),TTi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(TTi||(Wb.OperatingSystem=TTi={}));var Pvr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Wb.NameAndVersion=Pvr;Wb.IEnvService=(0,ITi.createServiceIdentifier)("IEnvService");Wb.INativeEnvService=(0,ITi.createServiceIdentifier)("INativeEnvService");var Dvr=class{static{a(this,"AbstractEnvService")}isProduction(){return xge.isProduction}isPreRelease(){return xge.isPreRelease}isSimulation(){return xTi.env.SIMULATION==="1"}getBuildType(){return xge.packageJson.buildType}getVersion(){return xge.packageJson.version}getBuild(){return xge.packageJson.build}getName(){return xge.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Wb.AbstractEnvService=Dvr;Wb.isScenarioAutomation=xTi.env.IS_SCENARIO_AUTOMATION==="1"});var I0=I(Ate=>{"use strict";p();Object.defineProperty(Ate,"__esModule",{value:!0});Ate.generateUuid=void 0;Ate.isUUID=oka;Ate.prefixedUuid=ska;var ika=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function oka(t){return ika.test(t)}a(oka,"isUUID");Ate.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 ska(t){return`${t}-${(0,Ate.generateUuid)()}`}a(ska,"prefixedUuid")});var wTi=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.CopilotConfigPrefix=void 0;N0t.CopilotConfigPrefix="github.copilot"});var Mvr=I(dD=>{"use strict";p();var aka=dD&&dD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cka=dD&&dD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lka=dD&&dD.__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(dka,"transformEvent")});var BE=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.apiVersion=hn.ICompletionsEditorAndPluginInfo=hn.BuildInfo=hn.InMemoryConfigProvider=hn.DefaultsOnlyConfigProvider=hn.ConfigProvider=hn.ICompletionsConfigProvider=hn.BuildType=hn.BlockMode=hn.ConfigKey=hn.packageJson=void 0;hn.shouldDoServerTrimming=hka;hn.getConfigKeyRecursively=mka;hn.getConfigDefaultForKey=kTi;hn.getOptionalConfigDefaultForKey=PTi;hn.getConfig=gka;hn.dumpForTelemetry=Aka;hn.formatNameAndVersion=Fvr;hn.editorVersionHeaders=yka;var M0t=p5e();Object.defineProperty(hn,"packageJson",{enumerable:!0,get:a(function(){return M0t.packageJson},"get")});var RTi=nn(),fka=wTi(),pka=Mvr();hn.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 O0t;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(O0t||(hn.BlockMode=O0t={}));function hka(t){return[O0t.Server,O0t.ParsingAndServer].includes(t)}a(hka,"shouldDoServerTrimming");var yte;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(yte||(hn.BuildType=yte={}));hn.ICompletionsConfigProvider=(0,RTi.createServiceIdentifier)("ICompletionsConfigProvider");var h5e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};hn.ConfigProvider=h5e;var Ovr=class extends h5e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return kTi(e)}getOptionalConfig(e){return PTi(e)}dumpForTelemetry(){return{}}};hn.DefaultsOnlyConfigProvider=Ovr;var Lvr=class extends h5e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new pka.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[hn.ConfigKey.ShowEditorCompletions,hn.ConfigKey.EnableAutoCompletions,hn.ConfigKey.DelayCompletions,hn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};hn.InMemoryConfigProvider=Lvr;function mka(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(mka,"getConfigKeyRecursively");function kTi(t){if(Bvr.has(t))return Bvr.get(t);throw new Error(`Missing config default value: ${fka.CopilotConfigPrefix}.${t}`)}a(kTi,"getConfigDefaultForKey");function PTi(t){return Bvr.get(t)}a(PTi,"getOptionalConfigDefaultForKey");var Bvr=new Map([[hn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[hn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[hn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[hn.ConfigKey.RelatedFilesVSCode,!1],[hn.ConfigKey.IncludeNeighboringFiles,!1],[hn.ConfigKey.ExcludeRelatedFiles,!1],[hn.ConfigKey.ContextProviders,[]],[hn.ConfigKey.DebugSnippyOverrideUrl,""],[hn.ConfigKey.UseSubsetMatching,null],[hn.ConfigKey.ContextProviderTimeBudget,void 0],[hn.ConfigKey.DebugOverrideCapiUrl,""],[hn.ConfigKey.DebugTestOverrideCapiUrl,""],[hn.ConfigKey.DebugOverrideProxyUrl,""],[hn.ConfigKey.DebugTestOverrideProxyUrl,""],[hn.ConfigKey.DebugOverrideEngine,""],[hn.ConfigKey.AlwaysRequestMultiline,void 0],[hn.ConfigKey.CompletionsDebounce,void 0],[hn.ConfigKey.CompletionsDelay,void 0],[hn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[hn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[hn.ConfigKey.ShowEditorCompletions,void 0],[hn.ConfigKey.EnableAutoCompletions,void 0],[hn.ConfigKey.DelayCompletions,void 0],[hn.ConfigKey.FilterCompletions,void 0],[hn.ConfigKey.UseSplitContextPrompt,!0],[hn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[hn.ConfigKey.UserSelectedCompletionModel,""],[hn.ConfigKey.DebugOverrideEngineLegacy,""],[hn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugFilterLogCategories,[]]]);function gka(t,e){return t.get(hn.ICompletionsConfigProvider).getConfig(e)}a(gka,"getConfig");function Aka(t){try{return t.get(hn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(Aka,"dumpForTelemetry");var L0t=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===yte.NIGHTLY}static isProduction(){return this.getBuildType()!==yte.DEV}static getBuildType(){return M0t.packageJson.buildType==="prod"?t.getVersion().length===15?yte.NIGHTLY:yte.PROD:yte.DEV}static getVersion(){return M0t.packageJson.version}static getBuild(){return M0t.packageJson.build}};hn.BuildInfo=L0t;function Fvr({name:t,version:e}){return`${t}/${e}`}a(Fvr,"formatNameAndVersion");hn.ICompletionsEditorAndPluginInfo=(0,RTi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");hn.apiVersion="2025-05-01";function yka(t){let e=t.get(hn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Fvr(e.getEditorInfo()),"Editor-Plugin-Version":Fvr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":L0t.getVersion()}}a(yka,"editorVersionHeaders")});var Uvr=I(B0t=>{"use strict";p();Object.defineProperty(B0t,"__esModule",{value:!0});B0t.ExpServiceTelemetryNames=void 0;var DTi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(DTi||(B0t.ExpServiceTelemetryNames=DTi={}))});var F0t=I(wge=>{"use strict";p();Object.defineProperty(wge,"__esModule",{value:!0});wge.ExpConfig=wge.ExpTreatmentVariables=void 0;var Eka=Vg(),_ka=Uvr(),NTi;(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"})(NTi||(wge.ExpTreatmentVariables=NTi={}));var Qvr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,Eka.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[_ka.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};wge.ExpConfig=Qvr});var py=I(U0t=>{"use strict";p();Object.defineProperty(U0t,"__esModule",{value:!0});U0t.ICompletionsFeaturesService=void 0;var vka=nn();U0t.ICompletionsFeaturesService=(0,vka.createServiceIdentifier)("ICompletionsFeaturesService")});var Q0t=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.FilterSettings=DG.Release=DG.Filter=void 0;var Ete;(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"})(Ete||(DG.Filter=Ete={}));var MTi;(function(t){t.Stable="stable",t.Nightly="nightly"})(MTi||(DG.Release=MTi={}));var Cka={[Ete.CopilotClientTimeBucket]:"timeBucket",[Ete.CopilotOverrideEngine]:"engine",[Ete.CopilotRepository]:"repo",[Ete.CopilotFileType]:"fileType",[Ete.CopilotUserKind]:"userKind"},qvr=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=Cka[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};DG.FilterSettings=qvr});var BTi=I(Rge=>{"use strict";p();Object.defineProperty(Rge,"__esModule",{value:!0});Rge.JointCompletionsProviderTriggerChangeStrategy=Rge.JointCompletionsProviderStrategy=void 0;var OTi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(OTi||(Rge.JointCompletionsProviderStrategy=OTi={}));var LTi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(LTi||(Rge.JointCompletionsProviderTriggerChangeStrategy=LTi={}))});var NG=I(x0=>{"use strict";p();Object.defineProperty(x0,"__esModule",{value:!0});x0.vString=Ska;x0.vNumber=Ika;x0.vBoolean=wka;x0.vObjAny=kka;x0.vUndefined=Dka;x0.vNull=Nka;x0.vNullable=Mka;x0.vUnchecked=UTi;x0.vUnknown=Oka;x0.vRequired=Lka;x0.vObj=Bka;x0.vArray=Fka;x0.vTuple=Uka;x0.vUnion=QTi;x0.vEnum=Qka;x0.vLiteral=qka;x0.vLazy=jka;var _te=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}}},bka=new _te("string");function Ska(){return bka}a(Ska,"vString");var Tka=new _te("number");function Ika(){return Tka}a(Ika,"vNumber");var xka=new _te("boolean");function wka(){return xka}a(wka,"vBoolean");var Rka=new _te("object");function kka(){return Rka}a(kka,"vObjAny");var Pka=new _te("undefined");function Dka(){return Pka}a(Dka,"vUndefined");var jvr=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"}}},FTi=new jvr;function Nka(){return FTi}a(Nka,"vNull");function Mka(t){return QTi(t,FTi)}a(Mka,"vNullable");function UTi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(UTi,"vUnchecked");function Oka(){return UTi()}a(Oka,"vUnknown");function Lka(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(Lka,"vRequired");function Bka(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(Bka,"vObj");function Fka(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(Uka,"vTuple");function QTi(...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(QTi,"vUnion");function Qka(...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(Qka,"vEnum");function qka(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(qka,"vLiteral");function jka(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(jka,"vLazy")});var qTi=I(m5e=>{"use strict";p();Object.defineProperty(m5e,"__esModule",{value:!0});m5e.DocumentSwitchTriggerStrategy=void 0;var Hka=NG(),q0t;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(q0t||(m5e.DocumentSwitchTriggerStrategy=q0t={}));(function(t){t.VALIDATOR=(0,Hka.vEnum)(t.Always,t.AfterAcceptance)})(q0t||(m5e.DocumentSwitchTriggerStrategy=q0t={}))});var Hvr=I(g5e=>{"use strict";p();Object.defineProperty(g5e,"__esModule",{value:!0});g5e.DiffHistoryMergeStrategy=void 0;var Gka=NG(),j0t;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(j0t||(g5e.DiffHistoryMergeStrategy=j0t={}));(function(t){t.VALIDATOR=(0,Gka.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(j0t||(g5e.DiffHistoryMergeStrategy=j0t={}))});var G0t=I(A5e=>{"use strict";p();Object.defineProperty(A5e,"__esModule",{value:!0});A5e.ImportChanges=void 0;var $ka=NG(),H0t;(function(t){t.All="all",t.None="none"})(H0t||(A5e.ImportChanges=H0t={}));(function(t){t.VALIDATOR=(0,$ka.vEnum)(t.All,t.None)})(H0t||(A5e.ImportChanges=H0t={}))});var hy=I(mn=>{"use strict";p();Object.defineProperty(mn,"__esModule",{value:!0});mn.PatchModelPrediction=mn.SpeculativeRequestsAutoExpandEditWindowLines=mn.SpeculativeRequestsCursorPlacement=mn.DuplicateAdditionsMode=mn.SpeculativeRequestsEnablement=mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=mn.MODEL_CONFIGURATION_VALIDATOR=mn.LINT_OPTIONS_VALIDATOR=mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=mn.DEFAULT_OPTIONS=mn.ResponseFormat=mn.PromptingStrategy=mn.EditIntent=mn.EarlyDivergenceCancellationMode=mn.AggressivenessLevel=mn.AggressivenessSetting=mn.LintOptionShowCode=mn.LintOptionWarning=mn.CurrentFileOptions=mn.GlobalBudgetOptions=mn.NeighborFilesOptions=mn.RecentlyViewedDocumentsOptions=mn.RecentFileClippingStrategy=mn.IncludeLineNumbersOption=void 0;mn.isPromptingStrategy=Vka;mn.isAggressivenessStrategy=Wka;mn.applyStrategyConfig=Yka;mn.parseLintOptionString=Kka;mn.parseUserHappinessScoreConfigurationString=Jka;var $Ti=nd(),pn=NG(),Gvr=G0t(),zb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(zb||(mn.IncludeLineNumbersOption=zb={}));var vte;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(vte||(mn.RecentFileClippingStrategy=vte={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.AroundEditRange,t.Proportional)})(vte||(mn.RecentFileClippingStrategy=vte={}));var $vr;(function(t){t.VALIDATOR=(0,pn.vObj)({nDocuments:(0,pn.vNumber)(),maxTokens:(0,pn.vNumber)(),includeViewedFiles:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),clippingStrategy:(0,pn.vEnum)(vte.AroundEditRange,vte.Proportional),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})($vr||(mn.RecentlyViewedDocumentsOptions=$vr={}));var jTi;(function(t){t.VALIDATOR=(0,pn.vObj)({enabled:(0,pn.vBoolean)(),maxTokens:(0,pn.vNumber)()})})(jTi||(mn.NeighborFilesOptions=jTi={}));var HTi;(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})(HTi||(mn.GlobalBudgetOptions=HTi={}));var Vvr;(function(t){t.VALIDATOR=(0,pn.vObj)({maxTokens:(0,pn.vNumber)(),includeTags:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),includeCursorTag:(0,pn.vBoolean)(),prioritizeAboveCursor:(0,pn.vBoolean)(),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(Vvr||(mn.CurrentFileOptions=Vvr={}));var kge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(kge||(mn.LintOptionWarning=kge={}));var Pge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(Pge||(mn.LintOptionShowCode=Pge={}));var $0t;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})($0t||(mn.AggressivenessSetting=$0t={}));var MG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(MG||(mn.AggressivenessLevel=MG={}));var V0t;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(V0t||(mn.EarlyDivergenceCancellationMode=V0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(V0t||(mn.EarlyDivergenceCancellationMode=V0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return MG.Low;case t.Medium:return MG.Medium;case t.High:return MG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})($0t||(mn.AggressivenessSetting=$0t={}));var W0t;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(W0t||(mn.EditIntent=W0t={}));(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===MG.Medium||s===MG.High;case t.Low:return s===MG.High;default:(0,$Ti.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(W0t||(mn.EditIntent=W0t={}));var Pl;(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"})(Pl||(mn.PromptingStrategy=Pl={}));function Vka(t){return Object.values(Pl).includes(t)}a(Vka,"isPromptingStrategy");function Wka(t){return t===Pl.XtabAggressiveness||t===Pl.Xtab275Aggressiveness||t===Pl.Xtab275AggressivenessHighLow||t===Pl.Xtab275EditIntent||t===Pl.Xtab275EditIntentShort}a(Wka,"isAggressivenessStrategy");var z0t;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(z0t||(mn.ResponseFormat=z0t={}));(function(t){function e(r){switch(r){case Pl.UnifiedModel:case Pl.Codexv21NesUnified:case Pl.Nes41Miniv3:return t.UnifiedWithXml;case Pl.Xtab275:case Pl.XtabAggressiveness:case Pl.Xtab275Aggressiveness:case Pl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case Pl.PatchBased:case Pl.PatchBased01:case Pl.PatchBased02:case Pl.PatchBased02WithRecentLineNumbers:case Pl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case Pl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case Pl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case Pl.SimplifiedSystemPrompt:case Pl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,$Ti.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(z0t||(mn.ResponseFormat=z0t={}));mn.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:zb.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:zb.None,clippingStrategy:vte.AroundEditRange,useLeftoverBudgetFromAbove:!1},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};mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:Pge.YES_WITH_SURROUNDING,tagName:"linter",warnings:kge.YES_IF_NO_ERRORS,nRecentFiles:0};mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var zka={[Pl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[Pl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:Gvr.ImportChanges.All},[Pl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.None},supportsNextCursorLinePrediction:!1,allowImportChanges:Gvr.ImportChanges.All}};function Yka(t){let e=t.promptingStrategy===void 0?void 0:zka[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(Yka,"applyStrategyConfig");mn.LINT_OPTIONS_VALIDATOR=(0,pn.vObj)({tagName:(0,pn.vString)(),warnings:(0,pn.vEnum)(kge.YES,kge.NO,kge.YES_IF_NO_ERRORS),showCode:(0,pn.vEnum)(Pge.NO,Pge.YES,Pge.YES_WITH_SURROUNDING),maxLints:(0,pn.vNumber)(),maxLineDistance:(0,pn.vNumber)(),nRecentFiles:(0,pn.vNumber)()});mn.MODEL_CONFIGURATION_VALIDATOR=(0,pn.vObj)({modelName:(0,pn.vRequired)((0,pn.vString)()),promptingStrategy:(0,pn.vUnion)((0,pn.vEnum)(...Object.values(Pl)),(0,pn.vUndefined)()),includeTagsInCurrentFile:(0,pn.vRequired)((0,pn.vBoolean)()),includePostScript:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),currentFile:(0,pn.vUnion)(Vvr.VALIDATOR,(0,pn.vUndefined)()),recentlyViewedDocuments:(0,pn.vUnion)($vr.VALIDATOR,(0,pn.vUndefined)()),lintOptions:(0,pn.vUnion)(mn.LINT_OPTIONS_VALIDATOR,(0,pn.vUndefined)()),supportsNextCursorLinePrediction:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),allowImportChanges:(0,pn.vUnion)(Gvr.ImportChanges.VALIDATOR,(0,pn.vUndefined)())});function Kka(t,e){try{let r=JSON.parse(t),n=mn.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(Kka,"parseLintOptionString");mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var GTi=(0,pn.vObj)({acceptedScore:(0,pn.vRequired)((0,pn.vNumber)()),rejectedScore:(0,pn.vRequired)((0,pn.vNumber)()),ignoredScore:(0,pn.vRequired)((0,pn.vNumber)()),highThreshold:(0,pn.vRequired)((0,pn.vNumber)()),mediumThreshold:(0,pn.vRequired)((0,pn.vNumber)()),includeIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),ignoredLimit:(0,pn.vRequired)((0,pn.vNumber)()),limitConsecutiveIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),limitTotalIgnored:(0,pn.vRequired)((0,pn.vBoolean)())});function y5e(t,e,r){return t>=e&&t<=r}a(y5e,"isInRange");mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=GTi.validate(t);if(e.error)return e;let r=e.content;return y5e(r.acceptedScore,0,1)?y5e(r.rejectedScore,0,1)?y5e(r.ignoredScore,0,1)?y5e(r.highThreshold,0,1)?y5e(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(Dge,"__esModule",{value:!0});Dge.TextReplacement=Dge.TextEdit=void 0;var VTi=Tl(),WTi=nd(),rgt=Rs(),egt=rm(),OG=j_(),Cm=rh(),ngt=xme(),zTi=HT(),igt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>xv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new xv(e,r)])}static delete(e){return new t([new xv(e,"")])}static insert(e,r){return new t([new xv(Cm.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,VTi.compareBy)(n=>n.range,Cm.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,WTi.assertFn)(()=>(0,WTi.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 xv(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=ngt.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new OG.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return tgt(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 OG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof OG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof OG.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return tgt(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 OG.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=tgt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=tgt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new zTi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new xv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=ngt.TextLength.ofText(s.text),l=OG.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 rgt.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 zTi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Cm.Range.fromPositions(new OG.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=Cm.Range.fromPositions(r.range.getEndPosition(),new OG.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(` +`)}};Dge.TextEdit=igt;var xv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new rgt.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}"`}};kge.TextReplacement=Tv;function J0t(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return _m.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Z0t.BugIndicatingError("start must be before end");return new _m.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(J0t,"rangeFromPositions")});var NG=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.SerializedLineReplacement=DG.LineReplacement=DG.LineEdit=void 0;var Hvr=Sl(),qTi=rd(),Lka=em(),m5e=$2(),HTi=kE(),Pge=q_(),Dge=eh(),Nge=h5e(),tgt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vte.deserialize(r)))}static fromStringEdit(e,r){let n=Nge.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,Hvr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,qTi.assert)((0,qTi.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 HTi.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(m5e.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 m5e.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 vte(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,Hvr.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 vte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};DG.LineEdit=tgt;var vte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(m5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,Lka.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Dge.Range.fromPositions(new Pge.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(Dge.Range.fromPositions(e.range.getEndPosition(),new Pge.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 Pge.Position(s,c)}else n=new Pge.Position(1,1);let o=r.addToPosition(new Pge.Position(1,1));return new Nge.TextReplacement(Dge.Range.fromPositions(n,o),"")}else return new Nge.TextReplacement(new Dge.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,egt.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,egt.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}"`}};Dge.TextReplacement=xv;function tgt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Cm.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new rgt.BugIndicatingError("start must be before end");return new Cm.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(tgt,"rangeFromPositions")});var BG=I(LG=>{"use strict";p();Object.defineProperty(LG,"__esModule",{value:!0});LG.SerializedLineReplacement=LG.LineReplacement=LG.LineEdit=void 0;var Wvr=Tl(),YTi=nd(),Zka=rm(),_5e=z2(),JTi=PE(),Nge=j_(),Mge=rh(),Oge=E5e(),ogt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>Cte.deserialize(r)))}static fromStringEdit(e,r){let n=Oge.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,Wvr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,YTi.assert)((0,YTi.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 JTi.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(_5e.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 _5e.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 Cte(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,Wvr.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 Cte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};LG.LineEdit=ogt;var Cte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(_5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,Zka.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Mge.Range.fromPositions(new Nge.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(Mge.Range.fromPositions(e.range.getEndPosition(),new Nge.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 Nge.Position(s,c)}else n=new Nge.Position(1,1);let o=r.addToPosition(new Nge.Position(1,1));return new Oge.TextReplacement(Mge.Range.fromPositions(n,o),"")}else return new Oge.TextReplacement(new Mge.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 Nge.TextReplacement(Dge.Range.fromPositions(new Pge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Dge.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new Nge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new HTi.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})(jTi||(DG.SerializedLineReplacement=jTi={}))});var ogt=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.ArrayMap=Mge.ResponseProcessor=void 0;var Bka=Rs(),rgt=NG(),ngt=$2(),GTi;(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 igt;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 ngt.LineRange(A.startLineIdx+1,l.length+1);yield new rgt.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),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new ngt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new rgt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(GTi||(Mge.ResponseProcessor=GTi={}));var igt=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)||[]}};Mge.ArrayMap=igt});var VTi=I(sgt=>{"use strict";p();Object.defineProperty(sgt,"__esModule",{value:!0});sgt.AlternativeNotebookFormat=void 0;var $Ti;(function(t){t.json="json",t.xml="xml",t.text="text"})($Ti||(sgt.AlternativeNotebookFormat=$Ti={}))});var Pl=I(Ho=>{"use strict";p();var Fka=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]})),Uka=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A5e=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):WTi.isObject(r)&&WTi.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,Hka.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=$vr;var agt;function Vka(){if(!agt){agt=new Map;let e=Gka.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)agt.set(n,r[n].default)}return agt}a(Vka,"getPackageJsonDefaults");function ZTi(t,e,r){let n=`${Ho.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Ho.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=Vka(),c=s.has(n),l=s.get(n);if(c&&!jka.equals(e,l))throw new Gvr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new Gvr.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(ZTi,"toBaseConfig");var Vvr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Ho.globalConfigRegistry=new Vvr;var Wvr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new XTi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Ho.ConfigurationMigrationRegistry=new Wvr;function lt(t,e,r,n,o,s){if(e===1){let l={...ZTi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new Gvr.BugIndicatingError("Shared settings cannot be experiment based");return Ho.globalConfigRegistry.registerConfig(l),l}let c={...ZTi(t,r,o),configType:0,validator:n};return Ho.globalConfigRegistry.registerConfig(c),c}a(lt,"defineSetting");function Pt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?lt(t,e,r,n,o):lt(t,e,r,n,o,s)}a(Pt,"defineTeamInternalSetting");function Jvr(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(Jvr,"migrateSetting");function Vg(t,e,r,n){return Jvr(e,t),lt(e,0,r,void 0,{...n,oldKey:t})}a(Vg,"defineAndMigrateSetting");function w0(t,e,r,n,o){return Jvr(e,t),lt(e,1,r,void 0,{...n,oldKey:t},o)}a(w0,"defineAndMigrateExpSetting");Ho.HARD_TOOL_LIMIT=128;var zvr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(zvr||(Ho.AuthProviderId=zvr={}));var Yvr;(function(t){t.Default="default",t.Minimal="minimal"})(Yvr||(Ho.AuthPermissionMode=Yvr={}));var g5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(g5e||(Ho.AzureAuthMode=g5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(g5e||(Ho.AzureAuthMode=g5e={}));Ho.XTabProviderId="XtabProvider";var Kvr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=lt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideAuthType=lt("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=lt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=lt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=lt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=lt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=lt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=lt("advanced.authProvider",0,zvr.GitHub),s.AuthPermissions=lt("advanced.authPermissions",0,Yvr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=lt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=lt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Vg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Vg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Vg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Vg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Vg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Vg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Vg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Vg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Vg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Vg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Vg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Vg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Vg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Vg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Vg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=lt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=lt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=lt("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=lt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=lt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=lt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=lt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=lt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Vg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=lt("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=lt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=lt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=lt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=lt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=lt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=lt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=lt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=lt("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=lt("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=Vg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=w0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=w0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=w0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=w0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=w0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=lt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=w0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=w0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",$ka.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=w0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=lt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=lt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=w0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=w0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=w0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=w0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=w0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=lt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=lt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=lt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=lt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=lt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=lt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=lt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=lt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=lt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=lt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=lt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=lt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=w0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=w0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=w0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=lt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=lt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=lt("nextEditSuggestions.eagerness",1,$c.AggressivenessSetting.Default,$c.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=w0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=lt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=lt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=lt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=lt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=lt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=lt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=lt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=lt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=w0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=w0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Vg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=lt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=lt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=lt("chat.otel.enabled",0,!1),s.OTelExporterType=lt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=lt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=lt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=lt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=lt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=lt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=lt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=lt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=lt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=lt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=lt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=lt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Jvr(l,c),lt(l,0,null,$c.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Pt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Pt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Pt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Pt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,x0.vBoolean)()),s.InlineEditsModelPickerEnabled=Pt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,x0.vBoolean)()),s.InlineEditsUseSlashModels=Pt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Pt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Pt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,x0.vBoolean)()),s.InlineEditsLogCancelledRequests=Pt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Pt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionApiKey=Pt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderUrl=Pt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderApiKey=Pt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,$c.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Pt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,x0.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Pt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,x0.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Pt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,x0.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Pt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Pt("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,$c.PatchModelPrediction.FilePath,$c.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Pt("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,lD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Pt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Pt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Pt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Pt("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Pt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Pt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Pt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Pt("chat.advanced.modelProviderPreference",0,void 0,(0,x0.vString)()),s.UseVSCodeTelemetryLibForGH=Pt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Pt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Pt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Pt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Pt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Pt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Pt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Pt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Pt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Pt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Pt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Pt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Pt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Pt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Pt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Pt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Pt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Pt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Pt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,x0.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Pt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Pt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Pt("chat.advanced.inlineEdits.speculativeRequests",1,lD.SpeculativeRequestsEnablement.Off,lD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Pt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,lD.SpeculativeRequestsCursorPlacement.AfterEditApplied,lD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,lD.SpeculativeRequestsAutoExpandEditWindowLines.Off,lD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Pt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Pt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Pt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,YTi.DocumentSwitchTriggerStrategy.AfterAcceptance,YTi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Pt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Pt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Pt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Pt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Pt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Pt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Pt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,$c.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Pt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,$c.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,$c.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,KTi.DiffHistoryMergeStrategy.SameStartLine,KTi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,x0.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,x0.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Pt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Pt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,$c.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Pt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,$c.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,$c.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,$c.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Pt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,$c.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Pt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,$c.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,JTi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,JTi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Pt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,lD.EarlyDivergenceCancellationMode.Off,lD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,$c.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,$c.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,$c.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,$c.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,$c.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Pt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,lD.DuplicateAdditionsMode.Off,lD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Pt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Pt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Pt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Pt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Pt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Pt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,zTi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,zTi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Pt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Pt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Pt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Pt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Pt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Pt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Pt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Pt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=lt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=lt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=lt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=lt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=lt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Pt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Pt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Pt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Pt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Pt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=lt("chat.planAgent.model",0,""),s.OllamaEndpoint=lt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=lt("chat.azureModels",0,{}),s.CustomOAIModels=lt("chat.customOAIModels",0,{}),s.AzureAuthType=lt("chat.azureAuthType",0,g5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=lt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=lt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=lt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,x0.vBoolean)()),t.ConversationUsePrismCompaction=lt("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=lt("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=lt("chat.conversationCompaction.prismModelFilter",1,"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash"),t.UseAnthropicMessagesApi=lt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=lt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=lt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=lt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=lt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPersistentCoTEnabled=lt("chat.responsesApi.persistentCoT.enabled",1,!1),t.Updated53CodexPromptEnabled=lt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=lt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=lt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=lt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGemini3LowReasoningEffort=lt("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=lt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=lt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=lt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=lt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=lt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=lt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=lt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=lt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=lt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=lt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=lt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=lt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=lt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=lt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=lt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=lt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=lt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=lt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=lt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=lt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=lt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=lt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=lt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=lt("chat.scopeSelection",0,!1),t.EnableCodeActions=lt("editor.enableCodeActions",0,!0),t.LocaleOverride=lt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=lt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=lt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=lt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=lt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=lt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=lt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=lt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=lt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=lt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=lt("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=lt("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=lt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=lt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=lt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=lt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=lt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=lt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=lt("chat.virtualTools.threshold",1,Ho.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=lt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=lt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=lt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=lt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=lt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=lt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=lt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=lt("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=lt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=lt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=lt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=lt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=lt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=lt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=lt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=lt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=lt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=lt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=lt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=lt("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=lt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=lt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=lt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=lt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=lt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=lt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=lt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=lt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=lt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=lt("chat.localIndex.enabled",1,!1),t.GrepSearchOutputFormat=lt("chat.tools.grepSearch.outputFormat",1,"tag")})(Kvr||(Ho.ConfigKey=Kvr={}));function Wka(){return Object.values(Kvr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(Wka,"getAllConfigKeys");var zka=[];function Yka(t){return zka.push(t),t}a(Yka,"registerNextEditProviderId")});var Sp=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.LogMemory=hy.LogServiceImpl=hy.ConsoleLog=hy.LogTarget=hy.LogLevel=hy.ILogService=void 0;hy.collectErrorMessages=tIi;hy.collectSingleLineErrorMessage=Zka;hy.sanitizeNetworkErrorForTelemetry=Xka;var Kka=nn(),Jka=Ro();hy.ILogService=(0,Kka.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||(hy.LogLevel=BE={}));var eIi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(eIi||(hy.LogTarget=eIi={}));var Zvr=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)}};hy.ConsoleLog=Zvr;var Xvr=class extends Jka.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new eCr(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)}};hy.LogServiceImpl=Xvr;var eCr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){lgt.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,tIi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new tCr(this,e)}withExtraTarget(e){return new cgt(this,[e])}},tCr=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 cgt(this,[e],this._prefix)}},cgt=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 tIi(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 Oge.TextReplacement(Mge.Range.fromPositions(new Nge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Mge.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new Oge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new JTi.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})(KTi||(LG.SerializedLineReplacement=KTi={}))});var lgt=I(Lge=>{"use strict";p();Object.defineProperty(Lge,"__esModule",{value:!0});Lge.ArrayMap=Lge.ResponseProcessor=void 0;var Xka=Rs(),sgt=BG(),agt=z2(),ZTi;(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 cgt;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 agt.LineRange(A.startLineIdx+1,l.length+1);yield new sgt.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),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new agt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new sgt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(ZTi||(Lge.ResponseProcessor=ZTi={}));var cgt=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)||[]}};Lge.ArrayMap=cgt});var eIi=I(ugt=>{"use strict";p();Object.defineProperty(ugt,"__esModule",{value:!0});ugt.AlternativeNotebookFormat=void 0;var XTi;(function(t){t.json="json",t.xml="xml",t.text="text"})(XTi||(ugt.AlternativeNotebookFormat=XTi={}))});var Dl=I(Go=>{"use strict";p();var ePa=Go&&Go.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tPa=Go&&Go.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C5e=Go&&Go.__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):tIi.isObject(r)&&tIi.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 Go.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,oPa.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){}};Go.AbstractConfigurationService=Yvr;var dgt;function cPa(){if(!dgt){dgt=new Map;let e=sPa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)dgt.set(n,r[n].default)}return dgt}a(cPa,"getPackageJsonDefaults");function sIi(t,e,r){let n=`${Go.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Go.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=cPa(),c=s.has(n),l=s.get(n);if(c&&!iPa.equals(e,l))throw new zvr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new zvr.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(sIi,"toBaseConfig");var Kvr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Go.globalConfigRegistry=new Kvr;var Jvr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new aIi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Go.ConfigurationMigrationRegistry=new Jvr;function lt(t,e,r,n,o,s){if(e===1){let l={...sIi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new zvr.BugIndicatingError("Shared settings cannot be experiment based");return Go.globalConfigRegistry.registerConfig(l),l}let c={...sIi(t,r,o),configType:0,validator:n};return Go.globalConfigRegistry.registerConfig(c),c}a(lt,"defineSetting");function Pt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?lt(t,e,r,n,o):lt(t,e,r,n,o,s)}a(Pt,"defineTeamInternalSetting");function tCr(t,e){Go.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Go.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Go.CopilotConfigPrefix}.${t}`,{value:r}],[`${Go.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(tCr,"migrateSetting");function Wg(t,e,r,n){return tCr(e,t),lt(e,0,r,void 0,{...n,oldKey:t})}a(Wg,"defineAndMigrateSetting");function R0(t,e,r,n,o){return tCr(e,t),lt(e,1,r,void 0,{...n,oldKey:t},o)}a(R0,"defineAndMigrateExpSetting");Go.HARD_TOOL_LIMIT=128;var Zvr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(Zvr||(Go.AuthProviderId=Zvr={}));var Xvr;(function(t){t.Default="default",t.Minimal="minimal"})(Xvr||(Go.AuthPermissionMode=Xvr={}));var v5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(v5e||(Go.AzureAuthMode=v5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(v5e||(Go.AzureAuthMode=v5e={}));Go.XTabProviderId="XtabProvider";var eCr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=lt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideAuthType=lt("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=lt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=lt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=lt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=lt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=lt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=lt("advanced.authProvider",0,Zvr.GitHub),s.AuthPermissions=lt("advanced.authPermissions",0,Xvr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=lt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=lt("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=lt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=lt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=lt("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=lt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=lt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=lt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=lt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=lt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Wg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=lt("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=lt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=lt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=lt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=lt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=lt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=lt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=lt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=lt("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=lt("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=Wg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=R0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=R0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=R0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=R0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=R0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=lt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=R0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=R0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",aPa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=R0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=lt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=lt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=R0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=R0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=R0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=R0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=R0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=lt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=lt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=lt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=lt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=lt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=lt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=lt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=lt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=lt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=lt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=lt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=lt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=R0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=R0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=R0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=lt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=lt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=lt("nextEditSuggestions.eagerness",1,$c.AggressivenessSetting.Default,$c.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=R0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=lt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=lt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=lt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=lt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=lt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=lt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=lt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=lt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=R0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=R0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Wg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=lt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=lt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=lt("chat.otel.enabled",0,!1),s.OTelExporterType=lt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=lt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=lt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=lt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=lt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=lt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=lt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=lt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=lt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=lt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=lt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=lt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return tCr(l,c),lt(l,0,null,$c.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Pt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Pt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Pt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Pt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,w0.vBoolean)()),s.InlineEditsModelPickerEnabled=Pt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,w0.vBoolean)()),s.InlineEditsUseSlashModels=Pt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Pt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Pt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,w0.vBoolean)()),s.InlineEditsLogCancelledRequests=Pt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,w0.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Pt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,w0.vString)()),s.InlineEditsNextCursorPredictionApiKey=Pt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,w0.vString)()),s.InlineEditsXtabProviderUrl=Pt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,w0.vString)()),s.InlineEditsXtabProviderApiKey=Pt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,w0.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,$c.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Pt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,w0.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Pt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,w0.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Pt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,w0.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Pt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,w0.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Pt("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,$c.PatchModelPrediction.FilePath,$c.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Pt("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,w0.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,fD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Pt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Pt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Pt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Pt("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Pt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Pt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Pt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Pt("chat.advanced.modelProviderPreference",0,void 0,(0,w0.vString)()),s.UseVSCodeTelemetryLibForGH=Pt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Pt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Pt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Pt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Pt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Pt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Pt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Pt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Pt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Pt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Pt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Pt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Pt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Pt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Pt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Pt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Pt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Pt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Pt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,w0.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Pt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Pt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Pt("chat.advanced.inlineEdits.speculativeRequests",1,fD.SpeculativeRequestsEnablement.Off,fD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Pt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,fD.SpeculativeRequestsCursorPlacement.AfterEditApplied,fD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,fD.SpeculativeRequestsAutoExpandEditWindowLines.Off,fD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Pt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Pt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Pt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,nIi.DocumentSwitchTriggerStrategy.AfterAcceptance,nIi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Pt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Pt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Pt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Pt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,w0.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Pt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Pt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Pt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,$c.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Pt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,$c.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,$c.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,iIi.DiffHistoryMergeStrategy.SameStartLine,iIi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,w0.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,w0.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Pt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Pt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,$c.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Pt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,$c.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,$c.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,$c.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Pt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,$c.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Pt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,$c.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,oIi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,oIi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Pt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,fD.EarlyDivergenceCancellationMode.Off,fD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,$c.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,$c.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,$c.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,$c.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,$c.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Pt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,fD.DuplicateAdditionsMode.Off,fD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Pt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Pt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Pt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Pt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Pt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Pt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,rIi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,rIi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Pt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Pt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Pt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Pt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Pt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Pt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Pt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Pt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=lt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=lt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=lt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=lt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=lt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Pt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Pt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Pt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Pt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Pt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=lt("chat.planAgent.model",0,""),s.OllamaEndpoint=lt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=lt("chat.azureModels",0,{}),s.CustomOAIModels=lt("chat.customOAIModels",0,{}),s.AzureAuthType=lt("chat.azureAuthType",0,v5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=lt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=lt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=lt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,w0.vBoolean)()),t.ConversationUsePrismCompaction=lt("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=lt("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=lt("chat.conversationCompaction.prismModelFilter",1,"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash"),t.UseAnthropicMessagesApi=lt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=lt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=lt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=lt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=lt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPersistentCoTEnabled=lt("chat.responsesApi.persistentCoT.enabled",1,!1),t.Updated53CodexPromptEnabled=lt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=lt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=lt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=lt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGemini3LowReasoningEffort=lt("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=lt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=lt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=lt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=lt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=lt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=lt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=lt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=lt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=lt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=lt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=lt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=lt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=lt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=lt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=lt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=lt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=lt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=lt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=lt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=lt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=lt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=lt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=lt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=lt("chat.scopeSelection",0,!1),t.EnableCodeActions=lt("editor.enableCodeActions",0,!0),t.LocaleOverride=lt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=lt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=lt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=lt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=lt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=lt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=lt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=lt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=lt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=lt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=lt("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=lt("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=lt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=lt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=lt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=lt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=lt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=lt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=lt("chat.virtualTools.threshold",1,Go.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=lt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=lt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=lt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=lt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=lt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=lt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=lt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=lt("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=lt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=lt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=lt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=lt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=lt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=lt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=lt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=lt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=lt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=lt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=lt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=lt("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=lt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=lt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=lt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=lt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=lt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=lt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=lt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=lt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=lt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=lt("chat.localIndex.enabled",1,!1),t.GrepSearchOutputFormat=lt("chat.tools.grepSearch.outputFormat",1,"tag")})(eCr||(Go.ConfigKey=eCr={}));function lPa(){return Object.values(eCr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(lPa,"getAllConfigKeys");var uPa=[];function dPa(t){return uPa.push(t),t}a(dPa,"registerNextEditProviderId")});var Ip=I(my=>{"use strict";p();Object.defineProperty(my,"__esModule",{value:!0});my.LogMemory=my.LogServiceImpl=my.ConsoleLog=my.LogTarget=my.LogLevel=my.ILogService=void 0;my.collectErrorMessages=lIi;my.collectSingleLineErrorMessage=hPa;my.sanitizeNetworkErrorForTelemetry=mPa;var fPa=nn(),pPa=ko();my.ILogService=(0,fPa.createServiceIdentifier)("ILogService");var FE;(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"})(FE||(my.LogLevel=FE={}));var cIi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(cIi||(my.LogTarget=cIi={}));var rCr=class{static{a(this,"ConsoleLog")}constructor(e,r=FE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===FE.Error?console.error(r,...n):e===FE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};my.ConsoleLog=rCr;var nCr=class extends pPa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new iCr(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)}};my.LogServiceImpl=nCr;var iCr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){pgt.addLog(FE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(FE.Trace,e)}debug(e){this._logIt(FE.Debug,e)}info(e){this._logIt(FE.Info,e)}warn(e){this._logIt(FE.Warning,e)}error(e,r){this._logIt(FE.Error,lIi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new oCr(this,e)}withExtraTarget(e){return new fgt(this,[e])}},oCr=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 fgt(this,[e],this._prefix)}},fgt=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(FE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(FE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(FE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(FE.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(FE.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 lIi(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(rIi(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(tIi,"collectErrorMessages");function Zka(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(rIi(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(Zka,"collectSingleLineErrorMessage");function Xka(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(Xka,"sanitizeNetworkErrorForTelemetry");function rIi(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(rIi,"extractChromiumDetails");var lgt=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}};hy.LogMemory=lgt});var E5e=I(y5e=>{"use strict";p();Object.defineProperty(y5e,"__esModule",{value:!0});y5e.ICopilotTokenManager=void 0;y5e.nowSeconds=tPa;var ePa=nn();y5e.ICopilotTokenManager=(0,ePa.createServiceIdentifier)("ICopilotTokenManager");function tPa(){return Math.floor(Date.now()/1e3)}a(tPa,"nowSeconds")});var FE=I(vm=>{"use strict";p();var rPa=vm&&vm.__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},ugt=vm&&vm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vm,"__esModule",{value:!0});vm.BaseAuthenticationService=vm.IAuthenticationService=vm.MinimalModeError=vm.GITHUB_SCOPE_ALIGNED=vm.GITHUB_SCOPE_READ_USER=vm.GITHUB_SCOPE_USER_EMAIL=void 0;vm.authProviderId=lPa;var nPa=nn(),dgt=Ic(),iPa=Ro(),oPa=C8(),Cte=Pl(),sPa=Sp(),aPa=E5e(),cPa=XH();vm.GITHUB_SCOPE_USER_EMAIL=["user:email"];vm.GITHUB_SCOPE_READ_USER=["read:user"];vm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var rCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};vm.MinimalModeError=rCr;vm.IAuthenticationService=(0,nPa.createServiceIdentifier)("IAuthenticationService");var nCr=class extends iPa.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()}fireCopilotTokenChange(e){this._logService.debug(`AuthenticationService: firing onDidCopilotTokenChange from ${e}.`),this._onDidCopilotTokenChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new dgt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new dgt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new dgt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new dgt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,oPa.derived)(s=>this._configurationService.getConfigObservable(Cte.ConfigKey.Shared.AuthPermissions).read(s)===Cte.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=this._tokenStore.copilotToken,n=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=n,this._copilotTokenError=void 0,r?.token!==n.token&&this.fireCopilotTokenChange("getCopilotToken"),n}catch(r){let n=this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0;let o=this._copilotTokenError;throw this._copilotTokenError=r,n?this.fireCopilotTokenChange("getCopilotToken token lost"):o&&r&&o.message!==r.message&&this.fireCopilotTokenChange("getCopilotToken error change"),r}}resetCopilotToken(e){let r=!!this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e),r&&this.fireCopilotTokenChange("resetCopilotToken")}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let s of o)s.status==="rejected"&&this._logService.error(`Error getting a session: ${s.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed (identity change), minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken."),this.fireAuthenticationChange("handleAuthChangeEvent identity change");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{}this._logService.debug("Finished handling auth change event.")}};vm.BaseAuthenticationService=nCr;vm.BaseAuthenticationService=nCr=rPa([ugt(0,sPa.ILogService),ugt(1,cPa.ICopilotTokenStore),ugt(2,aPa.ICopilotTokenManager),ugt(3,Cte.IConfigurationService)],nCr);function lPa(t){return t.getConfig(Cte.ConfigKey.Shared.AuthProvider)===Cte.AuthProviderId.GitHubEnterprise?Cte.AuthProviderId.GitHubEnterprise:Cte.AuthProviderId.GitHub}a(lPa,"authProviderId")});var fgt=I(iCr=>{"use strict";p();Object.defineProperty(iCr,"__esModule",{value:!0});iCr.onCopilotToken=uPa;function uPa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(uPa,"onCopilotToken")});var sCr=I(uD=>{"use strict";p();var dPa=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},fPa=uD&&uD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uD,"__esModule",{value:!0});uD.TelemetryUserConfig=uD.ICompletionsTelemetryUserConfigService=void 0;var pPa=FE(),hPa=nn(),mPa=Ro(),gPa=fgt();function APa(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(APa,"propertiesFromCopilotToken");uD.ICompletionsTelemetryUserConfigService=(0,hPa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var oCr=class extends mPa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,gPa.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=APa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};uD.TelemetryUserConfig=oCr;uD.TelemetryUserConfig=oCr=dPa([fPa(0,pPa.IAuthenticationService)],oCr)});var _5e=I(Oge=>{"use strict";p();Object.defineProperty(Oge,"__esModule",{value:!0});Oge.PromiseQueue=Oge.ICompletionsPromiseQueueService=void 0;var yPa=nn();Oge.ICompletionsPromiseQueueService=(0,yPa.createServiceIdentifier)("completionsPromiseQueueService");var aCr=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)}};Oge.PromiseQueue=aCr});var $g=I(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.TelemetryReporters=yd.ICompletionsTelemetryReporters=yd.CopilotTelemetryReporter=yd.TelemetryWithExp=yd.TelemetryData=yd.TelemetryStore=void 0;yd.telemetrizePromptLength=kPa;yd.now=Bge;yd.telemetry=gCr;yd.telemetryExpProblem=NPa;yd.telemetryRaw=OPa;yd.telemetryException=oIi;yd.telemetryCatch=LPa;yd.telemetryError=BPa;yd.logEngineCompletion=UPa;yd.logEnginePrompt=QPa;var EPa=U4(),_Pa=nn(),vPa=T0(),dCr=Gs(),pgt=bte(),Q4=LE(),CPa=M0t(),bPa=fy(),SPa=L0t(),TPa=Ovr(),fCr=sCr(),pCr=_5e(),KT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(KT||(yd.TelemetryStore=KT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(KT||(yd.TelemetryStore=KT={}));function Lge(t){return t===KT.Enhanced}a(Lge,"isEnhanced");var IPa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],v5e=8192,xPa=21,q4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[TPa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Bge())}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=Bge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(bPa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(EPa.IEnvService),n=e.get(Q4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,Q4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,Q4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${Q4.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,Q4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,Q4.dumpForTelemetry)(e);r["copilot.build"]=Q4.BuildInfo.getBuild(),r["copilot.buildType"]=Q4.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(Lge(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>v5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+v5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(kPa,"telemetrizePromptLength");function Bge(){return performance.now()}a(Bge,"now");function PPa(t){return Math.floor(t/1e3)}a(PPa,"nowSeconds");function mCr(t){return t.get(fCr.ICompletionsTelemetryUserConfigService).optedIn}a(mCr,"shouldSendEnhanced");function nIi(t){return t.get(fCr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(nIi,"shouldSendFinetuningTelemetry");function gCr(t,e,r,n){return t.get(pCr.ICompletionsPromiseQueueService).register(DPa(t,e,Bge(),r?.extendedBy(),n))}a(gCr,"telemetry");async function DPa(t,e,r,n,o=KT.Standard){let s=t.get(pgt.ICompletionsTelemetryService),c=t.get(dCr.IInstantiationService),l=n||q4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Lge(o)||c.invokeFunction(mCr))&&hCr(s,o,e,l),Lge(o)&&IPa.includes(e)&&c.invokeFunction(nIi)&&c.invokeFunction(RPa,o,e,l)}a(DPa,"_telemetry");function NPa(t,e){return t.get(pCr.ICompletionsPromiseQueueService).register(MPa(t,e,Bge()))}a(NPa,"telemetryExpProblem");async function MPa(t,e,r){let n=t.get(pgt.ICompletionsTelemetryService),o="expProblem",s=q4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,KT.Standard,"SkipExp",r),hCr(n,KT.Standard,o,s)}a(MPa,"_telemetryExpProblem");function OPa(t,e,r,n){let o=t.get(pgt.ICompletionsTelemetryService),s={...r,...iIi(t)};hCr(o,KT.Standard,e,{properties:s,measurements:n})}a(OPa,"telemetryRaw");function iIi(t){let e=t.get(Q4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,vPa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,Q4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(fCr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(iIi,"createRequiredProperties");function oIi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(oIi,"telemetryException");function LPa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){oIi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(LPa,"telemetryCatch");function BPa(t,e,r,n){return t.get(pCr.ICompletionsPromiseQueueService).register(FPa(t,e,Bge(),r?.extendedBy(),n))}a(BPa,"telemetryError");async function FPa(t,e,r,n,o=KT.Standard){if(Lge(o)&&!mCr(t))return;let s=t.get(dCr.IInstantiationService),c=n||q4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(wPa,o,e,c)}a(FPa,"_telemetryError");function UPa(t,e,r,n,o){let s=q4.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),gCr(t,"engine.completion",s,KT.Enhanced)}a(UPa,"logEngineCompletion");function QPa(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 gCr(t,"engine.prompt",o,KT.Enhanced)}a(QPa,"logEnginePrompt");var lCr=class{static{a(this,"CopilotTelemetryReporter")}};yd.CopilotTelemetryReporter=lCr;yd.ICompletionsTelemetryReporters=(0,_Pa.createServiceIdentifier)("ICompletionsTelemetryReporters");var uCr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=KT.Standard){return Lge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(mCr(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()))}};yd.TelemetryReporters=uCr});var bte=I(dD=>{"use strict";p();var qPa=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},jPa=dD&&dD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dD,"__esModule",{value:!0});dD.CompletionsTelemetryServiceBridge=dD.ICompletionsTelemetryService=void 0;var HPa=gm(),ACr=Ivr(),GPa=nn(),C5e=$g();dD.ICompletionsTelemetryService=(0,GPa.createServiceIdentifier)("completionsTelemetryService");var yCr=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,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??C5e.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 C5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};dD.CompletionsTelemetryServiceBridge=yCr;dD.CompletionsTelemetryServiceBridge=yCr=qPa([jPa(0,HPa.ITelemetryService)],yCr)});var sIi=I(Fge=>{"use strict";p();Object.defineProperty(Fge,"__esModule",{value:!0});Fge.CopilotExtensionStatus=Fge.ICompletionsExtensionStatus=void 0;var $Pa=nn();Fge.ICompletionsExtensionStatus=(0,$Pa.createServiceIdentifier)("ICompletionsExtensionStatus");var ECr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};Fge.CopilotExtensionStatus=ECr});var hgt=I(fD=>{"use strict";p();Object.defineProperty(fD,"__esModule",{value:!0});fD.CopilotToken=void 0;fD.containsInternalOrg=aIi;fD.containsVSCodeOrg=uIi;fD.validateTokenEnvelope=dIi;fD.isTokenEnvelope=JPa;fD.isErrorEnvelope=ZPa;fD.isStandardErrorEnvelope=XPa;fD.createTestExtendedTokenInfo=e2a;var Qn=RG();function aIi(t){return cIi(t)||lIi(t)}a(aIi,"containsInternalOrg");function cIi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(cIi,"containsGitHubOrg");function lIi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(lIi,"containsMicrosoftOrg");function uIi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(uIi,"containsVSCodeOrg");var _Cr=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 aIi(this.organizationList)}get isMicrosoftInternal(){return lIi(this.organizationList)}get isGitHubInternal(){return cIi(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||uIi(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"}};fD.CopilotToken=_Cr;var VPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),notification_id:(0,Qn.vRequired)((0,Qn.vString)()),title:(0,Qn.vRequired)((0,Qn.vString)()),url:(0,Qn.vRequired)((0,Qn.vString)())}),WPa=(0,Qn.vObj)({can_signup_for_limited:(0,Qn.vNullable)((0,Qn.vBoolean)()),error_details:(0,Qn.vRequired)(VPa),message:(0,Qn.vRequired)((0,Qn.vString)()),reason:(0,Qn.vString)()}),zPa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)()),sku:(0,Qn.vString)(),individual:(0,Qn.vBoolean)(),blackbird_clientside_indexing:(0,Qn.vBoolean)(),code_quote_enabled:(0,Qn.vBoolean)(),code_review_enabled:(0,Qn.vBoolean)(),codesearch:(0,Qn.vBoolean)(),copilotignore_enabled:(0,Qn.vBoolean)(),public_suggestions:(0,Qn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Qn.vEnum)("enabled","disabled"),endpoints:(0,Qn.vObj)({api:(0,Qn.vString)(),"origin-tracker":(0,Qn.vString)(),proxy:(0,Qn.vString)(),telemetry:(0,Qn.vString)()}),enterprise_list:(0,Qn.vNullable)((0,Qn.vArray)((0,Qn.vNumber)())),limited_user_quotas:(0,Qn.vNullable)((0,Qn.vObj)({chat:(0,Qn.vRequired)((0,Qn.vNumber)()),completions:(0,Qn.vRequired)((0,Qn.vNumber)())})),limited_user_reset_date:(0,Qn.vNullable)((0,Qn.vNumber)()),organization_list:(0,Qn.vArray)((0,Qn.vString)())}),YPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),documentation_url:(0,Qn.vRequired)((0,Qn.vString)()),status:(0,Qn.vRequired)((0,Qn.vString)())}),KPa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)())});function dIi(t){let e=zPa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=KPa.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(dIi,"validateTokenEnvelope");function JPa(t){return dIi(t).valid}a(JPa,"isTokenEnvelope");function ZPa(t){return WPa.validate(t).error===void 0}a(ZPa,"isErrorEnvelope");function XPa(t){return YPa.validate(t).error===void 0}a(XPa,"isStandardErrorEnvelope");function e2a(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(e2a,"createTestExtendedTokenInfo")});var Uge=I(JT=>{"use strict";p();var t2a=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},r2a=JT&&JT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(JT,"__esModule",{value:!0});JT.CopilotTokenManagerImpl=JT.ICompletionsCopilotTokenManager=JT.CopilotToken=void 0;var n2a=FE(),i2a=nn(),o2a=nl(),s2a=Ro(),a2a=hgt();Object.defineProperty(JT,"CopilotToken",{enumerable:!0,get:a(function(){return a2a.CopilotToken},"get")});JT.ICompletionsCopilotTokenManager=(0,i2a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var vCr=class extends s2a.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 o2a.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidCopilotTokenChange(()=>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}};JT.CopilotTokenManagerImpl=vCr;JT.CopilotTokenManagerImpl=vCr=t2a([r2a(1,n2a.IAuthenticationService)],vCr)});var mgt=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.NoOpCitationManager=Qge.ICompletionsCitationManager=void 0;var c2a=nn(),l2a=Ro();Qge.ICompletionsCitationManager=(0,c2a.createServiceIdentifier)("ICompletionsCitationManager");var CCr=class{static{a(this,"NoOpCitationManager")}register(){return l2a.Disposable.None}async handleIPCodeCitation(e){}};Qge.NoOpCitationManager=CCr});var Iv=I(Wg=>{"use strict";p();Object.defineProperty(Wg,"__esModule",{value:!0});Wg.HasPropertyKey=u2a;Wg.IsAsyncIterator=d2a;Wg.IsArray=bCr;Wg.IsBigInt=f2a;Wg.IsBoolean=p2a;Wg.IsDate=h2a;Wg.IsFunction=m2a;Wg.IsIterator=g2a;Wg.IsNull=A2a;Wg.IsNumber=y2a;Wg.IsObject=SCr;Wg.IsRegExp=E2a;Wg.IsString=_2a;Wg.IsSymbol=v2a;Wg.IsUint8Array=TCr;Wg.IsUndefined=C2a;function u2a(t,e){return e in t}a(u2a,"HasPropertyKey");function d2a(t){return SCr(t)&&!bCr(t)&&!TCr(t)&&Symbol.asyncIterator in t}a(d2a,"IsAsyncIterator");function bCr(t){return Array.isArray(t)}a(bCr,"IsArray");function f2a(t){return typeof t=="bigint"}a(f2a,"IsBigInt");function p2a(t){return typeof t=="boolean"}a(p2a,"IsBoolean");function h2a(t){return t instanceof globalThis.Date}a(h2a,"IsDate");function m2a(t){return typeof t=="function"}a(m2a,"IsFunction");function g2a(t){return SCr(t)&&!bCr(t)&&!TCr(t)&&Symbol.iterator in t}a(g2a,"IsIterator");function A2a(t){return t===null}a(A2a,"IsNull");function y2a(t){return typeof t=="number"}a(y2a,"IsNumber");function SCr(t){return typeof t=="object"&&t!==null}a(SCr,"IsObject");function E2a(t){return t instanceof globalThis.RegExp}a(E2a,"IsRegExp");function _2a(t){return typeof t=="string"}a(_2a,"IsString");function v2a(t){return typeof t=="symbol"}a(v2a,"IsSymbol");function TCr(t){return t instanceof globalThis.Uint8Array}a(TCr,"IsUint8Array");function C2a(t){return t===void 0}a(C2a,"IsUndefined")});var Yb=I(X8=>{"use strict";p();var b2a=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]})),S2a=X8&&X8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T2a=X8&&X8.__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;oggt(e))}a(I2a,"ArrayType");function x2a(t){return new Date(t.getTime())}a(x2a,"DateType");function w2a(t){return new Uint8Array(t)}a(w2a,"Uint8ArrayType");function R2a(t){return new RegExp(t.source,t.flags)}a(R2a,"RegExpType");function k2a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ggt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ggt(t[r]);return e}a(k2a,"ObjectType");function ggt(t){return b5e.IsArray(t)?I2a(t):b5e.IsDate(t)?x2a(t):b5e.IsUint8Array(t)?w2a(t):b5e.IsRegExp(t)?R2a(t):b5e.IsObject(t)?k2a(t):t}a(ggt,"Visit");function P2a(t){return ggt(t)}a(P2a,"Clone")});var ygt=I(Agt=>{"use strict";p();Object.defineProperty(Agt,"__esModule",{value:!0});Agt.CloneRest=D2a;Agt.CloneType=pIi;var fIi=Yb();function D2a(t){return t.map(e=>pIi(e))}a(D2a,"CloneRest");function pIi(t,e){return e===void 0?(0,fIi.Clone)(t):(0,fIi.Clone)({...e,...t})}a(pIi,"CloneType")});var ICr=I(MG=>{"use strict";p();var N2a=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]})),hIi=MG&&MG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N2a(e,t,r)};Object.defineProperty(MG,"__esModule",{value:!0});hIi(ygt(),MG);hIi(Yb(),MG)});var Egt=I(ya=>{"use strict";p();Object.defineProperty(ya,"__esModule",{value:!0});ya.IsAsyncIterator=M2a;ya.IsIterator=O2a;ya.IsStandardObject=L2a;ya.IsInstanceObject=B2a;ya.IsPromise=F2a;ya.IsDate=U2a;ya.IsMap=Q2a;ya.IsSet=q2a;ya.IsRegExp=j2a;ya.IsTypedArray=H2a;ya.IsInt8Array=G2a;ya.IsUint8Array=$2a;ya.IsUint8ClampedArray=V2a;ya.IsInt16Array=W2a;ya.IsUint16Array=z2a;ya.IsInt32Array=Y2a;ya.IsUint32Array=K2a;ya.IsFloat32Array=J2a;ya.IsFloat64Array=Z2a;ya.IsBigInt64Array=X2a;ya.IsBigUint64Array=eDa;ya.HasPropertyKey=tDa;ya.IsObject=S5e;ya.IsArray=mIi;ya.IsUndefined=gIi;ya.IsNull=AIi;ya.IsBoolean=yIi;ya.IsNumber=EIi;ya.IsInteger=rDa;ya.IsBigInt=_Ii;ya.IsString=vIi;ya.IsFunction=CIi;ya.IsSymbol=bIi;ya.IsValueType=nDa;function M2a(t){return S5e(t)&&globalThis.Symbol.asyncIterator in t}a(M2a,"IsAsyncIterator");function O2a(t){return S5e(t)&&globalThis.Symbol.iterator in t}a(O2a,"IsIterator");function L2a(t){return S5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(L2a,"IsStandardObject");function B2a(t){return S5e(t)&&!mIi(t)&&CIi(t.constructor)&&t.constructor.name!=="Object"}a(B2a,"IsInstanceObject");function F2a(t){return t instanceof globalThis.Promise}a(F2a,"IsPromise");function U2a(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(U2a,"IsDate");function Q2a(t){return t instanceof globalThis.Map}a(Q2a,"IsMap");function q2a(t){return t instanceof globalThis.Set}a(q2a,"IsSet");function j2a(t){return t instanceof globalThis.RegExp}a(j2a,"IsRegExp");function H2a(t){return globalThis.ArrayBuffer.isView(t)}a(H2a,"IsTypedArray");function G2a(t){return t instanceof globalThis.Int8Array}a(G2a,"IsInt8Array");function $2a(t){return t instanceof globalThis.Uint8Array}a($2a,"IsUint8Array");function V2a(t){return t instanceof globalThis.Uint8ClampedArray}a(V2a,"IsUint8ClampedArray");function W2a(t){return t instanceof globalThis.Int16Array}a(W2a,"IsInt16Array");function z2a(t){return t instanceof globalThis.Uint16Array}a(z2a,"IsUint16Array");function Y2a(t){return t instanceof globalThis.Int32Array}a(Y2a,"IsInt32Array");function K2a(t){return t instanceof globalThis.Uint32Array}a(K2a,"IsUint32Array");function J2a(t){return t instanceof globalThis.Float32Array}a(J2a,"IsFloat32Array");function Z2a(t){return t instanceof globalThis.Float64Array}a(Z2a,"IsFloat64Array");function X2a(t){return t instanceof globalThis.BigInt64Array}a(X2a,"IsBigInt64Array");function eDa(t){return t instanceof globalThis.BigUint64Array}a(eDa,"IsBigUint64Array");function tDa(t,e){return e in t}a(tDa,"HasPropertyKey");function S5e(t){return t!==null&&typeof t=="object"}a(S5e,"IsObject");function mIi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(mIi,"IsArray");function gIi(t){return t===void 0}a(gIi,"IsUndefined");function AIi(t){return t===null}a(AIi,"IsNull");function yIi(t){return typeof t=="boolean"}a(yIi,"IsBoolean");function EIi(t){return typeof t=="number"}a(EIi,"IsNumber");function rDa(t){return globalThis.Number.isInteger(t)}a(rDa,"IsInteger");function _Ii(t){return typeof t=="bigint"}a(_Ii,"IsBigInt");function vIi(t){return typeof t=="string"}a(vIi,"IsString");function CIi(t){return typeof t=="function"}a(CIi,"IsFunction");function bIi(t){return typeof t=="symbol"}a(bIi,"IsSymbol");function nDa(t){return _Ii(t)||yIi(t)||AIi(t)||EIi(t)||vIi(t)||bIi(t)||gIi(t)}a(nDa,"IsValueType")});var R0=I(Ste=>{"use strict";p();var iDa=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]})),oDa=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iDa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});oDa(Egt(),Ste)});var T5e=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.TypeSystemPolicy=void 0;var _gt=R0(),SIi;(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,_gt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,_gt.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,_gt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,_gt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(SIi||(vgt.TypeSystemPolicy=SIi={}))});var TIi=I(e6=>{"use strict";p();var sDa=e6&&e6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=e6&&e6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cDa=e6&&e6.__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;oCgt(e))}a(lDa,"ImmutableArray");function uDa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Cgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Cgt(t[r]);return globalThis.Object.freeze(e)}a(uDa,"ImmutableObject");function Cgt(t){return I5e.IsArray(t)?lDa(t):I5e.IsDate(t)?t:I5e.IsUint8Array(t)?t:I5e.IsRegExp(t)?t:I5e.IsObject(t)?uDa(t):t}a(Cgt,"Immutable")});var Ii=I(xCr=>{"use strict";p();Object.defineProperty(xCr,"__esModule",{value:!0});xCr.CreateType=hDa;var dDa=T5e(),fDa=TIi(),pDa=Yb();function hDa(t,e){let r=e!==void 0?{...e,...t}:t;switch(dDa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,fDa.Immutable)(r);case"clone":return(0,pDa.Clone)(r);default:return r}}a(hDa,"CreateType")});var t6=I(Tte=>{"use strict";p();var mDa=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]})),gDa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mDa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});gDa(Ii(),Tte)});var RCr=I(bgt=>{"use strict";p();Object.defineProperty(bgt,"__esModule",{value:!0});bgt.TypeBoxError=void 0;var wCr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};bgt.TypeBoxError=wCr});var Nf=I(Ite=>{"use strict";p();var ADa=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]})),yDa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ADa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});yDa(RCr(),Ite)});var x5e=I(IR=>{"use strict";p();Object.defineProperty(IR,"__esModule",{value:!0});IR.Kind=IR.Hint=IR.OptionalKind=IR.ReadonlyKind=IR.TransformKind=void 0;IR.TransformKind=Symbol.for("TypeBox.Transform");IR.ReadonlyKind=Symbol.for("TypeBox.Readonly");IR.OptionalKind=Symbol.for("TypeBox.Optional");IR.Hint=Symbol.for("TypeBox.Hint");IR.Kind=Symbol.for("TypeBox.Kind")});var Sn=I(xte=>{"use strict";p();var EDa=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]})),_Da=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EDa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});_Da(x5e(),xte)});var vs=I(ui=>{"use strict";p();var vDa=ui&&ui.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CDa=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bDa=ui&&ui.__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 ODa=Jn&&Jn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LDa=Jn&&Jn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BDa=Jn&&Jn.__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(PCr,"IsControlCharacterFree");function lxi(t){return DCr(t)||zg(t)}a(lxi,"IsAdditionalProperties");function R5e(t){return si.IsUndefined(t)||si.IsBigInt(t)}a(R5e,"IsOptionalBigInt");function Zl(t){return si.IsUndefined(t)||si.IsNumber(t)}a(Zl,"IsOptionalNumber");function DCr(t){return si.IsUndefined(t)||si.IsBoolean(t)}a(DCr,"IsOptionalBoolean");function pl(t){return si.IsUndefined(t)||si.IsString(t)}a(pl,"IsOptionalString");function QDa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)&&cxi(t)}a(QDa,"IsOptionalPattern");function qDa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)}a(qDa,"IsOptionalFormat");function uxi(t){return si.IsUndefined(t)||zg(t)}a(uxi,"IsOptionalSchema");function jDa(t){return si.IsObject(t)&&t[j4.ReadonlyKind]==="Readonly"}a(jDa,"IsReadonly");function HDa(t){return si.IsObject(t)&&t[j4.OptionalKind]==="Optional"}a(HDa,"IsOptional");function dxi(t){return Vs(t,"Any")&&pl(t.$id)}a(dxi,"IsAny");function fxi(t){return Vs(t,"Argument")&&si.IsNumber(t.index)}a(fxi,"IsArgument");function pxi(t){return Vs(t,"Array")&&t.type==="array"&&pl(t.$id)&&zg(t.items)&&Zl(t.minItems)&&Zl(t.maxItems)&&DCr(t.uniqueItems)&&uxi(t.contains)&&Zl(t.minContains)&&Zl(t.maxContains)}a(pxi,"IsArray");function hxi(t){return Vs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&pl(t.$id)&&zg(t.items)}a(hxi,"IsAsyncIterator");function mxi(t){return Vs(t,"BigInt")&&t.type==="bigint"&&pl(t.$id)&&R5e(t.exclusiveMaximum)&&R5e(t.exclusiveMinimum)&&R5e(t.maximum)&&R5e(t.minimum)&&R5e(t.multipleOf)}a(mxi,"IsBigInt");function gxi(t){return Vs(t,"Boolean")&&t.type==="boolean"&&pl(t.$id)}a(gxi,"IsBoolean");function Axi(t){return Vs(t,"Computed")&&si.IsString(t.target)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))}a(Axi,"IsComputed");function yxi(t){return Vs(t,"Constructor")&&t.type==="Constructor"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(yxi,"IsConstructor");function Exi(t){return Vs(t,"Date")&&t.type==="Date"&&pl(t.$id)&&Zl(t.exclusiveMaximumTimestamp)&&Zl(t.exclusiveMinimumTimestamp)&&Zl(t.maximumTimestamp)&&Zl(t.minimumTimestamp)&&Zl(t.multipleOfTimestamp)}a(Exi,"IsDate");function _xi(t){return Vs(t,"Function")&&t.type==="Function"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(_xi,"IsFunction");function GDa(t){return Vs(t,"Import")&&si.HasPropertyKey(t,"$defs")&&si.IsObject(t.$defs)&&Sgt(t.$defs)&&si.HasPropertyKey(t,"$ref")&&si.IsString(t.$ref)&&t.$ref in t.$defs}a(GDa,"IsImport");function vxi(t){return Vs(t,"Integer")&&t.type==="integer"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(vxi,"IsInteger");function Sgt(t){return si.IsObject(t)&&Object.entries(t).every(([e,r])=>PCr(e)&&zg(r))}a(Sgt,"IsProperties");function Cxi(t){return Vs(t,"Intersect")&&!(si.IsString(t.type)&&t.type!=="object")&&si.IsArray(t.allOf)&&t.allOf.every(e=>zg(e)&&!jxi(e))&&pl(t.type)&&(DCr(t.unevaluatedProperties)||uxi(t.unevaluatedProperties))&&pl(t.$id)}a(Cxi,"IsIntersect");function bxi(t){return Vs(t,"Iterator")&&t.type==="Iterator"&&pl(t.$id)&&zg(t.items)}a(bxi,"IsIterator");function Vs(t,e){return si.IsObject(t)&&j4.Kind in t&&t[j4.Kind]===e}a(Vs,"IsKindOf");function Sxi(t){return k5e(t)&&si.IsString(t.const)}a(Sxi,"IsLiteralString");function Txi(t){return k5e(t)&&si.IsNumber(t.const)}a(Txi,"IsLiteralNumber");function $Da(t){return k5e(t)&&si.IsBoolean(t.const)}a($Da,"IsLiteralBoolean");function k5e(t){return Vs(t,"Literal")&&pl(t.$id)&&Ixi(t.const)}a(k5e,"IsLiteral");function Ixi(t){return si.IsBoolean(t)||si.IsNumber(t)||si.IsString(t)}a(Ixi,"IsLiteralValue");function xxi(t){return Vs(t,"MappedKey")&&si.IsArray(t.keys)&&t.keys.every(e=>si.IsNumber(e)||si.IsString(e))}a(xxi,"IsMappedKey");function wxi(t){return Vs(t,"MappedResult")&&Sgt(t.properties)}a(wxi,"IsMappedResult");function Rxi(t){return Vs(t,"Never")&&si.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Rxi,"IsNever");function kxi(t){return Vs(t,"Not")&&zg(t.not)}a(kxi,"IsNot");function Pxi(t){return Vs(t,"Null")&&t.type==="null"&&pl(t.$id)}a(Pxi,"IsNull");function Dxi(t){return Vs(t,"Number")&&t.type==="number"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Dxi,"IsNumber");function Nxi(t){return Vs(t,"Object")&&t.type==="object"&&pl(t.$id)&&Sgt(t.properties)&&lxi(t.additionalProperties)&&Zl(t.minProperties)&&Zl(t.maxProperties)}a(Nxi,"IsObject");function Mxi(t){return Vs(t,"Promise")&&t.type==="Promise"&&pl(t.$id)&&zg(t.item)}a(Mxi,"IsPromise");function Oxi(t){return Vs(t,"Record")&&t.type==="object"&&pl(t.$id)&&lxi(t.additionalProperties)&&si.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&cxi(r[0])&&si.IsObject(e.patternProperties)&&zg(e.patternProperties[r[0]])})(t)}a(Oxi,"IsRecord");function VDa(t){return si.IsObject(t)&&j4.Hint in t&&t[j4.Hint]==="Recursive"}a(VDa,"IsRecursive");function Lxi(t){return Vs(t,"Ref")&&pl(t.$id)&&si.IsString(t.$ref)}a(Lxi,"IsRef");function Bxi(t){return Vs(t,"RegExp")&&pl(t.$id)&&si.IsString(t.source)&&si.IsString(t.flags)&&Zl(t.maxLength)&&Zl(t.minLength)}a(Bxi,"IsRegExp");function Fxi(t){return Vs(t,"String")&&t.type==="string"&&pl(t.$id)&&Zl(t.minLength)&&Zl(t.maxLength)&&QDa(t.pattern)&&qDa(t.format)}a(Fxi,"IsString");function Uxi(t){return Vs(t,"Symbol")&&t.type==="symbol"&&pl(t.$id)}a(Uxi,"IsSymbol");function Qxi(t){return Vs(t,"TemplateLiteral")&&t.type==="string"&&si.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Qxi,"IsTemplateLiteral");function qxi(t){return Vs(t,"This")&&pl(t.$id)&&si.IsString(t.$ref)}a(qxi,"IsThis");function jxi(t){return si.IsObject(t)&&j4.TransformKind in t}a(jxi,"IsTransform");function Hxi(t){return Vs(t,"Tuple")&&t.type==="array"&&pl(t.$id)&&si.IsNumber(t.minItems)&&si.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(si.IsUndefined(t.items)&&si.IsUndefined(t.additionalItems)&&t.minItems===0||si.IsArray(t.items)&&t.items.every(e=>zg(e)))}a(Hxi,"IsTuple");function Gxi(t){return Vs(t,"Undefined")&&t.type==="undefined"&&pl(t.$id)}a(Gxi,"IsUndefined");function WDa(t){return NCr(t)&&t.anyOf.every(e=>Sxi(e)||Txi(e))}a(WDa,"IsUnionLiteral");function NCr(t){return Vs(t,"Union")&&pl(t.$id)&&si.IsObject(t)&&si.IsArray(t.anyOf)&&t.anyOf.every(e=>zg(e))}a(NCr,"IsUnion");function $xi(t){return Vs(t,"Uint8Array")&&t.type==="Uint8Array"&&pl(t.$id)&&Zl(t.minByteLength)&&Zl(t.maxByteLength)}a($xi,"IsUint8Array");function Vxi(t){return Vs(t,"Unknown")&&pl(t.$id)}a(Vxi,"IsUnknown");function Wxi(t){return Vs(t,"Unsafe")}a(Wxi,"IsUnsafe");function zxi(t){return Vs(t,"Void")&&t.type==="void"&&pl(t.$id)}a(zxi,"IsVoid");function Yxi(t){return si.IsObject(t)&&j4.Kind in t&&si.IsString(t[j4.Kind])&&!UDa.includes(t[j4.Kind])}a(Yxi,"IsKind");function zg(t){return si.IsObject(t)&&(dxi(t)||fxi(t)||pxi(t)||gxi(t)||mxi(t)||hxi(t)||Axi(t)||yxi(t)||Exi(t)||_xi(t)||vxi(t)||Cxi(t)||bxi(t)||k5e(t)||xxi(t)||wxi(t)||Rxi(t)||kxi(t)||Pxi(t)||Dxi(t)||Nxi(t)||Mxi(t)||Oxi(t)||Lxi(t)||Bxi(t)||Fxi(t)||Uxi(t)||Qxi(t)||qxi(t)||Hxi(t)||Gxi(t)||NCr(t)||$xi(t)||Vxi(t)||Wxi(t)||zxi(t)||Yxi(t))}a(zg,"IsSchema")});var OCr=I(Jb=>{"use strict";p();var zDa=Jb&&Jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YDa=Jb&&Jb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MCr=Jb&&Jb.__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(LCr,"__esModule",{value:!0});LCr.Increment=KDa;function KDa(t){return(parseInt(t)+1).toString()}a(KDa,"Increment")});var Zxi=I(wte=>{"use strict";p();var JDa=wte&&wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=wte&&wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JDa(e,t,r)};Object.defineProperty(wte,"__esModule",{value:!0});ZDa(Jxi(),wte)});var Xxi=I(Tp=>{"use strict";p();Object.defineProperty(Tp,"__esModule",{value:!0});Tp.PatternNeverExact=Tp.PatternStringExact=Tp.PatternNumberExact=Tp.PatternBooleanExact=Tp.PatternNever=Tp.PatternString=Tp.PatternNumber=Tp.PatternBoolean=void 0;Tp.PatternBoolean="(true|false)";Tp.PatternNumber="(0|[1-9][0-9]*)";Tp.PatternString="(.*)";Tp.PatternNever="(?!.*)";Tp.PatternBooleanExact=`^${Tp.PatternBoolean}$`;Tp.PatternNumberExact=`^${Tp.PatternNumber}$`;Tp.PatternStringExact=`^${Tp.PatternString}$`;Tp.PatternNeverExact=`^${Tp.PatternNever}$`});var P5e=I(Rte=>{"use strict";p();var XDa=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]})),eNa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XDa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});eNa(Xxi(),Rte)});var ewi=I(OG=>{"use strict";p();Object.defineProperty(OG,"__esModule",{value:!0});OG.Entries=tNa;OG.Clear=rNa;OG.Delete=nNa;OG.Has=iNa;OG.Set=oNa;OG.Get=sNa;var qge=new Map;function tNa(){return new Map(qge)}a(tNa,"Entries");function rNa(){return qge.clear()}a(rNa,"Clear");function nNa(t){return qge.delete(t)}a(nNa,"Delete");function iNa(t){return qge.has(t)}a(iNa,"Has");function oNa(t,e){qge.set(t,e)}a(oNa,"Set");function sNa(t){return qge.get(t)}a(sNa,"Get")});var twi=I(LG=>{"use strict";p();Object.defineProperty(LG,"__esModule",{value:!0});LG.Entries=aNa;LG.Clear=cNa;LG.Delete=lNa;LG.Has=uNa;LG.Set=dNa;LG.Get=fNa;var jge=new Map;function aNa(){return new Map(jge)}a(aNa,"Entries");function cNa(){return jge.clear()}a(cNa,"Clear");function lNa(t){return jge.delete(t)}a(lNa,"Delete");function uNa(t){return jge.has(t)}a(uNa,"Has");function dNa(t,e){jge.set(t,e)}a(dNa,"Set");function fNa(t){return jge.get(t)}a(fNa,"Get")});var Hge=I(xR=>{"use strict";p();var pNa=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]})),hNa=xR&&xR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rwi=xR&&xR.__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(H4,"__esModule",{value:!0});H4.SetIncludes=nwi;H4.SetIsSubset=mNa;H4.SetDistinct=gNa;H4.SetIntersect=iwi;H4.SetUnion=ANa;H4.SetComplement=yNa;H4.SetIntersectMany=_Na;H4.SetUnionMany=vNa;function nwi(t,e){return t.includes(e)}a(nwi,"SetIncludes");function mNa(t,e){return t.every(r=>nwi(e,r))}a(mNa,"SetIsSubset");function gNa(t){return[...new Set(t)]}a(gNa,"SetDistinct");function iwi(t,e){return t.filter(r=>e.includes(r))}a(iwi,"SetIntersect");function ANa(t,e){return[...t,...e]}a(ANa,"SetUnion");function yNa(t,e){return t.filter(r=>!e.includes(r))}a(yNa,"SetComplement");function ENa(t,e){return t.reduce((r,n)=>iwi(r,n),e)}a(ENa,"SetIntersectManyResolve");function _Na(t){return t.length===1?t[0]:t.length>1?ENa(t.slice(1),t[0]):[]}a(_Na,"SetIntersectMany");function vNa(t){let e=[];for(let r of t)e.push(...r);return e}a(vNa,"SetUnionMany")});var D5e=I(kte=>{"use strict";p();var CNa=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]})),bNa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CNa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});bNa(owi(),kte)});var swi=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Any=INa;var SNa=t6(),TNa=Sn();function INa(t){return(0,SNa.CreateType)({[TNa.Kind]:"Any"},t)}a(INa,"Any")});var Gge=I(Pte=>{"use strict";p();var xNa=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]})),wNa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xNa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});wNa(swi(),Pte)});var awi=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.Array=PNa;var RNa=Ii(),kNa=Sn();function PNa(t,e){return(0,RNa.CreateType)({[kNa.Kind]:"Array",type:"array",items:t},e)}a(PNa,"Array")});var $ge=I(Dte=>{"use strict";p();var DNa=Dte&&Dte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NNa=Dte&&Dte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DNa(e,t,r)};Object.defineProperty(Dte,"__esModule",{value:!0});NNa(awi(),Dte)});var cwi=I(UCr=>{"use strict";p();Object.defineProperty(UCr,"__esModule",{value:!0});UCr.Argument=LNa;var MNa=Ii(),ONa=Sn();function LNa(t){return(0,MNa.CreateType)({[ONa.Kind]:"Argument",index:t})}a(LNa,"Argument")});var Tgt=I(Nte=>{"use strict";p();var BNa=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]})),FNa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BNa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});FNa(cwi(),Nte)});var lwi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.AsyncIterator=qNa;var UNa=Sn(),QNa=Ii();function qNa(t,e){return(0,QNa.CreateType)({[UNa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(qNa,"AsyncIterator")});var Vge=I(Mte=>{"use strict";p();var jNa=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]})),HNa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jNa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});HNa(lwi(),Mte)});var uwi=I(qCr=>{"use strict";p();Object.defineProperty(qCr,"__esModule",{value:!0});qCr.Computed=VNa;var GNa=t6(),$Na=x5e();function VNa(t,e,r){return(0,GNa.CreateType)({[$Na.Kind]:"Computed",target:t,parameters:e},r)}a(VNa,"Computed")});var BG=I(Ote=>{"use strict";p();var WNa=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]})),zNa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WNa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});zNa(uwi(),Ote)});var Igt=I(jCr=>{"use strict";p();Object.defineProperty(jCr,"__esModule",{value:!0});jCr.Discard=KNa;function YNa(t,e){let{[e]:r,...n}=t;return n}a(YNa,"DiscardKey");function KNa(t,e){return e.reduce((r,n)=>YNa(r,n),t)}a(KNa,"Discard")});var n6=I(Lte=>{"use strict";p();var JNa=Lte&&Lte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZNa=Lte&&Lte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JNa(e,t,r)};Object.defineProperty(Lte,"__esModule",{value:!0});ZNa(Igt(),Lte)});var dwi=I(HCr=>{"use strict";p();Object.defineProperty(HCr,"__esModule",{value:!0});HCr.Never=tMa;var XNa=Ii(),eMa=Sn();function tMa(t){return(0,XNa.CreateType)({[eMa.Kind]:"Never",not:{}},t)}a(tMa,"Never")});var Cm=I(Bte=>{"use strict";p();var rMa=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]})),nMa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rMa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});nMa(dwi(),Bte)});var fwi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.MappedKey=sMa;var iMa=Ii(),oMa=Sn();function sMa(t){return(0,iMa.CreateType)({[oMa.Kind]:"MappedKey",keys:t})}a(sMa,"MappedKey")});var VCr=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.MappedResult=lMa;var aMa=Ii(),cMa=Sn();function lMa(t){return(0,aMa.CreateType)({[cMa.Kind]:"MappedResult",properties:t})}a(lMa,"MappedResult")});var pwi=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Constructor=fMa;var uMa=Ii(),dMa=Sn();function fMa(t,e,r){return(0,uMa.CreateType)({[dMa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(fMa,"Constructor")});var Wge=I(Fte=>{"use strict";p();var pMa=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]})),hMa=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pMa(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});hMa(pwi(),Fte)});var hwi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.Function=AMa;var mMa=Ii(),gMa=Sn();function AMa(t,e,r){return(0,mMa.CreateType)({[gMa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(AMa,"Function")});var FG=I(Ute=>{"use strict";p();var yMa=Ute&&Ute.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EMa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yMa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});EMa(hwi(),Ute)});var KCr=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.UnionCreate=CMa;var _Ma=Ii(),vMa=Sn();function CMa(t,e){return(0,_Ma.CreateType)({[vMa.Kind]:"Union",anyOf:t},e)}a(CMa,"UnionCreate")});var ywi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.UnionEvaluated=PMa;var bMa=Ii(),SMa=Sn(),TMa=n6(),IMa=Cm(),xMa=G4(),mwi=KCr(),Awi=vs();function wMa(t){return t.some(e=>(0,Awi.IsOptional)(e))}a(wMa,"IsUnionOptional");function gwi(t){return t.map(e=>(0,Awi.IsOptional)(e)?RMa(e):e)}a(gwi,"RemoveOptionalFromRest");function RMa(t){return(0,TMa.Discard)(t,[SMa.OptionalKind])}a(RMa,"RemoveOptionalFromType");function kMa(t,e){return wMa(t)?(0,xMa.Optional)((0,mwi.UnionCreate)(gwi(t),e)):(0,mwi.UnionCreate)(gwi(t),e)}a(kMa,"ResolveUnion");function PMa(t,e){return t.length===1?(0,bMa.CreateType)(t[0],e):t.length===0?(0,IMa.Never)(e):kMa(t,e)}a(PMa,"UnionEvaluated")});var _wi=I(Ewi=>{"use strict";p();Object.defineProperty(Ewi,"__esModule",{value:!0});var ZSp=Sn()});var vwi=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.Union=OMa;var DMa=Cm(),NMa=Ii(),MMa=KCr();function OMa(t,e){return t.length===0?(0,DMa.Never)(e):t.length===1?(0,NMa.CreateType)(t[0],e):(0,MMa.UnionCreate)(t,e)}a(OMa,"Union")});var Ip=I(i6=>{"use strict";p();var LMa=i6&&i6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XCr=i6&&i6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LMa(e,t,r)};Object.defineProperty(i6,"__esModule",{value:!0});XCr(ywi(),i6);XCr(_wi(),i6);XCr(vwi(),i6)});var xgt=I(zge=>{"use strict";p();Object.defineProperty(zge,"__esModule",{value:!0});zge.TemplateLiteralParserError=void 0;zge.TemplateLiteralParse=Qte;zge.TemplateLiteralParseExact=$Ma;var BMa=Nf(),N5e=class extends BMa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};zge.TemplateLiteralParserError=N5e;function FMa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(FMa,"Unescape");function ebr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(ebr,"IsNonEscaped");function o6(t,e){return ebr(t,e,"(")}a(o6,"IsOpenParen");function M5e(t,e){return ebr(t,e,")")}a(M5e,"IsCloseParen");function Cwi(t,e){return ebr(t,e,"|")}a(Cwi,"IsSeparator");function UMa(t){if(!(o6(t,0)&&M5e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Qte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Qte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(HMa,"Or");function GMa(t){function e(o,s){if(!o6(o,s))throw new N5e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Qte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(GMa,"And");function Qte(t){return UMa(t)?Qte(QMa(t)):qMa(t)?HMa(t):jMa(t)?GMa(t):{type:"const",const:FMa(t)}}a(Qte,"TemplateLiteralParse");function $Ma(t){return Qte(t.slice(1,t.length-1))}a($Ma,"TemplateLiteralParseExact")});var tbr=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.TemplateLiteralFiniteError=void 0;Yge.IsTemplateLiteralExpressionFinite=Rgt;Yge.IsTemplateLiteralFinite=JMa;var VMa=xgt(),WMa=Nf(),wgt=class extends WMa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Yge.TemplateLiteralFiniteError=wgt;function zMa(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(zMa,"IsNumberExpression");function YMa(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(YMa,"IsBooleanExpression");function KMa(t){return t.type==="const"&&t.const===".*"}a(KMa,"IsStringExpression");function Rgt(t){return zMa(t)||KMa(t)?!1:YMa(t)?!0:t.type==="and"?t.expr.every(e=>Rgt(e)):t.type==="or"?t.expr.every(e=>Rgt(e)):t.type==="const"?!0:(()=>{throw new wgt("Unknown expression type")})()}a(Rgt,"IsTemplateLiteralExpressionFinite");function JMa(t){let e=(0,VMa.TemplateLiteralParseExact)(t.pattern);return Rgt(e)}a(JMa,"IsTemplateLiteralFinite")});var rbr=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.TemplateLiteralGenerateError=void 0;Kge.TemplateLiteralExpressionGenerate=Pgt;Kge.TemplateLiteralGenerate=iOa;var ZMa=tbr(),XMa=xgt(),eOa=Nf(),kgt=class extends eOa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Kge.TemplateLiteralGenerateError=kgt;function*bwi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of bwi(t.slice(1)))yield`${e}${r}`}a(bwi,"GenerateReduce");function*tOa(t){return yield*bwi(t.expr.map(e=>[...Pgt(e)]))}a(tOa,"GenerateAnd");function*rOa(t){for(let e of t.expr)yield*Pgt(e)}a(rOa,"GenerateOr");function*nOa(t){return yield t.const}a(nOa,"GenerateConst");function*Pgt(t){return t.type==="and"?yield*tOa(t):t.type==="or"?yield*rOa(t):t.type==="const"?yield*nOa(t):(()=>{throw new kgt("Unknown expression")})()}a(Pgt,"TemplateLiteralExpressionGenerate");function iOa(t){let e=(0,XMa.TemplateLiteralParseExact)(t.pattern);return(0,ZMa.IsTemplateLiteralExpressionFinite)(e)?[...Pgt(e)]:[]}a(iOa,"TemplateLiteralGenerate")});var Swi=I(nbr=>{"use strict";p();Object.defineProperty(nbr,"__esModule",{value:!0});nbr.Literal=aOa;var oOa=Ii(),sOa=Sn();function aOa(t,e){return(0,oOa.CreateType)({[sOa.Kind]:"Literal",const:t,type:typeof t},e)}a(aOa,"Literal")});var UE=I(qte=>{"use strict";p();var cOa=qte&&qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lOa=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cOa(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});lOa(Swi(),qte)});var Twi=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.Boolean=fOa;var uOa=Sn(),dOa=t6();function fOa(t){return(0,dOa.CreateType)({[uOa.Kind]:"Boolean",type:"boolean"},t)}a(fOa,"Boolean")});var O5e=I(jte=>{"use strict";p();var pOa=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]})),hOa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pOa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});hOa(Twi(),jte)});var Iwi=I(obr=>{"use strict";p();Object.defineProperty(obr,"__esModule",{value:!0});obr.BigInt=AOa;var mOa=Sn(),gOa=t6();function AOa(t){return(0,gOa.CreateType)({[mOa.Kind]:"BigInt",type:"bigint"},t)}a(AOa,"BigInt")});var Jge=I(Hte=>{"use strict";p();var yOa=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]})),EOa=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yOa(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});EOa(Iwi(),Hte)});var xwi=I(sbr=>{"use strict";p();Object.defineProperty(sbr,"__esModule",{value:!0});sbr.Number=COa;var _Oa=Ii(),vOa=Sn();function COa(t){return(0,_Oa.CreateType)({[vOa.Kind]:"Number",type:"number"},t)}a(COa,"Number")});var UG=I(Gte=>{"use strict";p();var bOa=Gte&&Gte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SOa=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bOa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});SOa(xwi(),Gte)});var wwi=I(abr=>{"use strict";p();Object.defineProperty(abr,"__esModule",{value:!0});abr.String=xOa;var TOa=Ii(),IOa=Sn();function xOa(t){return(0,TOa.CreateType)({[IOa.Kind]:"String",type:"string"},t)}a(xOa,"String")});var QG=I($te=>{"use strict";p();var wOa=$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]})),ROa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wOa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});ROa(wwi(),$te)});var ubr=I(lbr=>{"use strict";p();Object.defineProperty(lbr,"__esModule",{value:!0});lbr.TemplateLiteralSyntax=FOa;var L5e=UE(),kOa=O5e(),POa=Jge(),DOa=UG(),NOa=QG(),MOa=Ip(),OOa=Cm();function*LOa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,kOa.Boolean)():e==="number"?yield(0,DOa.Number)():e==="bigint"?yield(0,POa.BigInt)():e==="string"?yield(0,NOa.String)():yield(()=>{let r=e.split("|").map(n=>(0,L5e.Literal)(n.trim()));return r.length===0?(0,OOa.Never)():r.length===1?r[0]:(0,MOa.UnionEvaluated)(r)})()}a(LOa,"FromUnion");function*BOa(t){if(t[1]!=="{"){let e=(0,L5e.Literal)("$"),r=cbr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(F5e,"__esModule",{value:!0});F5e.TemplateLiteralPatternError=void 0;F5e.TemplateLiteralPattern=jOa;var B5e=P5e(),UOa=Sn(),QOa=Nf(),qG=vs(),Dgt=class extends QOa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};F5e.TemplateLiteralPatternError=Dgt;function qOa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(qOa,"Escape");function Rwi(t,e){return(0,qG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,qG.IsUnion)(t)?`(${t.anyOf.map(r=>Rwi(r,e)).join("|")})`:(0,qG.IsNumber)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsInteger)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsBigInt)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsString)(t)?`${e}${B5e.PatternString}`:(0,qG.IsLiteral)(t)?`${e}${qOa(t.const.toString())}`:(0,qG.IsBoolean)(t)?`${e}${B5e.PatternBoolean}`:(()=>{throw new Dgt(`Unexpected Kind '${t[UOa.Kind]}'`)})()}a(Rwi,"Visit");function jOa(t){return`^${t.map(e=>Rwi(e,"")).join("")}$`}a(jOa,"TemplateLiteralPattern")});var kwi=I(fbr=>{"use strict";p();Object.defineProperty(fbr,"__esModule",{value:!0});fbr.TemplateLiteralToUnion=VOa;var HOa=Ip(),GOa=UE(),$Oa=rbr();function VOa(t){let r=(0,$Oa.TemplateLiteralGenerate)(t).map(n=>(0,GOa.Literal)(n));return(0,HOa.UnionEvaluated)(r)}a(VOa,"TemplateLiteralToUnion")});var Dwi=I(pbr=>{"use strict";p();Object.defineProperty(pbr,"__esModule",{value:!0});pbr.TemplateLiteral=JOa;var WOa=Ii(),zOa=ubr(),Pwi=dbr(),YOa=Iv(),KOa=Sn();function JOa(t,e){let r=(0,YOa.IsString)(t)?(0,Pwi.TemplateLiteralPattern)((0,zOa.TemplateLiteralSyntax)(t)):(0,Pwi.TemplateLiteralPattern)(t);return(0,WOa.CreateType)({[KOa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(JOa,"TemplateLiteral")});var pD=I(ZT=>{"use strict";p();var ZOa=ZT&&ZT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vte=ZT&&ZT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZOa(e,t,r)};Object.defineProperty(ZT,"__esModule",{value:!0});Vte(tbr(),ZT);Vte(rbr(),ZT);Vte(ubr(),ZT);Vte(xgt(),ZT);Vte(dbr(),ZT);Vte(kwi(),ZT);Vte(Dwi(),ZT)});var Ngt=I(hbr=>{"use strict";p();Object.defineProperty(hbr,"__esModule",{value:!0});hbr.IndexPropertyKeys=Nwi;var XOa=pD(),U5e=vs();function e5a(t){return(0,XOa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(e5a,"FromTemplateLiteral");function t5a(t){let e=[];for(let r of t)e.push(...Nwi(r));return e}a(t5a,"FromUnion");function r5a(t){return[t.toString()]}a(r5a,"FromLiteral");function Nwi(t){return[...new Set((0,U5e.IsTemplateLiteral)(t)?e5a(t):(0,U5e.IsUnion)(t)?t5a(t.anyOf):(0,U5e.IsLiteral)(t)?r5a(t.const):(0,U5e.IsNumber)(t)?["[number]"]:(0,U5e.IsInteger)(t)?["[number]"]:[])]}a(Nwi,"IndexPropertyKeys")});var gbr=I(mbr=>{"use strict";p();Object.defineProperty(mbr,"__esModule",{value:!0});mbr.IndexFromMappedResult=c5a;var n5a=bm(),i5a=Ngt(),o5a=hD();function s5a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,o5a.Index)(t,(0,i5a.IndexPropertyKeys)(e[o]),r);return n}a(s5a,"FromProperties");function a5a(t,e,r){return s5a(t,e.properties,r)}a(a5a,"FromMappedResult");function c5a(t,e,r){let n=a5a(t,e,r);return(0,n5a.MappedResult)(n)}a(c5a,"IndexFromMappedResult")});var Ogt=I(Zge=>{"use strict";p();Object.defineProperty(Zge,"__esModule",{value:!0});Zge.IndexFromPropertyKey=ybr;Zge.IndexFromPropertyKeys=Bwi;Zge.IndexFromComputed=C5a;Zge.Index=b5a;var l5a=Ii(),u5a=Nf(),Owi=BG(),Mgt=Cm(),d5a=XT(),Abr=Ip(),f5a=Ngt(),p5a=Ebr(),h5a=gbr(),Zb=vs();function Lwi(t,e){return t.map(r=>ybr(r,e))}a(Lwi,"FromRest");function m5a(t){return t.filter(e=>!(0,Zb.IsNever)(e))}a(m5a,"FromIntersectRest");function g5a(t,e){return(0,d5a.IntersectEvaluated)(m5a(Lwi(t,e)))}a(g5a,"FromIntersect");function A5a(t){return t.some(e=>(0,Zb.IsNever)(e))?[]:t}a(A5a,"FromUnionRest");function y5a(t,e){return(0,Abr.UnionEvaluated)(A5a(Lwi(t,e)))}a(y5a,"FromUnion");function E5a(t,e){return e in t?t[e]:e==="[number]"?(0,Abr.UnionEvaluated)(t):(0,Mgt.Never)()}a(E5a,"FromTuple");function _5a(t,e){return e==="[number]"?t:(0,Mgt.Never)()}a(_5a,"FromArray");function v5a(t,e){return e in t?t[e]:(0,Mgt.Never)()}a(v5a,"FromProperty");function ybr(t,e){return(0,Zb.IsIntersect)(t)?g5a(t.allOf,e):(0,Zb.IsUnion)(t)?y5a(t.anyOf,e):(0,Zb.IsTuple)(t)?E5a(t.items??[],e):(0,Zb.IsArray)(t)?_5a(t.items,e):(0,Zb.IsObject)(t)?v5a(t.properties,e):(0,Mgt.Never)()}a(ybr,"IndexFromPropertyKey");function Bwi(t,e){return e.map(r=>ybr(t,r))}a(Bwi,"IndexFromPropertyKeys");function Mwi(t,e){return(0,Abr.UnionEvaluated)(Bwi(t,e))}a(Mwi,"FromSchema");function C5a(t,e){return(0,Owi.Computed)("Index",[t,e])}a(C5a,"IndexFromComputed");function b5a(t,e,r){if((0,Zb.IsRef)(t)||(0,Zb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Zb.IsSchema)(t)||!(0,Zb.IsSchema)(e))throw new u5a.TypeBoxError(n);return(0,Owi.Computed)("Index",[t,e])}return(0,Zb.IsMappedResult)(e)?(0,h5a.IndexFromMappedResult)(t,e,r):(0,Zb.IsMappedKey)(e)?(0,p5a.IndexFromMappedKey)(t,e,r):(0,l5a.CreateType)((0,Zb.IsSchema)(e)?Mwi(t,(0,f5a.IndexPropertyKeys)(e)):Mwi(t,e),r)}a(b5a,"Index")});var Ebr=I(_br=>{"use strict";p();Object.defineProperty(_br,"__esModule",{value:!0});_br.IndexFromMappedKey=k5a;var S5a=Ogt(),T5a=bm(),I5a=Yb();function x5a(t,e,r){return{[e]:(0,S5a.Index)(t,[e],(0,I5a.Clone)(r))}}a(x5a,"MappedIndexPropertyKey");function w5a(t,e,r){return e.reduce((n,o)=>({...n,...x5a(t,o,r)}),{})}a(w5a,"MappedIndexPropertyKeys");function R5a(t,e,r){return w5a(t,e.keys,r)}a(R5a,"MappedIndexProperties");function k5a(t,e,r){let n=R5a(t,e,r);return(0,T5a.MappedResult)(n)}a(k5a,"IndexFromMappedKey")});var hD=I($4=>{"use strict";p();var P5a=$4&&$4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lgt=$4&&$4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P5a(e,t,r)};Object.defineProperty($4,"__esModule",{value:!0});Lgt(Ebr(),$4);Lgt(gbr(),$4);Lgt(Ngt(),$4);Lgt(Ogt(),$4)});var Fwi=I(vbr=>{"use strict";p();Object.defineProperty(vbr,"__esModule",{value:!0});vbr.Iterator=M5a;var D5a=Ii(),N5a=Sn();function M5a(t,e){return(0,D5a.CreateType)({[N5a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(M5a,"Iterator")});var Xge=I(Wte=>{"use strict";p();var O5a=Wte&&Wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L5a=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O5a(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});L5a(Fwi(),Wte)});var Qwi=I(Bgt=>{"use strict";p();Object.defineProperty(Bgt,"__esModule",{value:!0});Bgt.Object=void 0;var B5a=Ii(),Uwi=Sn(),F5a=vs();function U5a(t){return globalThis.Object.keys(t).filter(e=>!(0,F5a.IsOptional)(t[e]))}a(U5a,"RequiredArray");function Q5a(t,e){let r=U5a(t),n=r.length>0?{[Uwi.Kind]:"Object",type:"object",required:r,properties:t}:{[Uwi.Kind]:"Object",type:"object",properties:t};return(0,B5a.CreateType)(n,e)}a(Q5a,"_Object");Bgt.Object=Q5a});var xv=I(zte=>{"use strict";p();var q5a=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]})),j5a=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q5a(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});j5a(Qwi(),zte)});var qwi=I(Cbr=>{"use strict";p();Object.defineProperty(Cbr,"__esModule",{value:!0});Cbr.Promise=$5a;var H5a=Ii(),G5a=Sn();function $5a(t,e){return(0,H5a.CreateType)({[G5a.Kind]:"Promise",type:"Promise",item:t},e)}a($5a,"Promise")});var Q5e=I(Yte=>{"use strict";p();var V5a=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]})),W5a=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V5a(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});W5a(qwi(),Yte)});var Sbr=I(bbr=>{"use strict";p();Object.defineProperty(bbr,"__esModule",{value:!0});bbr.Readonly=e4a;var jwi=Ii(),Hwi=Sn(),z5a=n6(),Y5a=Tbr(),K5a=vs();function J5a(t){return(0,jwi.CreateType)((0,z5a.Discard)(t,[Hwi.ReadonlyKind]))}a(J5a,"RemoveReadonly");function Z5a(t){return(0,jwi.CreateType)({...t,[Hwi.ReadonlyKind]:"Readonly"})}a(Z5a,"AddReadonly");function X5a(t,e){return e===!1?J5a(t):Z5a(t)}a(X5a,"ReadonlyWithFlag");function e4a(t,e){let r=e??!0;return(0,K5a.IsMappedResult)(t)?(0,Y5a.ReadonlyFromMappedResult)(t,r):X5a(t,r)}a(e4a,"Readonly")});var Tbr=I(Ibr=>{"use strict";p();Object.defineProperty(Ibr,"__esModule",{value:!0});Ibr.ReadonlyFromMappedResult=o4a;var t4a=bm(),r4a=Sbr();function n4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,r4a.Readonly)(t[n],e);return r}a(n4a,"FromProperties");function i4a(t,e){return n4a(t.properties,e)}a(i4a,"FromMappedResult");function o4a(t,e){let r=i4a(t,e);return(0,t4a.MappedResult)(r)}a(o4a,"ReadonlyFromMappedResult")});var HG=I(jG=>{"use strict";p();var s4a=jG&&jG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gwi=jG&&jG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s4a(e,t,r)};Object.defineProperty(jG,"__esModule",{value:!0});Gwi(Tbr(),jG);Gwi(Sbr(),jG)});var Vwi=I(xbr=>{"use strict";p();Object.defineProperty(xbr,"__esModule",{value:!0});xbr.Tuple=c4a;var a4a=Ii(),$wi=Sn();function c4a(t,e){return(0,a4a.CreateType)(t.length>0?{[$wi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[$wi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(c4a,"Tuple")});var s6=I(Kte=>{"use strict";p();var l4a=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]})),u4a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l4a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});u4a(Vwi(),Kte)});var Zwi=I(Fgt=>{"use strict";p();Object.defineProperty(Fgt,"__esModule",{value:!0});Fgt.MappedFunctionReturnType=Jwi;Fgt.Mapped=k4a;var wbr=Sn(),Wwi=n6(),d4a=$ge(),f4a=Vge(),p4a=Wge(),h4a=FG(),m4a=hD(),g4a=XT(),A4a=Xge(),zwi=UE(),Ywi=xv(),y4a=G4(),E4a=Q5e(),_4a=HG(),v4a=s6(),C4a=Ip(),b4a=D5e(),S4a=VCr(),wv=vs();function Kwi(t,e){return t in e?wR(t,e[t]):(0,S4a.MappedResult)(e)}a(Kwi,"FromMappedResult");function T4a(t){return{[t]:(0,zwi.Literal)(t)}}a(T4a,"MappedKeyToKnownMappedResultProperties");function I4a(t){let e={};for(let r of t)e[r]=(0,zwi.Literal)(r);return e}a(I4a,"MappedKeyToUnknownMappedResultProperties");function x4a(t,e){return(0,b4a.SetIncludes)(e,t)?T4a(t):I4a(e)}a(x4a,"MappedKeyToMappedResultProperties");function w4a(t,e){let r=x4a(t,e);return Kwi(t,r)}a(w4a,"FromMappedKey");function q5e(t,e){return e.map(r=>wR(t,r))}a(q5e,"FromRest");function R4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=wR(t,e[n]);return r}a(R4a,"FromProperties");function wR(t,e){let r={...e};return(0,wv.IsOptional)(e)?(0,y4a.Optional)(wR(t,(0,Wwi.Discard)(e,[wbr.OptionalKind]))):(0,wv.IsReadonly)(e)?(0,_4a.Readonly)(wR(t,(0,Wwi.Discard)(e,[wbr.ReadonlyKind]))):(0,wv.IsMappedResult)(e)?Kwi(t,e.properties):(0,wv.IsMappedKey)(e)?w4a(t,e.keys):(0,wv.IsConstructor)(e)?(0,p4a.Constructor)(q5e(t,e.parameters),wR(t,e.returns),r):(0,wv.IsFunction)(e)?(0,h4a.Function)(q5e(t,e.parameters),wR(t,e.returns),r):(0,wv.IsAsyncIterator)(e)?(0,f4a.AsyncIterator)(wR(t,e.items),r):(0,wv.IsIterator)(e)?(0,A4a.Iterator)(wR(t,e.items),r):(0,wv.IsIntersect)(e)?(0,g4a.Intersect)(q5e(t,e.allOf),r):(0,wv.IsUnion)(e)?(0,C4a.Union)(q5e(t,e.anyOf),r):(0,wv.IsTuple)(e)?(0,v4a.Tuple)(q5e(t,e.items??[]),r):(0,wv.IsObject)(e)?(0,Ywi.Object)(R4a(t,e.properties),r):(0,wv.IsArray)(e)?(0,d4a.Array)(wR(t,e.items),r):(0,wv.IsPromise)(e)?(0,E4a.Promise)(wR(t,e.item),r):e}a(wR,"FromSchemaType");function Jwi(t,e){let r={};for(let n of t)r[n]=wR(n,e);return r}a(Jwi,"MappedFunctionReturnType");function k4a(t,e,r){let n=(0,wv.IsSchema)(t)?(0,m4a.IndexPropertyKeys)(t):t,o=e({[wbr.Kind]:"MappedKey",keys:n}),s=Jwi(n,o);return(0,Ywi.Object)(s,r)}a(k4a,"Mapped")});var bm=I(a6=>{"use strict";p();var P4a=a6&&a6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rbr=a6&&a6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P4a(e,t,r)};Object.defineProperty(a6,"__esModule",{value:!0});Rbr(fwi(),a6);Rbr(VCr(),a6);Rbr(Zwi(),a6)});var Pbr=I(kbr=>{"use strict";p();Object.defineProperty(kbr,"__esModule",{value:!0});kbr.Optional=F4a;var Xwi=Ii(),eRi=Sn(),D4a=n6(),N4a=Dbr(),M4a=vs();function O4a(t){return(0,Xwi.CreateType)((0,D4a.Discard)(t,[eRi.OptionalKind]))}a(O4a,"RemoveOptional");function L4a(t){return(0,Xwi.CreateType)({...t,[eRi.OptionalKind]:"Optional"})}a(L4a,"AddOptional");function B4a(t,e){return e===!1?O4a(t):L4a(t)}a(B4a,"OptionalWithFlag");function F4a(t,e){let r=e??!0;return(0,M4a.IsMappedResult)(t)?(0,N4a.OptionalFromMappedResult)(t,r):B4a(t,r)}a(F4a,"Optional")});var Dbr=I(Nbr=>{"use strict";p();Object.defineProperty(Nbr,"__esModule",{value:!0});Nbr.OptionalFromMappedResult=H4a;var U4a=bm(),Q4a=Pbr();function q4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,Q4a.Optional)(t[n],e);return r}a(q4a,"FromProperties");function j4a(t,e){return q4a(t.properties,e)}a(j4a,"FromMappedResult");function H4a(t,e){let r=j4a(t,e);return(0,U4a.MappedResult)(r)}a(H4a,"OptionalFromMappedResult")});var G4=I(GG=>{"use strict";p();var G4a=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]})),tRi=GG&&GG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G4a(e,t,r)};Object.defineProperty(GG,"__esModule",{value:!0});tRi(Dbr(),GG);tRi(Pbr(),GG)});var Lbr=I(Obr=>{"use strict";p();Object.defineProperty(Obr,"__esModule",{value:!0});Obr.IntersectCreate=V4a;var $4a=Ii(),rRi=Sn(),Mbr=vs();function V4a(t,e={}){let r=t.every(o=>(0,Mbr.IsObject)(o)),n=(0,Mbr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,$4a.CreateType)(e.unevaluatedProperties===!1||(0,Mbr.IsSchema)(e.unevaluatedProperties)||r?{...n,[rRi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[rRi.Kind]:"Intersect",allOf:t},e)}a(V4a,"IntersectCreate")});var oRi=I(Fbr=>{"use strict";p();Object.defineProperty(Fbr,"__esModule",{value:!0});Fbr.IntersectEvaluated=tLa;var W4a=Sn(),z4a=Ii(),Y4a=n6(),K4a=Cm(),J4a=G4(),nRi=Lbr(),Bbr=vs();function Z4a(t){return t.every(e=>(0,Bbr.IsOptional)(e))}a(Z4a,"IsIntersectOptional");function X4a(t){return(0,Y4a.Discard)(t,[W4a.OptionalKind])}a(X4a,"RemoveOptionalFromType");function iRi(t){return t.map(e=>(0,Bbr.IsOptional)(e)?X4a(e):e)}a(iRi,"RemoveOptionalFromRest");function eLa(t,e){return Z4a(t)?(0,J4a.Optional)((0,nRi.IntersectCreate)(iRi(t),e)):(0,nRi.IntersectCreate)(iRi(t),e)}a(eLa,"ResolveIntersect");function tLa(t,e={}){if(t.length===1)return(0,z4a.CreateType)(t[0],e);if(t.length===0)return(0,K4a.Never)(e);if(t.some(r=>(0,Bbr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return eLa(t,e)}a(tLa,"IntersectEvaluated")});var aRi=I(sRi=>{"use strict";p();Object.defineProperty(sRi,"__esModule",{value:!0});var Cxp=Sn()});var cRi=I(Ubr=>{"use strict";p();Object.defineProperty(Ubr,"__esModule",{value:!0});Ubr.Intersect=sLa;var rLa=Ii(),nLa=Cm(),iLa=Lbr(),oLa=vs();function sLa(t,e){if(t.length===1)return(0,rLa.CreateType)(t[0],e);if(t.length===0)return(0,nLa.Never)(e);if(t.some(r=>(0,oLa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,iLa.IntersectCreate)(t,e)}a(sLa,"Intersect")});var XT=I(c6=>{"use strict";p();var aLa=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]})),Qbr=c6&&c6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aLa(e,t,r)};Object.defineProperty(c6,"__esModule",{value:!0});Qbr(oRi(),c6);Qbr(aRi(),c6);Qbr(cRi(),c6)});var lRi=I(qbr=>{"use strict";p();Object.defineProperty(qbr,"__esModule",{value:!0});qbr.Ref=dLa;var cLa=Nf(),lLa=Ii(),uLa=Sn();function dLa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new cLa.TypeBoxError("Ref: $ref must be a string");return(0,lLa.CreateType)({[uLa.Kind]:"Ref",$ref:e},r)}a(dLa,"Ref")});var $G=I(Jte=>{"use strict";p();var fLa=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]})),pLa=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fLa(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});pLa(lRi(),Jte)});var dRi=I(Gbr=>{"use strict";p();Object.defineProperty(Gbr,"__esModule",{value:!0});Gbr.Awaited=Hbr;var hLa=Ii(),jbr=BG(),mLa=XT(),gLa=Ip(),ALa=$G(),j5e=vs();function yLa(t,e){return(0,jbr.Computed)("Awaited",[(0,jbr.Computed)(t,e)])}a(yLa,"FromComputed");function ELa(t){return(0,jbr.Computed)("Awaited",[(0,ALa.Ref)(t)])}a(ELa,"FromRef");function _La(t){return(0,mLa.Intersect)(uRi(t))}a(_La,"FromIntersect");function vLa(t){return(0,gLa.Union)(uRi(t))}a(vLa,"FromUnion");function CLa(t){return Hbr(t)}a(CLa,"FromPromise");function uRi(t){return t.map(e=>Hbr(e))}a(uRi,"FromRest");function Hbr(t,e){return(0,hLa.CreateType)((0,j5e.IsComputed)(t)?yLa(t.target,t.parameters):(0,j5e.IsIntersect)(t)?_La(t.allOf):(0,j5e.IsUnion)(t)?vLa(t.anyOf):(0,j5e.IsPromise)(t)?CLa(t.item):(0,j5e.IsRef)(t)?ELa(t.$ref):t,e)}a(Hbr,"Awaited")});var H5e=I(Zte=>{"use strict";p();var bLa=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]})),SLa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bLa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});SLa(dRi(),Zte)});var Qgt=I(Ugt=>{"use strict";p();Object.defineProperty(Ugt,"__esModule",{value:!0});Ugt.KeyOfPropertyKeys=Vbr;Ugt.KeyOfPattern=PLa;var fRi=D5e(),eAe=vs();function pRi(t){let e=[];for(let r of t)e.push(Vbr(r));return e}a(pRi,"FromRest");function TLa(t){let e=pRi(t);return(0,fRi.SetUnionMany)(e)}a(TLa,"FromIntersect");function ILa(t){let e=pRi(t);return(0,fRi.SetIntersectMany)(e)}a(ILa,"FromUnion");function xLa(t){return t.map((e,r)=>r.toString())}a(xLa,"FromTuple");function wLa(t){return["[number]"]}a(wLa,"FromArray");function RLa(t){return globalThis.Object.getOwnPropertyNames(t)}a(RLa,"FromProperties");function kLa(t){return $br?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(kLa,"FromPatternProperties");function Vbr(t){return(0,eAe.IsIntersect)(t)?TLa(t.allOf):(0,eAe.IsUnion)(t)?ILa(t.anyOf):(0,eAe.IsTuple)(t)?xLa(t.items??[]):(0,eAe.IsArray)(t)?wLa(t.items):(0,eAe.IsObject)(t)?RLa(t.properties):(0,eAe.IsRecord)(t)?kLa(t.patternProperties):[]}a(Vbr,"KeyOfPropertyKeys");var $br=!1;function PLa(t){$br=!0;let e=Vbr(t);return $br=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(PLa,"KeyOfPattern")});var Ybr=I(qgt=>{"use strict";p();Object.defineProperty(qgt,"__esModule",{value:!0});qgt.KeyOfPropertyKeysToRest=hRi;qgt.KeyOf=jLa;var DLa=Ii(),NLa=UE(),MLa=UG(),zbr=BG(),OLa=$G(),LLa=Qgt(),BLa=Ip(),FLa=Kbr(),Wbr=vs();function ULa(t,e){return(0,zbr.Computed)("KeyOf",[(0,zbr.Computed)(t,e)])}a(ULa,"FromComputed");function QLa(t){return(0,zbr.Computed)("KeyOf",[(0,OLa.Ref)(t)])}a(QLa,"FromRef");function qLa(t,e){let r=(0,LLa.KeyOfPropertyKeys)(t),n=hRi(r),o=(0,BLa.UnionEvaluated)(n);return(0,DLa.CreateType)(o,e)}a(qLa,"KeyOfFromType");function hRi(t){return t.map(e=>e==="[number]"?(0,MLa.Number)():(0,NLa.Literal)(e))}a(hRi,"KeyOfPropertyKeysToRest");function jLa(t,e){return(0,Wbr.IsComputed)(t)?ULa(t.target,t.parameters):(0,Wbr.IsRef)(t)?QLa(t.$ref):(0,Wbr.IsMappedResult)(t)?(0,FLa.KeyOfFromMappedResult)(t,e):qLa(t,e)}a(jLa,"KeyOf")});var Kbr=I(Jbr=>{"use strict";p();Object.defineProperty(Jbr,"__esModule",{value:!0});Jbr.KeyOfFromMappedResult=zLa;var HLa=bm(),GLa=Ybr(),$La=Yb();function VLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,GLa.KeyOf)(t[n],(0,$La.Clone)(e));return r}a(VLa,"FromProperties");function WLa(t,e){return VLa(t.properties,e)}a(WLa,"FromMappedResult");function zLa(t,e){let r=WLa(t,e);return(0,HLa.MappedResult)(r)}a(zLa,"KeyOfFromMappedResult")});var mRi=I(Zbr=>{"use strict";p();Object.defineProperty(Zbr,"__esModule",{value:!0});Zbr.KeyOfPropertyEntries=JLa;var YLa=Ogt(),KLa=Qgt();function JLa(t){let e=(0,KLa.KeyOfPropertyKeys)(t),r=(0,YLa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(JLa,"KeyOfPropertyEntries")});var mD=I(V4=>{"use strict";p();var ZLa=V4&&V4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jgt=V4&&V4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZLa(e,t,r)};Object.defineProperty(V4,"__esModule",{value:!0});jgt(Kbr(),V4);jgt(mRi(),V4);jgt(Qgt(),V4);jgt(Ybr(),V4)});var gRi=I(Xbr=>{"use strict";p();Object.defineProperty(Xbr,"__esModule",{value:!0});Xbr.Composite=lBa;var XLa=XT(),eBa=hD(),tBa=mD(),rBa=xv(),nBa=D5e(),iBa=vs();function oBa(t){let e=[];for(let r of t)e.push(...(0,tBa.KeyOfPropertyKeys)(r));return(0,nBa.SetDistinct)(e)}a(oBa,"CompositeKeys");function sBa(t){return t.filter(e=>!(0,iBa.IsNever)(e))}a(sBa,"FilterNever");function aBa(t,e){let r=[];for(let n of t)r.push(...(0,eBa.IndexFromPropertyKeys)(n,[e]));return sBa(r)}a(aBa,"CompositeProperty");function cBa(t,e){let r={};for(let n of e)r[n]=(0,XLa.IntersectEvaluated)(aBa(t,n));return r}a(cBa,"CompositeProperties");function lBa(t,e){let r=oBa(t),n=cBa(t,r);return(0,rBa.Object)(n,e)}a(lBa,"Composite")});var Hgt=I(Xte=>{"use strict";p();var uBa=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]})),dBa=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uBa(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});dBa(gRi(),Xte)});var ARi=I(e1r=>{"use strict";p();Object.defineProperty(e1r,"__esModule",{value:!0});e1r.Date=hBa;var fBa=Sn(),pBa=Ii();function hBa(t){return(0,pBa.CreateType)({[fBa.Kind]:"Date",type:"Date"},t)}a(hBa,"Date")});var G5e=I(ere=>{"use strict";p();var mBa=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]})),gBa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mBa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});gBa(ARi(),ere)});var yRi=I(t1r=>{"use strict";p();Object.defineProperty(t1r,"__esModule",{value:!0});t1r.Null=EBa;var ABa=Ii(),yBa=Sn();function EBa(t){return(0,ABa.CreateType)({[yBa.Kind]:"Null",type:"null"},t)}a(EBa,"Null")});var $5e=I(tre=>{"use strict";p();var _Ba=tre&&tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vBa=tre&&tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ba(e,t,r)};Object.defineProperty(tre,"__esModule",{value:!0});vBa(yRi(),tre)});var ERi=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.Symbol=SBa;var CBa=Ii(),bBa=Sn();function SBa(t){return(0,CBa.CreateType)({[bBa.Kind]:"Symbol",type:"symbol"},t)}a(SBa,"Symbol")});var V5e=I(rre=>{"use strict";p();var TBa=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]})),IBa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TBa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});IBa(ERi(),rre)});var _Ri=I(n1r=>{"use strict";p();Object.defineProperty(n1r,"__esModule",{value:!0});n1r.Undefined=RBa;var xBa=Ii(),wBa=Sn();function RBa(t){return(0,xBa.CreateType)({[wBa.Kind]:"Undefined",type:"undefined"},t)}a(RBa,"Undefined")});var W5e=I(nre=>{"use strict";p();var kBa=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]})),PBa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kBa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});PBa(_Ri(),nre)});var vRi=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.Uint8Array=MBa;var DBa=Ii(),NBa=Sn();function MBa(t){return(0,DBa.CreateType)({[NBa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(MBa,"Uint8Array")});var z5e=I(ire=>{"use strict";p();var OBa=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]})),LBa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OBa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});LBa(vRi(),ire)});var CRi=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.Unknown=UBa;var BBa=Ii(),FBa=Sn();function UBa(t){return(0,BBa.CreateType)({[FBa.Kind]:"Unknown"},t)}a(UBa,"Unknown")});var VG=I(ore=>{"use strict";p();var QBa=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]})),qBa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QBa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});qBa(CRi(),ore)});var TRi=I(l1r=>{"use strict";p();Object.defineProperty(l1r,"__esModule",{value:!0});l1r.Const=e3a;var bRi=Gge(),jBa=Jge(),HBa=G5e(),GBa=FG(),s1r=UE(),$Ba=$5e(),SRi=xv(),VBa=V5e(),WBa=s6(),a1r=HG(),zBa=W5e(),YBa=z5e(),KBa=VG(),JBa=t6(),Xb=Iv();function ZBa(t){return t.map(e=>c1r(e,!1))}a(ZBa,"FromArray");function XBa(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,a1r.Readonly)(c1r(t[r],!1));return e}a(XBa,"FromProperties");function Ggt(t,e){return e===!0?t:(0,a1r.Readonly)(t)}a(Ggt,"ConditionalReadonly");function c1r(t,e){return(0,Xb.IsAsyncIterator)(t)||(0,Xb.IsIterator)(t)?Ggt((0,bRi.Any)(),e):(0,Xb.IsArray)(t)?(0,a1r.Readonly)((0,WBa.Tuple)(ZBa(t))):(0,Xb.IsUint8Array)(t)?(0,YBa.Uint8Array)():(0,Xb.IsDate)(t)?(0,HBa.Date)():(0,Xb.IsObject)(t)?Ggt((0,SRi.Object)(XBa(t)),e):(0,Xb.IsFunction)(t)?Ggt((0,GBa.Function)([],(0,KBa.Unknown)()),e):(0,Xb.IsUndefined)(t)?(0,zBa.Undefined)():(0,Xb.IsNull)(t)?(0,$Ba.Null)():(0,Xb.IsSymbol)(t)?(0,VBa.Symbol)():(0,Xb.IsBigInt)(t)?(0,jBa.BigInt)():(0,Xb.IsNumber)(t)||(0,Xb.IsBoolean)(t)||(0,Xb.IsString)(t)?(0,s1r.Literal)(t):(0,SRi.Object)({})}a(c1r,"FromValue");function e3a(t,e){return(0,JBa.CreateType)(c1r(t,!0),e)}a(e3a,"Const")});var $gt=I(sre=>{"use strict";p();var t3a=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]})),r3a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t3a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});r3a(TRi(),sre)});var IRi=I(l6=>{"use strict";p();var n3a=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]})),i3a=l6&&l6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o3a=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;o{"use strict";p();var u3a=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]})),d3a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u3a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});d3a(IRi(),are)});var xRi=I(u1r=>{"use strict";p();Object.defineProperty(u1r,"__esModule",{value:!0});u1r.Enum=g3a;var f3a=UE(),p3a=Sn(),h3a=Ip(),m3a=Iv();function g3a(t,e){if((0,m3a.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,f3a.Literal)(s));return(0,h3a.Union)(o,{...e,[p3a.Hint]:"Enum"})}a(g3a,"Enum")});var Wgt=I(cre=>{"use strict";p();var A3a=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]})),y3a=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A3a(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});y3a(xRi(),cre)});var y1r=I(lre=>{"use strict";p();Object.defineProperty(lre,"__esModule",{value:!0});lre.ExtendsResult=lre.ExtendsResolverError=void 0;lre.ExtendsCheck=aFa;var wRi=Gge(),E3a=FG(),m1r=UG(),f1r=QG(),_3a=VG(),RRi=pD(),tAe=P5e(),MRi=Sn(),v3a=Nf(),tt=OCr(),zgt=class extends v3a.TypeBoxError{static{a(this,"ExtendsResolverError")}};lre.ExtendsResolverError=zgt;var Lt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Lt||(lre.ExtendsResult=Lt={}));function RR(t){return t===Lt.False?t:Lt.True}a(RR,"IntoBooleanResult");function rAe(t){throw new zgt(t)}a(rAe,"Throw");function Sm(t){return tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsIntersect(t)||tt.TypeGuard.IsUnion(t)||tt.TypeGuard.IsUnknown(t)||tt.TypeGuard.IsAny(t)}a(Sm,"IsStructuralRight");function Tm(t,e){return tt.TypeGuard.IsNever(e)?BRi(t,e):tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsUnknown(e)?qRi(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):rAe("StructuralRight")}a(Tm,"StructuralRight");function g1r(t,e){return Lt.True}a(g1r,"FromAnyRight");function C3a(t,e){return tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>tt.TypeGuard.IsAny(r)||tt.TypeGuard.IsUnknown(r))?Lt.True:tt.TypeGuard.IsUnion(e)?Lt.Union:tt.TypeGuard.IsUnknown(e)||tt.TypeGuard.IsAny(e)?Lt.True:Lt.Union}a(C3a,"FromAny");function b3a(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)?Lt.True:Lt.False}a(b3a,"FromArrayRight");function S3a(t,e){return tt.TypeGuard.IsObject(e)&&Kgt(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsArray(e)?RR(hl(t.items,e.items)):Lt.False}a(S3a,"FromArray");function T3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsAsyncIterator(e)?RR(hl(t.items,e.items)):Lt.False}a(T3a,"FromAsyncIterator");function I3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsBigInt(e)?Lt.True:Lt.False}a(I3a,"FromBigInt");function ORi(t,e){return tt.TypeGuard.IsLiteralBoolean(t)||tt.TypeGuard.IsBoolean(t)?Lt.True:Lt.False}a(ORi,"FromBooleanRight");function x3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsBoolean(e)?Lt.True:Lt.False}a(x3a,"FromBoolean");function w3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>RR(hl(e.parameters[n],r))===Lt.True)?RR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(w3a,"FromConstructor");function R3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsDate(e)?Lt.True:Lt.False}a(R3a,"FromDate");function k3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>RR(hl(e.parameters[n],r))===Lt.True)?RR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(k3a,"FromFunction");function LRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsNumber(t.const)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(LRi,"FromIntegerRight");function P3a(t,e){return tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):Lt.False}a(P3a,"FromInteger");function Ygt(t,e){return e.allOf.every(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(Ygt,"FromIntersectRight");function D3a(t,e){return t.allOf.some(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(D3a,"FromIntersect");function N3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsIterator(e)?RR(hl(t.items,e.items)):Lt.False}a(N3a,"FromIterator");function M3a(t,e){return tt.TypeGuard.IsLiteral(e)&&e.const===t.const?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsString(e)?QRi(t,e):tt.TypeGuard.IsNumber(e)?FRi(t,e):tt.TypeGuard.IsInteger(e)?LRi(t,e):tt.TypeGuard.IsBoolean(e)?ORi(t,e):Lt.False}a(M3a,"FromLiteral");function BRi(t,e){return Lt.False}a(BRi,"FromNeverRight");function O3a(t,e){return Lt.True}a(O3a,"FromNever");function kRi(t){let[e,r]=[t,0];for(;tt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,_3a.Unknown)()}a(kRi,"UnwrapTNot");function L3a(t,e){return tt.TypeGuard.IsNot(t)?hl(kRi(t),e):tt.TypeGuard.IsNot(e)?hl(t,kRi(e)):rAe("Invalid fallthrough for Not")}a(L3a,"FromNot");function B3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsNull(e)?Lt.True:Lt.False}a(B3a,"FromNull");function FRi(t,e){return tt.TypeGuard.IsLiteralNumber(t)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(FRi,"FromNumberRight");function F3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Lt.False}a(F3a,"FromNumber");function e1(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(e1,"IsObjectPropertyCount");function PRi(t){return Kgt(t)}a(PRi,"IsObjectStringLike");function DRi(t){return e1(t,0)||e1(t,1)&&"description"in t.properties&&tt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(tt.TypeGuard.IsString(t.properties.description.anyOf[0])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||tt.TypeGuard.IsString(t.properties.description.anyOf[1])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(DRi,"IsObjectSymbolLike");function d1r(t){return e1(t,0)}a(d1r,"IsObjectNumberLike");function NRi(t){return e1(t,0)}a(NRi,"IsObjectBooleanLike");function U3a(t){return e1(t,0)}a(U3a,"IsObjectBigIntLike");function Q3a(t){return e1(t,0)}a(Q3a,"IsObjectDateLike");function q3a(t){return Kgt(t)}a(q3a,"IsObjectUint8ArrayLike");function j3a(t){let e=(0,m1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&RR(hl(t.properties.length,e))===Lt.True}a(j3a,"IsObjectFunctionLike");function H3a(t){return e1(t,0)}a(H3a,"IsObjectConstructorLike");function Kgt(t){let e=(0,m1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&RR(hl(t.properties.length,e))===Lt.True}a(Kgt,"IsObjectArrayLike");function G3a(t){let e=(0,E3a.Function)([(0,wRi.Any)()],(0,wRi.Any)());return e1(t,0)||e1(t,1)&&"then"in t.properties&&RR(hl(t.properties.then,e))===Lt.True}a(G3a,"IsObjectPromiseLike");function URi(t,e){return hl(t,e)===Lt.False||tt.TypeGuard.IsOptional(t)&&!tt.TypeGuard.IsOptional(e)?Lt.False:Lt.True}a(URi,"Property");function QE(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsLiteralString(t)&&PRi(e)||tt.TypeGuard.IsLiteralNumber(t)&&d1r(e)||tt.TypeGuard.IsLiteralBoolean(t)&&NRi(e)||tt.TypeGuard.IsSymbol(t)&&DRi(e)||tt.TypeGuard.IsBigInt(t)&&U3a(e)||tt.TypeGuard.IsString(t)&&PRi(e)||tt.TypeGuard.IsSymbol(t)&&DRi(e)||tt.TypeGuard.IsNumber(t)&&d1r(e)||tt.TypeGuard.IsInteger(t)&&d1r(e)||tt.TypeGuard.IsBoolean(t)&&NRi(e)||tt.TypeGuard.IsUint8Array(t)&&q3a(e)||tt.TypeGuard.IsDate(t)&&Q3a(e)||tt.TypeGuard.IsConstructor(t)&&H3a(e)||tt.TypeGuard.IsFunction(t)&&j3a(e)?Lt.True:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsString(p1r(t))?e[MRi.Hint]==="Record"?Lt.True:Lt.False:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsNumber(p1r(t))&&e1(e,0)?Lt.True:Lt.False}a(QE,"FromObjectRight");function $3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!tt.TypeGuard.IsOptional(e.properties[r]))return Lt.False;if(tt.TypeGuard.IsOptional(e.properties[r]))return Lt.True;if(URi(t.properties[r],e.properties[r])===Lt.False)return Lt.False}return Lt.True})():Lt.False}a($3a,"FromObject");function V3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&G3a(e)?Lt.True:tt.TypeGuard.IsPromise(e)?RR(hl(t.item,e.item)):Lt.False}a(V3a,"FromPromise");function p1r(t){return tAe.PatternNumberExact in t.patternProperties?(0,m1r.Number)():tAe.PatternStringExact in t.patternProperties?(0,f1r.String)():rAe("Unknown record key pattern")}a(p1r,"RecordKey");function h1r(t){return tAe.PatternNumberExact in t.patternProperties?t.patternProperties[tAe.PatternNumberExact]:tAe.PatternStringExact in t.patternProperties?t.patternProperties[tAe.PatternStringExact]:rAe("Unable to get record value schema")}a(h1r,"RecordValue");function kR(t,e){let[r,n]=[p1r(e),h1r(e)];return tt.TypeGuard.IsLiteralString(t)&&tt.TypeGuard.IsNumber(r)&&RR(hl(t,n))===Lt.True?Lt.True:tt.TypeGuard.IsUint8Array(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsString(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsArray(t)&&tt.TypeGuard.IsNumber(r)?hl(t,n):tt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(URi(n,t.properties[o])===Lt.False)return Lt.False;return Lt.True})():Lt.False}a(kR,"FromRecordRight");function W3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?hl(h1r(t),h1r(e)):Lt.False}a(W3a,"FromRecord");function z3a(t,e){let r=tt.TypeGuard.IsRegExp(t)?(0,f1r.String)():t,n=tt.TypeGuard.IsRegExp(e)?(0,f1r.String)():e;return hl(r,n)}a(z3a,"FromRegExp");function QRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsString(t.const)||tt.TypeGuard.IsString(t)?Lt.True:Lt.False}a(QRi,"FromStringRight");function Y3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsString(e)?Lt.True:Lt.False}a(Y3a,"FromString");function K3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsSymbol(e)?Lt.True:Lt.False}a(K3a,"FromSymbol");function J3a(t,e){return tt.TypeGuard.IsTemplateLiteral(t)?hl((0,RRi.TemplateLiteralToUnion)(t),e):tt.TypeGuard.IsTemplateLiteral(e)?hl(t,(0,RRi.TemplateLiteralToUnion)(e)):rAe("Invalid fallthrough for TemplateLiteral")}a(J3a,"FromTemplateLiteral");function Z3a(t,e){return tt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>hl(r,e.items)===Lt.True)}a(Z3a,"IsArrayOfTuple");function X3a(t,e){return tt.TypeGuard.IsNever(t)?Lt.True:tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:Lt.False}a(X3a,"FromTupleRight");function eFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&Kgt(e)||tt.TypeGuard.IsArray(e)&&Z3a(t,e)?Lt.True:tt.TypeGuard.IsTuple(e)?tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||!tt.ValueGuard.IsUndefined(t.items)&&tt.ValueGuard.IsUndefined(e.items)?Lt.False:tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>hl(r,e.items[n])===Lt.True)?Lt.True:Lt.False:Lt.False}a(eFa,"FromTuple");function tFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsUint8Array(e)?Lt.True:Lt.False}a(tFa,"FromUint8Array");function rFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsVoid(e)?oFa(t,e):tt.TypeGuard.IsUndefined(e)?Lt.True:Lt.False}a(rFa,"FromUndefined");function A1r(t,e){return e.anyOf.some(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(A1r,"FromUnionRight");function nFa(t,e){return t.anyOf.every(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(nFa,"FromUnion");function qRi(t,e){return Lt.True}a(qRi,"FromUnknownRight");function iFa(t,e){return tt.TypeGuard.IsNever(e)?BRi(t,e):tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):tt.TypeGuard.IsString(e)?QRi(t,e):tt.TypeGuard.IsNumber(e)?FRi(t,e):tt.TypeGuard.IsInteger(e)?LRi(t,e):tt.TypeGuard.IsBoolean(e)?ORi(t,e):tt.TypeGuard.IsArray(e)?b3a(t,e):tt.TypeGuard.IsTuple(e)?X3a(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsUnknown(e)?Lt.True:Lt.False}a(iFa,"FromUnknown");function oFa(t,e){return tt.TypeGuard.IsUndefined(t)||tt.TypeGuard.IsUndefined(t)?Lt.True:Lt.False}a(oFa,"FromVoidRight");function sFa(t,e){return tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsUnknown(e)?qRi(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsVoid(e)?Lt.True:Lt.False}a(sFa,"FromVoid");function hl(t,e){return tt.TypeGuard.IsTemplateLiteral(t)||tt.TypeGuard.IsTemplateLiteral(e)?J3a(t,e):tt.TypeGuard.IsRegExp(t)||tt.TypeGuard.IsRegExp(e)?z3a(t,e):tt.TypeGuard.IsNot(t)||tt.TypeGuard.IsNot(e)?L3a(t,e):tt.TypeGuard.IsAny(t)?C3a(t,e):tt.TypeGuard.IsArray(t)?S3a(t,e):tt.TypeGuard.IsBigInt(t)?I3a(t,e):tt.TypeGuard.IsBoolean(t)?x3a(t,e):tt.TypeGuard.IsAsyncIterator(t)?T3a(t,e):tt.TypeGuard.IsConstructor(t)?w3a(t,e):tt.TypeGuard.IsDate(t)?R3a(t,e):tt.TypeGuard.IsFunction(t)?k3a(t,e):tt.TypeGuard.IsInteger(t)?P3a(t,e):tt.TypeGuard.IsIntersect(t)?D3a(t,e):tt.TypeGuard.IsIterator(t)?N3a(t,e):tt.TypeGuard.IsLiteral(t)?M3a(t,e):tt.TypeGuard.IsNever(t)?O3a(t,e):tt.TypeGuard.IsNull(t)?B3a(t,e):tt.TypeGuard.IsNumber(t)?F3a(t,e):tt.TypeGuard.IsObject(t)?$3a(t,e):tt.TypeGuard.IsRecord(t)?W3a(t,e):tt.TypeGuard.IsString(t)?Y3a(t,e):tt.TypeGuard.IsSymbol(t)?K3a(t,e):tt.TypeGuard.IsTuple(t)?eFa(t,e):tt.TypeGuard.IsPromise(t)?V3a(t,e):tt.TypeGuard.IsUint8Array(t)?tFa(t,e):tt.TypeGuard.IsUndefined(t)?rFa(t,e):tt.TypeGuard.IsUnion(t)?nFa(t,e):tt.TypeGuard.IsUnknown(t)?iFa(t,e):tt.TypeGuard.IsVoid(t)?sFa(t,e):rAe(`Unknown left type operand '${t[MRi.Kind]}'`)}a(hl,"Visit");function aFa(t,e){return hl(t,e)}a(aFa,"ExtendsCheck")});var _1r=I(E1r=>{"use strict";p();Object.defineProperty(E1r,"__esModule",{value:!0});E1r.ExtendsFromMappedResult=pFa;var cFa=bm(),lFa=Jgt(),uFa=Yb();function dFa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,lFa.Extends)(t[c],e,r,n,(0,uFa.Clone)(o));return s}a(dFa,"FromProperties");function fFa(t,e,r,n,o){return dFa(t.properties,e,r,n,o)}a(fFa,"FromMappedResult");function pFa(t,e,r,n,o){let s=fFa(t,e,r,n,o);return(0,cFa.MappedResult)(s)}a(pFa,"ExtendsFromMappedResult")});var Jgt=I(C1r=>{"use strict";p();Object.defineProperty(C1r,"__esModule",{value:!0});C1r.Extends=yFa;var jRi=Ii(),hFa=Ip(),v1r=y1r(),mFa=b1r(),gFa=_1r(),HRi=vs();function AFa(t,e,r,n){let o=(0,v1r.ExtendsCheck)(t,e);return o===v1r.ExtendsResult.Union?(0,hFa.Union)([r,n]):o===v1r.ExtendsResult.True?r:n}a(AFa,"ExtendsResolve");function yFa(t,e,r,n,o){return(0,HRi.IsMappedResult)(t)?(0,gFa.ExtendsFromMappedResult)(t,e,r,n,o):(0,HRi.IsMappedKey)(t)?(0,jRi.CreateType)((0,mFa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,jRi.CreateType)(AFa(t,e,r,n),o)}a(yFa,"Extends")});var b1r=I(S1r=>{"use strict";p();Object.defineProperty(S1r,"__esModule",{value:!0});S1r.ExtendsFromMappedKey=IFa;var EFa=bm(),_Fa=UE(),vFa=Jgt(),CFa=Yb();function bFa(t,e,r,n,o){return{[t]:(0,vFa.Extends)((0,_Fa.Literal)(t),e,r,n,(0,CFa.Clone)(o))}}a(bFa,"FromPropertyKey");function SFa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...bFa(c,e,r,n,o)}),{})}a(SFa,"FromPropertyKeys");function TFa(t,e,r,n,o){return SFa(t.keys,e,r,n,o)}a(TFa,"FromMappedKey");function IFa(t,e,r,n,o){let s=TFa(t,e,r,n,o);return(0,EFa.MappedResult)(s)}a(IFa,"ExtendsFromMappedKey")});var I1r=I(T1r=>{"use strict";p();Object.defineProperty(T1r,"__esModule",{value:!0});T1r.ExtendsUndefinedCheck=Xgt;var Zgt=Sn();function xFa(t){return t.allOf.every(e=>Xgt(e))}a(xFa,"Intersect");function wFa(t){return t.anyOf.some(e=>Xgt(e))}a(wFa,"Union");function RFa(t){return!Xgt(t.not)}a(RFa,"Not");function Xgt(t){return t[Zgt.Kind]==="Intersect"?xFa(t):t[Zgt.Kind]==="Union"?wFa(t):t[Zgt.Kind]==="Not"?RFa(t):t[Zgt.Kind]==="Undefined"}a(Xgt,"ExtendsUndefinedCheck")});var ure=I(gD=>{"use strict";p();var kFa=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]})),Y5e=gD&&gD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kFa(e,t,r)};Object.defineProperty(gD,"__esModule",{value:!0});Y5e(y1r(),gD);Y5e(b1r(),gD);Y5e(_1r(),gD);Y5e(I1r(),gD);Y5e(Jgt(),gD)});var w1r=I(x1r=>{"use strict";p();Object.defineProperty(x1r,"__esModule",{value:!0});x1r.ExcludeFromTemplateLiteral=NFa;var PFa=eAt(),DFa=pD();function NFa(t,e){return(0,PFa.Exclude)((0,DFa.TemplateLiteralToUnion)(t),e)}a(NFa,"ExcludeFromTemplateLiteral")});var eAt=I(P1r=>{"use strict";p();Object.defineProperty(P1r,"__esModule",{value:!0});P1r.Exclude=UFa;var R1r=Ii(),MFa=Ip(),OFa=Cm(),tAt=ure(),LFa=D1r(),BFa=w1r(),k1r=vs();function FFa(t,e){let r=t.filter(n=>(0,tAt.ExtendsCheck)(n,e)===tAt.ExtendsResult.False);return r.length===1?r[0]:(0,MFa.Union)(r)}a(FFa,"ExcludeRest");function UFa(t,e,r={}){return(0,k1r.IsTemplateLiteral)(t)?(0,R1r.CreateType)((0,BFa.ExcludeFromTemplateLiteral)(t,e),r):(0,k1r.IsMappedResult)(t)?(0,R1r.CreateType)((0,LFa.ExcludeFromMappedResult)(t,e),r):(0,R1r.CreateType)((0,k1r.IsUnion)(t)?FFa(t.anyOf,e):(0,tAt.ExtendsCheck)(t,e)!==tAt.ExtendsResult.False?(0,OFa.Never)():t,r)}a(UFa,"Exclude")});var D1r=I(N1r=>{"use strict";p();Object.defineProperty(N1r,"__esModule",{value:!0});N1r.ExcludeFromMappedResult=GFa;var QFa=bm(),qFa=eAt();function jFa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,qFa.Exclude)(t[n],e);return r}a(jFa,"FromProperties");function HFa(t,e){return jFa(t.properties,e)}a(HFa,"FromMappedResult");function GFa(t,e){let r=HFa(t,e);return(0,QFa.MappedResult)(r)}a(GFa,"ExcludeFromMappedResult")});var rAt=I(u6=>{"use strict";p();var $Fa=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]})),M1r=u6&&u6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Fa(e,t,r)};Object.defineProperty(u6,"__esModule",{value:!0});M1r(D1r(),u6);M1r(w1r(),u6);M1r(eAt(),u6)});var L1r=I(O1r=>{"use strict";p();Object.defineProperty(O1r,"__esModule",{value:!0});O1r.ExtractFromTemplateLiteral=zFa;var VFa=nAt(),WFa=pD();function zFa(t,e){return(0,VFa.Extract)((0,WFa.TemplateLiteralToUnion)(t),e)}a(zFa,"ExtractFromTemplateLiteral")});var nAt=I(U1r=>{"use strict";p();Object.defineProperty(U1r,"__esModule",{value:!0});U1r.Extract=e8a;var B1r=Ii(),YFa=Ip(),KFa=Cm(),iAt=ure(),JFa=Q1r(),ZFa=L1r(),F1r=vs();function XFa(t,e){let r=t.filter(n=>(0,iAt.ExtendsCheck)(n,e)!==iAt.ExtendsResult.False);return r.length===1?r[0]:(0,YFa.Union)(r)}a(XFa,"ExtractRest");function e8a(t,e,r){return(0,F1r.IsTemplateLiteral)(t)?(0,B1r.CreateType)((0,ZFa.ExtractFromTemplateLiteral)(t,e),r):(0,F1r.IsMappedResult)(t)?(0,B1r.CreateType)((0,JFa.ExtractFromMappedResult)(t,e),r):(0,B1r.CreateType)((0,F1r.IsUnion)(t)?XFa(t.anyOf,e):(0,iAt.ExtendsCheck)(t,e)!==iAt.ExtendsResult.False?t:(0,KFa.Never)(),r)}a(e8a,"Extract")});var Q1r=I(q1r=>{"use strict";p();Object.defineProperty(q1r,"__esModule",{value:!0});q1r.ExtractFromMappedResult=o8a;var t8a=bm(),r8a=nAt();function n8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,r8a.Extract)(t[n],e);return r}a(n8a,"FromProperties");function i8a(t,e){return n8a(t.properties,e)}a(i8a,"FromMappedResult");function o8a(t,e){let r=i8a(t,e);return(0,t8a.MappedResult)(r)}a(o8a,"ExtractFromMappedResult")});var oAt=I(d6=>{"use strict";p();var s8a=d6&&d6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j1r=d6&&d6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s8a(e,t,r)};Object.defineProperty(d6,"__esModule",{value:!0});j1r(Q1r(),d6);j1r(L1r(),d6);j1r(nAt(),d6)});var GRi=I(f6=>{"use strict";p();var a8a=f6&&f6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c8a=f6&&f6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l8a=f6&&f6.__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 h8a=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]})),m8a=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h8a(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});m8a(GRi(),dre)});var $Ri=I(H1r=>{"use strict";p();Object.defineProperty(H1r,"__esModule",{value:!0});H1r.ReadonlyOptional=y8a;var g8a=HG(),A8a=G4();function y8a(t){return(0,g8a.Readonly)((0,A8a.Optional)(t))}a(y8a,"ReadonlyOptional")});var K5e=I(fre=>{"use strict";p();var E8a=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]})),_8a=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E8a(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});_8a($Ri(),fre)});var KRi=I(nAe=>{"use strict";p();Object.defineProperty(nAe,"__esModule",{value:!0});nAe.Record=B8a;nAe.RecordPattern=$1r;nAe.RecordKey=F8a;nAe.RecordValue=U8a;var v8a=Ii(),WRi=Sn(),C8a=Cm(),b8a=UG(),zRi=xv(),VRi=QG(),S8a=Ip(),T8a=pD(),pre=P5e(),YRi=hD(),I8a=Iv(),W4=vs();function hre(t,e,r){return(0,v8a.CreateType)({[WRi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(hre,"RecordCreateFromPattern");function G1r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,zRi.Object)(n,{...r,[WRi.Hint]:"Record"})}a(G1r,"RecordCreateFromKeys");function x8a(t,e,r){return(0,T8a.IsTemplateLiteralFinite)(t)?G1r((0,YRi.IndexPropertyKeys)(t),e,r):hre(t.pattern,e,r)}a(x8a,"FromTemplateLiteralKey");function w8a(t,e,r){return G1r((0,YRi.IndexPropertyKeys)((0,S8a.Union)(t)),e,r)}a(w8a,"FromUnionKey");function R8a(t,e,r){return G1r([t.toString()],e,r)}a(R8a,"FromLiteralKey");function k8a(t,e,r){return hre(t.source,e,r)}a(k8a,"FromRegExpKey");function P8a(t,e,r){let n=(0,I8a.IsUndefined)(t.pattern)?pre.PatternStringExact:t.pattern;return hre(n,e,r)}a(P8a,"FromStringKey");function D8a(t,e,r){return hre(pre.PatternStringExact,e,r)}a(D8a,"FromAnyKey");function N8a(t,e,r){return hre(pre.PatternNeverExact,e,r)}a(N8a,"FromNeverKey");function M8a(t,e,r){return(0,zRi.Object)({true:e,false:e},r)}a(M8a,"FromBooleanKey");function O8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(O8a,"FromIntegerKey");function L8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(L8a,"FromNumberKey");function B8a(t,e,r={}){return(0,W4.IsUnion)(t)?w8a(t.anyOf,e,r):(0,W4.IsTemplateLiteral)(t)?x8a(t,e,r):(0,W4.IsLiteral)(t)?R8a(t.const,e,r):(0,W4.IsBoolean)(t)?M8a(t,e,r):(0,W4.IsInteger)(t)?O8a(t,e,r):(0,W4.IsNumber)(t)?L8a(t,e,r):(0,W4.IsRegExp)(t)?k8a(t,e,r):(0,W4.IsString)(t)?P8a(t,e,r):(0,W4.IsAny)(t)?D8a(t,e,r):(0,W4.IsNever)(t)?N8a(t,e,r):(0,C8a.Never)(r)}a(B8a,"Record");function $1r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a($1r,"RecordPattern");function F8a(t){let e=$1r(t);return e===pre.PatternStringExact?(0,VRi.String)():e===pre.PatternNumberExact?(0,b8a.Number)():(0,VRi.String)({pattern:e})}a(F8a,"RecordKey");function U8a(t){return t.patternProperties[$1r(t)]}a(U8a,"RecordValue")});var iAe=I(mre=>{"use strict";p();var Q8a=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]})),q8a=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q8a(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});q8a(KRi(),mre)});var ZRi=I(z4=>{"use strict";p();var j8a=z4&&z4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H8a=z4&&z4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JRi=z4&&z4.__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]:l6a(t,e[n])}),{})}a(u6a,"FromProperties");function oAe(t,e){return e.map(r=>AD(t,r))}a(oAe,"FromTypes");function AD(t,e){return t1.IsConstructor(e)?J8a(t,e):t1.IsFunction(e)?Z8a(t,e):t1.IsIntersect(e)?X8a(t,e):t1.IsUnion(e)?e6a(t,e):t1.IsTuple(e)?t6a(t,e):t1.IsArray(e)?r6a(t,e):t1.IsAsyncIterator(e)?n6a(t,e):t1.IsIterator(e)?i6a(t,e):t1.IsPromise(e)?o6a(t,e):t1.IsObject(e)?s6a(t,e):t1.IsRecord(e)?a6a(t,e):t1.IsArgument(e)?c6a(t,e):e}a(AD,"FromType");function d6a(t,e){return AD(e,(0,G8a.CloneType)(t))}a(d6a,"Instantiate")});var aAt=I(gre=>{"use strict";p();var f6a=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]})),p6a=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f6a(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});p6a(ZRi(),gre)});var XRi=I(W1r=>{"use strict";p();Object.defineProperty(W1r,"__esModule",{value:!0});W1r.Integer=g6a;var h6a=Ii(),m6a=Sn();function g6a(t){return(0,h6a.CreateType)({[m6a.Kind]:"Integer",type:"integer"},t)}a(g6a,"Integer")});var cAt=I(Are=>{"use strict";p();var A6a=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]})),y6a=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A6a(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});y6a(XRi(),Are)});var Y1r=I(z1r=>{"use strict";p();Object.defineProperty(z1r,"__esModule",{value:!0});z1r.IntrinsicFromMappedKey=I6a;var E6a=bm(),_6a=yre(),v6a=UE(),C6a=Yb();function b6a(t,e,r){return{[t]:(0,_6a.Intrinsic)((0,v6a.Literal)(t),e,(0,C6a.Clone)(r))}}a(b6a,"MappedIntrinsicPropertyKey");function S6a(t,e,r){return t.reduce((o,s)=>({...o,...b6a(s,e,r)}),{})}a(S6a,"MappedIntrinsicPropertyKeys");function T6a(t,e,r){return S6a(t.keys,e,r)}a(T6a,"MappedIntrinsicProperties");function I6a(t,e,r){let n=T6a(t,e,r);return(0,E6a.MappedResult)(n)}a(I6a,"IntrinsicFromMappedKey")});var yre=I(K1r=>{"use strict";p();Object.defineProperty(K1r,"__esModule",{value:!0});K1r.Intrinsic=iki;var x6a=Ii(),lAt=pD(),w6a=Y1r(),eki=UE(),tki=Ip(),uAt=vs();function R6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(R6a,"ApplyUncapitalize");function k6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(k6a,"ApplyCapitalize");function P6a(t){return t.toUpperCase()}a(P6a,"ApplyUppercase");function D6a(t){return t.toLowerCase()}a(D6a,"ApplyLowercase");function N6a(t,e,r){let n=(0,lAt.TemplateLiteralParseExact)(t.pattern);if(!(0,lAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:rki(t.pattern,e)};let c=[...(0,lAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,eki.Literal)(d)),l=nki(c,e),u=(0,tki.Union)(l);return(0,lAt.TemplateLiteral)([u],r)}a(N6a,"FromTemplateLiteral");function rki(t,e){return typeof t=="string"?e==="Uncapitalize"?R6a(t):e==="Capitalize"?k6a(t):e==="Uppercase"?P6a(t):e==="Lowercase"?D6a(t):t:t.toString()}a(rki,"FromLiteralValue");function nki(t,e){return t.map(r=>iki(r,e))}a(nki,"FromRest");function iki(t,e,r={}){return(0,uAt.IsMappedKey)(t)?(0,w6a.IntrinsicFromMappedKey)(t,e,r):(0,uAt.IsTemplateLiteral)(t)?N6a(t,e,r):(0,uAt.IsUnion)(t)?(0,tki.Union)(nki(t.anyOf,e),r):(0,uAt.IsLiteral)(t)?(0,eki.Literal)(rki(t.const,e),r):(0,x6a.CreateType)(t,r)}a(iki,"Intrinsic")});var oki=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Capitalize=O6a;var M6a=yre();function O6a(t,e={}){return(0,M6a.Intrinsic)(t,"Capitalize",e)}a(O6a,"Capitalize")});var ski=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.Lowercase=B6a;var L6a=yre();function B6a(t,e={}){return(0,L6a.Intrinsic)(t,"Lowercase",e)}a(B6a,"Lowercase")});var aki=I(X1r=>{"use strict";p();Object.defineProperty(X1r,"__esModule",{value:!0});X1r.Uncapitalize=U6a;var F6a=yre();function U6a(t,e={}){return(0,F6a.Intrinsic)(t,"Uncapitalize",e)}a(U6a,"Uncapitalize")});var cki=I(eSr=>{"use strict";p();Object.defineProperty(eSr,"__esModule",{value:!0});eSr.Uppercase=q6a;var Q6a=yre();function q6a(t,e={}){return(0,Q6a.Intrinsic)(t,"Uppercase",e)}a(q6a,"Uppercase")});var dAt=I(PR=>{"use strict";p();var j6a=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]})),sAe=PR&&PR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j6a(e,t,r)};Object.defineProperty(PR,"__esModule",{value:!0});sAe(oki(),PR);sAe(Y1r(),PR);sAe(yre(),PR);sAe(ski(),PR);sAe(aki(),PR);sAe(cki(),PR)});var rSr=I(tSr=>{"use strict";p();Object.defineProperty(tSr,"__esModule",{value:!0});tSr.OmitFromMappedResult=z6a;var H6a=bm(),G6a=fAt(),$6a=Yb();function V6a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,G6a.Omit)(t[o],e,(0,$6a.Clone)(r));return n}a(V6a,"FromProperties");function W6a(t,e,r){return V6a(t.properties,e,r)}a(W6a,"FromMappedResult");function z6a(t,e,r){let n=W6a(t,e,r);return(0,H6a.MappedResult)(n)}a(z6a,"OmitFromMappedResult")});var fAt=I(oSr=>{"use strict";p();Object.defineProperty(oSr,"__esModule",{value:!0});oSr.Omit=u9a;var Y6a=Ii(),K6a=Igt(),J6a=x5e(),nSr=BG(),Z6a=UE(),X6a=hD(),e9a=XT(),lki=Ip(),uki=xv(),t9a=sSr(),r9a=rSr(),p6=vs(),n9a=Iv();function i9a(t,e){return t.map(r=>iSr(r,e))}a(i9a,"FromIntersect");function o9a(t,e){return t.map(r=>iSr(r,e))}a(o9a,"FromUnion");function s9a(t,e){let{[e]:r,...n}=t;return n}a(s9a,"FromProperty");function a9a(t,e){return e.reduce((r,n)=>s9a(r,n),t)}a(a9a,"FromProperties");function c9a(t,e,r){let n=(0,K6a.Discard)(t,[J6a.TransformKind,"$id","required","properties"]),o=a9a(r,e);return(0,uki.Object)(o,n)}a(c9a,"FromObject");function l9a(t){let e=t.reduce((r,n)=>(0,p6.IsLiteralValue)(n)?[...r,(0,Z6a.Literal)(n)]:r,[]);return(0,lki.Union)(e)}a(l9a,"UnionFromPropertyKeys");function iSr(t,e){return(0,p6.IsIntersect)(t)?(0,e9a.Intersect)(i9a(t.allOf,e)):(0,p6.IsUnion)(t)?(0,lki.Union)(o9a(t.anyOf,e)):(0,p6.IsObject)(t)?c9a(t,e,t.properties):(0,uki.Object)({})}a(iSr,"OmitResolve");function u9a(t,e,r){let n=(0,n9a.IsArray)(e)?l9a(e):e,o=(0,p6.IsSchema)(e)?(0,X6a.IndexPropertyKeys)(e):e,s=(0,p6.IsRef)(t),c=(0,p6.IsRef)(e);return(0,p6.IsMappedResult)(t)?(0,r9a.OmitFromMappedResult)(t,o,r):(0,p6.IsMappedKey)(e)?(0,t9a.OmitFromMappedKey)(t,e,r):s&&c?(0,nSr.Computed)("Omit",[t,n],r):!s&&c?(0,nSr.Computed)("Omit",[t,n],r):s&&!c?(0,nSr.Computed)("Omit",[t,n],r):(0,Y6a.CreateType)({...iSr(t,o),...r})}a(u9a,"Omit")});var sSr=I(aSr=>{"use strict";p();Object.defineProperty(aSr,"__esModule",{value:!0});aSr.OmitFromMappedKey=A9a;var d9a=bm(),f9a=fAt(),p9a=Yb();function h9a(t,e,r){return{[e]:(0,f9a.Omit)(t,[e],(0,p9a.Clone)(r))}}a(h9a,"FromPropertyKey");function m9a(t,e,r){return e.reduce((n,o)=>({...n,...h9a(t,o,r)}),{})}a(m9a,"FromPropertyKeys");function g9a(t,e,r){return m9a(t,e.keys,r)}a(g9a,"FromMappedKey");function A9a(t,e,r){let n=g9a(t,e,r);return(0,d9a.MappedResult)(n)}a(A9a,"OmitFromMappedKey")});var J5e=I(h6=>{"use strict";p();var y9a=h6&&h6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cSr=h6&&h6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y9a(e,t,r)};Object.defineProperty(h6,"__esModule",{value:!0});cSr(sSr(),h6);cSr(rSr(),h6);cSr(fAt(),h6)});var uSr=I(lSr=>{"use strict";p();Object.defineProperty(lSr,"__esModule",{value:!0});lSr.PickFromMappedResult=S9a;var E9a=bm(),_9a=pAt(),v9a=Yb();function C9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,_9a.Pick)(t[o],e,(0,v9a.Clone)(r));return n}a(C9a,"FromProperties");function b9a(t,e,r){return C9a(t.properties,e,r)}a(b9a,"FromMappedResult");function S9a(t,e,r){let n=b9a(t,e,r);return(0,E9a.MappedResult)(n)}a(S9a,"PickFromMappedResult")});var pAt=I(pSr=>{"use strict";p();Object.defineProperty(pSr,"__esModule",{value:!0});pSr.Pick=U9a;var T9a=Ii(),I9a=Igt(),dSr=BG(),x9a=XT(),w9a=UE(),dki=xv(),fki=Ip(),R9a=hD(),k9a=x5e(),m6=vs(),P9a=Iv(),D9a=hSr(),N9a=uSr();function M9a(t,e){return t.map(r=>fSr(r,e))}a(M9a,"FromIntersect");function O9a(t,e){return t.map(r=>fSr(r,e))}a(O9a,"FromUnion");function L9a(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(L9a,"FromProperties");function B9a(t,e,r){let n=(0,I9a.Discard)(t,[k9a.TransformKind,"$id","required","properties"]),o=L9a(r,e);return(0,dki.Object)(o,n)}a(B9a,"FromObject");function F9a(t){let e=t.reduce((r,n)=>(0,m6.IsLiteralValue)(n)?[...r,(0,w9a.Literal)(n)]:r,[]);return(0,fki.Union)(e)}a(F9a,"UnionFromPropertyKeys");function fSr(t,e){return(0,m6.IsIntersect)(t)?(0,x9a.Intersect)(M9a(t.allOf,e)):(0,m6.IsUnion)(t)?(0,fki.Union)(O9a(t.anyOf,e)):(0,m6.IsObject)(t)?B9a(t,e,t.properties):(0,dki.Object)({})}a(fSr,"PickResolve");function U9a(t,e,r){let n=(0,P9a.IsArray)(e)?F9a(e):e,o=(0,m6.IsSchema)(e)?(0,R9a.IndexPropertyKeys)(e):e,s=(0,m6.IsRef)(t),c=(0,m6.IsRef)(e);return(0,m6.IsMappedResult)(t)?(0,N9a.PickFromMappedResult)(t,o,r):(0,m6.IsMappedKey)(e)?(0,D9a.PickFromMappedKey)(t,e,r):s&&c?(0,dSr.Computed)("Pick",[t,n],r):!s&&c?(0,dSr.Computed)("Pick",[t,n],r):s&&!c?(0,dSr.Computed)("Pick",[t,n],r):(0,T9a.CreateType)({...fSr(t,o),...r})}a(U9a,"Pick")});var hSr=I(mSr=>{"use strict";p();Object.defineProperty(mSr,"__esModule",{value:!0});mSr.PickFromMappedKey=V9a;var Q9a=bm(),q9a=pAt(),j9a=Yb();function H9a(t,e,r){return{[e]:(0,q9a.Pick)(t,[e],(0,j9a.Clone)(r))}}a(H9a,"FromPropertyKey");function G9a(t,e,r){return e.reduce((n,o)=>({...n,...H9a(t,o,r)}),{})}a(G9a,"FromPropertyKeys");function $9a(t,e,r){return G9a(t,e.keys,r)}a($9a,"FromMappedKey");function V9a(t,e,r){let n=$9a(t,e,r);return(0,Q9a.MappedResult)(n)}a(V9a,"PickFromMappedKey")});var Z5e=I(g6=>{"use strict";p();var W9a=g6&&g6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gSr=g6&&g6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W9a(e,t,r)};Object.defineProperty(g6,"__esModule",{value:!0});gSr(hSr(),g6);gSr(uSr(),g6);gSr(pAt(),g6)});var ySr=I(A6=>{"use strict";p();var z9a=A6&&A6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y9a=A6&&A6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K9a=A6&&A6.__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;omki(e))}a(pki,"FromRest");function mki(t){return Rv.IsComputed(t)?oUa(t.target,t.parameters):Rv.IsRef(t)?sUa(t.$ref):Rv.IsIntersect(t)?(0,X9a.Intersect)(pki(t.allOf)):Rv.IsUnion(t)?(0,eUa.Union)(pki(t.anyOf)):Rv.IsObject(t)?cUa(t,t.properties):Rv.IsBigInt(t)||Rv.IsBoolean(t)||Rv.IsInteger(t)||Rv.IsLiteral(t)||Rv.IsNull(t)||Rv.IsNumber(t)||Rv.IsString(t)||Rv.IsSymbol(t)||Rv.IsUndefined(t)?t:(0,hki.Object)({})}a(mki,"PartialResolve");function lUa(t,e){return Rv.IsMappedResult(t)?(0,iUa.PartialFromMappedResult)(t,e):(0,J9a.CreateType)({...mki(t),...e})}a(lUa,"Partial")});var ESr=I(_Sr=>{"use strict";p();Object.defineProperty(_Sr,"__esModule",{value:!0});_Sr.PartialFromMappedResult=mUa;var uUa=bm(),dUa=ySr(),fUa=Yb();function pUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,dUa.Partial)(t[n],(0,fUa.Clone)(e));return r}a(pUa,"FromProperties");function hUa(t,e){return pUa(t.properties,e)}a(hUa,"FromMappedResult");function mUa(t,e){let r=hUa(t,e);return(0,uUa.MappedResult)(r)}a(mUa,"PartialFromMappedResult")});var X5e=I(WG=>{"use strict";p();var gUa=WG&&WG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gki=WG&&WG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gUa(e,t,r)};Object.defineProperty(WG,"__esModule",{value:!0});gki(ESr(),WG);gki(ySr(),WG)});var CSr=I(y6=>{"use strict";p();var AUa=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]})),yUa=y6&&y6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EUa=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;ovki(e))}a(Aki,"FromRest");function vki(t){return kv.IsComputed(t)?TUa(t.target,t.parameters):kv.IsRef(t)?IUa(t.$ref):kv.IsIntersect(t)?(0,vUa.Intersect)(Aki(t.allOf)):kv.IsUnion(t)?(0,CUa.Union)(Aki(t.anyOf)):kv.IsObject(t)?wUa(t,t.properties):kv.IsBigInt(t)||kv.IsBoolean(t)||kv.IsInteger(t)||kv.IsLiteral(t)||kv.IsNull(t)||kv.IsNumber(t)||kv.IsString(t)||kv.IsSymbol(t)||kv.IsUndefined(t)?t:(0,yki.Object)({})}a(vki,"RequiredResolve");function RUa(t,e){return kv.IsMappedResult(t)?(0,SUa.RequiredFromMappedResult)(t,e):(0,_Ua.CreateType)({...vki(t),...e})}a(RUa,"Required")});var bSr=I(SSr=>{"use strict";p();Object.defineProperty(SSr,"__esModule",{value:!0});SSr.RequiredFromMappedResult=MUa;var kUa=bm(),PUa=CSr();function DUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,PUa.Required)(t[n],e);return r}a(DUa,"FromProperties");function NUa(t,e){return DUa(t.properties,e)}a(NUa,"FromMappedResult");function MUa(t,e){let r=NUa(t,e);return(0,kUa.MappedResult)(r)}a(MUa,"RequiredFromMappedResult")});var e4e=I(zG=>{"use strict";p();var OUa=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]})),Cki=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OUa(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});Cki(bSr(),zG);Cki(CSr(),zG)});var Iki=I(yD=>{"use strict";p();var LUa=yD&&yD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BUa=yD&&yD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FUa=yD&&yD.__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;omy.IsRef(r)?ISr(t,r.$ref):n1(t,r))}a(r7a,"DereferenceParameters");function ISr(t,e){return e in t?my.IsRef(t[e])?ISr(t,t[e].$ref):n1(t,t[e]):(0,TSr.Never)()}a(ISr,"Dereference");function n7a(t){return(0,qUa.Awaited)(t[0])}a(n7a,"FromAwaited");function i7a(t){return(0,GUa.Index)(t[0],t[1])}a(i7a,"FromIndex");function o7a(t){return(0,zUa.KeyOf)(t[0])}a(o7a,"FromKeyOf");function s7a(t){return(0,ZUa.Partial)(t[0])}a(s7a,"FromPartial");function a7a(t){return(0,KUa.Omit)(t[0],t[1])}a(a7a,"FromOmit");function c7a(t){return(0,JUa.Pick)(t[0],t[1])}a(c7a,"FromPick");function l7a(t){return(0,XUa.Required)(t[0])}a(l7a,"FromRequired");function u7a(t,e,r){let n=r7a(t,r);return e==="Awaited"?n7a(n):e==="Index"?i7a(n):e==="KeyOf"?o7a(n):e==="Partial"?s7a(n):e==="Omit"?a7a(n):e==="Pick"?c7a(n):e==="Required"?l7a(n):(0,TSr.Never)()}a(u7a,"FromComputed");function d7a(t,e){return(0,QUa.Array)(n1(t,e))}a(d7a,"FromArray");function f7a(t,e){return(0,jUa.AsyncIterator)(n1(t,e))}a(f7a,"FromAsyncIterator");function p7a(t,e,r){return(0,HUa.Constructor)(t4e(t,e),n1(t,r))}a(p7a,"FromConstructor");function h7a(t,e,r){return(0,$Ua.Function)(t4e(t,e),n1(t,r))}a(h7a,"FromFunction");function m7a(t,e){return(0,VUa.Intersect)(t4e(t,e))}a(m7a,"FromIntersect");function g7a(t,e){return(0,WUa.Iterator)(n1(t,e))}a(g7a,"FromIterator");function A7a(t,e){return(0,YUa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:n1(t,e[n])}),{}))}a(A7a,"FromObject");function y7a(t,e){let[r,n]=[n1(t,(0,Ski.RecordValue)(e)),(0,Ski.RecordPattern)(e)],o=(0,UUa.CloneType)(e);return o.patternProperties[n]=r,o}a(y7a,"FromRecord");function E7a(t,e){return my.IsRef(e)?{...ISr(t,e.$ref),[hAt.TransformKind]:e[hAt.TransformKind]}:e}a(E7a,"FromTransform");function _7a(t,e){return(0,e7a.Tuple)(t4e(t,e))}a(_7a,"FromTuple");function v7a(t,e){return(0,t7a.Union)(t4e(t,e))}a(v7a,"FromUnion");function t4e(t,e){return e.map(r=>n1(t,r))}a(t4e,"FromTypes");function n1(t,e){return my.IsOptional(e)?(0,r1.CreateType)(n1(t,(0,bki.Discard)(e,[hAt.OptionalKind])),e):my.IsReadonly(e)?(0,r1.CreateType)(n1(t,(0,bki.Discard)(e,[hAt.ReadonlyKind])),e):my.IsTransform(e)?(0,r1.CreateType)(E7a(t,e),e):my.IsArray(e)?(0,r1.CreateType)(d7a(t,e.items),e):my.IsAsyncIterator(e)?(0,r1.CreateType)(f7a(t,e.items),e):my.IsComputed(e)?(0,r1.CreateType)(u7a(t,e.target,e.parameters)):my.IsConstructor(e)?(0,r1.CreateType)(p7a(t,e.parameters,e.returns),e):my.IsFunction(e)?(0,r1.CreateType)(h7a(t,e.parameters,e.returns),e):my.IsIntersect(e)?(0,r1.CreateType)(m7a(t,e.allOf),e):my.IsIterator(e)?(0,r1.CreateType)(g7a(t,e.items),e):my.IsObject(e)?(0,r1.CreateType)(A7a(t,e.properties),e):my.IsRecord(e)?(0,r1.CreateType)(y7a(t,e)):my.IsTuple(e)?(0,r1.CreateType)(_7a(t,e.items||[]),e):my.IsUnion(e)?(0,r1.CreateType)(v7a(t,e.anyOf),e):e}a(n1,"FromType");function Tki(t,e){return e in t?n1(t,t[e]):(0,TSr.Never)()}a(Tki,"ComputeType");function C7a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Tki(t,r)}),{})}a(C7a,"ComputeModuleProperties")});var wki=I(r4e=>{"use strict";p();Object.defineProperty(r4e,"__esModule",{value:!0});r4e.TModule=void 0;r4e.Module=T7a;var xki=t6(),b7a=Sn(),S7a=Iki(),mAt=class{static{a(this,"TModule")}constructor(e){let r=(0,S7a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,xki.CreateType)(this.$defs[e],r)};return(0,xki.CreateType)({[b7a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};r4e.TModule=mAt;function T7a(t){return new mAt(t)}a(T7a,"Module")});var gAt=I(Ere=>{"use strict";p();var I7a=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]})),x7a=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I7a(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});x7a(wki(),Ere)});var Rki=I(xSr=>{"use strict";p();Object.defineProperty(xSr,"__esModule",{value:!0});xSr.Not=k7a;var w7a=Ii(),R7a=Sn();function k7a(t,e){return(0,w7a.CreateType)({[R7a.Kind]:"Not",not:t},e)}a(k7a,"Not")});var AAt=I(_re=>{"use strict";p();var P7a=_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]})),D7a=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P7a(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});D7a(Rki(),_re)});var kki=I(E6=>{"use strict";p();var N7a=E6&&E6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M7a=E6&&E6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O7a=E6&&E6.__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 Q7a=vre&&vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q7a=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q7a(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});q7a(kki(),vre)});var Dki=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.Recursive=V7a;var j7a=ygt(),H7a=Ii(),G7a=Iv(),Pki=Sn(),$7a=0;function V7a(t,e={}){(0,G7a.IsUndefined)(e.$id)&&(e.$id=`T${$7a++}`);let r=(0,j7a.CloneType)(t({[Pki.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,H7a.CreateType)({[Pki.Hint]:"Recursive",...r},e)}a(V7a,"Recursive")});var EAt=I(Cre=>{"use strict";p();var W7a=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]})),z7a=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W7a(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});z7a(Dki(),Cre)});var Nki=I(RSr=>{"use strict";p();Object.defineProperty(RSr,"__esModule",{value:!0});RSr.RegExp=Z7a;var Y7a=Ii(),K7a=Iv(),J7a=Sn();function Z7a(t,e){let r=(0,K7a.IsString)(t)?new globalThis.RegExp(t):t;return(0,Y7a.CreateType)({[J7a.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(Z7a,"RegExp")});var _At=I(bre=>{"use strict";p();var X7a=bre&&bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eQa=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X7a(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});eQa(Nki(),bre)});var Mki=I(PSr=>{"use strict";p();Object.defineProperty(PSr,"__esModule",{value:!0});PSr.Rest=rQa;var kSr=vs();function tQa(t){return(0,kSr.IsIntersect)(t)?t.allOf:(0,kSr.IsUnion)(t)?t.anyOf:(0,kSr.IsTuple)(t)?t.items??[]:[]}a(tQa,"RestResolve");function rQa(t){return tQa(t)}a(rQa,"Rest")});var vAt=I(Sre=>{"use strict";p();var nQa=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]})),iQa=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nQa(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});iQa(Mki(),Sre)});var Oki=I(_6=>{"use strict";p();var oQa=_6&&_6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sQa=_6&&_6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aQa=_6&&_6.__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 fQa=Tre&&Tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pQa=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fQa(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});pQa(Oki(),Tre)});var Bki=I(Lki=>{"use strict";p();Object.defineProperty(Lki,"__esModule",{value:!0})});var Uki=I(Fki=>{"use strict";p();Object.defineProperty(Fki,"__esModule",{value:!0});var k2p=Sn()});var qki=I(YG=>{"use strict";p();var hQa=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]})),Qki=YG&&YG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hQa(e,t,r)};Object.defineProperty(YG,"__esModule",{value:!0});Qki(Bki(),YG);Qki(Uki(),YG)});var Hki=I(jki=>{"use strict";p();Object.defineProperty(jki,"__esModule",{value:!0})});var Gki=I(Ire=>{"use strict";p();var mQa=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]})),gQa=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mQa(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});gQa(Hki(),Ire)});var $ki=I(xre=>{"use strict";p();Object.defineProperty(xre,"__esModule",{value:!0});xre.TransformEncodeBuilder=xre.TransformDecodeBuilder=void 0;xre.Transform=yQa;var bAt=Sn(),AQa=vs(),SAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new TAt(this.schema,e)}};xre.TransformDecodeBuilder=SAt;var TAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[bAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[bAt.TransformKind].Decode(c)),"Decode")};return{...r,[bAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[bAt.TransformKind]:n}}Encode(e){return(0,AQa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};xre.TransformEncodeBuilder=TAt;function yQa(t){return new SAt(t)}a(yQa,"Transform")});var IAt=I(wre=>{"use strict";p();var EQa=wre&&wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Qa=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EQa(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});_Qa($ki(),wre)});var Wki=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Unsafe=CQa;var vQa=Ii(),Vki=Sn();function CQa(t={}){return(0,vQa.CreateType)({[Vki.Kind]:t[Vki.Kind]??"Unsafe"},t)}a(CQa,"Unsafe")});var n4e=I(Rre=>{"use strict";p();var bQa=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]})),SQa=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bQa(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});SQa(Wki(),Rre)});var zki=I(NSr=>{"use strict";p();Object.defineProperty(NSr,"__esModule",{value:!0});NSr.Void=xQa;var TQa=Ii(),IQa=Sn();function xQa(t){return(0,TQa.CreateType)({[IQa.Kind]:"Void",type:"void"},t)}a(xQa,"Void")});var xAt=I(kre=>{"use strict";p();var wQa=kre&&kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RQa=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wQa(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});RQa(zki(),kre)});var OSr=I(RAt=>{"use strict";p();Object.defineProperty(RAt,"__esModule",{value:!0});RAt.JsonTypeBuilder=void 0;var kQa=Gge(),PQa=$ge(),DQa=O5e(),NQa=Hgt(),MQa=$gt(),OQa=Wgt(),LQa=rAt(),BQa=ure(),FQa=oAt(),UQa=hD(),QQa=cAt(),qQa=XT(),wAt=dAt(),jQa=mD(),HQa=UE(),GQa=bm(),$Qa=Cm(),VQa=AAt(),WQa=$5e(),zQa=gAt(),YQa=UG(),KQa=xv(),JQa=J5e(),ZQa=G4(),XQa=X5e(),eqa=Z5e(),tqa=HG(),rqa=K5e(),nqa=iAe(),iqa=EAt(),oqa=$G(),sqa=e4e(),aqa=vAt(),cqa=QG(),lqa=pD(),uqa=IAt(),dqa=s6(),fqa=Ip(),pqa=VG(),hqa=n4e(),MSr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,rqa.ReadonlyOptional)(e)}Readonly(e,r){return(0,tqa.Readonly)(e,r??!0)}Optional(e,r){return(0,ZQa.Optional)(e,r??!0)}Any(e){return(0,kQa.Any)(e)}Array(e,r){return(0,PQa.Array)(e,r)}Boolean(e){return(0,DQa.Boolean)(e)}Capitalize(e,r){return(0,wAt.Capitalize)(e,r)}Composite(e,r){return(0,NQa.Composite)(e,r)}Const(e,r){return(0,MQa.Const)(e,r)}Enum(e,r){return(0,OQa.Enum)(e,r)}Exclude(e,r,n){return(0,LQa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,BQa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,FQa.Extract)(e,r,n)}Index(e,r,n){return(0,UQa.Index)(e,r,n)}Integer(e){return(0,QQa.Integer)(e)}Intersect(e,r){return(0,qQa.Intersect)(e,r)}KeyOf(e,r){return(0,jQa.KeyOf)(e,r)}Literal(e,r){return(0,HQa.Literal)(e,r)}Lowercase(e,r){return(0,wAt.Lowercase)(e,r)}Mapped(e,r,n){return(0,GQa.Mapped)(e,r,n)}Module(e){return(0,zQa.Module)(e)}Never(e){return(0,$Qa.Never)(e)}Not(e,r){return(0,VQa.Not)(e,r)}Null(e){return(0,WQa.Null)(e)}Number(e){return(0,YQa.Number)(e)}Object(e,r){return(0,KQa.Object)(e,r)}Omit(e,r,n){return(0,JQa.Omit)(e,r,n)}Partial(e,r){return(0,XQa.Partial)(e,r)}Pick(e,r,n){return(0,eqa.Pick)(e,r,n)}Record(e,r,n){return(0,nqa.Record)(e,r,n)}Recursive(e,r){return(0,iqa.Recursive)(e,r)}Ref(...e){return(0,oqa.Ref)(e[0],e[1])}Required(e,r){return(0,sqa.Required)(e,r)}Rest(e){return(0,aqa.Rest)(e)}String(e){return(0,cqa.String)(e)}TemplateLiteral(e,r){return(0,lqa.TemplateLiteral)(e,r)}Transform(e){return(0,uqa.Transform)(e)}Tuple(e,r){return(0,dqa.Tuple)(e,r)}Uncapitalize(e,r){return(0,wAt.Uncapitalize)(e,r)}Union(e,r){return(0,fqa.Union)(e,r)}Unknown(e){return(0,pqa.Unknown)(e)}Unsafe(e){return(0,hqa.Unsafe)(e)}Uppercase(e,r){return(0,wAt.Uppercase)(e,r)}};RAt.JsonTypeBuilder=MSr});var Yki=I(Ot=>{"use strict";p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Rest=Ot.Required=Ot.RegExp=Ot.Ref=Ot.Recursive=Ot.Record=Ot.ReadonlyOptional=Ot.Readonly=Ot.Promise=Ot.Pick=Ot.Partial=Ot.Parameters=Ot.Optional=Ot.Omit=Ot.Object=Ot.Number=Ot.Null=Ot.Not=Ot.Never=Ot.Module=Ot.Mapped=Ot.Literal=Ot.KeyOf=Ot.Iterator=Ot.Uppercase=Ot.Lowercase=Ot.Uncapitalize=Ot.Capitalize=Ot.Intersect=Ot.Integer=Ot.Instantiate=Ot.InstanceType=Ot.Index=Ot.Function=Ot.Extract=Ot.Extends=Ot.Exclude=Ot.Enum=Ot.Date=Ot.ConstructorParameters=Ot.Constructor=Ot.Const=Ot.Composite=Ot.Boolean=Ot.BigInt=Ot.Awaited=Ot.AsyncIterator=Ot.Array=Ot.Argument=Ot.Any=void 0;Ot.Void=Ot.Unsafe=Ot.Unknown=Ot.Union=Ot.Undefined=Ot.Uint8Array=Ot.Tuple=Ot.Transform=Ot.TemplateLiteral=Ot.Symbol=Ot.String=Ot.ReturnType=void 0;var mqa=Gge();Object.defineProperty(Ot,"Any",{enumerable:!0,get:a(function(){return mqa.Any},"get")});var gqa=Tgt();Object.defineProperty(Ot,"Argument",{enumerable:!0,get:a(function(){return gqa.Argument},"get")});var Aqa=$ge();Object.defineProperty(Ot,"Array",{enumerable:!0,get:a(function(){return Aqa.Array},"get")});var yqa=Vge();Object.defineProperty(Ot,"AsyncIterator",{enumerable:!0,get:a(function(){return yqa.AsyncIterator},"get")});var Eqa=H5e();Object.defineProperty(Ot,"Awaited",{enumerable:!0,get:a(function(){return Eqa.Awaited},"get")});var _qa=Jge();Object.defineProperty(Ot,"BigInt",{enumerable:!0,get:a(function(){return _qa.BigInt},"get")});var vqa=O5e();Object.defineProperty(Ot,"Boolean",{enumerable:!0,get:a(function(){return vqa.Boolean},"get")});var Cqa=Hgt();Object.defineProperty(Ot,"Composite",{enumerable:!0,get:a(function(){return Cqa.Composite},"get")});var bqa=$gt();Object.defineProperty(Ot,"Const",{enumerable:!0,get:a(function(){return bqa.Const},"get")});var Sqa=Wge();Object.defineProperty(Ot,"Constructor",{enumerable:!0,get:a(function(){return Sqa.Constructor},"get")});var Tqa=Vgt();Object.defineProperty(Ot,"ConstructorParameters",{enumerable:!0,get:a(function(){return Tqa.ConstructorParameters},"get")});var Iqa=G5e();Object.defineProperty(Ot,"Date",{enumerable:!0,get:a(function(){return Iqa.Date},"get")});var xqa=Wgt();Object.defineProperty(Ot,"Enum",{enumerable:!0,get:a(function(){return xqa.Enum},"get")});var wqa=rAt();Object.defineProperty(Ot,"Exclude",{enumerable:!0,get:a(function(){return wqa.Exclude},"get")});var Rqa=ure();Object.defineProperty(Ot,"Extends",{enumerable:!0,get:a(function(){return Rqa.Extends},"get")});var kqa=oAt();Object.defineProperty(Ot,"Extract",{enumerable:!0,get:a(function(){return kqa.Extract},"get")});var Pqa=FG();Object.defineProperty(Ot,"Function",{enumerable:!0,get:a(function(){return Pqa.Function},"get")});var Dqa=hD();Object.defineProperty(Ot,"Index",{enumerable:!0,get:a(function(){return Dqa.Index},"get")});var Nqa=sAt();Object.defineProperty(Ot,"InstanceType",{enumerable:!0,get:a(function(){return Nqa.InstanceType},"get")});var Mqa=aAt();Object.defineProperty(Ot,"Instantiate",{enumerable:!0,get:a(function(){return Mqa.Instantiate},"get")});var Oqa=cAt();Object.defineProperty(Ot,"Integer",{enumerable:!0,get:a(function(){return Oqa.Integer},"get")});var Lqa=XT();Object.defineProperty(Ot,"Intersect",{enumerable:!0,get:a(function(){return Lqa.Intersect},"get")});var kAt=dAt();Object.defineProperty(Ot,"Capitalize",{enumerable:!0,get:a(function(){return kAt.Capitalize},"get")});Object.defineProperty(Ot,"Uncapitalize",{enumerable:!0,get:a(function(){return kAt.Uncapitalize},"get")});Object.defineProperty(Ot,"Lowercase",{enumerable:!0,get:a(function(){return kAt.Lowercase},"get")});Object.defineProperty(Ot,"Uppercase",{enumerable:!0,get:a(function(){return kAt.Uppercase},"get")});var Bqa=Xge();Object.defineProperty(Ot,"Iterator",{enumerable:!0,get:a(function(){return Bqa.Iterator},"get")});var Fqa=mD();Object.defineProperty(Ot,"KeyOf",{enumerable:!0,get:a(function(){return Fqa.KeyOf},"get")});var Uqa=UE();Object.defineProperty(Ot,"Literal",{enumerable:!0,get:a(function(){return Uqa.Literal},"get")});var Qqa=bm();Object.defineProperty(Ot,"Mapped",{enumerable:!0,get:a(function(){return Qqa.Mapped},"get")});var qqa=gAt();Object.defineProperty(Ot,"Module",{enumerable:!0,get:a(function(){return qqa.Module},"get")});var jqa=Cm();Object.defineProperty(Ot,"Never",{enumerable:!0,get:a(function(){return jqa.Never},"get")});var Hqa=AAt();Object.defineProperty(Ot,"Not",{enumerable:!0,get:a(function(){return Hqa.Not},"get")});var Gqa=$5e();Object.defineProperty(Ot,"Null",{enumerable:!0,get:a(function(){return Gqa.Null},"get")});var $qa=UG();Object.defineProperty(Ot,"Number",{enumerable:!0,get:a(function(){return $qa.Number},"get")});var Vqa=xv();Object.defineProperty(Ot,"Object",{enumerable:!0,get:a(function(){return Vqa.Object},"get")});var Wqa=J5e();Object.defineProperty(Ot,"Omit",{enumerable:!0,get:a(function(){return Wqa.Omit},"get")});var zqa=G4();Object.defineProperty(Ot,"Optional",{enumerable:!0,get:a(function(){return zqa.Optional},"get")});var Yqa=yAt();Object.defineProperty(Ot,"Parameters",{enumerable:!0,get:a(function(){return Yqa.Parameters},"get")});var Kqa=X5e();Object.defineProperty(Ot,"Partial",{enumerable:!0,get:a(function(){return Kqa.Partial},"get")});var Jqa=Z5e();Object.defineProperty(Ot,"Pick",{enumerable:!0,get:a(function(){return Jqa.Pick},"get")});var Zqa=Q5e();Object.defineProperty(Ot,"Promise",{enumerable:!0,get:a(function(){return Zqa.Promise},"get")});var Xqa=HG();Object.defineProperty(Ot,"Readonly",{enumerable:!0,get:a(function(){return Xqa.Readonly},"get")});var eja=K5e();Object.defineProperty(Ot,"ReadonlyOptional",{enumerable:!0,get:a(function(){return eja.ReadonlyOptional},"get")});var tja=iAe();Object.defineProperty(Ot,"Record",{enumerable:!0,get:a(function(){return tja.Record},"get")});var rja=EAt();Object.defineProperty(Ot,"Recursive",{enumerable:!0,get:a(function(){return rja.Recursive},"get")});var nja=$G();Object.defineProperty(Ot,"Ref",{enumerable:!0,get:a(function(){return nja.Ref},"get")});var ija=_At();Object.defineProperty(Ot,"RegExp",{enumerable:!0,get:a(function(){return ija.RegExp},"get")});var oja=e4e();Object.defineProperty(Ot,"Required",{enumerable:!0,get:a(function(){return oja.Required},"get")});var sja=vAt();Object.defineProperty(Ot,"Rest",{enumerable:!0,get:a(function(){return sja.Rest},"get")});var aja=CAt();Object.defineProperty(Ot,"ReturnType",{enumerable:!0,get:a(function(){return aja.ReturnType},"get")});var cja=QG();Object.defineProperty(Ot,"String",{enumerable:!0,get:a(function(){return cja.String},"get")});var lja=V5e();Object.defineProperty(Ot,"Symbol",{enumerable:!0,get:a(function(){return lja.Symbol},"get")});var uja=pD();Object.defineProperty(Ot,"TemplateLiteral",{enumerable:!0,get:a(function(){return uja.TemplateLiteral},"get")});var dja=IAt();Object.defineProperty(Ot,"Transform",{enumerable:!0,get:a(function(){return dja.Transform},"get")});var fja=s6();Object.defineProperty(Ot,"Tuple",{enumerable:!0,get:a(function(){return fja.Tuple},"get")});var pja=z5e();Object.defineProperty(Ot,"Uint8Array",{enumerable:!0,get:a(function(){return pja.Uint8Array},"get")});var hja=W5e();Object.defineProperty(Ot,"Undefined",{enumerable:!0,get:a(function(){return hja.Undefined},"get")});var mja=Ip();Object.defineProperty(Ot,"Union",{enumerable:!0,get:a(function(){return mja.Union},"get")});var gja=VG();Object.defineProperty(Ot,"Unknown",{enumerable:!0,get:a(function(){return gja.Unknown},"get")});var Aja=n4e();Object.defineProperty(Ot,"Unsafe",{enumerable:!0,get:a(function(){return Aja.Unsafe},"get")});var yja=xAt();Object.defineProperty(Ot,"Void",{enumerable:!0,get:a(function(){return yja.Void},"get")})});var Kki=I(PAt=>{"use strict";p();Object.defineProperty(PAt,"__esModule",{value:!0});PAt.JavaScriptTypeBuilder=void 0;var Eja=OSr(),_ja=Tgt(),vja=Vge(),Cja=H5e(),bja=Jge(),Sja=Wge(),Tja=Vgt(),Ija=G5e(),xja=FG(),wja=sAt(),Rja=aAt(),kja=Xge(),Pja=yAt(),Dja=Q5e(),Nja=_At(),Mja=CAt(),Oja=V5e(),Lja=z5e(),Bja=W5e(),Fja=xAt(),LSr=class extends Eja.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,_ja.Argument)(e)}AsyncIterator(e,r){return(0,vja.AsyncIterator)(e,r)}Awaited(e,r){return(0,Cja.Awaited)(e,r)}BigInt(e){return(0,bja.BigInt)(e)}ConstructorParameters(e,r){return(0,Tja.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,Sja.Constructor)(e,r,n)}Date(e={}){return(0,Ija.Date)(e)}Function(e,r,n){return(0,xja.Function)(e,r,n)}InstanceType(e,r){return(0,wja.InstanceType)(e,r)}Instantiate(e,r){return(0,Rja.Instantiate)(e,r)}Iterator(e,r){return(0,kja.Iterator)(e,r)}Parameters(e,r){return(0,Pja.Parameters)(e,r)}Promise(e,r){return(0,Dja.Promise)(e,r)}RegExp(e,r){return(0,Nja.RegExp)(e,r)}ReturnType(e,r){return(0,Mja.ReturnType)(e,r)}Symbol(e){return(0,Oja.Symbol)(e)}Undefined(e){return(0,Bja.Undefined)(e)}Uint8Array(e){return(0,Lja.Uint8Array)(e)}Void(e){return(0,Fja.Void)(e)}};PAt.JavaScriptTypeBuilder=LSr});var Jki=I(i1=>{"use strict";p();var Uja=i1&&i1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qja=i1&&i1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qja=i1&&i1.__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 Vja=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]})),yn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vja(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});yn(ICr(),en);yn(t6(),en);yn(Nf(),en);yn(OCr(),en);yn(Zxi(),en);yn(P5e(),en);yn(Hge(),en);yn(D5e(),en);yn(Sn(),en);yn(Gge(),en);yn($ge(),en);yn(Tgt(),en);yn(Vge(),en);yn(H5e(),en);yn(Jge(),en);yn(O5e(),en);yn(Hgt(),en);yn($gt(),en);yn(Wge(),en);yn(Vgt(),en);yn(G5e(),en);yn(Wgt(),en);yn(rAt(),en);yn(ure(),en);yn(oAt(),en);yn(FG(),en);yn(hD(),en);yn(sAt(),en);yn(aAt(),en);yn(cAt(),en);yn(XT(),en);yn(Xge(),en);yn(dAt(),en);yn(mD(),en);yn(UE(),en);yn(gAt(),en);yn(bm(),en);yn(Cm(),en);yn(AAt(),en);yn($5e(),en);yn(UG(),en);yn(xv(),en);yn(J5e(),en);yn(G4(),en);yn(yAt(),en);yn(X5e(),en);yn(Z5e(),en);yn(Q5e(),en);yn(HG(),en);yn(K5e(),en);yn(iAe(),en);yn(EAt(),en);yn($G(),en);yn(_At(),en);yn(e4e(),en);yn(vAt(),en);yn(CAt(),en);yn(qki(),en);yn(Gki(),en);yn(QG(),en);yn(V5e(),en);yn(pD(),en);yn(IAt(),en);yn(s6(),en);yn(z5e(),en);yn(W5e(),en);yn(Ip(),en);yn(VG(),en);yn(n4e(),en);yn(xAt(),en);yn(Jki(),en)});var Xki=I(DR=>{"use strict";p();var Wja=DR&&DR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zja=DR&&DR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Yja=DR&&DR.__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 Jja=Y4&&Y4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zja=Y4&&Y4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xja=Y4&&Y4.__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(NAt,"__esModule",{value:!0});NAt.ContextItemOrigin=void 0;var rPi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(rPi||(NAt.ContextItemOrigin=rPi={}))});var oPi=I(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.RangeSchema=Nu.WorkspaceFolder=Nu.VersionedTextDocumentIdentifier=Nu.TextEdit=Nu.TextDocumentItem=Nu.Range=Nu.Position=Nu.DocumentUri=Nu.Disposable=Nu.Command=Nu.CancellationTokenSource=Nu.CancellationToken=void 0;var MAt=DAt(),ED=ri();Object.defineProperty(Nu,"CancellationToken",{enumerable:!0,get:a(function(){return ED.CancellationToken},"get")});Object.defineProperty(Nu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return ED.CancellationTokenSource},"get")});Object.defineProperty(Nu,"Command",{enumerable:!0,get:a(function(){return ED.Command},"get")});Object.defineProperty(Nu,"Disposable",{enumerable:!0,get:a(function(){return ED.Disposable},"get")});Object.defineProperty(Nu,"DocumentUri",{enumerable:!0,get:a(function(){return ED.DocumentUri},"get")});Object.defineProperty(Nu,"Position",{enumerable:!0,get:a(function(){return ED.Position},"get")});Object.defineProperty(Nu,"Range",{enumerable:!0,get:a(function(){return ED.Range},"get")});Object.defineProperty(Nu,"TextDocumentItem",{enumerable:!0,get:a(function(){return ED.TextDocumentItem},"get")});Object.defineProperty(Nu,"TextEdit",{enumerable:!0,get:a(function(){return ED.TextEdit},"get")});Object.defineProperty(Nu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return ED.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Nu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return ED.WorkspaceFolder},"get")});var iPi=MAt.Type.Object({line:MAt.Type.Integer({minimum:0}),character:MAt.Type.Integer({minimum:0})});Nu.RangeSchema=MAt.Type.Object({start:iPi,end:iPi})});var aPi=I(sPi=>{"use strict";p();Object.defineProperty(sPi,"__esModule",{value:!0})});var o4e=I(Mf=>{"use strict";p();var tHa=Mf&&Mf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i4e=Mf&&Mf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tHa(e,t,r)};Object.defineProperty(Mf,"__esModule",{value:!0});Mf.TextEdit=Mf.Range=Mf.Position=Mf.Disposable=Mf.CancellationTokenSource=Mf.CancellationToken=void 0;var aAe=ri();Object.defineProperty(Mf,"CancellationToken",{enumerable:!0,get:a(function(){return aAe.CancellationToken},"get")});Object.defineProperty(Mf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return aAe.CancellationTokenSource},"get")});Object.defineProperty(Mf,"Disposable",{enumerable:!0,get:a(function(){return aAe.Disposable},"get")});Object.defineProperty(Mf,"Position",{enumerable:!0,get:a(function(){return aAe.Position},"get")});Object.defineProperty(Mf,"Range",{enumerable:!0,get:a(function(){return aAe.Range},"get")});Object.defineProperty(Mf,"TextEdit",{enumerable:!0,get:a(function(){return aAe.TextEdit},"get")});i4e(Xki(),Mf);i4e(tPi(),Mf);i4e(nPi(),Mf);i4e(oPi(),Mf);i4e(aPi(),Mf)});var FSr=I(eI=>{"use strict";p();var rHa=eI&&eI.__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},cPi=eI&&eI.__param||function(t,e){return function(r,n){e(r,n,t)}},nHa=eI&&eI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eI,"__esModule",{value:!0});eI.CompletionNotifier=eI.ICompletionsNotifierService=void 0;var iHa=nHa(require("events")),oHa=nn(),sHa=bte(),aHa=o4e(),cHa=$g(),lHa=_5e(),OAt="CompletionRequested";eI.ICompletionsNotifierService=(0,oHa.createServiceIdentifier)("ICompletionsNotifierService");var BSr=class{static{a(this,"CompletionNotifier")}#e=new iHa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(OAt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,cHa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${OAt}`);return this.#e.on(OAt,r),aHa.Disposable.create(()=>this.#e.off(OAt,r))}};eI.CompletionNotifier=BSr;eI.CompletionNotifier=BSr=rHa([cPi(0,lHa.ICompletionsPromiseQueueService),cPi(1,sHa.ICompletionsTelemetryService)],BSr)});var USr=I(LAt=>{"use strict";p();Object.defineProperty(LAt,"__esModule",{value:!0});LAt.ICompletionsObservableWorkspace=void 0;var uHa=Gs();LAt.ICompletionsObservableWorkspace=(0,uHa.createDecorator)("ICompletionsObservableWorkspace")});var Dl=I(_D=>{"use strict";p();Object.defineProperty(_D,"__esModule",{value:!0});_D.logger=_D.Logger=_D.ICompletionsLogTargetService=_D.LogLevel=void 0;var dHa=nn(),fHa=bte(),pHa=$g(),Pre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Pre||(_D.LogLevel=Pre={}));_D.ICompletionsLogTargetService=(0,dHa.createServiceIdentifier)("ICompletionsLogTargetService");var BAt=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,Pre.DEBUG,...r)}info(e,...r){this.log(e,Pre.INFO,...r)}warn(e,...r){this.log(e,Pre.WARN,...r)}error(e,...r){this.log(e,Pre.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,pHa.telemetryException)(e.get(fHa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(_D.ICompletionsLogTargetService),Pre.ERROR,`${o}:`,s)}};_D.Logger=BAt;_D.logger=new BAt("default")});var uPi=I(KG=>{"use strict";p();Object.defineProperty(KG,"__esModule",{value:!0});KG.INotificationService=KG.NullNotificationService=KG.ProgressLocation=void 0;var hHa=nn(),mHa=YP(),lPi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(lPi||(KG.ProgressLocation=lPi={}));var QSr=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")},mHa.CancellationToken.None))}};KG.NullNotificationService=QSr;KG.INotificationService=(0,hHa.createServiceIdentifier)("INotificationService")});var jSr=I(vD=>{"use strict";p();var gHa=vD&&vD.__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},AHa=vD&&vD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vD,"__esModule",{value:!0});vD.ExtensionNotificationSender=vD.ICompletionsNotificationSender=void 0;var yHa=uPi(),EHa=nn();vD.ICompletionsNotificationSender=(0,EHa.createServiceIdentifier)("ICompletionsNotificationSender");var qSr=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}}};vD.ExtensionNotificationSender=qSr;vD.ExtensionNotificationSender=qSr=gHa([AHa(0,yHa.INotificationService)],qSr)});var $Sr=I(CD=>{"use strict";p();var _Ha=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},HSr=CD&&CD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(CD,"__esModule",{value:!0});CD.UserErrorNotifier=CD.ICompletionsUserErrorNotifierService=void 0;var vHa=U4(),CHa=nn(),bHa=nd(),pPi=Dl(),SHa=jSr(),THa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],dPi="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.",fPi="https://gh.io/copilot-network-errors";CD.ICompletionsUserErrorNotifierService=(0,CHa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var GSr=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&&THa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new pPi.Logger("certificates").error(this._logTarget,`${dPi} Please visit ${fPi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(dPi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(bHa.URI.parse(fPi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};CD.UserErrorNotifier=GSr;CD.UserErrorNotifier=GSr=_Ha([HSr(0,pPi.ICompletionsLogTargetService),HSr(1,SHa.ICompletionsNotificationSender),HSr(2,vHa.IEnvService)],GSr)});var mh=I(cAe=>{"use strict";p();Object.defineProperty(cAe,"__esModule",{value:!0});cAe.NullExperimentationService=cAe.IExperimentationService=void 0;var IHa=nn(),xHa=Ic();cAe.IExperimentationService=(0,IHa.createServiceIdentifier)("IExperimentationService");var VSr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new xHa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};cAe.NullExperimentationService=VSr});var JG=I(o1=>{"use strict";p();Object.defineProperty(o1,"__esModule",{value:!0});o1.DEFAULT_PROMPT_ALLOCATION_PERCENT=o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=o1.DEFAULT_NUM_SNIPPETS=o1.DEFAULT_MAX_PROMPT_LENGTH=o1.DEFAULT_MAX_COMPLETION_LENGTH=void 0;o1.normalizeLanguageId=RHa;o1.DEFAULT_MAX_COMPLETION_LENGTH=500;o1.DEFAULT_MAX_PROMPT_LENGTH=8192-o1.DEFAULT_MAX_COMPLETION_LENGTH;o1.DEFAULT_NUM_SNIPPETS=4;o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;o1.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var wHa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function RHa(t){return t=t.toLowerCase(),wHa[t]??t}a(RHa,"normalizeLanguageId")});var hPi=I(WSr=>{"use strict";p();Object.defineProperty(WSr,"__esModule",{value:!0});WSr.getUserKind=PHa;function kHa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(kHa,"findKnownOrg");function PHa(t){let e=t.organizationList??[];return kHa(e)??""}a(PHa,"getUserKind")});var s4e=I(K4=>{"use strict";p();Object.defineProperty(K4,"__esModule",{value:!0});K4.IEndpointProvider=K4.ModelSupportedEndpoint=void 0;K4.isEndpointEditToolName=MHa;K4.isChatModelInformation=OHa;K4.isEmbeddingModelInformation=LHa;K4.isCompletionModelInformation=BHa;var DHa=nn(),NHa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function MHa(t){return NHa.has(t)}a(MHa,"isEndpointEditToolName");var mPi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(mPi||(K4.ModelSupportedEndpoint=mPi={}));function OHa(t){return t.capabilities.type==="chat"}a(OHa,"isChatModelInformation");function LHa(t){return t.capabilities.type==="embeddings"}a(LHa,"isEmbeddingModelInformation");function BHa(t){return t.capabilities.type==="completion"}a(BHa,"isCompletionModelInformation");K4.IEndpointProvider=(0,DHa.createServiceIdentifier)("IEndpointProvider")});var APi=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.getUserSelectedModelConfiguration=FHa;var gPi=LE();function FHa(t){let e=(0,gPi.getConfig)(t,gPi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(FHa,"getUserSelectedModelConfiguration")});var yPi=I(Z4=>{"use strict";p();Object.defineProperty(Z4,"__esModule",{value:!0});Z4.bytePairEncode=Z4.BinaryMap=Z4.binaryMapKey=void 0;var UHa=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");Z4.binaryMapKey=UHa;var YSr=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,Z4.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,Z4.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)}}};Z4.BinaryMap=YSr;var J4=new Int32Array(128),Dv=new Int32Array(128);function QHa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;J4.length0&&(J4[Dv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.makeTextEncoder=void 0;var KSr=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}},JSr=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 JSr:new KSr,"makeTextEncoder");FAt.makeTextEncoder=qHa});var _Pi=I(UAt=>{"use strict";p();Object.defineProperty(UAt,"__esModule",{value:!0});UAt.LRUCache=void 0;var ZSr=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 XSr(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}};UAt.LRUCache=ZSr;var XSr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var tTr=I(qAt=>{"use strict";p();Object.defineProperty(qAt,"__esModule",{value:!0});qAt.TikTokenizer=void 0;var QAt=yPi(),jHa=EPi(),HHa=_Pi();function GHa(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(GHa,"loadTikTokenBpe");function $Ha(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($Ha,"escapeRegExp");var eTr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,jHa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new HHa.LRUCache(o);let s=typeof e=="string"?GHa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new QAt.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=>$Ha(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,QAt.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,QAt.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,QAt.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))}};qAt.TikTokenizer=eTr});var kPi=I(Im=>{"use strict";p();Object.defineProperty(Im,"__esModule",{value:!0});Im.createTokenizer=Im.createByEncoderName=Im.createByModelName=Im.getRegexByModel=Im.getRegexByEncoder=Im.getSpecialTokensByModel=Im.getSpecialTokensByEncoder=Im.MODEL_TO_ENCODING=void 0;var VHa=tTr(),WHa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Im.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 jAt="<|endoftext|>",vPi="<|fim_prefix|>",CPi="<|fim_middle|>",bPi="<|fim_suffix|>",SPi="<|endofprompt|>",a4e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",TPi="(?:'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+",zHa=[`[^\r +`:"",n.chromiumDetails?`${o}${JSON.stringify(uIi(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(lIi,"collectErrorMessages");function hPa(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(uIi(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(hPa,"collectSingleLineErrorMessage");function mPa(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(mPa,"sanitizeNetworkErrorForTelemetry");function uIi(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(uIi,"extractChromiumDetails");var pgt=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}};my.LogMemory=pgt});var S5e=I(b5e=>{"use strict";p();Object.defineProperty(b5e,"__esModule",{value:!0});b5e.ICopilotTokenManager=void 0;b5e.nowSeconds=APa;var gPa=nn();b5e.ICopilotTokenManager=(0,gPa.createServiceIdentifier)("ICopilotTokenManager");function APa(){return Math.floor(Date.now()/1e3)}a(APa,"nowSeconds")});var UE=I(bm=>{"use strict";p();var yPa=bm&&bm.__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},hgt=bm&&bm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(bm,"__esModule",{value:!0});bm.BaseAuthenticationService=bm.IAuthenticationService=bm.MinimalModeError=bm.GITHUB_SCOPE_ALIGNED=bm.GITHUB_SCOPE_READ_USER=bm.GITHUB_SCOPE_USER_EMAIL=void 0;bm.authProviderId=TPa;var EPa=nn(),mgt=Ic(),_Pa=ko(),vPa=S8(),bte=Dl(),CPa=Ip(),bPa=S5e(),SPa=nG();bm.GITHUB_SCOPE_USER_EMAIL=["user:email"];bm.GITHUB_SCOPE_READ_USER=["read:user"];bm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var sCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};bm.MinimalModeError=sCr;bm.IAuthenticationService=(0,EPa.createServiceIdentifier)("IAuthenticationService");var aCr=class extends _Pa.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()}fireCopilotTokenChange(e){this._logService.debug(`AuthenticationService: firing onDidCopilotTokenChange from ${e}.`),this._onDidCopilotTokenChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new mgt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new mgt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new mgt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new mgt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,vPa.derived)(s=>this._configurationService.getConfigObservable(bte.ConfigKey.Shared.AuthPermissions).read(s)===bte.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=this._tokenStore.copilotToken,n=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=n,this._copilotTokenError=void 0,r?.token!==n.token&&this.fireCopilotTokenChange("getCopilotToken"),n}catch(r){let n=this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0;let o=this._copilotTokenError;throw this._copilotTokenError=r,n?this.fireCopilotTokenChange("getCopilotToken token lost"):o&&r&&o.message!==r.message&&this.fireCopilotTokenChange("getCopilotToken error change"),r}}resetCopilotToken(e){let r=!!this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e),r&&this.fireCopilotTokenChange("resetCopilotToken")}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let s of o)s.status==="rejected"&&this._logService.error(`Error getting a session: ${s.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed (identity change), minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken."),this.fireAuthenticationChange("handleAuthChangeEvent identity change");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{}this._logService.debug("Finished handling auth change event.")}};bm.BaseAuthenticationService=aCr;bm.BaseAuthenticationService=aCr=yPa([hgt(0,CPa.ILogService),hgt(1,SPa.ICopilotTokenStore),hgt(2,bPa.ICopilotTokenManager),hgt(3,bte.IConfigurationService)],aCr);function TPa(t){return t.getConfig(bte.ConfigKey.Shared.AuthProvider)===bte.AuthProviderId.GitHubEnterprise?bte.AuthProviderId.GitHubEnterprise:bte.AuthProviderId.GitHub}a(TPa,"authProviderId")});var ggt=I(cCr=>{"use strict";p();Object.defineProperty(cCr,"__esModule",{value:!0});cCr.onCopilotToken=IPa;function IPa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(IPa,"onCopilotToken")});var uCr=I(pD=>{"use strict";p();var xPa=pD&&pD.__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},wPa=pD&&pD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(pD,"__esModule",{value:!0});pD.TelemetryUserConfig=pD.ICompletionsTelemetryUserConfigService=void 0;var RPa=UE(),kPa=nn(),PPa=ko(),DPa=ggt();function NPa(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(NPa,"propertiesFromCopilotToken");pD.ICompletionsTelemetryUserConfigService=(0,kPa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var lCr=class extends PPa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,DPa.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=NPa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};pD.TelemetryUserConfig=lCr;pD.TelemetryUserConfig=lCr=xPa([wPa(0,RPa.IAuthenticationService)],lCr)});var T5e=I(Bge=>{"use strict";p();Object.defineProperty(Bge,"__esModule",{value:!0});Bge.PromiseQueue=Bge.ICompletionsPromiseQueueService=void 0;var MPa=nn();Bge.ICompletionsPromiseQueueService=(0,MPa.createServiceIdentifier)("completionsPromiseQueueService");var dCr=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)}};Bge.PromiseQueue=dCr});var Vg=I(_d=>{"use strict";p();Object.defineProperty(_d,"__esModule",{value:!0});_d.TelemetryReporters=_d.ICompletionsTelemetryReporters=_d.CopilotTelemetryReporter=_d.TelemetryWithExp=_d.TelemetryData=_d.TelemetryStore=void 0;_d.telemetrizePromptLength=VPa;_d.now=Uge;_d.telemetry=_Cr;_d.telemetryExpProblem=YPa;_d.telemetryRaw=JPa;_d.telemetryException=pIi;_d.telemetryCatch=ZPa;_d.telemetryError=XPa;_d.logEngineCompletion=t2a;_d.logEnginePrompt=r2a;var OPa=Q4(),LPa=nn(),BPa=I0(),mCr=Gs(),Agt=Ste(),q4=BE(),FPa=F0t(),UPa=py(),QPa=Q0t(),qPa=Uvr(),gCr=uCr(),ACr=T5e(),ZT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(ZT||(_d.TelemetryStore=ZT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(ZT||(_d.TelemetryStore=ZT={}));function Fge(t){return t===ZT.Enhanced}a(Fge,"isEnhanced");var jPa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],I5e=8192,HPa=21,j4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[qPa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Uge())}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=Uge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(UPa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(OPa.IEnvService),n=e.get(q4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,q4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,q4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${q4.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,q4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,q4.dumpForTelemetry)(e);r["copilot.build"]=q4.BuildInfo.getBuild(),r["copilot.buildType"]=q4.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(Fge(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>I5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+I5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(VPa,"telemetrizePromptLength");function Uge(){return performance.now()}a(Uge,"now");function WPa(t){return Math.floor(t/1e3)}a(WPa,"nowSeconds");function ECr(t){return t.get(gCr.ICompletionsTelemetryUserConfigService).optedIn}a(ECr,"shouldSendEnhanced");function dIi(t){return t.get(gCr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(dIi,"shouldSendFinetuningTelemetry");function _Cr(t,e,r,n){return t.get(ACr.ICompletionsPromiseQueueService).register(zPa(t,e,Uge(),r?.extendedBy(),n))}a(_Cr,"telemetry");async function zPa(t,e,r,n,o=ZT.Standard){let s=t.get(Agt.ICompletionsTelemetryService),c=t.get(mCr.IInstantiationService),l=n||j4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Fge(o)||c.invokeFunction(ECr))&&yCr(s,o,e,l),Fge(o)&&jPa.includes(e)&&c.invokeFunction(dIi)&&c.invokeFunction($Pa,o,e,l)}a(zPa,"_telemetry");function YPa(t,e){return t.get(ACr.ICompletionsPromiseQueueService).register(KPa(t,e,Uge()))}a(YPa,"telemetryExpProblem");async function KPa(t,e,r){let n=t.get(Agt.ICompletionsTelemetryService),o="expProblem",s=j4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,ZT.Standard,"SkipExp",r),yCr(n,ZT.Standard,o,s)}a(KPa,"_telemetryExpProblem");function JPa(t,e,r,n){let o=t.get(Agt.ICompletionsTelemetryService),s={...r,...fIi(t)};yCr(o,ZT.Standard,e,{properties:s,measurements:n})}a(JPa,"telemetryRaw");function fIi(t){let e=t.get(q4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,BPa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,q4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(gCr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(fIi,"createRequiredProperties");function pIi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(pIi,"telemetryException");function ZPa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){pIi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(ZPa,"telemetryCatch");function XPa(t,e,r,n){return t.get(ACr.ICompletionsPromiseQueueService).register(e2a(t,e,Uge(),r?.extendedBy(),n))}a(XPa,"telemetryError");async function e2a(t,e,r,n,o=ZT.Standard){if(Fge(o)&&!ECr(t))return;let s=t.get(mCr.IInstantiationService),c=n||j4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(GPa,o,e,c)}a(e2a,"_telemetryError");function t2a(t,e,r,n,o){let s=j4.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),_Cr(t,"engine.completion",s,ZT.Enhanced)}a(t2a,"logEngineCompletion");function r2a(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 _Cr(t,"engine.prompt",o,ZT.Enhanced)}a(r2a,"logEnginePrompt");var pCr=class{static{a(this,"CopilotTelemetryReporter")}};_d.CopilotTelemetryReporter=pCr;_d.ICompletionsTelemetryReporters=(0,LPa.createServiceIdentifier)("ICompletionsTelemetryReporters");var hCr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=ZT.Standard){return Fge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(ECr(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()))}};_d.TelemetryReporters=hCr});var Ste=I(hD=>{"use strict";p();var n2a=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},i2a=hD&&hD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(hD,"__esModule",{value:!0});hD.CompletionsTelemetryServiceBridge=hD.ICompletionsTelemetryService=void 0;var o2a=ym(),vCr=kvr(),s2a=nn(),x5e=Vg();hD.ICompletionsTelemetryService=(0,s2a.createServiceIdentifier)("completionsTelemetryService");var CCr=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,vCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??x5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,vCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??x5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,vCr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??x5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??x5e.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 x5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};hD.CompletionsTelemetryServiceBridge=CCr;hD.CompletionsTelemetryServiceBridge=CCr=n2a([i2a(0,o2a.ITelemetryService)],CCr)});var hIi=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.CopilotExtensionStatus=Qge.ICompletionsExtensionStatus=void 0;var a2a=nn();Qge.ICompletionsExtensionStatus=(0,a2a.createServiceIdentifier)("ICompletionsExtensionStatus");var bCr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};Qge.CopilotExtensionStatus=bCr});var ygt=I(mD=>{"use strict";p();Object.defineProperty(mD,"__esModule",{value:!0});mD.CopilotToken=void 0;mD.containsInternalOrg=mIi;mD.containsVSCodeOrg=yIi;mD.validateTokenEnvelope=EIi;mD.isTokenEnvelope=p2a;mD.isErrorEnvelope=h2a;mD.isStandardErrorEnvelope=m2a;mD.createTestExtendedTokenInfo=g2a;var Qn=NG();function mIi(t){return gIi(t)||AIi(t)}a(mIi,"containsInternalOrg");function gIi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(gIi,"containsGitHubOrg");function AIi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(AIi,"containsMicrosoftOrg");function yIi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(yIi,"containsVSCodeOrg");var SCr=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 mIi(this.organizationList)}get isMicrosoftInternal(){return AIi(this.organizationList)}get isGitHubInternal(){return gIi(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||yIi(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"}};mD.CopilotToken=SCr;var c2a=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),notification_id:(0,Qn.vRequired)((0,Qn.vString)()),title:(0,Qn.vRequired)((0,Qn.vString)()),url:(0,Qn.vRequired)((0,Qn.vString)())}),l2a=(0,Qn.vObj)({can_signup_for_limited:(0,Qn.vNullable)((0,Qn.vBoolean)()),error_details:(0,Qn.vRequired)(c2a),message:(0,Qn.vRequired)((0,Qn.vString)()),reason:(0,Qn.vString)()}),u2a=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)()),sku:(0,Qn.vString)(),individual:(0,Qn.vBoolean)(),blackbird_clientside_indexing:(0,Qn.vBoolean)(),code_quote_enabled:(0,Qn.vBoolean)(),code_review_enabled:(0,Qn.vBoolean)(),codesearch:(0,Qn.vBoolean)(),copilotignore_enabled:(0,Qn.vBoolean)(),public_suggestions:(0,Qn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Qn.vEnum)("enabled","disabled"),endpoints:(0,Qn.vObj)({api:(0,Qn.vString)(),"origin-tracker":(0,Qn.vString)(),proxy:(0,Qn.vString)(),telemetry:(0,Qn.vString)()}),enterprise_list:(0,Qn.vNullable)((0,Qn.vArray)((0,Qn.vNumber)())),limited_user_quotas:(0,Qn.vNullable)((0,Qn.vObj)({chat:(0,Qn.vRequired)((0,Qn.vNumber)()),completions:(0,Qn.vRequired)((0,Qn.vNumber)())})),limited_user_reset_date:(0,Qn.vNullable)((0,Qn.vNumber)()),organization_list:(0,Qn.vArray)((0,Qn.vString)())}),d2a=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),documentation_url:(0,Qn.vRequired)((0,Qn.vString)()),status:(0,Qn.vRequired)((0,Qn.vString)())}),f2a=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)())});function EIi(t){let e=u2a.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=f2a.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(EIi,"validateTokenEnvelope");function p2a(t){return EIi(t).valid}a(p2a,"isTokenEnvelope");function h2a(t){return l2a.validate(t).error===void 0}a(h2a,"isErrorEnvelope");function m2a(t){return d2a.validate(t).error===void 0}a(m2a,"isStandardErrorEnvelope");function g2a(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(g2a,"createTestExtendedTokenInfo")});var qge=I(XT=>{"use strict";p();var A2a=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},y2a=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 E2a=UE(),_2a=nn(),v2a=nl(),C2a=ko(),b2a=ygt();Object.defineProperty(XT,"CopilotToken",{enumerable:!0,get:a(function(){return b2a.CopilotToken},"get")});XT.ICompletionsCopilotTokenManager=(0,_2a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var TCr=class extends C2a.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 v2a.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidCopilotTokenChange(()=>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=TCr;XT.CopilotTokenManagerImpl=TCr=A2a([y2a(1,E2a.IAuthenticationService)],TCr)});var Egt=I(jge=>{"use strict";p();Object.defineProperty(jge,"__esModule",{value:!0});jge.NoOpCitationManager=jge.ICompletionsCitationManager=void 0;var S2a=nn(),T2a=ko();jge.ICompletionsCitationManager=(0,S2a.createServiceIdentifier)("ICompletionsCitationManager");var ICr=class{static{a(this,"NoOpCitationManager")}register(){return T2a.Disposable.None}async handleIPCodeCitation(e){}};jge.NoOpCitationManager=ICr});var wv=I(zg=>{"use strict";p();Object.defineProperty(zg,"__esModule",{value:!0});zg.HasPropertyKey=I2a;zg.IsAsyncIterator=x2a;zg.IsArray=xCr;zg.IsBigInt=w2a;zg.IsBoolean=R2a;zg.IsDate=k2a;zg.IsFunction=P2a;zg.IsIterator=D2a;zg.IsNull=N2a;zg.IsNumber=M2a;zg.IsObject=wCr;zg.IsRegExp=O2a;zg.IsString=L2a;zg.IsSymbol=B2a;zg.IsUint8Array=RCr;zg.IsUndefined=F2a;function I2a(t,e){return e in t}a(I2a,"HasPropertyKey");function x2a(t){return wCr(t)&&!xCr(t)&&!RCr(t)&&Symbol.asyncIterator in t}a(x2a,"IsAsyncIterator");function xCr(t){return Array.isArray(t)}a(xCr,"IsArray");function w2a(t){return typeof t=="bigint"}a(w2a,"IsBigInt");function R2a(t){return typeof t=="boolean"}a(R2a,"IsBoolean");function k2a(t){return t instanceof globalThis.Date}a(k2a,"IsDate");function P2a(t){return typeof t=="function"}a(P2a,"IsFunction");function D2a(t){return wCr(t)&&!xCr(t)&&!RCr(t)&&Symbol.iterator in t}a(D2a,"IsIterator");function N2a(t){return t===null}a(N2a,"IsNull");function M2a(t){return typeof t=="number"}a(M2a,"IsNumber");function wCr(t){return typeof t=="object"&&t!==null}a(wCr,"IsObject");function O2a(t){return t instanceof globalThis.RegExp}a(O2a,"IsRegExp");function L2a(t){return typeof t=="string"}a(L2a,"IsString");function B2a(t){return typeof t=="symbol"}a(B2a,"IsSymbol");function RCr(t){return t instanceof globalThis.Uint8Array}a(RCr,"IsUint8Array");function F2a(t){return t===void 0}a(F2a,"IsUndefined")});var Yb=I(t6=>{"use strict";p();var U2a=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]})),Q2a=t6&&t6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),q2a=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_gt(e))}a(j2a,"ArrayType");function H2a(t){return new Date(t.getTime())}a(H2a,"DateType");function G2a(t){return new Uint8Array(t)}a(G2a,"Uint8ArrayType");function $2a(t){return new RegExp(t.source,t.flags)}a($2a,"RegExpType");function V2a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=_gt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=_gt(t[r]);return e}a(V2a,"ObjectType");function _gt(t){return w5e.IsArray(t)?j2a(t):w5e.IsDate(t)?H2a(t):w5e.IsUint8Array(t)?G2a(t):w5e.IsRegExp(t)?$2a(t):w5e.IsObject(t)?V2a(t):t}a(_gt,"Visit");function W2a(t){return _gt(t)}a(W2a,"Clone")});var Cgt=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.CloneRest=z2a;vgt.CloneType=vIi;var _Ii=Yb();function z2a(t){return t.map(e=>vIi(e))}a(z2a,"CloneRest");function vIi(t,e){return e===void 0?(0,_Ii.Clone)(t):(0,_Ii.Clone)({...e,...t})}a(vIi,"CloneType")});var kCr=I(FG=>{"use strict";p();var Y2a=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]})),CIi=FG&&FG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Y2a(e,t,r)};Object.defineProperty(FG,"__esModule",{value:!0});CIi(Cgt(),FG);CIi(Yb(),FG)});var bgt=I(Ea=>{"use strict";p();Object.defineProperty(Ea,"__esModule",{value:!0});Ea.IsAsyncIterator=K2a;Ea.IsIterator=J2a;Ea.IsStandardObject=Z2a;Ea.IsInstanceObject=X2a;Ea.IsPromise=eDa;Ea.IsDate=tDa;Ea.IsMap=rDa;Ea.IsSet=nDa;Ea.IsRegExp=iDa;Ea.IsTypedArray=oDa;Ea.IsInt8Array=sDa;Ea.IsUint8Array=aDa;Ea.IsUint8ClampedArray=cDa;Ea.IsInt16Array=lDa;Ea.IsUint16Array=uDa;Ea.IsInt32Array=dDa;Ea.IsUint32Array=fDa;Ea.IsFloat32Array=pDa;Ea.IsFloat64Array=hDa;Ea.IsBigInt64Array=mDa;Ea.IsBigUint64Array=gDa;Ea.HasPropertyKey=ADa;Ea.IsObject=R5e;Ea.IsArray=bIi;Ea.IsUndefined=SIi;Ea.IsNull=TIi;Ea.IsBoolean=IIi;Ea.IsNumber=xIi;Ea.IsInteger=yDa;Ea.IsBigInt=wIi;Ea.IsString=RIi;Ea.IsFunction=kIi;Ea.IsSymbol=PIi;Ea.IsValueType=EDa;function K2a(t){return R5e(t)&&globalThis.Symbol.asyncIterator in t}a(K2a,"IsAsyncIterator");function J2a(t){return R5e(t)&&globalThis.Symbol.iterator in t}a(J2a,"IsIterator");function Z2a(t){return R5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(Z2a,"IsStandardObject");function X2a(t){return R5e(t)&&!bIi(t)&&kIi(t.constructor)&&t.constructor.name!=="Object"}a(X2a,"IsInstanceObject");function eDa(t){return t instanceof globalThis.Promise}a(eDa,"IsPromise");function tDa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(tDa,"IsDate");function rDa(t){return t instanceof globalThis.Map}a(rDa,"IsMap");function nDa(t){return t instanceof globalThis.Set}a(nDa,"IsSet");function iDa(t){return t instanceof globalThis.RegExp}a(iDa,"IsRegExp");function oDa(t){return globalThis.ArrayBuffer.isView(t)}a(oDa,"IsTypedArray");function sDa(t){return t instanceof globalThis.Int8Array}a(sDa,"IsInt8Array");function aDa(t){return t instanceof globalThis.Uint8Array}a(aDa,"IsUint8Array");function cDa(t){return t instanceof globalThis.Uint8ClampedArray}a(cDa,"IsUint8ClampedArray");function lDa(t){return t instanceof globalThis.Int16Array}a(lDa,"IsInt16Array");function uDa(t){return t instanceof globalThis.Uint16Array}a(uDa,"IsUint16Array");function dDa(t){return t instanceof globalThis.Int32Array}a(dDa,"IsInt32Array");function fDa(t){return t instanceof globalThis.Uint32Array}a(fDa,"IsUint32Array");function pDa(t){return t instanceof globalThis.Float32Array}a(pDa,"IsFloat32Array");function hDa(t){return t instanceof globalThis.Float64Array}a(hDa,"IsFloat64Array");function mDa(t){return t instanceof globalThis.BigInt64Array}a(mDa,"IsBigInt64Array");function gDa(t){return t instanceof globalThis.BigUint64Array}a(gDa,"IsBigUint64Array");function ADa(t,e){return e in t}a(ADa,"HasPropertyKey");function R5e(t){return t!==null&&typeof t=="object"}a(R5e,"IsObject");function bIi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(bIi,"IsArray");function SIi(t){return t===void 0}a(SIi,"IsUndefined");function TIi(t){return t===null}a(TIi,"IsNull");function IIi(t){return typeof t=="boolean"}a(IIi,"IsBoolean");function xIi(t){return typeof t=="number"}a(xIi,"IsNumber");function yDa(t){return globalThis.Number.isInteger(t)}a(yDa,"IsInteger");function wIi(t){return typeof t=="bigint"}a(wIi,"IsBigInt");function RIi(t){return typeof t=="string"}a(RIi,"IsString");function kIi(t){return typeof t=="function"}a(kIi,"IsFunction");function PIi(t){return typeof t=="symbol"}a(PIi,"IsSymbol");function EDa(t){return wIi(t)||IIi(t)||TIi(t)||xIi(t)||RIi(t)||PIi(t)||SIi(t)}a(EDa,"IsValueType")});var k0=I(Tte=>{"use strict";p();var _Da=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]})),vDa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Da(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});vDa(bgt(),Tte)});var k5e=I(Tgt=>{"use strict";p();Object.defineProperty(Tgt,"__esModule",{value:!0});Tgt.TypeSystemPolicy=void 0;var Sgt=k0(),DIi;(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,Sgt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,Sgt.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,Sgt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,Sgt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(DIi||(Tgt.TypeSystemPolicy=DIi={}))});var NIi=I(r6=>{"use strict";p();var CDa=r6&&r6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bDa=r6&&r6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),SDa=r6&&r6.__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;oIgt(e))}a(TDa,"ImmutableArray");function IDa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Igt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Igt(t[r]);return globalThis.Object.freeze(e)}a(IDa,"ImmutableObject");function Igt(t){return P5e.IsArray(t)?TDa(t):P5e.IsDate(t)?t:P5e.IsUint8Array(t)?t:P5e.IsRegExp(t)?t:P5e.IsObject(t)?IDa(t):t}a(Igt,"Immutable")});var Ii=I(PCr=>{"use strict";p();Object.defineProperty(PCr,"__esModule",{value:!0});PCr.CreateType=kDa;var xDa=k5e(),wDa=NIi(),RDa=Yb();function kDa(t,e){let r=e!==void 0?{...e,...t}:t;switch(xDa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,wDa.Immutable)(r);case"clone":return(0,RDa.Clone)(r);default:return r}}a(kDa,"CreateType")});var n6=I(Ite=>{"use strict";p();var PDa=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]})),DDa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PDa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});DDa(Ii(),Ite)});var NCr=I(xgt=>{"use strict";p();Object.defineProperty(xgt,"__esModule",{value:!0});xgt.TypeBoxError=void 0;var DCr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};xgt.TypeBoxError=DCr});var Of=I(xte=>{"use strict";p();var NDa=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]})),MDa=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NDa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});MDa(NCr(),xte)});var D5e=I(wR=>{"use strict";p();Object.defineProperty(wR,"__esModule",{value:!0});wR.Kind=wR.Hint=wR.OptionalKind=wR.ReadonlyKind=wR.TransformKind=void 0;wR.TransformKind=Symbol.for("TypeBox.Transform");wR.ReadonlyKind=Symbol.for("TypeBox.Readonly");wR.OptionalKind=Symbol.for("TypeBox.Optional");wR.Hint=Symbol.for("TypeBox.Hint");wR.Kind=Symbol.for("TypeBox.Kind")});var Sn=I(wte=>{"use strict";p();var ODa=wte&&wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LDa=wte&&wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ODa(e,t,r)};Object.defineProperty(wte,"__esModule",{value:!0});LDa(D5e(),wte)});var vs=I(ui=>{"use strict";p();var BDa=ui&&ui.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),UDa=ui&&ui.__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 JDa=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]})),ZDa=Yn&&Yn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XDa=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(OCr,"IsControlCharacterFree");function Axi(t){return LCr(t)||Yg(t)}a(Axi,"IsAdditionalProperties");function M5e(t){return oi.IsUndefined(t)||oi.IsBigInt(t)}a(M5e,"IsOptionalBigInt");function Zl(t){return oi.IsUndefined(t)||oi.IsNumber(t)}a(Zl,"IsOptionalNumber");function LCr(t){return oi.IsUndefined(t)||oi.IsBoolean(t)}a(LCr,"IsOptionalBoolean");function hl(t){return oi.IsUndefined(t)||oi.IsString(t)}a(hl,"IsOptionalString");function rNa(t){return oi.IsUndefined(t)||oi.IsString(t)&&OCr(t)&&gxi(t)}a(rNa,"IsOptionalPattern");function nNa(t){return oi.IsUndefined(t)||oi.IsString(t)&&OCr(t)}a(nNa,"IsOptionalFormat");function yxi(t){return oi.IsUndefined(t)||Yg(t)}a(yxi,"IsOptionalSchema");function iNa(t){return oi.IsObject(t)&&t[H4.ReadonlyKind]==="Readonly"}a(iNa,"IsReadonly");function oNa(t){return oi.IsObject(t)&&t[H4.OptionalKind]==="Optional"}a(oNa,"IsOptional");function Exi(t){return Vs(t,"Any")&&hl(t.$id)}a(Exi,"IsAny");function _xi(t){return Vs(t,"Argument")&&oi.IsNumber(t.index)}a(_xi,"IsArgument");function vxi(t){return Vs(t,"Array")&&t.type==="array"&&hl(t.$id)&&Yg(t.items)&&Zl(t.minItems)&&Zl(t.maxItems)&&LCr(t.uniqueItems)&&yxi(t.contains)&&Zl(t.minContains)&&Zl(t.maxContains)}a(vxi,"IsArray");function Cxi(t){return Vs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&hl(t.$id)&&Yg(t.items)}a(Cxi,"IsAsyncIterator");function bxi(t){return Vs(t,"BigInt")&&t.type==="bigint"&&hl(t.$id)&&M5e(t.exclusiveMaximum)&&M5e(t.exclusiveMinimum)&&M5e(t.maximum)&&M5e(t.minimum)&&M5e(t.multipleOf)}a(bxi,"IsBigInt");function Sxi(t){return Vs(t,"Boolean")&&t.type==="boolean"&&hl(t.$id)}a(Sxi,"IsBoolean");function Txi(t){return Vs(t,"Computed")&&oi.IsString(t.target)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>Yg(e))}a(Txi,"IsComputed");function Ixi(t){return Vs(t,"Constructor")&&t.type==="Constructor"&&hl(t.$id)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>Yg(e))&&Yg(t.returns)}a(Ixi,"IsConstructor");function xxi(t){return Vs(t,"Date")&&t.type==="Date"&&hl(t.$id)&&Zl(t.exclusiveMaximumTimestamp)&&Zl(t.exclusiveMinimumTimestamp)&&Zl(t.maximumTimestamp)&&Zl(t.minimumTimestamp)&&Zl(t.multipleOfTimestamp)}a(xxi,"IsDate");function wxi(t){return Vs(t,"Function")&&t.type==="Function"&&hl(t.$id)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>Yg(e))&&Yg(t.returns)}a(wxi,"IsFunction");function sNa(t){return Vs(t,"Import")&&oi.HasPropertyKey(t,"$defs")&&oi.IsObject(t.$defs)&&wgt(t.$defs)&&oi.HasPropertyKey(t,"$ref")&&oi.IsString(t.$ref)&&t.$ref in t.$defs}a(sNa,"IsImport");function Rxi(t){return Vs(t,"Integer")&&t.type==="integer"&&hl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Rxi,"IsInteger");function wgt(t){return oi.IsObject(t)&&Object.entries(t).every(([e,r])=>OCr(e)&&Yg(r))}a(wgt,"IsProperties");function kxi(t){return Vs(t,"Intersect")&&!(oi.IsString(t.type)&&t.type!=="object")&&oi.IsArray(t.allOf)&&t.allOf.every(e=>Yg(e)&&!Kxi(e))&&hl(t.type)&&(LCr(t.unevaluatedProperties)||yxi(t.unevaluatedProperties))&&hl(t.$id)}a(kxi,"IsIntersect");function Pxi(t){return Vs(t,"Iterator")&&t.type==="Iterator"&&hl(t.$id)&&Yg(t.items)}a(Pxi,"IsIterator");function Vs(t,e){return oi.IsObject(t)&&H4.Kind in t&&t[H4.Kind]===e}a(Vs,"IsKindOf");function Dxi(t){return O5e(t)&&oi.IsString(t.const)}a(Dxi,"IsLiteralString");function Nxi(t){return O5e(t)&&oi.IsNumber(t.const)}a(Nxi,"IsLiteralNumber");function aNa(t){return O5e(t)&&oi.IsBoolean(t.const)}a(aNa,"IsLiteralBoolean");function O5e(t){return Vs(t,"Literal")&&hl(t.$id)&&Mxi(t.const)}a(O5e,"IsLiteral");function Mxi(t){return oi.IsBoolean(t)||oi.IsNumber(t)||oi.IsString(t)}a(Mxi,"IsLiteralValue");function Oxi(t){return Vs(t,"MappedKey")&&oi.IsArray(t.keys)&&t.keys.every(e=>oi.IsNumber(e)||oi.IsString(e))}a(Oxi,"IsMappedKey");function Lxi(t){return Vs(t,"MappedResult")&&wgt(t.properties)}a(Lxi,"IsMappedResult");function Bxi(t){return Vs(t,"Never")&&oi.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Bxi,"IsNever");function Fxi(t){return Vs(t,"Not")&&Yg(t.not)}a(Fxi,"IsNot");function Uxi(t){return Vs(t,"Null")&&t.type==="null"&&hl(t.$id)}a(Uxi,"IsNull");function Qxi(t){return Vs(t,"Number")&&t.type==="number"&&hl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Qxi,"IsNumber");function qxi(t){return Vs(t,"Object")&&t.type==="object"&&hl(t.$id)&&wgt(t.properties)&&Axi(t.additionalProperties)&&Zl(t.minProperties)&&Zl(t.maxProperties)}a(qxi,"IsObject");function jxi(t){return Vs(t,"Promise")&&t.type==="Promise"&&hl(t.$id)&&Yg(t.item)}a(jxi,"IsPromise");function Hxi(t){return Vs(t,"Record")&&t.type==="object"&&hl(t.$id)&&Axi(t.additionalProperties)&&oi.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&gxi(r[0])&&oi.IsObject(e.patternProperties)&&Yg(e.patternProperties[r[0]])})(t)}a(Hxi,"IsRecord");function cNa(t){return oi.IsObject(t)&&H4.Hint in t&&t[H4.Hint]==="Recursive"}a(cNa,"IsRecursive");function Gxi(t){return Vs(t,"Ref")&&hl(t.$id)&&oi.IsString(t.$ref)}a(Gxi,"IsRef");function $xi(t){return Vs(t,"RegExp")&&hl(t.$id)&&oi.IsString(t.source)&&oi.IsString(t.flags)&&Zl(t.maxLength)&&Zl(t.minLength)}a($xi,"IsRegExp");function Vxi(t){return Vs(t,"String")&&t.type==="string"&&hl(t.$id)&&Zl(t.minLength)&&Zl(t.maxLength)&&rNa(t.pattern)&&nNa(t.format)}a(Vxi,"IsString");function Wxi(t){return Vs(t,"Symbol")&&t.type==="symbol"&&hl(t.$id)}a(Wxi,"IsSymbol");function zxi(t){return Vs(t,"TemplateLiteral")&&t.type==="string"&&oi.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(zxi,"IsTemplateLiteral");function Yxi(t){return Vs(t,"This")&&hl(t.$id)&&oi.IsString(t.$ref)}a(Yxi,"IsThis");function Kxi(t){return oi.IsObject(t)&&H4.TransformKind in t}a(Kxi,"IsTransform");function Jxi(t){return Vs(t,"Tuple")&&t.type==="array"&&hl(t.$id)&&oi.IsNumber(t.minItems)&&oi.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(oi.IsUndefined(t.items)&&oi.IsUndefined(t.additionalItems)&&t.minItems===0||oi.IsArray(t.items)&&t.items.every(e=>Yg(e)))}a(Jxi,"IsTuple");function Zxi(t){return Vs(t,"Undefined")&&t.type==="undefined"&&hl(t.$id)}a(Zxi,"IsUndefined");function lNa(t){return BCr(t)&&t.anyOf.every(e=>Dxi(e)||Nxi(e))}a(lNa,"IsUnionLiteral");function BCr(t){return Vs(t,"Union")&&hl(t.$id)&&oi.IsObject(t)&&oi.IsArray(t.anyOf)&&t.anyOf.every(e=>Yg(e))}a(BCr,"IsUnion");function Xxi(t){return Vs(t,"Uint8Array")&&t.type==="Uint8Array"&&hl(t.$id)&&Zl(t.minByteLength)&&Zl(t.maxByteLength)}a(Xxi,"IsUint8Array");function ewi(t){return Vs(t,"Unknown")&&hl(t.$id)}a(ewi,"IsUnknown");function twi(t){return Vs(t,"Unsafe")}a(twi,"IsUnsafe");function rwi(t){return Vs(t,"Void")&&t.type==="void"&&hl(t.$id)}a(rwi,"IsVoid");function nwi(t){return oi.IsObject(t)&&H4.Kind in t&&oi.IsString(t[H4.Kind])&&!tNa.includes(t[H4.Kind])}a(nwi,"IsKind");function Yg(t){return oi.IsObject(t)&&(Exi(t)||_xi(t)||vxi(t)||Sxi(t)||bxi(t)||Cxi(t)||Txi(t)||Ixi(t)||xxi(t)||wxi(t)||Rxi(t)||kxi(t)||Pxi(t)||O5e(t)||Oxi(t)||Lxi(t)||Bxi(t)||Fxi(t)||Uxi(t)||Qxi(t)||qxi(t)||jxi(t)||Hxi(t)||Gxi(t)||$xi(t)||Vxi(t)||Wxi(t)||zxi(t)||Yxi(t)||Jxi(t)||Zxi(t)||BCr(t)||Xxi(t)||ewi(t)||twi(t)||rwi(t)||nwi(t))}a(Yg,"IsSchema")});var UCr=I(Jb=>{"use strict";p();var uNa=Jb&&Jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dNa=Jb&&Jb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FCr=Jb&&Jb.__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(QCr,"__esModule",{value:!0});QCr.Increment=fNa;function fNa(t){return(parseInt(t)+1).toString()}a(fNa,"Increment")});var swi=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(owi(),Rte)});var awi=I(xp=>{"use strict";p();Object.defineProperty(xp,"__esModule",{value:!0});xp.PatternNeverExact=xp.PatternStringExact=xp.PatternNumberExact=xp.PatternBooleanExact=xp.PatternNever=xp.PatternString=xp.PatternNumber=xp.PatternBoolean=void 0;xp.PatternBoolean="(true|false)";xp.PatternNumber="(0|[1-9][0-9]*)";xp.PatternString="(.*)";xp.PatternNever="(?!.*)";xp.PatternBooleanExact=`^${xp.PatternBoolean}$`;xp.PatternNumberExact=`^${xp.PatternNumber}$`;xp.PatternStringExact=`^${xp.PatternString}$`;xp.PatternNeverExact=`^${xp.PatternNever}$`});var L5e=I(kte=>{"use strict";p();var mNa=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]})),gNa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mNa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});gNa(awi(),kte)});var cwi=I(UG=>{"use strict";p();Object.defineProperty(UG,"__esModule",{value:!0});UG.Entries=ANa;UG.Clear=yNa;UG.Delete=ENa;UG.Has=_Na;UG.Set=vNa;UG.Get=CNa;var Hge=new Map;function ANa(){return new Map(Hge)}a(ANa,"Entries");function yNa(){return Hge.clear()}a(yNa,"Clear");function ENa(t){return Hge.delete(t)}a(ENa,"Delete");function _Na(t){return Hge.has(t)}a(_Na,"Has");function vNa(t,e){Hge.set(t,e)}a(vNa,"Set");function CNa(t){return Hge.get(t)}a(CNa,"Get")});var lwi=I(QG=>{"use strict";p();Object.defineProperty(QG,"__esModule",{value:!0});QG.Entries=bNa;QG.Clear=SNa;QG.Delete=TNa;QG.Has=INa;QG.Set=xNa;QG.Get=wNa;var Gge=new Map;function bNa(){return new Map(Gge)}a(bNa,"Entries");function SNa(){return Gge.clear()}a(SNa,"Clear");function TNa(t){return Gge.delete(t)}a(TNa,"Delete");function INa(t){return Gge.has(t)}a(INa,"Has");function xNa(t,e){Gge.set(t,e)}a(xNa,"Set");function wNa(t){return Gge.get(t)}a(wNa,"Get")});var $ge=I(RR=>{"use strict";p();var RNa=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]})),kNa=RR&&RR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uwi=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{"use strict";p();Object.defineProperty(G4,"__esModule",{value:!0});G4.SetIncludes=dwi;G4.SetIsSubset=PNa;G4.SetDistinct=DNa;G4.SetIntersect=fwi;G4.SetUnion=NNa;G4.SetComplement=MNa;G4.SetIntersectMany=LNa;G4.SetUnionMany=BNa;function dwi(t,e){return t.includes(e)}a(dwi,"SetIncludes");function PNa(t,e){return t.every(r=>dwi(e,r))}a(PNa,"SetIsSubset");function DNa(t){return[...new Set(t)]}a(DNa,"SetDistinct");function fwi(t,e){return t.filter(r=>e.includes(r))}a(fwi,"SetIntersect");function NNa(t,e){return[...t,...e]}a(NNa,"SetUnion");function MNa(t,e){return t.filter(r=>!e.includes(r))}a(MNa,"SetComplement");function ONa(t,e){return t.reduce((r,n)=>fwi(r,n),e)}a(ONa,"SetIntersectManyResolve");function LNa(t){return t.length===1?t[0]:t.length>1?ONa(t.slice(1),t[0]):[]}a(LNa,"SetIntersectMany");function BNa(t){let e=[];for(let r of t)e.push(...r);return e}a(BNa,"SetUnionMany")});var B5e=I(Pte=>{"use strict";p();var FNa=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]})),UNa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FNa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});UNa(pwi(),Pte)});var hwi=I(qCr=>{"use strict";p();Object.defineProperty(qCr,"__esModule",{value:!0});qCr.Any=jNa;var QNa=n6(),qNa=Sn();function jNa(t){return(0,QNa.CreateType)({[qNa.Kind]:"Any"},t)}a(jNa,"Any")});var Vge=I(Dte=>{"use strict";p();var HNa=Dte&&Dte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GNa=Dte&&Dte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HNa(e,t,r)};Object.defineProperty(Dte,"__esModule",{value:!0});GNa(hwi(),Dte)});var mwi=I(jCr=>{"use strict";p();Object.defineProperty(jCr,"__esModule",{value:!0});jCr.Array=WNa;var $Na=Ii(),VNa=Sn();function WNa(t,e){return(0,$Na.CreateType)({[VNa.Kind]:"Array",type:"array",items:t},e)}a(WNa,"Array")});var Wge=I(Nte=>{"use strict";p();var zNa=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]})),YNa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zNa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});YNa(mwi(),Nte)});var gwi=I(HCr=>{"use strict";p();Object.defineProperty(HCr,"__esModule",{value:!0});HCr.Argument=ZNa;var KNa=Ii(),JNa=Sn();function ZNa(t){return(0,KNa.CreateType)({[JNa.Kind]:"Argument",index:t})}a(ZNa,"Argument")});var Rgt=I(Mte=>{"use strict";p();var XNa=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]})),eMa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XNa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});eMa(gwi(),Mte)});var Awi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.AsyncIterator=nMa;var tMa=Sn(),rMa=Ii();function nMa(t,e){return(0,rMa.CreateType)({[tMa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(nMa,"AsyncIterator")});var zge=I(Ote=>{"use strict";p();var iMa=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]})),oMa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iMa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});oMa(Awi(),Ote)});var ywi=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.Computed=cMa;var sMa=n6(),aMa=D5e();function cMa(t,e,r){return(0,sMa.CreateType)({[aMa.Kind]:"Computed",target:t,parameters:e},r)}a(cMa,"Computed")});var qG=I(Lte=>{"use strict";p();var lMa=Lte&&Lte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uMa=Lte&&Lte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lMa(e,t,r)};Object.defineProperty(Lte,"__esModule",{value:!0});uMa(ywi(),Lte)});var kgt=I(VCr=>{"use strict";p();Object.defineProperty(VCr,"__esModule",{value:!0});VCr.Discard=fMa;function dMa(t,e){let{[e]:r,...n}=t;return n}a(dMa,"DiscardKey");function fMa(t,e){return e.reduce((r,n)=>dMa(r,n),t)}a(fMa,"Discard")});var o6=I(Bte=>{"use strict";p();var pMa=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]})),hMa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pMa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});hMa(kgt(),Bte)});var Ewi=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Never=AMa;var mMa=Ii(),gMa=Sn();function AMa(t){return(0,mMa.CreateType)({[gMa.Kind]:"Never",not:{}},t)}a(AMa,"Never")});var Sm=I(Fte=>{"use strict";p();var yMa=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]})),EMa=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yMa(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});EMa(Ewi(),Fte)});var _wi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.MappedKey=CMa;var _Ma=Ii(),vMa=Sn();function CMa(t){return(0,_Ma.CreateType)({[vMa.Kind]:"MappedKey",keys:t})}a(CMa,"MappedKey")});var KCr=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.MappedResult=TMa;var bMa=Ii(),SMa=Sn();function TMa(t){return(0,bMa.CreateType)({[SMa.Kind]:"MappedResult",properties:t})}a(TMa,"MappedResult")});var vwi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.Constructor=wMa;var IMa=Ii(),xMa=Sn();function wMa(t,e,r){return(0,IMa.CreateType)({[xMa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(wMa,"Constructor")});var Yge=I(Ute=>{"use strict";p();var RMa=Ute&&Ute.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kMa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RMa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});kMa(vwi(),Ute)});var Cwi=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.Function=NMa;var PMa=Ii(),DMa=Sn();function NMa(t,e,r){return(0,PMa.CreateType)({[DMa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(NMa,"Function")});var jG=I(Qte=>{"use strict";p();var MMa=Qte&&Qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OMa=Qte&&Qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MMa(e,t,r)};Object.defineProperty(Qte,"__esModule",{value:!0});OMa(Cwi(),Qte)});var ebr=I(XCr=>{"use strict";p();Object.defineProperty(XCr,"__esModule",{value:!0});XCr.UnionCreate=FMa;var LMa=Ii(),BMa=Sn();function FMa(t,e){return(0,LMa.CreateType)({[BMa.Kind]:"Union",anyOf:t},e)}a(FMa,"UnionCreate")});var Iwi=I(tbr=>{"use strict";p();Object.defineProperty(tbr,"__esModule",{value:!0});tbr.UnionEvaluated=WMa;var UMa=Ii(),QMa=Sn(),qMa=o6(),jMa=Sm(),HMa=$4(),bwi=ebr(),Twi=vs();function GMa(t){return t.some(e=>(0,Twi.IsOptional)(e))}a(GMa,"IsUnionOptional");function Swi(t){return t.map(e=>(0,Twi.IsOptional)(e)?$Ma(e):e)}a(Swi,"RemoveOptionalFromRest");function $Ma(t){return(0,qMa.Discard)(t,[QMa.OptionalKind])}a($Ma,"RemoveOptionalFromType");function VMa(t,e){return GMa(t)?(0,HMa.Optional)((0,bwi.UnionCreate)(Swi(t),e)):(0,bwi.UnionCreate)(Swi(t),e)}a(VMa,"ResolveUnion");function WMa(t,e){return t.length===1?(0,UMa.CreateType)(t[0],e):t.length===0?(0,jMa.Never)(e):VMa(t,e)}a(WMa,"UnionEvaluated")});var wwi=I(xwi=>{"use strict";p();Object.defineProperty(xwi,"__esModule",{value:!0});var _Tp=Sn()});var Rwi=I(rbr=>{"use strict";p();Object.defineProperty(rbr,"__esModule",{value:!0});rbr.Union=JMa;var zMa=Sm(),YMa=Ii(),KMa=ebr();function JMa(t,e){return t.length===0?(0,zMa.Never)(e):t.length===1?(0,YMa.CreateType)(t[0],e):(0,KMa.UnionCreate)(t,e)}a(JMa,"Union")});var wp=I(s6=>{"use strict";p();var ZMa=s6&&s6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nbr=s6&&s6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZMa(e,t,r)};Object.defineProperty(s6,"__esModule",{value:!0});nbr(Iwi(),s6);nbr(wwi(),s6);nbr(Rwi(),s6)});var Pgt=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.TemplateLiteralParserError=void 0;Kge.TemplateLiteralParse=qte;Kge.TemplateLiteralParseExact=aOa;var XMa=Of(),F5e=class extends XMa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};Kge.TemplateLiteralParserError=F5e;function eOa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(eOa,"Unescape");function ibr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(ibr,"IsNonEscaped");function a6(t,e){return ibr(t,e,"(")}a(a6,"IsOpenParen");function U5e(t,e){return ibr(t,e,")")}a(U5e,"IsCloseParen");function kwi(t,e){return ibr(t,e,"|")}a(kwi,"IsSeparator");function tOa(t){if(!(a6(t,0)&&U5e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(qte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(qte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(oOa,"Or");function sOa(t){function e(o,s){if(!a6(o,s))throw new F5e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(qte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(sOa,"And");function qte(t){return tOa(t)?qte(rOa(t)):nOa(t)?oOa(t):iOa(t)?sOa(t):{type:"const",const:eOa(t)}}a(qte,"TemplateLiteralParse");function aOa(t){return qte(t.slice(1,t.length-1))}a(aOa,"TemplateLiteralParseExact")});var obr=I(Jge=>{"use strict";p();Object.defineProperty(Jge,"__esModule",{value:!0});Jge.TemplateLiteralFiniteError=void 0;Jge.IsTemplateLiteralExpressionFinite=Ngt;Jge.IsTemplateLiteralFinite=pOa;var cOa=Pgt(),lOa=Of(),Dgt=class extends lOa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Jge.TemplateLiteralFiniteError=Dgt;function uOa(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(uOa,"IsNumberExpression");function dOa(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(dOa,"IsBooleanExpression");function fOa(t){return t.type==="const"&&t.const===".*"}a(fOa,"IsStringExpression");function Ngt(t){return uOa(t)||fOa(t)?!1:dOa(t)?!0:t.type==="and"?t.expr.every(e=>Ngt(e)):t.type==="or"?t.expr.every(e=>Ngt(e)):t.type==="const"?!0:(()=>{throw new Dgt("Unknown expression type")})()}a(Ngt,"IsTemplateLiteralExpressionFinite");function pOa(t){let e=(0,cOa.TemplateLiteralParseExact)(t.pattern);return Ngt(e)}a(pOa,"IsTemplateLiteralFinite")});var sbr=I(Zge=>{"use strict";p();Object.defineProperty(Zge,"__esModule",{value:!0});Zge.TemplateLiteralGenerateError=void 0;Zge.TemplateLiteralExpressionGenerate=Ogt;Zge.TemplateLiteralGenerate=_Oa;var hOa=obr(),mOa=Pgt(),gOa=Of(),Mgt=class extends gOa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Zge.TemplateLiteralGenerateError=Mgt;function*Pwi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of Pwi(t.slice(1)))yield`${e}${r}`}a(Pwi,"GenerateReduce");function*AOa(t){return yield*Pwi(t.expr.map(e=>[...Ogt(e)]))}a(AOa,"GenerateAnd");function*yOa(t){for(let e of t.expr)yield*Ogt(e)}a(yOa,"GenerateOr");function*EOa(t){return yield t.const}a(EOa,"GenerateConst");function*Ogt(t){return t.type==="and"?yield*AOa(t):t.type==="or"?yield*yOa(t):t.type==="const"?yield*EOa(t):(()=>{throw new Mgt("Unknown expression")})()}a(Ogt,"TemplateLiteralExpressionGenerate");function _Oa(t){let e=(0,mOa.TemplateLiteralParseExact)(t.pattern);return(0,hOa.IsTemplateLiteralExpressionFinite)(e)?[...Ogt(e)]:[]}a(_Oa,"TemplateLiteralGenerate")});var Dwi=I(abr=>{"use strict";p();Object.defineProperty(abr,"__esModule",{value:!0});abr.Literal=bOa;var vOa=Ii(),COa=Sn();function bOa(t,e){return(0,vOa.CreateType)({[COa.Kind]:"Literal",const:t,type:typeof t},e)}a(bOa,"Literal")});var QE=I(jte=>{"use strict";p();var SOa=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]})),TOa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SOa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});TOa(Dwi(),jte)});var Nwi=I(cbr=>{"use strict";p();Object.defineProperty(cbr,"__esModule",{value:!0});cbr.Boolean=wOa;var IOa=Sn(),xOa=n6();function wOa(t){return(0,xOa.CreateType)({[IOa.Kind]:"Boolean",type:"boolean"},t)}a(wOa,"Boolean")});var Q5e=I(Hte=>{"use strict";p();var ROa=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]})),kOa=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ROa(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});kOa(Nwi(),Hte)});var Mwi=I(lbr=>{"use strict";p();Object.defineProperty(lbr,"__esModule",{value:!0});lbr.BigInt=NOa;var POa=Sn(),DOa=n6();function NOa(t){return(0,DOa.CreateType)({[POa.Kind]:"BigInt",type:"bigint"},t)}a(NOa,"BigInt")});var Xge=I(Gte=>{"use strict";p();var MOa=Gte&&Gte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MOa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});OOa(Mwi(),Gte)});var Owi=I(ubr=>{"use strict";p();Object.defineProperty(ubr,"__esModule",{value:!0});ubr.Number=FOa;var LOa=Ii(),BOa=Sn();function FOa(t){return(0,LOa.CreateType)({[BOa.Kind]:"Number",type:"number"},t)}a(FOa,"Number")});var HG=I($te=>{"use strict";p();var UOa=$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]})),QOa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UOa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});QOa(Owi(),$te)});var Lwi=I(dbr=>{"use strict";p();Object.defineProperty(dbr,"__esModule",{value:!0});dbr.String=HOa;var qOa=Ii(),jOa=Sn();function HOa(t){return(0,qOa.CreateType)({[jOa.Kind]:"String",type:"string"},t)}a(HOa,"String")});var GG=I(Vte=>{"use strict";p();var GOa=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]})),$Oa=Vte&&Vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GOa(e,t,r)};Object.defineProperty(Vte,"__esModule",{value:!0});$Oa(Lwi(),Vte)});var hbr=I(pbr=>{"use strict";p();Object.defineProperty(pbr,"__esModule",{value:!0});pbr.TemplateLiteralSyntax=e5a;var q5e=QE(),VOa=Q5e(),WOa=Xge(),zOa=HG(),YOa=GG(),KOa=wp(),JOa=Sm();function*ZOa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,VOa.Boolean)():e==="number"?yield(0,zOa.Number)():e==="bigint"?yield(0,WOa.BigInt)():e==="string"?yield(0,YOa.String)():yield(()=>{let r=e.split("|").map(n=>(0,q5e.Literal)(n.trim()));return r.length===0?(0,JOa.Never)():r.length===1?r[0]:(0,KOa.UnionEvaluated)(r)})()}a(ZOa,"FromUnion");function*XOa(t){if(t[1]!=="{"){let e=(0,q5e.Literal)("$"),r=fbr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(H5e,"__esModule",{value:!0});H5e.TemplateLiteralPatternError=void 0;H5e.TemplateLiteralPattern=i5a;var j5e=L5e(),t5a=Sn(),r5a=Of(),$G=vs(),Lgt=class extends r5a.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};H5e.TemplateLiteralPatternError=Lgt;function n5a(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(n5a,"Escape");function Bwi(t,e){return(0,$G.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,$G.IsUnion)(t)?`(${t.anyOf.map(r=>Bwi(r,e)).join("|")})`:(0,$G.IsNumber)(t)?`${e}${j5e.PatternNumber}`:(0,$G.IsInteger)(t)?`${e}${j5e.PatternNumber}`:(0,$G.IsBigInt)(t)?`${e}${j5e.PatternNumber}`:(0,$G.IsString)(t)?`${e}${j5e.PatternString}`:(0,$G.IsLiteral)(t)?`${e}${n5a(t.const.toString())}`:(0,$G.IsBoolean)(t)?`${e}${j5e.PatternBoolean}`:(()=>{throw new Lgt(`Unexpected Kind '${t[t5a.Kind]}'`)})()}a(Bwi,"Visit");function i5a(t){return`^${t.map(e=>Bwi(e,"")).join("")}$`}a(i5a,"TemplateLiteralPattern")});var Fwi=I(gbr=>{"use strict";p();Object.defineProperty(gbr,"__esModule",{value:!0});gbr.TemplateLiteralToUnion=c5a;var o5a=wp(),s5a=QE(),a5a=sbr();function c5a(t){let r=(0,a5a.TemplateLiteralGenerate)(t).map(n=>(0,s5a.Literal)(n));return(0,o5a.UnionEvaluated)(r)}a(c5a,"TemplateLiteralToUnion")});var Qwi=I(Abr=>{"use strict";p();Object.defineProperty(Abr,"__esModule",{value:!0});Abr.TemplateLiteral=p5a;var l5a=Ii(),u5a=hbr(),Uwi=mbr(),d5a=wv(),f5a=Sn();function p5a(t,e){let r=(0,d5a.IsString)(t)?(0,Uwi.TemplateLiteralPattern)((0,u5a.TemplateLiteralSyntax)(t)):(0,Uwi.TemplateLiteralPattern)(t);return(0,l5a.CreateType)({[f5a.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(p5a,"TemplateLiteral")});var gD=I(eI=>{"use strict";p();var h5a=eI&&eI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wte=eI&&eI.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h5a(e,t,r)};Object.defineProperty(eI,"__esModule",{value:!0});Wte(obr(),eI);Wte(sbr(),eI);Wte(hbr(),eI);Wte(Pgt(),eI);Wte(mbr(),eI);Wte(Fwi(),eI);Wte(Qwi(),eI)});var Bgt=I(ybr=>{"use strict";p();Object.defineProperty(ybr,"__esModule",{value:!0});ybr.IndexPropertyKeys=qwi;var m5a=gD(),G5e=vs();function g5a(t){return(0,m5a.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(g5a,"FromTemplateLiteral");function A5a(t){let e=[];for(let r of t)e.push(...qwi(r));return e}a(A5a,"FromUnion");function y5a(t){return[t.toString()]}a(y5a,"FromLiteral");function qwi(t){return[...new Set((0,G5e.IsTemplateLiteral)(t)?g5a(t):(0,G5e.IsUnion)(t)?A5a(t.anyOf):(0,G5e.IsLiteral)(t)?y5a(t.const):(0,G5e.IsNumber)(t)?["[number]"]:(0,G5e.IsInteger)(t)?["[number]"]:[])]}a(qwi,"IndexPropertyKeys")});var _br=I(Ebr=>{"use strict";p();Object.defineProperty(Ebr,"__esModule",{value:!0});Ebr.IndexFromMappedResult=S5a;var E5a=Tm(),_5a=Bgt(),v5a=AD();function C5a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,v5a.Index)(t,(0,_5a.IndexPropertyKeys)(e[o]),r);return n}a(C5a,"FromProperties");function b5a(t,e,r){return C5a(t,e.properties,r)}a(b5a,"FromMappedResult");function S5a(t,e,r){let n=b5a(t,e,r);return(0,E5a.MappedResult)(n)}a(S5a,"IndexFromMappedResult")});var Ugt=I(eAe=>{"use strict";p();Object.defineProperty(eAe,"__esModule",{value:!0});eAe.IndexFromPropertyKey=Cbr;eAe.IndexFromPropertyKeys=$wi;eAe.IndexFromComputed=F5a;eAe.Index=U5a;var T5a=Ii(),I5a=Of(),Hwi=qG(),Fgt=Sm(),x5a=tI(),vbr=wp(),w5a=Bgt(),R5a=bbr(),k5a=_br(),Zb=vs();function Gwi(t,e){return t.map(r=>Cbr(r,e))}a(Gwi,"FromRest");function P5a(t){return t.filter(e=>!(0,Zb.IsNever)(e))}a(P5a,"FromIntersectRest");function D5a(t,e){return(0,x5a.IntersectEvaluated)(P5a(Gwi(t,e)))}a(D5a,"FromIntersect");function N5a(t){return t.some(e=>(0,Zb.IsNever)(e))?[]:t}a(N5a,"FromUnionRest");function M5a(t,e){return(0,vbr.UnionEvaluated)(N5a(Gwi(t,e)))}a(M5a,"FromUnion");function O5a(t,e){return e in t?t[e]:e==="[number]"?(0,vbr.UnionEvaluated)(t):(0,Fgt.Never)()}a(O5a,"FromTuple");function L5a(t,e){return e==="[number]"?t:(0,Fgt.Never)()}a(L5a,"FromArray");function B5a(t,e){return e in t?t[e]:(0,Fgt.Never)()}a(B5a,"FromProperty");function Cbr(t,e){return(0,Zb.IsIntersect)(t)?D5a(t.allOf,e):(0,Zb.IsUnion)(t)?M5a(t.anyOf,e):(0,Zb.IsTuple)(t)?O5a(t.items??[],e):(0,Zb.IsArray)(t)?L5a(t.items,e):(0,Zb.IsObject)(t)?B5a(t.properties,e):(0,Fgt.Never)()}a(Cbr,"IndexFromPropertyKey");function $wi(t,e){return e.map(r=>Cbr(t,r))}a($wi,"IndexFromPropertyKeys");function jwi(t,e){return(0,vbr.UnionEvaluated)($wi(t,e))}a(jwi,"FromSchema");function F5a(t,e){return(0,Hwi.Computed)("Index",[t,e])}a(F5a,"IndexFromComputed");function U5a(t,e,r){if((0,Zb.IsRef)(t)||(0,Zb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Zb.IsSchema)(t)||!(0,Zb.IsSchema)(e))throw new I5a.TypeBoxError(n);return(0,Hwi.Computed)("Index",[t,e])}return(0,Zb.IsMappedResult)(e)?(0,k5a.IndexFromMappedResult)(t,e,r):(0,Zb.IsMappedKey)(e)?(0,R5a.IndexFromMappedKey)(t,e,r):(0,T5a.CreateType)((0,Zb.IsSchema)(e)?jwi(t,(0,w5a.IndexPropertyKeys)(e)):jwi(t,e),r)}a(U5a,"Index")});var bbr=I(Sbr=>{"use strict";p();Object.defineProperty(Sbr,"__esModule",{value:!0});Sbr.IndexFromMappedKey=V5a;var Q5a=Ugt(),q5a=Tm(),j5a=Yb();function H5a(t,e,r){return{[e]:(0,Q5a.Index)(t,[e],(0,j5a.Clone)(r))}}a(H5a,"MappedIndexPropertyKey");function G5a(t,e,r){return e.reduce((n,o)=>({...n,...H5a(t,o,r)}),{})}a(G5a,"MappedIndexPropertyKeys");function $5a(t,e,r){return G5a(t,e.keys,r)}a($5a,"MappedIndexProperties");function V5a(t,e,r){let n=$5a(t,e,r);return(0,q5a.MappedResult)(n)}a(V5a,"IndexFromMappedKey")});var AD=I(V4=>{"use strict";p();var W5a=V4&&V4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qgt=V4&&V4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W5a(e,t,r)};Object.defineProperty(V4,"__esModule",{value:!0});Qgt(bbr(),V4);Qgt(_br(),V4);Qgt(Bgt(),V4);Qgt(Ugt(),V4)});var Vwi=I(Tbr=>{"use strict";p();Object.defineProperty(Tbr,"__esModule",{value:!0});Tbr.Iterator=K5a;var z5a=Ii(),Y5a=Sn();function K5a(t,e){return(0,z5a.CreateType)({[Y5a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(K5a,"Iterator")});var tAe=I(zte=>{"use strict";p();var J5a=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]})),Z5a=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&J5a(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});Z5a(Vwi(),zte)});var zwi=I(qgt=>{"use strict";p();Object.defineProperty(qgt,"__esModule",{value:!0});qgt.Object=void 0;var X5a=Ii(),Wwi=Sn(),e4a=vs();function t4a(t){return globalThis.Object.keys(t).filter(e=>!(0,e4a.IsOptional)(t[e]))}a(t4a,"RequiredArray");function r4a(t,e){let r=t4a(t),n=r.length>0?{[Wwi.Kind]:"Object",type:"object",required:r,properties:t}:{[Wwi.Kind]:"Object",type:"object",properties:t};return(0,X5a.CreateType)(n,e)}a(r4a,"_Object");qgt.Object=r4a});var Rv=I(Yte=>{"use strict";p();var n4a=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]})),i4a=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&n4a(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});i4a(zwi(),Yte)});var Ywi=I(Ibr=>{"use strict";p();Object.defineProperty(Ibr,"__esModule",{value:!0});Ibr.Promise=a4a;var o4a=Ii(),s4a=Sn();function a4a(t,e){return(0,o4a.CreateType)({[s4a.Kind]:"Promise",type:"Promise",item:t},e)}a(a4a,"Promise")});var $5e=I(Kte=>{"use strict";p();var c4a=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]})),l4a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&c4a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});l4a(Ywi(),Kte)});var wbr=I(xbr=>{"use strict";p();Object.defineProperty(xbr,"__esModule",{value:!0});xbr.Readonly=g4a;var Kwi=Ii(),Jwi=Sn(),u4a=o6(),d4a=Rbr(),f4a=vs();function p4a(t){return(0,Kwi.CreateType)((0,u4a.Discard)(t,[Jwi.ReadonlyKind]))}a(p4a,"RemoveReadonly");function h4a(t){return(0,Kwi.CreateType)({...t,[Jwi.ReadonlyKind]:"Readonly"})}a(h4a,"AddReadonly");function m4a(t,e){return e===!1?p4a(t):h4a(t)}a(m4a,"ReadonlyWithFlag");function g4a(t,e){let r=e??!0;return(0,f4a.IsMappedResult)(t)?(0,d4a.ReadonlyFromMappedResult)(t,r):m4a(t,r)}a(g4a,"Readonly")});var Rbr=I(kbr=>{"use strict";p();Object.defineProperty(kbr,"__esModule",{value:!0});kbr.ReadonlyFromMappedResult=v4a;var A4a=Tm(),y4a=wbr();function E4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,y4a.Readonly)(t[n],e);return r}a(E4a,"FromProperties");function _4a(t,e){return E4a(t.properties,e)}a(_4a,"FromMappedResult");function v4a(t,e){let r=_4a(t,e);return(0,A4a.MappedResult)(r)}a(v4a,"ReadonlyFromMappedResult")});var WG=I(VG=>{"use strict";p();var C4a=VG&&VG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zwi=VG&&VG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C4a(e,t,r)};Object.defineProperty(VG,"__esModule",{value:!0});Zwi(Rbr(),VG);Zwi(wbr(),VG)});var eRi=I(Pbr=>{"use strict";p();Object.defineProperty(Pbr,"__esModule",{value:!0});Pbr.Tuple=S4a;var b4a=Ii(),Xwi=Sn();function S4a(t,e){return(0,b4a.CreateType)(t.length>0?{[Xwi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Xwi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(S4a,"Tuple")});var c6=I(Jte=>{"use strict";p();var T4a=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]})),I4a=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T4a(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});I4a(eRi(),Jte)});var sRi=I(jgt=>{"use strict";p();Object.defineProperty(jgt,"__esModule",{value:!0});jgt.MappedFunctionReturnType=oRi;jgt.Mapped=V4a;var Dbr=Sn(),tRi=o6(),x4a=Wge(),w4a=zge(),R4a=Yge(),k4a=jG(),P4a=AD(),D4a=tI(),N4a=tAe(),rRi=QE(),nRi=Rv(),M4a=$4(),O4a=$5e(),L4a=WG(),B4a=c6(),F4a=wp(),U4a=B5e(),Q4a=KCr(),kv=vs();function iRi(t,e){return t in e?kR(t,e[t]):(0,Q4a.MappedResult)(e)}a(iRi,"FromMappedResult");function q4a(t){return{[t]:(0,rRi.Literal)(t)}}a(q4a,"MappedKeyToKnownMappedResultProperties");function j4a(t){let e={};for(let r of t)e[r]=(0,rRi.Literal)(r);return e}a(j4a,"MappedKeyToUnknownMappedResultProperties");function H4a(t,e){return(0,U4a.SetIncludes)(e,t)?q4a(t):j4a(e)}a(H4a,"MappedKeyToMappedResultProperties");function G4a(t,e){let r=H4a(t,e);return iRi(t,r)}a(G4a,"FromMappedKey");function V5e(t,e){return e.map(r=>kR(t,r))}a(V5e,"FromRest");function $4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=kR(t,e[n]);return r}a($4a,"FromProperties");function kR(t,e){let r={...e};return(0,kv.IsOptional)(e)?(0,M4a.Optional)(kR(t,(0,tRi.Discard)(e,[Dbr.OptionalKind]))):(0,kv.IsReadonly)(e)?(0,L4a.Readonly)(kR(t,(0,tRi.Discard)(e,[Dbr.ReadonlyKind]))):(0,kv.IsMappedResult)(e)?iRi(t,e.properties):(0,kv.IsMappedKey)(e)?G4a(t,e.keys):(0,kv.IsConstructor)(e)?(0,R4a.Constructor)(V5e(t,e.parameters),kR(t,e.returns),r):(0,kv.IsFunction)(e)?(0,k4a.Function)(V5e(t,e.parameters),kR(t,e.returns),r):(0,kv.IsAsyncIterator)(e)?(0,w4a.AsyncIterator)(kR(t,e.items),r):(0,kv.IsIterator)(e)?(0,N4a.Iterator)(kR(t,e.items),r):(0,kv.IsIntersect)(e)?(0,D4a.Intersect)(V5e(t,e.allOf),r):(0,kv.IsUnion)(e)?(0,F4a.Union)(V5e(t,e.anyOf),r):(0,kv.IsTuple)(e)?(0,B4a.Tuple)(V5e(t,e.items??[]),r):(0,kv.IsObject)(e)?(0,nRi.Object)($4a(t,e.properties),r):(0,kv.IsArray)(e)?(0,x4a.Array)(kR(t,e.items),r):(0,kv.IsPromise)(e)?(0,O4a.Promise)(kR(t,e.item),r):e}a(kR,"FromSchemaType");function oRi(t,e){let r={};for(let n of t)r[n]=kR(n,e);return r}a(oRi,"MappedFunctionReturnType");function V4a(t,e,r){let n=(0,kv.IsSchema)(t)?(0,P4a.IndexPropertyKeys)(t):t,o=e({[Dbr.Kind]:"MappedKey",keys:n}),s=oRi(n,o);return(0,nRi.Object)(s,r)}a(V4a,"Mapped")});var Tm=I(l6=>{"use strict";p();var W4a=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]})),Nbr=l6&&l6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W4a(e,t,r)};Object.defineProperty(l6,"__esModule",{value:!0});Nbr(_wi(),l6);Nbr(KCr(),l6);Nbr(sRi(),l6)});var Obr=I(Mbr=>{"use strict";p();Object.defineProperty(Mbr,"__esModule",{value:!0});Mbr.Optional=eLa;var aRi=Ii(),cRi=Sn(),z4a=o6(),Y4a=Lbr(),K4a=vs();function J4a(t){return(0,aRi.CreateType)((0,z4a.Discard)(t,[cRi.OptionalKind]))}a(J4a,"RemoveOptional");function Z4a(t){return(0,aRi.CreateType)({...t,[cRi.OptionalKind]:"Optional"})}a(Z4a,"AddOptional");function X4a(t,e){return e===!1?J4a(t):Z4a(t)}a(X4a,"OptionalWithFlag");function eLa(t,e){let r=e??!0;return(0,K4a.IsMappedResult)(t)?(0,Y4a.OptionalFromMappedResult)(t,r):X4a(t,r)}a(eLa,"Optional")});var Lbr=I(Bbr=>{"use strict";p();Object.defineProperty(Bbr,"__esModule",{value:!0});Bbr.OptionalFromMappedResult=oLa;var tLa=Tm(),rLa=Obr();function nLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,rLa.Optional)(t[n],e);return r}a(nLa,"FromProperties");function iLa(t,e){return nLa(t.properties,e)}a(iLa,"FromMappedResult");function oLa(t,e){let r=iLa(t,e);return(0,tLa.MappedResult)(r)}a(oLa,"OptionalFromMappedResult")});var $4=I(zG=>{"use strict";p();var sLa=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]})),lRi=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sLa(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});lRi(Lbr(),zG);lRi(Obr(),zG)});var Qbr=I(Ubr=>{"use strict";p();Object.defineProperty(Ubr,"__esModule",{value:!0});Ubr.IntersectCreate=cLa;var aLa=Ii(),uRi=Sn(),Fbr=vs();function cLa(t,e={}){let r=t.every(o=>(0,Fbr.IsObject)(o)),n=(0,Fbr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,aLa.CreateType)(e.unevaluatedProperties===!1||(0,Fbr.IsSchema)(e.unevaluatedProperties)||r?{...n,[uRi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[uRi.Kind]:"Intersect",allOf:t},e)}a(cLa,"IntersectCreate")});var pRi=I(jbr=>{"use strict";p();Object.defineProperty(jbr,"__esModule",{value:!0});jbr.IntersectEvaluated=ALa;var lLa=Sn(),uLa=Ii(),dLa=o6(),fLa=Sm(),pLa=$4(),dRi=Qbr(),qbr=vs();function hLa(t){return t.every(e=>(0,qbr.IsOptional)(e))}a(hLa,"IsIntersectOptional");function mLa(t){return(0,dLa.Discard)(t,[lLa.OptionalKind])}a(mLa,"RemoveOptionalFromType");function fRi(t){return t.map(e=>(0,qbr.IsOptional)(e)?mLa(e):e)}a(fRi,"RemoveOptionalFromRest");function gLa(t,e){return hLa(t)?(0,pLa.Optional)((0,dRi.IntersectCreate)(fRi(t),e)):(0,dRi.IntersectCreate)(fRi(t),e)}a(gLa,"ResolveIntersect");function ALa(t,e={}){if(t.length===1)return(0,uLa.CreateType)(t[0],e);if(t.length===0)return(0,fLa.Never)(e);if(t.some(r=>(0,qbr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return gLa(t,e)}a(ALa,"IntersectEvaluated")});var mRi=I(hRi=>{"use strict";p();Object.defineProperty(hRi,"__esModule",{value:!0});var Gxp=Sn()});var gRi=I(Hbr=>{"use strict";p();Object.defineProperty(Hbr,"__esModule",{value:!0});Hbr.Intersect=CLa;var yLa=Ii(),ELa=Sm(),_La=Qbr(),vLa=vs();function CLa(t,e){if(t.length===1)return(0,yLa.CreateType)(t[0],e);if(t.length===0)return(0,ELa.Never)(e);if(t.some(r=>(0,vLa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,_La.IntersectCreate)(t,e)}a(CLa,"Intersect")});var tI=I(u6=>{"use strict";p();var bLa=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]})),Gbr=u6&&u6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bLa(e,t,r)};Object.defineProperty(u6,"__esModule",{value:!0});Gbr(pRi(),u6);Gbr(mRi(),u6);Gbr(gRi(),u6)});var ARi=I($br=>{"use strict";p();Object.defineProperty($br,"__esModule",{value:!0});$br.Ref=xLa;var SLa=Of(),TLa=Ii(),ILa=Sn();function xLa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new SLa.TypeBoxError("Ref: $ref must be a string");return(0,TLa.CreateType)({[ILa.Kind]:"Ref",$ref:e},r)}a(xLa,"Ref")});var YG=I(Zte=>{"use strict";p();var wLa=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]})),RLa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wLa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});RLa(ARi(),Zte)});var ERi=I(zbr=>{"use strict";p();Object.defineProperty(zbr,"__esModule",{value:!0});zbr.Awaited=Wbr;var kLa=Ii(),Vbr=qG(),PLa=tI(),DLa=wp(),NLa=YG(),W5e=vs();function MLa(t,e){return(0,Vbr.Computed)("Awaited",[(0,Vbr.Computed)(t,e)])}a(MLa,"FromComputed");function OLa(t){return(0,Vbr.Computed)("Awaited",[(0,NLa.Ref)(t)])}a(OLa,"FromRef");function LLa(t){return(0,PLa.Intersect)(yRi(t))}a(LLa,"FromIntersect");function BLa(t){return(0,DLa.Union)(yRi(t))}a(BLa,"FromUnion");function FLa(t){return Wbr(t)}a(FLa,"FromPromise");function yRi(t){return t.map(e=>Wbr(e))}a(yRi,"FromRest");function Wbr(t,e){return(0,kLa.CreateType)((0,W5e.IsComputed)(t)?MLa(t.target,t.parameters):(0,W5e.IsIntersect)(t)?LLa(t.allOf):(0,W5e.IsUnion)(t)?BLa(t.anyOf):(0,W5e.IsPromise)(t)?FLa(t.item):(0,W5e.IsRef)(t)?OLa(t.$ref):t,e)}a(Wbr,"Awaited")});var z5e=I(Xte=>{"use strict";p();var ULa=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]})),QLa=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ULa(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});QLa(ERi(),Xte)});var Ggt=I(Hgt=>{"use strict";p();Object.defineProperty(Hgt,"__esModule",{value:!0});Hgt.KeyOfPropertyKeys=Kbr;Hgt.KeyOfPattern=WLa;var _Ri=B5e(),rAe=vs();function vRi(t){let e=[];for(let r of t)e.push(Kbr(r));return e}a(vRi,"FromRest");function qLa(t){let e=vRi(t);return(0,_Ri.SetUnionMany)(e)}a(qLa,"FromIntersect");function jLa(t){let e=vRi(t);return(0,_Ri.SetIntersectMany)(e)}a(jLa,"FromUnion");function HLa(t){return t.map((e,r)=>r.toString())}a(HLa,"FromTuple");function GLa(t){return["[number]"]}a(GLa,"FromArray");function $La(t){return globalThis.Object.getOwnPropertyNames(t)}a($La,"FromProperties");function VLa(t){return Ybr?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(VLa,"FromPatternProperties");function Kbr(t){return(0,rAe.IsIntersect)(t)?qLa(t.allOf):(0,rAe.IsUnion)(t)?jLa(t.anyOf):(0,rAe.IsTuple)(t)?HLa(t.items??[]):(0,rAe.IsArray)(t)?GLa(t.items):(0,rAe.IsObject)(t)?$La(t.properties):(0,rAe.IsRecord)(t)?VLa(t.patternProperties):[]}a(Kbr,"KeyOfPropertyKeys");var Ybr=!1;function WLa(t){Ybr=!0;let e=Kbr(t);return Ybr=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(WLa,"KeyOfPattern")});var Xbr=I($gt=>{"use strict";p();Object.defineProperty($gt,"__esModule",{value:!0});$gt.KeyOfPropertyKeysToRest=CRi;$gt.KeyOf=iBa;var zLa=Ii(),YLa=QE(),KLa=HG(),Zbr=qG(),JLa=YG(),ZLa=Ggt(),XLa=wp(),eBa=e1r(),Jbr=vs();function tBa(t,e){return(0,Zbr.Computed)("KeyOf",[(0,Zbr.Computed)(t,e)])}a(tBa,"FromComputed");function rBa(t){return(0,Zbr.Computed)("KeyOf",[(0,JLa.Ref)(t)])}a(rBa,"FromRef");function nBa(t,e){let r=(0,ZLa.KeyOfPropertyKeys)(t),n=CRi(r),o=(0,XLa.UnionEvaluated)(n);return(0,zLa.CreateType)(o,e)}a(nBa,"KeyOfFromType");function CRi(t){return t.map(e=>e==="[number]"?(0,KLa.Number)():(0,YLa.Literal)(e))}a(CRi,"KeyOfPropertyKeysToRest");function iBa(t,e){return(0,Jbr.IsComputed)(t)?tBa(t.target,t.parameters):(0,Jbr.IsRef)(t)?rBa(t.$ref):(0,Jbr.IsMappedResult)(t)?(0,eBa.KeyOfFromMappedResult)(t,e):nBa(t,e)}a(iBa,"KeyOf")});var e1r=I(t1r=>{"use strict";p();Object.defineProperty(t1r,"__esModule",{value:!0});t1r.KeyOfFromMappedResult=uBa;var oBa=Tm(),sBa=Xbr(),aBa=Yb();function cBa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,sBa.KeyOf)(t[n],(0,aBa.Clone)(e));return r}a(cBa,"FromProperties");function lBa(t,e){return cBa(t.properties,e)}a(lBa,"FromMappedResult");function uBa(t,e){let r=lBa(t,e);return(0,oBa.MappedResult)(r)}a(uBa,"KeyOfFromMappedResult")});var bRi=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.KeyOfPropertyEntries=pBa;var dBa=Ugt(),fBa=Ggt();function pBa(t){let e=(0,fBa.KeyOfPropertyKeys)(t),r=(0,dBa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(pBa,"KeyOfPropertyEntries")});var yD=I(W4=>{"use strict";p();var hBa=W4&&W4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vgt=W4&&W4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hBa(e,t,r)};Object.defineProperty(W4,"__esModule",{value:!0});Vgt(e1r(),W4);Vgt(bRi(),W4);Vgt(Ggt(),W4);Vgt(Xbr(),W4)});var SRi=I(n1r=>{"use strict";p();Object.defineProperty(n1r,"__esModule",{value:!0});n1r.Composite=TBa;var mBa=tI(),gBa=AD(),ABa=yD(),yBa=Rv(),EBa=B5e(),_Ba=vs();function vBa(t){let e=[];for(let r of t)e.push(...(0,ABa.KeyOfPropertyKeys)(r));return(0,EBa.SetDistinct)(e)}a(vBa,"CompositeKeys");function CBa(t){return t.filter(e=>!(0,_Ba.IsNever)(e))}a(CBa,"FilterNever");function bBa(t,e){let r=[];for(let n of t)r.push(...(0,gBa.IndexFromPropertyKeys)(n,[e]));return CBa(r)}a(bBa,"CompositeProperty");function SBa(t,e){let r={};for(let n of e)r[n]=(0,mBa.IntersectEvaluated)(bBa(t,n));return r}a(SBa,"CompositeProperties");function TBa(t,e){let r=vBa(t),n=SBa(t,r);return(0,yBa.Object)(n,e)}a(TBa,"Composite")});var Wgt=I(ere=>{"use strict";p();var IBa=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]})),xBa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IBa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});xBa(SRi(),ere)});var TRi=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.Date=kBa;var wBa=Sn(),RBa=Ii();function kBa(t){return(0,RBa.CreateType)({[wBa.Kind]:"Date",type:"Date"},t)}a(kBa,"Date")});var Y5e=I(tre=>{"use strict";p();var PBa=tre&&tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DBa=tre&&tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PBa(e,t,r)};Object.defineProperty(tre,"__esModule",{value:!0});DBa(TRi(),tre)});var IRi=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.Null=OBa;var NBa=Ii(),MBa=Sn();function OBa(t){return(0,NBa.CreateType)({[MBa.Kind]:"Null",type:"null"},t)}a(OBa,"Null")});var K5e=I(rre=>{"use strict";p();var LBa=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]})),BBa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LBa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});BBa(IRi(),rre)});var xRi=I(s1r=>{"use strict";p();Object.defineProperty(s1r,"__esModule",{value:!0});s1r.Symbol=QBa;var FBa=Ii(),UBa=Sn();function QBa(t){return(0,FBa.CreateType)({[UBa.Kind]:"Symbol",type:"symbol"},t)}a(QBa,"Symbol")});var J5e=I(nre=>{"use strict";p();var qBa=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]})),jBa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qBa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});jBa(xRi(),nre)});var wRi=I(a1r=>{"use strict";p();Object.defineProperty(a1r,"__esModule",{value:!0});a1r.Undefined=$Ba;var HBa=Ii(),GBa=Sn();function $Ba(t){return(0,HBa.CreateType)({[GBa.Kind]:"Undefined",type:"undefined"},t)}a($Ba,"Undefined")});var Z5e=I(ire=>{"use strict";p();var VBa=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]})),WBa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VBa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});WBa(wRi(),ire)});var RRi=I(c1r=>{"use strict";p();Object.defineProperty(c1r,"__esModule",{value:!0});c1r.Uint8Array=KBa;var zBa=Ii(),YBa=Sn();function KBa(t){return(0,zBa.CreateType)({[YBa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(KBa,"Uint8Array")});var X5e=I(ore=>{"use strict";p();var JBa=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]})),ZBa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JBa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});ZBa(RRi(),ore)});var kRi=I(l1r=>{"use strict";p();Object.defineProperty(l1r,"__esModule",{value:!0});l1r.Unknown=t3a;var XBa=Ii(),e3a=Sn();function t3a(t){return(0,XBa.CreateType)({[e3a.Kind]:"Unknown"},t)}a(t3a,"Unknown")});var KG=I(sre=>{"use strict";p();var r3a=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]})),n3a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&r3a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});n3a(kRi(),sre)});var NRi=I(p1r=>{"use strict";p();Object.defineProperty(p1r,"__esModule",{value:!0});p1r.Const=g3a;var PRi=Vge(),i3a=Xge(),o3a=Y5e(),s3a=jG(),u1r=QE(),a3a=K5e(),DRi=Rv(),c3a=J5e(),l3a=c6(),d1r=WG(),u3a=Z5e(),d3a=X5e(),f3a=KG(),p3a=n6(),Xb=wv();function h3a(t){return t.map(e=>f1r(e,!1))}a(h3a,"FromArray");function m3a(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,d1r.Readonly)(f1r(t[r],!1));return e}a(m3a,"FromProperties");function zgt(t,e){return e===!0?t:(0,d1r.Readonly)(t)}a(zgt,"ConditionalReadonly");function f1r(t,e){return(0,Xb.IsAsyncIterator)(t)||(0,Xb.IsIterator)(t)?zgt((0,PRi.Any)(),e):(0,Xb.IsArray)(t)?(0,d1r.Readonly)((0,l3a.Tuple)(h3a(t))):(0,Xb.IsUint8Array)(t)?(0,d3a.Uint8Array)():(0,Xb.IsDate)(t)?(0,o3a.Date)():(0,Xb.IsObject)(t)?zgt((0,DRi.Object)(m3a(t)),e):(0,Xb.IsFunction)(t)?zgt((0,s3a.Function)([],(0,f3a.Unknown)()),e):(0,Xb.IsUndefined)(t)?(0,u3a.Undefined)():(0,Xb.IsNull)(t)?(0,a3a.Null)():(0,Xb.IsSymbol)(t)?(0,c3a.Symbol)():(0,Xb.IsBigInt)(t)?(0,i3a.BigInt)():(0,Xb.IsNumber)(t)||(0,Xb.IsBoolean)(t)||(0,Xb.IsString)(t)?(0,u1r.Literal)(t):(0,DRi.Object)({})}a(f1r,"FromValue");function g3a(t,e){return(0,p3a.CreateType)(f1r(t,!0),e)}a(g3a,"Const")});var Ygt=I(are=>{"use strict";p();var A3a=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]})),y3a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A3a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});y3a(NRi(),are)});var MRi=I(d6=>{"use strict";p();var E3a=d6&&d6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=d6&&d6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v3a=d6&&d6.__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 I3a=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]})),x3a=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I3a(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});x3a(MRi(),cre)});var ORi=I(h1r=>{"use strict";p();Object.defineProperty(h1r,"__esModule",{value:!0});h1r.Enum=D3a;var w3a=QE(),R3a=Sn(),k3a=wp(),P3a=wv();function D3a(t,e){if((0,P3a.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,w3a.Literal)(s));return(0,k3a.Union)(o,{...e,[R3a.Hint]:"Enum"})}a(D3a,"Enum")});var Jgt=I(lre=>{"use strict";p();var N3a=lre&&lre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M3a=lre&&lre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N3a(e,t,r)};Object.defineProperty(lre,"__esModule",{value:!0});M3a(ORi(),lre)});var C1r=I(ure=>{"use strict";p();Object.defineProperty(ure,"__esModule",{value:!0});ure.ExtendsResult=ure.ExtendsResolverError=void 0;ure.ExtendsCheck=bFa;var LRi=Vge(),O3a=jG(),E1r=HG(),g1r=GG(),L3a=KG(),BRi=gD(),nAe=L5e(),jRi=Sn(),B3a=Of(),tt=UCr(),Zgt=class extends B3a.TypeBoxError{static{a(this,"ExtendsResolverError")}};ure.ExtendsResolverError=Zgt;var Lt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Lt||(ure.ExtendsResult=Lt={}));function PR(t){return t===Lt.False?t:Lt.True}a(PR,"IntoBooleanResult");function iAe(t){throw new Zgt(t)}a(iAe,"Throw");function Im(t){return tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsIntersect(t)||tt.TypeGuard.IsUnion(t)||tt.TypeGuard.IsUnknown(t)||tt.TypeGuard.IsAny(t)}a(Im,"IsStructuralRight");function xm(t,e){return tt.TypeGuard.IsNever(e)?$Ri(t,e):tt.TypeGuard.IsIntersect(e)?Xgt(t,e):tt.TypeGuard.IsUnion(e)?v1r(t,e):tt.TypeGuard.IsUnknown(e)?YRi(t,e):tt.TypeGuard.IsAny(e)?_1r(t,e):iAe("StructuralRight")}a(xm,"StructuralRight");function _1r(t,e){return Lt.True}a(_1r,"FromAnyRight");function F3a(t,e){return tt.TypeGuard.IsIntersect(e)?Xgt(t,e):tt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>tt.TypeGuard.IsAny(r)||tt.TypeGuard.IsUnknown(r))?Lt.True:tt.TypeGuard.IsUnion(e)?Lt.Union:tt.TypeGuard.IsUnknown(e)||tt.TypeGuard.IsAny(e)?Lt.True:Lt.Union}a(F3a,"FromAny");function U3a(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)?Lt.True:Lt.False}a(U3a,"FromArrayRight");function Q3a(t,e){return tt.TypeGuard.IsObject(e)&&eAt(e)?Lt.True:Im(e)?xm(t,e):tt.TypeGuard.IsArray(e)?PR(ml(t.items,e.items)):Lt.False}a(Q3a,"FromArray");function q3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsAsyncIterator(e)?PR(ml(t.items,e.items)):Lt.False}a(q3a,"FromAsyncIterator");function j3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsBigInt(e)?Lt.True:Lt.False}a(j3a,"FromBigInt");function HRi(t,e){return tt.TypeGuard.IsLiteralBoolean(t)||tt.TypeGuard.IsBoolean(t)?Lt.True:Lt.False}a(HRi,"FromBooleanRight");function H3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsBoolean(e)?Lt.True:Lt.False}a(H3a,"FromBoolean");function G3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>PR(ml(e.parameters[n],r))===Lt.True)?PR(ml(t.returns,e.returns)):Lt.False:Lt.False}a(G3a,"FromConstructor");function $3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsDate(e)?Lt.True:Lt.False}a($3a,"FromDate");function V3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>PR(ml(e.parameters[n],r))===Lt.True)?PR(ml(t.returns,e.returns)):Lt.False:Lt.False}a(V3a,"FromFunction");function GRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsNumber(t.const)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(GRi,"FromIntegerRight");function W3a(t,e){return tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):Lt.False}a(W3a,"FromInteger");function Xgt(t,e){return e.allOf.every(r=>ml(t,r)===Lt.True)?Lt.True:Lt.False}a(Xgt,"FromIntersectRight");function z3a(t,e){return t.allOf.some(r=>ml(r,e)===Lt.True)?Lt.True:Lt.False}a(z3a,"FromIntersect");function Y3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsIterator(e)?PR(ml(t.items,e.items)):Lt.False}a(Y3a,"FromIterator");function K3a(t,e){return tt.TypeGuard.IsLiteral(e)&&e.const===t.const?Lt.True:Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsString(e)?zRi(t,e):tt.TypeGuard.IsNumber(e)?VRi(t,e):tt.TypeGuard.IsInteger(e)?GRi(t,e):tt.TypeGuard.IsBoolean(e)?HRi(t,e):Lt.False}a(K3a,"FromLiteral");function $Ri(t,e){return Lt.False}a($Ri,"FromNeverRight");function J3a(t,e){return Lt.True}a(J3a,"FromNever");function FRi(t){let[e,r]=[t,0];for(;tt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,L3a.Unknown)()}a(FRi,"UnwrapTNot");function Z3a(t,e){return tt.TypeGuard.IsNot(t)?ml(FRi(t),e):tt.TypeGuard.IsNot(e)?ml(t,FRi(e)):iAe("Invalid fallthrough for Not")}a(Z3a,"FromNot");function X3a(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsNull(e)?Lt.True:Lt.False}a(X3a,"FromNull");function VRi(t,e){return tt.TypeGuard.IsLiteralNumber(t)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(VRi,"FromNumberRight");function eFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Lt.False}a(eFa,"FromNumber");function e1(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(e1,"IsObjectPropertyCount");function URi(t){return eAt(t)}a(URi,"IsObjectStringLike");function QRi(t){return e1(t,0)||e1(t,1)&&"description"in t.properties&&tt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(tt.TypeGuard.IsString(t.properties.description.anyOf[0])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||tt.TypeGuard.IsString(t.properties.description.anyOf[1])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(QRi,"IsObjectSymbolLike");function m1r(t){return e1(t,0)}a(m1r,"IsObjectNumberLike");function qRi(t){return e1(t,0)}a(qRi,"IsObjectBooleanLike");function tFa(t){return e1(t,0)}a(tFa,"IsObjectBigIntLike");function rFa(t){return e1(t,0)}a(rFa,"IsObjectDateLike");function nFa(t){return eAt(t)}a(nFa,"IsObjectUint8ArrayLike");function iFa(t){let e=(0,E1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&PR(ml(t.properties.length,e))===Lt.True}a(iFa,"IsObjectFunctionLike");function oFa(t){return e1(t,0)}a(oFa,"IsObjectConstructorLike");function eAt(t){let e=(0,E1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&PR(ml(t.properties.length,e))===Lt.True}a(eAt,"IsObjectArrayLike");function sFa(t){let e=(0,O3a.Function)([(0,LRi.Any)()],(0,LRi.Any)());return e1(t,0)||e1(t,1)&&"then"in t.properties&&PR(ml(t.properties.then,e))===Lt.True}a(sFa,"IsObjectPromiseLike");function WRi(t,e){return ml(t,e)===Lt.False||tt.TypeGuard.IsOptional(t)&&!tt.TypeGuard.IsOptional(e)?Lt.False:Lt.True}a(WRi,"Property");function qE(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsLiteralString(t)&&URi(e)||tt.TypeGuard.IsLiteralNumber(t)&&m1r(e)||tt.TypeGuard.IsLiteralBoolean(t)&&qRi(e)||tt.TypeGuard.IsSymbol(t)&&QRi(e)||tt.TypeGuard.IsBigInt(t)&&tFa(e)||tt.TypeGuard.IsString(t)&&URi(e)||tt.TypeGuard.IsSymbol(t)&&QRi(e)||tt.TypeGuard.IsNumber(t)&&m1r(e)||tt.TypeGuard.IsInteger(t)&&m1r(e)||tt.TypeGuard.IsBoolean(t)&&qRi(e)||tt.TypeGuard.IsUint8Array(t)&&nFa(e)||tt.TypeGuard.IsDate(t)&&rFa(e)||tt.TypeGuard.IsConstructor(t)&&oFa(e)||tt.TypeGuard.IsFunction(t)&&iFa(e)?Lt.True:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsString(A1r(t))?e[jRi.Hint]==="Record"?Lt.True:Lt.False:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsNumber(A1r(t))&&e1(e,0)?Lt.True:Lt.False}a(qE,"FromObjectRight");function aFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!tt.TypeGuard.IsOptional(e.properties[r]))return Lt.False;if(tt.TypeGuard.IsOptional(e.properties[r]))return Lt.True;if(WRi(t.properties[r],e.properties[r])===Lt.False)return Lt.False}return Lt.True})():Lt.False}a(aFa,"FromObject");function cFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)&&sFa(e)?Lt.True:tt.TypeGuard.IsPromise(e)?PR(ml(t.item,e.item)):Lt.False}a(cFa,"FromPromise");function A1r(t){return nAe.PatternNumberExact in t.patternProperties?(0,E1r.Number)():nAe.PatternStringExact in t.patternProperties?(0,g1r.String)():iAe("Unknown record key pattern")}a(A1r,"RecordKey");function y1r(t){return nAe.PatternNumberExact in t.patternProperties?t.patternProperties[nAe.PatternNumberExact]:nAe.PatternStringExact in t.patternProperties?t.patternProperties[nAe.PatternStringExact]:iAe("Unable to get record value schema")}a(y1r,"RecordValue");function DR(t,e){let[r,n]=[A1r(e),y1r(e)];return tt.TypeGuard.IsLiteralString(t)&&tt.TypeGuard.IsNumber(r)&&PR(ml(t,n))===Lt.True?Lt.True:tt.TypeGuard.IsUint8Array(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsString(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsArray(t)&&tt.TypeGuard.IsNumber(r)?ml(t,n):tt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(WRi(n,t.properties[o])===Lt.False)return Lt.False;return Lt.True})():Lt.False}a(DR,"FromRecordRight");function lFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?ml(y1r(t),y1r(e)):Lt.False}a(lFa,"FromRecord");function uFa(t,e){let r=tt.TypeGuard.IsRegExp(t)?(0,g1r.String)():t,n=tt.TypeGuard.IsRegExp(e)?(0,g1r.String)():e;return ml(r,n)}a(uFa,"FromRegExp");function zRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsString(t.const)||tt.TypeGuard.IsString(t)?Lt.True:Lt.False}a(zRi,"FromStringRight");function dFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsString(e)?Lt.True:Lt.False}a(dFa,"FromString");function fFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsSymbol(e)?Lt.True:Lt.False}a(fFa,"FromSymbol");function pFa(t,e){return tt.TypeGuard.IsTemplateLiteral(t)?ml((0,BRi.TemplateLiteralToUnion)(t),e):tt.TypeGuard.IsTemplateLiteral(e)?ml(t,(0,BRi.TemplateLiteralToUnion)(e)):iAe("Invalid fallthrough for TemplateLiteral")}a(pFa,"FromTemplateLiteral");function hFa(t,e){return tt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ml(r,e.items)===Lt.True)}a(hFa,"IsArrayOfTuple");function mFa(t,e){return tt.TypeGuard.IsNever(t)?Lt.True:tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:Lt.False}a(mFa,"FromTupleRight");function gFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)&&eAt(e)||tt.TypeGuard.IsArray(e)&&hFa(t,e)?Lt.True:tt.TypeGuard.IsTuple(e)?tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||!tt.ValueGuard.IsUndefined(t.items)&&tt.ValueGuard.IsUndefined(e.items)?Lt.False:tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>ml(r,e.items[n])===Lt.True)?Lt.True:Lt.False:Lt.False}a(gFa,"FromTuple");function AFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsUint8Array(e)?Lt.True:Lt.False}a(AFa,"FromUint8Array");function yFa(t,e){return Im(e)?xm(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsRecord(e)?DR(t,e):tt.TypeGuard.IsVoid(e)?vFa(t,e):tt.TypeGuard.IsUndefined(e)?Lt.True:Lt.False}a(yFa,"FromUndefined");function v1r(t,e){return e.anyOf.some(r=>ml(t,r)===Lt.True)?Lt.True:Lt.False}a(v1r,"FromUnionRight");function EFa(t,e){return t.anyOf.every(r=>ml(r,e)===Lt.True)?Lt.True:Lt.False}a(EFa,"FromUnion");function YRi(t,e){return Lt.True}a(YRi,"FromUnknownRight");function _Fa(t,e){return tt.TypeGuard.IsNever(e)?$Ri(t,e):tt.TypeGuard.IsIntersect(e)?Xgt(t,e):tt.TypeGuard.IsUnion(e)?v1r(t,e):tt.TypeGuard.IsAny(e)?_1r(t,e):tt.TypeGuard.IsString(e)?zRi(t,e):tt.TypeGuard.IsNumber(e)?VRi(t,e):tt.TypeGuard.IsInteger(e)?GRi(t,e):tt.TypeGuard.IsBoolean(e)?HRi(t,e):tt.TypeGuard.IsArray(e)?U3a(t,e):tt.TypeGuard.IsTuple(e)?mFa(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsUnknown(e)?Lt.True:Lt.False}a(_Fa,"FromUnknown");function vFa(t,e){return tt.TypeGuard.IsUndefined(t)||tt.TypeGuard.IsUndefined(t)?Lt.True:Lt.False}a(vFa,"FromVoidRight");function CFa(t,e){return tt.TypeGuard.IsIntersect(e)?Xgt(t,e):tt.TypeGuard.IsUnion(e)?v1r(t,e):tt.TypeGuard.IsUnknown(e)?YRi(t,e):tt.TypeGuard.IsAny(e)?_1r(t,e):tt.TypeGuard.IsObject(e)?qE(t,e):tt.TypeGuard.IsVoid(e)?Lt.True:Lt.False}a(CFa,"FromVoid");function ml(t,e){return tt.TypeGuard.IsTemplateLiteral(t)||tt.TypeGuard.IsTemplateLiteral(e)?pFa(t,e):tt.TypeGuard.IsRegExp(t)||tt.TypeGuard.IsRegExp(e)?uFa(t,e):tt.TypeGuard.IsNot(t)||tt.TypeGuard.IsNot(e)?Z3a(t,e):tt.TypeGuard.IsAny(t)?F3a(t,e):tt.TypeGuard.IsArray(t)?Q3a(t,e):tt.TypeGuard.IsBigInt(t)?j3a(t,e):tt.TypeGuard.IsBoolean(t)?H3a(t,e):tt.TypeGuard.IsAsyncIterator(t)?q3a(t,e):tt.TypeGuard.IsConstructor(t)?G3a(t,e):tt.TypeGuard.IsDate(t)?$3a(t,e):tt.TypeGuard.IsFunction(t)?V3a(t,e):tt.TypeGuard.IsInteger(t)?W3a(t,e):tt.TypeGuard.IsIntersect(t)?z3a(t,e):tt.TypeGuard.IsIterator(t)?Y3a(t,e):tt.TypeGuard.IsLiteral(t)?K3a(t,e):tt.TypeGuard.IsNever(t)?J3a(t,e):tt.TypeGuard.IsNull(t)?X3a(t,e):tt.TypeGuard.IsNumber(t)?eFa(t,e):tt.TypeGuard.IsObject(t)?aFa(t,e):tt.TypeGuard.IsRecord(t)?lFa(t,e):tt.TypeGuard.IsString(t)?dFa(t,e):tt.TypeGuard.IsSymbol(t)?fFa(t,e):tt.TypeGuard.IsTuple(t)?gFa(t,e):tt.TypeGuard.IsPromise(t)?cFa(t,e):tt.TypeGuard.IsUint8Array(t)?AFa(t,e):tt.TypeGuard.IsUndefined(t)?yFa(t,e):tt.TypeGuard.IsUnion(t)?EFa(t,e):tt.TypeGuard.IsUnknown(t)?_Fa(t,e):tt.TypeGuard.IsVoid(t)?CFa(t,e):iAe(`Unknown left type operand '${t[jRi.Kind]}'`)}a(ml,"Visit");function bFa(t,e){return ml(t,e)}a(bFa,"ExtendsCheck")});var S1r=I(b1r=>{"use strict";p();Object.defineProperty(b1r,"__esModule",{value:!0});b1r.ExtendsFromMappedResult=RFa;var SFa=Tm(),TFa=tAt(),IFa=Yb();function xFa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,TFa.Extends)(t[c],e,r,n,(0,IFa.Clone)(o));return s}a(xFa,"FromProperties");function wFa(t,e,r,n,o){return xFa(t.properties,e,r,n,o)}a(wFa,"FromMappedResult");function RFa(t,e,r,n,o){let s=wFa(t,e,r,n,o);return(0,SFa.MappedResult)(s)}a(RFa,"ExtendsFromMappedResult")});var tAt=I(I1r=>{"use strict";p();Object.defineProperty(I1r,"__esModule",{value:!0});I1r.Extends=MFa;var KRi=Ii(),kFa=wp(),T1r=C1r(),PFa=x1r(),DFa=S1r(),JRi=vs();function NFa(t,e,r,n){let o=(0,T1r.ExtendsCheck)(t,e);return o===T1r.ExtendsResult.Union?(0,kFa.Union)([r,n]):o===T1r.ExtendsResult.True?r:n}a(NFa,"ExtendsResolve");function MFa(t,e,r,n,o){return(0,JRi.IsMappedResult)(t)?(0,DFa.ExtendsFromMappedResult)(t,e,r,n,o):(0,JRi.IsMappedKey)(t)?(0,KRi.CreateType)((0,PFa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,KRi.CreateType)(NFa(t,e,r,n),o)}a(MFa,"Extends")});var x1r=I(w1r=>{"use strict";p();Object.defineProperty(w1r,"__esModule",{value:!0});w1r.ExtendsFromMappedKey=jFa;var OFa=Tm(),LFa=QE(),BFa=tAt(),FFa=Yb();function UFa(t,e,r,n,o){return{[t]:(0,BFa.Extends)((0,LFa.Literal)(t),e,r,n,(0,FFa.Clone)(o))}}a(UFa,"FromPropertyKey");function QFa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...UFa(c,e,r,n,o)}),{})}a(QFa,"FromPropertyKeys");function qFa(t,e,r,n,o){return QFa(t.keys,e,r,n,o)}a(qFa,"FromMappedKey");function jFa(t,e,r,n,o){let s=qFa(t,e,r,n,o);return(0,OFa.MappedResult)(s)}a(jFa,"ExtendsFromMappedKey")});var k1r=I(R1r=>{"use strict";p();Object.defineProperty(R1r,"__esModule",{value:!0});R1r.ExtendsUndefinedCheck=nAt;var rAt=Sn();function HFa(t){return t.allOf.every(e=>nAt(e))}a(HFa,"Intersect");function GFa(t){return t.anyOf.some(e=>nAt(e))}a(GFa,"Union");function $Fa(t){return!nAt(t.not)}a($Fa,"Not");function nAt(t){return t[rAt.Kind]==="Intersect"?HFa(t):t[rAt.Kind]==="Union"?GFa(t):t[rAt.Kind]==="Not"?$Fa(t):t[rAt.Kind]==="Undefined"}a(nAt,"ExtendsUndefinedCheck")});var dre=I(ED=>{"use strict";p();var VFa=ED&&ED.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e4e=ED&&ED.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VFa(e,t,r)};Object.defineProperty(ED,"__esModule",{value:!0});e4e(C1r(),ED);e4e(x1r(),ED);e4e(S1r(),ED);e4e(k1r(),ED);e4e(tAt(),ED)});var D1r=I(P1r=>{"use strict";p();Object.defineProperty(P1r,"__esModule",{value:!0});P1r.ExcludeFromTemplateLiteral=YFa;var WFa=iAt(),zFa=gD();function YFa(t,e){return(0,WFa.Exclude)((0,zFa.TemplateLiteralToUnion)(t),e)}a(YFa,"ExcludeFromTemplateLiteral")});var iAt=I(O1r=>{"use strict";p();Object.defineProperty(O1r,"__esModule",{value:!0});O1r.Exclude=t8a;var N1r=Ii(),KFa=wp(),JFa=Sm(),oAt=dre(),ZFa=L1r(),XFa=D1r(),M1r=vs();function e8a(t,e){let r=t.filter(n=>(0,oAt.ExtendsCheck)(n,e)===oAt.ExtendsResult.False);return r.length===1?r[0]:(0,KFa.Union)(r)}a(e8a,"ExcludeRest");function t8a(t,e,r={}){return(0,M1r.IsTemplateLiteral)(t)?(0,N1r.CreateType)((0,XFa.ExcludeFromTemplateLiteral)(t,e),r):(0,M1r.IsMappedResult)(t)?(0,N1r.CreateType)((0,ZFa.ExcludeFromMappedResult)(t,e),r):(0,N1r.CreateType)((0,M1r.IsUnion)(t)?e8a(t.anyOf,e):(0,oAt.ExtendsCheck)(t,e)!==oAt.ExtendsResult.False?(0,JFa.Never)():t,r)}a(t8a,"Exclude")});var L1r=I(B1r=>{"use strict";p();Object.defineProperty(B1r,"__esModule",{value:!0});B1r.ExcludeFromMappedResult=s8a;var r8a=Tm(),n8a=iAt();function i8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,n8a.Exclude)(t[n],e);return r}a(i8a,"FromProperties");function o8a(t,e){return i8a(t.properties,e)}a(o8a,"FromMappedResult");function s8a(t,e){let r=o8a(t,e);return(0,r8a.MappedResult)(r)}a(s8a,"ExcludeFromMappedResult")});var sAt=I(f6=>{"use strict";p();var a8a=f6&&f6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F1r=f6&&f6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a8a(e,t,r)};Object.defineProperty(f6,"__esModule",{value:!0});F1r(L1r(),f6);F1r(D1r(),f6);F1r(iAt(),f6)});var Q1r=I(U1r=>{"use strict";p();Object.defineProperty(U1r,"__esModule",{value:!0});U1r.ExtractFromTemplateLiteral=u8a;var c8a=aAt(),l8a=gD();function u8a(t,e){return(0,c8a.Extract)((0,l8a.TemplateLiteralToUnion)(t),e)}a(u8a,"ExtractFromTemplateLiteral")});var aAt=I(H1r=>{"use strict";p();Object.defineProperty(H1r,"__esModule",{value:!0});H1r.Extract=g8a;var q1r=Ii(),d8a=wp(),f8a=Sm(),cAt=dre(),p8a=G1r(),h8a=Q1r(),j1r=vs();function m8a(t,e){let r=t.filter(n=>(0,cAt.ExtendsCheck)(n,e)!==cAt.ExtendsResult.False);return r.length===1?r[0]:(0,d8a.Union)(r)}a(m8a,"ExtractRest");function g8a(t,e,r){return(0,j1r.IsTemplateLiteral)(t)?(0,q1r.CreateType)((0,h8a.ExtractFromTemplateLiteral)(t,e),r):(0,j1r.IsMappedResult)(t)?(0,q1r.CreateType)((0,p8a.ExtractFromMappedResult)(t,e),r):(0,q1r.CreateType)((0,j1r.IsUnion)(t)?m8a(t.anyOf,e):(0,cAt.ExtendsCheck)(t,e)!==cAt.ExtendsResult.False?t:(0,f8a.Never)(),r)}a(g8a,"Extract")});var G1r=I($1r=>{"use strict";p();Object.defineProperty($1r,"__esModule",{value:!0});$1r.ExtractFromMappedResult=v8a;var A8a=Tm(),y8a=aAt();function E8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,y8a.Extract)(t[n],e);return r}a(E8a,"FromProperties");function _8a(t,e){return E8a(t.properties,e)}a(_8a,"FromMappedResult");function v8a(t,e){let r=_8a(t,e);return(0,A8a.MappedResult)(r)}a(v8a,"ExtractFromMappedResult")});var lAt=I(p6=>{"use strict";p();var C8a=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]})),V1r=p6&&p6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C8a(e,t,r)};Object.defineProperty(p6,"__esModule",{value:!0});V1r(G1r(),p6);V1r(Q1r(),p6);V1r(aAt(),p6)});var ZRi=I(h6=>{"use strict";p();var b8a=h6&&h6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S8a=h6&&h6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T8a=h6&&h6.__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 k8a=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]})),P8a=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k8a(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});P8a(ZRi(),fre)});var XRi=I(W1r=>{"use strict";p();Object.defineProperty(W1r,"__esModule",{value:!0});W1r.ReadonlyOptional=M8a;var D8a=WG(),N8a=$4();function M8a(t){return(0,D8a.Readonly)((0,N8a.Optional)(t))}a(M8a,"ReadonlyOptional")});var t4e=I(pre=>{"use strict";p();var O8a=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]})),L8a=pre&&pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O8a(e,t,r)};Object.defineProperty(pre,"__esModule",{value:!0});L8a(XRi(),pre)});var iki=I(oAe=>{"use strict";p();Object.defineProperty(oAe,"__esModule",{value:!0});oAe.Record=X8a;oAe.RecordPattern=Y1r;oAe.RecordKey=e6a;oAe.RecordValue=t6a;var B8a=Ii(),tki=Sn(),F8a=Sm(),U8a=HG(),rki=Rv(),eki=GG(),Q8a=wp(),q8a=gD(),hre=L5e(),nki=AD(),j8a=wv(),z4=vs();function mre(t,e,r){return(0,B8a.CreateType)({[tki.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(mre,"RecordCreateFromPattern");function z1r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,rki.Object)(n,{...r,[tki.Hint]:"Record"})}a(z1r,"RecordCreateFromKeys");function H8a(t,e,r){return(0,q8a.IsTemplateLiteralFinite)(t)?z1r((0,nki.IndexPropertyKeys)(t),e,r):mre(t.pattern,e,r)}a(H8a,"FromTemplateLiteralKey");function G8a(t,e,r){return z1r((0,nki.IndexPropertyKeys)((0,Q8a.Union)(t)),e,r)}a(G8a,"FromUnionKey");function $8a(t,e,r){return z1r([t.toString()],e,r)}a($8a,"FromLiteralKey");function V8a(t,e,r){return mre(t.source,e,r)}a(V8a,"FromRegExpKey");function W8a(t,e,r){let n=(0,j8a.IsUndefined)(t.pattern)?hre.PatternStringExact:t.pattern;return mre(n,e,r)}a(W8a,"FromStringKey");function z8a(t,e,r){return mre(hre.PatternStringExact,e,r)}a(z8a,"FromAnyKey");function Y8a(t,e,r){return mre(hre.PatternNeverExact,e,r)}a(Y8a,"FromNeverKey");function K8a(t,e,r){return(0,rki.Object)({true:e,false:e},r)}a(K8a,"FromBooleanKey");function J8a(t,e,r){return mre(hre.PatternNumberExact,e,r)}a(J8a,"FromIntegerKey");function Z8a(t,e,r){return mre(hre.PatternNumberExact,e,r)}a(Z8a,"FromNumberKey");function X8a(t,e,r={}){return(0,z4.IsUnion)(t)?G8a(t.anyOf,e,r):(0,z4.IsTemplateLiteral)(t)?H8a(t,e,r):(0,z4.IsLiteral)(t)?$8a(t.const,e,r):(0,z4.IsBoolean)(t)?K8a(t,e,r):(0,z4.IsInteger)(t)?J8a(t,e,r):(0,z4.IsNumber)(t)?Z8a(t,e,r):(0,z4.IsRegExp)(t)?V8a(t,e,r):(0,z4.IsString)(t)?W8a(t,e,r):(0,z4.IsAny)(t)?z8a(t,e,r):(0,z4.IsNever)(t)?Y8a(t,e,r):(0,F8a.Never)(r)}a(X8a,"Record");function Y1r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(Y1r,"RecordPattern");function e6a(t){let e=Y1r(t);return e===hre.PatternStringExact?(0,eki.String)():e===hre.PatternNumberExact?(0,U8a.Number)():(0,eki.String)({pattern:e})}a(e6a,"RecordKey");function t6a(t){return t.patternProperties[Y1r(t)]}a(t6a,"RecordValue")});var sAe=I(gre=>{"use strict";p();var r6a=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]})),n6a=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&r6a(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});n6a(iki(),gre)});var ski=I(Y4=>{"use strict";p();var i6a=Y4&&Y4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o6a=Y4&&Y4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oki=Y4&&Y4.__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]:T6a(t,e[n])}),{})}a(I6a,"FromProperties");function aAe(t,e){return e.map(r=>_D(t,r))}a(aAe,"FromTypes");function _D(t,e){return t1.IsConstructor(e)?p6a(t,e):t1.IsFunction(e)?h6a(t,e):t1.IsIntersect(e)?m6a(t,e):t1.IsUnion(e)?g6a(t,e):t1.IsTuple(e)?A6a(t,e):t1.IsArray(e)?y6a(t,e):t1.IsAsyncIterator(e)?E6a(t,e):t1.IsIterator(e)?_6a(t,e):t1.IsPromise(e)?v6a(t,e):t1.IsObject(e)?C6a(t,e):t1.IsRecord(e)?b6a(t,e):t1.IsArgument(e)?S6a(t,e):e}a(_D,"FromType");function x6a(t,e){return _D(e,(0,s6a.CloneType)(t))}a(x6a,"Instantiate")});var dAt=I(Are=>{"use strict";p();var w6a=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]})),R6a=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w6a(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});R6a(ski(),Are)});var aki=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Integer=D6a;var k6a=Ii(),P6a=Sn();function D6a(t){return(0,k6a.CreateType)({[P6a.Kind]:"Integer",type:"integer"},t)}a(D6a,"Integer")});var fAt=I(yre=>{"use strict";p();var N6a=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]})),M6a=yre&&yre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N6a(e,t,r)};Object.defineProperty(yre,"__esModule",{value:!0});M6a(aki(),yre)});var X1r=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.IntrinsicFromMappedKey=j6a;var O6a=Tm(),L6a=Ere(),B6a=QE(),F6a=Yb();function U6a(t,e,r){return{[t]:(0,L6a.Intrinsic)((0,B6a.Literal)(t),e,(0,F6a.Clone)(r))}}a(U6a,"MappedIntrinsicPropertyKey");function Q6a(t,e,r){return t.reduce((o,s)=>({...o,...U6a(s,e,r)}),{})}a(Q6a,"MappedIntrinsicPropertyKeys");function q6a(t,e,r){return Q6a(t.keys,e,r)}a(q6a,"MappedIntrinsicProperties");function j6a(t,e,r){let n=q6a(t,e,r);return(0,O6a.MappedResult)(n)}a(j6a,"IntrinsicFromMappedKey")});var Ere=I(eSr=>{"use strict";p();Object.defineProperty(eSr,"__esModule",{value:!0});eSr.Intrinsic=fki;var H6a=Ii(),pAt=gD(),G6a=X1r(),cki=QE(),lki=wp(),hAt=vs();function $6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a($6a,"ApplyUncapitalize");function V6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(V6a,"ApplyCapitalize");function W6a(t){return t.toUpperCase()}a(W6a,"ApplyUppercase");function z6a(t){return t.toLowerCase()}a(z6a,"ApplyLowercase");function Y6a(t,e,r){let n=(0,pAt.TemplateLiteralParseExact)(t.pattern);if(!(0,pAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:uki(t.pattern,e)};let c=[...(0,pAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,cki.Literal)(d)),l=dki(c,e),u=(0,lki.Union)(l);return(0,pAt.TemplateLiteral)([u],r)}a(Y6a,"FromTemplateLiteral");function uki(t,e){return typeof t=="string"?e==="Uncapitalize"?$6a(t):e==="Capitalize"?V6a(t):e==="Uppercase"?W6a(t):e==="Lowercase"?z6a(t):t:t.toString()}a(uki,"FromLiteralValue");function dki(t,e){return t.map(r=>fki(r,e))}a(dki,"FromRest");function fki(t,e,r={}){return(0,hAt.IsMappedKey)(t)?(0,G6a.IntrinsicFromMappedKey)(t,e,r):(0,hAt.IsTemplateLiteral)(t)?Y6a(t,e,r):(0,hAt.IsUnion)(t)?(0,lki.Union)(dki(t.anyOf,e),r):(0,hAt.IsLiteral)(t)?(0,cki.Literal)(uki(t.const,e),r):(0,H6a.CreateType)(t,r)}a(fki,"Intrinsic")});var pki=I(tSr=>{"use strict";p();Object.defineProperty(tSr,"__esModule",{value:!0});tSr.Capitalize=J6a;var K6a=Ere();function J6a(t,e={}){return(0,K6a.Intrinsic)(t,"Capitalize",e)}a(J6a,"Capitalize")});var hki=I(rSr=>{"use strict";p();Object.defineProperty(rSr,"__esModule",{value:!0});rSr.Lowercase=X6a;var Z6a=Ere();function X6a(t,e={}){return(0,Z6a.Intrinsic)(t,"Lowercase",e)}a(X6a,"Lowercase")});var mki=I(nSr=>{"use strict";p();Object.defineProperty(nSr,"__esModule",{value:!0});nSr.Uncapitalize=t9a;var e9a=Ere();function t9a(t,e={}){return(0,e9a.Intrinsic)(t,"Uncapitalize",e)}a(t9a,"Uncapitalize")});var gki=I(iSr=>{"use strict";p();Object.defineProperty(iSr,"__esModule",{value:!0});iSr.Uppercase=n9a;var r9a=Ere();function n9a(t,e={}){return(0,r9a.Intrinsic)(t,"Uppercase",e)}a(n9a,"Uppercase")});var mAt=I(NR=>{"use strict";p();var i9a=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]})),cAe=NR&&NR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i9a(e,t,r)};Object.defineProperty(NR,"__esModule",{value:!0});cAe(pki(),NR);cAe(X1r(),NR);cAe(Ere(),NR);cAe(hki(),NR);cAe(mki(),NR);cAe(gki(),NR)});var sSr=I(oSr=>{"use strict";p();Object.defineProperty(oSr,"__esModule",{value:!0});oSr.OmitFromMappedResult=u9a;var o9a=Tm(),s9a=gAt(),a9a=Yb();function c9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,s9a.Omit)(t[o],e,(0,a9a.Clone)(r));return n}a(c9a,"FromProperties");function l9a(t,e,r){return c9a(t.properties,e,r)}a(l9a,"FromMappedResult");function u9a(t,e,r){let n=l9a(t,e,r);return(0,o9a.MappedResult)(n)}a(u9a,"OmitFromMappedResult")});var gAt=I(lSr=>{"use strict";p();Object.defineProperty(lSr,"__esModule",{value:!0});lSr.Omit=I9a;var d9a=Ii(),f9a=kgt(),p9a=D5e(),aSr=qG(),h9a=QE(),m9a=AD(),g9a=tI(),Aki=wp(),yki=Rv(),A9a=uSr(),y9a=sSr(),m6=vs(),E9a=wv();function _9a(t,e){return t.map(r=>cSr(r,e))}a(_9a,"FromIntersect");function v9a(t,e){return t.map(r=>cSr(r,e))}a(v9a,"FromUnion");function C9a(t,e){let{[e]:r,...n}=t;return n}a(C9a,"FromProperty");function b9a(t,e){return e.reduce((r,n)=>C9a(r,n),t)}a(b9a,"FromProperties");function S9a(t,e,r){let n=(0,f9a.Discard)(t,[p9a.TransformKind,"$id","required","properties"]),o=b9a(r,e);return(0,yki.Object)(o,n)}a(S9a,"FromObject");function T9a(t){let e=t.reduce((r,n)=>(0,m6.IsLiteralValue)(n)?[...r,(0,h9a.Literal)(n)]:r,[]);return(0,Aki.Union)(e)}a(T9a,"UnionFromPropertyKeys");function cSr(t,e){return(0,m6.IsIntersect)(t)?(0,g9a.Intersect)(_9a(t.allOf,e)):(0,m6.IsUnion)(t)?(0,Aki.Union)(v9a(t.anyOf,e)):(0,m6.IsObject)(t)?S9a(t,e,t.properties):(0,yki.Object)({})}a(cSr,"OmitResolve");function I9a(t,e,r){let n=(0,E9a.IsArray)(e)?T9a(e):e,o=(0,m6.IsSchema)(e)?(0,m9a.IndexPropertyKeys)(e):e,s=(0,m6.IsRef)(t),c=(0,m6.IsRef)(e);return(0,m6.IsMappedResult)(t)?(0,y9a.OmitFromMappedResult)(t,o,r):(0,m6.IsMappedKey)(e)?(0,A9a.OmitFromMappedKey)(t,e,r):s&&c?(0,aSr.Computed)("Omit",[t,n],r):!s&&c?(0,aSr.Computed)("Omit",[t,n],r):s&&!c?(0,aSr.Computed)("Omit",[t,n],r):(0,d9a.CreateType)({...cSr(t,o),...r})}a(I9a,"Omit")});var uSr=I(dSr=>{"use strict";p();Object.defineProperty(dSr,"__esModule",{value:!0});dSr.OmitFromMappedKey=N9a;var x9a=Tm(),w9a=gAt(),R9a=Yb();function k9a(t,e,r){return{[e]:(0,w9a.Omit)(t,[e],(0,R9a.Clone)(r))}}a(k9a,"FromPropertyKey");function P9a(t,e,r){return e.reduce((n,o)=>({...n,...k9a(t,o,r)}),{})}a(P9a,"FromPropertyKeys");function D9a(t,e,r){return P9a(t,e.keys,r)}a(D9a,"FromMappedKey");function N9a(t,e,r){let n=D9a(t,e,r);return(0,x9a.MappedResult)(n)}a(N9a,"OmitFromMappedKey")});var r4e=I(g6=>{"use strict";p();var M9a=g6&&g6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fSr=g6&&g6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M9a(e,t,r)};Object.defineProperty(g6,"__esModule",{value:!0});fSr(uSr(),g6);fSr(sSr(),g6);fSr(gAt(),g6)});var hSr=I(pSr=>{"use strict";p();Object.defineProperty(pSr,"__esModule",{value:!0});pSr.PickFromMappedResult=Q9a;var O9a=Tm(),L9a=AAt(),B9a=Yb();function F9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,L9a.Pick)(t[o],e,(0,B9a.Clone)(r));return n}a(F9a,"FromProperties");function U9a(t,e,r){return F9a(t.properties,e,r)}a(U9a,"FromMappedResult");function Q9a(t,e,r){let n=U9a(t,e,r);return(0,O9a.MappedResult)(n)}a(Q9a,"PickFromMappedResult")});var AAt=I(ASr=>{"use strict";p();Object.defineProperty(ASr,"__esModule",{value:!0});ASr.Pick=tUa;var q9a=Ii(),j9a=kgt(),mSr=qG(),H9a=tI(),G9a=QE(),Eki=Rv(),_ki=wp(),$9a=AD(),V9a=D5e(),A6=vs(),W9a=wv(),z9a=ySr(),Y9a=hSr();function K9a(t,e){return t.map(r=>gSr(r,e))}a(K9a,"FromIntersect");function J9a(t,e){return t.map(r=>gSr(r,e))}a(J9a,"FromUnion");function Z9a(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(Z9a,"FromProperties");function X9a(t,e,r){let n=(0,j9a.Discard)(t,[V9a.TransformKind,"$id","required","properties"]),o=Z9a(r,e);return(0,Eki.Object)(o,n)}a(X9a,"FromObject");function eUa(t){let e=t.reduce((r,n)=>(0,A6.IsLiteralValue)(n)?[...r,(0,G9a.Literal)(n)]:r,[]);return(0,_ki.Union)(e)}a(eUa,"UnionFromPropertyKeys");function gSr(t,e){return(0,A6.IsIntersect)(t)?(0,H9a.Intersect)(K9a(t.allOf,e)):(0,A6.IsUnion)(t)?(0,_ki.Union)(J9a(t.anyOf,e)):(0,A6.IsObject)(t)?X9a(t,e,t.properties):(0,Eki.Object)({})}a(gSr,"PickResolve");function tUa(t,e,r){let n=(0,W9a.IsArray)(e)?eUa(e):e,o=(0,A6.IsSchema)(e)?(0,$9a.IndexPropertyKeys)(e):e,s=(0,A6.IsRef)(t),c=(0,A6.IsRef)(e);return(0,A6.IsMappedResult)(t)?(0,Y9a.PickFromMappedResult)(t,o,r):(0,A6.IsMappedKey)(e)?(0,z9a.PickFromMappedKey)(t,e,r):s&&c?(0,mSr.Computed)("Pick",[t,n],r):!s&&c?(0,mSr.Computed)("Pick",[t,n],r):s&&!c?(0,mSr.Computed)("Pick",[t,n],r):(0,q9a.CreateType)({...gSr(t,o),...r})}a(tUa,"Pick")});var ySr=I(ESr=>{"use strict";p();Object.defineProperty(ESr,"__esModule",{value:!0});ESr.PickFromMappedKey=cUa;var rUa=Tm(),nUa=AAt(),iUa=Yb();function oUa(t,e,r){return{[e]:(0,nUa.Pick)(t,[e],(0,iUa.Clone)(r))}}a(oUa,"FromPropertyKey");function sUa(t,e,r){return e.reduce((n,o)=>({...n,...oUa(t,o,r)}),{})}a(sUa,"FromPropertyKeys");function aUa(t,e,r){return sUa(t,e.keys,r)}a(aUa,"FromMappedKey");function cUa(t,e,r){let n=aUa(t,e,r);return(0,rUa.MappedResult)(n)}a(cUa,"PickFromMappedKey")});var n4e=I(y6=>{"use strict";p();var lUa=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]})),_Sr=y6&&y6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lUa(e,t,r)};Object.defineProperty(y6,"__esModule",{value:!0});_Sr(ySr(),y6);_Sr(hSr(),y6);_Sr(AAt(),y6)});var CSr=I(E6=>{"use strict";p();var uUa=E6&&E6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dUa=E6&&E6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fUa=E6&&E6.__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;obki(e))}a(vki,"FromRest");function bki(t){return Pv.IsComputed(t)?vUa(t.target,t.parameters):Pv.IsRef(t)?CUa(t.$ref):Pv.IsIntersect(t)?(0,mUa.Intersect)(vki(t.allOf)):Pv.IsUnion(t)?(0,gUa.Union)(vki(t.anyOf)):Pv.IsObject(t)?SUa(t,t.properties):Pv.IsBigInt(t)||Pv.IsBoolean(t)||Pv.IsInteger(t)||Pv.IsLiteral(t)||Pv.IsNull(t)||Pv.IsNumber(t)||Pv.IsString(t)||Pv.IsSymbol(t)||Pv.IsUndefined(t)?t:(0,Cki.Object)({})}a(bki,"PartialResolve");function TUa(t,e){return Pv.IsMappedResult(t)?(0,_Ua.PartialFromMappedResult)(t,e):(0,pUa.CreateType)({...bki(t),...e})}a(TUa,"Partial")});var bSr=I(SSr=>{"use strict";p();Object.defineProperty(SSr,"__esModule",{value:!0});SSr.PartialFromMappedResult=PUa;var IUa=Tm(),xUa=CSr(),wUa=Yb();function RUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,xUa.Partial)(t[n],(0,wUa.Clone)(e));return r}a(RUa,"FromProperties");function kUa(t,e){return RUa(t.properties,e)}a(kUa,"FromMappedResult");function PUa(t,e){let r=kUa(t,e);return(0,IUa.MappedResult)(r)}a(PUa,"PartialFromMappedResult")});var i4e=I(JG=>{"use strict";p();var DUa=JG&&JG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ski=JG&&JG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DUa(e,t,r)};Object.defineProperty(JG,"__esModule",{value:!0});Ski(bSr(),JG);Ski(CSr(),JG)});var ISr=I(_6=>{"use strict";p();var NUa=_6&&_6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MUa=_6&&_6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OUa=_6&&_6.__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;oRki(e))}a(Tki,"FromRest");function Rki(t){return Dv.IsComputed(t)?qUa(t.target,t.parameters):Dv.IsRef(t)?jUa(t.$ref):Dv.IsIntersect(t)?(0,BUa.Intersect)(Tki(t.allOf)):Dv.IsUnion(t)?(0,FUa.Union)(Tki(t.anyOf)):Dv.IsObject(t)?GUa(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,Iki.Object)({})}a(Rki,"RequiredResolve");function $Ua(t,e){return Dv.IsMappedResult(t)?(0,QUa.RequiredFromMappedResult)(t,e):(0,LUa.CreateType)({...Rki(t),...e})}a($Ua,"Required")});var xSr=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.RequiredFromMappedResult=KUa;var VUa=Tm(),WUa=ISr();function zUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,WUa.Required)(t[n],e);return r}a(zUa,"FromProperties");function YUa(t,e){return zUa(t.properties,e)}a(YUa,"FromMappedResult");function KUa(t,e){let r=YUa(t,e);return(0,VUa.MappedResult)(r)}a(KUa,"RequiredFromMappedResult")});var o4e=I(ZG=>{"use strict";p();var JUa=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]})),kki=ZG&&ZG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JUa(e,t,r)};Object.defineProperty(ZG,"__esModule",{value:!0});kki(xSr(),ZG);kki(ISr(),ZG)});var Mki=I(vD=>{"use strict";p();var ZUa=vD&&vD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XUa=vD&&vD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e7a=vD&&vD.__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;ogy.IsRef(r)?kSr(t,r.$ref):n1(t,r))}a(y7a,"DereferenceParameters");function kSr(t,e){return e in t?gy.IsRef(t[e])?kSr(t,t[e].$ref):n1(t,t[e]):(0,RSr.Never)()}a(kSr,"Dereference");function E7a(t){return(0,n7a.Awaited)(t[0])}a(E7a,"FromAwaited");function _7a(t){return(0,s7a.Index)(t[0],t[1])}a(_7a,"FromIndex");function v7a(t){return(0,u7a.KeyOf)(t[0])}a(v7a,"FromKeyOf");function C7a(t){return(0,h7a.Partial)(t[0])}a(C7a,"FromPartial");function b7a(t){return(0,f7a.Omit)(t[0],t[1])}a(b7a,"FromOmit");function S7a(t){return(0,p7a.Pick)(t[0],t[1])}a(S7a,"FromPick");function T7a(t){return(0,m7a.Required)(t[0])}a(T7a,"FromRequired");function I7a(t,e,r){let n=y7a(t,r);return e==="Awaited"?E7a(n):e==="Index"?_7a(n):e==="KeyOf"?v7a(n):e==="Partial"?C7a(n):e==="Omit"?b7a(n):e==="Pick"?S7a(n):e==="Required"?T7a(n):(0,RSr.Never)()}a(I7a,"FromComputed");function x7a(t,e){return(0,r7a.Array)(n1(t,e))}a(x7a,"FromArray");function w7a(t,e){return(0,i7a.AsyncIterator)(n1(t,e))}a(w7a,"FromAsyncIterator");function R7a(t,e,r){return(0,o7a.Constructor)(s4e(t,e),n1(t,r))}a(R7a,"FromConstructor");function k7a(t,e,r){return(0,a7a.Function)(s4e(t,e),n1(t,r))}a(k7a,"FromFunction");function P7a(t,e){return(0,c7a.Intersect)(s4e(t,e))}a(P7a,"FromIntersect");function D7a(t,e){return(0,l7a.Iterator)(n1(t,e))}a(D7a,"FromIterator");function N7a(t,e){return(0,d7a.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:n1(t,e[n])}),{}))}a(N7a,"FromObject");function M7a(t,e){let[r,n]=[n1(t,(0,Dki.RecordValue)(e)),(0,Dki.RecordPattern)(e)],o=(0,t7a.CloneType)(e);return o.patternProperties[n]=r,o}a(M7a,"FromRecord");function O7a(t,e){return gy.IsRef(e)?{...kSr(t,e.$ref),[yAt.TransformKind]:e[yAt.TransformKind]}:e}a(O7a,"FromTransform");function L7a(t,e){return(0,g7a.Tuple)(s4e(t,e))}a(L7a,"FromTuple");function B7a(t,e){return(0,A7a.Union)(s4e(t,e))}a(B7a,"FromUnion");function s4e(t,e){return e.map(r=>n1(t,r))}a(s4e,"FromTypes");function n1(t,e){return gy.IsOptional(e)?(0,r1.CreateType)(n1(t,(0,Pki.Discard)(e,[yAt.OptionalKind])),e):gy.IsReadonly(e)?(0,r1.CreateType)(n1(t,(0,Pki.Discard)(e,[yAt.ReadonlyKind])),e):gy.IsTransform(e)?(0,r1.CreateType)(O7a(t,e),e):gy.IsArray(e)?(0,r1.CreateType)(x7a(t,e.items),e):gy.IsAsyncIterator(e)?(0,r1.CreateType)(w7a(t,e.items),e):gy.IsComputed(e)?(0,r1.CreateType)(I7a(t,e.target,e.parameters)):gy.IsConstructor(e)?(0,r1.CreateType)(R7a(t,e.parameters,e.returns),e):gy.IsFunction(e)?(0,r1.CreateType)(k7a(t,e.parameters,e.returns),e):gy.IsIntersect(e)?(0,r1.CreateType)(P7a(t,e.allOf),e):gy.IsIterator(e)?(0,r1.CreateType)(D7a(t,e.items),e):gy.IsObject(e)?(0,r1.CreateType)(N7a(t,e.properties),e):gy.IsRecord(e)?(0,r1.CreateType)(M7a(t,e)):gy.IsTuple(e)?(0,r1.CreateType)(L7a(t,e.items||[]),e):gy.IsUnion(e)?(0,r1.CreateType)(B7a(t,e.anyOf),e):e}a(n1,"FromType");function Nki(t,e){return e in t?n1(t,t[e]):(0,RSr.Never)()}a(Nki,"ComputeType");function F7a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Nki(t,r)}),{})}a(F7a,"ComputeModuleProperties")});var Lki=I(a4e=>{"use strict";p();Object.defineProperty(a4e,"__esModule",{value:!0});a4e.TModule=void 0;a4e.Module=q7a;var Oki=n6(),U7a=Sn(),Q7a=Mki(),EAt=class{static{a(this,"TModule")}constructor(e){let r=(0,Q7a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,Oki.CreateType)(this.$defs[e],r)};return(0,Oki.CreateType)({[U7a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};a4e.TModule=EAt;function q7a(t){return new EAt(t)}a(q7a,"Module")});var _At=I(_re=>{"use strict";p();var j7a=_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]})),H7a=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j7a(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});H7a(Lki(),_re)});var Bki=I(PSr=>{"use strict";p();Object.defineProperty(PSr,"__esModule",{value:!0});PSr.Not=V7a;var G7a=Ii(),$7a=Sn();function V7a(t,e){return(0,G7a.CreateType)({[$7a.Kind]:"Not",not:t},e)}a(V7a,"Not")});var vAt=I(vre=>{"use strict";p();var W7a=vre&&vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z7a=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W7a(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});z7a(Bki(),vre)});var Fki=I(v6=>{"use strict";p();var Y7a=v6&&v6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),K7a=v6&&v6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J7a=v6&&v6.__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 rQa=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]})),nQa=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rQa(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});nQa(Fki(),Cre)});var Qki=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Recursive=cQa;var iQa=Cgt(),oQa=Ii(),sQa=wv(),Uki=Sn(),aQa=0;function cQa(t,e={}){(0,sQa.IsUndefined)(e.$id)&&(e.$id=`T${aQa++}`);let r=(0,iQa.CloneType)(t({[Uki.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,oQa.CreateType)({[Uki.Hint]:"Recursive",...r},e)}a(cQa,"Recursive")});var bAt=I(bre=>{"use strict";p();var lQa=bre&&bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uQa=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lQa(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});uQa(Qki(),bre)});var qki=I(NSr=>{"use strict";p();Object.defineProperty(NSr,"__esModule",{value:!0});NSr.RegExp=hQa;var dQa=Ii(),fQa=wv(),pQa=Sn();function hQa(t,e){let r=(0,fQa.IsString)(t)?new globalThis.RegExp(t):t;return(0,dQa.CreateType)({[pQa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(hQa,"RegExp")});var SAt=I(Sre=>{"use strict";p();var mQa=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]})),gQa=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mQa(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});gQa(qki(),Sre)});var jki=I(OSr=>{"use strict";p();Object.defineProperty(OSr,"__esModule",{value:!0});OSr.Rest=yQa;var MSr=vs();function AQa(t){return(0,MSr.IsIntersect)(t)?t.allOf:(0,MSr.IsUnion)(t)?t.anyOf:(0,MSr.IsTuple)(t)?t.items??[]:[]}a(AQa,"RestResolve");function yQa(t){return AQa(t)}a(yQa,"Rest")});var TAt=I(Tre=>{"use strict";p();var EQa=Tre&&Tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Qa=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EQa(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});_Qa(jki(),Tre)});var Hki=I(C6=>{"use strict";p();var vQa=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]})),CQa=C6&&C6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bQa=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{"use strict";p();var wQa=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]})),RQa=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wQa(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});RQa(Hki(),Ire)});var $ki=I(Gki=>{"use strict";p();Object.defineProperty(Gki,"__esModule",{value:!0})});var Wki=I(Vki=>{"use strict";p();Object.defineProperty(Vki,"__esModule",{value:!0});var Z2p=Sn()});var Yki=I(XG=>{"use strict";p();var kQa=XG&&XG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zki=XG&&XG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kQa(e,t,r)};Object.defineProperty(XG,"__esModule",{value:!0});zki($ki(),XG);zki(Wki(),XG)});var Jki=I(Kki=>{"use strict";p();Object.defineProperty(Kki,"__esModule",{value:!0})});var Zki=I(xre=>{"use strict";p();var PQa=xre&&xre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DQa=xre&&xre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PQa(e,t,r)};Object.defineProperty(xre,"__esModule",{value:!0});DQa(Jki(),xre)});var Xki=I(wre=>{"use strict";p();Object.defineProperty(wre,"__esModule",{value:!0});wre.TransformEncodeBuilder=wre.TransformDecodeBuilder=void 0;wre.Transform=MQa;var xAt=Sn(),NQa=vs(),wAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new RAt(this.schema,e)}};wre.TransformDecodeBuilder=wAt;var RAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[xAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[xAt.TransformKind].Decode(c)),"Decode")};return{...r,[xAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[xAt.TransformKind]:n}}Encode(e){return(0,NQa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};wre.TransformEncodeBuilder=RAt;function MQa(t){return new wAt(t)}a(MQa,"Transform")});var kAt=I(Rre=>{"use strict";p();var OQa=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]})),LQa=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OQa(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});LQa(Xki(),Rre)});var tPi=I(LSr=>{"use strict";p();Object.defineProperty(LSr,"__esModule",{value:!0});LSr.Unsafe=FQa;var BQa=Ii(),ePi=Sn();function FQa(t={}){return(0,BQa.CreateType)({[ePi.Kind]:t[ePi.Kind]??"Unsafe"},t)}a(FQa,"Unsafe")});var c4e=I(kre=>{"use strict";p();var UQa=kre&&kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QQa=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UQa(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});QQa(tPi(),kre)});var rPi=I(BSr=>{"use strict";p();Object.defineProperty(BSr,"__esModule",{value:!0});BSr.Void=HQa;var qQa=Ii(),jQa=Sn();function HQa(t){return(0,qQa.CreateType)({[jQa.Kind]:"Void",type:"void"},t)}a(HQa,"Void")});var PAt=I(Pre=>{"use strict";p();var GQa=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]})),$Qa=Pre&&Pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GQa(e,t,r)};Object.defineProperty(Pre,"__esModule",{value:!0});$Qa(rPi(),Pre)});var USr=I(NAt=>{"use strict";p();Object.defineProperty(NAt,"__esModule",{value:!0});NAt.JsonTypeBuilder=void 0;var VQa=Vge(),WQa=Wge(),zQa=Q5e(),YQa=Wgt(),KQa=Ygt(),JQa=Jgt(),ZQa=sAt(),XQa=dre(),eqa=lAt(),tqa=AD(),rqa=fAt(),nqa=tI(),DAt=mAt(),iqa=yD(),oqa=QE(),sqa=Tm(),aqa=Sm(),cqa=vAt(),lqa=K5e(),uqa=_At(),dqa=HG(),fqa=Rv(),pqa=r4e(),hqa=$4(),mqa=i4e(),gqa=n4e(),Aqa=WG(),yqa=t4e(),Eqa=sAe(),_qa=bAt(),vqa=YG(),Cqa=o4e(),bqa=TAt(),Sqa=GG(),Tqa=gD(),Iqa=kAt(),xqa=c6(),wqa=wp(),Rqa=KG(),kqa=c4e(),FSr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,yqa.ReadonlyOptional)(e)}Readonly(e,r){return(0,Aqa.Readonly)(e,r??!0)}Optional(e,r){return(0,hqa.Optional)(e,r??!0)}Any(e){return(0,VQa.Any)(e)}Array(e,r){return(0,WQa.Array)(e,r)}Boolean(e){return(0,zQa.Boolean)(e)}Capitalize(e,r){return(0,DAt.Capitalize)(e,r)}Composite(e,r){return(0,YQa.Composite)(e,r)}Const(e,r){return(0,KQa.Const)(e,r)}Enum(e,r){return(0,JQa.Enum)(e,r)}Exclude(e,r,n){return(0,ZQa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,XQa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,eqa.Extract)(e,r,n)}Index(e,r,n){return(0,tqa.Index)(e,r,n)}Integer(e){return(0,rqa.Integer)(e)}Intersect(e,r){return(0,nqa.Intersect)(e,r)}KeyOf(e,r){return(0,iqa.KeyOf)(e,r)}Literal(e,r){return(0,oqa.Literal)(e,r)}Lowercase(e,r){return(0,DAt.Lowercase)(e,r)}Mapped(e,r,n){return(0,sqa.Mapped)(e,r,n)}Module(e){return(0,uqa.Module)(e)}Never(e){return(0,aqa.Never)(e)}Not(e,r){return(0,cqa.Not)(e,r)}Null(e){return(0,lqa.Null)(e)}Number(e){return(0,dqa.Number)(e)}Object(e,r){return(0,fqa.Object)(e,r)}Omit(e,r,n){return(0,pqa.Omit)(e,r,n)}Partial(e,r){return(0,mqa.Partial)(e,r)}Pick(e,r,n){return(0,gqa.Pick)(e,r,n)}Record(e,r,n){return(0,Eqa.Record)(e,r,n)}Recursive(e,r){return(0,_qa.Recursive)(e,r)}Ref(...e){return(0,vqa.Ref)(e[0],e[1])}Required(e,r){return(0,Cqa.Required)(e,r)}Rest(e){return(0,bqa.Rest)(e)}String(e){return(0,Sqa.String)(e)}TemplateLiteral(e,r){return(0,Tqa.TemplateLiteral)(e,r)}Transform(e){return(0,Iqa.Transform)(e)}Tuple(e,r){return(0,xqa.Tuple)(e,r)}Uncapitalize(e,r){return(0,DAt.Uncapitalize)(e,r)}Union(e,r){return(0,wqa.Union)(e,r)}Unknown(e){return(0,Rqa.Unknown)(e)}Unsafe(e){return(0,kqa.Unsafe)(e)}Uppercase(e,r){return(0,DAt.Uppercase)(e,r)}};NAt.JsonTypeBuilder=FSr});var nPi=I(Ot=>{"use strict";p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Rest=Ot.Required=Ot.RegExp=Ot.Ref=Ot.Recursive=Ot.Record=Ot.ReadonlyOptional=Ot.Readonly=Ot.Promise=Ot.Pick=Ot.Partial=Ot.Parameters=Ot.Optional=Ot.Omit=Ot.Object=Ot.Number=Ot.Null=Ot.Not=Ot.Never=Ot.Module=Ot.Mapped=Ot.Literal=Ot.KeyOf=Ot.Iterator=Ot.Uppercase=Ot.Lowercase=Ot.Uncapitalize=Ot.Capitalize=Ot.Intersect=Ot.Integer=Ot.Instantiate=Ot.InstanceType=Ot.Index=Ot.Function=Ot.Extract=Ot.Extends=Ot.Exclude=Ot.Enum=Ot.Date=Ot.ConstructorParameters=Ot.Constructor=Ot.Const=Ot.Composite=Ot.Boolean=Ot.BigInt=Ot.Awaited=Ot.AsyncIterator=Ot.Array=Ot.Argument=Ot.Any=void 0;Ot.Void=Ot.Unsafe=Ot.Unknown=Ot.Union=Ot.Undefined=Ot.Uint8Array=Ot.Tuple=Ot.Transform=Ot.TemplateLiteral=Ot.Symbol=Ot.String=Ot.ReturnType=void 0;var Pqa=Vge();Object.defineProperty(Ot,"Any",{enumerable:!0,get:a(function(){return Pqa.Any},"get")});var Dqa=Rgt();Object.defineProperty(Ot,"Argument",{enumerable:!0,get:a(function(){return Dqa.Argument},"get")});var Nqa=Wge();Object.defineProperty(Ot,"Array",{enumerable:!0,get:a(function(){return Nqa.Array},"get")});var Mqa=zge();Object.defineProperty(Ot,"AsyncIterator",{enumerable:!0,get:a(function(){return Mqa.AsyncIterator},"get")});var Oqa=z5e();Object.defineProperty(Ot,"Awaited",{enumerable:!0,get:a(function(){return Oqa.Awaited},"get")});var Lqa=Xge();Object.defineProperty(Ot,"BigInt",{enumerable:!0,get:a(function(){return Lqa.BigInt},"get")});var Bqa=Q5e();Object.defineProperty(Ot,"Boolean",{enumerable:!0,get:a(function(){return Bqa.Boolean},"get")});var Fqa=Wgt();Object.defineProperty(Ot,"Composite",{enumerable:!0,get:a(function(){return Fqa.Composite},"get")});var Uqa=Ygt();Object.defineProperty(Ot,"Const",{enumerable:!0,get:a(function(){return Uqa.Const},"get")});var Qqa=Yge();Object.defineProperty(Ot,"Constructor",{enumerable:!0,get:a(function(){return Qqa.Constructor},"get")});var qqa=Kgt();Object.defineProperty(Ot,"ConstructorParameters",{enumerable:!0,get:a(function(){return qqa.ConstructorParameters},"get")});var jqa=Y5e();Object.defineProperty(Ot,"Date",{enumerable:!0,get:a(function(){return jqa.Date},"get")});var Hqa=Jgt();Object.defineProperty(Ot,"Enum",{enumerable:!0,get:a(function(){return Hqa.Enum},"get")});var Gqa=sAt();Object.defineProperty(Ot,"Exclude",{enumerable:!0,get:a(function(){return Gqa.Exclude},"get")});var $qa=dre();Object.defineProperty(Ot,"Extends",{enumerable:!0,get:a(function(){return $qa.Extends},"get")});var Vqa=lAt();Object.defineProperty(Ot,"Extract",{enumerable:!0,get:a(function(){return Vqa.Extract},"get")});var Wqa=jG();Object.defineProperty(Ot,"Function",{enumerable:!0,get:a(function(){return Wqa.Function},"get")});var zqa=AD();Object.defineProperty(Ot,"Index",{enumerable:!0,get:a(function(){return zqa.Index},"get")});var Yqa=uAt();Object.defineProperty(Ot,"InstanceType",{enumerable:!0,get:a(function(){return Yqa.InstanceType},"get")});var Kqa=dAt();Object.defineProperty(Ot,"Instantiate",{enumerable:!0,get:a(function(){return Kqa.Instantiate},"get")});var Jqa=fAt();Object.defineProperty(Ot,"Integer",{enumerable:!0,get:a(function(){return Jqa.Integer},"get")});var Zqa=tI();Object.defineProperty(Ot,"Intersect",{enumerable:!0,get:a(function(){return Zqa.Intersect},"get")});var MAt=mAt();Object.defineProperty(Ot,"Capitalize",{enumerable:!0,get:a(function(){return MAt.Capitalize},"get")});Object.defineProperty(Ot,"Uncapitalize",{enumerable:!0,get:a(function(){return MAt.Uncapitalize},"get")});Object.defineProperty(Ot,"Lowercase",{enumerable:!0,get:a(function(){return MAt.Lowercase},"get")});Object.defineProperty(Ot,"Uppercase",{enumerable:!0,get:a(function(){return MAt.Uppercase},"get")});var Xqa=tAe();Object.defineProperty(Ot,"Iterator",{enumerable:!0,get:a(function(){return Xqa.Iterator},"get")});var eja=yD();Object.defineProperty(Ot,"KeyOf",{enumerable:!0,get:a(function(){return eja.KeyOf},"get")});var tja=QE();Object.defineProperty(Ot,"Literal",{enumerable:!0,get:a(function(){return tja.Literal},"get")});var rja=Tm();Object.defineProperty(Ot,"Mapped",{enumerable:!0,get:a(function(){return rja.Mapped},"get")});var nja=_At();Object.defineProperty(Ot,"Module",{enumerable:!0,get:a(function(){return nja.Module},"get")});var ija=Sm();Object.defineProperty(Ot,"Never",{enumerable:!0,get:a(function(){return ija.Never},"get")});var oja=vAt();Object.defineProperty(Ot,"Not",{enumerable:!0,get:a(function(){return oja.Not},"get")});var sja=K5e();Object.defineProperty(Ot,"Null",{enumerable:!0,get:a(function(){return sja.Null},"get")});var aja=HG();Object.defineProperty(Ot,"Number",{enumerable:!0,get:a(function(){return aja.Number},"get")});var cja=Rv();Object.defineProperty(Ot,"Object",{enumerable:!0,get:a(function(){return cja.Object},"get")});var lja=r4e();Object.defineProperty(Ot,"Omit",{enumerable:!0,get:a(function(){return lja.Omit},"get")});var uja=$4();Object.defineProperty(Ot,"Optional",{enumerable:!0,get:a(function(){return uja.Optional},"get")});var dja=CAt();Object.defineProperty(Ot,"Parameters",{enumerable:!0,get:a(function(){return dja.Parameters},"get")});var fja=i4e();Object.defineProperty(Ot,"Partial",{enumerable:!0,get:a(function(){return fja.Partial},"get")});var pja=n4e();Object.defineProperty(Ot,"Pick",{enumerable:!0,get:a(function(){return pja.Pick},"get")});var hja=$5e();Object.defineProperty(Ot,"Promise",{enumerable:!0,get:a(function(){return hja.Promise},"get")});var mja=WG();Object.defineProperty(Ot,"Readonly",{enumerable:!0,get:a(function(){return mja.Readonly},"get")});var gja=t4e();Object.defineProperty(Ot,"ReadonlyOptional",{enumerable:!0,get:a(function(){return gja.ReadonlyOptional},"get")});var Aja=sAe();Object.defineProperty(Ot,"Record",{enumerable:!0,get:a(function(){return Aja.Record},"get")});var yja=bAt();Object.defineProperty(Ot,"Recursive",{enumerable:!0,get:a(function(){return yja.Recursive},"get")});var Eja=YG();Object.defineProperty(Ot,"Ref",{enumerable:!0,get:a(function(){return Eja.Ref},"get")});var _ja=SAt();Object.defineProperty(Ot,"RegExp",{enumerable:!0,get:a(function(){return _ja.RegExp},"get")});var vja=o4e();Object.defineProperty(Ot,"Required",{enumerable:!0,get:a(function(){return vja.Required},"get")});var Cja=TAt();Object.defineProperty(Ot,"Rest",{enumerable:!0,get:a(function(){return Cja.Rest},"get")});var bja=IAt();Object.defineProperty(Ot,"ReturnType",{enumerable:!0,get:a(function(){return bja.ReturnType},"get")});var Sja=GG();Object.defineProperty(Ot,"String",{enumerable:!0,get:a(function(){return Sja.String},"get")});var Tja=J5e();Object.defineProperty(Ot,"Symbol",{enumerable:!0,get:a(function(){return Tja.Symbol},"get")});var Ija=gD();Object.defineProperty(Ot,"TemplateLiteral",{enumerable:!0,get:a(function(){return Ija.TemplateLiteral},"get")});var xja=kAt();Object.defineProperty(Ot,"Transform",{enumerable:!0,get:a(function(){return xja.Transform},"get")});var wja=c6();Object.defineProperty(Ot,"Tuple",{enumerable:!0,get:a(function(){return wja.Tuple},"get")});var Rja=X5e();Object.defineProperty(Ot,"Uint8Array",{enumerable:!0,get:a(function(){return Rja.Uint8Array},"get")});var kja=Z5e();Object.defineProperty(Ot,"Undefined",{enumerable:!0,get:a(function(){return kja.Undefined},"get")});var Pja=wp();Object.defineProperty(Ot,"Union",{enumerable:!0,get:a(function(){return Pja.Union},"get")});var Dja=KG();Object.defineProperty(Ot,"Unknown",{enumerable:!0,get:a(function(){return Dja.Unknown},"get")});var Nja=c4e();Object.defineProperty(Ot,"Unsafe",{enumerable:!0,get:a(function(){return Nja.Unsafe},"get")});var Mja=PAt();Object.defineProperty(Ot,"Void",{enumerable:!0,get:a(function(){return Mja.Void},"get")})});var iPi=I(OAt=>{"use strict";p();Object.defineProperty(OAt,"__esModule",{value:!0});OAt.JavaScriptTypeBuilder=void 0;var Oja=USr(),Lja=Rgt(),Bja=zge(),Fja=z5e(),Uja=Xge(),Qja=Yge(),qja=Kgt(),jja=Y5e(),Hja=jG(),Gja=uAt(),$ja=dAt(),Vja=tAe(),Wja=CAt(),zja=$5e(),Yja=SAt(),Kja=IAt(),Jja=J5e(),Zja=X5e(),Xja=Z5e(),eHa=PAt(),QSr=class extends Oja.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,Lja.Argument)(e)}AsyncIterator(e,r){return(0,Bja.AsyncIterator)(e,r)}Awaited(e,r){return(0,Fja.Awaited)(e,r)}BigInt(e){return(0,Uja.BigInt)(e)}ConstructorParameters(e,r){return(0,qja.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,Qja.Constructor)(e,r,n)}Date(e={}){return(0,jja.Date)(e)}Function(e,r,n){return(0,Hja.Function)(e,r,n)}InstanceType(e,r){return(0,Gja.InstanceType)(e,r)}Instantiate(e,r){return(0,$ja.Instantiate)(e,r)}Iterator(e,r){return(0,Vja.Iterator)(e,r)}Parameters(e,r){return(0,Wja.Parameters)(e,r)}Promise(e,r){return(0,zja.Promise)(e,r)}RegExp(e,r){return(0,Yja.RegExp)(e,r)}ReturnType(e,r){return(0,Kja.ReturnType)(e,r)}Symbol(e){return(0,Jja.Symbol)(e)}Undefined(e){return(0,Xja.Undefined)(e)}Uint8Array(e){return(0,Zja.Uint8Array)(e)}Void(e){return(0,eHa.Void)(e)}};OAt.JavaScriptTypeBuilder=QSr});var oPi=I(i1=>{"use strict";p();var tHa=i1&&i1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rHa=i1&&i1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nHa=i1&&i1.__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 cHa=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]})),yn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cHa(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});yn(kCr(),en);yn(n6(),en);yn(Of(),en);yn(UCr(),en);yn(swi(),en);yn(L5e(),en);yn($ge(),en);yn(B5e(),en);yn(Sn(),en);yn(Vge(),en);yn(Wge(),en);yn(Rgt(),en);yn(zge(),en);yn(z5e(),en);yn(Xge(),en);yn(Q5e(),en);yn(Wgt(),en);yn(Ygt(),en);yn(Yge(),en);yn(Kgt(),en);yn(Y5e(),en);yn(Jgt(),en);yn(sAt(),en);yn(dre(),en);yn(lAt(),en);yn(jG(),en);yn(AD(),en);yn(uAt(),en);yn(dAt(),en);yn(fAt(),en);yn(tI(),en);yn(tAe(),en);yn(mAt(),en);yn(yD(),en);yn(QE(),en);yn(_At(),en);yn(Tm(),en);yn(Sm(),en);yn(vAt(),en);yn(K5e(),en);yn(HG(),en);yn(Rv(),en);yn(r4e(),en);yn($4(),en);yn(CAt(),en);yn(i4e(),en);yn(n4e(),en);yn($5e(),en);yn(WG(),en);yn(t4e(),en);yn(sAe(),en);yn(bAt(),en);yn(YG(),en);yn(SAt(),en);yn(o4e(),en);yn(TAt(),en);yn(IAt(),en);yn(Yki(),en);yn(Zki(),en);yn(GG(),en);yn(J5e(),en);yn(gD(),en);yn(kAt(),en);yn(c6(),en);yn(X5e(),en);yn(Z5e(),en);yn(wp(),en);yn(KG(),en);yn(c4e(),en);yn(PAt(),en);yn(oPi(),en)});var aPi=I(MR=>{"use strict";p();var lHa=MR&&MR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uHa=MR&&MR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dHa=MR&&MR.__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 pHa=K4&&K4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hHa=K4&&K4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mHa=K4&&K4.__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(BAt,"__esModule",{value:!0});BAt.ContextItemOrigin=void 0;var uPi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(uPi||(BAt.ContextItemOrigin=uPi={}))});var pPi=I(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.RangeSchema=Nu.WorkspaceFolder=Nu.VersionedTextDocumentIdentifier=Nu.TextEdit=Nu.TextDocumentItem=Nu.Range=Nu.Position=Nu.DocumentUri=Nu.Disposable=Nu.Command=Nu.CancellationTokenSource=Nu.CancellationToken=void 0;var FAt=LAt(),CD=ei();Object.defineProperty(Nu,"CancellationToken",{enumerable:!0,get:a(function(){return CD.CancellationToken},"get")});Object.defineProperty(Nu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return CD.CancellationTokenSource},"get")});Object.defineProperty(Nu,"Command",{enumerable:!0,get:a(function(){return CD.Command},"get")});Object.defineProperty(Nu,"Disposable",{enumerable:!0,get:a(function(){return CD.Disposable},"get")});Object.defineProperty(Nu,"DocumentUri",{enumerable:!0,get:a(function(){return CD.DocumentUri},"get")});Object.defineProperty(Nu,"Position",{enumerable:!0,get:a(function(){return CD.Position},"get")});Object.defineProperty(Nu,"Range",{enumerable:!0,get:a(function(){return CD.Range},"get")});Object.defineProperty(Nu,"TextDocumentItem",{enumerable:!0,get:a(function(){return CD.TextDocumentItem},"get")});Object.defineProperty(Nu,"TextEdit",{enumerable:!0,get:a(function(){return CD.TextEdit},"get")});Object.defineProperty(Nu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return CD.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Nu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return CD.WorkspaceFolder},"get")});var fPi=FAt.Type.Object({line:FAt.Type.Integer({minimum:0}),character:FAt.Type.Integer({minimum:0})});Nu.RangeSchema=FAt.Type.Object({start:fPi,end:fPi})});var mPi=I(hPi=>{"use strict";p();Object.defineProperty(hPi,"__esModule",{value:!0})});var u4e=I(Lf=>{"use strict";p();var AHa=Lf&&Lf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l4e=Lf&&Lf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AHa(e,t,r)};Object.defineProperty(Lf,"__esModule",{value:!0});Lf.TextEdit=Lf.Range=Lf.Position=Lf.Disposable=Lf.CancellationTokenSource=Lf.CancellationToken=void 0;var lAe=ei();Object.defineProperty(Lf,"CancellationToken",{enumerable:!0,get:a(function(){return lAe.CancellationToken},"get")});Object.defineProperty(Lf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return lAe.CancellationTokenSource},"get")});Object.defineProperty(Lf,"Disposable",{enumerable:!0,get:a(function(){return lAe.Disposable},"get")});Object.defineProperty(Lf,"Position",{enumerable:!0,get:a(function(){return lAe.Position},"get")});Object.defineProperty(Lf,"Range",{enumerable:!0,get:a(function(){return lAe.Range},"get")});Object.defineProperty(Lf,"TextEdit",{enumerable:!0,get:a(function(){return lAe.TextEdit},"get")});l4e(aPi(),Lf);l4e(lPi(),Lf);l4e(dPi(),Lf);l4e(pPi(),Lf);l4e(mPi(),Lf)});var jSr=I(rI=>{"use strict";p();var yHa=rI&&rI.__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},gPi=rI&&rI.__param||function(t,e){return function(r,n){e(r,n,t)}},EHa=rI&&rI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rI,"__esModule",{value:!0});rI.CompletionNotifier=rI.ICompletionsNotifierService=void 0;var _Ha=EHa(require("events")),vHa=nn(),CHa=Ste(),bHa=u4e(),SHa=Vg(),THa=T5e(),UAt="CompletionRequested";rI.ICompletionsNotifierService=(0,vHa.createServiceIdentifier)("ICompletionsNotifierService");var qSr=class{static{a(this,"CompletionNotifier")}#e=new _Ha.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(UAt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,SHa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${UAt}`);return this.#e.on(UAt,r),bHa.Disposable.create(()=>this.#e.off(UAt,r))}};rI.CompletionNotifier=qSr;rI.CompletionNotifier=qSr=yHa([gPi(0,THa.ICompletionsPromiseQueueService),gPi(1,CHa.ICompletionsTelemetryService)],qSr)});var HSr=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.ICompletionsObservableWorkspace=void 0;var IHa=Gs();QAt.ICompletionsObservableWorkspace=(0,IHa.createDecorator)("ICompletionsObservableWorkspace")});var Nl=I(bD=>{"use strict";p();Object.defineProperty(bD,"__esModule",{value:!0});bD.logger=bD.Logger=bD.ICompletionsLogTargetService=bD.LogLevel=void 0;var xHa=nn(),wHa=Ste(),RHa=Vg(),Dre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Dre||(bD.LogLevel=Dre={}));bD.ICompletionsLogTargetService=(0,xHa.createServiceIdentifier)("ICompletionsLogTargetService");var qAt=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,Dre.DEBUG,...r)}info(e,...r){this.log(e,Dre.INFO,...r)}warn(e,...r){this.log(e,Dre.WARN,...r)}error(e,...r){this.log(e,Dre.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,RHa.telemetryException)(e.get(wHa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(bD.ICompletionsLogTargetService),Dre.ERROR,`${o}:`,s)}};bD.Logger=qAt;bD.logger=new qAt("default")});var yPi=I(e$=>{"use strict";p();Object.defineProperty(e$,"__esModule",{value:!0});e$.INotificationService=e$.NullNotificationService=e$.ProgressLocation=void 0;var kHa=nn(),PHa=JP(),APi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(APi||(e$.ProgressLocation=APi={}));var GSr=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")},PHa.CancellationToken.None))}};e$.NullNotificationService=GSr;e$.INotificationService=(0,kHa.createServiceIdentifier)("INotificationService")});var VSr=I(SD=>{"use strict";p();var DHa=SD&&SD.__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},NHa=SD&&SD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(SD,"__esModule",{value:!0});SD.ExtensionNotificationSender=SD.ICompletionsNotificationSender=void 0;var MHa=yPi(),OHa=nn();SD.ICompletionsNotificationSender=(0,OHa.createServiceIdentifier)("ICompletionsNotificationSender");var $Sr=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}}};SD.ExtensionNotificationSender=$Sr;SD.ExtensionNotificationSender=$Sr=DHa([NHa(0,MHa.INotificationService)],$Sr)});var YSr=I(TD=>{"use strict";p();var LHa=TD&&TD.__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},WSr=TD&&TD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TD,"__esModule",{value:!0});TD.UserErrorNotifier=TD.ICompletionsUserErrorNotifierService=void 0;var BHa=Q4(),FHa=nn(),UHa=id(),vPi=Nl(),QHa=VSr(),qHa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],EPi="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.",_Pi="https://gh.io/copilot-network-errors";TD.ICompletionsUserErrorNotifierService=(0,FHa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var zSr=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&&qHa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new vPi.Logger("certificates").error(this._logTarget,`${EPi} Please visit ${_Pi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(EPi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(UHa.URI.parse(_Pi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};TD.UserErrorNotifier=zSr;TD.UserErrorNotifier=zSr=LHa([WSr(0,vPi.ICompletionsLogTargetService),WSr(1,QHa.ICompletionsNotificationSender),WSr(2,BHa.IEnvService)],zSr)});var Ah=I(uAe=>{"use strict";p();Object.defineProperty(uAe,"__esModule",{value:!0});uAe.NullExperimentationService=uAe.IExperimentationService=void 0;var jHa=nn(),HHa=Ic();uAe.IExperimentationService=(0,jHa.createServiceIdentifier)("IExperimentationService");var KSr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new HHa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};uAe.NullExperimentationService=KSr});var t$=I(o1=>{"use strict";p();Object.defineProperty(o1,"__esModule",{value:!0});o1.DEFAULT_PROMPT_ALLOCATION_PERCENT=o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=o1.DEFAULT_NUM_SNIPPETS=o1.DEFAULT_MAX_PROMPT_LENGTH=o1.DEFAULT_MAX_COMPLETION_LENGTH=void 0;o1.normalizeLanguageId=$Ha;o1.DEFAULT_MAX_COMPLETION_LENGTH=500;o1.DEFAULT_MAX_PROMPT_LENGTH=8192-o1.DEFAULT_MAX_COMPLETION_LENGTH;o1.DEFAULT_NUM_SNIPPETS=4;o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;o1.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var GHa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function $Ha(t){return t=t.toLowerCase(),GHa[t]??t}a($Ha,"normalizeLanguageId")});var CPi=I(JSr=>{"use strict";p();Object.defineProperty(JSr,"__esModule",{value:!0});JSr.getUserKind=WHa;function VHa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(VHa,"findKnownOrg");function WHa(t){let e=t.organizationList??[];return VHa(e)??""}a(WHa,"getUserKind")});var d4e=I(J4=>{"use strict";p();Object.defineProperty(J4,"__esModule",{value:!0});J4.IEndpointProvider=J4.ModelSupportedEndpoint=void 0;J4.isEndpointEditToolName=KHa;J4.isChatModelInformation=JHa;J4.isEmbeddingModelInformation=ZHa;J4.isCompletionModelInformation=XHa;var zHa=nn(),YHa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function KHa(t){return YHa.has(t)}a(KHa,"isEndpointEditToolName");var bPi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(bPi||(J4.ModelSupportedEndpoint=bPi={}));function JHa(t){return t.capabilities.type==="chat"}a(JHa,"isChatModelInformation");function ZHa(t){return t.capabilities.type==="embeddings"}a(ZHa,"isEmbeddingModelInformation");function XHa(t){return t.capabilities.type==="completion"}a(XHa,"isCompletionModelInformation");J4.IEndpointProvider=(0,zHa.createServiceIdentifier)("IEndpointProvider")});var TPi=I(ZSr=>{"use strict";p();Object.defineProperty(ZSr,"__esModule",{value:!0});ZSr.getUserSelectedModelConfiguration=eGa;var SPi=BE();function eGa(t){let e=(0,SPi.getConfig)(t,SPi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(eGa,"getUserSelectedModelConfiguration")});var IPi=I(X4=>{"use strict";p();Object.defineProperty(X4,"__esModule",{value:!0});X4.bytePairEncode=X4.BinaryMap=X4.binaryMapKey=void 0;var tGa=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");X4.binaryMapKey=tGa;var XSr=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,X4.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,X4.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)}}};X4.BinaryMap=XSr;var Z4=new Int32Array(128),Mv=new Int32Array(128);function rGa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;Z4.length0&&(Z4[Mv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(jAt,"__esModule",{value:!0});jAt.makeTextEncoder=void 0;var eTr=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}},tTr=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 tTr:new eTr,"makeTextEncoder");jAt.makeTextEncoder=nGa});var wPi=I(HAt=>{"use strict";p();Object.defineProperty(HAt,"__esModule",{value:!0});HAt.LRUCache=void 0;var rTr=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 nTr(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}};HAt.LRUCache=rTr;var nTr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var oTr=I($At=>{"use strict";p();Object.defineProperty($At,"__esModule",{value:!0});$At.TikTokenizer=void 0;var GAt=IPi(),iGa=xPi(),oGa=wPi();function sGa(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(sGa,"loadTikTokenBpe");function aGa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(aGa,"escapeRegExp");var iTr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,iGa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new oGa.LRUCache(o);let s=typeof e=="string"?sGa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new GAt.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=>aGa(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,GAt.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,GAt.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,GAt.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))}};$At.TikTokenizer=iTr});var FPi=I(wm=>{"use strict";p();Object.defineProperty(wm,"__esModule",{value:!0});wm.createTokenizer=wm.createByEncoderName=wm.createByModelName=wm.getRegexByModel=wm.getRegexByEncoder=wm.getSpecialTokensByModel=wm.getSpecialTokensByEncoder=wm.MODEL_TO_ENCODING=void 0;var cGa=oTr(),lGa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);wm.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 VAt="<|endoftext|>",RPi="<|fim_prefix|>",kPi="<|fim_middle|>",PPi="<|fim_suffix|>",DPi="<|endofprompt|>",f4e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",NPi="(?:'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+",uGa=[`[^\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+"],IPi=zHa.join("|");function rTr(t){let e="";if(Im.MODEL_TO_ENCODING.has(t))e=Im.MODEL_TO_ENCODING.get(t);else for(let[r,n]of WHa)if(t.startsWith(r)){e=n;break}return e}a(rTr,"getEncoderFromModelName");async function YHa(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(YHa,"fetchAndSaveFile");function nTr(t){let e=new Map([[jAt,50256]]);switch(t){case"o200k_base":e=new Map([[jAt,199999],[SPi,200018]]);break;case"cl100k_base":e=new Map([[jAt,100257],[vPi,100258],[CPi,100259],[bPi,100260],[SPi,100276]]);break;case"p50k_edit":e=new Map([[jAt,50256],[vPi,50281],[CPi,50282],[bPi,50283]]);break;default:break}return e}a(nTr,"getSpecialTokensByEncoder");Im.getSpecialTokensByEncoder=nTr;function KHa(t){let e=rTr(t);return nTr(e)}a(KHa,"getSpecialTokensByModel");Im.getSpecialTokensByModel=KHa;function xPi(t){switch(t){case"o200k_base":return IPi;case"cl100k_base":return TPi;default:break}return a4e}a(xPi,"getRegexByEncoder");Im.getRegexByEncoder=xPi;function JHa(t){let e=rTr(t);return xPi(e)}a(JHa,"getRegexByModel");Im.getRegexByModel=JHa;async function ZHa(t,e=null){return wPi(rTr(t),e)}a(ZHa,"createByModelName");Im.createByModelName=ZHa;async function wPi(t,e=null){let r,n,o=nTr(t);switch(t){case"o200k_base":r=IPi,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=TPi,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=a4e,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 YHa(n,d),console.log(`Saved file to ${d}`)),RPi(d,o,r)}a(wPi,"createByEncoderName");Im.createByEncoderName=wPi;function RPi(t,e,r,n=8192){return new VHa.TikTokenizer(t,e,r,n)}a(RPi,"createTokenizer");Im.createTokenizer=RPi});var iTr=I(xm=>{"use strict";p();Object.defineProperty(xm,"__esModule",{value:!0});xm.createTokenizer=xm.createByEncoderName=xm.createByModelName=xm.getSpecialTokensByModel=xm.getSpecialTokensByEncoder=xm.getRegexByModel=xm.getRegexByEncoder=xm.MODEL_TO_ENCODING=xm.TikTokenizer=void 0;var XHa=tTr();Object.defineProperty(xm,"TikTokenizer",{enumerable:!0,get:a(function(){return XHa.TikTokenizer},"get")});var ZG=kPi();Object.defineProperty(xm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return ZG.MODEL_TO_ENCODING},"get")});Object.defineProperty(xm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return ZG.getRegexByEncoder},"get")});Object.defineProperty(xm,"getRegexByModel",{enumerable:!0,get:a(function(){return ZG.getRegexByModel},"get")});Object.defineProperty(xm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return ZG.getSpecialTokensByEncoder},"get")});Object.defineProperty(xm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return ZG.getSpecialTokensByModel},"get")});Object.defineProperty(xm,"createByModelName",{enumerable:!0,get:a(function(){return ZG.createByModelName},"get")});Object.defineProperty(xm,"createByEncoderName",{enumerable:!0,get:a(function(){return ZG.createByEncoderName},"get")});Object.defineProperty(xm,"createTokenizer",{enumerable:!0,get:a(function(){return ZG.createTokenizer},"get")})});var DPi=I(gy=>{"use strict";p();Object.defineProperty(gy,"__esModule",{value:!0});gy.isReadable=tGa;gy.isReadableStream=PPi;gy.isReadableBufferedStream=rGa;gy.newWriteableStream=c4e;gy.consumeReadable=nGa;gy.peekReadable=iGa;gy.consumeStream=oGa;gy.listenStream=GAt;gy.peekStream=sGa;gy.toStream=aGa;gy.emptyStream=cGa;gy.toReadable=lGa;gy.transform=uGa;gy.prefixedReadable=dGa;gy.prefixedStream=fGa;var eGa=Rs(),HAt=Ro();function tGa(t){let e=t;return e?typeof e.read=="function":!1}a(tGa,"isReadable");function PPi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(PPi,"isReadableStream");function rGa(t){let e=t;return e?PPi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(rGa,"isReadableBufferedStream");function c4e(t,e){return new oTr(t,e)}a(c4e,"newWriteableStream");var oTr=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,eGa.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 nGa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(nGa,"consumeReadable");function iGa(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(iGa,"peekReadable");function oGa(t,e){return new Promise((r,n)=>{let o=[];GAt(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(oGa,"consumeStream");function GAt(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(GAt,"listenStream");function sGa(t,e){return new Promise((r,n)=>{let o=new HAt.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,HAt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,HAt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,HAt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(sGa,"peekStream");function aGa(t,e){let r=c4e(e);return r.end(t),r}a(aGa,"toStream");function cGa(){let t=c4e(()=>{throw new Error("not supported")});return t.end(),t}a(cGa,"emptyStream");function lGa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(lGa,"toReadable");function uGa(t,e,r){let n=c4e(r);return GAt(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(uGa,"transform");function dGa(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(dGa,"prefixedReadable");function fGa(t,e,r){let n=!1,o=c4e(r);return GAt(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(fGa,"prefixedStream")});var e$=I(_c=>{"use strict";p();var pGa=_c&&_c.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hGa=_c&&_c.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mGa=_c&&_c.__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)),sTr,aTr,qE=class t{static{a(this,"VSBuffer")}static alloc(e){return l4e?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return l4e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&l4e?new t(Buffer.from(e)):(sTr||(sTr=new TextEncoder),new t(sTr.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])}};_c.VSBuffer=qE;function OPi(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=AGa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(yGa,"readUInt16LE");function EGa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(EGa,"writeUInt16LE");function LPi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(LPi,"readUInt32BE");function BPi(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(BPi,"writeUInt32BE");function FPi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(FPi,"readUInt32LE");function UPi(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(UPi,"writeUInt32LE");function QPi(t,e){return t[e]}a(QPi,"readUInt8");function qPi(t,e,r){t[r]=e}a(qPi,"writeUInt8");function _Ga(t){return XG.consumeReadable(t,e=>qE.concat(e))}a(_Ga,"readableToBuffer");function vGa(t){return XG.toReadable(t)}a(vGa,"bufferToReadable");function jPi(t){return XG.consumeStream(t,e=>qE.concat(e))}a(jPi,"streamToBuffer");async function CGa(t){return t.ended?qE.concat(t.buffer):qE.concat([...t.buffer,await jPi(t.stream)])}a(CGa,"bufferedStreamToBuffer");function bGa(t){return XG.toStream(t,e=>qE.concat(e))}a(bGa,"bufferToStream");function SGa(t){return XG.transform(t,{data:a(e=>typeof e=="string"?qE.fromString(e):qE.wrap(e),"data")},e=>qE.concat(e))}a(SGa,"streamToBufferReadableStream");function TGa(t){return XG.newWriteableStream(e=>qE.concat(e),t)}a(TGa,"newWriteableBufferStream");function IGa(t,e){return XG.prefixedReadable(t,e,r=>qE.concat(r))}a(IGa,"prefixedBufferReadable");function xGa(t,e){return XG.prefixedStream(t,e,r=>qE.concat(r))}a(xGa,"prefixedBufferStream");function wGa(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 qE.wrap(o).slice(0,c)}a(wGa,"decodeBase64");var RGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function PGa({buffer:t},e=!0,r=!1){let n=r?kGa:RGa,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(PGa,"encodeBase64");var NPi="0123456789abcdef";function DGa({buffer:t}){let e="";for(let r=0;r>>4],e+=NPi[n&15]}return e}a(DGa,"encodeHex");function NGa(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]=MPi(t,r++)<<4|MPi(t,r++);return qE.wrap(e)}a(NGa,"decodeHex");function MPi(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(MPi,"decodeHexChar")});var HPi=I($At=>{"use strict";p();Object.defineProperty($At,"__esModule",{value:!0});$At.readVariableLengthQuantity=OGa;$At.writeVariableLengthQuantity=LGa;var MGa=e$();function OGa(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 MGa.VSBuffer.fromByteArray(e)}a(LGa,"writeVariableLengthQuantity")});var cTr=I(VAt=>{"use strict";p();Object.defineProperty(VAt,"__esModule",{value:!0});VAt.parseTikTokenBinary=void 0;var BGa=require("fs"),FGa=HPi(),UGa=e$(),QGa=a(t=>{let e=(0,BGa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.CopilotPromptLoadFailure=void 0;var lTr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};WAt.CopilotPromptLoadFailure=lTr});var dTr=I(NR=>{"use strict";p();var qGa=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]})),jGa=NR&&NR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HGa=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(MR,"__esModule",{value:!0});MR.ApproximateTokenizer=MR.TTokenizer=MR.TokenizerName=void 0;MR.setExternalTokenizerProvider=KGa;MR.getTokenizer=JGa;MR.ensureTokenizersLoaded=XGa;MR.resetTokenizersForTest=e$a;var fTr=iTr(),WGa=cTr(),zGa=uTr(),YGa=dTr(),bD;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(bD||(MR.TokenizerName=bD={}));var lAe=new Map,Nre;function KGa(t){Nre||ZAt||(Nre=t)}a(KGa,"setExternalTokenizerProvider");function JGa(t=bD.o200k){if(Nre)try{return Nre.getTokenizer(t)}catch{}let e=lAe.get(t);return e!==void 0||(WPi(),e=lAe.get(bD.o200k),e!==void 0)?e:new JAt}a(JGa,"getTokenizer");var YAt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,fTr.createTokenizer)((0,WGa.parseTikTokenBinary)((0,YGa.locateFile)(`${e}.tiktoken`)),(0,fTr.getSpecialTokensByEncoder)(e),(0,fTr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new zGa.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{"use strict";p();Object.defineProperty(Rm,"__esModule",{value:!0});Rm.createTokenizer=Rm.createByEncoderName=Rm.createByModelName=Rm.getSpecialTokensByModel=Rm.getSpecialTokensByEncoder=Rm.getRegexByModel=Rm.getRegexByEncoder=Rm.MODEL_TO_ENCODING=Rm.TikTokenizer=void 0;var mGa=oTr();Object.defineProperty(Rm,"TikTokenizer",{enumerable:!0,get:a(function(){return mGa.TikTokenizer},"get")});var r$=FPi();Object.defineProperty(Rm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return r$.MODEL_TO_ENCODING},"get")});Object.defineProperty(Rm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return r$.getRegexByEncoder},"get")});Object.defineProperty(Rm,"getRegexByModel",{enumerable:!0,get:a(function(){return r$.getRegexByModel},"get")});Object.defineProperty(Rm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return r$.getSpecialTokensByEncoder},"get")});Object.defineProperty(Rm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return r$.getSpecialTokensByModel},"get")});Object.defineProperty(Rm,"createByModelName",{enumerable:!0,get:a(function(){return r$.createByModelName},"get")});Object.defineProperty(Rm,"createByEncoderName",{enumerable:!0,get:a(function(){return r$.createByEncoderName},"get")});Object.defineProperty(Rm,"createTokenizer",{enumerable:!0,get:a(function(){return r$.createTokenizer},"get")})});var QPi=I(Ay=>{"use strict";p();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.isReadable=AGa;Ay.isReadableStream=UPi;Ay.isReadableBufferedStream=yGa;Ay.newWriteableStream=p4e;Ay.consumeReadable=EGa;Ay.peekReadable=_Ga;Ay.consumeStream=vGa;Ay.listenStream=zAt;Ay.peekStream=CGa;Ay.toStream=bGa;Ay.emptyStream=SGa;Ay.toReadable=TGa;Ay.transform=IGa;Ay.prefixedReadable=xGa;Ay.prefixedStream=wGa;var gGa=Rs(),WAt=ko();function AGa(t){let e=t;return e?typeof e.read=="function":!1}a(AGa,"isReadable");function UPi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(UPi,"isReadableStream");function yGa(t){let e=t;return e?UPi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(yGa,"isReadableBufferedStream");function p4e(t,e){return new lTr(t,e)}a(p4e,"newWriteableStream");var lTr=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,gGa.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 EGa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(EGa,"consumeReadable");function _Ga(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(_Ga,"peekReadable");function vGa(t,e){return new Promise((r,n)=>{let o=[];zAt(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(vGa,"consumeStream");function zAt(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(zAt,"listenStream");function CGa(t,e){return new Promise((r,n)=>{let o=new WAt.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,WAt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,WAt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,WAt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(CGa,"peekStream");function bGa(t,e){let r=p4e(e);return r.end(t),r}a(bGa,"toStream");function SGa(){let t=p4e(()=>{throw new Error("not supported")});return t.end(),t}a(SGa,"emptyStream");function TGa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(TGa,"toReadable");function IGa(t,e,r){let n=p4e(r);return zAt(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(IGa,"transform");function xGa(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(xGa,"prefixedReadable");function wGa(t,e,r){let n=!1,o=p4e(r);return zAt(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(wGa,"prefixedStream")});var i$=I(_c=>{"use strict";p();var RGa=_c&&_c.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kGa=_c&&_c.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PGa=_c&&_c.__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)),uTr,dTr,jE=class t{static{a(this,"VSBuffer")}static alloc(e){return h4e?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return h4e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&h4e?new t(Buffer.from(e)):(uTr||(uTr=new TextEncoder),new t(uTr.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])}};_c.VSBuffer=jE;function HPi(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=NGa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(MGa,"readUInt16LE");function OGa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(OGa,"writeUInt16LE");function GPi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(GPi,"readUInt32BE");function $Pi(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($Pi,"writeUInt32BE");function VPi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(VPi,"readUInt32LE");function WPi(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(WPi,"writeUInt32LE");function zPi(t,e){return t[e]}a(zPi,"readUInt8");function YPi(t,e,r){t[r]=e}a(YPi,"writeUInt8");function LGa(t){return n$.consumeReadable(t,e=>jE.concat(e))}a(LGa,"readableToBuffer");function BGa(t){return n$.toReadable(t)}a(BGa,"bufferToReadable");function KPi(t){return n$.consumeStream(t,e=>jE.concat(e))}a(KPi,"streamToBuffer");async function FGa(t){return t.ended?jE.concat(t.buffer):jE.concat([...t.buffer,await KPi(t.stream)])}a(FGa,"bufferedStreamToBuffer");function UGa(t){return n$.toStream(t,e=>jE.concat(e))}a(UGa,"bufferToStream");function QGa(t){return n$.transform(t,{data:a(e=>typeof e=="string"?jE.fromString(e):jE.wrap(e),"data")},e=>jE.concat(e))}a(QGa,"streamToBufferReadableStream");function qGa(t){return n$.newWriteableStream(e=>jE.concat(e),t)}a(qGa,"newWriteableBufferStream");function jGa(t,e){return n$.prefixedReadable(t,e,r=>jE.concat(r))}a(jGa,"prefixedBufferReadable");function HGa(t,e){return n$.prefixedStream(t,e,r=>jE.concat(r))}a(HGa,"prefixedBufferStream");function GGa(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 jE.wrap(o).slice(0,c)}a(GGa,"decodeBase64");var $Ga="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",VGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function WGa({buffer:t},e=!0,r=!1){let n=r?VGa:$Ga,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(WGa,"encodeBase64");var qPi="0123456789abcdef";function zGa({buffer:t}){let e="";for(let r=0;r>>4],e+=qPi[n&15]}return e}a(zGa,"encodeHex");function YGa(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]=jPi(t,r++)<<4|jPi(t,r++);return jE.wrap(e)}a(YGa,"decodeHex");function jPi(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(jPi,"decodeHexChar")});var JPi=I(YAt=>{"use strict";p();Object.defineProperty(YAt,"__esModule",{value:!0});YAt.readVariableLengthQuantity=JGa;YAt.writeVariableLengthQuantity=ZGa;var KGa=i$();function JGa(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 KGa.VSBuffer.fromByteArray(e)}a(ZGa,"writeVariableLengthQuantity")});var fTr=I(KAt=>{"use strict";p();Object.defineProperty(KAt,"__esModule",{value:!0});KAt.parseTikTokenBinary=void 0;var XGa=require("fs"),e$a=JPi(),t$a=i$(),r$a=a(t=>{let e=(0,XGa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(JAt,"__esModule",{value:!0});JAt.CopilotPromptLoadFailure=void 0;var pTr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};JAt.CopilotPromptLoadFailure=pTr});var mTr=I(OR=>{"use strict";p();var n$a=OR&&OR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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$a=OR&&OR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o$a=OR&&OR.__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(LR,"__esModule",{value:!0});LR.ApproximateTokenizer=LR.TTokenizer=LR.TokenizerName=void 0;LR.setExternalTokenizerProvider=f$a;LR.getTokenizer=p$a;LR.ensureTokenizersLoaded=m$a;LR.resetTokenizersForTest=g$a;var gTr=cTr(),l$a=fTr(),u$a=hTr(),d$a=mTr(),ID;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(ID||(LR.TokenizerName=ID={}));var dAe=new Map,Mre;function f$a(t){Mre||ryt||(Mre=t)}a(f$a,"setExternalTokenizerProvider");function p$a(t=ID.o200k){if(Mre)try{return Mre.getTokenizer(t)}catch{}let e=dAe.get(t);return e!==void 0||(t2i(),e=dAe.get(ID.o200k),e!==void 0)?e:new tyt}a(p$a,"getTokenizer");var XAt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,gTr.createTokenizer)((0,l$a.parseTikTokenBinary)((0,d$a.locateFile)(`${e}.tiktoken`)),(0,gTr.getSpecialTokensByEncoder)(e),(0,gTr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new u$a.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.substring(o+1)}};LR.TTokenizer=XAt;var eyt=class{static{a(this,"MockTokenizer")}constructor(){this.hash=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)}},ZGa={[bD.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},[bD.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}},pTr=4,JAt=class{static{a(this,"ApproximateTokenizer")}constructor(e=bD.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(-pTr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-pTr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?ZGa[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)}},h$a={[ID.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},[ID.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}},ATr=4,tyt=class{static{a(this,"ApproximateTokenizer")}constructor(e=ID.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(-ATr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-ATr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?h$a[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)}};MR.ApproximateTokenizer=JAt;async function VPi(t){try{let e=await YAt.create(t);lAe.set(t,e)}catch{}}a(VPi,"setTokenizer");lAe.set(bD.mock,new KAt);var ZAt,zAt;function WPi(){if(Nre){let t=Nre;return zAt??=Promise.resolve().then(()=>t.ensureLoaded()).catch(()=>{zAt=void 0}),zAt}return ZAt??=Promise.all([VPi(bD.cl100k),VPi(bD.o200k)]).then(()=>{}),ZAt}a(WPi,"loadTokenizers");function XGa(){return WPi()}a(XGa,"ensureTokenizersLoaded");function e$a(){Nre=void 0,ZAt=void 0,zAt=void 0,lAe.clear(),lAe.set(bD.mock,new KAt)}a(e$a,"resetTokenizersForTest")});var Ore=I(Mre=>{"use strict";p();var t$a=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]})),r$a=Mre&&Mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t$a(e,t,r)};Object.defineProperty(Mre,"__esModule",{value:!0});r$a(zPi(),Mre)});var mTr=I(SD=>{"use strict";p();var n$a=SD&&SD.__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},u4e=SD&&SD.__param||function(t,e){return function(r,n){e(r,n,t)}},d4e;Object.defineProperty(SD,"__esModule",{value:!0});SD.AvailableModelsManager=SD.ICompletionsModelManagerService=void 0;var i$a=FE(),o$a=s4e(),s$a=nn(),a$a=Ro(),c$a=Gs(),l$a=APi(),u$a=Ore(),d$a=kvr(),f$a=fgt(),XAt=LE(),p$a=fy(),YPi=Dl();SD.ICompletionsModelManagerService=(0,s$a.createServiceIdentifier)("ICompletionsModelManagerService");var h$a="gpt-41-copilot",hTr=d4e=class extends a$a.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 d$a.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,f$a.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=d4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return h$a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=d4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return d4e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:u$a.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(l$a.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(YPi.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(XAt.getConfig,XAt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(XAt.getConfig,XAt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new t$(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 t$(s,"exp"):new t$(n,"modelpicker"):s?new t$(s,"exp"):this.customModels.length>0?new t$(this.customModels[0],"custommodel"):new t$(r,"default")}};SD.AvailableModelsManager=hTr;SD.AvailableModelsManager=hTr=d4e=n$a([u4e(1,c$a.IInstantiationService),u4e(2,p$a.ICompletionsFeaturesService),u4e(3,o$a.IEndpointProvider),u4e(4,i$a.IAuthenticationService),u4e(5,YPi.ICompletionsLogTargetService)],hTr);var t$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var ATr=I(gTr=>{"use strict";p();Object.defineProperty(gTr,"__esModule",{value:!0});gTr.getEngineRequestInfo=g$a;var m$a=mTr();function g$a(t,e=void 0){let r=t.get(m$a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(g$a,"getEngineRequestInfo")});var XPi=I(eyt=>{"use strict";p();Object.defineProperty(eyt,"__esModule",{value:!0});eyt.setupCompletionsExperimentationService=v$a;eyt.createCompletionsFilters=ZPi;var A$a=FE(),y$a=mh(),E$a=Gs(),KPi=hPi(),r$=LE(),_$a=ATr(),OR=L0t();function v$a(t){let e=t.get(A$a.IAuthenticationService),r=t.get(E$a.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(JPi,e.copilotToken)});return JPi(t,e.copilotToken),n}a(v$a,"setupCompletionsExperimentationService");function C$a(t){return r$.BuildInfo.getBuildType()===r$.BuildType.NIGHTLY?OR.Release.Nightly:OR.Release.Stable}a(C$a,"getPluginRelease");function JPi(t,e){let r=t.get(y$a.IExperimentationService),n=ZPi(t,e);r.setCompletionsFilters(n)}a(JPi,"updateCompletionsFilters");function ZPi(t,e){let r=new Map;if(r.set(OR.Filter.ExtensionRelease,C$a(t)),r.set(OR.Filter.CopilotOverrideEngine,(0,r$.getConfig)(t,r$.ConfigKey.DebugOverrideEngine)||(0,r$.getConfig)(t,r$.ConfigKey.DebugOverrideEngineLegacy)),r.set(OR.Filter.CopilotClientVersion,r$.BuildInfo.isProduction()?r$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,KPi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(OR.Filter.CopilotUserKind,o),r.set(OR.Filter.CopilotCustomModel,s),r.set(OR.Filter.CopilotOrgs,c),r.set(OR.Filter.CopilotCustomModelNames,l),r.set(OR.Filter.CopilotTrackingId,u),r.set(OR.Filter.CopilotUserKind,(0,KPi.getUserKind)(e))}let n=(0,_$a.getEngineRequestInfo)(t).modelId;return r.set(OR.Filter.CopilotEngine,n),r}a(ZPi,"createCompletionsFilters")});var e2i=I(v6=>{"use strict";p();var b$a=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},yTr=v6&&v6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v6,"__esModule",{value:!0});v6.Features=void 0;var S$a=Sp(),T$a=mh(),I$a=Gs(),uAe=JG(),x$a=Uge(),ETr=$g(),w$a=XPi(),La=M0t(),R$a=L0t(),_Tr=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=ETr.TelemetryData.createAndMarkAsIssued()){if(r instanceof ETr.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 ETr.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(La.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 La.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(w$a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new R$a.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[La.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixMatchThreshold]??uAe.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[La.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[La.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[La.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(S$a.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[La.ExpTreatmentVariables.MaxPromptCompletionTokens]??uAe.DEFAULT_MAX_PROMPT_LENGTH+uAe.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.StableContextPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.VolatileContextPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};v6.Features=_Tr;v6.Features=_Tr=b$a([yTr(0,I$a.IInstantiationService),yTr(1,T$a.IExperimentationService),yTr(2,x$a.ICompletionsCopilotTokenManager)],_Tr)});var n$=I(dAe=>{"use strict";p();Object.defineProperty(dAe,"__esModule",{value:!0});dAe.ICompletionsFileSystemService=dAe.FileType=void 0;var k$a=nn(),t2i;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(t2i||(dAe.FileType=t2i={}));dAe.ICompletionsFileSystemService=(0,k$a.createServiceIdentifier)("ICompletionsFileSystemService")});var vTr=I(tyt=>{"use strict";p();Object.defineProperty(tyt,"__esModule",{value:!0});tyt.knownLanguages=void 0;tyt.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 n2i=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.knownFileExtensions=i$.templateLanguageLimitations=i$.knownTemplateLanguageExtensions=void 0;var r2i=vTr();i$.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];i$.templateLanguageLimitations={".php":[".blade"]};i$.knownFileExtensions=Object.keys(r2i.knownLanguages).flatMap(t=>r2i.knownLanguages[t].extensions)});var o$=I(TD=>{"use strict";p();Object.defineProperty(TD,"__esModule",{value:!0});TD.makeFsUri=O$a;TD.validateUri=L$a;TD.normalizeUri=B$a;TD.fsPath=a2i;TD.getFsPath=c2i;TD.getFsUri=F$a;TD.joinPath=U$a;TD.basename=j$a;TD.dirname=H$a;var P$a=require("os"),D$a=require("path"),N$a=ZP(),f4e=nd();function o2i(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+o2i(t.substring(3)):t}}a(o2i,"decodeURIComponentGraceful");var i2i=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function M$a(t){return t.match(i2i)?t.replace(i2i,e=>o2i(e)):t}a(M$a,"percentDecode");function O$a(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 f4e.URI.file(t).toString()}a(O$a,"makeFsUri");function p4e(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?f4e.URI.parse(e[1]+e[2],!0):f4e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(p4e,"parseUri");function L$a(t){return p4e(t),t}a(L$a,"validateUri");function B$a(t){try{return p4e(t).toString()}catch{return t}}a(B$a,"normalizeUri");var s2i=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function a2i(t){let e=p4e(t);if(!s2i.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,P$a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,D$a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(a2i,"fsPath");function c2i(t){try{return a2i(t)}catch{return}}a(c2i,"getFsPath");function F$a(t){let e=c2i(t);if(e)return f4e.URI.file(e).toString()}a(F$a,"getFsUri");function U$a(t,...e){let r=f4e.URI.joinPath(p4e(t),...e.map(Q$a)).toString();return typeof t=="string"?r:{uri:r}}a(U$a,"joinPath");function Q$a(t){return q$a(t)?t.replaceAll("\\","/"):t}a(Q$a,"pathToURIPath");function q$a(t){return/^[^/\\]*\\/.test(t)}a(q$a,"isWinPath");function j$a(t){return M$a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(j$a,"basename");function H$a(t){let e=(0,N$a.dirname)(p4e(t)),r;return s2i.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(H$a,"dirname")});var u2i=I(jE=>{"use strict";p();var G$a=jE&&jE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$$a=jE&&jE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V$a=jE&&jE.__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&&CTr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=CTr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(fAe.has(e))return{languageId:fAe.get(e)[0],isGuess:!1};let n=bTr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),fAe.has(e))return{languageId:fAe.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},TTr=class extends pAe{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 Lre("cpp",r.isGuess,r.fileExtension):r}},ITr=class extends pAe{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Lre(e.languageId,!0,""):this.delegate.detectLanguage(e)}};jE.languageDetection=new TTr(new ITr(new STr));function Y$a({uri:t,languageId:e}){let r=jE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(Y$a,"detectLanguage")});var mAe=I(hAe=>{"use strict";p();Object.defineProperty(hAe,"__esModule",{value:!0});hAe.CopilotTextDocument=hAe.LocationFactory=void 0;var K$a=u2i(),J$a=o$(),h4e=(_6t(),ba(epn)),s$=ebe(),xTr=class{static{a(this,"LocationFactory")}static{this.range=s$.Range.create.bind(s$.Range)}static{this.position=s$.Position.create.bind(s$.Position)}};hAe.LocationFactory=xTr;var wTr=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=h4e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return h4e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=h4e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return h4e.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,K$a.detectLanguage)({uri:e,languageId:r})){return new t((0,J$a.normalizeUri)(e),h4e.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=s$.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=s$.Range.create(s$.Position.create(r,0),s$.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};hAe.CopilotTextDocument=wTr});var g4e=I((OMp,h2i)=>{"use strict";p();var RTr=Object.defineProperty,Z$a=Object.getOwnPropertyDescriptor,X$a=Object.getOwnPropertyNames,eVa=Object.prototype.hasOwnProperty,tVa=a((t,e)=>{for(var r in e)RTr(t,r,{get:e[r],enumerable:!0})},"__export"),rVa=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X$a(e))!eVa.call(t,o)&&o!==r&&RTr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Z$a(e,o))||n.enumerable});return t},"__copyProps"),nVa=a(t=>rVa(RTr({},"__esModule",{value:!0}),t),"__toCommonJS"),f2i={};tVa(f2i,{config:a(()=>cVa,"config"),t:a(()=>p2i,"t")});h2i.exports=nVa(f2i);var iVa=require("fs"),oVa=require("fs/promises");async function sVa(t){if(t.protocol==="file:")return await(0,oVa.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(sVa,"readFileFromUri");function aVa(t){return(0,iVa.readFileSync)(t,"utf8")}a(aVa,"readFileFromFsPath");var m4e;function cVa(t){if("contents"in t){typeof t.contents=="string"?m4e=JSON.parse(t.contents):m4e=t.contents;return}if("fsPath"in t){let e=aVa(t.fsPath),r=JSON.parse(e);m4e=d2i(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)=>{sVa(e).then(o=>{try{let s=JSON.parse(o);m4e=d2i(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(cVa,"config");function p2i(...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=m4e?.[r];return s?typeof s=="string"?ryt(s,o):s.comment?ryt(s.message,o):ryt(n,o):ryt(n,o)}a(p2i,"t");var lVa=/{([^}]+)}/g;function ryt(t,e){return Object.keys(e).length===0?t:t.replace(lVa,(r,n)=>e[n]??r)}a(ryt,"format");function d2i(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(d2i,"isBuiltinExtension")});var Bre=I(Nv=>{"use strict";p();var uVa=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]})),dVa=Nv&&Nv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fVa=Nv&&Nv.__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.ensureLoaded()).catch(()=>{ZAt=void 0}),ZAt}return ryt??=Promise.all([e2i(ID.cl100k),e2i(ID.o200k)]).then(()=>{}),ryt}a(t2i,"loadTokenizers");function m$a(){return t2i()}a(m$a,"ensureTokenizersLoaded");function g$a(){Mre=void 0,ryt=void 0,ZAt=void 0,dAe.clear(),dAe.set(ID.mock,new eyt)}a(g$a,"resetTokenizersForTest")});var Lre=I(Ore=>{"use strict";p();var A$a=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]})),y$a=Ore&&Ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A$a(e,t,r)};Object.defineProperty(Ore,"__esModule",{value:!0});y$a(r2i(),Ore)});var ETr=I(xD=>{"use strict";p();var E$a=xD&&xD.__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},m4e=xD&&xD.__param||function(t,e){return function(r,n){e(r,n,t)}},g4e;Object.defineProperty(xD,"__esModule",{value:!0});xD.AvailableModelsManager=xD.ICompletionsModelManagerService=void 0;var _$a=UE(),v$a=d4e(),C$a=nn(),b$a=ko(),S$a=Gs(),T$a=TPi(),I$a=Lre(),x$a=Mvr(),w$a=ggt(),nyt=BE(),R$a=py(),n2i=Nl();xD.ICompletionsModelManagerService=(0,C$a.createServiceIdentifier)("ICompletionsModelManagerService");var k$a="gpt-41-copilot",yTr=g4e=class extends b$a.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 x$a.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,w$a.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=g4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return k$a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=g4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return g4e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:I$a.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(T$a.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(n2i.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(nyt.getConfig,nyt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(nyt.getConfig,nyt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new o$(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 o$(s,"exp"):new o$(n,"modelpicker"):s?new o$(s,"exp"):this.customModels.length>0?new o$(this.customModels[0],"custommodel"):new o$(r,"default")}};xD.AvailableModelsManager=yTr;xD.AvailableModelsManager=yTr=g4e=E$a([m4e(1,S$a.IInstantiationService),m4e(2,R$a.ICompletionsFeaturesService),m4e(3,v$a.IEndpointProvider),m4e(4,_$a.IAuthenticationService),m4e(5,n2i.ICompletionsLogTargetService)],yTr);var o$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var vTr=I(_Tr=>{"use strict";p();Object.defineProperty(_Tr,"__esModule",{value:!0});_Tr.getEngineRequestInfo=D$a;var P$a=ETr();function D$a(t,e=void 0){let r=t.get(P$a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(D$a,"getEngineRequestInfo")});var a2i=I(iyt=>{"use strict";p();Object.defineProperty(iyt,"__esModule",{value:!0});iyt.setupCompletionsExperimentationService=B$a;iyt.createCompletionsFilters=s2i;var N$a=UE(),M$a=Ah(),O$a=Gs(),i2i=CPi(),s$=BE(),L$a=vTr(),BR=Q0t();function B$a(t){let e=t.get(N$a.IAuthenticationService),r=t.get(O$a.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(o2i,e.copilotToken)});return o2i(t,e.copilotToken),n}a(B$a,"setupCompletionsExperimentationService");function F$a(t){return s$.BuildInfo.getBuildType()===s$.BuildType.NIGHTLY?BR.Release.Nightly:BR.Release.Stable}a(F$a,"getPluginRelease");function o2i(t,e){let r=t.get(M$a.IExperimentationService),n=s2i(t,e);r.setCompletionsFilters(n)}a(o2i,"updateCompletionsFilters");function s2i(t,e){let r=new Map;if(r.set(BR.Filter.ExtensionRelease,F$a(t)),r.set(BR.Filter.CopilotOverrideEngine,(0,s$.getConfig)(t,s$.ConfigKey.DebugOverrideEngine)||(0,s$.getConfig)(t,s$.ConfigKey.DebugOverrideEngineLegacy)),r.set(BR.Filter.CopilotClientVersion,s$.BuildInfo.isProduction()?s$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,i2i.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(BR.Filter.CopilotUserKind,o),r.set(BR.Filter.CopilotCustomModel,s),r.set(BR.Filter.CopilotOrgs,c),r.set(BR.Filter.CopilotCustomModelNames,l),r.set(BR.Filter.CopilotTrackingId,u),r.set(BR.Filter.CopilotUserKind,(0,i2i.getUserKind)(e))}let n=(0,L$a.getEngineRequestInfo)(t).modelId;return r.set(BR.Filter.CopilotEngine,n),r}a(s2i,"createCompletionsFilters")});var c2i=I(b6=>{"use strict";p();var U$a=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},CTr=b6&&b6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(b6,"__esModule",{value:!0});b6.Features=void 0;var Q$a=Ip(),q$a=Ah(),j$a=Gs(),fAe=t$(),H$a=qge(),bTr=Vg(),G$a=a2i(),Ba=F0t(),$$a=Q0t(),STr=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=bTr.TelemetryData.createAndMarkAsIssued()){if(r instanceof bTr.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 bTr.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(Ba.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 Ba.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(G$a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new $$a.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[Ba.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.SuffixPercent]??fAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.SuffixMatchThreshold]??fAe.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Ba.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[Ba.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[Ba.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(Q$a.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[Ba.ExpTreatmentVariables.MaxPromptCompletionTokens]??fAe.DEFAULT_MAX_PROMPT_LENGTH+fAe.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.StableContextPercent]??fAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.VolatileContextPercent]??fAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Ba.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};b6.Features=STr;b6.Features=STr=U$a([CTr(0,j$a.IInstantiationService),CTr(1,q$a.IExperimentationService),CTr(2,H$a.ICompletionsCopilotTokenManager)],STr)});var a$=I(pAe=>{"use strict";p();Object.defineProperty(pAe,"__esModule",{value:!0});pAe.ICompletionsFileSystemService=pAe.FileType=void 0;var V$a=nn(),l2i;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(l2i||(pAe.FileType=l2i={}));pAe.ICompletionsFileSystemService=(0,V$a.createServiceIdentifier)("ICompletionsFileSystemService")});var TTr=I(oyt=>{"use strict";p();Object.defineProperty(oyt,"__esModule",{value:!0});oyt.knownLanguages=void 0;oyt.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 d2i=I(c$=>{"use strict";p();Object.defineProperty(c$,"__esModule",{value:!0});c$.knownFileExtensions=c$.templateLanguageLimitations=c$.knownTemplateLanguageExtensions=void 0;var u2i=TTr();c$.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];c$.templateLanguageLimitations={".php":[".blade"]};c$.knownFileExtensions=Object.keys(u2i.knownLanguages).flatMap(t=>u2i.knownLanguages[t].extensions)});var l$=I(wD=>{"use strict";p();Object.defineProperty(wD,"__esModule",{value:!0});wD.makeFsUri=J$a;wD.validateUri=Z$a;wD.normalizeUri=X$a;wD.fsPath=m2i;wD.getFsPath=g2i;wD.getFsUri=eVa;wD.joinPath=tVa;wD.basename=iVa;wD.dirname=oVa;var W$a=require("os"),z$a=require("path"),Y$a=e2(),A4e=id();function p2i(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+p2i(t.substring(3)):t}}a(p2i,"decodeURIComponentGraceful");var f2i=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function K$a(t){return t.match(f2i)?t.replace(f2i,e=>p2i(e)):t}a(K$a,"percentDecode");function J$a(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 A4e.URI.file(t).toString()}a(J$a,"makeFsUri");function y4e(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?A4e.URI.parse(e[1]+e[2],!0):A4e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(y4e,"parseUri");function Z$a(t){return y4e(t),t}a(Z$a,"validateUri");function X$a(t){try{return y4e(t).toString()}catch{return t}}a(X$a,"normalizeUri");var h2i=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function m2i(t){let e=y4e(t);if(!h2i.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,W$a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,z$a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(m2i,"fsPath");function g2i(t){try{return m2i(t)}catch{return}}a(g2i,"getFsPath");function eVa(t){let e=g2i(t);if(e)return A4e.URI.file(e).toString()}a(eVa,"getFsUri");function tVa(t,...e){let r=A4e.URI.joinPath(y4e(t),...e.map(rVa)).toString();return typeof t=="string"?r:{uri:r}}a(tVa,"joinPath");function rVa(t){return nVa(t)?t.replaceAll("\\","/"):t}a(rVa,"pathToURIPath");function nVa(t){return/^[^/\\]*\\/.test(t)}a(nVa,"isWinPath");function iVa(t){return K$a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(iVa,"basename");function oVa(t){let e=(0,Y$a.dirname)(y4e(t)),r;return h2i.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(oVa,"dirname")});var y2i=I(HE=>{"use strict";p();var sVa=HE&&HE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aVa=HE&&HE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cVa=HE&&HE.__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&&ITr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ITr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(hAe.has(e))return{languageId:hAe.get(e)[0],isGuess:!1};let n=xTr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),hAe.has(e))return{languageId:hAe.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},RTr=class extends mAe{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 Bre("cpp",r.isGuess,r.fileExtension):r}},kTr=class extends mAe{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Bre(e.languageId,!0,""):this.delegate.detectLanguage(e)}};HE.languageDetection=new RTr(new kTr(new wTr));function dVa({uri:t,languageId:e}){let r=HE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(dVa,"detectLanguage")});var AAe=I(gAe=>{"use strict";p();Object.defineProperty(gAe,"__esModule",{value:!0});gAe.CopilotTextDocument=gAe.LocationFactory=void 0;var fVa=y2i(),pVa=l$(),E4e=(S6t(),Sa(opn)),u$=nbe(),PTr=class{static{a(this,"LocationFactory")}static{this.range=u$.Range.create.bind(u$.Range)}static{this.position=u$.Position.create.bind(u$.Position)}};gAe.LocationFactory=PTr;var DTr=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=E4e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return E4e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=E4e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return E4e.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,fVa.detectLanguage)({uri:e,languageId:r})){return new t((0,pVa.normalizeUri)(e),E4e.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=u$.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=u$.Range.create(u$.Position.create(r,0),u$.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};gAe.CopilotTextDocument=DTr});var v4e=I((nOp,C2i)=>{"use strict";p();var NTr=Object.defineProperty,hVa=Object.getOwnPropertyDescriptor,mVa=Object.getOwnPropertyNames,gVa=Object.prototype.hasOwnProperty,AVa=a((t,e)=>{for(var r in e)NTr(t,r,{get:e[r],enumerable:!0})},"__export"),yVa=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mVa(e))!gVa.call(t,o)&&o!==r&&NTr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=hVa(e,o))||n.enumerable});return t},"__copyProps"),EVa=a(t=>yVa(NTr({},"__esModule",{value:!0}),t),"__toCommonJS"),_2i={};AVa(_2i,{config:a(()=>SVa,"config"),t:a(()=>v2i,"t")});C2i.exports=EVa(_2i);var _Va=require("fs"),vVa=require("fs/promises");async function CVa(t){if(t.protocol==="file:")return await(0,vVa.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(CVa,"readFileFromUri");function bVa(t){return(0,_Va.readFileSync)(t,"utf8")}a(bVa,"readFileFromFsPath");var _4e;function SVa(t){if("contents"in t){typeof t.contents=="string"?_4e=JSON.parse(t.contents):_4e=t.contents;return}if("fsPath"in t){let e=bVa(t.fsPath),r=JSON.parse(e);_4e=E2i(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)=>{CVa(e).then(o=>{try{let s=JSON.parse(o);_4e=E2i(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(SVa,"config");function v2i(...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=_4e?.[r];return s?typeof s=="string"?syt(s,o):s.comment?syt(s.message,o):syt(n,o):syt(n,o)}a(v2i,"t");var TVa=/{([^}]+)}/g;function syt(t,e){return Object.keys(e).length===0?t:t.replace(TVa,(r,n)=>e[n]??r)}a(syt,"format");function E2i(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(E2i,"isBuiltinExtension")});var Fre=I(Ov=>{"use strict";p();var IVa=Ov&&Ov.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xVa=Ov&&Ov.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wVa=Ov&&Ov.__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(PTr,"__esModule",{value:!0});PTr.isDocumentValid=yVa;var gVa=Bre(),AVa=nd();async function yVa(t,e){return await t.get(gVa.IIgnoreService).isCopilotIgnored(AVa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(yVa,"isDocumentValid")});var s1=I(ID=>{"use strict";p();var EVa=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},m2i=ID&&ID.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ID,"__esModule",{value:!0});ID.TextDocumentManager=ID.ICompletionsTextDocumentManagerService=void 0;var _Va=nn(),vVa=Gs(),CVa=n$(),g2i=DTr(),gAe=o$();ID.ICompletionsTextDocumentManagerService=(0,_Va.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var NTr=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(g2i.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,gAe.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(g2i.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,gAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,gAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,gAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,gAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,gAe.basename)(r)}};ID.TextDocumentManager=NTr;ID.TextDocumentManager=NTr=EVa([m2i(0,vVa.IInstantiationService),m2i(1,CVa.ICompletionsFileSystemService)],NTr)});var LTr=I(xD=>{"use strict";p();var bVa=xD&&xD.__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},MTr=xD&&xD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xD,"__esModule",{value:!0});xD.FileReader=xD.ICompletionsFileReaderService=void 0;var SVa=nn(),TVa=Gs(),IVa=n$(),xVa=mAe(),wVa=s1(),RVa=DTr(),kVa=o$();xD.ICompletionsFileReaderService=(0,SVa.createServiceIdentifier)("ICompletionsFileReaderService");var OTr=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,kVa.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(RVa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:xVa.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}};xD.FileReader=OTr;xD.FileReader=OTr=bVa([MTr(0,wVa.ICompletionsTextDocumentManagerService),MTr(1,TVa.IInstantiationService),MTr(2,IVa.ICompletionsFileSystemService)],OTr)});var C6=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.LRUCacheMap=void 0;var BTr=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)}};nyt.LRUCacheMap=BTr});var y4e=I(A4e=>{"use strict";p();Object.defineProperty(A4e,"__esModule",{value:!0});A4e.Deferred=void 0;A4e.delay=PVa;var FTr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};A4e.Deferred=FTr;function PVa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(PVa,"delay")});var A2i=I(AAe=>{"use strict";p();Object.defineProperty(AAe,"__esModule",{value:!0});AAe.ReplaySubject=AAe.Subject=void 0;var iyt=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?.()}};AAe.Subject=iyt;var UTr=class extends iyt{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)}};AAe.ReplaySubject=UTr});var jTr=I(wD=>{"use strict";p();var DVa=wD&&wD.__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},y2i=wD&&wD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(wD,"__esModule",{value:!0});wD.AsyncCompletionManager=wD.ICompletionsAsyncManagerService=void 0;var NVa=nn(),MVa=fy(),OVa=C6(),E2i=Dl(),LVa=y4e(),BVa=A2i(),Fre;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Fre||(Fre={}));wD.ICompletionsAsyncManagerService=(0,NVa.createServiceIdentifier)("ICompletionsAsyncManagerService");var qTr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new E2i.Logger("AsyncCompletionManager"),this.requests=new OVa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(QTr(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 BVa.ReplaySubject;return this.requests.set(e,{state:Fre.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:Fre.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 LVa.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(QTr(r,n,f)){if(f.state===Fre.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)QTr(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!==Fre.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};wD.AsyncCompletionManager=qTr;wD.AsyncCompletionManager=qTr=DVa([y2i(0,MVa.ICompletionsFeaturesService),y2i(1,E2i.ICompletionsLogTargetService)],qTr);function QTr(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===Fre.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(QTr,"isCandidate")});var _2i=I(oyt=>{"use strict";p();Object.defineProperty(oyt,"__esModule",{value:!0});oyt.LRURadixTrie=void 0;var HTr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new E4e,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 E4e;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 E4e;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(yAe,"__esModule",{value:!0});yAe.CompletionsCache=yAe.ICompletionsCacheService=void 0;var FVa=nn(),v2i=_2i();yAe.ICompletionsCacheService=(0,FVa.createServiceIdentifier)("ICompletionsCacheService");var GTr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new v2i.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 v2i.LRURadixTrie(100)}};yAe.CompletionsCache=GTr});var C2i=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.BlockMode=void 0;EAe.shouldDoParsingTrimming=UVa;EAe.shouldDoServerTrimming=QVa;var Ure;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Ure||(EAe.BlockMode=Ure={}));function UVa(t){return[Ure.Parsing,Ure.ParsingAndServer,Ure.MoreMultiline].includes(t)}a(UVa,"shouldDoParsingTrimming");function QVa(t){return[Ure.Server,Ure.ParsingAndServer].includes(t)}a(QVa,"shouldDoServerTrimming")});var Qre=I(tI=>{"use strict";p();var qVa=tI&&tI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tI,"__esModule",{value:!0});tI.WASMLanguage=void 0;tI.isSupportedLanguageId=HVa;tI.languageIdToWasmLanguage=YTr;tI.getLanguage=S2i;tI.parseTreeSitter=$Va;tI.parseTreeSitterIncludingVersion=T2i;tI.getBlockCloseToken=VVa;tI.queryPythonIsDocstring=YVa;var VTr=qVa(ale()),jVa=uTr(),b2i=dTr(),Ed;(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"})(Ed||(tI.WASMLanguage=Ed={}));var WTr={python:Ed.Python,javascript:Ed.JavaScript,javascriptreact:Ed.JavaScript,jsx:Ed.JavaScript,typescript:Ed.TypeScript,typescriptreact:Ed.TSX,go:Ed.Go,ruby:Ed.Ruby,csharp:Ed.CSharp,java:Ed.Java,php:Ed.Php,c:Ed.Cpp,cpp:Ed.Cpp};function HVa(t){return t in WTr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(HVa,"isSupportedLanguageId");function YTr(t){if(!(t in WTr))throw new Error(`Unrecognized language: ${t}`);return WTr[t]}a(YTr,"languageIdToWasmLanguage");var $Tr=new Map;async function GVa(t){let e;try{e=await(0,b2i.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new jVa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return VTr.default.Language.load(e)}a(GVa,"loadWasmLanguage");function S2i(t){let e=YTr(t);if(!$Tr.has(e)){let r=GVa(e);$Tr.set(e,r)}return $Tr.get(e)}a(S2i,"getLanguage");var zTr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function $Va(t,e){return(await T2i(t,e))[0]}a($Va,"parseTreeSitter");async function T2i(t,e){await VTr.default.init({locateFile:a(s=>(0,b2i.locateFile)(s),"locateFile")});let r;try{r=new VTr.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 zTr(`Could not init Parse for language <${t}>`,s):s}let n=await S2i(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(T2i,"parseTreeSitterIncludingVersion");function VVa(t){switch(YTr(t)){case Ed.Python:return null;case Ed.JavaScript:case Ed.TypeScript:case Ed.TSX:case Ed.Go:case Ed.CSharp:case Ed.Java:case Ed.Php:case Ed.Cpp:return"}";case Ed.Ruby:return"end"}}a(VVa,"getBlockCloseToken");function WVa(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(WVa,"innerQuery");var zVa=[`[ +**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.`);Ov.IIgnoreService=(0,kVa.createServiceIdentifier)("IIgnoreService");var MTr=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(){}};Ov.NullIgnoreService=MTr;async function PVa(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(PVa,"filterIngoredResources")});var LTr=I(OTr=>{"use strict";p();Object.defineProperty(OTr,"__esModule",{value:!0});OTr.isDocumentValid=MVa;var DVa=Fre(),NVa=id();async function MVa(t,e){return await t.get(DVa.IIgnoreService).isCopilotIgnored(NVa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(MVa,"isDocumentValid")});var s1=I(RD=>{"use strict";p();var OVa=RD&&RD.__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},b2i=RD&&RD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(RD,"__esModule",{value:!0});RD.TextDocumentManager=RD.ICompletionsTextDocumentManagerService=void 0;var LVa=nn(),BVa=Gs(),FVa=a$(),S2i=LTr(),yAe=l$();RD.ICompletionsTextDocumentManagerService=(0,LVa.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var BTr=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(S2i.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,yAe.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(S2i.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,yAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,yAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,yAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,yAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,yAe.basename)(r)}};RD.TextDocumentManager=BTr;RD.TextDocumentManager=BTr=OVa([b2i(0,BVa.IInstantiationService),b2i(1,FVa.ICompletionsFileSystemService)],BTr)});var QTr=I(kD=>{"use strict";p();var UVa=kD&&kD.__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},FTr=kD&&kD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kD,"__esModule",{value:!0});kD.FileReader=kD.ICompletionsFileReaderService=void 0;var QVa=nn(),qVa=Gs(),jVa=a$(),HVa=AAe(),GVa=s1(),$Va=LTr(),VVa=l$();kD.ICompletionsFileReaderService=(0,QVa.createServiceIdentifier)("ICompletionsFileReaderService");var UTr=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,VVa.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($Va.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:HVa.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}};kD.FileReader=UTr;kD.FileReader=UTr=UVa([FTr(0,GVa.ICompletionsTextDocumentManagerService),FTr(1,qVa.IInstantiationService),FTr(2,jVa.ICompletionsFileSystemService)],UTr)});var S6=I(ayt=>{"use strict";p();Object.defineProperty(ayt,"__esModule",{value:!0});ayt.LRUCacheMap=void 0;var qTr=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)}};ayt.LRUCacheMap=qTr});var b4e=I(C4e=>{"use strict";p();Object.defineProperty(C4e,"__esModule",{value:!0});C4e.Deferred=void 0;C4e.delay=WVa;var jTr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};C4e.Deferred=jTr;function WVa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(WVa,"delay")});var T2i=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.ReplaySubject=EAe.Subject=void 0;var cyt=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?.()}};EAe.Subject=cyt;var HTr=class extends cyt{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)}};EAe.ReplaySubject=HTr});var VTr=I(PD=>{"use strict";p();var zVa=PD&&PD.__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},I2i=PD&&PD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PD,"__esModule",{value:!0});PD.AsyncCompletionManager=PD.ICompletionsAsyncManagerService=void 0;var YVa=nn(),KVa=py(),JVa=S6(),x2i=Nl(),ZVa=b4e(),XVa=T2i(),Ure;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Ure||(Ure={}));PD.ICompletionsAsyncManagerService=(0,YVa.createServiceIdentifier)("ICompletionsAsyncManagerService");var $Tr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new x2i.Logger("AsyncCompletionManager"),this.requests=new JVa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(GTr(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 XVa.ReplaySubject;return this.requests.set(e,{state:Ure.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:Ure.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 ZVa.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(GTr(r,n,f)){if(f.state===Ure.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)GTr(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!==Ure.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};PD.AsyncCompletionManager=$Tr;PD.AsyncCompletionManager=$Tr=zVa([I2i(0,KVa.ICompletionsFeaturesService),I2i(1,x2i.ICompletionsLogTargetService)],$Tr);function GTr(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===Ure.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(GTr,"isCandidate")});var w2i=I(lyt=>{"use strict";p();Object.defineProperty(lyt,"__esModule",{value:!0});lyt.LRURadixTrie=void 0;var WTr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new S4e,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 S4e;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 S4e;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(_Ae,"__esModule",{value:!0});_Ae.CompletionsCache=_Ae.ICompletionsCacheService=void 0;var eWa=nn(),R2i=w2i();_Ae.ICompletionsCacheService=(0,eWa.createServiceIdentifier)("ICompletionsCacheService");var zTr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new R2i.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 R2i.LRURadixTrie(100)}};_Ae.CompletionsCache=zTr});var k2i=I(vAe=>{"use strict";p();Object.defineProperty(vAe,"__esModule",{value:!0});vAe.BlockMode=void 0;vAe.shouldDoParsingTrimming=tWa;vAe.shouldDoServerTrimming=rWa;var Qre;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Qre||(vAe.BlockMode=Qre={}));function tWa(t){return[Qre.Parsing,Qre.ParsingAndServer,Qre.MoreMultiline].includes(t)}a(tWa,"shouldDoParsingTrimming");function rWa(t){return[Qre.Server,Qre.ParsingAndServer].includes(t)}a(rWa,"shouldDoServerTrimming")});var qre=I(nI=>{"use strict";p();var nWa=nI&&nI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nI,"__esModule",{value:!0});nI.WASMLanguage=void 0;nI.isSupportedLanguageId=oWa;nI.languageIdToWasmLanguage=XTr;nI.getLanguage=D2i;nI.parseTreeSitter=aWa;nI.parseTreeSitterIncludingVersion=N2i;nI.getBlockCloseToken=cWa;nI.queryPythonIsDocstring=dWa;var KTr=nWa(cle()),iWa=hTr(),P2i=mTr(),vd;(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"})(vd||(nI.WASMLanguage=vd={}));var JTr={python:vd.Python,javascript:vd.JavaScript,javascriptreact:vd.JavaScript,jsx:vd.JavaScript,typescript:vd.TypeScript,typescriptreact:vd.TSX,go:vd.Go,ruby:vd.Ruby,csharp:vd.CSharp,java:vd.Java,php:vd.Php,c:vd.Cpp,cpp:vd.Cpp};function oWa(t){return t in JTr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(oWa,"isSupportedLanguageId");function XTr(t){if(!(t in JTr))throw new Error(`Unrecognized language: ${t}`);return JTr[t]}a(XTr,"languageIdToWasmLanguage");var YTr=new Map;async function sWa(t){let e;try{e=await(0,P2i.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new iWa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return KTr.default.Language.load(e)}a(sWa,"loadWasmLanguage");function D2i(t){let e=XTr(t);if(!YTr.has(e)){let r=sWa(e);YTr.set(e,r)}return YTr.get(e)}a(D2i,"getLanguage");var ZTr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function aWa(t,e){return(await N2i(t,e))[0]}a(aWa,"parseTreeSitter");async function N2i(t,e){await KTr.default.init({locateFile:a(s=>(0,P2i.locateFile)(s),"locateFile")});let r;try{r=new KTr.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 ZTr(`Could not init Parse for language <${t}>`,s):s}let n=await D2i(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(N2i,"parseTreeSitterIncludingVersion");function cWa(t){switch(XTr(t)){case vd.Python:return null;case vd.JavaScript:case vd.TypeScript:case vd.TSX:case vd.Go:case vd.CSharp:case vd.Java:case vd.Php:case vd.Cpp:return"}";case vd.Ruby:return"end"}}a(cWa,"getBlockCloseToken");function lWa(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(lWa,"innerQuery");var uWa=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function YVa(t){return WVa([zVa],t).length===1}a(YVa,"queryPythonIsDocstring")});var nIr=I(bAe=>{"use strict";p();Object.defineProperty(bAe,"__esModule",{value:!0});bAe.StatementTree=bAe.StatementNode=void 0;var KVa=Qre(),RD=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 dWa(t){return lWa([uWa],t).length===1}a(dWa,"queryPythonIsDocstring")});var aIr=I(TAe=>{"use strict";p();Object.defineProperty(TAe,"__esModule",{value:!0});TAe.StatementTree=TAe.StatementNode=void 0;var fWa=qre(),DD=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}}};bAe.StatementNode=RD;var LR=class{static{a(this,"StatementTree")}static isSupported(e){return _Ae.languageIds.has(e)||vAe.languageIds.has(e)||v4e.languageIds.has(e)||CAe.languageIds.has(e)||C4e.languageIds.has(e)||b4e.languageIds.has(e)||S4e.languageIds.has(e)||T4e.languageIds.has(e)||I4e.languageIds.has(e)}static isTrimmedByDefault(e){return _Ae.languageIds.has(e)||vAe.languageIds.has(e)||CAe.languageIds.has(e)}static create(e,r,n,o){if(_Ae.languageIds.has(e))return new _Ae(e,r,n,o);if(vAe.languageIds.has(e))return new vAe(e,r,n,o);if(v4e.languageIds.has(e))return new v4e(e,r,n,o);if(CAe.languageIds.has(e))return new CAe(e,r,n,o);if(S4e.languageIds.has(e))return new S4e(e,r,n,o);if(C4e.languageIds.has(e))return new C4e(e,r,n,o);if(b4e.languageIds.has(e))return new b4e(e,r,n,o);if(T4e.languageIds.has(e))return new T4e(e,r,n,o);if(I4e.languageIds.has(e))return new I4e(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,KVa.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}}};TAe.StatementNode=DD;var FR=class{static{a(this,"StatementTree")}static isSupported(e){return CAe.languageIds.has(e)||bAe.languageIds.has(e)||I4e.languageIds.has(e)||SAe.languageIds.has(e)||x4e.languageIds.has(e)||w4e.languageIds.has(e)||R4e.languageIds.has(e)||k4e.languageIds.has(e)||P4e.languageIds.has(e)}static isTrimmedByDefault(e){return CAe.languageIds.has(e)||bAe.languageIds.has(e)||SAe.languageIds.has(e)}static create(e,r,n,o){if(CAe.languageIds.has(e))return new CAe(e,r,n,o);if(bAe.languageIds.has(e))return new bAe(e,r,n,o);if(I4e.languageIds.has(e))return new I4e(e,r,n,o);if(SAe.languageIds.has(e))return new SAe(e,r,n,o);if(R4e.languageIds.has(e))return new R4e(e,r,n,o);if(x4e.languageIds.has(e))return new x4e(e,r,n,o);if(w4e.languageIds.has(e))return new w4e(e,r,n,o);if(k4e.languageIds.has(e))return new k4e(e,r,n,o);if(P4e.languageIds.has(e))return new P4e(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,fWa.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(` -`)}};bAe.StatementTree=LR;var syt=class t extends RD{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"}},_Ae=class extends LR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ +`)}};TAe.StatementTree=FR;var uyt=class t extends DD{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"}},CAe=class extends FR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new uyt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -827,7 +827,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},vAe=class extends LR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ + ] @statement`}},bAe=class extends FR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new uyt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -850,7 +850,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},KTr=class t extends RD{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}},v4e=class extends LR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new KTr(e)}getStatementQueryText(){return`[ + ] @statement`}},eIr=class t extends DD{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}},I4e=class extends FR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new eIr(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -876,24 +876,24 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},JTr=class t extends RD{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)}},CAe=class extends LR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new JTr(e)}getStatementQueryText(){return`[ + ] @statement`}},tIr=class t extends DD{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)}},SAe=class extends FR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new tIr(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},ZTr=class t extends RD{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)}},C4e=class extends LR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new ZTr(e)}getStatementQueryText(){return`[ + ] @statement`}},rIr=class t extends DD{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)}},x4e=class extends FR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new rIr(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},XTr=class t extends RD{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)}},b4e=class extends LR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new XTr(e)}getStatementQueryText(){return`[ + ] @statement`}},nIr=class t extends DD{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)}},w4e=class extends FR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new nIr(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},eIr=class t extends RD{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"}},S4e=class extends LR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new eIr(e)}getStatementQueryText(){return`[ + ] @statement`}},iIr=class t extends DD{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"}},R4e=class extends FR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new iIr(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -906,7 +906,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},tIr=class t extends RD{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"}},T4e=class extends LR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new tIr(e)}getStatementQueryText(){return`[ + ] @statement`}},oIr=class t extends DD{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"}},k4e=class extends FR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new oIr(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -918,7 +918,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},rIr=class t extends RD{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)}},I4e=class extends LR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new rIr(e)}getStatementQueryText(){return`[ + ] @statement`}},sIr=class t extends DD{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)}},P4e=class extends FR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new sIr(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -955,30 +955,30 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var SAe=I(kD=>{"use strict";p();Object.defineProperty(kD,"__esModule",{value:!0});kD.BlockPositionType=kD.TerseBlockTrimmer=kD.VerboseBlockTrimmer=kD.BlockTrimmer=void 0;kD.getBlockPositionType=JVa;var ayt=nIr(),x4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return ayt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return ayt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=ayt.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}};kD.BlockTrimmer=x4e;var iIr=class extends x4e{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}};kD.VerboseBlockTrimmer=iIr;var oIr=class extends x4e{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 ZVa=PD&&PD.__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},I2i=PD&&PD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PD,"__esModule",{value:!0});PD.ConfigBlockModeConfig=PD.ICompletionsBlockModeConfig=void 0;var XVa=nn(),eWa=Gs(),X4=C2i(),w2i=Qre(),x2i=LE(),tWa=fy(),rWa=SAe(),nWa=nIr();PD.ICompletionsBlockModeConfig=(0,XVa.createServiceIdentifier)("ICompletionsBlockModeConfig");var aIr=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 sIr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(x2i.getConfig,x2i.ConfigKey.AlwaysRequestMultiline)??o)||rWa.BlockTrimmer.isTrimmedByDefault(e)?sIr(X4.BlockMode.MoreMultiline,e):e==="ruby"?X4.BlockMode.Parsing:(0,w2i.isSupportedLanguageId)(e)?X4.BlockMode.ParsingAndServer:X4.BlockMode.Server}};PD.ConfigBlockModeConfig=aIr;PD.ConfigBlockModeConfig=aIr=ZVa([I2i(0,eWa.IInstantiationService),I2i(1,tWa.ICompletionsFeaturesService)],aIr);function iWa(t){return[X4.BlockMode.Parsing,X4.BlockMode.ParsingAndServer,X4.BlockMode.MoreMultiline].includes(t)}a(iWa,"blockModeRequiresTreeSitter");function sIr(t,e){return t===X4.BlockMode.MoreMultiline&&nWa.StatementTree.isSupported(e)?t:iWa(t)&&!(0,w2i.isSupportedLanguageId)(e)?X4.BlockMode.Server:t}a(sIr,"toApplicableBlockMode")});var a$=I(cyt=>{"use strict";p();Object.defineProperty(cyt,"__esModule",{value:!0});cyt.ResultType=void 0;var R2i;(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"})(R2i||(cyt.ResultType=R2i={}))});var uIr=I(TAe=>{"use strict";p();Object.defineProperty(TAe,"__esModule",{value:!0});TAe.CurrentGhostText=TAe.ICompletionsCurrentGhostText=void 0;var oWa=nn(),sWa=a$();TAe.ICompletionsCurrentGhostText=(0,oWa.createServiceIdentifier)("ICompletionsCurrentGhostText");var lIr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==sWa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&k2i(this.choices[0].completionText,n))return aWa(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)}};TAe.CurrentGhostText=lIr;function aWa(t,e){return t.filter(r=>k2i(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(aWa,"adjustChoicesStart");function k2i(t,e){return t.startsWith(e)&&t.length>e.length}a(k2i,"startsWithAndExceeds")});var P2i=I(S6=>{"use strict";p();var cWa=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},lWa=S6&&S6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S6,"__esModule",{value:!0});S6.ChangeTracker=void 0;var uWa=s1(),dIr=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)}};S6.ChangeTracker=dIr;S6.ChangeTracker=dIr=cWa([lWa(2,uWa.ICompletionsTextDocumentManagerService)],dIr)});var pIr=I(w4e=>{"use strict";p();Object.defineProperty(w4e,"__esModule",{value:!0});w4e.CompletionState=void 0;w4e.createCompletionState=dWa;var fIr=o4e(),lyt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??fIr.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(IAe,"__esModule",{value:!0});IAe.SpeculativeRequestCache=IAe.ICompletionsSpeculativeRequestCache=void 0;var fWa=nn(),pWa=C6();IAe.ICompletionsSpeculativeRequestCache=(0,fWa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var hIr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new pWa.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())}};IAe.SpeculativeRequestCache=hIr});var xAe=I(Mv=>{"use strict";p();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.logger=Mv.GHOST_TEXT_CATEGORY=void 0;Mv.telemetryShown=mWa;Mv.telemetryAccepted=gWa;Mv.telemetryRejected=AWa;Mv.mkCanceledResultTelemetry=yWa;Mv.mkBasicResultTelemetry=EWa;Mv.handleGhostTextResultTelemetry=_Wa;Mv.resultTypeToString=mIr;var D2i=Dl(),qre=$g(),R4e=a$(),hWa=uyt();Mv.GHOST_TEXT_CATEGORY="ghostText";Mv.logger=new D2i.Logger("getCompletions");function mWa(t,e){t.get(hWa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=mIr(e.resultType),(0,qre.telemetry)(t,"ghostText.shown",e.telemetry)}a(mWa,"telemetryShown");function gWa(t,e,r){let n=e+".accepted";(0,qre.telemetry)(t,n,r)}a(gWa,"telemetryAccepted");function AWa(t,e,r){let n=e+".rejected";(0,qre.telemetry)(t,n,r)}a(AWa,"telemetryRejected");function yWa(t,e={}){return{...e,telemetryBlob:t}}a(yWa,"mkCanceledResultTelemetry");function EWa(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(EWa,"mkBasicResultTelemetry");function _Wa(t,e){let r=t.get(D2i.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,qre.now)()-e.telemetryBlob.issuedTime,o=mIr(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 Mv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,qre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Mv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,qre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,qre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(_Wa,"handleGhostTextResultTelemetry");function mIr(t){switch(t){case R4e.ResultType.Network:return"network";case R4e.ResultType.Cache:return"cache";case R4e.ResultType.Cycling:return"cycling";case R4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case R4e.ResultType.Async:return"async"}}a(mIr,"resultTypeToString")});var O2i=I(wAe=>{"use strict";p();Object.defineProperty(wAe,"__esModule",{value:!0});wAe.getBlockParser=pyt;wAe.isEmptyBlockStart=SWa;wAe.isBlockBodyFinished=TWa;wAe.getNodeStart=IWa;var c$=Qre(),dyt=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,c$.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)}},fyt=class extends dyt{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(ND,"__esModule",{value:!0});ND.BlockPositionType=ND.TerseBlockTrimmer=ND.VerboseBlockTrimmer=ND.BlockTrimmer=void 0;ND.getBlockPositionType=pWa;var dyt=aIr(),D4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return dyt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return dyt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=dyt.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}};ND.BlockTrimmer=D4e;var cIr=class extends D4e{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}};ND.VerboseBlockTrimmer=cIr;var lIr=class extends D4e{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 hWa=MD&&MD.__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},M2i=MD&&MD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MD,"__esModule",{value:!0});MD.ConfigBlockModeConfig=MD.ICompletionsBlockModeConfig=void 0;var mWa=nn(),gWa=Gs(),eL=k2i(),L2i=qre(),O2i=BE(),AWa=py(),yWa=IAe(),EWa=aIr();MD.ICompletionsBlockModeConfig=(0,mWa.createServiceIdentifier)("ICompletionsBlockModeConfig");var dIr=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 uIr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(O2i.getConfig,O2i.ConfigKey.AlwaysRequestMultiline)??o)||yWa.BlockTrimmer.isTrimmedByDefault(e)?uIr(eL.BlockMode.MoreMultiline,e):e==="ruby"?eL.BlockMode.Parsing:(0,L2i.isSupportedLanguageId)(e)?eL.BlockMode.ParsingAndServer:eL.BlockMode.Server}};MD.ConfigBlockModeConfig=dIr;MD.ConfigBlockModeConfig=dIr=hWa([M2i(0,gWa.IInstantiationService),M2i(1,AWa.ICompletionsFeaturesService)],dIr);function _Wa(t){return[eL.BlockMode.Parsing,eL.BlockMode.ParsingAndServer,eL.BlockMode.MoreMultiline].includes(t)}a(_Wa,"blockModeRequiresTreeSitter");function uIr(t,e){return t===eL.BlockMode.MoreMultiline&&EWa.StatementTree.isSupported(e)?t:_Wa(t)&&!(0,L2i.isSupportedLanguageId)(e)?eL.BlockMode.Server:t}a(uIr,"toApplicableBlockMode")});var d$=I(fyt=>{"use strict";p();Object.defineProperty(fyt,"__esModule",{value:!0});fyt.ResultType=void 0;var B2i;(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"})(B2i||(fyt.ResultType=B2i={}))});var hIr=I(xAe=>{"use strict";p();Object.defineProperty(xAe,"__esModule",{value:!0});xAe.CurrentGhostText=xAe.ICompletionsCurrentGhostText=void 0;var vWa=nn(),CWa=d$();xAe.ICompletionsCurrentGhostText=(0,vWa.createServiceIdentifier)("ICompletionsCurrentGhostText");var pIr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==CWa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&F2i(this.choices[0].completionText,n))return bWa(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)}};xAe.CurrentGhostText=pIr;function bWa(t,e){return t.filter(r=>F2i(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(bWa,"adjustChoicesStart");function F2i(t,e){return t.startsWith(e)&&t.length>e.length}a(F2i,"startsWithAndExceeds")});var U2i=I(I6=>{"use strict";p();var SWa=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},TWa=I6&&I6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(I6,"__esModule",{value:!0});I6.ChangeTracker=void 0;var IWa=s1(),mIr=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)}};I6.ChangeTracker=mIr;I6.ChangeTracker=mIr=SWa([TWa(2,IWa.ICompletionsTextDocumentManagerService)],mIr)});var AIr=I(N4e=>{"use strict";p();Object.defineProperty(N4e,"__esModule",{value:!0});N4e.CompletionState=void 0;N4e.createCompletionState=xWa;var gIr=u4e(),pyt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??gIr.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(wAe,"__esModule",{value:!0});wAe.SpeculativeRequestCache=wAe.ICompletionsSpeculativeRequestCache=void 0;var wWa=nn(),RWa=S6();wAe.ICompletionsSpeculativeRequestCache=(0,wWa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var yIr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new RWa.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())}};wAe.SpeculativeRequestCache=yIr});var RAe=I(Lv=>{"use strict";p();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.logger=Lv.GHOST_TEXT_CATEGORY=void 0;Lv.telemetryShown=PWa;Lv.telemetryAccepted=DWa;Lv.telemetryRejected=NWa;Lv.mkCanceledResultTelemetry=MWa;Lv.mkBasicResultTelemetry=OWa;Lv.handleGhostTextResultTelemetry=LWa;Lv.resultTypeToString=EIr;var Q2i=Nl(),jre=Vg(),M4e=d$(),kWa=hyt();Lv.GHOST_TEXT_CATEGORY="ghostText";Lv.logger=new Q2i.Logger("getCompletions");function PWa(t,e){t.get(kWa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=EIr(e.resultType),(0,jre.telemetry)(t,"ghostText.shown",e.telemetry)}a(PWa,"telemetryShown");function DWa(t,e,r){let n=e+".accepted";(0,jre.telemetry)(t,n,r)}a(DWa,"telemetryAccepted");function NWa(t,e,r){let n=e+".rejected";(0,jre.telemetry)(t,n,r)}a(NWa,"telemetryRejected");function MWa(t,e={}){return{...e,telemetryBlob:t}}a(MWa,"mkCanceledResultTelemetry");function OWa(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(OWa,"mkBasicResultTelemetry");function LWa(t,e){let r=t.get(Q2i.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,jre.now)()-e.telemetryBlob.issuedTime,o=EIr(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 Lv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,jre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Lv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,jre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,jre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(LWa,"handleGhostTextResultTelemetry");function EIr(t){switch(t){case M4e.ResultType.Network:return"network";case M4e.ResultType.Cache:return"cache";case M4e.ResultType.Cycling:return"cycling";case M4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case M4e.ResultType.Async:return"async"}}a(EIr,"resultTypeToString")});var H2i=I(kAe=>{"use strict";p();Object.defineProperty(kAe,"__esModule",{value:!0});kAe.getBlockParser=Ayt;kAe.isEmptyBlockStart=QWa;kAe.isBlockBodyFinished=qWa;kAe.getNodeStart=jWa;var f$=qre(),myt=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,f$.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)}},gyt=class extends myt{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(M2i,"rewindToNearestNonWs");function N2i(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(N2i,"indent");function CWa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=N2i(t,r),o=N2i(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(CWa,"outdented");var eL=class extends dyt{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,c$.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()}}},bWa={python:new eL("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 eL("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 eL("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 eL("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 fyt("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 fyt("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 eL("csharp",{},new Map([]),[],"block",null,!0),java:new eL("java",{},new Map([]),[],"block",null,!0),php:new eL("php",{},new Map([]),[],"block",null,!0),cpp:new eL("cpp",{},new Map([]),[],"block",null,!0)};function pyt(t){if(!(0,c$.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return bWa[(0,c$.languageIdToWasmLanguage)(t)]}a(pyt,"getBlockParser");async function SWa(t,e,r){return(0,c$.isSupportedLanguageId)(t)?pyt(t).isEmptyBlockStart(e,r):!1}a(SWa,"isEmptyBlockStart");async function TWa(t,e,r,n){if((0,c$.isSupportedLanguageId)(t))return pyt(t).isBlockBodyFinished(e,r,n)}a(TWa,"isBlockBodyFinished");async function IWa(t,e,r){if((0,c$.isSupportedLanguageId)(t))return pyt(t).getNodeStart(e,r)}a(IWa,"getNodeStart")});var gyt=I(l$=>{"use strict";p();Object.defineProperty(l$,"__esModule",{value:!0});l$.parsingBlockFinished=xWa;l$.isEmptyBlockStartUtil=wWa;l$.getNodeStartUtil=RWa;l$.contextIndentation=NWa;l$.contextIndentationFromText=L2i;l$.indentationBlockFinished=LWa;var gIr=O2i(),myt=mAe();function xWa(t,e){let r=t.getText(myt.LocationFactory.range(myt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,gIr.isBlockBodyFinished)(o,r,s,n)}a(xWa,"parsingBlockFinished");function wWa(t,e){return(0,gIr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(wWa,"isEmptyBlockStartUtil");async function RWa(t,e,r){let o=t.getText(myt.LocationFactory.range(myt.LocationFactory.position(0,0),e))+r,s=await(0,gIr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(RWa,"getNodeStartUtil");var kWa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),PWa=new RegExp(`^(${kWa.join("|")})`);function DWa(t){return PWa.test(t.trimLeft().toLowerCase())}a(DWa,"isContinuationLine");function hyt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(hyt,"indentationOfLine");function NWa(t,e){let r=t.getText(),n=t.offsetAt(e);return L2i(r,n,t.detectedLanguageId)}a(NWa,"contextIndentation");function L2i(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(BWa,"getLineAtOffset");function j2i(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(j2i,"rewindToNearestNonWs");function q2i(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(q2i,"indent");function FWa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=q2i(t,r),o=q2i(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(FWa,"outdented");var tL=class extends myt{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,f$.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()}}},UWa={python:new tL("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 tL("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 tL("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 tL("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 gyt("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 gyt("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 tL("csharp",{},new Map([]),[],"block",null,!0),java:new tL("java",{},new Map([]),[],"block",null,!0),php:new tL("php",{},new Map([]),[],"block",null,!0),cpp:new tL("cpp",{},new Map([]),[],"block",null,!0)};function Ayt(t){if(!(0,f$.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return UWa[(0,f$.languageIdToWasmLanguage)(t)]}a(Ayt,"getBlockParser");async function QWa(t,e,r){return(0,f$.isSupportedLanguageId)(t)?Ayt(t).isEmptyBlockStart(e,r):!1}a(QWa,"isEmptyBlockStart");async function qWa(t,e,r,n){if((0,f$.isSupportedLanguageId)(t))return Ayt(t).isBlockBodyFinished(e,r,n)}a(qWa,"isBlockBodyFinished");async function jWa(t,e,r){if((0,f$.isSupportedLanguageId)(t))return Ayt(t).getNodeStart(e,r)}a(jWa,"getNodeStart")});var _yt=I(p$=>{"use strict";p();Object.defineProperty(p$,"__esModule",{value:!0});p$.parsingBlockFinished=HWa;p$.isEmptyBlockStartUtil=GWa;p$.getNodeStartUtil=$Wa;p$.contextIndentation=YWa;p$.contextIndentationFromText=G2i;p$.indentationBlockFinished=ZWa;var _Ir=H2i(),Eyt=AAe();function HWa(t,e){let r=t.getText(Eyt.LocationFactory.range(Eyt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,_Ir.isBlockBodyFinished)(o,r,s,n)}a(HWa,"parsingBlockFinished");function GWa(t,e){return(0,_Ir.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(GWa,"isEmptyBlockStartUtil");async function $Wa(t,e,r){let o=t.getText(Eyt.LocationFactory.range(Eyt.LocationFactory.position(0,0),e))+r,s=await(0,_Ir.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a($Wa,"getNodeStartUtil");var VWa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),WWa=new RegExp(`^(${VWa.join("|")})`);function zWa(t){return WWa.test(t.trimLeft().toLowerCase())}a(zWa,"isContinuationLine");function yyt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(yyt,"indentationOfLine");function YWa(t,e){let r=t.getText(),n=t.offsetAt(e);return G2i(r,n,t.detectedLanguageId)}a(YWa,"contextIndentation");function G2i(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=hyt(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=hyt(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=yyt(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=yyt(n[f]);if(h!==void 0&&h{let n=OWa(r,t,e);return n==="continue"?void 0:n}}a(LWa,"indentationBlockFinished")});var k4e=I(Yg=>{"use strict";p();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.languageMarkers=void 0;Yg.mdCodeBlockLangToLanguageId=BWa;Yg.isShebangLine=QWa;Yg.hasLanguageMarker=F2i;Yg.comment=U2i;Yg.commentBlockAsSingles=qWa;Yg.getLanguageMarker=jWa;Yg.getPathMarker=HWa;Yg.newLineEnded=GWa;Yg.getLanguage=$Wa;Yg.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 AIr={};for(let[t,e]of Object.entries(Yg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)AIr[r]=t;else AIr[t]=t;function BWa(t){return AIr[t]}a(BWa,"mdCodeBlockLangToLanguageId");var FWa={start:"//",end:""},UWa=["php","plaintext"],yIr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function QWa(t){return Object.values(yIr).includes(t.trim())}a(QWa,"isShebangLine");function F2i({source:t}){return t.startsWith("#!")||t.startsWith("{let n=JWa(r,t,e);return n==="continue"?void 0:n}}a(ZWa,"indentationBlockFinished")});var O4e=I(Kg=>{"use strict";p();Object.defineProperty(Kg,"__esModule",{value:!0});Kg.languageMarkers=void 0;Kg.mdCodeBlockLangToLanguageId=XWa;Kg.isShebangLine=rza;Kg.hasLanguageMarker=V2i;Kg.comment=W2i;Kg.commentBlockAsSingles=nza;Kg.getLanguageMarker=iza;Kg.getPathMarker=oza;Kg.newLineEnded=sza;Kg.getLanguage=aza;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 vIr={};for(let[t,e]of Object.entries(Kg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)vIr[r]=t;else vIr[t]=t;function XWa(t){return vIr[t]}a(XWa,"mdCodeBlockLangToLanguageId");var eza={start:"//",end:""},tza=["php","plaintext"],CIr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function rza(t){return Object.values(CIr).includes(t.trim())}a(rza,"isShebangLine");function V2i({source:t}){return t.startsWith("#!")||t.startsWith("U2i(s,e)).join(` +`).map(s=>W2i(s,e)).join(` `);return r?o+` -`:o}a(qWa,"commentBlockAsSingles");function jWa(t){let{languageId:e}=t;return UWa.indexOf(e)===-1&&!F2i(t)?e in yIr?yIr[e]:`Language: ${e}`:""}a(jWa,"getLanguageMarker");function HWa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(HWa,"getPathMarker");function GWa(t){return t===""||t.endsWith(` +`:o}a(nza,"commentBlockAsSingles");function iza(t){let{languageId:e}=t;return tza.indexOf(e)===-1&&!V2i(t)?e in CIr?CIr[e]:`Language: ${e}`:""}a(iza,"getLanguageMarker");function oza(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(oza,"getPathMarker");function sza(t){return t===""||t.endsWith(` `)?t:t+` -`}a(GWa,"newLineEnded");function $Wa(t){return B2i(typeof t=="string"?t:"plaintext")}a($Wa,"getLanguage");function B2i(t){return Yg.languageMarkers[t]!==void 0?{languageId:t,...Yg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(B2i,"_getLanguage")});var _Ir=I(EIr=>{"use strict";p();Object.defineProperty(EIr,"__esModule",{value:!0});EIr.getCursorContext=zWa;var Q2i=Ore(),VWa={tokenizerName:Q2i.TokenizerName.o200k};function WWa(t){return{...VWa,...t}}a(WWa,"cursorContextOptions");function zWa(t,e={}){let r=WWa(e),n=(0,Q2i.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(sza,"newLineEnded");function aza(t){return $2i(typeof t=="string"?t:"plaintext")}a(aza,"getLanguage");function $2i(t){return Kg.languageMarkers[t]!==void 0?{languageId:t,...Kg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a($2i,"_getLanguage")});var SIr=I(bIr=>{"use strict";p();Object.defineProperty(bIr,"__esModule",{value:!0});bIr.getCursorContext=uza;var z2i=Lre(),cza={tokenizerName:z2i.TokenizerName.o200k};function lza(t){return{...cza,...t}}a(lza,"cursorContextOptions");function uza(t,e={}){let r=lza(e),n=(0,z2i.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(zWa,"getCursorContext")});var vIr=I(jre=>{"use strict";p();Object.defineProperty(jre,"__esModule",{value:!0});jre.SnippetSemantics=jre.SnippetProviderType=void 0;jre.announceSnippet=KWa;var q2i;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(q2i||(jre.SnippetProviderType=q2i={}));var a1;(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"})(a1||(jre.SnippetSemantics=a1={}));var YWa={[a1.Function]:"function",[a1.Snippet]:"snippet",[a1.Snippets]:"snippets",[a1.Variable]:"variable",[a1.Parameter]:"parameter",[a1.Method]:"method",[a1.Class]:"class",[a1.Module]:"module",[a1.Alias]:"alias",[a1.Enum]:"enum member",[a1.Interface]:"interface"};function KWa(t){let e=YWa[t.semantics],r=[a1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(KWa,"announceSnippet")});var TIr=I(Gre=>{"use strict";p();Object.defineProperty(Gre,"__esModule",{value:!0});Gre.WindowedMatcher=Gre.SortOptions=void 0;Gre.splitIntoWords=G2i;var j2i=vIr(),CIr=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]}},Hre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Hre||(Gre.SortOptions=Hre={}));var bIr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=XWa.get(e.languageId)??ZWa}tokenize(e){return new Set(G2i(e).filter(r=>!this.stopsForLanguage.has(r)))}},H2i=new CIr(20),SIr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new bIr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Hre.Descending){return r===Hre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Hre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Hre.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=H2i.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(G2i,"splitIntoWords");var JWa=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"]),ZWa=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",...JWa]),XWa=new Map([])});var IIr=I(BR=>{"use strict";p();Object.defineProperty(BR,"__esModule",{value:!0});BR.virtualNode=eza;BR.lineNode=tza;BR.blankNode=rza;BR.topNode=nza;BR.isBlank=iza;BR.isLine=oza;BR.isVirtual=$2i;BR.isTop=V2i;BR.cutTreeAfterLine=sza;BR.duplicateTree=aza;function eza(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(eza,"virtualNode");function tza(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(tza,"lineNode");function rza(t){return{type:"blank",lineNumber:t,subs:[]}}a(rza,"blankNode");function nza(t){return{type:"top",indentation:-1,subs:t??[]}}a(nza,"topNode");function iza(t){return t.type==="blank"}a(iza,"isBlank");function oza(t){return t.type==="line"}a(oza,"isLine");function $2i(t){return t.type==="virtual"}a($2i,"isVirtual");function V2i(t){return t.type==="top"}a(V2i,"isTop");function sza(t,e){function r(n){if(!$2i(n)&&!V2i(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(tL,"__esModule",{value:!0});tL.clearLabels=cza;tL.clearLabelsIf=lza;tL.mapLabels=wIr;tL.resetLineNumbers=uza;tL.visitTree=P4e;tL.visitTreeConditionally=dza;tL.foldTree=fza;tL.rebuildTree=pza;var xIr=IIr();function cza(t){return P4e(t,e=>{e.label=void 0},"bottomUp"),t}a(cza,"clearLabels");function lza(t,e){return P4e(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(lza,"clearLabelsIf");function wIr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>wIr(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=>wIr(r,e)),label:t.label?e(t.label):void 0}}}a(wIr,"mapLabels");function uza(t){let e=0;function r(n){!(0,xIr.isVirtual)(n)&&!(0,xIr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),P4e(t,r,"topDown")}a(uza,"resetLineNumbers");function P4e(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(P4e,"visitTree");function dza(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(dza,"visitTreeConditionally");function fza(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),P4e(t,s,n),o}a(fza,"foldTree");function pza(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,xIr.topNode)()}a(pza,"rebuildTree")});var Z2i=I(DD=>{"use strict";p();Object.defineProperty(DD,"__esModule",{value:!0});DD.parseRaw=W2i;DD.labelLines=z2i;DD.labelVirtualInherited=hza;DD.buildLabelRules=Y2i;DD.combineClosersAndOpeners=K2i;DD.groupBlocks=mza;DD.flattenVirtual=gza;DD.registerLanguageSpecificParser=Eza;DD.parseTree=_za;var Kg=IIr(),RAe=RIr();function W2i(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,Kg.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,RAe.visitTree)(t,r,"bottomUp")}a(z2i,"labelLines");function hza(t){function e(r){if((0,Kg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Kg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,RAe.visitTree)(t,e,"bottomUp")}a(hza,"labelVirtualInherited");function Y2i(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(Y2i,"buildLabelRules");function K2i(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,Kg.isLine)(l)||(0,Kg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Kg.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,Kg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Kg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,RAe.rebuildTree)(t,e);return(0,RAe.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(K2i,"combineClosersAndOpeners");function mza(t,e=Kg.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,Kg.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(Ayt,"__esModule",{value:!0});Ayt.getBasicWindowDelineations=Cza;Ayt.getIndentationWindowsDelineations=bza;var X2i=RIr(),vza=Z2i();function Cza(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(bza,"getIndentationWindowsDelineations")});var tDi=I(D4e=>{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.FixedWindowSizeJaccardMatcher=void 0;D4e.computeScore=eDi;var Sza=_Ir(),Tza=TIr(),Iza=kIr(),PIr=class t extends Tza.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,Iza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,Sza.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return eDi(e,r)}};D4e.FixedWindowSizeJaccardMatcher=PIr;function eDi(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(eDi,"computeScore")});var nDi=I(yyt=>{"use strict";p();Object.defineProperty(yyt,"__esModule",{value:!0});yyt.BlockTokenSubsetMatcher=void 0;var xza=Qre(),rDi=_Ir(),wza=TIr(),Rza=kIr(),DIr=class t extends wza.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,Rza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,rDi.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,rDi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return kza(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,xza.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}}};yyt.BlockTokenSubsetMatcher=DIr;function kza(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(kza,"computeScore")});var Eyt=I(ND=>{"use strict";p();Object.defineProperty(ND,"__esModule",{value:!0});ND.defaultCppSimilarFilesOptions=ND.nullSimilarFilesOptions=ND.conservativeFilesOptions=ND.defaultSimilarFilesOptions=void 0;ND.getSimilarSnippets=Fza;var Pza=tDi(),Dza=nDi(),Nza=0,Mza=60,Oza=4,Lza=1,iDi=20,oDi=1e4;ND.defaultSimilarFilesOptions={snippetLength:Mza,threshold:Nza,maxTopSnippets:Oza,maxCharPerFile:oDi,maxNumberOfFiles:iDi,maxSnippetsPerFile:Lza,useSubsetMatching:!1};ND.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:oDi,maxNumberOfFiles:iDi,maxSnippetsPerFile:1};ND.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};ND.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Bza(t,e){return(e.useSubsetMatching?Dza.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Pza.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(Bza,"getMatcher");async function Fza(t,e,r){let n=Bza(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(Fza,"getSimilarSnippets")});var aDi=I(_yt=>{"use strict";p();Object.defineProperty(_yt,"__esModule",{value:!0});_yt.getCppSimilarFilesOptions=Qza;_yt.getCppNumberOfSnippets=qza;var sDi=Eyt(),Uza=vyt();function Qza(t,e){return{...sDi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,Uza.useSubsetMatching)(t,e)}}a(Qza,"getCppSimilarFilesOptions");function qza(t){return sDi.defaultCppSimilarFilesOptions.maxTopSnippets}a(qza,"getCppNumberOfSnippets")});var vyt=I(N4e=>{"use strict";p();Object.defineProperty(N4e,"__esModule",{value:!0});N4e.getSimilarFilesOptions=Vza;N4e.getNumberOfSnippets=zza;N4e.useSubsetMatching=uDi;var jza=JG(),Hza=Eyt(),cDi=LE(),Gza=M0t(),lDi=aDi(),$za=new Map([["cpp",lDi.getCppSimilarFilesOptions]]);function Vza(t,e,r){let n=$za.get(r);return n?n(t,e):{...Hza.defaultSimilarFilesOptions,useSubsetMatching:uDi(t,e)}}a(Vza,"getSimilarFilesOptions");var Wza=new Map([["cpp",lDi.getCppNumberOfSnippets]]);function zza(t,e){let r=Wza.get(e);return r?r(t):jza.DEFAULT_NUM_SNIPPETS}a(zza,"getNumberOfSnippets");function uDi(t,e){return(e.filtersAndExp.exp.variables[Gza.ExpTreatmentVariables.UseSubsetMatching]||(0,cDi.getConfig)(t,cDi.ConfigKey.UseSubsetMatching))??!1}a(uDi,"useSubsetMatching")});var M4e=I($re=>{"use strict";p();Object.defineProperty($re,"__esModule",{value:!0});$re.convertToAPIChoice=Zza;$re.getTemperatureForSamples=tYa;$re.getStops=nYa;$re.getTopP=iYa;$re.getMaxSolutionTokens=oYa;var Yza=T0(),Kza=JG(),dDi=Dl(),Jza=$g();function Zza(t,e,r,n,o,s,c){return(0,Jza.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Xza(t,r),meanAlternativeLogProb:eYa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Yza.generateUuid)(),finishReason:r.finish_reason}}a(Zza,"convertToAPIChoice");function Xza(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){dDi.logger.exception(t,r,"Error calculating mean prob")}}a(Xza,"calculateMeanLogProb");function eYa(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){dDi.logger.exception(t,r,"Error calculating mean prob")}}a(eYa,"calculateMeanAlternativeLogProb");function tYa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(tYa,"getTemperatureForSamples");var rYa={markdown:[` +`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(uza,"getCursorContext")});var TIr=I(Hre=>{"use strict";p();Object.defineProperty(Hre,"__esModule",{value:!0});Hre.SnippetSemantics=Hre.SnippetProviderType=void 0;Hre.announceSnippet=fza;var Y2i;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(Y2i||(Hre.SnippetProviderType=Y2i={}));var a1;(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"})(a1||(Hre.SnippetSemantics=a1={}));var dza={[a1.Function]:"function",[a1.Snippet]:"snippet",[a1.Snippets]:"snippets",[a1.Variable]:"variable",[a1.Parameter]:"parameter",[a1.Method]:"method",[a1.Class]:"class",[a1.Module]:"module",[a1.Alias]:"alias",[a1.Enum]:"enum member",[a1.Interface]:"interface"};function fza(t){let e=dza[t.semantics],r=[a1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(fza,"announceSnippet")});var RIr=I($re=>{"use strict";p();Object.defineProperty($re,"__esModule",{value:!0});$re.WindowedMatcher=$re.SortOptions=void 0;$re.splitIntoWords=Z2i;var K2i=TIr(),IIr=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]}},Gre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Gre||($re.SortOptions=Gre={}));var xIr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=mza.get(e.languageId)??hza}tokenize(e){return new Set(Z2i(e).filter(r=>!this.stopsForLanguage.has(r)))}},J2i=new IIr(20),wIr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new xIr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Gre.Descending){return r===Gre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Gre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Gre.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=J2i.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(Z2i,"splitIntoWords");var pza=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"]),hza=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",...pza]),mza=new Map([])});var kIr=I(UR=>{"use strict";p();Object.defineProperty(UR,"__esModule",{value:!0});UR.virtualNode=gza;UR.lineNode=Aza;UR.blankNode=yza;UR.topNode=Eza;UR.isBlank=_za;UR.isLine=vza;UR.isVirtual=X2i;UR.isTop=eDi;UR.cutTreeAfterLine=Cza;UR.duplicateTree=bza;function gza(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(gza,"virtualNode");function Aza(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(Aza,"lineNode");function yza(t){return{type:"blank",lineNumber:t,subs:[]}}a(yza,"blankNode");function Eza(t){return{type:"top",indentation:-1,subs:t??[]}}a(Eza,"topNode");function _za(t){return t.type==="blank"}a(_za,"isBlank");function vza(t){return t.type==="line"}a(vza,"isLine");function X2i(t){return t.type==="virtual"}a(X2i,"isVirtual");function eDi(t){return t.type==="top"}a(eDi,"isTop");function Cza(t,e){function r(n){if(!X2i(n)&&!eDi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(rL,"__esModule",{value:!0});rL.clearLabels=Sza;rL.clearLabelsIf=Tza;rL.mapLabels=DIr;rL.resetLineNumbers=Iza;rL.visitTree=L4e;rL.visitTreeConditionally=xza;rL.foldTree=wza;rL.rebuildTree=Rza;var PIr=kIr();function Sza(t){return L4e(t,e=>{e.label=void 0},"bottomUp"),t}a(Sza,"clearLabels");function Tza(t,e){return L4e(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Tza,"clearLabelsIf");function DIr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>DIr(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=>DIr(r,e)),label:t.label?e(t.label):void 0}}}a(DIr,"mapLabels");function Iza(t){let e=0;function r(n){!(0,PIr.isVirtual)(n)&&!(0,PIr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),L4e(t,r,"topDown")}a(Iza,"resetLineNumbers");function L4e(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(L4e,"visitTree");function xza(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(xza,"visitTreeConditionally");function wza(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),L4e(t,s,n),o}a(wza,"foldTree");function Rza(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,PIr.topNode)()}a(Rza,"rebuildTree")});var sDi=I(OD=>{"use strict";p();Object.defineProperty(OD,"__esModule",{value:!0});OD.parseRaw=tDi;OD.labelLines=rDi;OD.labelVirtualInherited=kza;OD.buildLabelRules=nDi;OD.combineClosersAndOpeners=iDi;OD.groupBlocks=Pza;OD.flattenVirtual=Dza;OD.registerLanguageSpecificParser=Oza;OD.parseTree=Lza;var Jg=kIr(),PAe=NIr();function tDi(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,Jg.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,PAe.visitTree)(t,r,"bottomUp")}a(rDi,"labelLines");function kza(t){function e(r){if((0,Jg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Jg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,PAe.visitTree)(t,e,"bottomUp")}a(kza,"labelVirtualInherited");function nDi(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(nDi,"buildLabelRules");function iDi(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,Jg.isLine)(l)||(0,Jg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Jg.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,Jg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Jg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,PAe.rebuildTree)(t,e);return(0,PAe.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(iDi,"combineClosersAndOpeners");function Pza(t,e=Jg.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,Jg.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(vyt,"__esModule",{value:!0});vyt.getBasicWindowDelineations=Fza;vyt.getIndentationWindowsDelineations=Uza;var aDi=NIr(),Bza=sDi();function Fza(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(Uza,"getIndentationWindowsDelineations")});var lDi=I(B4e=>{"use strict";p();Object.defineProperty(B4e,"__esModule",{value:!0});B4e.FixedWindowSizeJaccardMatcher=void 0;B4e.computeScore=cDi;var Qza=SIr(),qza=RIr(),jza=MIr(),OIr=class t extends qza.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,jza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,Qza.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return cDi(e,r)}};B4e.FixedWindowSizeJaccardMatcher=OIr;function cDi(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(cDi,"computeScore")});var dDi=I(Cyt=>{"use strict";p();Object.defineProperty(Cyt,"__esModule",{value:!0});Cyt.BlockTokenSubsetMatcher=void 0;var Hza=qre(),uDi=SIr(),Gza=RIr(),$za=MIr(),LIr=class t extends Gza.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,$za.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,uDi.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,uDi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return Vza(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,Hza.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}}};Cyt.BlockTokenSubsetMatcher=LIr;function Vza(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(Vza,"computeScore")});var byt=I(LD=>{"use strict";p();Object.defineProperty(LD,"__esModule",{value:!0});LD.defaultCppSimilarFilesOptions=LD.nullSimilarFilesOptions=LD.conservativeFilesOptions=LD.defaultSimilarFilesOptions=void 0;LD.getSimilarSnippets=eYa;var Wza=lDi(),zza=dDi(),Yza=0,Kza=60,Jza=4,Zza=1,fDi=20,pDi=1e4;LD.defaultSimilarFilesOptions={snippetLength:Kza,threshold:Yza,maxTopSnippets:Jza,maxCharPerFile:pDi,maxNumberOfFiles:fDi,maxSnippetsPerFile:Zza,useSubsetMatching:!1};LD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:pDi,maxNumberOfFiles:fDi,maxSnippetsPerFile:1};LD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};LD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Xza(t,e){return(e.useSubsetMatching?zza.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Wza.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(Xza,"getMatcher");async function eYa(t,e,r){let n=Xza(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(eYa,"getSimilarSnippets")});var mDi=I(Syt=>{"use strict";p();Object.defineProperty(Syt,"__esModule",{value:!0});Syt.getCppSimilarFilesOptions=rYa;Syt.getCppNumberOfSnippets=nYa;var hDi=byt(),tYa=Tyt();function rYa(t,e){return{...hDi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,tYa.useSubsetMatching)(t,e)}}a(rYa,"getCppSimilarFilesOptions");function nYa(t){return hDi.defaultCppSimilarFilesOptions.maxTopSnippets}a(nYa,"getCppNumberOfSnippets")});var Tyt=I(F4e=>{"use strict";p();Object.defineProperty(F4e,"__esModule",{value:!0});F4e.getSimilarFilesOptions=cYa;F4e.getNumberOfSnippets=uYa;F4e.useSubsetMatching=yDi;var iYa=t$(),oYa=byt(),gDi=BE(),sYa=F0t(),ADi=mDi(),aYa=new Map([["cpp",ADi.getCppSimilarFilesOptions]]);function cYa(t,e,r){let n=aYa.get(r);return n?n(t,e):{...oYa.defaultSimilarFilesOptions,useSubsetMatching:yDi(t,e)}}a(cYa,"getSimilarFilesOptions");var lYa=new Map([["cpp",ADi.getCppNumberOfSnippets]]);function uYa(t,e){let r=lYa.get(e);return r?r(t):iYa.DEFAULT_NUM_SNIPPETS}a(uYa,"getNumberOfSnippets");function yDi(t,e){return(e.filtersAndExp.exp.variables[sYa.ExpTreatmentVariables.UseSubsetMatching]||(0,gDi.getConfig)(t,gDi.ConfigKey.UseSubsetMatching))??!1}a(yDi,"useSubsetMatching")});var U4e=I(Vre=>{"use strict";p();Object.defineProperty(Vre,"__esModule",{value:!0});Vre.convertToAPIChoice=hYa;Vre.getTemperatureForSamples=AYa;Vre.getStops=EYa;Vre.getTopP=_Ya;Vre.getMaxSolutionTokens=vYa;var dYa=I0(),fYa=t$(),EDi=Nl(),pYa=Vg();function hYa(t,e,r,n,o,s,c){return(0,pYa.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:mYa(t,r),meanAlternativeLogProb:gYa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,dYa.generateUuid)(),finishReason:r.finish_reason}}a(hYa,"convertToAPIChoice");function mYa(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){EDi.logger.exception(t,r,"Error calculating mean prob")}}a(mYa,"calculateMeanLogProb");function gYa(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){EDi.logger.exception(t,r,"Error calculating mean prob")}}a(gYa,"calculateMeanAlternativeLogProb");function AYa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(AYa,"getTemperatureForSamples");var yYa={markdown:[` `],python:[` @@ -986,31 +986,31 @@ def `,` class `,` if `,` -#`]};function nYa(t){return rYa[t??""]??[` +#`]};function EYa(t){return yYa[t??""]??[` -`,"\n```"]}a(nYa,"getStops");function iYa(){return 1}a(iYa,"getTopP");function oYa(){return Kza.DEFAULT_MAX_COMPLETION_LENGTH}a(oYa,"getMaxSolutionTokens")});var rL=I(O4e=>{"use strict";p();Object.defineProperty(O4e,"__esModule",{value:!0});O4e.Fragment=pDi;O4e.jsx=fDi;O4e.jsxs=fDi;function fDi(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(fDi,"functionComponentFunction");function pDi(t){return{type:"f",children:t}}a(pDi,"fragmentFunction");pDi.isFragmentFunction=!0});var MD=I(NIr=>{"use strict";p();Object.defineProperty(NIr,"__esModule",{value:!0});NIr.es5ClassCompat=sYa;function sYa(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(sYa,"es5ClassCompat")});var kAe=I(Wre=>{"use strict";p();var aYa=Wre&&Wre.__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},Vre;Object.defineProperty(Wre,"__esModule",{value:!0});Wre.Position=void 0;var Cyt=Rs(),cYa=MD(),MIr=Vre=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,Cyt.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 Vre(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,Cyt.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 Vre(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Wre.Position=MIr;Wre.Position=MIr=Vre=aYa([cYa.es5ClassCompat],MIr)});var nL=I(u$=>{"use strict";p();var lYa=u$&&u$.__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},T6;Object.defineProperty(u$,"__esModule",{value:!0});u$.Range=void 0;u$.getDebugDescriptionOfRange=hDi;var uYa=Rs(),dYa=MD(),Ov=kAe(),OIr=T6=class{static{a(this,"Range")}static isRange(e){return e instanceof T6?!0:!e||typeof e!="object"?!1:Ov.Position.isPosition(e.start)&&Ov.Position.isPosition(e.end)}static of(e){if(e instanceof T6)return e;if(this.isRange(e))return new T6(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 Ov.Position(e,r),c=new Ov.Position(n,o)):Ov.Position.isPosition(e)&&Ov.Position.isPosition(r)&&(s=Ov.Position.of(e),c=Ov.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 T6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ov.Position.isPosition(e)?!(Ov.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=Ov.Position.Max(e.start,this._start),n=Ov.Position.Min(e.end,this._end);if(!r.isAfter(n))return new T6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Ov.Position.Min(e.start,this._start),n=Ov.Position.Max(e.end,this.end);return new T6(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,uYa.illegalArgument)();let n;return e?Ov.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 T6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return hDi(this)}};u$.Range=OIr;u$.Range=OIr=T6=lYa([dYa.es5ClassCompat],OIr);function hDi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(hDi,"getDebugDescriptionOfRange")});var BIr=I(c1=>{"use strict";p();var ADi=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};Object.defineProperty(c1,"__esModule",{value:!0});c1.Diagnostic=c1.DiagnosticRelatedInformation=c1.DiagnosticSeverity=c1.DiagnosticTag=void 0;var mDi=Sl(),fYa=nd(),yDi=MD(),EDi=nL(),gDi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(gDi||(c1.DiagnosticTag=gDi={}));var byt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(byt||(c1.DiagnosticSeverity=byt={}));var Syt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&EDi.Range.isRange(e.location.range)&&fYa.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()}};c1.DiagnosticRelatedInformation=Syt;c1.DiagnosticRelatedInformation=Syt=ADi([yDi.es5ClassCompat],Syt);var LIr=class{static{a(this,"Diagnostic")}constructor(e,r,n=byt.Error){if(!EDi.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:byt[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,mDi.equals)(e.tags,r.tags)&&(0,mDi.equals)(e.relatedInformation,r.relatedInformation,Syt.isEqual)}};c1.Diagnostic=LIr;c1.Diagnostic=LIr=ADi([yDi.es5ClassCompat],LIr)});var QIr=I(zre=>{"use strict";p();var pYa=zre&&zre.__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},FIr;Object.defineProperty(zre,"__esModule",{value:!0});zre.Location=void 0;var hYa=nd(),mYa=MD(),gYa=kAe(),Tyt=nL(),UIr=FIr=class{static{a(this,"Location")}static isLocation(e){return e instanceof FIr?!0:e?Tyt.Range.isRange(e.range)&&hYa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Tyt.Range.isRange(r))this.range=Tyt.Range.of(r);else if(gYa.Position.isPosition(r))this.range=new Tyt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};zre.Location=UIr;zre.Location=UIr=FIr=pYa([mYa.es5ClassCompat],UIr)});var _Di=I(GIr=>{"use strict";p();Object.defineProperty(GIr,"__esModule",{value:!0});GIr.getKoreanAltChars=AYa;function AYa(t){let e=yYa(t);if(e&&e.length>0)return new Uint32Array(e)}a(AYa,"getKoreanAltChars");var l1=0,d$=new Uint32Array(10);function yYa(t){if(l1=0,iL(t,qIr,4352),l1>0||(iL(t,jIr,4449),l1>0)||(iL(t,HIr,4520),l1>0)||(iL(t,Yre,12593),l1))return d$.subarray(0,l1);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 d$.subarray(0,l1)}}a(yYa,"disassembleKorean");function iL(t,e,r){t>=r&&t>8&&(d$[l1++]=t>>8&255),t>>16&&(d$[l1++]=t>>16&255))}a(EYa,"addCodesToBuffer");var qIr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),jIr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),HIr=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]),Yre=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 bDi=I(PAe=>{"use strict";p();Object.defineProperty(PAe,"__esModule",{value:!0});PAe.tryNormalizeToBase=void 0;PAe.normalizeNFC=vYa;PAe.normalizeNFD=vDi;var $Ir=zP(),_Ya=new $Ir.LRUCache(1e4);function vYa(t){return CDi(t,"NFC",_Ya)}a(vYa,"normalizeNFC");var CYa=new $Ir.LRUCache(1e4);function vDi(t){return CDi(t,"NFD",CYa)}a(vDi,"normalizeNFD");var bYa=/[^\u0000-\u0080]/;function CDi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return bYa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(CDi,"normalize");PAe.tryNormalizeToBase=(function(){let t=new $Ir.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=vDi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var HDi=I(dc=>{"use strict";p();var SYa=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]})),TYa=dc&&dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IYa=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;o0?[{start:0,end:e.length}]:[]:null}a(kDi,"_matchesPrefix");function PDi(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(PDi,"matchesContiguousSubString");function RYa(t,e){if(t.length>e.length)return null;t=(0,wyt.tryNormalizeToBase)(t),e=(0,wyt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(RYa,"matchesBaseContiguousSubString");function DDi(t,e){return t.length>e.length?null:zIr(t.toLowerCase(),e.toLowerCase(),0,0)}a(DDi,"matchesSubString");function zIr(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=zIr(t,e,r+1,n+1))?rxr({start:n,end:n+1},o):null}return zIr(t,e,r,n+1)}a(zIr,"_matchesSubString");function exr(t){return 97<=t&&t<=122}a(exr,"isLower");function F4e(t){return 65<=t&&t<=90}a(F4e,"isUpper");function txr(t){return 48<=t&&t<=57}a(txr,"isNumber");function NDi(t){return t===32||t===9||t===10||t===13}a(NDi,"isWhitespace");var MDi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>MDi.add(t.charCodeAt(0)));function Ryt(t){return NDi(t)||MDi.has(t)}a(Ryt,"isWordSeparator");function SDi(t,e){return t===e||Ryt(t)&&Ryt(e)}a(SDi,"charactersMatch");var VIr=new Map;function TDi(t){if(VIr.has(t))return VIr.get(t);let e,r=(0,wYa.getKoreanAltChars)(t);return r&&(e=r),VIr.set(t,e),e}a(TDi,"getAlternateCodes");function ODi(t){return exr(t)||F4e(t)||txr(t)}a(ODi,"isAlphanumeric");function rxr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(rxr,"join");function LDi(t,e){for(let r=e;r0&&!ODi(t.charCodeAt(r-1)))return r}return t.length}a(LDi,"nextAnchor");function YIr(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=YIr(t,e,r+1,n+1);!o&&(s=LDi(e,s)).6}a(PYa,"isUpperCaseWord");function DYa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(DYa,"isCamelCaseWord");function NYa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=kYa(e);if(!DYa(r)){if(!PYa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&Ryt(t.charCodeAt(r-1)))return r;return t.length}a(BDi,"nextWord");var LYa=XIr(dc.matchesPrefix,nxr,PDi),BYa=XIr(dc.matchesPrefix,nxr,DDi),xDi=new xYa.LRUCache(1e4);function FYa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=xDi.get(t);n||(n=new RegExp(ZIr.convertSimple2RegExpPattern(t),"i"),xDi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?BYa(t,e):LYa(t,e)}a(FYa,"matchesFuzzy");function UYa(t,e){let r=B4e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?FDi(r):null}a(UYa,"matchesFuzzy2");function QYa(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(FDi,"createMatches");var p$=128;function ixr(){let t=[],e=[];for(let r=0;r<=p$;r++)e[r]=0;for(let r=0;r<=p$;r++)t.push(e.slice(0));return t}a(ixr,"initTable");function UDi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(UDi,"initArr");var QDi=UDi(2*p$),JIr=UDi(2*p$),oL=ixr(),f$=ixr(),L4e=ixr(),qYa=!1;function WIr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\n```"]}a(EYa,"getStops");function _Ya(){return 1}a(_Ya,"getTopP");function vYa(){return fYa.DEFAULT_MAX_COMPLETION_LENGTH}a(vYa,"getMaxSolutionTokens")});var nL=I(Q4e=>{"use strict";p();Object.defineProperty(Q4e,"__esModule",{value:!0});Q4e.Fragment=vDi;Q4e.jsx=_Di;Q4e.jsxs=_Di;function _Di(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(_Di,"functionComponentFunction");function vDi(t){return{type:"f",children:t}}a(vDi,"fragmentFunction");vDi.isFragmentFunction=!0});var BD=I(BIr=>{"use strict";p();Object.defineProperty(BIr,"__esModule",{value:!0});BIr.es5ClassCompat=CYa;function CYa(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(CYa,"es5ClassCompat")});var DAe=I(zre=>{"use strict";p();var bYa=zre&&zre.__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},Wre;Object.defineProperty(zre,"__esModule",{value:!0});zre.Position=void 0;var Iyt=Rs(),SYa=BD(),FIr=Wre=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,Iyt.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 Wre(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,Iyt.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 Wre(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};zre.Position=FIr;zre.Position=FIr=Wre=bYa([SYa.es5ClassCompat],FIr)});var iL=I(h$=>{"use strict";p();var TYa=h$&&h$.__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},x6;Object.defineProperty(h$,"__esModule",{value:!0});h$.Range=void 0;h$.getDebugDescriptionOfRange=CDi;var IYa=Rs(),xYa=BD(),Bv=DAe(),UIr=x6=class{static{a(this,"Range")}static isRange(e){return e instanceof x6?!0:!e||typeof e!="object"?!1:Bv.Position.isPosition(e.start)&&Bv.Position.isPosition(e.end)}static of(e){if(e instanceof x6)return e;if(this.isRange(e))return new x6(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 Bv.Position(e,r),c=new Bv.Position(n,o)):Bv.Position.isPosition(e)&&Bv.Position.isPosition(r)&&(s=Bv.Position.of(e),c=Bv.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 x6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Bv.Position.isPosition(e)?!(Bv.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=Bv.Position.Max(e.start,this._start),n=Bv.Position.Min(e.end,this._end);if(!r.isAfter(n))return new x6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Bv.Position.Min(e.start,this._start),n=Bv.Position.Max(e.end,this.end);return new x6(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,IYa.illegalArgument)();let n;return e?Bv.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 x6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return CDi(this)}};h$.Range=UIr;h$.Range=UIr=x6=TYa([xYa.es5ClassCompat],UIr);function CDi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(CDi,"getDebugDescriptionOfRange")});var qIr=I(c1=>{"use strict";p();var TDi=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};Object.defineProperty(c1,"__esModule",{value:!0});c1.Diagnostic=c1.DiagnosticRelatedInformation=c1.DiagnosticSeverity=c1.DiagnosticTag=void 0;var bDi=Tl(),wYa=id(),IDi=BD(),xDi=iL(),SDi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(SDi||(c1.DiagnosticTag=SDi={}));var xyt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(xyt||(c1.DiagnosticSeverity=xyt={}));var wyt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&xDi.Range.isRange(e.location.range)&&wYa.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()}};c1.DiagnosticRelatedInformation=wyt;c1.DiagnosticRelatedInformation=wyt=TDi([IDi.es5ClassCompat],wyt);var QIr=class{static{a(this,"Diagnostic")}constructor(e,r,n=xyt.Error){if(!xDi.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:xyt[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,bDi.equals)(e.tags,r.tags)&&(0,bDi.equals)(e.relatedInformation,r.relatedInformation,wyt.isEqual)}};c1.Diagnostic=QIr;c1.Diagnostic=QIr=TDi([IDi.es5ClassCompat],QIr)});var GIr=I(Yre=>{"use strict";p();var RYa=Yre&&Yre.__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},jIr;Object.defineProperty(Yre,"__esModule",{value:!0});Yre.Location=void 0;var kYa=id(),PYa=BD(),DYa=DAe(),Ryt=iL(),HIr=jIr=class{static{a(this,"Location")}static isLocation(e){return e instanceof jIr?!0:e?Ryt.Range.isRange(e.range)&&kYa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Ryt.Range.isRange(r))this.range=Ryt.Range.of(r);else if(DYa.Position.isPosition(r))this.range=new Ryt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Yre.Location=HIr;Yre.Location=HIr=jIr=RYa([PYa.es5ClassCompat],HIr)});var wDi=I(zIr=>{"use strict";p();Object.defineProperty(zIr,"__esModule",{value:!0});zIr.getKoreanAltChars=NYa;function NYa(t){let e=MYa(t);if(e&&e.length>0)return new Uint32Array(e)}a(NYa,"getKoreanAltChars");var l1=0,m$=new Uint32Array(10);function MYa(t){if(l1=0,oL(t,$Ir,4352),l1>0||(oL(t,VIr,4449),l1>0)||(oL(t,WIr,4520),l1>0)||(oL(t,Kre,12593),l1))return m$.subarray(0,l1);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<$Ir.length?oL(n,$Ir,0):4352+n-12593=0&&(s0)return m$.subarray(0,l1)}}a(MYa,"disassembleKorean");function oL(t,e,r){t>=r&&t>8&&(m$[l1++]=t>>8&255),t>>16&&(m$[l1++]=t>>16&255))}a(OYa,"addCodesToBuffer");var $Ir=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),VIr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),WIr=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]),Kre=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 PDi=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.tryNormalizeToBase=void 0;NAe.normalizeNFC=BYa;NAe.normalizeNFD=RDi;var YIr=KP(),LYa=new YIr.LRUCache(1e4);function BYa(t){return kDi(t,"NFC",LYa)}a(BYa,"normalizeNFC");var FYa=new YIr.LRUCache(1e4);function RDi(t){return kDi(t,"NFD",FYa)}a(RDi,"normalizeNFD");var UYa=/[^\u0000-\u0080]/;function kDi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return UYa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(kDi,"normalize");NAe.tryNormalizeToBase=(function(){let t=new YIr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=RDi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var JDi=I(dc=>{"use strict";p();var QYa=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]})),qYa=dc&&dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jYa=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;o0?[{start:0,end:e.length}]:[]:null}a(FDi,"_matchesPrefix");function UDi(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(UDi,"matchesContiguousSubString");function $Ya(t,e){if(t.length>e.length)return null;t=(0,Dyt.tryNormalizeToBase)(t),e=(0,Dyt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a($Ya,"matchesBaseContiguousSubString");function QDi(t,e){return t.length>e.length?null:ZIr(t.toLowerCase(),e.toLowerCase(),0,0)}a(QDi,"matchesSubString");function ZIr(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=ZIr(t,e,r+1,n+1))?sxr({start:n,end:n+1},o):null}return ZIr(t,e,r,n+1)}a(ZIr,"_matchesSubString");function ixr(t){return 97<=t&&t<=122}a(ixr,"isLower");function H4e(t){return 65<=t&&t<=90}a(H4e,"isUpper");function oxr(t){return 48<=t&&t<=57}a(oxr,"isNumber");function qDi(t){return t===32||t===9||t===10||t===13}a(qDi,"isWhitespace");var jDi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>jDi.add(t.charCodeAt(0)));function Nyt(t){return qDi(t)||jDi.has(t)}a(Nyt,"isWordSeparator");function DDi(t,e){return t===e||Nyt(t)&&Nyt(e)}a(DDi,"charactersMatch");var KIr=new Map;function NDi(t){if(KIr.has(t))return KIr.get(t);let e,r=(0,GYa.getKoreanAltChars)(t);return r&&(e=r),KIr.set(t,e),e}a(NDi,"getAlternateCodes");function HDi(t){return ixr(t)||H4e(t)||oxr(t)}a(HDi,"isAlphanumeric");function sxr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(sxr,"join");function GDi(t,e){for(let r=e;r0&&!HDi(t.charCodeAt(r-1)))return r}return t.length}a(GDi,"nextAnchor");function XIr(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=XIr(t,e,r+1,n+1);!o&&(s=GDi(e,s)).6}a(WYa,"isUpperCaseWord");function zYa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(zYa,"isCamelCaseWord");function YYa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=VYa(e);if(!zYa(r)){if(!WYa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&Nyt(t.charCodeAt(r-1)))return r;return t.length}a($Di,"nextWord");var ZYa=nxr(dc.matchesPrefix,axr,UDi),XYa=nxr(dc.matchesPrefix,axr,QDi),ODi=new HYa.LRUCache(1e4);function eKa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=ODi.get(t);n||(n=new RegExp(rxr.convertSimple2RegExpPattern(t),"i"),ODi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?XYa(t,e):ZYa(t,e)}a(eKa,"matchesFuzzy");function tKa(t,e){let r=j4e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?VDi(r):null}a(tKa,"matchesFuzzy2");function rKa(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(VDi,"createMatches");var A$=128;function cxr(){let t=[],e=[];for(let r=0;r<=A$;r++)e[r]=0;for(let r=0;r<=A$;r++)t.push(e.slice(0));return t}a(cxr,"initTable");function WDi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(WDi,"initArr");var zDi=WDi(2*A$),txr=WDi(2*A$),sL=cxr(),g$=cxr(),q4e=cxr(),nKa=!1;function JIr(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(WIr,"printTable");function jYa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(WIr(f$,t,t.length,r,r.length)),console.log(WIr(L4e,t,t.length,r,r.length)),console.log(WIr(oL,t,t.length,r,r.length))}a(jYa,"printTables");function Iyt(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!!ZIr.isEmojiImprecise(r)}}a(Iyt,"isSeparatorAtPos");function wDi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(wDi,"isWhitespaceAtPos");function xyt(t,e,r){return e[t]!==r[t]}a(xyt,"isUpperCaseAtPos");function qDi(t,e,r,n,o,s,c=!1){for(;ep$?p$:t.length,u=n.length>p$?p$:n.length;if(r>=l||s>=u||l-r>u-s||!qDi(e,r,l,o,s,u,!0))return;HYa(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?f$[d][f-1]+(oL[d][f-1]>0?-5:0):0,N=m>v+1&&oL[d][f-1]>0,L=N?f$[d][f-2]+(oL[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))f$[d][f]=L,L4e[d][f]=3,oL[d][f]=0;else if(P&&(!R||D>=x))f$[d][f]=D,L4e[d][f]=2,oL[d][f]=0;else if(R)f$[d][f]=x,L4e[d][f]=1,oL[d][f]=oL[d-1][f-1]+1;else throw new Error("not possible")}}if(qYa&&jYa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[f$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=L4e[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]&&!xyt(v+s-1,n,o)&&y+1>oL[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(B4e,"fuzzyScore");function HYa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(JIr[c]=l,c--),l--}a(HYa,"_fillInMaxWordMatchPos");function GYa(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:xyt(c,o,s)&&(c===0||!xyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):Iyt(s,c)&&(c===0||!Iyt(s,c-1))?h=5:(Iyt(s,c-1)||wDi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=xyt(c,o,s)||Iyt(s,c-1)||wDi(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(GYa,"_doScore");function $Ya(t,e,r,n,o,s,c){return jDi(t,e,r,n,o,s,!0,c)}a($Ya,"fuzzyScoreGracefulAggressive");function VYa(t,e,r,n,o,s,c){return jDi(t,e,r,n,o,s,!1,c)}a(VYa,"fuzzyScoreGraceful");function jDi(t,e,r,n,o,s,c,l){let u=B4e(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(jDi,"fuzzyScoreWithPermutations");function WYa(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(WYa,"nextTypoPermutation")});var $Di=I(h$=>{"use strict";p();Object.defineProperty(h$,"__esModule",{value:!0});h$.escapeIcons=JYa;h$.markdownEscapeEscapedIcons=XYa;h$.stripIcons=tKa;h$.getCodiconAriaLabel=rKa;h$.parseLabelWithIcons=nKa;h$.matchesFuzzyIconAware=iKa;var GDi=HDi(),zYa=em(),sxr=R0r(),YYa="$(",axr=new RegExp(`\\$\\(${sxr.ThemeIcon.iconNameExpression}(?:${sxr.ThemeIcon.iconModifierExpression})?\\)`,"g"),KYa=new RegExp(`(\\\\)?${axr.source}`,"g");function JYa(t){return t.replace(KYa,(e,r)=>r?e:`\\${e}`)}a(JYa,"escapeIcons");var ZYa=new RegExp(`\\\\${axr.source}`,"g");function XYa(t){return t.replace(ZYa,e=>`\\${e}`)}a(XYa,"markdownEscapeEscapedIcons");var eKa=new RegExp(`(\\s)?(\\\\)?${axr.source}(\\s)?`,"g");function tKa(t){return t.indexOf(YYa)===-1?t:t.replace(eKa,(e,r,n,o)=>n?e:r||o||"")}a(tKa,"stripIcons");function rKa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(rKa,"getCodiconAriaLabel");var oxr=new RegExp(`\\$\\(${sxr.ThemeIcon.iconNameCharacter}+\\)`,"g");function nKa(t){oxr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=oxr.lastIndex,s=oxr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.MarkdownString=void 0;Ay.isEmptyMarkdownString=VDi;Ay.isMarkdownString=WDi;Ay.markdownStringEqual=uKa;Ay.escapeMarkdownSyntaxTokens=Nyt;Ay.escapeMarkdownLinkLabel=dKa;Ay.appendEscapedMarkdownCodeBlockFence=zDi;Ay.appendEscapedMarkdownInlineCode=fKa;Ay.escapeDoubleQuotes=pKa;Ay.removeMarkdownEscapes=hKa;Ay.parseHrefAndDimensions=mKa;Ay.createMarkdownLink=YDi;Ay.createMarkdownCommandLink=gKa;Ay.createCommandUri=KDi;var oKa=Rs(),sKa=$Di(),aKa=tJ(),cKa=ZP(),lKa=em(),Pyt=nd(),Dyt=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?Pyt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,oKa.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+=Nyt(this.supportThemeIcons?(0,sKa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;return c}a(JIr,"printTable");function iKa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(JIr(g$,t,t.length,r,r.length)),console.log(JIr(q4e,t,t.length,r,r.length)),console.log(JIr(sL,t,t.length,r,r.length))}a(iKa,"printTables");function kyt(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!!rxr.isEmojiImprecise(r)}}a(kyt,"isSeparatorAtPos");function LDi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(LDi,"isWhitespaceAtPos");function Pyt(t,e,r){return e[t]!==r[t]}a(Pyt,"isUpperCaseAtPos");function YDi(t,e,r,n,o,s,c=!1){for(;eA$?A$:t.length,u=n.length>A$?A$:n.length;if(r>=l||s>=u||l-r>u-s||!YDi(e,r,l,o,s,u,!0))return;oKa(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?g$[d][f-1]+(sL[d][f-1]>0?-5:0):0,N=m>v+1&&sL[d][f-1]>0,L=N?g$[d][f-2]+(sL[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))g$[d][f]=L,q4e[d][f]=3,sL[d][f]=0;else if(P&&(!R||D>=x))g$[d][f]=D,q4e[d][f]=2,sL[d][f]=0;else if(R)g$[d][f]=x,q4e[d][f]=1,sL[d][f]=sL[d-1][f-1]+1;else throw new Error("not possible")}}if(nKa&&iKa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[g$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=q4e[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]&&!Pyt(v+s-1,n,o)&&y+1>sL[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(j4e,"fuzzyScore");function oKa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(txr[c]=l,c--),l--}a(oKa,"_fillInMaxWordMatchPos");function sKa(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:Pyt(c,o,s)&&(c===0||!Pyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):kyt(s,c)&&(c===0||!kyt(s,c-1))?h=5:(kyt(s,c-1)||LDi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=Pyt(c,o,s)||kyt(s,c-1)||LDi(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(sKa,"_doScore");function aKa(t,e,r,n,o,s,c){return KDi(t,e,r,n,o,s,!0,c)}a(aKa,"fuzzyScoreGracefulAggressive");function cKa(t,e,r,n,o,s,c){return KDi(t,e,r,n,o,s,!1,c)}a(cKa,"fuzzyScoreGraceful");function KDi(t,e,r,n,o,s,c,l){let u=j4e(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(KDi,"fuzzyScoreWithPermutations");function lKa(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(lKa,"nextTypoPermutation")});var XDi=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.escapeIcons=pKa;y$.markdownEscapeEscapedIcons=mKa;y$.stripIcons=AKa;y$.getCodiconAriaLabel=yKa;y$.parseLabelWithIcons=EKa;y$.matchesFuzzyIconAware=_Ka;var ZDi=JDi(),uKa=rm(),uxr=N0r(),dKa="$(",dxr=new RegExp(`\\$\\(${uxr.ThemeIcon.iconNameExpression}(?:${uxr.ThemeIcon.iconModifierExpression})?\\)`,"g"),fKa=new RegExp(`(\\\\)?${dxr.source}`,"g");function pKa(t){return t.replace(fKa,(e,r)=>r?e:`\\${e}`)}a(pKa,"escapeIcons");var hKa=new RegExp(`\\\\${dxr.source}`,"g");function mKa(t){return t.replace(hKa,e=>`\\${e}`)}a(mKa,"markdownEscapeEscapedIcons");var gKa=new RegExp(`(\\s)?(\\\\)?${dxr.source}(\\s)?`,"g");function AKa(t){return t.indexOf(dKa)===-1?t:t.replace(gKa,(e,r,n,o)=>n?e:r||o||"")}a(AKa,"stripIcons");function yKa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(yKa,"getCodiconAriaLabel");var lxr=new RegExp(`\\$\\(${uxr.ThemeIcon.iconNameCharacter}+\\)`,"g");function EKa(t){lxr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=lxr.lastIndex,s=lxr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(yy,"__esModule",{value:!0});yy.MarkdownString=void 0;yy.isEmptyMarkdownString=eNi;yy.isMarkdownString=tNi;yy.markdownStringEqual=IKa;yy.escapeMarkdownSyntaxTokens=Byt;yy.escapeMarkdownLinkLabel=xKa;yy.appendEscapedMarkdownCodeBlockFence=rNi;yy.appendEscapedMarkdownInlineCode=wKa;yy.escapeDoubleQuotes=RKa;yy.removeMarkdownEscapes=kKa;yy.parseHrefAndDimensions=PKa;yy.createMarkdownLink=nNi;yy.createMarkdownCommandLink=DKa;yy.createCommandUri=iNi;var vKa=Rs(),CKa=XDi(),bKa=nJ(),SKa=e2(),TKa=rm(),Oyt=id(),Lyt=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?Oyt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,vKa.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+=Byt(this.supportThemeIcons?(0,CKa.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+=` -${zDi(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,lKa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};Ay.MarkdownString=Dyt;function VDi(t){return WDi(t)?!t.value:Array.isArray(t)?t.every(VDi):!0}a(VDi,"isEmptyMarkdownString");function WDi(t){return t instanceof Dyt?!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(WDi,"isMarkdownString");function uKa(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,cKa.isEqual)(Pyt.URI.from(t.baseUri),Pyt.URI.from(e.baseUri)))}a(uKa,"markdownStringEqual");function Nyt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Nyt,"escapeMarkdownSyntaxTokens");function dKa(t){return t.replace(/[\\\]]/g,"\\$&")}a(dKa,"escapeMarkdownLinkLabel");function zDi(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(zDi,"appendEscapedMarkdownCodeBlockFence");function fKa(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(fKa,"appendEscapedMarkdownInlineCode");function pKa(t){return t.replace(/"/g,""")}a(pKa,"escapeDoubleQuotes");function hKa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(hKa,"removeMarkdownEscapes");function mKa(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(mKa,"parseHrefAndDimensions");function YDi(t,e,r,n=!0){return`[${n?Nyt(t):t}](${e}${r?` "${Nyt(r)}"`:""})`}a(YDi,"createMarkdownLink");function gKa(t,e=!0){let r=KDi(t.id,...t.arguments||[]).toString();return YDi(t.text,r,t.tooltip,e)}a(gKa,"createMarkdownCommandLink");function KDi(t,...e){return Pyt.URI.from({scheme:aKa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(KDi,"createCommandUri")});var uxr=I(Kre=>{"use strict";p();var AKa=Kre&&Kre.__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},cxr;Object.defineProperty(Kre,"__esModule",{value:!0});Kre.MarkdownString=void 0;var yKa=JDi(),EKa=MD(),lxr=cxr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof cxr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new yKa.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}};Kre.MarkdownString=lxr;Kre.MarkdownString=lxr=cxr=AKa([EKa.es5ClassCompat],lxr)});var eNi=I(I6=>{"use strict";p();Object.defineProperty(I6,"__esModule",{value:!0});I6.Mimes=void 0;I6.getMediaOrTextMime=vKa;I6.getMediaMime=XDi;I6.getExtensionForMimeType=CKa;I6.normalizeMimeType=SKa;I6.isTextStreamMime=TKa;var ZDi=NA();I6.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 _Ka={".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"},dxr={".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 vKa(t){let e=(0,ZDi.extname)(t),r=_Ka[e.toLowerCase()];return r!==void 0?r:XDi(t)}a(vKa,"getMediaOrTextMime");function XDi(t){let e=(0,ZDi.extname)(t),r=dxr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(XDi,"getMediaMime");function CKa(t){for(let e in dxr){let r=dxr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(CKa,"getExtensionForMimeType");var bKa=/^(.+)\/(.+?)(;.+)?$/;function SKa(t,e){let r=bKa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(SKa,"normalizeMimeType");function TKa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(TKa,"isTextStreamMime")});var nNi=I(k0=>{"use strict";p();var IKa=k0&&k0.__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},m$;Object.defineProperty(k0,"__esModule",{value:!0});k0.NotebookCellOutput=k0.NotebookCellOutputItem=k0.NotebookEdit=k0.NotebookData=k0.NotebookCellData=k0.NotebookRange=k0.NotebookCellKind=void 0;var xKa=MD(),tNi=Rs(),Myt=eNi(),wKa=T0(),rNi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(rNi||(k0.NotebookCellKind=rNi={}));var Jre=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,tNi.illegalArgument)("start must be positive");if(r<0)throw(0,tNi.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)}};k0.NotebookRange=Jre;var fxr=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)}};k0.NotebookCellData=fxr;var pxr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};k0.NotebookData=pxr;var hxr=m$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof m$?!0:e?Jre.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new m$(e,r)}static insertCells(e,r){return new m$(new Jre(e,e),r)}static deleteCells(e){return new m$(e,[])}static updateCellMetadata(e,r){let n=new m$(new Jre(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new m$(new Jre(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};k0.NotebookEdit=hxr;k0.NotebookEdit=hxr=m$=IKa([xKa.es5ClassCompat],hxr);var mxr=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=Myt.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,Myt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};k0.NotebookCellOutputItem=mxr;var gxr=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,wKa.generateUuid)(),this.metadata=r??n)}};k0.NotebookCellOutput=gxr});var oNi=I(A$=>{"use strict";p();var RKa=A$&&A$.__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},Axr;Object.defineProperty(A$,"__esModule",{value:!0});A$.Selection=void 0;A$.getDebugDescriptionOfSelection=iNi;var kKa=MD(),g$=kAe(),yxr=nL(),Exr=Axr=class extends yxr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof Axr?!0:!e||typeof e!="object"?!1:yxr.Range.isRange(e)&&g$.Position.isPosition(e.anchor)&&g$.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 g$.Position(e,r),c=new g$.Position(n,o)):g$.Position.isPosition(e)&&g$.Position.isPosition(r)&&(s=g$.Position.of(e),c=g$.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 iNi(this)}};A$.Selection=Exr;A$.Selection=Exr=Axr=RKa([kKa.es5ClassCompat],Exr);function iNi(t){let e=(0,yxr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(iNi,"getDebugDescriptionOfSelection")});var vxr=I(Xre=>{"use strict";p();var PKa=Xre&&Xre.__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},Zre;Object.defineProperty(Xre,"__esModule",{value:!0});Xre.SnippetString=void 0;var DKa=MD(),_xr=Zre=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Zre?!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+=Zre._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 Zre;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Zre._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 Zre;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}};Xre.SnippetString=_xr;Xre.SnippetString=_xr=Zre=PKa([DKa.es5ClassCompat],_xr)});var bxr=I(Oyt=>{"use strict";p();Object.defineProperty(Oyt,"__esModule",{value:!0});Oyt.SnippetTextEdit=void 0;var NKa=vxr(),sNi=nL(),Cxr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?sNi.Range.isRange(e.range)&&NKa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new sNi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};Oyt.SnippetTextEdit=Cxr});var lNi=I(OD=>{"use strict";p();var MKa=OD&&OD.__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},Sxr;Object.defineProperty(OD,"__esModule",{value:!0});OD.SymbolInformation=OD.SymbolTag=OD.SymbolKind=void 0;var OKa=MD(),aNi=QIr(),LKa=nL(),Txr;(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"})(Txr||(OD.SymbolKind=Txr={}));var cNi;(function(t){t[t.Deprecated=1]="Deprecated"})(cNi||(OD.SymbolTag=cNi={}));var Ixr=Sxr=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 aNi.Location?this.location=o:n instanceof LKa.Range&&(this.location=new aNi.Location(o,n)),Sxr.validate(this)}toJSON(){return{name:this.name,kind:Txr[this.kind],location:this.location,containerName:this.containerName}}};OD.SymbolInformation=Ixr;OD.SymbolInformation=Ixr=Sxr=MKa([OKa.es5ClassCompat],Ixr)});var Rxr=I(x6=>{"use strict";p();var BKa=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},ene;Object.defineProperty(x6,"__esModule",{value:!0});x6.TextEdit=x6.EndOfLine=void 0;var xxr=Rs(),FKa=MD(),uNi=kAe(),Lyt=nL(),dNi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(dNi||(x6.EndOfLine=dNi={}));var wxr=ene=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof ene?!0:!e||typeof e!="object"?!1:Lyt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new ene(e,r)}static insert(e,r){return ene.replace(new Lyt.Range(e,e),r)}static delete(e){return ene.replace(e,"")}static setEndOfLine(e){let r=new ene(new Lyt.Range(new uNi.Position(0,0),new uNi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Lyt.Range.isRange(e))throw(0,xxr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,xxr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,xxr.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}}};x6.TextEdit=wxr;x6.TextEdit=wxr=ene=BKa([FKa.es5ClassCompat],wxr)});var bNi=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 fNi=e$(),Qyt=uxr(),kxr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=kxr;var Pxr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=Pxr;var Dxr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=Dxr;var Nxr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=Nxr;var Mxr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=Mxr;var Oxr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=Oxr;var Lxr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=Lxr;var Bxr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=Bxr;var Fxr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=Fxr;var Uxr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseWarningPart=Uxr;var Qxr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseInfoPart=Qxr;var qxr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=qxr;var jxr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=jxr;var Hxr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=Hxr;var Gxr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=Gxr;var $xr=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=$xr;var Vxr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=Vxr;var Wxr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=Wxr;var zxr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=zxr;var Yxr=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=Yxr;var Kxr=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=Kxr;var Jxr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=Jxr;var Zxr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=Zxr;var pNi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(pNi||(xt.ChatQuestionType=pNi={}));var Xxr=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=Xxr;var ewr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=ewr;var twr=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=twr;var rwr=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=rwr;var nwr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=nwr;var iwr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=iwr;var owr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=owr;var swr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=swr;var awr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=awr;var cwr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=cwr;var lwr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=lwr;var Byt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=Byt;var hNi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(hNi||(xt.LanguageModelPartAudience=hNi={}));var uwr=class extends Byt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=uwr;var dwr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=dwr;var Fyt=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(fNi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(fNi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=Fyt;var fwr=class extends Fyt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=fwr;var mNi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(mNi||(xt.ChatImageMimeType=mNi={}));var pwr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=pwr;var gNi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(gNi||(xt.ExcludeSettingOptions=gNi={}));var hwr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=hwr;var mwr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=mwr;var ANi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(ANi||(xt.ChatErrorLevel=ANi={}));var yNi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(yNi||(xt.ChatInputNotificationSeverity=yNi={}));var ENi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(ENi||(xt.ChatRequestEditedFileEventKind=ENi={}));var _Ni;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(_Ni||(xt.ChatResponseClearToPreviousToolInvocationReason=_Ni={}));var gwr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=gwr;var Awr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=Awr;var ywr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=ywr;var Ewr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=Ewr;var _wr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=_wr;var Uyt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Uyt||(xt.LanguageModelChatMessageRole=Uyt={}));var vNi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(vNi||(xt.LanguageModelChatToolMode=vNi={}));var vwr=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(Uyt.User,e,r)}static Assistant(e,r){return new t(Uyt.Assistant,e,r)}};xt.LanguageModelChatMessage=vwr;var Cwr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=Cwr;var bwr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=bwr;var Swr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=Swr;var Twr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=Twr;var CNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(CNi||(xt.ChatSessionStatus=CNi={}));var Iwr=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=Iwr;var xwr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=xwr;var wwr=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=wwr;var Rwr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=Rwr});var INi=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.TextDocumentChangeReason=y$.TextEditorSelectionChangeKind=y$.WorkspaceEdit=void 0;var UKa=Sl(),QKa=zP(),qKa=nL(),jKa=bxr(),HKa=Rxr(),kwr=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 HKa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new qKa.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,jKa.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(xp,"__esModule",{value:!0});xp.FileType=xp.ChatSessionStatus=xp.ChatLocation=xp.ChatVariableLevel=xp.ExtensionMode=xp.DiagnosticSeverity=xp.TextEditorRevealType=xp.TextEditorLineNumbersStyle=xp.TextEditorCursorStyle=xp.InteractiveEditorResponseFeedbackKind=void 0;var xNi;(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"})(xNi||(xp.InteractiveEditorResponseFeedbackKind=xNi={}));var wNi;(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"})(wNi||(xp.TextEditorCursorStyle=wNi={}));var RNi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(RNi||(xp.TextEditorLineNumbersStyle=RNi={}));var kNi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(kNi||(xp.TextEditorRevealType=kNi={}));var PNi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(PNi||(xp.DiagnosticSeverity=PNi={}));var DNi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(DNi||(xp.ExtensionMode=DNi={}));var NNi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(NNi||(xp.ChatVariableLevel=NNi={}));var MNi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(MNi||(xp.ChatLocation=MNi={}));var ONi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(ONi||(xp.ChatSessionStatus=ONi={}));var LNi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(LNi||(xp.FileType=LNi={}))});var UNi=I(Pwr=>{"use strict";p();Object.defineProperty(Pwr,"__esModule",{value:!0});Pwr.t=GKa;function GKa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return FNi({message:e,args:r})}return FNi(t[0])}a(GKa,"t");function FNi(t){let{message:e,args:r}=t;return VKa(e,r??{})}a(FNi,"getMessage");var $Ka=/{([^}]+)}/g;function VKa(t,e){return t.replace($Ka,(r,n)=>e[n]??r)}a(VKa,"format2")});var jNi=I(E$=>{"use strict";p();Object.defineProperty(E$,"__esModule",{value:!0});E$.NewSymbolName=E$.NewSymbolNameTriggerKind=E$.NewSymbolNameTag=void 0;var QNi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(QNi||(E$.NewSymbolNameTag=QNi={}));var qNi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(qNi||(E$.NewSymbolNameTriggerKind=qNi={}));var Dwr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};E$.NewSymbolName=Dwr});var GNi=I(qyt=>{"use strict";p();Object.defineProperty(qyt,"__esModule",{value:!0});qyt.TerminalShellExecutionCommandLineConfidence=void 0;var HNi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(HNi||(qyt.TerminalShellExecutionCommandLineConfidence=HNi={}))});var $Ni=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.ThemeColor=DAe.ThemeIcon=void 0;var Nwr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};DAe.ThemeIcon=Nwr;var Mwr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};DAe.ThemeColor=Mwr});var P0=I((SLp,YNi)=>{"use strict";p();var WKa=YP(),zKa=Ic(),YKa=nd(),VNi=BIr(),KKa=QIr(),JKa=uxr(),U4e=nNi(),ZKa=kAe(),XKa=nL(),eJa=oNi(),tJa=vxr(),rJa=bxr(),WNi=lNi(),zNi=Rxr(),On=bNi(),Owr=INi(),_$=BNi(),nJa=UNi(),Lwr=jNi(),iJa=GNi(),oJa=$Ni(),sJa={Position:ZKa.Position,Range:XKa.Range,Selection:eJa.Selection,EventEmitter:zKa.Emitter,CancellationTokenSource:WKa.CancellationTokenSource,Diagnostic:VNi.Diagnostic,Location:KKa.Location,DiagnosticRelatedInformation:VNi.DiagnosticRelatedInformation,TextEdit:zNi.TextEdit,WorkspaceEdit:Owr.WorkspaceEdit,Uri:YKa.URI,MarkdownString:JKa.MarkdownString,DiagnosticSeverity:_$.DiagnosticSeverity,TextEditorCursorStyle:_$.TextEditorCursorStyle,TextEditorLineNumbersStyle:_$.TextEditorLineNumbersStyle,TextEditorRevealType:_$.TextEditorRevealType,EndOfLine:zNi.EndOfLine,l10n:{t:nJa.t},ExtensionMode:_$.ExtensionMode,ChatVariableLevel:_$.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:On.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:On.ChatResponseMarkdownPart,ChatResponseFileTreePart:On.ChatResponseFileTreePart,ChatResponseAnchorPart:On.ChatResponseAnchorPart,ChatResponseMovePart:On.ChatResponseMovePart,ChatResponseExtensionsPart:On.ChatResponseExtensionsPart,ChatResponseProgressPart:On.ChatResponseProgressPart,ChatResponseProgressPart2:On.ChatResponseProgressPart2,ChatResponseWarningPart:On.ChatResponseWarningPart,ChatResponseInfoPart:On.ChatResponseInfoPart,ChatResponseHookPart:On.ChatResponseHookPart,ChatResponseReferencePart:On.ChatResponseReferencePart,ChatResponseReferencePart2:On.ChatResponseReferencePart2,ChatResponseCodeCitationPart:On.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:On.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:On.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:On.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:On.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:On.ChatResponseTextEditPart,ChatResponseNotebookEditPart:On.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:On.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:On.ChatResponseConfirmationPart,ChatQuestion:On.ChatQuestion,ChatQuestionType:On.ChatQuestionType,ChatResponseQuestionCarouselPart:On.ChatResponseQuestionCarouselPart,ChatRequestTurn:On.ChatRequestTurn,ChatResponseTurn:On.ChatResponseTurn,ChatRequestEditorData:On.ChatRequestEditorData,ChatRequestNotebookData:On.ChatRequestNotebookData,NewSymbolName:Lwr.NewSymbolName,NewSymbolNameTag:Lwr.NewSymbolNameTag,NewSymbolNameTriggerKind:Lwr.NewSymbolNameTriggerKind,ChatLocation:_$.ChatLocation,SymbolInformation:WNi.SymbolInformation,LanguageModelToolResult:On.LanguageModelToolResult,ExtendedLanguageModelToolResult:On.LanguageModelToolResult,LanguageModelToolResult2:On.LanguageModelToolResult2,LanguageModelPromptTsxPart:On.LanguageModelPromptTsxPart,LanguageModelTextPart:On.LanguageModelTextPart,LanguageModelDataPart:On.LanguageModelDataPart,LanguageModelToolExtensionSource:On.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:On.LanguageModelToolMCPSource,ChatReferenceBinaryData:On.ChatReferenceBinaryData,ChatReferenceDiagnostic:On.ChatReferenceDiagnostic,TextSearchMatch2:On.TextSearchMatch2,AISearchKeyword:On.AISearchKeyword,ExcludeSettingOptions:On.ExcludeSettingOptions,NotebookCellKind:U4e.NotebookCellKind,NotebookRange:U4e.NotebookRange,NotebookEdit:U4e.NotebookEdit,NotebookCellData:U4e.NotebookCellData,NotebookData:U4e.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:iJa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:On.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:On.ChatResponsePullRequestPart,LanguageModelTextPart2:On.LanguageModelTextPart2,LanguageModelDataPart2:On.LanguageModelDataPart2,LanguageModelThinkingPart:On.LanguageModelThinkingPart,LanguageModelPartAudience:On.LanguageModelPartAudience,ChatResponseThinkingProgressPart:On.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:On.LanguageModelToolCallPart,LanguageModelToolResultPart:On.LanguageModelToolResultPart,LanguageModelToolResultPart2:On.LanguageModelToolResultPart2,LanguageModelChatMessageRole:On.LanguageModelChatMessageRole,LanguageModelChatMessage:On.LanguageModelChatMessage,LanguageModelChatToolMode:On.LanguageModelChatToolMode,TextEditorSelectionChangeKind:Owr.TextEditorSelectionChangeKind,TextDocumentChangeReason:Owr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:WNi.SymbolKind,SnippetString:tJa.SnippetString,SnippetTextEdit:rJa.SnippetTextEdit,FileType:_$.FileType,ChatSessionStatus:On.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:On.McpHttpServerDefinition,McpStdioServerDefinition:On.McpStdioServerDefinition,ThemeIcon:oJa.ThemeIcon};YNi.exports=sJa});var KNi=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.UseData=NAe.UseState=void 0;var Bwr=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}};NAe.UseState=Bwr;var Fwr=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)}}};NAe.UseData=Fwr});var ZNi=I(jyt=>{"use strict";p();Object.defineProperty(jyt,"__esModule",{value:!0});jyt.VirtualPromptReconciler=void 0;var JNi=KNi(),Uwr=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(aJa(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 qwr(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 Qwr([])),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)}};jyt.VirtualPromptReconciler=Uwr;var Qwr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},qwr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new JNi.UseState(e.state),this.dataHook=new JNi.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 aJa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(aJa,"isFragmentFunction")});var XNi=I(Hyt=>{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.VirtualPrompt=void 0;var cJa=ZNi(),jwr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new cJa.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()}};Hyt.VirtualPrompt=jwr});var w6=I(Gyt=>{"use strict";p();Object.defineProperty(Gyt,"__esModule",{value:!0});Gyt.Text=lJa;Gyt.Chunk=uJa;function lJa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(lJa,"Text");function uJa(t){return t.children}a(uJa,"Chunk")});var v$=I(R6=>{"use strict";p();Object.defineProperty(R6,"__esModule",{value:!0});R6.PerCompletionContextProviderStatistics=R6.ContextProviderStatistics=R6.ICompletionsContextProviderService=void 0;R6.componentStatisticsToPromptMatcher=pJa;var dJa=nn(),fJa=C6();R6.ICompletionsContextProviderService=(0,dJa.createServiceIdentifier)("ICompletionsContextProviderService");var Hwr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new $yt){this.createStatistics=e,this.statistics=new fJa.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)}}};R6.ContextProviderStatistics=Hwr;var $yt=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()}}};R6.PerCompletionContextProviderStatistics=$yt;function pJa(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(pJa,"componentStatisticsToPromptMatcher")});var j4e=I(q4e=>{"use strict";p();Object.defineProperty(q4e,"__esModule",{value:!0});q4e.filterContextItemsByType=AJa;q4e.filterSupportedContextItems=yJa;q4e.addOrValidateContextItemsIDs=_Ja;var hJa=P0(),mJa=nd(),Gwr=T0(),gJa=o4e(),$wr=Dl(),Q4e;(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&&!gJa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(Q4e||(Q4e={}));var Vwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(Vwr||(Vwr={}));var Wwr;(function(t){function e(r){if(!Q4e.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})(Wwr||(Wwr={}));var zwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;if(!mJa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof hJa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(zwr||(zwr={}));var Ywr;(function(t){function e(r){if(Vwr.is(r))return"Trait";if(Wwr.is(r))return"CodeSnippet";if(zwr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(Ywr||(Ywr={}));function AJa(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(AJa,"filterContextItemsByType");function yJa(t){let e=[],r=0;return t.forEach(n=>{let o=Ywr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(yJa,"filterSupportedContextItems");function EJa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(EJa,"validateContextItemId");function _Ja(t,e){let r=new Set,n=t.get($wr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,Gwr.generateUuid)();if(!EJa(c)){let l=(0,Gwr.generateUuid)();$wr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,Gwr.generateUuid)();$wr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(_Ja,"addOrValidateContextItemsIDs")});var Kwr=I(Vyt=>{"use strict";p();Object.defineProperty(Vyt,"__esModule",{value:!0});Vyt.getCodeSnippetsFromContextItems=TJa;Vyt.addRelativePathToCodeSnippets=IJa;var vJa=s1(),CJa=v$(),bJa=j4e(),SJa="content_excluded";async function TJa(t,e,r,n){let o=(0,bJa.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(CJa.ICompletionsContextProviderService),u=t.get(vJa.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,SJa]]),g}).map(h=>h.data)}a(TJa,"getCodeSnippetsFromContextItems");function IJa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(IJa,"addRelativePathToCodeSnippets")});var Jwr=I(Yyt=>{"use strict";p();Object.defineProperty(Yyt,"__esModule",{value:!0});Yyt.CodeSnippets=void 0;var Wyt=rL(),zyt=w6(),xJa=k6(),wJa=Kwr(),RJa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(xJa.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,wJa.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,Wyt.jsx)(zyt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Wyt.jsx)(zyt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.CompletionsContext=eMi;MAe.StableCompletionsContext=tMi;MAe.AdditionalCompletionsContext=rMi;MAe.isContextNode=kJa;function eMi(t){return t.children}a(eMi,"CompletionsContext");function tMi(t){return t.children}a(tMi,"StableCompletionsContext");function rMi(t){return t.children}a(rMi,"AdditionalCompletionsContext");function kJa(t){return t.name===eMi.name||t.name===tMi.name||t.name===rMi.name}a(kJa,"isContextNode")});var Xwr=I(G4e=>{"use strict";p();Object.defineProperty(G4e,"__esModule",{value:!0});G4e.SnapshotWalker=void 0;G4e.defaultTransformers=nMi;var PJa=w6(),Zwr=class{static{a(this,"SnapshotWalker")}constructor(e,r=nMi()){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)}};G4e.SnapshotWalker=Zwr;function nMi(){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===PJa.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(nMi,"defaultTransformers")});var iMi=I(eRr=>{"use strict";p();Object.defineProperty(eRr,"__esModule",{value:!0});eRr.findEditDistanceScore=DJa;function DJa(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(LD,"__esModule",{value:!0});LD.MAX_EDIT_DISTANCE_LENGTH=void 0;LD.CurrentFile=LJa;LD.BeforeCursor=nRr;LD.AfterCursor=iRr;LD.DocumentPrefix=BJa;LD.DocumentSuffix=FJa;var FR=rL(),OAe=w6(),NJa=JG(),MJa=iMi(),OJa=Ore(),tRr=k6();LD.MAX_EDIT_DISTANCE_LENGTH=50;function rRr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(rRr,"approximateMaxCharacters");function LJa(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(tRr.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=rRr(c);return(0,FR.jsxs)(FR.Fragment,{children:[(0,FR.jsx)(nRr,{document:r,position:o,maxCharacters:m}),(0,FR.jsx)(iRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(LJa,"CurrentFile");function nRr(t){if(t.document===void 0||t.position===void 0)return(0,FR.jsx)(OAe.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)(OAe.Text,{children:e})}a(nRr,"BeforeCursor");function iRr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,FR.jsx)(OAe.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)(OAe.Text,{});if(r===s)return(0,FR.jsx)(OAe.Text,{children:r});let c=s;if(r!==""){let l=(0,OJa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,LD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,LD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,MJa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??NJa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,FR.jsx)(OAe.Text,{children:c})}a(iRr,"AfterCursor");function BJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(tRr.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=rRr(c);return(0,FR.jsx)(nRr,{document:r,position:o,maxCharacters:u})}a(BJa,"DocumentPrefix");function FJa(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(tRr.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=rRr(c);return(0,FR.jsx)(iRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(FJa,"DocumentSuffix")});var sRr=I(tne=>{"use strict";p();Object.defineProperty(tne,"__esModule",{value:!0});tne.WishlistElision=void 0;tne.makePrompt=UJa;tne.makePrefixPrompt=QJa;tne.makeContextPrompt=qJa;var oRr=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]}};tne.WishlistElision=oRr;function UJa(t){return t.map(e=>e.elidedValue).join("")}a(UJa,"makePrompt");function QJa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(QJa,"makePrefixPrompt");function qJa(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(qJa,"makeContextPrompt")});var lRr=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.transformers=C$.CompletionsPromptRenderer=void 0;C$.normalizeLineEndings=cRr;var cMi=Xwr(),oMi=k4e(),sMi=Ore(),jJa=H4e(),Kyt=$4e(),aMi=sRr(),HJa=5,aRr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=aMi.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??sMi.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 aMi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,sMi.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(...GJa([...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-HJa: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 cMi.SnapshotWalker(e,C$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Kyt.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:cRr(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,oMi.isShebangLine)(f.value)?y=A:y=(0,oMi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:cRr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Kyt.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}}};C$.CompletionsPromptRenderer=aRr;C$.transformers=[...(0,cMi.defaultTransformers)(),(t,e,r)=>(0,jJa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Kyt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Kyt.AfterCursor.name?{...r,type:"suffix"}:r];function GJa(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(GJa,"computeComponentStatistics");function cRr(t){return t.replace(/\r\n?/g,` -`)}a(cRr,"normalizeLineEndings")});var Jyt=I(LAe=>{"use strict";p();Object.defineProperty(LAe,"__esModule",{value:!0});LAe.ILanguageContextProviderService=LAe.ProviderTarget=void 0;var $Ja=nn(),lMi;(function(t){t.NES="nes",t.Completions="completions"})(lMi||(LAe.ProviderTarget=lMi={}));LAe.ILanguageContextProviderService=(0,$Ja.createServiceIdentifier)("ILanguageContextProviderService")});var rne=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.RuntimeMode=BAe.ICompletionsRuntimeModeService=void 0;var VJa=nn();BAe.ICompletionsRuntimeModeService=(0,VJa.createServiceIdentifier)("completionsRuntimeModeService");var uRr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:uMi(r,n),verboseLogging:zJa(r,n),testMode:e,simulation:WJa(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}};BAe.RuntimeMode=uRr;function uMi(t,e){return t.includes("--debug")||dRr(e,"DEBUG")}a(uMi,"determineDebugFlag");function WJa(t){return dRr(t,"SIMULATION")}a(WJa,"determineSimulationFlag");function zJa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||dRr(e,"VERBOSE")||uMi(t,e)}a(zJa,"determineVerboseLoggingEnabled");function dRr(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(dRr,"determineEnvFlagEnabled")});var hMi=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.eventToPromise=YJa;V4e.isArrayOfT=pMi;V4e.resolveAll=JJa;var dMi=y4e();async function YJa(t){let e=new dMi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(YJa,"eventToPromise");async function KJa(t){if(t.isCancellationRequested)return;let e=new dMi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(KJa,"cancellationTokenToPromise");async function fMi(t,e){if(e){let r=KJa(e);await Promise.race([t,r])}else await t}a(fMi,"raceCancellation");function pMi(t){return Array.isArray(t)}a(pMi,"isArrayOfT");async function JJa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await ZJa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(JJa,"resolveAll");async function ZJa(t,e){let r;return t instanceof Promise?r=await XJa(t,e):r=await eZa(t,e),r}a(ZJa,"resolve");async function XJa(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:pMi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await fMi(o,e),n.resolutionTime=performance.now()-r,n}a(XJa,"resolvePromise");async function eZa(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 fMi(o,e),n.resolutionTime=performance.now()-r,n}a(eZa,"resolveIterable")});var mMi=I(pRr=>{"use strict";p();Object.defineProperty(pRr,"__esModule",{value:!0});pRr.fillInCppVSCodeActiveExperiments=iZa;var tZa=fy(),fRr=Dl(),rZa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},nZa="ms-vscode.cpptools";function iZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(nZa))&&oZa(t,r,n)}a(iZa,"fillInCppVSCodeActiveExperiments");function oZa(t,e,r){try{let n=t.get(tZa.ICompletionsFeaturesService),o=t.get(fRr.ICompletionsLogTargetService),s=rZa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){fRr.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){fRr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(oZa,"addActiveExperiments")});var AMi=I(hRr=>{"use strict";p();Object.defineProperty(hRr,"__esModule",{value:!0});hRr.fillInCSharpActiveExperiments=aZa;var sZa=fy(),gMi=Dl();function aZa(t,e,r){let n=t.get(sZa.ICompletionsFeaturesService),o=t.get(gMi.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 gMi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(aZa,"fillInCSharpActiveExperiments")});var yMi=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.multiLanguageContextProviderParamsDefault=void 0;b$.fillInMultiLanguageActiveExperiments=uZa;b$.getMultiLanguageContextProviderParamsFromActiveExperiments=pZa;var cZa=fy(),mRr=Dl(),lZa="fallbackContextProvider";b$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function uZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(lZa))&&dZa(t,r,n)}a(uZa,"fillInMultiLanguageActiveExperiments");function dZa(t,e,r){try{let n=fZa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){mRr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(dZa,"addActiveExperiments");function fZa(t,e){let r=b$.multiLanguageContextProviderParamsDefault,n=t.get(mRr.ICompletionsLogTargetService),s=t.get(cZa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){mRr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(fZa,"getMultiLanguageContextProviderParamsFromExp");function pZa(t){let e={...b$.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(pZa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var _Mi=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.TS_CONTEXT_PROVIDER_ID=void 0;FAe.fillInTsActiveExperiments=mZa;var hZa=fy(),EMi=Dl();FAe.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function mZa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(FAe.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(EMi.ICompletionsLogTargetService),s=t.get(hZa.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 EMi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(mZa,"fillInTsActiveExperiments")});var eEt=I(Nl=>{"use strict";p();var _Rr=Nl&&Nl.__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},BD=Nl&&Nl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.DefaultDiagnosticSettings=Nl.CachedContextProviderRegistry=Nl.MutableContextProviderRegistry=Nl.CoreContextProviderRegistry=Nl.DefaultContextProvidersContainer=Nl.ICompletionsDefaultContextProviders=Nl.ICompletionsContextProviderRegistryService=void 0;Nl.telemetrizeContextItems=SZa;Nl.matchContextItems=TZa;Nl.useContextProviderAPI=xZa;Nl.getDefaultDiagnosticSettings=RZa;var gZa=ri(),vMi=Pl(),vRr=Jyt(),AZa=mh(),SMi=nn(),yZa=Rs(),CRr=Gs(),Zyt=LE(),TMi=fy(),EZa=C6(),P6=Dl(),bRr=rne(),CMi=hMi(),_Za=mMi(),vZa=AMi(),CZa=yMi(),bZa=_Mi(),bMi=j4e(),IMi=v$();Nl.ICompletionsContextProviderRegistryService=(0,SMi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Nl.ICompletionsDefaultContextProviders=(0,SMi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var gRr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Nl.DefaultContextProvidersContainer=gRr;var Xyt=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([vRr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return P6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(vZa.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 P6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(_Za.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(CZa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(bZa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new gZa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(wZa,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,CMi.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,yZa.isCancellationError)(x.reason)||P6.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")&&(P6.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,CMi.isArrayOfT)(q)?P.push(...q):q&&P.push(q),P.length>0&&(x.status="partial")}catch(q){P6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,bMi.filterSupportedContextItems)(P);N&&P6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(bMi.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 P6.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(xMi,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]}))}};Nl.CoreContextProviderRegistry=Xyt;Nl.CoreContextProviderRegistry=Xyt=_Rr([BD(1,vRr.ILanguageContextProviderService),BD(2,bRr.ICompletionsRuntimeModeService),BD(3,CRr.IInstantiationService),BD(4,P6.ICompletionsLogTargetService),BD(5,IMi.ICompletionsContextProviderService)],Xyt);var ARr=class extends Xyt{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)}};Nl.MutableContextProviderRegistry=ARr;Nl.MutableContextProviderRegistry=ARr=_Rr([BD(1,vRr.ILanguageContextProviderService),BD(2,bRr.ICompletionsRuntimeModeService),BD(3,CRr.IInstantiationService),BD(4,P6.ICompletionsLogTargetService),BD(5,IMi.ICompletionsContextProviderService)],ARr);var yRr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new EZa.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}};Nl.CachedContextProviderRegistry=yRr;Nl.CachedContextProviderRegistry=yRr=_Rr([BD(2,CRr.IInstantiationService)],yRr);function SZa(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(SZa,"telemetrizeContextItems");function TZa(t){return t.matchScore>0&&t.resolution!=="error"}a(TZa,"matchContextItems");function xMi(t,e,r){let n=IZa(t,e,r),o=(0,Zyt.getConfig)(t,Zyt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Nl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(xMi,"getActiveContextProviders");function IZa(t,e,r){if(t.get(bRr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(TMi.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(IZa,"getExpContextProviders");function xZa(t,e,r){return xMi(t,e,r).length>0}a(xZa,"useContextProviderAPI");function wZa(t,e,r){let n=(0,Zyt.getConfig)(t,Zyt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(TMi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(wZa,"getContextProviderTimeBudget");var ERr;(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")})(ERr||(Nl.DefaultDiagnosticSettings=ERr={}));function RZa(t){let e=t.get(vMi.IConfigurationService),r=t.get(AZa.IExperimentationService),n=e.getExperimentBasedConfig(vMi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return ERr.from(n)}a(RZa,"getDefaultDiagnosticSettings")});var tEt=I(FD=>{"use strict";p();var kZa=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},PZa=FD&&FD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(FD,"__esModule",{value:!0});FD.ContextProviderBridge=FD.ICompletionsContextProviderBridgeService=void 0;var DZa=nn(),NZa=C6(),MZa=eEt();FD.ICompletionsContextProviderBridgeService=(0,DZa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var SRr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new NZa.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:[]}};FD.ContextProviderBridge=SRr;FD.ContextProviderBridge=SRr=kZa([PZa(0,MZa.ICompletionsContextProviderRegistryService)],SRr)});var xRr=I(rEt=>{"use strict";p();Object.defineProperty(rEt,"__esModule",{value:!0});rEt.Diagnostics=void 0;var TRr=rL(),OZa=P0(),IRr=w6(),LZa=JG(),BZa=k6();function FZa(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(FZa,"getCode");function UZa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(UZa,"getRelativePath");var QZa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(BZa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,LZa.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,TRr.jsx)(IRr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${UZa(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=FZa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,TRr.jsx)(IRr.Text,{children:`${_.line+1}:${_.character+1} - ${OZa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,TRr.jsx)(IRr.Chunk,{children:m})})},"Diagnostics");rEt.Diagnostics=QZa});var wRr=I(iEt=>{"use strict";p();Object.defineProperty(iEt,"__esModule",{value:!0});iEt.DocumentMarker=void 0;var nEt=rL(),wMi=w6(),RMi=k4e(),qZa=k6(),jZa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(qZa.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,nEt.jsx)(HZa,{docInfo:s}):(0,nEt.jsx)(GZa,{docInfo:s})}},"DocumentMarker");iEt.DocumentMarker=jZa;var HZa=a(t=>(0,nEt.jsx)(wMi.Text,{children:(0,RMi.getPathMarker)(t.docInfo)}),"PathMarker"),GZa=a(t=>(0,nEt.jsx)(wMi.Text,{children:(0,RMi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var RRr=I(W4e=>{"use strict";p();Object.defineProperty(W4e,"__esModule",{value:!0});W4e.RecentEdits=void 0;W4e.editIsTooCloseToCursor=DMi;var kMi=rL(),PMi=w6(),oEt=k4e(),$Za=k6();function DMi(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(DMi,"editIsTooCloseToCursor");var VZa=a((t,e)=>{let[r,n]=e.useState();return e.useData($Za.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(DMi(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,oEt.newLineEnded)(`File: ${T}`)+(0,oEt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,oEt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,oEt.newLineEnded)("End of recent edits");n(h)}),r?(0,kMi.jsx)(PMi.Chunk,{children:(0,kMi.jsx)(PMi.Text,{children:r})}):void 0},"RecentEdits");W4e.RecentEdits=VZa});var NMi=I(sL=>{"use strict";p();Object.defineProperty(sL,"__esModule",{value:!0});sL.registerDocumentTracker=sL.accessTimes=void 0;sL.sortByAccessTimes=YZa;var WZa=C6(),zZa=s1();sL.accessTimes=new WZa.LRUCacheMap;function YZa(t){return[...t].sort((e,r)=>{let n=sL.accessTimes.get(e.uri)??0;return(sL.accessTimes.get(r.uri)??0)-n})}a(YZa,"sortByAccessTimes");var KZa=a(t=>t.get(zZa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&sL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");sL.registerDocumentTracker=KZa});var MMi=I(D6=>{"use strict";p();var JZa=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},ZZa=D6&&D6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(D6,"__esModule",{value:!0});D6.OpenTabFiles=void 0;var XZa=NMi(),eXa=s1(),kRr=UAe(),PRr=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>kRr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,kRr.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,XZa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(kRr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};D6.OpenTabFiles=PRr;D6.OpenTabFiles=PRr=JZa([ZZa(0,eXa.ICompletionsTextDocumentManagerService)],PRr)});var OMi=I(DRr=>{"use strict";p();Object.defineProperty(DRr,"__esModule",{value:!0});DRr.shortCircuit=tXa;function tXa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(tXa,"shortCircuit")});var dEt=I(Ml=>{"use strict";p();var rXa=Ml&&Ml.__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},sEt=Ml&&Ml.__param||function(t,e){return function(r,n){e(r,n,t)}},NRr;Object.defineProperty(Ml,"__esModule",{value:!0});Ml.RelatedFilesProvider=Ml.ICompletionsRelatedFilesProviderService=Ml.relatedFilesLogger=Ml.PromiseExpirationCacheMap=Ml.EmptyRelatedFilesResponse=void 0;Ml.getRelatedFilesAndTraits=fXa;var nXa=Bre(),iXa=nn(),oXa=nd(),LRr=Gs(),sXa=n$(),aXa=C6(),uEt=Dl(),cXa=$g(),lXa=OMi();Ml.EmptyRelatedFilesResponse={entries:[],traits:[]};var aEt={entries:new Map,traits:[]},cEt=class extends aXa.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.timestampMl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Ml.RelatedFilesProvider=MRr;Ml.RelatedFilesProvider=MRr=NRr=rXa([sEt(0,LRr.IInstantiationService),sEt(1,nXa.IIgnoreService),sEt(2,uEt.ICompletionsLogTargetService),sEt(3,sXa.ICompletionsFileSystemService)],MRr);var dXa=3,z4e=new cEt(uXa);async function LMi(t,e,r,n,o){let s=t.get(LRr.IInstantiationService),c=t.get(uEt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Ml.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(z4e.bumpRetryCount(e.uri)>=dXa?u=aEt:u=void 0);let d=performance.now()-l;if(Ml.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 lEt;return u}a(LMi,"getRelatedFiles");var ORr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(z4e.has(s))return z4e.get(s);let c=LMi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw z4e.delete(s),l})),z4e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");ORr=(0,lXa.shortCircuit)(ORr,200,aEt);async function fXa(t,e,r,n,o,s=!1){let c=t.get(LRr.IInstantiationService),l=t.get(uEt.ICompletionsLogTargetService),u=t.get(Ml.ICompletionsRelatedFilesProviderService),d=aEt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(LMi,f,r,n,u):await c.invokeFunction(ORr,f,r,n,u)}catch(f){d=aEt,f instanceof lEt&&c.invokeFunction(cXa.telemetry,"getRelatedFilesList",r)}return Ml.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(fXa,"getRelatedFilesAndTraits")});var UAe=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.NeighborSource=S$.NeighboringFileType=void 0;S$.considerNeighborFile=AXa;S$.isIncludeNeighborFilesActive=yXa;var pXa=Gs(),BMi=JG(),UMi=fy(),hXa=Dl(),mXa=s1(),gXa=MMi(),fEt=dEt(),FMi;(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"})(FMi||(S$.NeighboringFileType=FMi={}));function AXa(t,e){return(0,BMi.normalizeLanguageId)(t)===(0,BMi.normalizeLanguageId)(e)}a(AXa,"considerNeighborFile");var BRr=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(UMi.ICompletionsFeaturesService),d=e.get(hXa.ICompletionsLogTargetService),f=e.get(pXa.IInstantiationService),h=e.get(mXa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(gXa.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 fEt.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 fEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(fEt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(fEt.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)}};S$.NeighborSource=BRr;function yXa(t,e,r){return t.get(UMi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(yXa,"isIncludeNeighborFilesActive")});var URr=I(pEt=>{"use strict";p();Object.defineProperty(pEt,"__esModule",{value:!0});pEt.SimilarFiles=void 0;var QAe=rL(),FRr=w6(),EXa=Eyt(),_Xa=vIr(),vXa=vyt(),CXa=k6(),bXa=qAe(),QMi=UAe(),SXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(CXa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=QMi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await QMi.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(bXa.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,_Xa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(vXa.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,EXa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,QAe.jsxs)(QAe.Fragment,{children:[...o.map((u,d)=>(0,QAe.jsx)(TXa,{snippet:u}))]})},"SimilarFiles");pEt.SimilarFiles=SXa;var TXa=a((t,e)=>(0,QAe.jsxs)(FRr.Chunk,{children:[(0,QAe.jsx)(FRr.Text,{children:t.snippet.headline}),(0,QAe.jsx)(FRr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var zMi=I(rI=>{"use strict";p();Object.defineProperty(rI,"__esModule",{value:!0});rI.getAllRecentEditsByTimestamp=IXa;rI.findChangeSpan=QRr;rI.getDiff=jMi;rI.unifiedDiff=HMi;rI.findReplaceDiff=GMi;rI.editsOverlap=$Mi;rI.updateEdits=VMi;rI.buildIncomingEdit=qRr;rI.trimOldFilesFromState=WMi;rI.recentEditsReducer=RXa;rI.summarizeEdit=kXa;function IXa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(IXa,"getAllRecentEditsByTimestamp");function QRr(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(QRr,"findChangeSpan");function jMi(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(jMi,"getDiff");function xXa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(xXa,"measureDiffSize");function HMi(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(` +${rNi(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,TKa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};yy.MarkdownString=Lyt;function eNi(t){return tNi(t)?!t.value:Array.isArray(t)?t.every(eNi):!0}a(eNi,"isEmptyMarkdownString");function tNi(t){return t instanceof Lyt?!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(tNi,"isMarkdownString");function IKa(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,SKa.isEqual)(Oyt.URI.from(t.baseUri),Oyt.URI.from(e.baseUri)))}a(IKa,"markdownStringEqual");function Byt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Byt,"escapeMarkdownSyntaxTokens");function xKa(t){return t.replace(/[\\\]]/g,"\\$&")}a(xKa,"escapeMarkdownLinkLabel");function rNi(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(rNi,"appendEscapedMarkdownCodeBlockFence");function wKa(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(wKa,"appendEscapedMarkdownInlineCode");function RKa(t){return t.replace(/"/g,""")}a(RKa,"escapeDoubleQuotes");function kKa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(kKa,"removeMarkdownEscapes");function PKa(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(PKa,"parseHrefAndDimensions");function nNi(t,e,r,n=!0){return`[${n?Byt(t):t}](${e}${r?` "${Byt(r)}"`:""})`}a(nNi,"createMarkdownLink");function DKa(t,e=!0){let r=iNi(t.id,...t.arguments||[]).toString();return nNi(t.text,r,t.tooltip,e)}a(DKa,"createMarkdownCommandLink");function iNi(t,...e){return Oyt.URI.from({scheme:bKa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(iNi,"createCommandUri")});var hxr=I(Jre=>{"use strict";p();var NKa=Jre&&Jre.__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},fxr;Object.defineProperty(Jre,"__esModule",{value:!0});Jre.MarkdownString=void 0;var MKa=oNi(),OKa=BD(),pxr=fxr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof fxr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new MKa.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}};Jre.MarkdownString=pxr;Jre.MarkdownString=pxr=fxr=NKa([OKa.es5ClassCompat],pxr)});var cNi=I(w6=>{"use strict";p();Object.defineProperty(w6,"__esModule",{value:!0});w6.Mimes=void 0;w6.getMediaOrTextMime=BKa;w6.getMediaMime=aNi;w6.getExtensionForMimeType=FKa;w6.normalizeMimeType=QKa;w6.isTextStreamMime=qKa;var sNi=MA();w6.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 LKa={".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"},mxr={".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 BKa(t){let e=(0,sNi.extname)(t),r=LKa[e.toLowerCase()];return r!==void 0?r:aNi(t)}a(BKa,"getMediaOrTextMime");function aNi(t){let e=(0,sNi.extname)(t),r=mxr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(aNi,"getMediaMime");function FKa(t){for(let e in mxr){let r=mxr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(FKa,"getExtensionForMimeType");var UKa=/^(.+)\/(.+?)(;.+)?$/;function QKa(t,e){let r=UKa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(QKa,"normalizeMimeType");function qKa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(qKa,"isTextStreamMime")});var dNi=I(P0=>{"use strict";p();var jKa=P0&&P0.__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$;Object.defineProperty(P0,"__esModule",{value:!0});P0.NotebookCellOutput=P0.NotebookCellOutputItem=P0.NotebookEdit=P0.NotebookData=P0.NotebookCellData=P0.NotebookRange=P0.NotebookCellKind=void 0;var HKa=BD(),lNi=Rs(),Fyt=cNi(),GKa=I0(),uNi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(uNi||(P0.NotebookCellKind=uNi={}));var Zre=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,lNi.illegalArgument)("start must be positive");if(r<0)throw(0,lNi.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)}};P0.NotebookRange=Zre;var gxr=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)}};P0.NotebookCellData=gxr;var Axr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};P0.NotebookData=Axr;var yxr=E$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof E$?!0:e?Zre.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new E$(e,r)}static insertCells(e,r){return new E$(new Zre(e,e),r)}static deleteCells(e){return new E$(e,[])}static updateCellMetadata(e,r){let n=new E$(new Zre(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new E$(new Zre(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};P0.NotebookEdit=yxr;P0.NotebookEdit=yxr=E$=jKa([HKa.es5ClassCompat],yxr);var Exr=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=Fyt.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,Fyt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};P0.NotebookCellOutputItem=Exr;var _xr=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,GKa.generateUuid)(),this.metadata=r??n)}};P0.NotebookCellOutput=_xr});var pNi=I(v$=>{"use strict";p();var $Ka=v$&&v$.__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},vxr;Object.defineProperty(v$,"__esModule",{value:!0});v$.Selection=void 0;v$.getDebugDescriptionOfSelection=fNi;var VKa=BD(),_$=DAe(),Cxr=iL(),bxr=vxr=class extends Cxr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof vxr?!0:!e||typeof e!="object"?!1:Cxr.Range.isRange(e)&&_$.Position.isPosition(e.anchor)&&_$.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 _$.Position(e,r),c=new _$.Position(n,o)):_$.Position.isPosition(e)&&_$.Position.isPosition(r)&&(s=_$.Position.of(e),c=_$.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 fNi(this)}};v$.Selection=bxr;v$.Selection=bxr=vxr=$Ka([VKa.es5ClassCompat],bxr);function fNi(t){let e=(0,Cxr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(fNi,"getDebugDescriptionOfSelection")});var Txr=I(ene=>{"use strict";p();var WKa=ene&&ene.__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;Object.defineProperty(ene,"__esModule",{value:!0});ene.SnippetString=void 0;var zKa=BD(),Sxr=Xre=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Xre?!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+=Xre._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 Xre;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Xre._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 Xre;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}};ene.SnippetString=Sxr;ene.SnippetString=Sxr=Xre=WKa([zKa.es5ClassCompat],Sxr)});var xxr=I(Uyt=>{"use strict";p();Object.defineProperty(Uyt,"__esModule",{value:!0});Uyt.SnippetTextEdit=void 0;var YKa=Txr(),hNi=iL(),Ixr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?hNi.Range.isRange(e.range)&&YKa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new hNi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};Uyt.SnippetTextEdit=Ixr});var ANi=I(FD=>{"use strict";p();var KKa=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},wxr;Object.defineProperty(FD,"__esModule",{value:!0});FD.SymbolInformation=FD.SymbolTag=FD.SymbolKind=void 0;var JKa=BD(),mNi=GIr(),ZKa=iL(),Rxr;(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"})(Rxr||(FD.SymbolKind=Rxr={}));var gNi;(function(t){t[t.Deprecated=1]="Deprecated"})(gNi||(FD.SymbolTag=gNi={}));var kxr=wxr=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 mNi.Location?this.location=o:n instanceof ZKa.Range&&(this.location=new mNi.Location(o,n)),wxr.validate(this)}toJSON(){return{name:this.name,kind:Rxr[this.kind],location:this.location,containerName:this.containerName}}};FD.SymbolInformation=kxr;FD.SymbolInformation=kxr=wxr=KKa([JKa.es5ClassCompat],kxr)});var Nxr=I(R6=>{"use strict";p();var XKa=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},tne;Object.defineProperty(R6,"__esModule",{value:!0});R6.TextEdit=R6.EndOfLine=void 0;var Pxr=Rs(),eJa=BD(),yNi=DAe(),Qyt=iL(),ENi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(ENi||(R6.EndOfLine=ENi={}));var Dxr=tne=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof tne?!0:!e||typeof e!="object"?!1:Qyt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new tne(e,r)}static insert(e,r){return tne.replace(new Qyt.Range(e,e),r)}static delete(e){return tne.replace(e,"")}static setEndOfLine(e){let r=new tne(new Qyt.Range(new yNi.Position(0,0),new yNi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Qyt.Range.isRange(e))throw(0,Pxr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,Pxr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,Pxr.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}}};R6.TextEdit=Dxr;R6.TextEdit=Dxr=tne=XKa([eJa.es5ClassCompat],Dxr)});var PNi=I(It=>{"use strict";p();Object.defineProperty(It,"__esModule",{value:!0});It.ChatResponseClearToPreviousToolInvocationReason=It.ChatRequestEditedFileEventKind=It.ChatInputNotificationSeverity=It.ChatErrorLevel=It.AISearchKeyword=It.TextSearchMatch2=It.ExcludeSettingOptions=It.LanguageModelPromptTsxPart=It.ChatImageMimeType=It.LanguageModelDataPart2=It.LanguageModelDataPart=It.LanguageModelThinkingPart=It.LanguageModelTextPart2=It.LanguageModelPartAudience=It.LanguageModelTextPart=It.LanguageModelToolResult2=It.LanguageModelToolResult=It.ChatReferenceBinaryData=It.ChatReferenceDiagnostic=It.ChatRequestNotebookData=It.ChatRequestEditorData=It.ChatResponseTurn=It.ChatRequestTurn2=It.ChatRequestTurn=It.ChatResponseQuestionCarouselPart=It.ChatQuestion=It.ChatQuestionType=It.ChatResponseConfirmationPart=It.ChatResponseWorkspaceEditPart=It.ChatResponseNotebookEditPart=It.ChatResponseTextEditPart=It.ChatResponseMarkdownWithVulnerabilitiesPart=It.ChatResponseCommandButtonPart=It.ChatResponseCodeCitationPart=It.ChatResponsePullRequestPart=It.ChatResponseExtensionsPart=It.ChatResponseMovePart=It.ChatResponseReferencePart2=It.ChatResponseReferencePart=It.ChatResponseInfoPart=It.ChatResponseWarningPart=It.ChatResponseProgressPart2=It.ChatResponseExternalEditPart=It.ChatResponseHookPart=It.ChatResponseThinkingProgressPart=It.ChatResponseProgressPart=It.ChatResponseAnchorPart=It.ChatResponseFileTreePart=It.ChatResponseCodeblockUriPart=It.ChatResponseMarkdownPart=void 0;It.McpHttpServerDefinition=It.McpStdioServerDefinition=It.ChatResource=It.LanguageModelError=It.ChatSessionStatus=It.ChatResponseTurn2=It.ChatSubagentToolInvocationData=It.ChatToolInvocationPart=It.McpToolInvocationContentData=It.LanguageModelChatMessage=It.LanguageModelChatToolMode=It.LanguageModelChatMessageRole=It.LanguageModelToolResultPart2=It.LanguageModelToolResultPart=It.LanguageModelToolCallPart=It.LanguageModelToolMCPSource=It.LanguageModelToolExtensionSource=void 0;var _Ni=i$(),Gyt=hxr(),Mxr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new Gyt.MarkdownString(e):e}};It.ChatResponseMarkdownPart=Mxr;var Oxr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};It.ChatResponseCodeblockUriPart=Oxr;var Lxr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};It.ChatResponseFileTreePart=Lxr;var Bxr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};It.ChatResponseAnchorPart=Bxr;var Fxr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};It.ChatResponseProgressPart=Fxr;var Uxr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.ChatResponseThinkingProgressPart=Uxr;var Qxr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};It.ChatResponseHookPart=Qxr;var qxr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};It.ChatResponseExternalEditPart=qxr;var jxr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};It.ChatResponseProgressPart2=jxr;var Hxr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new Gyt.MarkdownString(e):e}};It.ChatResponseWarningPart=Hxr;var Gxr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new Gyt.MarkdownString(e):e}};It.ChatResponseInfoPart=Gxr;var $xr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};It.ChatResponseReferencePart=$xr;var Vxr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};It.ChatResponseReferencePart2=Vxr;var Wxr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};It.ChatResponseMovePart=Wxr;var zxr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};It.ChatResponseExtensionsPart=zxr;var Yxr=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}};It.ChatResponsePullRequestPart=Yxr;var Kxr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};It.ChatResponseCodeCitationPart=Kxr;var Jxr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};It.ChatResponseCommandButtonPart=Jxr;var Zxr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new Gyt.MarkdownString(e):e,this.vulnerabilities=r}};It.ChatResponseMarkdownWithVulnerabilitiesPart=Zxr;var Xxr=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]}};It.ChatResponseTextEditPart=Xxr;var ewr=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]}};It.ChatResponseNotebookEditPart=ewr;var twr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};It.ChatResponseWorkspaceEditPart=twr;var rwr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};It.ChatResponseConfirmationPart=rwr;var vNi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(vNi||(It.ChatQuestionType=vNi={}));var nwr=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)}};It.ChatQuestion=nwr;var iwr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};It.ChatResponseQuestionCarouselPart=iwr;var owr=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}};It.ChatRequestTurn=owr;var swr=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}};It.ChatRequestTurn2=swr;var awr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn=awr;var cwr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};It.ChatRequestEditorData=cwr;var lwr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};It.ChatRequestNotebookData=lwr;var uwr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};It.ChatReferenceDiagnostic=uwr;var dwr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};It.ChatReferenceBinaryData=dwr;var fwr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};It.LanguageModelToolResult=fwr;var pwr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};It.LanguageModelToolResult2=pwr;var qyt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};It.LanguageModelTextPart=qyt;var CNi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(CNi||(It.LanguageModelPartAudience=CNi={}));var hwr=class extends qyt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};It.LanguageModelTextPart2=hwr;var mwr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.LanguageModelThinkingPart=mwr;var jyt=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(_Ni.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(_Ni.VSBuffer.fromString(e).buffer,"text/plain")}};It.LanguageModelDataPart=jyt;var gwr=class extends jyt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};It.LanguageModelDataPart2=gwr;var bNi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(bNi||(It.ChatImageMimeType=bNi={}));var Awr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};It.LanguageModelPromptTsxPart=Awr;var SNi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(SNi||(It.ExcludeSettingOptions=SNi={}));var ywr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};It.TextSearchMatch2=ywr;var Ewr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};It.AISearchKeyword=Ewr;var TNi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(TNi||(It.ChatErrorLevel=TNi={}));var INi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(INi||(It.ChatInputNotificationSeverity=INi={}));var xNi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(xNi||(It.ChatRequestEditedFileEventKind=xNi={}));var wNi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(wNi||(It.ChatResponseClearToPreviousToolInvocationReason=wNi={}));var _wr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};It.LanguageModelToolExtensionSource=_wr;var vwr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};It.LanguageModelToolMCPSource=vwr;var Cwr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};It.LanguageModelToolCallPart=Cwr;var bwr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart=bwr;var Swr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart2=Swr;var Hyt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Hyt||(It.LanguageModelChatMessageRole=Hyt={}));var RNi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(RNi||(It.LanguageModelChatToolMode=RNi={}));var Twr=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(Hyt.User,e,r)}static Assistant(e,r){return new t(Hyt.Assistant,e,r)}};It.LanguageModelChatMessage=Twr;var Iwr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};It.McpToolInvocationContentData=Iwr;var xwr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};It.ChatToolInvocationPart=xwr;var wwr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};It.ChatSubagentToolInvocationData=wwr;var Rwr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn2=Rwr;var kNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(kNi||(It.ChatSessionStatus=kNi={}));var kwr=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??""}};It.LanguageModelError=kwr;var Pwr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};It.ChatResource=Pwr;var Dwr=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}};It.McpStdioServerDefinition=Dwr;var Nwr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};It.McpHttpServerDefinition=Nwr});var MNi=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.TextDocumentChangeReason=C$.TextEditorSelectionChangeKind=C$.WorkspaceEdit=void 0;var tJa=Tl(),rJa=KP(),nJa=iL(),iJa=xxr(),oJa=Nxr(),Mwr=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 oJa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new nJa.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,iJa.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(Rp,"__esModule",{value:!0});Rp.FileType=Rp.ChatSessionStatus=Rp.ChatLocation=Rp.ChatVariableLevel=Rp.ExtensionMode=Rp.DiagnosticSeverity=Rp.TextEditorRevealType=Rp.TextEditorLineNumbersStyle=Rp.TextEditorCursorStyle=Rp.InteractiveEditorResponseFeedbackKind=void 0;var ONi;(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"})(ONi||(Rp.InteractiveEditorResponseFeedbackKind=ONi={}));var LNi;(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"})(LNi||(Rp.TextEditorCursorStyle=LNi={}));var BNi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(BNi||(Rp.TextEditorLineNumbersStyle=BNi={}));var FNi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(FNi||(Rp.TextEditorRevealType=FNi={}));var UNi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(UNi||(Rp.DiagnosticSeverity=UNi={}));var QNi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(QNi||(Rp.ExtensionMode=QNi={}));var qNi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(qNi||(Rp.ChatVariableLevel=qNi={}));var jNi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(jNi||(Rp.ChatLocation=jNi={}));var HNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(HNi||(Rp.ChatSessionStatus=HNi={}));var GNi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(GNi||(Rp.FileType=GNi={}))});var WNi=I(Owr=>{"use strict";p();Object.defineProperty(Owr,"__esModule",{value:!0});Owr.t=sJa;function sJa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return VNi({message:e,args:r})}return VNi(t[0])}a(sJa,"t");function VNi(t){let{message:e,args:r}=t;return cJa(e,r??{})}a(VNi,"getMessage");var aJa=/{([^}]+)}/g;function cJa(t,e){return t.replace(aJa,(r,n)=>e[n]??r)}a(cJa,"format2")});var KNi=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.NewSymbolName=b$.NewSymbolNameTriggerKind=b$.NewSymbolNameTag=void 0;var zNi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(zNi||(b$.NewSymbolNameTag=zNi={}));var YNi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(YNi||(b$.NewSymbolNameTriggerKind=YNi={}));var Lwr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};b$.NewSymbolName=Lwr});var ZNi=I($yt=>{"use strict";p();Object.defineProperty($yt,"__esModule",{value:!0});$yt.TerminalShellExecutionCommandLineConfidence=void 0;var JNi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(JNi||($yt.TerminalShellExecutionCommandLineConfidence=JNi={}))});var XNi=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.ThemeColor=MAe.ThemeIcon=void 0;var Bwr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};MAe.ThemeIcon=Bwr;var Fwr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};MAe.ThemeColor=Fwr});var D0=I((VLp,nMi)=>{"use strict";p();var lJa=JP(),uJa=Ic(),dJa=id(),eMi=qIr(),fJa=GIr(),pJa=hxr(),G4e=dNi(),hJa=DAe(),mJa=iL(),gJa=pNi(),AJa=Txr(),yJa=xxr(),tMi=ANi(),rMi=Nxr(),On=PNi(),Uwr=MNi(),S$=$Ni(),EJa=WNi(),Qwr=KNi(),_Ja=ZNi(),vJa=XNi(),CJa={Position:hJa.Position,Range:mJa.Range,Selection:gJa.Selection,EventEmitter:uJa.Emitter,CancellationTokenSource:lJa.CancellationTokenSource,Diagnostic:eMi.Diagnostic,Location:fJa.Location,DiagnosticRelatedInformation:eMi.DiagnosticRelatedInformation,TextEdit:rMi.TextEdit,WorkspaceEdit:Uwr.WorkspaceEdit,Uri:dJa.URI,MarkdownString:pJa.MarkdownString,DiagnosticSeverity:S$.DiagnosticSeverity,TextEditorCursorStyle:S$.TextEditorCursorStyle,TextEditorLineNumbersStyle:S$.TextEditorLineNumbersStyle,TextEditorRevealType:S$.TextEditorRevealType,EndOfLine:rMi.EndOfLine,l10n:{t:EJa.t},ExtensionMode:S$.ExtensionMode,ChatVariableLevel:S$.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:On.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:On.ChatResponseMarkdownPart,ChatResponseFileTreePart:On.ChatResponseFileTreePart,ChatResponseAnchorPart:On.ChatResponseAnchorPart,ChatResponseMovePart:On.ChatResponseMovePart,ChatResponseExtensionsPart:On.ChatResponseExtensionsPart,ChatResponseProgressPart:On.ChatResponseProgressPart,ChatResponseProgressPart2:On.ChatResponseProgressPart2,ChatResponseWarningPart:On.ChatResponseWarningPart,ChatResponseInfoPart:On.ChatResponseInfoPart,ChatResponseHookPart:On.ChatResponseHookPart,ChatResponseReferencePart:On.ChatResponseReferencePart,ChatResponseReferencePart2:On.ChatResponseReferencePart2,ChatResponseCodeCitationPart:On.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:On.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:On.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:On.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:On.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:On.ChatResponseTextEditPart,ChatResponseNotebookEditPart:On.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:On.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:On.ChatResponseConfirmationPart,ChatQuestion:On.ChatQuestion,ChatQuestionType:On.ChatQuestionType,ChatResponseQuestionCarouselPart:On.ChatResponseQuestionCarouselPart,ChatRequestTurn:On.ChatRequestTurn,ChatResponseTurn:On.ChatResponseTurn,ChatRequestEditorData:On.ChatRequestEditorData,ChatRequestNotebookData:On.ChatRequestNotebookData,NewSymbolName:Qwr.NewSymbolName,NewSymbolNameTag:Qwr.NewSymbolNameTag,NewSymbolNameTriggerKind:Qwr.NewSymbolNameTriggerKind,ChatLocation:S$.ChatLocation,SymbolInformation:tMi.SymbolInformation,LanguageModelToolResult:On.LanguageModelToolResult,ExtendedLanguageModelToolResult:On.LanguageModelToolResult,LanguageModelToolResult2:On.LanguageModelToolResult2,LanguageModelPromptTsxPart:On.LanguageModelPromptTsxPart,LanguageModelTextPart:On.LanguageModelTextPart,LanguageModelDataPart:On.LanguageModelDataPart,LanguageModelToolExtensionSource:On.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:On.LanguageModelToolMCPSource,ChatReferenceBinaryData:On.ChatReferenceBinaryData,ChatReferenceDiagnostic:On.ChatReferenceDiagnostic,TextSearchMatch2:On.TextSearchMatch2,AISearchKeyword:On.AISearchKeyword,ExcludeSettingOptions:On.ExcludeSettingOptions,NotebookCellKind:G4e.NotebookCellKind,NotebookRange:G4e.NotebookRange,NotebookEdit:G4e.NotebookEdit,NotebookCellData:G4e.NotebookCellData,NotebookData:G4e.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:_Ja.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:On.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:On.ChatResponsePullRequestPart,LanguageModelTextPart2:On.LanguageModelTextPart2,LanguageModelDataPart2:On.LanguageModelDataPart2,LanguageModelThinkingPart:On.LanguageModelThinkingPart,LanguageModelPartAudience:On.LanguageModelPartAudience,ChatResponseThinkingProgressPart:On.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:On.LanguageModelToolCallPart,LanguageModelToolResultPart:On.LanguageModelToolResultPart,LanguageModelToolResultPart2:On.LanguageModelToolResultPart2,LanguageModelChatMessageRole:On.LanguageModelChatMessageRole,LanguageModelChatMessage:On.LanguageModelChatMessage,LanguageModelChatToolMode:On.LanguageModelChatToolMode,TextEditorSelectionChangeKind:Uwr.TextEditorSelectionChangeKind,TextDocumentChangeReason:Uwr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:tMi.SymbolKind,SnippetString:AJa.SnippetString,SnippetTextEdit:yJa.SnippetTextEdit,FileType:S$.FileType,ChatSessionStatus:On.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:On.McpHttpServerDefinition,McpStdioServerDefinition:On.McpStdioServerDefinition,ThemeIcon:vJa.ThemeIcon};nMi.exports=CJa});var iMi=I(OAe=>{"use strict";p();Object.defineProperty(OAe,"__esModule",{value:!0});OAe.UseData=OAe.UseState=void 0;var qwr=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}};OAe.UseState=qwr;var jwr=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)}}};OAe.UseData=jwr});var sMi=I(Vyt=>{"use strict";p();Object.defineProperty(Vyt,"__esModule",{value:!0});Vyt.VirtualPromptReconciler=void 0;var oMi=iMi(),Hwr=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(bJa(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 $wr(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 Gwr([])),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)}};Vyt.VirtualPromptReconciler=Hwr;var Gwr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},$wr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new oMi.UseState(e.state),this.dataHook=new oMi.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 bJa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(bJa,"isFragmentFunction")});var aMi=I(Wyt=>{"use strict";p();Object.defineProperty(Wyt,"__esModule",{value:!0});Wyt.VirtualPrompt=void 0;var SJa=sMi(),Vwr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new SJa.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()}};Wyt.VirtualPrompt=Vwr});var k6=I(zyt=>{"use strict";p();Object.defineProperty(zyt,"__esModule",{value:!0});zyt.Text=TJa;zyt.Chunk=IJa;function TJa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(TJa,"Text");function IJa(t){return t.children}a(IJa,"Chunk")});var T$=I(P6=>{"use strict";p();Object.defineProperty(P6,"__esModule",{value:!0});P6.PerCompletionContextProviderStatistics=P6.ContextProviderStatistics=P6.ICompletionsContextProviderService=void 0;P6.componentStatisticsToPromptMatcher=RJa;var xJa=nn(),wJa=S6();P6.ICompletionsContextProviderService=(0,xJa.createServiceIdentifier)("ICompletionsContextProviderService");var Wwr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Yyt){this.createStatistics=e,this.statistics=new wJa.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)}}};P6.ContextProviderStatistics=Wwr;var Yyt=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()}}};P6.PerCompletionContextProviderStatistics=Yyt;function RJa(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(RJa,"componentStatisticsToPromptMatcher")});var W4e=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.filterContextItemsByType=NJa;V4e.filterSupportedContextItems=MJa;V4e.addOrValidateContextItemsIDs=LJa;var kJa=D0(),PJa=id(),zwr=I0(),DJa=u4e(),Ywr=Nl(),$4e;(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&&!DJa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})($4e||($4e={}));var Kwr;(function(t){function e(r){if(!$4e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(Kwr||(Kwr={}));var Jwr;(function(t){function e(r){if(!$4e.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})(Jwr||(Jwr={}));var Zwr;(function(t){function e(r){if(!$4e.is(r))return!1;let n=r;if(!PJa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof kJa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(Zwr||(Zwr={}));var Xwr;(function(t){function e(r){if(Kwr.is(r))return"Trait";if(Jwr.is(r))return"CodeSnippet";if(Zwr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(Xwr||(Xwr={}));function NJa(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(NJa,"filterContextItemsByType");function MJa(t){let e=[],r=0;return t.forEach(n=>{let o=Xwr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(MJa,"filterSupportedContextItems");function OJa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(OJa,"validateContextItemId");function LJa(t,e){let r=new Set,n=t.get(Ywr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,zwr.generateUuid)();if(!OJa(c)){let l=(0,zwr.generateUuid)();Ywr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,zwr.generateUuid)();Ywr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(LJa,"addOrValidateContextItemsIDs")});var eRr=I(Kyt=>{"use strict";p();Object.defineProperty(Kyt,"__esModule",{value:!0});Kyt.getCodeSnippetsFromContextItems=qJa;Kyt.addRelativePathToCodeSnippets=jJa;var BJa=s1(),FJa=T$(),UJa=W4e(),QJa="content_excluded";async function qJa(t,e,r,n){let o=(0,UJa.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(FJa.ICompletionsContextProviderService),u=t.get(BJa.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,QJa]]),g}).map(h=>h.data)}a(qJa,"getCodeSnippetsFromContextItems");function jJa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(jJa,"addRelativePathToCodeSnippets")});var tRr=I(Xyt=>{"use strict";p();Object.defineProperty(Xyt,"__esModule",{value:!0});Xyt.CodeSnippets=void 0;var Jyt=nL(),Zyt=k6(),HJa=D6(),GJa=eRr(),$Ja=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(HJa.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,GJa.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,Jyt.jsx)(Zyt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Jyt.jsx)(Zyt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(LAe,"__esModule",{value:!0});LAe.CompletionsContext=cMi;LAe.StableCompletionsContext=lMi;LAe.AdditionalCompletionsContext=uMi;LAe.isContextNode=VJa;function cMi(t){return t.children}a(cMi,"CompletionsContext");function lMi(t){return t.children}a(lMi,"StableCompletionsContext");function uMi(t){return t.children}a(uMi,"AdditionalCompletionsContext");function VJa(t){return t.name===cMi.name||t.name===lMi.name||t.name===uMi.name}a(VJa,"isContextNode")});var nRr=I(Y4e=>{"use strict";p();Object.defineProperty(Y4e,"__esModule",{value:!0});Y4e.SnapshotWalker=void 0;Y4e.defaultTransformers=dMi;var WJa=k6(),rRr=class{static{a(this,"SnapshotWalker")}constructor(e,r=dMi()){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)}};Y4e.SnapshotWalker=rRr;function dMi(){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===WJa.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(dMi,"defaultTransformers")});var fMi=I(iRr=>{"use strict";p();Object.defineProperty(iRr,"__esModule",{value:!0});iRr.findEditDistanceScore=zJa;function zJa(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(UD,"__esModule",{value:!0});UD.MAX_EDIT_DISTANCE_LENGTH=void 0;UD.CurrentFile=ZJa;UD.BeforeCursor=aRr;UD.AfterCursor=cRr;UD.DocumentPrefix=XJa;UD.DocumentSuffix=eZa;var QR=nL(),BAe=k6(),YJa=t$(),KJa=fMi(),JJa=Lre(),oRr=D6();UD.MAX_EDIT_DISTANCE_LENGTH=50;function sRr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(sRr,"approximateMaxCharacters");function ZJa(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(oRr.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=sRr(c);return(0,QR.jsxs)(QR.Fragment,{children:[(0,QR.jsx)(aRr,{document:r,position:o,maxCharacters:m}),(0,QR.jsx)(cRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(ZJa,"CurrentFile");function aRr(t){if(t.document===void 0||t.position===void 0)return(0,QR.jsx)(BAe.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,QR.jsx)(BAe.Text,{children:e})}a(aRr,"BeforeCursor");function cRr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,QR.jsx)(BAe.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,QR.jsx)(BAe.Text,{});if(r===s)return(0,QR.jsx)(BAe.Text,{children:r});let c=s;if(r!==""){let l=(0,JJa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,UD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,UD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,KJa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??YJa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,QR.jsx)(BAe.Text,{children:c})}a(cRr,"AfterCursor");function XJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(oRr.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=sRr(c);return(0,QR.jsx)(aRr,{document:r,position:o,maxCharacters:u})}a(XJa,"DocumentPrefix");function eZa(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(oRr.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=sRr(c);return(0,QR.jsx)(cRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(eZa,"DocumentSuffix")});var uRr=I(rne=>{"use strict";p();Object.defineProperty(rne,"__esModule",{value:!0});rne.WishlistElision=void 0;rne.makePrompt=tZa;rne.makePrefixPrompt=rZa;rne.makeContextPrompt=nZa;var lRr=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]}};rne.WishlistElision=lRr;function tZa(t){return t.map(e=>e.elidedValue).join("")}a(tZa,"makePrompt");function rZa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(rZa,"makePrefixPrompt");function nZa(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(nZa,"makeContextPrompt")});var pRr=I(I$=>{"use strict";p();Object.defineProperty(I$,"__esModule",{value:!0});I$.transformers=I$.CompletionsPromptRenderer=void 0;I$.normalizeLineEndings=fRr;var gMi=nRr(),pMi=O4e(),hMi=Lre(),iZa=z4e(),eEt=K4e(),mMi=uRr(),oZa=5,dRr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=mMi.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??hMi.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 mMi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,hMi.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(...sZa([...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-oZa: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 gMi.SnapshotWalker(e,I$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===eEt.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:fRr(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,pMi.isShebangLine)(f.value)?y=A:y=(0,pMi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:fRr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${eEt.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}}};I$.CompletionsPromptRenderer=dRr;I$.transformers=[...(0,gMi.defaultTransformers)(),(t,e,r)=>(0,iZa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===eEt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===eEt.AfterCursor.name?{...r,type:"suffix"}:r];function sZa(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(sZa,"computeComponentStatistics");function fRr(t){return t.replace(/\r\n?/g,` +`)}a(fRr,"normalizeLineEndings")});var tEt=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.ILanguageContextProviderService=FAe.ProviderTarget=void 0;var aZa=nn(),AMi;(function(t){t.NES="nes",t.Completions="completions"})(AMi||(FAe.ProviderTarget=AMi={}));FAe.ILanguageContextProviderService=(0,aZa.createServiceIdentifier)("ILanguageContextProviderService")});var nne=I(UAe=>{"use strict";p();Object.defineProperty(UAe,"__esModule",{value:!0});UAe.RuntimeMode=UAe.ICompletionsRuntimeModeService=void 0;var cZa=nn();UAe.ICompletionsRuntimeModeService=(0,cZa.createServiceIdentifier)("completionsRuntimeModeService");var hRr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:yMi(r,n),verboseLogging:uZa(r,n),testMode:e,simulation:lZa(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}};UAe.RuntimeMode=hRr;function yMi(t,e){return t.includes("--debug")||mRr(e,"DEBUG")}a(yMi,"determineDebugFlag");function lZa(t){return mRr(t,"SIMULATION")}a(lZa,"determineSimulationFlag");function uZa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||mRr(e,"VERBOSE")||yMi(t,e)}a(uZa,"determineVerboseLoggingEnabled");function mRr(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(mRr,"determineEnvFlagEnabled")});var CMi=I(J4e=>{"use strict";p();Object.defineProperty(J4e,"__esModule",{value:!0});J4e.eventToPromise=dZa;J4e.isArrayOfT=vMi;J4e.resolveAll=pZa;var EMi=b4e();async function dZa(t){let e=new EMi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(dZa,"eventToPromise");async function fZa(t){if(t.isCancellationRequested)return;let e=new EMi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(fZa,"cancellationTokenToPromise");async function _Mi(t,e){if(e){let r=fZa(e);await Promise.race([t,r])}else await t}a(_Mi,"raceCancellation");function vMi(t){return Array.isArray(t)}a(vMi,"isArrayOfT");async function pZa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await hZa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(pZa,"resolveAll");async function hZa(t,e){let r;return t instanceof Promise?r=await mZa(t,e):r=await gZa(t,e),r}a(hZa,"resolve");async function mZa(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:vMi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await _Mi(o,e),n.resolutionTime=performance.now()-r,n}a(mZa,"resolvePromise");async function gZa(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 _Mi(o,e),n.resolutionTime=performance.now()-r,n}a(gZa,"resolveIterable")});var bMi=I(ARr=>{"use strict";p();Object.defineProperty(ARr,"__esModule",{value:!0});ARr.fillInCppVSCodeActiveExperiments=_Za;var AZa=py(),gRr=Nl(),yZa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},EZa="ms-vscode.cpptools";function _Za(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(EZa))&&vZa(t,r,n)}a(_Za,"fillInCppVSCodeActiveExperiments");function vZa(t,e,r){try{let n=t.get(AZa.ICompletionsFeaturesService),o=t.get(gRr.ICompletionsLogTargetService),s=yZa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){gRr.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){gRr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(vZa,"addActiveExperiments")});var TMi=I(yRr=>{"use strict";p();Object.defineProperty(yRr,"__esModule",{value:!0});yRr.fillInCSharpActiveExperiments=bZa;var CZa=py(),SMi=Nl();function bZa(t,e,r){let n=t.get(CZa.ICompletionsFeaturesService),o=t.get(SMi.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 SMi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(bZa,"fillInCSharpActiveExperiments")});var IMi=I(x$=>{"use strict";p();Object.defineProperty(x$,"__esModule",{value:!0});x$.multiLanguageContextProviderParamsDefault=void 0;x$.fillInMultiLanguageActiveExperiments=IZa;x$.getMultiLanguageContextProviderParamsFromActiveExperiments=RZa;var SZa=py(),ERr=Nl(),TZa="fallbackContextProvider";x$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function IZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(TZa))&&xZa(t,r,n)}a(IZa,"fillInMultiLanguageActiveExperiments");function xZa(t,e,r){try{let n=wZa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){ERr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(xZa,"addActiveExperiments");function wZa(t,e){let r=x$.multiLanguageContextProviderParamsDefault,n=t.get(ERr.ICompletionsLogTargetService),s=t.get(SZa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){ERr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(wZa,"getMultiLanguageContextProviderParamsFromExp");function RZa(t){let e={...x$.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(RZa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var wMi=I(QAe=>{"use strict";p();Object.defineProperty(QAe,"__esModule",{value:!0});QAe.TS_CONTEXT_PROVIDER_ID=void 0;QAe.fillInTsActiveExperiments=PZa;var kZa=py(),xMi=Nl();QAe.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function PZa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(QAe.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(xMi.ICompletionsLogTargetService),s=t.get(kZa.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 xMi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(PZa,"fillInTsActiveExperiments")});var iEt=I(Ml=>{"use strict";p();var SRr=Ml&&Ml.__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},QD=Ml&&Ml.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ml,"__esModule",{value:!0});Ml.DefaultDiagnosticSettings=Ml.CachedContextProviderRegistry=Ml.MutableContextProviderRegistry=Ml.CoreContextProviderRegistry=Ml.DefaultContextProvidersContainer=Ml.ICompletionsDefaultContextProviders=Ml.ICompletionsContextProviderRegistryService=void 0;Ml.telemetrizeContextItems=QZa;Ml.matchContextItems=qZa;Ml.useContextProviderAPI=HZa;Ml.getDefaultDiagnosticSettings=$Za;var DZa=ei(),RMi=Dl(),TRr=tEt(),NZa=Ah(),DMi=nn(),MZa=Rs(),IRr=Gs(),rEt=BE(),NMi=py(),OZa=S6(),N6=Nl(),xRr=nne(),kMi=CMi(),LZa=bMi(),BZa=TMi(),FZa=IMi(),UZa=wMi(),PMi=W4e(),MMi=T$();Ml.ICompletionsContextProviderRegistryService=(0,DMi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Ml.ICompletionsDefaultContextProviders=(0,DMi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var _Rr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Ml.DefaultContextProvidersContainer=_Rr;var nEt=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([TRr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return N6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(BZa.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 N6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(LZa.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(FZa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(UZa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new DZa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(GZa,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,kMi.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,MZa.isCancellationError)(x.reason)||N6.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")&&(N6.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,kMi.isArrayOfT)(q)?P.push(...q):q&&P.push(q),P.length>0&&(x.status="partial")}catch(q){N6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,PMi.filterSupportedContextItems)(P);N&&N6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(PMi.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 N6.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(OMi,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]}))}};Ml.CoreContextProviderRegistry=nEt;Ml.CoreContextProviderRegistry=nEt=SRr([QD(1,TRr.ILanguageContextProviderService),QD(2,xRr.ICompletionsRuntimeModeService),QD(3,IRr.IInstantiationService),QD(4,N6.ICompletionsLogTargetService),QD(5,MMi.ICompletionsContextProviderService)],nEt);var vRr=class extends nEt{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)}};Ml.MutableContextProviderRegistry=vRr;Ml.MutableContextProviderRegistry=vRr=SRr([QD(1,TRr.ILanguageContextProviderService),QD(2,xRr.ICompletionsRuntimeModeService),QD(3,IRr.IInstantiationService),QD(4,N6.ICompletionsLogTargetService),QD(5,MMi.ICompletionsContextProviderService)],vRr);var CRr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new OZa.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}};Ml.CachedContextProviderRegistry=CRr;Ml.CachedContextProviderRegistry=CRr=SRr([QD(2,IRr.IInstantiationService)],CRr);function QZa(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(QZa,"telemetrizeContextItems");function qZa(t){return t.matchScore>0&&t.resolution!=="error"}a(qZa,"matchContextItems");function OMi(t,e,r){let n=jZa(t,e,r),o=(0,rEt.getConfig)(t,rEt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Ml.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(OMi,"getActiveContextProviders");function jZa(t,e,r){if(t.get(xRr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(NMi.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(jZa,"getExpContextProviders");function HZa(t,e,r){return OMi(t,e,r).length>0}a(HZa,"useContextProviderAPI");function GZa(t,e,r){let n=(0,rEt.getConfig)(t,rEt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(NMi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(GZa,"getContextProviderTimeBudget");var bRr;(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")})(bRr||(Ml.DefaultDiagnosticSettings=bRr={}));function $Za(t){let e=t.get(RMi.IConfigurationService),r=t.get(NZa.IExperimentationService),n=e.getExperimentBasedConfig(RMi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return bRr.from(n)}a($Za,"getDefaultDiagnosticSettings")});var oEt=I(qD=>{"use strict";p();var VZa=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},WZa=qD&&qD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qD,"__esModule",{value:!0});qD.ContextProviderBridge=qD.ICompletionsContextProviderBridgeService=void 0;var zZa=nn(),YZa=S6(),KZa=iEt();qD.ICompletionsContextProviderBridgeService=(0,zZa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var wRr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new YZa.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:[]}};qD.ContextProviderBridge=wRr;qD.ContextProviderBridge=wRr=VZa([WZa(0,KZa.ICompletionsContextProviderRegistryService)],wRr)});var PRr=I(sEt=>{"use strict";p();Object.defineProperty(sEt,"__esModule",{value:!0});sEt.Diagnostics=void 0;var RRr=nL(),JZa=D0(),kRr=k6(),ZZa=t$(),XZa=D6();function eXa(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(eXa,"getCode");function tXa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(tXa,"getRelativePath");var rXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(XZa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,ZZa.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,RRr.jsx)(kRr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${tXa(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=eXa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,RRr.jsx)(kRr.Text,{children:`${_.line+1}:${_.character+1} - ${JZa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,RRr.jsx)(kRr.Chunk,{children:m})})},"Diagnostics");sEt.Diagnostics=rXa});var DRr=I(cEt=>{"use strict";p();Object.defineProperty(cEt,"__esModule",{value:!0});cEt.DocumentMarker=void 0;var aEt=nL(),LMi=k6(),BMi=O4e(),nXa=D6(),iXa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(nXa.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,aEt.jsx)(oXa,{docInfo:s}):(0,aEt.jsx)(sXa,{docInfo:s})}},"DocumentMarker");cEt.DocumentMarker=iXa;var oXa=a(t=>(0,aEt.jsx)(LMi.Text,{children:(0,BMi.getPathMarker)(t.docInfo)}),"PathMarker"),sXa=a(t=>(0,aEt.jsx)(LMi.Text,{children:(0,BMi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var NRr=I(Z4e=>{"use strict";p();Object.defineProperty(Z4e,"__esModule",{value:!0});Z4e.RecentEdits=void 0;Z4e.editIsTooCloseToCursor=QMi;var FMi=nL(),UMi=k6(),lEt=O4e(),aXa=D6();function QMi(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(QMi,"editIsTooCloseToCursor");var cXa=a((t,e)=>{let[r,n]=e.useState();return e.useData(aXa.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(QMi(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,lEt.newLineEnded)(`File: ${T}`)+(0,lEt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,lEt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,lEt.newLineEnded)("End of recent edits");n(h)}),r?(0,FMi.jsx)(UMi.Chunk,{children:(0,FMi.jsx)(UMi.Text,{children:r})}):void 0},"RecentEdits");Z4e.RecentEdits=cXa});var qMi=I(aL=>{"use strict";p();Object.defineProperty(aL,"__esModule",{value:!0});aL.registerDocumentTracker=aL.accessTimes=void 0;aL.sortByAccessTimes=dXa;var lXa=S6(),uXa=s1();aL.accessTimes=new lXa.LRUCacheMap;function dXa(t){return[...t].sort((e,r)=>{let n=aL.accessTimes.get(e.uri)??0;return(aL.accessTimes.get(r.uri)??0)-n})}a(dXa,"sortByAccessTimes");var fXa=a(t=>t.get(uXa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&aL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");aL.registerDocumentTracker=fXa});var jMi=I(M6=>{"use strict";p();var pXa=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},hXa=M6&&M6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M6,"__esModule",{value:!0});M6.OpenTabFiles=void 0;var mXa=qMi(),gXa=s1(),MRr=qAe(),ORr=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>MRr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,MRr.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,mXa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(MRr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};M6.OpenTabFiles=ORr;M6.OpenTabFiles=ORr=pXa([hXa(0,gXa.ICompletionsTextDocumentManagerService)],ORr)});var HMi=I(LRr=>{"use strict";p();Object.defineProperty(LRr,"__esModule",{value:!0});LRr.shortCircuit=AXa;function AXa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(AXa,"shortCircuit")});var mEt=I(Ol=>{"use strict";p();var yXa=Ol&&Ol.__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},uEt=Ol&&Ol.__param||function(t,e){return function(r,n){e(r,n,t)}},BRr;Object.defineProperty(Ol,"__esModule",{value:!0});Ol.RelatedFilesProvider=Ol.ICompletionsRelatedFilesProviderService=Ol.relatedFilesLogger=Ol.PromiseExpirationCacheMap=Ol.EmptyRelatedFilesResponse=void 0;Ol.getRelatedFilesAndTraits=wXa;var EXa=Fre(),_Xa=nn(),vXa=id(),QRr=Gs(),CXa=a$(),bXa=S6(),hEt=Nl(),SXa=Vg(),TXa=HMi();Ol.EmptyRelatedFilesResponse={entries:[],traits:[]};var dEt={entries:new Map,traits:[]},fEt=class extends bXa.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.timestampOl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Ol.RelatedFilesProvider=FRr;Ol.RelatedFilesProvider=FRr=BRr=yXa([uEt(0,QRr.IInstantiationService),uEt(1,EXa.IIgnoreService),uEt(2,hEt.ICompletionsLogTargetService),uEt(3,CXa.ICompletionsFileSystemService)],FRr);var xXa=3,X4e=new fEt(IXa);async function GMi(t,e,r,n,o){let s=t.get(QRr.IInstantiationService),c=t.get(hEt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Ol.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(X4e.bumpRetryCount(e.uri)>=xXa?u=dEt:u=void 0);let d=performance.now()-l;if(Ol.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 pEt;return u}a(GMi,"getRelatedFiles");var URr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(X4e.has(s))return X4e.get(s);let c=GMi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw X4e.delete(s),l})),X4e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");URr=(0,TXa.shortCircuit)(URr,200,dEt);async function wXa(t,e,r,n,o,s=!1){let c=t.get(QRr.IInstantiationService),l=t.get(hEt.ICompletionsLogTargetService),u=t.get(Ol.ICompletionsRelatedFilesProviderService),d=dEt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(GMi,f,r,n,u):await c.invokeFunction(URr,f,r,n,u)}catch(f){d=dEt,f instanceof pEt&&c.invokeFunction(SXa.telemetry,"getRelatedFilesList",r)}return Ol.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(wXa,"getRelatedFilesAndTraits")});var qAe=I(w$=>{"use strict";p();Object.defineProperty(w$,"__esModule",{value:!0});w$.NeighborSource=w$.NeighboringFileType=void 0;w$.considerNeighborFile=NXa;w$.isIncludeNeighborFilesActive=MXa;var RXa=Gs(),$Mi=t$(),WMi=py(),kXa=Nl(),PXa=s1(),DXa=jMi(),gEt=mEt(),VMi;(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"})(VMi||(w$.NeighboringFileType=VMi={}));function NXa(t,e){return(0,$Mi.normalizeLanguageId)(t)===(0,$Mi.normalizeLanguageId)(e)}a(NXa,"considerNeighborFile");var qRr=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(WMi.ICompletionsFeaturesService),d=e.get(kXa.ICompletionsLogTargetService),f=e.get(RXa.IInstantiationService),h=e.get(PXa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(DXa.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 gEt.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 gEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(gEt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(gEt.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)}};w$.NeighborSource=qRr;function MXa(t,e,r){return t.get(WMi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(MXa,"isIncludeNeighborFilesActive")});var HRr=I(AEt=>{"use strict";p();Object.defineProperty(AEt,"__esModule",{value:!0});AEt.SimilarFiles=void 0;var jAe=nL(),jRr=k6(),OXa=byt(),LXa=TIr(),BXa=Tyt(),FXa=D6(),UXa=HAe(),zMi=qAe(),QXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(FXa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=zMi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await zMi.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(UXa.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,LXa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(BXa.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,OXa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,jAe.jsxs)(jAe.Fragment,{children:[...o.map((u,d)=>(0,jAe.jsx)(qXa,{snippet:u}))]})},"SimilarFiles");AEt.SimilarFiles=QXa;var qXa=a((t,e)=>(0,jAe.jsxs)(jRr.Chunk,{children:[(0,jAe.jsx)(jRr.Text,{children:t.snippet.headline}),(0,jAe.jsx)(jRr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var rOi=I(iI=>{"use strict";p();Object.defineProperty(iI,"__esModule",{value:!0});iI.getAllRecentEditsByTimestamp=jXa;iI.findChangeSpan=GRr;iI.getDiff=KMi;iI.unifiedDiff=JMi;iI.findReplaceDiff=ZMi;iI.editsOverlap=XMi;iI.updateEdits=eOi;iI.buildIncomingEdit=$Rr;iI.trimOldFilesFromState=tOi;iI.recentEditsReducer=$Xa;iI.summarizeEdit=VXa;function jXa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(jXa,"getAllRecentEditsByTimestamp");function GRr(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(GRr,"findChangeSpan");function KMi(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(KMi,"getDiff");function HXa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(HXa,"measureDiffSize");function JMi(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(HMi,"unifiedDiff");function wXa(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(wXa,"aidersDiff");function GMi(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(GMi,"findReplaceDiff");function qMi(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(qMi,"applyEditsToLines");function $Mi(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($Mi,"editsOverlap");function VMi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if($Mi(r,c,o.editMergeLineDistance)){let u=qMi(t.split(` -`),s.slice(0,-1)),d=QRr(u,n);d&&(r=qRr(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=qMi(t.split(` +`}a(JMi,"unifiedDiff");function GXa(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(GXa,"aidersDiff");function ZMi(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(ZMi,"findReplaceDiff");function YMi(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(YMi,"applyEditsToLines");function XMi(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(XMi,"editsOverlap");function eOi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(XMi(r,c,o.editMergeLineDistance)){let u=YMi(t.split(` +`),s.slice(0,-1)),d=GRr(u,n);d&&(r=$Rr(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=YMi(t.split(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(VMi,"updateEdits");function qRr(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=jMi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(qRr,"buildIncomingEdit");function WMi(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(eOi,"updateEdits");function $Rr(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=KMi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a($Rr,"buildIncomingEdit");function tOi(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=QRr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=qRr(e,s,c,l,n);if(xXa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=VMi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return WMi(h,n.maxFiles)}a(RXa,"recentEditsReducer");function kXa(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=wXa(t.diff);else if(e.summarizationFormat==="diff")o=HMi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=GMi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(kXa,"summarizeEdit")});var hEt=I(UD=>{"use strict";p();var PXa=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},DXa=UD&&UD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(UD,"__esModule",{value:!0});UD.FullRecentEditsProvider=UD.ICompletionsRecentEditsProviderService=void 0;var NXa=h4(),MXa=nn(),OXa=Ro(),LXa=C8(),BXa=USr(),jRr=zMi();UD.ICompletionsRecentEditsProviderService=(0,MXa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var FXa=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}),HRr=class extends OXa.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({},FXa)}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,jRr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,jRr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,jRr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,LXa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,NXa.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))}};UD.FullRecentEditsProvider=HRr;UD.FullRecentEditsProvider=HRr=PXa([DXa(1,BXa.ICompletionsObservableWorkspace)],HRr)});var GRr=I(gEt=>{"use strict";p();Object.defineProperty(gEt,"__esModule",{value:!0});gEt.Traits=void 0;var mEt=rL(),YMi=w6(),UXa=JG(),QXa=k6(),qXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(QXa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,UXa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,mEt.jsxs)(mEt.Fragment,{children:[(0,mEt.jsx)(YMi.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,mEt.jsx)(YMi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");gEt.Traits=qXa});var ZMi=I($Rr=>{"use strict";p();Object.defineProperty($Rr,"__esModule",{value:!0});$Rr.splitContextCompletionsPrompt=JXa;var UR=rL(),jXa=Gs(),HXa=s1(),GXa=hEt(),$Xa=Jwr(),KMi=H4e(),JMi=$4e(),VXa=xRr(),WXa=wRr(),zXa=RRr(),YXa=URr(),KXa=GRr();function JXa(t){let e=t.get(jXa.IInstantiationService),r=t.get(HXa.ICompletionsTextDocumentManagerService),n=t.get(GXa.ICompletionsRecentEditsProviderService);return(0,UR.jsxs)(UR.Fragment,{children:[(0,UR.jsxs)(KMi.StableCompletionsContext,{children:[(0,UR.jsx)(WXa.DocumentMarker,{tdms:r,weight:.7}),(0,UR.jsx)(KXa.Traits,{weight:.6}),(0,UR.jsx)(VXa.Diagnostics,{tdms:r,weight:.65}),(0,UR.jsx)($Xa.CodeSnippets,{tdms:r,weight:.9}),(0,UR.jsx)(YXa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,UR.jsx)(JMi.DocumentSuffix,{weight:1}),(0,UR.jsx)(KMi.AdditionalCompletionsContext,{children:(0,UR.jsx)(zXa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,UR.jsx)(JMi.DocumentPrefix,{weight:1})]})}a(JXa,"splitContextCompletionsPrompt")});var rOi=I(yEt=>{"use strict";p();Object.defineProperty(yEt,"__esModule",{value:!0});yEt.SplitContextPromptRenderer=void 0;var ZXa=Xwr(),XXa=H4e(),AEt=lRr(),XMi=$4e(),eOi=sRr(),tOi=0;function eec(){tOi=0}a(eec,"resetContextIndex");function tec(){return tOi++}a(tec,"getNextContextIndex");var VRr=class extends AEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=eOi.makePrefixPrompt,this.formatContext=eOi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(eec(),new ZXa.SnapshotWalker(e,rec).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===XMi.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,AEt.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,AEt.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 ${XMi.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}}};yEt.SplitContextPromptRenderer=VRr;var rec=[...AEt.transformers,(t,e,r)=>(0,XXa.isContextNode)(t)?{...r,index:tec()}:r]});var T$=I(N6=>{"use strict";p();Object.defineProperty(N6,"__esModule",{value:!0});N6.AbstractLanguageDiagnosticsService=N6.ILanguageDiagnosticsService=void 0;N6.rangeSpanningDiagnostics=oec;N6.isError=sec;N6.getDiagnosticsAtSelection=aec;var nec=nn(),iec=ZP(),WRr=P0();N6.ILanguageDiagnosticsService=(0,nec.createServiceIdentifier)("ILanguageDiagnosticService");var zRr=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,iec.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};N6.AbstractLanguageDiagnosticsService=zRr;function oec(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(oec,"rangeSpanningDiagnostics");function sec(t){return t.severity===WRr.DiagnosticSeverity.Error}a(sec,"isError");function aec(t,e,r=[WRr.DiagnosticSeverity.Error,WRr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(aec,"getDiagnosticsAtSelection")});var iOi=I(YRr=>{"use strict";p();Object.defineProperty(YRr,"__esModule",{value:!0});YRr.getDiagnosticsFromContextItems=dec;var cec=s1(),nOi=v$(),lec=j4e(),uec="content_excluded";async function dec(t,e,r){let n=(0,lec.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)fec(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(nOi.ICompletionsContextProviderService),l=t.get(cec.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,uec]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(dec,"getDiagnosticsFromContextItems");function fec(t,e,r,n){let o=t.get(nOi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(fec,"setupExpectationsForDiagnosticBags")});var oOi=I(EEt=>{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.getTraitsFromContextItems=gec;EEt.ReportTraitsTelemetry=Eec;var pec=$g(),hec=v$(),mec=j4e();function gec(t,e,r){let n=(0,mec.filterContextItemsByType)(r,"Trait");for(let s of n)Aec(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(gec,"getTraitsFromContextItems");function Aec(t,e,r,n){let o=t.get(hec.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Aec,"setupExpectationsForTraits");var yec=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Eec(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=yec.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,pec.telemetry)(t,e,l)}}a(Eec,"ReportTraitsTelemetry")});var k6=I(d1=>{"use strict";p();var lOi=d1&&d1.__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},u1=d1&&d1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d1,"__esModule",{value:!0});d1.TestComponentsCompletionsPromptFactory=d1.ComponentsCompletionsPromptFactory=d1.PromptOrdering=void 0;d1.isCompletionRequestData=Fec;var aL=rL(),sOi=P0(),ekr=Dl(),uOi=Bre(),KRr=nd(),tkr=Gs(),dOi=bte(),aOi=XNi(),_ec=$g(),vec=s1(),Cec=Jwr(),bec=H4e(),Sec=lRr(),fOi=tEt(),Tec=$4e(),Iec=xRr(),xec=wRr(),wec=RRr(),Rec=URr(),kec=ZMi(),Pec=rOi(),Dec=GRr(),pOi=T$(),Nec=T0(),Y4e=eEt(),Mec=Kwr(),Oec=iOi(),cOi=oOi(),rkr=v$(),QD=qAe(),Lec=hEt(),Bec=UAe();function Fec(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(Fec,"isCompletionRequestData");var I$;(function(t){t.Default="default",t.SplitContext="splitContext"})(I$||(d1.PromptOrdering=I$={}));var JRr={[I$.Default]:{promptFunction:hOi,renderer:Sec.CompletionsPromptRenderer},[I$.SplitContext]:{promptFunction:kec.splitContextCompletionsPrompt,renderer:Pec.SplitContextPromptRenderer}};function hOi(t){let e=t.get(vec.ICompletionsTextDocumentManagerService),r=t.get(tkr.IInstantiationService),n=t.get(Lec.ICompletionsRecentEditsProviderService);return(0,aL.jsxs)(aL.Fragment,{children:[(0,aL.jsxs)(bec.CompletionsContext,{children:[(0,aL.jsx)(xec.DocumentMarker,{tdms:e,weight:.7}),(0,aL.jsx)(Dec.Traits,{weight:.6}),(0,aL.jsx)(Iec.Diagnostics,{tdms:e,weight:.65}),(0,aL.jsx)(Cec.CodeSnippets,{tdms:e,weight:.9}),(0,aL.jsx)(Rec.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,aL.jsx)(wec.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,aL.jsx)(Tec.CurrentFile,{weight:1})]})}a(hOi,"defaultCompletionsPrompt");var _Et=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??I$.Default,this.virtualPrompt=e??new aOi.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(QD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?I$.SplitContext:I$.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 QD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return QD._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 QD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,QD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(Y4e.useContextProviderAPI,P,n)){let N=(0,rkr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,Y4e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),ekr.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(Y4e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(Y4e.matchContextItems);this.instantiationService.invokeFunction(Uec,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(cOi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(cOi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(Mec.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Oec.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(Y4e.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 QD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(KRr.URI.parse(e.uri)))return QD._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,_ec.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),QD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new aOi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=JRr[this.promptOrdering]?.promptFunction??hOi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=JRr[this.promptOrdering]??JRr[I$.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(KRr.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===sOi.DiagnosticSeverity.Error?d.push(_):_.severity===sOi.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:KRr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Nec.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)}};_Et=lOi([u1(2,tkr.IInstantiationService),u1(3,dOi.ICompletionsTelemetryService),u1(4,uOi.IIgnoreService),u1(5,fOi.ICompletionsContextProviderBridgeService),u1(6,ekr.ICompletionsLogTargetService),u1(7,rkr.ICompletionsContextProviderService),u1(8,pOi.ILanguageDiagnosticsService)],_Et);var ZRr=class extends _Et{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};d1.ComponentsCompletionsPromptFactory=ZRr;d1.ComponentsCompletionsPromptFactory=ZRr=lOi([u1(0,tkr.IInstantiationService),u1(1,dOi.ICompletionsTelemetryService),u1(2,uOi.IIgnoreService),u1(3,fOi.ICompletionsContextProviderBridgeService),u1(4,ekr.ICompletionsLogTargetService),u1(5,rkr.ICompletionsContextProviderService),u1(6,pOi.ILanguageDiagnosticsService)],ZRr);var XRr=class extends _Et{static{a(this,"TestComponentsCompletionsPromptFactory")}};d1.TestComponentsCompletionsPromptFactory=XRr;function Uec(t,e,r,n){let o=["cpp","c"];return(0,Bec.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Uec,"similarFilesEnabled")});var ckr=I(HE=>{"use strict";p();var mOi=HE&&HE.__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},gOi=HE&&HE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HE,"__esModule",{value:!0});HE.TestCompletionsPromptFactory=HE.CompletionsPromptFactory=HE.DEFAULT_PROMPT_TIMEOUT=HE.ICompletionsPromptFactoryService=void 0;var Qec=ri(),AOi=Gs(),nkr=qAe(),qec=k6(),jec=nn();HE.ICompletionsPromptFactoryService=(0,jec.createServiceIdentifier)("ICompletionsPromptFactoryService");var ikr=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 nkr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return nkr._promptError}}};HE.DEFAULT_PROMPT_TIMEOUT=1200;var okr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Qec.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(nkr._promptTimeout)},HE.DEFAULT_PROMPT_TIMEOUT)})])}},vEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new ikr(new okr(n.createInstance(qec.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};vEt=mOi([gOi(2,AOi.IInstantiationService)],vEt);var skr=class extends vEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};HE.CompletionsPromptFactory=skr;HE.CompletionsPromptFactory=skr=mOi([gOi(0,AOi.IInstantiationService)],skr);var akr=class extends vEt{static{a(this,"TestCompletionsPromptFactory")}};HE.TestCompletionsPromptFactory=akr});var qAe=I(gh=>{"use strict";p();Object.defineProperty(gh,"__esModule",{value:!0});gh.PromptResponse=gh._promptTimeout=gh._promptCancelled=gh._promptError=gh._copilotContentExclusion=gh._contextTooShort=gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=gh.MIN_PROMPT_CHARS=void 0;gh.trimLastLine=Yec;gh.extractPrompt=Kec;gh.getPromptOptions=Xec;var Hec=k4e(),Gec=fy(),yOi=vyt(),$ec=M4e(),Vec=s1(),Wec=ckr(),zec=UAe();gh.MIN_PROMPT_CHARS=10;gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];gh._contextTooShort={type:"contextTooShort"};gh._copilotContentExclusion={type:"copilotContentExclusion"};gh._promptError={type:"promptError"};gh._promptCancelled={type:"promptCancelled"};gh._promptTimeout={type:"promptTimeout"};var EOi;(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=GRr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=$Rr(e,s,c,l,n);if(HXa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=eOi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return tOi(h,n.maxFiles)}a($Xa,"recentEditsReducer");function VXa(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=GXa(t.diff);else if(e.summarizationFormat==="diff")o=JMi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=ZMi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(VXa,"summarizeEdit")});var yEt=I(jD=>{"use strict";p();var WXa=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},zXa=jD&&jD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jD,"__esModule",{value:!0});jD.FullRecentEditsProvider=jD.ICompletionsRecentEditsProviderService=void 0;var YXa=m4(),KXa=nn(),JXa=ko(),ZXa=S8(),XXa=HSr(),VRr=rOi();jD.ICompletionsRecentEditsProviderService=(0,KXa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var eec=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}),WRr=class extends JXa.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({},eec)}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,VRr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,VRr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,VRr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,ZXa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,YXa.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))}};jD.FullRecentEditsProvider=WRr;jD.FullRecentEditsProvider=WRr=WXa([zXa(1,XXa.ICompletionsObservableWorkspace)],WRr)});var zRr=I(_Et=>{"use strict";p();Object.defineProperty(_Et,"__esModule",{value:!0});_Et.Traits=void 0;var EEt=nL(),nOi=k6(),tec=t$(),rec=D6(),nec=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(rec.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,tec.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,EEt.jsxs)(EEt.Fragment,{children:[(0,EEt.jsx)(nOi.Text,{children:`Consider this related information: +`}),...r.map(c=>(0,EEt.jsx)(nOi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");_Et.Traits=nec});var sOi=I(YRr=>{"use strict";p();Object.defineProperty(YRr,"__esModule",{value:!0});YRr.splitContextCompletionsPrompt=pec;var qR=nL(),iec=Gs(),oec=s1(),sec=yEt(),aec=tRr(),iOi=z4e(),oOi=K4e(),cec=PRr(),lec=DRr(),uec=NRr(),dec=HRr(),fec=zRr();function pec(t){let e=t.get(iec.IInstantiationService),r=t.get(oec.ICompletionsTextDocumentManagerService),n=t.get(sec.ICompletionsRecentEditsProviderService);return(0,qR.jsxs)(qR.Fragment,{children:[(0,qR.jsxs)(iOi.StableCompletionsContext,{children:[(0,qR.jsx)(lec.DocumentMarker,{tdms:r,weight:.7}),(0,qR.jsx)(fec.Traits,{weight:.6}),(0,qR.jsx)(cec.Diagnostics,{tdms:r,weight:.65}),(0,qR.jsx)(aec.CodeSnippets,{tdms:r,weight:.9}),(0,qR.jsx)(dec.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,qR.jsx)(oOi.DocumentSuffix,{weight:1}),(0,qR.jsx)(iOi.AdditionalCompletionsContext,{children:(0,qR.jsx)(uec.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,qR.jsx)(oOi.DocumentPrefix,{weight:1})]})}a(pec,"splitContextCompletionsPrompt")});var uOi=I(CEt=>{"use strict";p();Object.defineProperty(CEt,"__esModule",{value:!0});CEt.SplitContextPromptRenderer=void 0;var hec=nRr(),mec=z4e(),vEt=pRr(),aOi=K4e(),cOi=uRr(),lOi=0;function gec(){lOi=0}a(gec,"resetContextIndex");function Aec(){return lOi++}a(Aec,"getNextContextIndex");var KRr=class extends vEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=cOi.makePrefixPrompt,this.formatContext=cOi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(gec(),new hec.SnapshotWalker(e,yec).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===aOi.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,vEt.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,vEt.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 ${aOi.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}}};CEt.SplitContextPromptRenderer=KRr;var yec=[...vEt.transformers,(t,e,r)=>(0,mec.isContextNode)(t)?{...r,index:Aec()}:r]});var R$=I(O6=>{"use strict";p();Object.defineProperty(O6,"__esModule",{value:!0});O6.AbstractLanguageDiagnosticsService=O6.ILanguageDiagnosticsService=void 0;O6.rangeSpanningDiagnostics=vec;O6.isError=Cec;O6.getDiagnosticsAtSelection=bec;var Eec=nn(),_ec=e2(),JRr=D0();O6.ILanguageDiagnosticsService=(0,Eec.createServiceIdentifier)("ILanguageDiagnosticService");var ZRr=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,_ec.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};O6.AbstractLanguageDiagnosticsService=ZRr;function vec(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(vec,"rangeSpanningDiagnostics");function Cec(t){return t.severity===JRr.DiagnosticSeverity.Error}a(Cec,"isError");function bec(t,e,r=[JRr.DiagnosticSeverity.Error,JRr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(bec,"getDiagnosticsAtSelection")});var fOi=I(XRr=>{"use strict";p();Object.defineProperty(XRr,"__esModule",{value:!0});XRr.getDiagnosticsFromContextItems=xec;var Sec=s1(),dOi=T$(),Tec=W4e(),Iec="content_excluded";async function xec(t,e,r){let n=(0,Tec.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)wec(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(dOi.ICompletionsContextProviderService),l=t.get(Sec.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,Iec]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(xec,"getDiagnosticsFromContextItems");function wec(t,e,r,n){let o=t.get(dOi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(wec,"setupExpectationsForDiagnosticBags")});var pOi=I(bEt=>{"use strict";p();Object.defineProperty(bEt,"__esModule",{value:!0});bEt.getTraitsFromContextItems=Dec;bEt.ReportTraitsTelemetry=Oec;var Rec=Vg(),kec=T$(),Pec=W4e();function Dec(t,e,r){let n=(0,Pec.filterContextItemsByType)(r,"Trait");for(let s of n)Nec(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Dec,"getTraitsFromContextItems");function Nec(t,e,r,n){let o=t.get(kec.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Nec,"setupExpectationsForTraits");var Mec=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Oec(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=Mec.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,Rec.telemetry)(t,e,l)}}a(Oec,"ReportTraitsTelemetry")});var D6=I(d1=>{"use strict";p();var AOi=d1&&d1.__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},u1=d1&&d1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d1,"__esModule",{value:!0});d1.TestComponentsCompletionsPromptFactory=d1.ComponentsCompletionsPromptFactory=d1.PromptOrdering=void 0;d1.isCompletionRequestData=etc;var cL=nL(),hOi=D0(),ikr=Nl(),yOi=Fre(),ekr=id(),okr=Gs(),EOi=Ste(),mOi=aMi(),Lec=Vg(),Bec=s1(),Fec=tRr(),Uec=z4e(),Qec=pRr(),_Oi=oEt(),qec=K4e(),jec=PRr(),Hec=DRr(),Gec=NRr(),$ec=HRr(),Vec=sOi(),Wec=uOi(),zec=zRr(),vOi=R$(),Yec=I0(),eLe=iEt(),Kec=eRr(),Jec=fOi(),gOi=pOi(),skr=T$(),HD=HAe(),Zec=yEt(),Xec=qAe();function etc(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(etc,"isCompletionRequestData");var k$;(function(t){t.Default="default",t.SplitContext="splitContext"})(k$||(d1.PromptOrdering=k$={}));var tkr={[k$.Default]:{promptFunction:COi,renderer:Qec.CompletionsPromptRenderer},[k$.SplitContext]:{promptFunction:Vec.splitContextCompletionsPrompt,renderer:Wec.SplitContextPromptRenderer}};function COi(t){let e=t.get(Bec.ICompletionsTextDocumentManagerService),r=t.get(okr.IInstantiationService),n=t.get(Zec.ICompletionsRecentEditsProviderService);return(0,cL.jsxs)(cL.Fragment,{children:[(0,cL.jsxs)(Uec.CompletionsContext,{children:[(0,cL.jsx)(Hec.DocumentMarker,{tdms:e,weight:.7}),(0,cL.jsx)(zec.Traits,{weight:.6}),(0,cL.jsx)(jec.Diagnostics,{tdms:e,weight:.65}),(0,cL.jsx)(Fec.CodeSnippets,{tdms:e,weight:.9}),(0,cL.jsx)($ec.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,cL.jsx)(Gec.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,cL.jsx)(qec.CurrentFile,{weight:1})]})}a(COi,"defaultCompletionsPrompt");var SEt=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??k$.Default,this.virtualPrompt=e??new mOi.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(HD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?k$.SplitContext:k$.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 HD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return HD._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 HD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,HD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(eLe.useContextProviderAPI,P,n)){let N=(0,skr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,eLe.telemetrizeContextItems)(this.contextProviderStatistics,e,E),ikr.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(eLe.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(eLe.matchContextItems);this.instantiationService.invokeFunction(ttc,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(gOi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(gOi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(Kec.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Jec.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(eLe.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 HD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(ekr.URI.parse(e.uri)))return HD._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,Lec.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),HD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new mOi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=tkr[this.promptOrdering]?.promptFunction??COi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=tkr[this.promptOrdering]??tkr[k$.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(ekr.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===hOi.DiagnosticSeverity.Error?d.push(_):_.severity===hOi.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:ekr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Yec.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)}};SEt=AOi([u1(2,okr.IInstantiationService),u1(3,EOi.ICompletionsTelemetryService),u1(4,yOi.IIgnoreService),u1(5,_Oi.ICompletionsContextProviderBridgeService),u1(6,ikr.ICompletionsLogTargetService),u1(7,skr.ICompletionsContextProviderService),u1(8,vOi.ILanguageDiagnosticsService)],SEt);var rkr=class extends SEt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};d1.ComponentsCompletionsPromptFactory=rkr;d1.ComponentsCompletionsPromptFactory=rkr=AOi([u1(0,okr.IInstantiationService),u1(1,EOi.ICompletionsTelemetryService),u1(2,yOi.IIgnoreService),u1(3,_Oi.ICompletionsContextProviderBridgeService),u1(4,ikr.ICompletionsLogTargetService),u1(5,skr.ICompletionsContextProviderService),u1(6,vOi.ILanguageDiagnosticsService)],rkr);var nkr=class extends SEt{static{a(this,"TestComponentsCompletionsPromptFactory")}};d1.TestComponentsCompletionsPromptFactory=nkr;function ttc(t,e,r,n){let o=["cpp","c"];return(0,Xec.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(ttc,"similarFilesEnabled")});var fkr=I(GE=>{"use strict";p();var bOi=GE&&GE.__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},SOi=GE&&GE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(GE,"__esModule",{value:!0});GE.TestCompletionsPromptFactory=GE.CompletionsPromptFactory=GE.DEFAULT_PROMPT_TIMEOUT=GE.ICompletionsPromptFactoryService=void 0;var rtc=ei(),TOi=Gs(),akr=HAe(),ntc=D6(),itc=nn();GE.ICompletionsPromptFactoryService=(0,itc.createServiceIdentifier)("ICompletionsPromptFactoryService");var ckr=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 akr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return akr._promptError}}};GE.DEFAULT_PROMPT_TIMEOUT=1200;var lkr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new rtc.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(akr._promptTimeout)},GE.DEFAULT_PROMPT_TIMEOUT)})])}},TEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new ckr(new lkr(n.createInstance(ntc.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};TEt=bOi([SOi(2,TOi.IInstantiationService)],TEt);var ukr=class extends TEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};GE.CompletionsPromptFactory=ukr;GE.CompletionsPromptFactory=ukr=bOi([SOi(0,TOi.IInstantiationService)],ukr);var dkr=class extends TEt{static{a(this,"TestCompletionsPromptFactory")}};GE.TestCompletionsPromptFactory=dkr});var HAe=I(yh=>{"use strict";p();Object.defineProperty(yh,"__esModule",{value:!0});yh.PromptResponse=yh._promptTimeout=yh._promptCancelled=yh._promptError=yh._copilotContentExclusion=yh._contextTooShort=yh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=yh.MIN_PROMPT_CHARS=void 0;yh.trimLastLine=dtc;yh.extractPrompt=ftc;yh.getPromptOptions=mtc;var otc=O4e(),stc=py(),IOi=Tyt(),atc=U4e(),ctc=s1(),ltc=fkr(),utc=qAe();yh.MIN_PROMPT_CHARS=10;yh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];yh._contextTooShort={type:"contextTooShort"};yh._copilotContentExclusion={type:"copilotContentExclusion"};yh._promptError={type:"promptError"};yh._promptCancelled={type:"promptCancelled"};yh._promptTimeout={type:"promptTimeout"};var xOi;(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} @@ -1020,14 +1020,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(EOi||(gh.PromptResponse=EOi={}));function Yec(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(Yec,"trimLastLine");function Kec(t,e,r,n,o,s={}){let l=t.get(Vec.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Zec(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Wec.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(Kec,"extractPrompt");function Jec(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Hec.commentBlockAsSingles)(n,e)}a(Jec,"addNeighboringCellsToPrompt");function Zec(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Jec(l,r.document.detectedLanguageId)).join(` +`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(xOi||(yh.PromptResponse=xOi={}));function dtc(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(dtc,"trimLastLine");function ftc(t,e,r,n,o,s={}){let l=t.get(ctc.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=htc(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(ltc.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(ftc,"extractPrompt");function ptc(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,otc.commentBlockAsSingles)(n,e)}a(ptc,"addNeighboringCellsToPrompt");function htc(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>ptc(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Zec,"applyEditsForNotebook");function Xec(t,e,r){let n=t.get(Gec.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,$ec.getMaxSolutionTokens)(),c=(0,yOi.getNumberOfSnippets)(e,r),l=(0,yOi.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(Xec,"getPromptOptions")});var COi=I(x$=>{"use strict";p();Object.defineProperty(x$,"__esModule",{value:!0});x$.TypeSystem=x$.TypeSystemDuplicateFormat=x$.TypeSystemDuplicateTypeKind=void 0;var CEt=Hge(),etc=n4e(),ttc=Sn(),vOi=Nf(),bEt=class extends vOi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};x$.TypeSystemDuplicateTypeKind=bEt;var SEt=class extends vOi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};x$.TypeSystemDuplicateFormat=SEt;var _Oi;(function(t){function e(n,o){if(CEt.TypeRegistry.Has(n))throw new bEt(n);return CEt.TypeRegistry.Set(n,o),(s={})=>(0,etc.Unsafe)({...s,[ttc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(CEt.FormatRegistry.Has(n))throw new SEt(n);return CEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(_Oi||(x$.TypeSystem=_Oi={}))});var lkr=I(w$=>{"use strict";p();var rtc=w$&&w$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bOi=w$&&w$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rtc(e,t,r)};Object.defineProperty(w$,"__esModule",{value:!0});bOi(T5e(),w$);bOi(COi(),w$)});var ukr=I(K4e=>{"use strict";p();Object.defineProperty(K4e,"__esModule",{value:!0});K4e.DefaultErrorFunction=SOi;K4e.SetErrorFunction=itc;K4e.GetErrorFunction=otc;var ntc=Sn(),qn=dkr();function SOi(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[ntc.Kind]}'`;default:return"Unknown error type"}}a(SOi,"DefaultErrorFunction");var TOi=SOi;function itc(t){TOi=t}a(itc,"SetErrorFunction");function otc(){return TOi}a(otc,"GetErrorFunction")});var wOi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.TypeDereferenceError=void 0;jAe.Pushref=ltc;jAe.Deref=xOi;var stc=Nf(),IOi=Sn(),atc=Egt(),TEt=class extends stc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};jAe.TypeDereferenceError=TEt;function ctc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new TEt(t);return xOi(r,e)}a(ctc,"Resolve");function ltc(t,e){return!(0,atc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(ltc,"Pushref");function xOi(t,e){return t[IOi.Kind]==="This"||t[IOi.Kind]==="Ref"?ctc(t,e):t}a(xOi,"Deref")});var qD=I(nne=>{"use strict";p();var utc=nne&&nne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dtc=nne&&nne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&utc(e,t,r)};Object.defineProperty(nne,"__esModule",{value:!0});dtc(wOi(),nne)});var DOi=I(J4e=>{"use strict";p();Object.defineProperty(J4e,"__esModule",{value:!0});J4e.ValueHashError=void 0;J4e.Hash=wtc;var jD=R0(),ftc=Nf(),IEt=class extends ftc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};J4e.ValueHashError=IEt;var nI;(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"})(nI||(nI={}));var HAe=BigInt("14695981039346656037"),[ptc,htc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],mtc=Array.from({length:256}).map((t,e)=>BigInt(e)),ROi=new Float64Array(1),kOi=new DataView(ROi.buffer),POi=new Uint8Array(ROi.buffer);function*gtc(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(gtc,"NumberToBytes");function Atc(t){GE(nI.Array);for(let e of t)GAe(e)}a(Atc,"ArrayType");function ytc(t){GE(nI.Boolean),GE(t?1:0)}a(ytc,"BooleanType");function Etc(t){GE(nI.BigInt),kOi.setBigInt64(0,t);for(let e of POi)GE(e)}a(Etc,"BigIntType");function _tc(t){GE(nI.Date),GAe(t.getTime())}a(_tc,"DateType");function vtc(t){GE(nI.Null)}a(vtc,"NullType");function Ctc(t){GE(nI.Number),kOi.setFloat64(0,t);for(let e of POi)GE(e)}a(Ctc,"NumberType");function btc(t){GE(nI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())GAe(e),GAe(t[e])}a(btc,"ObjectType");function Stc(t){GE(nI.String);for(let e=0;e{"use strict";p();var Rtc=ine&&ine.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ktc=ine&&ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rtc(e,t,r)};Object.defineProperty(ine,"__esModule",{value:!0});ktc(DOi(),ine)});var pkr=I(tLe=>{"use strict";p();Object.defineProperty(tLe,"__esModule",{value:!0});tLe.ValueCheckUnknownTypeError=void 0;tLe.Check=Arc;var X4e=lkr(),fkr=qD(),Ptc=Z4e(),$Ae=Sn(),NOi=mD(),Dtc=ure(),eLe=Hge(),Ntc=Nf(),Mtc=Cm(),wm=R0(),Otc=vs(),xEt=class extends Ntc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};tLe.ValueCheckUnknownTypeError=xEt;function Ltc(t){return t[$Ae.Kind]==="Any"||t[$Ae.Kind]==="Unknown"}a(Ltc,"IsAnyOrUnknown");function ia(t){return t!==void 0}a(ia,"IsDefined");function Btc(t,e,r){return!0}a(Btc,"FromAny");function Ftc(t,e,r){return!0}a(Ftc,"FromArgument");function Utc(t,e,r){if(!(0,wm.IsArray)(r)||ia(t.minItems)&&!(r.length>=t.minItems)||ia(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Jg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,Ptc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ia(t.contains)||(0,wm.IsNumber)(t.minContains)||(0,wm.IsNumber)(t.maxContains)))return!0;let n=ia(t.contains)?t.contains:(0,Mtc.Never)(),o=r.reduce((s,c)=>Jg(n,e,c)?s+1:s,0);return!(o===0||(0,wm.IsNumber)(t.minContains)&&ot.maxContains)}a(Utc,"FromArray");function Qtc(t,e,r){return(0,wm.IsAsyncIterator)(r)}a(Qtc,"FromAsyncIterator");function qtc(t,e,r){return!(!(0,wm.IsBigInt)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(qtc,"FromBigInt");function jtc(t,e,r){return(0,wm.IsBoolean)(r)}a(jtc,"FromBoolean");function Htc(t,e,r){return Jg(t.returns,e,r.prototype)}a(Htc,"FromConstructor");function Gtc(t,e,r){return!(!(0,wm.IsDate)(r)||ia(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ia(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ia(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ia(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Gtc,"FromDate");function $tc(t,e,r){return(0,wm.IsFunction)(r)}a($tc,"FromFunction");function Vtc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Jg(o,[...e,...n],r)}a(Vtc,"FromImport");function Wtc(t,e,r){return!(!(0,wm.IsInteger)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(Wtc,"FromInteger");function ztc(t,e,r){let n=t.allOf.every(o=>Jg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,NOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,Otc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,NOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Jg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(ztc,"FromIntersect");function Ytc(t,e,r){return(0,wm.IsIterator)(r)}a(Ytc,"FromIterator");function Ktc(t,e,r){return r===t.const}a(Ktc,"FromLiteral");function Jtc(t,e,r){return!1}a(Jtc,"FromNever");function Ztc(t,e,r){return!Jg(t.not,e,r)}a(Ztc,"FromNot");function Xtc(t,e,r){return(0,wm.IsNull)(r)}a(Xtc,"FromNull");function erc(t,e,r){return!(!X4e.TypeSystemPolicy.IsNumberLike(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(erc,"FromNumber");function trc(t,e,r){if(!X4e.TypeSystemPolicy.IsObjectLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(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(!Jg(s,e,r[o])||((0,Dtc.ExtendsUndefinedCheck)(s)||Ltc(s))&&!(o in r))return!1}else if(X4e.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Jg(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)||Jg(t.additionalProperties,e,r[s])):!0}a(trc,"FromObject");function rrc(t,e,r){return(0,wm.IsPromise)(r)}a(rrc,"FromPromise");function nrc(t,e,r){if(!X4e.TypeSystemPolicy.IsRecordLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(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)?Jg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Jg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(nrc,"FromRecord");function irc(t,e,r){return Jg((0,fkr.Deref)(t,e),e,r)}a(irc,"FromRef");function orc(t,e,r){let n=new RegExp(t.source,t.flags);return ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(orc,"FromRegExp");function src(t,e,r){return!(0,wm.IsString)(r)||ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)||ia(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ia(t.format)?eLe.FormatRegistry.Has(t.format)?eLe.FormatRegistry.Get(t.format)(r):!1:!0}a(src,"FromString");function arc(t,e,r){return(0,wm.IsSymbol)(r)}a(arc,"FromSymbol");function crc(t,e,r){return(0,wm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(crc,"FromTemplateLiteral");function lrc(t,e,r){return Jg((0,fkr.Deref)(t,e),e,r)}a(lrc,"FromThis");function urc(t,e,r){if(!(0,wm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nJg(n,e,r))}a(frc,"FromUnion");function prc(t,e,r){return!(!(0,wm.IsUint8Array)(r)||ia(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ia(t.minByteLength)&&!(r.length>=t.minByteLength))}a(prc,"FromUint8Array");function hrc(t,e,r){return!0}a(hrc,"FromUnknown");function mrc(t,e,r){return X4e.TypeSystemPolicy.IsVoidLike(r)}a(mrc,"FromVoid");function grc(t,e,r){return eLe.TypeRegistry.Has(t[$Ae.Kind])?eLe.TypeRegistry.Get(t[$Ae.Kind])(t,r):!1}a(grc,"FromKind");function Jg(t,e,r){let n=ia(t.$id)?(0,fkr.Pushref)(t,e):e,o=t;switch(o[$Ae.Kind]){case"Any":return Btc(o,n,r);case"Argument":return Ftc(o,n,r);case"Array":return Utc(o,n,r);case"AsyncIterator":return Qtc(o,n,r);case"BigInt":return qtc(o,n,r);case"Boolean":return jtc(o,n,r);case"Constructor":return Htc(o,n,r);case"Date":return Gtc(o,n,r);case"Function":return $tc(o,n,r);case"Import":return Vtc(o,n,r);case"Integer":return Wtc(o,n,r);case"Intersect":return ztc(o,n,r);case"Iterator":return Ytc(o,n,r);case"Literal":return Ktc(o,n,r);case"Never":return Jtc(o,n,r);case"Not":return Ztc(o,n,r);case"Null":return Xtc(o,n,r);case"Number":return erc(o,n,r);case"Object":return trc(o,n,r);case"Promise":return rrc(o,n,r);case"Record":return nrc(o,n,r);case"Ref":return irc(o,n,r);case"RegExp":return orc(o,n,r);case"String":return src(o,n,r);case"Symbol":return arc(o,n,r);case"TemplateLiteral":return crc(o,n,r);case"This":return lrc(o,n,r);case"Tuple":return urc(o,n,r);case"Undefined":return drc(o,n,r);case"Union":return frc(o,n,r);case"Uint8Array":return prc(o,n,r);case"Unknown":return hrc(o,n,r);case"Void":return mrc(o,n,r);default:if(!eLe.TypeRegistry.Has(o[$Ae.Kind]))throw new xEt(o);return grc(o,n,r)}}a(Jg,"Visit");function Arc(...t){return t.length===3?Jg(t[0],t[1],t[2]):Jg(t[0],[],t[1])}a(Arc,"Check")});var iI=I(one=>{"use strict";p();var yrc=one&&one.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Erc=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yrc(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});Erc(pkr(),one)});var dkr=I(O6=>{"use strict";p();Object.defineProperty(O6,"__esModule",{value:!0});O6.ValueErrorIterator=O6.ValueErrorsUnknownTypeError=O6.ValueErrorType=void 0;O6.Errors=snc;var rLe=lkr(),MOi=mD(),wEt=Hge(),_rc=I1r(),vrc=ukr(),Crc=Nf(),OOi=qD(),brc=Z4e(),Src=iI(),hkr=Sn(),Trc=Cm(),Ah=R0(),tn;(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"})(tn||(O6.ValueErrorType=tn={}));var REt=class extends Crc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};O6.ValueErrorsUnknownTypeError=REt;function M6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(M6,"EscapeKey");function oa(t){return t!==void 0}a(oa,"IsDefined");var nLe=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}};O6.ValueErrorIterator=nLe;function cn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,vrc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(cn,"Create");function*Irc(t,e,r,n){}a(Irc,"FromAny");function*xrc(t,e,r,n){}a(xrc,"FromArgument");function*wrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Array,t,r,n);oa(t.minItems)&&!(n.length>=t.minItems)&&(yield cn(tn.ArrayMinItems,t,r,n)),oa(t.maxItems)&&!(n.length<=t.maxItems)&&(yield cn(tn.ArrayMaxItems,t,r,n));for(let c=0;cZg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield cn(tn.ArrayContains,t,r,n)),(0,Ah.IsNumber)(t.minContains)&&st.maxContains&&(yield cn(tn.ArrayMaxContains,t,r,n))}a(wrc,"FromArray");function*Rrc(t,e,r,n){(0,Ah.IsAsyncIterator)(n)||(yield cn(tn.AsyncIterator,t,r,n))}a(Rrc,"FromAsyncIterator");function*krc(t,e,r,n){if(!(0,Ah.IsBigInt)(n))return yield cn(tn.BigInt,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.BigIntExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.BigIntMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.BigIntMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield cn(tn.BigIntMultipleOf,t,r,n))}a(krc,"FromBigInt");function*Prc(t,e,r,n){(0,Ah.IsBoolean)(n)||(yield cn(tn.Boolean,t,r,n))}a(Prc,"FromBoolean");function*Drc(t,e,r,n){yield*Zg(t.returns,e,r,n.prototype)}a(Drc,"FromConstructor");function*Nrc(t,e,r,n){if(!(0,Ah.IsDate)(n))return yield cn(tn.Date,t,r,n);oa(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield cn(tn.DateExclusiveMinimumTimestamp,t,r,n)),oa(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield cn(tn.DateMaximumTimestamp,t,r,n)),oa(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield cn(tn.DateMinimumTimestamp,t,r,n)),oa(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield cn(tn.DateMultipleOfTimestamp,t,r,n))}a(Nrc,"FromDate");function*Mrc(t,e,r,n){(0,Ah.IsFunction)(n)||(yield cn(tn.Function,t,r,n))}a(Mrc,"FromFunction");function*Orc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Zg(s,[...e,...o],r,n)}a(Orc,"FromImport");function*Lrc(t,e,r,n){if(!(0,Ah.IsInteger)(n))return yield cn(tn.Integer,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.IntegerExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.IntegerMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.IntegerMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.IntegerMultipleOf,t,r,n))}a(Lrc,"FromInteger");function*Brc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Zg(s,e,r,n))o=!0,yield c;if(o)return yield cn(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,MOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield cn(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,MOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Zg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Brc,"FromIntersect");function*Frc(t,e,r,n){(0,Ah.IsIterator)(n)||(yield cn(tn.Iterator,t,r,n))}a(Frc,"FromIterator");function*Urc(t,e,r,n){n!==t.const&&(yield cn(tn.Literal,t,r,n))}a(Urc,"FromLiteral");function*Qrc(t,e,r,n){yield cn(tn.Never,t,r,n)}a(Qrc,"FromNever");function*qrc(t,e,r,n){Zg(t.not,e,r,n).next().done===!0&&(yield cn(tn.Not,t,r,n))}a(qrc,"FromNot");function*jrc(t,e,r,n){(0,Ah.IsNull)(n)||(yield cn(tn.Null,t,r,n))}a(jrc,"FromNull");function*Hrc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsNumberLike(n))return yield cn(tn.Number,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.NumberExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.NumberMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.NumberMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.NumberMultipleOf,t,r,n))}a(Hrc,"FromNumber");function*Grc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsObjectLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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 cn(tn.ObjectRequiredProperty,t.properties[l],`${r}/${M6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield cn(tn.ObjectAdditionalProperties,t,`${r}/${M6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Zg(t.additionalProperties,e,`${r}/${M6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Zg(u,e,`${r}/${M6(l)}`,n[l]),(0,_rc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield cn(tn.ObjectRequiredProperty,u,`${r}/${M6(l)}`,void 0))):rLe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Zg(u,e,`${r}/${M6(l)}`,n[l]))}}a(Grc,"FromObject");function*$rc(t,e,r,n){(0,Ah.IsPromise)(n)||(yield cn(tn.Promise,t,r,n))}a($rc,"FromPromise");function*Vrc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsRecordLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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*Zg(s,e,`${r}/${M6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Zg(t.additionalProperties,e,`${r}/${M6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield cn(tn.ObjectAdditionalProperties,t,`${r}/${M6(l)}`,u)}}a(Vrc,"FromRecord");function*Wrc(t,e,r,n){yield*Zg((0,OOi.Deref)(t,e),e,r,n)}a(Wrc,"FromRef");function*zrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);if(oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield cn(tn.RegExp,t,r,n)}a(zrc,"FromRegExp");function*Yrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),(0,Ah.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))),(0,Ah.IsString)(t.format)&&(wEt.FormatRegistry.Has(t.format)?wEt.FormatRegistry.Get(t.format)(n)||(yield cn(tn.StringFormat,t,r,n)):yield cn(tn.StringFormatUnknown,t,r,n))}a(Yrc,"FromString");function*Krc(t,e,r,n){(0,Ah.IsSymbol)(n)||(yield cn(tn.Symbol,t,r,n))}a(Krc,"FromSymbol");function*Jrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))}a(Jrc,"FromTemplateLiteral");function*Zrc(t,e,r,n){yield*Zg((0,OOi.Deref)(t,e),e,r,n)}a(Zrc,"FromThis");function*Xrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield cn(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield cn(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew nLe(Zg(s,e,r,n)));yield cn(tn.Union,t,r,n,o)}a(tnc,"FromUnion");function*rnc(t,e,r,n){if(!(0,Ah.IsUint8Array)(n))return yield cn(tn.Uint8Array,t,r,n);oa(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield cn(tn.Uint8ArrayMaxByteLength,t,r,n)),oa(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield cn(tn.Uint8ArrayMinByteLength,t,r,n))}a(rnc,"FromUint8Array");function*nnc(t,e,r,n){}a(nnc,"FromUnknown");function*inc(t,e,r,n){rLe.TypeSystemPolicy.IsVoidLike(n)||(yield cn(tn.Void,t,r,n))}a(inc,"FromVoid");function*onc(t,e,r,n){wEt.TypeRegistry.Get(t[hkr.Kind])(t,n)||(yield cn(tn.Kind,t,r,n))}a(onc,"FromKind");function*Zg(t,e,r,n){let o=oa(t.$id)?[...e,t]:e,s=t;switch(s[hkr.Kind]){case"Any":return yield*Irc(s,o,r,n);case"Argument":return yield*xrc(s,o,r,n);case"Array":return yield*wrc(s,o,r,n);case"AsyncIterator":return yield*Rrc(s,o,r,n);case"BigInt":return yield*krc(s,o,r,n);case"Boolean":return yield*Prc(s,o,r,n);case"Constructor":return yield*Drc(s,o,r,n);case"Date":return yield*Nrc(s,o,r,n);case"Function":return yield*Mrc(s,o,r,n);case"Import":return yield*Orc(s,o,r,n);case"Integer":return yield*Lrc(s,o,r,n);case"Intersect":return yield*Brc(s,o,r,n);case"Iterator":return yield*Frc(s,o,r,n);case"Literal":return yield*Urc(s,o,r,n);case"Never":return yield*Qrc(s,o,r,n);case"Not":return yield*qrc(s,o,r,n);case"Null":return yield*jrc(s,o,r,n);case"Number":return yield*Hrc(s,o,r,n);case"Object":return yield*Grc(s,o,r,n);case"Promise":return yield*$rc(s,o,r,n);case"Record":return yield*Vrc(s,o,r,n);case"Ref":return yield*Wrc(s,o,r,n);case"RegExp":return yield*zrc(s,o,r,n);case"String":return yield*Yrc(s,o,r,n);case"Symbol":return yield*Krc(s,o,r,n);case"TemplateLiteral":return yield*Jrc(s,o,r,n);case"This":return yield*Zrc(s,o,r,n);case"Tuple":return yield*Xrc(s,o,r,n);case"Undefined":return yield*enc(s,o,r,n);case"Union":return yield*tnc(s,o,r,n);case"Uint8Array":return yield*rnc(s,o,r,n);case"Unknown":return yield*nnc(s,o,r,n);case"Void":return yield*inc(s,o,r,n);default:if(!wEt.TypeRegistry.Has(s[hkr.Kind]))throw new REt(t);return yield*onc(s,o,r,n)}}a(Zg,"Visit");function snc(...t){let e=t.length===3?Zg(t[0],t[1],"",t[2]):Zg(t[0],[],"",t[1]);return new nLe(e)}a(snc,"Errors")});var VAe=I(R$=>{"use strict";p();var anc=R$&&R$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LOi=R$&&R$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&anc(e,t,r)};Object.defineProperty(R$,"__esModule",{value:!0});LOi(dkr(),R$);LOi(ukr(),R$)});var qOi=I(L6=>{"use strict";p();var cnc=L6&&L6.__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},FOi=L6&&L6.__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)},mkr,kEt,UOi;Object.defineProperty(L6,"__esModule",{value:!0});L6.AssertError=void 0;L6.Assert=dnc;var QOi=VAe(),lnc=RCr(),unc=pkr(),PEt=class extends lnc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),mkr.add(this),kEt.set(this,void 0),cnc(this,kEt,e,"f"),this.error=r}Errors(){return new QOi.ValueErrorIterator(FOi(this,mkr,"m",UOi).call(this))}};L6.AssertError=PEt;kEt=new WeakMap,mkr=new WeakSet,UOi=a(function*(){this.error&&(yield this.error),yield*FOi(this,kEt,"f")},"_AssertError_Iterator");function BOi(t,e,r){if(!(0,unc.Check)(t,e,r))throw new PEt((0,QOi.Errors)(t,e,r))}a(BOi,"AssertValue");function dnc(...t){return t.length===3?BOi(t[0],t[1],t[2]):BOi(t[0],[],t[1])}a(dnc,"Assert")});var DEt=I(sne=>{"use strict";p();var fnc=sne&&sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pnc=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fnc(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});pnc(qOi(),sne)});var jOi=I(gkr=>{"use strict";p();Object.defineProperty(gkr,"__esModule",{value:!0});gkr.Clone=WAe;var ane=R0();function hnc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=WAe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=WAe(t[r]);return e}a(hnc,"FromObject");function mnc(t){return t.map(e=>WAe(e))}a(mnc,"FromArray");function gnc(t){return t.slice()}a(gnc,"FromTypedArray");function Anc(t){return new Map(WAe([...t.entries()]))}a(Anc,"FromMap");function ync(t){return new Set(WAe([...t.entries()]))}a(ync,"FromSet");function Enc(t){return new Date(t.toISOString())}a(Enc,"FromDate");function WAe(t){if((0,ane.IsArray)(t))return mnc(t);if((0,ane.IsDate)(t))return Enc(t);if((0,ane.IsTypedArray)(t))return gnc(t);if((0,ane.IsMap)(t))return Anc(t);if((0,ane.IsSet)(t))return ync(t);if((0,ane.IsObject)(t))return hnc(t);if((0,ane.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(WAe,"Clone")});var HD=I(cne=>{"use strict";p();var _nc=cne&&cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vnc=cne&&cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_nc(e,t,r)};Object.defineProperty(cne,"__esModule",{value:!0});vnc(jOi(),cne)});var VOi=I(iLe=>{"use strict";p();Object.defineProperty(iLe,"__esModule",{value:!0});iLe.ValueCreateError=void 0;iLe.Create=cic;var Ba=R0(),Cnc=iI(),bnc=HD(),Akr=qD(),HOi=pD(),Snc=Hge(),GOi=Sn(),Tnc=Nf(),Inc=Egt(),f1=class extends Tnc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};iLe.ValueCreateError=f1;function Xa(t){return(0,Inc.IsFunction)(t)?t():(0,bnc.Clone)(t)}a(Xa,"FromDefault");function xnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(xnc,"FromAny");function wnc(t,e){return{}}a(wnc,"FromArgument");function Rnc(t,e){if(t.uniqueItems===!0&&!(0,Ba.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ba.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the contains constraint requires a default value");return"default"in t?Xa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>oI(t.items,e)):[]}a(Rnc,"FromArray");function knc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):(async function*(){})()}a(knc,"FromAsyncIterator");function Pnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):BigInt(0)}a(Pnc,"FromBigInt");function Dnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):!1}a(Dnc,"FromBoolean");function Nnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=oI(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(Nnc,"FromConstructor");function Mnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Mnc,"FromDate");function Onc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):()=>oI(t.returns,e)}a(Onc,"FromFunction");function Lnc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return oI(n,[...e,...r])}a(Lnc,"FromImport");function Bnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Bnc,"FromInteger");function Fnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=oI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,Cnc.Check)(t,e,r))throw new f1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(Fnc,"FromIntersect");function Unc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):(function*(){})()}a(Unc,"FromIterator");function Qnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.const}a(Qnc,"FromLiteral");function qnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Never types cannot be created. Consider using a default value.")}a(qnc,"FromNever");function jnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Not types must have a default value")}a(jnc,"FromNot");function Hnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):null}a(Hnc,"FromNull");function Gnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Gnc,"FromNumber");function $nc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=oI(s,e));return n}}a($nc,"FromObject");function Vnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):Promise.resolve(oI(t.item,e))}a(Vnc,"FromPromise");function Wnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(Wnc,"FromRecord");function znc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):oI((0,Akr.Deref)(t,e),e)}a(znc,"FromRef");function Ync(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"RegExp types cannot be created. Consider using a default value.")}a(Ync,"FromRegExp");function Knc(t,e){if(t.pattern!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with formats must specify a default value")}else return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Knc,"FromString");function Jnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Jnc,"FromSymbol");function Znc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);if(!(0,HOi.IsTemplateLiteralFinite)(t))throw new f1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,HOi.TemplateLiteralGenerate)(t)[0]}a(Znc,"FromTemplateLiteral");function Xnc(t,e){if($Oi++>aic)throw new f1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):oI((0,Akr.Deref)(t,e),e)}a(Xnc,"FromThis");function eic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>oI(t.items[n],e))}a(eic,"FromTuple");function tic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default)}a(tic,"FromUndefined");function ric(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return oI(t.anyOf[0],e)}a(ric,"FromUnion");function nic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(nic,"FromUint8Array");function iic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(iic,"FromUnknown");function oic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default)}a(oic,"FromVoid");function sic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new Error("User defined types must specify a default value")}a(sic,"FromKind");function oI(t,e){let r=(0,Akr.Pushref)(t,e),n=t;switch(n[GOi.Kind]){case"Any":return xnc(n,r);case"Argument":return wnc(n,r);case"Array":return Rnc(n,r);case"AsyncIterator":return knc(n,r);case"BigInt":return Pnc(n,r);case"Boolean":return Dnc(n,r);case"Constructor":return Nnc(n,r);case"Date":return Mnc(n,r);case"Function":return Onc(n,r);case"Import":return Lnc(n,r);case"Integer":return Bnc(n,r);case"Intersect":return Fnc(n,r);case"Iterator":return Unc(n,r);case"Literal":return Qnc(n,r);case"Never":return qnc(n,r);case"Not":return jnc(n,r);case"Null":return Hnc(n,r);case"Number":return Gnc(n,r);case"Object":return $nc(n,r);case"Promise":return Vnc(n,r);case"Record":return Wnc(n,r);case"Ref":return znc(n,r);case"RegExp":return Ync(n,r);case"String":return Knc(n,r);case"Symbol":return Jnc(n,r);case"TemplateLiteral":return Znc(n,r);case"This":return Xnc(n,r);case"Tuple":return eic(n,r);case"Undefined":return tic(n,r);case"Union":return ric(n,r);case"Uint8Array":return nic(n,r);case"Unknown":return iic(n,r);case"Void":return oic(n,r);default:if(!Snc.TypeRegistry.Has(n[GOi.Kind]))throw new f1(n,"Unknown type");return sic(n,r)}}a(oI,"Visit");var aic=512,$Oi=0;function cic(...t){return $Oi=0,t.length===2?oI(t[0],t[1]):oI(t[0],[])}a(cic,"Create")});var NEt=I(lne=>{"use strict";p();var lic=lne&&lne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uic=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lic(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});uic(VOi(),lne)});var KOi=I(aLe=>{"use strict";p();Object.defineProperty(aLe,"__esModule",{value:!0});aLe.ValueCastError=void 0;aLe.Cast=YOi;var QR=R0(),dic=Nf(),MEt=Sn(),k$=NEt(),sI=iI(),une=HD(),sLe=qD(),oLe=class extends dic.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};aLe.ValueCastError=oLe;function WOi(t,e,r){if(t[MEt.Kind]==="Object"&&typeof r=="object"&&!(0,QR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[MEt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,sI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[MEt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,sLe.Deref)(s,e)).map(s=>WOi(s,e,r));return Math.max(...o)}else return(0,sI.Check)(t,e,r)?1:0}a(WOi,"ScoreUnion");function fic(t,e,r){let n=t.anyOf.map(c=>(0,sLe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=WOi(c,e,r);l>s&&(o=c,s=l)}return o}a(fic,"SelectUnion");function pic(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,une.Clone)(t.default);{let n=fic(t,e,r);return YOi(n,e,r)}}a(pic,"CastUnion");function hic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):(0,k$.Create)(t,e)}a(hic,"DefaultClone");function mic(t,e,r){return(0,sI.Check)(t,e,r)?r:(0,k$.Create)(t,e)}a(mic,"Default");function gic(t,e,r){if((0,sI.Check)(t,e,r))return(0,une.Clone)(r);let n=(0,QR.IsArray)(r)?(0,une.Clone)(r):(0,k$.Create)(t,e),o=(0,QR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,QR.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,sI.Check)(t,e,l))throw new oLe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(gic,"FromArray");function Aic(t,e,r){if((0,sI.Check)(t,e,r))return(0,k$.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(Aic,"FromConstructor");function yic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return GD(o,[...e,...n],r)}a(yic,"FromImport");function zOi(t,e){return(0,QR.IsObject)(t)&&!(0,QR.IsObject)(e)||!(0,QR.IsObject)(t)&&(0,QR.IsObject)(e)?t:!(0,QR.IsObject)(t)||!(0,QR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?zOi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(zOi,"IntersectAssign");function Eic(t,e,r){if((0,sI.Check)(t,e,r))return r;let n=(0,k$.Create)(t,e),o=zOi(n,r);return(0,sI.Check)(t,e,o)?o:n}a(Eic,"FromIntersect");function _ic(t,e,r){throw new oLe(t,"Never types cannot be cast")}a(_ic,"FromNever");function vic(t,e,r){if((0,sI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,k$.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(vic,"FromObject");function Cic(t,e,r){if((0,sI.Check)(t,e,r))return(0,une.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,k$.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(Cic,"FromRecord");function bic(t,e,r){return GD((0,sLe.Deref)(t,e),e,r)}a(bic,"FromRef");function Sic(t,e,r){return GD((0,sLe.Deref)(t,e),e,r)}a(Sic,"FromThis");function Tic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):(0,QR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>GD(n,e,r[o])):(0,k$.Create)(t,e)}a(Tic,"FromTuple");function Iic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):pic(t,e,r)}a(Iic,"FromUnion");function GD(t,e,r){let n=(0,QR.IsString)(t.$id)?(0,sLe.Pushref)(t,e):e,o=t;switch(t[MEt.Kind]){case"Array":return gic(o,n,r);case"Constructor":return Aic(o,n,r);case"Import":return yic(o,n,r);case"Intersect":return Eic(o,n,r);case"Never":return _ic(o,n,r);case"Object":return vic(o,n,r);case"Record":return Cic(o,n,r);case"Ref":return bic(o,n,r);case"This":return Sic(o,n,r);case"Tuple":return Tic(o,n,r);case"Union":return Iic(o,n,r);case"Date":case"Symbol":case"Uint8Array":return hic(t,e,r);default:return mic(o,n,r)}}a(GD,"Visit");function YOi(...t){return t.length===3?GD(t[0],t[1],t[2]):GD(t[0],[],t[1])}a(YOi,"Cast")});var OEt=I(dne=>{"use strict";p();var xic=dne&&dne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wic=dne&&dne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xic(e,t,r)};Object.defineProperty(dne,"__esModule",{value:!0});wic(KOi(),dne)});var ZOi=I(Ekr=>{"use strict";p();Object.defineProperty(Ekr,"__esModule",{value:!0});Ekr.Clean=qic;var Ric=mD(),LEt=iI(),kic=HD(),ykr=qD(),JOi=Sn(),$D=R0(),BEt=vs();function Pic(t){return(0,BEt.IsKind)(t)&&t[JOi.Kind]!=="Unsafe"}a(Pic,"IsCheckable");function Dic(t,e,r){return(0,$D.IsArray)(r)?r.map(n=>p1(t.items,e,n)):r}a(Dic,"FromArray");function Nic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return p1(o,[...e,...n],r)}a(Nic,"FromImport");function Mic(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>p1(l,e,(0,kic.Clone)(r))).reduce((l,u)=>(0,$D.IsObject)(u)?{...l,...u}:u,{});if(!(0,$D.IsObject)(r)||!(0,$D.IsObject)(s)||!(0,BEt.IsKind)(n))return s;let c=(0,Ric.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,LEt.Check)(n,e,r[l])&&(s[l]=p1(n,e,r[l]));return s}a(Mic,"FromIntersect");function Oic(t,e,r){if(!(0,$D.IsObject)(r)||(0,$D.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,$D.HasPropertyKey)(t.properties,o)){r[o]=p1(t.properties[o],e,r[o]);continue}if((0,BEt.IsKind)(n)&&(0,LEt.Check)(n,e,r[o])){r[o]=p1(n,e,r[o]);continue}delete r[o]}return r}a(Oic,"FromObject");function Lic(t,e,r){if(!(0,$D.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]=p1(c,e,r[u]);continue}if((0,BEt.IsKind)(n)&&(0,LEt.Check)(n,e,r[u])){r[u]=p1(n,e,r[u]);continue}delete r[u]}return r}a(Lic,"FromRecord");function Bic(t,e,r){return p1((0,ykr.Deref)(t,e),e,r)}a(Bic,"FromRef");function Fic(t,e,r){return p1((0,ykr.Deref)(t,e),e,r)}a(Fic,"FromThis");function Uic(t,e,r){if(!(0,$D.IsArray)(r))return r;if((0,$D.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Uic,"FromTuple");function Qic(t,e,r){for(let n of t.anyOf)if(Pic(n)&&(0,LEt.Check)(n,e,r))return p1(n,e,r);return r}a(Qic,"FromUnion");function p1(t,e,r){let n=(0,$D.IsString)(t.$id)?(0,ykr.Pushref)(t,e):e,o=t;switch(o[JOi.Kind]){case"Array":return Dic(o,n,r);case"Import":return Nic(o,n,r);case"Intersect":return Mic(o,n,r);case"Object":return Oic(o,n,r);case"Record":return Lic(o,n,r);case"Ref":return Bic(o,n,r);case"This":return Fic(o,n,r);case"Tuple":return Uic(o,n,r);case"Union":return Qic(o,n,r);default:return r}}a(p1,"Visit");function qic(...t){return t.length===3?p1(t[0],t[1],t[2]):p1(t[0],[],t[1])}a(qic,"Clean")});var FEt=I(fne=>{"use strict";p();var jic=fne&&fne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hic=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jic(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});Hic(ZOi(),fne)});var n5i=I(vkr=>{"use strict";p();Object.defineProperty(vkr,"__esModule",{value:!0});vkr.Convert=Ioc;var Gic=HD(),XOi=iI(),_kr=qD(),$ic=Sn(),Fa=R0();function UEt(t){return(0,Fa.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(UEt,"IsStringNumeric");function Vic(t){return(0,Fa.IsBigInt)(t)||(0,Fa.IsBoolean)(t)||(0,Fa.IsNumber)(t)}a(Vic,"IsValueToString");function cLe(t){return t===!0||(0,Fa.IsNumber)(t)&&t===1||(0,Fa.IsBigInt)(t)&&t===BigInt("1")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(cLe,"IsValueTrue");function lLe(t){return t===!1||(0,Fa.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Fa.IsBigInt)(t)&&t===BigInt("0")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(lLe,"IsValueFalse");function Wic(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Wic,"IsTimeStringWithTimeZone");function zic(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(zic,"IsTimeStringWithoutTimeZone");function Yic(t){return(0,Fa.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(Yic,"IsDateTimeStringWithTimeZone");function Kic(t){return(0,Fa.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(Kic,"IsDateTimeStringWithoutTimeZone");function Jic(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Jic,"IsDateString");function Zic(t,e){let r=t5i(t);return r===e?r:t}a(Zic,"TryConvertLiteralString");function Xic(t,e){let r=r5i(t);return r===e?r:t}a(Xic,"TryConvertLiteralNumber");function eoc(t,e){let r=e5i(t);return r===e?r:t}a(eoc,"TryConvertLiteralBoolean");function toc(t,e){return(0,Fa.IsString)(t.const)?Zic(e,t.const):(0,Fa.IsNumber)(t.const)?Xic(e,t.const):(0,Fa.IsBoolean)(t.const)?eoc(e,t.const):e}a(toc,"TryConvertLiteral");function e5i(t){return cLe(t)?!0:lLe(t)?!1:t}a(e5i,"TryConvertBoolean");function roc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return UEt(t)?BigInt(e(t)):(0,Fa.IsNumber)(t)?BigInt(Math.trunc(t)):lLe(t)?BigInt(0):cLe(t)?BigInt(1):t}a(roc,"TryConvertBigInt");function t5i(t){return(0,Fa.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Vic(t)?t.toString():t}a(t5i,"TryConvertString");function r5i(t){return UEt(t)?parseFloat(t):cLe(t)?1:lLe(t)?0:t}a(r5i,"TryConvertNumber");function noc(t){return UEt(t)?parseInt(t):(0,Fa.IsNumber)(t)?Math.trunc(t):cLe(t)?1:lLe(t)?0:t}a(noc,"TryConvertInteger");function ioc(t){return(0,Fa.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(ioc,"TryConvertNull");function ooc(t){return(0,Fa.IsString)(t)&&t==="undefined"?void 0:t}a(ooc,"TryConvertUndefined");function soc(t){return(0,Fa.IsDate)(t)?t:(0,Fa.IsNumber)(t)?new Date(t):cLe(t)?new Date(1):lLe(t)?new Date(0):UEt(t)?new Date(parseInt(t)):zic(t)?new Date(`1970-01-01T${t}.000Z`):Wic(t)?new Date(`1970-01-01T${t}`):Kic(t)?new Date(`${t}.000Z`):Yic(t)?new Date(t):Jic(t)?new Date(`${t}T00:00:00.000Z`):t}a(soc,"TryConvertDate");function aoc(t,e,r){return((0,Fa.IsArray)(r)?r:[r]).map(o=>VD(t.items,e,o))}a(aoc,"FromArray");function coc(t,e,r){return roc(r)}a(coc,"FromBigInt");function loc(t,e,r){return e5i(r)}a(loc,"FromBoolean");function uoc(t,e,r){return soc(r)}a(uoc,"FromDate");function doc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return VD(o,[...e,...n],r)}a(doc,"FromImport");function foc(t,e,r){return noc(r)}a(foc,"FromInteger");function poc(t,e,r){return t.allOf.reduce((n,o)=>VD(o,e,n),r)}a(poc,"FromIntersect");function hoc(t,e,r){return toc(t,r)}a(hoc,"FromLiteral");function moc(t,e,r){return ioc(r)}a(moc,"FromNull");function goc(t,e,r){return r5i(r)}a(goc,"FromNumber");function Aoc(t,e,r){if(!(0,Fa.IsObject)(r)||(0,Fa.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Fa.HasPropertyKey)(r,n)&&(r[n]=VD(t.properties[n],e,r[n]));return r}a(Aoc,"FromObject");function yoc(t,e,r){if(!((0,Fa.IsObject)(r)&&!(0,Fa.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]=VD(s,e,l);return r}a(yoc,"FromRecord");function Eoc(t,e,r){return VD((0,_kr.Deref)(t,e),e,r)}a(Eoc,"FromRef");function _oc(t,e,r){return t5i(r)}a(_oc,"FromString");function voc(t,e,r){return(0,Fa.IsString)(r)||(0,Fa.IsNumber)(r)?Symbol(r):r}a(voc,"FromSymbol");function Coc(t,e,r){return VD((0,_kr.Deref)(t,e),e,r)}a(Coc,"FromThis");function boc(t,e,r){return(0,Fa.IsArray)(r)&&!(0,Fa.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var xoc=pne&&pne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),woc=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xoc(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});woc(n5i(),pne)});var a5i=I(hne=>{"use strict";p();Object.defineProperty(hne,"__esModule",{value:!0});hne.TransformDecodeError=hne.TransformDecodeCheckError=void 0;hne.TransformDecode=qoc;var Roc=T5e(),i5i=Sn(),o5i=Nf(),s5i=mD(),bkr=qD(),koc=iI(),B6=R0(),uLe=vs(),Ckr=class extends o5i.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}};hne.TransformDecodeCheckError=Ckr;var qEt=class extends o5i.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}};hne.TransformDecodeError=qEt;function Yd(t,e,r){try{return(0,uLe.IsTransform)(t)?t[i5i.TransformKind].Decode(r):r}catch(n){throw new qEt(t,e,r,n)}}a(Yd,"Default");function Poc(t,e,r,n){return(0,B6.IsArray)(n)?Yd(t,r,n.map((o,s)=>WD(t.items,e,`${r}/${s}`,o))):Yd(t,r,n)}a(Poc,"FromArray");function Doc(t,e,r,n){if(!(0,B6.IsObject)(n)||(0,B6.IsValueType)(n))return Yd(t,r,n);let o=(0,s5i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=WD(h,e,`${r}/${f}`,c[f]));if(!(0,uLe.IsTransform)(t.unevaluatedProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Doc,"FromIntersect");function Noc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=WD(s,[...e,...o],r,n);return Yd(t,r,c)}a(Noc,"FromImport");function Moc(t,e,r,n){return Yd(t,r,WD(t.not,e,r,n))}a(Moc,"FromNot");function Ooc(t,e,r,n){if(!(0,B6.IsObject)(n))return Yd(t,r,n);let o=(0,s5i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,B6.HasPropertyKey)(s,d)&&((0,B6.IsUndefined)(s[d])&&(!(0,uLe.IsUndefined)(t.properties[d])||Roc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=WD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,uLe.IsSchema)(t.additionalProperties))return Yd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Yd(l,`${r}/${d}`,u[d]));return Yd(t,r,u)}a(Ooc,"FromObject");function Loc(t,e,r,n){if(!(0,B6.IsObject)(n))return Yd(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]=WD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,uLe.IsSchema)(t.additionalProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Loc,"FromRecord");function Boc(t,e,r,n){let o=(0,bkr.Deref)(t,e);return Yd(t,r,WD(o,e,r,n))}a(Boc,"FromRef");function Foc(t,e,r,n){let o=(0,bkr.Deref)(t,e);return Yd(t,r,WD(o,e,r,n))}a(Foc,"FromThis");function Uoc(t,e,r,n){return(0,B6.IsArray)(n)&&(0,B6.IsArray)(t.items)?Yd(t,r,t.items.map((o,s)=>WD(o,e,`${r}/${s}`,n[s]))):Yd(t,r,n)}a(Uoc,"FromTuple");function Qoc(t,e,r,n){for(let o of t.anyOf){if(!(0,koc.Check)(o,e,n))continue;let s=WD(o,e,r,n);return Yd(t,r,s)}return Yd(t,r,n)}a(Qoc,"FromUnion");function WD(t,e,r,n){let o=(0,bkr.Pushref)(t,e),s=t;switch(t[i5i.Kind]){case"Array":return Poc(s,o,r,n);case"Import":return Noc(s,o,r,n);case"Intersect":return Doc(s,o,r,n);case"Not":return Moc(s,o,r,n);case"Object":return Ooc(s,o,r,n);case"Record":return Loc(s,o,r,n);case"Ref":return Boc(s,o,r,n);case"Symbol":return Yd(s,r,n);case"This":return Foc(s,o,r,n);case"Tuple":return Uoc(s,o,r,n);case"Union":return Qoc(s,o,r,n);default:return Yd(s,r,n)}}a(WD,"Visit");function qoc(t,e,r){return WD(t,e,"",r)}a(qoc,"TransformDecode")});var f5i=I(mne=>{"use strict";p();Object.defineProperty(mne,"__esModule",{value:!0});mne.TransformEncodeError=mne.TransformEncodeCheckError=void 0;mne.TransformEncode=Xoc;var joc=T5e(),l5i=Sn(),u5i=Nf(),d5i=mD(),Tkr=qD(),c5i=iI(),P$=R0(),dLe=vs(),Skr=class extends u5i.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}};mne.TransformEncodeCheckError=Skr;var jEt=class extends u5i.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}};mne.TransformEncodeError=jEt;function yy(t,e,r){try{return(0,dLe.IsTransform)(t)?t[l5i.TransformKind].Encode(r):r}catch(n){throw new jEt(t,e,r,n)}}a(yy,"Default");function Hoc(t,e,r,n){let o=yy(t,r,n);return(0,P$.IsArray)(o)?o.map((s,c)=>zD(t.items,e,`${r}/${c}`,s)):o}a(Hoc,"FromArray");function Goc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yy(t,r,n);return zD(s,[...e,...o],r,c)}a(Goc,"FromImport");function $oc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(n)||(0,P$.IsValueType)(n))return o;let s=(0,d5i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=zD(m,e,`${r}/${h}`,l[h]));if(!(0,dLe.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]=yy(d,`${r}/${h}`,f[h]));return f}a($oc,"FromIntersect");function Voc(t,e,r,n){return yy(t.not,r,yy(t,r,n))}a(Voc,"FromNot");function Woc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(o))return o;let s=(0,d5i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,P$.HasPropertyKey)(c,f)&&((0,P$.IsUndefined)(c[f])&&(!(0,dLe.IsUndefined)(t.properties[f])||joc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=zD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,dLe.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]=yy(u,`${r}/${f}`,d[f]));return d}a(Woc,"FromObject");function zoc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.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]=zD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,dLe.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]=yy(d,`${r}/${h}`,f[h]));return f}a(zoc,"FromRecord");function Yoc(t,e,r,n){let o=(0,Tkr.Deref)(t,e),s=zD(o,e,r,n);return yy(t,r,s)}a(Yoc,"FromRef");function Koc(t,e,r,n){let o=(0,Tkr.Deref)(t,e),s=zD(o,e,r,n);return yy(t,r,s)}a(Koc,"FromThis");function Joc(t,e,r,n){let o=yy(t,r,n);return(0,P$.IsArray)(t.items)?t.items.map((s,c)=>zD(s,e,`${r}/${c}`,o[c])):[]}a(Joc,"FromTuple");function Zoc(t,e,r,n){for(let o of t.anyOf){if(!(0,c5i.Check)(o,e,n))continue;let s=zD(o,e,r,n);return yy(t,r,s)}for(let o of t.anyOf){let s=zD(o,e,r,n);if((0,c5i.Check)(t,e,s))return yy(t,r,s)}return yy(t,r,n)}a(Zoc,"FromUnion");function zD(t,e,r,n){let o=(0,Tkr.Pushref)(t,e),s=t;switch(t[l5i.Kind]){case"Array":return Hoc(s,o,r,n);case"Import":return Goc(s,o,r,n);case"Intersect":return $oc(s,o,r,n);case"Not":return Voc(s,o,r,n);case"Object":return Woc(s,o,r,n);case"Record":return zoc(s,o,r,n);case"Ref":return Yoc(s,o,r,n);case"This":return Koc(s,o,r,n);case"Tuple":return Joc(s,o,r,n);case"Union":return Zoc(s,o,r,n);default:return yy(s,r,n)}}a(zD,"Visit");function Xoc(t,e,r){return zD(t,e,"",r)}a(Xoc,"TransformEncode")});var p5i=I(wkr=>{"use strict";p();Object.defineProperty(wkr,"__esModule",{value:!0});wkr.HasTransform=Asc;var xkr=qD(),esc=Sn(),Rm=vs(),tsc=R0();function rsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(rsc,"FromArray");function nsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(nsc,"FromAsyncIterator");function isc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(isc,"FromConstructor");function osc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(osc,"FromFunction");function ssc(t,e){return(0,Rm.IsTransform)(t)||(0,Rm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>D0(r,e))}a(ssc,"FromIntersect");function asc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Rm.IsTransform)(t)||D0(n,[...r,...e])}a(asc,"FromImport");function csc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(csc,"FromIterator");function lsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.not,e)}a(lsc,"FromNot");function usc(t,e){return(0,Rm.IsTransform)(t)||Object.values(t.properties).some(r=>D0(r,e))||(0,Rm.IsSchema)(t.additionalProperties)&&D0(t.additionalProperties,e)}a(usc,"FromObject");function dsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.item,e)}a(dsc,"FromPromise");function fsc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Rm.IsTransform)(t)||D0(n,e)||(0,Rm.IsSchema)(t.additionalProperties)&&(0,Rm.IsTransform)(t.additionalProperties)}a(fsc,"FromRecord");function psc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,xkr.Deref)(t,e),e)}a(psc,"FromRef");function hsc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,xkr.Deref)(t,e),e)}a(hsc,"FromThis");function msc(t,e){return(0,Rm.IsTransform)(t)||!(0,tsc.IsUndefined)(t.items)&&t.items.some(r=>D0(r,e))}a(msc,"FromTuple");function gsc(t,e){return(0,Rm.IsTransform)(t)||t.anyOf.some(r=>D0(r,e))}a(gsc,"FromUnion");function D0(t,e){let r=(0,xkr.Pushref)(t,e),n=t;if(t.$id&&Ikr.has(t.$id))return!1;switch(t.$id&&Ikr.add(t.$id),t[esc.Kind]){case"Array":return rsc(n,r);case"AsyncIterator":return nsc(n,r);case"Constructor":return isc(n,r);case"Function":return osc(n,r);case"Import":return asc(n,r);case"Intersect":return ssc(n,r);case"Iterator":return csc(n,r);case"Not":return lsc(n,r);case"Object":return usc(n,r);case"Promise":return dsc(n,r);case"Record":return fsc(n,r);case"Ref":return psc(n,r);case"This":return hsc(n,r);case"Tuple":return msc(n,r);case"Union":return gsc(n,r);default:return(0,Rm.IsTransform)(t)}}a(D0,"Visit");var Ikr=new Set;function Asc(t,e){return Ikr.clear(),D0(t,e)}a(Asc,"HasTransform")});var fLe=I(F6=>{"use strict";p();var ysc=F6&&F6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rkr=F6&&F6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ysc(e,t,r)};Object.defineProperty(F6,"__esModule",{value:!0});Rkr(a5i(),F6);Rkr(f5i(),F6);Rkr(p5i(),F6)});var h5i=I(Pkr=>{"use strict";p();Object.defineProperty(Pkr,"__esModule",{value:!0});Pkr.Decode=vsc;var kkr=fLe(),Esc=iI(),_sc=VAe();function vsc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Esc.Check)(e,r,n))throw new kkr.TransformDecodeCheckError(e,n,(0,_sc.Errors)(e,r,n).First());return(0,kkr.HasTransform)(e,r)?(0,kkr.TransformDecode)(e,r,n):n}a(vsc,"Decode")});var Dkr=I(gne=>{"use strict";p();var Csc=gne&&gne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bsc=gne&&gne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Csc(e,t,r)};Object.defineProperty(gne,"__esModule",{value:!0});bsc(h5i(),gne)});var g5i=I(Okr=>{"use strict";p();Object.defineProperty(Okr,"__esModule",{value:!0});Okr.Default=Bsc;var Ssc=iI(),m5i=HD(),Mkr=qD(),Tsc=Sn(),h1=R0(),Isc=vs();function U6(t,e){let r=(0,h1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,h1.IsFunction)(r)?r():(0,m5i.Clone)(r);return(0,h1.IsUndefined)(e)?n:(0,h1.IsObject)(e)&&(0,h1.IsObject)(n)?Object.assign(n,e):e}a(U6,"ValueOrDefault");function Nkr(t){return(0,Isc.IsKind)(t)&&"default"in t}a(Nkr,"HasDefaultProperty");function xsc(t,e,r){if((0,h1.IsArray)(r)){for(let o=0;o{let c=Lv(s,e,n);return(0,h1.IsObject)(c)?{...o,...c}:c},{})}a(ksc,"FromIntersect");function Psc(t,e,r){let n=U6(t,r);if(!(0,h1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Lv(t.properties[s],e,n[s]);(0,h1.IsUndefined)(c)||(n[s]=Lv(t.properties[s],e,n[s]))}if(!Nkr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Lv(t.additionalProperties,e,n[s]));return n}a(Psc,"FromObject");function Dsc(t,e,r){let n=U6(t,r);if(!(0,h1.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)&&Nkr(c)&&(n[u]=Lv(c,e,n[u]));if(!Nkr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Lv(o,e,n[u]));return n}a(Dsc,"FromRecord");function Nsc(t,e,r){return Lv((0,Mkr.Deref)(t,e),e,U6(t,r))}a(Nsc,"FromRef");function Msc(t,e,r){return Lv((0,Mkr.Deref)(t,e),e,r)}a(Msc,"FromThis");function Osc(t,e,r){let n=U6(t,r);if(!(0,h1.IsArray)(n)||(0,h1.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 Fsc=Ane&&Ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Usc=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Fsc(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});Usc(g5i(),Ane)});var E5i=I(YD=>{"use strict";p();Object.defineProperty(YD,"__esModule",{value:!0});YD.ValuePointerRootDeleteError=YD.ValuePointerRootSetError=void 0;YD.Format=pLe;YD.Set=Qsc;YD.Delete=qsc;YD.Has=jsc;YD.Get=Hsc;var y5i=Nf(),GEt=class extends y5i.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=GEt;var $Et=class extends y5i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};YD.ValuePointerRootDeleteError=$Et;function A5i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(A5i,"Escape");function*pLe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var Gsc=cL&&cL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$sc=cL&&cL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vsc=cL&&cL.__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(Lkr,"__esModule",{value:!0});Lkr.Equal=WEt;var Q6=R0();function Wsc(t,e){if(!(0,Q6.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=>WEt(t[o],e[o]))}a(Wsc,"ObjectType");function zsc(t,e){return(0,Q6.IsDate)(e)&&t.getTime()===e.getTime()}a(zsc,"DateType");function Ysc(t,e){return!(0,Q6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>WEt(r,e[n]))}a(Ysc,"ArrayType");function Ksc(t,e){return!(0,Q6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>WEt(r,e[n]))}a(Ksc,"TypedArrayType");function Jsc(t,e){return t===e}a(Jsc,"ValueType");function WEt(t,e){if((0,Q6.IsDate)(t))return zsc(t,e);if((0,Q6.IsTypedArray)(t))return Ksc(t,e);if((0,Q6.IsArray)(t))return Ysc(t,e);if((0,Q6.IsObject)(t))return Wsc(t,e);if((0,Q6.IsValueType)(t))return Jsc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(WEt,"Equal")});var S5i=I(Ey=>{"use strict";p();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueDiffError=Ey.Edit=Ey.Delete=Ey.Update=Ey.Insert=void 0;Ey.Diff=oac;Ey.Patch=cac;var lL=R0(),Fkr=VEt(),Ukr=HD(),Zsc=Bkr(),Xsc=Nf(),Qkr=UE(),qkr=xv(),jkr=QG(),v5i=VG(),eac=Ip();Ey.Insert=(0,qkr.Object)({type:(0,Qkr.Literal)("insert"),path:(0,jkr.String)(),value:(0,v5i.Unknown)()});Ey.Update=(0,qkr.Object)({type:(0,Qkr.Literal)("update"),path:(0,jkr.String)(),value:(0,v5i.Unknown)()});Ey.Delete=(0,qkr.Object)({type:(0,Qkr.Literal)("delete"),path:(0,jkr.String)()});Ey.Edit=(0,eac.Union)([Ey.Insert,Ey.Update,Ey.Delete]);var hLe=class extends Xsc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};Ey.ValueDiffError=hLe;function zEt(t,e){return{type:"update",path:t,value:e}}a(zEt,"CreateUpdate");function C5i(t,e){return{type:"insert",path:t,value:e}}a(C5i,"CreateInsert");function b5i(t){return{type:"delete",path:t}}a(b5i,"CreateDelete");function _5i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new hLe(t,"Cannot diff objects with symbols")}a(_5i,"AssertDiffable");function*tac(t,e,r){if(_5i(e),_5i(r),!(0,lL.IsStandardObject)(r))return yield zEt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,lL.HasPropertyKey)(e,s)||(yield C5i(`${t}/${s}`,r[s]));for(let s of n)(0,lL.HasPropertyKey)(r,s)&&((0,Zsc.Equal)(e,r)||(yield*YEt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,lL.HasPropertyKey)(r,s)||(yield b5i(`${t}/${s}`))}a(tac,"ObjectType");function*rac(t,e,r){if(!(0,lL.IsArray)(r))return yield zEt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(sac,"IsRootUpdate");function aac(t){return t.length===0}a(aac,"IsIdentity");function cac(t,e){if(sac(e))return(0,Ukr.Clone)(e[0].value);if(aac(e))return(0,Ukr.Clone)(t);let r=(0,Ukr.Clone)(t);for(let n of e)switch(n.type){case"insert":{Fkr.ValuePointer.Set(r,n.path,n.value);break}case"update":{Fkr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{Fkr.ValuePointer.Delete(r,n.path);break}}return r}a(cac,"Patch")});var Hkr=I(yne=>{"use strict";p();var lac=yne&&yne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uac=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lac(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});uac(S5i(),yne)});var T5i=I($kr=>{"use strict";p();Object.defineProperty($kr,"__esModule",{value:!0});$kr.Encode=pac;var Gkr=fLe(),dac=iI(),fac=VAe();function pac(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,Gkr.HasTransform)(e,r)?(0,Gkr.TransformEncode)(e,r,n):n;if(!(0,dac.Check)(e,r,o))throw new Gkr.TransformEncodeCheckError(e,o,(0,fac.Errors)(e,r,o).First());return o}a(pac,"Encode")});var Vkr=I(Ene=>{"use strict";p();var hac=Ene&&Ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mac=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hac(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});mac(T5i(),Ene)});var Wkr=I(_ne=>{"use strict";p();var gac=_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]})),Aac=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gac(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});Aac(Bkr(),_ne)});var x5i=I(gLe=>{"use strict";p();Object.defineProperty(gLe,"__esModule",{value:!0});gLe.ValueMutateError=void 0;gLe.Mutate=Sac;var KD=R0(),JEt=VEt(),zkr=HD(),yac=Nf();function KEt(t){return(0,KD.IsObject)(t)&&!(0,KD.IsArray)(t)}a(KEt,"IsStandardObject");var mLe=class extends yac.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};gLe.ValueMutateError=mLe;function Eac(t,e,r,n){if(!KEt(r))JEt.ValuePointer.Set(t,e,(0,zkr.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)Ykr(t,`${e}/${c}`,r[c],n[c])}}a(Eac,"ObjectType");function _ac(t,e,r,n){if(!(0,KD.IsArray)(r))JEt.ValuePointer.Set(t,e,(0,zkr.Clone)(n));else{for(let o=0;o{"use strict";p();var Tac=vne&&vne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tac(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});Iac(x5i(),vne)});var R5i=I(JD=>{"use strict";p();Object.defineProperty(JD,"__esModule",{value:!0});JD.ParseDefault=JD.ParseRegistry=JD.ParseError=void 0;JD.Parse=Oac;var xac=Nf(),ZEt=fLe(),wac=DEt(),Rac=OEt(),kac=FEt(),Pac=HD(),Dac=QEt(),Nac=HEt(),w5i=R0(),ALe=class extends xac.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};JD.ParseError=ALe;var Jkr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,wac.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,Rac.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,kac.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Pac.Clone)(l)],["Convert",(s,c,l)=>(0,Dac.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,ZEt.HasTransform)(s,c)?(0,ZEt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Nac.Default)(s,c,l)],["Encode",(s,c,l)=>(0,ZEt.HasTransform)(s,c)?(0,ZEt.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})(Jkr||(JD.ParseRegistry=Jkr={}));JD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function Mac(t,e,r,n){return t.reduce((o,s)=>{let c=Jkr.Get(s);if((0,w5i.IsUndefined)(c))throw new ALe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(Mac,"ParseValue");function Oac(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,w5i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[JD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[JD.ParseDefault,t[0],[],t[1]]:(()=>{throw new ALe("Invalid Arguments")})();return Mac(e,r,n,o)}a(Oac,"Parse")});var Zkr=I(Cne=>{"use strict";p();var Lac=Cne&&Cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bac=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lac(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});Bac(R5i(),Cne)});var P5i=I(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Parse=Cs.Mutate=Cs.Hash=Cs.Equal=Cs.Encode=Cs.Edit=Cs.Patch=Cs.Diff=Cs.Default=Cs.Decode=Cs.Create=Cs.Convert=Cs.Clone=Cs.Clean=Cs.Check=Cs.Cast=Cs.Assert=Cs.ValueErrorIterator=Cs.Errors=void 0;var k5i=VAe();Object.defineProperty(Cs,"Errors",{enumerable:!0,get:a(function(){return k5i.Errors},"get")});Object.defineProperty(Cs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return k5i.ValueErrorIterator},"get")});var Fac=DEt();Object.defineProperty(Cs,"Assert",{enumerable:!0,get:a(function(){return Fac.Assert},"get")});var Uac=OEt();Object.defineProperty(Cs,"Cast",{enumerable:!0,get:a(function(){return Uac.Cast},"get")});var Qac=iI();Object.defineProperty(Cs,"Check",{enumerable:!0,get:a(function(){return Qac.Check},"get")});var qac=FEt();Object.defineProperty(Cs,"Clean",{enumerable:!0,get:a(function(){return qac.Clean},"get")});var jac=HD();Object.defineProperty(Cs,"Clone",{enumerable:!0,get:a(function(){return jac.Clone},"get")});var Hac=QEt();Object.defineProperty(Cs,"Convert",{enumerable:!0,get:a(function(){return Hac.Convert},"get")});var Gac=NEt();Object.defineProperty(Cs,"Create",{enumerable:!0,get:a(function(){return Gac.Create},"get")});var $ac=Dkr();Object.defineProperty(Cs,"Decode",{enumerable:!0,get:a(function(){return $ac.Decode},"get")});var Vac=HEt();Object.defineProperty(Cs,"Default",{enumerable:!0,get:a(function(){return Vac.Default},"get")});var Xkr=Hkr();Object.defineProperty(Cs,"Diff",{enumerable:!0,get:a(function(){return Xkr.Diff},"get")});Object.defineProperty(Cs,"Patch",{enumerable:!0,get:a(function(){return Xkr.Patch},"get")});Object.defineProperty(Cs,"Edit",{enumerable:!0,get:a(function(){return Xkr.Edit},"get")});var Wac=Vkr();Object.defineProperty(Cs,"Encode",{enumerable:!0,get:a(function(){return Wac.Encode},"get")});var zac=Wkr();Object.defineProperty(Cs,"Equal",{enumerable:!0,get:a(function(){return zac.Equal},"get")});var Yac=Z4e();Object.defineProperty(Cs,"Hash",{enumerable:!0,get:a(function(){return Yac.Hash},"get")});var Kac=Kkr();Object.defineProperty(Cs,"Mutate",{enumerable:!0,get:a(function(){return Kac.Mutate},"get")});var Jac=Zkr();Object.defineProperty(Cs,"Parse",{enumerable:!0,get:a(function(){return Jac.Parse},"get")})});var D5i=I(uL=>{"use strict";p();var Zac=uL&&uL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xac=uL&&uL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ecc=uL&&uL.__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 tcc=Vc&&Vc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xg=Vc&&Vc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tcc(e,t,r)};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Value=Vc.ValueErrorIterator=Vc.ValueErrorType=void 0;var N5i=VAe();Object.defineProperty(Vc,"ValueErrorType",{enumerable:!0,get:a(function(){return N5i.ValueErrorType},"get")});Object.defineProperty(Vc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return N5i.ValueErrorIterator},"get")});Xg(R0(),Vc);Xg(DEt(),Vc);Xg(OEt(),Vc);Xg(iI(),Vc);Xg(FEt(),Vc);Xg(HD(),Vc);Xg(QEt(),Vc);Xg(NEt(),Vc);Xg(Dkr(),Vc);Xg(HEt(),Vc);Xg(Hkr(),Vc);Xg(Vkr(),Vc);Xg(Wkr(),Vc);Xg(Z4e(),Vc);Xg(Kkr(),Vc);Xg(Zkr(),Vc);Xg(VEt(),Vc);Xg(fLe(),Vc);var rcc=D5i();Object.defineProperty(Vc,"Value",{enumerable:!0,get:a(function(){return rcc.Value},"get")})});var O5i=I(XEt=>{"use strict";p();Object.defineProperty(XEt,"__esModule",{value:!0});XEt.assertShape=void 0;var M5i=ePr(),ncc=a((t,e)=>{if(M5i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...M5i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");XEt.assertShape=ncc});var bne={};ki(bne,{CAPIClient:()=>lcc,RequestType:()=>B5i});async function acc(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 ccc(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 icc,tPr,yLe,occ,scc,B5i,lcc,Sne=ve(()=>{p();icc=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)}}},tPr=class L5i{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||L5i.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`}};tPr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",tPr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";yLe=tPr,occ=`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(htc,"applyEditsForNotebook");function mtc(t,e,r){let n=t.get(stc.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,atc.getMaxSolutionTokens)(),c=(0,IOi.getNumberOfSnippets)(e,r),l=(0,IOi.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(mtc,"getPromptOptions")});var kOi=I(P$=>{"use strict";p();Object.defineProperty(P$,"__esModule",{value:!0});P$.TypeSystem=P$.TypeSystemDuplicateFormat=P$.TypeSystemDuplicateTypeKind=void 0;var IEt=$ge(),gtc=c4e(),Atc=Sn(),ROi=Of(),xEt=class extends ROi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};P$.TypeSystemDuplicateTypeKind=xEt;var wEt=class extends ROi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};P$.TypeSystemDuplicateFormat=wEt;var wOi;(function(t){function e(n,o){if(IEt.TypeRegistry.Has(n))throw new xEt(n);return IEt.TypeRegistry.Set(n,o),(s={})=>(0,gtc.Unsafe)({...s,[Atc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(IEt.FormatRegistry.Has(n))throw new wEt(n);return IEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(wOi||(P$.TypeSystem=wOi={}))});var pkr=I(D$=>{"use strict";p();var ytc=D$&&D$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),POi=D$&&D$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ytc(e,t,r)};Object.defineProperty(D$,"__esModule",{value:!0});POi(k5e(),D$);POi(kOi(),D$)});var hkr=I(tLe=>{"use strict";p();Object.defineProperty(tLe,"__esModule",{value:!0});tLe.DefaultErrorFunction=DOi;tLe.SetErrorFunction=_tc;tLe.GetErrorFunction=vtc;var Etc=Sn(),qn=mkr();function DOi(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[Etc.Kind]}'`;default:return"Unknown error type"}}a(DOi,"DefaultErrorFunction");var NOi=DOi;function _tc(t){NOi=t}a(_tc,"SetErrorFunction");function vtc(){return NOi}a(vtc,"GetErrorFunction")});var LOi=I(GAe=>{"use strict";p();Object.defineProperty(GAe,"__esModule",{value:!0});GAe.TypeDereferenceError=void 0;GAe.Pushref=Ttc;GAe.Deref=OOi;var Ctc=Of(),MOi=Sn(),btc=bgt(),REt=class extends Ctc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};GAe.TypeDereferenceError=REt;function Stc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new REt(t);return OOi(r,e)}a(Stc,"Resolve");function Ttc(t,e){return!(0,btc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Ttc,"Pushref");function OOi(t,e){return t[MOi.Kind]==="This"||t[MOi.Kind]==="Ref"?Stc(t,e):t}a(OOi,"Deref")});var GD=I(ine=>{"use strict";p();var Itc=ine&&ine.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xtc=ine&&ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Itc(e,t,r)};Object.defineProperty(ine,"__esModule",{value:!0});xtc(LOi(),ine)});var QOi=I(rLe=>{"use strict";p();Object.defineProperty(rLe,"__esModule",{value:!0});rLe.ValueHashError=void 0;rLe.Hash=Gtc;var $D=k0(),wtc=Of(),kEt=class extends wtc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};rLe.ValueHashError=kEt;var oI;(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"})(oI||(oI={}));var $Ae=BigInt("14695981039346656037"),[Rtc,ktc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Ptc=Array.from({length:256}).map((t,e)=>BigInt(e)),BOi=new Float64Array(1),FOi=new DataView(BOi.buffer),UOi=new Uint8Array(BOi.buffer);function*Dtc(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(Dtc,"NumberToBytes");function Ntc(t){$E(oI.Array);for(let e of t)VAe(e)}a(Ntc,"ArrayType");function Mtc(t){$E(oI.Boolean),$E(t?1:0)}a(Mtc,"BooleanType");function Otc(t){$E(oI.BigInt),FOi.setBigInt64(0,t);for(let e of UOi)$E(e)}a(Otc,"BigIntType");function Ltc(t){$E(oI.Date),VAe(t.getTime())}a(Ltc,"DateType");function Btc(t){$E(oI.Null)}a(Btc,"NullType");function Ftc(t){$E(oI.Number),FOi.setFloat64(0,t);for(let e of UOi)$E(e)}a(Ftc,"NumberType");function Utc(t){$E(oI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())VAe(e),VAe(t[e])}a(Utc,"ObjectType");function Qtc(t){$E(oI.String);for(let e=0;e{"use strict";p();var $tc=one&&one.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vtc=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$tc(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});Vtc(QOi(),one)});var Akr=I(sLe=>{"use strict";p();Object.defineProperty(sLe,"__esModule",{value:!0});sLe.ValueCheckUnknownTypeError=void 0;sLe.Check=Nrc;var iLe=pkr(),gkr=GD(),Wtc=nLe(),WAe=Sn(),qOi=yD(),ztc=dre(),oLe=$ge(),Ytc=Of(),Ktc=Sm(),km=k0(),Jtc=vs(),PEt=class extends Ytc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};sLe.ValueCheckUnknownTypeError=PEt;function Ztc(t){return t[WAe.Kind]==="Any"||t[WAe.Kind]==="Unknown"}a(Ztc,"IsAnyOrUnknown");function oa(t){return t!==void 0}a(oa,"IsDefined");function Xtc(t,e,r){return!0}a(Xtc,"FromAny");function erc(t,e,r){return!0}a(erc,"FromArgument");function trc(t,e,r){if(!(0,km.IsArray)(r)||oa(t.minItems)&&!(r.length>=t.minItems)||oa(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Zg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,Wtc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(oa(t.contains)||(0,km.IsNumber)(t.minContains)||(0,km.IsNumber)(t.maxContains)))return!0;let n=oa(t.contains)?t.contains:(0,Ktc.Never)(),o=r.reduce((s,c)=>Zg(n,e,c)?s+1:s,0);return!(o===0||(0,km.IsNumber)(t.minContains)&&ot.maxContains)}a(trc,"FromArray");function rrc(t,e,r){return(0,km.IsAsyncIterator)(r)}a(rrc,"FromAsyncIterator");function nrc(t,e,r){return!(!(0,km.IsBigInt)(r)||oa(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||oa(t.maximum)&&!(r<=t.maximum)||oa(t.minimum)&&!(r>=t.minimum)||oa(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(nrc,"FromBigInt");function irc(t,e,r){return(0,km.IsBoolean)(r)}a(irc,"FromBoolean");function orc(t,e,r){return Zg(t.returns,e,r.prototype)}a(orc,"FromConstructor");function src(t,e,r){return!(!(0,km.IsDate)(r)||oa(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||oa(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||oa(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||oa(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(src,"FromDate");function arc(t,e,r){return(0,km.IsFunction)(r)}a(arc,"FromFunction");function crc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Zg(o,[...e,...n],r)}a(crc,"FromImport");function lrc(t,e,r){return!(!(0,km.IsInteger)(r)||oa(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||oa(t.maximum)&&!(r<=t.maximum)||oa(t.minimum)&&!(r>=t.minimum)||oa(t.multipleOf)&&r%t.multipleOf!==0)}a(lrc,"FromInteger");function urc(t,e,r){let n=t.allOf.every(o=>Zg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,qOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,Jtc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,qOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Zg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(urc,"FromIntersect");function drc(t,e,r){return(0,km.IsIterator)(r)}a(drc,"FromIterator");function frc(t,e,r){return r===t.const}a(frc,"FromLiteral");function prc(t,e,r){return!1}a(prc,"FromNever");function hrc(t,e,r){return!Zg(t.not,e,r)}a(hrc,"FromNot");function mrc(t,e,r){return(0,km.IsNull)(r)}a(mrc,"FromNull");function grc(t,e,r){return!(!iLe.TypeSystemPolicy.IsNumberLike(r)||oa(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||oa(t.minimum)&&!(r>=t.minimum)||oa(t.maximum)&&!(r<=t.maximum)||oa(t.multipleOf)&&r%t.multipleOf!==0)}a(grc,"FromNumber");function Arc(t,e,r){if(!iLe.TypeSystemPolicy.IsObjectLike(r)||oa(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||oa(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(!Zg(s,e,r[o])||((0,ztc.ExtendsUndefinedCheck)(s)||Ztc(s))&&!(o in r))return!1}else if(iLe.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Zg(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)||Zg(t.additionalProperties,e,r[s])):!0}a(Arc,"FromObject");function yrc(t,e,r){return(0,km.IsPromise)(r)}a(yrc,"FromPromise");function Erc(t,e,r){if(!iLe.TypeSystemPolicy.IsRecordLike(r)||oa(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||oa(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)?Zg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Zg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Erc,"FromRecord");function _rc(t,e,r){return Zg((0,gkr.Deref)(t,e),e,r)}a(_rc,"FromRef");function vrc(t,e,r){let n=new RegExp(t.source,t.flags);return oa(t.minLength)&&!(r.length>=t.minLength)||oa(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(vrc,"FromRegExp");function Crc(t,e,r){return!(0,km.IsString)(r)||oa(t.minLength)&&!(r.length>=t.minLength)||oa(t.maxLength)&&!(r.length<=t.maxLength)||oa(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:oa(t.format)?oLe.FormatRegistry.Has(t.format)?oLe.FormatRegistry.Get(t.format)(r):!1:!0}a(Crc,"FromString");function brc(t,e,r){return(0,km.IsSymbol)(r)}a(brc,"FromSymbol");function Src(t,e,r){return(0,km.IsString)(r)&&new RegExp(t.pattern).test(r)}a(Src,"FromTemplateLiteral");function Trc(t,e,r){return Zg((0,gkr.Deref)(t,e),e,r)}a(Trc,"FromThis");function Irc(t,e,r){if(!(0,km.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nZg(n,e,r))}a(wrc,"FromUnion");function Rrc(t,e,r){return!(!(0,km.IsUint8Array)(r)||oa(t.maxByteLength)&&!(r.length<=t.maxByteLength)||oa(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Rrc,"FromUint8Array");function krc(t,e,r){return!0}a(krc,"FromUnknown");function Prc(t,e,r){return iLe.TypeSystemPolicy.IsVoidLike(r)}a(Prc,"FromVoid");function Drc(t,e,r){return oLe.TypeRegistry.Has(t[WAe.Kind])?oLe.TypeRegistry.Get(t[WAe.Kind])(t,r):!1}a(Drc,"FromKind");function Zg(t,e,r){let n=oa(t.$id)?(0,gkr.Pushref)(t,e):e,o=t;switch(o[WAe.Kind]){case"Any":return Xtc(o,n,r);case"Argument":return erc(o,n,r);case"Array":return trc(o,n,r);case"AsyncIterator":return rrc(o,n,r);case"BigInt":return nrc(o,n,r);case"Boolean":return irc(o,n,r);case"Constructor":return orc(o,n,r);case"Date":return src(o,n,r);case"Function":return arc(o,n,r);case"Import":return crc(o,n,r);case"Integer":return lrc(o,n,r);case"Intersect":return urc(o,n,r);case"Iterator":return drc(o,n,r);case"Literal":return frc(o,n,r);case"Never":return prc(o,n,r);case"Not":return hrc(o,n,r);case"Null":return mrc(o,n,r);case"Number":return grc(o,n,r);case"Object":return Arc(o,n,r);case"Promise":return yrc(o,n,r);case"Record":return Erc(o,n,r);case"Ref":return _rc(o,n,r);case"RegExp":return vrc(o,n,r);case"String":return Crc(o,n,r);case"Symbol":return brc(o,n,r);case"TemplateLiteral":return Src(o,n,r);case"This":return Trc(o,n,r);case"Tuple":return Irc(o,n,r);case"Undefined":return xrc(o,n,r);case"Union":return wrc(o,n,r);case"Uint8Array":return Rrc(o,n,r);case"Unknown":return krc(o,n,r);case"Void":return Prc(o,n,r);default:if(!oLe.TypeRegistry.Has(o[WAe.Kind]))throw new PEt(o);return Drc(o,n,r)}}a(Zg,"Visit");function Nrc(...t){return t.length===3?Zg(t[0],t[1],t[2]):Zg(t[0],[],t[1])}a(Nrc,"Check")});var sI=I(sne=>{"use strict";p();var Mrc=sne&&sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Orc=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mrc(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});Orc(Akr(),sne)});var mkr=I(B6=>{"use strict";p();Object.defineProperty(B6,"__esModule",{value:!0});B6.ValueErrorIterator=B6.ValueErrorsUnknownTypeError=B6.ValueErrorType=void 0;B6.Errors=Cnc;var aLe=pkr(),jOi=yD(),DEt=$ge(),Lrc=k1r(),Brc=hkr(),Frc=Of(),HOi=GD(),Urc=nLe(),Qrc=sI(),ykr=Sn(),qrc=Sm(),Eh=k0(),tn;(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"})(tn||(B6.ValueErrorType=tn={}));var NEt=class extends Frc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};B6.ValueErrorsUnknownTypeError=NEt;function L6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(L6,"EscapeKey");function sa(t){return t!==void 0}a(sa,"IsDefined");var cLe=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}};B6.ValueErrorIterator=cLe;function cn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,Brc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(cn,"Create");function*jrc(t,e,r,n){}a(jrc,"FromAny");function*Hrc(t,e,r,n){}a(Hrc,"FromArgument");function*Grc(t,e,r,n){if(!(0,Eh.IsArray)(n))return yield cn(tn.Array,t,r,n);sa(t.minItems)&&!(n.length>=t.minItems)&&(yield cn(tn.ArrayMinItems,t,r,n)),sa(t.maxItems)&&!(n.length<=t.maxItems)&&(yield cn(tn.ArrayMaxItems,t,r,n));for(let c=0;cXg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield cn(tn.ArrayContains,t,r,n)),(0,Eh.IsNumber)(t.minContains)&&st.maxContains&&(yield cn(tn.ArrayMaxContains,t,r,n))}a(Grc,"FromArray");function*$rc(t,e,r,n){(0,Eh.IsAsyncIterator)(n)||(yield cn(tn.AsyncIterator,t,r,n))}a($rc,"FromAsyncIterator");function*Vrc(t,e,r,n){if(!(0,Eh.IsBigInt)(n))return yield cn(tn.BigInt,t,r,n);sa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.BigIntExclusiveMinimum,t,r,n)),sa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.BigIntMaximum,t,r,n)),sa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.BigIntMinimum,t,r,n)),sa(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield cn(tn.BigIntMultipleOf,t,r,n))}a(Vrc,"FromBigInt");function*Wrc(t,e,r,n){(0,Eh.IsBoolean)(n)||(yield cn(tn.Boolean,t,r,n))}a(Wrc,"FromBoolean");function*zrc(t,e,r,n){yield*Xg(t.returns,e,r,n.prototype)}a(zrc,"FromConstructor");function*Yrc(t,e,r,n){if(!(0,Eh.IsDate)(n))return yield cn(tn.Date,t,r,n);sa(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield cn(tn.DateExclusiveMinimumTimestamp,t,r,n)),sa(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield cn(tn.DateMaximumTimestamp,t,r,n)),sa(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield cn(tn.DateMinimumTimestamp,t,r,n)),sa(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield cn(tn.DateMultipleOfTimestamp,t,r,n))}a(Yrc,"FromDate");function*Krc(t,e,r,n){(0,Eh.IsFunction)(n)||(yield cn(tn.Function,t,r,n))}a(Krc,"FromFunction");function*Jrc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Xg(s,[...e,...o],r,n)}a(Jrc,"FromImport");function*Zrc(t,e,r,n){if(!(0,Eh.IsInteger)(n))return yield cn(tn.Integer,t,r,n);sa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.IntegerExclusiveMinimum,t,r,n)),sa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.IntegerMaximum,t,r,n)),sa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.IntegerMinimum,t,r,n)),sa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.IntegerMultipleOf,t,r,n))}a(Zrc,"FromInteger");function*Xrc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Xg(s,e,r,n))o=!0,yield c;if(o)return yield cn(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,jOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield cn(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,jOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Xg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Xrc,"FromIntersect");function*enc(t,e,r,n){(0,Eh.IsIterator)(n)||(yield cn(tn.Iterator,t,r,n))}a(enc,"FromIterator");function*tnc(t,e,r,n){n!==t.const&&(yield cn(tn.Literal,t,r,n))}a(tnc,"FromLiteral");function*rnc(t,e,r,n){yield cn(tn.Never,t,r,n)}a(rnc,"FromNever");function*nnc(t,e,r,n){Xg(t.not,e,r,n).next().done===!0&&(yield cn(tn.Not,t,r,n))}a(nnc,"FromNot");function*inc(t,e,r,n){(0,Eh.IsNull)(n)||(yield cn(tn.Null,t,r,n))}a(inc,"FromNull");function*onc(t,e,r,n){if(!aLe.TypeSystemPolicy.IsNumberLike(n))return yield cn(tn.Number,t,r,n);sa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.NumberExclusiveMinimum,t,r,n)),sa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.NumberMaximum,t,r,n)),sa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.NumberMinimum,t,r,n)),sa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.NumberMultipleOf,t,r,n))}a(onc,"FromNumber");function*snc(t,e,r,n){if(!aLe.TypeSystemPolicy.IsObjectLike(n))return yield cn(tn.Object,t,r,n);sa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),sa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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 cn(tn.ObjectRequiredProperty,t.properties[l],`${r}/${L6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield cn(tn.ObjectAdditionalProperties,t,`${r}/${L6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Xg(t.additionalProperties,e,`${r}/${L6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Xg(u,e,`${r}/${L6(l)}`,n[l]),(0,Lrc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield cn(tn.ObjectRequiredProperty,u,`${r}/${L6(l)}`,void 0))):aLe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Xg(u,e,`${r}/${L6(l)}`,n[l]))}}a(snc,"FromObject");function*anc(t,e,r,n){(0,Eh.IsPromise)(n)||(yield cn(tn.Promise,t,r,n))}a(anc,"FromPromise");function*cnc(t,e,r,n){if(!aLe.TypeSystemPolicy.IsRecordLike(n))return yield cn(tn.Object,t,r,n);sa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),sa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.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*Xg(s,e,`${r}/${L6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Xg(t.additionalProperties,e,`${r}/${L6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield cn(tn.ObjectAdditionalProperties,t,`${r}/${L6(l)}`,u)}}a(cnc,"FromRecord");function*lnc(t,e,r,n){yield*Xg((0,HOi.Deref)(t,e),e,r,n)}a(lnc,"FromRef");function*unc(t,e,r,n){if(!(0,Eh.IsString)(n))return yield cn(tn.String,t,r,n);if(sa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),sa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield cn(tn.RegExp,t,r,n)}a(unc,"FromRegExp");function*dnc(t,e,r,n){if(!(0,Eh.IsString)(n))return yield cn(tn.String,t,r,n);sa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),sa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),(0,Eh.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))),(0,Eh.IsString)(t.format)&&(DEt.FormatRegistry.Has(t.format)?DEt.FormatRegistry.Get(t.format)(n)||(yield cn(tn.StringFormat,t,r,n)):yield cn(tn.StringFormatUnknown,t,r,n))}a(dnc,"FromString");function*fnc(t,e,r,n){(0,Eh.IsSymbol)(n)||(yield cn(tn.Symbol,t,r,n))}a(fnc,"FromSymbol");function*pnc(t,e,r,n){if(!(0,Eh.IsString)(n))return yield cn(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))}a(pnc,"FromTemplateLiteral");function*hnc(t,e,r,n){yield*Xg((0,HOi.Deref)(t,e),e,r,n)}a(hnc,"FromThis");function*mnc(t,e,r,n){if(!(0,Eh.IsArray)(n))return yield cn(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield cn(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield cn(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew cLe(Xg(s,e,r,n)));yield cn(tn.Union,t,r,n,o)}a(Anc,"FromUnion");function*ync(t,e,r,n){if(!(0,Eh.IsUint8Array)(n))return yield cn(tn.Uint8Array,t,r,n);sa(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield cn(tn.Uint8ArrayMaxByteLength,t,r,n)),sa(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield cn(tn.Uint8ArrayMinByteLength,t,r,n))}a(ync,"FromUint8Array");function*Enc(t,e,r,n){}a(Enc,"FromUnknown");function*_nc(t,e,r,n){aLe.TypeSystemPolicy.IsVoidLike(n)||(yield cn(tn.Void,t,r,n))}a(_nc,"FromVoid");function*vnc(t,e,r,n){DEt.TypeRegistry.Get(t[ykr.Kind])(t,n)||(yield cn(tn.Kind,t,r,n))}a(vnc,"FromKind");function*Xg(t,e,r,n){let o=sa(t.$id)?[...e,t]:e,s=t;switch(s[ykr.Kind]){case"Any":return yield*jrc(s,o,r,n);case"Argument":return yield*Hrc(s,o,r,n);case"Array":return yield*Grc(s,o,r,n);case"AsyncIterator":return yield*$rc(s,o,r,n);case"BigInt":return yield*Vrc(s,o,r,n);case"Boolean":return yield*Wrc(s,o,r,n);case"Constructor":return yield*zrc(s,o,r,n);case"Date":return yield*Yrc(s,o,r,n);case"Function":return yield*Krc(s,o,r,n);case"Import":return yield*Jrc(s,o,r,n);case"Integer":return yield*Zrc(s,o,r,n);case"Intersect":return yield*Xrc(s,o,r,n);case"Iterator":return yield*enc(s,o,r,n);case"Literal":return yield*tnc(s,o,r,n);case"Never":return yield*rnc(s,o,r,n);case"Not":return yield*nnc(s,o,r,n);case"Null":return yield*inc(s,o,r,n);case"Number":return yield*onc(s,o,r,n);case"Object":return yield*snc(s,o,r,n);case"Promise":return yield*anc(s,o,r,n);case"Record":return yield*cnc(s,o,r,n);case"Ref":return yield*lnc(s,o,r,n);case"RegExp":return yield*unc(s,o,r,n);case"String":return yield*dnc(s,o,r,n);case"Symbol":return yield*fnc(s,o,r,n);case"TemplateLiteral":return yield*pnc(s,o,r,n);case"This":return yield*hnc(s,o,r,n);case"Tuple":return yield*mnc(s,o,r,n);case"Undefined":return yield*gnc(s,o,r,n);case"Union":return yield*Anc(s,o,r,n);case"Uint8Array":return yield*ync(s,o,r,n);case"Unknown":return yield*Enc(s,o,r,n);case"Void":return yield*_nc(s,o,r,n);default:if(!DEt.TypeRegistry.Has(s[ykr.Kind]))throw new NEt(t);return yield*vnc(s,o,r,n)}}a(Xg,"Visit");function Cnc(...t){let e=t.length===3?Xg(t[0],t[1],"",t[2]):Xg(t[0],[],"",t[1]);return new cLe(e)}a(Cnc,"Errors")});var zAe=I(N$=>{"use strict";p();var bnc=N$&&N$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GOi=N$&&N$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bnc(e,t,r)};Object.defineProperty(N$,"__esModule",{value:!0});GOi(mkr(),N$);GOi(hkr(),N$)});var YOi=I(F6=>{"use strict";p();var Snc=F6&&F6.__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},VOi=F6&&F6.__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)},Ekr,MEt,WOi;Object.defineProperty(F6,"__esModule",{value:!0});F6.AssertError=void 0;F6.Assert=xnc;var zOi=zAe(),Tnc=NCr(),Inc=Akr(),OEt=class extends Tnc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),Ekr.add(this),MEt.set(this,void 0),Snc(this,MEt,e,"f"),this.error=r}Errors(){return new zOi.ValueErrorIterator(VOi(this,Ekr,"m",WOi).call(this))}};F6.AssertError=OEt;MEt=new WeakMap,Ekr=new WeakSet,WOi=a(function*(){this.error&&(yield this.error),yield*VOi(this,MEt,"f")},"_AssertError_Iterator");function $Oi(t,e,r){if(!(0,Inc.Check)(t,e,r))throw new OEt((0,zOi.Errors)(t,e,r))}a($Oi,"AssertValue");function xnc(...t){return t.length===3?$Oi(t[0],t[1],t[2]):$Oi(t[0],[],t[1])}a(xnc,"Assert")});var LEt=I(ane=>{"use strict";p();var wnc=ane&&ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rnc=ane&&ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wnc(e,t,r)};Object.defineProperty(ane,"__esModule",{value:!0});Rnc(YOi(),ane)});var KOi=I(_kr=>{"use strict";p();Object.defineProperty(_kr,"__esModule",{value:!0});_kr.Clone=YAe;var cne=k0();function knc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=YAe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=YAe(t[r]);return e}a(knc,"FromObject");function Pnc(t){return t.map(e=>YAe(e))}a(Pnc,"FromArray");function Dnc(t){return t.slice()}a(Dnc,"FromTypedArray");function Nnc(t){return new Map(YAe([...t.entries()]))}a(Nnc,"FromMap");function Mnc(t){return new Set(YAe([...t.entries()]))}a(Mnc,"FromSet");function Onc(t){return new Date(t.toISOString())}a(Onc,"FromDate");function YAe(t){if((0,cne.IsArray)(t))return Pnc(t);if((0,cne.IsDate)(t))return Onc(t);if((0,cne.IsTypedArray)(t))return Dnc(t);if((0,cne.IsMap)(t))return Nnc(t);if((0,cne.IsSet)(t))return Mnc(t);if((0,cne.IsObject)(t))return knc(t);if((0,cne.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(YAe,"Clone")});var VD=I(lne=>{"use strict";p();var Lnc=lne&&lne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bnc=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lnc(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});Bnc(KOi(),lne)});var e5i=I(lLe=>{"use strict";p();Object.defineProperty(lLe,"__esModule",{value:!0});lLe.ValueCreateError=void 0;lLe.Create=Sic;var Fa=k0(),Fnc=sI(),Unc=VD(),vkr=GD(),JOi=gD(),Qnc=$ge(),ZOi=Sn(),qnc=Of(),jnc=bgt(),f1=class extends qnc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};lLe.ValueCreateError=f1;function ec(t){return(0,jnc.IsFunction)(t)?t():(0,Unc.Clone)(t)}a(ec,"FromDefault");function Hnc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):{}}a(Hnc,"FromAny");function Gnc(t,e){return{}}a(Gnc,"FromArgument");function $nc(t,e){if(t.uniqueItems===!0&&!(0,Fa.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Fa.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the contains constraint requires a default value");return"default"in t?ec(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>aI(t.items,e)):[]}a($nc,"FromArray");function Vnc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):(async function*(){})()}a(Vnc,"FromAsyncIterator");function Wnc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):BigInt(0)}a(Wnc,"FromBigInt");function znc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):!1}a(znc,"FromBoolean");function Ync(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);{let r=aI(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(Ync,"FromConstructor");function Knc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Knc,"FromDate");function Jnc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):()=>aI(t.returns,e)}a(Jnc,"FromFunction");function Znc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return aI(n,[...e,...r])}a(Znc,"FromImport");function Xnc(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.minimum!==void 0?t.minimum:0}a(Xnc,"FromInteger");function eic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);{let r=t.allOf.reduce((n,o)=>{let s=aI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,Fnc.Check)(t,e,r))throw new f1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(eic,"FromIntersect");function tic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):(function*(){})()}a(tic,"FromIterator");function ric(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.const}a(ric,"FromLiteral");function nic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);throw new f1(t,"Never types cannot be created. Consider using a default value.")}a(nic,"FromNever");function iic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);throw new f1(t,"Not types must have a default value")}a(iic,"FromNot");function oic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):null}a(oic,"FromNull");function sic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.minimum!==void 0?t.minimum:0}a(sic,"FromNumber");function aic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=aI(s,e));return n}}a(aic,"FromObject");function cic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):Promise.resolve(aI(t.item,e))}a(cic,"FromPromise");function lic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):{}}a(lic,"FromRecord");function uic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):aI((0,vkr.Deref)(t,e),e)}a(uic,"FromRef");function dic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);throw new f1(t,"RegExp types cannot be created. Consider using a default value.")}a(dic,"FromRegExp");function fic(t,e){if(t.pattern!==void 0){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);throw new f1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);throw new f1(t,"String types with formats must specify a default value")}else return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(fic,"FromString");function pic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(pic,"FromSymbol");function hic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);if(!(0,JOi.IsTemplateLiteralFinite)(t))throw new f1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,JOi.TemplateLiteralGenerate)(t)[0]}a(hic,"FromTemplateLiteral");function mic(t,e){if(XOi++>bic)throw new f1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):aI((0,vkr.Deref)(t,e),e)}a(mic,"FromThis");function gic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>aI(t.items[n],e))}a(gic,"FromTuple");function Aic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default)}a(Aic,"FromUndefined");function yic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return aI(t.anyOf[0],e)}a(yic,"FromUnion");function Eic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(Eic,"FromUint8Array");function _ic(t,e){return(0,Fa.HasPropertyKey)(t,"default")?ec(t.default):{}}a(_ic,"FromUnknown");function vic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default)}a(vic,"FromVoid");function Cic(t,e){if((0,Fa.HasPropertyKey)(t,"default"))return ec(t.default);throw new Error("User defined types must specify a default value")}a(Cic,"FromKind");function aI(t,e){let r=(0,vkr.Pushref)(t,e),n=t;switch(n[ZOi.Kind]){case"Any":return Hnc(n,r);case"Argument":return Gnc(n,r);case"Array":return $nc(n,r);case"AsyncIterator":return Vnc(n,r);case"BigInt":return Wnc(n,r);case"Boolean":return znc(n,r);case"Constructor":return Ync(n,r);case"Date":return Knc(n,r);case"Function":return Jnc(n,r);case"Import":return Znc(n,r);case"Integer":return Xnc(n,r);case"Intersect":return eic(n,r);case"Iterator":return tic(n,r);case"Literal":return ric(n,r);case"Never":return nic(n,r);case"Not":return iic(n,r);case"Null":return oic(n,r);case"Number":return sic(n,r);case"Object":return aic(n,r);case"Promise":return cic(n,r);case"Record":return lic(n,r);case"Ref":return uic(n,r);case"RegExp":return dic(n,r);case"String":return fic(n,r);case"Symbol":return pic(n,r);case"TemplateLiteral":return hic(n,r);case"This":return mic(n,r);case"Tuple":return gic(n,r);case"Undefined":return Aic(n,r);case"Union":return yic(n,r);case"Uint8Array":return Eic(n,r);case"Unknown":return _ic(n,r);case"Void":return vic(n,r);default:if(!Qnc.TypeRegistry.Has(n[ZOi.Kind]))throw new f1(n,"Unknown type");return Cic(n,r)}}a(aI,"Visit");var bic=512,XOi=0;function Sic(...t){return XOi=0,t.length===2?aI(t[0],t[1]):aI(t[0],[])}a(Sic,"Create")});var BEt=I(une=>{"use strict";p();var Tic=une&&une.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Iic=une&&une.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tic(e,t,r)};Object.defineProperty(une,"__esModule",{value:!0});Iic(e5i(),une)});var i5i=I(fLe=>{"use strict";p();Object.defineProperty(fLe,"__esModule",{value:!0});fLe.ValueCastError=void 0;fLe.Cast=n5i;var jR=k0(),xic=Of(),FEt=Sn(),M$=BEt(),cI=sI(),dne=VD(),dLe=GD(),uLe=class extends xic.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};fLe.ValueCastError=uLe;function t5i(t,e,r){if(t[FEt.Kind]==="Object"&&typeof r=="object"&&!(0,jR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[FEt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,cI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[FEt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,dLe.Deref)(s,e)).map(s=>t5i(s,e,r));return Math.max(...o)}else return(0,cI.Check)(t,e,r)?1:0}a(t5i,"ScoreUnion");function wic(t,e,r){let n=t.anyOf.map(c=>(0,dLe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=t5i(c,e,r);l>s&&(o=c,s=l)}return o}a(wic,"SelectUnion");function Ric(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,dne.Clone)(t.default);{let n=wic(t,e,r);return n5i(n,e,r)}}a(Ric,"CastUnion");function kic(t,e,r){return(0,cI.Check)(t,e,r)?(0,dne.Clone)(r):(0,M$.Create)(t,e)}a(kic,"DefaultClone");function Pic(t,e,r){return(0,cI.Check)(t,e,r)?r:(0,M$.Create)(t,e)}a(Pic,"Default");function Dic(t,e,r){if((0,cI.Check)(t,e,r))return(0,dne.Clone)(r);let n=(0,jR.IsArray)(r)?(0,dne.Clone)(r):(0,M$.Create)(t,e),o=(0,jR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,jR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>WD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,cI.Check)(t,e,l))throw new uLe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(Dic,"FromArray");function Nic(t,e,r){if((0,cI.Check)(t,e,r))return(0,M$.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]=WD(c,e,r.prototype[s]));return o}a(Nic,"FromConstructor");function Mic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return WD(o,[...e,...n],r)}a(Mic,"FromImport");function r5i(t,e){return(0,jR.IsObject)(t)&&!(0,jR.IsObject)(e)||!(0,jR.IsObject)(t)&&(0,jR.IsObject)(e)?t:!(0,jR.IsObject)(t)||!(0,jR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?r5i(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(r5i,"IntersectAssign");function Oic(t,e,r){if((0,cI.Check)(t,e,r))return r;let n=(0,M$.Create)(t,e),o=r5i(n,r);return(0,cI.Check)(t,e,o)?o:n}a(Oic,"FromIntersect");function Lic(t,e,r){throw new uLe(t,"Never types cannot be cast")}a(Lic,"FromNever");function Bic(t,e,r){if((0,cI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,M$.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]=WD(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]=WD(t.additionalProperties,e,r[c]))}return o}a(Bic,"FromObject");function Fic(t,e,r){if((0,cI.Check)(t,e,r))return(0,dne.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,M$.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]=WD(o,e,l);return s}a(Fic,"FromRecord");function Uic(t,e,r){return WD((0,dLe.Deref)(t,e),e,r)}a(Uic,"FromRef");function Qic(t,e,r){return WD((0,dLe.Deref)(t,e),e,r)}a(Qic,"FromThis");function qic(t,e,r){return(0,cI.Check)(t,e,r)?(0,dne.Clone)(r):(0,jR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>WD(n,e,r[o])):(0,M$.Create)(t,e)}a(qic,"FromTuple");function jic(t,e,r){return(0,cI.Check)(t,e,r)?(0,dne.Clone)(r):Ric(t,e,r)}a(jic,"FromUnion");function WD(t,e,r){let n=(0,jR.IsString)(t.$id)?(0,dLe.Pushref)(t,e):e,o=t;switch(t[FEt.Kind]){case"Array":return Dic(o,n,r);case"Constructor":return Nic(o,n,r);case"Import":return Mic(o,n,r);case"Intersect":return Oic(o,n,r);case"Never":return Lic(o,n,r);case"Object":return Bic(o,n,r);case"Record":return Fic(o,n,r);case"Ref":return Uic(o,n,r);case"This":return Qic(o,n,r);case"Tuple":return qic(o,n,r);case"Union":return jic(o,n,r);case"Date":case"Symbol":case"Uint8Array":return kic(t,e,r);default:return Pic(o,n,r)}}a(WD,"Visit");function n5i(...t){return t.length===3?WD(t[0],t[1],t[2]):WD(t[0],[],t[1])}a(n5i,"Cast")});var UEt=I(fne=>{"use strict";p();var Hic=fne&&fne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gic=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hic(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});Gic(i5i(),fne)});var s5i=I(bkr=>{"use strict";p();Object.defineProperty(bkr,"__esModule",{value:!0});bkr.Clean=noc;var $ic=yD(),QEt=sI(),Vic=VD(),Ckr=GD(),o5i=Sn(),zD=k0(),qEt=vs();function Wic(t){return(0,qEt.IsKind)(t)&&t[o5i.Kind]!=="Unsafe"}a(Wic,"IsCheckable");function zic(t,e,r){return(0,zD.IsArray)(r)?r.map(n=>p1(t.items,e,n)):r}a(zic,"FromArray");function Yic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return p1(o,[...e,...n],r)}a(Yic,"FromImport");function Kic(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>p1(l,e,(0,Vic.Clone)(r))).reduce((l,u)=>(0,zD.IsObject)(u)?{...l,...u}:u,{});if(!(0,zD.IsObject)(r)||!(0,zD.IsObject)(s)||!(0,qEt.IsKind)(n))return s;let c=(0,$ic.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,QEt.Check)(n,e,r[l])&&(s[l]=p1(n,e,r[l]));return s}a(Kic,"FromIntersect");function Jic(t,e,r){if(!(0,zD.IsObject)(r)||(0,zD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,zD.HasPropertyKey)(t.properties,o)){r[o]=p1(t.properties[o],e,r[o]);continue}if((0,qEt.IsKind)(n)&&(0,QEt.Check)(n,e,r[o])){r[o]=p1(n,e,r[o]);continue}delete r[o]}return r}a(Jic,"FromObject");function Zic(t,e,r){if(!(0,zD.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]=p1(c,e,r[u]);continue}if((0,qEt.IsKind)(n)&&(0,QEt.Check)(n,e,r[u])){r[u]=p1(n,e,r[u]);continue}delete r[u]}return r}a(Zic,"FromRecord");function Xic(t,e,r){return p1((0,Ckr.Deref)(t,e),e,r)}a(Xic,"FromRef");function eoc(t,e,r){return p1((0,Ckr.Deref)(t,e),e,r)}a(eoc,"FromThis");function toc(t,e,r){if(!(0,zD.IsArray)(r))return r;if((0,zD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(toc,"FromTuple");function roc(t,e,r){for(let n of t.anyOf)if(Wic(n)&&(0,QEt.Check)(n,e,r))return p1(n,e,r);return r}a(roc,"FromUnion");function p1(t,e,r){let n=(0,zD.IsString)(t.$id)?(0,Ckr.Pushref)(t,e):e,o=t;switch(o[o5i.Kind]){case"Array":return zic(o,n,r);case"Import":return Yic(o,n,r);case"Intersect":return Kic(o,n,r);case"Object":return Jic(o,n,r);case"Record":return Zic(o,n,r);case"Ref":return Xic(o,n,r);case"This":return eoc(o,n,r);case"Tuple":return toc(o,n,r);case"Union":return roc(o,n,r);default:return r}}a(p1,"Visit");function noc(...t){return t.length===3?p1(t[0],t[1],t[2]):p1(t[0],[],t[1])}a(noc,"Clean")});var jEt=I(pne=>{"use strict";p();var ioc=pne&&pne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ooc=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ioc(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});ooc(s5i(),pne)});var d5i=I(Tkr=>{"use strict";p();Object.defineProperty(Tkr,"__esModule",{value:!0});Tkr.Convert=joc;var soc=VD(),a5i=sI(),Skr=GD(),aoc=Sn(),Ua=k0();function HEt(t){return(0,Ua.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(HEt,"IsStringNumeric");function coc(t){return(0,Ua.IsBigInt)(t)||(0,Ua.IsBoolean)(t)||(0,Ua.IsNumber)(t)}a(coc,"IsValueToString");function pLe(t){return t===!0||(0,Ua.IsNumber)(t)&&t===1||(0,Ua.IsBigInt)(t)&&t===BigInt("1")||(0,Ua.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(pLe,"IsValueTrue");function hLe(t){return t===!1||(0,Ua.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ua.IsBigInt)(t)&&t===BigInt("0")||(0,Ua.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(hLe,"IsValueFalse");function loc(t){return(0,Ua.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(loc,"IsTimeStringWithTimeZone");function uoc(t){return(0,Ua.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(uoc,"IsTimeStringWithoutTimeZone");function doc(t){return(0,Ua.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(doc,"IsDateTimeStringWithTimeZone");function foc(t){return(0,Ua.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(foc,"IsDateTimeStringWithoutTimeZone");function poc(t){return(0,Ua.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(poc,"IsDateString");function hoc(t,e){let r=l5i(t);return r===e?r:t}a(hoc,"TryConvertLiteralString");function moc(t,e){let r=u5i(t);return r===e?r:t}a(moc,"TryConvertLiteralNumber");function goc(t,e){let r=c5i(t);return r===e?r:t}a(goc,"TryConvertLiteralBoolean");function Aoc(t,e){return(0,Ua.IsString)(t.const)?hoc(e,t.const):(0,Ua.IsNumber)(t.const)?moc(e,t.const):(0,Ua.IsBoolean)(t.const)?goc(e,t.const):e}a(Aoc,"TryConvertLiteral");function c5i(t){return pLe(t)?!0:hLe(t)?!1:t}a(c5i,"TryConvertBoolean");function yoc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return HEt(t)?BigInt(e(t)):(0,Ua.IsNumber)(t)?BigInt(Math.trunc(t)):hLe(t)?BigInt(0):pLe(t)?BigInt(1):t}a(yoc,"TryConvertBigInt");function l5i(t){return(0,Ua.IsSymbol)(t)&&t.description!==void 0?t.description.toString():coc(t)?t.toString():t}a(l5i,"TryConvertString");function u5i(t){return HEt(t)?parseFloat(t):pLe(t)?1:hLe(t)?0:t}a(u5i,"TryConvertNumber");function Eoc(t){return HEt(t)?parseInt(t):(0,Ua.IsNumber)(t)?Math.trunc(t):pLe(t)?1:hLe(t)?0:t}a(Eoc,"TryConvertInteger");function _oc(t){return(0,Ua.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(_oc,"TryConvertNull");function voc(t){return(0,Ua.IsString)(t)&&t==="undefined"?void 0:t}a(voc,"TryConvertUndefined");function Coc(t){return(0,Ua.IsDate)(t)?t:(0,Ua.IsNumber)(t)?new Date(t):pLe(t)?new Date(1):hLe(t)?new Date(0):HEt(t)?new Date(parseInt(t)):uoc(t)?new Date(`1970-01-01T${t}.000Z`):loc(t)?new Date(`1970-01-01T${t}`):foc(t)?new Date(`${t}.000Z`):doc(t)?new Date(t):poc(t)?new Date(`${t}T00:00:00.000Z`):t}a(Coc,"TryConvertDate");function boc(t,e,r){return((0,Ua.IsArray)(r)?r:[r]).map(o=>YD(t.items,e,o))}a(boc,"FromArray");function Soc(t,e,r){return yoc(r)}a(Soc,"FromBigInt");function Toc(t,e,r){return c5i(r)}a(Toc,"FromBoolean");function Ioc(t,e,r){return Coc(r)}a(Ioc,"FromDate");function xoc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return YD(o,[...e,...n],r)}a(xoc,"FromImport");function woc(t,e,r){return Eoc(r)}a(woc,"FromInteger");function Roc(t,e,r){return t.allOf.reduce((n,o)=>YD(o,e,n),r)}a(Roc,"FromIntersect");function koc(t,e,r){return Aoc(t,r)}a(koc,"FromLiteral");function Poc(t,e,r){return _oc(r)}a(Poc,"FromNull");function Doc(t,e,r){return u5i(r)}a(Doc,"FromNumber");function Noc(t,e,r){if(!(0,Ua.IsObject)(r)||(0,Ua.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ua.HasPropertyKey)(r,n)&&(r[n]=YD(t.properties[n],e,r[n]));return r}a(Noc,"FromObject");function Moc(t,e,r){if(!((0,Ua.IsObject)(r)&&!(0,Ua.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(Moc,"FromRecord");function Ooc(t,e,r){return YD((0,Skr.Deref)(t,e),e,r)}a(Ooc,"FromRef");function Loc(t,e,r){return l5i(r)}a(Loc,"FromString");function Boc(t,e,r){return(0,Ua.IsString)(r)||(0,Ua.IsNumber)(r)?Symbol(r):r}a(Boc,"FromSymbol");function Foc(t,e,r){return YD((0,Skr.Deref)(t,e),e,r)}a(Foc,"FromThis");function Uoc(t,e,r){return(0,Ua.IsArray)(r)&&!(0,Ua.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var Hoc=hne&&hne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Goc=hne&&hne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hoc(e,t,r)};Object.defineProperty(hne,"__esModule",{value:!0});Goc(d5i(),hne)});var m5i=I(mne=>{"use strict";p();Object.defineProperty(mne,"__esModule",{value:!0});mne.TransformDecodeError=mne.TransformDecodeCheckError=void 0;mne.TransformDecode=nsc;var $oc=k5e(),f5i=Sn(),p5i=Of(),h5i=yD(),xkr=GD(),Voc=sI(),U6=k0(),mLe=vs(),Ikr=class extends p5i.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}};mne.TransformDecodeCheckError=Ikr;var $Et=class extends p5i.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}};mne.TransformDecodeError=$Et;function Jd(t,e,r){try{return(0,mLe.IsTransform)(t)?t[f5i.TransformKind].Decode(r):r}catch(n){throw new $Et(t,e,r,n)}}a(Jd,"Default");function Woc(t,e,r,n){return(0,U6.IsArray)(n)?Jd(t,r,n.map((o,s)=>KD(t.items,e,`${r}/${s}`,o))):Jd(t,r,n)}a(Woc,"FromArray");function zoc(t,e,r,n){if(!(0,U6.IsObject)(n)||(0,U6.IsValueType)(n))return Jd(t,r,n);let o=(0,h5i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=KD(h,e,`${r}/${f}`,c[f]));if(!(0,mLe.IsTransform)(t.unevaluatedProperties))return Jd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Jd(u,`${r}/${f}`,d[f]));return Jd(t,r,d)}a(zoc,"FromIntersect");function Yoc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=KD(s,[...e,...o],r,n);return Jd(t,r,c)}a(Yoc,"FromImport");function Koc(t,e,r,n){return Jd(t,r,KD(t.not,e,r,n))}a(Koc,"FromNot");function Joc(t,e,r,n){if(!(0,U6.IsObject)(n))return Jd(t,r,n);let o=(0,h5i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,U6.HasPropertyKey)(s,d)&&((0,U6.IsUndefined)(s[d])&&(!(0,mLe.IsUndefined)(t.properties[d])||$oc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=KD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,mLe.IsSchema)(t.additionalProperties))return Jd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Jd(l,`${r}/${d}`,u[d]));return Jd(t,r,u)}a(Joc,"FromObject");function Zoc(t,e,r,n){if(!(0,U6.IsObject)(n))return Jd(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]=KD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,mLe.IsSchema)(t.additionalProperties))return Jd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Jd(u,`${r}/${f}`,d[f]));return Jd(t,r,d)}a(Zoc,"FromRecord");function Xoc(t,e,r,n){let o=(0,xkr.Deref)(t,e);return Jd(t,r,KD(o,e,r,n))}a(Xoc,"FromRef");function esc(t,e,r,n){let o=(0,xkr.Deref)(t,e);return Jd(t,r,KD(o,e,r,n))}a(esc,"FromThis");function tsc(t,e,r,n){return(0,U6.IsArray)(n)&&(0,U6.IsArray)(t.items)?Jd(t,r,t.items.map((o,s)=>KD(o,e,`${r}/${s}`,n[s]))):Jd(t,r,n)}a(tsc,"FromTuple");function rsc(t,e,r,n){for(let o of t.anyOf){if(!(0,Voc.Check)(o,e,n))continue;let s=KD(o,e,r,n);return Jd(t,r,s)}return Jd(t,r,n)}a(rsc,"FromUnion");function KD(t,e,r,n){let o=(0,xkr.Pushref)(t,e),s=t;switch(t[f5i.Kind]){case"Array":return Woc(s,o,r,n);case"Import":return Yoc(s,o,r,n);case"Intersect":return zoc(s,o,r,n);case"Not":return Koc(s,o,r,n);case"Object":return Joc(s,o,r,n);case"Record":return Zoc(s,o,r,n);case"Ref":return Xoc(s,o,r,n);case"Symbol":return Jd(s,r,n);case"This":return esc(s,o,r,n);case"Tuple":return tsc(s,o,r,n);case"Union":return rsc(s,o,r,n);default:return Jd(s,r,n)}}a(KD,"Visit");function nsc(t,e,r){return KD(t,e,"",r)}a(nsc,"TransformDecode")});var _5i=I(gne=>{"use strict";p();Object.defineProperty(gne,"__esModule",{value:!0});gne.TransformEncodeError=gne.TransformEncodeCheckError=void 0;gne.TransformEncode=msc;var isc=k5e(),A5i=Sn(),y5i=Of(),E5i=yD(),Rkr=GD(),g5i=sI(),O$=k0(),gLe=vs(),wkr=class extends y5i.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}};gne.TransformEncodeCheckError=wkr;var VEt=class extends y5i.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}};gne.TransformEncodeError=VEt;function Ey(t,e,r){try{return(0,gLe.IsTransform)(t)?t[A5i.TransformKind].Encode(r):r}catch(n){throw new VEt(t,e,r,n)}}a(Ey,"Default");function osc(t,e,r,n){let o=Ey(t,r,n);return(0,O$.IsArray)(o)?o.map((s,c)=>JD(t.items,e,`${r}/${c}`,s)):o}a(osc,"FromArray");function ssc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Ey(t,r,n);return JD(s,[...e,...o],r,c)}a(ssc,"FromImport");function asc(t,e,r,n){let o=Ey(t,r,n);if(!(0,O$.IsObject)(n)||(0,O$.IsValueType)(n))return o;let s=(0,E5i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=JD(m,e,`${r}/${h}`,l[h]));if(!(0,gLe.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]=Ey(d,`${r}/${h}`,f[h]));return f}a(asc,"FromIntersect");function csc(t,e,r,n){return Ey(t.not,r,Ey(t,r,n))}a(csc,"FromNot");function lsc(t,e,r,n){let o=Ey(t,r,n);if(!(0,O$.IsObject)(o))return o;let s=(0,E5i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,O$.HasPropertyKey)(c,f)&&((0,O$.IsUndefined)(c[f])&&(!(0,gLe.IsUndefined)(t.properties[f])||isc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=JD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,gLe.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]=Ey(u,`${r}/${f}`,d[f]));return d}a(lsc,"FromObject");function usc(t,e,r,n){let o=Ey(t,r,n);if(!(0,O$.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]=JD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,gLe.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]=Ey(d,`${r}/${h}`,f[h]));return f}a(usc,"FromRecord");function dsc(t,e,r,n){let o=(0,Rkr.Deref)(t,e),s=JD(o,e,r,n);return Ey(t,r,s)}a(dsc,"FromRef");function fsc(t,e,r,n){let o=(0,Rkr.Deref)(t,e),s=JD(o,e,r,n);return Ey(t,r,s)}a(fsc,"FromThis");function psc(t,e,r,n){let o=Ey(t,r,n);return(0,O$.IsArray)(t.items)?t.items.map((s,c)=>JD(s,e,`${r}/${c}`,o[c])):[]}a(psc,"FromTuple");function hsc(t,e,r,n){for(let o of t.anyOf){if(!(0,g5i.Check)(o,e,n))continue;let s=JD(o,e,r,n);return Ey(t,r,s)}for(let o of t.anyOf){let s=JD(o,e,r,n);if((0,g5i.Check)(t,e,s))return Ey(t,r,s)}return Ey(t,r,n)}a(hsc,"FromUnion");function JD(t,e,r,n){let o=(0,Rkr.Pushref)(t,e),s=t;switch(t[A5i.Kind]){case"Array":return osc(s,o,r,n);case"Import":return ssc(s,o,r,n);case"Intersect":return asc(s,o,r,n);case"Not":return csc(s,o,r,n);case"Object":return lsc(s,o,r,n);case"Record":return usc(s,o,r,n);case"Ref":return dsc(s,o,r,n);case"This":return fsc(s,o,r,n);case"Tuple":return psc(s,o,r,n);case"Union":return hsc(s,o,r,n);default:return Ey(s,r,n)}}a(JD,"Visit");function msc(t,e,r){return JD(t,e,"",r)}a(msc,"TransformEncode")});var v5i=I(Dkr=>{"use strict";p();Object.defineProperty(Dkr,"__esModule",{value:!0});Dkr.HasTransform=Nsc;var Pkr=GD(),gsc=Sn(),Pm=vs(),Asc=k0();function ysc(t,e){return(0,Pm.IsTransform)(t)||N0(t.items,e)}a(ysc,"FromArray");function Esc(t,e){return(0,Pm.IsTransform)(t)||N0(t.items,e)}a(Esc,"FromAsyncIterator");function _sc(t,e){return(0,Pm.IsTransform)(t)||N0(t.returns,e)||t.parameters.some(r=>N0(r,e))}a(_sc,"FromConstructor");function vsc(t,e){return(0,Pm.IsTransform)(t)||N0(t.returns,e)||t.parameters.some(r=>N0(r,e))}a(vsc,"FromFunction");function Csc(t,e){return(0,Pm.IsTransform)(t)||(0,Pm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>N0(r,e))}a(Csc,"FromIntersect");function bsc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Pm.IsTransform)(t)||N0(n,[...r,...e])}a(bsc,"FromImport");function Ssc(t,e){return(0,Pm.IsTransform)(t)||N0(t.items,e)}a(Ssc,"FromIterator");function Tsc(t,e){return(0,Pm.IsTransform)(t)||N0(t.not,e)}a(Tsc,"FromNot");function Isc(t,e){return(0,Pm.IsTransform)(t)||Object.values(t.properties).some(r=>N0(r,e))||(0,Pm.IsSchema)(t.additionalProperties)&&N0(t.additionalProperties,e)}a(Isc,"FromObject");function xsc(t,e){return(0,Pm.IsTransform)(t)||N0(t.item,e)}a(xsc,"FromPromise");function wsc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Pm.IsTransform)(t)||N0(n,e)||(0,Pm.IsSchema)(t.additionalProperties)&&(0,Pm.IsTransform)(t.additionalProperties)}a(wsc,"FromRecord");function Rsc(t,e){return(0,Pm.IsTransform)(t)?!0:N0((0,Pkr.Deref)(t,e),e)}a(Rsc,"FromRef");function ksc(t,e){return(0,Pm.IsTransform)(t)?!0:N0((0,Pkr.Deref)(t,e),e)}a(ksc,"FromThis");function Psc(t,e){return(0,Pm.IsTransform)(t)||!(0,Asc.IsUndefined)(t.items)&&t.items.some(r=>N0(r,e))}a(Psc,"FromTuple");function Dsc(t,e){return(0,Pm.IsTransform)(t)||t.anyOf.some(r=>N0(r,e))}a(Dsc,"FromUnion");function N0(t,e){let r=(0,Pkr.Pushref)(t,e),n=t;if(t.$id&&kkr.has(t.$id))return!1;switch(t.$id&&kkr.add(t.$id),t[gsc.Kind]){case"Array":return ysc(n,r);case"AsyncIterator":return Esc(n,r);case"Constructor":return _sc(n,r);case"Function":return vsc(n,r);case"Import":return bsc(n,r);case"Intersect":return Csc(n,r);case"Iterator":return Ssc(n,r);case"Not":return Tsc(n,r);case"Object":return Isc(n,r);case"Promise":return xsc(n,r);case"Record":return wsc(n,r);case"Ref":return Rsc(n,r);case"This":return ksc(n,r);case"Tuple":return Psc(n,r);case"Union":return Dsc(n,r);default:return(0,Pm.IsTransform)(t)}}a(N0,"Visit");var kkr=new Set;function Nsc(t,e){return kkr.clear(),N0(t,e)}a(Nsc,"HasTransform")});var ALe=I(Q6=>{"use strict";p();var Msc=Q6&&Q6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Nkr=Q6&&Q6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Msc(e,t,r)};Object.defineProperty(Q6,"__esModule",{value:!0});Nkr(m5i(),Q6);Nkr(_5i(),Q6);Nkr(v5i(),Q6)});var C5i=I(Okr=>{"use strict";p();Object.defineProperty(Okr,"__esModule",{value:!0});Okr.Decode=Bsc;var Mkr=ALe(),Osc=sI(),Lsc=zAe();function Bsc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Osc.Check)(e,r,n))throw new Mkr.TransformDecodeCheckError(e,n,(0,Lsc.Errors)(e,r,n).First());return(0,Mkr.HasTransform)(e,r)?(0,Mkr.TransformDecode)(e,r,n):n}a(Bsc,"Decode")});var Lkr=I(Ane=>{"use strict";p();var Fsc=Ane&&Ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Usc=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Fsc(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});Usc(C5i(),Ane)});var S5i=I(Ukr=>{"use strict";p();Object.defineProperty(Ukr,"__esModule",{value:!0});Ukr.Default=Xsc;var Qsc=sI(),b5i=VD(),Fkr=GD(),qsc=Sn(),h1=k0(),jsc=vs();function q6(t,e){let r=(0,h1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,h1.IsFunction)(r)?r():(0,b5i.Clone)(r);return(0,h1.IsUndefined)(e)?n:(0,h1.IsObject)(e)&&(0,h1.IsObject)(n)?Object.assign(n,e):e}a(q6,"ValueOrDefault");function Bkr(t){return(0,jsc.IsKind)(t)&&"default"in t}a(Bkr,"HasDefaultProperty");function Hsc(t,e,r){if((0,h1.IsArray)(r)){for(let o=0;o{let c=Fv(s,e,n);return(0,h1.IsObject)(c)?{...o,...c}:c},{})}a(Vsc,"FromIntersect");function Wsc(t,e,r){let n=q6(t,r);if(!(0,h1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Fv(t.properties[s],e,n[s]);(0,h1.IsUndefined)(c)||(n[s]=Fv(t.properties[s],e,n[s]))}if(!Bkr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Fv(t.additionalProperties,e,n[s]));return n}a(Wsc,"FromObject");function zsc(t,e,r){let n=q6(t,r);if(!(0,h1.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)&&Bkr(c)&&(n[u]=Fv(c,e,n[u]));if(!Bkr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Fv(o,e,n[u]));return n}a(zsc,"FromRecord");function Ysc(t,e,r){return Fv((0,Fkr.Deref)(t,e),e,q6(t,r))}a(Ysc,"FromRef");function Ksc(t,e,r){return Fv((0,Fkr.Deref)(t,e),e,r)}a(Ksc,"FromThis");function Jsc(t,e,r){let n=q6(t,r);if(!(0,h1.IsArray)(n)||(0,h1.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 eac=yne&&yne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tac=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eac(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});tac(S5i(),yne)});var x5i=I(ZD=>{"use strict";p();Object.defineProperty(ZD,"__esModule",{value:!0});ZD.ValuePointerRootDeleteError=ZD.ValuePointerRootSetError=void 0;ZD.Format=yLe;ZD.Set=rac;ZD.Delete=nac;ZD.Has=iac;ZD.Get=oac;var I5i=Of(),zEt=class extends I5i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};ZD.ValuePointerRootSetError=zEt;var YEt=class extends I5i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};ZD.ValuePointerRootDeleteError=YEt;function T5i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(T5i,"Escape");function*yLe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var sac=lL&&lL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aac=lL&&lL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cac=lL&&lL.__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(Qkr,"__esModule",{value:!0});Qkr.Equal=JEt;var j6=k0();function lac(t,e){if(!(0,j6.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=>JEt(t[o],e[o]))}a(lac,"ObjectType");function uac(t,e){return(0,j6.IsDate)(e)&&t.getTime()===e.getTime()}a(uac,"DateType");function dac(t,e){return!(0,j6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>JEt(r,e[n]))}a(dac,"ArrayType");function fac(t,e){return!(0,j6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>JEt(r,e[n]))}a(fac,"TypedArrayType");function pac(t,e){return t===e}a(pac,"ValueType");function JEt(t,e){if((0,j6.IsDate)(t))return uac(t,e);if((0,j6.IsTypedArray)(t))return fac(t,e);if((0,j6.IsArray)(t))return dac(t,e);if((0,j6.IsObject)(t))return lac(t,e);if((0,j6.IsValueType)(t))return pac(t,e);throw new Error("ValueEquals: Unable to compare value")}a(JEt,"Equal")});var D5i=I(_y=>{"use strict";p();Object.defineProperty(_y,"__esModule",{value:!0});_y.ValueDiffError=_y.Edit=_y.Delete=_y.Update=_y.Insert=void 0;_y.Diff=vac;_y.Patch=Sac;var uL=k0(),jkr=KEt(),Hkr=VD(),hac=qkr(),mac=Of(),Gkr=QE(),$kr=Rv(),Vkr=GG(),R5i=KG(),gac=wp();_y.Insert=(0,$kr.Object)({type:(0,Gkr.Literal)("insert"),path:(0,Vkr.String)(),value:(0,R5i.Unknown)()});_y.Update=(0,$kr.Object)({type:(0,Gkr.Literal)("update"),path:(0,Vkr.String)(),value:(0,R5i.Unknown)()});_y.Delete=(0,$kr.Object)({type:(0,Gkr.Literal)("delete"),path:(0,Vkr.String)()});_y.Edit=(0,gac.Union)([_y.Insert,_y.Update,_y.Delete]);var ELe=class extends mac.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};_y.ValueDiffError=ELe;function ZEt(t,e){return{type:"update",path:t,value:e}}a(ZEt,"CreateUpdate");function k5i(t,e){return{type:"insert",path:t,value:e}}a(k5i,"CreateInsert");function P5i(t){return{type:"delete",path:t}}a(P5i,"CreateDelete");function w5i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new ELe(t,"Cannot diff objects with symbols")}a(w5i,"AssertDiffable");function*Aac(t,e,r){if(w5i(e),w5i(r),!(0,uL.IsStandardObject)(r))return yield ZEt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,uL.HasPropertyKey)(e,s)||(yield k5i(`${t}/${s}`,r[s]));for(let s of n)(0,uL.HasPropertyKey)(r,s)&&((0,hac.Equal)(e,r)||(yield*XEt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,uL.HasPropertyKey)(r,s)||(yield P5i(`${t}/${s}`))}a(Aac,"ObjectType");function*yac(t,e,r){if(!(0,uL.IsArray)(r))return yield ZEt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(Cac,"IsRootUpdate");function bac(t){return t.length===0}a(bac,"IsIdentity");function Sac(t,e){if(Cac(e))return(0,Hkr.Clone)(e[0].value);if(bac(e))return(0,Hkr.Clone)(t);let r=(0,Hkr.Clone)(t);for(let n of e)switch(n.type){case"insert":{jkr.ValuePointer.Set(r,n.path,n.value);break}case"update":{jkr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{jkr.ValuePointer.Delete(r,n.path);break}}return r}a(Sac,"Patch")});var Wkr=I(Ene=>{"use strict";p();var Tac=Ene&&Ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tac(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});Iac(D5i(),Ene)});var N5i=I(Ykr=>{"use strict";p();Object.defineProperty(Ykr,"__esModule",{value:!0});Ykr.Encode=Rac;var zkr=ALe(),xac=sI(),wac=zAe();function Rac(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,zkr.HasTransform)(e,r)?(0,zkr.TransformEncode)(e,r,n):n;if(!(0,xac.Check)(e,r,o))throw new zkr.TransformEncodeCheckError(e,o,(0,wac.Errors)(e,r,o).First());return o}a(Rac,"Encode")});var Kkr=I(_ne=>{"use strict";p();var kac=_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]})),Pac=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kac(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});Pac(N5i(),_ne)});var Jkr=I(vne=>{"use strict";p();var Dac=vne&&vne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Nac=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dac(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});Nac(qkr(),vne)});var O5i=I(vLe=>{"use strict";p();Object.defineProperty(vLe,"__esModule",{value:!0});vLe.ValueMutateError=void 0;vLe.Mutate=Qac;var XD=k0(),t_t=KEt(),Zkr=VD(),Mac=Of();function e_t(t){return(0,XD.IsObject)(t)&&!(0,XD.IsArray)(t)}a(e_t,"IsStandardObject");var _Le=class extends Mac.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};vLe.ValueMutateError=_Le;function Oac(t,e,r,n){if(!e_t(r))t_t.ValuePointer.Set(t,e,(0,Zkr.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)Xkr(t,`${e}/${c}`,r[c],n[c])}}a(Oac,"ObjectType");function Lac(t,e,r,n){if(!(0,XD.IsArray)(r))t_t.ValuePointer.Set(t,e,(0,Zkr.Clone)(n));else{for(let o=0;o{"use strict";p();var qac=Cne&&Cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jac=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qac(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});jac(O5i(),Cne)});var B5i=I(eN=>{"use strict";p();Object.defineProperty(eN,"__esModule",{value:!0});eN.ParseDefault=eN.ParseRegistry=eN.ParseError=void 0;eN.Parse=Jac;var Hac=Of(),r_t=ALe(),Gac=LEt(),$ac=UEt(),Vac=jEt(),Wac=VD(),zac=GEt(),Yac=WEt(),L5i=k0(),CLe=class extends Hac.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};eN.ParseError=CLe;var tPr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,Gac.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,$ac.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,Vac.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Wac.Clone)(l)],["Convert",(s,c,l)=>(0,zac.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,r_t.HasTransform)(s,c)?(0,r_t.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Yac.Default)(s,c,l)],["Encode",(s,c,l)=>(0,r_t.HasTransform)(s,c)?(0,r_t.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})(tPr||(eN.ParseRegistry=tPr={}));eN.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function Kac(t,e,r,n){return t.reduce((o,s)=>{let c=tPr.Get(s);if((0,L5i.IsUndefined)(c))throw new CLe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(Kac,"ParseValue");function Jac(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,L5i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[eN.ParseDefault,t[0],t[1],t[2]]:t.length===2?[eN.ParseDefault,t[0],[],t[1]]:(()=>{throw new CLe("Invalid Arguments")})();return Kac(e,r,n,o)}a(Jac,"Parse")});var rPr=I(bne=>{"use strict";p();var Zac=bne&&bne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xac=bne&&bne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zac(e,t,r)};Object.defineProperty(bne,"__esModule",{value:!0});Xac(B5i(),bne)});var U5i=I(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Parse=Cs.Mutate=Cs.Hash=Cs.Equal=Cs.Encode=Cs.Edit=Cs.Patch=Cs.Diff=Cs.Default=Cs.Decode=Cs.Create=Cs.Convert=Cs.Clone=Cs.Clean=Cs.Check=Cs.Cast=Cs.Assert=Cs.ValueErrorIterator=Cs.Errors=void 0;var F5i=zAe();Object.defineProperty(Cs,"Errors",{enumerable:!0,get:a(function(){return F5i.Errors},"get")});Object.defineProperty(Cs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return F5i.ValueErrorIterator},"get")});var ecc=LEt();Object.defineProperty(Cs,"Assert",{enumerable:!0,get:a(function(){return ecc.Assert},"get")});var tcc=UEt();Object.defineProperty(Cs,"Cast",{enumerable:!0,get:a(function(){return tcc.Cast},"get")});var rcc=sI();Object.defineProperty(Cs,"Check",{enumerable:!0,get:a(function(){return rcc.Check},"get")});var ncc=jEt();Object.defineProperty(Cs,"Clean",{enumerable:!0,get:a(function(){return ncc.Clean},"get")});var icc=VD();Object.defineProperty(Cs,"Clone",{enumerable:!0,get:a(function(){return icc.Clone},"get")});var occ=GEt();Object.defineProperty(Cs,"Convert",{enumerable:!0,get:a(function(){return occ.Convert},"get")});var scc=BEt();Object.defineProperty(Cs,"Create",{enumerable:!0,get:a(function(){return scc.Create},"get")});var acc=Lkr();Object.defineProperty(Cs,"Decode",{enumerable:!0,get:a(function(){return acc.Decode},"get")});var ccc=WEt();Object.defineProperty(Cs,"Default",{enumerable:!0,get:a(function(){return ccc.Default},"get")});var nPr=Wkr();Object.defineProperty(Cs,"Diff",{enumerable:!0,get:a(function(){return nPr.Diff},"get")});Object.defineProperty(Cs,"Patch",{enumerable:!0,get:a(function(){return nPr.Patch},"get")});Object.defineProperty(Cs,"Edit",{enumerable:!0,get:a(function(){return nPr.Edit},"get")});var lcc=Kkr();Object.defineProperty(Cs,"Encode",{enumerable:!0,get:a(function(){return lcc.Encode},"get")});var ucc=Jkr();Object.defineProperty(Cs,"Equal",{enumerable:!0,get:a(function(){return ucc.Equal},"get")});var dcc=nLe();Object.defineProperty(Cs,"Hash",{enumerable:!0,get:a(function(){return dcc.Hash},"get")});var fcc=ePr();Object.defineProperty(Cs,"Mutate",{enumerable:!0,get:a(function(){return fcc.Mutate},"get")});var pcc=rPr();Object.defineProperty(Cs,"Parse",{enumerable:!0,get:a(function(){return pcc.Parse},"get")})});var Q5i=I(dL=>{"use strict";p();var hcc=dL&&dL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mcc=dL&&dL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gcc=dL&&dL.__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 Acc=Vc&&Vc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eA=Vc&&Vc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Acc(e,t,r)};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Value=Vc.ValueErrorIterator=Vc.ValueErrorType=void 0;var q5i=zAe();Object.defineProperty(Vc,"ValueErrorType",{enumerable:!0,get:a(function(){return q5i.ValueErrorType},"get")});Object.defineProperty(Vc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return q5i.ValueErrorIterator},"get")});eA(k0(),Vc);eA(LEt(),Vc);eA(UEt(),Vc);eA(sI(),Vc);eA(jEt(),Vc);eA(VD(),Vc);eA(GEt(),Vc);eA(BEt(),Vc);eA(Lkr(),Vc);eA(WEt(),Vc);eA(Wkr(),Vc);eA(Kkr(),Vc);eA(Jkr(),Vc);eA(nLe(),Vc);eA(ePr(),Vc);eA(rPr(),Vc);eA(KEt(),Vc);eA(ALe(),Vc);var ycc=Q5i();Object.defineProperty(Vc,"Value",{enumerable:!0,get:a(function(){return ycc.Value},"get")})});var H5i=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.assertShape=void 0;var j5i=iPr(),Ecc=a((t,e)=>{if(j5i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...j5i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");n_t.assertShape=Ecc});var Sne={};ki(Sne,{CAPIClient:()=>Tcc,RequestType:()=>$5i});async function bcc(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 Scc(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 _cc,oPr,bLe,vcc,Ccc,$5i,Tcc,Tne=ve(()=>{p();_cc=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)}}},oPr=class G5i{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||G5i.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`}};oPr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",oPr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";bLe=oPr,vcc=`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. @@ -1069,52 +1069,52 @@ 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.`,scc=`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.`,Ccc=`I have read and agree to the following license terms: -${occ} -`,B5i=(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))(B5i||{});a(acc,"v");a(ccc,"_");lcc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===scc&&(this._licenseCheckSucceeded=!0),this._domainService=new yLe,this._fetcherService=r??new icc,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(`${yLe.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.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(`${yLe.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.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(!ccc(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 acc(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 _y=I(Bv=>{"use strict";p();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.DestroyableStream=Bv.HeadersImpl=Bv.Response=Bv.NO_FETCH_TELEMETRY=Bv.IFetcherService=void 0;Bv.jsonVerboseError=dcc;Bv.isAbortError=F5i;Bv.safeGetHostname=fcc;var ucc=nn();Bv.IFetcherService=(0,ucc.createServiceIdentifier)("IFetcherService");Bv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var rPr=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&&!F5i(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 e_t(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())}};Bv.Response=rPr;var nPr=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")}}};Bv.HeadersImpl=nPr;var e_t=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()}};Bv.DestroyableStream=e_t;async function dcc(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${vcc} +`,$5i=(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))($5i||{});a(bcc,"v");a(Scc,"_");Tcc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===Ccc&&(this._licenseCheckSucceeded=!0),this._domainService=new bLe,this._fetcherService=r??new _cc,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(`${bLe.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${bLe.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(`${bLe.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${bLe.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(!Scc(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 bcc(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 vy=I(Uv=>{"use strict";p();Object.defineProperty(Uv,"__esModule",{value:!0});Uv.DestroyableStream=Uv.HeadersImpl=Uv.Response=Uv.NO_FETCH_TELEMETRY=Uv.IFetcherService=void 0;Uv.jsonVerboseError=xcc;Uv.isAbortError=V5i;Uv.safeGetHostname=wcc;var Icc=nn();Uv.IFetcherService=(0,Icc.createServiceIdentifier)("IFetcherService");Uv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var sPr=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&&!V5i(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 i_t(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())}};Uv.Response=sPr;var aPr=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")}}};Uv.HeadersImpl=aPr;var i_t=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()}};Uv.DestroyableStream=i_t;async function xcc(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(dcc,"jsonVerboseError");function F5i(t){return t&&t.name==="AbortError"}a(F5i,"isAbortError");function fcc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(fcc,"safeGetHostname")});var U5i=I(zAe=>{"use strict";p();Object.defineProperty(zAe,"__esModule",{value:!0});zAe.INTEGRATION_ID=zAe.LICENSE_AGREEMENT=void 0;zAe.LICENSE_AGREEMENT=void 0;zAe.INTEGRATION_ID="code-oss"});var $E=I(YAe=>{"use strict";p();Object.defineProperty(YAe,"__esModule",{value:!0});YAe.ICAPIClientService=YAe.BaseCAPIClientService=void 0;var ELe=(Sne(),ba(bne)),pcc=nn(),hcc=_y(),mcc=U5i(),iPr=class extends ELe.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()},mcc.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===ELe.RequestType.Telemetry||r.type===ELe.RequestType.ChatCompletions||r.type===ELe.RequestType.ChatMessages||r.type===ELe.RequestType.ChatResponses)&&(e.callSite=hcc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};YAe.BaseCAPIClientService=iPr;YAe.ICAPIClientService=(0,pcc.createServiceIdentifier)("ICAPIClientService")});var r_t=I(t_t=>{"use strict";p();Object.defineProperty(t_t,"__esModule",{value:!0});t_t.getEndpointUrl=vcc;t_t.getLastKnownEndpoints=Ccc;var gcc=FE(),Acc=$E(),D$=LE(),ycc=rne(),Ecc=o$();function q5i(t){let e=t.get(Acc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(q5i,"getDefaultEndpoints");function Q5i(t,e,r){if(r!==void 0&&t.get(ycc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,D$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,D$.getConfig)(t,n);if(o)return o}}a(Q5i,"urlConfigOverride");function _cc(t,e){switch(e){case"proxy":return Q5i(t,[D$.ConfigKey.DebugOverrideProxyUrl,D$.ConfigKey.DebugOverrideProxyUrlLegacy],[D$.ConfigKey.DebugTestOverrideProxyUrl,D$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!D$.BuildInfo.isProduction())return Q5i(t,[D$.ConfigKey.DebugSnippyOverrideUrl])}}a(_cc,"getEndpointOverrideUrl");function vcc(t,e,r,...n){let o=_cc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??q5i(t)[r];return(0,Ecc.joinPath)(o,...n)}a(vcc,"getEndpointUrl");function Ccc(t){return t.get(gcc.IAuthenticationService).copilotToken?.endpoints??q5i(t)}a(Ccc,"getLastKnownEndpoints")});var sPr=I(_Le=>{"use strict";p();Object.defineProperty(_Le,"__esModule",{value:!0});_Le.Response=void 0;_Le.isAbortError=Scc;var bcc=_y();Object.defineProperty(_Le,"Response",{enumerable:!0,get:a(function(){return bcc.Response},"get")});var oPr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Scc(t){return!t||typeof t!="object"?!1:t instanceof oPr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Scc,"isAbortError")});var KAe=I(N0=>{"use strict";p();var Tcc=N0&&N0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Icc=N0&&N0.__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},xcc=N0&&N0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tcc(e,t,r)},aPr=N0&&N0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N0,"__esModule",{value:!0});N0.Fetcher=N0.CompletionsFetcher=N0.ICompletionsFetcherService=void 0;N0.isInterruptedNetworkError=Pcc;xcc(sPr(),N0);var j5i=Pl(),wcc=_y(),Rcc=mh(),kcc=nn();N0.ICompletionsFetcherService=(0,kcc.createServiceIdentifier)("ICompletionsFetcherService");var cPr=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(j5i.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()}};N0.CompletionsFetcher=cPr;N0.CompletionsFetcher=cPr=Icc([aPr(0,j5i.IConfigurationService),aPr(1,wcc.IFetcherService),aPr(2,Rcc.IExperimentationService)],cPr);var lPr=class{static{a(this,"Fetcher")}getImplementation(){return this}};N0.Fetcher=lPr;function Pcc(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(Pcc,"isInterruptedNetworkError")});var H5i=I(JAe=>{"use strict";p();Object.defineProperty(JAe,"__esModule",{value:!0});JAe.FeatureName=JAe.OutputPaneShowCommand=void 0;JAe.OutputPaneShowCommand="codereferencing.showOutputPane2";JAe.FeatureName="code-referencing"});var vLe=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.codeReferenceLogger=void 0;var Dcc=Dl(),Ncc=H5i();n_t.codeReferenceLogger=new Dcc.Logger(Ncc.FeatureName)});var V5i=I(s_t=>{"use strict";p();Object.defineProperty(s_t,"__esModule",{value:!0});s_t.ConnectionState=void 0;var Mcc=Gs(),Occ=Dl(),Lcc=r_t(),Bcc=KAe(),CLe=vLe(),Fcc=3e3,uPr=2,G5i=256,$5i=Math.log(G5i)/Math.log(uPr)/uPr,ZD={connection:"disabled",maxAttempts:$5i,retryAttempts:0,initialWait:!1},i_t,o_t=[];function Ucc(){if(i_t)return i_t;function t(_){return o_t.push(_),()=>{let v=o_t.indexOf(_);v!==-1&&o_t.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of o_t)_()}a(e,"afterUpdateConnection");function r(_){ZD.connection!==_&&(ZD.connection=_,e())}a(r,"updateConnection");function n(){return ZD.connection==="connected"}a(n,"isConnected");function o(){return ZD.connection==="disconnected"}a(o,"isDisconnected");function s(){return ZD.connection==="retry"}a(s,"isRetrying");function c(){return ZD.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(_){ZD.initialWait!==_&&(ZD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Fcc){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return ZD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Occ.ICompletionsLogTargetService),T=_.get(Bcc.ICompletionsFetcherService),w=_.get(Mcc.IInstantiationService);CLe.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>G5i){CLe.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{ZD.retryAttempts=Math.min(ZD.retryAttempts+1,$5i);try{CLe.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(Lcc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{CLe.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),CLe.codeReferenceLogger.info(b,"Attempting to reconnect."),R(uPr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),i_t={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},i_t}a(Ucc,"registerConnectionState");s_t.ConnectionState=Ucc()});var z5i=I(eA=>{"use strict";p();Object.defineProperty(eA,"__esModule",{value:!0});eA.ErrorMessages=eA.ErrorReasons=void 0;eA.getErrorType=W5i;eA.createErrorResponse=Qcc;eA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};eA.ErrorMessages={[eA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[eA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[eA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function W5i(t){return t===401?eA.ErrorReasons.Unauthorized:t===400?eA.ErrorReasons.BadArguments:t===404?eA.ErrorReasons.NotFound:t===429?eA.ErrorReasons.RateLimit:t>=500&&t<600?eA.ErrorReasons.InternalError:t>=600?eA.ErrorReasons.ConnectionError:eA.ErrorReasons.Unknown}a(W5i,"getErrorType");function Qcc(t,e,r={}){return{kind:"failure",reason:W5i(Number(t)),code:Number(t),msg:e,meta:r}}a(Qcc,"createErrorResponse")});var mPr=I(dL=>{"use strict";p();Object.defineProperty(dL,"__esModule",{value:!0});dL.NoopTelemetryReporter=dL.snippyTelemetry=dL.matchNotificationTelemetry=dL.copilotOutputLogTelemetry=void 0;var qcc=Dl(),VE=$g(),jcc=vLe(),Hcc=/^[1-6][0-9][0-9]$/,Gcc=/([A-Z][a-z]+)/,$cc="code_referencing",ZAe=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[$cc,this.baseKey,...e].join(".")}},dPr=class extends ZAe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=VE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(VE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(VE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(VE.telemetry,n,r)}};dL.copilotOutputLogTelemetry=new dPr;var fPr=class extends ZAe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(VE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(VE.telemetry,o,n)}};dL.matchNotificationTelemetry=new fPr;var pPr=class extends ZAe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Hcc)){e.invokeFunction(l=>jcc.codeReferenceLogger.debug(l.get(qcc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(Gcc).filter(l=>!!l).join("_").toLowerCase(),c=VE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(VE.telemetryError,this.buildKey(s,r),c)}};dL.snippyTelemetry=new pPr;var hPr=class extends ZAe{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};dL.NoopTelemetryReporter=hPr});var Y5i=I(gPr=>{"use strict";p();Object.defineProperty(gPr,"__esModule",{value:!0});gPr.call=elc;var Vcc=Gs(),Wcc=Uge(),zcc=LE(),Ycc=Dl(),Kcc=r_t(),Jcc=KAe(),XAe=V5i(),yh=z5i(),Zcc=vLe(),Xcc=mPr();async function elc(t,e,r,n){let o,s=t.get(Ycc.ICompletionsLogTargetService),c=t.get(Vcc.IInstantiationService),l=t.get(Wcc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return XAe.ConnectionState.setDisconnected(),(0,yh.createErrorResponse)(401,yh.ErrorMessages[yh.ErrorReasons.Unauthorized])}if(Zcc.codeReferenceLogger.info(s,`Calling ${e}`),XAe.ConnectionState.isRetrying())return(0,yh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(XAe.ConnectionState.isDisconnected())return(0,yh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(Jcc.ICompletionsFetcherService).fetch((0,Kcc.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,zcc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(XAe.ConnectionState.enableRetry),(0,yh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw Xcc.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,yh.getErrorType)(A),E=m||"unknown error";switch(y){case yh.ErrorReasons.Unauthorized:return(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.Unauthorized],g);case yh.ErrorReasons.BadArguments:return(0,yh.createErrorResponse)(h,E,g);case yh.ErrorReasons.RateLimit:return c.invokeFunction(_=>XAe.ConnectionState.enableRetry(_,60*1e3)),(0,yh.createErrorResponse)(h,yh.ErrorMessages.RateLimitError,g);case yh.ErrorReasons.InternalError:return c.invokeFunction(_=>XAe.ConnectionState.enableRetry(_)),(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.InternalError],g);default:return(0,yh.createErrorResponse)(h,E,g)}}a(elc,"call")});var APr=I(m1=>{"use strict";p();Object.defineProperty(m1,"__esModule",{value:!0});m1.FileMatchResponse=m1.FileMatchRequest=m1.MatchResponse=m1.MatchRequest=m1.MatchError=void 0;var Ea=DAt();m1.MatchError=Ea.Type.Object({kind:Ea.Type.Literal("failure"),reason:Ea.Type.String(),code:Ea.Type.Number(),msg:Ea.Type.String(),meta:Ea.Type.Optional(Ea.Type.Any())});var tlc=Ea.Type.Object({matched_source:Ea.Type.String(),occurrences:Ea.Type.String(),capped:Ea.Type.Boolean(),cursor:Ea.Type.String(),github_url:Ea.Type.String()});m1.MatchRequest=Ea.Type.Object({source:Ea.Type.String()});var rlc=Ea.Type.Object({snippets:Ea.Type.Array(tlc)});m1.MatchResponse=Ea.Type.Union([rlc,m1.MatchError]);m1.FileMatchRequest=Ea.Type.Object({cursor:Ea.Type.String()});var nlc=Ea.Type.Object({commit_id:Ea.Type.String(),license:Ea.Type.String(),nwo:Ea.Type.String(),path:Ea.Type.String(),url:Ea.Type.String()}),ilc=Ea.Type.Object({has_next_page:Ea.Type.Boolean(),cursor:Ea.Type.String()}),olc=Ea.Type.Object({count:Ea.Type.Record(Ea.Type.String(),Ea.Type.String())}),slc=Ea.Type.Object({file_matches:Ea.Type.Array(nlc),page_info:ilc,license_stats:olc});m1.FileMatchResponse=Ea.Type.Union([slc,m1.MatchError])});var X5i=I(fL=>{"use strict";p();var alc=fL&&fL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=fL&&fL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K5i=fL&&fL.__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(q6,"__esModule",{value:!0});q6.MinTokenLength=void 0;q6.lexemeLength=e4i;q6.offsetLastLexemes=flc;q6.hasMinLexemeLength=plc;var bLe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");q6.MinTokenLength=65;function e4i(t){let e=0,r;bLe.lastIndex=0;do if(r=bLe.exec(t),r&&(e+=1),e>=q6.MinTokenLength)break;while(r);return e}a(e4i,"lexemeLength");function dlc(t,e){let r=0,n;bLe.lastIndex=0;do if(n=bLe.exec(t),n&&(r+=1,r>=e))return bLe.lastIndex;while(n);return t.length}a(dlc,"offsetFirstLexemes");function flc(t,e){let r=t.split("").reverse().join(""),n=dlc(r,e);return r.length-n}a(flc,"offsetLastLexemes");function plc(t){return e4i(t)>=q6.MinTokenLength}a(plc,"hasMinLexemeLength")});var a4i=I(j6=>{"use strict";p();var hlc=j6&&j6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mlc=j6&&j6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o4i=j6&&j6.__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;on4i(E,()=>r4i.Match(E,f)));if(!h||i4i(h)||!h.snippets.length){yPr.codeReferenceLogger.info(s,"No match found");return}yPr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>n4i(T,()=>r4i.FilesForMatch(T,{cursor:E.cursor})));if(!_||i4i(_))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(blc,"fetchCitations")});var p4i=I(N$=>{"use strict";p();Object.defineProperty(N$,"__esModule",{value:!0});N$.editDistance=l4i;N$.emptyLexDictionary=u4i;N$.reverseLexDictionary=d4i;N$.lexGeneratorWords=f4i;N$.lexicalAnalyzer=EPr;N$.lexEditDistance=Slc;function l4i(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(f4i,"lexGeneratorWords");function EPr(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(EPr,"lexicalAnalyzer");function c4i(t){return t!==" "}a(c4i,"notSingleSpace");function Slc(t,e,r=f4i){let[n,o]=EPr(t,u4i(),r,c4i),[s,c]=EPr(e,o,r,c4i);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=d4i(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=l4i(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(Slc,"lexEditDistance")});var _Pr=I(Tne=>{"use strict";p();Object.defineProperty(Tne,"__esModule",{value:!0});Tne.PartialAcceptTriggerKind=void 0;Tne.computeCompCharLen=Tlc;Tne.countLines=Ilc;Tne.computeCompletionText=xlc;var h4i;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(h4i||(Tne.PartialAcceptTriggerKind=h4i={}));function Tlc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Tlc,"computeCompCharLen");function Ilc(t){return t.length===0?0:t.split(` -`).length}a(Ilc,"countLines");function xlc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(xlc,"computeCompletionText")});var S4i=I(d_t=>{"use strict";p();Object.defineProperty(d_t,"__esModule",{value:!0});d_t.postRejectionTasks=Ulc;d_t.postInsertionTasks=Qlc;var u_t=Gs(),A4i=bte(),wlc=Uge(),l_t=P2i(),Rlc=mgt(),klc=pIr(),y4i=LTr(),E4i=xAe(),tye=Dl(),m4i=gyt(),Plc=qAe(),Dlc=a4i(),g4i=p4i(),Nlc=_Pr(),M$=$g(),Mlc=s1(),_4i=_5e(),Olc=rne(),O$=new tye.Logger("postInsertion"),v4i=[{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}],C4i=50,Llc=1500,Blc=.5,Flc=500,vPr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function b4i(t,e,r,n,o){let s=t.get(u_t.IInstantiationService),c=t.get(tye.ICompletionsLogTargetService),l=await t.get(y4i.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return O$.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(Plc.extractPrompt,r.properties.headerRequestId,(0,klc.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,m4i.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,m4i.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Flc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(b4i,"captureCode");function Ulc(t,e,r,n,o){let s=t.get(tye.ICompletionsLogTargetService),c=t.get(u_t.IInstantiationService),l=t.get(A4i.ICompletionsTelemetryService),u=t.get(_4i.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{O$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(E4i.telemetryRejected,e,g)});let d=c.createInstance(l_t.ChangeTracker,n,r-1),f=c.createInstance(l_t.ChangeTracker,n,r),h=a(async m=>{O$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(b4i,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});O$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(M$.telemetry,e+".capturedAfterRejected",v,M$.TelemetryStore.Enhanced)},"checkInCode");v4i.filter(m=>m.captureRejection).map(m=>d.push((0,M$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Ulc,"postRejectionTasks");function Qlc(t,e,r,n,o,s,c,l){let u=t.get(tye.ICompletionsLogTargetService),d=t.get(u_t.IInstantiationService),f=t.get(_4i.ICompletionsPromiseQueueService),h=t.get(A4i.ICompletionsTelemetryService),m=t.get(Olc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});O$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(E4i.telemetryAccepted,e,g);let A=r;r=(0,Nlc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(l_t.ChangeTracker,o,n),_=d.createInstance(l_t.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(Glc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(vPr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:vPr.captureCode,captureRejection:vPr.captureRejection});f.register(b)}else v4i.map(b=>E.push((0,M$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,M$.telemetryCatch)(h,f,qlc,"post insertion citation check")(b,o,A,r,n,l))}a(Qlc,"postInsertionTasks");async function qlc(t,e,r,n,o,s){let c=t.get(tye.ICompletionsLogTargetService),l=t.get(Mlc.ICompletionsTextDocumentManagerService),u=t.get(wlc.ICompletionsCopilotTokenManager),d=t.get(Rlc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,Dlc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=CPr(f.getText(),n,C4i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=jlc(r.length,n.length,h.start_offset);if(m===void 0){O$.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+Hlc(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(qlc,"citationCheck");function jlc(t,e,r){if(!(ee))return r}a(jlc,"computeCitationStart");function Hlc(t,e,r){return e{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.LastGhostText=vy.ICompletionsLastGhostText=void 0;vy.rejectLastShown=x4i;vy.setLastShown=zlc;vy.handleGhostTextShown=Ylc;vy.handleGhostTextPostInsert=Jlc;vy.handlePartialGhostTextPostInsert=Zlc;var $lc=nn(),T4i=Dl(),SPr=S4i(),f_t=_Pr(),I4i=a$(),TPr=xAe(),Vlc=new T4i.Logger("ghostText");vy.ICompletionsLastGhostText=(0,$lc.createServiceIdentifier)("ICompletionsLastGhostText");var bPr=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}};vy.LastGhostText=bPr;function Wlc(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(Wlc,"computeRejectedCompletions");function x4i(t,e){let r=t.get(vy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=Wlc(r);n.length>0&&(0,SPr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(x4i,"rejectLastShown");function zlc(t,e,r,n){let o=t.get(vy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==I4i.ResultType.TypingAsSuggested&&x4i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(zlc,"setLastShown");function Ylc(t,e){let r=t.get(T4i.ICompletionsLogTargetService),n=t.get(vy.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!==I4i.ResultType.Network;Vlc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,TPr.telemetryShown)(t,e)}}a(Ylc,"handleGhostTextShown");function Klc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,f_t.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,f_t.countLines)(e.displayText));let o=(0,f_t.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(Klc,"handleLineAcceptance");function Jlc(t,e){let r=t.get(vy.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,f_t.countLines)(e.displayText)},r.resetState(),(0,SPr.postInsertionTasks)(t,TPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Jlc,"handleGhostTextPostInsert");function Zlc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);Klc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,SPr.postInsertionTasks)(t,TPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Zlc,"handlePartialGhostTextPostInsert")});var w4i=I(xPr=>{"use strict";p();Object.defineProperty(xPr,"__esModule",{value:!0});xPr.normalizeIndentCharacter=Xlc;function Xlc(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(xcc,"jsonVerboseError");function V5i(t){return t&&t.name==="AbortError"}a(V5i,"isAbortError");function wcc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(wcc,"safeGetHostname")});var W5i=I(KAe=>{"use strict";p();Object.defineProperty(KAe,"__esModule",{value:!0});KAe.INTEGRATION_ID=KAe.LICENSE_AGREEMENT=void 0;KAe.LICENSE_AGREEMENT=void 0;KAe.INTEGRATION_ID="code-oss"});var VE=I(JAe=>{"use strict";p();Object.defineProperty(JAe,"__esModule",{value:!0});JAe.ICAPIClientService=JAe.BaseCAPIClientService=void 0;var SLe=(Tne(),Sa(Sne)),Rcc=nn(),kcc=vy(),Pcc=W5i(),cPr=class extends SLe.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()},Pcc.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===SLe.RequestType.Telemetry||r.type===SLe.RequestType.ChatCompletions||r.type===SLe.RequestType.ChatMessages||r.type===SLe.RequestType.ChatResponses)&&(e.callSite=kcc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};JAe.BaseCAPIClientService=cPr;JAe.ICAPIClientService=(0,Rcc.createServiceIdentifier)("ICAPIClientService")});var s_t=I(o_t=>{"use strict";p();Object.defineProperty(o_t,"__esModule",{value:!0});o_t.getEndpointUrl=Bcc;o_t.getLastKnownEndpoints=Fcc;var Dcc=UE(),Ncc=VE(),L$=BE(),Mcc=nne(),Occ=l$();function Y5i(t){let e=t.get(Ncc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(Y5i,"getDefaultEndpoints");function z5i(t,e,r){if(r!==void 0&&t.get(Mcc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,L$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,L$.getConfig)(t,n);if(o)return o}}a(z5i,"urlConfigOverride");function Lcc(t,e){switch(e){case"proxy":return z5i(t,[L$.ConfigKey.DebugOverrideProxyUrl,L$.ConfigKey.DebugOverrideProxyUrlLegacy],[L$.ConfigKey.DebugTestOverrideProxyUrl,L$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!L$.BuildInfo.isProduction())return z5i(t,[L$.ConfigKey.DebugSnippyOverrideUrl])}}a(Lcc,"getEndpointOverrideUrl");function Bcc(t,e,r,...n){let o=Lcc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??Y5i(t)[r];return(0,Occ.joinPath)(o,...n)}a(Bcc,"getEndpointUrl");function Fcc(t){return t.get(Dcc.IAuthenticationService).copilotToken?.endpoints??Y5i(t)}a(Fcc,"getLastKnownEndpoints")});var uPr=I(TLe=>{"use strict";p();Object.defineProperty(TLe,"__esModule",{value:!0});TLe.Response=void 0;TLe.isAbortError=Qcc;var Ucc=vy();Object.defineProperty(TLe,"Response",{enumerable:!0,get:a(function(){return Ucc.Response},"get")});var lPr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Qcc(t){return!t||typeof t!="object"?!1:t instanceof lPr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Qcc,"isAbortError")});var ZAe=I(M0=>{"use strict";p();var qcc=M0&&M0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jcc=M0&&M0.__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},Hcc=M0&&M0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qcc(e,t,r)},dPr=M0&&M0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M0,"__esModule",{value:!0});M0.Fetcher=M0.CompletionsFetcher=M0.ICompletionsFetcherService=void 0;M0.isInterruptedNetworkError=Wcc;Hcc(uPr(),M0);var K5i=Dl(),Gcc=vy(),$cc=Ah(),Vcc=nn();M0.ICompletionsFetcherService=(0,Vcc.createServiceIdentifier)("ICompletionsFetcherService");var fPr=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(K5i.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()}};M0.CompletionsFetcher=fPr;M0.CompletionsFetcher=fPr=jcc([dPr(0,K5i.IConfigurationService),dPr(1,Gcc.IFetcherService),dPr(2,$cc.IExperimentationService)],fPr);var pPr=class{static{a(this,"Fetcher")}getImplementation(){return this}};M0.Fetcher=pPr;function Wcc(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(Wcc,"isInterruptedNetworkError")});var J5i=I(XAe=>{"use strict";p();Object.defineProperty(XAe,"__esModule",{value:!0});XAe.FeatureName=XAe.OutputPaneShowCommand=void 0;XAe.OutputPaneShowCommand="codereferencing.showOutputPane2";XAe.FeatureName="code-referencing"});var ILe=I(a_t=>{"use strict";p();Object.defineProperty(a_t,"__esModule",{value:!0});a_t.codeReferenceLogger=void 0;var zcc=Nl(),Ycc=J5i();a_t.codeReferenceLogger=new zcc.Logger(Ycc.FeatureName)});var e4i=I(u_t=>{"use strict";p();Object.defineProperty(u_t,"__esModule",{value:!0});u_t.ConnectionState=void 0;var Kcc=Gs(),Jcc=Nl(),Zcc=s_t(),Xcc=ZAe(),xLe=ILe(),elc=3e3,hPr=2,Z5i=256,X5i=Math.log(Z5i)/Math.log(hPr)/hPr,tN={connection:"disabled",maxAttempts:X5i,retryAttempts:0,initialWait:!1},c_t,l_t=[];function tlc(){if(c_t)return c_t;function t(_){return l_t.push(_),()=>{let v=l_t.indexOf(_);v!==-1&&l_t.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of l_t)_()}a(e,"afterUpdateConnection");function r(_){tN.connection!==_&&(tN.connection=_,e())}a(r,"updateConnection");function n(){return tN.connection==="connected"}a(n,"isConnected");function o(){return tN.connection==="disconnected"}a(o,"isDisconnected");function s(){return tN.connection==="retry"}a(s,"isRetrying");function c(){return tN.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(_){tN.initialWait!==_&&(tN.initialWait=_)}a(h,"setInitialWait");function m(_,v=elc){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return tN.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Jcc.ICompletionsLogTargetService),T=_.get(Xcc.ICompletionsFetcherService),w=_.get(Kcc.IInstantiationService);xLe.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>Z5i){xLe.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{tN.retryAttempts=Math.min(tN.retryAttempts+1,X5i);try{xLe.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(Zcc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{xLe.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),xLe.codeReferenceLogger.info(b,"Attempting to reconnect."),R(hPr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),c_t={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},c_t}a(tlc,"registerConnectionState");u_t.ConnectionState=tlc()});var r4i=I(tA=>{"use strict";p();Object.defineProperty(tA,"__esModule",{value:!0});tA.ErrorMessages=tA.ErrorReasons=void 0;tA.getErrorType=t4i;tA.createErrorResponse=rlc;tA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};tA.ErrorMessages={[tA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[tA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[tA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function t4i(t){return t===401?tA.ErrorReasons.Unauthorized:t===400?tA.ErrorReasons.BadArguments:t===404?tA.ErrorReasons.NotFound:t===429?tA.ErrorReasons.RateLimit:t>=500&&t<600?tA.ErrorReasons.InternalError:t>=600?tA.ErrorReasons.ConnectionError:tA.ErrorReasons.Unknown}a(t4i,"getErrorType");function rlc(t,e,r={}){return{kind:"failure",reason:t4i(Number(t)),code:Number(t),msg:e,meta:r}}a(rlc,"createErrorResponse")});var EPr=I(fL=>{"use strict";p();Object.defineProperty(fL,"__esModule",{value:!0});fL.NoopTelemetryReporter=fL.snippyTelemetry=fL.matchNotificationTelemetry=fL.copilotOutputLogTelemetry=void 0;var nlc=Nl(),WE=Vg(),ilc=ILe(),olc=/^[1-6][0-9][0-9]$/,slc=/([A-Z][a-z]+)/,alc="code_referencing",eye=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[alc,this.baseKey,...e].join(".")}},mPr=class extends eye{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=WE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(WE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=WE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(WE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=WE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(WE.telemetry,n,r)}};fL.copilotOutputLogTelemetry=new mPr;var gPr=class extends eye{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=WE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(WE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=WE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(WE.telemetry,o,n)}};fL.matchNotificationTelemetry=new gPr;var APr=class extends eye{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=WE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(WE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=WE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(WE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(olc)){e.invokeFunction(l=>ilc.codeReferenceLogger.debug(l.get(nlc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(slc).filter(l=>!!l).join("_").toLowerCase(),c=WE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(WE.telemetryError,this.buildKey(s,r),c)}};fL.snippyTelemetry=new APr;var yPr=class extends eye{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};fL.NoopTelemetryReporter=yPr});var n4i=I(_Pr=>{"use strict";p();Object.defineProperty(_Pr,"__esModule",{value:!0});_Pr.call=glc;var clc=Gs(),llc=qge(),ulc=BE(),dlc=Nl(),flc=s_t(),plc=ZAe(),tye=e4i(),_h=r4i(),hlc=ILe(),mlc=EPr();async function glc(t,e,r,n){let o,s=t.get(dlc.ICompletionsLogTargetService),c=t.get(clc.IInstantiationService),l=t.get(llc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return tye.ConnectionState.setDisconnected(),(0,_h.createErrorResponse)(401,_h.ErrorMessages[_h.ErrorReasons.Unauthorized])}if(hlc.codeReferenceLogger.info(s,`Calling ${e}`),tye.ConnectionState.isRetrying())return(0,_h.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(tye.ConnectionState.isDisconnected())return(0,_h.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(plc.ICompletionsFetcherService).fetch((0,flc.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,ulc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(tye.ConnectionState.enableRetry),(0,_h.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw mlc.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,_h.getErrorType)(A),E=m||"unknown error";switch(y){case _h.ErrorReasons.Unauthorized:return(0,_h.createErrorResponse)(h,_h.ErrorMessages[_h.ErrorReasons.Unauthorized],g);case _h.ErrorReasons.BadArguments:return(0,_h.createErrorResponse)(h,E,g);case _h.ErrorReasons.RateLimit:return c.invokeFunction(_=>tye.ConnectionState.enableRetry(_,60*1e3)),(0,_h.createErrorResponse)(h,_h.ErrorMessages.RateLimitError,g);case _h.ErrorReasons.InternalError:return c.invokeFunction(_=>tye.ConnectionState.enableRetry(_)),(0,_h.createErrorResponse)(h,_h.ErrorMessages[_h.ErrorReasons.InternalError],g);default:return(0,_h.createErrorResponse)(h,E,g)}}a(glc,"call")});var vPr=I(m1=>{"use strict";p();Object.defineProperty(m1,"__esModule",{value:!0});m1.FileMatchResponse=m1.FileMatchRequest=m1.MatchResponse=m1.MatchRequest=m1.MatchError=void 0;var _a=LAt();m1.MatchError=_a.Type.Object({kind:_a.Type.Literal("failure"),reason:_a.Type.String(),code:_a.Type.Number(),msg:_a.Type.String(),meta:_a.Type.Optional(_a.Type.Any())});var Alc=_a.Type.Object({matched_source:_a.Type.String(),occurrences:_a.Type.String(),capped:_a.Type.Boolean(),cursor:_a.Type.String(),github_url:_a.Type.String()});m1.MatchRequest=_a.Type.Object({source:_a.Type.String()});var ylc=_a.Type.Object({snippets:_a.Type.Array(Alc)});m1.MatchResponse=_a.Type.Union([ylc,m1.MatchError]);m1.FileMatchRequest=_a.Type.Object({cursor:_a.Type.String()});var Elc=_a.Type.Object({commit_id:_a.Type.String(),license:_a.Type.String(),nwo:_a.Type.String(),path:_a.Type.String(),url:_a.Type.String()}),_lc=_a.Type.Object({has_next_page:_a.Type.Boolean(),cursor:_a.Type.String()}),vlc=_a.Type.Object({count:_a.Type.Record(_a.Type.String(),_a.Type.String())}),Clc=_a.Type.Object({file_matches:_a.Type.Array(Elc),page_info:_lc,license_stats:vlc});m1.FileMatchResponse=_a.Type.Union([Clc,m1.MatchError])});var a4i=I(pL=>{"use strict";p();var blc=pL&&pL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Slc=pL&&pL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i4i=pL&&pL.__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(H6,"__esModule",{value:!0});H6.MinTokenLength=void 0;H6.lexemeLength=c4i;H6.offsetLastLexemes=wlc;H6.hasMinLexemeLength=Rlc;var wLe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");H6.MinTokenLength=65;function c4i(t){let e=0,r;wLe.lastIndex=0;do if(r=wLe.exec(t),r&&(e+=1),e>=H6.MinTokenLength)break;while(r);return e}a(c4i,"lexemeLength");function xlc(t,e){let r=0,n;wLe.lastIndex=0;do if(n=wLe.exec(t),n&&(r+=1,r>=e))return wLe.lastIndex;while(n);return t.length}a(xlc,"offsetFirstLexemes");function wlc(t,e){let r=t.split("").reverse().join(""),n=xlc(r,e);return r.length-n}a(wlc,"offsetLastLexemes");function Rlc(t){return c4i(t)>=H6.MinTokenLength}a(Rlc,"hasMinLexemeLength")});var m4i=I(G6=>{"use strict";p();var klc=G6&&G6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Plc=G6&&G6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),p4i=G6&&G6.__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;od4i(E,()=>u4i.Match(E,f)));if(!h||f4i(h)||!h.snippets.length){CPr.codeReferenceLogger.info(s,"No match found");return}CPr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>d4i(T,()=>u4i.FilesForMatch(T,{cursor:E.cursor})));if(!_||f4i(_))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(Ulc,"fetchCitations")});var v4i=I(B$=>{"use strict";p();Object.defineProperty(B$,"__esModule",{value:!0});B$.editDistance=A4i;B$.emptyLexDictionary=y4i;B$.reverseLexDictionary=E4i;B$.lexGeneratorWords=_4i;B$.lexicalAnalyzer=bPr;B$.lexEditDistance=Qlc;function A4i(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(_4i,"lexGeneratorWords");function bPr(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(bPr,"lexicalAnalyzer");function g4i(t){return t!==" "}a(g4i,"notSingleSpace");function Qlc(t,e,r=_4i){let[n,o]=bPr(t,y4i(),r,g4i),[s,c]=bPr(e,o,r,g4i);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=E4i(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=A4i(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(Qlc,"lexEditDistance")});var SPr=I(Ine=>{"use strict";p();Object.defineProperty(Ine,"__esModule",{value:!0});Ine.PartialAcceptTriggerKind=void 0;Ine.computeCompCharLen=qlc;Ine.countLines=jlc;Ine.computeCompletionText=Hlc;var C4i;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(C4i||(Ine.PartialAcceptTriggerKind=C4i={}));function qlc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(qlc,"computeCompCharLen");function jlc(t){return t.length===0?0:t.split(` +`).length}a(jlc,"countLines");function Hlc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(Hlc,"computeCompletionText")});var D4i=I(m_t=>{"use strict";p();Object.defineProperty(m_t,"__esModule",{value:!0});m_t.postRejectionTasks=tuc;m_t.postInsertionTasks=ruc;var h_t=Gs(),T4i=Ste(),Glc=qge(),p_t=U2i(),$lc=Egt(),Vlc=AIr(),I4i=QTr(),x4i=RAe(),nye=Nl(),b4i=_yt(),Wlc=HAe(),zlc=m4i(),S4i=v4i(),Ylc=SPr(),F$=Vg(),Klc=s1(),w4i=T5e(),Jlc=nne(),U$=new nye.Logger("postInsertion"),R4i=[{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}],k4i=50,Zlc=1500,Xlc=.5,euc=500,TPr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function P4i(t,e,r,n,o){let s=t.get(h_t.IInstantiationService),c=t.get(nye.ICompletionsLogTargetService),l=await t.get(I4i.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return U$.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(Wlc.extractPrompt,r.properties.headerRequestId,(0,Vlc.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,b4i.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,b4i.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:euc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(P4i,"captureCode");function tuc(t,e,r,n,o){let s=t.get(nye.ICompletionsLogTargetService),c=t.get(h_t.IInstantiationService),l=t.get(T4i.ICompletionsTelemetryService),u=t.get(w4i.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{U$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(x4i.telemetryRejected,e,g)});let d=c.createInstance(p_t.ChangeTracker,n,r-1),f=c.createInstance(p_t.ChangeTracker,n,r),h=a(async m=>{U$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(P4i,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});U$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(F$.telemetry,e+".capturedAfterRejected",v,F$.TelemetryStore.Enhanced)},"checkInCode");R4i.filter(m=>m.captureRejection).map(m=>d.push((0,F$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(tuc,"postRejectionTasks");function ruc(t,e,r,n,o,s,c,l){let u=t.get(nye.ICompletionsLogTargetService),d=t.get(h_t.IInstantiationService),f=t.get(w4i.ICompletionsPromiseQueueService),h=t.get(T4i.ICompletionsTelemetryService),m=t.get(Jlc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});U$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(x4i.telemetryAccepted,e,g);let A=r;r=(0,Ylc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(p_t.ChangeTracker,o,n),_=d.createInstance(p_t.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(suc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(TPr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:TPr.captureCode,captureRejection:TPr.captureRejection});f.register(b)}else R4i.map(b=>E.push((0,F$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,F$.telemetryCatch)(h,f,nuc,"post insertion citation check")(b,o,A,r,n,l))}a(ruc,"postInsertionTasks");async function nuc(t,e,r,n,o,s){let c=t.get(nye.ICompletionsLogTargetService),l=t.get(Klc.ICompletionsTextDocumentManagerService),u=t.get(Glc.ICompletionsCopilotTokenManager),d=t.get($lc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,zlc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=IPr(f.getText(),n,k4i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=iuc(r.length,n.length,h.start_offset);if(m===void 0){U$.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+ouc(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(nuc,"citationCheck");function iuc(t,e,r){if(!(ee))return r}a(iuc,"computeCitationStart");function ouc(t,e,r){return e{"use strict";p();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.LastGhostText=Cy.ICompletionsLastGhostText=void 0;Cy.rejectLastShown=O4i;Cy.setLastShown=uuc;Cy.handleGhostTextShown=duc;Cy.handleGhostTextPostInsert=puc;Cy.handlePartialGhostTextPostInsert=huc;var auc=nn(),N4i=Nl(),wPr=D4i(),g_t=SPr(),M4i=d$(),RPr=RAe(),cuc=new N4i.Logger("ghostText");Cy.ICompletionsLastGhostText=(0,auc.createServiceIdentifier)("ICompletionsLastGhostText");var xPr=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}};Cy.LastGhostText=xPr;function luc(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(luc,"computeRejectedCompletions");function O4i(t,e){let r=t.get(Cy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=luc(r);n.length>0&&(0,wPr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(O4i,"rejectLastShown");function uuc(t,e,r,n){let o=t.get(Cy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==M4i.ResultType.TypingAsSuggested&&O4i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(uuc,"setLastShown");function duc(t,e){let r=t.get(N4i.ICompletionsLogTargetService),n=t.get(Cy.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!==M4i.ResultType.Network;cuc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,RPr.telemetryShown)(t,e)}}a(duc,"handleGhostTextShown");function fuc(t,e,r){let n=t.get(Cy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,g_t.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,g_t.countLines)(e.displayText));let o=(0,g_t.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(fuc,"handleLineAcceptance");function puc(t,e){let r=t.get(Cy.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,g_t.countLines)(e.displayText)},r.resetState(),(0,wPr.postInsertionTasks)(t,RPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(puc,"handleGhostTextPostInsert");function huc(t,e,r){let n=t.get(Cy.ICompletionsLastGhostText);fuc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,wPr.postInsertionTasks)(t,RPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(huc,"handlePartialGhostTextPostInsert")});var L4i=I(PPr=>{"use strict";p();Object.defineProperty(PPr,"__esModule",{value:!0});PPr.normalizeIndentCharacter=muc;function muc(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(Xlc,"normalizeIndentCharacter")});var R4i=I(wPr=>{"use strict";p();Object.defineProperty(wPr,"__esModule",{value:!0});wPr.completionsFromGhostTextResults=nuc;var euc=T0(),p_t=mAe(),tuc=w4i(),ruc=a$();function nuc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=p_t.LocationFactory.range(p_t.LocationFactory.position(n.line,0),p_t.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,tuc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=p_t.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,euc.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===ruc.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(nuc,"completionsFromGhostTextResults")});var PPr=I(XD=>{"use strict";p();var iuc=XD&&XD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ouc=XD&&XD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),suc=XD&&XD.__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(auc,"createRequestHMAC");async function cuc(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(cuc,"createSha256Hash");var RPr=new Map;function luc(t){if(RPr.has(t))return RPr.get(t);let e=uuc(t);return RPr.set(t,e),e}a(luc,"getCachedSha256Hash");function uuc(t){let e=new kPr;return e.update(t),e.digest()}a(uuc,"createSha256HashSyncInsecure");function L$(t,e=32){return t instanceof ArrayBuffer?(0,k4i.encodeHex)(k4i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(L$,"toHexString");function pL(t,e){return(t>>>e|t<<32-e)>>>0}a(pL,"rightRotate");var kPr=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(h_t.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()),L$(this._h0)+L$(this._h1)+L$(this._h2)+L$(this._h3)+L$(this._h4)+L$(this._h5)+L$(this._h6)+L$(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=pL(A,7)^pL(A,18)^A>>>3,_=pL(y,17)^pL(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=pL(u,6)^pL(u,11)^pL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=pL(o,2)^pL(o,13)^pL(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 DPr=I(m_t=>{"use strict";p();Object.defineProperty(m_t,"__esModule",{value:!0});m_t.isInlineSuggestionFromTextAfterCursor=P4i;m_t.determineIsInlineSuggestionPosition=duc;function P4i(t){let e=fuc(t),r=puc(t);if(!(e&&!r))return e&&r}a(P4i,"isInlineSuggestionFromTextAfterCursor");function duc(t){let e=t.textAfterCursor();return P4i(e)}a(duc,"determineIsInlineSuggestionPosition");function fuc(t){return t.trim().length!==0}a(fuc,"isMiddleOfTheLineFromTextAfterCursor");function puc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(puc,"isValidMiddleOfTheLineFromTextAfterCursor")});var A_t=I(B$=>{"use strict";p();Object.defineProperty(B$,"__esModule",{value:!0});B$.NoOpStatusReporter=B$.StatusReporter=B$.ICompletionsStatusReporter=void 0;var huc=nn();B$.ICompletionsStatusReporter=(0,huc.createServiceIdentifier)("ICompletionsStatusReporter");var g_t=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)}};B$.StatusReporter=g_t;var NPr=class extends g_t{static{a(this,"NoOpStatusReporter")}didChange(){}};B$.NoOpStatusReporter=NPr});var FPr=I(Cy=>{"use strict";p();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.AdoRepoId=Cy.GithubRepoId=Cy.IGitService=void 0;Cy.getGitHubRepoInfoFromContext=Auc;Cy.getOrderedRepoInfosFromContext=yuc;Cy.getOrderedRemoteUrlsFromContext=OPr;Cy.parseRemoteUrl=LPr;Cy.toGithubNwo=D4i;Cy.toGithubWebUrl=Euc;Cy.getGithubRepoIdFromFetchUrl=BPr;Cy.getAdoRepoIdFromFetchUrl=N4i;Cy.normalizeFetchUrl=_uc;var muc=nn(),MPr=em(),guc=nd();Cy.IGitService=(0,muc.createServiceIdentifier)("IGitService");function Auc(t){for(let e of OPr(t))if(e){let r=BPr(e);if(r)return{id:r,remoteUrl:e}}}a(Auc,"getGitHubRepoInfoFromContext");function*yuc(t){for(let e of OPr(t)){let r=BPr(e)??N4i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(yuc,"getOrderedRepoInfosFromContext");function OPr(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(OPr,"getOrderedRemoteUrlsFromContext");function LPr(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=guc.URI.parse(t),r=e.authority,n=e.path;if(!((0,MPr.equalsIgnoreCase)(e.scheme,"ssh")||(0,MPr.equalsIgnoreCase)(e.scheme,"https")||(0,MPr.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(LPr,"parseRemoteUrl");var y_t=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 D4i(this)}};Cy.GithubRepoId=y_t;function D4i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(D4i,"toGithubNwo");function Euc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Euc,"toGithubWebUrl");function BPr(t){let e=LPr(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 y_t(s[1],s[2],o):void 0}a(BPr,"getGithubRepoIdFromFetchUrl");var rye=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()}};Cy.AdoRepoId=rye;function N4i(t){let e=LPr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new rye(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 rye(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 rye(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(N4i,"getAdoRepoIdFromFetchUrl");function _uc(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(_uc,"normalizeFetchUrl")});var qPr=I(Ine=>{"use strict";p();Object.defineProperty(Ine,"__esModule",{value:!0});Ine.ComputationStatus=void 0;Ine.tryGetGitHubNWO=buc;Ine.extractRepoInfoInBackground=Suc;Ine.extractRepoInfo=M4i;var UPr=FPr(),vuc=n$(),Cuc=C6(),SLe=o$();function buc(t){if(t!==void 0&&t!==TLe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(buc,"tryGetGitHubNWO");function Suc(t,e){let r=(0,SLe.dirname)(e);return Tuc(t,r)}a(Suc,"extractRepoInfoInBackground");var Tuc=Ruc(M4i,1e4);async function M4i(t,e){let r=t.get(vuc.ICompletionsFileSystemService),n=(0,SLe.getFsUri)(e);if(!n)return;let o=await xuc(r,n);if(!o)return;let s=(0,SLe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=wuc(c)??"",u=Iuc(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(M4i,"extractRepoInfo");function Iuc(t){let e=(0,UPr.parseRemoteUrl)(t);if(!e)return;let r=(0,UPr.getGithubRepoIdFromFetchUrl)(t)??(0,UPr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Iuc,"parseRepoUrl");async function xuc(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 TLe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new QPr(d)),n.delete(c)}),TLe.PENDING}}a(Ruc,"computeInBackgroundAndMemoize")});var L4i=I(jPr=>{"use strict";p();Object.defineProperty(jPr,"__esModule",{value:!0});jPr.isRepetitive=Puc;var kuc=[{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 Puc(t){let e=t.slice();return e.reverse(),O4i(e)||O4i(e.filter(r=>r.trim().length>0))}a(Puc,"isRepetitive");function O4i(t){let e=Duc(t);for(let r of kuc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Duc,"kmp_prefix_function")});var F4i=I(ILe=>{"use strict";p();Object.defineProperty(ILe,"__esModule",{value:!0});ILe.maybeSnipCompletionImpl=B4i;ILe.postProcessChoiceInContext=Fuc;ILe.checkSuffix=Uuc;var Nuc=Qre(),xne=$g(),Muc=L4i();function Ouc(t,e,r,n){let o="}";try{o=(0,Nuc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return B4i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Ouc,"maybeSnipCompletion");function B4i(t,e,r,n){let o=Luc(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(B4i,"maybeSnipCompletionImpl");function Luc(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(muc,"normalizeIndentCharacter")});var B4i=I(DPr=>{"use strict";p();Object.defineProperty(DPr,"__esModule",{value:!0});DPr.completionsFromGhostTextResults=Euc;var guc=I0(),A_t=AAe(),Auc=L4i(),yuc=d$();function Euc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=A_t.LocationFactory.range(A_t.LocationFactory.position(n.line,0),A_t.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,Auc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=A_t.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,guc.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===yuc.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(Euc,"completionsFromGhostTextResults")});var OPr=I(rN=>{"use strict";p();var _uc=rN&&rN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vuc=rN&&rN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Cuc=rN&&rN.__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(buc,"createRequestHMAC");async function Suc(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(Suc,"createSha256Hash");var NPr=new Map;function Tuc(t){if(NPr.has(t))return NPr.get(t);let e=Iuc(t);return NPr.set(t,e),e}a(Tuc,"getCachedSha256Hash");function Iuc(t){let e=new MPr;return e.update(t),e.digest()}a(Iuc,"createSha256HashSyncInsecure");function Q$(t,e=32){return t instanceof ArrayBuffer?(0,F4i.encodeHex)(F4i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Q$,"toHexString");function hL(t,e){return(t>>>e|t<<32-e)>>>0}a(hL,"rightRotate");var MPr=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(y_t.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()),Q$(this._h0)+Q$(this._h1)+Q$(this._h2)+Q$(this._h3)+Q$(this._h4)+Q$(this._h5)+Q$(this._h6)+Q$(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=hL(A,7)^hL(A,18)^A>>>3,_=hL(y,17)^hL(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=hL(u,6)^hL(u,11)^hL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=hL(o,2)^hL(o,13)^hL(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 LPr=I(E_t=>{"use strict";p();Object.defineProperty(E_t,"__esModule",{value:!0});E_t.isInlineSuggestionFromTextAfterCursor=U4i;E_t.determineIsInlineSuggestionPosition=xuc;function U4i(t){let e=wuc(t),r=Ruc(t);if(!(e&&!r))return e&&r}a(U4i,"isInlineSuggestionFromTextAfterCursor");function xuc(t){let e=t.textAfterCursor();return U4i(e)}a(xuc,"determineIsInlineSuggestionPosition");function wuc(t){return t.trim().length!==0}a(wuc,"isMiddleOfTheLineFromTextAfterCursor");function Ruc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Ruc,"isValidMiddleOfTheLineFromTextAfterCursor")});var v_t=I(q$=>{"use strict";p();Object.defineProperty(q$,"__esModule",{value:!0});q$.NoOpStatusReporter=q$.StatusReporter=q$.ICompletionsStatusReporter=void 0;var kuc=nn();q$.ICompletionsStatusReporter=(0,kuc.createServiceIdentifier)("ICompletionsStatusReporter");var __t=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)}};q$.StatusReporter=__t;var BPr=class extends __t{static{a(this,"NoOpStatusReporter")}didChange(){}};q$.NoOpStatusReporter=BPr});var jPr=I(by=>{"use strict";p();Object.defineProperty(by,"__esModule",{value:!0});by.AdoRepoId=by.GithubRepoId=by.IGitService=void 0;by.getGitHubRepoInfoFromContext=Nuc;by.getOrderedRepoInfosFromContext=Muc;by.getOrderedRemoteUrlsFromContext=UPr;by.parseRemoteUrl=QPr;by.toGithubNwo=Q4i;by.toGithubWebUrl=Ouc;by.getGithubRepoIdFromFetchUrl=qPr;by.getAdoRepoIdFromFetchUrl=q4i;by.normalizeFetchUrl=Luc;var Puc=nn(),FPr=rm(),Duc=id();by.IGitService=(0,Puc.createServiceIdentifier)("IGitService");function Nuc(t){for(let e of UPr(t))if(e){let r=qPr(e);if(r)return{id:r,remoteUrl:e}}}a(Nuc,"getGitHubRepoInfoFromContext");function*Muc(t){for(let e of UPr(t)){let r=qPr(e)??q4i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(Muc,"getOrderedRepoInfosFromContext");function UPr(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(UPr,"getOrderedRemoteUrlsFromContext");function QPr(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=Duc.URI.parse(t),r=e.authority,n=e.path;if(!((0,FPr.equalsIgnoreCase)(e.scheme,"ssh")||(0,FPr.equalsIgnoreCase)(e.scheme,"https")||(0,FPr.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(QPr,"parseRemoteUrl");var C_t=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 Q4i(this)}};by.GithubRepoId=C_t;function Q4i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(Q4i,"toGithubNwo");function Ouc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Ouc,"toGithubWebUrl");function qPr(t){let e=QPr(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 C_t(s[1],s[2],o):void 0}a(qPr,"getGithubRepoIdFromFetchUrl");var iye=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()}};by.AdoRepoId=iye;function q4i(t){let e=QPr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new iye(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 iye(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 iye(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(q4i,"getAdoRepoIdFromFetchUrl");function Luc(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(Luc,"normalizeFetchUrl")});var $Pr=I(xne=>{"use strict";p();Object.defineProperty(xne,"__esModule",{value:!0});xne.ComputationStatus=void 0;xne.tryGetGitHubNWO=Uuc;xne.extractRepoInfoInBackground=Quc;xne.extractRepoInfo=j4i;var HPr=jPr(),Buc=a$(),Fuc=S6(),RLe=l$();function Uuc(t){if(t!==void 0&&t!==kLe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(Uuc,"tryGetGitHubNWO");function Quc(t,e){let r=(0,RLe.dirname)(e);return quc(t,r)}a(Quc,"extractRepoInfoInBackground");var quc=$uc(j4i,1e4);async function j4i(t,e){let r=t.get(Buc.ICompletionsFileSystemService),n=(0,RLe.getFsUri)(e);if(!n)return;let o=await Huc(r,n);if(!o)return;let s=(0,RLe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=Guc(c)??"",u=juc(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(j4i,"extractRepoInfo");function juc(t){let e=(0,HPr.parseRemoteUrl)(t);if(!e)return;let r=(0,HPr.getGithubRepoIdFromFetchUrl)(t)??(0,HPr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(juc,"parseRepoUrl");async function Huc(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 kLe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new GPr(d)),n.delete(c)}),kLe.PENDING}}a($uc,"computeInBackgroundAndMemoize")});var G4i=I(VPr=>{"use strict";p();Object.defineProperty(VPr,"__esModule",{value:!0});VPr.isRepetitive=Wuc;var Vuc=[{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 Wuc(t){let e=t.slice();return e.reverse(),H4i(e)||H4i(e.filter(r=>r.trim().length>0))}a(Wuc,"isRepetitive");function H4i(t){let e=zuc(t);for(let r of Vuc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(zuc,"kmp_prefix_function")});var V4i=I(PLe=>{"use strict";p();Object.defineProperty(PLe,"__esModule",{value:!0});PLe.maybeSnipCompletionImpl=$4i;PLe.postProcessChoiceInContext=edc;PLe.checkSuffix=tdc;var Yuc=qre(),wne=Vg(),Kuc=G4i();function Juc(t,e,r,n){let o="}";try{o=(0,Yuc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return $4i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Juc,"maybeSnipCompletion");function $4i(t,e,r,n){let o=Zuc(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($4i,"maybeSnipCompletionImpl");function Zuc(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(Luc,"splitByNewLine");function Buc(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(Uuc,"checkSuffix")});var j4i=I(F$=>{"use strict";p();Object.defineProperty(F$,"__esModule",{value:!0});F$.DocumentLogEntry=void 0;F$.serializeOffsetRange=Quc;F$.deserializeOffsetRange=quc;F$.serializeEdit=juc;F$.deserializeEdit=Huc;var U4i=kE(),q4i=hd(),Q4i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(Q4i||(F$.DocumentLogEntry=Q4i={}));function Quc(t){return[t.start,t.endExclusive]}a(Quc,"serializeOffsetRange");function quc(t){return new q4i.OffsetRange(t[0],t[1])}a(quc,"deserializeOffsetRange");function juc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(juc,"serializeEdit");function Huc(t){return U4i.StringEdit.create(t.map(e=>U4i.StringReplacement.replace(new q4i.OffsetRange(e[0],e[1]),e[2])))}a(Huc,"deserializeEdit")});var nye=I(km=>{"use strict";p();Object.defineProperty(km,"__esModule",{value:!0});km.StatelessNextEditTelemetryBuilder=km.StatelessNextEditResult=km.NoNextEditReason=km.FilteredOutReason=km.StatelessNextEditDocument=km.StatelessNextEditRequest=km.RequestEditWindowWithCursorJump=km.RequestEditWindow=km.WithStatelessProviderTelemetry=void 0;var H4i=uw(),HPr=rd(),Guc=nl(),$uc=YP(),Vuc=kE(),Wuc=qT(),zuc=j4i(),Yuc=b0r(),GPr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};km.WithStatelessProviderTelemetry=GPr;var $Pr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};km.RequestEditWindow=$Pr;var VPr=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)}};km.RequestEditWindowWithCursorJump=VPr;var WPr=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 $uc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Vuc.StringEdit.empty,this._result=new Guc.DeferredPromise,(0,HPr.assert)(o.length>0),(0,HPr.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(Zuc,"splitByNewLine");function Xuc(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(tdc,"checkSuffix")});var K4i=I(j$=>{"use strict";p();Object.defineProperty(j$,"__esModule",{value:!0});j$.DocumentLogEntry=void 0;j$.serializeOffsetRange=rdc;j$.deserializeOffsetRange=ndc;j$.serializeEdit=idc;j$.deserializeEdit=odc;var W4i=PE(),Y4i=gd(),z4i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(z4i||(j$.DocumentLogEntry=z4i={}));function rdc(t){return[t.start,t.endExclusive]}a(rdc,"serializeOffsetRange");function ndc(t){return new Y4i.OffsetRange(t[0],t[1])}a(ndc,"deserializeOffsetRange");function idc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(idc,"serializeEdit");function odc(t){return W4i.StringEdit.create(t.map(e=>W4i.StringReplacement.replace(new Y4i.OffsetRange(e[0],e[1]),e[2])))}a(odc,"deserializeEdit")});var oye=I(Dm=>{"use strict";p();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.StatelessNextEditTelemetryBuilder=Dm.StatelessNextEditResult=Dm.NoNextEditReason=Dm.FilteredOutReason=Dm.StatelessNextEditDocument=Dm.StatelessNextEditRequest=Dm.RequestEditWindowWithCursorJump=Dm.RequestEditWindow=Dm.WithStatelessProviderTelemetry=void 0;var J4i=fw(),WPr=nd(),sdc=nl(),adc=JP(),cdc=PE(),ldc=HT(),udc=K4i(),ddc=x0r(),zPr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};Dm.WithStatelessProviderTelemetry=zPr;var YPr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};Dm.RequestEditWindow=YPr;var KPr=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)}};Dm.RequestEditWindowWithCursorJump=KPr;var JPr=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 adc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=cdc.StringEdit.empty,this._result=new sdc.DeferredPromise,(0,WPr.assert)(o.length>0),(0,WPr.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(` -`)}`}};km.StatelessNextEditRequest=WPr;var zPr=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 Wuc.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,zuc.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};Dm.StatelessNextEditRequest=JPr;var ZPr=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 ldc.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,udc.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(` -`)}};km.StatelessNextEditDocument=zPr;var G4i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(G4i||(km.FilteredOutReason=G4i={}));var hL;(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})(hL||(km.NoNextEditReason=hL={}));var YPr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=H4i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=H4i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};km.StatelessNextEditResult=YPr;var KPr=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,Yuc.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 hL.ActiveDocumentHasNoEdits||e.err instanceof hL.NoSuggestions||(e.err instanceof hL.GotCancelled||e.err instanceof hL.FilteredOut||e.err instanceof hL.PromptTooLarge?d=e.err.message:e.err instanceof hL.FetchFailure||e.err instanceof hL.Uncategorized||e.err instanceof hL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,HPr.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}};km.StatelessNextEditTelemetryBuilder=KPr});var $4i=I(E_t=>{"use strict";p();Object.defineProperty(E_t,"__esModule",{value:!0});E_t.StreamCopilotAnnotations=void 0;var JPr=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]??[]}};E_t.StreamCopilotAnnotations=JPr});var __t=I(U$=>{"use strict";p();Object.defineProperty(U$,"__esModule",{value:!0});U$.ICompletionsFetchService=U$.CompletionsFetchError=U$.Completions=void 0;var Kuc=nn(),V4i;(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})(V4i||(U$.Completions=V4i={}));var ZPr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};U$.CompletionsFetchError=ZPr;U$.ICompletionsFetchService=(0,Kuc.createServiceIdentifier)("ICompletionsFetchService")});var xLe=I(iye=>{"use strict";p();Object.defineProperty(iye,"__esModule",{value:!0});iye.CacheType=iye.CustomDataPartMimeTypes=void 0;var W4i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(W4i||(iye.CustomDataPartMimeTypes=W4i={}));iye.CacheType="ephemeral"});var e2r=I(wLe=>{"use strict";p();Object.defineProperty(wLe,"__esModule",{value:!0});wLe.ThinkingDataContainer=void 0;wLe.rawPartAsThinkingData=Zuc;var Juc=Io(),z4i=xLe(),XPr=class extends Juc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:z4i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};wLe.ThinkingDataContainer=XPr;function Zuc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===z4i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(Zuc,"rawPartAsThinkingData")});var H6=I(WE=>{"use strict";p();Object.defineProperty(WE,"__esModule",{value:!0});WE.FilterReason=WE.FinishedCompletionReason=WE.ChatRole=WE.modelsWithoutResponsesContextManagement=WE.openAIContextManagementCompactionType=void 0;WE.isApiUsage=tdc;WE.nanoAiuToCredits=rdc;WE.getCAPITextPart=Z4i;WE.rawMessageToCAPI=X4i;var v_t=Io(),Xuc=lxe(),edc=e2r();function tdc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(tdc,"isApiUsage");function rdc(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(rdc,"nanoAiuToCredits");WE.openAIContextManagementCompactionType="compaction";WE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var Y4i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(Y4i||(WE.ChatRole=Y4i={}));function Z4i(t){return Array.isArray(t)?t.map(e=>Z4i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(Z4i,"getCAPITextPart");function X4i(t,e){if(Array.isArray(t))return t.map(n=>X4i(n,e));let r=(0,v_t.toMode)(v_t.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===Xuc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===v_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,edc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(X4i,"rawMessageToCAPI");var K4i;(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"})(K4i||(WE.FinishedCompletionReason=K4i={}));var J4i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(J4i||(WE.FilterReason=J4i={}))});var $6=I(G6=>{"use strict";p();Object.defineProperty(G6,"__esModule",{value:!0});G6.getRequestId=idc;G6.isCopilotAnnotation=odc;G6.isCodeCitationAnnotation=sdc;G6.isCopilotWebReference=adc;G6.isOpenAIContextManagementResponse=cdc;G6.isAnthropicContextManagementResponse=ldc;G6.isOpenAiFunctionTool=udc;var ndc=H6();function idc(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(idc,"getRequestId");function odc(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(odc,"isCopilotAnnotation");function sdc(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(sdc,"isCodeCitationAnnotation");function adc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(adc,"isCopilotWebReference");function cdc(t){return"type"in t&&t.type===ndc.openAIContextManagementCompactionType}a(cdc,"isOpenAIContextManagementResponse");function ldc(t){return"applied_edits"in t}a(ldc,"isAnthropicContextManagementResponse");function udc(t){return t.function!==void 0}a(udc,"isOpenAiFunctionTool")});var eLi=I(eN=>{"use strict";p();Object.defineProperty(eN,"__esModule",{value:!0});eN.asyncIterableMap=ddc;eN.asyncIterableFilter=fdc;eN.asyncIterableMapFilter=pdc;eN.asyncIterableFromArray=hdc;eN.asyncIterableToArray=mdc;eN.asyncIterableConcat=gdc;eN.asyncIterableCount=Adc;eN.iterableMap=ydc;eN.iterableMapFilter=Edc;async function*ddc(t,e){for await(let r of t)yield e(r)}a(ddc,"asyncIterableMap");async function*fdc(t,e){for await(let r of t)await e(r)&&(yield r)}a(fdc,"asyncIterableFilter");async function*pdc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(pdc,"asyncIterableMapFilter");async function*hdc(t){for(let e of t)yield Promise.resolve(e)}a(hdc,"asyncIterableFromArray");async function mdc(t){let e=[];for await(let r of t)e.push(r);return e}a(mdc,"asyncIterableToArray");async function*gdc(...t){for(let e of t)yield*e}a(gdc,"asyncIterableConcat");async function Adc(t){let e=0;for await(let r of t)e++;return e}a(Adc,"asyncIterableCount");function*ydc(t,e){for(let r of t)yield e(r)}a(ydc,"iterableMap");function*Edc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Edc,"iterableMapFilter")});var tLi=I(t2r=>{"use strict";p();Object.defineProperty(t2r,"__esModule",{value:!0});t2r.getKey=vdc;function _dc(t,e){return t!==null&&typeof t=="object"&&e in t}a(_dc,"hasKey");function vdc(t,e){return _dc(t,e)?t[e]:void 0}a(vdc,"getKey")});var o2r=I(Pm=>{"use strict";p();var Cdc=Pm&&Pm.__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},Q$=Pm&&Pm.__param||function(t,e){return function(r,n){e(r,n,t)}},r2r;Object.defineProperty(Pm,"__esModule",{value:!0});Pm.LiveOpenAIFetcher=Pm.CMDQuotaExceeded=Pm.OpenAIFetcher=Pm.ICompletionsOpenAIFetcherService=Pm.CopilotUiKind=void 0;Pm.sanitizeRequestOptionTelemetry=aLi;Pm.postProcessChoices=cLi;var bdc=FE(),Sdc=$4i(),Tdc=U4(),kLe=__t(),Idc=$6(),rLi=gm(),xdc=nn(),wdc=rd(),Rdc=YP(),kdc=FO(),Pdc=T0(),Ddc=Gs(),Ndc=Uge(),Mdc=fgt(),nLi=LE(),Odc=eLi(),sLi=Dl(),Ldc=r_t(),iLi=KAe(),Bdc=A_t(),Fdc=qPr(),aI=$g(),Udc=y4e(),Qdc=rne(),RLe=tLi(),C_t=M4e(),tA=new sLi.Logger("fetchCompletions"),b_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(b_t||(Pm.CopilotUiKind=b_t={}));function qdc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(qdc,"getProcessingTime");function jdc(t){switch(t){case b_t.GhostText:return"copilot-ghost";case b_t.Panel:return"copilot-panel"}}a(jdc,"uiKindToIntent");Pm.ICompletionsOpenAIFetcherService=(0,xdc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var S_t=class{static{a(this,"OpenAIFetcher")}};Pm.OpenAIFetcher=S_t;function Hdc(t,e,r,n){return(0,Ldc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Hdc,"getProxyEngineUrl");function aLi(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(aLi,"sanitizeRequestOptionTelemetry");function cLi(t){return(0,Odc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(cLi,"postProcessChoices");Pm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var n2r=r2r=class extends S_t{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,C_t.getMaxSolutionTokens)(),temperature:(0,C_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,C_t.getTopP)(),n:e.count,stop:(0,C_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,Fdc.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,Udc.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(Hdc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,aI.telemetrizePromptLength)(u));aLi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(aI.telemetry,"request.sent",y);let E=jdc(m),_;_={...g,...this.instantiationService.invokeFunction(nLi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=nLi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new kdc.StopWatch,b=o??Rdc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof kLe.Completions.Unexpected&&(0,iLi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(aI.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 kLe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(aI.telemetry,"networking.cancelRequest",aI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(aI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof kLe.Completions.UnsuccessfulResponse){let P=(0,Idc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(rLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(aI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof kLe.Completions.Unexpected){let P=x.error;if((0,iLi.isAbortError)(P))throw this.instantiationService.invokeFunction(aI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,RLe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(aI.telemetry,"request.shownWarning",D),y.properties.message=String((0,RLe.getKey)(P,"name")??""),y.properties.code=String((0,RLe.getKey)(P,"code")??""),y.properties.errno=String((0,RLe.getKey)(P,"errno")??""),y.properties.type=String((0,RLe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,tA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),tA.debug(this.logTargetService,"request.error properties",y.properties),tA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(aI.telemetry,"request.error",y),P}else(0,wdc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(rLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(aI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>tA.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=r2r.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:cLi(R),getProcessingTime:a(()=>qdc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(aI.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,Pdc.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:Pm.CMDQuotaExceeded,title:"Learn More"});let l=(0,Mdc.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),tA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(oLi(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`;tA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else oLi(n)?(tA.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(aI.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",tA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(tA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(tA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Pm.LiveOpenAIFetcher=n2r;Pm.LiveOpenAIFetcher=n2r=r2r=Cdc([Q$(0,Ddc.IInstantiationService),Q$(1,Qdc.ICompletionsRuntimeModeService),Q$(2,sLi.ICompletionsLogTargetService),Q$(3,Ndc.ICompletionsCopilotTokenManager),Q$(4,Bdc.ICompletionsStatusReporter),Q$(5,bdc.IAuthenticationService),Q$(6,kLe.ICompletionsFetchService),Q$(7,Tdc.IEnvService)],n2r);function oLi(t){return t.status>=400&&t.status<500}a(oLi,"isClientError");var i2r=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Sdc.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 a2r=I(s2r=>{"use strict";p();Object.defineProperty(s2r,"__esModule",{value:!0});s2r.appendToCache=Gdc;function Gdc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Gdc,"appendToCache")});var pLi=I(Kd=>{"use strict";p();var $dc=Kd&&Kd.__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},wne=Kd&&Kd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Kd,"__esModule",{value:!0});Kd.CompletionsFromNetwork=Kd.logger=void 0;Kd.postProcessChoices=T_t;Kd.makeGhostAPIChoice=fLi;Kd.telemetryPerformance=d2r;var PLe=nye(),Vdc=X_(),DLe=uw(),Wdc=rd(),zdc=qT(),Ydc=Gs(),lLi=LE(),Kdc=$Sr(),Jdc=fy(),dLi=Dl(),Zdc=sPr(),l2r=o2r(),Xdc=M4e(),efc=$g(),tfc=rne(),rfc=SAe(),c2r=a2r(),nfc=_4e(),uLi=a$(),tN=xAe();Kd.logger=new dLi.Logger("ghostText");var u2r=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 Kd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,tN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Kd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,tN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Kd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,tN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(d2r,"performance",h,c,l),Kd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=T_t(h);m&&((0,c2r.appendToCache)(this.completionsCacheService,e,m),Kd.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;Kd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=T_t(y,A);E&&(A.push(E),(0,c2r.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[fLi(m,{forceSingleLine:!1}),g],telemetryData:(0,tN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:uLi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,tN.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 Kd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,tN.mkCanceledResultTelemetry)(r)};let h=T_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,c2r.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(d2r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,tN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:uLi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new PLe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=DLe.Result.ok(void 0);break;case"canceled":f=DLe.Result.error(new PLe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=DLe.Result.error(new PLe.NoNextEditReason.NoSuggestions(new zdc.StringText(""),void 0));break;case"failed":f=DLe.Result.error(new PLe.NoNextEditReason.Uncategorized(Vdc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=DLe.Result.error(new PLe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Wdc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Kd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Xdc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,lLi.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===lLi.BlockMode.MoreMultiline&&rfc.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:l2r.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:l2r.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,tN.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Kd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,tN.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,Zdc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,tN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Kd.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,tN.mkBasicResultTelemetry)(r)}}}};Kd.CompletionsFromNetwork=u2r;Kd.CompletionsFromNetwork=u2r=$dc([wne(0,Ydc.IInstantiationService),wne(1,l2r.ICompletionsOpenAIFetcherService),wne(2,Jdc.ICompletionsFeaturesService),wne(3,tfc.ICompletionsRuntimeModeService),wne(4,dLi.ICompletionsLogTargetService),wne(5,nfc.ICompletionsCacheService),wne(6,Kdc.ICompletionsUserErrorNotifierService)],u2r);function T_t(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(T_t,"postProcessChoices");function fLi(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};Dm.StatelessNextEditDocument=ZPr;var Z4i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(Z4i||(Dm.FilteredOutReason=Z4i={}));var mL;(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})(mL||(Dm.NoNextEditReason=mL={}));var XPr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=J4i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=J4i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};Dm.StatelessNextEditResult=XPr;var e2r=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,ddc.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 mL.ActiveDocumentHasNoEdits||e.err instanceof mL.NoSuggestions||(e.err instanceof mL.GotCancelled||e.err instanceof mL.FilteredOut||e.err instanceof mL.PromptTooLarge?d=e.err.message:e.err instanceof mL.FetchFailure||e.err instanceof mL.Uncategorized||e.err instanceof mL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,WPr.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}};Dm.StatelessNextEditTelemetryBuilder=e2r});var X4i=I(b_t=>{"use strict";p();Object.defineProperty(b_t,"__esModule",{value:!0});b_t.StreamCopilotAnnotations=void 0;var t2r=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]??[]}};b_t.StreamCopilotAnnotations=t2r});var S_t=I(H$=>{"use strict";p();Object.defineProperty(H$,"__esModule",{value:!0});H$.ICompletionsFetchService=H$.CompletionsFetchError=H$.Completions=void 0;var fdc=nn(),eLi;(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})(eLi||(H$.Completions=eLi={}));var r2r=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};H$.CompletionsFetchError=r2r;H$.ICompletionsFetchService=(0,fdc.createServiceIdentifier)("ICompletionsFetchService")});var DLe=I(sye=>{"use strict";p();Object.defineProperty(sye,"__esModule",{value:!0});sye.CacheType=sye.CustomDataPartMimeTypes=void 0;var tLi;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(tLi||(sye.CustomDataPartMimeTypes=tLi={}));sye.CacheType="ephemeral"});var i2r=I(NLe=>{"use strict";p();Object.defineProperty(NLe,"__esModule",{value:!0});NLe.ThinkingDataContainer=void 0;NLe.rawPartAsThinkingData=hdc;var pdc=xo(),rLi=DLe(),n2r=class extends pdc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:rLi.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};NLe.ThinkingDataContainer=n2r;function hdc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===rLi.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(hdc,"rawPartAsThinkingData")});var $6=I(zE=>{"use strict";p();Object.defineProperty(zE,"__esModule",{value:!0});zE.FilterReason=zE.FinishedCompletionReason=zE.ChatRole=zE.modelsWithoutResponsesContextManagement=zE.openAIContextManagementCompactionType=void 0;zE.isApiUsage=Adc;zE.nanoAiuToCredits=ydc;zE.getCAPITextPart=sLi;zE.rawMessageToCAPI=aLi;var T_t=xo(),mdc=fxe(),gdc=i2r();function Adc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(Adc,"isApiUsage");function ydc(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(ydc,"nanoAiuToCredits");zE.openAIContextManagementCompactionType="compaction";zE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var nLi;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(nLi||(zE.ChatRole=nLi={}));function sLi(t){return Array.isArray(t)?t.map(e=>sLi(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(sLi,"getCAPITextPart");function aLi(t,e){if(Array.isArray(t))return t.map(n=>aLi(n,e));let r=(0,T_t.toMode)(T_t.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===mdc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===T_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,gdc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(aLi,"rawMessageToCAPI");var iLi;(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"})(iLi||(zE.FinishedCompletionReason=iLi={}));var oLi;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(oLi||(zE.FilterReason=oLi={}))});var W6=I(V6=>{"use strict";p();Object.defineProperty(V6,"__esModule",{value:!0});V6.getRequestId=_dc;V6.isCopilotAnnotation=vdc;V6.isCodeCitationAnnotation=Cdc;V6.isCopilotWebReference=bdc;V6.isOpenAIContextManagementResponse=Sdc;V6.isAnthropicContextManagementResponse=Tdc;V6.isOpenAiFunctionTool=Idc;var Edc=$6();function _dc(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(_dc,"getRequestId");function vdc(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(vdc,"isCopilotAnnotation");function Cdc(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(Cdc,"isCodeCitationAnnotation");function bdc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(bdc,"isCopilotWebReference");function Sdc(t){return"type"in t&&t.type===Edc.openAIContextManagementCompactionType}a(Sdc,"isOpenAIContextManagementResponse");function Tdc(t){return"applied_edits"in t}a(Tdc,"isAnthropicContextManagementResponse");function Idc(t){return t.function!==void 0}a(Idc,"isOpenAiFunctionTool")});var cLi=I(nN=>{"use strict";p();Object.defineProperty(nN,"__esModule",{value:!0});nN.asyncIterableMap=xdc;nN.asyncIterableFilter=wdc;nN.asyncIterableMapFilter=Rdc;nN.asyncIterableFromArray=kdc;nN.asyncIterableToArray=Pdc;nN.asyncIterableConcat=Ddc;nN.asyncIterableCount=Ndc;nN.iterableMap=Mdc;nN.iterableMapFilter=Odc;async function*xdc(t,e){for await(let r of t)yield e(r)}a(xdc,"asyncIterableMap");async function*wdc(t,e){for await(let r of t)await e(r)&&(yield r)}a(wdc,"asyncIterableFilter");async function*Rdc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Rdc,"asyncIterableMapFilter");async function*kdc(t){for(let e of t)yield Promise.resolve(e)}a(kdc,"asyncIterableFromArray");async function Pdc(t){let e=[];for await(let r of t)e.push(r);return e}a(Pdc,"asyncIterableToArray");async function*Ddc(...t){for(let e of t)yield*e}a(Ddc,"asyncIterableConcat");async function Ndc(t){let e=0;for await(let r of t)e++;return e}a(Ndc,"asyncIterableCount");function*Mdc(t,e){for(let r of t)yield e(r)}a(Mdc,"iterableMap");function*Odc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Odc,"iterableMapFilter")});var lLi=I(o2r=>{"use strict";p();Object.defineProperty(o2r,"__esModule",{value:!0});o2r.getKey=Bdc;function Ldc(t,e){return t!==null&&typeof t=="object"&&e in t}a(Ldc,"hasKey");function Bdc(t,e){return Ldc(t,e)?t[e]:void 0}a(Bdc,"getKey")});var l2r=I(Nm=>{"use strict";p();var Fdc=Nm&&Nm.__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},G$=Nm&&Nm.__param||function(t,e){return function(r,n){e(r,n,t)}},s2r;Object.defineProperty(Nm,"__esModule",{value:!0});Nm.LiveOpenAIFetcher=Nm.CMDQuotaExceeded=Nm.OpenAIFetcher=Nm.ICompletionsOpenAIFetcherService=Nm.CopilotUiKind=void 0;Nm.sanitizeRequestOptionTelemetry=mLi;Nm.postProcessChoices=gLi;var Udc=UE(),Qdc=X4i(),qdc=Q4(),OLe=S_t(),jdc=W6(),uLi=ym(),Hdc=nn(),Gdc=nd(),$dc=JP(),Vdc=QO(),Wdc=I0(),zdc=Gs(),Ydc=qge(),Kdc=ggt(),dLi=BE(),Jdc=cLi(),hLi=Nl(),Zdc=s_t(),fLi=ZAe(),Xdc=v_t(),efc=$Pr(),lI=Vg(),tfc=b4e(),rfc=nne(),MLe=lLi(),I_t=U4e(),rA=new hLi.Logger("fetchCompletions"),x_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(x_t||(Nm.CopilotUiKind=x_t={}));function nfc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(nfc,"getProcessingTime");function ifc(t){switch(t){case x_t.GhostText:return"copilot-ghost";case x_t.Panel:return"copilot-panel"}}a(ifc,"uiKindToIntent");Nm.ICompletionsOpenAIFetcherService=(0,Hdc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var w_t=class{static{a(this,"OpenAIFetcher")}};Nm.OpenAIFetcher=w_t;function ofc(t,e,r,n){return(0,Zdc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(ofc,"getProxyEngineUrl");function mLi(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(mLi,"sanitizeRequestOptionTelemetry");function gLi(t){return(0,Jdc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(gLi,"postProcessChoices");Nm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var a2r=s2r=class extends w_t{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,I_t.getMaxSolutionTokens)(),temperature:(0,I_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,I_t.getTopP)(),n:e.count,stop:(0,I_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,efc.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,tfc.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(ofc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,lI.telemetrizePromptLength)(u));mLi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(lI.telemetry,"request.sent",y);let E=ifc(m),_;_={...g,...this.instantiationService.invokeFunction(dLi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=dLi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new Vdc.StopWatch,b=o??$dc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof OLe.Completions.Unexpected&&(0,fLi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(lI.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 OLe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(lI.telemetry,"networking.cancelRequest",lI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(lI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof OLe.Completions.UnsuccessfulResponse){let P=(0,jdc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(uLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),rA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),rA.debug(this.logTargetService,"request.response properties",y.properties),rA.debug(this.logTargetService,"request.response measurements",y.measurements),rA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(lI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof OLe.Completions.Unexpected){let P=x.error;if((0,fLi.isAbortError)(P))throw this.instantiationService.invokeFunction(lI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,MLe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(lI.telemetry,"request.shownWarning",D),y.properties.message=String((0,MLe.getKey)(P,"name")??""),y.properties.code=String((0,MLe.getKey)(P,"code")??""),y.properties.errno=String((0,MLe.getKey)(P,"errno")??""),y.properties.type=String((0,MLe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,rA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),rA.debug(this.logTargetService,"request.error properties",y.properties),rA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(lI.telemetry,"request.error",y),P}else(0,Gdc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(uLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;rA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),rA.debug(this.logTargetService,"request.response properties",y.properties),rA.debug(this.logTargetService,"request.response measurements",y.measurements),rA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(lI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>rA.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=s2r.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:gLi(R),getProcessingTime:a(()=>nfc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(lI.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,Wdc.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:Nm.CMDQuotaExceeded,title:"Learn More"});let l=(0,Kdc.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),rA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(pLi(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`;rA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else pLi(n)?(rA.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(lI.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",rA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(rA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(rA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Nm.LiveOpenAIFetcher=a2r;Nm.LiveOpenAIFetcher=a2r=s2r=Fdc([G$(0,zdc.IInstantiationService),G$(1,rfc.ICompletionsRuntimeModeService),G$(2,hLi.ICompletionsLogTargetService),G$(3,Ydc.ICompletionsCopilotTokenManager),G$(4,Xdc.ICompletionsStatusReporter),G$(5,Udc.IAuthenticationService),G$(6,OLe.ICompletionsFetchService),G$(7,qdc.IEnvService)],a2r);function pLi(t){return t.status>=400&&t.status<500}a(pLi,"isClientError");var c2r=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Qdc.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 d2r=I(u2r=>{"use strict";p();Object.defineProperty(u2r,"__esModule",{value:!0});u2r.appendToCache=sfc;function sfc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(sfc,"appendToCache")});var vLi=I(Zd=>{"use strict";p();var afc=Zd&&Zd.__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},Rne=Zd&&Zd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Zd,"__esModule",{value:!0});Zd.CompletionsFromNetwork=Zd.logger=void 0;Zd.postProcessChoices=R_t;Zd.makeGhostAPIChoice=_Li;Zd.telemetryPerformance=m2r;var LLe=oye(),cfc=tv(),BLe=fw(),lfc=nd(),ufc=HT(),dfc=Gs(),ALi=BE(),ffc=YSr(),pfc=py(),ELi=Nl(),hfc=uPr(),p2r=l2r(),mfc=U4e(),gfc=Vg(),Afc=nne(),yfc=IAe(),f2r=d2r(),Efc=T4e(),yLi=d$(),iN=RAe();Zd.logger=new ELi.Logger("ghostText");var h2r=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 Zd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,iN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Zd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,iN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Zd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,iN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(m2r,"performance",h,c,l),Zd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=R_t(h);m&&((0,f2r.appendToCache)(this.completionsCacheService,e,m),Zd.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;Zd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=R_t(y,A);E&&(A.push(E),(0,f2r.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[_Li(m,{forceSingleLine:!1}),g],telemetryData:(0,iN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:yLi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,iN.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 Zd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,iN.mkCanceledResultTelemetry)(r)};let h=R_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,f2r.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(m2r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,iN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:yLi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new LLe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=BLe.Result.ok(void 0);break;case"canceled":f=BLe.Result.error(new LLe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=BLe.Result.error(new LLe.NoNextEditReason.NoSuggestions(new ufc.StringText(""),void 0));break;case"failed":f=BLe.Result.error(new LLe.NoNextEditReason.Uncategorized(cfc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=BLe.Result.error(new LLe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,lfc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Zd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,mfc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,ALi.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===ALi.BlockMode.MoreMultiline&&yfc.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:p2r.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:p2r.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,iN.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Zd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,iN.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,hfc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,iN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Zd.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,iN.mkBasicResultTelemetry)(r)}}}};Zd.CompletionsFromNetwork=h2r;Zd.CompletionsFromNetwork=h2r=afc([Rne(0,dfc.IInstantiationService),Rne(1,p2r.ICompletionsOpenAIFetcherService),Rne(2,pfc.ICompletionsFeaturesService),Rne(3,Afc.ICompletionsRuntimeModeService),Rne(4,ELi.ICompletionsLogTargetService),Rne(5,Efc.ICompletionsCacheService),Rne(6,ffc.ICompletionsUserErrorNotifierService)],h2r);function R_t(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(R_t,"postProcessChoices");function _Li(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(fLi,"makeGhostAPIChoice");function d2r(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,efc.telemetry)(t,`ghostText.${e}`,l)}a(d2r,"telemetryPerformance")});var hLi=I(I_t=>{"use strict";p();Object.defineProperty(I_t,"__esModule",{value:!0});I_t.contextualFilterCharacterMap=void 0;I_t.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 mLi=I(f2r=>{"use strict";p();Object.defineProperty(f2r,"__esModule",{value:!0});f2r.multilineModelPredict=ifc;function ifc(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 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 j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.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 Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.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 V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.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 le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.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 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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.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 rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.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 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 Qe;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?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.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 Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.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 J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.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?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.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 me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.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 et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.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 ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.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 Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.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 cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.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 Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.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 $0=ofc(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+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(ifc,"multilineModelPredict");function ofc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(ofc,"sigmoid")});var ALi=I(j$=>{"use strict";p();Object.defineProperty(j$,"__esModule",{value:!0});j$.MultilineModelFeatures=j$.PromptFeatures=void 0;j$.hasComment=p2r;j$.requestMultilineScore=lfc;var q$=hLi(),sfc=mLi(),afc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},gLi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function p2r(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(afc[r]??[]).some(l=>s.includes(l))}a(p2r,"hasComment");var NLe=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=p2r(e,-2,r),this.rstripSecondToLastLineHasComment=p2r(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[0]}return r}a(_Li,"makeGhostAPIChoice");function m2r(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,gfc.telemetry)(t,`ghostText.${e}`,l)}a(m2r,"telemetryPerformance")});var CLi=I(k_t=>{"use strict";p();Object.defineProperty(k_t,"__esModule",{value:!0});k_t.contextualFilterCharacterMap=void 0;k_t.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 bLi=I(g2r=>{"use strict";p();Object.defineProperty(g2r,"__esModule",{value:!0});g2r.multilineModelPredict=_fc;function _fc(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 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 j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.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 Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.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 V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.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 le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.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 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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.0012774367867215346;let Me;t[120]>1e-35?Me=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Me=-.042799574885345304:Me=.07412430171193245:Me=-.11248270469336048:t[193]>1e-35?Me=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Me=.028911612178122104:Me=.12326369727728437:t[0]>4091.5000000000005?Me=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Me=.1159839898100149:Me=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Me=-.0216343737351583:Me=-.1220272260878369:t[2]>18.500000000000004?Me=.09152924475072398:t[8]>55.50000000000001?Me=.039508716651005665:Me=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Me=.06793009902674053:Me=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Me=-.04391068849624096:Me=.04009967593394672:t[8]>1085.5000000000002?Me=-.024773826356034825:Me=-.13919707884246582:Me=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Me=-.11567917501901476:Me=-.006813640337684114:t[3]>7.500000000000001?Me=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Me=-.001754586408351048:Me=-.055422422450722056:Me=-.06090032532532226:t[0]>5269.500000000001?Me=.11787981735983527:Me=-.00198119768540783:Me=.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 rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.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 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 Qe;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?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.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 Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.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 J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.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?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.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 me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.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 et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.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 Ct;t[187]>1e-35?t[243]>1e-35?Ct=-.08392792551692502:t[10]>68.50000000000001?Ct=.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?Ct=-.0825306209711224:Ct=.049559996084532945:Ct=-.1064938580886302:Ct=.03353240732240275:Ct=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?Ct=.16966001471529374:t[1]>57.50000000000001?Ct=-.005772777673676247:Ct=.09383677041525058:t[8]>747.5000000000001?Ct=.054068175469351235:Ct=-.049968216310277036:t[8]>753.5000000000001?Ct=-.0679383555784074:t[4]>8.500000000000002?Ct=-.059757341189735386:Ct=.05701083682780414:Ct=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?Ct=.05820296128730006:Ct=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?Ct=.15340611616954566:Ct=.04385036188666874:t[0]>4449.500000000001?Ct=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?Ct=.004840354641006495:Ct=.09967827580276283:Ct=.11605363537391578:t[9]>19.500000000000004?Ct=-.0735831692725717:Ct=.019973331823355176:t[306]>1e-35?t[149]>1e-35?Ct=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?Ct=-.02442182361342386:Ct=.10334853004243093:Ct=-.030431948680167104:Ct=-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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.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 Oe;t[304]>1e-35?Oe=-.04717777269217453:t[76]>1e-35?Oe=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Oe=-.09648224457374217:t[132]>1e-35?Oe=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Oe=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Oe=.10838431695638147:t[230]>1e-35?Oe=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Oe=.050071316251979:Oe=-.006356941111525215:t[6]>8.500000000000002?Oe=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Oe=.10217402850540398:Oe=-.048840949025349197:Oe=-.03668313197909846:t[7]>39.50000000000001?Oe=-.0562642841496003:t[10]>2.5000000000000004?Oe=.09749777369987417:Oe=-.04848223121417616:t[0]>5453.500000000001?Oe=.08316648226133942:Oe=-.0261979698267618:t[212]>1e-35?Oe=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Oe=.04837009746506856:Oe=-.09184360565631328:Oe=.0032411047845613606:t[0]>4733.500000000001?Oe=.0977378556864798:Oe=.010776545559325588:Oe=-.012483310473120218:Oe=-.049284121449103935:Oe=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Oe=-.08380361910948711:Oe=.07375088778585813:Oe=-.1084864186071348:Oe=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.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 Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.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 cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.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 Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.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 V0=vfc(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+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Me+we+Be+rt+st+Et+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+Ct+ht+We+ae+Re+Oe+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-V0,V0]}a(_fc,"multilineModelPredict");function vfc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(vfc,"sigmoid")});var TLi=I(V$=>{"use strict";p();Object.defineProperty(V$,"__esModule",{value:!0});V$.MultilineModelFeatures=V$.PromptFeatures=void 0;V$.hasComment=A2r;V$.requestMultilineScore=Tfc;var $$=CLi(),Cfc=bLi(),bfc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},SLi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function A2r(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(bfc[r]??[]).some(l=>s.includes(l))}a(A2r,"hasComment");var FLe=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=A2r(e,-2,r),this.rstripSecondToLastLineHasComment=A2r(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]}};j$.PromptFeatures=NLe;var x_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new NLe(e,n),this.suffixFeatures=new NLe(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(gLi).length+1).fill(0);r[gLi[this.language]??0]=1;let n=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);n[q$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);o[q$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);s[q$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);return c[q$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};j$.MultilineModelFeatures=x_t;function cfc(t,e){return new x_t(t.prefix,t.suffix,e)}a(cfc,"constructMultilineFeatures");function lfc(t,e){let r=cfc(t,e).constructFeatures();return(0,sfc.multilineModelPredict)(r)[1]}a(lfc,"requestMultilineScore")});var yLi=I(V6=>{"use strict";p();var ufc=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},dfc=V6&&V6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V6,"__esModule",{value:!0});V6.StreamedCompletionSplitter=void 0;var ffc=Gs(),pfc=M4e(),hfc=SAe(),h2r=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}},m2r=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 h2r(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 hfc.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(pfc.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}};V6.StreamedCompletionSplitter=m2r;V6.StreamedCompletionSplitter=m2r=ufc([dfc(5,ffc.IInstantiationService)],m2r)});var ILi=I(g2r=>{"use strict";p();Object.defineProperty(g2r,"__esModule",{value:!0});g2r.getGhostTextStrategy=vfc;var SLi=Gs(),ELi=Qre(),rN=LE(),TLi=fy(),w_t=gyt(),_Li=$g(),mfc=mAe(),MLe=SAe(),gfc=a2r(),Afc=_4e(),yfc=cIr(),Efc=ALi(),_fc=yLi(),vLi=20;function CLi(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]}};V$.PromptFeatures=FLe;var P_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new FLe(e,n),this.suffixFeatures=new FLe(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(SLi).length+1).fill(0);r[SLi[this.language]??0]=1;let n=new Array(Object.keys($$.contextualFilterCharacterMap).length+1).fill(0);n[$$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys($$.contextualFilterCharacterMap).length+1).fill(0);o[$$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys($$.contextualFilterCharacterMap).length+1).fill(0);s[$$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys($$.contextualFilterCharacterMap).length+1).fill(0);return c[$$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};V$.MultilineModelFeatures=P_t;function Sfc(t,e){return new P_t(t.prefix,t.suffix,e)}a(Sfc,"constructMultilineFeatures");function Tfc(t,e){let r=Sfc(t,e).constructFeatures();return(0,Cfc.multilineModelPredict)(r)[1]}a(Tfc,"requestMultilineScore")});var ILi=I(z6=>{"use strict";p();var Ifc=z6&&z6.__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},xfc=z6&&z6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z6,"__esModule",{value:!0});z6.StreamedCompletionSplitter=void 0;var wfc=Gs(),Rfc=U4e(),kfc=IAe(),y2r=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}},E2r=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 y2r(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 kfc.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(Rfc.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}};z6.StreamedCompletionSplitter=E2r;z6.StreamedCompletionSplitter=E2r=Ifc([xfc(5,wfc.IInstantiationService)],E2r)});var MLi=I(_2r=>{"use strict";p();Object.defineProperty(_2r,"__esModule",{value:!0});_2r.getGhostTextStrategy=Bfc;var DLi=Gs(),xLi=qre(),oN=BE(),NLi=py(),D_t=_yt(),wLi=Vg(),Pfc=AAe(),ULe=IAe(),Dfc=d2r(),Nfc=T4e(),Mfc=fIr(),Ofc=TLi(),Lfc=ILi(),RLi=20;function kLi(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(CLi,"takeNLines");async function vfc(t,e,r,n,o,s,c){let l=t.get(SLi.IInstantiationService),u=t.get(TLi.ICompletionsFeaturesService),d=t.get(yfc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case rN.BlockMode.Server:return s?{blockMode:rN.BlockMode.Parsing,requestMultiline:!0,finishedCb:CLi(f),stop:[` +`).length}}a(kLi,"takeNLines");async function Bfc(t,e,r,n,o,s,c){let l=t.get(DLi.IInstantiationService),u=t.get(NLi.ICompletionsFeaturesService),d=t.get(Mfc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case oN.BlockMode.Server:return s?{blockMode:oN.BlockMode.Parsing,requestMultiline:!0,finishedCb:kLi(f),stop:[` -`],maxTokens:vLi*f}:{blockMode:rN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case rN.BlockMode.Parsing:case rN.BlockMode.ParsingAndServer:case rN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(Cfc,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=mfc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(bLi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:rN.BlockMode.Parsing,requestMultiline:!0,finishedCb:CLi(f),stop:[` +`],maxTokens:RLi*f}:{blockMode:oN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case oN.BlockMode.Parsing:case oN.BlockMode.ParsingAndServer:case oN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(Ffc,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=Pfc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(PLi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:oN.BlockMode.Parsing,requestMultiline:!0,finishedCb:kLi(f),stop:[` -`],maxTokens:vLi*f};return h===rN.BlockMode.MoreMultiline&&(g.blockMode=rN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(bLi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(vfc,"getGhostTextStrategy");function bLi(t,e,r,n,o,s,c,l,u){let d=t.get(TLi.ICompletionsFeaturesService),f=t.get(SLi.IInstantiationService);if(c&&e===rN.BlockMode.MoreMultiline&&MLe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===MLe.BlockPositionType.EmptyBlock||o===MLe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(Afc.ICompletionsCacheService);return{finishedCb:f.createInstance(_fc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,gfc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,w_t.parsingBlockFinished)(r,n):h=>{}}}a(bLi,"buildFinishedCallback");async function Cfc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,_Li.telemetry)(t,"ghostText.longFileMultilineSkip",_Li.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===rN.BlockMode.MoreMultiline&&MLe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,MLe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&bfc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,ELi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,w_t.isEmptyBlockStartUtil)(r,n):o&&(0,ELi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,w_t.isEmptyBlockStartUtil)(r,n)||await(0,w_t.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Efc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(Cfc,"shouldRequestMultiline");function bfc(t,e){return e.lineAt(t).text.trim().length===0}a(bfc,"isNewLine")});var DLi=I(qR=>{"use strict";p();var Sfc=qR&&qR.__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},nN=qR&&qR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qR,"__esModule",{value:!0});qR.ForceMultiLine=qR.GhostTextComputer=void 0;qR.getGhostText=$fc;var wLi=Sp(),Tfc=gm(),Ifc=PPr(),xfc=T0(),RLi=Gs(),wfc=DPr(),Rfc=Ore(),kfc=o4e(),Pfc=FSr(),LLe=LE(),C2r=fy(),Dfc=Dl(),Nfc=KAe(),Mfc=ATr(),Ofc=A_t(),Lfc=tEt(),Bfc=v$(),Ffc=gyt(),A2r=qAe(),E2r=qPr(),y2r=F4i(),oye=$g(),R_t=mAe(),xLi=y4e(),Ufc=jTr(),Qfc=SAe(),qfc=_4e(),_2r=pLi(),kLi=uIr(),jfc=ILi(),H$=a$(),Eh=xAe(),Hfc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Gfc(t,e,r){let n=t.get(C2r.ICompletionsFeaturesService),o=(0,LLe.getConfig)(t,LLe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,oye.now)()-r.issuedTime;return Math.max(0,o-s)}a(Gfc,"getRemainingDebounceMs");function OLe(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(OLe,"isCompletionRequestCancelled");var k_t=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,xfc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Kfc,e.textDocument,l,n);await(0,Rfc.ensureTokenizersLoaded)().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,Nfc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Eh.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,oye.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),OLe(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let g=Wfc(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,Eh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Mfc.getEngineRequestInfo,n),y={...Hfc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(A2r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(A2r.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,Eh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Eh.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,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Eh.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,Eh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Gfc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,xLi.delay)(_),OLe(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,A2r.trimLastLine)(e.textDocument.getText(R_t.LocationFactory.range(R_t.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(jfc.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(Vfc,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(E2r.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,Ffc.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(Zfc,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 Y=!w.requestMultiline;R=[[(0,_2r.makeGhostAPIChoice)(U[0],{forceSingleLine:Y})],H$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(OLe(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===LLe.BlockMode.MoreMultiline&&Qfc.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(y2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===H$.ResultType.Cache||R[1]===H$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(_2r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await U.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(Y.type==="success"){d.trace(`Cycling network request returned ${Y.value[0].length} choices`);let W=R?.[0]??[];Y.value[0].forEach(V=>{W.findIndex(z=>z.completionText.trim()===V.completionText.trim())===-1&&W.push(V)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,H$.ResultType.Cycling]}else if(R===void 0)return Y}else{d.trace("Initiating network request for completions");let Y=a((ie,H)=>(this.asyncCompletionManager.updateCompletion(r,ie),w.finishedCb(ie,H)),"finishedCb"),W=new kfc.CancellationTokenSource,V=U.getCompletionsFromNetwork(P,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(z===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],H$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,Eh.resultTypeToString)(B)}`);let q=L.map(U=>this.instantiationService.invokeFunction(y2r.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(LLe.getConfig,LLe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,oye.now)()-n.issuedTime,j=Math.max(M-O,0);if(B!==H$.ResultType.TypingAsSuggested&&!y.isCycling&&j>0&&(d.debug(`Waiting ${j}ms before returning completion`),await(0,xLi.delay)(j),OLe(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of q){let Y=Jfc(e.textDocument,P,U,D),W=g?(0,y2r.checkSuffix)(e.textDocument,e.position,U):0,z={completion:zfc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(z)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,Eh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),OLe(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Eh.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 ${Q.length} results`),{type:"success",value:[Q,B],telemetryData:(0,Eh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};qR.GhostTextComputer=k_t;qR.GhostTextComputer=k_t=Sfc([nN(0,RLi.IInstantiationService),nN(1,Tfc.ITelemetryService),nN(2,Pfc.ICompletionsNotifierService),nN(3,Lfc.ICompletionsContextProviderBridgeService),nN(4,kLi.ICompletionsCurrentGhostText),nN(5,Bfc.ICompletionsContextProviderService),nN(6,Ufc.ICompletionsAsyncManagerService),nN(7,C2r.ICompletionsFeaturesService),nN(8,Dfc.ICompletionsLogTargetService),nN(9,Ofc.ICompletionsStatusReporter),nN(10,wLi.ILogService)],k_t);async function $fc(t,e,r,n,o,s,c){return t.get(RLi.IInstantiationService).createInstance(k_t).getGhostText(e,r,n,o,s,c)}a($fc,"getGhostText");function Vfc(t,e,r,n){let s=t.get(kLi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Yfc(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),H$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,H$.ResultType.Cache]}a(Vfc,"getLocalInlineSuggestion");function Wfc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,wfc.isInlineSuggestionFromTextAfterCursor)(n)}a(Wfc,"isInlineSuggestion");var v2r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};qR.ForceMultiLine=v2r;function zfc(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(zfc,"adjustLeadingWhitespace");function Yfc(t,e,r,n){let o=t.get(wLi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(qfc.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,_2r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Yfc,"getCompletionsFromCache");async function Kfc(t,e,r,n){let o=t.get(C2r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=oye.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Kfc,"createTelemetryWithExp");function Jfc(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,PLi(l,t),l.extendWithRequestId(o),l}a(Jfc,"telemetryWithAddData");function Zfc(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);PLi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===E2r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==E2r.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(R_t.LocationFactory.range(h.range.start,n)),g=e.getText(R_t.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Ifc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,oye.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,oye.telemetry)(t,"ghostText.issued",_),d}a(Zfc,"telemetryIssued");function PLi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(PLi,"addDocumentTelemetry")});var LLi=I(W6=>{"use strict";p();var Xfc=W6&&W6.__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},b2r=W6&&W6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(W6,"__esModule",{value:!0});W6.GhostText=void 0;var NLi=ri(),epc=Gs(),tpc=pIr(),rpc=R4i(),MLi=DLi(),npc=IPr(),ipc=a$(),opc=uyt(),OLi=xAe(),spc=Dl(),S2r=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){apc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,tpc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(OLi.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(MLi.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(npc.setLastShown,e.textDocument,e.position,f),m=(0,rpc.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!==ipc.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(MLi.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,_=NLi.Range.create(y,NLi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};W6.GhostText=S2r;W6.GhostText=S2r=Xfc([b2r(0,epc.IInstantiationService),b2r(1,spc.ICompletionsLogTargetService),b2r(2,opc.ICompletionsSpeculativeRequestCache)],S2r);function apc(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}});OLi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(apc,"logCompletionLocation")});var BLi=I(N_t=>{"use strict";p();Object.defineProperty(N_t,"__esModule",{value:!0});N_t.LocalFileSystem=void 0;var P_t=require("fs"),cpc=require("path"),D_t=n$(),T2r=o$(),I2r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await P_t.promises.readFile((0,T2r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,T2r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,T2r.fsPath)(e),n=await P_t.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,cpc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await P_t.promises.lstat(e);if(r.isSymbolicLink())try{let n=await P_t.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=D_t.FileType.Unknown;return e.isFile()&&(o=D_t.FileType.File),e.isDirectory()&&(o=D_t.FileType.Directory),r.isSymbolicLink()&&n&&(o|=D_t.FileType.SymbolicLink),o}};N_t.LocalFileSystem=I2r});var qLi=I(z6=>{"use strict";p();var lpc=z6&&z6.__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},BLe=z6&&z6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z6,"__esModule",{value:!0});z6.CompositeRelatedFilesProvider=void 0;var upc=Bre(),dpc=Gs(),sye=LE(),fpc=fy(),ppc=n$(),hpc=Dl(),FLe=UAe(),Rne=dEt(),FLi=["cpp","c","cuda-cpp"],ULi=["typescript","javascript","typescriptreact","javascriptreact"],QLi=["csharp"],mpc=new Map([...FLi.map(t=>[t,FLe.NeighboringFileType.RelatedCpp]),...ULi.map(t=>[t,FLe.NeighboringFileType.RelatedTypeScript]),...QLi.map(t=>[t,FLe.NeighboringFileType.RelatedCSharpRoslyn])]);function gpc(t){return mpc.get(t)??FLe.NeighboringFileType.RelatedOther}a(gpc,"getNeighboringFileType");var x2r=class extends Rne.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(gpc(s)===FLe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Rne.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Rne.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Rne.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Rne.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Rne.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)Rne.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 QLi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCodeCSharp):ULi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCodeTypeScript):FLi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};z6.CompositeRelatedFilesProvider=x2r;z6.CompositeRelatedFilesProvider=x2r=lpc([BLe(0,dpc.IInstantiationService),BLe(1,upc.IIgnoreService),BLe(2,fpc.ICompletionsFeaturesService),BLe(3,hpc.ICompletionsLogTargetService),BLe(4,ppc.ICompletionsFileSystemService)],x2r)});var M_t=I(kne=>{"use strict";p();Object.defineProperty(kne,"__esModule",{value:!0});kne.PositionOffsetTransformer=kne.PositionOffsetTransformerBase=void 0;kne.ensureDependenciesAreSet=Epc;var jLi=kE(),HLi=h5e(),Apc=Yut(),ypc=Tme(),GLi=Yut();Object.defineProperty(kne,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return GLi.PositionOffsetTransformerBase},"get")});Object.defineProperty(kne,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return GLi.PositionOffsetTransformer},"get")});(0,Apc._setPositionOffsetTransformerDependencies)({StringEdit:jLi.StringEdit,StringReplacement:jLi.StringReplacement,TextReplacement:HLi.TextReplacement,TextEdit:HLi.TextEdit,TextLength:ypc.TextLength});function Epc(){}a(Epc,"ensureDependenciesAreSet")});var L_t=I(O_t=>{"use strict";p();Object.defineProperty(O_t,"__esModule",{value:!0});O_t.RootedLineEdit=void 0;var $Li=NG(),_pc=M_t(),vpc=iN();(0,_pc.ensureDependenciesAreSet)();var w2r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=$Li.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 vpc.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 $Li.LineEdit(r))}};O_t.RootedLineEdit=w2r});var iN=I(G$=>{"use strict";p();Object.defineProperty(G$,"__esModule",{value:!0});G$.Edits=G$.SingleEdits=G$.RootedEdit=void 0;var VLi=rd(),Cpc=NG(),aye=kE(),WLi=k2r(),bpc=L_t(),ULe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return Cpc.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,VLi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,VLi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return bpc.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)}};G$.RootedEdit=ULe;var R2r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return aye.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new B_t(aye.StringEdit,this.edits.map(e=>e.toEdit()))}};G$.SingleEdits=R2r;var B_t=class t{static{a(this,"Edits")}static single(e){return new t(aye.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=aye.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(aye.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,WLi.serializeStringEdit)(e))}static deserialize(e){return new t(aye.StringEdit,e.map(r=>(0,WLi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=ULe.toLineEdit(new ULe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],maxTokens:RLi*f};return h===oN.BlockMode.MoreMultiline&&(g.blockMode=oN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(PLi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(Bfc,"getGhostTextStrategy");function PLi(t,e,r,n,o,s,c,l,u){let d=t.get(NLi.ICompletionsFeaturesService),f=t.get(DLi.IInstantiationService);if(c&&e===oN.BlockMode.MoreMultiline&&ULe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===ULe.BlockPositionType.EmptyBlock||o===ULe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(Nfc.ICompletionsCacheService);return{finishedCb:f.createInstance(Lfc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,Dfc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,D_t.parsingBlockFinished)(r,n):h=>{}}}a(PLi,"buildFinishedCallback");async function Ffc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,wLi.telemetry)(t,"ghostText.longFileMultilineSkip",wLi.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===oN.BlockMode.MoreMultiline&&ULe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,ULe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&Ufc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,xLi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,D_t.isEmptyBlockStartUtil)(r,n):o&&(0,xLi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,D_t.isEmptyBlockStartUtil)(r,n)||await(0,D_t.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Ofc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(Ffc,"shouldRequestMultiline");function Ufc(t,e){return e.lineAt(t).text.trim().length===0}a(Ufc,"isNewLine")});var QLi=I(HR=>{"use strict";p();var Qfc=HR&&HR.__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},sN=HR&&HR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HR,"__esModule",{value:!0});HR.ForceMultiLine=HR.GhostTextComputer=void 0;HR.getGhostText=apc;var LLi=Ip(),qfc=ym(),jfc=OPr(),Hfc=I0(),BLi=Gs(),Gfc=LPr(),$fc=Lre(),Vfc=u4e(),Wfc=jSr(),qLe=BE(),I2r=py(),zfc=Nl(),Yfc=ZAe(),Kfc=vTr(),Jfc=v_t(),Zfc=oEt(),Xfc=T$(),epc=_yt(),v2r=HAe(),b2r=$Pr(),C2r=V4i(),aye=Vg(),N_t=AAe(),OLi=b4e(),tpc=VTr(),rpc=IAe(),npc=T4e(),S2r=vLi(),FLi=hIr(),ipc=MLi(),W$=d$(),vh=RAe(),opc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function spc(t,e,r){let n=t.get(I2r.ICompletionsFeaturesService),o=(0,qLe.getConfig)(t,qLe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,aye.now)()-r.issuedTime;return Math.max(0,o-s)}a(spc,"getRemainingDebounceMs");function QLe(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(QLe,"isCompletionRequestCancelled");var M_t=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,Hfc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(fpc,e.textDocument,l,n);await(0,$fc.ensureTokenizersLoaded)().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,Yfc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,vh.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,aye.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),QLe(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,vh.mkBasicResultTelemetry)(n)};let g=lpc(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,vh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Kfc.getEngineRequestInfo,n),y={...opc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(v2r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(v2r.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,vh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,vh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,vh.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,vh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,vh.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,vh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(spc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,OLi.delay)(_),QLe(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,vh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,v2r.trimLastLine)(e.textDocument.getText(N_t.LocationFactory.range(N_t.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(ipc.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(cpc,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(b2r.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,epc.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(hpc,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 Y=!w.requestMultiline;R=[[(0,S2r.makeGhostAPIChoice)(U[0],{forceSingleLine:Y})],W$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(QLe(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,vh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===qLe.BlockMode.MoreMultiline&&rpc.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(C2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===W$.ResultType.Cache||R[1]===W$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,vh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,vh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,vh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(S2r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await U.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(Y.type==="success"){d.trace(`Cycling network request returned ${Y.value[0].length} choices`);let W=R?.[0]??[];Y.value[0].forEach(V=>{W.findIndex(z=>z.completionText.trim()===V.completionText.trim())===-1&&W.push(V)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,W$.ResultType.Cycling]}else if(R===void 0)return Y}else{d.trace("Initiating network request for completions");let Y=a((ie,H)=>(this.asyncCompletionManager.updateCompletion(r,ie),w.finishedCb(ie,H)),"finishedCb"),W=new Vfc.CancellationTokenSource,V=U.getCompletionsFromNetwork(P,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(z===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,vh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],W$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,vh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,vh.resultTypeToString)(B)}`);let q=L.map(U=>this.instantiationService.invokeFunction(C2r.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(qLe.getConfig,qLe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,aye.now)()-n.issuedTime,j=Math.max(M-O,0);if(B!==W$.ResultType.TypingAsSuggested&&!y.isCycling&&j>0&&(d.debug(`Waiting ${j}ms before returning completion`),await(0,OLi.delay)(j),QLe(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,vh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of q){let Y=ppc(e.textDocument,P,U,D),W=g?(0,C2r.checkSuffix)(e.textDocument,e.position,U):0,z={completion:upc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(z)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,vh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),QLe(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,vh.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 ${Q.length} results`),{type:"success",value:[Q,B],telemetryData:(0,vh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};HR.GhostTextComputer=M_t;HR.GhostTextComputer=M_t=Qfc([sN(0,BLi.IInstantiationService),sN(1,qfc.ITelemetryService),sN(2,Wfc.ICompletionsNotifierService),sN(3,Zfc.ICompletionsContextProviderBridgeService),sN(4,FLi.ICompletionsCurrentGhostText),sN(5,Xfc.ICompletionsContextProviderService),sN(6,tpc.ICompletionsAsyncManagerService),sN(7,I2r.ICompletionsFeaturesService),sN(8,zfc.ICompletionsLogTargetService),sN(9,Jfc.ICompletionsStatusReporter),sN(10,LLi.ILogService)],M_t);async function apc(t,e,r,n,o,s,c){return t.get(BLi.IInstantiationService).createInstance(M_t).getGhostText(e,r,n,o,s,c)}a(apc,"getGhostText");function cpc(t,e,r,n){let s=t.get(FLi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=dpc(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),W$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,W$.ResultType.Cache]}a(cpc,"getLocalInlineSuggestion");function lpc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,Gfc.isInlineSuggestionFromTextAfterCursor)(n)}a(lpc,"isInlineSuggestion");var T2r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};HR.ForceMultiLine=T2r;function upc(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(upc,"adjustLeadingWhitespace");function dpc(t,e,r,n){let o=t.get(LLi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(npc.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,S2r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(dpc,"getCompletionsFromCache");async function fpc(t,e,r,n){let o=t.get(I2r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=aye.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(fpc,"createTelemetryWithExp");function ppc(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,ULi(l,t),l.extendWithRequestId(o),l}a(ppc,"telemetryWithAddData");function hpc(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);ULi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===b2r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==b2r.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(N_t.LocationFactory.range(h.range.start,n)),g=e.getText(N_t.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,jfc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,aye.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,aye.telemetry)(t,"ghostText.issued",_),d}a(hpc,"telemetryIssued");function ULi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(ULi,"addDocumentTelemetry")});var GLi=I(Y6=>{"use strict";p();var mpc=Y6&&Y6.__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},x2r=Y6&&Y6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Y6,"__esModule",{value:!0});Y6.GhostText=void 0;var qLi=ei(),gpc=Gs(),Apc=AIr(),ypc=B4i(),jLi=QLi(),Epc=kPr(),_pc=d$(),vpc=hyt(),HLi=RAe(),Cpc=Nl(),w2r=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){bpc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Apc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(HLi.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(jLi.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(Epc.setLastShown,e.textDocument,e.position,f),m=(0,ypc.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!==_pc.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(jLi.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,_=qLi.Range.create(y,qLi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};Y6.GhostText=w2r;Y6.GhostText=w2r=mpc([x2r(0,gpc.IInstantiationService),x2r(1,Cpc.ICompletionsLogTargetService),x2r(2,vpc.ICompletionsSpeculativeRequestCache)],w2r);function bpc(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}});HLi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(bpc,"logCompletionLocation")});var $Li=I(B_t=>{"use strict";p();Object.defineProperty(B_t,"__esModule",{value:!0});B_t.LocalFileSystem=void 0;var O_t=require("fs"),Spc=require("path"),L_t=a$(),R2r=l$(),k2r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await O_t.promises.readFile((0,R2r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,R2r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,R2r.fsPath)(e),n=await O_t.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Spc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await O_t.promises.lstat(e);if(r.isSymbolicLink())try{let n=await O_t.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=L_t.FileType.Unknown;return e.isFile()&&(o=L_t.FileType.File),e.isDirectory()&&(o=L_t.FileType.Directory),r.isSymbolicLink()&&n&&(o|=L_t.FileType.SymbolicLink),o}};B_t.LocalFileSystem=k2r});var YLi=I(K6=>{"use strict";p();var Tpc=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},jLe=K6&&K6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(K6,"__esModule",{value:!0});K6.CompositeRelatedFilesProvider=void 0;var Ipc=Fre(),xpc=Gs(),cye=BE(),wpc=py(),Rpc=a$(),kpc=Nl(),HLe=qAe(),kne=mEt(),VLi=["cpp","c","cuda-cpp"],WLi=["typescript","javascript","typescriptreact","javascriptreact"],zLi=["csharp"],Ppc=new Map([...VLi.map(t=>[t,HLe.NeighboringFileType.RelatedCpp]),...WLi.map(t=>[t,HLe.NeighboringFileType.RelatedTypeScript]),...zLi.map(t=>[t,HLe.NeighboringFileType.RelatedCSharpRoslyn])]);function Dpc(t){return Ppc.get(t)??HLe.NeighboringFileType.RelatedOther}a(Dpc,"getNeighboringFileType");var P2r=class extends kne.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(Dpc(s)===HLe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),kne.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),kne.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return kne.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),kne.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return kne.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)kne.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 zLi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(cye.getConfig,cye.ConfigKey.RelatedFilesVSCodeCSharp):WLi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(cye.getConfig,cye.ConfigKey.RelatedFilesVSCodeTypeScript):VLi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(cye.getConfig,cye.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};K6.CompositeRelatedFilesProvider=P2r;K6.CompositeRelatedFilesProvider=P2r=Tpc([jLe(0,xpc.IInstantiationService),jLe(1,Ipc.IIgnoreService),jLe(2,wpc.ICompletionsFeaturesService),jLe(3,kpc.ICompletionsLogTargetService),jLe(4,Rpc.ICompletionsFileSystemService)],P2r)});var F_t=I(Pne=>{"use strict";p();Object.defineProperty(Pne,"__esModule",{value:!0});Pne.PositionOffsetTransformer=Pne.PositionOffsetTransformerBase=void 0;Pne.ensureDependenciesAreSet=Opc;var KLi=PE(),JLi=E5e(),Npc=Xut(),Mpc=xme(),ZLi=Xut();Object.defineProperty(Pne,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return ZLi.PositionOffsetTransformerBase},"get")});Object.defineProperty(Pne,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return ZLi.PositionOffsetTransformer},"get")});(0,Npc._setPositionOffsetTransformerDependencies)({StringEdit:KLi.StringEdit,StringReplacement:KLi.StringReplacement,TextReplacement:JLi.TextReplacement,TextEdit:JLi.TextEdit,TextLength:Mpc.TextLength});function Opc(){}a(Opc,"ensureDependenciesAreSet")});var Q_t=I(U_t=>{"use strict";p();Object.defineProperty(U_t,"__esModule",{value:!0});U_t.RootedLineEdit=void 0;var XLi=BG(),Lpc=F_t(),Bpc=aN();(0,Lpc.ensureDependenciesAreSet)();var D2r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=XLi.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 Bpc.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 XLi.LineEdit(r))}};U_t.RootedLineEdit=D2r});var aN=I(z$=>{"use strict";p();Object.defineProperty(z$,"__esModule",{value:!0});z$.Edits=z$.SingleEdits=z$.RootedEdit=void 0;var eBi=nd(),Fpc=BG(),lye=PE(),tBi=M2r(),Upc=Q_t(),GLe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return Fpc.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,eBi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,eBi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return Upc.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)}};z$.RootedEdit=GLe;var N2r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return lye.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new q_t(lye.StringEdit,this.edits.map(e=>e.toEdit()))}};z$.SingleEdits=N2r;var q_t=class t{static{a(this,"Edits")}static single(e){return new t(lye.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=lye.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(lye.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,tBi.serializeStringEdit)(e))}static deserialize(e){return new t(lye.StringEdit,e.map(r=>(0,tBi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=GLe.toLineEdit(new GLe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` --- -`)}};G$.Edits=B_t});var k2r=I(cye=>{"use strict";p();Object.defineProperty(cye,"__esModule",{value:!0});cye.serializeStringEdit=Ipc;cye.serializeSingleEdit=KLi;cye.deserializeStringEdit=xpc;cye.decomposeStringEdit=Rpc;var Spc=Rs(),YLi=kE(),Tpc=hd(),zLi=iN();function Ipc(t){return t.replacements.map(e=>KLi(e))}a(Ipc,"serializeStringEdit");function KLi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(KLi,"serializeSingleEdit");function xpc(t){return new YLi.StringEdit(t.map(e=>wpc(e)))}a(xpc,"deserializeStringEdit");function wpc(t){return new YLi.StringReplacement(new Tpc.OffsetRange(t[0],t[1]),t[2])}a(wpc,"deserializeSingleEdit");function Rpc(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 zLi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Spc.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(F_t,"__esModule",{value:!0});F_t.DebugRecorderBookmark=void 0;var P2r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};F_t.DebugRecorderBookmark=P2r});var tBi=I(Q_t=>{"use strict";p();Object.defineProperty(Q_t,"__esModule",{value:!0});Q_t.DebugRecorder=void 0;var ZLi=k2r(),kpc=JLi(),Ppc=h4(),Dpc=vMe(),U_t=Sl(),XLi=Ro(),Npc=tJ(),Mpc=C8(),Opc=NA(),eBi=T0(),Lpc=qT(),D2r=class extends XLi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=Dpc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,Mpc.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 N2r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Ppc.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,XLi.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,eBi.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,U_t.compareBy)(n=>n.sortTime,U_t.numberComparator)),r.map(n=>n.entry)}getLogInRange(e,r){if(!this._workspaceRoot)return;let n=[];n.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,eBi.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,U_t.compareBy)(o=>o.sortTime,U_t.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new kpc.DebugRecorderBookmark(this.getNow())}};Q_t.DebugRecorder=D2r;var N2r=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,Opc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Npc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new Lpc.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(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 n++,r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,ZLi.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}getDocumentLogInRange(e,r){let n=this._edits.filter(u=>u.instant>=e&&u.instant<=r);if(n.length===0)return[];let o=this._baseValue,s=this._baseValueTime;if(e>s)for(let u of this._edits){if(u.instant>=e)break;u.kind==="edit"&&(o=u.edit.applyOnText(o),s=u.instant)}let c=[];c.push({entry:{kind:"documentEncountered",id:this.id,relativePath:this.relativePath,time:this.creationTime},sortTime:this.creationTime});let l=1;c.push({entry:{kind:"setContent",id:this.id,v:l,content:o.value,time:s},sortTime:s}),c.push({entry:{kind:"opened",id:this.id,time:s},sortTime:s});for(let u of n)if(u.kind==="selections"){let d=u.selections.map(f=>[f.start,f.endExclusive]);c.push({entry:{kind:"selectionChanged",id:this.id,selection:d,time:u.instant},sortTime:u.instant})}else l++,c.push({entry:{kind:"changed",id:this.id,v:l,edit:(0,ZLi.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var rBi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.CapturingToken=void 0;var M2r=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}};q_t.CapturingToken=M2r});var nBi=I(O2r=>{"use strict";p();Object.defineProperty(O2r,"__esModule",{value:!0});O2r.secondsToHumanReadableTime=Bpc;function Bpc(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(Bpc,"secondsToHumanReadableTime")});var jR=I(Jd=>{"use strict";p();var Fpc=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]})),Upc=Jd&&Jd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qpc=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{"use strict";p();Object.defineProperty(uye,"__esModule",{value:!0});uye.serializeStringEdit=jpc;uye.serializeSingleEdit=iBi;uye.deserializeStringEdit=Hpc;uye.decomposeStringEdit=$pc;var Qpc=Rs(),nBi=PE(),qpc=gd(),rBi=aN();function jpc(t){return t.replacements.map(e=>iBi(e))}a(jpc,"serializeStringEdit");function iBi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(iBi,"serializeSingleEdit");function Hpc(t){return new nBi.StringEdit(t.map(e=>Gpc(e)))}a(Hpc,"deserializeStringEdit");function Gpc(t){return new nBi.StringReplacement(new qpc.OffsetRange(t[0],t[1]),t[2])}a(Gpc,"deserializeSingleEdit");function $pc(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 rBi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Qpc.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(j_t,"__esModule",{value:!0});j_t.DebugRecorderBookmark=void 0;var O2r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};j_t.DebugRecorderBookmark=O2r});var lBi=I(G_t=>{"use strict";p();Object.defineProperty(G_t,"__esModule",{value:!0});G_t.DebugRecorder=void 0;var sBi=M2r(),Vpc=oBi(),Wpc=m4(),zpc=IMe(),H_t=Tl(),aBi=ko(),Ypc=nJ(),Kpc=S8(),Jpc=MA(),cBi=I0(),Zpc=HT(),L2r=class extends aBi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=zpc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,Kpc.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 B2r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Wpc.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,aBi.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,cBi.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,H_t.compareBy)(n=>n.sortTime,H_t.numberComparator)),r.map(n=>n.entry)}getLogInRange(e,r){if(!this._workspaceRoot)return;let n=[];n.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,cBi.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,H_t.compareBy)(o=>o.sortTime,H_t.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new Vpc.DebugRecorderBookmark(this.getNow())}};G_t.DebugRecorder=L2r;var B2r=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,Jpc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Ypc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new Zpc.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(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 n++,r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,sBi.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}getDocumentLogInRange(e,r){let n=this._edits.filter(u=>u.instant>=e&&u.instant<=r);if(n.length===0)return[];let o=this._baseValue,s=this._baseValueTime;if(e>s)for(let u of this._edits){if(u.instant>=e)break;u.kind==="edit"&&(o=u.edit.applyOnText(o),s=u.instant)}let c=[];c.push({entry:{kind:"documentEncountered",id:this.id,relativePath:this.relativePath,time:this.creationTime},sortTime:this.creationTime});let l=1;c.push({entry:{kind:"setContent",id:this.id,v:l,content:o.value,time:s},sortTime:s}),c.push({entry:{kind:"opened",id:this.id,time:s},sortTime:s});for(let u of n)if(u.kind==="selections"){let d=u.selections.map(f=>[f.start,f.endExclusive]);c.push({entry:{kind:"selectionChanged",id:this.id,selection:d,time:u.instant},sortTime:u.instant})}else l++,c.push({entry:{kind:"changed",id:this.id,v:l,edit:(0,sBi.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var uBi=I($_t=>{"use strict";p();Object.defineProperty($_t,"__esModule",{value:!0});$_t.CapturingToken=void 0;var F2r=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}};$_t.CapturingToken=F2r});var dBi=I(U2r=>{"use strict";p();Object.defineProperty(U2r,"__esModule",{value:!0});U2r.secondsToHumanReadableTime=Xpc;function Xpc(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(Xpc,"secondsToHumanReadableTime")});var GR=I(Xd=>{"use strict";p();var ehc=Xd&&Xd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),thc=Xd&&Xd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rhc=Xd&&Xd.__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(mL,"__esModule",{value:!0});mL.PendingLoggedChatRequest=mL.IRequestLogger=mL.ChatRequestScheme=void 0;mL.resolveMarkdownContent=zpc;mL.resolveMarkdownIcon=Ypc;var cBi=jR(),Vpc=nn(),Wpc=hd(),L2r=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 Wpc.OffsetRange(n.index,n.index+o.length)}})}};mL.ChatRequestScheme=L2r;mL.IRequestLogger=(0,Vpc.createServiceIdentifier)("IRequestLogger");function zpc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(zpc,"resolveMarkdownContent");function Ypc(t){return typeof t.icon=="function"?t.icon():t.icon}a(Ypc,"resolveMarkdownIcon");var B2r=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})}},F2r=class extends B2r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===cBi.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===cBi.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})}};mL.PendingLoggedChatRequest=F2r});var Q2r=I(uye=>{"use strict";p();Object.defineProperty(uye,"__esModule",{value:!0});uye.NullSnippyService=uye.ISnippyService=void 0;var Kpc=nn();uye.ISnippyService=(0,Kpc.createServiceIdentifier)("ISnippyService");var U2r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};uye.NullSnippyService=U2r});var H2r=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.MovedText=dye.LinesDiff=void 0;var q2r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};dye.LinesDiff=q2r;var j2r=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()))}};dye.MovedText=j2r});var G_t=I(sN=>{"use strict";p();Object.defineProperty(sN,"__esModule",{value:!0});sN.RangeMapping=sN.DetailedLineRangeMapping=sN.LineRangeMapping=void 0;sN.lineRangeMappingFromRangeMappings=Zpc;sN.getLineRangeMapping=fBi;sN.lineRangeMappingFromChange=Xpc;var Jpc=Sl(),lBi=rd(),H_t=Rs(),g1=$2(),oN=q_(),gL=eh(),dBi=h5e(),QLe=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 g1.LineRange(s,u.original.startLineNumber),new g1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new g1.LineRange(s,r+1),new g1.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 Y6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new H_t.BugIndicatingError("not a valid diff");return new Y6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Y6(new gL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new gL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(uBi(this.original.endLineNumberExclusive,e)&&uBi(this.modified.endLineNumberExclusive,r))return new Y6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Y6(gL.Range.fromPositions(new oN.Position(this.original.startLineNumber,1),fye(new oN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(new oN.Position(this.modified.startLineNumber,1),fye(new oN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Y6(gL.Range.fromPositions(fye(new oN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),fye(new oN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(fye(new oN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),fye(new oN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new H_t.BugIndicatingError}};sN.LineRangeMapping=QLe;function fye(t,e){if(t.lineNumber<1)return new oN.Position(1,1);if(t.lineNumber>e.length)return new oN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new oN.Position(t.lineNumber,r.length+1):t}a(fye,"normalizePosition");function uBi(t,e){return t>=1&&t<=e.length}a(uBi,"isValidLineNumber");var qLe=class t extends QLe{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 dBi.TextEdit(n)}static fromRangeMappings(e){let r=g1.LineRange.join(e.map(o=>g1.LineRange.fromRangeInclusive(o.originalRange))),n=g1.LineRange.join(e.map(o=>g1.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()])}};sN.DetailedLineRangeMapping=qLe;var Y6=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 H_t.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 dBi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};sN.RangeMapping=Y6;function Zpc(t,e,r,n=!1){let o=[];for(let s of(0,Jpc.groupAdjacentBy)(t.map(c=>fBi(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 qLe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,lBi.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,lBi.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 g1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new g1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new qLe(s,c,[t])}a(fBi,"getLineRangeMapping");function Xpc(t){let e;t.originalEndLineNumber===0?e=new g1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new g1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new g1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new g1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new QLe(e,r)}a(Xpc,"lineRangeMappingFromChange")});var hye=I(HR=>{"use strict";p();Object.defineProperty(HR,"__esModule",{value:!0});HR.DateTimeout=HR.InfiniteTimeout=HR.OffsetPair=HR.SequenceDiff=HR.DiffAlgorithmResult=void 0;var ehc=Sl(),pBi=Rs(),pye=hd(),G2r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new jLe(pye.OffsetRange.ofLength(e.length),pye.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new jLe(pye.OffsetRange.ofLength(e.length),pye.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};HR.DiffAlgorithmResult=G2r;var jLe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,ehc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Pne.zero,s?s.getStarts():new Pne(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new pye.OffsetRange(e.offset1,r.offset1),new pye.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 pBi.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 Pne(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Pne(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};HR.SequenceDiff=jLe;var Pne=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}};HR.OffsetPair=Pne;var $2r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};HR.InfiniteTimeout=$2r;var V2r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new pBi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};HR.DateTimeout=V2r});var $_t=I(Dne=>{"use strict";p();Object.defineProperty(Dne,"__esModule",{value:!0});Dne.LineRangeFragment=Dne.Array2D=void 0;Dne.isSpace=thc;var W2r=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}};Dne.Array2D=W2r;function thc(t){return t===32||t===9}a(thc,"isSpace");var z2r=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(V_t,"__esModule",{value:!0});V_t.DynamicProgrammingDiffing=void 0;var hBi=hd(),HLe=hye(),Y2r=$_t(),K2r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=HLe.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return HLe.DiffAlgorithmResult.trivial(e,r);let s=new Y2r.Array2D(e.length,r.length),c=new Y2r.Array2D(e.length,r.length),l=new Y2r.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 HLe.SequenceDiff(new hBi.OffsetRange(A+1,d),new hBi.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 HLe.DiffAlgorithmResult(u,!1)}};V_t.DynamicProgrammingDiffing=K2r});var eDr=I(z_t=>{"use strict";p();Object.defineProperty(z_t,"__esModule",{value:!0});z_t.MyersDiffAlgorithm=void 0;var gBi=hd(),GLe=hye(),J2r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=GLe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return GLe.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 W_t(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 GLe.SequenceDiff(new gBi.OffsetRange(y,g),new gBi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new GLe.DiffAlgorithmResult(m,!1)}};z_t.MyersDiffAlgorithm=J2r;var W_t=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},Z2r=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}}},X2r=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 nDr=I(K_t=>{"use strict";p();Object.defineProperty(K_t,"__esModule",{value:!0});K_t.LinesSliceCharSequence=void 0;var tDr=xq(),Y_t=hd(),rhc=q_(),ABi=eh(),nhc=$_t(),rDr=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=_Bi(e>0?this.elements[e-1]:-1),n=_Bi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new rhc.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)?ABi.Range.fromPositions(n,n):ABi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!mye(this.elements[e]))return;let r=e;for(;r>0&&mye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!mye(this.elements[e]))return;let r=e;for(;r>0&&mye(this.elements[r-1])&&!yBi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,tDr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Y_t.OffsetRange(r,n)}};K_t.LinesSliceCharSequence=rDr;function mye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(mye,"isWordChar");function yBi(t){return t>=65&&t<=90}a(yBi,"isUpperCase");var ihc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function EBi(t){return ihc[t]}a(EBi,"getCategoryBoundaryScore");function _Bi(t){return t===10?8:t===13?7:(0,nhc.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(_Bi,"getCategory")});var SBi=I(iDr=>{"use strict";p();Object.defineProperty(iDr,"__esModule",{value:!0});iDr.computeMovedLines=chc;var ohc=hye(),J_t=G_t(),AL=Sl(),$Le=xq(),shc=zP(),A1=$2(),vBi=nDr(),Z_t=$_t(),ahc=eDr(),CBi=eh();function chc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=uhc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=dhc(u,n,o,e,r,s);return(0,AL.pushMany)(c,d),c=fhc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&lhc(h,g=>g.length>=2)>=2}),c=phc(t,c),c}a(chc,"computeMovedLines");function lhc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(lhc,"countWhere");function uhc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Z_t.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Z_t.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 J_t.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(uhc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function dhc(t,e,r,n,o,s){let c=[],l=new shc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,AL.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 A1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new A1.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,AL.reverseOrder)((0,AL.compareBy)(m=>m.modifiedLineRange.length,AL.numberComparator)));let d=new A1.LineRangeSet,f=new A1.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 J_t.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,AL.compareBy)(m=>m.original.startLineNumber,AL.numberComparator));let h=new $Le.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,$Le.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)||!bBi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new A1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new A1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!bBi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new A1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new A1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new J_t.LineRangeMapping(new A1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new A1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(dhc,"computeUnchangedMoves");function bBi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new ahc.MyersDiffAlgorithm().compute(new vBi.LinesSliceCharSequence([t],new CBi.Range(1,1,1,t.length),!1),new vBi.LinesSliceCharSequence([e],new CBi.Range(1,1,1,e.length),!1),r),s=0,c=ohc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Z_t.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(bBi,"areLinesSimilar");function fhc(t){if(t.length===0)return t;t.sort((0,AL.compareBy)(r=>r.original.startLineNumber,AL.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(fhc,"joinCloseConsecutiveMoves");function phc(t,e){let r=new $Le.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Nne,"__esModule",{value:!0});Nne.optimizeSequenceDiffs=mhc;Nne.removeShortMatches=Ahc;Nne.extendDiffsToEntireWordIfAppropriate=yhc;Nne.removeVeryShortMatchingLinesBetweenDiffs=_hc;Nne.removeVeryShortMatchingTextBetweenLongDiffs=vhc;var hhc=Sl(),yL=hd(),EL=hye();function mhc(t,e,r){let n=r;return n=TBi(t,e,n),n=TBi(t,e,n),n=ghc(t,e,n),n}a(mhc,"optimizeSequenceDiffs");function TBi(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(TBi,"joinSequenceDiffsByShifting");function ghc(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(IBi,"shiftDiffToBetterPosition");function Ahc(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 EL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(Ahc,"removeShortMatches");function yhc(t,e,r,n,o=!1){let s=EL.SequenceDiff.invert(r,t.length),c=[],l=new EL.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 EL.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 Ehc(r,c)}a(yhc,"extendDiffsToEntireWordIfAppropriate");function Ehc(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(Ehc,"mergeSequenceDiffs");function _hc(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(_hc,"removeVeryShortMatchingLinesBetweenDiffs");function vhc(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 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(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,hhc.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 yL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new yL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=EL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():EL.OffsetPair.zero,d?d.getStarts():EL.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(vhc,"removeVeryShortMatchingTextBetweenLongDiffs")});var RBi=I(X_t=>{"use strict";p();Object.defineProperty(X_t,"__esModule",{value:!0});X_t.LineSequence=void 0;var oDr=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:wBi(this.lines[e-1]),n=e===this.lines.length?0:wBi(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]}};X_t.LineSequence=oDr;function wBi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(nvt,"__esModule",{value:!0});nvt.DefaultLinesDiffComputer=void 0;var Chc=Sl(),kBi=rd(),rvt=$2(),PBi=hd(),DBi=eh(),evt=qT(),tvt=H2r(),One=G_t(),_L=hye(),bhc=mBi(),Shc=eDr(),Thc=SBi(),Mne=xBi(),NBi=RBi(),MBi=nDr(),sDr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new bhc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Shc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,Chc.equals)(e,r,(x,P)=>x===P))return new tvt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new tvt.LinesDiff([new One.DetailedLineRangeMapping(new rvt.LineRange(1,e.length+1),new rvt.LineRange(1,r.length+1),[new One.RangeMapping(new DBi.Range(1,1,e.length,e[e.length-1].length+1),new DBi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?_L.InfiniteTimeout.instance:new _L.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 NBi.LineSequence(u,e),h=new NBi.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,Mne.optimizeSequenceDiffs)(f,h,g),g=(0,Mne.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 evt.ArrayText(e),T=new evt.ArrayText(r),w=(0,One.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,kBi.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 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 tvt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,Thc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new _L.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,One.lineRangeMappingFromRangeMappings)(m.mappings,new evt.ArrayText(r),new evt.ArrayText(n),!0);return new tvt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=Ihc(n).toRangeMapping2(e,r),d=new MBi.LinesSliceCharSequence(e,u.originalRange,s),f=new MBi.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&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.optimizeSequenceDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&_L.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&_L.SequenceDiff.assertSorted(g)),g=(0,Mne.removeShortMatches)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g);let A=g.map(y=>new One.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&One.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};nvt.DefaultLinesDiffComputer=sDr;function Ihc(t){return new One.LineRangeMapping(new rvt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new rvt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(Ihc,"toLineRangeMapping")});var cDr=I(Fv=>{"use strict";p();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.EditDataWithIndex=Fv.maxImperfectAgreementLength=Fv.maxAgreementOffset=void 0;Fv.tryRebase=Phc;Fv.checkEditConsistency=LBi;Fv.tryRebaseStringEdits=Nhc;var xhc=iN(),whc=X_(),zE=kE(),gye=hd(),OBi=qT(),Rhc=aDr(),khc=!1;Fv.maxAgreementOffset=10;Fv.maxImperfectAgreementLength=5;var ivt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Fv.EditDataWithIndex=ivt;function Phc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Fv.maxImperfectAgreementLength}){let f=Date.now();try{return Dhc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${whc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Phc,"tryRebase");function Dhc(t,e,r,n,o,s,c,l,u,d){if(!LBi(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.lengthzE.AnnotatedStringEdit.create(E))),g=BBi(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=zE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new xhc.SingleEdits(r).apply(t)!==zE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Dhc,"_tryRebase");function LBi(t,e,r,n,o=khc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(LBi,"checkEditConsistency");function Nhc(t,e,r,n,o={maxImperfectAgreementLength:Fv.maxImperfectAgreementLength}){return BBi(t,e.mapData(s=>new zE.VoidEditData),r,n,o)?.toStringEdit()}a(Nhc,"tryRebaseStringEdits");function BBi(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 zE.AnnotatedStringReplacement(gye.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=Bhc(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 zE.AnnotatedStringReplacement(new gye.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(;uFv.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 zE.AnnotatedStringReplacement(gye.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 Lhc(t){return Ohc.has(t)}a(Lhc,"isAutoClosePair");function Bhc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uFv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&Lhc(l)&&Mhc(l,e.newText.substring(o))?o:-1}a(Bhc,"agreementIndexOf");function Fhc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new Rhc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new OBi.StringText(t),f=new OBi.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 zE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Fhc,"computeDiff")});var UBi=I(ovt=>{"use strict";p();Object.defineProperty(ovt,"__esModule",{value:!0});ovt.RejectionCollector=void 0;var Uhc=h4(),FBi=Ro(),Qhc=W2(),lDr=class extends FBi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new fDr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,Qhc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new uDr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Uhc.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,FBi.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()}};ovt.RejectionCollector=lDr;var uDr=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 dDr(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}},dDr=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()}},fDr=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 hDr=I(Aye=>{"use strict";p();Object.defineProperty(Aye,"__esModule",{value:!0});Aye.DisposablesLRUCache=Aye.LRUCache=void 0;var VLe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},svt=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 VLe("",null),this._tail=new VLe("",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 VLe(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}};Aye.LRUCache=svt;var pDr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new svt(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()}};Aye.DisposablesLRUCache=pDr});var QBi=I(cvt=>{"use strict";p();Object.defineProperty(cvt,"__esModule",{value:!0});cvt.RebaseFailureInfo=void 0;var qhc=kE(),mDr=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 qhc.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 = ${avt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${avt(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}), ${avt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${avt(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(` -`)}};cvt.RebaseFailureInfo=mDr;function avt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(avt,"toBacktickLiteral")});var jBi=I(uvt=>{"use strict";p();Object.defineProperty(uvt,"__esModule",{value:!0});uvt.NextEditCache=void 0;var WLe=Pl(),jhc=h4(),Hhc=hDr(),qBi=Ro(),Ghc=C8(),lvt=cDr(),$hc=QBi(),gDr=class extends qBi.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 Hhc.LRUCache(50),(0,Ghc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new ADr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,jhc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(WLe.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,qBi.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(WLe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(WLe.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(WLe.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()}};uvt.NextEditCache=gDr;var ADr=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,lvt.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,lvt.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,lvt.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 $hc.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,lvt.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 HBi=I(dvt=>{"use strict";p();Object.defineProperty(dvt,"__esModule",{value:!0});dvt.NextEditResult=void 0;var yDr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};dvt.NextEditResult=yDr});var GBi=I(fvt=>{"use strict";p();Object.defineProperty(fvt,"__esModule",{value:!0});fvt.SpeculativeRequestManager=void 0;var Vhc=Ro(),EDr=class extends Vhc.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 Whc=cI&&cI.__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},zLe=cI&&cI.__param||function(t,e){return function(r,n){e(r,n,t)}},_Dr;Object.defineProperty(cI,"__esModule",{value:!0});cI.NextEditFetchRequest=cI.NextEditProvider=cI.NesOutcome=void 0;var zhc=require("path"),y1=Pl(),yye=iN(),JLe=L_t(),YLe=py(),Yhc=Zft(),wp=nye(),Khc=h4(),vDr=Sp(),Jhc=rBi(),Zhc=lye(),Xhc=Q2r(),emc=mh(),KLe=X_(),YE=uw(),$Bi=rd(),pvt=nl(),tmc=WJe(),SDr=Rs(),hvt=Ro(),VBi=W2(),WBi=FO(),rmc=KS(),ZBi=T0(),zBi=NG(),Lne=kE(),nmc=q_(),CDr=hd(),YBi=qT(),imc=cDr(),omc=UBi(),smc=jBi(),mvt=HBi(),amc=GBi();function cmc(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 CDr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(cmc,"computeReducedWindow");function KBi(t,e){let n=new JLe.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r -`)?new Lne.StringEdit(n.replacements.map(o=>new Lne.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a(KBi,"convertLineEditToEdit");function JBi(t,e){return new tmc.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:Lne.StringEdit.empty,nextEdits:[],docId:n}}}throw new SDr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Lne.StringEdit.empty,nextEdits:[],docId:n}})}a(JBi,"createDocStateLookupMap");var ZLe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(ZLe||(cI.NesOutcome=ZLe={}));var bDr=_Dr=class extends hvt.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 omc.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 smc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new amc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,VBi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,VBi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,hvt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(y1.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 WBi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(vDr.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(KLe.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 SDr.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 mvt.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(y1.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new XLe(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 Q=q.val.rebasedEdit||q.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof wp.NoNextEditReason.FetchFailure||_ instanceof wp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof wp.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new mvt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof wp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new mvt.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(JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(h,new Lne.StringEdit([y.actualEdit])))),(0,$Bi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new mvt.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,pvt.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(y1.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,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=JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new wp.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 YE.Result.error(new wp.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{let B=await this._joinNextEditRequest(R,L,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let j=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(j.edit)return c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.ok(j.edit);this._logRebaseFailure(j.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.error(new wp.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 j=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(j.telemetry),j.nextEdit.isError()?j.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=e.log;if(this._debugRecorder){let B=this._debugRecorder.createBookmark();h.recordingBookmark=B,l.setRequestBookmark(B)}let m=lmc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new pvt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new wp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),m.idx,E,_,v,!1,h,h.recordingBookmark,A,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"),h.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,Khc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(q=>{b.intermediateUserEdit&&!q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(q),(0,imc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=JBi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,h,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),j=B.edit,Q=new zBi.LineEdit([j]),Y=KBi(Q,O.baseDocState).tryRebase(O.editsSoFar);if(Y===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(Y);let W;if(Y.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(Y.replacements.length>1)M.trace(`WARNING: ${D} has ${Y.replacements.length} edits, but expected only 1`);else{let V=Y.replacements[0];O.nextEdits.push(V),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,V,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?g?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),h.setResult(new JLe.RootedLineEdit(O.docContents,Q)),_.complete(W?YE.Result.ok(W):YE.Result.error(new wp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=Y.applyOnText(O.docContents),W},"processEdit"),L=a((B,q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof wp.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 wp.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:Y,window:W}=B,V=W?cmc(W,g,Y):void 0;this._nextEditCache.setNoNextEdit(d,Y,V,e)}_.isSettled||_.complete(YE.Result.error(B));let j=x.get(d).nextEdits.length>0?YE.Result.ok(void 0):YE.Result.error(B),Q=new wp.StatelessNextEditResult(j,q);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let B=await P.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 P.next();!B.done;){let j=B.value.v;N(j,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await P.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${KLe.ErrorUtils.toString(O)}`);let j=new wp.NoNextEditReason.Unexpected(KLe.ErrorUtils.fromUnknown(O));L(j,M)}})(),T=new wp.StatelessNextEditResult(YE.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new hvt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new pvt.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,hvt.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(y1.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(y1.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===YLe.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 Yhc.InlineEditRequestLogContext(n.uri,0,void 0),s=new WBi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(vDr.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 CDr.OffsetRange(d,d),h=[f],m=new yye.RootedEdit(r.documentBeforeEdits,new Lne.StringEdit([r.edit])),g=new YBi.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===YLe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=_Dr.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 XLe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,ZBi.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: ${KLe.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 YBi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Lne.StringEdit([l]),q=JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new wp.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),q,r.value.get(),yye.Edits.single(B),n);return{recentEdit:new yye.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 pvt.DeferredPromise,w=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,$Bi.assertNever)(w)}let x=new wp.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,zhc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Jhc.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=JBi(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(YE.Result.error(g.value.v)),e.setResult(new wp.StatelessNextEditResult(YE.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 zBi.LineEdit([E]),b=KBi(_,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(YE.Result.ok(w)),e.setResult(new wp.StatelessNextEditResult(YE.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(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new wp.StatelessNextEditResult(YE.Result.error(new wp.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: ${KLe.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=ZLe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=ZLe.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")}};cI.NextEditProvider=bDr;cI.NextEditProvider=bDr=_Dr=Whc([zLe(5,y1.IConfigurationService),zLe(6,Xhc.ISnippyService),zLe(7,vDr.ILogService),zLe(8,emc.IExperimentationService),zLe(9,Zhc.IRequestLogger)],bDr);function lmc(t){if(!t)throw new SDr.BugIndicatingError("expected value to be defined, but it was not");return t}a(lmc,"assertDefined");var XLe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,ZBi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};cI.NextEditFetchRequest=XLe});var e3i=I(eBe=>{"use strict";p();Object.defineProperty(eBe,"__esModule",{value:!0});eBe.parseGitRemotes=umc;eBe.toGitUri=dmc;eBe.getUpstreamRemote=fmc;var TDr=class t{static{a(this,"GitConfigParser")}static{this._lineSeparator=/\r?\n/}static{this._propertyRegex=/^\s*(\w+)\s*=\s*"?([^"]+)"?$/}static{this._sectionRegex=/^\s*\[\s*([^\]]+?)\s*(\"[^"]+\")*\]\s*$/}static parse(e){let r={sections:[]},n={name:"DEFAULT",properties:{}},o=a(s=>{s&&r.sections.push(s)},"addSection");for(let s of e.split(t._lineSeparator)){let c=s.match(t._sectionRegex);if(c?.length===3){o(n),n={name:c[1],subSectionName:c[2]?.replaceAll('"',""),properties:{}};continue}let l=s.match(t._propertyRegex);l?.length===3&&!Object.keys(n.properties).includes(l[1])&&(n.properties[l[1]]=l[2])}return o(n),r.sections}};function umc(t){let e=[];for(let r of TDr.parse(t).filter(n=>n.name==="remote"))r.subSectionName&&e.push({name:r.subSectionName,fetchUrl:r.properties.url,pushUrl:r.properties.pushurl??r.properties.url,isReadOnly:!1});return e}a(umc,"parseGitRemotes");function dmc(t,e,r={}){let n={path:t.fsPath,ref:e};r.submoduleOf&&(n.submoduleOf=r.submoduleOf);let o=t.path;return r.replaceFileExtension?o=`${o}.git`:r.submoduleOf&&(o=`${o}.diff`),t.with({scheme:r.scheme??"git",path:o,query:JSON.stringify(n)})}a(dmc,"toGitUri");function fmc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(fmc,"getUpstreamRemote")});var l3i=I(_h=>{"use strict";p();Object.defineProperty(_h,"__esModule",{value:!0});_h.GLOB_SPLIT=_h.GLOBSTAR=void 0;_h.getEmptyExpression=Amc;_h.splitGlobAware=wDr;_h.isEmptyPattern=Tmc;_h.match=kmc;_h.parse=s3i;_h.isRelativePattern=a3i;_h.getBasenameTerms=Pmc;_h.getPathTerms=Dmc;_h.patternsEquals=Omc;var pmc=Sl(),xDr=nl(),hmc=tHt(),mmc=zP(),$$=NA(),gmc=Rq(),tBe=em();function Amc(){return Object.create(null)}a(Amc,"getEmptyExpression");_h.GLOBSTAR="**";_h.GLOB_SPLIT="/";var gvt="[/\\\\]",Avt="[^/\\\\]",ymc=/\//g;function t3i(t,e){switch(t){case 0:return"";case 1:return`${Avt}*?`;default:return`(?:${gvt}|${Avt}+${gvt}${e?`|${gvt}${Avt}+`:""})*?`}}a(t3i,"starsToRegExp");function wDr(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(wDr,"splitGlobAware");function o3i(t){if(!t)return"";let e="",r=wDr(t,_h.GLOB_SPLIT);if(r.every(n=>n===_h.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===_h.GLOBSTAR){if(n)return;e+=t3i(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===_h.GLOB_SPLIT?h="":h=(0,tBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${wDr(l,",").map(g=>o3i(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Avt;continue;case"*":e+=t3i(1);continue;default:e+=(0,tBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?tBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,hmc.isEqualOrParent)(u,d,e.ignoreCase??!gmc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=r3i.get(s);if(c)return n3i(c,t,o);let l;return Emc.test(r)?c=Imc(r.substring(4),r,o):(l=_mc.exec(IDr(r,o)))?c=xmc(l[1],r,o):(e.trimForExclusions?Cmc:vmc).test(r)?c=wmc(r,o):(l=bmc.exec(IDr(r,o)))?c=i3i(l[1].substring(1),r,!0,o):(l=Smc.exec(IDr(r,o)))?c=i3i(l[1],r,!1,o):c=Rmc(r,o),r3i.set(s,c),n3i(c,t,o)}a(kDr,"parsePattern");function n3i(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,tBe.ltrim)(o.substring(e.base.length),$$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(n3i,"wrapRelativePattern");function IDr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(IDr,"trimForExclusions");function Imc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(Imc,"trivia1");function xmc(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(xmc,"trivia2");function wmc(t,e){let r=c3i(t.slice(1,-1).split(",").map(l=>kDr(l,e)).filter(l=>l!==aN),t),n=r.length;if(!n)return aN;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(wmc,"trivia3");function i3i(t,e,r,n){let o=$$.sep===$$.posix.sep,s=o?t:t.replace(ymc,$$.sep),c=$$.sep+s,l=$$.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(i3i,"trivia4and5");function Rmc(t,e){try{let r=new RegExp(`^${o3i(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return aN}}a(Rmc,"toRegExp");function kmc(t,e,r){return!t||typeof e!="string"?!1:s3i(t,r)(e)}a(kmc,"match");function s3i(t,e={}){if(!t)return RDr;if(typeof t=="string"||a3i(t)){let r=kDr(t,e);if(r===aN)return RDr;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 Nmc(t,e)}a(s3i,"parse");function a3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(a3i,"isRelativePattern");function Pmc(t){return t.allBasenames||[]}a(Pmc,"getBasenameTerms");function Dmc(t){return t.allPaths||[]}a(Dmc,"getPathTerms");function Nmc(t,e){let r=c3i(Object.getOwnPropertyNames(t).map(l=>Mmc(l,t[l],e)).filter(l=>l!==aN)),n=r.length;if(!n)return aN;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(Nmc,"parsedExpression");function Mmc(t,e,r){if(e===!1)return aN;let n=kDr(t,r);if(n===aN)return aN;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,xDr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Mmc,"parseExpressionPattern");function c3i(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(c3i,"aggregateBasenameMatches");function Omc(t,e){return(0,pmc.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(Omc,"patternsEquals")});var Evt=I(Ol=>{"use strict";p();var Lmc=Ol&&Ol.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bmc=Ol&&Ol.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fmc=Ol&&Ol.__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,u3i.isEqual)(r.uri,t)||r.uri.path===t.path||DDr(t,r))}a(PDr,"findNotebook");function DDr(t,e){if(t.scheme===rBe.Schemas.vscodeNotebookCell||t.scheme===rBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,u3i.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(DDr,"findCell");function Umc(t,e){if(t.scheme!==rBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=d3i(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(Umc,"getNotebookCellOutput");function d3i(t,e){let r=PDr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=DDr(t,r);return n===void 0?[r,void 0]:[r,n]}a(d3i,"getNotebookAndCellFromUri");function Qmc(t){return t.scheme===rBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Qmc,"isNotebookCellOrNotebookChatInput");function qmc(t){return t.scheme===rBe.Schemas.vscodeNotebookCell}a(qmc,"isNotebookCell");function jmc(t){return t.path.endsWith(".ipynb")}a(jmc,"isJupyterNotebookUri");function Hmc(t){return t.notebookType==="jupyter-notebook"}a(Hmc,"isJupyterNotebook");function Gmc(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(Gmc,"serializeNotebookDocument");function $mc(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($mc,"extractNotebookOutline");function f3i(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||h3i(e.include))}a(f3i,"isDocumentExcludePattern");function p3i(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(p3i,"isFilenamePattern");function h3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(h3i,"isRelativePattern");function Vmc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(Vmc,"isNotebookEditorContribution");function Wmc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Wmc,"extractEditorAssociation");function m3i(t,e){if(typeof e=="string"&&Eye.match(e.toLowerCase(),(0,_ye.basename)(t.fsPath).toLowerCase()))return!0;if(f3i(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Eye.match(r,(0,_ye.basename)(t.fsPath).toLowerCase()))return!(n&&Eye.match(n,(0,_ye.basename)(t.fsPath).toLowerCase()))}return p3i(e)&&Eye.match(e.filenamePattern,(0,_ye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Eye.match(e.excludeFileNamePattern,(0,_ye.basename)(t.fsPath).toLowerCase())):!1}a(m3i,"notebookSelectorMatches");function g3i(t,e){let r=[];for(let n of e)n.filenamePattern&&Eye.match(n.filenamePattern.toLowerCase(),(0,_ye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(g3i,"getNotebookEditorAssociations");function zmc(t,e,r,n){if(PDr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>m3i(t,l)));if(o.length===0)return!1;let s=g3i(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??yvt.default)===yvt.default)}a(zmc,"_hasSupportedNotebooks")});var C3i=I(M0=>{"use strict";p();var Ymc=M0&&M0.__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},Kmc=M0&&M0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M0,"__esModule",{value:!0});M0.TelemetrySender=M0.NextEditProviderTelemetryBuilder=M0.DiagnosticsTelemetryBuilder=M0.LlmNESTelemetryBuilder=M0.NES_GH_TELEMETRY_EVENT_NAME=void 0;var A3i=jR(),y3i=e3i(),Jmc=h4(),v3i=gm(),Zmc=Evt(),Xmc=nl(),_vt=Ro(),e0c=tJ(),E3i=C8(),_3i=P0();M0.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var vvt=class extends _vt.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===e0c.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,Zmc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(_3i.Uri.parse(g.id.uri));if(y){let v=(0,y3i.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(_3i.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?(0,y3i.getUpstreamRemote)(v):void 0;b?.fetchUrl&&E.add(b.fetchUrl),b?.pushUrl&&E.add(b.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}setRequestBookmark(e){this._requestBookmark=e}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,Jmc.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}};M0.LlmNESTelemetryBuilder=vvt;var Cvt=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}};M0.DiagnosticsTelemetryBuilder=Cvt;var NDr=class t extends _vt.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 vvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new Cvt}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}};M0.NextEditProviderTelemetryBuilder=NDr;var MDr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new _vt.DisposableStore,this._disposalTracker=new _vt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new Xmc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,E3i.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,E3i.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()}},ODr=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 MDr(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:L,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:V,isInlineSuggestion:z,debounceTime:ie,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,notebookId:ge,notebookCellLines:Ue,nextEditLogprob:ke,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:Z,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ne,diagnosticDroppedReasons:ce,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:_t,hadDiagnosticsNES:Dt,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Qe}=e,pe,Se,Fe,te;if(Z!==void 0){let{response:Te,ttft:Ge,fetchResult:J,fetchTime:se}=await Z;Te.type===A3i.ChatFetchResponseType.Success&&(pe=Te.usage),Se=Ge,Fe=J,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Fe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:ce,pickedNES:Gt,notebookType:b,notebookId:ge,notebookCellLines:Ue,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,modelConfig:Qe,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:le>0?1:0,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum(V),isInlineSuggestion:this._boolToNum(z),debounceTime:ie,artificialDelay:H,fetchStartedAfterMs:he,ttft:Se,fetchTime:te,promptTokens:pe?.prompt_tokens,responseTokens:pe?.completion_tokens,cachedTokens:pe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:pe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:pe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ke,hadDiagnosticsNES:this._boolToNum(Dt),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(_t),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(M0.NES_GH_TELEMETRY_EVENT_NAME,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(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(M0.NES_GH_TELEMETRY_EVENT_NAME,(0,v3i.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==A3i.ChatFetchResponseType.Success?void 0:x.response.value,fetchResult:D,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)}};M0.TelemetrySender=ODr;M0.TelemetrySender=ODr=Ymc([Kmc(1,v3i.ITelemetryService)],ODr)});var BDr=I(vye=>{"use strict";p();Object.defineProperty(vye,"__esModule",{value:!0});vye.NullPowerService=vye.IPowerService=void 0;var b3i=Ic(),t0c=Gs();vye.IPowerService=(0,t0c.createDecorator)("IPowerService");var LDr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=b3i.Event.None,this.onDidResume=b3i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};vye.NullPowerService=LDr});var K6=I(V$=>{"use strict";p();Object.defineProperty(V$,"__esModule",{value:!0});V$.FetchStreamRecorder=V$.FetchStreamSource=V$.IChatMLFetcher=void 0;var r0c=nn(),n0c=nl();V$.IChatMLFetcher=(0,r0c.createServiceIdentifier)("IChatMLFetcher");var FDr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new n0c.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)}};V$.FetchStreamSource=FDr;var UDr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}get outputChunkGapsMs(){return this._outputChunkGapsMs}constructor(e){this.deltas=[],this._outputChunkGapsMs=[],this.callback=async(r,n,o)=>{if(!!(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)){let l=Date.now();this._firstTokenEmittedTime===void 0?this._firstTokenEmittedTime=l:this._lastOutputChunkTime!==void 0&&this._outputChunkGapsMs.push(l-this._lastOutputChunkTime),this._lastOutputChunkTime=l}let c=e?await e(r,n,o):void 0;return this.deltas.push(o),c}}};V$.FetchStreamRecorder=UDr});var QDr=I(bvt=>{"use strict";p();Object.defineProperty(bvt,"__esModule",{value:!0});bvt.IChatQuotaService=void 0;var i0c=nn();bvt.IChatQuotaService=(0,i0c.createServiceIdentifier)("IChatQuotaService")});var qDr=I(Svt=>{"use strict";p();Object.defineProperty(Svt,"__esModule",{value:!0});Svt.IConversationOptions=void 0;var o0c=nn();Svt.IConversationOptions=(0,o0c.createServiceIdentifier)("ConversationOptions")});var nBe=I(Cye=>{"use strict";p();Object.defineProperty(Cye,"__esModule",{value:!0});Cye.getTextPart=a0c;Cye.toTextPart=S3i;Cye.toTextParts=c0c;Cye.roleToString=l0c;var Bne=Io(),s0c=rd();function a0c(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Bne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Bne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(a0c,"getTextPart");function S3i(t){return{type:Bne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(S3i,"toTextPart");function c0c(t){return[S3i(t)]}a(c0c,"toTextParts");function l0c(t){switch(t){case Bne.Raw.ChatRole.System:return"system";case Bne.Raw.ChatRole.User:return"user";case Bne.Raw.ChatRole.Assistant:return"assistant";case Bne.Raw.ChatRole.Tool:return"tool";default:(0,s0c.assertNever)(t,`unknown role (${t})`)}}a(l0c,"roleToString")});var HDr=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.InteractionService=bye.IInteractionService=void 0;var u0c=nn(),T3i=T0();bye.IInteractionService=(0,u0c.createServiceIdentifier)("IInteractionService");var jDr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,T3i.generateUuid)()}startInteraction(){this._interactionId=(0,T3i.generateUuid)()}get interactionId(){return this._interactionId}};bye.InteractionService=jDr});var $Dr=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.SSEParser=void 0;var GDr=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(gL,"__esModule",{value:!0});gL.PendingLoggedChatRequest=gL.IRequestLogger=gL.ChatRequestScheme=void 0;gL.resolveMarkdownContent=uhc;gL.resolveMarkdownIcon=dhc;var gBi=GR(),chc=nn(),lhc=gd(),Q2r=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 lhc.OffsetRange(n.index,n.index+o.length)}})}};gL.ChatRequestScheme=Q2r;gL.IRequestLogger=(0,chc.createServiceIdentifier)("IRequestLogger");function uhc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(uhc,"resolveMarkdownContent");function dhc(t){return typeof t.icon=="function"?t.icon():t.icon}a(dhc,"resolveMarkdownIcon");var q2r=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})}},j2r=class extends q2r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===gBi.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===gBi.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})}};gL.PendingLoggedChatRequest=j2r});var G2r=I(fye=>{"use strict";p();Object.defineProperty(fye,"__esModule",{value:!0});fye.NullSnippyService=fye.ISnippyService=void 0;var fhc=nn();fye.ISnippyService=(0,fhc.createServiceIdentifier)("ISnippyService");var H2r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};fye.NullSnippyService=H2r});var W2r=I(pye=>{"use strict";p();Object.defineProperty(pye,"__esModule",{value:!0});pye.MovedText=pye.LinesDiff=void 0;var $2r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};pye.LinesDiff=$2r;var V2r=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()))}};pye.MovedText=V2r});var z_t=I(lN=>{"use strict";p();Object.defineProperty(lN,"__esModule",{value:!0});lN.RangeMapping=lN.DetailedLineRangeMapping=lN.LineRangeMapping=void 0;lN.lineRangeMappingFromRangeMappings=hhc;lN.getLineRangeMapping=_Bi;lN.lineRangeMappingFromChange=mhc;var phc=Tl(),ABi=nd(),W_t=Rs(),g1=z2(),cN=j_(),AL=rh(),EBi=E5e(),$Le=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 g1.LineRange(s,u.original.startLineNumber),new g1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new g1.LineRange(s,r+1),new g1.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 J6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new W_t.BugIndicatingError("not a valid diff");return new J6(new AL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new AL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new J6(new AL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new AL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(yBi(this.original.endLineNumberExclusive,e)&&yBi(this.modified.endLineNumberExclusive,r))return new J6(new AL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new AL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new J6(AL.Range.fromPositions(new cN.Position(this.original.startLineNumber,1),hye(new cN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),AL.Range.fromPositions(new cN.Position(this.modified.startLineNumber,1),hye(new cN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new J6(AL.Range.fromPositions(hye(new cN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),hye(new cN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),AL.Range.fromPositions(hye(new cN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),hye(new cN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new W_t.BugIndicatingError}};lN.LineRangeMapping=$Le;function hye(t,e){if(t.lineNumber<1)return new cN.Position(1,1);if(t.lineNumber>e.length)return new cN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new cN.Position(t.lineNumber,r.length+1):t}a(hye,"normalizePosition");function yBi(t,e){return t>=1&&t<=e.length}a(yBi,"isValidLineNumber");var VLe=class t extends $Le{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 EBi.TextEdit(n)}static fromRangeMappings(e){let r=g1.LineRange.join(e.map(o=>g1.LineRange.fromRangeInclusive(o.originalRange))),n=g1.LineRange.join(e.map(o=>g1.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()])}};lN.DetailedLineRangeMapping=VLe;var J6=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 W_t.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 EBi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};lN.RangeMapping=J6;function hhc(t,e,r,n=!1){let o=[];for(let s of(0,phc.groupAdjacentBy)(t.map(c=>_Bi(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 VLe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,ABi.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,ABi.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 g1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new g1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new VLe(s,c,[t])}a(_Bi,"getLineRangeMapping");function mhc(t){let e;t.originalEndLineNumber===0?e=new g1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new g1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new g1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new g1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new $Le(e,r)}a(mhc,"lineRangeMappingFromChange")});var gye=I($R=>{"use strict";p();Object.defineProperty($R,"__esModule",{value:!0});$R.DateTimeout=$R.InfiniteTimeout=$R.OffsetPair=$R.SequenceDiff=$R.DiffAlgorithmResult=void 0;var ghc=Tl(),vBi=Rs(),mye=gd(),z2r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new WLe(mye.OffsetRange.ofLength(e.length),mye.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new WLe(mye.OffsetRange.ofLength(e.length),mye.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};$R.DiffAlgorithmResult=z2r;var WLe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,ghc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Dne.zero,s?s.getStarts():new Dne(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new mye.OffsetRange(e.offset1,r.offset1),new mye.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 vBi.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 Dne(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Dne(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};$R.SequenceDiff=WLe;var Dne=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}};$R.OffsetPair=Dne;var Y2r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};$R.InfiniteTimeout=Y2r;var K2r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new vBi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};$R.DateTimeout=K2r});var Y_t=I(Nne=>{"use strict";p();Object.defineProperty(Nne,"__esModule",{value:!0});Nne.LineRangeFragment=Nne.Array2D=void 0;Nne.isSpace=Ahc;var J2r=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}};Nne.Array2D=J2r;function Ahc(t){return t===32||t===9}a(Ahc,"isSpace");var Z2r=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(K_t,"__esModule",{value:!0});K_t.DynamicProgrammingDiffing=void 0;var CBi=gd(),zLe=gye(),X2r=Y_t(),eDr=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=zLe.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return zLe.DiffAlgorithmResult.trivial(e,r);let s=new X2r.Array2D(e.length,r.length),c=new X2r.Array2D(e.length,r.length),l=new X2r.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 zLe.SequenceDiff(new CBi.OffsetRange(A+1,d),new CBi.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 zLe.DiffAlgorithmResult(u,!1)}};K_t.DynamicProgrammingDiffing=eDr});var iDr=I(Z_t=>{"use strict";p();Object.defineProperty(Z_t,"__esModule",{value:!0});Z_t.MyersDiffAlgorithm=void 0;var SBi=gd(),YLe=gye(),tDr=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=YLe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return YLe.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 J_t(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 YLe.SequenceDiff(new SBi.OffsetRange(y,g),new SBi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new YLe.DiffAlgorithmResult(m,!1)}};Z_t.MyersDiffAlgorithm=tDr;var J_t=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},rDr=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}}},nDr=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 aDr=I(evt=>{"use strict";p();Object.defineProperty(evt,"__esModule",{value:!0});evt.LinesSliceCharSequence=void 0;var oDr=kq(),X_t=gd(),yhc=j_(),TBi=rh(),Ehc=Y_t(),sDr=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=wBi(e>0?this.elements[e-1]:-1),n=wBi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new yhc.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)?TBi.Range.fromPositions(n,n):TBi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!Aye(this.elements[e]))return;let r=e;for(;r>0&&Aye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!Aye(this.elements[e]))return;let r=e;for(;r>0&&Aye(this.elements[r-1])&&!IBi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,oDr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new X_t.OffsetRange(r,n)}};evt.LinesSliceCharSequence=sDr;function Aye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(Aye,"isWordChar");function IBi(t){return t>=65&&t<=90}a(IBi,"isUpperCase");var _hc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function xBi(t){return _hc[t]}a(xBi,"getCategoryBoundaryScore");function wBi(t){return t===10?8:t===13?7:(0,Ehc.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(wBi,"getCategory")});var DBi=I(cDr=>{"use strict";p();Object.defineProperty(cDr,"__esModule",{value:!0});cDr.computeMovedLines=Shc;var vhc=gye(),tvt=z_t(),yL=Tl(),KLe=kq(),Chc=KP(),A1=z2(),RBi=aDr(),rvt=Y_t(),bhc=iDr(),kBi=rh();function Shc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=Ihc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=xhc(u,n,o,e,r,s);return(0,yL.pushMany)(c,d),c=whc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&Thc(h,g=>g.length>=2)>=2}),c=Rhc(t,c),c}a(Shc,"computeMovedLines");function Thc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Thc,"countWhere");function Ihc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new rvt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new rvt.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 tvt.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(Ihc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function xhc(t,e,r,n,o,s){let c=[],l=new Chc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,yL.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 A1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new A1.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,yL.reverseOrder)((0,yL.compareBy)(m=>m.modifiedLineRange.length,yL.numberComparator)));let d=new A1.LineRangeSet,f=new A1.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 tvt.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,yL.compareBy)(m=>m.original.startLineNumber,yL.numberComparator));let h=new KLe.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,KLe.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)||!PBi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new A1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new A1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!PBi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new A1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new A1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new tvt.LineRangeMapping(new A1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new A1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(xhc,"computeUnchangedMoves");function PBi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new bhc.MyersDiffAlgorithm().compute(new RBi.LinesSliceCharSequence([t],new kBi.Range(1,1,1,t.length),!1),new RBi.LinesSliceCharSequence([e],new kBi.Range(1,1,1,e.length),!1),r),s=0,c=vhc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,rvt.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(PBi,"areLinesSimilar");function whc(t){if(t.length===0)return t;t.sort((0,yL.compareBy)(r=>r.original.startLineNumber,yL.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(whc,"joinCloseConsecutiveMoves");function Rhc(t,e){let r=new KLe.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Mne,"__esModule",{value:!0});Mne.optimizeSequenceDiffs=Phc;Mne.removeShortMatches=Nhc;Mne.extendDiffsToEntireWordIfAppropriate=Mhc;Mne.removeVeryShortMatchingLinesBetweenDiffs=Lhc;Mne.removeVeryShortMatchingTextBetweenLongDiffs=Bhc;var khc=Tl(),EL=gd(),_L=gye();function Phc(t,e,r){let n=r;return n=NBi(t,e,n),n=NBi(t,e,n),n=Dhc(t,e,n),n}a(Phc,"optimizeSequenceDiffs");function NBi(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(NBi,"joinSequenceDiffsByShifting");function Dhc(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(MBi,"shiftDiffToBetterPosition");function Nhc(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 _L.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(Nhc,"removeShortMatches");function Mhc(t,e,r,n,o=!1){let s=_L.SequenceDiff.invert(r,t.length),c=[],l=new _L.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 _L.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 Ohc(r,c)}a(Mhc,"extendDiffsToEntireWordIfAppropriate");function Ohc(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(Ohc,"mergeSequenceDiffs");function Lhc(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(Lhc,"removeVeryShortMatchingLinesBetweenDiffs");function Bhc(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 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(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,khc.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 EL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new EL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=_L.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():_L.OffsetPair.zero,d?d.getStarts():_L.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(Bhc,"removeVeryShortMatchingTextBetweenLongDiffs")});var BBi=I(nvt=>{"use strict";p();Object.defineProperty(nvt,"__esModule",{value:!0});nvt.LineSequence=void 0;var lDr=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:LBi(this.lines[e-1]),n=e===this.lines.length?0:LBi(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]}};nvt.LineSequence=lDr;function LBi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(avt,"__esModule",{value:!0});avt.DefaultLinesDiffComputer=void 0;var Fhc=Tl(),FBi=nd(),svt=z2(),UBi=gd(),QBi=rh(),ivt=HT(),ovt=W2r(),Lne=z_t(),vL=gye(),Uhc=bBi(),Qhc=iDr(),qhc=DBi(),One=OBi(),qBi=BBi(),jBi=aDr(),uDr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new Uhc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Qhc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,Fhc.equals)(e,r,(x,P)=>x===P))return new ovt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new ovt.LinesDiff([new Lne.DetailedLineRangeMapping(new svt.LineRange(1,e.length+1),new svt.LineRange(1,r.length+1),[new Lne.RangeMapping(new QBi.Range(1,1,e.length,e[e.length-1].length+1),new QBi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?vL.InfiniteTimeout.instance:new vL.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 qBi.LineSequence(u,e),h=new qBi.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,One.optimizeSequenceDiffs)(f,h,g),g=(0,One.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 ivt.ArrayText(e),T=new ivt.ArrayText(r),w=(0,Lne.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,FBi.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 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 ovt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,qhc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new vL.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Lne.lineRangeMappingFromRangeMappings)(m.mappings,new ivt.ArrayText(r),new ivt.ArrayText(n),!0);return new ovt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=jhc(n).toRangeMapping2(e,r),d=new jBi.LinesSliceCharSequence(e,u.originalRange,s),f=new jBi.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&&vL.SequenceDiff.assertSorted(g),g=(0,One.optimizeSequenceDiffs)(d,f,g),m&&vL.SequenceDiff.assertSorted(g),g=(0,One.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&vL.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,One.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&vL.SequenceDiff.assertSorted(g)),g=(0,One.removeShortMatches)(d,f,g),m&&vL.SequenceDiff.assertSorted(g),g=(0,One.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&vL.SequenceDiff.assertSorted(g);let A=g.map(y=>new Lne.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Lne.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};avt.DefaultLinesDiffComputer=uDr;function jhc(t){return new Lne.LineRangeMapping(new svt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new svt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(jhc,"toLineRangeMapping")});var fDr=I(Qv=>{"use strict";p();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.EditDataWithIndex=Qv.maxImperfectAgreementLength=Qv.maxAgreementOffset=void 0;Qv.tryRebase=Whc;Qv.checkEditConsistency=GBi;Qv.tryRebaseStringEdits=Yhc;var Hhc=aN(),Ghc=tv(),YE=PE(),yye=gd(),HBi=HT(),$hc=dDr(),Vhc=!1;Qv.maxAgreementOffset=10;Qv.maxImperfectAgreementLength=5;var cvt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Qv.EditDataWithIndex=cvt;function Whc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Qv.maxImperfectAgreementLength}){let f=Date.now();try{return zhc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${Ghc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Whc,"tryRebase");function zhc(t,e,r,n,o,s,c,l,u,d){if(!GBi(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.lengthYE.AnnotatedStringEdit.create(E))),g=$Bi(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=YE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new Hhc.SingleEdits(r).apply(t)!==YE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(zhc,"_tryRebase");function GBi(t,e,r,n,o=Vhc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(GBi,"checkEditConsistency");function Yhc(t,e,r,n,o={maxImperfectAgreementLength:Qv.maxImperfectAgreementLength}){return $Bi(t,e.mapData(s=>new YE.VoidEditData),r,n,o)?.toStringEdit()}a(Yhc,"tryRebaseStringEdits");function $Bi(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 YE.AnnotatedStringReplacement(yye.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=Xhc(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 YE.AnnotatedStringReplacement(new yye.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(;uQv.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 YE.AnnotatedStringReplacement(yye.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 Zhc(t){return Jhc.has(t)}a(Zhc,"isAutoClosePair");function Xhc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uQv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&Zhc(l)&&Khc(l,e.newText.substring(o))?o:-1}a(Xhc,"agreementIndexOf");function emc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new $hc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new HBi.StringText(t),f=new HBi.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 YE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(emc,"computeDiff")});var WBi=I(lvt=>{"use strict";p();Object.defineProperty(lvt,"__esModule",{value:!0});lvt.RejectionCollector=void 0;var tmc=m4(),VBi=ko(),rmc=K2(),pDr=class extends VBi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new gDr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,rmc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new hDr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,tmc.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,VBi.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()}};lvt.RejectionCollector=pDr;var hDr=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 mDr(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}},mDr=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()}},gDr=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 yDr=I(Eye=>{"use strict";p();Object.defineProperty(Eye,"__esModule",{value:!0});Eye.DisposablesLRUCache=Eye.LRUCache=void 0;var JLe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},uvt=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 JLe("",null),this._tail=new JLe("",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 JLe(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}};Eye.LRUCache=uvt;var ADr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new uvt(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()}};Eye.DisposablesLRUCache=ADr});var zBi=I(fvt=>{"use strict";p();Object.defineProperty(fvt,"__esModule",{value:!0});fvt.RebaseFailureInfo=void 0;var nmc=PE(),EDr=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 nmc.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 = ${dvt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${dvt(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}), ${dvt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${dvt(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(` +`)}};fvt.RebaseFailureInfo=EDr;function dvt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(dvt,"toBacktickLiteral")});var KBi=I(hvt=>{"use strict";p();Object.defineProperty(hvt,"__esModule",{value:!0});hvt.NextEditCache=void 0;var ZLe=Dl(),imc=m4(),omc=yDr(),YBi=ko(),smc=S8(),pvt=fDr(),amc=zBi(),_Dr=class extends YBi.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 omc.LRUCache(50),(0,smc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new vDr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,imc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(ZLe.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,YBi.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(ZLe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(ZLe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(ZLe.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(ZLe.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()}};hvt.NextEditCache=_Dr;var vDr=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,pvt.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,pvt.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,pvt.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 amc.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,pvt.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 JBi=I(mvt=>{"use strict";p();Object.defineProperty(mvt,"__esModule",{value:!0});mvt.NextEditResult=void 0;var CDr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};mvt.NextEditResult=CDr});var ZBi=I(gvt=>{"use strict";p();Object.defineProperty(gvt,"__esModule",{value:!0});gvt.SpeculativeRequestManager=void 0;var cmc=ko(),bDr=class extends cmc.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 lmc=uI&&uI.__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},XLe=uI&&uI.__param||function(t,e){return function(r,n){e(r,n,t)}},SDr;Object.defineProperty(uI,"__esModule",{value:!0});uI.NextEditFetchRequest=uI.NextEditProvider=uI.NesOutcome=void 0;var umc=require("path"),y1=Dl(),_ye=aN(),rBe=Q_t(),eBe=hy(),dmc=rpt(),kp=oye(),fmc=m4(),TDr=Ip(),pmc=uBi(),hmc=dye(),mmc=G2r(),gmc=Ah(),tBe=tv(),KE=fw(),XBi=nd(),Avt=nl(),Amc=XJe(),wDr=Rs(),yvt=ko(),e3i=K2(),t3i=QO(),ymc=ZS(),s3i=I0(),r3i=BG(),Bne=PE(),Emc=j_(),IDr=gd(),n3i=HT(),_mc=fDr(),vmc=WBi(),Cmc=KBi(),Evt=JBi(),bmc=ZBi();function Smc(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 IDr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Smc,"computeReducedWindow");function i3i(t,e){let n=new rBe.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r +`)?new Bne.StringEdit(n.replacements.map(o=>new Bne.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r +`)))):n}a(i3i,"convertLineEditToEdit");function o3i(t,e){return new Amc.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:Bne.StringEdit.empty,nextEdits:[],docId:n}}}throw new wDr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Bne.StringEdit.empty,nextEdits:[],docId:n}})}a(o3i,"createDocStateLookupMap");var nBe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(nBe||(uI.NesOutcome=nBe={}));var xDr=SDr=class extends yvt.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 vmc.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 Cmc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new bmc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,e3i.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,e3i.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,yvt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(y1.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 t3i.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(TDr.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(tBe.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 wDr.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 Evt.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(y1.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new iBe(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 Q=q.val.rebasedEdit||q.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof kp.NoNextEditReason.FetchFailure||_ instanceof kp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof kp.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new Evt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof kp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new Evt.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(rBe.RootedLineEdit.fromEdit(new _ye.RootedEdit(h,new Bne.StringEdit([y.actualEdit])))),(0,XBi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new Evt.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,Avt.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(y1.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,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=rBe.RootedLineEdit.fromEdit(new _ye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new kp.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 KE.Result.error(new kp.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{let B=await this._joinNextEditRequest(R,L,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let j=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(j.edit)return c.setStatelessNextEditTelemetry(B.telemetry),KE.Result.ok(j.edit);this._logRebaseFailure(j.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),KE.Result.error(new kp.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 j=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(j.telemetry),j.nextEdit.isError()?j.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=e.log;if(this._debugRecorder){let B=this._debugRecorder.createBookmark();h.recordingBookmark=B,l.setRequestBookmark(B)}let m=Tmc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new Avt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new kp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),m.idx,E,_,v,!1,h,h.recordingBookmark,A,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"),h.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,fmc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(q=>{b.intermediateUserEdit&&!q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(q),(0,_mc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=o3i(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,h,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),j=B.edit,Q=new r3i.LineEdit([j]),Y=i3i(Q,O.baseDocState).tryRebase(O.editsSoFar);if(Y===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(KE.Result.error(new kp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(Y);let W;if(Y.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(Y.replacements.length>1)M.trace(`WARNING: ${D} has ${Y.replacements.length} edits, but expected only 1`);else{let V=Y.replacements[0];O.nextEdits.push(V),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,V,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?g?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),h.setResult(new rBe.RootedLineEdit(O.docContents,Q)),_.complete(W?KE.Result.ok(W):KE.Result.error(new kp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=Y.applyOnText(O.docContents),W},"processEdit"),L=a((B,q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof kp.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 kp.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:Y,window:W}=B,V=W?Smc(W,g,Y):void 0;this._nextEditCache.setNoNextEdit(d,Y,V,e)}_.isSettled||_.complete(KE.Result.error(B));let j=x.get(d).nextEdits.length>0?KE.Result.ok(void 0):KE.Result.error(B),Q=new kp.StatelessNextEditResult(j,q);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let B=await P.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 P.next();!B.done;){let j=B.value.v;N(j,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await P.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${tBe.ErrorUtils.toString(O)}`);let j=new kp.NoNextEditReason.Unexpected(tBe.ErrorUtils.fromUnknown(O));L(j,M)}})(),T=new kp.StatelessNextEditResult(KE.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new yvt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Avt.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,yvt.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(y1.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(y1.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===eBe.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 dmc.InlineEditRequestLogContext(n.uri,0,void 0),s=new t3i.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(TDr.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 IDr.OffsetRange(d,d),h=[f],m=new _ye.RootedEdit(r.documentBeforeEdits,new Bne.StringEdit([r.edit])),g=new n3i.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(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===eBe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=SDr.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 iBe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,s3i.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: ${tBe.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 n3i.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Bne.StringEdit([l]),q=rBe.RootedLineEdit.fromEdit(new _ye.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new kp.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),q,r.value.get(),_ye.Edits.single(B),n);return{recentEdit:new _ye.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 Avt.DeferredPromise,w=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case eBe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case eBe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case eBe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,XBi.assertNever)(w)}let x=new kp.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,umc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new pmc.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=o3i(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(KE.Result.error(g.value.v)),e.setResult(new kp.StatelessNextEditResult(KE.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 r3i.LineEdit([E]),b=i3i(_,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(KE.Result.ok(w)),e.setResult(new kp.StatelessNextEditResult(KE.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(KE.Result.error(new kp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new kp.StatelessNextEditResult(KE.Result.error(new kp.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: ${tBe.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=nBe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=nBe.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")}};uI.NextEditProvider=xDr;uI.NextEditProvider=xDr=SDr=lmc([XLe(5,y1.IConfigurationService),XLe(6,mmc.ISnippyService),XLe(7,TDr.ILogService),XLe(8,gmc.IExperimentationService),XLe(9,hmc.IRequestLogger)],xDr);function Tmc(t){if(!t)throw new wDr.BugIndicatingError("expected value to be defined, but it was not");return t}a(Tmc,"assertDefined");var iBe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,s3i.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};uI.NextEditFetchRequest=iBe});var c3i=I(oBe=>{"use strict";p();Object.defineProperty(oBe,"__esModule",{value:!0});oBe.parseGitRemotes=Imc;oBe.toGitUri=xmc;oBe.getUpstreamRemote=wmc;var RDr=class t{static{a(this,"GitConfigParser")}static{this._lineSeparator=/\r?\n/}static{this._propertyRegex=/^\s*(\w+)\s*=\s*"?([^"]+)"?$/}static{this._sectionRegex=/^\s*\[\s*([^\]]+?)\s*(\"[^"]+\")*\]\s*$/}static parse(e){let r={sections:[]},n={name:"DEFAULT",properties:{}},o=a(s=>{s&&r.sections.push(s)},"addSection");for(let s of e.split(t._lineSeparator)){let c=s.match(t._sectionRegex);if(c?.length===3){o(n),n={name:c[1],subSectionName:c[2]?.replaceAll('"',""),properties:{}};continue}let l=s.match(t._propertyRegex);l?.length===3&&!Object.keys(n.properties).includes(l[1])&&(n.properties[l[1]]=l[2])}return o(n),r.sections}};function Imc(t){let e=[];for(let r of RDr.parse(t).filter(n=>n.name==="remote"))r.subSectionName&&e.push({name:r.subSectionName,fetchUrl:r.properties.url,pushUrl:r.properties.pushurl??r.properties.url,isReadOnly:!1});return e}a(Imc,"parseGitRemotes");function xmc(t,e,r={}){let n={path:t.fsPath,ref:e};r.submoduleOf&&(n.submoduleOf=r.submoduleOf);let o=t.path;return r.replaceFileExtension?o=`${o}.git`:r.submoduleOf&&(o=`${o}.diff`),t.with({scheme:r.scheme??"git",path:o,query:JSON.stringify(n)})}a(xmc,"toGitUri");function wmc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(wmc,"getUpstreamRemote")});var A3i=I(Ch=>{"use strict";p();Object.defineProperty(Ch,"__esModule",{value:!0});Ch.GLOB_SPLIT=Ch.GLOBSTAR=void 0;Ch.getEmptyExpression=Nmc;Ch.splitGlobAware=DDr;Ch.isEmptyPattern=qmc;Ch.match=Vmc;Ch.parse=h3i;Ch.isRelativePattern=m3i;Ch.getBasenameTerms=Wmc;Ch.getPathTerms=zmc;Ch.patternsEquals=Jmc;var Rmc=Tl(),PDr=nl(),kmc=oHt(),Pmc=KP(),Y$=MA(),Dmc=Dq(),sBe=rm();function Nmc(){return Object.create(null)}a(Nmc,"getEmptyExpression");Ch.GLOBSTAR="**";Ch.GLOB_SPLIT="/";var _vt="[/\\\\]",vvt="[^/\\\\]",Mmc=/\//g;function l3i(t,e){switch(t){case 0:return"";case 1:return`${vvt}*?`;default:return`(?:${_vt}|${vvt}+${_vt}${e?`|${_vt}${vvt}+`:""})*?`}}a(l3i,"starsToRegExp");function DDr(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(DDr,"splitGlobAware");function p3i(t){if(!t)return"";let e="",r=DDr(t,Ch.GLOB_SPLIT);if(r.every(n=>n===Ch.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===Ch.GLOBSTAR){if(n)return;e+=l3i(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===Ch.GLOB_SPLIT?h="":h=(0,sBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${DDr(l,",").map(g=>p3i(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=vvt;continue;case"*":e+=l3i(1);continue;default:e+=(0,sBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?sBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,kmc.isEqualOrParent)(u,d,e.ignoreCase??!Dmc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=u3i.get(s);if(c)return d3i(c,t,o);let l;return Omc.test(r)?c=jmc(r.substring(4),r,o):(l=Lmc.exec(kDr(r,o)))?c=Hmc(l[1],r,o):(e.trimForExclusions?Fmc:Bmc).test(r)?c=Gmc(r,o):(l=Umc.exec(kDr(r,o)))?c=f3i(l[1].substring(1),r,!0,o):(l=Qmc.exec(kDr(r,o)))?c=f3i(l[1],r,!1,o):c=$mc(r,o),u3i.set(s,c),d3i(c,t,o)}a(MDr,"parsePattern");function d3i(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,sBe.ltrim)(o.substring(e.base.length),Y$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(d3i,"wrapRelativePattern");function kDr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(kDr,"trimForExclusions");function jmc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(jmc,"trivia1");function Hmc(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(Hmc,"trivia2");function Gmc(t,e){let r=g3i(t.slice(1,-1).split(",").map(l=>MDr(l,e)).filter(l=>l!==uN),t),n=r.length;if(!n)return uN;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(Gmc,"trivia3");function f3i(t,e,r,n){let o=Y$.sep===Y$.posix.sep,s=o?t:t.replace(Mmc,Y$.sep),c=Y$.sep+s,l=Y$.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(f3i,"trivia4and5");function $mc(t,e){try{let r=new RegExp(`^${p3i(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return uN}}a($mc,"toRegExp");function Vmc(t,e,r){return!t||typeof e!="string"?!1:h3i(t,r)(e)}a(Vmc,"match");function h3i(t,e={}){if(!t)return NDr;if(typeof t=="string"||m3i(t)){let r=MDr(t,e);if(r===uN)return NDr;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 Ymc(t,e)}a(h3i,"parse");function m3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(m3i,"isRelativePattern");function Wmc(t){return t.allBasenames||[]}a(Wmc,"getBasenameTerms");function zmc(t){return t.allPaths||[]}a(zmc,"getPathTerms");function Ymc(t,e){let r=g3i(Object.getOwnPropertyNames(t).map(l=>Kmc(l,t[l],e)).filter(l=>l!==uN)),n=r.length;if(!n)return uN;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(Ymc,"parsedExpression");function Kmc(t,e,r){if(e===!1)return uN;let n=MDr(t,r);if(n===uN)return uN;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,PDr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Kmc,"parseExpressionPattern");function g3i(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(g3i,"aggregateBasenameMatches");function Jmc(t,e){return(0,Rmc.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(Jmc,"patternsEquals")});var bvt=I(Ll=>{"use strict";p();var Zmc=Ll&&Ll.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xmc=Ll&&Ll.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e0c=Ll&&Ll.__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,y3i.isEqual)(r.uri,t)||r.uri.path===t.path||LDr(t,r))}a(ODr,"findNotebook");function LDr(t,e){if(t.scheme===aBe.Schemas.vscodeNotebookCell||t.scheme===aBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,y3i.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(LDr,"findCell");function t0c(t,e){if(t.scheme!==aBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=E3i(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(t0c,"getNotebookCellOutput");function E3i(t,e){let r=ODr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=LDr(t,r);return n===void 0?[r,void 0]:[r,n]}a(E3i,"getNotebookAndCellFromUri");function r0c(t){return t.scheme===aBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(r0c,"isNotebookCellOrNotebookChatInput");function n0c(t){return t.scheme===aBe.Schemas.vscodeNotebookCell}a(n0c,"isNotebookCell");function i0c(t){return t.path.endsWith(".ipynb")}a(i0c,"isJupyterNotebookUri");function o0c(t){return t.notebookType==="jupyter-notebook"}a(o0c,"isJupyterNotebook");function s0c(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(s0c,"serializeNotebookDocument");function a0c(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(a0c,"extractNotebookOutline");function _3i(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||C3i(e.include))}a(_3i,"isDocumentExcludePattern");function v3i(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(v3i,"isFilenamePattern");function C3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(C3i,"isRelativePattern");function c0c(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(c0c,"isNotebookEditorContribution");function l0c(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(l0c,"extractEditorAssociation");function b3i(t,e){if(typeof e=="string"&&vye.match(e.toLowerCase(),(0,Cye.basename)(t.fsPath).toLowerCase()))return!0;if(_3i(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(vye.match(r,(0,Cye.basename)(t.fsPath).toLowerCase()))return!(n&&vye.match(n,(0,Cye.basename)(t.fsPath).toLowerCase()))}return v3i(e)&&vye.match(e.filenamePattern,(0,Cye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&vye.match(e.excludeFileNamePattern,(0,Cye.basename)(t.fsPath).toLowerCase())):!1}a(b3i,"notebookSelectorMatches");function S3i(t,e){let r=[];for(let n of e)n.filenamePattern&&vye.match(n.filenamePattern.toLowerCase(),(0,Cye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(S3i,"getNotebookEditorAssociations");function u0c(t,e,r,n){if(ODr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>b3i(t,l)));if(o.length===0)return!1;let s=S3i(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??Cvt.default)===Cvt.default)}a(u0c,"_hasSupportedNotebooks")});var k3i=I(O0=>{"use strict";p();var d0c=O0&&O0.__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},f0c=O0&&O0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(O0,"__esModule",{value:!0});O0.TelemetrySender=O0.NextEditProviderTelemetryBuilder=O0.DiagnosticsTelemetryBuilder=O0.LlmNESTelemetryBuilder=O0.NES_GH_TELEMETRY_EVENT_NAME=void 0;var T3i=GR(),I3i=c3i(),p0c=m4(),R3i=ym(),h0c=bvt(),m0c=nl(),Svt=ko(),g0c=nJ(),x3i=S8(),w3i=D0();O0.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var Tvt=class extends Svt.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===g0c.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,h0c.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(w3i.Uri.parse(g.id.uri));if(y){let v=(0,I3i.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(w3i.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?(0,I3i.getUpstreamRemote)(v):void 0;b?.fetchUrl&&E.add(b.fetchUrl),b?.pushUrl&&E.add(b.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}setRequestBookmark(e){this._requestBookmark=e}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,p0c.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}};O0.LlmNESTelemetryBuilder=Tvt;var Ivt=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}};O0.DiagnosticsTelemetryBuilder=Ivt;var BDr=class t extends Svt.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 Tvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new Ivt}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}};O0.NextEditProviderTelemetryBuilder=BDr;var FDr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new Svt.DisposableStore,this._disposalTracker=new Svt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new m0c.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,x3i.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,x3i.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()}},UDr=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 FDr(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:L,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:V,isInlineSuggestion:z,debounceTime:ie,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,notebookId:ge,notebookCellLines:Ue,nextEditLogprob:ke,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:Z,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ne,diagnosticDroppedReasons:ce,diagnosticHasExistingSameFileImport:Me,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:Et,hadDiagnosticsNES:Dt,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Qe}=e,pe,Se,Fe,te;if(Z!==void 0){let{response:Te,ttft:Ge,fetchResult:J,fetchTime:se}=await Z;Te.type===T3i.ChatFetchResponseType.Success&&(pe=Te.usage),Se=Ge,Fe=J,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Fe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:ce,pickedNES:Gt,notebookType:b,notebookId:ge,notebookCellLines:Ue,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,modelConfig:Qe,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:le>0?1:0,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum(V),isInlineSuggestion:this._boolToNum(z),debounceTime:ie,artificialDelay:H,fetchStartedAfterMs:he,ttft:Se,fetchTime:te,promptTokens:pe?.prompt_tokens,responseTokens:pe?.completion_tokens,cachedTokens:pe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:pe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:pe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ke,hadDiagnosticsNES:this._boolToNum(Dt),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Me),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,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(O0.NES_GH_TELEMETRY_EVENT_NAME,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(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(O0.NES_GH_TELEMETRY_EVENT_NAME,(0,R3i.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==T3i.ChatFetchResponseType.Success?void 0:x.response.value,fetchResult:D,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)}};O0.TelemetrySender=UDr;O0.TelemetrySender=UDr=d0c([f0c(1,R3i.ITelemetryService)],UDr)});var qDr=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.NullPowerService=bye.IPowerService=void 0;var P3i=Ic(),A0c=Gs();bye.IPowerService=(0,A0c.createDecorator)("IPowerService");var QDr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=P3i.Event.None,this.onDidResume=P3i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};bye.NullPowerService=QDr});var Z6=I(K$=>{"use strict";p();Object.defineProperty(K$,"__esModule",{value:!0});K$.FetchStreamRecorder=K$.FetchStreamSource=K$.IChatMLFetcher=void 0;var y0c=nn(),E0c=nl();K$.IChatMLFetcher=(0,y0c.createServiceIdentifier)("IChatMLFetcher");var jDr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new E0c.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)}};K$.FetchStreamSource=jDr;var HDr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}get outputChunkGapsMs(){return this._outputChunkGapsMs}constructor(e){this.deltas=[],this._outputChunkGapsMs=[],this.callback=async(r,n,o)=>{if(!!(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)){let l=Date.now();this._firstTokenEmittedTime===void 0?this._firstTokenEmittedTime=l:this._lastOutputChunkTime!==void 0&&this._outputChunkGapsMs.push(l-this._lastOutputChunkTime),this._lastOutputChunkTime=l}let c=e?await e(r,n,o):void 0;return this.deltas.push(o),c}}};K$.FetchStreamRecorder=HDr});var GDr=I(xvt=>{"use strict";p();Object.defineProperty(xvt,"__esModule",{value:!0});xvt.IChatQuotaService=void 0;var _0c=nn();xvt.IChatQuotaService=(0,_0c.createServiceIdentifier)("IChatQuotaService")});var $Dr=I(wvt=>{"use strict";p();Object.defineProperty(wvt,"__esModule",{value:!0});wvt.IConversationOptions=void 0;var v0c=nn();wvt.IConversationOptions=(0,v0c.createServiceIdentifier)("ConversationOptions")});var cBe=I(Sye=>{"use strict";p();Object.defineProperty(Sye,"__esModule",{value:!0});Sye.getTextPart=b0c;Sye.toTextPart=D3i;Sye.toTextParts=S0c;Sye.roleToString=T0c;var Fne=xo(),C0c=nd();function b0c(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Fne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Fne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(b0c,"getTextPart");function D3i(t){return{type:Fne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(D3i,"toTextPart");function S0c(t){return[D3i(t)]}a(S0c,"toTextParts");function T0c(t){switch(t){case Fne.Raw.ChatRole.System:return"system";case Fne.Raw.ChatRole.User:return"user";case Fne.Raw.ChatRole.Assistant:return"assistant";case Fne.Raw.ChatRole.Tool:return"tool";default:(0,C0c.assertNever)(t,`unknown role (${t})`)}}a(T0c,"roleToString")});var WDr=I(Tye=>{"use strict";p();Object.defineProperty(Tye,"__esModule",{value:!0});Tye.InteractionService=Tye.IInteractionService=void 0;var I0c=nn(),N3i=I0();Tye.IInteractionService=(0,I0c.createServiceIdentifier)("IInteractionService");var VDr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,N3i.generateUuid)()}startInteraction(){this._interactionId=(0,N3i.generateUuid)()}get interactionId(){return this._interactionId}};Tye.InteractionService=VDr});var YDr=I(Rvt=>{"use strict";p();Object.defineProperty(Rvt,"__esModule",{value:!0});Rvt.SSEParser=void 0;var zDr=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(ho,"__esModule",{value:!0});ho.getModelCapabilityOverride=y0c;ho.getModelId=W$;ho.isHiddenModelA=E0c;ho.isHiddenModelB=VDr;ho.isHiddenModelE=Ivt;ho.isHiddenModelF=xvt;ho.isHiddenFamilyH=wvt;ho.isHiddenModelK=_0c;ho.isGpt54=WDr;ho.isGpt55=v0c;ho.isHiddenModelM=iBe;ho.isGpt53Codex=zDr;ho.isVSCModelA=Rvt;ho.isVSCModelB=kvt;ho.isVSCModelReplaceStringSet=oBe;ho.isVSCModelC=C0c;ho.isVSCModelD=b0c;ho.isGpt52CodexFamily=YDr;ho.isGpt52Family=KDr;ho.modelPrefersInstructionsInUserMessage=S0c;ho.modelPrefersInstructionsAfterHistory=T0c;ho.modelSupportsApplyPatch=I0c;ho.modelPrefersJsonNotebookRepresentation=x0c;ho.modelSupportsReplaceString=w0c;ho.modelSupportsMultiReplaceString=N3i;ho.modelCanUseReplaceStringExclusively=R0c;ho.modelShouldUseReplaceStringHealing=k0c;ho.modelCanUseMcpResultImageURL=P0c;ho.modelCanUseImageURL=D0c;ho.modelSupportsPDFDocuments=N0c;ho.modelCanUseApplyPatchExclusively=M0c;ho.modelNeedsStrongReplaceStringHint=O0c;ho.modelSupportsSimplifiedApplyPatchInstructions=L0c;ho.isAnthropicFamily=sBe;ho.isGeminiFamily=JDr;ho.isMinimaxFamily=Pvt;ho.isGpt5PlusFamily=Dvt;ho.isGptCodexFamily=B0c;ho.isGpt5Family=F0c;ho.isGptFamily=U0c;ho.isGpt51Family=Q0c;ho.getVerbosityForModelSync=q0c;ho.modelSupportsToolSearch=j0c;ho.modelSupportsContextEditing=H0c;var Nm=PPr(),d0c=Pl(),f0c=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],P3i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],I3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],x3i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],w3i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],R3i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],k3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],p0c=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],h0c=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],m0c=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],D3i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",g0c=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],A0c=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function y0c(t,e){return e.getConfig(d0c.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(y0c,"getModelCapabilityOverride");function W$(t){return"id"in t?t.id:t.model}a(W$,"getModelId");function E0c(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return f0c.includes(e)}a(E0c,"isHiddenModelA");function VDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return P3i.includes(e)}a(VDr,"isHiddenModelB");function Ivt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return p0c.includes(e)}a(Ivt,"isHiddenModelE");function xvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return h0c.includes(e)}a(xvt,"isHiddenModelF");function wvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return g0c.includes(e)}a(wvt,"isHiddenFamilyH");function _0c(t){return(0,Nm.getCachedSha256Hash)(t.family)===D3i}a(_0c,"isHiddenModelK");function WDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||m0c.includes(e)}a(WDr,"isGpt54");function v0c(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||P3i.includes(e)}a(v0c,"isGpt55");function iBe(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return A0c.includes(e)}a(iBe,"isHiddenModelM");function zDr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(zDr,"isGpt53Codex");function Rvt(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return I3i.includes(e)||I3i.includes(r)}a(Rvt,"isVSCModelA");function kvt(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return x3i.includes(e)||x3i.includes(r)}a(kvt,"isVSCModelB");function oBe(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return k3i.includes(e)||k3i.includes(r)}a(oBe,"isVSCModelReplaceStringSet");function C0c(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return w3i.includes(e)||w3i.includes(r)}a(C0c,"isVSCModelC");function b0c(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return R3i.includes(e)||R3i.includes(r)}a(b0c,"isVSCModelD");function YDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(YDr,"isGpt52CodexFamily");function KDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(KDr,"isGpt52Family");function S0c(t){return t.includes("claude-3.5-sonnet")}a(S0c,"modelPrefersInstructionsInUserMessage");function T0c(t){return t.includes("claude-3.5-sonnet")}a(T0c,"modelPrefersInstructionsAfterHistory");function I0c(t){return oBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||YDr(t.family)||zDr(t.family)||Rvt(t)||kvt(t)||KDr(t.family)||WDr(t)||VDr(t)||iBe(t)}a(I0c,"modelSupportsApplyPatch");function x0c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||YDr(t.family)||zDr(t.family)||KDr(t.family)||WDr(t)||VDr(t)||iBe(t)}a(x0c,"modelPrefersJsonNotebookRepresentation");function w0c(t){return JDr(t)||t.family.includes("grok-code")||N3i(t)||xvt(t)||Pvt(t)||wvt(t)}a(w0c,"modelSupportsReplaceString");function N3i(t){return sBe(t)||Ivt(t)||oBe(t)||Pvt(t)||wvt(t)}a(N3i,"modelSupportsMultiReplaceString");function R0c(t){return sBe(t)||t.family.includes("grok-code")||Ivt(t)||t.family.toLowerCase().includes("gemini-3")||oBe(t)||xvt(t)||Pvt(t)||wvt(t)}a(R0c,"modelCanUseReplaceStringExclusively");function k0c(t){return t.family.includes("gemini-2")}a(k0c,"modelShouldUseReplaceStringHealing");function P0c(t){return!sBe(t)&&!Ivt(t)}a(P0c,"modelCanUseMcpResultImageURL");function D0c(t){return!0}a(D0c,"modelCanUseImageURL");function N0c(t){return sBe(t)||Dvt(t)||iBe(t)}a(N0c,"modelSupportsPDFDocuments");function M0c(t){return oBe(t)?!1:Dvt(t)||Rvt(t)||kvt(t)}a(M0c,"modelCanUseApplyPatchExclusively");function O0c(t){return JDr(t)||xvt(t)}a(O0c,"modelNeedsStrongReplaceStringHint");function L0c(t){return Dvt(t)||Rvt(t)||kvt(t)}a(L0c,"modelSupportsSimplifiedApplyPatchInstructions");function sBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(sBe,"isAnthropicFamily");function JDr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Nm.getCachedSha256Hash)(e)===D3i}a(JDr,"isGeminiFamily");function Pvt(t){return t.family.toLowerCase().includes("minimax")}a(Pvt,"isMinimaxFamily");function Dvt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(Dvt,"isGpt5PlusFamily");function B0c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(B0c,"isGptCodexFamily");function F0c(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(F0c,"isGpt5Family");function U0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(U0c,"isGptFamily");function Q0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Q0c,"isGpt51Family");function q0c(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(q0c,"getVerbosityForModelSync");function j0c(t){let e=typeof t=="string"?t:W$(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"?!0:!s.startsWith("claude")||s.startsWith("claude-haiku")?!1:!(s.startsWith("claude-1")||s.startsWith("claude-2")||s.startsWith("claude-3")||s.startsWith("claude-instant")||s==="claude-sonnet-4"||s.startsWith("claude-sonnet-4-2")||s==="claude-opus-4"||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4-2"))},"matches");return n(e)||n(r)||iBe(r)}a(j0c,"modelSupportsToolSearch");function H0c(t){let e=typeof t=="string"?t:W$(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-fable-5")||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-8")||l.startsWith("claude-opus-4-7")||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(H0c,"modelSupportsContextEditing")});var Ovt=I(GR=>{"use strict";p();Object.defineProperty(GR,"__esModule",{value:!0});GR.CUSTOM_TOOL_SEARCH_NAME=void 0;GR.modelSupportsInterleavedThinking=$0c;GR.modelSupportsMemory=V0c;GR.isAnthropicContextEditingEnabled=W0c;GR.modelSupportsExtendedCacheTtl=M3i;GR.isExtendedCacheTtlEnabled=z0c;GR.isExtendedCacheTtlMessagesEnabled=Y0c;GR.buildContextManagement=O3i;GR.getContextManagementFromConfig=K0c;var Mvt=Pl(),Nvt=aBe(),G0c=jR();GR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function $0c(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($0c,"modelSupportsInterleavedThinking");function V0c(t){let e=typeof t=="string"?t:(0,Nvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||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-8")||s.startsWith("claude-opus-4-7")||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(V0c,"modelSupportsMemory");function W0c(t,e,r){return(typeof t=="string"?(0,Nvt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,Nvt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(Mvt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(W0c,"isAnthropicContextEditingEnabled");function M3i(t){let e=typeof t=="string"?t:(0,Nvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-opus-4-8")||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(M3i,"modelSupportsExtendedCacheTtl");function z0c(t,e,r,n,o){return!M3i(t)||n!==G0c.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(Mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(z0c,"isExtendedCacheTtlEnabled");function Y0c(t,e,r){return t?e.getExperimentBasedConfig(Mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(Y0c,"isExtendedCacheTtlMessagesEnabled");function O3i(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(O3i,"buildContextManagement");function K0c(t,e,r){let n=t.getExperimentBasedConfig(Mvt.ConfigKey.AnthropicContextEditingMode,e);return O3i(n,r)}a(K0c,"getContextManagementFromConfig")});var ZDr=I(Lvt=>{"use strict";p();Object.defineProperty(Lvt,"__esModule",{value:!0});Lvt.IToolDeferralService=void 0;var J0c=nn();Lvt.IToolDeferralService=(0,J0c.createServiceIdentifier)("IToolDeferralService")});var rNr=I(KE=>{"use strict";p();var Z0c=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]})),X0c=KE&&KE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),egc=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;oUvt(n,r),e)}a(ngc,"arrayHash");function igc(t,e){return e=vL(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=tNr(n,r),Uvt(t[n],r)),e)}a(igc,"objectHash");var ogc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new Fvt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof eNr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Sye)},"hashAsync");KE.hashAsync=ogc;function XDr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(XDr,"leftRotate");function Sye(t,e=32){return t instanceof ArrayBuffer?(0,eNr.encodeHex)(eNr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Sye,"toHexString");var Fvt=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(Bvt.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()),Sye(this._h0)+Sye(this._h1)+Sye(this._h2)+Sye(this._h3)+Sye(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,XDr(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=XDr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=XDr(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=Fvt});var Tye=I(cBe=>{"use strict";p();Object.defineProperty(cBe,"__esModule",{value:!0});cBe.TelemetryData=void 0;cBe.eventPropertiesToSimpleObject=agc;var sgc=T0(),nNr=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];cgc(r,this.properties)}};cBe.TelemetryData=nNr;function agc(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(agc,"eventPropertiesToSimpleObject");function cgc(t,e){e.unique_id=(0,sgc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(cgc,"addRequiredProperties")});var L3i=I(iNr=>{"use strict";p();Object.defineProperty(iNr,"__esModule",{value:!0});iNr.extractThinkingDeltaFromChoice=dgc;function lgc(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(lgc,"getThinkingDeltaText");function ugc(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(ugc,"getThinkingDeltaId");function dgc(t){let e=t.message||t.delta;if(!e)return;let r=ugc(e),n=lgc(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(dgc,"extractThinkingDeltaFromChoice")});var jvt=I(Fne=>{"use strict";p();Object.defineProperty(Fne,"__esModule",{value:!0});Fne.SSEProcessor=void 0;Fne.splitChunk=F3i;Fne.convertToAPIJsonData=hgc;Fne.sendCommunicationErrorTelemetry=Iye;var Qvt=Sp(),B3i=Tye(),fgc=L3i(),qvt=$6(),Mm=H6(),lBe=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}}},oNr=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}},sNr=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 oNr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function F3i(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(F3i,"splitChunk");var aNr=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,qvt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new sNr,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,Mm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Mm.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]=F3i(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}`),Iye(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&&pgc(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}`),Iye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new lBe(h.model||""),reason:Mm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),Iye(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,qvt.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,qvt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(qvt.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 lBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Mm.FinishedCompletionReason.FunctionCall||g.finish_reason===Mm.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===Mm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Mm.FinishedCompletionReason.ToolCalls||g.finish_reason===Mm.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??Mm.FinishedCompletionReason.ClientTrimmed,filterReason:mgc(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:Mm.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}`),Iye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),Iye(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"?Mm.FinishedCompletionReason.FunctionCall:Mm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Mm.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)}`)}};Fne.SSEProcessor=aNr;function pgc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(pgc,"isCopilotConfirmation");function hgc(t){return{text:t.text.join(""),tokens:t.text}}a(hgc,"convertToAPIJsonData");function mgc(t){if(t.finish_reason===Mm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Mm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Mm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Mm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Mm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Mm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Mm.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(mgc,"choiceToFilterReason");function Iye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=B3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Qvt.LogLevel[Qvt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=B3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Qvt.LogLevel[Qvt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(Iye,"sendCommunicationErrorTelemetry")});var fBe=I(xye=>{"use strict";p();Object.defineProperty(xye,"__esModule",{value:!0});xye.sendEngineMessagesLengthTelemetry=H3i;xye.sendEngineMessagesTelemetry=G3i;xye.sendResponsesApiCompactionTelemetry=xgc;xye.prepareChatCompletionForReturn=wgc;var ggc=Io(),q3i=rNr(),Gvt=zP(),j3i=T0(),Agc=nBe(),lNr=gm(),dBe=Tye(),ygc=H6(),Egc=jvt();function H3i(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=dBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,lNr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,lNr.multiplexProperties)(d.properties),d.measurements)}a(H3i,"sendEngineMessagesLengthTelemetry");var U3i=new Gvt.LRUCache(1e3),Q3i=new Gvt.LRUCache(500),uBe=new Gvt.LRUCache(1e3),Hvt={headerRequestId:null},cNr=new Gvt.LRUCache(100);function _gc(t){let e=uBe.get(t);if(e!==void 0){let r=e+1;return uBe.set(t,r),r}else return uBe.set(t,1),1}a(_gc,"updateHeaderRequestIdTracker");function vgc(t){let e=cNr.get(t);if(e!==void 0){let r=e+1;return cNr.set(t,r),r}else return cNr.set(t,1),1}a(vgc,"updateConversationTracker");function Cgc(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,q3i.hash)(n).toString(),l=Q3i.get(c);if(!l)l=(0,j3i.generateUuid)(),Q3i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(pBe,"__esModule",{value:!0});pBe.CompactionDataContainer=void 0;pBe.rawPartAsCompactionData=kgc;var Rgc=Io(),$3i=xLe(),uNr=class extends Rgc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:$3i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};pBe.CompactionDataContainer=uNr;function kgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===$3i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(kgc,"rawPartAsCompactionData")});var z3i=I(hBe=>{"use strict";p();Object.defineProperty(hBe,"__esModule",{value:!0});hBe.PhaseDataContainer=void 0;hBe.rawPartAsPhaseData=Dgc;var Pgc=Io(),W3i=xLe(),dNr=class extends Pgc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:W3i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};hBe.PhaseDataContainer=dNr;function Dgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===W3i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(Dgc,"rawPartAsPhaseData")});var J3i=I(CL=>{"use strict";p();Object.defineProperty(CL,"__esModule",{value:!0});CL.StatefulMarkerContainer=void 0;CL.rawPartAsStatefulMarker=K3i;CL.encodeStatefulMarker=Ngc;CL.decodeStatefulMarker=Mgc;CL.getAllStatefulMarkersAndIndicies=hNr;CL.getStatefulMarkerAndIndex=Ogc;CL.getIndexOfStatefulMarker=Lgc;var fNr=Io(),Y3i=xLe(),pNr=class extends fNr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:Y3i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};CL.StatefulMarkerContainer=pNr;function K3i(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Y3i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(K3i,"rawPartAsStatefulMarker");function Ngc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Ngc,"encodeStatefulMarker");function Mgc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(Mgc,"decodeStatefulMarker");function*hNr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===fNr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===fNr.Raw.ChatCompletionContentPartKind.Opaque){let o=K3i(n);o&&(yield{statefulMarker:o,index:e})}}}}a(hNr,"getAllStatefulMarkersAndIndicies");function Ogc(t,e){for(let r of hNr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Ogc,"getStatefulMarkerAndIndex");function Lgc(t,e){for(let r of hNr(e))if(r.statefulMarker.marker===t)return r.index}a(Lgc,"getIndexOfStatefulMarker")});var eFi=I(J6=>{"use strict";p();var Bgc=J6&&J6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Fgc=J6&&J6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X3i=J6&&J6.__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(mo,"__esModule",{value:!0});mo.getModelCapabilityOverride=M0c;mo.getModelId=J$;mo.isHiddenModelA=O0c;mo.isHiddenModelB=KDr;mo.isHiddenModelE=kvt;mo.isHiddenModelF=Pvt;mo.isHiddenFamilyH=Dvt;mo.isHiddenModelK=L0c;mo.isGpt54=JDr;mo.isGpt55=B0c;mo.isHiddenModelM=lBe;mo.isGpt53Codex=ZDr;mo.isVSCModelA=Nvt;mo.isVSCModelB=Mvt;mo.isVSCModelReplaceStringSet=uBe;mo.isVSCModelC=F0c;mo.isVSCModelD=U0c;mo.isGpt52CodexFamily=XDr;mo.isGpt52Family=eNr;mo.modelPrefersInstructionsInUserMessage=Q0c;mo.modelPrefersInstructionsAfterHistory=q0c;mo.modelSupportsApplyPatch=j0c;mo.modelPrefersJsonNotebookRepresentation=H0c;mo.modelSupportsReplaceString=G0c;mo.modelSupportsMultiReplaceString=q3i;mo.modelCanUseReplaceStringExclusively=$0c;mo.modelShouldUseReplaceStringHealing=V0c;mo.modelCanUseMcpResultImageURL=W0c;mo.modelCanUseImageURL=z0c;mo.modelSupportsPDFDocuments=Y0c;mo.modelCanUseApplyPatchExclusively=K0c;mo.modelNeedsStrongReplaceStringHint=J0c;mo.modelSupportsSimplifiedApplyPatchInstructions=Z0c;mo.isAnthropicFamily=dBe;mo.isGeminiFamily=tNr;mo.isMinimaxFamily=Ovt;mo.isGpt5PlusFamily=Lvt;mo.isGptCodexFamily=X0c;mo.isGpt5Family=egc;mo.isGptFamily=tgc;mo.isGpt51Family=rgc;mo.getVerbosityForModelSync=ngc;mo.modelSupportsToolSearch=igc;mo.modelSupportsContextEditing=ogc;var Om=OPr(),x0c=Dl(),w0c=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],U3i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],M3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],O3i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],L3i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],B3i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],F3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],R0c=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],k0c=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],P0c=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],Q3i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",D0c=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],N0c=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function M0c(t,e){return e.getConfig(x0c.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(M0c,"getModelCapabilityOverride");function J$(t){return"id"in t?t.id:t.model}a(J$,"getModelId");function O0c(t){let e=(0,Om.getCachedSha256Hash)(t.family);return w0c.includes(e)}a(O0c,"isHiddenModelA");function KDr(t){let e=(0,Om.getCachedSha256Hash)(typeof t=="string"?t:t.family);return U3i.includes(e)}a(KDr,"isHiddenModelB");function kvt(t){let e=(0,Om.getCachedSha256Hash)(t.family);return R0c.includes(e)}a(kvt,"isHiddenModelE");function Pvt(t){let e=(0,Om.getCachedSha256Hash)(t.family);return k0c.includes(e)}a(Pvt,"isHiddenModelF");function Dvt(t){let e=(0,Om.getCachedSha256Hash)(t.family);return D0c.includes(e)}a(Dvt,"isHiddenFamilyH");function L0c(t){return(0,Om.getCachedSha256Hash)(t.family)===Q3i}a(L0c,"isHiddenModelK");function JDr(t){let e=(0,Om.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||P0c.includes(e)}a(JDr,"isGpt54");function B0c(t){let e=(0,Om.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||U3i.includes(e)}a(B0c,"isGpt55");function lBe(t){let e=(0,Om.getCachedSha256Hash)(typeof t=="string"?t:t.family);return N0c.includes(e)}a(lBe,"isHiddenModelM");function ZDr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(ZDr,"isGpt53Codex");function Nvt(t){let e=(0,Om.getCachedSha256Hash)(J$(t)),r=(0,Om.getCachedSha256Hash)(t.family);return M3i.includes(e)||M3i.includes(r)}a(Nvt,"isVSCModelA");function Mvt(t){let e=(0,Om.getCachedSha256Hash)(J$(t)),r=(0,Om.getCachedSha256Hash)(t.family);return O3i.includes(e)||O3i.includes(r)}a(Mvt,"isVSCModelB");function uBe(t){let e=(0,Om.getCachedSha256Hash)(J$(t)),r=(0,Om.getCachedSha256Hash)(t.family);return F3i.includes(e)||F3i.includes(r)}a(uBe,"isVSCModelReplaceStringSet");function F0c(t){let e=(0,Om.getCachedSha256Hash)(J$(t)),r=(0,Om.getCachedSha256Hash)(t.family);return L3i.includes(e)||L3i.includes(r)}a(F0c,"isVSCModelC");function U0c(t){let e=(0,Om.getCachedSha256Hash)(J$(t)),r=(0,Om.getCachedSha256Hash)(t.family);return B3i.includes(e)||B3i.includes(r)}a(U0c,"isVSCModelD");function XDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(XDr,"isGpt52CodexFamily");function eNr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(eNr,"isGpt52Family");function Q0c(t){return t.includes("claude-3.5-sonnet")}a(Q0c,"modelPrefersInstructionsInUserMessage");function q0c(t){return t.includes("claude-3.5-sonnet")}a(q0c,"modelPrefersInstructionsAfterHistory");function j0c(t){return uBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||XDr(t.family)||ZDr(t.family)||Nvt(t)||Mvt(t)||eNr(t.family)||JDr(t)||KDr(t)||lBe(t)}a(j0c,"modelSupportsApplyPatch");function H0c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||XDr(t.family)||ZDr(t.family)||eNr(t.family)||JDr(t)||KDr(t)||lBe(t)}a(H0c,"modelPrefersJsonNotebookRepresentation");function G0c(t){return tNr(t)||t.family.includes("grok-code")||q3i(t)||Pvt(t)||Ovt(t)||Dvt(t)}a(G0c,"modelSupportsReplaceString");function q3i(t){return dBe(t)||kvt(t)||uBe(t)||Ovt(t)||Dvt(t)}a(q3i,"modelSupportsMultiReplaceString");function $0c(t){return dBe(t)||t.family.includes("grok-code")||kvt(t)||t.family.toLowerCase().includes("gemini-3")||uBe(t)||Pvt(t)||Ovt(t)||Dvt(t)}a($0c,"modelCanUseReplaceStringExclusively");function V0c(t){return t.family.includes("gemini-2")}a(V0c,"modelShouldUseReplaceStringHealing");function W0c(t){return!dBe(t)&&!kvt(t)}a(W0c,"modelCanUseMcpResultImageURL");function z0c(t){return!0}a(z0c,"modelCanUseImageURL");function Y0c(t){return dBe(t)||Lvt(t)||lBe(t)}a(Y0c,"modelSupportsPDFDocuments");function K0c(t){return uBe(t)?!1:Lvt(t)||Nvt(t)||Mvt(t)}a(K0c,"modelCanUseApplyPatchExclusively");function J0c(t){return tNr(t)||Pvt(t)}a(J0c,"modelNeedsStrongReplaceStringHint");function Z0c(t){return Lvt(t)||Nvt(t)||Mvt(t)}a(Z0c,"modelSupportsSimplifiedApplyPatchInstructions");function dBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(dBe,"isAnthropicFamily");function tNr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Om.getCachedSha256Hash)(e)===Q3i}a(tNr,"isGeminiFamily");function Ovt(t){return t.family.toLowerCase().includes("minimax")}a(Ovt,"isMinimaxFamily");function Lvt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(Lvt,"isGpt5PlusFamily");function X0c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(X0c,"isGptCodexFamily");function egc(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(egc,"isGpt5Family");function tgc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(tgc,"isGptFamily");function rgc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(rgc,"isGpt51Family");function ngc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(ngc,"getVerbosityForModelSync");function igc(t){let e=typeof t=="string"?t:J$(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"?!0:!s.startsWith("claude")||s.startsWith("claude-haiku")?!1:!(s.startsWith("claude-1")||s.startsWith("claude-2")||s.startsWith("claude-3")||s.startsWith("claude-instant")||s==="claude-sonnet-4"||s.startsWith("claude-sonnet-4-2")||s==="claude-opus-4"||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4-2"))},"matches");return n(e)||n(r)||lBe(r)}a(igc,"modelSupportsToolSearch");function ogc(t){let e=typeof t=="string"?t:J$(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-fable-5")||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-8")||l.startsWith("claude-opus-4-7")||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(ogc,"modelSupportsContextEditing")});var Uvt=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.CUSTOM_TOOL_SEARCH_NAME=void 0;VR.modelSupportsInterleavedThinking=agc;VR.modelSupportsMemory=cgc;VR.isAnthropicContextEditingEnabled=lgc;VR.modelSupportsExtendedCacheTtl=j3i;VR.isExtendedCacheTtlEnabled=ugc;VR.isExtendedCacheTtlMessagesEnabled=dgc;VR.buildContextManagement=H3i;VR.getContextManagementFromConfig=fgc;var Fvt=Dl(),Bvt=fBe(),sgc=GR();VR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function agc(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(agc,"modelSupportsInterleavedThinking");function cgc(t){let e=typeof t=="string"?t:(0,Bvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||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-8")||s.startsWith("claude-opus-4-7")||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(cgc,"modelSupportsMemory");function lgc(t,e,r){return(typeof t=="string"?(0,Bvt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,Bvt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(Fvt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(lgc,"isAnthropicContextEditingEnabled");function j3i(t){let e=typeof t=="string"?t:(0,Bvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-opus-4-8")||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(j3i,"modelSupportsExtendedCacheTtl");function ugc(t,e,r,n,o){return!j3i(t)||n!==sgc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(Fvt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(ugc,"isExtendedCacheTtlEnabled");function dgc(t,e,r){return t?e.getExperimentBasedConfig(Fvt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(dgc,"isExtendedCacheTtlMessagesEnabled");function H3i(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(H3i,"buildContextManagement");function fgc(t,e,r){let n=t.getExperimentBasedConfig(Fvt.ConfigKey.AnthropicContextEditingMode,e);return H3i(n,r)}a(fgc,"getContextManagementFromConfig")});var rNr=I(Qvt=>{"use strict";p();Object.defineProperty(Qvt,"__esModule",{value:!0});Qvt.IToolDeferralService=void 0;var pgc=nn();Qvt.IToolDeferralService=(0,pgc.createServiceIdentifier)("IToolDeferralService")});var sNr=I(JE=>{"use strict";p();var hgc=JE&&JE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mgc=JE&&JE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ggc=JE&&JE.__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;oHvt(n,r),e)}a(Egc,"arrayHash");function _gc(t,e){return e=CL(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=oNr(n,r),Hvt(t[n],r)),e)}a(_gc,"objectHash");var vgc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new jvt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof iNr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Iye)},"hashAsync");JE.hashAsync=vgc;function nNr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(nNr,"leftRotate");function Iye(t,e=32){return t instanceof ArrayBuffer?(0,iNr.encodeHex)(iNr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Iye,"toHexString");var jvt=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(qvt.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()),Iye(this._h0)+Iye(this._h1)+Iye(this._h2)+Iye(this._h3)+Iye(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,nNr(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=nNr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=nNr(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}};JE.StringSHA1=jvt});var xye=I(pBe=>{"use strict";p();Object.defineProperty(pBe,"__esModule",{value:!0});pBe.TelemetryData=void 0;pBe.eventPropertiesToSimpleObject=bgc;var Cgc=I0(),aNr=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];Sgc(r,this.properties)}};pBe.TelemetryData=aNr;function bgc(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(bgc,"eventPropertiesToSimpleObject");function Sgc(t,e){e.unique_id=(0,Cgc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(Sgc,"addRequiredProperties")});var G3i=I(cNr=>{"use strict";p();Object.defineProperty(cNr,"__esModule",{value:!0});cNr.extractThinkingDeltaFromChoice=xgc;function Tgc(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(Tgc,"getThinkingDeltaText");function Igc(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(Igc,"getThinkingDeltaId");function xgc(t){let e=t.message||t.delta;if(!e)return;let r=Igc(e),n=Tgc(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(xgc,"extractThinkingDeltaFromChoice")});var Vvt=I(Une=>{"use strict";p();Object.defineProperty(Une,"__esModule",{value:!0});Une.SSEProcessor=void 0;Une.splitChunk=V3i;Une.convertToAPIJsonData=kgc;Une.sendCommunicationErrorTelemetry=wye;var Gvt=Ip(),$3i=xye(),wgc=G3i(),$vt=W6(),Lm=$6(),hBe=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}}},lNr=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}},uNr=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 lNr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function V3i(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!==""),r]}a(V3i,"splitChunk");var dNr=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,$vt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new uNr,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,Lm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Lm.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]=V3i(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}`),wye(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&&Rgc(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}`),wye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new hBe(h.model||""),reason:Lm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),wye(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,$vt.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,$vt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every($vt.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 hBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Lm.FinishedCompletionReason.FunctionCall||g.finish_reason===Lm.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===Lm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Lm.FinishedCompletionReason.ToolCalls||g.finish_reason===Lm.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??Lm.FinishedCompletionReason.ClientTrimmed,filterReason:Pgc(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:Lm.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}`),wye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),wye(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"?Lm.FinishedCompletionReason.FunctionCall:Lm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Lm.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)}`)}};Une.SSEProcessor=dNr;function Rgc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Rgc,"isCopilotConfirmation");function kgc(t){return{text:t.text.join(""),tokens:t.text}}a(kgc,"convertToAPIJsonData");function Pgc(t){if(t.finish_reason===Lm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Lm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Lm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Lm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Lm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Lm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Lm.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(Pgc,"choiceToFilterReason");function wye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=$3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Gvt.LogLevel[Gvt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=$3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Gvt.LogLevel[Gvt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(wye,"sendCommunicationErrorTelemetry")});var ABe=I(Rye=>{"use strict";p();Object.defineProperty(Rye,"__esModule",{value:!0});Rye.sendEngineMessagesLengthTelemetry=J3i;Rye.sendEngineMessagesTelemetry=Z3i;Rye.sendResponsesApiCompactionTelemetry=Hgc;Rye.prepareChatCompletionForReturn=Ggc;var Dgc=xo(),Y3i=sNr(),zvt=KP(),K3i=I0(),Ngc=cBe(),pNr=ym(),gBe=xye(),Mgc=$6(),Ogc=Vvt();function J3i(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=gBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,pNr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,pNr.multiplexProperties)(d.properties),d.measurements)}a(J3i,"sendEngineMessagesLengthTelemetry");var W3i=new zvt.LRUCache(1e3),z3i=new zvt.LRUCache(500),mBe=new zvt.LRUCache(1e3),Wvt={headerRequestId:null},fNr=new zvt.LRUCache(100);function Lgc(t){let e=mBe.get(t);if(e!==void 0){let r=e+1;return mBe.set(t,r),r}else return mBe.set(t,1),1}a(Lgc,"updateHeaderRequestIdTracker");function Bgc(t){let e=fNr.get(t);if(e!==void 0){let r=e+1;return fNr.set(t,r),r}else return fNr.set(t,1),1}a(Bgc,"updateConversationTracker");function Fgc(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,Y3i.hash)(n).toString(),l=z3i.get(c);if(!l)l=(0,K3i.generateUuid)(),z3i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(yBe,"__esModule",{value:!0});yBe.CompactionDataContainer=void 0;yBe.rawPartAsCompactionData=Vgc;var $gc=xo(),X3i=DLe(),hNr=class extends $gc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:X3i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};yBe.CompactionDataContainer=hNr;function Vgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===X3i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(Vgc,"rawPartAsCompactionData")});var rFi=I(EBe=>{"use strict";p();Object.defineProperty(EBe,"__esModule",{value:!0});EBe.PhaseDataContainer=void 0;EBe.rawPartAsPhaseData=zgc;var Wgc=xo(),tFi=DLe(),mNr=class extends Wgc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:tFi.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};EBe.PhaseDataContainer=mNr;function zgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===tFi.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(zgc,"rawPartAsPhaseData")});var oFi=I(bL=>{"use strict";p();Object.defineProperty(bL,"__esModule",{value:!0});bL.StatefulMarkerContainer=void 0;bL.rawPartAsStatefulMarker=iFi;bL.encodeStatefulMarker=Ygc;bL.decodeStatefulMarker=Kgc;bL.getAllStatefulMarkersAndIndicies=yNr;bL.getStatefulMarkerAndIndex=Jgc;bL.getIndexOfStatefulMarker=Zgc;var gNr=xo(),nFi=DLe(),ANr=class extends gNr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:nFi.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};bL.StatefulMarkerContainer=ANr;function iFi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===nFi.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(iFi,"rawPartAsStatefulMarker");function Ygc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Ygc,"encodeStatefulMarker");function Kgc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(Kgc,"decodeStatefulMarker");function*yNr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===gNr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===gNr.Raw.ChatCompletionContentPartKind.Opaque){let o=iFi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(yNr,"getAllStatefulMarkersAndIndicies");function Jgc(t,e){for(let r of yNr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Jgc,"getStatefulMarkerAndIndex");function Zgc(t,e){for(let r of yNr(e))if(r.statefulMarker.marker===t)return r.index}a(Zgc,"getIndexOfStatefulMarker")});var cFi=I(X6=>{"use strict";p();var Xgc=X6&&X6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eAc=X6&&X6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aFi=X6&&X6.__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 qgc=Uv&&Uv.__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},jgc=Uv&&Uv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Uv,"__esModule",{value:!0});Uv.OpenAIResponsesProcessor=void 0;Uv.getResponsesApiCompactionThreshold=aFi;Uv.createResponsesRequestBody=rAc;Uv.getResponsesApiCompactionThresholdFromBody=nAc;Uv.responseApiInputToRawMessagesForLogging=pAc;Uv.processResponseFromChatEndpoint=CAc;Uv.sendCompletionOutputTelemetry=uFi;var Xi=Io(),CNr=Sl(),Hgc=nl(),Ggc=e$(),$gc=eF(),Vgc=$Dr(),bL=KS(),Wgc=T0(),tFi=jR(),Une=Pl(),zgc=Sp(),Z6=Ovt(),Ygc=$6(),Of=H6(),Kgc=ZDr(),ENr=fBe(),Jgc=X6(),Zgc=mh(),$vt=aBe(),bNr=V3i(),Xgc=z3i(),rFi=J3i(),eAc=e2r(),tAc=eFi();function aFi(t,e,r){if(t.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Of.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(aFi,"getResponsesApiCompactionThreshold");function rAc(t,e,r,n){let o=t.get(Une.IConfigurationService),s=t.get(Zgc.IExperimentationService),c=(0,$vt.getVerbosityForModelSync)(n),l=aFi(o,s,n),u=iAc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(q=>q.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===tFi.ChatLocation.Agent||e.location===tFi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(Kgc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let q of e.requestOptions.tools)!q.function.name||q.function.name.length===0||q.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(q.function.name)||E.push({...q.function,type:"function",strict:!1,parameters:q.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(q=>[q.function.name,q])):void 0,b=A?q=>!y.isNonDeferredTool(q):void 0,T={model:r,...oAc(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:Of.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Une.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Une.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R,L=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPersistentCoTEnabled,s)&&((0,$vt.isGpt54)(n)||(0,$vt.isGpt55)(n)||(0,$vt.isHiddenModelM)(n));return(D||N||L)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{},...L?{context:"all_turns"}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(rAc,"createResponsesRequestBody");function nAc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Of.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(nAc,"getResponsesApiCompactionThresholdFromBody");function iAc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(Jgc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(iAc,"resolveWebSocketStatefulMarker");function oAc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=aAc(e),d=u!==void 0?sAc(e[u]):void 0,f,h;if(n)h=(0,rFi.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,rFi.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===Z6.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 nFi(_,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(...fAc(E.content)),y.push(...uAc(E.content));let _=E.content.map(cAc).filter(bL.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:dAc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===Z6.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?nFi(_,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(cFi).filter(bL.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(iFi).filter(bL.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(iFi).filter(bL.isDefined)});break}return{input:y,previous_response_id:f}}a(oAc,"rawMessagesToResponseAPI");function nFi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==Z6.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(nFi,"buildToolSearchOutputTools");function sAc(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,bNr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(sAc,"createCompactionRoundTripMessage");function aAc(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,bNr.rawPartAsCompactionData)(n))return e}}a(aAc,"getLatestCompactionMessageIndex");function cFi(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(cFi,"rawDocumentToResponsesInputFile");function iFi(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 cFi(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(iFi,"rawContentToResponsesContent");function cAc(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(cAc,"rawContentToResponsesAssistantContent");function lAc(t){return typeof t=="string"&&t.startsWith("rs")}a(lAc,"isResponsesReasoningId");function uAc(t){return(0,CNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,eAc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&lAc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(uAc,"extractThinkingData");function dAc(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Xgc.rawPartAsPhaseData)(e);if(r)return r}}a(dAc,"extractPhaseData");function fAc(t){return(0,CNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,bNr.rawPartAsCompactionData)(e);if(r)return{type:Of.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(fAc,"extractCompactionData");function pAc(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:yNr(s.content).map(Vvt).filter(bL.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:yNr(s.content).map(Vvt).filter(bL.isDefined)});break;case"assistant":n(),hAc(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(gAc).filter(bL.isDefined)}):mAc(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:yNr(s.content).map(Vvt).filter(bL.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=AAc(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(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new vNr(s)}catch{return sFi}}a(rAc,"createResponsesStreamDumper")});var Zvt=I(qv=>{"use strict";p();var nAc=qv&&qv.__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},iAc=qv&&qv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qv,"__esModule",{value:!0});qv.OpenAIResponsesProcessor=void 0;qv.getResponsesApiCompactionThreshold=mFi;qv.createResponsesRequestBody=yAc;qv.getResponsesApiCompactionThresholdFromBody=EAc;qv.responseApiInputToRawMessagesForLogging=RAc;qv.processResponseFromChatEndpoint=FAc;qv.sendCompletionOutputTelemetry=yFi;var Xi=xo(),INr=Tl(),oAc=nl(),sAc=i$(),aAc=rF(),cAc=YDr(),SL=ZS(),lAc=I0(),lFi=GR(),Qne=Dl(),uAc=Ip(),e9=Uvt(),dAc=W6(),Bf=$6(),fAc=rNr(),bNr=ABe(),pAc=t9(),hAc=Ah(),Yvt=fBe(),xNr=eFi(),mAc=rFi(),uFi=oFi(),gAc=i2r(),AAc=cFi();function mFi(t,e,r){if(t.getExperimentBasedConfig(Qne.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Bf.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(mFi,"getResponsesApiCompactionThreshold");function yAc(t,e,r,n){let o=t.get(Qne.IConfigurationService),s=t.get(hAc.IExperimentationService),c=(0,Yvt.getVerbosityForModelSync)(n),l=mFi(o,s,n),u=_Ac(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(q=>q.function.name===e9.CUSTOM_TOOL_SEARCH_NAME),m=e.location===lFi.ChatLocation.Agent||e.location===lFi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(fAc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let q of e.requestOptions.tools)!q.function.name||q.function.name.length===0||q.function.name===e9.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(q.function.name)||E.push({...q.function,type:"function",strict:!1,parameters:q.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(q=>[q.function.name,q])):void 0,b=A?q=>!y.isNonDeferredTool(q):void 0,T={model:r,...vAc(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:Bf.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Qne.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Qne.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Qne.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R,L=o.getExperimentBasedConfig(Qne.ConfigKey.ResponsesApiPersistentCoTEnabled,s)&&((0,Yvt.isGpt54)(n)||(0,Yvt.isGpt55)(n)||(0,Yvt.isHiddenModelM)(n));return(D||N||L)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{},...L?{context:"all_turns"}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Qne.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(yAc,"createResponsesRequestBody");function EAc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Bf.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(EAc,"getResponsesApiCompactionThresholdFromBody");function _Ac(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(pAc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(_Ac,"resolveWebSocketStatefulMarker");function vAc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=bAc(e),d=u!==void 0?CAc(e[u]):void 0,f,h;if(n)h=(0,uFi.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,uFi.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===e9.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 dFi(_,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(...wAc(E.content)),y.push(...IAc(E.content));let _=E.content.map(SAc).filter(SL.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:xAc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===e9.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?dFi(_,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(gFi).filter(SL.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(fFi).filter(SL.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(fFi).filter(SL.isDefined)});break}return{input:y,previous_response_id:f}}a(vAc,"rawMessagesToResponseAPI");function dFi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==e9.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(dFi,"buildToolSearchOutputTools");function CAc(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,xNr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(CAc,"createCompactionRoundTripMessage");function bAc(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,xNr.rawPartAsCompactionData)(n))return e}}a(bAc,"getLatestCompactionMessageIndex");function gFi(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(gFi,"rawDocumentToResponsesInputFile");function fFi(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 gFi(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(fFi,"rawContentToResponsesContent");function SAc(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(SAc,"rawContentToResponsesAssistantContent");function TAc(t){return typeof t=="string"&&t.startsWith("rs")}a(TAc,"isResponsesReasoningId");function IAc(t){return(0,INr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,gAc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&TAc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(IAc,"extractThinkingData");function xAc(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,mAc.rawPartAsPhaseData)(e);if(r)return r}}a(xAc,"extractPhaseData");function wAc(t){return(0,INr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,xNr.rawPartAsCompactionData)(e);if(r)return{type:Bf.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(wAc,"extractCompactionData");function RAc(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:CNr(s.content).map(Kvt).filter(SL.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:CNr(s.content).map(Kvt).filter(SL.isDefined)});break;case"assistant":n(),kAc(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(DAc).filter(SL.isDefined)}):PAc(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:CNr(s.content).map(Kvt).filter(SL.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=NAc(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:Z6.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(pAc,"responseApiInputToRawMessagesForLogging");function hAc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(hAc,"isResponseOutputMessage");function mAc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(mAc,"isResponseInputItemMessage");function yNr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(yNr,"ensureContentArray");function Vvt(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(Vvt,"responseContentToRawContent");function gAc(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(gAc,"responseOutputToRawContent");function AAc(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,CNr.coalesce)(t.map(Vvt))}a(AAc,"responseFunctionOutputToRawContents");function _Nr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Of.openAIContextManagementCompactionType}a(_Nr,"isCompactionItem");function yAc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(yAc,"hasOutputItem");function EAc(t){return"response"in t&&Array.isArray(t.response.output)}a(EAc,"hasResponseOutput");function _Ac(t){return t.output_index}a(_Ac,"getOutputItemIndex");function vNr(t){return _Nr(t)}a(vNr,"isCompactionOutputItem");function lFi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(vNr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&vNr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(lFi,"getLatestCompactionOutput");function vAc(t,e){let r=lFi(t,e);return r?t.filter((n,o)=>!vNr(n)||o===r.outputIndex):t}a(vAc,"keepLatestCompactionOutput");async function CAc(t,e,r,n,o,s,c,l){return new Hgc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Wgc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,Ygc.getRequestId)(n.headers),m=t.createInstance(Wvt,c,e,d,f,h,l),g=(0,tAc.createResponsesStreamDumper)(d,r),A=new Vgc.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&&(uFi(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(CAc,"processResponseFromChatEndpoint");function uFi(t,e,r,n){let o=(0,Of.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,ENr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(uFi,"sendCompletionOutputTelemetry");function bAc(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 Of.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Of.FilterReason.SelfHarm;if(o.includes("sexual"))return Of.FilterReason.Sexual;if(o.includes("violence"))return Of.FilterReason.Violence;if(o.includes("hate"))return Of.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Of.FilterReason.Hate;if(s.self_harm?.filtered)return Of.FilterReason.SelfHarm;if(s.sexual?.filtered)return Of.FilterReason.Sexual;if(s.violence?.filtered)return Of.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Of.FilterReason.Copyright;if(r.source_type==="prompt")return Of.FilterReason.Prompt}a(bAc,"extractFilterReasonFromContentFilters");function oFi(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(oFi,"mapResponsesApiError");var Wvt=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(yAc(e)&&_Nr(e.item)){let n=_Ac(e);r.push({item:e.item,outputIndex:n})}if(EAc(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:e9.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(RAc,"responseApiInputToRawMessagesForLogging");function kAc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(kAc,"isResponseOutputMessage");function PAc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(PAc,"isResponseInputItemMessage");function CNr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(CNr,"ensureContentArray");function Kvt(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(Kvt,"responseContentToRawContent");function DAc(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(DAc,"responseOutputToRawContent");function NAc(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,INr.coalesce)(t.map(Kvt))}a(NAc,"responseFunctionOutputToRawContents");function SNr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Bf.openAIContextManagementCompactionType}a(SNr,"isCompactionItem");function MAc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(MAc,"hasOutputItem");function OAc(t){return"response"in t&&Array.isArray(t.response.output)}a(OAc,"hasResponseOutput");function LAc(t){return t.output_index}a(LAc,"getOutputItemIndex");function TNr(t){return SNr(t)}a(TNr,"isCompactionOutputItem");function AFi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(TNr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&TNr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(AFi,"getLatestCompactionOutput");function BAc(t,e){let r=AFi(t,e);return r?t.filter((n,o)=>!TNr(n)||o===r.outputIndex):t}a(BAc,"keepLatestCompactionOutput");async function FAc(t,e,r,n,o,s,c,l){return new oAc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,lAc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,dAc.getRequestId)(n.headers),m=t.createInstance(Jvt,c,e,d,f,h,l),g=(0,AAc.createResponsesStreamDumper)(d,r),A=new cAc.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&&(yFi(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(FAc,"processResponseFromChatEndpoint");function yFi(t,e,r,n){let o=(0,Bf.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,bNr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(yFi,"sendCompletionOutputTelemetry");function UAc(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 Bf.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Bf.FilterReason.SelfHarm;if(o.includes("sexual"))return Bf.FilterReason.Sexual;if(o.includes("violence"))return Bf.FilterReason.Violence;if(o.includes("hate"))return Bf.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Bf.FilterReason.Hate;if(s.self_harm?.filtered)return Bf.FilterReason.SelfHarm;if(s.sexual?.filtered)return Bf.FilterReason.Sexual;if(s.violence?.filtered)return Bf.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Bf.FilterReason.Copyright;if(r.source_type==="prompt")return Bf.FilterReason.Prompt}a(UAc,"extractFilterReasonFromContentFilters");function pFi(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(pFi,"mapResponsesApiError");var Jvt=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(MAc(e)&&SNr(e.item)){let n=LAc(e);r.push({item:e.item,outputIndex:n})}if(OAc(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 $gc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...sFi(c,l),top_logprobs:l.top_logprobs?.map(u=>sFi(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:Z6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:Z6.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:Z6.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=vAc(s.response.output,this.latestCompactionOutputIndex),l=lFi(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,ENr.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,ENr.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:Of.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(bL.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Of.FinishedCompletionReason.Length:c==="content_filter"?(l=Of.FinishedCompletionReason.ContentFilter,u=bAc(s.content_filters)):l=Of.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:oFi(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Of.FinishedCompletionReason.ServerError,{error:oFi(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(bL.isDefined)}}}};Uv.OpenAIResponsesProcessor=Wvt;Uv.OpenAIResponsesProcessor=Wvt=qgc([jgc(6,zgc.ILogService)],Wvt);function sFi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Ggc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(sFi,"mapLogProp")});var dFi=I(Yvt=>{"use strict";p();Object.defineProperty(Yvt,"__esModule",{value:!0});Yvt.ChatWebSocketTelemetrySender=void 0;var SNr=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})}};Yvt.ChatWebSocketTelemetrySender=SNr});var X6=I(E1=>{"use strict";p();var SAc=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},Kvt=E1&&E1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(E1,"__esModule",{value:!0});E1.ChatWebSocketManager=E1.NullChatWebSocketManager=E1.IChatWebSocketManager=void 0;E1.isCAPIWebSocketError=RNr;var TAc=nn(),IAc=Rs(),Jvt=Ic(),fFi=Ro(),pFi=Pl(),xAc=$E(),wye=Sp(),wAc=gm(),RAc=_y(),kAc=zvt(),z$=dFi();E1.IChatWebSocketManager=(0,TAc.createServiceIdentifier)("IChatWebSocketManager");var TNr=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(){}};E1.NullChatWebSocketManager=TNr;function RNr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(RNr,"isCAPIWebSocketError");var PAc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function DAc(t){return PAc[t.type]}a(DAc,"getStreamTerminatingOutcome");var INr=class extends fFi.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 xNr(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()}};E1.ChatWebSocketManager=INr;E1.ChatWebSocketManager=INr=SAc([Kvt(0,wye.ILogService),Kvt(1,xAc.ICAPIClientService),Kvt(2,wAc.ITelemetryService),Kvt(3,pFi.IConfigurationService)],INr);function Zvt(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(Zvt,"wsCloseCodeToString");var xNr=class extends fFi.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 Jvt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new RAc.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}`),z$.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,wye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,wye.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})`:""}`),z$.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=Zvt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),z$.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,wye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),z$.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}!RNr(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=Zvt(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})`),z$.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,wye.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}`),z$.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,kAc.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 wNr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-E,z=this._totalSentMessageCount-_,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;z$.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:V,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:z,requestReceivedMessageCount:ie,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})}),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,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})`),z$.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()}},wNr=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 Jvt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new Jvt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new Jvt.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(pFi.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,wye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),RNr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=DAc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${Zvt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${Zvt(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 IAc.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 PNr=I(SL=>{"use strict";p();Object.defineProperty(SL,"__esModule",{value:!0});SL.getImageDimensions=NAc;SL.getImageDimensionsFromBytes=MAc;SL.getPngDimensions=hFi;SL.getGifDimensions=mFi;SL.getJpegDimensions=gFi;SL.getWebPDimensions=_Fi;SL.getMimeType=bFi;SL.extractImageAttributes=BAc;function NAc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(bFi(e)){case"image/png":return hFi(e);case"image/gif":return mFi(e);case"image/jpeg":case"image/jpg":return gFi(e);case"image/webp":return _Fi(e);default:throw new Error("Unsupported image format")}}a(NAc,"getImageDimensions");function MAc(t,e){switch(OAc(e)){case"image/png":return AFi(t);case"image/gif":return yFi(t);case"image/jpeg":case"image/jpg":return EFi(t);case"image/webp":return vFi(t);default:throw new Error("Unsupported image format")}}a(MAc,"getImageDimensionsFromBytes");function hFi(t){return AFi(Xvt(t.slice(0,50)))}a(hFi,"getPngDimensions");function mFi(t){return yFi(Xvt(t.slice(0,50)))}a(mFi,"getGifDimensions");function gFi(t){return EFi(Xvt(t))}a(gFi,"getJpegDimensions");function AFi(t){if(!CFi(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(AFi,"getPngDimensionsFromBytes");function yFi(t){if(!kNr(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(yFi,"getGifDimensionsFromBytes");function EFi(t){if(!CFi(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(EFi,"getJpegDimensionsFromBytes");function _Fi(t){return vFi(Xvt(t))}a(_Fi,"getWebPDimensions");function vFi(t){if(!kNr(t,0,"RIFF")||!kNr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=LAc(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(vFi,"getWebPDimensionsFromBytes");function OAc(t){return t?.toLowerCase().split(";")[0].trim()}a(OAc,"normalizeMimeType");function Xvt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(Xvt,"base64ToBytes");function CFi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(eCt,"__esModule",{value:!0});eCt.TokenizerType=void 0;var SFi;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(SFi||(eCt.TokenizerType=SFi={}))});var NNr=I(qne=>{"use strict";p();Object.defineProperty(qne,"__esModule",{value:!0});qne.WorkerWithRpcProxy=qne.RcpResponseHandler=void 0;qne.createRpcProxy=TFi;var FAc=require("worker_threads"),tCt=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()}};qne.RcpResponseHandler=tCt;function TFi(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(TFi,"createRpcProxy");var DNr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new tCt,this.worker=new FAc.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=TFi((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)}};qne.WorkerWithRpcProxy=DNr});var IFi=I($R=>{"use strict";p();Object.defineProperty($R,"__esModule",{value:!0});$R.SlidingWindowAverage=$R.MovingAverage=$R.Counter=void 0;$R.clamp=QAc;$R.rot=qAc;$R.isPointWithinTriangle=jAc;$R.randomChance=HAc;var UAc=rd();function QAc(t,e,r){return Math.min(Math.max(t,e),r)}a(QAc,"clamp");function qAc(t,e){return(e+t%e)%e}a(qAc,"rot");var MNr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};$R.Counter=MNr;var ONr=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}};$R.MovingAverage=ONr;var LNr=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(jAc,"isPointWithinTriangle");function HAc(t){return(0,UAc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(nCt,"__esModule",{value:!0});nCt.TikTokenImpl=void 0;var BNr=iTr(),rCt=IFi(),GAc=FO(),$Ac=cTr(),FNr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new rCt.MovingAverage,textLength:new rCt.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?$Ac.parseTikTokenBinary:c=>c;return this._values.push((0,BNr.createTokenizer)(s(e),(0,BNr.getSpecialTokensByEncoder)(r),(0,BNr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=GAc.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 rCt.MovingAverage,this._stats.textLength=new rCt.MovingAverage,this._stats.callCount=0,r}};nCt.TikTokenImpl=FNr});var K$=I(Rp=>{"use strict";p();var kFi=Rp&&Rp.__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},PFi=Rp&&Rp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.TokenizerProvider=Rp.BaseTokensPerName=Rp.BaseTokensPerMessage=Rp.BaseTokensPerCompletion=Rp.ITokenizerProvider=void 0;Rp.calculateImageTokenCost=jNr;Rp.estimateDocumentTokenCost=NFi;var Y$=Io(),VAc=hDr(),WAc=PNr(),zAc=nn(),wFi=Qne(),YAc=NNr(),KAc=rd(),RFi=eF(),UNr=Ro(),iCt=NA(),DFi=gm(),QNr=xFi();Rp.ITokenizerProvider=(0,zAc.createServiceIdentifier)("ITokenizerProvider");Rp.BaseTokensPerCompletion=3;Rp.BaseTokensPerMessage=3;Rp.BaseTokensPerName=1;var qNr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new RFi.Lazy(()=>new oCt(e,(0,iCt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new RFi.Lazy(()=>new oCt(e,(0,iCt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case wFi.TokenizerType.CL100K:return this._cl100kTokenizer.value;case wFi.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Rp.TokenizerProvider=qNr;Rp.TokenizerProvider=qNr=kFi([PFi(1,DFi.ITelemetryService)],qNr);var oCt=class extends UNr.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 VAc.LRUCache(5e3),this.baseTokensPerMessage=Rp.BaseTokensPerMessage,this.baseTokensPerName=Rp.BaseTokensPerName,this.mode=Y$.OutputMode.Raw}async countMessagesTokens(e){let r=Rp.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 Y$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case Y$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case Y$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return jNr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case Y$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case Y$.Raw.ChatCompletionContentPartKind.Document:return NFi(e.documentData.data);default:(0,KAc.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,Y$.toMode)(Y$.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+=jNr(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,iCt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,iCt.join)(__dirname,"tikTokenizerWorker.js"),n=new YAc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,UNr.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=QNr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,UNr.toDisposable)(()=>{QNr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>QNr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};oCt=kFi([PFi(3,DFi.ITelemetryService)],oCt);function jNr(t,e){let{width:r,height:n}=(0,WAc.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(jNr,"calculateImageTokenCost");function NFi(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(NFi,"estimateDocumentTokenCost")});var J$=I(sCt=>{"use strict";p();Object.defineProperty(sCt,"__esModule",{value:!0});sCt.IDomainService=void 0;var JAc=nn();sCt.IDomainService=(0,JAc.createServiceIdentifier)("IDomainService")});var aCt=I(Qv=>{"use strict";p();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.HeaderContributors=Qv.IHeaderContributors=Qv.userAgentLibraryHeader=void 0;Qv.stringifyUrlOrRequestMetadata=syc;Qv.isCAPIRequestMetadata=GNr;Qv.isCAPIEndpoint=ayc;Qv.createCapiRequestBody=cyc;Qv.canRetryOnceNetworkError=OFi;Qv.postRequest=lyc;Qv.getRequest=uyc;var ZAc=nn(),XAc=Qne(),eyc=Rs(),tyc=$E(),ryc=gm(),nyc=_y(),iyc=H6();Qv.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var oyc=30*1e3;function syc(t){return typeof t=="string"?t:JSON.stringify(t)}a(syc,"stringifyUrlOrRequestMetadata");function GNr(t){return typeof t!="string"}a(GNr,"isCAPIRequestMetadata");function ayc(t){return GNr(t.urlOrRequestMetadata)}a(ayc,"isCAPIEndpoint");function cyc(t,e,r){let n={messages:(0,iyc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(cyc,"createCapiRequestBody");function MFi(t,e){let r=t.get(nyc.IFetcherService),n=t.get(ryc.ITelemetryService),o=t.get(tyc.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:XAc.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:oyc,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 GNr(E.urlOrRequestMetadata)?o.makeRequest(T,E.urlOrRequestMetadata):r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&OFi(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new eyc.CancellationError:R})}a(MFi,"networkRequest");function OFi(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(OFi,"canRetryOnceNetworkError");function lyc(t,e){return MFi(t,{...e,requestType:"POST"})}a(lyc,"postRequest");function uyc(t,e){return MFi(t,{...e,requestType:"GET"})}a(uyc,"getRequest");Qv.IHeaderContributors=(0,ZAc.createServiceIdentifier)("headerContributors");var HNr=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}};Qv.HeaderContributors=HNr});var qFi=I(JE=>{"use strict";p();var dyc=JE&&JE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fyc=JE&&JE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pyc=JE&&JE.__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=1e6){let e=t/1e6,r=Math.floor(e*10)/10;return r%1===0?`${r.toFixed(0)}M`:`${r.toFixed(1)}M`}else{if(t>9e5)return"1M";if(t>=1e3)return`${Math.round(t/1e3)}K`}return t.toString()}a(gyc,"formatTokenCount");function Ayc(t){return ml.t("In: {0} \xB7 Out: {1} AICs/1M tokens",LFi(t.default.inputPrice),LFi(t.default.outputPrice))}a(Ayc,"formatPricingLabel");var BFi=1e6;function yyc(t){if(!t)return;let e=t.batch_size??BFi,r=BFi/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,cacheWritePrice:n.cache_write_price!==void 0?n.cache_write_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,cacheWritePrice:c.cache_write_price!==void 0?c.cache_write_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice||l.cacheWritePrice!==o.cacheWritePrice)&&(s=l)}return{default:o,longContext:s}}}a(yyc,"normalizeTokenPrices")});var r8i=I(by=>{"use strict";p();var Eyc=by&&by.__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},jFi=by&&by.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(by,"__esModule",{value:!0});by.AnthropicMessagesProcessor=void 0;by.buildToolInputSchema=YFi;by.createMessagesRequestBody=Syc;by.rawMessagesToMessagesAPI=KFi;by.clearAllCacheControl=JFi;by.addToolsAndSystemCacheControl=ZFi;by.addMessagesApiCacheControl=XFi;by.processResponseFromMessagesEndpoint=xyc;by.processNonStreamingResponseFromMessagesEndpoint=t8i;var cN=Io(),GFi=nl(),_yc=$Dr(),$Nr=T0(),vyc=jR(),HFi=Pl(),$Fi=Sp(),Rye=Ovt(),VFi=$6(),mBe=H6(),Cyc=ZDr(),WFi=fBe(),byc=mh(),zFi=gm();function YFi(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(YFi,"buildToolInputSchema");function Syc(t,e,r,n){let o=t.get(HFi.IConfigurationService),s=t.get(byc.IExperimentationService),c=t.get(Cyc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===Rye.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:YFi(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&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,Rye.isAnthropicContextEditingEnabled)(n,o,s)?(0,Rye.getContextManagementFromConfig)(o,s,g):void 0,E=t.get($Fi.ILogService),_=t.get(zFi.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,b=KFi(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,Rye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,Rye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;JFi(b),XFi(b,P),ZFi(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:vyc.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(Syc,"createMessagesRequestBody");function KFi(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case cN.Raw.ChatRole.System:{n.push(...cCt(c.content).filter(l=>l.type==="text"));break}case cN.Raw.ChatRole.User:{let l=cCt(c.content);l.length>0&&r.push({role:"user",content:l});break}case cN.Raw.ChatRole.Assistant:{let l=cCt(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 cN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=cCt(c.content),u=!1;for(let g of l)gBe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===Rye.CUSTOM_TOOL_SEARCH_NAME?Tyc(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(KFi,"rawMessagesToMessagesAPI");function Tyc(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(Tyc,"tryParseToolReferences");function cCt(t){let e=[],r=!1;for(let n of t){switch(n.type){case cN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case cN.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 cN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&gBe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case cN.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 cN.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;o.thinking.redacted&&o.thinking.encrypted?e.push({type:"redacted_thinking",data:o.thinking.encrypted}):o.thinking.encrypted&&e.push({type:"thinking",thinking:s||"",signature:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);gBe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(cCt,"rawContentToAnthropicContent");function gBe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(gBe,"contentBlockSupportsCacheControl");function JFi(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(JFi,"clearAllCacheControl");function ZFi(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(ZFi,"addToolsAndSystemCacheControl");function XFi(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"&&gBe(c))&&(Iyc(s,e),n++)}}a(XFi,"addMessagesApiCacheControl");function Iyc(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"&&gBe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(Iyc,"markLastCacheableBlock");async function xyc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new GFi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,$Nr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,VFi.getRequestId)(n.headers),h=t.createInstance(lCt,s,u,d,f),m=new _yc.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,mBe.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,WFi.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()}):t8i(e,r,n,o,s)}a(xyc,"processResponseFromMessagesEndpoint");function wyc(t){switch(t){case"refusal":return mBe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return mBe.FinishedCompletionReason.Length;default:return mBe.FinishedCompletionReason.Stop}}a(wyc,"mapStopReason");function e8i(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(e8i,"buildAnthropicCompletion");async function t8i(t,e,r,n,o){return new GFi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,VFi.getRequestId)(r.headers),u=c||(0,$Nr.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=e8i({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,mBe.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,WFi.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(t8i,"processNonStreamingResponseFromMessagesEndpoint");var lCt=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,$Nr.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,redacted:!0}})}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 e8i({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}]})}}}};by.AnthropicMessagesProcessor=lCt;by.AnthropicMessagesProcessor=lCt=Eyc([jFi(4,$Fi.ILogService),jFi(5,zFi.ITelemetryService)],lCt)});var n8i=I(e9=>{"use strict";p();var Ryc=e9&&e9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kyc=e9&&e9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pyc=e9&&e9.__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===jne.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(Dyc.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===jne.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===jne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==jne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:jne.Raw.ChatCompletionContentPartKind.Text,text:Nyc})})}a(Myc,"filterHistoryImages")});var Gne=I(_1=>{"use strict";p();var c8i=_1&&_1.__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},Om=_1&&_1.__param||function(t,e){return function(r,n){e(r,n,t)}},zNr;Object.defineProperty(_1,"__esModule",{value:!0});_1.RemoteAgentChatEndpoint=_1.ChatEndpoint=void 0;_1.defaultChatResponseProcessor=KNr;_1.defaultNonStreamChatResponseProcessor=A8i;var VNr=(Sne(),ba(bne)),i8i=Io(),Oyc=Qne(),l8i=nl(),o8i=zZe(),Lyc=T0(),u8i=Gs(),Byc=FE(),d8i=K6(),Fyc=jR(),Uyc=nBe(),Hne=Pl(),f8i=Sp(),s8i=Ovt(),Qyc=$6(),qyc=_y(),jyc=aCt(),Hyc=fBe(),p8i=X6(),Gyc=jvt(),h8i=mh(),$yc=gm(),m8i=K$(),Vyc=$E(),ABe=aBe(),g8i=J$(),yBe=s4e(),Wyc=qFi(),a8i=r8i(),WNr=zvt(),zyc=n8i();async function KNr(t,e,r,n,o,s,c){let u=(await Gyc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return l8i.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,Hyc.prepareChatCompletionForReturn)(t,e,f,s)})}a(KNr,"defaultChatResponseProcessor");async function A8i(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,Uyc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Lyc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Qyc.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 l8i.AsyncIterableObject.fromArray(s)}a(A8i,"defaultNonStreamChatResponseProcessor");var uCt=zNr=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,ABe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??Oyc.TokenizerType.O200K,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,Wyc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice,cacheWriteTokenPrice:h.default.cacheWritePrice,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice,cacheWriteTokenPrice:h.longContext.cacheWritePrice,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.modelPickerCategory=e.model_picker_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,ABe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,ABe.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(Hne.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,s8i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,s8i.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:VNr.RequestType.ChatResponses}:this.useMessagesApi?{type:VNr.RequestType.ChatMessages}:{type:VNr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(yBe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(yBe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(yBe.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===i8i.OpenAI.ChatRole.System?{role:i8i.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(WNr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(a8i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,jyc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,ABe.isAnthropicFamily)(this))return 20;if((0,ABe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,zyc.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(Hne.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return this.family.toLowerCase().includes("gemini-3")&&this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,WNr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,WNr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,a8i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?KNr(e,r,n,o,s,c,l):A8i(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(Hne.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===Fyc.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(zNr,(0,o8i.mixin)((0,o8i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};_1.ChatEndpoint=uCt;_1.ChatEndpoint=uCt=zNr=c8i([Om(1,g8i.IDomainService),Om(2,d8i.IChatMLFetcher),Om(3,m8i.ITokenizerProvider),Om(4,u8i.IInstantiationService),Om(5,Hne.IConfigurationService),Om(6,h8i.IExperimentationService),Om(7,p8i.IChatWebSocketManager),Om(8,f8i.ILogService)],uCt);var YNr=class extends uCt{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 KNr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};_1.RemoteAgentChatEndpoint=YNr;_1.RemoteAgentChatEndpoint=YNr=c8i([Om(2,g8i.IDomainService),Om(3,Vyc.ICAPIClientService),Om(4,qyc.IFetcherService),Om(5,$yc.ITelemetryService),Om(6,Byc.IAuthenticationService),Om(7,d8i.IChatMLFetcher),Om(8,m8i.ITokenizerProvider),Om(9,u8i.IInstantiationService),Om(10,Hne.IConfigurationService),Om(11,h8i.IExperimentationService),Om(12,p8i.IChatWebSocketManager),Om(13,f8i.ILogService)],YNr)});var y8i=I(uI=>{"use strict";p();var Yyc=uI&&uI.__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},lI=uI&&uI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uI,"__esModule",{value:!0});uI.CopilotUtilityChatEndpoint=uI.CopilotUtilitySmallChatEndpoint=uI.CopilotChatEndpoint=void 0;var Kyc=Gs(),Jyc=FE(),Zyc=K6(),Xyc=Pl(),eEc=U4(),tEc=Sp(),rEc=_y(),nEc=X6(),iEc=mh(),oEc=gm(),sEc=K$(),aEc=$E(),cEc=J$(),lEc=Gne(),EBe=class extends lEc.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)}}};uI.CopilotChatEndpoint=EBe;uI.CopilotChatEndpoint=EBe=Yyc([lI(1,cEc.IDomainService),lI(2,aEc.ICAPIClientService),lI(3,rEc.IFetcherService),lI(4,eEc.IEnvService),lI(5,oEc.ITelemetryService),lI(6,Jyc.IAuthenticationService),lI(7,Zyc.IChatMLFetcher),lI(8,sEc.ITokenizerProvider),lI(9,Kyc.IInstantiationService),lI(10,Xyc.IConfigurationService),lI(11,iEc.IExperimentationService),lI(12,nEc.IChatWebSocketManager),lI(13,tEc.ILogService)],EBe);var JNr=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(EBe,n)}};uI.CopilotUtilitySmallChatEndpoint=JNr;var ZNr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(EBe,n)}};uI.CopilotUtilityChatEndpoint=ZNr});var XNr=I(TL=>{"use strict";p();var uEc=TL&&TL.__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},dI=TL&&TL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TL,"__esModule",{value:!0});TL.AutoChatEndpoint=void 0;TL.isAutoModel=xEc;var dEc=Gs(),fEc=FE(),pEc=K6(),hEc=Pl(),mEc=U4(),gEc=Sp(),AEc=_y(),yEc=X6(),EEc=mh(),_Ec=gm(),vEc=K$(),CEc=$E(),bEc=J$(),SEc=Gne(),TEc=y8i(),_Be=class extends TEc.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(IEc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};TL.AutoChatEndpoint=_Be;TL.AutoChatEndpoint=_Be=uEc([dI(4,bEc.IDomainService),dI(5,CEc.ICAPIClientService),dI(6,AEc.IFetcherService),dI(7,mEc.IEnvService),dI(8,_Ec.ITelemetryService),dI(9,fEc.IAuthenticationService),dI(10,pEc.IChatMLFetcher),dI(11,vEc.ITokenizerProvider),dI(12,dEc.IInstantiationService),dI(13,hEc.IConfigurationService),dI(14,EEc.IExperimentationService),dI(15,yEc.IChatWebSocketManager),dI(16,gEc.ILogService)],_Be);function IEc(t,e,r){let n;t instanceof SEc.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(IEc,"calculateAutoModelInfo");function xEc(t){return t&&(t.model===_Be.pseudoModelId||t instanceof _Be)?1:-1}a(xEc,"isAutoModel")});var tMr=I(vBe=>{"use strict";p();Object.defineProperty(vBe,"__esModule",{value:!0});vBe.getImageTelemetryEventMeasurements=wEc;vBe.getImageTelemetryMeasurementsFromMessages=REc;vBe.getImageTelemetryMeasurementsFromReferences=kEc;var b8i=PNr(),E8i="screenshot-focused-window";function S8i(){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(S8i,"createEmptyImageTelemetryMeasurements");function wEc(t){return t.imageCount>0?t:{}}a(wEc,"getImageTelemetryEventMeasurements");function REc(t){let e=S8i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=UEc(n,"imageUrl"),s=eMr(o,"url");if(!s)continue;let c=PEc(s,eMr(o,"mediaType"));c&&T8i(e,c)}return e}a(REc,"getImageTelemetryMeasurementsFromMessages");function kEc(t){let e=S8i();for(let r of t??[]){let n=kye(r.value);if(!n)continue;let o=eMr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=v8i(n.data)??v8i(n.value);T8i(e,{mimeType:o,byteLength:s?.byteLength??C8i(n.data)??C8i(n.value),dimensions:MEc(s,o),source:OEc(r,n)})}return e}a(kEc,"getImageTelemetryMeasurementsFromReferences");function T8i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),DEc(t,e.dimensions),I8i(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(T8i,"addImageTelemetryInput");function PEc(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:LEc(r[2]),dimensions:NEc(t),source:"unknown"}}a(PEc,"getImageTelemetryInputFromUrl");function DEc(t,e){if(!e||!_8i(e.width)||!_8i(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(DEc,"addImageDimensions");function _8i(t){return Number.isFinite(t)&&t>0}a(_8i,"isValidDimension");function NEc(t){try{return(0,b8i.getImageDimensions)(t)}catch{return}}a(NEc,"getImageDimensionsFromDataUrl");function MEc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||I8i(r)==="unknown"))try{return(0,b8i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(MEc,"getImageDimensionsFromBytes");function I8i(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(I8i,"normalizeMimeType");function OEc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===E8i||e.id===E8i?"screenshot":e.isURL===!1?"file":"unknown"}a(OEc,"getImageSourceFromReference");function LEc(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(LEc,"getBase64ByteLength");function v8i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=kye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(BEc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(FEc))return new Uint8Array(o)}a(v8i,"getByteData");function BEc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(BEc,"isArrayIndexKey");function FEc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(FEc,"isByteValue");function C8i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=kye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(C8i,"getByteLength");function UEc(t,e){return kye(kye(t)?.[e])}a(UEc,"getObjectProperty");function eMr(t,e){let r=kye(t)?.[e];return typeof r=="string"?r:void 0}a(eMr,"getStringProperty");function kye(t){return typeof t=="object"&&t!==null?t:void 0}a(kye,"asRecord")});var R8i=I(Pye=>{"use strict";p();Object.defineProperty(Pye,"__esModule",{value:!0});Pye.ChatFailKind=Pye.FetchResponseKind=void 0;var x8i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(x8i||(Pye.FetchResponseKind=x8i={}));var w8i;(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"})(w8i||(Pye.ChatFailKind=w8i={}))});var CBe=I(Mu=>{"use strict";p();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FILE_TOOL_NAMES=Mu.SHELL_TOOL_NAMES=Mu.TOOL_PARAM_COMMAND_MAX_LEN=Mu.GitHubCopilotAttr=Mu.CopilotCliSdkAttr=Mu.StdAttr=Mu.CopilotChatAttr=Mu.GenAiAttr=Mu.GenAiToolType=Mu.GenAiTokenType=Mu.GenAiProviderName=Mu.GenAiOperationName=void 0;Mu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Mu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Mu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Mu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Mu.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",REQUEST_STREAM:"gen_ai.request.stream",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",RESPONSE_TIME_TO_FIRST_CHUNK:"gen_ai.response.time_to_first_chunk",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"};Mu.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"};Mu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Mu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Mu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",CLOUD_BACKEND_VERSION:"github.copilot.cloud.backend_version",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"};Mu.TOOL_PARAM_COMMAND_MAX_LEN=256;Mu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Mu.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 nMr=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.truncateForOTel=QEc;VR.toInputMessages=qEc;VR.toOutputMessages=jEc;VR.toSystemInstructions=HEc;VR.extractTextFromContent=rMr;VR.collectSystemTextsFromRequestBody=GEc;VR.normalizeProviderMessages=$Ec;VR.toToolDefinitions=D8i;VR.stringifyToolDefinitionsForOTel=ZEc;VR.stringifyToolsRawForTelemetry=XEc;function QEc(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(QEc,"truncateForOTel");function qEc(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(qEc,"toInputMessages");function jEc(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(jEc,"toOutputMessages");function HEc(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(HEc,"toSystemInstructions");function rMr(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(rMr,"extractTextFromContent");function GEc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=rMr(n.content);o&&e.push(o)}}if(e.length===0){let n=rMr(t.system??t.instructions);n&&e.push(n)}return e}a(GEc,"collectSystemTextsFromRequestBody");function $Ec(t){return t.map(e=>{switch(e.type){case"function_call":return VEc(e);case"function_call_output":return WEc(e);case"tool_search_output":return zEc(e);case"reasoning":return YEc(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($Ec,"normalizeProviderMessages");function VEc(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(VEc,"normalizeResponsesFunctionCall");function WEc(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(WEc,"normalizeResponsesFunctionCallOutput");function zEc(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(zEc,"normalizeResponsesToolSearchOutput");function YEc(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(YEc,"normalizeResponsesReasoning");function D8i(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(D8i,"toToolDefinitions");var k8i=new WeakMap,P8i=new WeakMap,dCt,fCt;function KEc(t){return dCt!==void 0&&dCt===t?dCt:(dCt=t,t)}a(KEc,"internToolDefsString");function JEc(t){return fCt!==void 0&&fCt===t?fCt:(fCt=t,t)}a(JEc,"internToolsRawString");function ZEc(t){if(!t||t.length===0)return;let e=k8i.get(t);if(e!==void 0)return e;let r=D8i(t);if(!r)return;let n=KEc(JSON.stringify(r));return k8i.set(t,n),n}a(ZEc,"stringifyToolDefinitionsForOTel");function XEc(t){if(!t)return;let e=P8i.get(t);if(e!==void 0)return e;let r=JEc(JSON.stringify(t));return P8i.set(t,r),r}a(XEc,"stringifyToolsRawForTelemetry")});var iMr=I(pCt=>{"use strict";p();Object.defineProperty(pCt,"__esModule",{value:!0});pCt.resolveWorkspaceOTelMetadata=e_c;pCt.workspaceMetadataToOTelAttributes=r_c;var N8i=ZP(),M8i=FPr(),Z$=CBe();function e_c(t,e){let r=t.activeRepository?.get();return r?t_c(r,e):{}}a(e_c,"resolveWorkspaceOTelMetadata");function t_c(t,e){let r,n=Array.from((0,M8i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,M8i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,N8i.isEqualOrParent)(e,t.rootUri)&&(o=(0,N8i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(t_c,"buildWorkspaceMetadata");function r_c(t){if(!t)return{};let e={};if(t.headBranchName&&(e[Z$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[Z$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[Z$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[Z$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[Z$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[Z$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=n_c(t.remoteUrl);r&&(e[Z$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[Z$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(r_c,"workspaceMetadataToOTelAttributes");function n_c(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(n_c,"extractGitHubOrg")});var O8i=I(WR=>{"use strict";p();Object.defineProperty(WR,"__esModule",{value:!0});WR.emitInferenceDetailsEvent=i_c;WR.emitSessionStartEvent=o_c;WR.emitToolCallEvent=s_c;WR.emitAgentTurnEvent=a_c;WR.emitEditFeedbackEvent=c_c;WR.emitEditHunkActionEvent=l_c;WR.emitInlineDoneEvent=u_c;WR.emitEditSurvivalEvent=d_c;WR.emitUserFeedbackEvent=f_c;WR.emitCloudSessionInvokeEvent=p_c;var Lm=CBe(),Dye=nMr(),hCt=iMr();function i_c(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Lm.GenAiAttr.OPERATION_NAME]:Lm.GenAiOperationName.CHAT,[Lm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Lm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Lm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Lm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Lm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Lm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Lm.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[Lm.GenAiAttr.INPUT_MESSAGES]=(0,Dye.truncateForOTel)(JSON.stringify(c?(0,Dye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,Dye.toSystemInstructions)(c);l!==void 0&&(o[Lm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,Dye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,Dye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Lm.GenAiAttr.TOOL_DEFINITIONS]=(0,Dye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(i_c,"emitInferenceDetailsEvent");function o_c(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Lm.GenAiAttr.REQUEST_MODEL]:r,[Lm.GenAiAttr.AGENT_NAME]:n})}a(o_c,"emitSessionStartEvent");function s_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Lm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Lm.StdAttr.ERROR_TYPE]:o}:{}})}a(s_c,"emitToolCallEvent");function a_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Lm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(a_c,"emitAgentTurnEvent");function c_c(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,hCt.workspaceMetadataToOTelAttributes)(u)})}a(c_c,"emitEditFeedbackEvent");function l_c(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,hCt.workspaceMetadataToOTelAttributes)(l)})}a(l_c,"emitEditHunkActionEvent");function u_c(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,hCt.workspaceMetadataToOTelAttributes)(l)})}a(u_c,"emitInlineDoneEvent");function d_c(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,hCt.workspaceMetadataToOTelAttributes)(l)})}a(d_c,"emitEditSurvivalEvent");function f_c(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(f_c,"emitUserFeedbackEvent");function p_c(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(p_c,"emitCloudSessionInvokeEvent")});var L8i=I(mCt=>{"use strict";p();Object.defineProperty(mCt,"__esModule",{value:!0});mCt.GenAiMetrics=void 0;var No=CBe(),oMr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[No.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[No.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[No.GenAiAttr.OPERATION_NAME]:o.operationName,[No.GenAiAttr.PROVIDER_NAME]:o.providerName,[No.GenAiAttr.TOKEN_TYPE]:n,[No.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[No.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[No.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[No.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[No.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[No.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,n){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r,...n?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[No.StdAttr.ERROR_TYPE]:o})}};mCt.GenAiMetrics=oMr});var aMr=I(gCt=>{"use strict";p();Object.defineProperty(gCt,"__esModule",{value:!0});gCt.NoopOTelService=void 0;var B8i=Ic(),F8i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},sMr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=B8i.Event.None,this.onDidEmitSpanEvent=B8i.Event.None,this.config=e}startSpan(e,r){return F8i}startActiveSpan(e,r,n){return n(F8i)}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){}};gCt.NoopOTelService=sMr});var cMr=I($ne=>{"use strict";p();Object.defineProperty($ne,"__esModule",{value:!0});$ne.DEFAULT_OTLP_ENDPOINT=void 0;$ne.resolveOTelConfig=g_c;$ne.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function h_c(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(h_c,"parseResourceAttributes");function m_c(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(m_c,"parseOtlpEndpoint");function g_c(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return U8i(t);let r=t.settingDbSpanExporter??!1,n=(bBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(bBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return U8i(t);let s;bBe(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??$ne.DEFAULT_OTLP_ENDPOINT,d=m_c(u,l)??$ne.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=bBe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=A_c(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",_=bBe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=h_c(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(g_c,"resolveOTelConfig");function U8i(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(U8i,"createDisabledConfig");function bBe(t){if(t!==void 0)return t==="true"||t==="1"}a(bBe,"envBool");function A_c(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(A_c,"parseMaxAttributeSizeChars")});var yCt=I(ACt=>{"use strict";p();Object.defineProperty(ACt,"__esModule",{value:!0});ACt.IOTelService=void 0;var y_c=nn();ACt.IOTelService=(0,y_c.createServiceIdentifier)("IOTelService")});var Q8i=I(lMr=>{"use strict";p();Object.defineProperty(lMr,"__esModule",{value:!0});lMr.normalizeResponseModel=E_c;function E_c(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(E_c,"normalizeResponseModel")});var H8i=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 zR=CBe();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return zR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return zR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return zR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return zR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return zR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return zR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return zR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return zR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return zR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return zR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return zR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return zR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var IL=O8i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return IL.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return IL.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return IL.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return IL.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return IL.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return IL.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return IL.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return IL.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitUserFeedbackEvent},"get")});var __c=L8i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return __c.GenAiMetrics},"get")});var xL=nMr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return xL.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return xL.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return xL.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return xL.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return xL.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return xL.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return xL.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return xL.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return xL.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return xL.truncateForOTel},"get")});var v_c=aMr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return v_c.NoopOTelService},"get")});var q8i=cMr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return q8i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return q8i.DEFAULT_OTLP_ENDPOINT},"get")});var C_c=yCt();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return C_c.IOTelService},"get")});var b_c=Q8i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return b_c.normalizeResponseModel},"get")});var j8i=iMr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return j8i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return j8i.workspaceMetadataToOTelAttributes},"get")})});var fMr=I(X$=>{"use strict";p();Object.defineProperty(X$,"__esModule",{value:!0});X$.AbstractRequestLogger=void 0;X$.getCurrentCapturingToken=x_c;X$.storeCapturingTokenForCorrelation=w_c;X$.retrieveCapturingTokenByCorrelation=R_c;X$.runWithCapturingToken=k_c;var S_c=require("async_hooks"),T_c=lye(),I_c=Ro(),SBe=new S_c.AsyncLocalStorage,uMr=new Map;function x_c(){return SBe.getStore()}a(x_c,"getCurrentCapturingToken");function w_c(t){let e=SBe.getStore();e&&uMr.set(t,e)}a(w_c,"storeCapturingTokenForCorrelation");function R_c(t){let e=uMr.get(t);return e&&uMr.delete(t),e}a(R_c,"retrieveCapturingTokenByCorrelation");function k_c(t,e){return SBe.run(t,e)}a(k_c,"runWithCapturingToken");var dMr=class extends I_c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return SBe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new T_c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return SBe.getStore()}};X$.AbstractRequestLogger=dMr});var G8i=I(pMr=>{"use strict";p();Object.defineProperty(pMr,"__esModule",{value:!0});pMr.isEncryptedThinkingDelta=P_c;function P_c(t){return t.encrypted!==void 0}a(P_c,"isEncryptedThinkingDelta")});var V8i=I(ECt=>{"use strict";p();Object.defineProperty(ECt,"__esModule",{value:!0});ECt.calculateLineRepetitionStats=N_c;ECt.isRepetitive=M_c;var D_c=[{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 N_c(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(N_c,"calculateLineRepetitionStats");function M_c(t){let e=t.slice();return e.reverse(),$8i(e)||$8i(e.filter(r=>r.trim().length>0))}a(M_c,"isRepetitive");function $8i(t){let e=O_c(t);for(let r of D_c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(O_c,"kmp_prefix_function")});var hMr=I(wL=>{"use strict";p();var L_c=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},eV=wL&&wL.__param||function(t,e){return function(r,n){e(r,n,t)}},YR;Object.defineProperty(wL,"__esModule",{value:!0});wL.OpenAIEndpoint=void 0;wL.isBYOKModel=z_c;var B_c=K6(),W8i=jR(),z8i=Pl(),F_c=J$(),U_c=Gne(),Q_c=Sp(),q_c=$6(),j_c=aCt(),H_c=X6(),G_c=mh(),$_c=K$(),V_c=Gs();function W_c(t){return t.type===W8i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===W8i.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 aAc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...hFi(c,l),top_logprobs:l.top_logprobs?.map(u=>hFi(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:e9.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e9.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:e9.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=BAc(s.response.output,this.latestCompactionOutputIndex),l=AFi(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,bNr.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,bNr.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:Bf.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(SL.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Bf.FinishedCompletionReason.Length:c==="content_filter"?(l=Bf.FinishedCompletionReason.ContentFilter,u=UAc(s.content_filters)):l=Bf.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:pFi(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Bf.FinishedCompletionReason.ServerError,{error:pFi(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(SL.isDefined)}}}};qv.OpenAIResponsesProcessor=Jvt;qv.OpenAIResponsesProcessor=Jvt=nAc([iAc(6,uAc.ILogService)],Jvt);function hFi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,sAc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(hFi,"mapLogProp")});var EFi=I(Xvt=>{"use strict";p();Object.defineProperty(Xvt,"__esModule",{value:!0});Xvt.ChatWebSocketTelemetrySender=void 0;var wNr=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})}};Xvt.ChatWebSocketTelemetrySender=wNr});var t9=I(E1=>{"use strict";p();var QAc=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},eCt=E1&&E1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(E1,"__esModule",{value:!0});E1.ChatWebSocketManager=E1.NullChatWebSocketManager=E1.IChatWebSocketManager=void 0;E1.isCAPIWebSocketError=NNr;var qAc=nn(),jAc=Rs(),tCt=Ic(),_Fi=ko(),vFi=Dl(),HAc=VE(),kye=Ip(),GAc=ym(),$Ac=vy(),VAc=Zvt(),Z$=EFi();E1.IChatWebSocketManager=(0,qAc.createServiceIdentifier)("IChatWebSocketManager");var RNr=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(){}};E1.NullChatWebSocketManager=RNr;function NNr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(NNr,"isCAPIWebSocketError");var WAc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function zAc(t){return WAc[t.type]}a(zAc,"getStreamTerminatingOutcome");var kNr=class extends _Fi.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 PNr(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()}};E1.ChatWebSocketManager=kNr;E1.ChatWebSocketManager=kNr=QAc([eCt(0,kye.ILogService),eCt(1,HAc.ICAPIClientService),eCt(2,GAc.ITelemetryService),eCt(3,vFi.IConfigurationService)],kNr);function rCt(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(rCt,"wsCloseCodeToString");var PNr=class extends _Fi.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 tCt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new $Ac.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}`),Z$.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,kye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,kye.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})`:""}`),Z$.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=rCt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),Z$.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,kye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),Z$.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}!NNr(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=rCt(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})`),Z$.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,kye.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}`),Z$.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,VAc.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 DNr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-E,z=this._totalSentMessageCount-_,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;Z$.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:V,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:z,requestReceivedMessageCount:ie,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})}),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,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})`),Z$.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()}},DNr=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 tCt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new tCt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new tCt.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(vFi.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,kye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),NNr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=zAc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${rCt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${rCt(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 jAc.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 ONr=I(TL=>{"use strict";p();Object.defineProperty(TL,"__esModule",{value:!0});TL.getImageDimensions=YAc;TL.getImageDimensionsFromBytes=KAc;TL.getPngDimensions=CFi;TL.getGifDimensions=bFi;TL.getJpegDimensions=SFi;TL.getWebPDimensions=wFi;TL.getMimeType=PFi;TL.extractImageAttributes=XAc;function YAc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(PFi(e)){case"image/png":return CFi(e);case"image/gif":return bFi(e);case"image/jpeg":case"image/jpg":return SFi(e);case"image/webp":return wFi(e);default:throw new Error("Unsupported image format")}}a(YAc,"getImageDimensions");function KAc(t,e){switch(JAc(e)){case"image/png":return TFi(t);case"image/gif":return IFi(t);case"image/jpeg":case"image/jpg":return xFi(t);case"image/webp":return RFi(t);default:throw new Error("Unsupported image format")}}a(KAc,"getImageDimensionsFromBytes");function CFi(t){return TFi(nCt(t.slice(0,50)))}a(CFi,"getPngDimensions");function bFi(t){return IFi(nCt(t.slice(0,50)))}a(bFi,"getGifDimensions");function SFi(t){return xFi(nCt(t))}a(SFi,"getJpegDimensions");function TFi(t){if(!kFi(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(TFi,"getPngDimensionsFromBytes");function IFi(t){if(!MNr(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(IFi,"getGifDimensionsFromBytes");function xFi(t){if(!kFi(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(xFi,"getJpegDimensionsFromBytes");function wFi(t){return RFi(nCt(t))}a(wFi,"getWebPDimensions");function RFi(t){if(!MNr(t,0,"RIFF")||!MNr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=ZAc(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(RFi,"getWebPDimensionsFromBytes");function JAc(t){return t?.toLowerCase().split(";")[0].trim()}a(JAc,"normalizeMimeType");function nCt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(nCt,"base64ToBytes");function kFi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(iCt,"__esModule",{value:!0});iCt.TokenizerType=void 0;var DFi;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(DFi||(iCt.TokenizerType=DFi={}))});var BNr=I(jne=>{"use strict";p();Object.defineProperty(jne,"__esModule",{value:!0});jne.WorkerWithRpcProxy=jne.RcpResponseHandler=void 0;jne.createRpcProxy=NFi;var eyc=require("worker_threads"),oCt=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()}};jne.RcpResponseHandler=oCt;function NFi(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(NFi,"createRpcProxy");var LNr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new oCt,this.worker=new eyc.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=NFi((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)}};jne.WorkerWithRpcProxy=LNr});var MFi=I(WR=>{"use strict";p();Object.defineProperty(WR,"__esModule",{value:!0});WR.SlidingWindowAverage=WR.MovingAverage=WR.Counter=void 0;WR.clamp=ryc;WR.rot=nyc;WR.isPointWithinTriangle=iyc;WR.randomChance=oyc;var tyc=nd();function ryc(t,e,r){return Math.min(Math.max(t,e),r)}a(ryc,"clamp");function nyc(t,e){return(e+t%e)%e}a(nyc,"rot");var FNr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};WR.Counter=FNr;var UNr=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}};WR.MovingAverage=UNr;var QNr=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(iyc,"isPointWithinTriangle");function oyc(t){return(0,tyc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(aCt,"__esModule",{value:!0});aCt.TikTokenImpl=void 0;var qNr=cTr(),sCt=MFi(),syc=QO(),ayc=fTr(),jNr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new sCt.MovingAverage,textLength:new sCt.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?ayc.parseTikTokenBinary:c=>c;return this._values.push((0,qNr.createTokenizer)(s(e),(0,qNr.getSpecialTokensByEncoder)(r),(0,qNr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=syc.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 sCt.MovingAverage,this._stats.textLength=new sCt.MovingAverage,this._stats.callCount=0,r}};aCt.TikTokenImpl=jNr});var eV=I(Pp=>{"use strict";p();var FFi=Pp&&Pp.__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},UFi=Pp&&Pp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.TokenizerProvider=Pp.BaseTokensPerName=Pp.BaseTokensPerMessage=Pp.BaseTokensPerCompletion=Pp.ITokenizerProvider=void 0;Pp.calculateImageTokenCost=VNr;Pp.estimateDocumentTokenCost=qFi;var X$=xo(),cyc=yDr(),lyc=ONr(),uyc=nn(),LFi=qne(),dyc=BNr(),fyc=nd(),BFi=rF(),HNr=ko(),cCt=MA(),QFi=ym(),GNr=OFi();Pp.ITokenizerProvider=(0,uyc.createServiceIdentifier)("ITokenizerProvider");Pp.BaseTokensPerCompletion=3;Pp.BaseTokensPerMessage=3;Pp.BaseTokensPerName=1;var $Nr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new BFi.Lazy(()=>new lCt(e,(0,cCt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new BFi.Lazy(()=>new lCt(e,(0,cCt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case LFi.TokenizerType.CL100K:return this._cl100kTokenizer.value;case LFi.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Pp.TokenizerProvider=$Nr;Pp.TokenizerProvider=$Nr=FFi([UFi(1,QFi.ITelemetryService)],$Nr);var lCt=class extends HNr.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 cyc.LRUCache(5e3),this.baseTokensPerMessage=Pp.BaseTokensPerMessage,this.baseTokensPerName=Pp.BaseTokensPerName,this.mode=X$.OutputMode.Raw}async countMessagesTokens(e){let r=Pp.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 X$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case X$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case X$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return VNr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case X$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case X$.Raw.ChatCompletionContentPartKind.Document:return qFi(e.documentData.data);default:(0,fyc.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,X$.toMode)(X$.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+=VNr(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,cCt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,cCt.join)(__dirname,"tikTokenizerWorker.js"),n=new dyc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,HNr.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=GNr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,HNr.toDisposable)(()=>{GNr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>GNr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};lCt=FFi([UFi(3,QFi.ITelemetryService)],lCt);function VNr(t,e){let{width:r,height:n}=(0,lyc.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(VNr,"calculateImageTokenCost");function qFi(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(qFi,"estimateDocumentTokenCost")});var tV=I(uCt=>{"use strict";p();Object.defineProperty(uCt,"__esModule",{value:!0});uCt.IDomainService=void 0;var pyc=nn();uCt.IDomainService=(0,pyc.createServiceIdentifier)("IDomainService")});var dCt=I(jv=>{"use strict";p();Object.defineProperty(jv,"__esModule",{value:!0});jv.HeaderContributors=jv.IHeaderContributors=jv.userAgentLibraryHeader=void 0;jv.stringifyUrlOrRequestMetadata=Cyc;jv.isCAPIRequestMetadata=zNr;jv.isCAPIEndpoint=byc;jv.createCapiRequestBody=Syc;jv.canRetryOnceNetworkError=HFi;jv.postRequest=Tyc;jv.getRequest=Iyc;var hyc=nn(),myc=qne(),gyc=Rs(),Ayc=VE(),yyc=ym(),Eyc=vy(),_yc=$6();jv.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var vyc=30*1e3;function Cyc(t){return typeof t=="string"?t:JSON.stringify(t)}a(Cyc,"stringifyUrlOrRequestMetadata");function zNr(t){return typeof t!="string"}a(zNr,"isCAPIRequestMetadata");function byc(t){return zNr(t.urlOrRequestMetadata)}a(byc,"isCAPIEndpoint");function Syc(t,e,r){let n={messages:(0,_yc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(Syc,"createCapiRequestBody");function jFi(t,e){let r=t.get(Eyc.IFetcherService),n=t.get(yyc.ITelemetryService),o=t.get(Ayc.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:myc.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:vyc,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 zNr(E.urlOrRequestMetadata)?o.makeRequest(T,E.urlOrRequestMetadata):r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&HFi(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new gyc.CancellationError:R})}a(jFi,"networkRequest");function HFi(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(HFi,"canRetryOnceNetworkError");function Tyc(t,e){return jFi(t,{...e,requestType:"POST"})}a(Tyc,"postRequest");function Iyc(t,e){return jFi(t,{...e,requestType:"GET"})}a(Iyc,"getRequest");jv.IHeaderContributors=(0,hyc.createServiceIdentifier)("headerContributors");var WNr=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}};jv.HeaderContributors=WNr});var YFi=I(ZE=>{"use strict";p();var xyc=ZE&&ZE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wyc=ZE&&ZE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ryc=ZE&&ZE.__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=1e6){let e=t/1e6,r=Math.floor(e*10)/10;return r%1===0?`${r.toFixed(0)}M`:`${r.toFixed(1)}M`}else{if(t>9e5)return"1M";if(t>=1e3)return`${Math.round(t/1e3)}K`}return t.toString()}a(Dyc,"formatTokenCount");function Nyc(t){return gl.t("In: {0} \xB7 Out: {1} AICs/1M tokens",GFi(t.default.inputPrice),GFi(t.default.outputPrice))}a(Nyc,"formatPricingLabel");var $Fi=1e6;function Myc(t){if(!t)return;let e=t.batch_size??$Fi,r=$Fi/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,cacheWritePrice:n.cache_write_price!==void 0?n.cache_write_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,cacheWritePrice:c.cache_write_price!==void 0?c.cache_write_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice||l.cacheWritePrice!==o.cacheWritePrice)&&(s=l)}return{default:o,longContext:s}}}a(Myc,"normalizeTokenPrices")});var u8i=I(Sy=>{"use strict";p();var Oyc=Sy&&Sy.__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},KFi=Sy&&Sy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Sy,"__esModule",{value:!0});Sy.AnthropicMessagesProcessor=void 0;Sy.buildToolInputSchema=n8i;Sy.createMessagesRequestBody=Qyc;Sy.rawMessagesToMessagesAPI=i8i;Sy.clearAllCacheControl=o8i;Sy.addToolsAndSystemCacheControl=s8i;Sy.addMessagesApiCacheControl=a8i;Sy.processResponseFromMessagesEndpoint=Hyc;Sy.processNonStreamingResponseFromMessagesEndpoint=l8i;var dN=xo(),ZFi=nl(),Lyc=YDr(),YNr=I0(),Byc=GR(),JFi=Dl(),XFi=Ip(),Pye=Uvt(),e8i=W6(),_Be=$6(),Fyc=rNr(),t8i=ABe(),Uyc=Ah(),r8i=ym();function n8i(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(n8i,"buildToolInputSchema");function Qyc(t,e,r,n){let o=t.get(JFi.IConfigurationService),s=t.get(Uyc.IExperimentationService),c=t.get(Fyc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===Pye.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:n8i(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&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,Pye.isAnthropicContextEditingEnabled)(n,o,s)?(0,Pye.getContextManagementFromConfig)(o,s,g):void 0,E=t.get(XFi.ILogService),_=t.get(r8i.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,b=i8i(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,Pye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,Pye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;o8i(b),a8i(b,P),s8i(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:Byc.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(Qyc,"createMessagesRequestBody");function i8i(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case dN.Raw.ChatRole.System:{n.push(...fCt(c.content).filter(l=>l.type==="text"));break}case dN.Raw.ChatRole.User:{let l=fCt(c.content);l.length>0&&r.push({role:"user",content:l});break}case dN.Raw.ChatRole.Assistant:{let l=fCt(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 dN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=fCt(c.content),u=!1;for(let g of l)vBe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===Pye.CUSTOM_TOOL_SEARCH_NAME?qyc(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(i8i,"rawMessagesToMessagesAPI");function qyc(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(qyc,"tryParseToolReferences");function fCt(t){let e=[],r=!1;for(let n of t){switch(n.type){case dN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case dN.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 dN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&vBe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case dN.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 dN.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;o.thinking.redacted&&o.thinking.encrypted?e.push({type:"redacted_thinking",data:o.thinking.encrypted}):o.thinking.encrypted&&e.push({type:"thinking",thinking:s||"",signature:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);vBe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(fCt,"rawContentToAnthropicContent");function vBe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(vBe,"contentBlockSupportsCacheControl");function o8i(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(o8i,"clearAllCacheControl");function s8i(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(s8i,"addToolsAndSystemCacheControl");function a8i(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"&&vBe(c))&&(jyc(s,e),n++)}}a(a8i,"addMessagesApiCacheControl");function jyc(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"&&vBe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(jyc,"markLastCacheableBlock");async function Hyc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new ZFi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,YNr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,e8i.getRequestId)(n.headers),h=t.createInstance(pCt,s,u,d,f),m=new Lyc.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,_Be.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,t8i.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()}):l8i(e,r,n,o,s)}a(Hyc,"processResponseFromMessagesEndpoint");function Gyc(t){switch(t){case"refusal":return _Be.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return _Be.FinishedCompletionReason.Length;default:return _Be.FinishedCompletionReason.Stop}}a(Gyc,"mapStopReason");function c8i(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(c8i,"buildAnthropicCompletion");async function l8i(t,e,r,n,o){return new ZFi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,e8i.getRequestId)(r.headers),u=c||(0,YNr.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=c8i({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,_Be.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,t8i.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(l8i,"processNonStreamingResponseFromMessagesEndpoint");var pCt=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,YNr.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,redacted:!0}})}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 c8i({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}]})}}}};Sy.AnthropicMessagesProcessor=pCt;Sy.AnthropicMessagesProcessor=pCt=Oyc([KFi(4,XFi.ILogService),KFi(5,r8i.ITelemetryService)],pCt)});var d8i=I(r9=>{"use strict";p();var $yc=r9&&r9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vyc=r9&&r9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Wyc=r9&&r9.__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===Hne.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(zyc.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===Hne.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===Hne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Hne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Hne.Raw.ChatCompletionContentPartKind.Text,text:Yyc})})}a(Kyc,"filterHistoryImages")});var $ne=I(_1=>{"use strict";p();var g8i=_1&&_1.__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},Bm=_1&&_1.__param||function(t,e){return function(r,n){e(r,n,t)}},ZNr;Object.defineProperty(_1,"__esModule",{value:!0});_1.RemoteAgentChatEndpoint=_1.ChatEndpoint=void 0;_1.defaultChatResponseProcessor=eMr;_1.defaultNonStreamChatResponseProcessor=T8i;var KNr=(Tne(),Sa(Sne)),f8i=xo(),Jyc=qne(),A8i=nl(),p8i=eXe(),Zyc=I0(),y8i=Gs(),Xyc=UE(),E8i=Z6(),eEc=GR(),tEc=cBe(),Gne=Dl(),_8i=Ip(),h8i=Uvt(),rEc=W6(),nEc=vy(),iEc=dCt(),oEc=ABe(),v8i=t9(),sEc=Vvt(),C8i=Ah(),aEc=ym(),b8i=eV(),cEc=VE(),CBe=fBe(),S8i=tV(),bBe=d4e(),lEc=YFi(),m8i=u8i(),JNr=Zvt(),uEc=d8i();async function eMr(t,e,r,n,o,s,c){let u=(await sEc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return A8i.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,oEc.prepareChatCompletionForReturn)(t,e,f,s)})}a(eMr,"defaultChatResponseProcessor");async function T8i(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,tEc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Zyc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,rEc.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 A8i.AsyncIterableObject.fromArray(s)}a(T8i,"defaultNonStreamChatResponseProcessor");var hCt=ZNr=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,CBe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??Jyc.TokenizerType.O200K,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,lEc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice,cacheWriteTokenPrice:h.default.cacheWritePrice,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice,cacheWriteTokenPrice:h.longContext.cacheWritePrice,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.modelPickerCategory=e.model_picker_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,CBe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,CBe.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(Gne.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,h8i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,h8i.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:KNr.RequestType.ChatResponses}:this.useMessagesApi?{type:KNr.RequestType.ChatMessages}:{type:KNr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(bBe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(bBe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(bBe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(bBe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Gne.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(bBe.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===f8i.OpenAI.ChatRole.System?{role:f8i.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(JNr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(m8i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,iEc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,CBe.isAnthropicFamily)(this))return 20;if((0,CBe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,uEc.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(Gne.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return this.family.toLowerCase().includes("gemini-3")&&this._configurationService.getExperimentBasedConfig(Gne.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,JNr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,JNr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,m8i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?eMr(e,r,n,o,s,c,l):T8i(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(Gne.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===eEc.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(ZNr,(0,p8i.mixin)((0,p8i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};_1.ChatEndpoint=hCt;_1.ChatEndpoint=hCt=ZNr=g8i([Bm(1,S8i.IDomainService),Bm(2,E8i.IChatMLFetcher),Bm(3,b8i.ITokenizerProvider),Bm(4,y8i.IInstantiationService),Bm(5,Gne.IConfigurationService),Bm(6,C8i.IExperimentationService),Bm(7,v8i.IChatWebSocketManager),Bm(8,_8i.ILogService)],hCt);var XNr=class extends hCt{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 eMr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};_1.RemoteAgentChatEndpoint=XNr;_1.RemoteAgentChatEndpoint=XNr=g8i([Bm(2,S8i.IDomainService),Bm(3,cEc.ICAPIClientService),Bm(4,nEc.IFetcherService),Bm(5,aEc.ITelemetryService),Bm(6,Xyc.IAuthenticationService),Bm(7,E8i.IChatMLFetcher),Bm(8,b8i.ITokenizerProvider),Bm(9,y8i.IInstantiationService),Bm(10,Gne.IConfigurationService),Bm(11,C8i.IExperimentationService),Bm(12,v8i.IChatWebSocketManager),Bm(13,_8i.ILogService)],XNr)});var I8i=I(fI=>{"use strict";p();var dEc=fI&&fI.__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},dI=fI&&fI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fI,"__esModule",{value:!0});fI.CopilotUtilityChatEndpoint=fI.CopilotUtilitySmallChatEndpoint=fI.CopilotChatEndpoint=void 0;var fEc=Gs(),pEc=UE(),hEc=Z6(),mEc=Dl(),gEc=Q4(),AEc=Ip(),yEc=vy(),EEc=t9(),_Ec=Ah(),vEc=ym(),CEc=eV(),bEc=VE(),SEc=tV(),TEc=$ne(),SBe=class extends TEc.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)}}};fI.CopilotChatEndpoint=SBe;fI.CopilotChatEndpoint=SBe=dEc([dI(1,SEc.IDomainService),dI(2,bEc.ICAPIClientService),dI(3,yEc.IFetcherService),dI(4,gEc.IEnvService),dI(5,vEc.ITelemetryService),dI(6,pEc.IAuthenticationService),dI(7,hEc.IChatMLFetcher),dI(8,CEc.ITokenizerProvider),dI(9,fEc.IInstantiationService),dI(10,mEc.IConfigurationService),dI(11,_Ec.IExperimentationService),dI(12,EEc.IChatWebSocketManager),dI(13,AEc.ILogService)],SBe);var tMr=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(SBe,n)}};fI.CopilotUtilitySmallChatEndpoint=tMr;var rMr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(SBe,n)}};fI.CopilotUtilityChatEndpoint=rMr});var nMr=I(IL=>{"use strict";p();var IEc=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},pI=IL&&IL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(IL,"__esModule",{value:!0});IL.AutoChatEndpoint=void 0;IL.isAutoModel=HEc;var xEc=Gs(),wEc=UE(),REc=Z6(),kEc=Dl(),PEc=Q4(),DEc=Ip(),NEc=vy(),MEc=t9(),OEc=Ah(),LEc=ym(),BEc=eV(),FEc=VE(),UEc=tV(),QEc=$ne(),qEc=I8i(),TBe=class extends qEc.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(jEc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};IL.AutoChatEndpoint=TBe;IL.AutoChatEndpoint=TBe=IEc([pI(4,UEc.IDomainService),pI(5,FEc.ICAPIClientService),pI(6,NEc.IFetcherService),pI(7,PEc.IEnvService),pI(8,LEc.ITelemetryService),pI(9,wEc.IAuthenticationService),pI(10,REc.IChatMLFetcher),pI(11,BEc.ITokenizerProvider),pI(12,xEc.IInstantiationService),pI(13,kEc.IConfigurationService),pI(14,OEc.IExperimentationService),pI(15,MEc.IChatWebSocketManager),pI(16,DEc.ILogService)],TBe);function jEc(t,e,r){let n;t instanceof QEc.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(jEc,"calculateAutoModelInfo");function HEc(t){return t&&(t.model===TBe.pseudoModelId||t instanceof TBe)?1:-1}a(HEc,"isAutoModel")});var oMr=I(IBe=>{"use strict";p();Object.defineProperty(IBe,"__esModule",{value:!0});IBe.getImageTelemetryEventMeasurements=GEc;IBe.getImageTelemetryMeasurementsFromMessages=$Ec;IBe.getImageTelemetryMeasurementsFromReferences=VEc;var P8i=ONr(),x8i="screenshot-focused-window";function D8i(){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(D8i,"createEmptyImageTelemetryMeasurements");function GEc(t){return t.imageCount>0?t:{}}a(GEc,"getImageTelemetryEventMeasurements");function $Ec(t){let e=D8i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=t_c(n,"imageUrl"),s=iMr(o,"url");if(!s)continue;let c=WEc(s,iMr(o,"mediaType"));c&&N8i(e,c)}return e}a($Ec,"getImageTelemetryMeasurementsFromMessages");function VEc(t){let e=D8i();for(let r of t??[]){let n=Dye(r.value);if(!n)continue;let o=iMr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=R8i(n.data)??R8i(n.value);N8i(e,{mimeType:o,byteLength:s?.byteLength??k8i(n.data)??k8i(n.value),dimensions:KEc(s,o),source:JEc(r,n)})}return e}a(VEc,"getImageTelemetryMeasurementsFromReferences");function N8i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),zEc(t,e.dimensions),M8i(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(N8i,"addImageTelemetryInput");function WEc(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:ZEc(r[2]),dimensions:YEc(t),source:"unknown"}}a(WEc,"getImageTelemetryInputFromUrl");function zEc(t,e){if(!e||!w8i(e.width)||!w8i(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(zEc,"addImageDimensions");function w8i(t){return Number.isFinite(t)&&t>0}a(w8i,"isValidDimension");function YEc(t){try{return(0,P8i.getImageDimensions)(t)}catch{return}}a(YEc,"getImageDimensionsFromDataUrl");function KEc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||M8i(r)==="unknown"))try{return(0,P8i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(KEc,"getImageDimensionsFromBytes");function M8i(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(M8i,"normalizeMimeType");function JEc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===x8i||e.id===x8i?"screenshot":e.isURL===!1?"file":"unknown"}a(JEc,"getImageSourceFromReference");function ZEc(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(ZEc,"getBase64ByteLength");function R8i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=Dye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(XEc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(e_c))return new Uint8Array(o)}a(R8i,"getByteData");function XEc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(XEc,"isArrayIndexKey");function e_c(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(e_c,"isByteValue");function k8i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=Dye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(k8i,"getByteLength");function t_c(t,e){return Dye(Dye(t)?.[e])}a(t_c,"getObjectProperty");function iMr(t,e){let r=Dye(t)?.[e];return typeof r=="string"?r:void 0}a(iMr,"getStringProperty");function Dye(t){return typeof t=="object"&&t!==null?t:void 0}a(Dye,"asRecord")});var B8i=I(Nye=>{"use strict";p();Object.defineProperty(Nye,"__esModule",{value:!0});Nye.ChatFailKind=Nye.FetchResponseKind=void 0;var O8i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(O8i||(Nye.FetchResponseKind=O8i={}));var L8i;(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"})(L8i||(Nye.ChatFailKind=L8i={}))});var xBe=I(Mu=>{"use strict";p();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FILE_TOOL_NAMES=Mu.SHELL_TOOL_NAMES=Mu.TOOL_PARAM_COMMAND_MAX_LEN=Mu.GitHubCopilotAttr=Mu.CopilotCliSdkAttr=Mu.StdAttr=Mu.CopilotChatAttr=Mu.GenAiAttr=Mu.GenAiToolType=Mu.GenAiTokenType=Mu.GenAiProviderName=Mu.GenAiOperationName=void 0;Mu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Mu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Mu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Mu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Mu.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",REQUEST_STREAM:"gen_ai.request.stream",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",RESPONSE_TIME_TO_FIRST_CHUNK:"gen_ai.response.time_to_first_chunk",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"};Mu.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"};Mu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Mu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Mu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",CLOUD_BACKEND_VERSION:"github.copilot.cloud.backend_version",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"};Mu.TOOL_PARAM_COMMAND_MAX_LEN=256;Mu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Mu.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 aMr=I(zR=>{"use strict";p();Object.defineProperty(zR,"__esModule",{value:!0});zR.truncateForOTel=r_c;zR.toInputMessages=n_c;zR.toOutputMessages=i_c;zR.toSystemInstructions=o_c;zR.extractTextFromContent=sMr;zR.collectSystemTextsFromRequestBody=s_c;zR.normalizeProviderMessages=a_c;zR.toToolDefinitions=Q8i;zR.stringifyToolDefinitionsForOTel=h_c;zR.stringifyToolsRawForTelemetry=m_c;function r_c(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(r_c,"truncateForOTel");function n_c(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(n_c,"toInputMessages");function i_c(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(i_c,"toOutputMessages");function o_c(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(o_c,"toSystemInstructions");function sMr(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(sMr,"extractTextFromContent");function s_c(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=sMr(n.content);o&&e.push(o)}}if(e.length===0){let n=sMr(t.system??t.instructions);n&&e.push(n)}return e}a(s_c,"collectSystemTextsFromRequestBody");function a_c(t){return t.map(e=>{switch(e.type){case"function_call":return c_c(e);case"function_call_output":return l_c(e);case"tool_search_output":return u_c(e);case"reasoning":return d_c(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(a_c,"normalizeProviderMessages");function c_c(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(c_c,"normalizeResponsesFunctionCall");function l_c(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(l_c,"normalizeResponsesFunctionCallOutput");function u_c(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(u_c,"normalizeResponsesToolSearchOutput");function d_c(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(d_c,"normalizeResponsesReasoning");function Q8i(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(Q8i,"toToolDefinitions");var F8i=new WeakMap,U8i=new WeakMap,mCt,gCt;function f_c(t){return mCt!==void 0&&mCt===t?mCt:(mCt=t,t)}a(f_c,"internToolDefsString");function p_c(t){return gCt!==void 0&&gCt===t?gCt:(gCt=t,t)}a(p_c,"internToolsRawString");function h_c(t){if(!t||t.length===0)return;let e=F8i.get(t);if(e!==void 0)return e;let r=Q8i(t);if(!r)return;let n=f_c(JSON.stringify(r));return F8i.set(t,n),n}a(h_c,"stringifyToolDefinitionsForOTel");function m_c(t){if(!t)return;let e=U8i.get(t);if(e!==void 0)return e;let r=p_c(JSON.stringify(t));return U8i.set(t,r),r}a(m_c,"stringifyToolsRawForTelemetry")});var cMr=I(ACt=>{"use strict";p();Object.defineProperty(ACt,"__esModule",{value:!0});ACt.resolveWorkspaceOTelMetadata=g_c;ACt.workspaceMetadataToOTelAttributes=y_c;var q8i=e2(),j8i=jPr(),rV=xBe();function g_c(t,e){let r=t.activeRepository?.get();return r?A_c(r,e):{}}a(g_c,"resolveWorkspaceOTelMetadata");function A_c(t,e){let r,n=Array.from((0,j8i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,j8i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,q8i.isEqualOrParent)(e,t.rootUri)&&(o=(0,q8i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(A_c,"buildWorkspaceMetadata");function y_c(t){if(!t)return{};let e={};if(t.headBranchName&&(e[rV.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[rV.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[rV.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[rV.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[rV.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[rV.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=E_c(t.remoteUrl);r&&(e[rV.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[rV.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(y_c,"workspaceMetadataToOTelAttributes");function E_c(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(E_c,"extractGitHubOrg")});var H8i=I(YR=>{"use strict";p();Object.defineProperty(YR,"__esModule",{value:!0});YR.emitInferenceDetailsEvent=__c;YR.emitSessionStartEvent=v_c;YR.emitToolCallEvent=C_c;YR.emitAgentTurnEvent=b_c;YR.emitEditFeedbackEvent=S_c;YR.emitEditHunkActionEvent=T_c;YR.emitInlineDoneEvent=I_c;YR.emitEditSurvivalEvent=x_c;YR.emitUserFeedbackEvent=w_c;YR.emitCloudSessionInvokeEvent=R_c;var Fm=xBe(),Mye=aMr(),yCt=cMr();function __c(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Fm.GenAiAttr.OPERATION_NAME]:Fm.GenAiOperationName.CHAT,[Fm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Fm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Fm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Fm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Fm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Fm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Fm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Fm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Fm.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[Fm.GenAiAttr.INPUT_MESSAGES]=(0,Mye.truncateForOTel)(JSON.stringify(c?(0,Mye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,Mye.toSystemInstructions)(c);l!==void 0&&(o[Fm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,Mye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,Mye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Fm.GenAiAttr.TOOL_DEFINITIONS]=(0,Mye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(__c,"emitInferenceDetailsEvent");function v_c(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Fm.GenAiAttr.REQUEST_MODEL]:r,[Fm.GenAiAttr.AGENT_NAME]:n})}a(v_c,"emitSessionStartEvent");function C_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Fm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Fm.StdAttr.ERROR_TYPE]:o}:{}})}a(C_c,"emitToolCallEvent");function b_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Fm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Fm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(b_c,"emitAgentTurnEvent");function S_c(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,yCt.workspaceMetadataToOTelAttributes)(u)})}a(S_c,"emitEditFeedbackEvent");function T_c(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,yCt.workspaceMetadataToOTelAttributes)(l)})}a(T_c,"emitEditHunkActionEvent");function I_c(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,yCt.workspaceMetadataToOTelAttributes)(l)})}a(I_c,"emitInlineDoneEvent");function x_c(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,yCt.workspaceMetadataToOTelAttributes)(l)})}a(x_c,"emitEditSurvivalEvent");function w_c(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(w_c,"emitUserFeedbackEvent");function R_c(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(R_c,"emitCloudSessionInvokeEvent")});var G8i=I(ECt=>{"use strict";p();Object.defineProperty(ECt,"__esModule",{value:!0});ECt.GenAiMetrics=void 0;var Mo=xBe(),lMr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[Mo.GenAiAttr.OPERATION_NAME]:n.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Mo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[Mo.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[Mo.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[Mo.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[Mo.GenAiAttr.OPERATION_NAME]:o.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:o.providerName,[Mo.GenAiAttr.TOKEN_TYPE]:n,[Mo.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[Mo.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[Mo.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[Mo.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[Mo.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[Mo.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[Mo.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[Mo.GenAiAttr.OPERATION_NAME]:n.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Mo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[Mo.GenAiAttr.OPERATION_NAME]:n.operationName,[Mo.GenAiAttr.PROVIDER_NAME]:n.providerName,[Mo.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Mo.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Mo.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Mo.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[Mo.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[Mo.CopilotChatAttr.EDIT_SOURCE]:r,[Mo.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[Mo.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,n){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r,...n?{[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[Mo.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[Mo.StdAttr.ERROR_TYPE]:o})}};ECt.GenAiMetrics=lMr});var dMr=I(_Ct=>{"use strict";p();Object.defineProperty(_Ct,"__esModule",{value:!0});_Ct.NoopOTelService=void 0;var $8i=Ic(),V8i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},uMr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=$8i.Event.None,this.onDidEmitSpanEvent=$8i.Event.None,this.config=e}startSpan(e,r){return V8i}startActiveSpan(e,r,n){return n(V8i)}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){}};_Ct.NoopOTelService=uMr});var fMr=I(Vne=>{"use strict";p();Object.defineProperty(Vne,"__esModule",{value:!0});Vne.DEFAULT_OTLP_ENDPOINT=void 0;Vne.resolveOTelConfig=D_c;Vne.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function k_c(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(k_c,"parseResourceAttributes");function P_c(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(P_c,"parseOtlpEndpoint");function D_c(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return W8i(t);let r=t.settingDbSpanExporter??!1,n=(wBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(wBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return W8i(t);let s;wBe(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??Vne.DEFAULT_OTLP_ENDPOINT,d=P_c(u,l)??Vne.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=wBe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=N_c(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",_=wBe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=k_c(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(D_c,"resolveOTelConfig");function W8i(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(W8i,"createDisabledConfig");function wBe(t){if(t!==void 0)return t==="true"||t==="1"}a(wBe,"envBool");function N_c(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(N_c,"parseMaxAttributeSizeChars")});var CCt=I(vCt=>{"use strict";p();Object.defineProperty(vCt,"__esModule",{value:!0});vCt.IOTelService=void 0;var M_c=nn();vCt.IOTelService=(0,M_c.createServiceIdentifier)("IOTelService")});var z8i=I(pMr=>{"use strict";p();Object.defineProperty(pMr,"__esModule",{value:!0});pMr.normalizeResponseModel=O_c;function O_c(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(O_c,"normalizeResponseModel")});var J8i=I(Fr=>{"use strict";p();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.workspaceMetadataToOTelAttributes=Fr.resolveWorkspaceOTelMetadata=Fr.normalizeResponseModel=Fr.IOTelService=Fr.DEFAULT_OTLP_ENDPOINT=Fr.resolveOTelConfig=Fr.NoopOTelService=Fr.truncateForOTel=Fr.toToolDefinitions=Fr.toSystemInstructions=Fr.toOutputMessages=Fr.toInputMessages=Fr.stringifyToolsRawForTelemetry=Fr.stringifyToolDefinitionsForOTel=Fr.normalizeProviderMessages=Fr.extractTextFromContent=Fr.collectSystemTextsFromRequestBody=Fr.GenAiMetrics=Fr.emitUserFeedbackEvent=Fr.emitToolCallEvent=Fr.emitSessionStartEvent=Fr.emitInlineDoneEvent=Fr.emitInferenceDetailsEvent=Fr.emitEditSurvivalEvent=Fr.emitEditHunkActionEvent=Fr.emitEditFeedbackEvent=Fr.emitCloudSessionInvokeEvent=Fr.emitAgentTurnEvent=Fr.TOOL_PARAM_COMMAND_MAX_LEN=Fr.StdAttr=Fr.SHELL_TOOL_NAMES=Fr.GitHubCopilotAttr=Fr.GenAiToolType=Fr.GenAiTokenType=Fr.GenAiProviderName=Fr.GenAiOperationName=Fr.GenAiAttr=Fr.FILE_TOOL_NAMES=Fr.CopilotCliSdkAttr=Fr.CopilotChatAttr=void 0;var KR=xBe();Object.defineProperty(Fr,"CopilotChatAttr",{enumerable:!0,get:a(function(){return KR.CopilotChatAttr},"get")});Object.defineProperty(Fr,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return KR.CopilotCliSdkAttr},"get")});Object.defineProperty(Fr,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return KR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Fr,"GenAiAttr",{enumerable:!0,get:a(function(){return KR.GenAiAttr},"get")});Object.defineProperty(Fr,"GenAiOperationName",{enumerable:!0,get:a(function(){return KR.GenAiOperationName},"get")});Object.defineProperty(Fr,"GenAiProviderName",{enumerable:!0,get:a(function(){return KR.GenAiProviderName},"get")});Object.defineProperty(Fr,"GenAiTokenType",{enumerable:!0,get:a(function(){return KR.GenAiTokenType},"get")});Object.defineProperty(Fr,"GenAiToolType",{enumerable:!0,get:a(function(){return KR.GenAiToolType},"get")});Object.defineProperty(Fr,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return KR.GitHubCopilotAttr},"get")});Object.defineProperty(Fr,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return KR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Fr,"StdAttr",{enumerable:!0,get:a(function(){return KR.StdAttr},"get")});Object.defineProperty(Fr,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return KR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var xL=H8i();Object.defineProperty(Fr,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return xL.emitAgentTurnEvent},"get")});Object.defineProperty(Fr,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return xL.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Fr,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return xL.emitEditFeedbackEvent},"get")});Object.defineProperty(Fr,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return xL.emitEditHunkActionEvent},"get")});Object.defineProperty(Fr,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return xL.emitEditSurvivalEvent},"get")});Object.defineProperty(Fr,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return xL.emitInferenceDetailsEvent},"get")});Object.defineProperty(Fr,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return xL.emitInlineDoneEvent},"get")});Object.defineProperty(Fr,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return xL.emitSessionStartEvent},"get")});Object.defineProperty(Fr,"emitToolCallEvent",{enumerable:!0,get:a(function(){return xL.emitToolCallEvent},"get")});Object.defineProperty(Fr,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return xL.emitUserFeedbackEvent},"get")});var L_c=G8i();Object.defineProperty(Fr,"GenAiMetrics",{enumerable:!0,get:a(function(){return L_c.GenAiMetrics},"get")});var wL=aMr();Object.defineProperty(Fr,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return wL.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Fr,"extractTextFromContent",{enumerable:!0,get:a(function(){return wL.extractTextFromContent},"get")});Object.defineProperty(Fr,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return wL.normalizeProviderMessages},"get")});Object.defineProperty(Fr,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return wL.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Fr,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return wL.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Fr,"toInputMessages",{enumerable:!0,get:a(function(){return wL.toInputMessages},"get")});Object.defineProperty(Fr,"toOutputMessages",{enumerable:!0,get:a(function(){return wL.toOutputMessages},"get")});Object.defineProperty(Fr,"toSystemInstructions",{enumerable:!0,get:a(function(){return wL.toSystemInstructions},"get")});Object.defineProperty(Fr,"toToolDefinitions",{enumerable:!0,get:a(function(){return wL.toToolDefinitions},"get")});Object.defineProperty(Fr,"truncateForOTel",{enumerable:!0,get:a(function(){return wL.truncateForOTel},"get")});var B_c=dMr();Object.defineProperty(Fr,"NoopOTelService",{enumerable:!0,get:a(function(){return B_c.NoopOTelService},"get")});var Y8i=fMr();Object.defineProperty(Fr,"resolveOTelConfig",{enumerable:!0,get:a(function(){return Y8i.resolveOTelConfig},"get")});Object.defineProperty(Fr,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return Y8i.DEFAULT_OTLP_ENDPOINT},"get")});var F_c=CCt();Object.defineProperty(Fr,"IOTelService",{enumerable:!0,get:a(function(){return F_c.IOTelService},"get")});var U_c=z8i();Object.defineProperty(Fr,"normalizeResponseModel",{enumerable:!0,get:a(function(){return U_c.normalizeResponseModel},"get")});var K8i=cMr();Object.defineProperty(Fr,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return K8i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Fr,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return K8i.workspaceMetadataToOTelAttributes},"get")})});var gMr=I(nV=>{"use strict";p();Object.defineProperty(nV,"__esModule",{value:!0});nV.AbstractRequestLogger=void 0;nV.getCurrentCapturingToken=H_c;nV.storeCapturingTokenForCorrelation=G_c;nV.retrieveCapturingTokenByCorrelation=$_c;nV.runWithCapturingToken=V_c;var Q_c=require("async_hooks"),q_c=dye(),j_c=ko(),RBe=new Q_c.AsyncLocalStorage,hMr=new Map;function H_c(){return RBe.getStore()}a(H_c,"getCurrentCapturingToken");function G_c(t){let e=RBe.getStore();e&&hMr.set(t,e)}a(G_c,"storeCapturingTokenForCorrelation");function $_c(t){let e=hMr.get(t);return e&&hMr.delete(t),e}a($_c,"retrieveCapturingTokenByCorrelation");function V_c(t,e){return RBe.run(t,e)}a(V_c,"runWithCapturingToken");var mMr=class extends j_c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return RBe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new q_c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return RBe.getStore()}};nV.AbstractRequestLogger=mMr});var Z8i=I(AMr=>{"use strict";p();Object.defineProperty(AMr,"__esModule",{value:!0});AMr.isEncryptedThinkingDelta=W_c;function W_c(t){return t.encrypted!==void 0}a(W_c,"isEncryptedThinkingDelta")});var e6i=I(bCt=>{"use strict";p();Object.defineProperty(bCt,"__esModule",{value:!0});bCt.calculateLineRepetitionStats=Y_c;bCt.isRepetitive=K_c;var z_c=[{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 Y_c(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(Y_c,"calculateLineRepetitionStats");function K_c(t){let e=t.slice();return e.reverse(),X8i(e)||X8i(e.filter(r=>r.trim().length>0))}a(K_c,"isRepetitive");function X8i(t){let e=J_c(t);for(let r of z_c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(J_c,"kmp_prefix_function")});var yMr=I(RL=>{"use strict";p();var Z_c=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},iV=RL&&RL.__param||function(t,e){return function(r,n){e(r,n,t)}},JR;Object.defineProperty(RL,"__esModule",{value:!0});RL.OpenAIEndpoint=void 0;RL.isBYOKModel=uvc;var X_c=Z6(),t6i=GR(),r6i=Dl(),evc=tV(),tvc=$ne(),rvc=Ip(),nvc=W6(),ivc=dCt(),ovc=t9(),svc=Ah(),avc=eV(),cvc=Gs();function lvc(t){return t.type===t6i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===t6i.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(W_c,"hydrateBYOKErrorMessages");function z_c(t){return t?t instanceof _Ct||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(z_c,"isBYOKModel");var _Ct=class extends U_c.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{YR=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 YR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>YR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${YR._maxCustomHeaderCount}. Only first ${YR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=YR._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>YR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${YR._maxHeaderNameLength} characters, skipping.`);continue}if(!YR._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>YR._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,j_c.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(z8i.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,q_c.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(YR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return W_c(o)}};wL.OpenAIEndpoint=_Ct;wL.OpenAIEndpoint=_Ct=YR=L_c([eV(3,F_c.IDomainService),eV(4,B_c.IChatMLFetcher),eV(5,$_c.ITokenizerProvider),eV(6,V_c.IInstantiationService),eV(7,z8i.IConfigurationService),eV(8,G_c.IExperimentationService),eV(9,H_c.IChatWebSocketManager),eV(10,Q_c.ILogService)],_Ct)});var Y8i=I(lN=>{"use strict";p();Object.defineProperty(lN,"__esModule",{value:!0});lN.EXTENSION_ID=lN.agentsToCommands=lN.GITHUB_PLATFORM_AGENT=void 0;lN.getAgentForIntent=K_c;var Y_c=jR();lN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";lN.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 K_c(t,e){if(Object.keys(lN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(lN.agentsToCommands))if(!(e===Y_c.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(K_c,"getAgentForIntent");lN.EXTENSION_ID="GitHub.copilot-chat"});var Z8i=I(vCt=>{"use strict";p();Object.defineProperty(vCt,"__esModule",{value:!0});vCt.ChatMLFetcherTelemetrySender=void 0;var K8i=XNr(),mMr=tMr(),J8i=hMr();function J_c(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(J_c,"getTurnFromBaseTelemetry");function gMr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(gMr,"sendResponseTelemetryEvent");var AMr=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}){gMr(e,"response.success",{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:J_c(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,mMr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,J8i.isBYOKModel)(c),isAuto:(0,K8i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},g)}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:L,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){gMr(e,"response.cancelled",{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:q,isVisionRequest:D,...(0,mMr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},M)}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}){gMr(e,"response.error",{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,mMr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,J8i.isBYOKModel)(o),isAuto:(0,K8i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},f)}};vCt.ChatMLFetcherTelemetrySender=AMr});var s6i=I(pI=>{"use strict";p();var Z_c=pI&&pI.__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},qv=pI&&pI.__param||function(t,e){return function(r,n){e(r,n,t)}},CMr;Object.defineProperty(pI,"__esModule",{value:!0});pI.ChatMLFetcherImpl=pI.AbstractChatMLFetcher=void 0;pI.createTelemetryData=o6i;pI.locationToIntent=TCt;var X_c=Io(),evc=FE(),tvc=K6(),rvc=QDr(),zn=jR(),nvc=qDr(),TBe=nBe(),ivc=HDr(),tV=Pl(),ovc=$E(),CCt=XNr(),IBe=zvt(),svc=tMr(),bMr=Sp(),yMr=$6(),avc=_y(),bCt=aCt(),fI=H6(),X8i=fBe(),i6i=X6(),e6i=jvt(),gn=R8i(),on=H8i(),cvc=yCt(),lvc=lye(),EMr=fMr(),uvc=mh(),SMr=gm(),Mye=Tye(),dvc=G8i(),SCt=V8i(),fvc=X_(),t6i=nl(),r6i=Rs(),pvc=Ic(),hvc=Ro(),mvc=em(),_Mr=T0(),gvc=Gs(),n6i=hMr(),Avc=Y8i(),yvc=BDr(),Nye=Z8i(),ICt=class extends hvc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new pvc.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===zn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};pI.AbstractChatMLFetcher=ICt;var TMr=class extends ICt{static{a(this,"ChatMLFetcherImpl")}static{CMr=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??TCt(c);E&&this._consecutiveWebSocketRetryFallbacks>=CMr._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,_Mr.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,svc.getImageTelemetryMeasurementsFromMessages)(l),D=Mye.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:zn.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 tvc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,j,Q,U,Y,W,V,z;try{let ie,H=Evc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ge,Ue=a(()=>ge??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ke;try{ke=await this._authenticationService.getCopilotToken()}catch{}O=ke?.username??this._authenticationService.copilotToken?.username;let X=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,ke,e.location,T,R.n,r,Ue,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=X.result,j=X.fetcher,Q=X.bytesReceived,U=X.statusCode,Y=X.suspendEventSeen,W=X.resumeEventSeen,V=X.modelCallId,z=X.otelSpan,z?.setAttribute(on.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),Z=he?.[he.length-1];if(Z?.content){let ne=typeof Z.content=="string"?Z.content:JSON.stringify(Z.content);z.setAttribute(on.CopilotChatAttr.USER_REQUEST,(0,on.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let ue=(0,on.collectSystemTextsFromRequestBody)(x),qe=(0,on.toSystemInstructions)(ue);qe&&z.setAttribute(on.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,on.truncateForOTel)(JSON.stringify(qe),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let qe=K.filter(ne=>ne.role!=="system");z.setAttribute(on.GenAiAttr.INPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify((0,on.normalizeProviderMessages)(qe)),this._otelService.config.maxAttributeSizeChars))}let he=(0,on.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(on.GenAiAttr.TOOL_DEFINITIONS,(0,on.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let Z=_vc(x);Z&&z.setAttribute(on.CopilotChatAttr.REQUEST_OPTIONS,(0,on.truncateForOTel)(JSON.stringify(Z),this._otelService.config.maxAttributeSizeChars));let ue=vvc(x);ue&&z.setAttribute(on.CopilotChatAttr.REQUEST_SHAPE,(0,on.truncateForOTel)(JSON.stringify(ue),this._otelService.config.maxAttributeSizeChars))}L=await Ue();let ee=d?.extensionId??Avc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:L})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case gn.FetchResponseKind.Success:{let ge=await this.processSuccessfulResponse(ie,l,P,x,T,w,L,re,B,D,o,h,v,b,j,Q,Y,W,V);if(ge.type===zn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ge.category});let Ue=ge.value[0];if(Ue){let ke=ge.category===fI.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: ${Ue} +`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(lvc,"hydrateBYOKErrorMessages");function uvc(t){return t?t instanceof SCt||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(uvc,"isBYOKModel");var SCt=class extends tvc.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{JR=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 JR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>JR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${JR._maxCustomHeaderCount}. Only first ${JR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=JR._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>JR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${JR._maxHeaderNameLength} characters, skipping.`);continue}if(!JR._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>JR._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,ivc.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(r6i.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,nvc.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(JR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return lvc(o)}};RL.OpenAIEndpoint=SCt;RL.OpenAIEndpoint=SCt=JR=Z_c([iV(3,evc.IDomainService),iV(4,X_c.IChatMLFetcher),iV(5,avc.ITokenizerProvider),iV(6,cvc.IInstantiationService),iV(7,r6i.IConfigurationService),iV(8,svc.IExperimentationService),iV(9,ovc.IChatWebSocketManager),iV(10,rvc.ILogService)],SCt)});var n6i=I(fN=>{"use strict";p();Object.defineProperty(fN,"__esModule",{value:!0});fN.EXTENSION_ID=fN.agentsToCommands=fN.GITHUB_PLATFORM_AGENT=void 0;fN.getAgentForIntent=fvc;var dvc=GR();fN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";fN.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 fvc(t,e){if(Object.keys(fN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(fN.agentsToCommands))if(!(e===dvc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(fvc,"getAgentForIntent");fN.EXTENSION_ID="GitHub.copilot-chat"});var s6i=I(TCt=>{"use strict";p();Object.defineProperty(TCt,"__esModule",{value:!0});TCt.ChatMLFetcherTelemetrySender=void 0;var i6i=nMr(),EMr=oMr(),o6i=yMr();function pvc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(pvc,"getTurnFromBaseTelemetry");function _Mr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(_Mr,"sendResponseTelemetryEvent");var vMr=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}){_Mr(e,"response.success",{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:pvc(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,EMr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,o6i.isBYOKModel)(c),isAuto:(0,i6i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},g)}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:L,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){_Mr(e,"response.cancelled",{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:q,isVisionRequest:D,...(0,EMr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},M)}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}){_Mr(e,"response.error",{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,EMr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,o6i.isBYOKModel)(o),isAuto:(0,i6i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},f)}};TCt.ChatMLFetcherTelemetrySender=vMr});var h6i=I(mI=>{"use strict";p();var hvc=mI&&mI.__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},Hv=mI&&mI.__param||function(t,e){return function(r,n){e(r,n,t)}},IMr;Object.defineProperty(mI,"__esModule",{value:!0});mI.ChatMLFetcherImpl=mI.AbstractChatMLFetcher=void 0;mI.createTelemetryData=p6i;mI.locationToIntent=RCt;var mvc=xo(),gvc=UE(),Avc=Z6(),yvc=GDr(),Wn=GR(),Evc=$Dr(),kBe=cBe(),_vc=WDr(),oV=Dl(),vvc=VE(),ICt=nMr(),PBe=Zvt(),Cvc=oMr(),xMr=Ip(),CMr=W6(),bvc=vy(),xCt=dCt(),hI=$6(),a6i=ABe(),f6i=t9(),c6i=Vvt(),gn=B8i(),on=J8i(),Svc=CCt(),Tvc=dye(),bMr=gMr(),Ivc=Ah(),wMr=ym(),Lye=xye(),xvc=Z8i(),wCt=e6i(),wvc=tv(),l6i=nl(),u6i=Rs(),Rvc=Ic(),kvc=ko(),Pvc=rm(),SMr=I0(),Dvc=Gs(),d6i=yMr(),Nvc=n6i(),Mvc=qDr(),Oye=s6i(),kCt=class extends kvc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new Rvc.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}};mI.AbstractChatMLFetcher=kCt;var RMr=class extends kCt{static{a(this,"ChatMLFetcherImpl")}static{IMr=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??RCt(c);E&&this._consecutiveWebSocketRetryFallbacks>=IMr._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,SMr.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,Cvc.getImageTelemetryMeasurementsFromMessages)(l),D=Lye.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}),L=-1,B=new Avc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,j,Q,U,Y,W,V,z;try{let ie,H=Ovc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ge,Ue=a(()=>ge??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ke;try{ke=await this._authenticationService.getCopilotToken()}catch{}O=ke?.username??this._authenticationService.copilotToken?.username;let X=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,ke,e.location,T,R.n,r,Ue,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=X.result,j=X.fetcher,Q=X.bytesReceived,U=X.statusCode,Y=X.suspendEventSeen,W=X.resumeEventSeen,V=X.modelCallId,z=X.otelSpan,z?.setAttribute(on.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),Z=he?.[he.length-1];if(Z?.content){let ne=typeof Z.content=="string"?Z.content:JSON.stringify(Z.content);z.setAttribute(on.CopilotChatAttr.USER_REQUEST,(0,on.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let ue=(0,on.collectSystemTextsFromRequestBody)(x),qe=(0,on.toSystemInstructions)(ue);qe&&z.setAttribute(on.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,on.truncateForOTel)(JSON.stringify(qe),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let qe=K.filter(ne=>ne.role!=="system");z.setAttribute(on.GenAiAttr.INPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify((0,on.normalizeProviderMessages)(qe)),this._otelService.config.maxAttributeSizeChars))}let he=(0,on.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(on.GenAiAttr.TOOL_DEFINITIONS,(0,on.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let Z=Lvc(x);Z&&z.setAttribute(on.CopilotChatAttr.REQUEST_OPTIONS,(0,on.truncateForOTel)(JSON.stringify(Z),this._otelService.config.maxAttributeSizeChars));let ue=Bvc(x);ue&&z.setAttribute(on.CopilotChatAttr.REQUEST_SHAPE,(0,on.truncateForOTel)(JSON.stringify(ue),this._otelService.config.maxAttributeSizeChars))}L=await Ue();let ee=d?.extensionId??Nvc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:L})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case gn.FetchResponseKind.Success:{let ge=await this.processSuccessfulResponse(ie,l,P,x,T,w,L,re,B,D,o,h,v,b,j,Q,Y,W,V);if(ge.type===Wn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ge.category});let Ue=ge.value[0];if(Ue){let ke=ge.category===hI.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: ${Ue} `:`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: ${Ue} -`,X=[...l,{role:X_c.Raw.ChatRole.User,content:(0,TBe.toTextParts)(ke)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:X,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ge.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===zn.ChatFetchResponseType.Success)return ee}}return{type:zn.ChatFetchResponseType.Filtered,category:ge.category,reason:"Response got filtered.",requestId:ge.requestId,serverRequestId:ge.serverRequestId}}if(N?.resolve(ge,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),ge.type===zn.ChatFetchResponseType.Success&&ge.usage){typeof ge.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ge.usage.copilot_usage.total_nano_aiu,y??A),le=(0,on.normalizeResponseModel)(o.model,ge.resolvedModel);let Ue={operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};ge.usage.prompt_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.prompt_tokens,"input",Ue),ge.usage.completion_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.completion_tokens,"output",Ue),z?.setAttributes({[on.GenAiAttr.USAGE_INPUT_TOKENS]:ge.usage.prompt_tokens??0,[on.GenAiAttr.USAGE_OUTPUT_TOKENS]:ge.usage.completion_tokens??0,[on.GenAiAttr.RESPONSE_MODEL]:le??o.model,[on.GenAiAttr.RESPONSE_ID]:ge.requestId,[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ge.usage.prompt_tokens_details?.cached_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cached_tokens}:{},...ge.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[on.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[on.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[on.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...ge.serverRequestId?{[on.CopilotChatAttr.SERVER_REQUEST_ID]:ge.serverRequestId}:{},...ge.usage.completion_tokens_details?.reasoning_tokens?{[on.GenAiAttr.USAGE_REASONING_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens,[on.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ge.usage.copilot_usage?.total_nano_aiu=="number"?{[on.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ge.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&ge.type===zn.ChatFetchResponseType.Success){let Ue=B.deltas.map(K=>K.text).join(""),ke=B.deltas.filter(K=>K.copilotToolCalls?.length).flatMap(K=>K.copilotToolCalls.map(he=>({type:"tool_call",id:he.id,name:he.name,arguments:he.arguments}))),X=[];if(Ue&&X.push({type:"text",content:Ue}),X.push(...ke),X.length>0&&z.setAttribute(on.GenAiAttr.OUTPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify([{role:"assistant",parts:X}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(Z=>Z.thinking&&!(0,dvc.isEncryptedThinkingDelta)(Z.thinking)&&Z.thinking.text).map(Z=>{let ue=Z.thinking;return"encrypted"in ue?"":Array.isArray(ue.text)?ue.text.join(""):ue.text??""}).join("");z.setAttribute(on.CopilotChatAttr.REASONING_CONTENT,(0,on.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,on.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ge.type===zn.ChatFetchResponseType.Success?{id:ge.requestId,model:(0,on.normalizeResponseModel)(o.model,ge.resolvedModel),finishReasons:["stop"],inputTokens:ge.usage?.prompt_tokens,outputTokens:ge.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&on.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&on.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Ue of B.outputChunkGapsMs)on.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Ue/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return E&&ge.type===zn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ge}case gn.FetchResponseKind.Canceled:return Nye.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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,n6i.isBYOKModel)(o),isAuto:(0,CCt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),z?.setAttributes({[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[on.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case gn.FetchResponseKind.Failed:{let ge=this.processFailedResponse(ie,T,(0,CCt.isAutoModel)(o)===1),ke=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),X=q&&U!==void 0&&ke.includes(U),ee=q&&E&&(ie.failKind===gn.ChatFailKind.ServerError||ie.failKind===gn.ChatFailKind.Unknown);if(X||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:ge,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:j,bytesReceived:Q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ge,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(ge),ge}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(on.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(on.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(j=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,O,(0,CCt.isAutoModel)(o)===1),le=q&&re.type===zn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&E&&(re.type===zn.ChatFetchResponseType.NetworkError||re.type===zn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:ge,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:j,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(ge)return ge;f={...f,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}}return re.type===zn.ChatFetchResponseType.Canceled?Nye.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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,n6i.isBYOKModel)(o),isAuto:(0,CCt.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,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,bMr.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(tV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===zn.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 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};Nye.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===zn.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(tV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==zn.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} (${zn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${zn.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(B){throw P&&(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:gn.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,EMr.getCurrentCapturingToken)()?.chatSessionId,P=(0,EMr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,EMr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[on.GenAiAttr.OPERATION_NAME]:on.GenAiOperationName.CHAT,[on.GenAiAttr.PROVIDER_NAME]:on.GenAiProviderName.GITHUB,[on.GenAiAttr.REQUEST_MODEL]:e.model,[on.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[on.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[on.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[on.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[on.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[on.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[on.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[on.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[on.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[on.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,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,e6i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.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(on.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;on.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=TCt(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,_Mr.generateUuid)(),R=Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,yMr.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,on.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,SMr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,on.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}),L=this._instantiationService.createInstance(IBe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,IBe.getResponsesApiCompactionThresholdFromBody)(r)),B=new t6i.AsyncIterableObject(async M=>{try{await new Promise((j,Q)=>{D.onEvent(U=>{let Y=L.push(U,o);if(Y&&((0,IBe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let Y=new Error(`${U.error.message} (${U.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=U,Q(Y)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,r6i.isCancellationError)(U)){Q(U);return}let Y=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.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(j,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 j=(0,IBe.responseApiInputToRawMessagesForLogging)(r);O=(0,fI.rawMessageToCAPI)(j)}catch(j){this._logService.error("Failed to convert Response API input to messages for telemetry:",j),O=[]}(0,X8i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,i6i.isCAPIWebSocketError)(q)){let M=Date.now()-P;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:gn.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,_Mr.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:gn.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=o6i(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 t6i.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:gn.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=Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.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,on.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,SMr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,on.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=TCt(s);return this._instantiationService.invokeFunction(bCt.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,yMr.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,bCt.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,bCt.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,IBe.responseApiInputToRawMessagesForLogging)(n);E=(0,fI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,X8i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,yMr.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,X=[...l,{role:mvc.Raw.ChatRole.User,content:(0,kBe.toTextParts)(ke)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:X,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ge.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===Wn.ChatFetchResponseType.Success)return ee}}return{type:Wn.ChatFetchResponseType.Filtered,category:ge.category,reason:"Response got filtered.",requestId:ge.requestId,serverRequestId:ge.serverRequestId}}if(N?.resolve(ge,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),ge.type===Wn.ChatFetchResponseType.Success&&ge.usage){typeof ge.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ge.usage.copilot_usage.total_nano_aiu,y??A),le=(0,on.normalizeResponseModel)(o.model,ge.resolvedModel);let Ue={operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};ge.usage.prompt_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.prompt_tokens,"input",Ue),ge.usage.completion_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.completion_tokens,"output",Ue),z?.setAttributes({[on.GenAiAttr.USAGE_INPUT_TOKENS]:ge.usage.prompt_tokens??0,[on.GenAiAttr.USAGE_OUTPUT_TOKENS]:ge.usage.completion_tokens??0,[on.GenAiAttr.RESPONSE_MODEL]:le??o.model,[on.GenAiAttr.RESPONSE_ID]:ge.requestId,[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ge.usage.prompt_tokens_details?.cached_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cached_tokens}:{},...ge.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[on.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[on.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[on.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...ge.serverRequestId?{[on.CopilotChatAttr.SERVER_REQUEST_ID]:ge.serverRequestId}:{},...ge.usage.completion_tokens_details?.reasoning_tokens?{[on.GenAiAttr.USAGE_REASONING_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens,[on.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ge.usage.copilot_usage?.total_nano_aiu=="number"?{[on.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ge.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&ge.type===Wn.ChatFetchResponseType.Success){let Ue=B.deltas.map(K=>K.text).join(""),ke=B.deltas.filter(K=>K.copilotToolCalls?.length).flatMap(K=>K.copilotToolCalls.map(he=>({type:"tool_call",id:he.id,name:he.name,arguments:he.arguments}))),X=[];if(Ue&&X.push({type:"text",content:Ue}),X.push(...ke),X.length>0&&z.setAttribute(on.GenAiAttr.OUTPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify([{role:"assistant",parts:X}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(Z=>Z.thinking&&!(0,xvc.isEncryptedThinkingDelta)(Z.thinking)&&Z.thinking.text).map(Z=>{let ue=Z.thinking;return"encrypted"in ue?"":Array.isArray(ue.text)?ue.text.join(""):ue.text??""}).join("");z.setAttribute(on.CopilotChatAttr.REASONING_CONTENT,(0,on.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,on.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ge.type===Wn.ChatFetchResponseType.Success?{id:ge.requestId,model:(0,on.normalizeResponseModel)(o.model,ge.resolvedModel),finishReasons:["stop"],inputTokens:ge.usage?.prompt_tokens,outputTokens:ge.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&on.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&on.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Ue of B.outputChunkGapsMs)on.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Ue/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return E&&ge.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ge}case gn.FetchResponseKind.Canceled:return Oye.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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,d6i.isBYOKModel)(o),isAuto:(0,ICt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),z?.setAttributes({[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[on.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case gn.FetchResponseKind.Failed:{let ge=this.processFailedResponse(ie,T,(0,ICt.isAutoModel)(o)===1),ke=this._configurationService.getExperimentBasedConfig(oV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),X=q&&U!==void 0&&ke.includes(U),ee=q&&E&&(ie.failKind===gn.ChatFailKind.ServerError||ie.failKind===gn.ChatFailKind.Unknown);if(X||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:ge,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:j,bytesReceived:Q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return Oye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ge,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(ge),ge}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(on.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(on.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(j=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,O,(0,ICt.isAutoModel)(o)===1),le=q&&re.type===Wn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(oV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&E&&(re.type===Wn.ChatFetchResponseType.NetworkError||re.type===Wn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:ge,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:j,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(ge)return ge;f={...f,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}}return re.type===Wn.ChatFetchResponseType.Canceled?Oye.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:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,d6i.isBYOKModel)(o),isAuto:(0,ICt.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):Oye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,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,xMr.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(oV.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 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};Oye.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===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: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(oV.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)})`)}),L=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(B){throw P&&(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:gn.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,bMr.getCurrentCapturingToken)()?.chatSessionId,P=(0,bMr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,bMr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[on.GenAiAttr.OPERATION_NAME]:on.GenAiOperationName.CHAT,[on.GenAiAttr.PROVIDER_NAME]:on.GenAiProviderName.GITHUB,[on.GenAiAttr.REQUEST_MODEL]:e.model,[on.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[on.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[on.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[on.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[on.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[on.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[on.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[on.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[on.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[on.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,xCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,c6i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.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(on.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;on.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=RCt(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,SMr.generateUuid)(),R=Lye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,CMr.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,on.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,wMr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,on.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}),L=this._instantiationService.createInstance(PBe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,PBe.getResponsesApiCompactionThresholdFromBody)(r)),B=new l6i.AsyncIterableObject(async M=>{try{await new Promise((j,Q)=>{D.onEvent(U=>{let Y=L.push(U,o);if(Y&&((0,PBe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let Y=new Error(`${U.error.message} (${U.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=U,Q(Y)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,u6i.isCancellationError)(U)){Q(U);return}let Y=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.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(j,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 j=(0,PBe.responseApiInputToRawMessagesForLogging)(r);O=(0,hI.rawMessageToCAPI)(j)}catch(j){this._logService.error("Failed to convert Response API input to messages for telemetry:",j),O=[]}(0,a6i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,f6i.isCAPIWebSocketError)(q)){let M=Date.now()-P;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:gn.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,SMr.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:gn.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=p6i(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 l6i.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:gn.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=Lye.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,on.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,wMr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,on.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=RCt(s);return this._instantiationService.invokeFunction(xCt.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,CMr.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,xCt.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,xCt.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,PBe.responseApiInputToRawMessagesForLogging)(n);E=(0,hI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,a6i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,CMr.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service -`+s};if(r.status===424)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,e6i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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)Nye.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([fI.FinishedCompletionReason.Stop,fI.FinishedCompletionReason.ClientTrimmed,fI.FinishedCompletionReason.FunctionCall,fI.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:zn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,TBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case fI.FinishedCompletionReason.ContentFilter:return{type:zn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??fI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,TBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case fI.FinishedCompletionReason.Length:return{type:zn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,TBe.getTextPart)(x.message.content)};case fI.FinishedCompletionReason.ServerError:return{type:zn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:zn.ChatFetchResponseType.Unknown,reason:zn.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,SCt.calculateLineRepetitionStats)((0,TBe.getTextPart)(e.message.content)),o=(0,SCt.isRepetitive)(e.tokens);if(o){let s=Mye.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,SCt.calculateLineRepetitionStats)(o);if((0,SCt.isRepetitive)(s)){let d=Mye.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:zn.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===gn.ChatFailKind.RateLimited)return{type:zn.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===gn.ChatFailKind.QuotaExceeded)return{type:zn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.OffTopic)return{type:zn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===gn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:zn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ServerError)return{type:zn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ContentFilter)return{type:zn.ChatFetchResponseType.PromptFiltered,reason:s,category:fI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentUnauthorized)return{type:zn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentFailedDependency)return{type:zn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:zn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===gn.ChatFailKind.NotFound?{type:zn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===gn.ChatFailKind.InvalidPreviousResponseId?{type:zn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:zn.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:zn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,r6i.isCancellationError)(e))return{type:zn.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:zn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(fvc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,bMr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:zn.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:zn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:zn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:zn.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:zn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:zn.ChatFetchResponseType.PromptFiltered,reason:c,category:fI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:zn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:zn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:zn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,mvc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};pI.ChatMLFetcherImpl=TMr;pI.ChatMLFetcherImpl=TMr=CMr=Z_c([qv(0,avc.IFetcherService),qv(1,SMr.ITelemetryService),qv(2,lvc.IRequestLogger),qv(3,bMr.ILogService),qv(4,evc.IAuthenticationService),qv(5,ivc.IInteractionService),qv(6,rvc.IChatQuotaService),qv(7,ovc.ICAPIClientService),qv(8,nvc.IConversationOptions),qv(9,tV.IConfigurationService),qv(10,uvc.IExperimentationService),qv(11,yvc.IPowerService),qv(12,gvc.IInstantiationService),qv(13,i6i.IChatWebSocketManager),qv(14,cvc.IOTelService)],TMr);function Evc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:vMr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:vMr("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:vMr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>tV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${tV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-tV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Evc,"isValidChatPayload");function vMr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(vMr,"asUnexpected");function o6i(t,e,r){return Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(e),headerRequestId:r})}a(o6i,"createTelemetryData");function TCt(t){switch(t){case zn.ChatLocation.Panel:return"conversation-panel";case zn.ChatLocation.Editor:return"conversation-inline";case zn.ChatLocation.EditingSession:return"conversation-edits";case zn.ChatLocation.Notebook:return"conversation-notebook";case zn.ChatLocation.Terminal:return"conversation-terminal";case zn.ChatLocation.Other:return"conversation-other";case zn.ChatLocation.Agent:return"conversation-agent";case zn.ChatLocation.ResponsesProxy:return"responses-proxy";case zn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(TCt,"locationToIntent");function _vc(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(_vc,"pickCacheRelevantRequestOptions");function vvc(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(vvc,"pickRequestShapeMetadata")});var xMr=I(Oye=>{"use strict";p();Object.defineProperty(Oye,"__esModule",{value:!0});Oye.NullSimilarFilesContextService=Oye.ISimilarFilesContextService=void 0;var Cvc=nn();Oye.ISimilarFilesContextService=(0,Cvc.createServiceIdentifier)("ISimilarFilesContextService");var IMr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Oye.NullSimilarFilesContextService=IMr});var wMr=I(xCt=>{"use strict";p();Object.defineProperty(xCt,"__esModule",{value:!0});xCt.IDiffService=void 0;var bvc=nn();xCt.IDiffService=(0,bvc.createServiceIdentifier)("IDiffService")});var a6i=I(RMr=>{"use strict";p();Object.defineProperty(RMr,"__esModule",{value:!0});RMr.createProxyXtabEndpoint=xvc;var Svc=(Sne(),ba(bne)),Tvc=Qne(),Ivc=Gne();function xvc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:Svc.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:Tvc.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(Ivc.ChatEndpoint,r)}a(xvc,"createProxyXtabEndpoint")});var Vne=I(wCt=>{"use strict";p();Object.defineProperty(wCt,"__esModule",{value:!0});wCt.DocumentId=void 0;var wvc=WJe(),c6i=NA(),Rvc=nd(),kMr=class t{static{a(this,"DocumentId")}static{this._cache=new wvc.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=Rvc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,c6i.basename)(this.uri)}get extension(){return(0,c6i.extname)(this.uri)}toUri(){return this._uri}};wCt.DocumentId=kMr});var PMr=I(RCt=>{"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.NextCursorLinePrediction=void 0;var l6i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(l6i||(RCt.NextCursorLinePrediction=l6i={}))});var kCt=I(rV=>{"use strict";p();Object.defineProperty(rV,"__esModule",{value:!0});rV.NullUndesiredModelsManager=rV.IUndesiredModelsManager=rV.IInlineEditsModelService=void 0;var u6i=nn(),kvc=Ic();rV.IInlineEditsModelService=(0,u6i.createServiceIdentifier)("IInlineEditsModelService");rV.IUndesiredModelsManager=(0,u6i.createServiceIdentifier)("IUndesiredModelsManager");var DMr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=kvc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};rV.NullUndesiredModelsManager=DMr});var d6i=I(t9=>{"use strict";p();Object.defineProperty(t9,"__esModule",{value:!0});t9.IgnoreWhitespaceOnlyChanges=t9.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;t9.editWouldDeleteWhatWasJustInserted=Pvc;t9.editIsDeletion=OMr;t9.editWouldDeleteWhatWasJustInserted2=Dvc;var NMr=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}};t9.IgnoreWhitespaceOnlyChanges=MMr;function Pvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!OMr(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(Pvc,"editWouldDeleteWhatWasJustInserted");function OMr(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(OMr,"editIsDeletion");function Dvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!OMr(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(Dvc,"editWouldDeleteWhatWasJustInserted2")});var BMr=I(Lye=>{"use strict";p();Object.defineProperty(Lye,"__esModule",{value:!0});Lye.NulSimulationTestContext=Lye.ISimulationTestContext=void 0;var Nvc=nn();Lye.ISimulationTestContext=(0,Nvc.createServiceIdentifier)("ISimulationTestContext");var LMr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};Lye.NulSimulationTestContext=LMr});var DCt=I(PCt=>{"use strict";p();Object.defineProperty(PCt,"__esModule",{value:!0});PCt.BaseAlternativeNotebookContentProvider=void 0;var FMr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};PCt.BaseAlternativeNotebookContentProvider=FMr});var QMr=I(uN=>{"use strict";p();Object.defineProperty(uN,"__esModule",{value:!0});uN.DEFAULT_WORD_REGEXP=uN.USUAL_WORD_SEPARATORS=void 0;uN.ensureValidWordDefinition=f6i;uN.setDefaultGetWordAtTextConfig=Fvc;uN.getWordAtText=p6i;var Mvc=fjt(),Ovc=Ro(),Lvc=vue();uN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Bvc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of uN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Bvc,"createWordRegExp");uN.DEFAULT_WORD_REGEXP=Bvc();function f6i(t){let e=uN.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(f6i,"ensureValidWordDefinition");var UMr=new Lvc.LinkedList;UMr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Fvc(t){let e=UMr.unshift(t);return(0,Ovc.toDisposable)(e)}a(Fvc,"setDefaultGetWordAtTextConfig");function p6i(t,e,r,n,o){if(e=f6i(e),o||(o=Mvc.Iterable.first(UMr)),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),p6i(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=Uvc(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(p6i,"getWordAtText");function Uvc(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(Uvc,"_findRegexMatchEnclosingPosition")});var h6i=I(NCt=>{"use strict";p();Object.defineProperty(NCt,"__esModule",{value:!0});NCt.toUint8=Qvc;NCt.toUint32=qvc;function Qvc(t){return t<0?0:t>255?255:t|0}a(Qvc,"toUint8");function qvc(t){return t<0?0:t>4294967295?4294967295:t|0}a(qvc,"toUint32")});var m6i=I(nV=>{"use strict";p();Object.defineProperty(nV,"__esModule",{value:!0});nV.PrefixSumIndexOfResult=nV.ConstantTimePrefixSumComputer=nV.PrefixSumComputer=void 0;var jvc=Sl(),Bye=h6i(),qMr=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,Bye.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,Bye.toUint32)(e),r=(0,Bye.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,Bye.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 Fye(o,e-c)}};nV.PrefixSumComputer=qMr;var jMr=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 Fye(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Fye(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,jvc.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))}};nV.ConstantTimePrefixSumComputer=jMr;var Fye=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};nV.PrefixSumIndexOfResult=Fye});var GMr=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.PositionOffsetTransformer=void 0;var g6i=em(),A6i=kE(),Hvc=hd(),Gvc=m6i(),Wne=P0(),HMr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,g6i.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r +`+s};if(r.status===424)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,c6i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.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)Oye.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([hI.FinishedCompletionReason.Stop,hI.FinishedCompletionReason.ClientTrimmed,hI.FinishedCompletionReason.FunctionCall,hI.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,kBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case hI.FinishedCompletionReason.ContentFilter:return{type:Wn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??hI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,kBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case hI.FinishedCompletionReason.Length:return{type:Wn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,kBe.getTextPart)(x.message.content)};case hI.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,wCt.calculateLineRepetitionStats)((0,kBe.getTextPart)(e.message.content)),o=(0,wCt.isRepetitive)(e.tokens);if(o){let s=Lye.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,wCt.calculateLineRepetitionStats)(o);if((0,wCt.isRepetitive)(s)){let d=Lye.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===gn.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===gn.ChatFailKind.QuotaExceeded)return{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.OffTopic)return{type:Wn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===gn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Wn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ServerError)return{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ContentFilter)return{type:Wn.ChatFetchResponseType.PromptFiltered,reason:s,category:hI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentUnauthorized)return{type:Wn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentFailedDependency)return{type:Wn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.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===gn.ChatFailKind.NotFound?{type:Wn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===gn.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,u6i.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(wvc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,xMr.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.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:hI.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,Pvc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};mI.ChatMLFetcherImpl=RMr;mI.ChatMLFetcherImpl=RMr=IMr=hvc([Hv(0,bvc.IFetcherService),Hv(1,wMr.ITelemetryService),Hv(2,Tvc.IRequestLogger),Hv(3,xMr.ILogService),Hv(4,gvc.IAuthenticationService),Hv(5,_vc.IInteractionService),Hv(6,yvc.IChatQuotaService),Hv(7,vvc.ICAPIClientService),Hv(8,Evc.IConversationOptions),Hv(9,oV.IConfigurationService),Hv(10,Ivc.IExperimentationService),Hv(11,Mvc.IPowerService),Hv(12,Dvc.IInstantiationService),Hv(13,f6i.IChatWebSocketManager),Hv(14,Svc.IOTelService)],RMr);function Ovc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:TMr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:TMr("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:TMr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>oV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${oV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-oV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Ovc,"isValidChatPayload");function TMr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(TMr,"asUnexpected");function p6i(t,e,r){return Lye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(e),headerRequestId:r})}a(p6i,"createTelemetryData");function RCt(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(RCt,"locationToIntent");function Lvc(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(Lvc,"pickCacheRelevantRequestOptions");function Bvc(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(Bvc,"pickRequestShapeMetadata")});var PMr=I(Bye=>{"use strict";p();Object.defineProperty(Bye,"__esModule",{value:!0});Bye.NullSimilarFilesContextService=Bye.ISimilarFilesContextService=void 0;var Fvc=nn();Bye.ISimilarFilesContextService=(0,Fvc.createServiceIdentifier)("ISimilarFilesContextService");var kMr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Bye.NullSimilarFilesContextService=kMr});var DMr=I(PCt=>{"use strict";p();Object.defineProperty(PCt,"__esModule",{value:!0});PCt.IDiffService=void 0;var Uvc=nn();PCt.IDiffService=(0,Uvc.createServiceIdentifier)("IDiffService")});var m6i=I(NMr=>{"use strict";p();Object.defineProperty(NMr,"__esModule",{value:!0});NMr.createProxyXtabEndpoint=Hvc;var Qvc=(Tne(),Sa(Sne)),qvc=qne(),jvc=$ne();function Hvc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:Qvc.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:qvc.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(jvc.ChatEndpoint,r)}a(Hvc,"createProxyXtabEndpoint")});var Wne=I(DCt=>{"use strict";p();Object.defineProperty(DCt,"__esModule",{value:!0});DCt.DocumentId=void 0;var Gvc=XJe(),g6i=MA(),$vc=id(),MMr=class t{static{a(this,"DocumentId")}static{this._cache=new Gvc.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=$vc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,g6i.basename)(this.uri)}get extension(){return(0,g6i.extname)(this.uri)}toUri(){return this._uri}};DCt.DocumentId=MMr});var OMr=I(NCt=>{"use strict";p();Object.defineProperty(NCt,"__esModule",{value:!0});NCt.NextCursorLinePrediction=void 0;var A6i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(A6i||(NCt.NextCursorLinePrediction=A6i={}))});var MCt=I(sV=>{"use strict";p();Object.defineProperty(sV,"__esModule",{value:!0});sV.NullUndesiredModelsManager=sV.IUndesiredModelsManager=sV.IInlineEditsModelService=void 0;var y6i=nn(),Vvc=Ic();sV.IInlineEditsModelService=(0,y6i.createServiceIdentifier)("IInlineEditsModelService");sV.IUndesiredModelsManager=(0,y6i.createServiceIdentifier)("IUndesiredModelsManager");var LMr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=Vvc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};sV.NullUndesiredModelsManager=LMr});var E6i=I(n9=>{"use strict";p();Object.defineProperty(n9,"__esModule",{value:!0});n9.IgnoreWhitespaceOnlyChanges=n9.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;n9.editWouldDeleteWhatWasJustInserted=Wvc;n9.editIsDeletion=UMr;n9.editWouldDeleteWhatWasJustInserted2=zvc;var BMr=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}};n9.IgnoreWhitespaceOnlyChanges=FMr;function Wvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!UMr(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(Wvc,"editWouldDeleteWhatWasJustInserted");function UMr(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(UMr,"editIsDeletion");function zvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!UMr(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(zvc,"editWouldDeleteWhatWasJustInserted2")});var qMr=I(Fye=>{"use strict";p();Object.defineProperty(Fye,"__esModule",{value:!0});Fye.NulSimulationTestContext=Fye.ISimulationTestContext=void 0;var Yvc=nn();Fye.ISimulationTestContext=(0,Yvc.createServiceIdentifier)("ISimulationTestContext");var QMr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};Fye.NulSimulationTestContext=QMr});var LCt=I(OCt=>{"use strict";p();Object.defineProperty(OCt,"__esModule",{value:!0});OCt.BaseAlternativeNotebookContentProvider=void 0;var jMr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};OCt.BaseAlternativeNotebookContentProvider=jMr});var GMr=I(pN=>{"use strict";p();Object.defineProperty(pN,"__esModule",{value:!0});pN.DEFAULT_WORD_REGEXP=pN.USUAL_WORD_SEPARATORS=void 0;pN.ensureValidWordDefinition=_6i;pN.setDefaultGetWordAtTextConfig=eCc;pN.getWordAtText=v6i;var Kvc=gjt(),Jvc=ko(),Zvc=Cue();pN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Xvc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of pN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Xvc,"createWordRegExp");pN.DEFAULT_WORD_REGEXP=Xvc();function _6i(t){let e=pN.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(_6i,"ensureValidWordDefinition");var HMr=new Zvc.LinkedList;HMr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function eCc(t){let e=HMr.unshift(t);return(0,Jvc.toDisposable)(e)}a(eCc,"setDefaultGetWordAtTextConfig");function v6i(t,e,r,n,o){if(e=_6i(e),o||(o=Kvc.Iterable.first(HMr)),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),v6i(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=tCc(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(v6i,"getWordAtText");function tCc(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(tCc,"_findRegexMatchEnclosingPosition")});var C6i=I(BCt=>{"use strict";p();Object.defineProperty(BCt,"__esModule",{value:!0});BCt.toUint8=rCc;BCt.toUint32=nCc;function rCc(t){return t<0?0:t>255?255:t|0}a(rCc,"toUint8");function nCc(t){return t<0?0:t>4294967295?4294967295:t|0}a(nCc,"toUint32")});var b6i=I(aV=>{"use strict";p();Object.defineProperty(aV,"__esModule",{value:!0});aV.PrefixSumIndexOfResult=aV.ConstantTimePrefixSumComputer=aV.PrefixSumComputer=void 0;var iCc=Tl(),Uye=C6i(),$Mr=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,Uye.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,Uye.toUint32)(e),r=(0,Uye.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,Uye.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 Qye(o,e-c)}};aV.PrefixSumComputer=$Mr;var VMr=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 Qye(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Qye(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,iCc.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))}};aV.ConstantTimePrefixSumComputer=VMr;var Qye=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};aV.PrefixSumIndexOfResult=Qye});var zMr=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.PositionOffsetTransformer=void 0;var S6i=rm(),T6i=PE(),oCc=gd(),sCc=b6i(),zne=D0(),WMr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,S6i.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,g6i.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 Wne.TextEdit(this.validateRange(n.range),n.newText));return new A6i.StringEdit(r.map(n=>new A6i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Wne.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Wne.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 Wne.Position(r,n):e}validateRange(e){return new Wne.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};MCt.PositionOffsetTransformer=HMr});var VMr=I(zne=>{"use strict";p();Object.defineProperty(zne,"__esModule",{value:!0});zne.SnapshotDocumentLine=zne.TextDocumentSnapshot=void 0;zne.isTextDocumentSnapshotJSON=Vvc;var OCt=KS(),E6i=nd(),y6i=QMr(),Uye=P0(),$vc=GMr();function Vvc(t){return!t||typeof t!="object"?!1:(0,E6i.isUriComponents)(t.uri)&&(0,OCt.isString)(t._text)&&(0,OCt.isString)(t.languageId)&&(0,OCt.isNumber)(t.version)&&(0,OCt.isNumber)(t.eol)}a(Vvc,"isTextDocumentSnapshotJSON");var $Mr=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,E6i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new $vc.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 Uye.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 LCt(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,y6i.getWordAtText)(r.character+1,y6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new Uye.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 Uye.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 Uye.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};zne.TextDocumentSnapshot=$Mr;var LCt=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 Uye.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Uye.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}};zne.SnapshotDocumentLine=LCt});var UCt=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.AlternativeNotebookDocument=void 0;var _6i=QMr(),BCt=P0(),Wvc=GMr(),zvc=VMr(),WMr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Wvc.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,_6i.getWordAtText)(r.character+1,_6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new BCt.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 BCt.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 zvc.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 BCt.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 BCt.Position(r,n):e}};FCt.AlternativeNotebookDocument=WMr});var QCt=I(Qye=>{"use strict";p();Object.defineProperty(Qye,"__esModule",{value:!0});Qye.isUri=Kvc;Qye.isLocation=zMr;Qye.toLocation=Jvc;Qye.isSymbolInformation=Zvc;var xBe=P0(),Yvc=nd();function Kvc(t){return Yvc.URI.isUri(t)}a(Kvc,"isUri");function zMr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(zMr,"isLocation");function Jvc(t){if(zMr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new xBe.Location(t.uri,new xBe.Range(new xBe.Position(e.line,e.character),new xBe.Position(r.line,r.character)))}else if(zMr(t)&&t.range instanceof xBe.Range)return t}a(Jvc,"toLocation");function Zvc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(Zvc,"isSymbolInformation")});var kBe=I(Sy=>{"use strict";p();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.CellIdPatternRe=Sy.EOL=Sy.LineOfText=void 0;Sy.summarize=eCc;Sy.notebookCellToCellData=tCc;Sy.getCellIdMap=rCc;Sy.normalizeCellId=nCc;Sy.getNotebookId=iCc;Sy.getCellId=JMr;Sy.getDefaultLanguage=sCc;Sy.requestHasNotebookRefs=cCc;Sy.parseAndCleanStack=lCc;var v6i=QCt(),T6i=rNr(),Xvc=em(),C6i=nd(),KMr=P0(),YMr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Sy.LineOfText=YMr;Sy.EOL=` -`;function eCc(t){let e=t.kind===KMr.NotebookCellKind.Code?"code":"markdown",r=JMr(t),n=oCc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(eCc,"summarize");function tCc(t){let e=new KMr.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(tCc,"notebookCellToCellData");function rCc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(JMr(r),r)}),e}a(rCc,"getCellIdMap");var b6i=new WeakMap,RBe=8,wBe="#VSC-";Sy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${RBe}})\\b`,"gi");function nCc(t){return t.startsWith(wBe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===RBe+3?`${wBe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===RBe+7?`${wBe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===RBe?`${wBe}${t}`:t}a(nCc,"normalizeCellId");var S6i=new WeakMap;function iCc(t){let e=S6i.get(t);if(e)return e;let r=new T6i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),S6i.set(t,e),e}a(iCc,"getNotebookId");function JMr(t){let e=b6i.get(t);if(e)return e;let r=new T6i.StringSHA1;return r.update(t.document.uri.toString()),e=`${wBe}${r.digest().substring(0,RBe)}`,b6i.set(t,e),e}a(JMr,"getCellId");function oCc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(oCc,"getCellCode");function sCc(t){let e=t.getCells().find(r=>r.kind===KMr.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(sCc,"getDefaultLanguage");var aCc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function cCc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&aCc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,v6i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,C6i.isUriComponents)(o.value)?e.hasSupportedNotebooks(C6i.URI.revive(o.value)):(0,v6i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(cCc,"requestHasNotebookRefs");function lCc(t){try{let e=JSON.parse(t);return(0,Xvc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(lCc,"parseAndCleanStack")});var w6i=I(PBe=>{"use strict";p();Object.defineProperty(PBe,"__esModule",{value:!0});PBe.AlternativeJsonNotebookContentProvider=void 0;PBe.isJsonContent=hCc;var uCc=(zdr(),ba(RJn)),dCc=nl(),I6i=nd(),dN=P0(),fCc=DCt(),pCc=UCt(),qye=kBe(),x6i=4;function hCc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(hCc,"isJsonContent");var qCt=class extends pCc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,qye.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 dN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new dN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},ZMr=class extends fCc.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 qCt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==dN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,qye.summarize)(c),u=mCc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,x6i);return new qCt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,qye.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,x6i).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(qye.EOL)}parseAlternateContentImpl(e,r,n){return new dCc.AsyncIterableObject(async o=>{let s=I6i.URI.isUri(e)?new Map:(0,qye.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:dN.NotebookCellKind.Code,source:[]},f=I6i.URI.isUri(e)?"python":(0,qye.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"?dN.NotebookCellKind.Markup:dN.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,uCc.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=dN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?dN.NotebookCellKind.Code:dN.NotebookCellKind.Markup,d.kind===dN.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=dN.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)})}};PBe.AlternativeJsonNotebookContentProvider=ZMr;function mCc(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(mCc,"getCellCode")});var eOr=I(iV=>{"use strict";p();Object.defineProperty(iV,"__esModule",{value:!0});iV.wellKnownLanguages=void 0;iV.getLanguage=R6i;iV.getLanguageForResource=yCc;var gCc=ZP(),ACc=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"]}});iV.wellKnownLanguages=new Map(Object.entries(ACc).map(([t,e])=>[t,{languageId:t,...e}]));function R6i(t){return XMr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(R6i,"getLanguage");function XMr(t){return iV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(XMr,"_getLanguage");function yCc(t){let e=(0,gCc.extname)(t).toLowerCase();for(let r of iV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return R6i("plaintext")}a(yCc,"getLanguageForResource")});var D6i=I(oV=>{"use strict";p();Object.defineProperty(oV,"__esModule",{value:!0});oV.AlternativeTextNotebookContentProvider=void 0;oV.generateCellTextMarker=nOr;oV.lineMightHaveCellMarker=iOr;oV.getBlockComment=Hye;oV.getLineCommentStart=Gye;var rOr=eOr(),ECc=QCt(),_Cc=xq(),jye=P0(),vCc=DCt(),CCc=UCt(),Bm=kBe();function nOr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(nOr,"generateCellTextMarker");function iOr(t){return t.toLowerCase().includes("vscode.cell")}a(iOr,"lineMightHaveCellMarker");var jCt=class extends CCc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Bm.summarize)(e),o=Gye(this.notebook),s=nOr(n,o),c=e.document.eol===jye.EndOfLine.LF?1:2,l=Hye(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===jye.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,_Cc.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}}},tOr=class extends vCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Bm.EOL);return r.length&&iOr(r[0])?(r.shift(),r.join(Bm.EOL)):e}getSummaryOfStructure(e,r,n){let o=Hye(e),s=Gye(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Bm.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(k6i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Bm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,ECc.isUri)(e),s=o?(0,Bm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=Gye(o?e:void 0),m=Hye(o?e:void 0),g=o?(0,rOr.getLanguage)((0,Bm.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||_?P6i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:jye.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"?jye.NotebookCellKind.Markup:jye.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=Hye(r),o=Gye(r),s=(0,Bm.getCellIdMap)(r),c=[],l=e.split(Bm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=Bm.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+Bm.EOL.length}return new jCt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==jye.NotebookCellKind.Markup:!0).map(d=>(0,Bm.summarize)(d)),o=Hye(e),s=Gye(e),c=n.map(d=>({...k6i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Bm.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 jCt(l,u,e)}};oV.AlternativeTextNotebookContentProvider=tOr;function k6i(t,e,r){let n=nOr(t,e),o=t.source.join(Bm.EOL),s=t.language==="markdown"?`${n}${Bm.EOL}${r[0]}${Bm.EOL}`:`${n}${Bm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Bm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(k6i,"generateAlternativeCellTextContent");function Hye(t){return t?(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(Hye,"getBlockComment");function Gye(t){return t&&(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).lineComment.start||"#"}a(Gye,"getLineCommentStart");function P6i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:iOr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(P6i,"extractCellParts")});var O6i=I(MBe=>{"use strict";p();Object.defineProperty(MBe,"__esModule",{value:!0});MBe.AlternativeXmlNotebookContentProvider=void 0;MBe.isXmlContent=M6i;var bCc=eOr(),SCc=QCt(),TCc=xq(),DBe=P0(),ICc=DCt(),xCc=UCt(),ZE=kBe(),NBe="`}a(oOr,"generateCellMarker");function M6i(t){return t.includes(NBe)||t.includes(sV)||t.includes(HCt)}a(M6i,"isXmlContent");var GCt=class extends xCc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,ZE.summarize)(e),o=oOr(n),s=e.document.eol===DBe.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,TCc.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}}},sOr=class extends ICc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(ZE.EOL);return r.length&&(r[0].startsWith(NBe)||r[0].startsWith(HCt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(sV)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(sV))),r.join(ZE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,ZE.summarize)(c);o.push(oOr(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(sV)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(ZE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,SCc.isUri)(e),s=o?(0,ZE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,bCc.getLanguage)((0,ZE.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(HCt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(sV)),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:DBe.NotebookCellKind.Code},y=N6i(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"?DBe.NotebookCellKind.Markup:DBe.NotebookCellKind.Code),yield A}else g.startsWith(sV)?(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(sV),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,ZE.getCellIdMap)(r),o=[],s=e.split(ZE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=ZE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+ZE.EOL.length}return new GCt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==DBe.NotebookCellKind.Markup:!0).map(l=>(0,ZE.summarize)(l)).map(l=>{let d=`${oOr(l)}${ZE.EOL}`;return{content:`${d}${l.source.join(ZE.EOL)}${ZE.EOL}${sV}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(ZE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new GCt(s,c,e)}};MBe.AlternativeXmlNotebookContentProvider=sOr;function N6i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(M6i(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(N6i,"extractCellParts")});var Q6i=I(v1=>{"use strict";p();var RCc=v1&&v1.__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},L6i=v1&&v1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v1,"__esModule",{value:!0});v1.AlternativeNotebookContentService=v1.IAlternativeNotebookContentService=void 0;v1.getAlternativeNotebookDocumentProvider=cOr;v1.inferAlternativeNotebookContentFormat=LCc;v1.getAltNotebookRange=BCc;var kCc=Evt(),PCc=nn(),DCc=P0(),B6i=Pl(),NCc=aBe(),MCc=mh(),F6i=w6i(),OCc=D6i(),U6i=O6i();function cOr(t){switch(t){case"xml":return new U6i.AlternativeXmlNotebookContentProvider;case"text":return new OCc.AlternativeTextNotebookContentProvider;case"json":return new F6i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(cOr,"getAlternativeNotebookDocumentProvider");function LCc(t){return(0,U6i.isXmlContent)(t)?"xml":(0,F6i.isJsonContent)(t)?"json":"text"}a(LCc,"inferAlternativeNotebookContentFormat");v1.IAlternativeNotebookContentService=(0,PCc.createServiceIdentifier)("IAlternativeNotebookContentService");var aOr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,NCc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(B6i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return cOr(e)}};v1.AlternativeNotebookContentService=aOr;v1.AlternativeNotebookContentService=aOr=RCc([L6i(0,B6i.IConfigurationService),L6i(1,MCc.IExperimentationService)],aOr);function BCc(t,e,r,n){let o=(0,kCc.findCell)(e,r);if(!o)return;let s=cOr(n).getAlternativeDocument(r);return new DCc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(BCc,"getAltNotebookRange")});var j6i=I(OBe=>{"use strict";p();Object.defineProperty(OBe,"__esModule",{value:!0});OBe.NotebookDocumentSnapshot=void 0;OBe.isNotebookDocumentSnapshotJSON=QCc;var $Ct=KS(),FCc=nd(),lOr=P0(),q6i=Q6i(),UCc=kBe();function QCc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,FCc.isUriComponents)(t.uri)&&(0,$Ct.isString)(t._text)&&(0,$Ct.isString)(t.languageId)&&(0,$Ct.isNumber)(t.version)&&(0,$Ct.isString)(t.alternativeFormat)}a(QCc,"isNotebookDocumentSnapshotJSON");var uOr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,q6i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,q6i.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,UCc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new lOr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new lOr.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 lOr.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=uOr});var fOr=I(jv=>{"use strict";p();var qCc=jv&&jv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jCc=jv&&jv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HCc=jv&&jv.__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,H6i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return KCc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,GCc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return YCc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>H6i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};jv.AbstractWorkspaceService=VCt;function JCc(t,e){let r=t.getWorkspaceFolder(e);return r?WCc.posix.relative(r.path,e.path):e.path}a(JCc,"getWorkspaceFileDisplayPath");var dOr=class extends VCt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new VCc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new aV.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new aV.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)}};jv.NullWorkspaceService=dOr});var gOr=I(Yne=>{"use strict";p();Object.defineProperty(Yne,"__esModule",{value:!0});Yne.BatchedProcessor=Yne.TaskQueue=void 0;Yne.raceFilter=ZCc;var pOr=nl(),G6i=Rs(),hOr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new pOr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new pOr.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 G6i.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 G6i.CancellationError)}};Yne.TaskQueue=hOr;var mOr=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 pOr.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)}};Yne.BatchedProcessor=mOr;function ZCc(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(ZCc,"raceFilter")});var AOr=I($ye=>{"use strict";p();Object.defineProperty($ye,"__esModule",{value:!0});$ye.AsyncIterUtilsExt=$ye.AsyncIterUtils=void 0;var $6i;(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})($6i||($ye.AsyncIterUtils=$6i={}));var V6i;(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})(V6i||($ye.AsyncIterUtilsExt=V6i={}))});var EOr=I(yOr=>{"use strict";p();Object.defineProperty(yOr,"__esModule",{value:!0});yOr.backwardCompatSetting=XCc;function XCc(t,e){return e(t)}a(XCc,"backwardCompatSetting")});var z6i=I(hI=>{"use strict";p();Object.defineProperty(hI,"__esModule",{value:!0});hI.LineWithTokens=hI.Token=void 0;hI.getOrDeduceSelectionFromLastEdit=tbc;hI.clipTokensToRange=W6i;hI.clipTokensToRangeAndAdjustOffsets=nbc;hI.removeTokensInRangeAndAdjustOffsets=ibc;hI.getTokensFromLogProbs=obc;hI.getTokensFromLinesWithTokens=sbc;hI.mergeOffsetRangesAtDistance=abc;var ebc=Rs(),Vye=hd();function tbc(t){let e=new Vye.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):rbc(t)}a(tbc,"getOrDeduceSelectionFromLastEdit");function rbc(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 Vye.OffsetRange(c,c))}a(rbc,"deduceSelectionFromLastEdit");var WCt=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 Vye.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)}};hI.Token=WCt;function W6i(t,e){return t.filter(r=>e.intersects(r.range))}a(W6i,"clipTokensToRange");function nbc(t,e){return W6i(t,e).map(r=>r.deltaOffset(-e.start))}a(nbc,"clipTokensToRangeAndAdjustOffsets");function ibc(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(ibc,"removeTokensInRangeAndAdjustOffsets");function obc(t,e){let r=e;return t.content.map(n=>{let o=new WCt(n.token,n.logprob,r);return r+=o.range.length,o})}a(obc,"getTokensFromLogProbs");var _Or=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,S6i.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 zne.TextEdit(this.validateRange(n.range),n.newText));return new T6i.StringEdit(r.map(n=>new T6i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new zne.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof zne.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 zne.Position(r,n):e}validateRange(e){return new zne.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};FCt.PositionOffsetTransformer=WMr});var KMr=I(Yne=>{"use strict";p();Object.defineProperty(Yne,"__esModule",{value:!0});Yne.SnapshotDocumentLine=Yne.TextDocumentSnapshot=void 0;Yne.isTextDocumentSnapshotJSON=cCc;var UCt=ZS(),x6i=id(),I6i=GMr(),qye=D0(),aCc=zMr();function cCc(t){return!t||typeof t!="object"?!1:(0,x6i.isUriComponents)(t.uri)&&(0,UCt.isString)(t._text)&&(0,UCt.isString)(t.languageId)&&(0,UCt.isNumber)(t.version)&&(0,UCt.isNumber)(t.eol)}a(cCc,"isTextDocumentSnapshotJSON");var YMr=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,x6i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new aCc.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 qye.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 QCt(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,I6i.getWordAtText)(r.character+1,I6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new qye.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 qye.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 qye.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};Yne.TextDocumentSnapshot=YMr;var QCt=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 qye.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new qye.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}};Yne.SnapshotDocumentLine=QCt});var HCt=I(jCt=>{"use strict";p();Object.defineProperty(jCt,"__esModule",{value:!0});jCt.AlternativeNotebookDocument=void 0;var w6i=GMr(),qCt=D0(),lCc=zMr(),uCc=KMr(),JMr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new lCc.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,w6i.getWordAtText)(r.character+1,w6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new qCt.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 qCt.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 uCc.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 qCt.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 qCt.Position(r,n):e}};jCt.AlternativeNotebookDocument=JMr});var GCt=I(jye=>{"use strict";p();Object.defineProperty(jye,"__esModule",{value:!0});jye.isUri=fCc;jye.isLocation=ZMr;jye.toLocation=pCc;jye.isSymbolInformation=hCc;var DBe=D0(),dCc=id();function fCc(t){return dCc.URI.isUri(t)}a(fCc,"isUri");function ZMr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(ZMr,"isLocation");function pCc(t){if(ZMr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new DBe.Location(t.uri,new DBe.Range(new DBe.Position(e.line,e.character),new DBe.Position(r.line,r.character)))}else if(ZMr(t)&&t.range instanceof DBe.Range)return t}a(pCc,"toLocation");function hCc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(hCc,"isSymbolInformation")});var OBe=I(Ty=>{"use strict";p();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.CellIdPatternRe=Ty.EOL=Ty.LineOfText=void 0;Ty.summarize=gCc;Ty.notebookCellToCellData=ACc;Ty.getCellIdMap=yCc;Ty.normalizeCellId=ECc;Ty.getNotebookId=_Cc;Ty.getCellId=tOr;Ty.getDefaultLanguage=CCc;Ty.requestHasNotebookRefs=SCc;Ty.parseAndCleanStack=TCc;var R6i=GCt(),N6i=sNr(),mCc=rm(),k6i=id(),eOr=D0(),XMr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Ty.LineOfText=XMr;Ty.EOL=` +`;function gCc(t){let e=t.kind===eOr.NotebookCellKind.Code?"code":"markdown",r=tOr(t),n=vCc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(gCc,"summarize");function ACc(t){let e=new eOr.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(ACc,"notebookCellToCellData");function yCc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(tOr(r),r)}),e}a(yCc,"getCellIdMap");var P6i=new WeakMap,MBe=8,NBe="#VSC-";Ty.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${MBe}})\\b`,"gi");function ECc(t){return t.startsWith(NBe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===MBe+3?`${NBe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===MBe+7?`${NBe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===MBe?`${NBe}${t}`:t}a(ECc,"normalizeCellId");var D6i=new WeakMap;function _Cc(t){let e=D6i.get(t);if(e)return e;let r=new N6i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),D6i.set(t,e),e}a(_Cc,"getNotebookId");function tOr(t){let e=P6i.get(t);if(e)return e;let r=new N6i.StringSHA1;return r.update(t.document.uri.toString()),e=`${NBe}${r.digest().substring(0,MBe)}`,P6i.set(t,e),e}a(tOr,"getCellId");function vCc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(vCc,"getCellCode");function CCc(t){let e=t.getCells().find(r=>r.kind===eOr.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(CCc,"getDefaultLanguage");var bCc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function SCc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&bCc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,R6i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,k6i.isUriComponents)(o.value)?e.hasSupportedNotebooks(k6i.URI.revive(o.value)):(0,R6i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(SCc,"requestHasNotebookRefs");function TCc(t){try{let e=JSON.parse(t);return(0,mCc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(TCc,"parseAndCleanStack")});var L6i=I(LBe=>{"use strict";p();Object.defineProperty(LBe,"__esModule",{value:!0});LBe.AlternativeJsonNotebookContentProvider=void 0;LBe.isJsonContent=kCc;var ICc=(Zdr(),Sa(MJn)),xCc=nl(),M6i=id(),hN=D0(),wCc=LCt(),RCc=HCt(),Hye=OBe(),O6i=4;function kCc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(kCc,"isJsonContent");var $Ct=class extends RCc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,Hye.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 hN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new hN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},rOr=class extends wCc.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 $Ct(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==hN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,Hye.summarize)(c),u=PCc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,O6i);return new $Ct(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,Hye.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,O6i).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(Hye.EOL)}parseAlternateContentImpl(e,r,n){return new xCc.AsyncIterableObject(async o=>{let s=M6i.URI.isUri(e)?new Map:(0,Hye.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:hN.NotebookCellKind.Code,source:[]},f=M6i.URI.isUri(e)?"python":(0,Hye.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"?hN.NotebookCellKind.Markup:hN.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,ICc.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=hN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?hN.NotebookCellKind.Code:hN.NotebookCellKind.Markup,d.kind===hN.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=hN.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)})}};LBe.AlternativeJsonNotebookContentProvider=rOr;function PCc(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(PCc,"getCellCode")});var iOr=I(cV=>{"use strict";p();Object.defineProperty(cV,"__esModule",{value:!0});cV.wellKnownLanguages=void 0;cV.getLanguage=B6i;cV.getLanguageForResource=MCc;var DCc=e2(),NCc=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"]}});cV.wellKnownLanguages=new Map(Object.entries(NCc).map(([t,e])=>[t,{languageId:t,...e}]));function B6i(t){return nOr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(B6i,"getLanguage");function nOr(t){return cV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(nOr,"_getLanguage");function MCc(t){let e=(0,DCc.extname)(t).toLowerCase();for(let r of cV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return B6i("plaintext")}a(MCc,"getLanguageForResource")});var Q6i=I(lV=>{"use strict";p();Object.defineProperty(lV,"__esModule",{value:!0});lV.AlternativeTextNotebookContentProvider=void 0;lV.generateCellTextMarker=aOr;lV.lineMightHaveCellMarker=cOr;lV.getBlockComment=$ye;lV.getLineCommentStart=Vye;var sOr=iOr(),OCc=GCt(),LCc=kq(),Gye=D0(),BCc=LCt(),FCc=HCt(),Um=OBe();function aOr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(aOr,"generateCellTextMarker");function cOr(t){return t.toLowerCase().includes("vscode.cell")}a(cOr,"lineMightHaveCellMarker");var VCt=class extends FCc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Um.summarize)(e),o=Vye(this.notebook),s=aOr(n,o),c=e.document.eol===Gye.EndOfLine.LF?1:2,l=$ye(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===Gye.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,LCc.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}}},oOr=class extends BCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Um.EOL);return r.length&&cOr(r[0])?(r.shift(),r.join(Um.EOL)):e}getSummaryOfStructure(e,r,n){let o=$ye(e),s=Vye(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Um.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(F6i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Um.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,OCc.isUri)(e),s=o?(0,Um.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=Vye(o?e:void 0),m=$ye(o?e:void 0),g=o?(0,sOr.getLanguage)((0,Um.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||_?U6i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:Gye.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"?Gye.NotebookCellKind.Markup:Gye.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=$ye(r),o=Vye(r),s=(0,Um.getCellIdMap)(r),c=[],l=e.split(Um.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=Um.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+Um.EOL.length}return new VCt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==Gye.NotebookCellKind.Markup:!0).map(d=>(0,Um.summarize)(d)),o=$ye(e),s=Vye(e),c=n.map(d=>({...F6i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Um.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 VCt(l,u,e)}};lV.AlternativeTextNotebookContentProvider=oOr;function F6i(t,e,r){let n=aOr(t,e),o=t.source.join(Um.EOL),s=t.language==="markdown"?`${n}${Um.EOL}${r[0]}${Um.EOL}`:`${n}${Um.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Um.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(F6i,"generateAlternativeCellTextContent");function $ye(t){return t?(0,sOr.getLanguage)((0,Um.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a($ye,"getBlockComment");function Vye(t){return t&&(0,sOr.getLanguage)((0,Um.getDefaultLanguage)(t)).lineComment.start||"#"}a(Vye,"getLineCommentStart");function U6i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:cOr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(U6i,"extractCellParts")});var H6i=I(UBe=>{"use strict";p();Object.defineProperty(UBe,"__esModule",{value:!0});UBe.AlternativeXmlNotebookContentProvider=void 0;UBe.isXmlContent=j6i;var UCc=iOr(),QCc=GCt(),qCc=kq(),BBe=D0(),jCc=LCt(),HCc=HCt(),XE=OBe(),FBe="`}a(lOr,"generateCellMarker");function j6i(t){return t.includes(FBe)||t.includes(uV)||t.includes(WCt)}a(j6i,"isXmlContent");var zCt=class extends HCc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,XE.summarize)(e),o=lOr(n),s=e.document.eol===BBe.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,qCc.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}}},uOr=class extends jCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(XE.EOL);return r.length&&(r[0].startsWith(FBe)||r[0].startsWith(WCt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(uV)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(uV))),r.join(XE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,XE.summarize)(c);o.push(lOr(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(uV)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(XE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,QCc.isUri)(e),s=o?(0,XE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,UCc.getLanguage)((0,XE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(FBe)||g.startsWith(WCt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(uV)),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:BBe.NotebookCellKind.Code},y=q6i(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"?BBe.NotebookCellKind.Markup:BBe.NotebookCellKind.Code),yield A}else g.startsWith(uV)?(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(uV),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,XE.getCellIdMap)(r),o=[],s=e.split(XE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=XE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+XE.EOL.length}return new zCt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==BBe.NotebookCellKind.Markup:!0).map(l=>(0,XE.summarize)(l)).map(l=>{let d=`${lOr(l)}${XE.EOL}`;return{content:`${d}${l.source.join(XE.EOL)}${XE.EOL}${uV}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(XE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new zCt(s,c,e)}};UBe.AlternativeXmlNotebookContentProvider=uOr;function q6i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(j6i(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(q6i,"extractCellParts")});var z6i=I(v1=>{"use strict";p();var $Cc=v1&&v1.__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},G6i=v1&&v1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v1,"__esModule",{value:!0});v1.AlternativeNotebookContentService=v1.IAlternativeNotebookContentService=void 0;v1.getAlternativeNotebookDocumentProvider=fOr;v1.inferAlternativeNotebookContentFormat=ZCc;v1.getAltNotebookRange=XCc;var VCc=bvt(),WCc=nn(),zCc=D0(),$6i=Dl(),YCc=fBe(),KCc=Ah(),V6i=L6i(),JCc=Q6i(),W6i=H6i();function fOr(t){switch(t){case"xml":return new W6i.AlternativeXmlNotebookContentProvider;case"text":return new JCc.AlternativeTextNotebookContentProvider;case"json":return new V6i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(fOr,"getAlternativeNotebookDocumentProvider");function ZCc(t){return(0,W6i.isXmlContent)(t)?"xml":(0,V6i.isJsonContent)(t)?"json":"text"}a(ZCc,"inferAlternativeNotebookContentFormat");v1.IAlternativeNotebookContentService=(0,WCc.createServiceIdentifier)("IAlternativeNotebookContentService");var dOr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,YCc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig($6i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return fOr(e)}};v1.AlternativeNotebookContentService=dOr;v1.AlternativeNotebookContentService=dOr=$Cc([G6i(0,$6i.IConfigurationService),G6i(1,KCc.IExperimentationService)],dOr);function XCc(t,e,r,n){let o=(0,VCc.findCell)(e,r);if(!o)return;let s=fOr(n).getAlternativeDocument(r);return new zCc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(XCc,"getAltNotebookRange")});var K6i=I(QBe=>{"use strict";p();Object.defineProperty(QBe,"__esModule",{value:!0});QBe.NotebookDocumentSnapshot=void 0;QBe.isNotebookDocumentSnapshotJSON=rbc;var YCt=ZS(),ebc=id(),pOr=D0(),Y6i=z6i(),tbc=OBe();function rbc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,ebc.isUriComponents)(t.uri)&&(0,YCt.isString)(t._text)&&(0,YCt.isString)(t.languageId)&&(0,YCt.isNumber)(t.version)&&(0,YCt.isString)(t.alternativeFormat)}a(rbc,"isNotebookDocumentSnapshotJSON");var hOr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,Y6i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,Y6i.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,tbc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new pOr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new pOr.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 pOr.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}}};QBe.NotebookDocumentSnapshot=hOr});var gOr=I(Gv=>{"use strict";p();var nbc=Gv&&Gv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ibc=Gv&&Gv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),obc=Gv&&Gv.__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,J6i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return fbc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,sbc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return dbc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>J6i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};Gv.AbstractWorkspaceService=KCt;function pbc(t,e){let r=t.getWorkspaceFolder(e);return r?lbc.posix.relative(r.path,e.path):e.path}a(pbc,"getWorkspaceFileDisplayPath");var mOr=class extends KCt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new cbc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new dV.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new dV.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new dV.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new dV.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new dV.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new dV.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new dV.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new dV.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)}};Gv.NullWorkspaceService=mOr});var _Or=I(Kne=>{"use strict";p();Object.defineProperty(Kne,"__esModule",{value:!0});Kne.BatchedProcessor=Kne.TaskQueue=void 0;Kne.raceFilter=hbc;var AOr=nl(),Z6i=Rs(),yOr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new AOr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new AOr.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 Z6i.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 Z6i.CancellationError)}};Kne.TaskQueue=yOr;var EOr=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 AOr.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)}};Kne.BatchedProcessor=EOr;function hbc(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(hbc,"raceFilter")});var vOr=I(Wye=>{"use strict";p();Object.defineProperty(Wye,"__esModule",{value:!0});Wye.AsyncIterUtilsExt=Wye.AsyncIterUtils=void 0;var X6i;(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})(X6i||(Wye.AsyncIterUtils=X6i={}));var e9i;(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})(e9i||(Wye.AsyncIterUtilsExt=e9i={}))});var bOr=I(COr=>{"use strict";p();Object.defineProperty(COr,"__esModule",{value:!0});COr.backwardCompatSetting=mbc;function mbc(t,e){return e(t)}a(mbc,"backwardCompatSetting")});var r9i=I(gI=>{"use strict";p();Object.defineProperty(gI,"__esModule",{value:!0});gI.LineWithTokens=gI.Token=void 0;gI.getOrDeduceSelectionFromLastEdit=Abc;gI.clipTokensToRange=t9i;gI.clipTokensToRangeAndAdjustOffsets=Ebc;gI.removeTokensInRangeAndAdjustOffsets=_bc;gI.getTokensFromLogProbs=vbc;gI.getTokensFromLinesWithTokens=Cbc;gI.mergeOffsetRangesAtDistance=bbc;var gbc=Rs(),zye=gd();function Abc(t){let e=new zye.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):ybc(t)}a(Abc,"getOrDeduceSelectionFromLastEdit");function ybc(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 zye.OffsetRange(c,c))}a(ybc,"deduceSelectionFromLastEdit");var JCt=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 zye.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)}};gI.Token=JCt;function t9i(t,e){return t.filter(r=>e.intersects(r.range))}a(t9i,"clipTokensToRange");function Ebc(t,e){return t9i(t,e).map(r=>r.deltaOffset(-e.start))}a(Ebc,"clipTokensToRangeAndAdjustOffsets");function _bc(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(_bc,"removeTokensInRangeAndAdjustOffsets");function vbc(t,e){let r=e;return t.content.map(n=>{let o=new JCt(n.token,n.logprob,r);return r+=o.range.length,o})}a(vbc,"getTokensFromLogProbs");var SOr=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)}};hI.LineWithTokens=_Or;function sbc(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(sbc,"getTokensFromLinesWithTokens");function abc(t,e){if(e<0)throw new ebc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new Vye.OffsetRange(o.start-e,o.endExclusive+e)),n=new Vye.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new Vye.OffsetRange(o.start+e,o.endExclusive-e))}a(abc,"mergeOffsetRangesAtDistance")});var Y6i=I(zCt=>{"use strict";p();Object.defineProperty(zCt,"__esModule",{value:!0});zCt.DelaySession=void 0;var vOr=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)}};zCt.DelaySession=vOr});var X6i=I(kp=>{"use strict";p();var cbc=kp&&kp.__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},YCt=kp&&kp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kp,"__esModule",{value:!0});kp.UserInteractionMonitor=kp.MAX_INTERACTIONS_STORED=kp.MAX_INTERACTIONS_CONSIDERED=kp.ActionKind=void 0;kp.getWindowWithIgnoredLimit=J6i;kp.getUserHappinessScore=Z6i;var Wye=Pl(),Kne=py(),lbc=Sp(),ubc=mh(),dbc=gm(),K6i=X_(),fbc=Y6i(),mI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(mI||(kp.ActionKind=mI={}));kp.MAX_INTERACTIONS_CONSIDERED=10;kp.MAX_INTERACTIONS_STORED=30;function J6i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-kp.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(J6i,"getWindowWithIgnoredLimit");function Z6i(t,e){if(t.length===0)return .5;let r=J6i(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/kp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(Z6i,"getUserHappinessScore");var COr=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(mI.Accepted)}handleRejection(){this._recordUserAction(mI.Rejected)}handleIgnored(){this._recordUserAction(mI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===mI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-kp.MAX_INTERACTIONS_STORED),e!==mI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-kp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new fbc.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===mI.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(Wye.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Kne.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(Wye.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=Kne.AggressivenessLevel.High:c>=s.mediumThreshold?o=Kne.AggressivenessLevel.Medium:o=Kne.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=Wye.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Kne.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:K6i.ErrorUtils.toString(K6i.ErrorUtils.fromUnknown(n)),configValue:r}),Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return Z6i(this._recentUserActionsForAggressiveness,e)}};kp.UserInteractionMonitor=COr;kp.UserInteractionMonitor=COr=cbc([YCt(0,Wye.IConfigurationService),YCt(1,ubc.IExperimentationService),YCt(2,lbc.ILogService),YCt(3,dbc.ITelemetryService)],COr)});var e9i=I(bOr=>{"use strict";p();Object.defineProperty(bOr,"__esModule",{value:!0});bOr.isImportStatement=pbc;function pbc(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(pbc,"isImportStatement")});var n9i=I(KCt=>{"use strict";p();Object.defineProperty(KCt,"__esModule",{value:!0});KCt.IgnoreImportChangesAspect=void 0;var t9i=Q0t(),hbc=Sl(),r9i=e9i(),SOr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,r9i.isImportStatement)(o,r))||mbc(e,n).some(o=>(0,r9i.isImportStatement)(o,r))}static filterEdit(e,r,n=t9i.ImportChanges.None){if(n===t9i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};KCt.IgnoreImportChangesAspect=SOr;function mbc(t,e){return(0,hbc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(mbc,"getOldLines")});var IOr=I(JCt=>{"use strict";p();Object.defineProperty(JCt,"__esModule",{value:!0});JCt.FetchStreamError=void 0;var TOr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};JCt.FetchStreamError=TOr});var i9i=I(ZCt=>{"use strict";p();Object.defineProperty(ZCt,"__esModule",{value:!0});ZCt.DiagnosticData=void 0;var gbc=ZP(),xOr=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,gbc.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}};ZCt.DiagnosticData=xOr});var cV=I(zye=>{"use strict";p();Object.defineProperty(zye,"__esModule",{value:!0});zye.ResponseTags=zye.PromptTags=void 0;var o9i;(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})(o9i||(zye.PromptTags=o9i={}));var s9i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(s9i||(zye.ResponseTags=s9i={}))});var DOr=I(r9=>{"use strict";p();var Abc=r9&&r9.__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},ybc=r9&&r9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(r9,"__esModule",{value:!0});r9.LintErrors=void 0;var Ebc=i9i(),KR=py(),_bc=T$(),vbc=Rs(),wOr=ZP(),Cbc=eh(),c9i=hd(),bbc=P0(),Sbc=cV(),kOr=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 Cbc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,wOr.isEqual)(n,s)?ebt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new POr(s,l.message,l.severity===bbc.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=wbc(n,e.maxLineDistance),n=a9i(n),n=ROr(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,wOr.isEqual)(l.documentUri,o)?e:{...e,showCode:KR.LintOptionShowCode.NO};return XCt(l,this._document.lines,d)}).join(` -`),c=Sbc.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)}};gI.LineWithTokens=SOr;function Cbc(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(Cbc,"getTokensFromLinesWithTokens");function bbc(t,e){if(e<0)throw new gbc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new zye.OffsetRange(o.start-e,o.endExclusive+e)),n=new zye.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new zye.OffsetRange(o.start+e,o.endExclusive-e))}a(bbc,"mergeOffsetRangesAtDistance")});var n9i=I(ZCt=>{"use strict";p();Object.defineProperty(ZCt,"__esModule",{value:!0});ZCt.DelaySession=void 0;var TOr=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)}};ZCt.DelaySession=TOr});var a9i=I(Dp=>{"use strict";p();var Sbc=Dp&&Dp.__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},XCt=Dp&&Dp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.UserInteractionMonitor=Dp.MAX_INTERACTIONS_STORED=Dp.MAX_INTERACTIONS_CONSIDERED=Dp.ActionKind=void 0;Dp.getWindowWithIgnoredLimit=o9i;Dp.getUserHappinessScore=s9i;var Yye=Dl(),Jne=hy(),Tbc=Ip(),Ibc=Ah(),xbc=ym(),i9i=tv(),wbc=n9i(),AI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(AI||(Dp.ActionKind=AI={}));Dp.MAX_INTERACTIONS_CONSIDERED=10;Dp.MAX_INTERACTIONS_STORED=30;function o9i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-Dp.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(o9i,"getWindowWithIgnoredLimit");function s9i(t,e){if(t.length===0)return .5;let r=o9i(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/Dp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(s9i,"getUserHappinessScore");var IOr=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(AI.Accepted)}handleRejection(){this._recordUserAction(AI.Rejected)}handleIgnored(){this._recordUserAction(AI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===AI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-Dp.MAX_INTERACTIONS_STORED),e!==AI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-Dp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(Yye.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(Yye.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new wbc.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===AI.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(Yye.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Jne.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(Yye.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=Jne.AggressivenessLevel.High:c>=s.mediumThreshold?o=Jne.AggressivenessLevel.Medium:o=Jne.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=Yye.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Jne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Jne.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:i9i.ErrorUtils.toString(i9i.ErrorUtils.fromUnknown(n)),configValue:r}),Jne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return s9i(this._recentUserActionsForAggressiveness,e)}};Dp.UserInteractionMonitor=IOr;Dp.UserInteractionMonitor=IOr=Sbc([XCt(0,Yye.IConfigurationService),XCt(1,Ibc.IExperimentationService),XCt(2,Tbc.ILogService),XCt(3,xbc.ITelemetryService)],IOr)});var c9i=I(xOr=>{"use strict";p();Object.defineProperty(xOr,"__esModule",{value:!0});xOr.isImportStatement=Rbc;function Rbc(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(Rbc,"isImportStatement")});var d9i=I(ebt=>{"use strict";p();Object.defineProperty(ebt,"__esModule",{value:!0});ebt.IgnoreImportChangesAspect=void 0;var l9i=G0t(),kbc=Tl(),u9i=c9i(),wOr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,u9i.isImportStatement)(o,r))||Pbc(e,n).some(o=>(0,u9i.isImportStatement)(o,r))}static filterEdit(e,r,n=l9i.ImportChanges.None){if(n===l9i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};ebt.IgnoreImportChangesAspect=wOr;function Pbc(t,e){return(0,kbc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(Pbc,"getOldLines")});var kOr=I(tbt=>{"use strict";p();Object.defineProperty(tbt,"__esModule",{value:!0});tbt.FetchStreamError=void 0;var ROr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};tbt.FetchStreamError=ROr});var f9i=I(rbt=>{"use strict";p();Object.defineProperty(rbt,"__esModule",{value:!0});rbt.DiagnosticData=void 0;var Dbc=e2(),POr=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,Dbc.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}};rbt.DiagnosticData=POr});var fV=I(Kye=>{"use strict";p();Object.defineProperty(Kye,"__esModule",{value:!0});Kye.ResponseTags=Kye.PromptTags=void 0;var p9i;(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})(p9i||(Kye.PromptTags=p9i={}));var h9i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(h9i||(Kye.ResponseTags=h9i={}))});var LOr=I(i9=>{"use strict";p();var Nbc=i9&&i9.__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},Mbc=i9&&i9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(i9,"__esModule",{value:!0});i9.LintErrors=void 0;var Obc=f9i(),ZR=hy(),Lbc=R$(),Bbc=Rs(),DOr=e2(),Fbc=rh(),g9i=gd(),Ubc=D0(),Qbc=fV(),MOr=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 Fbc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,DOr.isEqual)(n,s)?ibt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new OOr(s,l.message,l.severity===Ubc.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=Gbc(n,e.maxLineDistance),n=m9i(n),n=NOr(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,DOr.isEqual)(l.documentUri,o)?e:{...e,showCode:ZR.LintOptionShowCode.NO};return nbt(l,this._document.lines,d)}).join(` +`),c=Qbc.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=ROr(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 vbc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,wOr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===KR.LintOptionShowCode.NO)continue;if(l9i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:KR.LintOptionWarning.YES,showCode:KR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=ROr(r,KR.LintOptionWarning.YES),r=a9i(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:XCt(o,this._document.lines,e),formattedCode:XCt(o,this._document.lines,{...e,showCode:KR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:XCt(o,this._document.lines,{...e,showCode:KR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};r9.LintErrors=kOr;r9.LintErrors=kOr=Abc([ybc(2,_bc.ILanguageDiagnosticsService)],kOr);function XCt(t,e,r){let n=Tbc(t,t.documentRange);if(r.showCode===KR.LintOptionShowCode.NO)return n;let o=Ibc(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=NOr(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 Bbc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,DOr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===ZR.LintOptionShowCode.NO)continue;if(A9i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:ZR.LintOptionWarning.YES,showCode:ZR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=NOr(r,ZR.LintOptionWarning.YES),r=m9i(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:nbt(o,this._document.lines,e),formattedCode:nbt(o,this._document.lines,{...e,showCode:ZR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:nbt(o,this._document.lines,{...e,showCode:ZR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};i9.LintErrors=MOr;i9.LintErrors=MOr=Nbc([Mbc(2,Lbc.ILanguageDiagnosticsService)],MOr);function nbt(t,e,r){let n=qbc(t,t.documentRange);if(r.showCode===ZR.LintOptionShowCode.NO)return n;let o=jbc(t.documentRange,r,e);return n+` `+o.join(` -`)}a(XCt,"formatSingleDiagnostic");function Tbc(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(Tbc,"formatDiagnosticMessage");function Ibc(t,e,r){let o=l9i(t,e).intersect(new c9i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(wbc,"filterDiagnosticsByDistance");function a9i(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:ebt.compareFn(e.distance,r.distance))}a(a9i,"sortDiagnosticsByDistance");function ROr(t,e){switch(e){case KR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case KR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case KR.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(ROr,"filterDiagnosticsBySeverity");var ebt=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}},POr=class extends Ebc.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 Yye=I(tbt=>{"use strict";p();Object.defineProperty(tbt,"__esModule",{value:!0});tbt.toUniquePath=kbc;tbt.countTokensForLines=Pbc;var Rbc=tJ();function kbc(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===Rbc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(kbc,"toUniquePath");function Pbc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(Pbc,"countTokensForLines")});var u9i=I(NOr=>{"use strict";p();Object.defineProperty(NOr,"__esModule",{value:!0});NOr.getEditDiffHistory=Mbc;var Dbc=iN(),lV=Sl(),Nbc=Yye();function Mbc(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=Obc(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(nbt,"formatSingleDiagnostic");function qbc(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(qbc,"formatDiagnosticMessage");function jbc(t,e,r){let o=A9i(t,e).intersect(new g9i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(Gbc,"filterDiagnosticsByDistance");function m9i(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:ibt.compareFn(e.distance,r.distance))}a(m9i,"sortDiagnosticsByDistance");function NOr(t,e){switch(e){case ZR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case ZR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case ZR.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(NOr,"filterDiagnosticsBySeverity");var ibt=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}},OOr=class extends Obc.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 Jye=I(obt=>{"use strict";p();Object.defineProperty(obt,"__esModule",{value:!0});obt.toUniquePath=Vbc;obt.countTokensForLines=Wbc;var $bc=nJ();function Vbc(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===$bc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(Vbc,"toUniquePath");function Wbc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(Wbc,"countTokensForLines")});var y9i=I(BOr=>{"use strict";p();Object.defineProperty(BOr,"__esModule",{value:!0});BOr.getEditDiffHistory=Kbc;var zbc=aN(),pV=Tl(),Ybc=Jye();function Kbc(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=Jbc(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(Mbc,"getEditDiffHistory");function Obc(t,e){let r=[],n=Dbc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,lV.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,lV.pushMany)(r,d.map(g=>`-${g}`)),(0,lV.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,Nbc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,lV.pushMany)(c,r),c.join(` -`)}a(Obc,"generateDocDiff")});var MOr=I(uV=>{"use strict";p();Object.defineProperty(uV,"__esModule",{value:!0});uV.count=Lbc;uV.findInsertionIndexInSortedArray=Bbc;uV.max=Fbc;uV.filterMap=Ubc;uV.min=Qbc;uV.batchArrayElements=qbc;function Lbc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Lbc,"count");function Bbc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Bbc,"findInsertionIndexInSortedArray");function Fbc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(Fbc,"max");function Ubc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(Ubc,"filterMap");function Qbc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var jbc=XE&&XE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hbc=XE&&XE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gbc=XE&&XE.__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;oQOr(A.entries)):d=p9i(e,t.id,c,l).map(A=>m9i(A));let{snippets:f,docsInPrompt:h}=v9i(d,n,o);r&&g9i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=A9i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` +`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(Kbc,"getEditDiffHistory");function Jbc(t,e){let r=[],n=zbc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,pV.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,pV.pushMany)(r,d.map(g=>`-${g}`)),(0,pV.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,Ybc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,pV.pushMany)(c,r),c.join(` +`)}a(Jbc,"generateDocDiff")});var FOr=I(hV=>{"use strict";p();Object.defineProperty(hV,"__esModule",{value:!0});hV.count=Zbc;hV.findInsertionIndexInSortedArray=Xbc;hV.max=e1c;hV.filterMap=t1c;hV.min=r1c;hV.batchArrayElements=n1c;function Zbc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Zbc,"count");function Xbc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Xbc,"findInsertionIndexInSortedArray");function e1c(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(e1c,"max");function t1c(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(t1c,"filterMap");function r1c(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var i1c=e_&&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]})),o1c=e_&&e_.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),s1c=e_&&e_.__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;oGOr(A.entries)):d=v9i(e,t.id,c,l).map(A=>b9i(A));let{snippets:f,docsInPrompt:h}=R9i(d,n,o);r&&S9i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=T9i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` -`),documents:h,neighborSnippetsResult:m}}a(Kbc,"getRecentCodeSnippets");function Jbc(t,e,r){switch(e){case OOr.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case OOr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case OOr.IncludeLineNumbersOption.None:return t;default:(0,Vbc.assertNever)(e)}}a(Jbc,"formatLinesWithLineNumbers");function rbt(t,e,r){let n=(0,FOr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=Jbc(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[d9i.PromptTags.RECENT_FILE.start,o,c,d9i.PromptTags.RECENT_FILE.end].join(` -`)}a(rbt,"formatCodeSnippet");function p9i(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(p9i,"collectRecentDocuments");function h9i(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(h9i,"collectRecentDocumentsGrouped");function Zbc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===BOr.RecentFileClippingStrategy.Proportional?h9i(e,t.id,n,o).map(u=>QOr(u.entries)):p9i(e,t.id,n,o).map(l=>m9i(l))}a(Zbc,"prepareRecentCodeSnippets");function UOr(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(UOr,"selectFocalRangesWithinSpanCap");function m9i(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(m9i,"historyEntryToCodeSnippet");function QOr(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(QOr,"historyEntriesToCodeSnippet");function g9i(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===$bc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=LOr.DocumentId.create(l.uri.toString());e.push(rbt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(g9i,"appendLanguageContextSnippets");function A9i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=LOr.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(rbt(LOr.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(A9i,"appendNeighborFileSnippets");function y9i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,FOr.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(rbt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(y9i,"clipFullDocument");function E9i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=UOr(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,FOr.countTokensForLines)(h.slice(E,_),n)}return A}a(E9i,"computeFocalPageCost");function _9i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=UOr(t.focalRanges,T=>u.getPosition(T).lineNumber,d);if(f.length===0)return n;let h=Math.min(...f.map(T=>T.start)),m=Math.max(...f.map(T=>T.endExclusive-1)),g=u.getPosition(h),A=u.getPosition(m),{firstPageIdx:y,lastPageIdxIncl:E,budgetLeft:_}=(0,Ybc.expandRangeToPageRange)(t.content.getLines(),new zbc.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(_===n||_<0)return;let v=y*e,b=t.content.getLines().slice(v,(E+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(rbt(t.id,b,{truncated:b.lengthE.focalRanges!==void 0&&E.focalRanges.length>0?E9i(E.content,E.focalRanges,n,e)??0:0),d=t.length,f=u.reduce((E,_)=>E+_,0);for(;d>0&&f>s;)d--,f-=u[d];if(d===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let h=s-f,m=t.slice(0,d).map(E=>E.editEntryCount??1),g=m.reduce((E,_)=>E+_,0),A=m.map(E=>Math.floor(h*(E/g))),y=0;for(let E=0;E0)y=_9i(_,n,v.length,b,e,c,l,o)??b;else{let T=(0,f9i.batchArrayElements)(v,n);y=y9i(_,T,v.length,b,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(e1c,"buildCodeSnippetsWithProportionalBudget")});var nbt=I(Zd=>{"use strict";p();var t1c=Zd&&Zd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r1c=Zd&&Zd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n1c=Zd&&Zd.__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 UOr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case UOr.IncludeLineNumbersOption.None:return t;default:(0,c1c.assertNever)(e)}}a(p1c,"formatLinesWithLineNumbers");function sbt(t,e,r){let n=(0,jOr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=p1c(e,r.includeLineNumbers,r.startLineOffset).join(` +`);return[E9i.PromptTags.RECENT_FILE.start,o,c,E9i.PromptTags.RECENT_FILE.end].join(` +`)}a(sbt,"formatCodeSnippet");function v9i(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(v9i,"collectRecentDocuments");function C9i(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(C9i,"collectRecentDocumentsGrouped");function h1c(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===qOr.RecentFileClippingStrategy.Proportional?C9i(e,t.id,n,o).map(u=>GOr(u.entries)):v9i(e,t.id,n,o).map(l=>b9i(l))}a(h1c,"prepareRecentCodeSnippets");function HOr(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(HOr,"selectFocalRangesWithinSpanCap");function b9i(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(b9i,"historyEntryToCodeSnippet");function GOr(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(GOr,"historyEntriesToCodeSnippet");function S9i(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===a1c.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=QOr.DocumentId.create(l.uri.toString());e.push(sbt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(S9i,"appendLanguageContextSnippets");function T9i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=QOr.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(sbt(QOr.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(T9i,"appendNeighborFileSnippets");function I9i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,jOr.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(sbt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(I9i,"clipFullDocument");function x9i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=HOr(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,jOr.countTokensForLines)(h.slice(E,_),n)}return A}a(x9i,"computeFocalPageCost");function w9i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=HOr(t.focalRanges,T=>u.getPosition(T).lineNumber,d);if(f.length===0)return n;let h=Math.min(...f.map(T=>T.start)),m=Math.max(...f.map(T=>T.endExclusive-1)),g=u.getPosition(h),A=u.getPosition(m),{firstPageIdx:y,lastPageIdxIncl:E,budgetLeft:_}=(0,d1c.expandRangeToPageRange)(t.content.getLines(),new u1c.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(_===n||_<0)return;let v=y*e,b=t.content.getLines().slice(v,(E+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(sbt(t.id,b,{truncated:b.lengthE.focalRanges!==void 0&&E.focalRanges.length>0?x9i(E.content,E.focalRanges,n,e)??0:0),d=t.length,f=u.reduce((E,_)=>E+_,0);for(;d>0&&f>s;)d--,f-=u[d];if(d===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let h=s-f,m=t.slice(0,d).map(E=>E.editEntryCount??1),g=m.reduce((E,_)=>E+_,0),A=m.map(E=>Math.floor(h*(E/g))),y=0;for(let E=0;E0)y=w9i(_,n,v.length,b,e,c,l,o)??b;else{let T=(0,_9i.batchArrayElements)(v,n);y=I9i(_,T,v.length,b,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(g1c,"buildCodeSnippetsWithProportionalBudget")});var abt=I(ef=>{"use strict";p();var A1c=ef&&ef.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y1c=ef&&ef.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E1c=ef&&ef.__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(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,LBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,LBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,I9i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,obt.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` +${o}`;break}let D=d.promptingStrategy!==Xl.PromptingStrategy.Nes41Miniv3&&d.promptingStrategy!==Xl.PromptingStrategy.Codexv21NesUnified&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased01&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased02&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased02WithRecentLineNumbers&&d.promptingStrategy!==Xl.PromptingStrategy.PatchBased02WithoutRecentLineNumbers?T1c(x):x;return{prompt:(I1c(v,D,d.languageContext.traitPosition)+T).trim(),nDiffsInPrompt:E,diffTokensInPrompt:_,neighborSnippetsResult:A}}a(C1c,"getUserPrompt");function b1c(t,e,r,n,o,s,c){S1c(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=0,y=(0,qBe.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,qBe.buildCodeSnippetsUsingPagedClipping)(y,n,R);l.push(...x.snippets),x.docsInPrompt.forEach(P=>f.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,qBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,qBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,M9i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,lbt.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(a1c,"runGlobalBudgetCascade");function c1c(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(c1c,"validateGlobalBudget");function l1c(t){return`\`\`\` +`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(b1c,"runGlobalBudgetCascade");function S1c(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(S1c,"validateGlobalBudget");function T1c(t){return`\`\`\` ${t} -\`\`\``}a(l1c,"wrapInBackticks");function u1c(t,e,r){return r==="before"?S9i(t,e,2):S9i(e,t,2)}a(u1c,"addRelatedInformation");function S9i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}a(T1c,"wrapInBackticks");function I1c(t,e,r){return r==="before"?D9i(t,e,2):D9i(e,t,2)}a(I1c,"addRelatedInformation");function D9i(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 Xl.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 Xl.PromptingStrategy.Xtab275EditIntentShort:case Xl.PromptingStrategy.Xtab275EditIntent:case Xl.PromptingStrategy.Xtab275:o=n;break;case Xl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} +`.repeat(o)+e).trim()}a(D9i,"appendWithNewLineIfNeeded");function x1c(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 \`${bh.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 \`${bh.PromptTags.EDIT_WINDOW.start}\` and \`${bh.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 Xl.PromptingStrategy.PatchBased01:case Xl.PromptingStrategy.Codexv21NesUnified:break;case Xl.PromptingStrategy.PatchBased02:case Xl.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Xl.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 Xl.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 \`${bh.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 Xl.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 Xl.PromptingStrategy.Xtab275EditIntentShort:case Xl.PromptingStrategy.Xtab275EditIntent:case Xl.PromptingStrategy.Xtab275:o=n;break;case Xl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} <|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===Xl.AggressivenessLevel.Medium?n:`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case Xl.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 Xl.PromptingStrategy.SimplifiedSystemPrompt:case Xl.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 \`${vh.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 \`${vh.PromptTags.EDIT_WINDOW.start}\` and \`${vh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. +<|aggressive|>${r}<|/aggressive|>`;break;case Xl.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 Xl.PromptingStrategy.SimplifiedSystemPrompt:case Xl.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 \`${bh.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 \`${bh.PromptTags.EDIT_WINDOW.start}\` and \`${bh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. \`\`\` // Your revised code goes here -\`\`\``;break;default:(0,obt.assertNever)(t)}return o===void 0?"":` +\`\`\``;break;default:(0,lbt.assertNever)(t)}return o===void 0?"":` -${o}`}a(d1c,"getPostScript");function f1c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===i1c.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(x1c,"getPostScript");function w1c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===_1c.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(f1c,"getRelatedInformation");function p1c(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(p1c,"truncateCode");Zd.N_LINES_ABOVE=2;Zd.N_LINES_BELOW=5;Zd.N_LINES_AS_CONTEXT=15;function x9i(t,e,r,n,o,s,c){let l=Math.ceil(t.length/r);function u(g){let A=g*r,y=Math.min(A+r,t.length),E=t.slice(A,y);return(0,GOr.countTokensForLines)(E,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,o1c.range)(d,f+1).reduce((g,A)=>g+u(A),0);if(h<0)return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:h};let m=h;if(s){m=h;for(let g=d-1;g>=0&&m>0;--g){let A=u(g),y=m-A;if(y<0)break;d=g,m=y}for(let g=f+1;g0;++g){let A=u(g),y=m-A;if(y<0)break;f=g,m=y}}else{let g=Math.floor(h/2);m=g;for(let y=d-1;y>=0&&m>0;--y){let E=u(y),_=m-E;if(_<0)break;d=y,m=_}m=g+(c?m:0);for(let y=f+1;y0;++y){let E=u(y),_=m-E;if(_<0)break;f=y,m=_}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(x9i,"expandRangeToPageRange");function w9i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,GOr.countTokensForLines)(s,r);if(c<0)return jOr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=x9i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return jOr.Result.ok(new T9i.OffsetRange(d,f))}a(w9i,"clipPreservingRange");var ibt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Zd.ClippedDocument=ibt;function R9i(t,e,r,n,o,s){let c=w9i(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 T9i.OffsetRange(l.start,l.start+u.length);return jOr.Result.ok(new ibt(u,d))}a(R9i,"createTaggedCurrentFileContentUsingPagedClipping");function qOr(t,e){switch(e){case Kye.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case Kye.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case Kye.IncludeLineNumbersOption.None:return[...t];default:(0,obt.assertNever)(e)}}a(qOr,"addLineNumbers");function h1c(t,e,r,n,o,s){let c=b9i.StringEdit.single(b9i.StringReplacement.insert(t.cursorOffset,vh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=qOr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[vh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),vh.PromptTags.EDIT_WINDOW.start,...u,vh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),vh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=qOr(f,s.includeLineNumbers.currentFileContent),m=qOr(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 R9i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(h1c,"constructTaggedFile")});var k9i=I(JR=>{"use strict";p();Object.defineProperty(JR,"__esModule",{value:!0});JR.xtab275SystemPrompt=JR.simplifiedPrompt=JR.nes41Miniv3SystemPrompt=JR.unifiedModelSystemPrompt=JR.systemPromptTemplate=void 0;var dV=cV();JR.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 ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}a(w1c,"getRelatedInformation");function R1c(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(R1c,"truncateCode");ef.N_LINES_ABOVE=2;ef.N_LINES_BELOW=5;ef.N_LINES_AS_CONTEXT=15;function O9i(t,e,r,n,o,s,c){let l=Math.ceil(t.length/r);function u(g){let A=g*r,y=Math.min(A+r,t.length),E=t.slice(A,y);return(0,zOr.countTokensForLines)(E,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,v1c.range)(d,f+1).reduce((g,A)=>g+u(A),0);if(h<0)return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:h};let m=h;if(s){m=h;for(let g=d-1;g>=0&&m>0;--g){let A=u(g),y=m-A;if(y<0)break;d=g,m=y}for(let g=f+1;g0;++g){let A=u(g),y=m-A;if(y<0)break;f=g,m=y}}else{let g=Math.floor(h/2);m=g;for(let y=d-1;y>=0&&m>0;--y){let E=u(y),_=m-E;if(_<0)break;d=y,m=_}m=g+(c?m:0);for(let y=f+1;y0;++y){let E=u(y),_=m-E;if(_<0)break;f=y,m=_}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(O9i,"expandRangeToPageRange");function L9i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,zOr.countTokensForLines)(s,r);if(c<0)return VOr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=O9i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return VOr.Result.ok(new N9i.OffsetRange(d,f))}a(L9i,"clipPreservingRange");var cbt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};ef.ClippedDocument=cbt;function B9i(t,e,r,n,o,s){let c=L9i(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 N9i.OffsetRange(l.start,l.start+u.length);return VOr.Result.ok(new cbt(u,d))}a(B9i,"createTaggedCurrentFileContentUsingPagedClipping");function $Or(t,e){switch(e){case Zye.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case Zye.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case Zye.IncludeLineNumbersOption.None:return[...t];default:(0,lbt.assertNever)(e)}}a($Or,"addLineNumbers");function k1c(t,e,r,n,o,s){let c=P9i.StringEdit.single(P9i.StringReplacement.insert(t.cursorOffset,bh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=$Or(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[bh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),bh.PromptTags.EDIT_WINDOW.start,...u,bh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),bh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=$Or(f,s.includeLineNumbers.currentFileContent),m=$Or(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 B9i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` +`)}))}a(k1c,"constructTaggedFile")});var F9i=I(XR=>{"use strict";p();Object.defineProperty(XR,"__esModule",{value:!0});XR.xtab275SystemPrompt=XR.simplifiedPrompt=XR.nes41Miniv3SystemPrompt=XR.unifiedModelSystemPrompt=XR.systemPromptTemplate=void 0;var mV=fV();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 ${mV.PromptTags.EDIT_WINDOW.start} and ${mV.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: @@ -1225,9 +1225,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 ${dV.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 ${mV.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 ${dV.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 ${mV.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 @@ -1238,9 +1238,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 ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.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 ${mV.PromptTags.EDIT_WINDOW.start} and ${mV.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 ${dV.PromptTags.EDIT_WINDOW.start} or ${dV.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 ${mV.PromptTags.EDIT_WINDOW.start} or ${mV.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1250,7 +1250,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.`;JR.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.`;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. You have access to the following information to help you make informed suggestions: @@ -1279,7 +1279,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.`;JR.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.`;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. You have access to the following information to help you make informed suggestions: @@ -1307,18 +1307,18 @@ 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.`;JR.simplifiedPrompt="Predict next code edit based on the context given by the user.";JR.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 abt=I(fV=>{"use strict";p();Object.defineProperty(fV,"__esModule",{value:!0});fV.NullTerminalService=fV.ITerminalService=void 0;fV.isTerminalService=A1c;fV.isNullTerminalService=y1c;var m1c=nn(),sbt=Ic(),g1c=Ro();fV.ITerminalService=(0,m1c.createServiceIdentifier)("ITerminalService");var $Or=class t extends g1c.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new sbt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new sbt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new sbt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new sbt.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){}};fV.NullTerminalService=$Or;function A1c(t){return t&&typeof t.createTerminal=="function"}a(A1c,"isTerminalService");function y1c(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(y1c,"isNullTerminalService")});var P9i=I(n9=>{"use strict";p();var E1c=n9&&n9.__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},_1c=n9&&n9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(n9,"__esModule",{value:!0});n9.TerminalMonitor=void 0;var v1c=abt(),C1c=Ro(),BBe=2e3,VOr=class extends C1c.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:b1c(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,BBe*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<=BBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,BBe/2),contentEnd:n.slice(-BBe/2),length:n.length,truncatedChars:n.length-BBe},terminalCount:r};return JSON.stringify(s)}};n9.TerminalMonitor=VOr;n9.TerminalMonitor=VOr=E1c([_1c(0,v1c.ITerminalService)],VOr);function b1c(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(b1c,"formatCwd")});var D9i=I(cbt=>{"use strict";p();Object.defineProperty(cbt,"__esModule",{value:!0});cbt.CurrentDocument=void 0;var S1c=Rs(),WOr=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 S1c.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}};cbt.CurrentDocument=WOr});var L9i=I(lbt=>{"use strict";p();Object.defineProperty(lbt,"__esModule",{value:!0});lbt.getCurrentLine=I1c;lbt.isModelLineCompatible=x1c;var N9i=q_(),T1c=M_t();function I1c(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new N9i.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?R1c(n,o,e,r):!1}a(x1c,"isModelLineCompatible");var w1c=new Set(["()","[]","{}","<>",'""',"''","``"]);function R1c(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&&O9i(t.inserted,e.inserted):O9i(t.inserted,e.inserted)}a(R1c,"isUserEditCompatibleWithModelEdit");function O9i(t,e){return e.startsWith(t)?!0:w1c.has(t)?k1c(t,e):!1}a(O9i,"isUserTypingCompatibleWithModelText");function k1c(t,e){let r=0;for(let n=0;n{"use strict";p();var P1c=fN&&fN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D1c=fN&&fN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),N1c=fN&&fN.__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(O1c,"parseEditIntentFromStreamShortName");async function L1c(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=ubt.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=ubt.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(L1c,"parseEditIntentFromStreamTags")});var fbt=I(Jye=>{"use strict";p();Object.defineProperty(Jye,"__esModule",{value:!0});Jye.linesWithBackticksRemoved=F1c;Jye.constructMessages=U1c;Jye.charCount=Q1c;Jye.findMergeConflictMarkersRange=q1c;var YOr=Io(),B9i=nBe(),B1c=hd();async function*F1c(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(F1c,"linesWithBackticksRemoved");function U1c({systemMsg:t,userMsg:e}){return[{role:YOr.Raw.ChatRole.System,content:(0,B9i.toTextParts)(t)},{role:YOr.Raw.ChatRole.User,content:(0,B9i.toTextParts)(e)}]}a(U1c,"constructMessages");function Q1c(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===YOr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(Q1c,"charCount");function q1c(t,e,r){for(let n=e.start;n>>>>>>"))return new B1c.OffsetRange(n,o+1)}}a(q1c,"findMergeConflictMarkersRange")});var Q9i=I(pV=>{"use strict";p();Object.defineProperty(pV,"__esModule",{value:!0});pV.ResponseParseResult=void 0;pV.handleEditWindowOnly=G1c;pV.handleCodeBlock=$1c;pV.handleEditWindowWithEditIntent=V1c;pV.handleUnifiedWithXml=W1c;var FBe=nye(),F9i=NG(),U9i=$2(),Zye=cV(),j1c=zOr(),H1c=fbt(),RL;(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})(RL||(pV.ResponseParseResult=RL={}));function G1c(t){return new RL.EditWindowLines(t)}a(G1c,"handleEditWindowOnly");function $1c(t){return new RL.EditWindowLines((0,H1c.linesWithBackticksRemoved)(t))}a($1c,"handleCodeBlock");async function V1c(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,j1c.parseEditIntentFromStream)(t,e,r);return new RL.EditWindowLines(o,{intent:n,parseError:s})}a(V1c,"handleEditWindowWithEditIntent");async function W1c(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new RL.Done(new FBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===Zye.ResponseTags.NO_CHANGE.start)return new RL.Done(new FBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===Zye.ResponseTags.INSERT.start)return new RL.DirectEdits(z1c(o,e,r));if(c===Zye.ResponseTags.EDIT.start){let l=Y1c(o);return new RL.EditWindowLines(l)}return new RL.Done(new FBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(W1c,"handleUnifiedWithXml");async function*z1c(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorLineInEditWindowOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(Zye.ResponseTags.INSERT.end))return new FBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new F9i.LineReplacement(new U9i.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(Zye.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new F9i.LineReplacement(new U9i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new FBe.NoNextEditReason.NoSuggestions(r,l)}a(z1c,"generateInsertEdits");async function*Y1c(t){let e=await t.next();for(;!e.done;){if(e.value.includes(Zye.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Y1c,"generateEditLines")});var q9i=I(i9=>{"use strict";p();var K1c=i9&&i9.__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},ZR=i9&&i9.__param||function(t,e){return function(r,n){e(r,n,t)}},pbt;Object.defineProperty(i9,"__esModule",{value:!0});i9.XtabEndpoint=void 0;var J1c=FE(),Z1c=K6(),KOr=Pl(),X1c=$E(),eSc=J$(),tSc=Gne(),rSc=Sp(),nSc=_y(),iSc=X6(),oSc=mh(),sSc=gm(),aSc=K$(),cSc=Qne(),lSc=Gs(),JOr=class extends tSc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{pbt=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:cSc.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?{...pbt.chatModelInfo,id:n}:pbt.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(KOr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(KOr.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}}};i9.XtabEndpoint=JOr;i9.XtabEndpoint=JOr=pbt=K1c([ZR(3,KOr.IConfigurationService),ZR(4,eSc.IDomainService),ZR(5,nSc.IFetcherService),ZR(6,X1c.ICAPIClientService),ZR(7,sSc.ITelemetryService),ZR(8,J1c.IAuthenticationService),ZR(9,Z1c.IChatMLFetcher),ZR(10,aSc.ITokenizerProvider),ZR(11,lSc.IInstantiationService),ZR(12,oSc.IExperimentationService),ZR(13,iSc.IChatWebSocketManager),ZR(14,rSc.ILogService)],JOr)});var hbt=I(Xye=>{"use strict";p();Object.defineProperty(Xye,"__esModule",{value:!0});Xye.NullProxyModelsService=Xye.IProxyModelsService=void 0;var uSc=nn(),dSc=Ic();Xye.IProxyModelsService=(0,uSc.createServiceIdentifier)("IProxyModelsService");var ZOr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=dSc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};Xye.NullProxyModelsService=ZOr});var j9i=I(rA=>{"use strict";p();var fSc=rA&&rA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pSc=rA&&rA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hSc=rA&&rA.__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},mSc=rA&&rA.__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 g=="boolean"?g?gbt.IncludeLineNumbersOption.WithSpaceAfter:gbt.IncludeLineNumbersOption.None:g),f=new e5r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,s.lines,c,e.langCtx,e.aggressivenessLevel,u,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:l,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:d}}),{prompt:h}=(0,e5r.getUserPrompt)(f),m=(0,wSc.constructMessages)({systemMsg:r,userMsg:h});return gI.Result.ok({messages:m,keptRange:s.keptRange})}async predictNextCursorPosition(e,r,n){let o=r.tracer.createSubLogger("predictNextCursorPosition"),s=this.buildCursorPredictionPrompt(e);if(s.isError())return o.trace(`Failed to construct tagged file: ${s.err.message}`),gI.Result.fromString(s.err.message);let{messages:c,keptRange:l}=s.val;r.telemetry.setCursorJumpPrompt(c),r.logContext.setCursorJumpPrompt(c,l);let u=this.determineModelName();r.telemetry.setCursorJumpModelName(u);let d=await this.resolveEndpoint(u,o);if(!d)return gI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),A={max_tokens:h?Math.max(g,2048):g};m&&(A={...A,secretKey:m});let y=await f.makeChatRequest2({messages:c,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:XOr.ChatLocation.Other,requestOptions:A},n);if(y.type!==XOr.ChatFetchResponseType.Success)return y.type===XOr.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),gI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let E=y.value.trim();return this.parseResponse(E,l)}catch(E){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${E}`),gI.Result.fromString(`failedToParseLine:"${y.value}". Error ${bSc.ErrorUtils.fromUnknown(E).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(pN.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(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(ySc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:gSc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:SSc.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(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??RSc}determineLintOptions(){let e=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,Abt.parseLintOptionString)(r,Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=kSc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return gI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?gI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?gI.Result.fromString("crossFileEmptyFilePath"):gI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?gI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(kSc,"stripThinkTags")});var Y9i=I(QBe=>{"use strict";p();Object.defineProperty(QBe,"__esModule",{value:!0});QBe.XtabPatchResponseHandler=void 0;QBe.tryRemoveDuplicateAdditions=z9i;var H9i=Vne(),UBe=py(),PSc=ogt(),G9i=nye(),DSc=X_(),NSc=Sl(),MSc=NA(),$9i=nd(),W9i=NG(),OSc=$2(),LSc=IOr(),BSc=Yye(),FSc=cV(),tEe=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))}static insertion(e,r){return new t(e,r)}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 r5r(t){return t.trim().length>1}a(r5r,"isMeaningfulLine");function z9i(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,NSc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&r5r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&r5r(c[0])&&r5r(c[1])){let l=c[0],u=c[1];for(let d=1;d=1&&c.lineNumZeroBased===l&&c.filePath===u&&PSc.ResponseProcessor.isAdditiveEdit(c.removedLines[0],c.addedLines[0])}a(o,"isGhostTextPatch"),t.isGhostTextPatch=o;async function*s(c,l,u){let d=null,f=!0,h=!1;for await(let m of c){if(m.trim()===FSc.ResponseTags.NO_EDIT)break;if(d===null){d=tEe.ofLine(m);continue}if(d.addLine(m)){if(f&&!h&&l!==void 0&&u!==void 0&&d.addedLines.length===1&&d.removedLines.length>=1){if(o(d,l,u)){let g=tEe.insertion(d.filePath,d.lineNumZeroBased);g.removedLines=[...d.removedLines],g.addedLines=[...d.addedLines],yield g,d=tEe.insertion(d.filePath,d.lineNumZeroBased+1)}h=!0}continue}(d.removedLines.length>0||d.addedLines.length>0)&&(yield d),d=tEe.ofLine(m),f=!1}d&&(d.removedLines.length>0||d.addedLines.length>0)&&(yield d)}a(s,"extractEdits"),t.extractEdits=s})(V9i||(QBe.XtabPatchResponseHandler=V9i={}))});var pUi=I(Pp=>{"use strict";p();var QSc=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]})),qSc=Pp&&Pp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jSc=Pp&&Pp.__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},HSc=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;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=o9.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(pTc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(yTc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(vTc.XtabNextCursorPredictor,o9.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ds.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ds.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ds.WithStatelessProviderTelemetry(h,s.build(_bt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,AV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ds.WithStatelessProviderTelemetry(d.value,s.build(_bt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ds.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ds.WithStatelessProviderTelemetry(f,s.build(_bt.Result.error(f)))}catch(c){let l=mV.ErrorUtils.fromUnknown(c),u=new Ds.NoNextEditReason.Unexpected(l);return new Ds.WithStatelessProviderTelemetry(u,s.build(_bt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,fTc.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 Ds.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 n5r.Position(r.endLineNumber,r.endColumn),E=new ETc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=lUi(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 Cbt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ds.RequestEditWindowWithCursorJump(w,l):new Ds.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,aUi.countTokensForLines)(R,o9.computeTokens)>x)return new Ds.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(ke=>ke.includes(nUi.PromptTags.CURSOR)),N=(0,gV.constructTaggedFile)(E,v,_,m,o9.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Go.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ds.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(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(q),M!==void 0&&f.setXtabUserHappinessScore(M);let j=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,hV.raceCancellation)((0,hV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new gTc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),Y=new gV.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,j,q,U,o9.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:V,diffTokensInPrompt:z,neighborSnippetsResult:ie}=(0,gV.getUserPrompt)(Y);f.setNDiffsInPrompt(V),f.setDiffTokensInPrompt(z),ie&&(f.setNNeighborSnippetsComputed(ie.nComputed),f.setNNeighborSnippetsInPrompt(ie.nIncluded),f.setNeighborSnippetIndicesInPrompt(ie.includedIndices));let H=Go.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,E.cursorLineOffset,R,b,H),le=(0,i5r.constructMessages)({systemMsg:uUi(m.promptingStrategy),userMsg:W});d.setPrompt(le),f.setPrompt(le);let Le=3e4*4;if((0,i5r.charCount)(le)>Le)return new Ds.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let ke=U.getData();f.setLintErrors(ke),d.setDiagnosticsData(ke);let X=this.terminalMonitor.getData();f.setTerminalOutput(X),d.setTerminalData(X)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Ue={endpoint:A,modelServiceConfig:g,messages:le,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:b,editWindowLineRange:v},promptPieces:Y,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Ue,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{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,mTc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Hv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Hv.AggressivenessSetting.Low]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Hv.AggressivenessSetting.Medium]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Hv.AggressivenessSetting.High]:{debounceConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Hv.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(di.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,sUi.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new dTc.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,nTc.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===J9i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,hV.raceCancellation)((0,hV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===J9i.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(mV.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],r.modelServiceConfig.allowImportChanges??KSc.ImportChanges.None);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 Ds.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 oTc.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(di.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new GSc.FetchStreamSource,E=new sTc.StopWatch,_="",v,b=new hV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:o9.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:Lf.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===Lf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==Lf.ChatFetchResponseType.Success?y.reject(new rUi.FetchStreamError(c5r(P))):y.resolve()}).catch(P=>{m.setError(mV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(mV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==Lf.ChatFetchResponseType.Success)return w.type===Lf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,yV.ModelNotFound.INSTANCE):w.type===Lf.ChatFetchResponseType.Unknown&&w.reason===Lf.RESPONSE_CONTAINED_NO_CHOICES?new yV.FetchFailure(new Ds.NoNextEditReason.NoSuggestions(u,l)):new yV.FetchFailure(c5r(w));let R=Z9i.AsyncIterUtilsExt.splitLines(Z9i.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(nUi.PromptTags.CURSOR,""):D}})();return new yV.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,cursorLineInEditWindowOffset: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 yV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof yV.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof AV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case Go.ResponseFormat.EditWindowOnly:{O=(0,Jne.handleEditWindowOnly)(L);break}case Go.ResponseFormat.CodeBlock:{O=(0,Jne.handleCodeBlock)(L);break}case Go.ResponseFormat.EditWindowWithEditIntent:case Go.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===Go.ResponseFormat.EditWindowWithEditIntentShort?oUi.EditIntentParseMode.ShortName:oUi.EditIntentParseMode.Tags;O=await(0,Jne.handleEditWindowWithEditIntent)(L,h,ie);break}case Go.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[E.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new Cbt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,le+1)),ge=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Ue=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService);O=new Jne.ResponseParseResult.DirectEdits(CTc.XtabPatchResponseHandler.handleResponse(L,H,ie.id,ie.workspaceRoot,Le,h,ge,Ue));break}case Go.ResponseFormat.UnifiedWithXml:{O=await(0,Jne.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Zne.assertNever)(n.responseFormat)}if(O instanceof Jne.ResponseParseResult.Done)return O.reason;if(O instanceof Jne.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ie,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!Go.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new Ds.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let j=O.lines,Q={emitFastCursorLineChange:K9i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let U=(0,iTc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return Hv.EarlyDivergenceCancellationMode.Off;case!0:return Hv.EarlyDivergenceCancellationMode.Cursor;case Hv.EarlyDivergenceCancellationMode.Off:case Hv.EarlyDivergenceCancellationMode.Cursor:case Hv.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return Hv.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=U===Hv.EarlyDivergenceCancellationMode.Off?j:TTc(j,x,e,P,R,d,l,ie=>{Y=ie},U),V=0,z=!1;for await(let ie of K9i.ResponseProcessor.diff(R,W,x,Q)){if(Y)break;h.trace(`ResponseProcessor streamed edit #${V} with latency ${q.elapsed()} ms`);let H=[];if(ie.lineRange.startLineNumber===ie.lineRange.endLineNumberExclusive||ie.newLines.length===0||ie.lineRange.endLineNumberExclusive-ie.lineRange.startLineNumber===1&&ie.newLines.length===1){let re=new vbt.LineReplacement(new tUi.LineRange(ie.lineRange.startLineNumber+P.start,ie.lineRange.endLineNumberExclusive+P.start),ie.newLines);H.push(re)}else{let re=R.slice(ie.lineRange.startLineNumber-1,ie.lineRange.endLineNumberExclusive-1).join(` +- 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 dbt=I(gV=>{"use strict";p();Object.defineProperty(gV,"__esModule",{value:!0});gV.NullTerminalService=gV.ITerminalService=void 0;gV.isTerminalService=N1c;gV.isNullTerminalService=M1c;var P1c=nn(),ubt=Ic(),D1c=ko();gV.ITerminalService=(0,P1c.createServiceIdentifier)("ITerminalService");var YOr=class t extends D1c.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new ubt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new ubt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new ubt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new ubt.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){}};gV.NullTerminalService=YOr;function N1c(t){return t&&typeof t.createTerminal=="function"}a(N1c,"isTerminalService");function M1c(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(M1c,"isNullTerminalService")});var U9i=I(o9=>{"use strict";p();var O1c=o9&&o9.__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},L1c=o9&&o9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(o9,"__esModule",{value:!0});o9.TerminalMonitor=void 0;var B1c=dbt(),F1c=ko(),jBe=2e3,KOr=class extends F1c.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:U1c(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,jBe*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<=jBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,jBe/2),contentEnd:n.slice(-jBe/2),length:n.length,truncatedChars:n.length-jBe},terminalCount:r};return JSON.stringify(s)}};o9.TerminalMonitor=KOr;o9.TerminalMonitor=KOr=O1c([L1c(0,B1c.ITerminalService)],KOr);function U1c(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(U1c,"formatCwd")});var Q9i=I(fbt=>{"use strict";p();Object.defineProperty(fbt,"__esModule",{value:!0});fbt.CurrentDocument=void 0;var Q1c=Rs(),JOr=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 Q1c.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}};fbt.CurrentDocument=JOr});var G9i=I(pbt=>{"use strict";p();Object.defineProperty(pbt,"__esModule",{value:!0});pbt.getCurrentLine=j1c;pbt.isModelLineCompatible=H1c;var q9i=j_(),q1c=F_t();function j1c(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new q9i.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?$1c(n,o,e,r):!1}a(H1c,"isModelLineCompatible");var G1c=new Set(["()","[]","{}","<>",'""',"''","``"]);function $1c(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&&H9i(t.inserted,e.inserted):H9i(t.inserted,e.inserted)}a($1c,"isUserEditCompatibleWithModelEdit");function H9i(t,e){return e.startsWith(t)?!0:G1c.has(t)?V1c(t,e):!1}a(H9i,"isUserTypingCompatibleWithModelText");function V1c(t,e){let r=0;for(let n=0;n{"use strict";p();var W1c=mN&&mN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z1c=mN&&mN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y1c=mN&&mN.__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(J1c,"parseEditIntentFromStreamShortName");async function Z1c(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=hbt.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=hbt.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(Z1c,"parseEditIntentFromStreamTags")});var gbt=I(Xye=>{"use strict";p();Object.defineProperty(Xye,"__esModule",{value:!0});Xye.linesWithBackticksRemoved=eSc;Xye.constructMessages=tSc;Xye.charCount=rSc;Xye.findMergeConflictMarkersRange=nSc;var XOr=xo(),$9i=cBe(),X1c=gd();async function*eSc(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(eSc,"linesWithBackticksRemoved");function tSc({systemMsg:t,userMsg:e}){return[{role:XOr.Raw.ChatRole.System,content:(0,$9i.toTextParts)(t)},{role:XOr.Raw.ChatRole.User,content:(0,$9i.toTextParts)(e)}]}a(tSc,"constructMessages");function rSc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===XOr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(rSc,"charCount");function nSc(t,e,r){for(let n=e.start;n>>>>>>"))return new X1c.OffsetRange(n,o+1)}}a(nSc,"findMergeConflictMarkersRange")});var z9i=I(AV=>{"use strict";p();Object.defineProperty(AV,"__esModule",{value:!0});AV.ResponseParseResult=void 0;AV.handleEditWindowOnly=sSc;AV.handleCodeBlock=aSc;AV.handleEditWindowWithEditIntent=cSc;AV.handleUnifiedWithXml=lSc;var HBe=oye(),V9i=BG(),W9i=z2(),eEe=fV(),iSc=ZOr(),oSc=gbt(),kL;(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})(kL||(AV.ResponseParseResult=kL={}));function sSc(t){return new kL.EditWindowLines(t)}a(sSc,"handleEditWindowOnly");function aSc(t){return new kL.EditWindowLines((0,oSc.linesWithBackticksRemoved)(t))}a(aSc,"handleCodeBlock");async function cSc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,iSc.parseEditIntentFromStream)(t,e,r);return new kL.EditWindowLines(o,{intent:n,parseError:s})}a(cSc,"handleEditWindowWithEditIntent");async function lSc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new kL.Done(new HBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===eEe.ResponseTags.NO_CHANGE.start)return new kL.Done(new HBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===eEe.ResponseTags.INSERT.start)return new kL.DirectEdits(uSc(o,e,r));if(c===eEe.ResponseTags.EDIT.start){let l=dSc(o);return new kL.EditWindowLines(l)}return new kL.Done(new HBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(lSc,"handleUnifiedWithXml");async function*uSc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorLineInEditWindowOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(eEe.ResponseTags.INSERT.end))return new HBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new V9i.LineReplacement(new W9i.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(eEe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new V9i.LineReplacement(new W9i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new HBe.NoNextEditReason.NoSuggestions(r,l)}a(uSc,"generateInsertEdits");async function*dSc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(eEe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(dSc,"generateEditLines")});var Y9i=I(s9=>{"use strict";p();var fSc=s9&&s9.__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},ek=s9&&s9.__param||function(t,e){return function(r,n){e(r,n,t)}},Abt;Object.defineProperty(s9,"__esModule",{value:!0});s9.XtabEndpoint=void 0;var pSc=UE(),hSc=Z6(),e5r=Dl(),mSc=VE(),gSc=tV(),ASc=$ne(),ySc=Ip(),ESc=vy(),_Sc=t9(),vSc=Ah(),CSc=ym(),bSc=eV(),SSc=qne(),TSc=Gs(),t5r=class extends ASc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{Abt=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:SSc.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?{...Abt.chatModelInfo,id:n}:Abt.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(e5r.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(e5r.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}}};s9.XtabEndpoint=t5r;s9.XtabEndpoint=t5r=Abt=fSc([ek(3,e5r.IConfigurationService),ek(4,gSc.IDomainService),ek(5,ESc.IFetcherService),ek(6,mSc.ICAPIClientService),ek(7,CSc.ITelemetryService),ek(8,pSc.IAuthenticationService),ek(9,hSc.IChatMLFetcher),ek(10,bSc.ITokenizerProvider),ek(11,TSc.IInstantiationService),ek(12,vSc.IExperimentationService),ek(13,_Sc.IChatWebSocketManager),ek(14,ySc.ILogService)],t5r)});var ybt=I(tEe=>{"use strict";p();Object.defineProperty(tEe,"__esModule",{value:!0});tEe.NullProxyModelsService=tEe.IProxyModelsService=void 0;var ISc=nn(),xSc=Ic();tEe.IProxyModelsService=(0,ISc.createServiceIdentifier)("IProxyModelsService");var r5r=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=xSc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};tEe.NullProxyModelsService=r5r});var K9i=I(nA=>{"use strict";p();var wSc=nA&&nA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RSc=nA&&nA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kSc=nA&&nA.__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},PSc=nA&&nA.__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 g=="boolean"?g?_bt.IncludeLineNumbersOption.WithSpaceAfter:_bt.IncludeLineNumbersOption.None:g),f=new i5r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,s.lines,c,e.langCtx,e.aggressivenessLevel,u,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:l,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:d}}),{prompt:h}=(0,i5r.getUserPrompt)(f),m=(0,GSc.constructMessages)({systemMsg:r,userMsg:h});return yI.Result.ok({messages:m,keptRange:s.keptRange})}async predictNextCursorPosition(e,r,n){let o=r.tracer.createSubLogger("predictNextCursorPosition"),s=this.buildCursorPredictionPrompt(e);if(s.isError())return o.trace(`Failed to construct tagged file: ${s.err.message}`),yI.Result.fromString(s.err.message);let{messages:c,keptRange:l}=s.val;r.telemetry.setCursorJumpPrompt(c),r.logContext.setCursorJumpPrompt(c,l);let u=this.determineModelName();r.telemetry.setCursorJumpModelName(u);let d=await this.resolveEndpoint(u,o);if(!d)return yI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(gN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(gN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),A={max_tokens:h?Math.max(g,2048):g};m&&(A={...A,secretKey:m});let y=await f.makeChatRequest2({messages:c,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:n5r.ChatLocation.Other,requestOptions:A},n);if(y.type!==n5r.ChatFetchResponseType.Success)return y.type===n5r.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),yI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let E=y.value.trim();return this.parseResponse(E,l)}catch(E){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${E}`),yI.Result.fromString(`failedToParseLine:"${y.value}". Error ${USc.ErrorUtils.fromUnknown(E).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(gN.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(gN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(MSc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:DSc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:QSc.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(gN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??$Sc}determineLintOptions(){let e=this.configService.getConfig(gN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...vbt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(gN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,vbt.parseLintOptionString)(r,vbt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):vbt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=VSc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return yI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?yI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?yI.Result.fromString("crossFileEmptyFilePath"):yI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?yI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(VSc,"stripThinkTags")});var nUi=I($Be=>{"use strict";p();Object.defineProperty($Be,"__esModule",{value:!0});$Be.XtabPatchResponseHandler=void 0;$Be.tryRemoveDuplicateAdditions=rUi;var J9i=Wne(),GBe=hy(),WSc=lgt(),Z9i=oye(),zSc=tv(),YSc=Tl(),KSc=MA(),X9i=id(),tUi=BG(),JSc=z2(),ZSc=kOr(),XSc=Jye(),eTc=fV(),nEe=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))}static insertion(e,r){return new t(e,r)}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 s5r(t){return t.trim().length>1}a(s5r,"isMeaningfulLine");function rUi(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,YSc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&s5r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&s5r(c[0])&&s5r(c[1])){let l=c[0],u=c[1];for(let d=1;d=1&&c.lineNumZeroBased===l&&c.filePath===u&&WSc.ResponseProcessor.isAdditiveEdit(c.removedLines[0],c.addedLines[0])}a(o,"isGhostTextPatch"),t.isGhostTextPatch=o;async function*s(c,l,u){let d=null,f=!0,h=!1;for await(let m of c){if(m.trim()===eTc.ResponseTags.NO_EDIT)break;if(d===null){d=nEe.ofLine(m);continue}if(d.addLine(m)){if(f&&!h&&l!==void 0&&u!==void 0&&d.addedLines.length===1&&d.removedLines.length>=1){if(o(d,l,u)){let g=nEe.insertion(d.filePath,d.lineNumZeroBased);g.removedLines=[...d.removedLines],g.addedLines=[...d.addedLines],yield g,d=nEe.insertion(d.filePath,d.lineNumZeroBased+1)}h=!0}continue}(d.removedLines.length>0||d.addedLines.length>0)&&(yield d),d=nEe.ofLine(m),f=!1}d&&(d.removedLines.length>0||d.addedLines.length>0)&&(yield d)}a(s,"extractEdits"),t.extractEdits=s})(eUi||($Be.XtabPatchResponseHandler=eUi={}))});var vUi=I(Np=>{"use strict";p();var rTc=Np&&Np.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(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=Np&&Np.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iTc=Np&&Np.__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},oTc=Np&&Np.__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=a9.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(RTc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(MTc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(BTc.XtabNextCursorPredictor,a9.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ds.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ds.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ds.WithStatelessProviderTelemetry(h,s.build(Sbt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,vV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ds.WithStatelessProviderTelemetry(d.value,s.build(Sbt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ds.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ds.WithStatelessProviderTelemetry(f,s.build(Sbt.Result.error(f)))}catch(c){let l=EV.ErrorUtils.fromUnknown(c),u=new Ds.NoNextEditReason.Unexpected(l);return new Ds.WithStatelessProviderTelemetry(u,s.build(Sbt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,wTc.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 Ds.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 a5r.Position(r.endLineNumber,r.endColumn),E=new OTc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=AUi(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 Ibt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ds.RequestEditWindowWithCursorJump(w,l):new Ds.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,mUi.countTokensForLines)(R,a9.computeTokens)>x)return new Ds.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(ke=>ke.includes(dUi.PromptTags.CURSOR)),N=(0,_V.constructTaggedFile)(E,v,_,m,a9.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:$o.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ds.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(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(q),M!==void 0&&f.setXtabUserHappinessScore(M);let j=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,yV.raceCancellation)((0,yV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new DTc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),Y=new _V.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,j,q,U,a9.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:V,diffTokensInPrompt:z,neighborSnippetsResult:ie}=(0,_V.getUserPrompt)(Y);f.setNDiffsInPrompt(V),f.setDiffTokensInPrompt(z),ie&&(f.setNNeighborSnippetsComputed(ie.nComputed),f.setNNeighborSnippetsInPrompt(ie.nIncluded),f.setNeighborSnippetIndicesInPrompt(ie.includedIndices));let H=$o.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,E.cursorLineOffset,R,b,H),le=(0,c5r.constructMessages)({systemMsg:yUi(m.promptingStrategy),userMsg:W});d.setPrompt(le),f.setPrompt(le);let Le=3e4*4;if((0,c5r.charCount)(le)>Le)return new Ds.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let ke=U.getData();f.setLintErrors(ke),d.setDiagnosticsData(ke);let X=this.terminalMonitor.getData();f.setTerminalOutput(X),d.setTerminalData(X)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Ue={endpoint:A,modelServiceConfig:g,messages:le,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:b,editWindowLineRange:v},promptPieces:Y,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Ue,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{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,PTc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,$v.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[$v.AggressivenessSetting.Low]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[$v.AggressivenessSetting.Medium]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[$v.AggressivenessSetting.High]:{debounceConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[$v.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(di.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,hUi.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new xTc.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,ETc.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===oUi.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,yV.raceCancellation)((0,yV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===oUi.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(EV.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],r.modelServiceConfig.allowImportChanges??fTc.ImportChanges.None);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 Ds.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 vTc.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(di.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new sTc.FetchStreamSource,E=new CTc.StopWatch,_="",v,b=new yV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:a9.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:Ff.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===Ff.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==Ff.ChatFetchResponseType.Success?y.reject(new uUi.FetchStreamError(f5r(P))):y.resolve()}).catch(P=>{m.setError(EV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(EV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==Ff.ChatFetchResponseType.Success)return w.type===Ff.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,CV.ModelNotFound.INSTANCE):w.type===Ff.ChatFetchResponseType.Unknown&&w.reason===Ff.RESPONSE_CONTAINED_NO_CHOICES?new CV.FetchFailure(new Ds.NoNextEditReason.NoSuggestions(u,l)):new CV.FetchFailure(f5r(w));let R=sUi.AsyncIterUtilsExt.splitLines(sUi.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(dUi.PromptTags.CURSOR,""):D}})();return new CV.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,cursorLineInEditWindowOffset: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 CV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof CV.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof vV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case $o.ResponseFormat.EditWindowOnly:{O=(0,Zne.handleEditWindowOnly)(L);break}case $o.ResponseFormat.CodeBlock:{O=(0,Zne.handleCodeBlock)(L);break}case $o.ResponseFormat.EditWindowWithEditIntent:case $o.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===$o.ResponseFormat.EditWindowWithEditIntentShort?pUi.EditIntentParseMode.ShortName:pUi.EditIntentParseMode.Tags;O=await(0,Zne.handleEditWindowWithEditIntent)(L,h,ie);break}case $o.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[E.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new Ibt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,le+1)),ge=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Ue=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService);O=new Zne.ResponseParseResult.DirectEdits(FTc.XtabPatchResponseHandler.handleResponse(L,H,ie.id,ie.workspaceRoot,Le,h,ge,Ue));break}case $o.ResponseFormat.UnifiedWithXml:{O=await(0,Zne.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Xne.assertNever)(n.responseFormat)}if(O instanceof Zne.ResponseParseResult.Done)return O.reason;if(O instanceof Zne.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ie,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!$o.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new Ds.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let j=O.lines,Q={emitFastCursorLineChange:iUi.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let U=(0,_Tc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return $v.EarlyDivergenceCancellationMode.Off;case!0:return $v.EarlyDivergenceCancellationMode.Cursor;case $v.EarlyDivergenceCancellationMode.Off:case $v.EarlyDivergenceCancellationMode.Cursor:case $v.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return $v.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=U===$v.EarlyDivergenceCancellationMode.Off?j:qTc(j,x,e,P,R,d,l,ie=>{Y=ie},U),V=0,z=!1;for await(let ie of iUi.ResponseProcessor.diff(R,W,x,Q)){if(Y)break;h.trace(`ResponseProcessor streamed edit #${V} with latency ${q.elapsed()} ms`);let H=[];if(ie.lineRange.startLineNumber===ie.lineRange.endLineNumberExclusive||ie.newLines.length===0||ie.lineRange.endLineNumberExclusive-ie.lineRange.startLineNumber===1&&ie.newLines.length===1){let re=new Tbt.LineReplacement(new lUi.LineRange(ie.lineRange.startLineNumber+P.start,ie.lineRange.endLineNumberExclusive+P.start),ie.newLines);H.push(re)}else{let re=R.slice(ie.lineRange.startLineNumber-1,ie.lineRange.endLineNumberExclusive-1).join(` `),le=await this.diffService.computeDiff(re,ie.newLines.join(` -`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${q.elapsed()} ms`);let Le=P.start+ie.lineRange.startLineNumber;for(let ge of le.changes){let Ue=new vbt.LineReplacement(new tUi.LineRange(Le+ge.original.startLineNumber-1,Le+ge.original.endLineNumberExclusive-1),ie.newLines.slice(ge.modified.startLineNumber-1,ge.modified.endLineNumberExclusive-1));H.push(Ue)}}m.setResponse(B());for(let re of H){if(h.trace(`extracting edit #${V}: ${re.toString()}`),!z){z=!0;let le=this.determineArtificialDelayMs(c,h,g);if(le&&(await(0,hV.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new Ds.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new Ds.NoNextEditReason.GotCancelled(U===Hv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(j){return j instanceof rUi.FetchStreamError?j.reason:(m.setError(j),new Ds.NoNextEditReason.Unexpected(mV.ErrorUtils.fromUnknown(j)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof AV.Retrying)return m;if(o5r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ds.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(o5r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ds.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=o9.getNextCursorColumn(b);switch(g){case ybt.NextCursorLinePrediction.Jump:{let w=new n5r.Position(v,T);return new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case ybt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new Cbt.Range(v,T,v,T),n,o,s,new AV.Retrying("cursorJump"),d);default:(0,Zne.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,X9i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,X9i.isAbsolute)(e.filePath)?eUi.URI.file(e.filePath):eUi.URI.joinPath(m,e.filePath),A=zSc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new n5r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case ybt.NextCursorLinePrediction.Jump:return new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case ybt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${mV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(o5r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new cTc.StringText(_.getText()),b=new Ds.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,JSc.LanguageId.create(_.languageId),v.getLines(),vbt.LineEdit.empty,v,new YSc.Edits(aTc.StringEdit,[])),T=new Ds.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new hV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new Cbt.Range(y,1,y,1),s,c,l,new AV.Retrying("cursorJump"),f)}default:(0,Zne.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??gV.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${gV.N_LINES_BELOW}`),u=gV.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new s5r.OffsetRange(d,f),g=(0,i5r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(di.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 s5r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Go.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:l5r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:dUi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:Go.GlobalBudgetOptions.DEFAULT_ORDER,shares:Go.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=Go.applyStrategyConfig(n);return{promptOptions:l5r(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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(_Tc.XtabEndpoint,r,n,e):(0,VSc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===Go.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):Go.PatchModelPrediction.FilePath;return{type:"content",content:fUi(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof AV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,hV.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,n){let o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:hTc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:Ebt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(di.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:Ebt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=Ebt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=Ebt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Zne.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new vbt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(di.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:cUi(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}};Pp.XtabProvider=a5r;Pp.XtabProvider=a5r=o9=jSc([hN(0,ZSc.IInlineEditsModelService),hN(1,eTc.ISimulationTestContext),hN(2,uTc.IInstantiationService),hN(3,rTc.IWorkspaceService),hN(4,$Sc.IDiffService),hN(5,di.IConfigurationService),hN(6,tTc.IExperimentationService),hN(7,sUi.ILanguageContextProviderService),hN(8,XSc.ILanguageDiagnosticsService),hN(9,WSc.IIgnoreService),hN(10,ATc.ISimilarFilesContextService)],a5r);function cUi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(cUi,"filterOutEditsWithSubstrings");function lUi(t){let e=t.cursorLineOffset,r=Math.max(0,e-gV.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+gV.N_LINES_AS_CONTEXT+1);return new s5r.OffsetRange(r,n)}a(lUi,"computeAreaAroundEditWindowLinesRange");function c5r(t){switch(t.type){case Lf.ChatFetchResponseType.Canceled:return new Ds.NoNextEditReason.GotCancelled("afterFetchCall");case Lf.ChatFetchResponseType.OffTopic:case Lf.ChatFetchResponseType.Filtered:case Lf.ChatFetchResponseType.PromptFiltered:case Lf.ChatFetchResponseType.Length:case Lf.ChatFetchResponseType.RateLimited:case Lf.ChatFetchResponseType.QuotaExceeded:case Lf.ChatFetchResponseType.ExtensionBlocked:case Lf.ChatFetchResponseType.AgentUnauthorized:case Lf.ChatFetchResponseType.AgentFailedDependency:case Lf.ChatFetchResponseType.InvalidStatefulMarker:return new Ds.NoNextEditReason.Uncategorized(mV.ErrorUtils.fromUnknown(t));case Lf.ChatFetchResponseType.BadRequest:case Lf.ChatFetchResponseType.NotFound:case Lf.ChatFetchResponseType.Failed:case Lf.ChatFetchResponseType.NetworkError:case Lf.ChatFetchResponseType.Unknown:return new Ds.NoNextEditReason.FetchFailure(mV.ErrorUtils.fromUnknown(t))}}a(c5r,"mapChatFetcherErrorToNoNextEditReason");function l5r(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?STc(t.lintOptions,e.lintOptions):t.lintOptions}}a(l5r,"overrideModelConfig");var bTc={...Go.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function STc(t,e){return{...t??bTc,...e}}a(STc,"mergeLintOptions");function uUi(t){switch(t){case Go.PromptingStrategy.UnifiedModel:return qBe.unifiedModelSystemPrompt;case Go.PromptingStrategy.Codexv21NesUnified:case Go.PromptingStrategy.SimplifiedSystemPrompt:return qBe.simplifiedPrompt;case Go.PromptingStrategy.PatchBased:case Go.PromptingStrategy.PatchBased01:case Go.PromptingStrategy.PatchBased02:case Go.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Go.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Go.PromptingStrategy.Xtab275:case Go.PromptingStrategy.XtabAggressiveness:case Go.PromptingStrategy.Xtab275Aggressiveness:case Go.PromptingStrategy.Xtab275AggressivenessHighLow:case Go.PromptingStrategy.Xtab275EditIntent:case Go.PromptingStrategy.Xtab275EditIntentShort:return qBe.xtab275SystemPrompt;case Go.PromptingStrategy.Nes41Miniv3:return qBe.nes41Miniv3SystemPrompt;case Go.PromptingStrategy.CopilotNesXtab:case void 0:return qBe.systemPromptTemplate;default:(0,Zne.assertNever)(t)}}a(uUi,"pickSystemPrompt");function dUi(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(dUi,"determineLanguageContextOptions");function fUi(t,e,r,n,o,s){if(o===Go.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` -`);if(o===Go.ResponseFormat.EditWindowOnly)return r.join(` -`);if(o===Go.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...r].join(` -`);if(o===Go.ResponseFormat.EditWindowWithEditIntentShort)return["H",...r].join(` -`);if(o===Go.ResponseFormat.CodeBlock)return["```",...r,"```"].join(` -`);if(o===Go.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,aUi.toUniquePath)(t.id,c);if(s===Go.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case Go.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` -`);case Go.PatchModelPrediction.CurrentLineReplaced:return[d,`-${u}`,"+"].join(` -`);case Go.PatchModelPrediction.CurrentLineCompleted:return[d,`-${u}`,`+${u}`].join(` -`);default:(0,Zne.assertNever)(s)}}else(0,Zne.assertNever)(o)}a(fUi,"getPredictionContents");async function*TTc(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 lTc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Hv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Hv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,iUi.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,iUi.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(TTc,"linesWithIntermediateEditDivergenceCheck")});var hUi=I(kL=>{"use strict";p();var ITc=kL&&kL.__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},bbt=kL&&kL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kL,"__esModule",{value:!0});kL.StaticGitHubAuthenticationService=void 0;kL.setCopilotToken=PTc;var xTc=Pl(),wTc=Sp(),Sbt=FE(),RTc=E5e(),kTc=XH(),Tbt=class extends Sbt.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:Sbt.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:Sbt.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 Sbt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireCopilotTokenChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};kL.StaticGitHubAuthenticationService=Tbt;kL.StaticGitHubAuthenticationService=Tbt=ITc([bbt(1,wTc.ILogService),bbt(2,kTc.ICopilotTokenStore),bbt(3,RTc.ICopilotTokenManager),bbt(4,xTc.IConfigurationService)],Tbt);function PTc(t,e){if(!(t instanceof Tbt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(PTc,"setCopilotToken")});var EUi=I(Gv=>{"use strict";p();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.GraphQLErrorType=void 0;Gv.getErrorCode=AUi;Gv.derivePullRequestState=DTc;Gv.makeGitHubAPIRequest=yUi;Gv.makeGitHubGraphQLRequest=rEe;Gv.makeSearchGraphQLRequest=NTc;Gv.getPullRequestFromGlobalId=MTc;Gv.addPullRequestCommentGraphQLRequest=OTc;Gv.closePullRequest=LTc;Gv.makeGitHubAPIRequestWithPagination=BTc;Gv.getAssignableActorsWithSuggestedActors=FTc;Gv.getAssignableActorsWithAssignableUsers=UTc;function mUi(t){return typeof t=="object"&&t!==null}a(mUi,"isObject");var gUi;(function(t){t.Unprocessable="UNPROCESSABLE"})(gUi||(Gv.GraphQLErrorType=gUi={}));function AUi(t){if(!mUi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(mUi(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(AUi,"getErrorCode");function DTc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(DTc,"derivePullRequestState");async function yUi(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(yUi,"makeGitHubAPIRequest");async function rEe(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(rEe,"makeGitHubGraphQLRequest");async function NTc(t,e,r,n,o,s,c=20){let l=` +`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${q.elapsed()} ms`);let Le=P.start+ie.lineRange.startLineNumber;for(let ge of le.changes){let Ue=new Tbt.LineReplacement(new lUi.LineRange(Le+ge.original.startLineNumber-1,Le+ge.original.endLineNumberExclusive-1),ie.newLines.slice(ge.modified.startLineNumber-1,ge.modified.endLineNumberExclusive-1));H.push(Ue)}}m.setResponse(B());for(let re of H){if(h.trace(`extracting edit #${V}: ${re.toString()}`),!z){z=!0;let le=this.determineArtificialDelayMs(c,h,g);if(le&&(await(0,yV.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new Ds.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new Ds.NoNextEditReason.GotCancelled(U===$v.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(j){return j instanceof uUi.FetchStreamError?j.reason:(m.setError(j),new Ds.NoNextEditReason.Unexpected(EV.ErrorUtils.fromUnknown(j)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof vV.Retrying)return m;if(l5r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ds.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(l5r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ds.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=a9.getNextCursorColumn(b);switch(g){case Cbt.NextCursorLinePrediction.Jump:{let w=new a5r.Position(v,T);return new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case Cbt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new Ibt.Range(v,T,v,T),n,o,s,new vV.Retrying("cursorJump"),d);default:(0,Xne.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,aUi.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,aUi.isAbsolute)(e.filePath)?cUi.URI.file(e.filePath):cUi.URI.joinPath(m,e.filePath),A=uTc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new a5r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case Cbt.NextCursorLinePrediction.Jump:return new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case Cbt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${EV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(l5r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new STc.StringText(_.getText()),b=new Ds.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,pTc.LanguageId.create(_.languageId),v.getLines(),Tbt.LineEdit.empty,v,new dTc.Edits(bTc.StringEdit,[])),T=new Ds.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new yV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new Ibt.Range(y,1,y,1),s,c,l,new vV.Retrying("cursorJump"),f)}default:(0,Xne.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(di.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??_V.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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${_V.N_LINES_BELOW}`),u=_V.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new u5r.OffsetRange(d,f),g=(0,c5r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(di.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 u5r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...$o.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:p5r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:EUi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:$o.GlobalBudgetOptions.DEFAULT_ORDER,shares:$o.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=$o.applyStrategyConfig(n);return{promptOptions:p5r(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(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(LTc.XtabEndpoint,r,n,e):(0,cTc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===$o.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):$o.PatchModelPrediction.FilePath;return{type:"content",content:_Ui(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof vV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,yV.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,n){let o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:kTc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:bbt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(di.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:bbt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=bbt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=bbt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Xne.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new Tbt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(di.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:gUi(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}};Np.XtabProvider=d5r;Np.XtabProvider=d5r=a9=iTc([AN(0,hTc.IInlineEditsModelService),AN(1,gTc.ISimulationTestContext),AN(2,ITc.IInstantiationService),AN(3,yTc.IWorkspaceService),AN(4,aTc.IDiffService),AN(5,di.IConfigurationService),AN(6,ATc.IExperimentationService),AN(7,hUi.ILanguageContextProviderService),AN(8,mTc.ILanguageDiagnosticsService),AN(9,lTc.IIgnoreService),AN(10,NTc.ISimilarFilesContextService)],d5r);function gUi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(gUi,"filterOutEditsWithSubstrings");function AUi(t){let e=t.cursorLineOffset,r=Math.max(0,e-_V.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+_V.N_LINES_AS_CONTEXT+1);return new u5r.OffsetRange(r,n)}a(AUi,"computeAreaAroundEditWindowLinesRange");function f5r(t){switch(t.type){case Ff.ChatFetchResponseType.Canceled:return new Ds.NoNextEditReason.GotCancelled("afterFetchCall");case Ff.ChatFetchResponseType.OffTopic:case Ff.ChatFetchResponseType.Filtered:case Ff.ChatFetchResponseType.PromptFiltered:case Ff.ChatFetchResponseType.Length:case Ff.ChatFetchResponseType.RateLimited:case Ff.ChatFetchResponseType.QuotaExceeded:case Ff.ChatFetchResponseType.ExtensionBlocked:case Ff.ChatFetchResponseType.AgentUnauthorized:case Ff.ChatFetchResponseType.AgentFailedDependency:case Ff.ChatFetchResponseType.InvalidStatefulMarker:return new Ds.NoNextEditReason.Uncategorized(EV.ErrorUtils.fromUnknown(t));case Ff.ChatFetchResponseType.BadRequest:case Ff.ChatFetchResponseType.NotFound:case Ff.ChatFetchResponseType.Failed:case Ff.ChatFetchResponseType.NetworkError:case Ff.ChatFetchResponseType.Unknown:return new Ds.NoNextEditReason.FetchFailure(EV.ErrorUtils.fromUnknown(t))}}a(f5r,"mapChatFetcherErrorToNoNextEditReason");function p5r(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?QTc(t.lintOptions,e.lintOptions):t.lintOptions}}a(p5r,"overrideModelConfig");var UTc={...$o.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function QTc(t,e){return{...t??UTc,...e}}a(QTc,"mergeLintOptions");function yUi(t){switch(t){case $o.PromptingStrategy.UnifiedModel:return VBe.unifiedModelSystemPrompt;case $o.PromptingStrategy.Codexv21NesUnified:case $o.PromptingStrategy.SimplifiedSystemPrompt:return VBe.simplifiedPrompt;case $o.PromptingStrategy.PatchBased:case $o.PromptingStrategy.PatchBased01:case $o.PromptingStrategy.PatchBased02:case $o.PromptingStrategy.PatchBased02WithRecentLineNumbers:case $o.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case $o.PromptingStrategy.Xtab275:case $o.PromptingStrategy.XtabAggressiveness:case $o.PromptingStrategy.Xtab275Aggressiveness:case $o.PromptingStrategy.Xtab275AggressivenessHighLow:case $o.PromptingStrategy.Xtab275EditIntent:case $o.PromptingStrategy.Xtab275EditIntentShort:return VBe.xtab275SystemPrompt;case $o.PromptingStrategy.Nes41Miniv3:return VBe.nes41Miniv3SystemPrompt;case $o.PromptingStrategy.CopilotNesXtab:case void 0:return VBe.systemPromptTemplate;default:(0,Xne.assertNever)(t)}}a(yUi,"pickSystemPrompt");function EUi(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(EUi,"determineLanguageContextOptions");function _Ui(t,e,r,n,o,s){if(o===$o.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` +`);if(o===$o.ResponseFormat.EditWindowOnly)return r.join(` +`);if(o===$o.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...r].join(` +`);if(o===$o.ResponseFormat.EditWindowWithEditIntentShort)return["H",...r].join(` +`);if(o===$o.ResponseFormat.CodeBlock)return["```",...r,"```"].join(` +`);if(o===$o.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,mUi.toUniquePath)(t.id,c);if(s===$o.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case $o.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` +`);case $o.PatchModelPrediction.CurrentLineReplaced:return[d,`-${u}`,"+"].join(` +`);case $o.PatchModelPrediction.CurrentLineCompleted:return[d,`-${u}`,`+${u}`].join(` +`);default:(0,Xne.assertNever)(s)}}else(0,Xne.assertNever)(o)}a(_Ui,"getPredictionContents");async function*qTc(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 TTc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case $v.EarlyDivergenceCancellationMode.Cursor:return E===e;case $v.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,fUi.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,fUi.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(qTc,"linesWithIntermediateEditDivergenceCheck")});var CUi=I(PL=>{"use strict";p();var jTc=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},xbt=PL&&PL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PL,"__esModule",{value:!0});PL.StaticGitHubAuthenticationService=void 0;PL.setCopilotToken=WTc;var HTc=Dl(),GTc=Ip(),wbt=UE(),$Tc=S5e(),VTc=nG(),Rbt=class extends wbt.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:wbt.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:wbt.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 wbt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireCopilotTokenChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};PL.StaticGitHubAuthenticationService=Rbt;PL.StaticGitHubAuthenticationService=Rbt=jTc([xbt(1,GTc.ILogService),xbt(2,VTc.ICopilotTokenStore),xbt(3,$Tc.ICopilotTokenManager),xbt(4,HTc.IConfigurationService)],Rbt);function WTc(t,e){if(!(t instanceof Rbt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(WTc,"setCopilotToken")});var xUi=I(Vv=>{"use strict";p();Object.defineProperty(Vv,"__esModule",{value:!0});Vv.GraphQLErrorType=void 0;Vv.getErrorCode=TUi;Vv.derivePullRequestState=zTc;Vv.makeGitHubAPIRequest=IUi;Vv.makeGitHubGraphQLRequest=iEe;Vv.makeSearchGraphQLRequest=YTc;Vv.getPullRequestFromGlobalId=KTc;Vv.addPullRequestCommentGraphQLRequest=JTc;Vv.closePullRequest=ZTc;Vv.makeGitHubAPIRequestWithPagination=XTc;Vv.getAssignableActorsWithSuggestedActors=eIc;Vv.getAssignableActorsWithAssignableUsers=tIc;function bUi(t){return typeof t=="object"&&t!==null}a(bUi,"isObject");var SUi;(function(t){t.Unprocessable="UNPROCESSABLE"})(SUi||(Vv.GraphQLErrorType=SUi={}));function TUi(t){if(!bUi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(bUi(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(TUi,"getErrorCode");function zTc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(zTc,"derivePullRequestState");async function IUi(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(IUi,"makeGitHubAPIRequest");async function iEe(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(iEe,"makeGitHubGraphQLRequest");async function YTc(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 { @@ -1360,7 +1360,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 rEe(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(NTc,"makeSearchGraphQLRequest");async function MTc(t,e,r,n,o,s){let c=` + `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await iEe(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(YTc,"makeSearchGraphQLRequest");async function KTc(t,e,r,n,o,s){let c=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1395,7 +1395,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 rEe(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=AUi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(MTc,"getPullRequestFromGlobalId");async function OTc(t,e,r,n,o,s,c){let l=` + `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await iEe(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=TUi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(KTc,"getPullRequestFromGlobalId");async function JTc(t,e,r,n,o,s,c){let l=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1411,7 +1411,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 rEe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(OTc,"addPullRequestCommentGraphQLRequest");async function LTc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await yUi(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(LTc,"closePullRequest");async function BTc(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(BTc,"makeGitHubAPIRequestWithPagination");async function FTc(t,e,r,n,o,s,c){let l=` + `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await iEe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(JTc,"addPullRequestCommentGraphQLRequest");async function ZTc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await IUi(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(ZTc,"closePullRequest");async function XTc(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(XTc,"makeGitHubAPIRequestWithPagination");async function eIc(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( @@ -1432,7 +1432,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 rEe(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(FTc,"getAssignableActorsWithSuggestedActors");async function UTc(t,e,r,n,o,s,c){let l=` + `,u=[],d=null,f=!0;for(;f;){let m=await iEe(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(eIc,"getAssignableActorsWithSuggestedActors");async function tIc(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) { @@ -1449,27 +1449,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 rEe(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(UTc,"getAssignableActorsWithAssignableUsers")});var CUi=I(XR=>{"use strict";p();Object.defineProperty(XR,"__esModule",{value:!0});XR.BaseOctoKitService=XR.PermissiveAuthRequiredError=XR.VSCodeTeamId=XR.IOctoKitService=XR.IGithubRepositoryService=void 0;var vUi=nn(),_Ui=e$(),mN=EUi();XR.IGithubRepositoryService=(0,vUi.createServiceIdentifier)("IGithubRepositoryService");XR.IOctoKitService=(0,vUi.createServiceIdentifier)("IOctoKitService");XR.VSCodeTeamId=1682102;var u5r=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};XR.PermissiveAuthRequiredError=u5r;var d5r=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,mN.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,mN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,mN.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 compareCommitsWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/compare/${n}...${o}`,l=await(0,mN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{version:"2022-11-28",callSite:"github-rest-compare-commits"});if(!l)return;let u=l,d=u.merge_base_commit?.sha??u.base_commit?.sha??n,f=u.commits?.[u.commits.length-1]?.sha??o;return{baseSha:d,headSha:f,files:u.files??[]}}async getRepositoryByIdWithToken(e,r){let n=await(0,mN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repositories/${e}`,"GET",r,{version:"2022-11-28",callSite:"github-rest-get-repository-by-id"});if(!n)return;let o=n;if(o.owner?.login&&o.name)return{owner:o.owner.login,name:o.name};if(o.full_name){let[s,c]=o.full_name.split("/");if(s&&c)return{owner:s,name:c}}}async closePullRequestWithToken(e,r,n,o){return(0,mN.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,mN.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,_Ui.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(Ibt,"__esModule",{value:!0});Ibt.NullBaseOctoKitService=void 0;var QTc=CUi(),f5r=class extends QTc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{id:0,avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};Ibt.NullBaseOctoKitService=f5r});var xUi=I(Ll=>{"use strict";p();var Nbt=Ll&&Ll.__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},Ou=Ll&&Ll.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.CopilotTokenManagerFromGitHubToken=Ll.CopilotTokenManagerFromDeviceId=Ll.RefreshableCopilotTokenManager=Ll.StaticExtendedTokenInfoCopilotTokenManager=Ll.FixedCopilotTokenManager=Ll.BaseCopilotTokenManager=Ll.tokenErrorString=void 0;Ll.createStaticGitHubTokenProvider=jTc;Ll.getOrCreateTestingCopilotTokenManager=HTc;var p5r=(Sne(),ba(bne)),qTc=Ic(),SUi=Ro(),xbt=Hft(),IUi=Pl(),Mbt=$E(),Obt=J$(),iEe=U4(),Lbt=bUi(),Bbt=Sp(),HBe=_y(),Fbt=gm(),TUi=Tye(),s9=hgt(),wbt=E5e();Ll.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 jTc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(iEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Ll.tokenErrorString)}}a(jTc,"createStaticGitHubTokenProvider");function HTc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new xbt.SyncDescriptor(kbt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new xbt.SyncDescriptor(Dbt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new xbt.SyncDescriptor(Rbt,[process.env.GITHUB_PAT]);if(iEe.isScenarioAutomation)return new xbt.SyncDescriptor(Pbt,[t]);throw new Error(Ll.tokenErrorString)}a(HTc,"getOrCreateTestingCopilotTokenManager");var nEe=class extends SUi.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 qTc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,SUi.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=TUi.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,wbt.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,s9.containsVSCodeOrg)(s.organization_list??[])},d=TUi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,wbt.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:p5r.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:p5r.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,HBe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,s9.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,s9.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,s9.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:p5r.RequestType.CopilotUserInfo})).json()}};Ll.BaseCopilotTokenManager=nEe;var Rbt=class extends nEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Lbt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,s9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,s9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new s9.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.FixedCopilotTokenManager=Rbt;Ll.FixedCopilotTokenManager=Rbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Mbt.ICAPIClientService),Ou(4,Obt.IDomainService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService)],Rbt);var kbt=class extends nEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Lbt.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 s9.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.StaticExtendedTokenInfoCopilotTokenManager=kbt;Ll.StaticExtendedTokenInfoCopilotTokenManager=kbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Mbt.ICAPIClientService),Ou(4,Obt.IDomainService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService)],kbt);var jBe=class extends nEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,wbt.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 s9.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,wbt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Ll.RefreshableCopilotTokenManager=jBe;var Pbt=class extends jBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new Lbt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Ll.CopilotTokenManagerFromDeviceId=Pbt;Ll.CopilotTokenManagerFromDeviceId=Pbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Obt.IDomainService),Ou(4,Mbt.ICAPIClientService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService),Ou(7,IUi.IConfigurationService)],Pbt);var Dbt=class extends jBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new Lbt.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)}};Ll.CopilotTokenManagerFromGitHubToken=Dbt;Ll.CopilotTokenManagerFromGitHubToken=Dbt=Nbt([Ou(2,Bbt.ILogService),Ou(3,Fbt.ITelemetryService),Ou(4,Obt.IDomainService),Ou(5,Mbt.ICAPIClientService),Ou(6,HBe.IFetcherService),Ou(7,iEe.IEnvService),Ou(8,IUi.IConfigurationService)],Dbt)});var wUi=I(a9=>{"use strict";p();var GTc=a9&&a9.__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},h5r=a9&&a9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(a9,"__esModule",{value:!0});a9.ChatQuotaService=void 0;var $Tc=(Sne(),ba(bne)),VTc=Ic(),WTc=Ro(),zTc=FE(),YTc=$E(),KTc=Sp(),m5r=class extends WTc.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 VTc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidCopilotTokenChange(()=>{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:$Tc.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()}};a9.ChatQuotaService=m5r;a9.ChatQuotaService=m5r=GTc([h5r(0,zTc.IAuthenticationService),h5r(1,KTc.ILogService),h5r(2,YTc.ICAPIClientService)],m5r)});var kUi=I(Ubt=>{"use strict";p();Object.defineProperty(Ubt,"__esModule",{value:!0});Ubt.DefaultsOnlyConfigurationService=void 0;var RUi=Pl(),g5r=class extends RUi.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=RUi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};Ubt.DefaultsOnlyConfigurationService=g5r});var DUi=I(Qbt=>{"use strict";p();Object.defineProperty(Qbt,"__esModule",{value:!0});Qbt.computeDiff=ZTc;Qbt.computeDiffSync=PUi;var JTc=aDr();async function ZTc(t,e,r){return PUi(t,e,r)}a(ZTc,"computeDiff");function PUi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new JTc.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(PUi,"computeDiffSync")});var LUi=I(gN=>{"use strict";p();var XTc=gN&&gN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eIc=gN&&gN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OUi=gN&&gN.__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=sIc([NUi.join(__dirname,"diffWorker.js"),NUi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new tIc.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 oIc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:E5r(o.changes),moves:o.moves.map(c=>new iIc.MovedText(new A5r.LineRangeMapping(new qbt.LineRange(c[0],c[1]),new qbt.LineRange(c[2],c[3])),E5r(c[4])))}}};gN.DiffServiceImpl=y5r;function E5r(t){return t.map(e=>new A5r.DetailedLineRangeMapping(new qbt.LineRange(e[0],e[1]),new qbt.LineRange(e[2],e[3]),e[4]?.map(r=>new A5r.RangeMapping(new MUi.Range(r[0],r[1],r[2],r[3]),new MUi.Range(r[4],r[5],r[6],r[7])))))}a(E5r,"toLineRangeMappings");function sIc(t){for(let e of t)if((0,nIc.existsSync)(e))return e}a(sIc,"firstExistingPath")});var FUi=I(c9=>{"use strict";p();var aIc=c9&&c9.__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},BUi=c9&&c9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c9,"__esModule",{value:!0});c9.CAPIClientImpl=void 0;var cIc=U4(),lIc=_y(),uIc=$E(),_5r=class extends uIc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};c9.CAPIClientImpl=_5r;c9.CAPIClientImpl=_5r=aIc([BUi(0,lIc.IFetcherService),BUi(1,cIc.IEnvService)],_5r)});var QUi=I(l9=>{"use strict";p();var dIc=l9&&l9.__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},v5r=l9&&l9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(l9,"__esModule",{value:!0});l9.DomainService=void 0;var fIc=Ic(),pIc=Ro(),hIc=XH(),oEe=Pl(),mIc=$E(),UUi="github-enterprise.uri",C5r=class extends pIc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new fIc.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(`${oEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(UUi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(oEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(oEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(oEe.ConfigKey.Shared.AuthProvider)===oEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(UUi):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)}};l9.DomainService=C5r;l9.DomainService=C5r=dIc([v5r(0,oEe.IConfigurationService),v5r(1,hIc.ICopilotTokenStore),v5r(2,mIc.ICAPIClientService)],C5r)});var qUi=I(sEe=>{"use strict";p();Object.defineProperty(sEe,"__esModule",{value:!0});sEe.NullNativeEnvService=sEe.NullEnvService=void 0;var gIc=Ic(),AIc=nd(),jbt=U4(),yIc=c5e(),Hbt=class t extends jbt.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 gIc.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 jbt.OperatingSystem.Linux}getEditorInfo(){return new jbt.NameAndVersion("simulation-tests-editor",yIc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new jbt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};sEe.NullEnvService=Hbt;var b5r=class extends Hbt{static{a(this,"NullNativeEnvService")}get userHome(){return AIc.URI.file("/home/testuser")}};sEe.NullNativeEnvService=b5r});var S5r=I(Gbt=>{"use strict";p();Object.defineProperty(Gbt,"__esModule",{value:!0});Gbt.IGitExtensionService=void 0;var EIc=nn();Gbt.IGitExtensionService=(0,EIc.createServiceIdentifier)("IGitExtensionService")});var jUi=I($bt=>{"use strict";p();Object.defineProperty($bt,"__esModule",{value:!0});$bt.NullGitExtensionService=void 0;var _Ic=Ic(),T5r=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=_Ic.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};$bt.NullGitExtensionService=T5r});var HUi=I(u9=>{"use strict";p();var vIc=u9&&u9.__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},CIc=u9&&u9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u9,"__esModule",{value:!0});u9.ObservableGit=void 0;var bIc=Ro(),EV=W2(),SIc=S5r(),I5r=class extends bIc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,EV.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,EV.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,EV.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,EV.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,EV.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,EV.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,EV.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,EV.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};u9.ObservableGit=I5r;u9.ObservableGit=I5r=vIc([CIc(0,SIc.IGitExtensionService)],I5r)});var Wbt=I(Bl=>{"use strict";p();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.lengthZero=void 0;Bl.lengthDiff=xIc;Bl.lengthIsZero=wIc;Bl.toLength=Xne;Bl.lengthToObj=RIc;Bl.lengthGetLineCount=kIc;Bl.lengthGetColumnCountIfZeroLineCount=PIc;Bl.lengthAdd=$Ui;Bl.sumLengths=DIc;Bl.lengthEquals=NIc;Bl.lengthDiffNonNegative=MIc;Bl.lengthLessThan=OIc;Bl.lengthLessThanEqual=LIc;Bl.lengthGreaterThanEqual=BIc;Bl.lengthToPosition=FIc;Bl.positionToLength=UIc;Bl.lengthsToRange=QIc;Bl.lengthOfRange=qIc;Bl.lengthCompare=jIc;Bl.lengthOfString=HIc;Bl.lengthOfStringObj=GIc;Bl.lengthHash=$Ic;Bl.lengthMax=VIc;var GUi=em(),TIc=q_(),IIc=eh(),Vbt=Tme();function xIc(t,e,r,n){return t!==r?Xne(r-t,n):Xne(0,n-e)}a(xIc,"lengthDiff");Bl.lengthZero=0;function wIc(t){return t===0}a(wIc,"lengthIsZero");var e_=2**26;function Xne(t,e){return t*e_+e}a(Xne,"toLength");function RIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new Vbt.TextLength(r,n)}a(RIc,"lengthToObj");function kIc(t){return Math.floor(t/e_)}a(kIc,"lengthGetLineCount");function PIc(t){return t}a(PIc,"lengthGetColumnCountIfZeroLineCount");function $Ui(t,e){let r=t+e;return e>=e_&&(r=r-t%e_),r}a($Ui,"lengthAdd");function DIc(t,e){return t.reduce((r,n)=>$Ui(r,e(n)),Bl.lengthZero)}a(DIc,"sumLengths");function NIc(t,e){return t===e}a(NIc,"lengthEquals");function MIc(t,e){let r=t,n=e;if(n-r<=0)return Bl.lengthZero;let s=Math.floor(r/e_),c=Math.floor(n/e_),l=n-c*e_;if(s===c){let u=r-s*e_;return Xne(0,l-u)}else return Xne(c-s,l)}a(MIc,"lengthDiffNonNegative");function OIc(t,e){return t=e}a(BIc,"lengthGreaterThanEqual");function FIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new TIc.Position(r+1,n+1)}a(FIc,"lengthToPosition");function UIc(t){return Xne(t.lineNumber-1,t.column-1)}a(UIc,"positionToLength");function QIc(t,e){let r=t,n=Math.floor(r/e_),o=r-n*e_,s=e,c=Math.floor(s/e_),l=s-c*e_;return new IIc.Range(n+1,o+1,c+1,l+1)}a(QIc,"lengthsToRange");function qIc(t){return t.startLineNumber===t.endLineNumber?new Vbt.TextLength(0,t.endColumn-t.startColumn):new Vbt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(qIc,"lengthOfRange");function jIc(t,e){return t-e}a(jIc,"lengthCompare");function HIc(t){let e=(0,GUi.splitLines)(t);return Xne(e.length-1,e[e.length-1].length)}a(HIc,"lengthOfString");function GIc(t){let e=(0,GUi.splitLines)(t);return new Vbt.TextLength(e.length-1,e[e.length-1].length)}a(GIc,"lengthOfStringObj");function $Ic(t){return t}a($Ic,"lengthHash");function VIc(t,e){return t>e?t:e}a(VIc,"lengthMax")});var R5r=I(zbt=>{"use strict";p();Object.defineProperty(zbt,"__esModule",{value:!0});zbt.TextEditInfo=void 0;var x5r=Wbt(),w5r=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,x5r.lengthToObj)(this.startOffset)}...${(0,x5r.lengthToObj)(this.endOffset)}) -> ${(0,x5r.lengthToObj)(this.newLength)}`}};zbt.TextEditInfo=w5r});var WUi=I(k5r=>{"use strict";p();Object.defineProperty(k5r,"__esModule",{value:!0});k5r.combineTextEditInfos=YIc;var WIc=Sl(),O0=Wbt(),zIc=R5r();function YIc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new WIc.ArrayQueue(VUi(t)),n=VUi(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,O0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,O0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,O0.lengthIsZero)(d)||f.push(new GBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,O0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new zIc.TextEditInfo(m.startOffset,f,(0,O0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=O0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,O0.sumLengths)(f,g=>g.lengthBefore),m=(0,O0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,O0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(YIc,"combineTextEditInfos");var GBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,O0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,O0.lengthEquals)(r,O0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,O0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,O0.lengthToObj)(this.lengthBefore)} -> ${(0,O0.lengthToObj)(this.lengthAfter)}`}};function VUi(t){let e=[],r=O0.lengthZero;for(let n of t){let o=(0,O0.lengthDiffNonNegative)(r,n.startOffset);(0,O0.lengthIsZero)(o)||e.push(new GBe(!1,o,o));let s=(0,O0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new GBe(!0,s,n.newLength)),r=n.endOffset}return e}a(VUi,"toLengthMapping")});var YUi=I(aEe=>{"use strict";p();Object.defineProperty(aEe,"__esModule",{value:!0});aEe.SingleTextEditLength=aEe.TextLengthEdit=void 0;var KIc=eh(),zUi=Tme(),JIc=WUi(),$Be=Wbt(),ZIc=R5r(),P5r=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new VBe(n.range,zUi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,$Be.lengthToObj)(n.newLength);return new VBe((0,$Be.lengthsToRange)(n.startOffset,n.endOffset),new zUi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new ZIc.TextEditInfo((0,$Be.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,$Be.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,$Be.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,JIc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return KIc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};aEe.TextLengthEdit=P5r;var VBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};aEe.SingleTextEditLength=VBe});var KUi=I(cEe=>{"use strict";p();Object.defineProperty(cEe,"__esModule",{value:!0});cEe.DocumentHistory=cEe.HistoryContext=void 0;var XIc=rd(),exc=iN(),D5r=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,XIc.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}}};cEe.HistoryContext=D5r;var N5r=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 exc.RootedEdit(this.base,this.lastEdits.compose())}};cEe.DocumentHistory=N5r});var r7i=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.NesHistoryContextProvider=void 0;lEe.sum=zBe;lEe.editExtends=t7i;var JUi=Ro(),ZUi=W2(),txc=KS(),WBe=kE(),rxc=h5e(),nxc=qT(),Ybt=iN(),ixc=L_t(),XUi=YUi(),oxc=h4(),YBe=vMe(),e7i=KUi(),M5r=class extends JUi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new L5r(50),this._register((0,ZUi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,YBe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,ZUi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new O5r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,oxc.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,JUi.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 e7i.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,YBe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};lEe.NesHistoryContextProvider=M5r;var O5r=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 nxc.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=rxc.TextEdit.fromStringEdit(e,this._currentValue),o=XUi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return zBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&t7i(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,YBe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,YBe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Ybt.Edits(WBe.StringEdit,this._edits.map(o=>o.edit));return{history:new e7i.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=WBe.StringEdit.empty,o=XUi.TextLengthEdit.empty,s,c=0,l=WBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,YBe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,txc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=zBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||zBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||zBe(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=WBe.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=Ybt.RootedEdit.toLineEdit(new Ybt.RootedEdit(r,y)),v=new ixc.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 Ybt.Edits(WBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function zBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(zBe,"sum");function t7i(t,e){let r=e.getNewRanges();return t.replacements.every(n=>sxc(n.replaceRange,r))}a(t7i,"editExtends");function sxc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(sxc,"doesTouch");var L5r=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 o7i=I(AN=>{"use strict";p();var axc=AN&&AN.__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},n7i=AN&&AN.__param||function(t,e){return function(r,n){e(r,n,t)}},F5r;Object.defineProperty(AN,"__esModule",{value:!0});AN.NesXtabHistoryTracker=AN.XtabEditMergeStrategy=void 0;var U5r=rd(),cxc=Ro(),lxc=vue(),uxc=W2(),dxc=C8(),Jbt=Pl(),fxc=mh(),Kbt=iN(),d9=Uvr(),pxc=h4(),B5r=vMe(),Q5r;(function(t){t.sameStartLine={kind:d9.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:d9.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:d9.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case d9.DiffHistoryMergeStrategy.Proximity:return e(s);case d9.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case d9.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,U5r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(Q5r||(AN.XtabEditMergeStrategy=Q5r={}));function i7i(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(i7i,"areLineEditsWithinProximity");var q5r=class extends cxc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{F5r=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 lxc.LinkedList,this.maxHistorySize=r??F5r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,dxc.derived)(s=>Q5r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,uxc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,pxc.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,B5r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case d9.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case d9.DiffHistoryMergeStrategy.Proximity:return i7i(r,e,o.lineGap);case d9.DiffHistoryMergeStrategy.Hybrid:return(0,B5r.now)()-n<=o.splitAfterMs&&i7i(r,e,o.lineGap)}}handleEdits(e,r){(0,U5r.assert)(r.previous!==void 0,"Document has previous version"),(0,U5r.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 Kbt.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=Kbt.RootedEdit.toLineEdit(l),d=Kbt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new Kbt.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,B5r.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)}}}};AN.NesXtabHistoryTracker=q5r;AN.NesXtabHistoryTracker=q5r=F5r=axc([n7i(2,Jbt.IConfigurationService),n7i(3,fxc.IExperimentationService)],q5r)});var s7i=I(Zbt=>{"use strict";p();Object.defineProperty(Zbt,"__esModule",{value:!0});Zbt.IVSCodeExtensionContext=void 0;var hxc=nn();Zbt.IVSCodeExtensionContext=(0,hxc.createServiceIdentifier)("IVSCodeExtensionContext")});var h7i=I(EN=>{"use strict";p();var u7i=EN&&EN.__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},_V=EN&&EN.__param||function(t,e){return function(r,n){e(r,n,t)}},JBe;Object.defineProperty(EN,"__esModule",{value:!0});EN.UndesiredModels=EN.InlineEditsModelService=void 0;var mxc=MOr(),d7i=gOr(),a7i=X_(),gxc=Sl(),c7i=rd(),f7i=Ic(),p7i=Ro(),uEe=W2(),Axc=XH(),yN=Pl(),yxc=s7i(),Exc=Sp(),_xc=hbt(),vxc=mh(),Cxc=gm(),KBe=py(),bxc=kCt(),H5r=class extends p7i.Disposable{static{a(this,"InlineEditsModelService")}static{JBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:KBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:KBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:KBe.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,uEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,uEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(yN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,uEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new d7i.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,uEe.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,uEe.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,uEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=f7i.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(yN.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(yN.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(yN.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,yN.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,mxc.filterMap)(r,f=>{if((0,KBe.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,gxc.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 j5r(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 j5r(r[0])}return j5r(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,c7i.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,yN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?JBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?JBe.COPILOT_NES_CALLISTO:JBe.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,c7i.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=KBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=a7i.ErrorUtils.toString(a7i.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};EN.InlineEditsModelService=H5r;EN.InlineEditsModelService=H5r=JBe=u7i([_V(0,Axc.ICopilotTokenStore),_V(1,_xc.IProxyModelsService),_V(2,bxc.IUndesiredModelsManager),_V(3,yN.IConfigurationService),_V(4,vxc.IExperimentationService),_V(5,Cxc.ITelemetryService),_V(6,Exc.ILogService)],H5r);function j5r(t){let{source:e,...r}=t;return r}a(j5r,"toModelConfiguration");var l7i;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends p7i.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new f7i.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new d7i.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=u7i([_V(0,yxc.IVSCodeExtensionContext)],r),t.Manager=r})(l7i||(EN.UndesiredModels=l7i={}))});var m7i=I(Xbt=>{"use strict";p();Object.defineProperty(Xbt,"__esModule",{value:!0});Xbt.NullLanguageContextProviderService=void 0;var Sxc=Ro(),G5r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return Sxc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};Xbt.NullLanguageContextProviderService=G5r});var g7i=I(e1t=>{"use strict";p();Object.defineProperty(e1t,"__esModule",{value:!0});e1t.TestLanguageDiagnosticsService=void 0;var Txc=Ic(),Ixc=zP(),xxc=T$(),$5r=class extends xxc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new Ixc.ResourceMap,this._onDidChangeDiagnostics=new Txc.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())}};e1t.TestLanguageDiagnosticsService=$5r});var A7i=I(r1t=>{"use strict";p();Object.defineProperty(r1t,"__esModule",{value:!0});r1t.ResponseStream=void 0;var wxc=X_(),t1t=uw(),Rxc=nl(),kxc=KS(),V5r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new Rxc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return t1t.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return t1t.Result.error(l)}}),this.stream=Pxc(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,kxc.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}}};r1t.ResponseStream=V5r;async function*Pxc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=wxc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?t1t.Result.error(n):t1t.Result.ok(r))}}a(Pxc,"streamWithAggregation")});var y7i=I(W5r=>{"use strict";p();Object.defineProperty(W5r,"__esModule",{value:!0});W5r.jsonlStreamToCompletions=Dxc;async function*Dxc(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(Dxc,"jsonlStreamToCompletions")});var _7i=I(f9=>{"use strict";p();var Nxc=f9&&f9.__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},z5r=f9&&f9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(f9,"__esModule",{value:!0});f9.CompletionsFetchService=void 0;var Mxc=AOr(),E7i=X_(),eie=uw(),Oxc=I0r(),Lxc=FE(),Bxc=$6(),Fxc=_y(),Uxc=lye(),vV=__t(),Qxc=A7i(),qxc=y7i(),Y5r=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=eie.Result.error(new vV.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=Mxc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,qxc.jsonlStreamToCompletions)(f),m=new Qxc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=eie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new vV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>Hxc(d.val.body).catch(()=>"")),h=eie.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())),eie.Result.error(new vV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=jxc(u,s);return eie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Bxc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return eie.Result.error(new vV.Completions.RequestCancelled);let l=E7i.ErrorUtils.fromUnknown(c);return eie.Result.error(new vV.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 vV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof vV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof vV.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:Oxc.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}}};f9.CompletionsFetchService=Y5r;f9.CompletionsFetchService=Y5r=Nxc([z5r(0,Lxc.IAuthenticationService),z5r(1,Fxc.IFetcherService),z5r(2,Uxc.IRequestLogger)],Y5r);async function*jxc(t,e){try{for await(let r of t)yield r}catch(r){throw E7i.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(jxc,"streamWithCleanup");async function Hxc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(Hxc,"collectAsyncIterableToString")});var C7i=I(n1t=>{"use strict";p();Object.defineProperty(n1t,"__esModule",{value:!0});n1t.WireTypes=void 0;var CV=RG(),v7i;(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,CV.vObj)({promptStrategy:(0,CV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,CV.vObj)({serviceType:(0,CV.vString)(),name:(0,CV.vString)(),provider:(0,CV.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,CV.vObj)({models:(0,CV.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={}))})(v7i||(n1t.WireTypes=v7i={}))});var S7i=I(p9=>{"use strict";p();var Gxc=p9&&p9.__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},i1t=p9&&p9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(p9,"__esModule",{value:!0});p9.ProxyModelsService=void 0;var $xc=require("util"),K5r=X_(),Vxc=YP(),Wxc=Ic(),zxc=Ro(),b7i=W2(),Yxc=XH(),Kxc=$E(),Jxc=C7i(),Zxc=Sp(),Xxc=_y(),J5r=class extends zxc.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 Wxc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,b7i.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,b7i.autorun)(c=>{let l=s.read(c),u=new Vxc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,$xc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=K5r.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=K5r.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=Jxc.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=K5r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};p9.ProxyModelsService=J5r;p9.ProxyModelsService=J5r=Gxc([i1t(0,Yxc.ICopilotTokenStore),i1t(1,Kxc.ICAPIClientService),i1t(2,Xxc.IFetcherService),i1t(3,Zxc.ILogService)],J5r)});var T7i=I(o1t=>{"use strict";p();Object.defineProperty(o1t,"__esModule",{value:!0});o1t.NullRequestLogger=void 0;var ewc=fMr(),twc=Ic(),Z5r=class extends ewc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=twc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};o1t.NullRequestLogger=Z5r});var u1t=I(eu=>{"use strict";p();var a4r=eu&&eu.__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},_N=eu&&eu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eu,"__esModule",{value:!0});eu.SimpleExperimentationService=eu.LogLevel=eu.TokenizerName=eu.ILanguageContextProviderService=eu.IIgnoreService=eu.IExperimentationService=eu.IEndpointProvider=eu.ICAPIClientService=eu.IAuthenticationService=void 0;eu.createNESProvider=zwc;eu.createInlineCompletionsProvider=Kwc;var rwc=Asi(),I7i=bte(),x7i=sIi(),w7i=Uge(),nwc=mgt(),R7i=FSr(),iwc=USr(),$v=LE(),k7i=$Sr(),owc=e2i(),swc=fy(),P7i=LTr(),awc=n$(),D7i=jTr(),N7i=_4e(),M7i=cIr(),O7i=uIr(),L7i=IPr(),e4r=uyt(),cwc=LLi(),lwc=BLi(),ZBe=Dl(),uwc=KAe(),dwc=jSr(),B7i=o2r(),F7i=mTr(),U7i=A_t(),Q7i=ckr(),q7i=tEt(),XBe=eEt(),j7i=v$(),H7i=hEt(),fwc=qLi(),pwc=dEt(),G7i=sCr(),$7i=s1(),V7i=_5e(),W7i=rne(),iQi=Ore();Object.defineProperty(eu,"TokenizerName",{enumerable:!0,get:a(function(){return iQi.TokenizerName},"get")});var hwc=tBi(),mwc=XBi(),t4r=C3i(),z7i=BDr(),gwc=s6i(),Y7i=xMr(),Awc=pUi(),c4r=FE();Object.defineProperty(eu,"IAuthenticationService",{enumerable:!0,get:a(function(){return c4r.IAuthenticationService},"get")});var ywc=E5e(),K7i=XH(),Ewc=hUi(),_wc=xUi(),vwc=K6(),Cwc=QDr(),bwc=wUi(),Swc=qDr(),J7i=HDr(),PL=Pl(),Twc=kUi(),Iwc=wMr(),xwc=LUi(),l4r=$E();Object.defineProperty(eu,"ICAPIClientService",{enumerable:!0,get:a(function(){return l4r.ICAPIClientService},"get")});var wwc=J$(),u4r=s4e();Object.defineProperty(eu,"IEndpointProvider",{enumerable:!0,get:a(function(){return u4r.IEndpointProvider},"get")});var oQi=FUi(),Rwc=QUi(),tie=U4(),kwc=qUi(),Pwc=S5r(),sQi=jUi(),e3e=Bre();Object.defineProperty(eu,"IIgnoreService",{enumerable:!0,get:a(function(){return e3e.IIgnoreService},"get")});var Dwc=Vne(),Nwc=Zft(),X5r=kCt(),Mwc=HUi(),Owc=r7i(),Lwc=o7i(),Bwc=h7i(),d4r=Jyt();Object.defineProperty(eu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return d4r.ILanguageContextProviderService},"get")});var aQi=m7i(),cQi=T$(),lQi=g7i(),vN=Sp(),Fwc=__t(),Uwc=_7i(),f4r=_y(),Z7i=X6(),Qwc=aMr(),qwc=cMr(),jwc=yCt(),Hwc=hbt(),Gwc=S7i(),uQi=lye(),dQi=T7i(),X7i=BMr(),eQi=Q2r(),r3e=mh();Object.defineProperty(eu,"IExperimentationService",{enumerable:!0,get:a(function(){return r3e.IExperimentationService},"get")});var fQi=gm(),tQi=Tye(),$wc=Ivr(),rQi=abt(),nQi=K$(),r4r=fOr(),pQi=nn(),Vwc=YP(),t3e=Ic(),l1t=Ro(),Wwc=T0(),gi=Hft(),hQi=Gs(),rie;(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"})(rie||(eu.LogLevel=rie={}));function zwc(t){return Ywc(t).createInstance(n4r,t)}a(zwc,"createNESProvider");var n4r=class extends l1t.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(Awc.XtabProvider),l=r.createInstance(Mwc.ObservableGit),u=new Owc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(PL.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Lwc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new hwc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(mwc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(t4r.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=Dwc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Wwc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Nwc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new t4r.NextEditProviderTelemetryBuilder(new sQi.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 nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};n4r=a4r([_N(1,hQi.IInstantiationService),_N(2,r3e.IExperimentationService),_N(3,PL.IConfigurationService),_N(4,r4r.IWorkspaceService)],n4r);function Ywc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new pQi.InstantiationServiceBuilder;s.define(PL.IConfigurationService,new gi.SyncDescriptor(s1t,[t.configOverrides??new Map])),s.define(r3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),s.define(X7i.ISimulationTestContext,new gi.SyncDescriptor(X7i.NulSimulationTestContext)),s.define(r4r.IWorkspaceService,new gi.SyncDescriptor(r4r.NullWorkspaceService)),s.define(Iwc.IDiffService,new gi.SyncDescriptor(xwc.DiffServiceImpl,[!1])),s.define(vN.ILogService,new gi.SyncDescriptor(vN.LogServiceImpl,[[o||new vN.ConsoleLog(void 0,vN.LogLevel.Trace)]])),s.define(Pwc.IGitExtensionService,new gi.SyncDescriptor(sQi.NullGitExtensionService)),s.define(d4r.ILanguageContextProviderService,new gi.SyncDescriptor(aQi.NullLanguageContextProviderService)),s.define(cQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(lQi.TestLanguageDiagnosticsService)),s.define(e3e.IIgnoreService,new gi.SyncDescriptor(e3e.NullIgnoreService)),s.define(eQi.ISnippyService,new gi.SyncDescriptor(eQi.NullSnippyService)),s.define(wwc.IDomainService,new gi.SyncDescriptor(Rwc.DomainService)),s.define(l4r.ICAPIClientService,new gi.SyncDescriptor(oQi.CAPIClientImpl)),s.define(K7i.ICopilotTokenStore,new gi.SyncDescriptor(K7i.CopilotTokenStore)),s.define(tie.IEnvService,new gi.SyncDescriptor(kwc.NullEnvService)),s.define(f4r.IFetcherService,new gi.SyncDescriptor(a1t,[e])),s.define(fQi.ITelemetryService,new gi.SyncDescriptor(c1t,[n])),s.define(c4r.IAuthenticationService,new gi.SyncDescriptor(Ewc.StaticGitHubAuthenticationService,[(0,_wc.createStaticGitHubTokenProvider)()])),s.define(ywc.ICopilotTokenManager,r),s.define(z7i.IPowerService,new gi.SyncDescriptor(z7i.NullPowerService)),s.define(vwc.IChatMLFetcher,new gi.SyncDescriptor(gwc.ChatMLFetcherImpl)),s.define(Z7i.IChatWebSocketManager,new gi.SyncDescriptor(Z7i.NullChatWebSocketManager)),s.define(jwc.IOTelService,new Qwc.NoopOTelService((0,qwc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Cwc.IChatQuotaService,new gi.SyncDescriptor(bwc.ChatQuotaService)),s.define(J7i.IInteractionService,new gi.SyncDescriptor(J7i.InteractionService)),s.define(uQi.IRequestLogger,new gi.SyncDescriptor(dQi.NullRequestLogger)),s.define(nQi.ITokenizerProvider,t.tokenizerProvider??new gi.SyncDescriptor(nQi.TokenizerProvider,[!1])),s.define(Swc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(Hwc.IProxyModelsService,new gi.SyncDescriptor(Gwc.ProxyModelsService)),s.define(X5r.IInlineEditsModelService,new gi.SyncDescriptor(Bwc.InlineEditsModelService)),s.define(X5r.IUndesiredModelsManager,t.undesiredModelsManager||new gi.SyncDescriptor(X5r.NullUndesiredModelsManager)),s.define(rQi.ITerminalService,t.terminalService||new gi.SyncDescriptor(rQi.NullTerminalService)),s.define(Y7i.ISimilarFilesContextService,new gi.SyncDescriptor(Y7i.NullSimilarFilesContextService)),s.define(u4r.IEndpointProvider,new i4r);let c=new $v.InMemoryConfigProvider(new $v.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define($v.ICompletionsConfigProvider,c),s.seal()}a(Ywc,"setupServices");var s1t=class extends Twc.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)}},i4r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=t3e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},nie=class extends l1t.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new t3e.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()}};eu.SimpleExperimentationService=nie;eu.SimpleExperimentationService=nie=a4r([_N(1,PL.IConfigurationService)],nie);var a1t=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=t3e.Event.None,this.onDidCompleteFetch=t3e.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 f4r.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)}},c1t=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,tQi.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,tQi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function Kwc(t){return t.tokenizerProvider&&(0,iQi.setExternalTokenizerProvider)(t.tokenizerProvider),Jwc(t).createInstance(o4r)}a(Kwc,"createInlineCompletionsProvider");var o4r=class extends l1t.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(cwc.GhostText)}updateTreatmentVariables(e){this._expService instanceof nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof $v.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new t4r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??Vwc.CancellationToken.None,o,new rwc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};o4r=a4r([_N(0,hQi.IInstantiationService),_N(1,r3e.IExperimentationService),_N(2,e4r.ICompletionsSpeculativeRequestCache),_N(3,vN.ILogService),_N(4,PL.IConfigurationService),_N(5,$v.ICompletionsConfigProvider)],o4r);var s4r=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,$wc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function Jwc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new vN.ConsoleLog(void 0,vN.LogLevel.Trace),f=new pQi.InstantiationServiceBuilder;f.define(ZBe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case ZBe.LogLevel.DEBUG:return rie.Debug;case ZBe.LogLevel.INFO:return rie.Info;case ZBe.LogLevel.WARN:return rie.Warning;case ZBe.LogLevel.ERROR:return rie.Error;default:return rie.Info}}}),f.define(c4r.IAuthenticationService,r),f.define(vN.ILogService,new gi.SyncDescriptor(vN.LogServiceImpl,[[d||new vN.ConsoleLog(void 0,vN.LogLevel.Trace)]])),f.define(e3e.IIgnoreService,t.ignoreService||new e3e.NullIgnoreService),f.define(fQi.ITelemetryService,new gi.SyncDescriptor(c1t,[new s4r(c)])),f.define(PL.IConfigurationService,new gi.SyncDescriptor(s1t,[t.configOverrides??new Map])),f.define(r3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),f.define(u4r.IEndpointProvider,t.endpointProvider),f.define(l4r.ICAPIClientService,t.capiClientService||new gi.SyncDescriptor(oQi.CAPIClientImpl)),f.define(f4r.IFetcherService,new gi.SyncDescriptor(a1t,[e])),f.define(I7i.ICompletionsTelemetryService,new gi.SyncDescriptor(I7i.CompletionsTelemetryServiceBridge)),f.define(W7i.ICompletionsRuntimeModeService,W7i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(N7i.ICompletionsCacheService,new N7i.CompletionsCache);let h=new $v.InMemoryConfigProvider(new $v.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define($v.ICompletionsConfigProvider,h),f.define(L7i.ICompletionsLastGhostText,new L7i.LastGhostText),f.define(O7i.ICompletionsCurrentGhostText,new O7i.CurrentGhostText),f.define(e4r.ICompletionsSpeculativeRequestCache,new e4r.SpeculativeRequestCache),f.define(dwc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define($v.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(x7i.ICompletionsExtensionStatus,new x7i.CopilotExtensionStatus),f.define(swc.ICompletionsFeaturesService,new gi.SyncDescriptor(owc.Features)),f.define(iwc.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(U7i.ICompletionsStatusReporter,new class extends U7i.StatusReporter{didChange(m){n.didChange(m)}}),f.define(w7i.ICompletionsCopilotTokenManager,new gi.SyncDescriptor(w7i.CopilotTokenManagerImpl,[!1])),f.define($7i.ICompletionsTextDocumentManagerService,new gi.SyncDescriptor(class extends $7i.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(P7i.ICompletionsFileReaderService,new gi.SyncDescriptor(P7i.FileReader)),f.define(M7i.ICompletionsBlockModeConfig,new gi.SyncDescriptor(M7i.ConfigBlockModeConfig)),f.define(G7i.ICompletionsTelemetryUserConfigService,new gi.SyncDescriptor(G7i.TelemetryUserConfig)),f.define(H7i.ICompletionsRecentEditsProviderService,new gi.SyncDescriptor(H7i.FullRecentEditsProvider,[void 0])),f.define(R7i.ICompletionsNotifierService,new gi.SyncDescriptor(R7i.CompletionNotifier)),f.define(B7i.ICompletionsOpenAIFetcherService,new gi.SyncDescriptor(B7i.LiveOpenAIFetcher)),f.define(Fwc.ICompletionsFetchService,new gi.SyncDescriptor(Uwc.CompletionsFetchService)),f.define(F7i.ICompletionsModelManagerService,new gi.SyncDescriptor(F7i.AvailableModelsManager,[!0])),f.define(D7i.ICompletionsAsyncManagerService,new gi.SyncDescriptor(D7i.AsyncCompletionManager)),f.define(q7i.ICompletionsContextProviderBridgeService,new gi.SyncDescriptor(q7i.ContextProviderBridge)),f.define(k7i.ICompletionsUserErrorNotifierService,new gi.SyncDescriptor(k7i.UserErrorNotifier)),f.define(pwc.ICompletionsRelatedFilesProviderService,new gi.SyncDescriptor(fwc.CompositeRelatedFilesProvider)),f.define(awc.ICompletionsFileSystemService,new lwc.LocalFileSystem),f.define(XBe.ICompletionsContextProviderRegistryService,new gi.SyncDescriptor(XBe.CachedContextProviderRegistry,[XBe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(V7i.ICompletionsPromiseQueueService,new V7i.PromiseQueue),f.define(nwc.ICompletionsCitationManager,new class{register(){return l1t.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(j7i.ICompletionsContextProviderService,new j7i.ContextProviderStatistics),f.define(Q7i.ICompletionsPromptFactoryService,new gi.SyncDescriptor(Q7i.CompletionsPromptFactory)),f.define(uwc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(XBe.ICompletionsDefaultContextProviders,new XBe.DefaultContextProvidersContainer),f.define(tie.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=t3e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?tie.OperatingSystem.Macintosh:process.platform==="win32"?tie.OperatingSystem.Windows:tie.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return $v.BuildInfo.isProduction()}isPreRelease(){return $v.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return $v.BuildInfo.getBuildType()===$v.BuildType.DEV?"dev":"prod"}getVersion(){return $v.BuildInfo.getVersion()}getBuild(){return $v.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new tie.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new tie.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(d4r.ILanguageContextProviderService,t.languageContextProvider??new aQi.NullLanguageContextProviderService),f.define(cQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(lQi.TestLanguageDiagnosticsService)),f.define(uQi.IRequestLogger,new gi.SyncDescriptor(dQi.NullRequestLogger)),f.seal()}a(Jwc,"setupCompletionServices")});function qt(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 C1=ve(()=>{p();a(qt,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var vEe,D1t=ve(()=>{p();vEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return vEe=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 v9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var u3e,CEe=ve(()=>{p();a(v9,"isAbortError");u3e=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,Ch,Ty,TV,bEe,SEe,TEe,IEe,xEe,wEe,REe,kEe,PEe,Bf=ve(()=>{p();CEe();fr=class extends Error{static{a(this,"AnthropicError")}},Ch=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 TV({message:n,cause:u3e(r)});let s=r,c=s?.error?.type;return e===400?new SEe(e,s,n,o,c):e===401?new TEe(e,s,n,o,c):e===403?new IEe(e,s,n,o,c):e===404?new xEe(e,s,n,o,c):e===409?new wEe(e,s,n,o,c):e===422?new REe(e,s,n,o,c):e===429?new kEe(e,s,n,o,c):e>=500?new PEe(e,s,n,o,c):new t(e,s,n,o,c)}},Ty=class extends Ch{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},TV=class extends Ch{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},bEe=class extends TV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},SEe=class extends Ch{static{a(this,"BadRequestError")}},TEe=class extends Ch{static{a(this,"AuthenticationError")}},IEe=class extends Ch{static{a(this,"PermissionDeniedError")}},xEe=class extends Ch{static{a(this,"NotFoundError")}},wEe=class extends Ch{static{a(this,"ConflictError")}},REe=class extends Ch{static{a(this,"UnprocessableEntityError")}},kEe=class extends Ch{static{a(this,"RateLimitError")}},PEe=class extends Ch{static{a(this,"InternalServerError")}}});function N1t(t){return typeof t!="object"?{}:t??{}}function X4r(t){if(!t)return!0;for(let e in t)return!1;return!0}function zqi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var WPc,Wqi,t_,Z4r,Yqi,M1t,NL=ve(()=>{p();Bf();WPc=/^[a-z][a-z0-9+.-]*:/i,Wqi=a(t=>WPc.test(t),"isAbsoluteURL"),t_=a(t=>(t_=Array.isArray,t_(t)),"isArray"),Z4r=t_;a(N1t,"maybeObj");a(X4r,"isEmptyObj");a(zqi,"hasOwn");Yqi=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"),M1t=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var TN,DEe=ve(()=>{p();TN=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 ek,d3e=ve(()=>{p();ek="0.98.0"});function zPc(){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 KPc(){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 Xqi,YPc,Kqi,Jqi,Zqi,f3e,O1t=ve(()=>{p();d3e();Xqi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(zPc,"getDetectedPlatform");YPc=a(()=>{let t=zPc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":Jqi(Deno.build.os),"X-Stainless-Arch":Kqi(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":ek,"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":ek,"X-Stainless-OS":Jqi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Kqi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=KPc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"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":ek,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(KPc,"getBrowserInfo");Kqi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),Jqi=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"),f3e=a(()=>Zqi??(Zqi=YPc()),"getPlatformHeaders")});function eji(){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 eLr(...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 L1t(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return eLr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function p3e(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 tji(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 NEe=ve(()=>{p();a(eji,"getDefaultFetch");a(eLr,"makeReadableStream");a(L1t,"ReadableStreamFrom");a(p3e,"ReadableStreamToAsyncIterable");a(tji,"CancelReadableStream")});var rji,nji=ve(()=>{p();rji=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var tLr,rLr,nLr,iji,iLr=ve(()=>{p();tLr="RFC3986",rLr=a(t=>String(t),"default_formatter"),nLr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:rLr},iji="RFC1738"});function sji(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function sLr(t,e){if(t_(t)){let r=[];for(let n=0;n{p();iLr();NL();B1t=a((t,e)=>(B1t=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),B1t(t,e)),"has"),ML=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),oLr=1024,oji=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=oLr?s.slice(l,l+oLr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===iji&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=ML[h];continue}if(h<2048){d[d.length]=ML[192|h>>6]+ML[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=ML[224|h>>12]+ML[128|h>>6&63]+ML[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=ML[240|h>>18]+ML[128|h>>12&63]+ML[128|h>>6&63]+ML[128|h&63]}c+=d.join("")}return c},"encode");a(sji,"is_buffer");a(sLr,"maybe_map")});function XPc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function dji(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(aLr))!==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(aLr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&t_(v)&&(v=sLr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,L0.encoder,E,"key",g):e;v=""}if(XPc(v)||sji(v)){if(u){let N=y?e:u(e,L0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,L0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&t_(v))y&&u&&(v=sLr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(t_(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&&t_(v)&&v.length===1?P+"[]":P;if(o&&t_(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:L0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:L0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:L0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:L0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?L0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:L0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:L0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:L0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:L0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:L0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:L0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:L0.strictNullHandling}}function fji(t,e={}){let r=t,n=e2c(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):t_(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=lji[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 lji,uji,cji,L0,aLr,pji=ve(()=>{p();aji();iLr();NL();lji={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},uji=a(function(t,e){Array.prototype.push.apply(t,t_(e)?e:[e])},"push_to_array"),L0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:oji,encodeValuesOnly:!1,format:tLr,formatter:rLr,indices:!1,serializeDate(t){return(cji??(cji=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(XPc,"is_non_nullish_primitive");aLr={};a(dji,"inner_stringify");a(e2c,"normalize_stringify_options");a(fji,"stringify")});function hji(t){return fji(t,{arrayFormat:"brackets"})}var cLr=ve(()=>{p();pji();a(hji,"stringifyQuery")});function U1t(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Wc(`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 Wc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Q1t(t,e){let r=await n2c(t),n;try{n=JSON.parse(r)}catch{throw new Wc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,b1(r),e)}if(!n.access_token)throw new Wc(`Token endpoint response missing access_token: ${JSON.stringify(b1(n))}`,t.status,b1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Wc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,b1(n),e);return n}function b1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=lLr?t:t.slice(0,lLr)+`... <${t.length-lLr} more chars>`}return JSON.stringify(b1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))r2c.has(r)&&(e[r]=n);return e}return null}async function q1t(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 Wc(`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 Wc(`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 j1t(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 n2c(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>mji){let l=mji-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 gji,Aji,F1t,lie,yji,Eji,MEe,_ji,mji,lLr,r2c,Wc,OEe=ve(()=>{p();Bf();gji="urn:ietf:params:oauth:grant-type:jwt-bearer",Aji="refresh_token",F1t="/v1/oauth/token",lie="oauth-2025-04-20",yji="oidc-federation-2026-04-01",Eji=120,MEe=30,_ji=5,mji=1<<20;a(U1t,"requireSecureTokenEndpoint");a(Q1t,"parseTokenResponse");lLr=2e3,r2c=new Set(["error","error_description","error_uri"]);a(b1,"redactSensitive");a(q1t,"checkCredentialsFileSafety");a(j1t,"writeCredentialsFileAtomic");a(n2c,"readLimitedText");Wc=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 IN(){return Math.floor(Date.now()/1e3)}var h3e=ve(()=>{p();a(IN,"nowAsSeconds")});var H1t,vji=ve(()=>{p();OEe();h3e();H1t=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-IN();return n>Eji?r.token:n>MEe?(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||IN()-this.lastAdvisoryError<_ji||this.doRefresh().catch(e=>{this.lastAdvisoryError=IN(),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 _a,m3e=ve(()=>{p();_a=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 Sji(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 LEe(t){let e;return(Cji??(e=new globalThis.TextEncoder,Cji=e.encode.bind(e)))(t)}function uLr(t){let e;return(bji??(e=new globalThis.TextDecoder,bji=e.decode.bind(e)))(t)}var Cji,bji,G1t=ve(()=>{p();a(Sji,"concatBytes");a(LEe,"encodeUTF8");a(uLr,"decodeUTF8")});var Tji=ve(()=>{p();Bf();G1t()});function g3e(){}function $1t(t,e,r){return!e||V1t[t]>V1t[r]?g3e:e[t].bind(e)}function gl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return i2c;let n=Iji.get(e);if(n&&n[0]===r)return n[1];let o={error:$1t("error",e,r),warn:$1t("warn",e,r),info:$1t("info",e,r),debug:$1t("debug",e,r)};return Iji.set(e,[r,o]),o}var V1t,dLr,i2c,Iji,C9,b9=ve(()=>{p();NL();V1t={off:0,error:200,warn:300,info:400,debug:500},dLr=a((t,e,r)=>{if(t){if(zqi(V1t,t))return t;gl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(V1t))}`)}},"parseLogLevel");a(g3e,"noop");a($1t,"makeLogFn");i2c={error:g3e,warn:g3e,info:g3e,debug:g3e},Iji=new WeakMap;a(gl,"loggerFor");C9=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 fLr=ve(()=>{p();NL();Tji();m3e();b9();D1t();DEe();cLr()});function xji(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(!o2c.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var W1t,o2c,wji,Rji,pLr,s2c,kji,hLr=ve(()=>{p();O1t();fLr();W1t="1.0",o2c=/^[A-Za-z0-9_.-]+$/;a(xji,"validateProfileName");wji=a(async t=>{var e,r;let n=await pLr();if(n===null)return null;let o=t??await kji();if(o===null)return null;xji(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=_a("ANTHROPIC_ORGANIZATION_ID"),m=_a("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=_a("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:_a("ANTHROPIC_WORKSPACE_ID"),base_url:_a("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:_a("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:_a("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=_a("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=_a("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=_a("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=_a("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=_a("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=_a("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Rji=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await pLr();if(!r)return null;let n=e??await kji();return n?(xji(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),pLr=a(async()=>{if(!s2c())return null;let t=await import("node:path"),e=_a("ANTHROPIC_CONFIG_DIR");if(e)return e;if(f3e()["X-Stainless-OS"]==="Windows"){let s=_a("APPDATA");if(s)return t.join(s,"Anthropic");let c=_a("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=_a("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=_a("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),s2c=a(()=>{let t=f3e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),kji=a(async()=>{let t=await pLr();if(!t)return null;let e=_a("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 mLr(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 Pji(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var Dji=ve(()=>{p();Bf();a(mLr,"identityTokenFromFile");a(Pji,"identityTokenFromValue")});function Nji(t){return async()=>{U1t(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Wc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:gji,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}${F1t}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${lie},${yji}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${ek} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Wc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=b1(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 Wc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Q1t(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Wc(`Token endpoint response missing required fields: ${JSON.stringify(b1(c))}`,o.status,b1(c),s);return{token:c.access_token,expiresAt:IN()+l}}}var Mji=ve(()=>{p();OEe();h3e();d3e();a(Nji,"oidcFederationProvider")});function Oji(t){return async e=>{let r=await import("node:fs");await q1t(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Wc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Wc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Wc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||IN()"");throw new Wc(`User OAuth refresh failed (HTTP ${f.status}): ${b1(E)}`,f.status,b1(E),h)}let m=await Q1t(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Wc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(b1(m))}`,f.status,b1(m),h);let A=IN()+g,y=m.refresh_token||l;return await j1t(t.credentialsPath,{...o,version:W1t,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var Lji=ve(()=>{p();hLr();OEe();h3e();d3e();a(Oji,"userOAuthProvider")});function gLr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=a2c(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 Bji(t,e){let r=await wji(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 Rji(n,e)??void 0}};return gLr(s,t)}function a2c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=c2c(o);if(!s)throw new Wc("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 Wc("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 Wc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=Nji({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?l2c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Wc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return Oji({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 Wc(`authentication.type "${o}" is not a known authentication type`)}}}function c2c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Wc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Wc('identity_token.source "file" requires a non-empty path');return mLr(t.identity_token.path)}let e=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return mLr(e);let r=_a("ANTHROPIC_IDENTITY_TOKEN");return r?Pji(r):null}function l2c(t,e,r,n){return async o=>{let s=await import("node:fs");await q1t(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||IN(){p();m3e();hLr();OEe();h3e();Dji();Mji();Lji();a(gLr,"resolveCredentialsFromConfig");a(Bji,"defaultCredentials");a(a2c,"buildProvider");a(c2c,"resolveIdentityTokenProvider");a(l2c,"cachedExchangeProvider")});function u2c(t,e){for(let o=e??0;o{p();C1();G1t();S9=class{static{a(this,"LineDecoder")}constructor(){yI.set(this,void 0),EI.set(this,void 0),qt(this,yI,new Uint8Array,"f"),qt(this,EI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?LEe(e):e;qt(this,yI,Sji([xe(this,yI,"f"),r]),"f");let n=[],o;for(;(o=u2c(xe(this,yI,"f"),xe(this,EI,"f")))!=null;){if(o.carriage&&xe(this,EI,"f")==null){qt(this,EI,o.index,"f");continue}if(xe(this,EI,"f")!=null&&(o.index!==xe(this,EI,"f")+1||o.carriage)){n.push(uLr(xe(this,yI,"f").subarray(0,xe(this,EI,"f")-1))),qt(this,yI,xe(this,yI,"f").subarray(xe(this,EI,"f")),"f"),qt(this,EI,null,"f");continue}let s=xe(this,EI,"f")!==null?o.preceding-1:o.preceding,c=uLr(xe(this,yI,"f").subarray(0,s));n.push(c),qt(this,yI,xe(this,yI,"f").subarray(o.index),"f"),qt(this,EI,null,"f")}return n}flush(){return xe(this,yI,"f").length?this.decode(` -`):[]}};yI=new WeakMap,EI=new WeakMap;S9.NEWLINE_CHARS=new Set([` -`,"\r"]);S9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(u2c,"findNewlineIndex");a(Uji,"findDoubleNewlineIndex")});async function*d2c(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 yLr,n=new S9,o=p3e(t.body);for await(let s of f2c(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*f2c(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"?LEe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=Uji(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function p2c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var A3e,OL,yLr,ELr=ve(()=>{p();C1();Bf();NEe();ALr();NEe();CEe();NL();G1t();b9();Bf();OL=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,A3e.set(this,void 0),this.controller=r,qt(this,A3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?gl(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 d2c(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=M1t(u.data)??u.data,f=d?.error?.type;throw new Ch(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(v9(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 S9,u=p3e(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(v9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(A3e=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,A3e,"f")),new t(()=>o(r),this.controller,xe(this,A3e,"f"))]}toReadableStream(){let e=this,r;return eLr({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=LEe(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(d2c,"_iterSSEMessages");a(f2c,"iterSSEChunks");yLr=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]=p2c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(p2c,"partition")});async function z1t(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return gl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):OL.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 _Lr(m,r)}return await r.text()})();return gl(t).debug(`[${n}] response parsed`,C9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function _Lr(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 vLr=ve(()=>{p();ELr();b9();a(z1t,"defaultParseResponse");a(_Lr,"addRequestID")});var y3e,uie,Y1t=ve(()=>{p();C1();vLr();uie=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=z1t){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,y3e.set(this,void 0),qt(this,y3e,e,"f")}_thenUnwrap(e){return new t(xe(this,y3e,"f"),this.responsePromise,async(r,n)=>_Lr(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,y3e,"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)}};y3e=new WeakMap});var K1t,J1t,E3e,tk,va,_d=ve(()=>{p();C1();Bf();vLr();Y1t();NL();J1t=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){K1t.set(this,void 0),qt(this,K1t,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,K1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(K1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},E3e=class extends uie{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await z1t(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},tk=class extends J1t{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:{...N1t(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...N1t(this.options.query),after_id:e}}:null}},va=class extends J1t{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:{...N1t(this.options.query),page:e}}:null}}});function die(t,e,r){return bLr(),new File(t,e??"unknown_file",r)}function _3e(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 m2c(t){let e=typeof t=="function"?t:t.fetch,r=Qji.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 Qji.set(e,n),n}var bLr,SLr,BEe,Qji,g2c,A2c,CLr,FEe=ve(()=>{p();NEe();bLr=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(die,"makeFile");a(_3e,"getName");SLr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),BEe=a(async(t,e,r=!0)=>({...t,body:await g2c(t.body,e,r)}),"multipartFormRequestOptions"),Qji=new WeakMap;a(m2c,"supportsFormData");g2c=a(async(t,e,r=!0)=>{if(!await m2c(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])=>CLr(n,o,s,r))),n},"createForm"),A2c=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),CLr=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,die([await r.blob()],_3e(r,n),o))}else if(SLr(r))t.append(e,die([await new Response(L1t(r)).blob()],_3e(r,n)));else if(A2c(r))t.append(e,die([r],_3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>CLr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>CLr(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 Z1t(t,e,r){if(bLr(),t=await t,e||(e=_3e(t,!0)),y2c(t))return t instanceof File&&e==null&&r==null?t:die([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(E2c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),die(await TLr(o),e,r)}let n=await TLr(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 die(n,e,r)}async function TLr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(qji(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(SLr(t))for await(let r of t)e.push(...await TLr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${_2c(t)}`)}return e}function _2c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var qji,y2c,E2c,jji=ve(()=>{p();FEe();FEe();qji=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"),y2c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&qji(t),"isFileLike"),E2c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(Z1t,"toFile");a(TLr,"getBytes");a(_2c,"propsForError")});var ILr=ve(()=>{p();jji()});var Hji=ve(()=>{p()});var Ai,Ul=ve(()=>{p();Ai=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*C2c(t){if(!t)return;if(Gji 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():Z4r(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=Z4r(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 Gji,vt,vc=ve(()=>{p();NL();Gji=Symbol.for("brand.privateNullableHeaders");a(C2c,"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 C2c(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{[Gji]:!0,values:e,nulls:r}},"buildHeaders")});function X1t(t){return typeof t=="object"&&t!==null&&v3e in t}function xLr(t,e){let r=new Set;if(t)for(let n of t)X1t(n)&&r.add(n[v3e]);if(e){for(let n of e)if(X1t(n)&&r.add(n[v3e]),Array.isArray(n.content))for(let o of n.content)X1t(o)&&r.add(o[v3e])}return Array.from(r)}function eSt(t,e){let r=xLr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function $ji(t){return X1t(t)?{"x-stainless-helper":t[v3e]}:{}}var v3e,C3e=ve(()=>{p();v3e=Symbol("anthropic.sdk.stainlessHelper");a(X1t,"wasCreatedByStainlessHelper");a(xLr,"collectStainlessHelpers");a(eSt,"stainlessHelperHeader");a($ji,"stainlessHelperHeaderFromFile")});function Wji(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Vji,b2c,or,Ff=ve(()=>{p();Bf();a(Wji,"encodeURIPath");Vji=Object.freeze(Object.create(null)),b2c=a((t=Wji)=>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??Vji)??Vji)?.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: + `,u=[],d=null,f=!0;for(;f;){let m=await iEe(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(tIc,"getAssignableActorsWithAssignableUsers")});var kUi=I(tk=>{"use strict";p();Object.defineProperty(tk,"__esModule",{value:!0});tk.BaseOctoKitService=tk.PermissiveAuthRequiredError=tk.VSCodeTeamId=tk.IOctoKitService=tk.IGithubRepositoryService=void 0;var RUi=nn(),wUi=i$(),yN=xUi();tk.IGithubRepositoryService=(0,RUi.createServiceIdentifier)("IGithubRepositoryService");tk.IOctoKitService=(0,RUi.createServiceIdentifier)("IOctoKitService");tk.VSCodeTeamId=1682102;var h5r=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};tk.PermissiveAuthRequiredError=h5r;var m5r=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,yN.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,yN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,yN.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 compareCommitsWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/compare/${n}...${o}`,l=await(0,yN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{version:"2022-11-28",callSite:"github-rest-compare-commits"});if(!l)return;let u=l,d=u.merge_base_commit?.sha??u.base_commit?.sha??n,f=u.commits?.[u.commits.length-1]?.sha??o;return{baseSha:d,headSha:f,files:u.files??[]}}async getRepositoryByIdWithToken(e,r){let n=await(0,yN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repositories/${e}`,"GET",r,{version:"2022-11-28",callSite:"github-rest-get-repository-by-id"});if(!n)return;let o=n;if(o.owner?.login&&o.name)return{owner:o.owner.login,name:o.name};if(o.full_name){let[s,c]=o.full_name.split("/");if(s&&c)return{owner:s,name:c}}}async closePullRequestWithToken(e,r,n,o){return(0,yN.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,yN.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,wUi.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(kbt,"__esModule",{value:!0});kbt.NullBaseOctoKitService=void 0;var rIc=kUi(),g5r=class extends rIc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{id:0,avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};kbt.NullBaseOctoKitService=g5r});var OUi=I(Bl=>{"use strict";p();var Bbt=Bl&&Bl.__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},Ou=Bl&&Bl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Bl,"__esModule",{value:!0});Bl.CopilotTokenManagerFromGitHubToken=Bl.CopilotTokenManagerFromDeviceId=Bl.RefreshableCopilotTokenManager=Bl.StaticExtendedTokenInfoCopilotTokenManager=Bl.FixedCopilotTokenManager=Bl.BaseCopilotTokenManager=Bl.tokenErrorString=void 0;Bl.createStaticGitHubTokenProvider=iIc;Bl.getOrCreateTestingCopilotTokenManager=oIc;var A5r=(Tne(),Sa(Sne)),nIc=Ic(),DUi=ko(),Pbt=Wft(),MUi=Dl(),Fbt=VE(),Ubt=tV(),sEe=Q4(),Qbt=PUi(),qbt=Ip(),zBe=vy(),jbt=ym(),NUi=xye(),c9=ygt(),Dbt=S5e();Bl.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 iIc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(sEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Bl.tokenErrorString)}}a(iIc,"createStaticGitHubTokenProvider");function oIc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new Pbt.SyncDescriptor(Mbt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new Pbt.SyncDescriptor(Lbt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new Pbt.SyncDescriptor(Nbt,[process.env.GITHUB_PAT]);if(sEe.isScenarioAutomation)return new Pbt.SyncDescriptor(Obt,[t]);throw new Error(Bl.tokenErrorString)}a(oIc,"getOrCreateTestingCopilotTokenManager");var oEe=class extends DUi.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 nIc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,DUi.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=NUi.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,Dbt.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,c9.containsVSCodeOrg)(s.organization_list??[])},d=NUi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,Dbt.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:A5r.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:A5r.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,zBe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,c9.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,c9.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,c9.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:A5r.RequestType.CopilotUserInfo})).json()}};Bl.BaseCopilotTokenManager=oEe;var Nbt=class extends oEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Qbt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,c9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,c9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new c9.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Bl.FixedCopilotTokenManager=Nbt;Bl.FixedCopilotTokenManager=Nbt=Bbt([Ou(1,qbt.ILogService),Ou(2,jbt.ITelemetryService),Ou(3,Fbt.ICAPIClientService),Ou(4,Ubt.IDomainService),Ou(5,zBe.IFetcherService),Ou(6,sEe.IEnvService)],Nbt);var Mbt=class extends oEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Qbt.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 c9.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Bl.StaticExtendedTokenInfoCopilotTokenManager=Mbt;Bl.StaticExtendedTokenInfoCopilotTokenManager=Mbt=Bbt([Ou(1,qbt.ILogService),Ou(2,jbt.ITelemetryService),Ou(3,Fbt.ICAPIClientService),Ou(4,Ubt.IDomainService),Ou(5,zBe.IFetcherService),Ou(6,sEe.IEnvService)],Mbt);var WBe=class extends oEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,Dbt.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 c9.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,Dbt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Bl.RefreshableCopilotTokenManager=WBe;var Obt=class extends WBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new Qbt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Bl.CopilotTokenManagerFromDeviceId=Obt;Bl.CopilotTokenManagerFromDeviceId=Obt=Bbt([Ou(1,qbt.ILogService),Ou(2,jbt.ITelemetryService),Ou(3,Ubt.IDomainService),Ou(4,Fbt.ICAPIClientService),Ou(5,zBe.IFetcherService),Ou(6,sEe.IEnvService),Ou(7,MUi.IConfigurationService)],Obt);var Lbt=class extends WBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new Qbt.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)}};Bl.CopilotTokenManagerFromGitHubToken=Lbt;Bl.CopilotTokenManagerFromGitHubToken=Lbt=Bbt([Ou(2,qbt.ILogService),Ou(3,jbt.ITelemetryService),Ou(4,Ubt.IDomainService),Ou(5,Fbt.ICAPIClientService),Ou(6,zBe.IFetcherService),Ou(7,sEe.IEnvService),Ou(8,MUi.IConfigurationService)],Lbt)});var LUi=I(l9=>{"use strict";p();var sIc=l9&&l9.__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},y5r=l9&&l9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(l9,"__esModule",{value:!0});l9.ChatQuotaService=void 0;var aIc=(Tne(),Sa(Sne)),cIc=Ic(),lIc=ko(),uIc=UE(),dIc=VE(),fIc=Ip(),E5r=class extends lIc.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 cIc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidCopilotTokenChange(()=>{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:aIc.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()}};l9.ChatQuotaService=E5r;l9.ChatQuotaService=E5r=sIc([y5r(0,uIc.IAuthenticationService),y5r(1,fIc.ILogService),y5r(2,dIc.ICAPIClientService)],E5r)});var FUi=I(Hbt=>{"use strict";p();Object.defineProperty(Hbt,"__esModule",{value:!0});Hbt.DefaultsOnlyConfigurationService=void 0;var BUi=Dl(),_5r=class extends BUi.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=BUi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};Hbt.DefaultsOnlyConfigurationService=_5r});var QUi=I(Gbt=>{"use strict";p();Object.defineProperty(Gbt,"__esModule",{value:!0});Gbt.computeDiff=hIc;Gbt.computeDiffSync=UUi;var pIc=dDr();async function hIc(t,e,r){return UUi(t,e,r)}a(hIc,"computeDiff");function UUi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new pIc.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(UUi,"computeDiffSync")});var GUi=I(EN=>{"use strict";p();var mIc=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]})),gIc=EN&&EN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HUi=EN&&EN.__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=CIc([qUi.join(__dirname,"diffWorker.js"),qUi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new AIc.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 vIc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:b5r(o.changes),moves:o.moves.map(c=>new _Ic.MovedText(new v5r.LineRangeMapping(new $bt.LineRange(c[0],c[1]),new $bt.LineRange(c[2],c[3])),b5r(c[4])))}}};EN.DiffServiceImpl=C5r;function b5r(t){return t.map(e=>new v5r.DetailedLineRangeMapping(new $bt.LineRange(e[0],e[1]),new $bt.LineRange(e[2],e[3]),e[4]?.map(r=>new v5r.RangeMapping(new jUi.Range(r[0],r[1],r[2],r[3]),new jUi.Range(r[4],r[5],r[6],r[7])))))}a(b5r,"toLineRangeMappings");function CIc(t){for(let e of t)if((0,EIc.existsSync)(e))return e}a(CIc,"firstExistingPath")});var VUi=I(u9=>{"use strict";p();var bIc=u9&&u9.__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},$Ui=u9&&u9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u9,"__esModule",{value:!0});u9.CAPIClientImpl=void 0;var SIc=Q4(),TIc=vy(),IIc=VE(),S5r=class extends IIc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};u9.CAPIClientImpl=S5r;u9.CAPIClientImpl=S5r=bIc([$Ui(0,TIc.IFetcherService),$Ui(1,SIc.IEnvService)],S5r)});var zUi=I(d9=>{"use strict";p();var xIc=d9&&d9.__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},T5r=d9&&d9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d9,"__esModule",{value:!0});d9.DomainService=void 0;var wIc=Ic(),RIc=ko(),kIc=nG(),aEe=Dl(),PIc=VE(),WUi="github-enterprise.uri",I5r=class extends RIc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new wIc.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(`${aEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(WUi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(aEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(aEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(aEe.ConfigKey.Shared.AuthProvider)===aEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(WUi):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)}};d9.DomainService=I5r;d9.DomainService=I5r=xIc([T5r(0,aEe.IConfigurationService),T5r(1,kIc.ICopilotTokenStore),T5r(2,PIc.ICAPIClientService)],I5r)});var YUi=I(cEe=>{"use strict";p();Object.defineProperty(cEe,"__esModule",{value:!0});cEe.NullNativeEnvService=cEe.NullEnvService=void 0;var DIc=Ic(),NIc=id(),Vbt=Q4(),MIc=p5e(),Wbt=class t extends Vbt.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 DIc.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 Vbt.OperatingSystem.Linux}getEditorInfo(){return new Vbt.NameAndVersion("simulation-tests-editor",MIc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new Vbt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};cEe.NullEnvService=Wbt;var x5r=class extends Wbt{static{a(this,"NullNativeEnvService")}get userHome(){return NIc.URI.file("/home/testuser")}};cEe.NullNativeEnvService=x5r});var w5r=I(zbt=>{"use strict";p();Object.defineProperty(zbt,"__esModule",{value:!0});zbt.IGitExtensionService=void 0;var OIc=nn();zbt.IGitExtensionService=(0,OIc.createServiceIdentifier)("IGitExtensionService")});var KUi=I(Ybt=>{"use strict";p();Object.defineProperty(Ybt,"__esModule",{value:!0});Ybt.NullGitExtensionService=void 0;var LIc=Ic(),R5r=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=LIc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};Ybt.NullGitExtensionService=R5r});var JUi=I(f9=>{"use strict";p();var BIc=f9&&f9.__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},FIc=f9&&f9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(f9,"__esModule",{value:!0});f9.ObservableGit=void 0;var UIc=ko(),bV=K2(),QIc=w5r(),k5r=class extends UIc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,bV.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,bV.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,bV.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,bV.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,bV.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,bV.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,bV.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,bV.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};f9.ObservableGit=k5r;f9.ObservableGit=k5r=BIc([FIc(0,QIc.IGitExtensionService)],k5r)});var Jbt=I(Fl=>{"use strict";p();Object.defineProperty(Fl,"__esModule",{value:!0});Fl.lengthZero=void 0;Fl.lengthDiff=HIc;Fl.lengthIsZero=GIc;Fl.toLength=eie;Fl.lengthToObj=$Ic;Fl.lengthGetLineCount=VIc;Fl.lengthGetColumnCountIfZeroLineCount=WIc;Fl.lengthAdd=XUi;Fl.sumLengths=zIc;Fl.lengthEquals=YIc;Fl.lengthDiffNonNegative=KIc;Fl.lengthLessThan=JIc;Fl.lengthLessThanEqual=ZIc;Fl.lengthGreaterThanEqual=XIc;Fl.lengthToPosition=exc;Fl.positionToLength=txc;Fl.lengthsToRange=rxc;Fl.lengthOfRange=nxc;Fl.lengthCompare=ixc;Fl.lengthOfString=oxc;Fl.lengthOfStringObj=sxc;Fl.lengthHash=axc;Fl.lengthMax=cxc;var ZUi=rm(),qIc=j_(),jIc=rh(),Kbt=xme();function HIc(t,e,r,n){return t!==r?eie(r-t,n):eie(0,n-e)}a(HIc,"lengthDiff");Fl.lengthZero=0;function GIc(t){return t===0}a(GIc,"lengthIsZero");var t_=2**26;function eie(t,e){return t*t_+e}a(eie,"toLength");function $Ic(t){let e=t,r=Math.floor(e/t_),n=e-r*t_;return new Kbt.TextLength(r,n)}a($Ic,"lengthToObj");function VIc(t){return Math.floor(t/t_)}a(VIc,"lengthGetLineCount");function WIc(t){return t}a(WIc,"lengthGetColumnCountIfZeroLineCount");function XUi(t,e){let r=t+e;return e>=t_&&(r=r-t%t_),r}a(XUi,"lengthAdd");function zIc(t,e){return t.reduce((r,n)=>XUi(r,e(n)),Fl.lengthZero)}a(zIc,"sumLengths");function YIc(t,e){return t===e}a(YIc,"lengthEquals");function KIc(t,e){let r=t,n=e;if(n-r<=0)return Fl.lengthZero;let s=Math.floor(r/t_),c=Math.floor(n/t_),l=n-c*t_;if(s===c){let u=r-s*t_;return eie(0,l-u)}else return eie(c-s,l)}a(KIc,"lengthDiffNonNegative");function JIc(t,e){return t=e}a(XIc,"lengthGreaterThanEqual");function exc(t){let e=t,r=Math.floor(e/t_),n=e-r*t_;return new qIc.Position(r+1,n+1)}a(exc,"lengthToPosition");function txc(t){return eie(t.lineNumber-1,t.column-1)}a(txc,"positionToLength");function rxc(t,e){let r=t,n=Math.floor(r/t_),o=r-n*t_,s=e,c=Math.floor(s/t_),l=s-c*t_;return new jIc.Range(n+1,o+1,c+1,l+1)}a(rxc,"lengthsToRange");function nxc(t){return t.startLineNumber===t.endLineNumber?new Kbt.TextLength(0,t.endColumn-t.startColumn):new Kbt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(nxc,"lengthOfRange");function ixc(t,e){return t-e}a(ixc,"lengthCompare");function oxc(t){let e=(0,ZUi.splitLines)(t);return eie(e.length-1,e[e.length-1].length)}a(oxc,"lengthOfString");function sxc(t){let e=(0,ZUi.splitLines)(t);return new Kbt.TextLength(e.length-1,e[e.length-1].length)}a(sxc,"lengthOfStringObj");function axc(t){return t}a(axc,"lengthHash");function cxc(t,e){return t>e?t:e}a(cxc,"lengthMax")});var N5r=I(Zbt=>{"use strict";p();Object.defineProperty(Zbt,"__esModule",{value:!0});Zbt.TextEditInfo=void 0;var P5r=Jbt(),D5r=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,P5r.lengthToObj)(this.startOffset)}...${(0,P5r.lengthToObj)(this.endOffset)}) -> ${(0,P5r.lengthToObj)(this.newLength)}`}};Zbt.TextEditInfo=D5r});var t7i=I(M5r=>{"use strict";p();Object.defineProperty(M5r,"__esModule",{value:!0});M5r.combineTextEditInfos=dxc;var lxc=Tl(),L0=Jbt(),uxc=N5r();function dxc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new lxc.ArrayQueue(e7i(t)),n=e7i(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,L0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,L0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,L0.lengthIsZero)(d)||f.push(new YBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,L0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new uxc.TextEditInfo(m.startOffset,f,(0,L0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=L0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,L0.sumLengths)(f,g=>g.lengthBefore),m=(0,L0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,L0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(dxc,"combineTextEditInfos");var YBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,L0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,L0.lengthEquals)(r,L0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,L0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,L0.lengthToObj)(this.lengthBefore)} -> ${(0,L0.lengthToObj)(this.lengthAfter)}`}};function e7i(t){let e=[],r=L0.lengthZero;for(let n of t){let o=(0,L0.lengthDiffNonNegative)(r,n.startOffset);(0,L0.lengthIsZero)(o)||e.push(new YBe(!1,o,o));let s=(0,L0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new YBe(!0,s,n.newLength)),r=n.endOffset}return e}a(e7i,"toLengthMapping")});var n7i=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.SingleTextEditLength=lEe.TextLengthEdit=void 0;var fxc=rh(),r7i=xme(),pxc=t7i(),KBe=Jbt(),hxc=N5r(),O5r=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new JBe(n.range,r7i.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,KBe.lengthToObj)(n.newLength);return new JBe((0,KBe.lengthsToRange)(n.startOffset,n.endOffset),new r7i.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new hxc.TextEditInfo((0,KBe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,KBe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,KBe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,pxc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return fxc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};lEe.TextLengthEdit=O5r;var JBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};lEe.SingleTextEditLength=JBe});var i7i=I(uEe=>{"use strict";p();Object.defineProperty(uEe,"__esModule",{value:!0});uEe.DocumentHistory=uEe.HistoryContext=void 0;var mxc=nd(),gxc=aN(),L5r=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,mxc.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}}};uEe.HistoryContext=L5r;var B5r=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 gxc.RootedEdit(this.base,this.lastEdits.compose())}};uEe.DocumentHistory=B5r});var u7i=I(dEe=>{"use strict";p();Object.defineProperty(dEe,"__esModule",{value:!0});dEe.NesHistoryContextProvider=void 0;dEe.sum=XBe;dEe.editExtends=l7i;var o7i=ko(),s7i=K2(),Axc=ZS(),ZBe=PE(),yxc=E5e(),Exc=HT(),Xbt=aN(),_xc=Q_t(),a7i=n7i(),vxc=m4(),e3e=IMe(),c7i=i7i(),F5r=class extends o7i.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new Q5r(50),this._register((0,s7i.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,e3e.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,s7i.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new U5r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,vxc.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,o7i.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 c7i.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,e3e.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};dEe.NesHistoryContextProvider=F5r;var U5r=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 Exc.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=yxc.TextEdit.fromStringEdit(e,this._currentValue),o=a7i.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return XBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&l7i(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,e3e.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,e3e.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Xbt.Edits(ZBe.StringEdit,this._edits.map(o=>o.edit));return{history:new c7i.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=ZBe.StringEdit.empty,o=a7i.TextLengthEdit.empty,s,c=0,l=ZBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,e3e.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,Axc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=XBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||XBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||XBe(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=ZBe.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=Xbt.RootedEdit.toLineEdit(new Xbt.RootedEdit(r,y)),v=new _xc.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 Xbt.Edits(ZBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function XBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(XBe,"sum");function l7i(t,e){let r=e.getNewRanges();return t.replacements.every(n=>Cxc(n.replaceRange,r))}a(l7i,"editExtends");function Cxc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(Cxc,"doesTouch");var Q5r=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 p7i=I(_N=>{"use strict";p();var bxc=_N&&_N.__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},d7i=_N&&_N.__param||function(t,e){return function(r,n){e(r,n,t)}},j5r;Object.defineProperty(_N,"__esModule",{value:!0});_N.NesXtabHistoryTracker=_N.XtabEditMergeStrategy=void 0;var H5r=nd(),Sxc=ko(),Txc=Cue(),Ixc=K2(),xxc=S8(),t1t=Dl(),wxc=Ah(),e1t=aN(),p9=Hvr(),Rxc=m4(),q5r=IMe(),G5r;(function(t){t.sameStartLine={kind:p9.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:p9.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:p9.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case p9.DiffHistoryMergeStrategy.Proximity:return e(s);case p9.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case p9.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,H5r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(G5r||(_N.XtabEditMergeStrategy=G5r={}));function f7i(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(f7i,"areLineEditsWithinProximity");var $5r=class extends Sxc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{j5r=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 Txc.LinkedList,this.maxHistorySize=r??j5r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,xxc.derived)(s=>G5r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(t1t.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(t1t.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(t1t.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,Ixc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,Rxc.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,q5r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case p9.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case p9.DiffHistoryMergeStrategy.Proximity:return f7i(r,e,o.lineGap);case p9.DiffHistoryMergeStrategy.Hybrid:return(0,q5r.now)()-n<=o.splitAfterMs&&f7i(r,e,o.lineGap)}}handleEdits(e,r){(0,H5r.assert)(r.previous!==void 0,"Document has previous version"),(0,H5r.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 e1t.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=e1t.RootedEdit.toLineEdit(l),d=e1t.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new e1t.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,q5r.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)}}}};_N.NesXtabHistoryTracker=$5r;_N.NesXtabHistoryTracker=$5r=j5r=bxc([d7i(2,t1t.IConfigurationService),d7i(3,wxc.IExperimentationService)],$5r)});var h7i=I(r1t=>{"use strict";p();Object.defineProperty(r1t,"__esModule",{value:!0});r1t.IVSCodeExtensionContext=void 0;var kxc=nn();r1t.IVSCodeExtensionContext=(0,kxc.createServiceIdentifier)("IVSCodeExtensionContext")});var C7i=I(CN=>{"use strict";p();var y7i=CN&&CN.__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},SV=CN&&CN.__param||function(t,e){return function(r,n){e(r,n,t)}},r3e;Object.defineProperty(CN,"__esModule",{value:!0});CN.UndesiredModels=CN.InlineEditsModelService=void 0;var Pxc=FOr(),E7i=_Or(),m7i=tv(),Dxc=Tl(),g7i=nd(),_7i=Ic(),v7i=ko(),fEe=K2(),Nxc=nG(),vN=Dl(),Mxc=h7i(),Oxc=Ip(),Lxc=ybt(),Bxc=Ah(),Fxc=ym(),t3e=hy(),Uxc=MCt(),W5r=class extends v7i.Disposable{static{a(this,"InlineEditsModelService")}static{r3e=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:t3e.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:t3e.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:t3e.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,fEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,fEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(vN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(vN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(vN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(vN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(vN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,fEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new E7i.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,fEe.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,fEe.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,fEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=_7i.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(vN.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(vN.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(vN.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,vN.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,Pxc.filterMap)(r,f=>{if((0,t3e.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,Dxc.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 V5r(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 V5r(r[0])}return V5r(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,g7i.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,vN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?r3e.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?r3e.COPILOT_NES_CALLISTO:r3e.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,g7i.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=t3e.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=m7i.ErrorUtils.toString(m7i.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};CN.InlineEditsModelService=W5r;CN.InlineEditsModelService=W5r=r3e=y7i([SV(0,Nxc.ICopilotTokenStore),SV(1,Lxc.IProxyModelsService),SV(2,Uxc.IUndesiredModelsManager),SV(3,vN.IConfigurationService),SV(4,Bxc.IExperimentationService),SV(5,Fxc.ITelemetryService),SV(6,Oxc.ILogService)],W5r);function V5r(t){let{source:e,...r}=t;return r}a(V5r,"toModelConfiguration");var A7i;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends v7i.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new _7i.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new E7i.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=y7i([SV(0,Mxc.IVSCodeExtensionContext)],r),t.Manager=r})(A7i||(CN.UndesiredModels=A7i={}))});var b7i=I(n1t=>{"use strict";p();Object.defineProperty(n1t,"__esModule",{value:!0});n1t.NullLanguageContextProviderService=void 0;var Qxc=ko(),z5r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return Qxc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};n1t.NullLanguageContextProviderService=z5r});var S7i=I(i1t=>{"use strict";p();Object.defineProperty(i1t,"__esModule",{value:!0});i1t.TestLanguageDiagnosticsService=void 0;var qxc=Ic(),jxc=KP(),Hxc=R$(),Y5r=class extends Hxc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new jxc.ResourceMap,this._onDidChangeDiagnostics=new qxc.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())}};i1t.TestLanguageDiagnosticsService=Y5r});var T7i=I(s1t=>{"use strict";p();Object.defineProperty(s1t,"__esModule",{value:!0});s1t.ResponseStream=void 0;var Gxc=tv(),o1t=fw(),$xc=nl(),Vxc=ZS(),K5r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new $xc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return o1t.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return o1t.Result.error(l)}}),this.stream=Wxc(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,Vxc.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}}};s1t.ResponseStream=K5r;async function*Wxc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=Gxc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?o1t.Result.error(n):o1t.Result.ok(r))}}a(Wxc,"streamWithAggregation")});var I7i=I(J5r=>{"use strict";p();Object.defineProperty(J5r,"__esModule",{value:!0});J5r.jsonlStreamToCompletions=zxc;async function*zxc(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(zxc,"jsonlStreamToCompletions")});var w7i=I(h9=>{"use strict";p();var Yxc=h9&&h9.__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},Z5r=h9&&h9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h9,"__esModule",{value:!0});h9.CompletionsFetchService=void 0;var Kxc=vOr(),x7i=tv(),tie=fw(),Jxc=k0r(),Zxc=UE(),Xxc=W6(),ewc=vy(),twc=dye(),TV=S_t(),rwc=T7i(),nwc=I7i(),X5r=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=tie.Result.error(new TV.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=Kxc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,nwc.jsonlStreamToCompletions)(f),m=new rwc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=tie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new TV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>owc(d.val.body).catch(()=>"")),h=tie.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())),tie.Result.error(new TV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=iwc(u,s);return tie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Xxc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return tie.Result.error(new TV.Completions.RequestCancelled);let l=x7i.ErrorUtils.fromUnknown(c);return tie.Result.error(new TV.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 TV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof TV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof TV.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:Jxc.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}}};h9.CompletionsFetchService=X5r;h9.CompletionsFetchService=X5r=Yxc([Z5r(0,Zxc.IAuthenticationService),Z5r(1,ewc.IFetcherService),Z5r(2,twc.IRequestLogger)],X5r);async function*iwc(t,e){try{for await(let r of t)yield r}catch(r){throw x7i.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(iwc,"streamWithCleanup");async function owc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(owc,"collectAsyncIterableToString")});var k7i=I(a1t=>{"use strict";p();Object.defineProperty(a1t,"__esModule",{value:!0});a1t.WireTypes=void 0;var IV=NG(),R7i;(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,IV.vObj)({promptStrategy:(0,IV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,IV.vObj)({serviceType:(0,IV.vString)(),name:(0,IV.vString)(),provider:(0,IV.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,IV.vObj)({models:(0,IV.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={}))})(R7i||(a1t.WireTypes=R7i={}))});var D7i=I(m9=>{"use strict";p();var swc=m9&&m9.__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},c1t=m9&&m9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(m9,"__esModule",{value:!0});m9.ProxyModelsService=void 0;var awc=require("util"),e4r=tv(),cwc=JP(),lwc=Ic(),uwc=ko(),P7i=K2(),dwc=nG(),fwc=VE(),pwc=k7i(),hwc=Ip(),mwc=vy(),t4r=class extends uwc.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 lwc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,P7i.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,P7i.autorun)(c=>{let l=s.read(c),u=new cwc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,awc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=e4r.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=e4r.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=pwc.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=e4r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};m9.ProxyModelsService=t4r;m9.ProxyModelsService=t4r=swc([c1t(0,dwc.ICopilotTokenStore),c1t(1,fwc.ICAPIClientService),c1t(2,mwc.IFetcherService),c1t(3,hwc.ILogService)],t4r)});var N7i=I(l1t=>{"use strict";p();Object.defineProperty(l1t,"__esModule",{value:!0});l1t.NullRequestLogger=void 0;var gwc=gMr(),Awc=Ic(),r4r=class extends gwc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=Awc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};l1t.NullRequestLogger=r4r});var h1t=I(eu=>{"use strict";p();var d4r=eu&&eu.__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},bN=eu&&eu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eu,"__esModule",{value:!0});eu.SimpleExperimentationService=eu.LogLevel=eu.TokenizerName=eu.ILanguageContextProviderService=eu.IIgnoreService=eu.IExperimentationService=eu.IEndpointProvider=eu.ICAPIClientService=eu.IAuthenticationService=void 0;eu.createNESProvider=uRc;eu.createInlineCompletionsProvider=fRc;var ywc=Tsi(),M7i=Ste(),O7i=hIi(),L7i=qge(),Ewc=Egt(),B7i=jSr(),_wc=HSr(),Wv=BE(),F7i=YSr(),vwc=c2i(),Cwc=py(),U7i=QTr(),bwc=a$(),Q7i=VTr(),q7i=T4e(),j7i=fIr(),H7i=hIr(),G7i=kPr(),i4r=hyt(),Swc=GLi(),Twc=$Li(),n3e=Nl(),Iwc=ZAe(),xwc=VSr(),$7i=l2r(),V7i=ETr(),W7i=v_t(),z7i=fkr(),Y7i=oEt(),i3e=iEt(),K7i=T$(),J7i=yEt(),wwc=YLi(),Rwc=mEt(),Z7i=uCr(),X7i=s1(),eQi=T5e(),tQi=nne(),fQi=Lre();Object.defineProperty(eu,"TokenizerName",{enumerable:!0,get:a(function(){return fQi.TokenizerName},"get")});var kwc=lBi(),Pwc=a3i(),o4r=k3i(),rQi=qDr(),Dwc=h6i(),nQi=PMr(),Nwc=vUi(),f4r=UE();Object.defineProperty(eu,"IAuthenticationService",{enumerable:!0,get:a(function(){return f4r.IAuthenticationService},"get")});var Mwc=S5e(),iQi=nG(),Owc=CUi(),Lwc=OUi(),Bwc=Z6(),Fwc=GDr(),Uwc=LUi(),Qwc=$Dr(),oQi=WDr(),DL=Dl(),qwc=FUi(),jwc=DMr(),Hwc=GUi(),p4r=VE();Object.defineProperty(eu,"ICAPIClientService",{enumerable:!0,get:a(function(){return p4r.ICAPIClientService},"get")});var Gwc=tV(),h4r=d4e();Object.defineProperty(eu,"IEndpointProvider",{enumerable:!0,get:a(function(){return h4r.IEndpointProvider},"get")});var pQi=VUi(),$wc=zUi(),rie=Q4(),Vwc=YUi(),Wwc=w5r(),hQi=KUi(),o3e=Fre();Object.defineProperty(eu,"IIgnoreService",{enumerable:!0,get:a(function(){return o3e.IIgnoreService},"get")});var zwc=Wne(),Ywc=rpt(),n4r=MCt(),Kwc=JUi(),Jwc=u7i(),Zwc=p7i(),Xwc=C7i(),m4r=tEt();Object.defineProperty(eu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return m4r.ILanguageContextProviderService},"get")});var mQi=b7i(),gQi=R$(),AQi=S7i(),SN=Ip(),eRc=S_t(),tRc=w7i(),g4r=vy(),sQi=t9(),rRc=dMr(),nRc=fMr(),iRc=CCt(),oRc=ybt(),sRc=D7i(),yQi=dye(),EQi=N7i(),aQi=qMr(),cQi=G2r(),a3e=Ah();Object.defineProperty(eu,"IExperimentationService",{enumerable:!0,get:a(function(){return a3e.IExperimentationService},"get")});var _Qi=ym(),lQi=xye(),aRc=kvr(),uQi=dbt(),dQi=eV(),s4r=gOr(),vQi=nn(),cRc=JP(),s3e=Ic(),p1t=ko(),lRc=I0(),gi=Wft(),CQi=Gs(),nie;(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"})(nie||(eu.LogLevel=nie={}));function uRc(t){return dRc(t).createInstance(a4r,t)}a(uRc,"createNESProvider");var a4r=class extends p1t.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(Nwc.XtabProvider),l=r.createInstance(Kwc.ObservableGit),u=new Jwc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(DL.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Zwc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new kwc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(Pwc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(o4r.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=zwc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,lRc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Ywc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new o4r.NextEditProviderTelemetryBuilder(new hQi.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 iie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=DL.globalConfigRegistry.configs.get(`${DL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};a4r=d4r([bN(1,CQi.IInstantiationService),bN(2,a3e.IExperimentationService),bN(3,DL.IConfigurationService),bN(4,s4r.IWorkspaceService)],a4r);function dRc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new vQi.InstantiationServiceBuilder;s.define(DL.IConfigurationService,new gi.SyncDescriptor(u1t,[t.configOverrides??new Map])),s.define(a3e.IExperimentationService,new gi.SyncDescriptor(iie,[t.waitForTreatmentVariables])),s.define(aQi.ISimulationTestContext,new gi.SyncDescriptor(aQi.NulSimulationTestContext)),s.define(s4r.IWorkspaceService,new gi.SyncDescriptor(s4r.NullWorkspaceService)),s.define(jwc.IDiffService,new gi.SyncDescriptor(Hwc.DiffServiceImpl,[!1])),s.define(SN.ILogService,new gi.SyncDescriptor(SN.LogServiceImpl,[[o||new SN.ConsoleLog(void 0,SN.LogLevel.Trace)]])),s.define(Wwc.IGitExtensionService,new gi.SyncDescriptor(hQi.NullGitExtensionService)),s.define(m4r.ILanguageContextProviderService,new gi.SyncDescriptor(mQi.NullLanguageContextProviderService)),s.define(gQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(AQi.TestLanguageDiagnosticsService)),s.define(o3e.IIgnoreService,new gi.SyncDescriptor(o3e.NullIgnoreService)),s.define(cQi.ISnippyService,new gi.SyncDescriptor(cQi.NullSnippyService)),s.define(Gwc.IDomainService,new gi.SyncDescriptor($wc.DomainService)),s.define(p4r.ICAPIClientService,new gi.SyncDescriptor(pQi.CAPIClientImpl)),s.define(iQi.ICopilotTokenStore,new gi.SyncDescriptor(iQi.CopilotTokenStore)),s.define(rie.IEnvService,new gi.SyncDescriptor(Vwc.NullEnvService)),s.define(g4r.IFetcherService,new gi.SyncDescriptor(d1t,[e])),s.define(_Qi.ITelemetryService,new gi.SyncDescriptor(f1t,[n])),s.define(f4r.IAuthenticationService,new gi.SyncDescriptor(Owc.StaticGitHubAuthenticationService,[(0,Lwc.createStaticGitHubTokenProvider)()])),s.define(Mwc.ICopilotTokenManager,r),s.define(rQi.IPowerService,new gi.SyncDescriptor(rQi.NullPowerService)),s.define(Bwc.IChatMLFetcher,new gi.SyncDescriptor(Dwc.ChatMLFetcherImpl)),s.define(sQi.IChatWebSocketManager,new gi.SyncDescriptor(sQi.NullChatWebSocketManager)),s.define(iRc.IOTelService,new rRc.NoopOTelService((0,nRc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Fwc.IChatQuotaService,new gi.SyncDescriptor(Uwc.ChatQuotaService)),s.define(oQi.IInteractionService,new gi.SyncDescriptor(oQi.InteractionService)),s.define(yQi.IRequestLogger,new gi.SyncDescriptor(EQi.NullRequestLogger)),s.define(dQi.ITokenizerProvider,t.tokenizerProvider??new gi.SyncDescriptor(dQi.TokenizerProvider,[!1])),s.define(Qwc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(oRc.IProxyModelsService,new gi.SyncDescriptor(sRc.ProxyModelsService)),s.define(n4r.IInlineEditsModelService,new gi.SyncDescriptor(Xwc.InlineEditsModelService)),s.define(n4r.IUndesiredModelsManager,t.undesiredModelsManager||new gi.SyncDescriptor(n4r.NullUndesiredModelsManager)),s.define(uQi.ITerminalService,t.terminalService||new gi.SyncDescriptor(uQi.NullTerminalService)),s.define(nQi.ISimilarFilesContextService,new gi.SyncDescriptor(nQi.NullSimilarFilesContextService)),s.define(h4r.IEndpointProvider,new c4r);let c=new Wv.InMemoryConfigProvider(new Wv.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(Wv.ICompletionsConfigProvider,c),s.seal()}a(dRc,"setupServices");var u1t=class extends qwc.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)}},c4r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=s3e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},iie=class extends p1t.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new s3e.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()}};eu.SimpleExperimentationService=iie;eu.SimpleExperimentationService=iie=d4r([bN(1,DL.IConfigurationService)],iie);var d1t=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=s3e.Event.None,this.onDidCompleteFetch=s3e.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 g4r.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)}},f1t=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,lQi.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,lQi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function fRc(t){return t.tokenizerProvider&&(0,fQi.setExternalTokenizerProvider)(t.tokenizerProvider),pRc(t).createInstance(l4r)}a(fRc,"createInlineCompletionsProvider");var l4r=class extends p1t.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(Swc.GhostText)}updateTreatmentVariables(e){this._expService instanceof iie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=DL.globalConfigRegistry.configs.get(`${DL.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 o4r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??cRc.CancellationToken.None,o,new ywc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};l4r=d4r([bN(0,CQi.IInstantiationService),bN(1,a3e.IExperimentationService),bN(2,i4r.ICompletionsSpeculativeRequestCache),bN(3,SN.ILogService),bN(4,DL.IConfigurationService),bN(5,Wv.ICompletionsConfigProvider)],l4r);var u4r=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,aRc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function pRc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new SN.ConsoleLog(void 0,SN.LogLevel.Trace),f=new vQi.InstantiationServiceBuilder;f.define(n3e.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case n3e.LogLevel.DEBUG:return nie.Debug;case n3e.LogLevel.INFO:return nie.Info;case n3e.LogLevel.WARN:return nie.Warning;case n3e.LogLevel.ERROR:return nie.Error;default:return nie.Info}}}),f.define(f4r.IAuthenticationService,r),f.define(SN.ILogService,new gi.SyncDescriptor(SN.LogServiceImpl,[[d||new SN.ConsoleLog(void 0,SN.LogLevel.Trace)]])),f.define(o3e.IIgnoreService,t.ignoreService||new o3e.NullIgnoreService),f.define(_Qi.ITelemetryService,new gi.SyncDescriptor(f1t,[new u4r(c)])),f.define(DL.IConfigurationService,new gi.SyncDescriptor(u1t,[t.configOverrides??new Map])),f.define(a3e.IExperimentationService,new gi.SyncDescriptor(iie,[t.waitForTreatmentVariables])),f.define(h4r.IEndpointProvider,t.endpointProvider),f.define(p4r.ICAPIClientService,t.capiClientService||new gi.SyncDescriptor(pQi.CAPIClientImpl)),f.define(g4r.IFetcherService,new gi.SyncDescriptor(d1t,[e])),f.define(M7i.ICompletionsTelemetryService,new gi.SyncDescriptor(M7i.CompletionsTelemetryServiceBridge)),f.define(tQi.ICompletionsRuntimeModeService,tQi.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(q7i.ICompletionsCacheService,new q7i.CompletionsCache);let h=new Wv.InMemoryConfigProvider(new Wv.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(Wv.ICompletionsConfigProvider,h),f.define(G7i.ICompletionsLastGhostText,new G7i.LastGhostText),f.define(H7i.ICompletionsCurrentGhostText,new H7i.CurrentGhostText),f.define(i4r.ICompletionsSpeculativeRequestCache,new i4r.SpeculativeRequestCache),f.define(xwc.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(O7i.ICompletionsExtensionStatus,new O7i.CopilotExtensionStatus),f.define(Cwc.ICompletionsFeaturesService,new gi.SyncDescriptor(vwc.Features)),f.define(_wc.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(W7i.ICompletionsStatusReporter,new class extends W7i.StatusReporter{didChange(m){n.didChange(m)}}),f.define(L7i.ICompletionsCopilotTokenManager,new gi.SyncDescriptor(L7i.CopilotTokenManagerImpl,[!1])),f.define(X7i.ICompletionsTextDocumentManagerService,new gi.SyncDescriptor(class extends X7i.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(U7i.ICompletionsFileReaderService,new gi.SyncDescriptor(U7i.FileReader)),f.define(j7i.ICompletionsBlockModeConfig,new gi.SyncDescriptor(j7i.ConfigBlockModeConfig)),f.define(Z7i.ICompletionsTelemetryUserConfigService,new gi.SyncDescriptor(Z7i.TelemetryUserConfig)),f.define(J7i.ICompletionsRecentEditsProviderService,new gi.SyncDescriptor(J7i.FullRecentEditsProvider,[void 0])),f.define(B7i.ICompletionsNotifierService,new gi.SyncDescriptor(B7i.CompletionNotifier)),f.define($7i.ICompletionsOpenAIFetcherService,new gi.SyncDescriptor($7i.LiveOpenAIFetcher)),f.define(eRc.ICompletionsFetchService,new gi.SyncDescriptor(tRc.CompletionsFetchService)),f.define(V7i.ICompletionsModelManagerService,new gi.SyncDescriptor(V7i.AvailableModelsManager,[!0])),f.define(Q7i.ICompletionsAsyncManagerService,new gi.SyncDescriptor(Q7i.AsyncCompletionManager)),f.define(Y7i.ICompletionsContextProviderBridgeService,new gi.SyncDescriptor(Y7i.ContextProviderBridge)),f.define(F7i.ICompletionsUserErrorNotifierService,new gi.SyncDescriptor(F7i.UserErrorNotifier)),f.define(Rwc.ICompletionsRelatedFilesProviderService,new gi.SyncDescriptor(wwc.CompositeRelatedFilesProvider)),f.define(bwc.ICompletionsFileSystemService,new Twc.LocalFileSystem),f.define(i3e.ICompletionsContextProviderRegistryService,new gi.SyncDescriptor(i3e.CachedContextProviderRegistry,[i3e.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(eQi.ICompletionsPromiseQueueService,new eQi.PromiseQueue),f.define(Ewc.ICompletionsCitationManager,new class{register(){return p1t.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(K7i.ICompletionsContextProviderService,new K7i.ContextProviderStatistics),f.define(z7i.ICompletionsPromptFactoryService,new gi.SyncDescriptor(z7i.CompletionsPromptFactory)),f.define(Iwc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(i3e.ICompletionsDefaultContextProviders,new i3e.DefaultContextProvidersContainer),f.define(rie.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=s3e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?rie.OperatingSystem.Macintosh:process.platform==="win32"?rie.OperatingSystem.Windows:rie.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 rie.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new rie.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(m4r.ILanguageContextProviderService,t.languageContextProvider??new mQi.NullLanguageContextProviderService),f.define(gQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(AQi.TestLanguageDiagnosticsService)),f.define(yQi.IRequestLogger,new gi.SyncDescriptor(EQi.NullRequestLogger)),f.seal()}a(pRc,"setupCompletionServices")});function qt(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 C1=ve(()=>{p();a(qt,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var bEe,L1t=ve(()=>{p();bEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return bEe=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 b9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var m3e,SEe=ve(()=>{p();a(b9,"isAbortError");m3e=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,Sh,Iy,RV,TEe,IEe,xEe,wEe,REe,kEe,PEe,DEe,NEe,Uf=ve(()=>{p();SEe();fr=class extends Error{static{a(this,"AnthropicError")}},Sh=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 RV({message:n,cause:m3e(r)});let s=r,c=s?.error?.type;return e===400?new IEe(e,s,n,o,c):e===401?new xEe(e,s,n,o,c):e===403?new wEe(e,s,n,o,c):e===404?new REe(e,s,n,o,c):e===409?new kEe(e,s,n,o,c):e===422?new PEe(e,s,n,o,c):e===429?new DEe(e,s,n,o,c):e>=500?new NEe(e,s,n,o,c):new t(e,s,n,o,c)}},Iy=class extends Sh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},RV=class extends Sh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},TEe=class extends RV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},IEe=class extends Sh{static{a(this,"BadRequestError")}},xEe=class extends Sh{static{a(this,"AuthenticationError")}},wEe=class extends Sh{static{a(this,"PermissionDeniedError")}},REe=class extends Sh{static{a(this,"NotFoundError")}},kEe=class extends Sh{static{a(this,"ConflictError")}},PEe=class extends Sh{static{a(this,"UnprocessableEntityError")}},DEe=class extends Sh{static{a(this,"RateLimitError")}},NEe=class extends Sh{static{a(this,"InternalServerError")}}});function B1t(t){return typeof t!="object"?{}:t??{}}function nLr(t){if(!t)return!0;for(let e in t)return!1;return!0}function iji(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d2c,nji,r_,rLr,oji,F1t,ML=ve(()=>{p();Uf();d2c=/^[a-z][a-z0-9+.-]*:/i,nji=a(t=>d2c.test(t),"isAbsoluteURL"),r_=a(t=>(r_=Array.isArray,r_(t)),"isArray"),rLr=r_;a(B1t,"maybeObj");a(nLr,"isEmptyObj");a(iji,"hasOwn");oji=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"),F1t=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var wN,MEe=ve(()=>{p();wN=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 rk,g3e=ve(()=>{p();rk="0.98.0"});function f2c(){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 h2c(){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 lji,p2c,sji,aji,cji,A3e,U1t=ve(()=>{p();g3e();lji=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(f2c,"getDetectedPlatform");p2c=a(()=>{let t=f2c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"X-Stainless-OS":aji(Deno.build.os),"X-Stainless-Arch":sji(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":rk,"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":rk,"X-Stainless-OS":aji(globalThis.process.platform??"unknown"),"X-Stainless-Arch":sji(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=h2c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":rk,"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":rk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(h2c,"getBrowserInfo");sji=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),aji=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"),A3e=a(()=>cji??(cji=p2c()),"getPlatformHeaders")});function uji(){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 iLr(...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 Q1t(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return iLr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function y3e(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 dji(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 OEe=ve(()=>{p();a(uji,"getDefaultFetch");a(iLr,"makeReadableStream");a(Q1t,"ReadableStreamFrom");a(y3e,"ReadableStreamToAsyncIterable");a(dji,"CancelReadableStream")});var fji,pji=ve(()=>{p();fji=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var oLr,sLr,aLr,hji,cLr=ve(()=>{p();oLr="RFC3986",sLr=a(t=>String(t),"default_formatter"),aLr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:sLr},hji="RFC1738"});function gji(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function uLr(t,e){if(r_(t)){let r=[];for(let n=0;n{p();cLr();ML();q1t=a((t,e)=>(q1t=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),q1t(t,e)),"has"),OL=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),lLr=1024,mji=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=lLr?s.slice(l,l+lLr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===hji&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=OL[h];continue}if(h<2048){d[d.length]=OL[192|h>>6]+OL[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=OL[224|h>>12]+OL[128|h>>6&63]+OL[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=OL[240|h>>18]+OL[128|h>>12&63]+OL[128|h>>6&63]+OL[128|h&63]}c+=d.join("")}return c},"encode");a(gji,"is_buffer");a(uLr,"maybe_map")});function A2c(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function vji(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(dLr))!==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(dLr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&r_(v)&&(v=uLr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,B0.encoder,E,"key",g):e;v=""}if(A2c(v)||gji(v)){if(u){let N=y?e:u(e,B0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,B0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&r_(v))y&&u&&(v=uLr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(r_(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&&r_(v)&&v.length===1?P+"[]":P;if(o&&r_(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:B0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:B0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:B0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:B0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?B0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:B0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:B0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:B0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:B0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:B0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:B0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:B0.strictNullHandling}}function Cji(t,e={}){let r=t,n=y2c(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):r_(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=Eji[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 Eji,_ji,yji,B0,dLr,bji=ve(()=>{p();Aji();cLr();ML();Eji={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},_ji=a(function(t,e){Array.prototype.push.apply(t,r_(e)?e:[e])},"push_to_array"),B0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:mji,encodeValuesOnly:!1,format:oLr,formatter:sLr,indices:!1,serializeDate(t){return(yji??(yji=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(A2c,"is_non_nullish_primitive");dLr={};a(vji,"inner_stringify");a(y2c,"normalize_stringify_options");a(Cji,"stringify")});function Sji(t){return Cji(t,{arrayFormat:"brackets"})}var fLr=ve(()=>{p();bji();a(Sji,"stringifyQuery")});function H1t(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Wc(`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 Wc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function G1t(t,e){let r=await v2c(t),n;try{n=JSON.parse(r)}catch{throw new Wc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,b1(r),e)}if(!n.access_token)throw new Wc(`Token endpoint response missing access_token: ${JSON.stringify(b1(n))}`,t.status,b1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Wc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,b1(n),e);return n}function b1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=pLr?t:t.slice(0,pLr)+`... <${t.length-pLr} more chars>`}return JSON.stringify(b1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))_2c.has(r)&&(e[r]=n);return e}return null}async function $1t(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 Wc(`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 Wc(`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 V1t(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 v2c(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>Tji){let l=Tji-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 Iji,xji,j1t,uie,wji,Rji,LEe,kji,Tji,pLr,_2c,Wc,BEe=ve(()=>{p();Uf();Iji="urn:ietf:params:oauth:grant-type:jwt-bearer",xji="refresh_token",j1t="/v1/oauth/token",uie="oauth-2025-04-20",wji="oidc-federation-2026-04-01",Rji=120,LEe=30,kji=5,Tji=1<<20;a(H1t,"requireSecureTokenEndpoint");a(G1t,"parseTokenResponse");pLr=2e3,_2c=new Set(["error","error_description","error_uri"]);a(b1,"redactSensitive");a($1t,"checkCredentialsFileSafety");a(V1t,"writeCredentialsFileAtomic");a(v2c,"readLimitedText");Wc=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 RN(){return Math.floor(Date.now()/1e3)}var E3e=ve(()=>{p();a(RN,"nowAsSeconds")});var W1t,Pji=ve(()=>{p();BEe();E3e();W1t=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-RN();return n>Rji?r.token:n>LEe?(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||RN()-this.lastAdvisoryError{this.lastAdvisoryError=RN(),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 va,_3e=ve(()=>{p();va=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 Mji(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 FEe(t){let e;return(Dji??(e=new globalThis.TextEncoder,Dji=e.encode.bind(e)))(t)}function hLr(t){let e;return(Nji??(e=new globalThis.TextDecoder,Nji=e.decode.bind(e)))(t)}var Dji,Nji,z1t=ve(()=>{p();a(Mji,"concatBytes");a(FEe,"encodeUTF8");a(hLr,"decodeUTF8")});var Oji=ve(()=>{p();Uf();z1t()});function v3e(){}function Y1t(t,e,r){return!e||K1t[t]>K1t[r]?v3e:e[t].bind(e)}function Al(t){let e=t.logger,r=t.logLevel??"off";if(!e)return C2c;let n=Lji.get(e);if(n&&n[0]===r)return n[1];let o={error:Y1t("error",e,r),warn:Y1t("warn",e,r),info:Y1t("info",e,r),debug:Y1t("debug",e,r)};return Lji.set(e,[r,o]),o}var K1t,mLr,C2c,Lji,S9,T9=ve(()=>{p();ML();K1t={off:0,error:200,warn:300,info:400,debug:500},mLr=a((t,e,r)=>{if(t){if(iji(K1t,t))return t;Al(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(K1t))}`)}},"parseLogLevel");a(v3e,"noop");a(Y1t,"makeLogFn");C2c={error:v3e,warn:v3e,info:v3e,debug:v3e},Lji=new WeakMap;a(Al,"loggerFor");S9=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 gLr=ve(()=>{p();ML();Oji();_3e();T9();L1t();MEe();fLr()});function Bji(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(!b2c.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var J1t,b2c,Fji,Uji,ALr,S2c,Qji,yLr=ve(()=>{p();U1t();gLr();J1t="1.0",b2c=/^[A-Za-z0-9_.-]+$/;a(Bji,"validateProfileName");Fji=a(async t=>{var e,r;let n=await ALr();if(n===null)return null;let o=t??await Qji();if(o===null)return null;Bji(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=va("ANTHROPIC_ORGANIZATION_ID"),m=va("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=va("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:va("ANTHROPIC_WORKSPACE_ID"),base_url:va("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:va("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:va("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=va("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=va("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=va("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=va("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=va("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=va("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=va("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Uji=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await ALr();if(!r)return null;let n=e??await Qji();return n?(Bji(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),ALr=a(async()=>{if(!S2c())return null;let t=await import("node:path"),e=va("ANTHROPIC_CONFIG_DIR");if(e)return e;if(A3e()["X-Stainless-OS"]==="Windows"){let s=va("APPDATA");if(s)return t.join(s,"Anthropic");let c=va("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=va("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=va("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),S2c=a(()=>{let t=A3e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),Qji=a(async()=>{let t=await ALr();if(!t)return null;let e=va("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 ELr(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 qji(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var jji=ve(()=>{p();Uf();a(ELr,"identityTokenFromFile");a(qji,"identityTokenFromValue")});function Hji(t){return async()=>{H1t(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Wc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:Iji,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}${j1t}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${uie},${wji}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${rk} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Wc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=b1(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 Wc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await G1t(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Wc(`Token endpoint response missing required fields: ${JSON.stringify(b1(c))}`,o.status,b1(c),s);return{token:c.access_token,expiresAt:RN()+l}}}var Gji=ve(()=>{p();BEe();E3e();g3e();a(Hji,"oidcFederationProvider")});function $ji(t){return async e=>{let r=await import("node:fs");await $1t(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Wc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Wc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Wc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||RN()"");throw new Wc(`User OAuth refresh failed (HTTP ${f.status}): ${b1(E)}`,f.status,b1(E),h)}let m=await G1t(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Wc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(b1(m))}`,f.status,b1(m),h);let A=RN()+g,y=m.refresh_token||l;return await V1t(t.credentialsPath,{...o,version:J1t,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var Vji=ve(()=>{p();yLr();BEe();E3e();g3e();a($ji,"userOAuthProvider")});function _Lr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=T2c(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 Wji(t,e){let r=await Fji(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 Uji(n,e)??void 0}};return _Lr(s,t)}function T2c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=I2c(o);if(!s)throw new Wc("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 Wc("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 Wc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=Hji({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?x2c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Wc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return $ji({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 Wc(`authentication.type "${o}" is not a known authentication type`)}}}function I2c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Wc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Wc('identity_token.source "file" requires a non-empty path');return ELr(t.identity_token.path)}let e=va("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return ELr(e);let r=va("ANTHROPIC_IDENTITY_TOKEN");return r?qji(r):null}function x2c(t,e,r,n){return async o=>{let s=await import("node:fs");await $1t(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||RN(){p();_3e();yLr();BEe();E3e();jji();Gji();Vji();a(_Lr,"resolveCredentialsFromConfig");a(Wji,"defaultCredentials");a(T2c,"buildProvider");a(I2c,"resolveIdentityTokenProvider");a(x2c,"cachedExchangeProvider")});function w2c(t,e){for(let o=e??0;o{p();C1();z1t();I9=class{static{a(this,"LineDecoder")}constructor(){_I.set(this,void 0),vI.set(this,void 0),qt(this,_I,new Uint8Array,"f"),qt(this,vI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?FEe(e):e;qt(this,_I,Mji([xe(this,_I,"f"),r]),"f");let n=[],o;for(;(o=w2c(xe(this,_I,"f"),xe(this,vI,"f")))!=null;){if(o.carriage&&xe(this,vI,"f")==null){qt(this,vI,o.index,"f");continue}if(xe(this,vI,"f")!=null&&(o.index!==xe(this,vI,"f")+1||o.carriage)){n.push(hLr(xe(this,_I,"f").subarray(0,xe(this,vI,"f")-1))),qt(this,_I,xe(this,_I,"f").subarray(xe(this,vI,"f")),"f"),qt(this,vI,null,"f");continue}let s=xe(this,vI,"f")!==null?o.preceding-1:o.preceding,c=hLr(xe(this,_I,"f").subarray(0,s));n.push(c),qt(this,_I,xe(this,_I,"f").subarray(o.index),"f"),qt(this,vI,null,"f")}return n}flush(){return xe(this,_I,"f").length?this.decode(` +`):[]}};_I=new WeakMap,vI=new WeakMap;I9.NEWLINE_CHARS=new Set([` +`,"\r"]);I9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(w2c,"findNewlineIndex");a(Yji,"findDoubleNewlineIndex")});async function*R2c(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 CLr,n=new I9,o=y3e(t.body);for await(let s of k2c(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*k2c(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"?FEe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=Yji(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function P2c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var C3e,LL,CLr,bLr=ve(()=>{p();C1();Uf();OEe();vLr();OEe();SEe();ML();z1t();T9();Uf();LL=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,C3e.set(this,void 0),this.controller=r,qt(this,C3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?Al(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 R2c(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=F1t(u.data)??u.data,f=d?.error?.type;throw new Sh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(b9(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 I9,u=y3e(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(b9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(C3e=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,C3e,"f")),new t(()=>o(r),this.controller,xe(this,C3e,"f"))]}toReadableStream(){let e=this,r;return iLr({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=FEe(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(R2c,"_iterSSEMessages");a(k2c,"iterSSEChunks");CLr=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]=P2c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(P2c,"partition")});async function Z1t(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return Al(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):LL.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 SLr(m,r)}return await r.text()})();return Al(t).debug(`[${n}] response parsed`,S9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function SLr(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 TLr=ve(()=>{p();bLr();T9();a(Z1t,"defaultParseResponse");a(SLr,"addRequestID")});var b3e,die,X1t=ve(()=>{p();C1();TLr();die=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=Z1t){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,b3e.set(this,void 0),qt(this,b3e,e,"f")}_thenUnwrap(e){return new t(xe(this,b3e,"f"),this.responsePromise,async(r,n)=>SLr(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,b3e,"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)}};b3e=new WeakMap});var eSt,tSt,S3e,nk,Ca,Cd=ve(()=>{p();C1();Uf();TLr();X1t();ML();tSt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){eSt.set(this,void 0),qt(this,eSt,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,eSt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(eSt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},S3e=class extends die{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await Z1t(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},nk=class extends tSt{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:{...B1t(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...B1t(this.options.query),after_id:e}}:null}},Ca=class extends tSt{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:{...B1t(this.options.query),page:e}}:null}}});function fie(t,e,r){return xLr(),new File(t,e??"unknown_file",r)}function T3e(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 N2c(t){let e=typeof t=="function"?t:t.fetch,r=Kji.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 Kji.set(e,n),n}var xLr,wLr,UEe,Kji,M2c,O2c,ILr,QEe=ve(()=>{p();OEe();xLr=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(fie,"makeFile");a(T3e,"getName");wLr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),UEe=a(async(t,e,r=!0)=>({...t,body:await M2c(t.body,e,r)}),"multipartFormRequestOptions"),Kji=new WeakMap;a(N2c,"supportsFormData");M2c=a(async(t,e,r=!0)=>{if(!await N2c(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])=>ILr(n,o,s,r))),n},"createForm"),O2c=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),ILr=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,fie([await r.blob()],T3e(r,n),o))}else if(wLr(r))t.append(e,fie([await new Response(Q1t(r)).blob()],T3e(r,n)));else if(O2c(r))t.append(e,fie([r],T3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>ILr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>ILr(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 rSt(t,e,r){if(xLr(),t=await t,e||(e=T3e(t,!0)),L2c(t))return t instanceof File&&e==null&&r==null?t:fie([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(B2c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),fie(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 fie(n,e,r)}async function RLr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Jji(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(wLr(t))for await(let r of t)e.push(...await RLr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${F2c(t)}`)}return e}function F2c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var Jji,L2c,B2c,Zji=ve(()=>{p();QEe();QEe();Jji=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"),L2c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Jji(t),"isFileLike"),B2c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(rSt,"toFile");a(RLr,"getBytes");a(F2c,"propsForError")});var kLr=ve(()=>{p();Zji()});var Xji=ve(()=>{p()});var Ai,Ql=ve(()=>{p();Ai=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*Q2c(t){if(!t)return;if(eHi 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():rLr(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=rLr(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 eHi,_t,vc=ve(()=>{p();ML();eHi=Symbol.for("brand.privateNullableHeaders");a(Q2c,"iterateHeaders");_t=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of Q2c(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{[eHi]:!0,values:e,nulls:r}},"buildHeaders")});function nSt(t){return typeof t=="object"&&t!==null&&I3e in t}function PLr(t,e){let r=new Set;if(t)for(let n of t)nSt(n)&&r.add(n[I3e]);if(e){for(let n of e)if(nSt(n)&&r.add(n[I3e]),Array.isArray(n.content))for(let o of n.content)nSt(o)&&r.add(o[I3e])}return Array.from(r)}function iSt(t,e){let r=PLr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function tHi(t){return nSt(t)?{"x-stainless-helper":t[I3e]}:{}}var I3e,x3e=ve(()=>{p();I3e=Symbol("anthropic.sdk.stainlessHelper");a(nSt,"wasCreatedByStainlessHelper");a(PLr,"collectStainlessHelpers");a(iSt,"stainlessHelperHeader");a(tHi,"stainlessHelperHeaderFromFile")});function nHi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var rHi,q2c,or,Qf=ve(()=>{p();Uf();a(nHi,"encodeURIPath");rHi=Object.freeze(Object.create(null)),q2c=a((t=nHi)=>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??rHi)??rHi)?.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"),or=b2c(Wji)});var UEe,wLr=ve(()=>{p();Ul();_d();vc();C3e();FEe();Ff();UEe=class extends Ai{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",tk,{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(or`/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(or`/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(or`/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",BEe({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},$ji(o.file),r?.headers])},this._client))}}});var QEe,RLr=ve(()=>{p();Ul();_d();vc();Ff();QEe=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/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",tk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var qEe,kLr=ve(()=>{p();Ul();_d();vc();Ff();qEe=class extends Ai{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(or`/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(or`/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",va,{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(or`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var Yji=I(tSt=>{"use strict";p();Object.defineProperty(tSt,"__esModule",{value:!0});tSt.timingSafeEqual=void 0;function zji(t,e=""){if(!t)throw new Error(e)}a(zji,"assert");function x2c(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)),zji(t instanceof DataView),zji(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var w2c=_I&&_I.__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(_I,"__esModule",{value:!0});var Um=256,PLr=(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&Um,l|=d&Um,l|=f&Um,l|=h&Um;if(c>>4,l|=u&Um,l|=d&Um),c>>2,l|=f&Um),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=Um;return r+=(42-e&e-44)>>>8&-Um+e-43+62,r+=(46-e&e-48)>>>8&-Um+e-47+63,r+=(47-e&e-58)>>>8&-Um+e-48+52,r+=(64-e&e-91)>>>8&-Um+e-65+0,r+=(96-e&e-123)>>>8&-Um+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})();_I.Coder=PLr;var b3e=new PLr;function R2c(t){return b3e.encode(t)}a(R2c,"encode");_I.encode=R2c;function k2c(t){return b3e.decode(t)}a(k2c,"decode");_I.decode=k2c;var Kji=(function(t){w2c(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=Um;return n+=(44-r&r-46)>>>8&-Um+r-45+62,n+=(94-r&r-96)>>>8&-Um+r-95+63,n+=(47-r&r-58)>>>8&-Um+r-48+52,n+=(64-r&r-91)>>>8&-Um+r-65+0,n+=(96-r&r-123)>>>8&-Um+r-97+26,n},e})(PLr);_I.URLSafeCoder=Kji;var Jji=new Kji;function P2c(t){return Jji.encode(t)}a(P2c,"encodeURLSafe");_I.encodeURLSafe=P2c;function D2c(t){return Jji.decode(t)}a(D2c,"decodeURLSafe");_I.decodeURLSafe=D2c;_I.encodedLength=function(t){return b3e.encodedLength(t)};_I.maxDecodedLength=function(t){return b3e.maxDecodedLength(t)};_I.decodedLength=function(t){return b3e.decodedLength(t)}});var eHi=I((Xji,rSt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof rSt=="object"&&typeof rSt.exports=="object"?rSt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(Xji,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,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++)P=h[D-2],L=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],B=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>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(jEe,"__esModule",{value:!0});jEe.Webhook=jEe.WebhookVerificationError=void 0;var N2c=Yji(),tHi=Zji(),M2c=eHi(),rHi=300,DLr=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}},IV=class t extends DLr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};jEe.WebhookVerificationError=IV;var nSt=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=tHi.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 IV("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,N2c.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new IV("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,${tHi.encode(M2c.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new IV("Invalid Signature Headers");if(r-n>rHi)throw new IV("Message timestamp too old");if(n>r+rHi)throw new IV("Message timestamp too new");return new Date(n*1e3)}};jEe.Webhook=nSt;nSt.prefix="whsec_"});var iHi,HEe,NLr=ve(()=>{p();Ul();iHi=de(nHi(),1),HEe=class extends Ai{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 iHi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var GEe,MLr=ve(()=>{p();Ul();_d();vc();Ff();GEe=class extends Ai{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var fie,OLr=ve(()=>{p();Ul();MLr();MLr();_d();vc();Ff();fie=class extends Ai{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new GEe(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(or`/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(or`/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",va,{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(or`/v1/agents/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fie.Versions=GEe});function pie(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 iSt=ve(()=>{p();a(pie,"linkAbort")});function xV(t,e){return t instanceof Ch&&t.status===e}function oHi(t){return t instanceof Ch&&typeof t.status=="number"&&t.status>=400&&t.status<500}function wV(t){return oHi(t)&&!xV(t,408)&&!xV(t,409)&&!xV(t,429)}function sHi(t,e,r){return Math.min(e*2**t,r)}function LLr(t,e){return t+Math.random()*(e-t)}function aHi(t){return t*(1-Math.random()*.25)}var S3e=ve(()=>{p();Bf();a(xV,"isStatus");a(oHi,"is4xx");a(wV,"isFatal4xx");a(sHi,"backoff");a(LLr,"jitter");a(aHi,"applyJitter")});function oSt(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 BLr=ve(()=>{p();Bf();vc();a(oSt,"copyClientForHelper")});function q2c(t){return sHi(t,U2c,Q2c)}function j2c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${vEe()}`:vEe()}var $Ee,sSt,rk,aSt,cSt,lSt,T3e,I3e,VEe,F2c,U2c,Q2c,RV,uSt=ve(()=>{p();C1();Bf();b9();DEe();D1t();iSt();vc();S3e();BLr();S3e();F2c=999,U2c=1e3,Q2c=6e4,RV=class{static{a(this,"WorkPoller")}constructor(e){$Ee.set(this,void 0),sSt.set(this,!1),rk.set(this,void 0),aSt.set(this,void 0),cSt.set(this,void 0),lSt.set(this,void 0),T3e.set(this,void 0),I3e.set(this,void 0),VEe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??j2c(),qt(this,$Ee,oSt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,cSt,e.autoStop??!0,"f"),qt(this,lSt,e.drain??!1,"f"),qt(this,T3e,e.blockMs===void 0?F2c:e.blockMs,"f"),qt(this,I3e,e.reclaimOlderThanMs??null,"f"),qt(this,VEe,e.requestOptions,"f"),qt(this,rk,new AbortController,"f"),qt(this,aSt,pie(e.signal,xe(this,rk,"f")),"f")}get signal(){return xe(this,rk,"f").signal}abort(){xe(this,rk,"f").abort()}async*[($Ee=new WeakMap,sSt=new WeakMap,rk=new WeakMap,aSt=new WeakMap,cSt=new WeakMap,lSt=new WeakMap,T3e=new WeakMap,I3e=new WeakMap,VEe=new WeakMap,Symbol.asyncIterator)](){if(xe(this,sSt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");qt(this,sSt,!0,"f");let e=gl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,rk,"f").signal.aborted;){let n;try{n=await xe(this,$Ee,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,T3e,"f")!==null?{block_ms:xe(this,T3e,"f")}:{},...xe(this,I3e,"f")!==null?{reclaim_older_than_ms:xe(this,I3e,"f")}:{}},{headers:vt([xe(this,VEe,"f")?.headers]),signal:xe(this,rk,"f").signal})}catch(o){if(xe(this,rk,"f").signal.aborted)return;if(wV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=aHi(q2c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await TN(s,xe(this,rk,"f").signal);continue}if(r=0,n==null){if(xe(this,lSt,"f"))return;await TN(LLr(1e3,3e3),xe(this,rk,"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,$Ee,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,VEe,"f")?.headers]),signal:xe(this,rk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,cSt,"f"))try{await xe(this,$Ee,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,VEe,"f")?.headers])})}catch(o){xV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,aSt,"f").call(this)}}};a(q2c,"backoff");a(j2c,"defaultWorkerId")});var WEe,kV,zEe,dSt,cHi=ve(()=>{p();C1();dSt=class{static{a(this,"AsyncQueue")}constructor(){WEe.set(this,[]),kV.set(this,[]),zEe.set(this,!1)}push(e){if(xe(this,zEe,"f"))return!1;let r=xe(this,kV,"f").shift();return r?r({done:!1,value:e}):xe(this,WEe,"f").push(e),!0}close(){if(!xe(this,zEe,"f"))for(qt(this,zEe,!0,"f");xe(this,kV,"f").length>0;)xe(this,kV,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,WEe,"f").length>0?Promise.resolve({done:!1,value:xe(this,WEe,"f").shift()}):xe(this,zEe,"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,kV,"f").indexOf(n);s>=0&&xe(this,kV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,kV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,WEe,"f").shift()}};WEe=new WeakMap,kV=new WeakMap,zEe=new WeakMap});var _o,hie=ve(()=>{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 FLr(t){return"name"in t?t.name:t.mcp_server_name}function H2c(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function lHi(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:H2c(n),isError:!0}}}var uHi=ve(()=>{p();hie();a(FLr,"toolName");a(H2c,"toolErrorContent");a(lHi,"runRunnableTool")});function AHi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function Y2c(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 K2c(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 B0,fSt,Iy,pSt,w3e,mSt,r_,YEe,LL,mie,T9,R3e,KEe,hSt,yHi,dHi,fHi,pHi,ULr,x3e,QLr,hHi,EHi,G2c,mHi,$2c,V2c,W2c,gHi,z2c,PV,gSt=ve(()=>{p();C1();Bf();b9();DEe();S3e();iSt();cHi();vc();uHi();G2c="SessionToolRunner",mHi=500,$2c=1e4,V2c=12e4,W2c=3e4,gHi=3,z2c=6e4;a(AHi,"isEndTurnIdle");PV=class{static{a(this,"SessionToolRunner")}constructor(e,r){B0.add(this),fSt.set(this,!1),Iy.set(this,void 0),pSt.set(this,void 0),w3e.set(this,void 0),mSt.set(this,void 0),r_.set(this,void 0),YEe.set(this,new Set),LL.set(this,new Set),mie.set(this,new dSt),T9.set(this,0),R3e.set(this,null),KEe.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??z2c,qt(this,r_,gl(r.client),"f"),qt(this,mSt,new Map(r.tools.map(n=>[FLr(n),n])),"f"),qt(this,Iy,new AbortController,"f"),qt(this,pSt,pie(r.signal,xe(this,Iy,"f")),"f"),qt(this,w3e,r.requestOptions,"f")}get signal(){return xe(this,Iy,"f").signal}abort(){xe(this,Iy,"f").abort()}async*[(fSt=new WeakMap,Iy=new WeakMap,pSt=new WeakMap,w3e=new WeakMap,mSt=new WeakMap,r_=new WeakMap,YEe=new WeakMap,LL=new WeakMap,mie=new WeakMap,T9=new WeakMap,R3e=new WeakMap,KEe=new WeakMap,B0=new WeakSet,Symbol.asyncIterator)](){if(xe(this,fSt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");qt(this,fSt,!0,"f"),xe(this,r_,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,B0,"m",yHi).call(this).catch(r=>{xe(this,Iy,"f").signal.aborted||xe(this,r_,"f").error("stream loop failed",{error:String(r)}),xe(this,Iy,"f").abort()});try{for(;;){let n=await xe(this,mie,"f").next(xe(this,Iy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,mie,"f").tryShift())!==void 0;)yield r}finally{xe(this,Iy,"f").abort(),xe(this,B0,"m",x3e).call(this),await e;try{await xe(this,B0,"m",EHi).call(this)}catch(r){xe(this,r_,"f").warn("drain failed",{error:String(r)})}xe(this,mie,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,r_,"f").warn("tool.close failed",{tool:FLr(r),error:String(n)})}xe(this,pSt,"f").call(this)}}};hSt=a(function(){return{...xe(this,w3e,"f"),headers:vt([{"x-stainless-helper":G2c},xe(this,w3e,"f")?.headers]),signal:xe(this,Iy,"f").signal}},"_SessionToolRunner_requestOptions"),yHi=a(async function(){let e=xe(this,Iy,"f"),r=mHi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,B0,"m",hSt).call(this));await xe(this,B0,"m",dHi).call(this);for await(let o of n)if(r=mHi,await xe(this,B0,"m",pHi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),wV(n))throw xe(this,r_,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,r_,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await TN(r,e.signal),r=Math.min(r*2,$2c)}},"_SessionToolRunner_streamLoop"),dHi=a(async function(){let e=xe(this,Iy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,B0,"m",hSt).call(this)))xe(this,B0,"m",fHi).call(this,s,r),n=AHi(s)}catch(s){e.signal.throwIfAborted(),xe(this,r_,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,YEe,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,LL,"f").has(s.id));n&&o.length===0?xe(this,B0,"m",ULr).call(this):xe(this,B0,"m",x3e).call(this);for(let s of o)await xe(this,B0,"m",QLr).call(this,s)},"_SessionToolRunner_reconcile"),fHi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,YEe,"f").add(e.id),xe(this,LL,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,LL,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,LL,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),pHi=a(async function(e){switch(AHi(e)?xe(this,B0,"m",ULr).call(this):xe(this,B0,"m",x3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,YEe,"f").has(e.id)||(xe(this,YEe,"f").add(e.id),await xe(this,B0,"m",QLr).call(this,e)),!1;case"user.tool_result":return xe(this,LL,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,LL,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,r_,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,Iy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),ULr=a(function(){xe(this,B0,"m",x3e).call(this),!(this.maxIdleMs<=0)&&qt(this,KEe,setTimeout(()=>{xe(this,r_,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,Iy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),x3e=a(function(){xe(this,KEe,"f")!==void 0&&(clearTimeout(xe(this,KEe,"f")),qt(this,KEe,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),QLr=a(async function(e){var r,n;if(!xe(this,LL,"f").has(e.id)){xe(this,r_,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,T9,(r=xe(this,T9,"f"),r++,r),"f");try{let o=xe(this,mSt,"f").get(e.name);if(!o){xe(this,r_,"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,mie,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=pie(xe(this,Iy,"f").signal,l),d=setTimeout(()=>l.abort(),V2c);try{let m=await lHi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=Y2c(e,c,K2c(s)),h=await xe(this,B0,"m",hHi).call(this,f,e.id);xe(this,mie,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,T9,(n=xe(this,T9,"f"),n--,n),"f"),xe(this,T9,"f")===0&&xe(this,R3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),hHi=a(async function(e,r){let n=xe(this,Iy,"f"),o;for(let s=0;sqt(this,R3e,e,"f")),TN(W2c)]),qt(this,R3e,null,"f"),xe(this,T9,"f")>0&&xe(this,r_,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(Y2c,"buildResultEvent");a(K2c,"toSessionContent")});var _Hi=ve(()=>{p();fLr()});function gie(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 vHi=ve(()=>{p();qLr();_Hi();a(gie,"betaTool")});function JEe(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var jLr=ve(()=>{p();a(JEe,"promiseWithResolvers")});async function Z2c(t){try{return await vI.realpath(t)}catch{return t}}async function X2c(t){let e=[],r=t;for(;;){let n;try{n=await vI.realpath(r)}catch{let o=!1;try{o=(await vI.lstat(r)).isSymbolicLink()}catch{}if(o){r=F0.resolve(F0.dirname(r),await vI.readlink(r));continue}let s=F0.dirname(r);if(s===r)return t;e.push(F0.basename(r)),r=s;continue}return e.length?F0.join(n,...e.reverse()):n}}async function bHi(t,e,r){let n=r?.allowOutside??!1;if(F0.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return F0.resolve(e)}let o=await Z2c(F0.resolve(t)),s=F0.resolve(o,e);if(n)return s;let c=await X2c(s),l=o.endsWith(F0.sep)?o:o+F0.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function HLr(t,e){let r=F0.dirname(t),n=F0.join(r,`.tmp-${process.pid}-${(0,CHi.randomUUID)()}`),o;try{o=await vI.open(n,"wx",J2c),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await vI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await vI.unlink(n).catch(()=>{}),s}}function P3e(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 vI,F0,CHi,k3e,J2c,GLr=ve(()=>{p();vI=de(require("node:fs/promises"),1),F0=de(require("node:path"),1),CHi=require("node:crypto");hie();k3e=493,J2c=420;a(Z2c,"realpathOrSelf");a(X2c,"canonicalize");a(bHi,"confineToRoot");a(HLr,"atomicWriteFile");a(P3e,"fsErrorMessage")});async function RHi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=gl(e),o=await e.beta.sessions.retrieve(r),s=xy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await VLr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=xy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=xy.resolve(s,f);if(h!==s&&!h.startsWith(s+xy.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 S1.rm(h,{recursive:!0,force:!0}),await S1.mkdir(h,{recursive:!0,mode:k3e}),c.push(h),await WLr(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 S1.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 VLr(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 tDc(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(xy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function rDc(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 $Lr(t,e){try{let{stdout:r}=await eDc(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 nDc(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 WLr(t,e){let r=xy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,wHi.pipeline)(xHi.Readable.fromWeb(t.body),SHi.createWriteStream(r));let n=xy.join(xy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await iDc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await $Lr(c,s?["-Z1",r]:["-tf",r]);tDc(l),rDc(await $Lr(c,s?["-Z",r]:["-tvf",r]));let u=nDc(l);await S1.mkdir(n,{recursive:!0,mode:k3e}),await $Lr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?xy.join(n,u):n;for(let f of await S1.readdir(d))await S1.rename(xy.join(d,f),xy.join(e,f))}finally{await S1.rm(r,{force:!0}),await S1.rm(n,{recursive:!0,force:!0})}}async function iDc(t,e){let r=await S1.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 S1,SHi,xy,THi,IHi,xHi,wHi,eDc,kHi=ve(()=>{p();S1=de(require("node:fs/promises"),1),SHi=de(require("node:fs"),1),xy=de(require("node:path"),1),THi=require("node:child_process"),IHi=require("node:util"),xHi=require("node:stream"),wHi=require("node:stream/promises");Bf();b9();GLr();eDc=(0,IHi.promisify)(THi.execFile);a(RHi,"setupSkills");a(VLr,"resolveSkillVersion");a(tDc,"assertSafeMemberNames");a(rDc,"assertNoSpecialMembers");a($Lr,"runArchiveTool");a(nDc,"archiveTopDir");a(WLr,"extractSkillArchive");a(iDc,"readHead")});var HHi={};ki(HHi,{BashSession:()=>ySt,betaAgentToolset20260401:()=>lDc,betaBashTool:()=>BHi,betaEditTool:()=>QHi,betaGlobTool:()=>qHi,betaGrepTool:()=>jHi,betaReadTool:()=>FHi,betaWriteTool:()=>UHi,extractSkillArchive:()=>WLr,resolvePath:()=>ZEe,resolveSkillVersion:()=>VLr,setupSkills:()=>RHi});function lDc(t){return[BHi(t),FHi(t),UHi(t),QHi(t),qHi(t),jHi(t)]}function ZEe(t,e){return bHi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function uDc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function BHi(t){let e,r=Promise.resolve();return gie({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=JEe();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 ySt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??LHi,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 FHi(t){return gie({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 ZEe(t,e),o;try{let f=await n_.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>YLr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${YLr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await n_.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${P3e(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(` +${h}`)}return c},"path"),"createPathTagFunction"),or=q2c(nHi)});var qEe,DLr=ve(()=>{p();Ql();Cd();vc();x3e();QEe();Qf();qEe=class extends Ai{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",nk,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/files/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}/content?beta=true`,{...n,headers:_t([{"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(or`/v1/files/${e}?beta=true`,{...n,headers:_t([{"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",UEe({body:o,...r,headers:_t([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},tHi(o.file),r?.headers])},this._client))}}});var jEe,NLr=ve(()=>{p();Ql();Cd();vc();Qf();jEe=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}?beta=true`,{...n,headers:_t([{...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",nk,{query:o,...r,headers:_t([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var HEe,MLr=ve(()=>{p();Ql();Cd();vc();Qf();HEe=class extends Ai{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:_t([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/user_profiles/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var oHi=I(oSt=>{"use strict";p();Object.defineProperty(oSt,"__esModule",{value:!0});oSt.timingSafeEqual=void 0;function iHi(t,e=""){if(!t)throw new Error(e)}a(iHi,"assert");function $2c(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)),iHi(t instanceof DataView),iHi(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var V2c=CI&&CI.__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(CI,"__esModule",{value:!0});var qm=256,OLr=(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&qm,l|=d&qm,l|=f&qm,l|=h&qm;if(c>>4,l|=u&qm,l|=d&qm),c>>2,l|=f&qm),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=qm;return r+=(42-e&e-44)>>>8&-qm+e-43+62,r+=(46-e&e-48)>>>8&-qm+e-47+63,r+=(47-e&e-58)>>>8&-qm+e-48+52,r+=(64-e&e-91)>>>8&-qm+e-65+0,r+=(96-e&e-123)>>>8&-qm+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})();CI.Coder=OLr;var w3e=new OLr;function W2c(t){return w3e.encode(t)}a(W2c,"encode");CI.encode=W2c;function z2c(t){return w3e.decode(t)}a(z2c,"decode");CI.decode=z2c;var sHi=(function(t){V2c(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=qm;return n+=(44-r&r-46)>>>8&-qm+r-45+62,n+=(94-r&r-96)>>>8&-qm+r-95+63,n+=(47-r&r-58)>>>8&-qm+r-48+52,n+=(64-r&r-91)>>>8&-qm+r-65+0,n+=(96-r&r-123)>>>8&-qm+r-97+26,n},e})(OLr);CI.URLSafeCoder=sHi;var aHi=new sHi;function Y2c(t){return aHi.encode(t)}a(Y2c,"encodeURLSafe");CI.encodeURLSafe=Y2c;function K2c(t){return aHi.decode(t)}a(K2c,"decodeURLSafe");CI.decodeURLSafe=K2c;CI.encodedLength=function(t){return w3e.encodedLength(t)};CI.maxDecodedLength=function(t){return w3e.maxDecodedLength(t)};CI.decodedLength=function(t){return w3e.decodedLength(t)}});var uHi=I((lHi,sSt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof sSt=="object"&&typeof sSt.exports=="object"?sSt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(lHi,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,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++)P=h[D-2],L=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],B=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>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(GEe,"__esModule",{value:!0});GEe.Webhook=GEe.WebhookVerificationError=void 0;var J2c=oHi(),dHi=cHi(),Z2c=uHi(),fHi=300,LLr=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}},kV=class t extends LLr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};GEe.WebhookVerificationError=kV;var aSt=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=dHi.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 kV("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,J2c.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new kV("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,${dHi.encode(Z2c.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new kV("Invalid Signature Headers");if(r-n>fHi)throw new kV("Message timestamp too old");if(n>r+fHi)throw new kV("Message timestamp too new");return new Date(n*1e3)}};GEe.Webhook=aSt;aSt.prefix="whsec_"});var hHi,$Ee,BLr=ve(()=>{p();Ql();hHi=de(pHi(),1),$Ee=class extends Ai{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 hHi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var VEe,FLr=ve(()=>{p();Ql();Cd();vc();Qf();VEe=class extends Ai{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,Ca,{query:s,...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var pie,ULr=ve(()=>{p();Ql();FLr();FLr();Cd();vc();Qf();pie=class extends Ai{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new VEe(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(or`/v1/agents/${e}?beta=true`,{query:s,...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/agents/${e}?beta=true`,{body:s,...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/agents/${e}/archive?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pie.Versions=VEe});function hie(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 cSt=ve(()=>{p();a(hie,"linkAbort")});function PV(t,e){return t instanceof Sh&&t.status===e}function mHi(t){return t instanceof Sh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function DV(t){return mHi(t)&&!PV(t,408)&&!PV(t,409)&&!PV(t,429)}function gHi(t,e,r){return Math.min(e*2**t,r)}function QLr(t,e){return t+Math.random()*(e-t)}function AHi(t){return t*(1-Math.random()*.25)}var R3e=ve(()=>{p();Uf();a(PV,"isStatus");a(mHi,"is4xx");a(DV,"isFatal4xx");a(gHi,"backoff");a(QLr,"jitter");a(AHi,"applyJitter")});function lSt(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=_t([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var qLr=ve(()=>{p();Uf();vc();a(lSt,"copyClientForHelper")});function oDc(t){return gHi(t,nDc,iDc)}function sDc(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${bEe()}`:bEe()}var WEe,uSt,ik,dSt,fSt,pSt,k3e,P3e,zEe,rDc,nDc,iDc,NV,hSt=ve(()=>{p();C1();Uf();T9();MEe();L1t();cSt();vc();R3e();qLr();R3e();rDc=999,nDc=1e3,iDc=6e4,NV=class{static{a(this,"WorkPoller")}constructor(e){WEe.set(this,void 0),uSt.set(this,!1),ik.set(this,void 0),dSt.set(this,void 0),fSt.set(this,void 0),pSt.set(this,void 0),k3e.set(this,void 0),P3e.set(this,void 0),zEe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??sDc(),qt(this,WEe,lSt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,fSt,e.autoStop??!0,"f"),qt(this,pSt,e.drain??!1,"f"),qt(this,k3e,e.blockMs===void 0?rDc:e.blockMs,"f"),qt(this,P3e,e.reclaimOlderThanMs??null,"f"),qt(this,zEe,e.requestOptions,"f"),qt(this,ik,new AbortController,"f"),qt(this,dSt,hie(e.signal,xe(this,ik,"f")),"f")}get signal(){return xe(this,ik,"f").signal}abort(){xe(this,ik,"f").abort()}async*[(WEe=new WeakMap,uSt=new WeakMap,ik=new WeakMap,dSt=new WeakMap,fSt=new WeakMap,pSt=new WeakMap,k3e=new WeakMap,P3e=new WeakMap,zEe=new WeakMap,Symbol.asyncIterator)](){if(xe(this,uSt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");qt(this,uSt,!0,"f");let e=Al(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,ik,"f").signal.aborted;){let n;try{n=await xe(this,WEe,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,k3e,"f")!==null?{block_ms:xe(this,k3e,"f")}:{},...xe(this,P3e,"f")!==null?{reclaim_older_than_ms:xe(this,P3e,"f")}:{}},{headers:_t([xe(this,zEe,"f")?.headers]),signal:xe(this,ik,"f").signal})}catch(o){if(xe(this,ik,"f").signal.aborted)return;if(DV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=AHi(oDc(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await wN(s,xe(this,ik,"f").signal);continue}if(r=0,n==null){if(xe(this,pSt,"f"))return;await wN(QLr(1e3,3e3),xe(this,ik,"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,WEe,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:_t([xe(this,zEe,"f")?.headers]),signal:xe(this,ik,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,fSt,"f"))try{await xe(this,WEe,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:_t([xe(this,zEe,"f")?.headers])})}catch(o){PV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,dSt,"f").call(this)}}};a(oDc,"backoff");a(sDc,"defaultWorkerId")});var YEe,MV,KEe,mSt,yHi=ve(()=>{p();C1();mSt=class{static{a(this,"AsyncQueue")}constructor(){YEe.set(this,[]),MV.set(this,[]),KEe.set(this,!1)}push(e){if(xe(this,KEe,"f"))return!1;let r=xe(this,MV,"f").shift();return r?r({done:!1,value:e}):xe(this,YEe,"f").push(e),!0}close(){if(!xe(this,KEe,"f"))for(qt(this,KEe,!0,"f");xe(this,MV,"f").length>0;)xe(this,MV,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,YEe,"f").length>0?Promise.resolve({done:!1,value:xe(this,YEe,"f").shift()}):xe(this,KEe,"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,MV,"f").indexOf(n);s>=0&&xe(this,MV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,MV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,YEe,"f").shift()}};YEe=new WeakMap,MV=new WeakMap,KEe=new WeakMap});var vo,mie=ve(()=>{p();vo=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 jLr(t){return"name"in t?t.name:t.mcp_server_name}function aDc(t){return t instanceof vo?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function EHi(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:aDc(n),isError:!0}}}var _Hi=ve(()=>{p();mie();a(jLr,"toolName");a(aDc,"toolErrorContent");a(EHi,"runRunnableTool")});function xHi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function pDc(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 hDc(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 F0,gSt,xy,ASt,N3e,ESt,n_,JEe,BL,gie,x9,M3e,ZEe,ySt,wHi,vHi,CHi,bHi,HLr,D3e,GLr,SHi,RHi,cDc,THi,lDc,uDc,dDc,IHi,fDc,OV,_St=ve(()=>{p();C1();Uf();T9();MEe();R3e();cSt();yHi();vc();_Hi();cDc="SessionToolRunner",THi=500,lDc=1e4,uDc=12e4,dDc=3e4,IHi=3,fDc=6e4;a(xHi,"isEndTurnIdle");OV=class{static{a(this,"SessionToolRunner")}constructor(e,r){F0.add(this),gSt.set(this,!1),xy.set(this,void 0),ASt.set(this,void 0),N3e.set(this,void 0),ESt.set(this,void 0),n_.set(this,void 0),JEe.set(this,new Set),BL.set(this,new Set),gie.set(this,new mSt),x9.set(this,0),M3e.set(this,null),ZEe.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??fDc,qt(this,n_,Al(r.client),"f"),qt(this,ESt,new Map(r.tools.map(n=>[jLr(n),n])),"f"),qt(this,xy,new AbortController,"f"),qt(this,ASt,hie(r.signal,xe(this,xy,"f")),"f"),qt(this,N3e,r.requestOptions,"f")}get signal(){return xe(this,xy,"f").signal}abort(){xe(this,xy,"f").abort()}async*[(gSt=new WeakMap,xy=new WeakMap,ASt=new WeakMap,N3e=new WeakMap,ESt=new WeakMap,n_=new WeakMap,JEe=new WeakMap,BL=new WeakMap,gie=new WeakMap,x9=new WeakMap,M3e=new WeakMap,ZEe=new WeakMap,F0=new WeakSet,Symbol.asyncIterator)](){if(xe(this,gSt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");qt(this,gSt,!0,"f"),xe(this,n_,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,F0,"m",wHi).call(this).catch(r=>{xe(this,xy,"f").signal.aborted||xe(this,n_,"f").error("stream loop failed",{error:String(r)}),xe(this,xy,"f").abort()});try{for(;;){let n=await xe(this,gie,"f").next(xe(this,xy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,gie,"f").tryShift())!==void 0;)yield r}finally{xe(this,xy,"f").abort(),xe(this,F0,"m",D3e).call(this),await e;try{await xe(this,F0,"m",RHi).call(this)}catch(r){xe(this,n_,"f").warn("drain failed",{error:String(r)})}xe(this,gie,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,n_,"f").warn("tool.close failed",{tool:jLr(r),error:String(n)})}xe(this,ASt,"f").call(this)}}};ySt=a(function(){return{...xe(this,N3e,"f"),headers:_t([{"x-stainless-helper":cDc},xe(this,N3e,"f")?.headers]),signal:xe(this,xy,"f").signal}},"_SessionToolRunner_requestOptions"),wHi=a(async function(){let e=xe(this,xy,"f"),r=THi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,F0,"m",ySt).call(this));await xe(this,F0,"m",vHi).call(this);for await(let o of n)if(r=THi,await xe(this,F0,"m",bHi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),DV(n))throw xe(this,n_,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,n_,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await wN(r,e.signal),r=Math.min(r*2,lDc)}},"_SessionToolRunner_streamLoop"),vHi=a(async function(){let e=xe(this,xy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,F0,"m",ySt).call(this)))xe(this,F0,"m",CHi).call(this,s,r),n=xHi(s)}catch(s){e.signal.throwIfAborted(),xe(this,n_,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,JEe,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,BL,"f").has(s.id));n&&o.length===0?xe(this,F0,"m",HLr).call(this):xe(this,F0,"m",D3e).call(this);for(let s of o)await xe(this,F0,"m",GLr).call(this,s)},"_SessionToolRunner_reconcile"),CHi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,JEe,"f").add(e.id),xe(this,BL,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,BL,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,BL,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),bHi=a(async function(e){switch(xHi(e)?xe(this,F0,"m",HLr).call(this):xe(this,F0,"m",D3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,JEe,"f").has(e.id)||(xe(this,JEe,"f").add(e.id),await xe(this,F0,"m",GLr).call(this,e)),!1;case"user.tool_result":return xe(this,BL,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,BL,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,n_,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,xy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),HLr=a(function(){xe(this,F0,"m",D3e).call(this),!(this.maxIdleMs<=0)&&qt(this,ZEe,setTimeout(()=>{xe(this,n_,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,xy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),D3e=a(function(){xe(this,ZEe,"f")!==void 0&&(clearTimeout(xe(this,ZEe,"f")),qt(this,ZEe,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),GLr=a(async function(e){var r,n;if(!xe(this,BL,"f").has(e.id)){xe(this,n_,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,x9,(r=xe(this,x9,"f"),r++,r),"f");try{let o=xe(this,ESt,"f").get(e.name);if(!o){xe(this,n_,"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,gie,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=hie(xe(this,xy,"f").signal,l),d=setTimeout(()=>l.abort(),uDc);try{let m=await EHi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=pDc(e,c,hDc(s)),h=await xe(this,F0,"m",SHi).call(this,f,e.id);xe(this,gie,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,x9,(n=xe(this,x9,"f"),n--,n),"f"),xe(this,x9,"f")===0&&xe(this,M3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),SHi=a(async function(e,r){let n=xe(this,xy,"f"),o;for(let s=0;sqt(this,M3e,e,"f")),wN(dDc)]),qt(this,M3e,null,"f"),xe(this,x9,"f")>0&&xe(this,n_,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(pDc,"buildResultEvent");a(hDc,"toSessionContent")});var kHi=ve(()=>{p();gLr()});function Aie(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 PHi=ve(()=>{p();$Lr();kHi();a(Aie,"betaTool")});function XEe(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var VLr=ve(()=>{p();a(XEe,"promiseWithResolvers")});async function gDc(t){try{return await bI.realpath(t)}catch{return t}}async function ADc(t){let e=[],r=t;for(;;){let n;try{n=await bI.realpath(r)}catch{let o=!1;try{o=(await bI.lstat(r)).isSymbolicLink()}catch{}if(o){r=U0.resolve(U0.dirname(r),await bI.readlink(r));continue}let s=U0.dirname(r);if(s===r)return t;e.push(U0.basename(r)),r=s;continue}return e.length?U0.join(n,...e.reverse()):n}}async function NHi(t,e,r){let n=r?.allowOutside??!1;if(U0.isAbsolute(e)){if(!n)throw new vo(`absolute path ${JSON.stringify(e)} not permitted`);return U0.resolve(e)}let o=await gDc(U0.resolve(t)),s=U0.resolve(o,e);if(n)return s;let c=await ADc(s),l=o.endsWith(U0.sep)?o:o+U0.sep;if(c!==o&&!c.startsWith(l))throw new vo(`path ${JSON.stringify(e)} escapes workdir`);return c}async function WLr(t,e){let r=U0.dirname(t),n=U0.join(r,`.tmp-${process.pid}-${(0,DHi.randomUUID)()}`),o;try{o=await bI.open(n,"wx",mDc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await bI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await bI.unlink(n).catch(()=>{}),s}}function L3e(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 bI,U0,DHi,O3e,mDc,zLr=ve(()=>{p();bI=de(require("node:fs/promises"),1),U0=de(require("node:path"),1),DHi=require("node:crypto");mie();O3e=493,mDc=420;a(gDc,"realpathOrSelf");a(ADc,"canonicalize");a(NHi,"confineToRoot");a(WLr,"atomicWriteFile");a(L3e,"fsErrorMessage")});async function UHi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=Al(e),o=await e.beta.sessions.retrieve(r),s=wy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await KLr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=wy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=wy.resolve(s,f);if(h!==s&&!h.startsWith(s+wy.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 S1.rm(h,{recursive:!0,force:!0}),await S1.mkdir(h,{recursive:!0,mode:O3e}),c.push(h),await JLr(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 S1.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 KLr(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 EDc(t){for(let e of t.split(` +`)){let r=e.trim();if(r&&(wy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function _Dc(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 YLr(t,e){try{let{stdout:r}=await yDc(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 vDc(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 JLr(t,e){let r=wy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,FHi.pipeline)(BHi.Readable.fromWeb(t.body),MHi.createWriteStream(r));let n=wy.join(wy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await CDc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await YLr(c,s?["-Z1",r]:["-tf",r]);EDc(l),_Dc(await YLr(c,s?["-Z",r]:["-tvf",r]));let u=vDc(l);await S1.mkdir(n,{recursive:!0,mode:O3e}),await YLr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?wy.join(n,u):n;for(let f of await S1.readdir(d))await S1.rename(wy.join(d,f),wy.join(e,f))}finally{await S1.rm(r,{force:!0}),await S1.rm(n,{recursive:!0,force:!0})}}async function CDc(t,e){let r=await S1.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 S1,MHi,wy,OHi,LHi,BHi,FHi,yDc,QHi=ve(()=>{p();S1=de(require("node:fs/promises"),1),MHi=de(require("node:fs"),1),wy=de(require("node:path"),1),OHi=require("node:child_process"),LHi=require("node:util"),BHi=require("node:stream"),FHi=require("node:stream/promises");Uf();T9();zLr();yDc=(0,LHi.promisify)(OHi.execFile);a(UHi,"setupSkills");a(KLr,"resolveSkillVersion");a(EDc,"assertSafeMemberNames");a(_Dc,"assertNoSpecialMembers");a(YLr,"runArchiveTool");a(vDc,"archiveTopDir");a(JLr,"extractSkillArchive");a(CDc,"readHead")});var XHi={};ki(XHi,{BashSession:()=>CSt,betaAgentToolset20260401:()=>xDc,betaBashTool:()=>WHi,betaEditTool:()=>KHi,betaGlobTool:()=>JHi,betaGrepTool:()=>ZHi,betaReadTool:()=>zHi,betaWriteTool:()=>YHi,extractSkillArchive:()=>JLr,resolvePath:()=>e_e,resolveSkillVersion:()=>KLr,setupSkills:()=>UHi});function xDc(t){return[WHi(t),zHi(t),YHi(t),KHi(t),JHi(t),ZHi(t)]}function e_e(t,e){return NHi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function wDc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function WHi(t){let e,r=Promise.resolve();return Aie({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=XEe();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new vo("bash: command is required")}e??(e=new CSt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??VHi,signal:c?.signal});if(f!==0)throw new vo(d||`exit ${f}`);return d}catch(d){throw d instanceof vo?d:(e.close(),e=void 0,new vo(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function zHi(t){return Aie({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 vo("read: file_path is required");let n=await e_e(t,e),o;try{let f=await i_.stat(n);if(!f.isFile())throw new vo(`read: ${e} is not a regular file`);if(f.size>XLr)throw new vo(`read: ${e} is ${f.size} bytes, exceeds ${XLr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await i_.readFile(n,"utf8")}catch(f){throw f instanceof vo?f:new vo(`read: ${L3e(f,e)}`)}if(!r)return o;if(r.length!==2)throw new vo("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 UHi(t){return gie({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 ZEe(t,e);try{await n_.mkdir(Uf.dirname(n),{recursive:!0,mode:k3e}),await HLr(n,r??"")}catch(o){throw new _o(`write: ${P3e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function QHi(t){return gie({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 ZEe(t,e),c;try{let d=await n_.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>DHi)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${DHi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await n_.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${P3e(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 HLr(s,u)}catch(d){throw new _o(`edit: write: ${P3e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function qHi(t){return gie({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=Uf.resolve(t.workdir),o=e;if(Uf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=Uf.parse(e).root,o=Uf.relative(n,e)}else r&&(n=await ZEe(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 cDc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Uf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!pDc(n,l))continue;let u=0;try{u=(await n_.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,sDc).map(c=>c.path).join(` -`))},"run")})}function jHi(t){return gie({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=Uf.resolve(t.workdir);r&&(o=await ZEe(t,r));let s=await ADc();return s?dDc(s,e,o,n?.signal):fDc(e,o,n?.signal)},"run")})}function dDc(t,e,r,n){return new Promise((o,s)=>{let c=KLr.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>N3e&&(d=!0,l=l.slice(0,N3e),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 ${N3e} 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 fDc(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=N3e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${N3e} bytes]`),!1):(o.push(u),!0)),"push");if((await n_.stat(e).catch(()=>null))?.isFile()?await NHi(e,n,c):await gDc(e,"",u=>NHi(Uf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function NHi(t,e,r){let n=ESt.createReadStream(t,{encoding:"utf8"}),o=OHi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>oDc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function pDc(t,e){let r=Uf.relative(t,e);return r===""||!r.startsWith(".."+Uf.sep)&&r!==".."&&!Uf.isAbsolute(r)}async function gDc(t,e,r,n){let o=mDc;async function s(c,l){if(l>hDc)return!0;if(n?.aborted)return!1;let u;try{u=await n_.readdir(Uf.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?Uf.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 ADc(){let t=(process.env.PATH??"").split(Uf.delimiter);for(let e of t){let r=Uf.join(e,"rg");try{return await n_.access(r,ESt.constants.X_OK),r}catch{}}return null}var n_,ESt,Uf,KLr,MHi,OHi,ASt,Wv,T1,D3e,Aie,nk,zLr,PHi,LHi,YLr,DHi,N3e,oDc,sDc,aDc,cDc,ySt,hDc,mDc,GHi=ve(()=>{p();C1();n_=de(require("node:fs/promises"),1),ESt=de(require("node:fs"),1),Uf=de(require("node:path"),1),KLr=de(require("node:child_process"),1),MHi=de(require("node:crypto"),1),OHi=de(require("node:readline"),1);Bf();hie();vHi();jLr();GLr();kHi();PHi=100*1024,LHi=12e4,YLr=256*1024,DHi=YLr,N3e=100*1024,oDc=2e3,sDc=200,aDc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,cDc=n_.glob;a(lDc,"betaAgentToolset20260401");a(ZEe,"resolvePath");a(uDc,"scrubbedShellEnv");ySt=class{static{a(this,"BashSession")}constructor(e,r=uDc()){ASt.add(this),Wv.set(this,void 0),T1.set(this,""),D3e.set(this,!1),Aie.set(this,!1),nk.set(this,null),qt(this,Wv,KLr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Wv,"f").stdout.setEncoding("utf8"),xe(this,Wv,"f").stderr.setEncoding("utf8"),xe(this,Wv,"f").stdout.on("data",n=>xe(this,ASt,"m",zLr).call(this,n)),xe(this,Wv,"f").stderr.on("data",n=>xe(this,ASt,"m",zLr).call(this,n)),xe(this,Wv,"f").once("close",()=>{qt(this,Aie,!0,"f");let n=xe(this,nk,"f");qt(this,nk,null,"f"),n?.resolve()})}get closed(){return xe(this,Aie,"f")}async exec(e,r={}){if(xe(this,Aie,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??LHi,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");qt(this,T1,"","f"),qt(this,D3e,!1,"f");let s=`__ANT_CMD_${MHi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"run")})}function YHi(t){return Aie({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 vo("write: file_path is required");let n=await e_e(t,e);try{await i_.mkdir(qf.dirname(n),{recursive:!0,mode:O3e}),await WLr(n,r??"")}catch(o){throw new vo(`write: ${L3e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function KHi(t){return Aie({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 vo("edit: file_path is required");if(!r)throw new vo("edit: old_string is required");let s=await e_e(t,e),c;try{let d=await i_.stat(s);if(!d.isFile())throw new vo(`edit: ${e} is not a regular file`);if(d.size>jHi)throw new vo(`edit: ${e} is ${d.size} bytes, exceeds ${jHi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await i_.readFile(s,"utf8")}catch(d){throw d instanceof vo?d:new vo(`edit: ${L3e(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new vo(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new vo(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await WLr(s,u)}catch(d){throw new vo(`edit: write: ${L3e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function JHi(t){return Aie({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 vo("glob: pattern is required");let n=qf.resolve(t.workdir),o=e;if(qf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new vo("glob: absolute pattern not permitted");n=qf.parse(e).root,o=qf.relative(n,e)}else r&&(n=await e_e(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new vo('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of IDc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=qf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!PDc(n,l))continue;let u=0;try{u=(await i_.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new vo(`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,SDc).map(c=>c.path).join(` +`))},"run")})}function ZHi(t){return Aie({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 vo("grep: pattern is required");let o=qf.resolve(t.workdir);r&&(o=await e_e(t,r));let s=await ODc();return s?RDc(s,e,o,n?.signal):kDc(e,o,n?.signal)},"run")})}function RDc(t,e,r,n){return new Promise((o,s)=>{let c=eBr.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>F3e&&(d=!0,l=l.slice(0,F3e),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new vo("grep: aborted"));if(d)return o(l+` +[output truncated at ${F3e} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new vo(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new vo("grep: aborted"));s(new vo(`grep: rg failed: ${f.message}`))})})}async function kDc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new vo(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=F3e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${F3e} bytes]`),!1):(o.push(u),!0)),"push");if((await i_.stat(e).catch(()=>null))?.isFile()?await HHi(e,n,c):await MDc(e,"",u=>HHi(qf.join(e,u),n,c),r),r?.aborted)throw new vo("grep: aborted");return o.length===0?"no matches":o.join(` +`)}async function HHi(t,e,r){let n=bSt.createReadStream(t,{encoding:"utf8"}),o=$Hi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>bDc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function PDc(t,e){let r=qf.relative(t,e);return r===""||!r.startsWith(".."+qf.sep)&&r!==".."&&!qf.isAbsolute(r)}async function MDc(t,e,r,n){let o=NDc;async function s(c,l){if(l>DDc)return!0;if(n?.aborted)return!1;let u;try{u=await i_.readdir(qf.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?qf.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 ODc(){let t=(process.env.PATH??"").split(qf.delimiter);for(let e of t){let r=qf.join(e,"rg");try{return await i_.access(r,bSt.constants.X_OK),r}catch{}}return null}var i_,bSt,qf,eBr,GHi,$Hi,vSt,Yv,T1,B3e,yie,ok,ZLr,qHi,VHi,XLr,jHi,F3e,bDc,SDc,TDc,IDc,CSt,DDc,NDc,eGi=ve(()=>{p();C1();i_=de(require("node:fs/promises"),1),bSt=de(require("node:fs"),1),qf=de(require("node:path"),1),eBr=de(require("node:child_process"),1),GHi=de(require("node:crypto"),1),$Hi=de(require("node:readline"),1);Uf();mie();PHi();VLr();zLr();QHi();qHi=100*1024,VHi=12e4,XLr=256*1024,jHi=XLr,F3e=100*1024,bDc=2e3,SDc=200,TDc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,IDc=i_.glob;a(xDc,"betaAgentToolset20260401");a(e_e,"resolvePath");a(wDc,"scrubbedShellEnv");CSt=class{static{a(this,"BashSession")}constructor(e,r=wDc()){vSt.add(this),Yv.set(this,void 0),T1.set(this,""),B3e.set(this,!1),yie.set(this,!1),ok.set(this,null),qt(this,Yv,eBr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Yv,"f").stdout.setEncoding("utf8"),xe(this,Yv,"f").stderr.setEncoding("utf8"),xe(this,Yv,"f").stdout.on("data",n=>xe(this,vSt,"m",ZLr).call(this,n)),xe(this,Yv,"f").stderr.on("data",n=>xe(this,vSt,"m",ZLr).call(this,n)),xe(this,Yv,"f").once("close",()=>{qt(this,yie,!0,"f");let n=xe(this,ok,"f");qt(this,ok,null,"f"),n?.resolve()})}get closed(){return xe(this,yie,"f")}async exec(e,r={}){if(xe(this,yie,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??VHi,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");qt(this,T1,"","f"),qt(this,B3e,!1,"f");let s=`__ANT_CMD_${GHi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} } &1; printf '\\n${c}%d\\n' $? -`;if(xe(this,Wv,"f").stdin.write(l),xe(this,T1,"f").indexOf(s)<0){let{promise:g,resolve:A}=JEe();qt(this,nk,{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),qt(this,nk,null,"f")}}let u=xe(this,T1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,T1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,T1,"f").slice(0,u).replace(aDc,"").replace(/\n+$/,"");return xe(this,D3e,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(xe(this,Aie,"f"))return;qt(this,Aie,!0,"f");let e=xe(this,nk,"f");qt(this,nk,null,"f"),e?.resolve(),xe(this,Wv,"f").stdout.destroy(),xe(this,Wv,"f").stderr.destroy(),xe(this,Wv,"f").stdin.destroy();try{process.kill(-xe(this,Wv,"f").pid,"SIGKILL")}catch{xe(this,Wv,"f").kill("SIGKILL")}xe(this,Wv,"f").unref()}};Wv=new WeakMap,T1=new WeakMap,D3e=new WeakMap,Aie=new WeakMap,nk=new WeakMap,ASt=new WeakSet,zLr=a(function(e){if(qt(this,T1,xe(this,T1,"f")+e,"f"),xe(this,T1,"f").length>PHi&&(qt(this,T1,xe(this,T1,"f").slice(xe(this,T1,"f").length-PHi),"f"),qt(this,D3e,!0,"f")),xe(this,nk,"f")&&xe(this,T1,"f").indexOf(xe(this,nk,"f").sentinel)>=0){let r=xe(this,nk,"f");qt(this,nk,null,"f"),r.resolve()}},"_BashSession_append");a(BHi,"betaBashTool");a(FHi,"betaReadTool");a(UHi,"betaWriteTool");a(QHi,"betaEditTool");a(qHi,"betaGlobTool");a(jHi,"betaGrepTool");a(dDc,"runRipgrep");a(fDc,"runWalkGrep");a(NHi,"grepFile");a(pDc,"isWithin");hDc=40,mDc=5e4;a(gDc,"walk");a(ADc,"findRg")});async function EDc(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){xV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function _Dc(t,e,r,n,o){let s=$Hi,c=yDc,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,$Hi))),(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(),wV(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 TN(s,r.signal),r.signal.throwIfAborted(),await l()}var _St,M3e,JLr,$Hi,yDc,XEe,ZLr=ve(()=>{p();C1();Bf();b9();m3e();DEe();S3e();iSt();vc();gSt();uSt();BLr();$Hi=3e4,yDc="NO_HEARTBEAT",XEe=class{static{a(this,"EnvironmentWorker")}constructor(e){_St.add(this),M3e.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,qt(this,M3e,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,M3e,"f"),s=new RV({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,_St,"m",JLr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??_a("ANTHROPIC_WORK_ID"),n=e?.environmentId??_a("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??_a("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??_a("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,_St,"m",JLr).call(this,c,s,e?.signal??xe(this,M3e,"f"))}};M3e=new WeakMap,_St=new WeakSet,JLr=a(async function(e,r,n){let o=gl(this.client),s=oSt(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(()=>(GHi(),HHi)),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=pie(n,h),g=_Dc(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 PV(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 EDc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(EDc,"forceStop");a(_Dc,"heartbeatLoop")});var DV,XLr=ve(()=>{p();Ul();_d();vc();Ff();uSt();ZLr();uSt();ZLr();DV=class extends Ai{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(or`/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(or`/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(or`/v1/environments/${e}/work?beta=true`,va,{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(or`/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(or`/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(or`/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(or`/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(or`/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 RV({...e,client:this._client})}worker(e){return new XEe({...e,client:this._client})}};DV.WorkPoller=RV;DV.EnvironmentWorker=XEe});var yie,eBr=ve(()=>{p();Ul();XLr();XLr();_d();vc();Ff();yie=class extends Ai{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new DV(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(or`/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(or`/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",va,{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(or`/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(or`/v1/environments/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yie.Work=DV});var e_e,tBr=ve(()=>{p();Ul();_d();vc();Ff();e_e=class extends Ai{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(or`/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(or`/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(or`/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(or`/v1/memory_stores/${e}/memories?beta=true`,va,{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(or`/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 t_e,rBr=ve(()=>{p();Ul();_d();vc();Ff();t_e=class extends Ai{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/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(or`/v1/memory_stores/${e}/memory_versions?beta=true`,va,{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(or`/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 NV,nBr=ve(()=>{p();Ul();tBr();tBr();rBr();rBr();_d();vc();Ff();NV=class extends Ai{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new e_e(this._client),this.memoryVersions=new t_e(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(or`/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(or`/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",va,{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(or`/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(or`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};NV.Memories=e_e;NV.MemoryVersions=t_e});var r_e=ve(()=>{p();Bf()});var n_e,iBr=ve(()=>{p();Bf();NEe();ALr();n_e=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new S9;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(p3e(e.body),r)}}});var i_e,oBr=ve(()=>{p();Ul();_d();vc();iBr();r_e();Ff();i_e=class extends Ai{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(or`/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",tk,{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(or`/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(or`/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)=>n_e.fromResponse(l.response,l.controller))}}});var vSt,sBr=ve(()=>{p();vSt={"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 VHi(t){return t?.output_format??t?.output_config?.format}function aBr(t,e,r){let n=VHi(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}:cBr(t,e,r)}function cBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=xDc(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 xDc(t,e){let r=VHi(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 lBr=ve(()=>{p();Bf();a(VHi,"getOutputFormat");a(aBr,"maybeParseBetaMessage");a(cBr,"parseBetaMessage");a(xDc,"parseBetaOutputFormat")});var wDc,o_e,RDc,kDc,CSt,uBr=ve(()=>{p();wDc=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),o_e(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),o_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),o_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),o_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),o_e(t);break}return t},"strip"),RDc=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"),kDc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),CSt=a(t=>JSON.parse(kDc(RDc(o_e(wDc(t))))),"partialParse")});var dBr=ve(()=>{p();ELr()});function KHi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var ik,MV,s_e,O3e,bSt,L3e,B3e,SSt,F3e,I9,U3e,TSt,ISt,Eie,xSt,wSt,Q3e,fBr,WHi,RSt,pBr,hBr,mBr,zHi,YHi,kSt,JHi=ve(()=>{p();C1();uBr();r_e();CEe();dBr();lBr();YHi="__json_buf";a(KHi,"tracksToolInput");kSt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){ik.add(this),this.messages=[],this.receivedMessages=[],MV.set(this,void 0),s_e.set(this,null),this.controller=new AbortController,O3e.set(this,void 0),bSt.set(this,()=>{}),L3e.set(this,()=>{}),B3e.set(this,void 0),SSt.set(this,()=>{}),F3e.set(this,()=>{}),I9.set(this,{}),U3e.set(this,!1),TSt.set(this,!1),ISt.set(this,!1),Eie.set(this,!1),xSt.set(this,void 0),wSt.set(this,void 0),Q3e.set(this,void 0),RSt.set(this,n=>{if(qt(this,TSt,!0,"f"),v9(n)&&(n=new Ty),n instanceof Ty)return qt(this,ISt,!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)))}),qt(this,O3e,new Promise((n,o)=>{qt(this,bSt,n,"f"),qt(this,L3e,o,"f")}),"f"),qt(this,B3e,new Promise((n,o)=>{qt(this,SSt,n,"f"),qt(this,F3e,o,"f")}),"f"),xe(this,O3e,"f").catch(()=>{}),xe(this,B3e,"f").catch(()=>{}),qt(this,s_e,e,"f"),qt(this,Q3e,r?.logger??console,"f")}get response(){return xe(this,xSt,"f")}get request_id(){return xe(this,wSt,"f")}async withResponse(){qt(this,Eie,!0,"f");let e=await xe(this,O3e,"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 qt(s,s_e,{...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,RSt,"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,ik,"m",pBr).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,ik,"m",hBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ik,"m",mBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,xSt,e,"f"),qt(this,wSt,e?.headers.get("request-id"),"f"),xe(this,bSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,U3e,"f")}get errored(){return xe(this,TSt,"f")}get aborted(){return xe(this,ISt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,I9,"f")[e]||(xe(this,I9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(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(xe(this,I9,"f")[e]||(xe(this,I9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Eie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Eie,!0,"f"),await xe(this,B3e,"f")}get currentMessage(){return xe(this,MV,"f")}async finalMessage(){return await this.done(),xe(this,ik,"m",fBr).call(this)}async finalText(){return await this.done(),xe(this,ik,"m",WHi).call(this)}_emit(e,...r){if(xe(this,U3e,"f"))return;e==="end"&&(qt(this,U3e,!0,"f"),xe(this,SSt,"f").call(this));let n=xe(this,I9,"f")[e];if(n&&(xe(this,I9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,L3e,"f").call(this,o),xe(this,F3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,L3e,"f").call(this,o),xe(this,F3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ik,"m",fBr).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,ik,"m",pBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ik,"m",hBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ik,"m",mBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(MV=new WeakMap,s_e=new WeakMap,O3e=new WeakMap,bSt=new WeakMap,L3e=new WeakMap,B3e=new WeakMap,SSt=new WeakMap,F3e=new WeakMap,I9=new WeakMap,U3e=new WeakMap,TSt=new WeakMap,ISt=new WeakMap,Eie=new WeakMap,xSt=new WeakMap,wSt=new WeakMap,Q3e=new WeakMap,RSt=new WeakMap,ik=new WeakSet,fBr=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"),WHi=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"),pBr=a(function(){this.ended||qt(this,MV,void 0,"f")},"_BetaMessageStream_beginRequest"),hBr=a(function(r){if(this.ended)return;let n=xe(this,ik,"m",zHi).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":{KHi(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(aBr(n,xe(this,s_e,"f"),{logger:xe(this,Q3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,MV,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),mBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,MV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,MV,void 0,"f"),aBr(r,xe(this,s_e,"f"),{logger:xe(this,Q3e,"f")})},"_BetaMessageStream_endRequest"),zHi=a(function(r){let n=xe(this,MV,"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&&KHi(o)){let s=o[YHi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,YHi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=CSt(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,RSt,"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 OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var ZHi,XHi=ve(()=>{p();ZHi=`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,Yv,"f").stdin.write(l),xe(this,T1,"f").indexOf(s)<0){let{promise:g,resolve:A}=XEe();qt(this,ok,{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),qt(this,ok,null,"f")}}let u=xe(this,T1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,T1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,T1,"f").slice(0,u).replace(TDc,"").replace(/\n+$/,"");return xe(this,B3e,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:h}}close(){if(xe(this,yie,"f"))return;qt(this,yie,!0,"f");let e=xe(this,ok,"f");qt(this,ok,null,"f"),e?.resolve(),xe(this,Yv,"f").stdout.destroy(),xe(this,Yv,"f").stderr.destroy(),xe(this,Yv,"f").stdin.destroy();try{process.kill(-xe(this,Yv,"f").pid,"SIGKILL")}catch{xe(this,Yv,"f").kill("SIGKILL")}xe(this,Yv,"f").unref()}};Yv=new WeakMap,T1=new WeakMap,B3e=new WeakMap,yie=new WeakMap,ok=new WeakMap,vSt=new WeakSet,ZLr=a(function(e){if(qt(this,T1,xe(this,T1,"f")+e,"f"),xe(this,T1,"f").length>qHi&&(qt(this,T1,xe(this,T1,"f").slice(xe(this,T1,"f").length-qHi),"f"),qt(this,B3e,!0,"f")),xe(this,ok,"f")&&xe(this,T1,"f").indexOf(xe(this,ok,"f").sentinel)>=0){let r=xe(this,ok,"f");qt(this,ok,null,"f"),r.resolve()}},"_BashSession_append");a(WHi,"betaBashTool");a(zHi,"betaReadTool");a(YHi,"betaWriteTool");a(KHi,"betaEditTool");a(JHi,"betaGlobTool");a(ZHi,"betaGrepTool");a(RDc,"runRipgrep");a(kDc,"runWalkGrep");a(HHi,"grepFile");a(PDc,"isWithin");DDc=40,NDc=5e4;a(MDc,"walk");a(ODc,"findRg")});async function BDc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:_t([n?.headers])})}catch(o){PV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function FDc(t,e,r,n,o){let s=tGi,c=LDc,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:_t([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,tGi))),(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(),DV(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 wN(s,r.signal),r.signal.throwIfAborted(),await l()}var SSt,U3e,tBr,tGi,LDc,t_e,rBr=ve(()=>{p();C1();Uf();T9();_3e();MEe();R3e();cSt();vc();_St();hSt();qLr();tGi=3e4,LDc="NO_HEARTBEAT",t_e=class{static{a(this,"EnvironmentWorker")}constructor(e){SSt.add(this),U3e.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,qt(this,U3e,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,U3e,"f"),s=new NV({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,SSt,"m",tBr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??va("ANTHROPIC_WORK_ID"),n=e?.environmentId??va("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??va("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??va("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,SSt,"m",tBr).call(this,c,s,e?.signal??xe(this,U3e,"f"))}};U3e=new WeakMap,SSt=new WeakSet,tBr=a(async function(e,r,n){let o=Al(this.client),s=lSt(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(()=>(eGi(),XHi)),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=hie(n,h),g=FDc(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 OV(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 BDc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(BDc,"forceStop");a(FDc,"heartbeatLoop")});var LV,nBr=ve(()=>{p();Ql();Cd();vc();Qf();hSt();rBr();hSt();rBr();LV=class extends Ai{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(or`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:_t([{"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(or`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/environments/${e}/work?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:_t([{"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(or`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:_t([{"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(or`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:_t([{"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(or`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:_t([{"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(or`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new NV({...e,client:this._client})}worker(e){return new t_e({...e,client:this._client})}};LV.WorkPoller=NV;LV.EnvironmentWorker=t_e});var Eie,iBr=ve(()=>{p();Ql();nBr();nBr();Cd();vc();Qf();Eie=class extends Ai{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new LV(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/environments/${e}?beta=true`,{body:s,...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/environments/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/environments/${e}/archive?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Eie.Work=LV});var r_e,oBr=ve(()=>{p();Ql();Cd();vc();Qf();r_e=class extends Ai{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(or`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:_t([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:_t([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:_t([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memories?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:_t([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var n_e,sBr=ve(()=>{p();Ql();Cd();vc();Qf();n_e=class extends Ai{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memory_versions?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var BV,aBr=ve(()=>{p();Ql();oBr();oBr();sBr();sBr();Cd();vc();Qf();BV=class extends Ai{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new r_e(this._client),this.memoryVersions=new n_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};BV.Memories=r_e;BV.MemoryVersions=n_e});var i_e=ve(()=>{p();Uf()});var o_e,cBr=ve(()=>{p();Uf();OEe();vLr();o_e=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new I9;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(y3e(e.body),r)}}});var s_e,lBr=ve(()=>{p();Ql();Cd();vc();cBr();i_e();Qf();s_e=class extends Ai{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:_t([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:_t([{"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",nk,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:_t([{"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:_t([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>o_e.fromResponse(l.response,l.controller))}}});var TSt,uBr=ve(()=>{p();TSt={"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 rGi(t){return t?.output_format??t?.output_config?.format}function dBr(t,e,r){let n=rGi(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}:fBr(t,e,r)}function fBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=$Dc(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 $Dc(t,e){let r=rGi(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 pBr=ve(()=>{p();Uf();a(rGi,"getOutputFormat");a(dBr,"maybeParseBetaMessage");a(fBr,"parseBetaMessage");a($Dc,"parseBetaOutputFormat")});var VDc,a_e,WDc,zDc,ISt,hBr=ve(()=>{p();VDc=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),a_e(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),a_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),a_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),a_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),a_e(t);break}return t},"strip"),WDc=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"),zDc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),ISt=a(t=>JSON.parse(zDc(WDc(a_e(VDc(t))))),"partialParse")});var mBr=ve(()=>{p();bLr()});function sGi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var sk,FV,c_e,Q3e,xSt,q3e,j3e,wSt,H3e,w9,G3e,RSt,kSt,_ie,PSt,DSt,$3e,gBr,nGi,NSt,ABr,yBr,EBr,iGi,oGi,MSt,aGi=ve(()=>{p();C1();hBr();i_e();SEe();mBr();pBr();oGi="__json_buf";a(sGi,"tracksToolInput");MSt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){sk.add(this),this.messages=[],this.receivedMessages=[],FV.set(this,void 0),c_e.set(this,null),this.controller=new AbortController,Q3e.set(this,void 0),xSt.set(this,()=>{}),q3e.set(this,()=>{}),j3e.set(this,void 0),wSt.set(this,()=>{}),H3e.set(this,()=>{}),w9.set(this,{}),G3e.set(this,!1),RSt.set(this,!1),kSt.set(this,!1),_ie.set(this,!1),PSt.set(this,void 0),DSt.set(this,void 0),$3e.set(this,void 0),NSt.set(this,n=>{if(qt(this,RSt,!0,"f"),b9(n)&&(n=new Iy),n instanceof Iy)return qt(this,kSt,!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)))}),qt(this,Q3e,new Promise((n,o)=>{qt(this,xSt,n,"f"),qt(this,q3e,o,"f")}),"f"),qt(this,j3e,new Promise((n,o)=>{qt(this,wSt,n,"f"),qt(this,H3e,o,"f")}),"f"),xe(this,Q3e,"f").catch(()=>{}),xe(this,j3e,"f").catch(()=>{}),qt(this,c_e,e,"f"),qt(this,$3e,r?.logger??console,"f")}get response(){return xe(this,PSt,"f")}get request_id(){return xe(this,DSt,"f")}async withResponse(){qt(this,_ie,!0,"f");let e=await xe(this,Q3e,"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 qt(s,c_e,{...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,NSt,"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,sk,"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)xe(this,sk,"m",yBr).call(this,u);if(l.controller.signal?.aborted)throw new Iy;xe(this,sk,"m",EBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,PSt,e,"f"),qt(this,DSt,e?.headers.get("request-id"),"f"),xe(this,xSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,G3e,"f")}get errored(){return xe(this,RSt,"f")}get aborted(){return xe(this,kSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,w9,"f")[e]||(xe(this,w9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,w9,"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,w9,"f")[e]||(xe(this,w9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,_ie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,_ie,!0,"f"),await xe(this,j3e,"f")}get currentMessage(){return xe(this,FV,"f")}async finalMessage(){return await this.done(),xe(this,sk,"m",gBr).call(this)}async finalText(){return await this.done(),xe(this,sk,"m",nGi).call(this)}_emit(e,...r){if(xe(this,G3e,"f"))return;e==="end"&&(qt(this,G3e,!0,"f"),xe(this,wSt,"f").call(this));let n=xe(this,w9,"f")[e];if(n&&(xe(this,w9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,_ie,"f")&&!n?.length&&Promise.reject(o),xe(this,q3e,"f").call(this,o),xe(this,H3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,_ie,"f")&&!n?.length&&Promise.reject(o),xe(this,q3e,"f").call(this,o),xe(this,H3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,sk,"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{xe(this,sk,"m",ABr).call(this),this._connected(null);let s=LL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,sk,"m",yBr).call(this,c);if(s.controller.signal?.aborted)throw new Iy;xe(this,sk,"m",EBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(FV=new WeakMap,c_e=new WeakMap,Q3e=new WeakMap,xSt=new WeakMap,q3e=new WeakMap,j3e=new WeakMap,wSt=new WeakMap,H3e=new WeakMap,w9=new WeakMap,G3e=new WeakMap,RSt=new WeakMap,kSt=new WeakMap,_ie=new WeakMap,PSt=new WeakMap,DSt=new WeakMap,$3e=new WeakMap,NSt=new WeakMap,sk=new WeakSet,gBr=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"),nGi=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"),ABr=a(function(){this.ended||qt(this,FV,void 0,"f")},"_BetaMessageStream_beginRequest"),yBr=a(function(r){if(this.ended)return;let n=xe(this,sk,"m",iGi).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":{sGi(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(dBr(n,xe(this,c_e,"f"),{logger:xe(this,$3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,FV,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),EBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,FV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,FV,void 0,"f"),dBr(r,xe(this,c_e,"f"),{logger:xe(this,$3e,"f")})},"_BetaMessageStream_endRequest"),iGi=a(function(r){let n=xe(this,FV,"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&&sGi(o)){let s=o[oGi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,oGi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=ISt(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,NSt,"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 LL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var cGi,lGi=ve(()=>{p();cGi=`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 @@ -1491,65 +1491,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 DDc(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 q3e,a_e,_ie,U0,I1,CI,x9,OV,j3e,eGi,gBr,c_e,ABr=ve(()=>{p();C1();hie();Bf();vc();jLr();XHi();C3e();c_e=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){q3e.add(this),this.client=e,a_e.set(this,!1),_ie.set(this,!1),U0.set(this,void 0),I1.set(this,void 0),CI.set(this,void 0),x9.set(this,void 0),OV.set(this,void 0),j3e.set(this,0),qt(this,U0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...xLr(r.tools,r.messages)].join(", ");qt(this,I1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,OV,JEe(),"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*[(a_e=new WeakMap,_ie=new WeakMap,U0=new WeakMap,I1=new WeakMap,CI=new WeakMap,x9=new WeakMap,OV=new WeakMap,j3e=new WeakMap,q3e=new WeakSet,eGi=a(async function(){let r=xe(this,U0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,CI,"f")!==void 0)try{let d=await xe(this,CI,"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,U0,"f").params.max_tokens},{signal:xe(this,I1,"f").signal,headers:vt([xe(this,I1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,U0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,a_e,"f"))throw new fr("Cannot iterate over a consumed stream");qt(this,a_e,!0,"f"),qt(this,_ie,!0,"f"),qt(this,x9,void 0,"f");try{for(;;){let r;try{if(xe(this,U0,"f").params.max_iterations&&xe(this,j3e,"f")>=xe(this,U0,"f").params.max_iterations)break;qt(this,_ie,!1,"f"),qt(this,x9,void 0,"f"),qt(this,j3e,(e=xe(this,j3e,"f"),e++,e),"f"),qt(this,CI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,U0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,I1,"f")),qt(this,CI,r.finalMessage(),"f"),xe(this,CI,"f").catch(()=>{}),yield r):(qt(this,CI,this.client.beta.messages.create({...s,stream:!1},xe(this,I1,"f")),"f"),yield xe(this,CI,"f")),!await xe(this,q3e,"m",eGi).call(this)){if(!xe(this,_ie,"f")){let{role:u,content:d}=await xe(this,CI,"f");xe(this,U0,"f").params.messages.push({role:u,content:d})}let l=await xe(this,q3e,"m",gBr).call(this,xe(this,U0,"f").params.messages.at(-1));if(l)xe(this,U0,"f").params.messages.push(l);else if(!xe(this,_ie,"f"))break}}finally{r&&r.abort()}}if(!xe(this,CI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,OV,"f").resolve(await xe(this,CI,"f"))}catch(r){throw qt(this,a_e,!1,"f"),xe(this,OV,"f").promise.catch(()=>{}),xe(this,OV,"f").reject(r),qt(this,OV,JEe(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,U0,"f").params=e(xe(this,U0,"f").params):xe(this,U0,"f").params=e,qt(this,_ie,!0,"f"),qt(this,x9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,I1,e(xe(this,I1,"f")),"f"):qt(this,I1,{...xe(this,I1,"f"),...e},"f")}async generateToolResponse(e=xe(this,I1,"f").signal){let r=await xe(this,CI,"f")??this.params.messages.at(-1);return r?xe(this,q3e,"m",gBr).call(this,r,e):null}done(){return xe(this,OV,"f").promise}async runUntilDone(){if(!xe(this,a_e,"f"))for await(let e of this);return this.done()}get params(){return xe(this,U0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};gBr=a(async function(e,r=xe(this,I1,"f").signal){return xe(this,x9,"f")!==void 0?xe(this,x9,"f"):(qt(this,x9,DDc(xe(this,U0,"f").params,e,{...xe(this,I1,"f"),signal:r}),"f"),xe(this,x9,"f"))},"_BetaToolRunner_generateToolResponse");a(DDc,"generateToolResponse")});function rGi(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 tGi,NDc,w9,yBr=ve(()=>{p();r_e();oBr();Ul();sBr();vc();C3e();lBr();JHi();ABr();hie();oBr();ABr();hie();tGi={"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"},NDc=["claude-mythos-preview","claude-opus-4-6"],w9=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new i_e(this._client)}create(e,r){let n=rGi(e),{betas:o,...s}=n;s.model in tGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${tGi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),NDc.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=vSt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=eSt(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=>cBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return kSt.createMessage(this,e,r)}countTokens(e,r){let n=rGi(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 c_e(this._client,e,r)}};a(rGi,"transformOutputFormat");w9.Batches=i_e;w9.BetaToolRunner=c_e;w9.ToolError=_o});var vie,EBr=ve(()=>{p();Ul();_d();vc();Ff();gSt();gSt();vie=class extends Ai{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,va,{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(or`/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(or`/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 PV(e,{...r,client:this._client})}};vie.SessionToolRunner=PV});var l_e,_Br=ve(()=>{p();Ul();_d();vc();Ff();l_e=class extends Ai{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/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(or`/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(or`/v1/sessions/${e}/resources?beta=true`,va,{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(or`/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(or`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var u_e,vBr=ve(()=>{p();Ul();_d();vc();Ff();u_e=class extends Ai{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(or`/v1/sessions/${o}/threads/${e}/events?beta=true`,va,{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(or`/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 Cie,CBr=ve(()=>{p();Ul();vBr();vBr();_d();vc();Ff();Cie=class extends Ai{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new u_e(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/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(or`/v1/sessions/${e}/threads?beta=true`,va,{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(or`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Cie.Events=u_e});var R9,bBr=ve(()=>{p();Ul();EBr();EBr();_Br();_Br();CBr();CBr();_d();vc();Ff();R9=class extends Ai{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new vie(this._client),this.resources=new l_e(this._client),this.threads=new Cie(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(or`/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(or`/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",va,{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(or`/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(or`/v1/sessions/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};R9.Events=vie;R9.Resources=l_e;R9.Threads=Cie});var d_e,SBr=ve(()=>{p();Ul();_d();vc();FEe();Ff();d_e=class extends Ai{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,BEe({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(or`/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(or`/v1/skills/${e}/versions?beta=true`,va,{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(or`/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(or`/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 bie,TBr=ve(()=>{p();Ul();SBr();SBr();_d();vc();FEe();Ff();bie=class extends Ai{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new d_e(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",BEe({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(or`/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",va,{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(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};bie.Versions=d_e});var f_e,IBr=ve(()=>{p();Ul();_d();vc();Ff();f_e=class extends Ai{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/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(or`/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(or`/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(or`/v1/vaults/${e}/credentials?beta=true`,va,{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(or`/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(or`/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(or`/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 Sie,xBr=ve(()=>{p();Ul();IBr();IBr();_d();vc();Ff();Sie=class extends Ai{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new f_e(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(or`/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(or`/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",va,{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(or`/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(or`/v1/vaults/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Sie.Credentials=f_e});var iA,wBr=ve(()=>{p();Ul();wLr();wLr();RLr();RLr();kLr();kLr();NLr();NLr();OLr();OLr();eBr();eBr();nBr();nBr();yBr();yBr();bBr();bBr();TBr();TBr();xBr();xBr();iA=class extends Ai{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new QEe(this._client),this.messages=new w9(this._client),this.agents=new fie(this._client),this.environments=new yie(this._client),this.sessions=new R9(this._client),this.vaults=new Sie(this._client),this.memoryStores=new NV(this._client),this.files=new UEe(this._client),this.skills=new bie(this._client),this.webhooks=new HEe(this._client),this.userProfiles=new qEe(this._client)}};iA.Models=QEe;iA.Messages=w9;iA.Agents=fie;iA.Environments=yie;iA.Sessions=R9;iA.Vaults=Sie;iA.MemoryStores=NV;iA.Files=UEe;iA.Skills=bie;iA.Webhooks=HEe;iA.UserProfiles=qEe});var Tie,RBr=ve(()=>{p();Ul();vc();Tie=class extends Ai{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 nGi(t){return t?.output_config?.format}function kBr(t,e,r){let n=nGi(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}:PBr(t,e,r)}function PBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=GDc(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 GDc(t,e){let r=nGi(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 DBr=ve(()=>{p();Bf();a(nGi,"getOutputFormat");a(kBr,"maybeParseMessage");a(PBr,"parseMessage");a(GDc,"parseOutputFormat")});function aGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var ok,LV,p_e,H3e,PSt,G3e,$3e,DSt,V3e,k9,W3e,NSt,MSt,Iie,OSt,LSt,z3e,NBr,iGi,MBr,OBr,LBr,BBr,oGi,sGi,BSt,cGi=ve(()=>{p();C1();CEe();r_e();dBr();uBr();DBr();sGi="__json_buf";a(aGi,"tracksToolInput");BSt=class t{static{a(this,"MessageStream")}constructor(e,r){ok.add(this),this.messages=[],this.receivedMessages=[],LV.set(this,void 0),p_e.set(this,null),this.controller=new AbortController,H3e.set(this,void 0),PSt.set(this,()=>{}),G3e.set(this,()=>{}),$3e.set(this,void 0),DSt.set(this,()=>{}),V3e.set(this,()=>{}),k9.set(this,{}),W3e.set(this,!1),NSt.set(this,!1),MSt.set(this,!1),Iie.set(this,!1),OSt.set(this,void 0),LSt.set(this,void 0),z3e.set(this,void 0),MBr.set(this,n=>{if(qt(this,NSt,!0,"f"),v9(n)&&(n=new Ty),n instanceof Ty)return qt(this,MSt,!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)))}),qt(this,H3e,new Promise((n,o)=>{qt(this,PSt,n,"f"),qt(this,G3e,o,"f")}),"f"),qt(this,$3e,new Promise((n,o)=>{qt(this,DSt,n,"f"),qt(this,V3e,o,"f")}),"f"),xe(this,H3e,"f").catch(()=>{}),xe(this,$3e,"f").catch(()=>{}),qt(this,p_e,e,"f"),qt(this,z3e,r?.logger??console,"f")}get response(){return xe(this,OSt,"f")}get request_id(){return xe(this,LSt,"f")}async withResponse(){qt(this,Iie,!0,"f");let e=await xe(this,H3e,"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 qt(s,p_e,{...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,MBr,"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,ok,"m",OBr).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,ok,"m",LBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",BBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,OSt,e,"f"),qt(this,LSt,e?.headers.get("request-id"),"f"),xe(this,PSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,W3e,"f")}get errored(){return xe(this,NSt,"f")}get aborted(){return xe(this,MSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,k9,"f")[e]||(xe(this,k9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,k9,"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,k9,"f")[e]||(xe(this,k9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Iie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Iie,!0,"f"),await xe(this,$3e,"f")}get currentMessage(){return xe(this,LV,"f")}async finalMessage(){return await this.done(),xe(this,ok,"m",NBr).call(this)}async finalText(){return await this.done(),xe(this,ok,"m",iGi).call(this)}_emit(e,...r){if(xe(this,W3e,"f"))return;e==="end"&&(qt(this,W3e,!0,"f"),xe(this,DSt,"f").call(this));let n=xe(this,k9,"f")[e];if(n&&(xe(this,k9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,G3e,"f").call(this,o),xe(this,V3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,G3e,"f").call(this,o),xe(this,V3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ok,"m",NBr).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,ok,"m",OBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ok,"m",LBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",BBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(LV=new WeakMap,p_e=new WeakMap,H3e=new WeakMap,PSt=new WeakMap,G3e=new WeakMap,$3e=new WeakMap,DSt=new WeakMap,V3e=new WeakMap,k9=new WeakMap,W3e=new WeakMap,NSt=new WeakMap,MSt=new WeakMap,Iie=new WeakMap,OSt=new WeakMap,LSt=new WeakMap,z3e=new WeakMap,MBr=new WeakMap,ok=new WeakSet,NBr=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"),iGi=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"),OBr=a(function(){this.ended||qt(this,LV,void 0,"f")},"_MessageStream_beginRequest"),LBr=a(function(r){if(this.ended)return;let n=xe(this,ok,"m",oGi).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":{aGi(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(kBr(n,xe(this,p_e,"f"),{logger:xe(this,z3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,LV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),BBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,LV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,LV,void 0,"f"),kBr(r,xe(this,p_e,"f"),{logger:xe(this,z3e,"f")})},"_MessageStream_endRequest"),oGi=a(function(r){let n=xe(this,LV,"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&&aGi(o)){let s=o[sGi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,sGi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=CSt(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 OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var h_e,FBr=ve(()=>{p();Ul();_d();vc();iBr();r_e();Ff();h_e=class extends Ai{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(or`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",tk,{query:e,...r})}delete(e,r){return this._client.delete(or`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(or`/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)=>n_e.fromResponse(s.response,s.controller))}}});var BV,lGi,VDc,UBr=ve(()=>{p();Ul();vc();C3e();cGi();DBr();FBr();FBr();sBr();BV=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new h_e(this._client)}create(e,r){e.model in lGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${lGi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),VDc.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=vSt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=eSt(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=>PBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return BSt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},lGi={"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"},VDc=["claude-mythos-preview","claude-opus-4-6"];BV.Batches=h_e});var xie,QBr=ve(()=>{p();Ul();_d();vc();Ff();xie=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/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",tk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var uGi=ve(()=>{p();Hji();wBr();RBr();UBr();QBr()});var qBr,jBr,FSt,dGi,fGi,pGi,Qf,BL,HBr=ve(()=>{p();C1();D1t();NL();DEe();CEe();O1t();NEe();nji();cLr();d3e();Bf();OEe();vji();Fji();_d();ILr();uGi();Y1t();RBr();QBr();wBr();UBr();O1t();vc();m3e();b9();NL();fGi="\\n\\nHuman:",pGi="\\n\\nAssistant:",Qf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=_a("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=_a("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(qBr.add(this),this._requestAuthFlags=new WeakMap,FSt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:_a("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:_a("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&&Xqi())throw new fr(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function KDc(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 vo?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var V3e,l_e,vie,Q0,I1,SI,R9,UV,W3e,uGi,_Br,u_e,vBr=ve(()=>{p();C1();mie();Uf();vc();VLr();lGi();x3e();u_e=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){V3e.add(this),this.client=e,l_e.set(this,!1),vie.set(this,!1),Q0.set(this,void 0),I1.set(this,void 0),SI.set(this,void 0),R9.set(this,void 0),UV.set(this,void 0),W3e.set(this,0),qt(this,Q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...PLr(r.tools,r.messages)].join(", ");qt(this,I1,{...n,headers:_t([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,UV,XEe(),"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*[(l_e=new WeakMap,vie=new WeakMap,Q0=new WeakMap,I1=new WeakMap,SI=new WeakMap,R9=new WeakMap,UV=new WeakMap,W3e=new WeakMap,V3e=new WeakSet,uGi=a(async function(){let r=xe(this,Q0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,SI,"f")!==void 0)try{let d=await xe(this,SI,"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,Q0,"f").params.max_tokens},{signal:xe(this,I1,"f").signal,headers:_t([xe(this,I1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,Q0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,l_e,"f"))throw new fr("Cannot iterate over a consumed stream");qt(this,l_e,!0,"f"),qt(this,vie,!0,"f"),qt(this,R9,void 0,"f");try{for(;;){let r;try{if(xe(this,Q0,"f").params.max_iterations&&xe(this,W3e,"f")>=xe(this,Q0,"f").params.max_iterations)break;qt(this,vie,!1,"f"),qt(this,R9,void 0,"f"),qt(this,W3e,(e=xe(this,W3e,"f"),e++,e),"f"),qt(this,SI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,Q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,I1,"f")),qt(this,SI,r.finalMessage(),"f"),xe(this,SI,"f").catch(()=>{}),yield r):(qt(this,SI,this.client.beta.messages.create({...s,stream:!1},xe(this,I1,"f")),"f"),yield xe(this,SI,"f")),!await xe(this,V3e,"m",uGi).call(this)){if(!xe(this,vie,"f")){let{role:u,content:d}=await xe(this,SI,"f");xe(this,Q0,"f").params.messages.push({role:u,content:d})}let l=await xe(this,V3e,"m",_Br).call(this,xe(this,Q0,"f").params.messages.at(-1));if(l)xe(this,Q0,"f").params.messages.push(l);else if(!xe(this,vie,"f"))break}}finally{r&&r.abort()}}if(!xe(this,SI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,UV,"f").resolve(await xe(this,SI,"f"))}catch(r){throw qt(this,l_e,!1,"f"),xe(this,UV,"f").promise.catch(()=>{}),xe(this,UV,"f").reject(r),qt(this,UV,XEe(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,Q0,"f").params=e(xe(this,Q0,"f").params):xe(this,Q0,"f").params=e,qt(this,vie,!0,"f"),qt(this,R9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,I1,e(xe(this,I1,"f")),"f"):qt(this,I1,{...xe(this,I1,"f"),...e},"f")}async generateToolResponse(e=xe(this,I1,"f").signal){let r=await xe(this,SI,"f")??this.params.messages.at(-1);return r?xe(this,V3e,"m",_Br).call(this,r,e):null}done(){return xe(this,UV,"f").promise}async runUntilDone(){if(!xe(this,l_e,"f"))for await(let e of this);return this.done()}get params(){return xe(this,Q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};_Br=a(async function(e,r=xe(this,I1,"f").signal){return xe(this,R9,"f")!==void 0?xe(this,R9,"f"):(qt(this,R9,KDc(xe(this,Q0,"f").params,e,{...xe(this,I1,"f"),signal:r}),"f"),xe(this,R9,"f"))},"_BetaToolRunner_generateToolResponse");a(KDc,"generateToolResponse")});function fGi(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 dGi,JDc,k9,CBr=ve(()=>{p();i_e();lBr();Ql();uBr();vc();x3e();pBr();aGi();vBr();mie();lBr();vBr();mie();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"},JDc=["claude-mythos-preview","claude-opus-4-6"],k9=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new s_e(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.`),JDc.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=TSt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=iSt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:_t([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:_t([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>fBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return MSt.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:_t([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new u_e(this._client,e,r)}};a(fGi,"transformOutputFormat");k9.Batches=s_e;k9.BetaToolRunner=u_e;k9.ToolError=vo});var Cie,bBr=ve(()=>{p();Ql();Cd();vc();Qf();_St();_St();Cie=class extends Ai{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,Ca,{query:s,...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new OV(e,{...r,client:this._client})}};Cie.SessionToolRunner=OV});var d_e,SBr=ve(()=>{p();Ql();Cd();vc();Qf();d_e=class extends Ai{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:_t([{"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(or`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/resources?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var f_e,TBr=ve(()=>{p();Ql();Cd();vc();Qf();f_e=class extends Ai{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(or`/v1/sessions/${o}/threads/${e}/events?beta=true`,Ca,{query:c,...n,headers:_t([{"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(or`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var bie,IBr=ve(()=>{p();Ql();TBr();TBr();Cd();vc();Qf();bie=class extends Ai{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new f_e(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/threads?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};bie.Events=f_e});var P9,xBr=ve(()=>{p();Ql();bBr();bBr();SBr();SBr();IBr();IBr();Cd();vc();Qf();P9=class extends Ai{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new Cie(this._client),this.resources=new d_e(this._client),this.threads=new bie(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/sessions/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/sessions/${e}/archive?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};P9.Events=Cie;P9.Resources=d_e;P9.Threads=bie});var p_e,wBr=ve(()=>{p();Ql();Cd();vc();QEe();Qf();p_e=class extends Ai{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,UEe({body:s,...n,headers:_t([{"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(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/skills/${e}/versions?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:_t([{"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(or`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var Sie,RBr=ve(()=>{p();Ql();wBr();wBr();Cd();vc();QEe();Qf();Sie=class extends Ai{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new p_e(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",UEe({body:o,...r,headers:_t([{"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(or`/v1/skills/${e}?beta=true`,{...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/skills/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};Sie.Versions=p_e});var h_e,kBr=ve(()=>{p();Ql();Cd();vc();Qf();h_e=class extends Ai{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:_t([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:_t([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/vaults/${e}/credentials?beta=true`,Ca,{query:s,...n,headers:_t([{"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(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:_t([{"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(or`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:_t([{"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(or`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:_t([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Tie,PBr=ve(()=>{p();Ql();kBr();kBr();Cd();vc();Qf();Tie=class extends Ai{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new h_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/vaults/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:_t([{"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",Ca,{query:o,...r,headers:_t([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/vaults/${e}?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/vaults/${e}/archive?beta=true`,{...n,headers:_t([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Tie.Credentials=h_e});var oA,DBr=ve(()=>{p();Ql();DLr();DLr();NLr();NLr();MLr();MLr();BLr();BLr();ULr();ULr();iBr();iBr();aBr();aBr();CBr();CBr();xBr();xBr();RBr();RBr();PBr();PBr();oA=class extends Ai{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new jEe(this._client),this.messages=new k9(this._client),this.agents=new pie(this._client),this.environments=new Eie(this._client),this.sessions=new P9(this._client),this.vaults=new Tie(this._client),this.memoryStores=new BV(this._client),this.files=new qEe(this._client),this.skills=new Sie(this._client),this.webhooks=new $Ee(this._client),this.userProfiles=new HEe(this._client)}};oA.Models=jEe;oA.Messages=k9;oA.Agents=pie;oA.Environments=Eie;oA.Sessions=P9;oA.Vaults=Tie;oA.MemoryStores=BV;oA.Files=qEe;oA.Skills=Sie;oA.Webhooks=$Ee;oA.UserProfiles=HEe});var Iie,NBr=ve(()=>{p();Ql();vc();Iie=class extends Ai{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:_t([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function pGi(t){return t?.output_config?.format}function MBr(t,e,r){let n=pGi(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}:OBr(t,e,r)}function OBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=cNc(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 cNc(t,e){let r=pGi(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 LBr=ve(()=>{p();Uf();a(pGi,"getOutputFormat");a(MBr,"maybeParseMessage");a(OBr,"parseMessage");a(cNc,"parseOutputFormat")});function AGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var ak,QV,m_e,z3e,OSt,Y3e,K3e,LSt,J3e,D9,Z3e,BSt,FSt,xie,USt,QSt,X3e,BBr,hGi,FBr,UBr,QBr,qBr,mGi,gGi,qSt,yGi=ve(()=>{p();C1();SEe();i_e();mBr();hBr();LBr();gGi="__json_buf";a(AGi,"tracksToolInput");qSt=class t{static{a(this,"MessageStream")}constructor(e,r){ak.add(this),this.messages=[],this.receivedMessages=[],QV.set(this,void 0),m_e.set(this,null),this.controller=new AbortController,z3e.set(this,void 0),OSt.set(this,()=>{}),Y3e.set(this,()=>{}),K3e.set(this,void 0),LSt.set(this,()=>{}),J3e.set(this,()=>{}),D9.set(this,{}),Z3e.set(this,!1),BSt.set(this,!1),FSt.set(this,!1),xie.set(this,!1),USt.set(this,void 0),QSt.set(this,void 0),X3e.set(this,void 0),FBr.set(this,n=>{if(qt(this,BSt,!0,"f"),b9(n)&&(n=new Iy),n instanceof Iy)return qt(this,FSt,!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)))}),qt(this,z3e,new Promise((n,o)=>{qt(this,OSt,n,"f"),qt(this,Y3e,o,"f")}),"f"),qt(this,K3e,new Promise((n,o)=>{qt(this,LSt,n,"f"),qt(this,J3e,o,"f")}),"f"),xe(this,z3e,"f").catch(()=>{}),xe(this,K3e,"f").catch(()=>{}),qt(this,m_e,e,"f"),qt(this,X3e,r?.logger??console,"f")}get response(){return xe(this,USt,"f")}get request_id(){return xe(this,QSt,"f")}async withResponse(){qt(this,xie,!0,"f");let e=await xe(this,z3e,"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 qt(s,m_e,{...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,FBr,"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,ak,"m",UBr).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,ak,"m",QBr).call(this,u);if(l.controller.signal?.aborted)throw new Iy;xe(this,ak,"m",qBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,USt,e,"f"),qt(this,QSt,e?.headers.get("request-id"),"f"),xe(this,OSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,Z3e,"f")}get errored(){return xe(this,BSt,"f")}get aborted(){return xe(this,FSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,D9,"f")[e]||(xe(this,D9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,D9,"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,D9,"f")[e]||(xe(this,D9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,xie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,xie,!0,"f"),await xe(this,K3e,"f")}get currentMessage(){return xe(this,QV,"f")}async finalMessage(){return await this.done(),xe(this,ak,"m",BBr).call(this)}async finalText(){return await this.done(),xe(this,ak,"m",hGi).call(this)}_emit(e,...r){if(xe(this,Z3e,"f"))return;e==="end"&&(qt(this,Z3e,!0,"f"),xe(this,LSt,"f").call(this));let n=xe(this,D9,"f")[e];if(n&&(xe(this,D9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,xie,"f")&&!n?.length&&Promise.reject(o),xe(this,Y3e,"f").call(this,o),xe(this,J3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,xie,"f")&&!n?.length&&Promise.reject(o),xe(this,Y3e,"f").call(this,o),xe(this,J3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ak,"m",BBr).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,ak,"m",UBr).call(this),this._connected(null);let s=LL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ak,"m",QBr).call(this,c);if(s.controller.signal?.aborted)throw new Iy;xe(this,ak,"m",qBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(QV=new WeakMap,m_e=new WeakMap,z3e=new WeakMap,OSt=new WeakMap,Y3e=new WeakMap,K3e=new WeakMap,LSt=new WeakMap,J3e=new WeakMap,D9=new WeakMap,Z3e=new WeakMap,BSt=new WeakMap,FSt=new WeakMap,xie=new WeakMap,USt=new WeakMap,QSt=new WeakMap,X3e=new WeakMap,FBr=new WeakMap,ak=new WeakSet,BBr=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"),hGi=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"),UBr=a(function(){this.ended||qt(this,QV,void 0,"f")},"_MessageStream_beginRequest"),QBr=a(function(r){if(this.ended)return;let n=xe(this,ak,"m",mGi).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":{AGi(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(MBr(n,xe(this,m_e,"f"),{logger:xe(this,X3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,QV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),qBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,QV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,QV,void 0,"f"),MBr(r,xe(this,m_e,"f"),{logger:xe(this,X3e,"f")})},"_MessageStream_endRequest"),mGi=a(function(r){let n=xe(this,QV,"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&&AGi(o)){let s=o[gGi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,gGi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=ISt(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 LL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var g_e,jBr=ve(()=>{p();Ql();Cd();vc();cBr();i_e();Qf();g_e=class extends Ai{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(or`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",nk,{query:e,...r})}delete(e,r){return this._client.delete(or`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(or`/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:_t([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>o_e.fromResponse(s.response,s.controller))}}});var qV,EGi,uNc,HBr=ve(()=>{p();Ql();vc();x3e();yGi();LBr();jBr();jBr();uBr();qV=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new g_e(this._client)}create(e,r){e.model in EGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${EGi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),uNc.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=TSt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=iSt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:_t([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>OBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return qSt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},EGi={"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"},uNc=["claude-mythos-preview","claude-opus-4-6"];qV.Batches=g_e});var wie,GBr=ve(()=>{p();Ql();Cd();vc();Qf();wie=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}`,{...n,headers:_t([{...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",nk,{query:o,...r,headers:_t([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var _Gi=ve(()=>{p();Xji();DBr();NBr();HBr();GBr()});var $Br,VBr,jSt,vGi,CGi,bGi,jf,FL,WBr=ve(()=>{p();C1();L1t();ML();MEe();SEe();U1t();OEe();pji();fLr();g3e();Uf();BEe();Pji();zji();Cd();kLr();_Gi();X1t();NBr();GBr();DBr();HBr();U1t();vc();_3e();T9();ML();CGi="\\n\\nHuman:",bGi="\\n\\nAssistant:",jf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=va("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=va("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if($Br.add(this),this._requestAuthFlags=new WeakMap,jSt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:va("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:va("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&&lji())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??jBr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=dLr(c.logLevel,"ClientOptions.logLevel",this)??dLr(_a("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??eji(),qt(this,FSt,rji,"f");let u=_a("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=gLr(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=>{gl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{gl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new H1t(e,r=>{gl(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 Bji(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 hji(e)}getUserAgent(){return`${this.constructor.name}/JS ${ek}`}defaultIdempotencyKey(){return`stainless-node-retry-${vEe()}`}makeStatusError(e,r,n,o){return Ch.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,qBr,"m",dGi).call(this)&&n||this.baseURL,s=Wqi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!X4r(c)||!X4r(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(lie)||o.append("anthropic-beta",lie),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 uie(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(gl(this).debug(`[${d}] sending request`,C9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Ty;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(u3e),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Ty;let v=v9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,C9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,C9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new bEe:new TV({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 tji(g.body),gl(this).info(`${E} - ${x}`),gl(this).debug(`[${d}] response error (${x})`,C9({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";gl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>u3e(x).message),T=M1t(b),w=T?void 0:b;throw gl(this).debug(`[${d}] response error (${v})`,C9({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 gl(this).info(E),gl(this).debug(`[${d}] response start`,C9({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 E3e(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 TN(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&&Yqi("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))}:{},...f3e(),...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:L1t(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,FSt,"f").call(this,{body:e,headers:n})}};jBr=Qf,FSt=new WeakMap,qBr=new WeakSet,dGi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Qf.Anthropic=jBr;Qf.HUMAN_PROMPT=fGi;Qf.AI_PROMPT=pGi;Qf.DEFAULT_TIMEOUT=6e5;Qf.AnthropicError=fr;Qf.APIError=Ch;Qf.APIConnectionError=TV;Qf.APIConnectionTimeoutError=bEe;Qf.APIUserAbortError=Ty;Qf.NotFoundError=xEe;Qf.ConflictError=wEe;Qf.RateLimitError=kEe;Qf.BadRequestError=SEe;Qf.AuthenticationError=TEe;Qf.InternalServerError=PEe;Qf.PermissionDeniedError=IEe;Qf.UnprocessableEntityError=REe;Qf.toFile=Z1t;BL=class extends Qf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Tie(this),this.messages=new BV(this),this.models=new xie(this),this.beta=new iA(this)}};BL.Completions=Tie;BL.Messages=BV;BL.Models=xie;BL.Beta=iA});var qLr=ve(()=>{p();HBr();ILr();Y1t();HBr();_d();Bf()});var b3r=I((pFh,AWi)=>{p();var dFe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xLc=typeof AbortController=="function",RTt=xLc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new hWi}abort(){this.signal.dispatchEvent("abort")}},wLc=typeof AbortSignal=="function",RLc=typeof RTt.AbortSignal=="function",hWi=wLc?AbortSignal:RLc?RTt.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))}},v3r=new Set,y3r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;kTt(r)&&C3r(r,`${t} option`,`options.${e}`,D_e)},"deprecatedOption"),E3r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(kTt(r)){let{prototype:n}=D_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);C3r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),kLc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(kTt(r)){let{prototype:n}=D_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);C3r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),mWi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),kTt=a(t=>!v3r.has(t),"shouldWarn"),C3r=a((t,e,r,n)=>{v3r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;mWi(o,"DeprecationWarning",t,n)},"warn"),Die=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),gWi=a(t=>Die(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?P_e:null:null,"getUintArray"),P_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},_3r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=gWi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},D_e=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&&!Die(r))throw new TypeError("max option must be a nonnegative integer");let R=r?gWi(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 _3r(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(!Die(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=Die(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!Die(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";kTt(x)&&(v3r.add(x),mWi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&y3r("stale","allowStale"),T&&y3r("maxAge","ttl"),b&&y3r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new P_e(this.max),this.starts=new P_e(this.max),this.setItemTTL=(n,o,s=dFe.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?dFe.now():0};let e=0,r=a(()=>{let n=dFe.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 P_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!Die(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!Die(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 E3r("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=dFe.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=dFe.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 RTt,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 E3r("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 E3r("reset","clear"),this.clear}get length(){return kLc("length","size"),this.size}static get AbortController(){return RTt}static get AbortSignal(){return hWi}};AWi.exports=D_e});var I3r=I((gFh,yWi)=>{"use strict";p();var fFe=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}},S3r=class extends fFe{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)}},T3r=class extends fFe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};yWi.exports={FetchBaseError:fFe,FetchError:S3r,AbortError:T3r}});var N9=I((EFh,_Wi)=>{"use strict";p();var{constants:{MAX_LENGTH:PLc}}=require("buffer"),{pipeline:PTt,PassThrough:DLc}=require("stream"),{promisify:NLc}=require("util"),{createGunzip:MLc,createInflate:OLc,createBrotliDecompress:LLc,constants:{Z_SYNC_FLUSH:EWi}}=require("zlib"),BLc=EP()("helix-fetch:utils"),FLc=NLc(PTt),ULc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),QLc=a((t,e,r,n)=>{if(!ULc(t,e))return r;let o=a(s=>{s&&(BLc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return PTt(r,MLc({flush:EWi,finishFlush:EWi}),o);case"deflate":case"x-deflate":return PTt(r,OLc(),o);case"br":return PTt(r,LLc(),o);default:return r}},"decodeStream"),qLc=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"),DTt=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)?jLc(t,e):HLc(t,e);default:return 0}},"calcSize"),jLc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:DTt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),HLc=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+=DTt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=DTt(t[o],e)}),r},"calcObjectSize"),GLc=a(t=>DTt(t,new WeakSet),"sizeof"),$Lc=a(async t=>{let e=new DLc,r=0,n=[];return e.on("data",o=>{if(r+o.length>PLc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await FLc(t,e),Buffer.concat(n,r)},"streamToBuffer");_Wi.exports={decodeStream:QLc,isPlainObject:qLc,sizeof:GLc,streamToBuffer:$Lc}});var MTt=I((CFh,SWi)=>{"use strict";p();var{PassThrough:vWi,Readable:M9}=require("stream"),{types:{isAnyArrayBuffer:bWi}}=require("util"),{FetchError:VLc,FetchBaseError:WLc}=I3r(),{streamToBuffer:zLc}=N9(),YLc=Buffer.alloc(0),lk=Symbol("Body internals"),KLc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),CWi=a(async t=>{if(t[lk].disturbed)throw new TypeError("Already read");if(t[lk].error)throw new TypeError(`Stream had error: ${t[lk].error.message}`);t[lk].disturbed=!0;let{stream:e}=t[lk];return e===null?YLc:zLc(e)},"consume"),NTt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=M9.from(e.toString()):e instanceof M9?r=e:Buffer.isBuffer(e)?r=M9.from(e):bWi(e)?r=M9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=M9.from(e):r=M9.from(String(e)),this[lk]={stream:r,disturbed:!1,error:null},e instanceof M9&&r.on("error",n=>{let o=n instanceof WLc?n:new VLc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[lk].error=o})}get body(){return this[lk].stream}get bodyUsed(){return this[lk].disturbed}async buffer(){return CWi(this)}async arrayBuffer(){return KLc(await this.buffer())}async text(){return(await CWi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(NTt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var JLc=a(t=>{if(t[lk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[lk],r=e;if(e instanceof M9){r=new vWi;let n=new vWi;e.pipe(r),e.pipe(n),t[lk].stream=n}return r},"cloneStream"),ZLc=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)||bWi(t)||t instanceof M9?null:"text/plain; charset=utf-8","guessContentType");SWi.exports={Body:NTt,cloneStream:JLc,guessContentType:ZLc}});var N_e=I((TFh,wWi)=>{"use strict";p();var{validateHeaderName:TWi,validateHeaderValue:IWi}=require("http"),{isPlainObject:XLc}=N9(),O9=Symbol("Headers internals"),pFe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof TWi=="function")TWi(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"),xWi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof IWi=="function")IWi(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"),OTt=class t{static{a(this,"Headers")}constructor(e={}){if(this[O9]={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(XLc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[O9].map.set(pFe(e),xWi(r,e))}has(e){return this[O9].map.has(pFe(e))}get(e){let r=this[O9].map.get(pFe(e));return r===void 0?null:r}append(e,r){let n=pFe(e),o=xWi(r,e),s=this[O9].map.get(n);this[O9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[O9].map.delete(pFe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[O9].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[O9].map)}};Object.defineProperties(OTt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));wWi.exports={Headers:OTt}});var x3r=I((wFh,RWi)=>{"use strict";p();var{EventEmitter:eBc}=require("events"),NN=Symbol("AbortSignal internals"),M_e=class{static{a(this,"AbortSignal")}constructor(){this[NN]={eventEmitter:new eBc,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(M_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var BTt=class extends M_e{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(BTt.prototype,{clear:{enumerable:!0}});var LTt=Symbol("AbortController internals"),FTt=class{static{a(this,"AbortController")}constructor(){this[LTt]={signal:new M_e}}get signal(){return this[LTt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[LTt].signal.aborted||this[LTt].signal.fire()}};Object.defineProperties(FTt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});RWi.exports={AbortController:FTt,AbortSignal:M_e,TimeoutSignal:BTt}});var hFe=I((PFh,DWi)=>{"use strict";p();var{randomBytes:tBc}=require("crypto"),{Readable:rBc}=require("stream"),R3r=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"),nBc=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"),kWi=a(t=>`--${t}--\r +`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??VBr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=mLr(c.logLevel,"ClientOptions.logLevel",this)??mLr(va("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??uji(),qt(this,jSt,fji,"f");let u=va("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=_Lr(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=>{Al(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{Al(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new W1t(e,r=>{Al(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 Wji(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,_t([{Authorization:`Bearer ${r}`}])}return _t([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return _t([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return _t([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Sji(e)}getUserAgent(){return`${this.constructor.name}/JS ${rk}`}defaultIdempotencyKey(){return`stainless-node-retry-${bEe()}`}makeStatusError(e,r,n,o){return Sh.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,$Br,"m",vGi).call(this)&&n||this.baseURL,s=nji(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!nLr(c)||!nLr(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(uie)||o.append("anthropic-beta",uie),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 die(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(Al(this).debug(`[${d}] sending request`,S9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Iy;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(m3e),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Iy;let v=b9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return Al(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),Al(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,S9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw Al(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),Al(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,S9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new TEe:new RV({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 dji(g.body),Al(this).info(`${E} - ${x}`),Al(this).debug(`[${d}] response error (${x})`,S9({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";Al(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>m3e(x).message),T=F1t(b),w=T?void 0:b;throw Al(this).debug(`[${d}] response error (${v})`,S9({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 Al(this).info(E),Al(this).debug(`[${d}] response start`,S9({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 S3e(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 wN(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&&oji("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=_t([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))}:{},...A3e(),...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=_t([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:Q1t(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,jSt,"f").call(this,{body:e,headers:n})}};VBr=jf,jSt=new WeakMap,$Br=new WeakSet,vGi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");jf.Anthropic=VBr;jf.HUMAN_PROMPT=CGi;jf.AI_PROMPT=bGi;jf.DEFAULT_TIMEOUT=6e5;jf.AnthropicError=fr;jf.APIError=Sh;jf.APIConnectionError=RV;jf.APIConnectionTimeoutError=TEe;jf.APIUserAbortError=Iy;jf.NotFoundError=REe;jf.ConflictError=kEe;jf.RateLimitError=DEe;jf.BadRequestError=IEe;jf.AuthenticationError=xEe;jf.InternalServerError=NEe;jf.PermissionDeniedError=wEe;jf.UnprocessableEntityError=PEe;jf.toFile=rSt;FL=class extends jf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Iie(this),this.messages=new qV(this),this.models=new wie(this),this.beta=new oA(this)}};FL.Completions=Iie;FL.Messages=qV;FL.Models=wie;FL.Beta=oA});var $Lr=ve(()=>{p();WBr();kLr();X1t();WBr();Cd();Uf()});var w3r=I((qFh,xWi)=>{p();var gFe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$Lc=typeof AbortController=="function",NTt=$Lc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new SWi}abort(){this.signal.dispatchEvent("abort")}},VLc=typeof AbortSignal=="function",WLc=typeof NTt.AbortSignal=="function",SWi=VLc?AbortSignal:WLc?NTt.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))}},I3r=new Set,b3r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;MTt(r)&&x3r(r,`${t} option`,`options.${e}`,M_e)},"deprecatedOption"),S3r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(MTt(r)){let{prototype:n}=M_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);x3r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),zLc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(MTt(r)){let{prototype:n}=M_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);x3r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),TWi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),MTt=a(t=>!I3r.has(t),"shouldWarn"),x3r=a((t,e,r,n)=>{I3r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;TWi(o,"DeprecationWarning",t,n)},"warn"),Nie=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),IWi=a(t=>Nie(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?N_e:null:null,"getUintArray"),N_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},T3r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=IWi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},M_e=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&&!Nie(r))throw new TypeError("max option must be a nonnegative integer");let R=r?IWi(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 T3r(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(!Nie(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=Nie(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!Nie(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";MTt(x)&&(I3r.add(x),TWi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&b3r("stale","allowStale"),T&&b3r("maxAge","ttl"),b&&b3r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new N_e(this.max),this.starts=new N_e(this.max),this.setItemTTL=(n,o,s=gFe.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?gFe.now():0};let e=0,r=a(()=>{let n=gFe.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 N_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!Nie(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!Nie(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 S3r("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=gFe.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=gFe.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 NTt,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 S3r("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 S3r("reset","clear"),this.clear}get length(){return zLc("length","size"),this.size}static get AbortController(){return NTt}static get AbortSignal(){return SWi}};xWi.exports=M_e});var P3r=I((GFh,wWi)=>{"use strict";p();var AFe=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}},R3r=class extends AFe{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)}},k3r=class extends AFe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};wWi.exports={FetchBaseError:AFe,FetchError:R3r,AbortError:k3r}});var O9=I((WFh,kWi)=>{"use strict";p();var{constants:{MAX_LENGTH:YLc}}=require("buffer"),{pipeline:OTt,PassThrough:KLc}=require("stream"),{promisify:JLc}=require("util"),{createGunzip:ZLc,createInflate:XLc,createBrotliDecompress:eBc,constants:{Z_SYNC_FLUSH:RWi}}=require("zlib"),tBc=vP()("helix-fetch:utils"),rBc=JLc(OTt),nBc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),iBc=a((t,e,r,n)=>{if(!nBc(t,e))return r;let o=a(s=>{s&&(tBc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return OTt(r,ZLc({flush:RWi,finishFlush:RWi}),o);case"deflate":case"x-deflate":return OTt(r,XLc(),o);case"br":return OTt(r,eBc(),o);default:return r}},"decodeStream"),oBc=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"),LTt=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)?sBc(t,e):aBc(t,e);default:return 0}},"calcSize"),sBc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:LTt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),aBc=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+=LTt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=LTt(t[o],e)}),r},"calcObjectSize"),cBc=a(t=>LTt(t,new WeakSet),"sizeof"),lBc=a(async t=>{let e=new KLc,r=0,n=[];return e.on("data",o=>{if(r+o.length>YLc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await rBc(t,e),Buffer.concat(n,r)},"streamToBuffer");kWi.exports={decodeStream:iBc,isPlainObject:oBc,sizeof:cBc,streamToBuffer:lBc}});var FTt=I((KFh,MWi)=>{"use strict";p();var{PassThrough:PWi,Readable:L9}=require("stream"),{types:{isAnyArrayBuffer:NWi}}=require("util"),{FetchError:uBc,FetchBaseError:dBc}=P3r(),{streamToBuffer:fBc}=O9(),pBc=Buffer.alloc(0),dk=Symbol("Body internals"),hBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),DWi=a(async t=>{if(t[dk].disturbed)throw new TypeError("Already read");if(t[dk].error)throw new TypeError(`Stream had error: ${t[dk].error.message}`);t[dk].disturbed=!0;let{stream:e}=t[dk];return e===null?pBc:fBc(e)},"consume"),BTt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=L9.from(e.toString()):e instanceof L9?r=e:Buffer.isBuffer(e)?r=L9.from(e):NWi(e)?r=L9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=L9.from(e):r=L9.from(String(e)),this[dk]={stream:r,disturbed:!1,error:null},e instanceof L9&&r.on("error",n=>{let o=n instanceof dBc?n:new uBc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[dk].error=o})}get body(){return this[dk].stream}get bodyUsed(){return this[dk].disturbed}async buffer(){return DWi(this)}async arrayBuffer(){return hBc(await this.buffer())}async text(){return(await DWi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(BTt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var mBc=a(t=>{if(t[dk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[dk],r=e;if(e instanceof L9){r=new PWi;let n=new PWi;e.pipe(r),e.pipe(n),t[dk].stream=n}return r},"cloneStream"),gBc=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)||NWi(t)||t instanceof L9?null:"text/plain; charset=utf-8","guessContentType");MWi.exports={Body:BTt,cloneStream:mBc,guessContentType:gBc}});var O_e=I((XFh,FWi)=>{"use strict";p();var{validateHeaderName:OWi,validateHeaderValue:LWi}=require("http"),{isPlainObject:ABc}=O9(),B9=Symbol("Headers internals"),yFe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof OWi=="function")OWi(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"),BWi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof LWi=="function")LWi(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"),UTt=class t{static{a(this,"Headers")}constructor(e={}){if(this[B9]={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(ABc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[B9].map.set(yFe(e),BWi(r,e))}has(e){return this[B9].map.has(yFe(e))}get(e){let r=this[B9].map.get(yFe(e));return r===void 0?null:r}append(e,r){let n=yFe(e),o=BWi(r,e),s=this[B9].map.get(n);this[B9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[B9].map.delete(yFe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[B9].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[B9].map)}};Object.defineProperties(UTt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));FWi.exports={Headers:UTt}});var D3r=I((r8h,UWi)=>{"use strict";p();var{EventEmitter:yBc}=require("events"),LN=Symbol("AbortSignal internals"),L_e=class{static{a(this,"AbortSignal")}constructor(){this[LN]={eventEmitter:new yBc,onabort:null,aborted:!1}}get aborted(){return this[LN].aborted}get onabort(){return this[LN].onabort}set onabort(e){this[LN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[LN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[LN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[LN][n]=="function"&&this[n](r),this[LN].eventEmitter.emit(e,r)}fire(){this[LN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(L_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var qTt=class extends L_e{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[LN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[LN].timerId)}};Object.defineProperties(qTt.prototype,{clear:{enumerable:!0}});var QTt=Symbol("AbortController internals"),jTt=class{static{a(this,"AbortController")}constructor(){this[QTt]={signal:new L_e}}get signal(){return this[QTt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[QTt].signal.aborted||this[QTt].signal.fire()}};Object.defineProperties(jTt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});UWi.exports={AbortController:jTt,AbortSignal:L_e,TimeoutSignal:qTt}});var EFe=I((o8h,jWi)=>{"use strict";p();var{randomBytes:EBc}=require("crypto"),{Readable:_Bc}=require("stream"),M3r=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"),vBc=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"),QWi=a(t=>`--${t}--\r \r -`,"getFooter"),PWi=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,R3r(r)&&(n+=`; filename="${r.name}"\r +`,"getFooter"),qWi=a((t,e,r)=>{let n="";return n+=`--${t}\r +`,n+=`Content-Disposition: form-data; name="${e}"`,M3r(r)&&(n+=`; filename="${r.name}"\r `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*iBc(t,e){for(let[r,n]of t)yield PWi(e,r,n),R3r(n)?yield*n.stream():yield n,yield`\r -`;yield kWi(e)}a(iBc,"formDataIterator");var oBc=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(PWi(e,n,o)),r+=R3r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength(kWi(e)),r},"getFormDataLength"),w3r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=tBc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=oBc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return rBc.from(iBc(this.fd,this.boundary))}};DWi.exports={isFormData:nBc,FormDataSerializer:w3r}});var MWi=I((OFh,NWi)=>{"use strict";p();var{AbortSignal:MFh}=x3r(),{Body:sBc,cloneStream:aBc,guessContentType:cBc}=MTt(),{Headers:lBc}=N_e(),{isPlainObject:uBc}=N9(),{isFormData:dBc,FormDataSerializer:fBc}=hFe(),pBc=20,HV=Symbol("Request internals"),UTt=class t extends sBc{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?aBc(n):null),l=new lBc(r.headers||n&&n.headers||{});if(dBc(c)&&!l.has("content-type")){let h=new fBc(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(uBc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=cBc(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[HV]={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=pBc: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[HV].method}get url(){return this[HV].parsedURL.toString()}get headers(){return this[HV].headers}get redirect(){return this[HV].redirect}get cache(){return this[HV].cache}get signal(){return this[HV].signal}clone(){return new t(this)}get init(){return this[HV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(UTt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});NWi.exports={Request:UTt}});var k3r=I((FFh,OWi)=>{"use strict";p();var{Body:hBc,cloneStream:mBc,guessContentType:gBc}=MTt(),{Headers:ABc}=N_e(),{isPlainObject:yBc}=N9(),{isFormData:EBc,FormDataSerializer:_Bc}=hFe(),MN=Symbol("Response internals"),QTt=class t extends hBc{static{a(this,"Response")}constructor(e=null,r={}){let n=new ABc(r.headers),o=e;if(EBc(o)&&!n.has("content-type")){let s=new _Bc(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(yBc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=gBc(o);s&&n.set("content-type",s)}super(o),this[MN]={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[MN].url||""}get status(){return this[MN].status}get statusText(){return this[MN].statusText}get ok(){return this[MN].status>=200&&this[MN].status<300}get redirected(){return this[MN].counter>0}get headers(){return this[MN].headers}get httpVersion(){return this[MN].httpVersion}get decoded(){return this[MN].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(mBc(this),{...this[MN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(QTt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});OWi.exports={Response:QTt}});var BWi=I((jFh,LWi)=>{"use strict";p();var vBc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),CBc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),bBc=new Set([500,502,503,504]),SBc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},TBc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Nie(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Nie,"toNumberOrZero");function IBc(t){return t?bBc.has(t.status):!0}a(IBc,"isErrorResponse");function P3r(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(P3r,"parseCacheControl");function xBc(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(xBc,"formatCacheControl");LWi.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=P3r(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=P3r(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":xBc(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())&&CBc.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||vBc.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=P3r(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)SBc[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 Nie(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 Nie(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Nie(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+Nie(this._rescc["stale-if-error"]),n=e+Nie(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Nie(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Nie(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()&&IBc(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&&!TBc[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 qWi=I(($Fh,QWi)=>{"use strict";p();var wBc=BWi(),{Headers:RBc}=N_e(),FWi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),UWi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),D3r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new wBc(FWi(e),UWi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(FWi(e))}responseHeaders(e){return new RBc(this.policy.responseHeaders(UWi(e)))}timeToLive(){return this.policy.timeToLive()}};QWi.exports=D3r});var GWi=I((zFh,HWi)=>{"use strict";p();var{Readable:kBc}=require("stream"),{Headers:jWi}=N_e(),{Response:PBc}=k3r(),GV=Symbol("CacheableResponse internals"),DBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),N3r=class t extends PBc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new jWi(r.headers);this[GV]={headers:n,bufferedBody:e}}get headers(){return this[GV].headers}set headers(e){if(e instanceof jWi)this[GV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return kBc.from(this[GV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[GV].bufferedBody}async arrayBuffer(){return DBc(this[GV].bufferedBody)}async text(){return this[GV].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[GV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},NBc=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 N3r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");HWi.exports={cacheableResponse:NBc}});var qTt=I((JFh,$Wi)=>{"use strict";p();var M3r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};$Wi.exports={RequestAbortedError:M3r}});var KWi=I((e8h,YWi)=>{"use strict";p();var WWi=require("http"),zWi=require("https"),{Readable:MBc}=require("stream"),L9=EP()("helix-fetch:h1"),{RequestAbortedError:VWi}=qTt(),{decodeStream:OBc}=N9(),LBc=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 zWi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new WWi.Agent(n),r.httpAgent):void 0},"getAgent"),BBc=a(t=>{t.h1={}},"setupContext"),FBc=a(async({h1:t})=>{t.httpAgent&&(L9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(L9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),UBc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?OBc(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"),QBc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?zWi:WWi,o=LBc(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)=>{L9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{L9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{L9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new VWi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new VWi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(UBc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(L9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof MBc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");YWi.exports={request:QBc,setupContext:BBc,resetContext:FBc}});var ezi=I((n8h,XWi)=>{"use strict";p();var{connect:qBc,constants:jBc}=require("http2"),{Readable:HBc}=require("stream"),vd=EP()("helix-fetch:h2"),{RequestAbortedError:JWi}=qTt(),{decodeStream:GBc}=N9(),{NGHTTP2_CANCEL:mFe}=jBc,$Bc=300*1e3,VBc=5e3,WBc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),zBc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),vd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),ZWi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?GBc(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"),YBc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=VBc}}}=t,d=o[":path"],f=`${e}${d}`;vd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(mFe)},"rejectPush")),n.on("push",(h,m)=>{vd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{vd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(mFe)}),l&&l(f,o,ZWi(h,n,r))}),n.on("aborted",()=>{vd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{vd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{vd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),KBc=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=$Bc,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=()=>(vd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=qBc(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{vd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{vd(`session ${n} established`),vd(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{vd(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{vd(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{vd(`session ${n} closed`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{vd(`session ${n} encountered error: ${q}`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,O)=>{vd(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${O}`)}),w.once("goaway",(q,M,O)=>{vd(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(q,M,O)=>{YBc(t,n,v,q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(vd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());vd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new JWi),R&&R.close(mFe)},"onAbortSignal");if(x){if(x.aborted){T(new JWi);return}x.addEventListener("abort",P)}let D=a(N=>{vd(`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(ZWi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==mFe&&(vd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(mFe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),vd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{vd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof HBc?_.pipe(R):(_&&R.write(_),R.end())})},"request");XWi.exports={request:KBc,setupContext:WBc,resetContext:zBc}});var rzi=I((s8h,tzi)=>{"use strict";p();var{EventEmitter:JBc}=require("events"),ZBc=a(()=>{let t={},e=new JBc;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");tzi.exports=ZBc});var nzi=I((l8h,XBc)=>{XBc.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 czi=I((u8h,azi)=>{"use strict";p();var{Readable:e3c}=require("stream"),t3c=require("tls"),{types:{isAnyArrayBuffer:r3c}}=require("util"),n3c=b3r(),O3r=EP()("helix-fetch:core"),{RequestAbortedError:jTt}=qTt(),L3r=KWi(),HTt=ezi(),i3c=rzi(),{isPlainObject:o3c}=N9(),{isFormData:s3c,FormDataSerializer:a3c}=hFe(),{version:c3c}=nzi(),B3r="h2",F3r="h2c",U3r="http/1.0",Mie="http/1.1",l3c=100,u3c=3600*1e3,d3c=[B3r,Mie,U3r],f3c=`helix-fetch/${c3c}`,p3c={method:"GET",compress:!0,decode:!0},izi=0,ozi=i3c(),szi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new jTt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new jTt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof jTt||(O3r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=t3c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),izi+=1,s.id=izi,s.secureConnecting=!1,O3r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),h3c=a(async(t,e)=>{let r=await ozi.acquire(t.origin);try{return r||(r=await szi(t,e)),r}finally{ozi.release(t.origin,r)}},"connect"),m3c=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=Mie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=F3r,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 h3c(e,d);return o=f.alpnProtocol,o||(o=Mie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),g3c=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),A3c=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 szi(e,d);return{protocol:f.alpnProtocol||Mie,socket:f}}return{protocol:l.alpnProtocol||Mie,socket:l}},"getProtocolAndSocketFromFactory"),y3c=a(async(t,e,r)=>{let n=new URL(e),o={...p3c,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=g3c(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(s3c(o.body)){let d=new a3c(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":o3c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):r3c(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 e3c||(!(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 A3c(t.socketFactory,n,o,t.alpnProtocols):await m3c(t,n,c);switch(O3r(`${n.host} -> ${l}`),l){case B3r:try{return await HTt.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 F3r:return HTt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case U3r:case Mie:return L3r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),E3c=a(async t=>(t.alpnCache.clear(),Promise.all([L3r.resetContext(t),HTt.resetContext(t)])),"resetContext"),_3c=a(t=>{let{options:{alpnProtocols:e=d3c,alpnCacheTTL:r=u3c,alpnCacheSize:n=l3c,userAgent:o=f3c,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new n3c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,L3r.setupContext(t),HTt.setupContext(t)},"setupContext");azi.exports={request:y3c,setupContext:_3c,resetContext:E3c,RequestAbortedError:jTt,ALPN_HTTP2:B3r,ALPN_HTTP2C:F3r,ALPN_HTTP1_1:Mie,ALPN_HTTP1_0:U3r}});var uzi=I((p8h,lzi)=>{"use strict";p();var v3c=EP()("helix-fetch:core"),{request:C3c,setupContext:b3c,resetContext:S3c,RequestAbortedError:T3c,ALPN_HTTP2:I3c,ALPN_HTTP2C:x3c,ALPN_HTTP1_1:w3c,ALPN_HTTP1_0:R3c}=czi(),Q3r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},b3c(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:T3c,ALPN_HTTP2:I3c,ALPN_HTTP2C:x3c,ALPN_HTTP1_1:w3c,ALPN_HTTP1_0:R3c}}async request(e,r){return C3c(this,e,r)}setCA(e){this.options.ca=e}async reset(){return v3c("resetting context"),S3c(this)}};lzi.exports=new Q3r().api()});var mzi=I((g8h,hzi)=>{"use strict";p();var{EventEmitter:k3c}=require("events"),{Readable:gFe}=require("stream"),q3r=EP()("helix-fetch"),P3c=b3r(),{Body:D3c}=MTt(),{Headers:$3r}=N_e(),{Request:Oie}=MWi(),{Response:H3r}=k3r(),{FetchBaseError:N3c,FetchError:AFe,AbortError:GTt}=I3r(),{AbortController:M3c,AbortSignal:O3c,TimeoutSignal:L3c}=x3r(),B3c=qWi(),{cacheableResponse:F3c}=GWi(),{sizeof:U3c}=N9(),{isFormData:Q3c}=hFe(),{context:q3c,RequestAbortedError:j3c}=uzi(),dzi=["GET","HEAD"],H3c=500,G3c=100*1024*1024,j3r="push",fzi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Oie&&typeof r>"u"?e:new Oie(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 GTt("The operation was aborted.");throw o.init.body instanceof gFe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof gFe)&&!Q3c(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof gFe&&m.destroy(w),w instanceof TypeError?w:w instanceof j3c?new GTt("The operation was aborted."):new AFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new GTt("The operation was aborted.");o.init.body instanceof gFe&&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 AFe(`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 AFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new $3r(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 gFe)throw l&&l.removeEventListener("abort",A),new AFe("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),fzi(t,new Oie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new H3r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),pzi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!dzi.includes(e.method))return r;let n=new B3c(e,r,{shared:!1});if(n.storable()){let o=await F3c(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),$3c=a(async(t,e,r)=>{let n=new Oie(e,r);if(t.options.maxCacheSize!==0&&dzi.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 $3r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await fzi(t,n);return n.cache!=="no-store"?pzi(t,n,s):s},"cachingFetch"),V3c=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"),W3c=a(t=>new L3c(t),"timeoutSignal"),G3r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:G3c,o=H3c;n===0&&(n=1,o=1);let s=a(({response:l},u)=>U3c(l),"sizeCalculation");this.cache=new P3c({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new k3c,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 H3r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=q3c(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:D3c,Headers:$3r,Request:Oie,Response:H3r,AbortController:M3c,AbortSignal:O3c,FetchBaseError:N3c,FetchError:AFe,AbortError:GTt,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:V3c,timeoutSignal:W3c,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 $3c(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(j3r,e)}offPush(e){return this.eventEmitter.off(j3r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){q3r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Oie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(q3r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){q3r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await pzi(this,new Oie(e,{headers:r}),n);this.eventEmitter.emit(j3r,e,o)}};hzi.exports=new G3r().api()});var Azi=I((E8h,gzi)=>{"use strict";p();gzi.exports=mzi()});var Uzi=I((CUh,Fzi)=>{"use strict";p();function Bzi(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(Bzi,"validateParameter");function _Fc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(_Fc,"hasOwnProperty");function vFc(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(vFc,"defineOperation");Fzi.exports={defineOperation:vFc,validateParameter:Bzi}});var J3r=I((TUh,jzi)=>{"use strict";p();var Q_e=W6e()("kerberos"),U_e=Q_e.KerberosClient,Qzi=Q_e.KerberosServer,VV=Uzi().defineOperation,CFc=1,bFc=2,SFc=4,TFc=8,IFc=16,xFc=32,wFc=64,RFc=128,kFc=256,qzi=0,PFc=9,DFc=6;U_e.prototype.step=VV(U_e.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);U_e.prototype.wrap=VV(U_e.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);U_e.prototype.unwrap=VV(U_e.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Qzi.prototype.step=VV(Qzi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var NFc=VV(Q_e.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}]),MFc=VV(Q_e.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),OFc=VV(Q_e.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:qzi}},{name:"callback",type:"function",required:!1}]),LFc=VV(Q_e.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);jzi.exports={initializeClient:OFc,initializeServer:LFc,principalDetails:MFc,checkPassword:NFc,GSS_C_DELEG_FLAG:CFc,GSS_C_MUTUAL_FLAG:bFc,GSS_C_REPLAY_FLAG:SFc,GSS_C_SEQUENCE_FLAG:TFc,GSS_C_CONF_FLAG:IFc,GSS_C_INTEG_FLAG:xFc,GSS_C_ANON_FLAG:wFc,GSS_C_PROT_READY_FLAG:RFc,GSS_C_TRANS_FLAG:kFc,GSS_C_NO_OID:qzi,GSS_MECH_OID_KRB5:PFc,GSS_MECH_OID_SPNEGO:DFc}});var Hzi=I((xUh,BFc)=>{BFc.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 $zi=I((wUh,Gzi)=>{"use strict";p();var FFc=require("dns"),UFc=J3r(),Z3r=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=QFc(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();FFc.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}`;UFc.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 QFc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=qFc(t),r(null,o)})}}a(QFc,"firstTransition");function qFc(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=jFc(t),r(null,o||"")})}}a(qFc,"secondTransition");function jFc(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=HFc(t),r(null,c)})})}}a(jFc,"thirdTransition");function HFc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(HFc,"fourthTransition");Gzi.exports={MongoAuthProcess:Z3r}});var Wzi=I((PUh,_Fe)=>{"use strict";p();var Vzi=J3r();_Fe.exports=Vzi;_Fe.exports.Kerberos=Vzi;_Fe.exports.version=Hzi().version;_Fe.exports.processes={MongoAuthProcess:$zi().MongoAuthProcess}});var _oo={};ki(_oo,{AbortError:()=>R1,DirectConnectError:()=>mk,DirectConnectTransport:()=>t6r,EXIT_REASONS:()=>C9c,HOOK_EVENTS:()=>ywt,InMemorySessionStore:()=>r8r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>b9c,createSdkMcpServer:()=>tZc,deleteSession:()=>trl,filterEscalatingDefaultMode:()=>Qtl,foldSessionSummary:()=>pZi,forkSession:()=>rrl,getSessionInfo:()=>Ztl,getSessionMessages:()=>Ktl,getSubagentMessages:()=>srl,importSessionToStore:()=>nrl,listSessions:()=>Jtl,listSubagents:()=>orl,parseDirectConnectUrl:()=>iZc,query:()=>ztl,renameSession:()=>Xtl,resolveSettings:()=>jtl,startup:()=>Ytl,tagSession:()=>erl,tool:()=>eZc});function q8c(t){return this[t]}function $8c(t,e){this[t]=G8c.bind(null,e)}function t8r(t=_9c){let e=new AbortController;return(0,cZi.setMaxListeners)(t,e.signal),e}function lZi(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 v9c(t,e){t(Error(e))}function Vie(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(v9c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function T6r(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=T9c.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(!S9c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function pZi(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=R9c(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)}k9c(c,l);for(let[d,f]of Object.entries(I9c)){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 x9c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=YV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=YV(r.customTitle)||YV(r.aiTitle)||void 0,s=o||YV(r.lastPrompt)||YV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:YV(r.gitBranch)||void 0,cwd:YV(r.cwd)||e||void 0,tag:YV(r.tag)||void 0,createdAt:w9c(r.createdAt)}:null}function YV(t){return typeof t=="string"?t:void 0}function w9c(t){return typeof t=="number"?t:void 0}function R9c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function k9c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=T6r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function hZi(){return process.versions.bun!==void 0}function s_(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 D8e(){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 B9c(t){var e=O9c.call(t,bFe),r=t[bFe];try{t[bFe]=void 0;var n=!0}catch{}var o=L9c.call(t);return n&&(e?t[bFe]=r:delete t[bFe]),o}function q9c(t){return Q9c.call(t)}function $9c(t){return t==null?t===void 0?G9c:H9c:MYi&&MYi in Object(t)?F9c(t):j9c(t)}function V9c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function J9c(t){if(!z9(t))return!1;var e=N8e(t);return e==z9c||e==Y9c||e==W9c||e==K9c}function X9c(t){return!!OYi&&OYi in t}function nUc(t){if(t!=null){try{return rUc.call(t)}catch{}try{return t+""}catch{}}return""}function fUc(t){if(!z9(t)||eUc(t))return!1;var e=I6r(t)?dUc:sUc;return e.test(iUc(t))}function hUc(t,e){return t?.[e]}function gUc(t,e){var r=mUc(t,e);return pUc(r)?r:void 0}function yUc(){this.__data__=n8e?n8e(null):{},this.size=0}function _Uc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function TUc(t){var e=this.__data__;if(n8e){var r=e[t];return r===CUc?void 0:r}return SUc.call(e,t)?e[t]:void 0}function RUc(t){var e=this.__data__;return n8e?e[t]!==void 0:wUc.call(e,t)}function DUc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n8e&&e===void 0?PUc:e,this}function Ove(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function VUc(t,e){var r=this.__data__,n=_wt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Lve(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 y7c(){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 CZi(...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 bZi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return CZi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function P6r(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 E7c(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 v7c(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 Ri(`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 TZi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new nu(`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 nu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function IZi(t,e){let r=await w7c(t),n;try{n=JSON.parse(r)}catch{throw new nu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,gk(r),e)}if(!n.access_token)throw new nu(`Token endpoint response missing access_token: ${JSON.stringify(gk(n))}`,t.status,gk(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new nu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,gk(n),e);return n}function gk(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=bFr?t:t.slice(0,bFr)+`... <${t.length-bFr} more chars>`}return JSON.stringify(gk(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))x7c.has(r)&&(e[r]=n);return e}return null}async function xZi(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 nu(`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 nu(`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 wZi(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 w7c(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>jYi){let l=jYi-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 Wie(){return Math.floor(Date.now()/1e3)}function R7c(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 N6r(t){let e;return(HYi??(e=new globalThis.TextEncoder,HYi=e.encode.bind(e)))(t)}function $Yi(t){let e;return(GYi??(e=new globalThis.TextDecoder,GYi=e.decode.bind(e)))(t)}function GFe(){}function _It(t,e,r){return!e||rxt[t]>rxt[r]?GFe:e[t].bind(e)}function oA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return k7c;let n=WYi.get(e);if(n&&n[0]===r)return n[1];let o={error:_It("error",e,r),warn:_It("warn",e,r),info:_It("info",e,r),debug:_It("debug",e,r)};return WYi.set(e,[r,o]),o}function kZi(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(!P7c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function zYi(t){if(!t)throw new Ri("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 Ri(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ri(`Identity token file at ${t} is empty`);return n}}function O7c(t){if(!t)throw new Ri("Identity token value is empty");return()=>t}function L7c(t){return async()=>{TZi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new nu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:C7c,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}${SZi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${txt},${S7c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${nW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new nu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=gk(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 nu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await IZi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new nu(`Token endpoint response missing required fields: ${JSON.stringify(gk(c))}`,o.status,gk(c),s);return{token:c.access_token,expiresAt:Wie()+l}}}function B7c(t){return async e=>{let r=await import("node:fs");await xZi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new nu(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new nu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new nu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Wie()"");throw new nu(`User OAuth refresh failed (HTTP ${f.status}): ${gk(E)}`,f.status,gk(E),h)}let m=await IZi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new nu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(gk(m))}`,f.status,gk(m),h);let A=Wie()+g,y=m.refresh_token||l;return await wZi(t.credentialsPath,{...o,version:RZi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function DZi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=U7c(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 F7c(t,e){let r=await D7c(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 N7c(n,e)??void 0}};return DZi(s,t)}function U7c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=Q7c(o);if(!s)throw new nu("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 nu("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 nu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=L7c({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?q7c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new nu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return B7c({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 nu(`authentication.type "${o}" is not a known authentication type`)}}}function Q7c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new nu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new nu('identity_token.source "file" requires a non-empty path');return zYi(t.identity_token.path)}let e=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return zYi(e);let r=tu("ANTHROPIC_IDENTITY_TOKEN");return r?O7c(r):null}function q7c(t,e,r,n){return async o=>{let s=await import("node:fs");await xZi(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||Wie()0&&(yield e)}function V7c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function NZi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return oA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Xie.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 MZi(u,r)}return await r.text()})();return oA(t).debug(`[${n}] response parsed`,Gie({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function MZi(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 sve(t,e,r){return OZi(),new File(t,e??"unknown_file",r)}function QIt(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 W7c(t){let e=typeof t=="function"?t:t.fetch,r=YYi.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 YYi.set(e,n),n}async function Z7c(t,e,r){if(OZi(),t=await t,e||(e=QIt(t,!0)),K7c(t))return t instanceof File&&e==null&&r==null?t:sve([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(J7c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),sve(await u8r(o),e,r)}let n=await u8r(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 sve(n,e,r)}async function u8r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(BZi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(LZi(t))for await(let r of t)e.push(...await u8r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${X7c(t)}`)}return e}function X7c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*eQc(t){if(!t)return;if(FZi 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():BYi(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=BYi(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 UZi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function qIt(t){return typeof t=="object"&&t!==null&&XFe in t}function QZi(t,e){let r=new Set;if(t)for(let n of t)qIt(n)&&r.add(n[XFe]);if(e){for(let n of e)if(qIt(n)&&r.add(n[XFe]),Array.isArray(n.content))for(let o of n.content)qIt(o)&&r.add(o[XFe])}return Array.from(r)}function qZi(t,e){let r=QZi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function rQc(t){return qIt(t)?{"x-stainless-helper":t[XFe]}:{}}function HZi(t){return t?.output_format??t?.output_config?.format}function JYi(t,e,r){let n=HZi(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}:GZi(t,e,r)}function GZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=nQc(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 nQc(t,e){let r=HZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function tKi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function nKi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function lQc(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 hxt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function oKi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ri("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 VZi(t){return t?.output_config?.format}function sKi(t,e,r){let n=VZi(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}:WZi(t,e,r)}function WZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=dQc(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 dQc(t,e){let r=VZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function uKi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function M8e(t){return t instanceof Error?t:Error(String(t))}function HIt(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 O8e(t){return PI(t)==="ENOENT"}function YZi(t){return PI(t)==="EISDIR"}function mQc(t){let e=PI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function yQc(t,e,r){let n=`${t}.tmp.${(0,ZZi.randomBytes)(4).toString("hex")}`;try{await(0,jL.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,jL.rename)(n,t)}catch(o){let s=PI(o);if(s!==void 0&&gQc.has(s)){try{await(0,jL.copyFile)(n,t)}catch(c){throw AQc.has(PI(c)??"")&&await(0,jL.unlink)(t).catch(()=>{}),c}await(0,jL.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,jL.unlink)(n).catch(()=>{}),o}}function bxt(){return EQc.getStore()??new g8r}function XZi(){if(K_e)return K_e;if(!s_(process.env.DEBUG_CLAUDE_AGENT_SDK))return zie=null,K_e=Promise.resolve(),K_e;let t=(0,m8r.join)(Fve(),"debug");return zie=(0,m8r.join)(t,`sdk-${(0,KZi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${zie} -`),K_e=bxt().mkdir(t).catch(()=>{}),K_e}function _Qc(){return XZi(),zie??null}function pk(t){if(zie===null)return;let e=`${new Date().toISOString()} ${t} -`;XZi().then(()=>{zie&&bxt().append(zie,e).catch(()=>{})})}function vQc(){this.__data__=new vwt,this.size=0}function bQc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function TQc(t){return this.__data__.get(t)}function xQc(t){return this.__data__.has(t)}function kQc(t,e){var r=this.__data__;if(r instanceof vwt){var n=r.__data__;if(!AZi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=nqc}function Rqc(t){return Qve(t)&&U6r(t.length)&&!!Cd[N8e(t)]}function Pqc(t){return function(e){return t(e)}}function Fqc(t,e){var r=lW(t),n=!r&&l8e(t),o=!r&&!n&&F6r(t),s=!r&&!n&&!o&&iXi(t),c=r||n||o||s,l=c?qQc(t.length,String):[],u=l.length;for(var d in t)(e||Bqc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||bwt(d,u)))&&l.push(d);return l}function qqc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qqc;return t===r}function jqc(t,e){return function(r){return t(e(r))}}function Gqc(t){return t!=null&&U6r(t.length)&&!I6r(t)}function $qc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Yqc(t){if(!z9(t))return Vqc(t);var e=oXi(t),r=[];for(var n in t)n=="constructor"&&(e||!zqc.call(t,n))||r.push(n);return r}function Jqc(t){return Q6r(t)?Uqc(t,!0):Kqc(t)}function Xqc(t,e){if(e)return t.slice();var r=t.length,n=yKi?yKi(r):new t.constructor(r);return t.copy(n),n}function ejc(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 dHc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function pHc(t){return fHc.register(t)}function mHc(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 gHc(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 AHc(t,e){if(!e)return!0;let r=mHc(t);return gHc(r,e)}function yHc(t){return/^[\\/]{2}/.test(t)}function EHc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function bKi(t){try{return EHc(hXi.realpathSync.native(t))}catch{return null}}function _Hc(t,e){let r=(0,HL.resolve)(e).toLowerCase(),n=(0,HL.resolve)(t).toLowerCase();if((0,HL.dirname)(n)===r||n.startsWith(r+HL.sep))return!0;let o=bKi(e)?.toLowerCase();if(o==null)return!1;let s=bKi((0,HL.dirname)((0,HL.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+HL.sep)}function mXi(t,e){if(yHc(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 DI(){return CHc}function bHc(t,e){t.destroyed||t.write(e)}function SHc(t){bHc(process.stderr,t)}function THc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function IHc(t,e,r=e+"s"){return t===1?e:r}function xHc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function PHc(t){return kHc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function DHc(t){IKi??=PHc(!0);for(let e of IKi)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 Twt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function LHc(t){if(!v8r()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=OHc();return AHc(t,e)}async function yXi(t,e,r=FHc){if(UFe<0?UFe=await(0,l_.stat)(t).then(n=>n.size).catch(()=>0):UFe+=e,!(UFe<=r||OFr)){OFr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,l_.rename)(t,n)}catch(o){O8e(o)||(await(0,l_.unlink)(n).catch(()=>{}),await(0,l_.rename)(t,n).catch(()=>(0,l_.unlink)(t).catch(()=>{})))}UFe=0}finally{OFr=!1}}}function EXi(t){return C8r=(0,soe.join)(t,`${pXi()}.txt`),C8r}async function UHc(t,e,r,n){t&&await(0,l_.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,l_.appendFile)(r,n)}catch(s){if(!YZi(s))throw s;o=EXi(r),await(0,l_.appendFile)(o,n)}await yXi(o,Buffer.byteLength(n)).catch(b8r),vXi()}function b8r(){}function QHc(){if(!OIt){let t=null;OIt=uHc({writeFn:a(e=>{let r=_Xi(),n=(0,soe.dirname)(r),o=t!==n;if(t=n,v8r()){if(o)try{DI().mkdirSync(n)}catch{}let s=r;try{DI().appendFileSync(r,e)}catch(c){if(!YZi(c))throw c;s=EXi(r),DI().appendFileSync(s,e)}yXi(s,Buffer.byteLength(e)).catch(b8r),vXi();return}MFr=MFr.then(UHc.bind(null,o,n,r,e)).catch(b8r)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:v8r()}),pHc(async()=>{OIt?.dispose(),await MFr})}return OIt}function ru(t,{level:e}={level:"debug"}){if(_8r[e]<_8r[NHc()]||!LHc(t))return;BHc&&t.includes(` -`)&&(t=Qm(t));let r=`${new Date().toISOString()} [${e.toUpperCase()}] ${DHc(t.trim())} -`;if(gXi()){SHc(r);return}QHc().write(r)}function _Xi(){return AXi()??C8r??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??(0,soe.join)(Fve(),"debug",`${pXi()}.txt`)}function jHc(){return qHc}function Qm(t,e,r){let n=[];try{let c=ef(n,rf`JSON.stringify(${t})`,0);return JSON.stringify(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}}function HHc(t){return JSON.parse(t)}function uW(t,e){let r=[];try{let s=ef(r,rf`structuredClone(${t})`,0);return structuredClone(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}}function GHc(t){let e=t.trim();return e.startsWith("{")&&e.endsWith("}")}function $Hc(t,e){let r={...t};if(e){let n=e.enabled===!0&&e.failIfUnavailable===void 0?{...e,failIfUnavailable:!0}:e,o=r.settings;if(o&&!GHc(o))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let s={sandbox:n};if(o)try{s={...GN(o),sandbox:n}}catch{}r.settings=Qm(s)}return r}function WHc(){for(let t of xxt)if(!t.killed)if(process.platform==="win32")try{t.stdin.end()}catch{}else t.kill("SIGTERM")}function zHc(t){xxt.add(t),!xKi&&(xKi=!0,process.on("exit",WHc))}function YHc(t){return![".js",".mjs",".tsx",".ts",".jsx"].some(e=>t.endsWith(e))}function KHc(t,e){return(0,dZi.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 JHc(){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 ZHc(t,e=process.platform,r=process.arch,n=CXi.existsSync,o=JHc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${J_e}-linux-${r}-android`]:e==="linux"?o?[`${J_e}-linux-${r}-musl`,`${J_e}-linux-${r}`]:[`${J_e}-linux-${r}`,`${J_e}-linux-${r}-musl`]:[`${J_e}-${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 XHc(){return{eventQueue:[],sink:null}}function V6r(t,e){let r=eGc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function bXi(t){V6r("tengu_feature_ok",{feature_name:t})}function SXi(t,e,r){V6r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function tGc(t,e,r){V6r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function q9(t,e,r){try{let n=await e();return bXi(t),n}catch(n){throw SXi(t,r?.(n)??"error"),n}}function nGc(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 t8e(t){if(typeof t=="string")return nGc(t);if(Array.isArray(t))return t.map(t8e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[t8e(r)]=t8e(n);return e}return t}function iGc(){return process.platform==="win32"}function sGc(t){let e=LFr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,kXi.join)(r,"System32","where.exe");try{let o=(0,RXi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:oGc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!_Hc(c,s))return LFr.set(t,c),c;return null}catch(o){return aGc(o)&&LFr.set(t,null),null}}function aGc(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 cGc(t){return!iGc()||t.includes("/")||t.includes("\\")?t:sGc(t)}async function L8e(t){let e=cGc("git");if(e===null)return[];try{let{stdout:r}=await lGc(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 uGc(t){let e=0;for(let r=0;ro&&(n=PXi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function R8r(t,e){let r=(0,IXi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,w8r.once)(r,"drain");r.end(),await(0,w8r.once)(r,"finish")}catch(n){throw r.destroy(),n}}function DXi(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=T6r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function fGc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=T6r(r,e);if(n!==void 0)return n}return e.commandFallback}async function NXi(t){try{let e=await(0,UN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe($9),o=await e.read(n,0,$9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-$9),l=s;if(c>0){let u=await e.read(n,0,$9,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 pGc(t){return Math.abs(uGc(t)).toString(36)}function B8e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=u8e?e:`${e.slice(0,u8e)}-${pGc(t)}`}function hW(){return(0,mve.join)(Fve(),"projects")}function hGc(t){return(0,mve.join)(hW(),B8e(t))}async function F8e(t){try{return(await(0,UN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function BN(t){let e=hGc(t),r=[];try{await(0,UN.readdir)(e),r.push(e)}catch{}let n=B8e(t);if(n.length<=u8e)return r;let o=n.slice(0,u8e)+"-",s=hW();try{for(let c of await(0,UN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,mve.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function Iwt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,mve.join)(c,r);try{let d=await(0,UN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await F8e(e);for(let u of await BN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await BN(u)){let f=await n(d,u);if(f)return f}return}let o=hW(),s;try{s=await(0,UN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,mve.join)(o,c),void 0);if(l)return l}}function yGc(){return AGc??=Buffer.from('"compact_boundary"')}function MXi(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 Yie(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 Rxt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function CGc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(d8e);if(o===-1||o>=r)return 0;let s=o+1;if(Rxt(n,kxt,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 TGc(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 IGc(t){if(t.carryLen>0){let e=t.carryBuf;Rxt(e,kxt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Yie(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==d8e&&Yie(t.out,_Gc,0,1),Yie(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function xGc(t,e){let r=yGc(),n=mGc,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,UN.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=bGc(o,f,r);SGc(o,f,s,h.lastSnapStart,h.lastSnapEnd),TGc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}IGc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function wGc(t,e){try{return e>gGc&&!s_(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await xGc(t,e)).postBoundaryBuf:await(0,TXi.readFile)(t)}catch{return null}}function RGc(t){let e=[];try{let o=ef(e,rf`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=HHc(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{tf(e,r,n)}}function kGc(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(),DGc(e,d,f)}function FFr(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 PGc(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 DGc(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=FFr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=FFr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(PGc(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=FFr(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 NGc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function OXi(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 LXi(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 MGc(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 BXi(r,e)}function BXi(t,e){let r=kGc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>NGc(s,n)).map(s=>OXi(s));return LXi(o,e)}async function OGc(t,e){if(!bh(t))return[];let r=await Iwt(t,e?.dir);if(!r)return[];let n=await wGc(r.filePath,r.fileSize);return n?BXi(RGc(n),e):[]}function xwt(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=hk(o,"customTitle")||hk(n,"customTitle")||hk(o,"aiTitle")||hk(n,"aiTitle")||void 0,f=DXi(n)||void 0,h=BFr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||hk(o,"lastPrompt")||hk(o,"summary")||f;if(!g)return null;let A=hk(o,"gitBranch")||BFr(n,"gitBranch")||void 0,y=BFr(n,"cwd")||r||void 0,E=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&hk(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 YFe(t,e,r){let n;try{n=await(0,qve.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=bh(o.slice(0,-6));if(!s)return null;let c=(0,jve.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,qve.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function FXi(t){let e=await NXi(t.filePath);if(!e)return null;let r=xwt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function BGc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function FGc(t,e,r){t.sort(BGc);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 QGc(t,e,r){let n=await F8e(t),o;if(e)try{o=await L8e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await BN(n))h.push(...await YFe(m,r,n));return h}let s=hW(),c=process.platform==="win32",l=o.map(h=>{let m=B8e(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,qve.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await BN(n))h.push(...await YFe(m,r,n));return h}let d=[],f=new Set;for(let h of await BN(n)){let m=(0,jve.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await YFe(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>=u8e&&m.startsWith(A+"-")){f.add(m),d.push(...await YFe((0,jve.join)(s,h.name),r,g));break}}}return d}async function qGc(t){let e=hW(),r;try{r=await(0,qve.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>YFe((0,jve.join)(e,n.name),t)))).flat()}async function jGc(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 QGc(e,o??!0,c):await qGc(c);return c?FGc(l,r,s):UGc(l)}async function HGc(t,e={}){let r=bh(t);if(!r)return;let n=await Iwt(r,e.dir);if(!n)return;let o=await NXi(n.filePath);if(o)return xwt(r,o,n.projectPath)??void 0}async function GGc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=Qm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await UXi(t,n,r)}async function $Gc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=t8e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=Qm({type:"tag",tag:e??"",sessionId:t})+` -`;await UXi(t,n,r)}async function VGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await WGc(e)){let n=(0,Kie.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,GL.stat)(n))}catch(s){let c=PI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,GL.rm)(n,{force:!0}),await(0,GL.rm)((0,Kie.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 WGc(t){if(t.dir){let r=await F8e(t.dir),n=await BN(r),o;try{o=await L8e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await BN(s));return n}let e=hW();try{return(await(0,GL.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Kie.join)(e,r.name))}catch{return[]}}async function UXi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await F8e(r.dir);for(let u of await BN(c))if(await UFr((0,Kie.join)(u,n),e))return;let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await BN(u))if(await UFr((0,Kie.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=hW(),s;try{s=await(0,GL.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await UFr((0,Kie.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function UFr(t,e){let r;try{r=await(0,GL.open)(t,k8r.constants.O_WRONLY|k8r.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 zGc(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await bxt().readBytes((0,Pxt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await F8e(e);for(let u of await BN(c)){let d=await n(u);if(d)return d}let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await BN(u)){let f=await n(d);if(f)return f}return null}let o=hW(),s;try{s=await bxt().list(o)}catch{return null}for(let c of s){let l=await n((0,Pxt.join)(o,c));if(l)return l}return null}function KGc(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{QXi(GN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function JGc(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||QXi(o,e,r,n);return{transcript:r,contentReplacements:n}}function QXi(t,e,r,n){YGc.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 ZGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!bh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await zGc(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}=XGc(r.buf,t,e);return await R8r((0,Pxt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function XGc(t,e,r){let n=KGc(t,e);return qXi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,$9)),c=t.toString("utf-8",Math.max(0,o-$9));return hk(c,"customTitle")||hk(s,"customTitle")||hk(c,"aiTitle")||hk(s,"aiTitle")||DXi(s)})}function e$c(t,e,r){let n=JGc(t,e);return qXi(n,e,r,()=>t$c(t))}function t$c(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||fGc(t)||void 0}function qXi(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,KFe.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,KFe.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,KFe.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,KFe.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function jXi(t,e){let r=await Iwt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,Dxt.join)(n,"subagents")}async function HXi(t){let e=[];async function r(n){let o;try{o=await(0,f8e.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,Dxt.join)(n,s.name)})}else s.isDirectory()&&await r((0,Dxt.join)(n,s.name))}return a(r,"J"),await r(t),e}function r$c(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=GN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function n$c(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 i$c(t,e){if(!bh(t))return[];let r=await jXi(t,e?.dir);return r?(await HXi(r)).map(n=>n.agentId):[]}async function o$c(t,e,r){if(!bh(t))return[];if(!e)return[];let n=await jXi(t,r?.dir);if(!n)return[];let o=(await HXi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,f8e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=GN(await(0,f8e.readFile)(l,"utf-8")).toolUseId}catch{}return GXi(s,r,c)}function GXi(t,e,r){if(t.length===0)return[];let n=r$c(t),o=n$c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>OXi(s,r));return LXi(o,e)}function WXi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function zXi(t){return[...new Set(t)]}function s$c(){return"prod"}function f$c(){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 h$c(){let t=(()=>{switch(s$c()){case"local":return f$c();case"staging":return d$c??RKi;case"prod":return RKi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!p$c.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 g$c(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"):Fve(),o=r?"":`-${(0,$Xi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${h$c().OAUTH_FILE_SUFFIX}${t}${o}`}function y$c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,VXi.userInfo)().username}catch{t="claude-code-user"}return A$c.test(t)?t:"claude-code-user"}function P8r(){return _$c}function ln(t,e){let r=P8r(),n=D8r({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===p8e?void 0:p8e].filter(o=>!!o)});t.common.issues.push(n)}function Zo(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 JXi(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 B$c(t){return new RegExp(`^${JXi(t)}$`)}function F$c(t){let e=`${KXi}T${JXi(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 U$c(t,e){return!!((e==="v4"||!e)&&k$c.test(t)||(e==="v6"||!e)&&D$c.test(t))}function Q$c(t,e){if(!I$c.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 q$c(t,e){return!!((e==="v4"||!e)&&P$c.test(t)||(e==="v6"||!e)&&N$c.test(t))}function j$c(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 tve(t){if(t instanceof NI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ek.create(tve(n))}return new NI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof dW?new dW({...t._def,type:tve(t.element)}):t instanceof Ek?Ek.create(tve(t.unwrap())):t instanceof K9?K9.create(tve(t.unwrap())):t instanceof Y9?Y9.create(t.items.map(e=>tve(e))):t}function M8r(t,e){let r=tW(t),n=tW(e);if(t===e)return{valid:!0,data:t};if(r===kn.object&&n===kn.object){let o=hc.objectKeys(e),s=hc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=M8r(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===kn.array&&n===kn.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 Xv(t){return t&&Object.assign(Lxt,t),Lxt}function G$c(t){return t}function $$c(t){return t}function V$c(t){}function W$c(t){throw Error()}function z$c(t){}function Y6r(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 Vr(t,e="|"){return t.map(r=>us(r)).join(e)}function reo(t,e){return typeof e=="bigint"?e.toString():e}function wwt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function aoe(t){return t==null}function Rwt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function neo(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 zc(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 K6r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Y$c(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function K$c(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 eVc(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 us(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function seo(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function tVc(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 $N(t,{...t._zod.def,shape:r,checks:[]})}function rVc(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 $N(t,{...t._zod.def,shape:r,checks:[]})}function nVc(t,e){if(!T8e(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 K6r(this,"shape",n),n},checks:[]};return $N(t,r)}function iVc(t,e){return $N(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return K6r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function oVc(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 $N(e,{...e._zod.def,shape:o,checks:[]})}function sVc(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 $N(e,{...e._zod.def,shape:o,checks:[]})}function ave(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function ZFe(t){return typeof t=="string"?t:t?.message}function qN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=ZFe(t.inst?._zod.def?.error?.(t))??ZFe(e?.error?.(t))??ZFe(r.customError?.(t))??ZFe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function kwt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Pwt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function leo(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function aVc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function X6r(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 e9r(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 ${feo(n.path)}`);return e.join(` -`)}function beo(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Neo(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 Meo(t){return new RegExp(`^${Neo(t)}$`)}function Oeo(t){let e=Neo({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(`^${Peo}T(?:${n})$`)}function MKi(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues))}function l9r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Pto(t){if(!s9r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return l9r(r)}function Mto(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 OKi(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues)),e.value[r]=t.value}function LIt(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues)),e.value[r]=t.value}function LKi(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(...Ak(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function BKi(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=>qN(s,n,Xv())))}),e}function F8r(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(T8e(t)&&T8e(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=F8r(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;nqN(l,c,Xv()))})),e.issues.length&&(Bxt.has(typeof n)?r.issues.push(...Ak(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>qN(l,c,Xv()))})),r.value.set(t.value,e.value)}function QKi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function qKi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function jKi(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 HKi(t,e,r){return ave(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function GKi(t){return t.value=Object.freeze(t.value),t}function $Ki(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(leo(o))}}function EVc(){return{localeError:yVc()}}function vVc(){return{localeError:_Vc()}}function VKi(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 bVc(){return{localeError:CVc()}}function TVc(){return{localeError:SVc()}}function xVc(){return{localeError:IVc()}}function RVc(){return{localeError:wVc()}}function pro(){return{localeError:PVc()}}function MVc(){return{localeError:NVc()}}function LVc(){return{localeError:OVc()}}function FVc(){return{localeError:BVc()}}function QVc(){return{localeError:UVc()}}function jVc(){return{localeError:qVc()}}function GVc(){return{localeError:HVc()}}function VVc(){return{localeError:$Vc()}}function zVc(){return{localeError:WVc()}}function KVc(){return{localeError:YVc()}}function ZVc(){return{localeError:JVc()}}function eWc(){return{localeError:XVc()}}function rWc(){return{localeError:tWc()}}function iWc(){return{localeError:nWc()}}function sWc(){return{localeError:oWc()}}function cWc(){return{localeError:aWc()}}function uWc(){return{localeError:lWc()}}function fWc(){return{localeError:dWc()}}function hWc(){return{localeError:pWc()}}function gWc(){return{localeError:mWc()}}function yWc(){return{localeError:AWc()}}function _Wc(){return{localeError:EWc()}}function WKi(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 CWc(){return{localeError:vWc()}}function SWc(){return{localeError:bWc()}}function IWc(){return{localeError:TWc()}}function wWc(){return{localeError:xWc()}}function kWc(){return{localeError:RWc()}}function NWc(){return{localeError:DWc()}}function OWc(){return{localeError:MWc()}}function BWc(){return{localeError:LWc()}}function UWc(){return{localeError:FWc()}}function qWc(){return{localeError:QWc()}}function HWc(){return{localeError:jWc()}}function E9r(){return new I8e}function gro(t,e){return new t({type:"string",...xr(e)})}function Aro(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function _9r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function jxt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function v9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function C9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function b9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function S9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function T9r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function I9r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function x9r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function w9r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function R9r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function k9r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function P9r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function D9r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function N9r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function M9r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function O9r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function L9r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function B9r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function F9r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function U9r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function Q9r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function Ero(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function _ro(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function vro(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function Cro(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function bro(t,e){return new t({type:"number",checks:[],...xr(e)})}function Sro(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function Tro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function Iro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function xro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function wro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function Rro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function kro(t,e){return new t({type:"boolean",...xr(e)})}function Pro(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function Dro(t,e){return new t({type:"bigint",...xr(e)})}function Nro(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Mro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function Oro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function Lro(t,e){return new t({type:"symbol",...xr(e)})}function Bro(t,e){return new t({type:"undefined",...xr(e)})}function Fro(t,e){return new t({type:"null",...xr(e)})}function Uro(t){return new t({type:"any"})}function Hxt(t){return new t({type:"unknown"})}function Qro(t,e){return new t({type:"never",...xr(e)})}function qro(t,e){return new t({type:"void",...xr(e)})}function jro(t,e){return new t({type:"date",...xr(e)})}function Hro(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function Gro(t,e){return new t({type:"nan",...xr(e)})}function noe(t,e){return new a9r({check:"less_than",...xr(e),value:t,inclusive:!1})}function FN(t,e){return new a9r({check:"less_than",...xr(e),value:t,inclusive:!0})}function ioe(t,e){return new c9r({check:"greater_than",...xr(e),value:t,inclusive:!1})}function RI(t,e){return new c9r({check:"greater_than",...xr(e),value:t,inclusive:!0})}function $ro(t){return ioe(0,t)}function Vro(t){return noe(0,t)}function Wro(t){return FN(0,t)}function zro(t){return RI(0,t)}function x8e(t,e){return new Veo({check:"multiple_of",...xr(e),value:t})}function Owt(t,e){return new Yeo({check:"max_size",...xr(e),maximum:t})}function w8e(t,e){return new Keo({check:"min_size",...xr(e),minimum:t})}function q9r(t,e){return new Jeo({check:"size_equals",...xr(e),size:t})}function Lwt(t,e){return new Zeo({check:"max_length",...xr(e),maximum:t})}function kve(t,e){return new Xeo({check:"min_length",...xr(e),minimum:t})}function Bwt(t,e){return new eto({check:"length_equals",...xr(e),length:t})}function j9r(t,e){return new tto({check:"string_format",format:"regex",...xr(e),pattern:t})}function H9r(t){return new rto({check:"string_format",format:"lowercase",...xr(t)})}function G9r(t){return new nto({check:"string_format",format:"uppercase",...xr(t)})}function $9r(t,e){return new ito({check:"string_format",format:"includes",...xr(e),includes:t})}function V9r(t,e){return new oto({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function W9r(t,e){return new sto({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function Yro(t,e,r){return new ato({check:"property",property:t,schema:e,...xr(r)})}function z9r(t,e){return new cto({check:"mime_type",mime:t,...xr(e)})}function loe(t){return new lto({check:"overwrite",tx:t})}function Y9r(t){return loe(e=>e.normalize(t))}function K9r(){return loe(t=>t.trim())}function J9r(){return loe(t=>t.toLowerCase())}function Z9r(){return loe(t=>t.toUpperCase())}function X9r(t,e,r){return new t({type:"array",element:e,...xr(r)})}function GWc(t,e,r){return new t({type:"union",options:e,...xr(r)})}function $Wc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function VWc(t,e,r){return new t({type:"intersection",left:e,right:r})}function Kro(t,e,r,n){let o=r instanceof Co;return new t({type:"tuple",items:e,rest:o?r:null,...xr(o?n:r)})}function WWc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function zWc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function YWc(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function KWc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...xr(r)})}function JWc(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function ZWc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function Jro(t,e){return new t({type:"file",...xr(e)})}function XWc(t,e){return new t({type:"transform",transform:e})}function ezc(t,e){return new t({type:"optional",innerType:e})}function tzc(t,e){return new t({type:"nullable",innerType:e})}function rzc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function nzc(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function izc(t,e){return new t({type:"success",innerType:e})}function ozc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function szc(t,e,r){return new t({type:"pipe",in:e,out:r})}function azc(t,e){return new t({type:"readonly",innerType:e})}function czc(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function lzc(t,e){return new t({type:"lazy",getter:e})}function uzc(t,e){return new t({type:"promise",innerType:e})}function Zro(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Xro(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function eno(t,e){let r=xr(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??A9r,u=t.Boolean??d9r,d=t.String??q8e,f=new(t.Transform??g9r)({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 tno(t,e,r,n={}){let o=xr(n),s={...xr(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 rno(t){return new Gxt({type:"function",input:Array.isArray(t?.input)?Kro(Mwt,t?.input):t?.input??X9r(p9r,Hxt(qxt)),output:t?.output??Hxt(qxt)})}function eUr(t,e){if(t instanceof I8e){let n=new R8e(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 R8e(e);return r.process(t),r.emit(t,e)}function q0(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 q0(n.element,r);case"object":{for(let o in n.shape)if(q0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(q0(o,r))return!0;return!1}case"intersection":return q0(n.left,r)||q0(n.right,r);case"tuple":{for(let o of n.items)if(q0(o,r))return!0;return!!(n.rest&&q0(n.rest,r))}case"record":return q0(n.keyType,r)||q0(n.valueType,r);case"map":return q0(n.keyType,r)||q0(n.valueType,r);case"set":return q0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return q0(n.innerType,r);case"lazy":return q0(n.getter(),r);case"default":return q0(n.innerType,r);case"prefault":return q0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return q0(n.in,r)||q0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function zKi(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new pzc(r)}function VL(t){return!!t._zod}function nve(t){let e=Object.values(t);if(e.length===0)return zKi({});let r=e.every(VL),n=e.every(o=>!VL(o));if(r)return zKi(t);if(n)return H$c(t);throw Error("Mixed Zod versions detected in object shape.")}function r8e(t,e){return VL(t)?Dwt(t,e):t.safeParse(e)}async function qFr(t,e){return VL(t)?await Nwt(t,e):await t.safeParseAsync(e)}function j8e(t){if(!t)return;let e;if(VL(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function QFe(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 nve(t)}}if(VL(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 jFr(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 hzc(t){return t.description}function mzc(t){if(VL(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function nno(t){if(VL(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 ino(t){return Ero(rUr,t)}function ono(t){return _ro(nUr,t)}function sno(t){return vro(iUr,t)}function ano(t){return Cro(oUr,t)}function It(t){return gro(Fwt,t)}function Azc(t){return _9r(aUr,t)}function yzc(t){return jxt($xt,t)}function Ezc(t){return v9r(W9,t)}function _zc(t){return C9r(W9,t)}function vzc(t){return b9r(W9,t)}function Czc(t){return S9r(W9,t)}function bzc(t){return T9r(cUr,t)}function Szc(t){return I9r(lUr,t)}function Tzc(t){return x9r(uUr,t)}function Izc(t){return w9r(dUr,t)}function xzc(t){return R9r(fUr,t)}function wzc(t){return k9r(pUr,t)}function Rzc(t){return P9r(hUr,t)}function kzc(t){return D9r(mUr,t)}function Pzc(t){return N9r(gUr,t)}function Dzc(t){return M9r(AUr,t)}function Nzc(t){return O9r(yUr,t)}function Mzc(t){return L9r(EUr,t)}function Ozc(t){return B9r(_Ur,t)}function Lzc(t){return F9r(vUr,t)}function Bzc(t){return U9r(CUr,t)}function Fzc(t){return Q9r(bUr,t)}function Uzc(t,e,r={}){return tno(pno,t,e,r)}function Nc(t){return bro(Uwt,t)}function U8r(t){return Tro(Hve,t)}function Qzc(t){return Iro(Hve,t)}function qzc(t){return xro(Hve,t)}function jzc(t){return wro(Hve,t)}function Hzc(t){return Rro(Hve,t)}function j0(t){return kro(Qwt,t)}function Gzc(t){return Dro(qwt,t)}function $zc(t){return Mro(SUr,t)}function Vzc(t){return Oro(SUr,t)}function Wzc(t){return Lro(hno,t)}function zzc(t){return Bro(mno,t)}function TUr(t){return Fro(gno,t)}function Yzc(){return Uro(Ano)}function of(){return Hxt(yno)}function jwt(t){return Qro(Eno,t)}function Kzc(t){return qro(_no,t)}function Jzc(t){return jro(IUr,t)}function Ca(t,e){return X9r(vno,t,e)}function Zzc(t){let e=t._zod.def.shape;return ti(Object.keys(e))}function Tn(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Hwt(r)}function Xzc(t,e){return new Hwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:jwt(),...Ws.normalizeParams(e)})}function Kv(t,e){return new Hwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:of(),...Ws.normalizeParams(e)})}function ou(t,e){return new xUr({type:"union",options:t,...Ws.normalizeParams(e)})}function wUr(t,e,r){return new Cno({type:"union",options:e,discriminator:t,...Ws.normalizeParams(r)})}function Gwt(t,e){return new bno({type:"intersection",left:t,right:e})}function eYc(t,e,r){let n=e instanceof Co,o=n?r:e;return new Sno({type:"tuple",items:t,rest:n?e:null,...Ws.normalizeParams(o)})}function iu(t,e,r){return new RUr({type:"record",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function tYc(t,e,r){return new RUr({type:"record",keyType:ou([t,jwt()]),valueType:e,...Ws.normalizeParams(r)})}function rYc(t,e,r){return new Tno({type:"map",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function nYc(t,e){return new Ino({type:"set",valueType:t,...Ws.normalizeParams(e)})}function N1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new k8e({type:"enum",entries:r,...Ws.normalizeParams(e)})}function iYc(t,e){return new k8e({type:"enum",entries:t,...Ws.normalizeParams(e)})}function ti(t,e){return new xno({type:"literal",values:Array.isArray(t)?t:[t],...Ws.normalizeParams(e)})}function oYc(t){return Jro(wno,t)}function PUr(t){return new kUr({type:"transform",transform:t})}function bd(t){return new DUr({type:"optional",innerType:t})}function Vxt(t){return new Rno({type:"nullable",innerType:t})}function sYc(t){return bd(Vxt(t))}function Pno(t,e){return new kno({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Nno(t,e){return new Dno({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Mno(t,e){return new NUr({type:"nonoptional",innerType:t,...Ws.normalizeParams(e)})}function aYc(t){return new Ono({type:"success",innerType:t})}function Bno(t,e){return new Lno({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function cYc(t){return Gro(Fno,t)}function Wxt(t,e){return new MUr({type:"pipe",in:t,out:e})}function Qno(t){return new Uno({type:"readonly",innerType:t})}function lYc(t,e){return new qno({type:"template_literal",parts:t,...Ws.normalizeParams(e)})}function Hno(t){return new jno({type:"lazy",getter:t})}function uYc(t){return new Gno({type:"promise",innerType:t})}function $no(t,e){let r=new Sh({check:"custom",...Ws.normalizeParams(e)});return r._zod.check=t,r}function Vno(t,e){return Zro($wt,t??(()=>!0),e)}function Wno(t,e={}){return Xro($wt,t,e)}function zno(t,e){let r=$no(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Ws.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(Ws.issue(s))}},t(n.value,n)),e);return r}function dYc(t,e={error:`Input not instance of ${t.name}`}){let r=new $wt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Ws.normalizeParams(e)});return r._zod.bag.Class=t,r}function pYc(t){let e=Hno(()=>ou([It(t),Nc(),j0(),TUr(),Ca(e),iu(It(),e)]));return e}function OUr(t,e){return Wxt(PUr(t),e)}function mYc(t){Xv({customError:t})}function gYc(){return Xv().customError}function AYc(t){return Aro(Fwt,t)}function yYc(t){return Sro(Uwt,t)}function EYc(t){return Pro(Qwt,t)}function _Yc(t){return Nro(qwt,t)}function vYc(t){return Hro(IUr,t)}function KKc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function JKc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Hie(t){return t==="completed"||t==="failed"||t==="cancelled"}function pio(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Al(t,e,r,n,o){t[e]=r,pio(t,e,n,o)}function D1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?hio(e,t.currentPath):e.join("/")}}function oJc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Dc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Al(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Al(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Al(r,"minItems",t.exactLength.value,t.exactLength.message,e),Al(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function sJc(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?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function aJc(){return{type:"boolean"}}function mio(t,e){return Dc(t.type._def,e)}function gio(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>gio(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 lJc(t,e)}}function uJc(t,e){return{...Dc(t.innerType._def,e),default:t.defaultValue()}}function dJc(t,e){return e.effectStrategy==="input"?Dc(t.schema._def,e):D1(e)}function fJc(t){return{type:"string",enum:Array.from(t.values)}}function hJc(t,e){let r=[Dc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Dc(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(pJc(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 mJc(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 Aio(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Al(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":LN(r,"email",n.message,e);break;case"format:idn-email":LN(r,"idn-email",n.message,e);break;case"pattern:zod":Yv(r,ON.email,n.message,e);break}break;case"url":LN(r,"uri",n.message,e);break;case"uuid":LN(r,"uuid",n.message,e);break;case"regex":Yv(r,n.regex,n.message,e);break;case"cuid":Yv(r,ON.cuid,n.message,e);break;case"cuid2":Yv(r,ON.cuid2,n.message,e);break;case"startsWith":Yv(r,RegExp(`^${GFr(n.value,e)}`),n.message,e);break;case"endsWith":Yv(r,RegExp(`${GFr(n.value,e)}$`),n.message,e);break;case"datetime":LN(r,"date-time",n.message,e);break;case"date":LN(r,"date",n.message,e);break;case"time":LN(r,"time",n.message,e);break;case"duration":LN(r,"duration",n.message,e);break;case"length":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Al(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Yv(r,RegExp(GFr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&LN(r,"ipv4",n.message,e),n.version!=="v4"&&LN(r,"ipv6",n.message,e);break}case"base64url":Yv(r,ON.base64url,n.message,e);break;case"jwt":Yv(r,ON.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Yv(r,ON.ipv4Cidr,n.message,e),n.version!=="v4"&&Yv(r,ON.ipv6Cidr,n.message,e);break}case"emoji":Yv(r,ON.emoji(),n.message,e);break;case"ulid":{Yv(r,ON.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{LN(r,"binary",n.message,e);break}case"contentEncoding:base64":{Al(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Yv(r,ON.base64,n.message,e);break}}break}case"nanoid":Yv(r,ON.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function GFr(t,e){return e.patternStrategy==="escape"?AJc(t):t}function AJc(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}}})):Al(t,"format",e,r,n)}function Yv(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:JKi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Al(t,"pattern",JKi(e,n),r,n)}function JKi(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(qWi(e,n,o)),r+=M3r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r +`);return r+=Buffer.byteLength(QWi(e)),r},"getFormDataLength"),N3r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=EBc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=bBc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return _Bc.from(CBc(this.fd,this.boundary))}};jWi.exports={isFormData:vBc,FormDataSerializer:N3r}});var GWi=I((l8h,HWi)=>{"use strict";p();var{AbortSignal:c8h}=D3r(),{Body:SBc,cloneStream:TBc,guessContentType:IBc}=FTt(),{Headers:xBc}=O_e(),{isPlainObject:wBc}=O9(),{isFormData:RBc,FormDataSerializer:kBc}=EFe(),PBc=20,WV=Symbol("Request internals"),HTt=class t extends SBc{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?TBc(n):null),l=new xBc(r.headers||n&&n.headers||{});if(RBc(c)&&!l.has("content-type")){let h=new kBc(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(wBc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=IBc(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[WV]={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=PBc: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[WV].method}get url(){return this[WV].parsedURL.toString()}get headers(){return this[WV].headers}get redirect(){return this[WV].redirect}get cache(){return this[WV].cache}get signal(){return this[WV].signal}clone(){return new t(this)}get init(){return this[WV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(HTt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});HWi.exports={Request:HTt}});var O3r=I((f8h,$Wi)=>{"use strict";p();var{Body:DBc,cloneStream:NBc,guessContentType:MBc}=FTt(),{Headers:OBc}=O_e(),{isPlainObject:LBc}=O9(),{isFormData:BBc,FormDataSerializer:FBc}=EFe(),BN=Symbol("Response internals"),GTt=class t extends DBc{static{a(this,"Response")}constructor(e=null,r={}){let n=new OBc(r.headers),o=e;if(BBc(o)&&!n.has("content-type")){let s=new FBc(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(LBc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=MBc(o);s&&n.set("content-type",s)}super(o),this[BN]={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[BN].url||""}get status(){return this[BN].status}get statusText(){return this[BN].statusText}get ok(){return this[BN].status>=200&&this[BN].status<300}get redirected(){return this[BN].counter>0}get headers(){return this[BN].headers}get httpVersion(){return this[BN].httpVersion}get decoded(){return this[BN].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(NBc(this),{...this[BN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(GTt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});$Wi.exports={Response:GTt}});var WWi=I((g8h,VWi)=>{"use strict";p();var UBc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),QBc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),qBc=new Set([500,502,503,504]),jBc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},HBc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Mie(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Mie,"toNumberOrZero");function GBc(t){return t?qBc.has(t.status):!0}a(GBc,"isErrorResponse");function L3r(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(L3r,"parseCacheControl");function $Bc(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($Bc,"formatCacheControl");VWi.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=L3r(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=L3r(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":$Bc(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())&&QBc.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||UBc.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=L3r(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)jBc[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 Mie(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 Mie(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Mie(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+Mie(this._rescc["stale-if-error"]),n=e+Mie(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Mie(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Mie(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()&&GBc(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&&!HBc[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 JWi=I((E8h,KWi)=>{"use strict";p();var VBc=WWi(),{Headers:WBc}=O_e(),zWi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),YWi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),B3r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new VBc(zWi(e),YWi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(zWi(e))}responseHeaders(e){return new WBc(this.policy.responseHeaders(YWi(e)))}timeToLive(){return this.policy.timeToLive()}};KWi.exports=B3r});var ezi=I((C8h,XWi)=>{"use strict";p();var{Readable:zBc}=require("stream"),{Headers:ZWi}=O_e(),{Response:YBc}=O3r(),zV=Symbol("CacheableResponse internals"),KBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),F3r=class t extends YBc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new ZWi(r.headers);this[zV]={headers:n,bufferedBody:e}}get headers(){return this[zV].headers}set headers(e){if(e instanceof ZWi)this[zV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return zBc.from(this[zV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[zV].bufferedBody}async arrayBuffer(){return KBc(this[zV].bufferedBody)}async text(){return this[zV].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[zV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},JBc=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 F3r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");XWi.exports={cacheableResponse:JBc}});var $Tt=I((T8h,tzi)=>{"use strict";p();var U3r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};tzi.exports={RequestAbortedError:U3r}});var szi=I((w8h,ozi)=>{"use strict";p();var nzi=require("http"),izi=require("https"),{Readable:ZBc}=require("stream"),F9=vP()("helix-fetch:h1"),{RequestAbortedError:rzi}=$Tt(),{decodeStream:XBc}=O9(),e3c=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 izi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new nzi.Agent(n),r.httpAgent):void 0},"getAgent"),t3c=a(t=>{t.h1={}},"setupContext"),r3c=a(async({h1:t})=>{t.httpAgent&&(F9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(F9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),n3c=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?XBc(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"),i3c=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?izi:nzi,o=e3c(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)=>{F9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{F9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{F9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(F9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new rzi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new rzi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(F9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(n3c(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(F9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(F9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof ZBc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");ozi.exports={request:i3c,setupContext:t3c,resetContext:r3c}});var uzi=I((P8h,lzi)=>{"use strict";p();var{connect:o3c,constants:s3c}=require("http2"),{Readable:a3c}=require("stream"),bd=vP()("helix-fetch:h2"),{RequestAbortedError:azi}=$Tt(),{decodeStream:c3c}=O9(),{NGHTTP2_CANCEL:_Fe}=s3c,l3c=300*1e3,u3c=5e3,d3c=a(t=>{t.h2={sessionCache:{}}},"setupContext"),f3c=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),bd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),czi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?c3c(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"),p3c=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=u3c}}}=t,d=o[":path"],f=`${e}${d}`;bd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(_Fe)},"rejectPush")),n.on("push",(h,m)=>{bd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{bd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(_Fe)}),l&&l(f,o,czi(h,n,r))}),n.on("aborted",()=>{bd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{bd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{bd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),h3c=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=l3c,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=()=>(bd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=o3c(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{bd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{bd(`session ${n} established`),bd(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{bd(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{bd(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{bd(`session ${n} closed`),d[n]===w&&(bd(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{bd(`session ${n} encountered error: ${q}`),d[n]===w&&(bd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,O)=>{bd(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${O}`)}),w.once("goaway",(q,M,O)=>{bd(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(q,M,O)=>{p3c(t,n,v,q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(bd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());bd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new azi),R&&R.close(_Fe)},"onAbortSignal");if(x){if(x.aborted){T(new azi);return}x.addEventListener("abort",P)}let D=a(N=>{bd(`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(czi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==_Fe&&(bd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(_Fe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),bd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{bd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof a3c?_.pipe(R):(_&&R.write(_),R.end())})},"request");lzi.exports={request:h3c,setupContext:d3c,resetContext:f3c}});var fzi=I((M8h,dzi)=>{"use strict";p();var{EventEmitter:m3c}=require("events"),g3c=a(()=>{let t={},e=new m3c;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");dzi.exports=g3c});var pzi=I((B8h,A3c)=>{A3c.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 yzi=I((F8h,Azi)=>{"use strict";p();var{Readable:y3c}=require("stream"),E3c=require("tls"),{types:{isAnyArrayBuffer:_3c}}=require("util"),v3c=w3r(),Q3r=vP()("helix-fetch:core"),{RequestAbortedError:VTt}=$Tt(),q3r=szi(),WTt=uzi(),C3c=fzi(),{isPlainObject:b3c}=O9(),{isFormData:S3c,FormDataSerializer:T3c}=EFe(),{version:I3c}=pzi(),j3r="h2",H3r="h2c",G3r="http/1.0",Oie="http/1.1",x3c=100,w3c=3600*1e3,R3c=[j3r,Oie,G3r],k3c=`helix-fetch/${I3c}`,P3c={method:"GET",compress:!0,decode:!0},hzi=0,mzi=C3c(),gzi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new VTt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new VTt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof VTt||(Q3r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=E3c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),hzi+=1,s.id=hzi,s.secureConnecting=!1,Q3r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),D3c=a(async(t,e)=>{let r=await mzi.acquire(t.origin);try{return r||(r=await gzi(t,e)),r}finally{mzi.release(t.origin,r)}},"connect"),N3c=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=Oie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=H3r,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 D3c(e,d);return o=f.alpnProtocol,o||(o=Oie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),M3c=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),O3c=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 gzi(e,d);return{protocol:f.alpnProtocol||Oie,socket:f}}return{protocol:l.alpnProtocol||Oie,socket:l}},"getProtocolAndSocketFromFactory"),L3c=a(async(t,e,r)=>{let n=new URL(e),o={...P3c,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=M3c(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(S3c(o.body)){let d=new T3c(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":b3c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):_3c(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 y3c||(!(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 O3c(t.socketFactory,n,o,t.alpnProtocols):await N3c(t,n,c);switch(Q3r(`${n.host} -> ${l}`),l){case j3r:try{return await WTt.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 H3r:return WTt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case G3r:case Oie:return q3r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),B3c=a(async t=>(t.alpnCache.clear(),Promise.all([q3r.resetContext(t),WTt.resetContext(t)])),"resetContext"),F3c=a(t=>{let{options:{alpnProtocols:e=R3c,alpnCacheTTL:r=w3c,alpnCacheSize:n=x3c,userAgent:o=k3c,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new v3c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,q3r.setupContext(t),WTt.setupContext(t)},"setupContext");Azi.exports={request:L3c,setupContext:F3c,resetContext:B3c,RequestAbortedError:VTt,ALPN_HTTP2:j3r,ALPN_HTTP2C:H3r,ALPN_HTTP1_1:Oie,ALPN_HTTP1_0:G3r}});var _zi=I((q8h,Ezi)=>{"use strict";p();var U3c=vP()("helix-fetch:core"),{request:Q3c,setupContext:q3c,resetContext:j3c,RequestAbortedError:H3c,ALPN_HTTP2:G3c,ALPN_HTTP2C:$3c,ALPN_HTTP1_1:V3c,ALPN_HTTP1_0:W3c}=yzi(),$3r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},q3c(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:H3c,ALPN_HTTP2:G3c,ALPN_HTTP2C:$3c,ALPN_HTTP1_1:V3c,ALPN_HTTP1_0:W3c}}async request(e,r){return Q3c(this,e,r)}setCA(e){this.options.ca=e}async reset(){return U3c("resetting context"),j3c(this)}};Ezi.exports=new $3r().api()});var Tzi=I((G8h,Szi)=>{"use strict";p();var{EventEmitter:z3c}=require("events"),{Readable:vFe}=require("stream"),V3r=vP()("helix-fetch"),Y3c=w3r(),{Body:K3c}=FTt(),{Headers:K3r}=O_e(),{Request:Lie}=GWi(),{Response:z3r}=O3r(),{FetchBaseError:J3c,FetchError:CFe,AbortError:zTt}=P3r(),{AbortController:Z3c,AbortSignal:X3c,TimeoutSignal:eFc}=D3r(),tFc=JWi(),{cacheableResponse:rFc}=ezi(),{sizeof:nFc}=O9(),{isFormData:iFc}=EFe(),{context:oFc,RequestAbortedError:sFc}=_zi(),vzi=["GET","HEAD"],aFc=500,cFc=100*1024*1024,W3r="push",Czi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Lie&&typeof r>"u"?e:new Lie(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 zTt("The operation was aborted.");throw o.init.body instanceof vFe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof vFe)&&!iFc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof vFe&&m.destroy(w),w instanceof TypeError?w:w instanceof sFc?new zTt("The operation was aborted."):new CFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new zTt("The operation was aborted.");o.init.body instanceof vFe&&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 CFe(`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 CFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new K3r(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 vFe)throw l&&l.removeEventListener("abort",A),new CFe("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),Czi(t,new Lie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new z3r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),bzi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!vzi.includes(e.method))return r;let n=new tFc(e,r,{shared:!1});if(n.storable()){let o=await rFc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),lFc=a(async(t,e,r)=>{let n=new Lie(e,r);if(t.options.maxCacheSize!==0&&vzi.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 K3r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await Czi(t,n);return n.cache!=="no-store"?bzi(t,n,s):s},"cachingFetch"),uFc=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"),dFc=a(t=>new eFc(t),"timeoutSignal"),Y3r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:cFc,o=aFc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>nFc(l),"sizeCalculation");this.cache=new Y3c({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new z3c,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 z3r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=oFc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:K3c,Headers:K3r,Request:Lie,Response:z3r,AbortController:Z3c,AbortSignal:X3c,FetchBaseError:J3c,FetchError:CFe,AbortError:zTt,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:uFc,timeoutSignal:dFc,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 lFc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(W3r,e)}offPush(e){return this.eventEmitter.off(W3r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){V3r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Lie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(V3r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){V3r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await bzi(this,new Lie(e,{headers:r}),n);this.eventEmitter.emit(W3r,e,o)}};Szi.exports=new Y3r().api()});var xzi=I((W8h,Izi)=>{"use strict";p();Izi.exports=Tzi()});var Yzi=I((KUh,zzi)=>{"use strict";p();function Wzi(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(Wzi,"validateParameter");function FFc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(FFc,"hasOwnProperty");function UFc(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(UFc,"defineOperation");zzi.exports={defineOperation:UFc,validateParameter:Wzi}});var rFr=I((XUh,Zzi)=>{"use strict";p();var j_e=Z6e()("kerberos"),q_e=j_e.KerberosClient,Kzi=j_e.KerberosServer,KV=Yzi().defineOperation,QFc=1,qFc=2,jFc=4,HFc=8,GFc=16,$Fc=32,VFc=64,WFc=128,zFc=256,Jzi=0,YFc=9,KFc=6;q_e.prototype.step=KV(q_e.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);q_e.prototype.wrap=KV(q_e.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);q_e.prototype.unwrap=KV(q_e.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Kzi.prototype.step=KV(Kzi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var JFc=KV(j_e.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}]),ZFc=KV(j_e.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),XFc=KV(j_e.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:Jzi}},{name:"callback",type:"function",required:!1}]),e8c=KV(j_e.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);Zzi.exports={initializeClient:XFc,initializeServer:e8c,principalDetails:ZFc,checkPassword:JFc,GSS_C_DELEG_FLAG:QFc,GSS_C_MUTUAL_FLAG:qFc,GSS_C_REPLAY_FLAG:jFc,GSS_C_SEQUENCE_FLAG:HFc,GSS_C_CONF_FLAG:GFc,GSS_C_INTEG_FLAG:$Fc,GSS_C_ANON_FLAG:VFc,GSS_C_PROT_READY_FLAG:WFc,GSS_C_TRANS_FLAG:zFc,GSS_C_NO_OID:Jzi,GSS_MECH_OID_KRB5:YFc,GSS_MECH_OID_SPNEGO:KFc}});var Xzi=I((t7h,t8c)=>{t8c.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 tYi=I((r7h,eYi)=>{"use strict";p();var r8c=require("dns"),n8c=rFr(),nFr=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=i8c(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();r8c.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}`;n8c.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 i8c(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=o8c(t),r(null,o)})}}a(i8c,"firstTransition");function o8c(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=s8c(t),r(null,o||"")})}}a(o8c,"secondTransition");function s8c(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=a8c(t),r(null,c)})})}}a(s8c,"thirdTransition");function a8c(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(a8c,"fourthTransition");eYi.exports={MongoAuthProcess:nFr}});var nYi=I((o7h,TFe)=>{"use strict";p();var rYi=rFr();TFe.exports=rYi;TFe.exports.Kerberos=rYi;TFe.exports.version=Xzi().version;TFe.exports.processes={MongoAuthProcess:tYi().MongoAuthProcess}});var koo={};ki(koo,{AbortError:()=>R1,DirectConnectError:()=>Ak,DirectConnectTransport:()=>s6r,EXIT_REASONS:()=>Q9c,HOOK_EVENTS:()=>Cwt,InMemorySessionStore:()=>a8r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>q9c,createSdkMcpServer:()=>EZc,deleteSession:()=>Erl,filterEscalatingDefaultMode:()=>irl,foldSessionSummary:()=>bZi,forkSession:()=>_rl,getSessionInfo:()=>grl,getSessionMessages:()=>hrl,getSubagentMessages:()=>Srl,importSessionToStore:()=>vrl,listSessions:()=>mrl,listSubagents:()=>brl,parseDirectConnectUrl:()=>CZc,query:()=>frl,renameSession:()=>Arl,resolveSettings:()=>srl,startup:()=>prl,tagSession:()=>yrl,tool:()=>yZc});function o6c(t){return this[t]}function l6c(t,e){this[t]=c6c.bind(null,e)}function s8r(t=F9c){let e=new AbortController;return(0,yZi.setMaxListeners)(t,e.signal),e}function EZi(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 U9c(t,e){t(Error(e))}function Wie(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(U9c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function k6r(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=H9c.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(!j9c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function bZi(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=W9c(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)}z9c(c,l);for(let[d,f]of Object.entries(G9c)){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 $9c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=XV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=XV(r.customTitle)||XV(r.aiTitle)||void 0,s=o||XV(r.lastPrompt)||XV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:XV(r.gitBranch)||void 0,cwd:XV(r.cwd)||e||void 0,tag:XV(r.tag)||void 0,createdAt:V9c(r.createdAt)}:null}function XV(t){return typeof t=="string"?t:void 0}function V9c(t){return typeof t=="number"?t:void 0}function W9c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function z9c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=k6r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function SZi(){return process.versions.bun!==void 0}function a_(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 B8e(){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 tUc(t){var e=X9c.call(t,wFe),r=t[wFe];try{t[wFe]=void 0;var n=!0}catch{}var o=eUc.call(t);return n&&(e?t[wFe]=r:delete t[wFe]),o}function oUc(t){return iUc.call(t)}function lUc(t){return t==null?t===void 0?cUc:aUc:GYi&&GYi in Object(t)?rUc(t):sUc(t)}function uUc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function mUc(t){if(!K9(t))return!1;var e=F8e(t);return e==fUc||e==pUc||e==dUc||e==hUc}function AUc(t){return!!$Yi&&$Yi in t}function vUc(t){if(t!=null){try{return _Uc.call(t)}catch{}try{return t+""}catch{}}return""}function kUc(t){if(!K9(t)||yUc(t))return!1;var e=P6r(t)?RUc:SUc;return e.test(CUc(t))}function DUc(t,e){return t?.[e]}function MUc(t,e){var r=NUc(t,e);return PUc(r)?r:void 0}function LUc(){this.__data__=c8e?c8e(null):{},this.size=0}function FUc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function HUc(t){var e=this.__data__;if(c8e){var r=e[t];return r===QUc?void 0:r}return jUc.call(e,t)?e[t]:void 0}function WUc(t){var e=this.__data__;return c8e?e[t]!==void 0:VUc.call(e,t)}function KUc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=c8e&&e===void 0?YUc:e,this}function Fve(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function u7c(t,e){var r=this.__data__,n=Swt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Uve(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 L7c(){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 DZi(...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 NZi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return DZi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function L6r(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 B7c(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 U7c(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 Ri(`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 OZi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new nu(`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 nu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function LZi(t,e){let r=await V7c(t),n;try{n=JSON.parse(r)}catch{throw new nu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,yk(r),e)}if(!n.access_token)throw new nu(`Token endpoint response missing access_token: ${JSON.stringify(yk(n))}`,t.status,yk(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new nu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,yk(n),e);return n}function yk(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=wFr?t:t.slice(0,wFr)+`... <${t.length-wFr} more chars>`}return JSON.stringify(yk(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))$7c.has(r)&&(e[r]=n);return e}return null}async function BZi(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 nu(`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 nu(`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 FZi(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 V7c(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>ZYi){let l=ZYi-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 zie(){return Math.floor(Date.now()/1e3)}function W7c(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 F6r(t){let e;return(XYi??(e=new globalThis.TextEncoder,XYi=e.encode.bind(e)))(t)}function tKi(t){let e;return(eKi??(e=new globalThis.TextDecoder,eKi=e.decode.bind(e)))(t)}function YFe(){}function SIt(t,e,r){return!e||sxt[t]>sxt[r]?YFe:e[t].bind(e)}function sA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return z7c;let n=nKi.get(e);if(n&&n[0]===r)return n[1];let o={error:SIt("error",e,r),warn:SIt("warn",e,r),info:SIt("info",e,r),debug:SIt("debug",e,r)};return nKi.set(e,[r,o]),o}function QZi(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(!Y7c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function iKi(t){if(!t)throw new Ri("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 Ri(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ri(`Identity token file at ${t} is empty`);return n}}function X7c(t){if(!t)throw new Ri("Identity token value is empty");return()=>t}function eQc(t){return async()=>{OZi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new nu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:Q7c,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}${MZi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${oxt},${j7c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${aW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new nu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=yk(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 nu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await LZi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new nu(`Token endpoint response missing required fields: ${JSON.stringify(yk(c))}`,o.status,yk(c),s);return{token:c.access_token,expiresAt:zie()+l}}}function tQc(t){return async e=>{let r=await import("node:fs");await BZi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new nu(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new nu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new nu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||zie()"");throw new nu(`User OAuth refresh failed (HTTP ${f.status}): ${yk(E)}`,f.status,yk(E),h)}let m=await LZi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new nu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(yk(m))}`,f.status,yk(m),h);let A=zie()+g,y=m.refresh_token||l;return await FZi(t.credentialsPath,{...o,version:UZi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function jZi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=nQc(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 rQc(t,e){let r=await K7c(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 J7c(n,e)??void 0}};return jZi(s,t)}function nQc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=iQc(o);if(!s)throw new nu("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 nu("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 nu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=eQc({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?oQc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new nu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return tQc({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 nu(`authentication.type "${o}" is not a known authentication type`)}}}function iQc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new nu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new nu('identity_token.source "file" requires a non-empty path');return iKi(t.identity_token.path)}let e=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return iKi(e);let r=tu("ANTHROPIC_IDENTITY_TOKEN");return r?X7c(r):null}function oQc(t,e,r,n){return async o=>{let s=await import("node:fs");await BZi(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||zie()0&&(yield e)}function uQc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function HZi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return sA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):eoe.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 GZi(u,r)}return await r.text()})();return sA(t).debug(`[${n}] response parsed`,$ie({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function GZi(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 lve(t,e,r){return $Zi(),new File(t,e??"unknown_file",r)}function GIt(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 dQc(t){let e=typeof t=="function"?t:t.fetch,r=oKi.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 oKi.set(e,n),n}async function gQc(t,e,r){if($Zi(),t=await t,e||(e=GIt(t,!0)),hQc(t))return t instanceof File&&e==null&&r==null?t:lve([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(mQc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),lve(await m8r(o),e,r)}let n=await m8r(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 lve(n,e,r)}async function m8r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(WZi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(VZi(t))for await(let r of t)e.push(...await m8r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${AQc(t)}`)}return e}function AQc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*yQc(t){if(!t)return;if(zZi 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():WYi(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=WYi(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 YZi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function $It(t){return typeof t=="object"&&t!==null&&i8e in t}function KZi(t,e){let r=new Set;if(t)for(let n of t)$It(n)&&r.add(n[i8e]);if(e){for(let n of e)if($It(n)&&r.add(n[i8e]),Array.isArray(n.content))for(let o of n.content)$It(o)&&r.add(o[i8e])}return Array.from(r)}function JZi(t,e){let r=KZi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function _Qc(t){return $It(t)?{"x-stainless-helper":t[i8e]}:{}}function XZi(t){return t?.output_format??t?.output_config?.format}function aKi(t,e,r){let n=XZi(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}:eXi(t,e,r)}function eXi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=vQc(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 vQc(t,e){let r=XZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function dKi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function pKi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function xQc(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 yxt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function mKi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ri("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 rXi(t){return t?.output_config?.format}function gKi(t,e,r){let n=rXi(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}:nXi(t,e,r)}function nXi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=RQc(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 RQc(t,e){let r=rXi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function _Ki(t){return t.type==="tool_use"||t.type==="server_tool_use"}function U8e(t){return t instanceof Error?t:Error(String(t))}function WIt(t){return t instanceof Error?t.message:String(t)}function NI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function Q8e(t){return NI(t)==="ENOENT"}function oXi(t){return NI(t)==="EISDIR"}function NQc(t){let e=NI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function LQc(t,e,r){let n=`${t}.tmp.${(0,cXi.randomBytes)(4).toString("hex")}`;try{await(0,HL.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,HL.rename)(n,t)}catch(o){let s=NI(o);if(s!==void 0&&MQc.has(s)){try{await(0,HL.copyFile)(n,t)}catch(c){throw OQc.has(NI(c)??"")&&await(0,HL.unlink)(t).catch(()=>{}),c}await(0,HL.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,HL.unlink)(n).catch(()=>{}),o}}function xxt(){return BQc.getStore()??new v8r}function lXi(){if(X_e)return X_e;if(!a_(process.env.DEBUG_CLAUDE_AGENT_SDK))return Yie=null,X_e=Promise.resolve(),X_e;let t=(0,_8r.join)(qve(),"debug");return Yie=(0,_8r.join)(t,`sdk-${(0,sXi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${Yie} +`),X_e=xxt().mkdir(t).catch(()=>{}),X_e}function FQc(){return lXi(),Yie??null}function mk(t){if(Yie===null)return;let e=`${new Date().toISOString()} ${t} +`;lXi().then(()=>{Yie&&xxt().append(Yie,e).catch(()=>{})})}function UQc(){this.__data__=new Twt,this.size=0}function qQc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function HQc(t){return this.__data__.get(t)}function $Qc(t){return this.__data__.has(t)}function zQc(t,e){var r=this.__data__;if(r instanceof Twt){var n=r.__data__;if(!xZi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=vqc}function Wqc(t){return Hve(t)&&G6r(t.length)&&!!Sd[F8e(t)]}function Yqc(t){return function(e){return t(e)}}function rjc(t,e){var r=pW(t),n=!r&&h8e(t),o=!r&&!n&&H6r(t),s=!r&&!n&&!o&&hXi(t),c=r||n||o||s,l=c?oqc(t.length,String):[],u=l.length;for(var d in t)(e||tjc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||xwt(d,u)))&&l.push(d);return l}function ojc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ijc;return t===r}function sjc(t,e){return function(r){return t(e(r))}}function cjc(t){return t!=null&&G6r(t.length)&&!P6r(t)}function ljc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function pjc(t){if(!K9(t))return ujc(t);var e=mXi(t),r=[];for(var n in t)n=="constructor"&&(e||!fjc.call(t,n))||r.push(n);return r}function mjc(t){return $6r(t)?njc(t,!0):hjc(t)}function Ajc(t,e){if(e)return t.slice();var r=t.length,n=wKi?wKi(r):new t.constructor(r);return t.copy(n),n}function yjc(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 RHc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function PHc(t){return kHc.register(t)}function NHc(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 MHc(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 OHc(t,e){if(!e)return!0;let r=NHc(t);return MHc(r,e)}function LHc(t){return/^[\\/]{2}/.test(t)}function BHc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function NKi(t){try{return BHc(SXi.realpathSync.native(t))}catch{return null}}function FHc(t,e){let r=(0,GL.resolve)(e).toLowerCase(),n=(0,GL.resolve)(t).toLowerCase();if((0,GL.dirname)(n)===r||n.startsWith(r+GL.sep))return!0;let o=NKi(e)?.toLowerCase();if(o==null)return!1;let s=NKi((0,GL.dirname)((0,GL.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+GL.sep)}function TXi(t,e){if(LHc(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 MI(){return QHc}function qHc(t,e){t.destroyed||t.write(e)}function jHc(t){qHc(process.stderr,t)}function HHc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function GHc(t,e,r=e+"s"){return t===1?e:r}function $Hc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function YHc(t){return zHc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function KHc(t){LKi??=YHc(!0);for(let e of LKi)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 Rwt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function eGc(t){if(!I8r()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=XHc();return OHc(t,e)}async function wXi(t,e,r=rGc){if(GFe<0?GFe=await(0,u_.stat)(t).then(n=>n.size).catch(()=>0):GFe+=e,!(GFe<=r||QFr)){QFr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,u_.rename)(t,n)}catch(o){Q8e(o)||(await(0,u_.unlink)(n).catch(()=>{}),await(0,u_.rename)(t,n).catch(()=>(0,u_.unlink)(t).catch(()=>{})))}GFe=0}finally{QFr=!1}}}function RXi(t){return x8r=(0,aoe.join)(t,`${bXi()}.txt`),x8r}async function nGc(t,e,r,n){t&&await(0,u_.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,u_.appendFile)(r,n)}catch(s){if(!oXi(s))throw s;o=RXi(r),await(0,u_.appendFile)(o,n)}await wXi(o,Buffer.byteLength(n)).catch(w8r),PXi()}function w8r(){}function iGc(){if(!UIt){let t=null;UIt=wHc({writeFn:a(e=>{let r=kXi(),n=(0,aoe.dirname)(r),o=t!==n;if(t=n,I8r()){if(o)try{MI().mkdirSync(n)}catch{}let s=r;try{MI().appendFileSync(r,e)}catch(c){if(!oXi(c))throw c;s=RXi(r),MI().appendFileSync(s,e)}wXi(s,Buffer.byteLength(e)).catch(w8r),PXi();return}UFr=UFr.then(nGc.bind(null,o,n,r,e)).catch(w8r)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:I8r()}),PHc(async()=>{UIt?.dispose(),await UFr})}return UIt}function ru(t,{level:e}={level:"debug"}){if(T8r[e]t.endsWith(e))}function hGc(t,e){return(0,vZi.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 mGc(){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 gGc(t,e=process.platform,r=process.arch,n=DXi.existsSync,o=mGc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${eve}-linux-${r}-android`]:e==="linux"?o?[`${eve}-linux-${r}-musl`,`${eve}-linux-${r}`]:[`${eve}-linux-${r}`,`${eve}-linux-${r}-musl`]:[`${eve}-${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 AGc(){return{eventQueue:[],sink:null}}function J6r(t,e){let r=yGc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function NXi(t){J6r("tengu_feature_ok",{feature_name:t})}function MXi(t,e,r){J6r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function EGc(t,e,r){J6r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function H9(t,e,r){try{let n=await e();return NXi(t),n}catch(n){throw MXi(t,r?.(n)??"error"),n}}function vGc(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 s8e(t){if(typeof t=="string")return vGc(t);if(Array.isArray(t))return t.map(s8e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[s8e(r)]=s8e(n);return e}return t}function CGc(){return process.platform==="win32"}function SGc(t){let e=qFr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,QXi.join)(r,"System32","where.exe");try{let o=(0,UXi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:bGc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!FHc(c,s))return qFr.set(t,c),c;return null}catch(o){return TGc(o)&&qFr.set(t,null),null}}function TGc(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 IGc(t){return!CGc()||t.includes("/")||t.includes("\\")?t:SGc(t)}async function q8e(t){let e=IGc("git");if(e===null)return[];try{let{stdout:r}=await xGc(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 wGc(t){let e=0;for(let r=0;ro&&(n=qXi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function M8r(t,e){let r=(0,LXi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` +`)||await(0,N8r.once)(r,"drain");r.end(),await(0,N8r.once)(r,"finish")}catch(n){throw r.destroy(),n}}function jXi(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=k6r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function kGc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=k6r(r,e);if(n!==void 0)return n}return e.commandFallback}async function HXi(t){try{let e=await(0,jN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(W9),o=await e.read(n,0,W9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-W9),l=s;if(c>0){let u=await e.read(n,0,W9,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 PGc(t){return Math.abs(wGc(t)).toString(36)}function j8e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=m8e?e:`${e.slice(0,m8e)}-${PGc(t)}`}function yW(){return(0,yve.join)(qve(),"projects")}function DGc(t){return(0,yve.join)(yW(),j8e(t))}async function H8e(t){try{return(await(0,jN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function QN(t){let e=DGc(t),r=[];try{await(0,jN.readdir)(e),r.push(e)}catch{}let n=j8e(t);if(n.length<=m8e)return r;let o=n.slice(0,m8e)+"-",s=yW();try{for(let c of await(0,jN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,yve.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function kwt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,yve.join)(c,r);try{let d=await(0,jN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await H8e(e);for(let u of await QN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await q8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await QN(u)){let f=await n(d,u);if(f)return f}return}let o=yW(),s;try{s=await(0,jN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,yve.join)(o,c),void 0);if(l)return l}}function LGc(){return OGc??=Buffer.from('"compact_boundary"')}function GXi(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 Kie(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 Nxt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function QGc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(g8e);if(o===-1||o>=r)return 0;let s=o+1;if(Nxt(n,Mxt,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 HGc(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 GGc(t){if(t.carryLen>0){let e=t.carryBuf;Nxt(e,Mxt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Kie(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==g8e&&Kie(t.out,FGc,0,1),Kie(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function $Gc(t,e){let r=LGc(),n=NGc,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,jN.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=qGc(o,f,r);jGc(o,f,s,h.lastSnapStart,h.lastSnapEnd),HGc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}GGc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function VGc(t,e){try{return e>MGc&&!a_(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await $Gc(t,e)).postBoundaryBuf:await(0,OXi.readFile)(t)}catch{return null}}function WGc(t){let e=[];try{let o=rf(e,of`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=aGc(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{nf(e,r,n)}}function zGc(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(),KGc(e,d,f)}function HFr(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 YGc(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 KGc(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=HFr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=HFr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(YGc(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=HFr(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 JGc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function $Xi(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 VXi(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 ZGc(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 WXi(r,e)}function WXi(t,e){let r=zGc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>JGc(s,n)).map(s=>$Xi(s));return VXi(o,e)}async function XGc(t,e){if(!Th(t))return[];let r=await kwt(t,e?.dir);if(!r)return[];let n=await VGc(r.filePath,r.fileSize);return n?WXi(WGc(n),e):[]}function Pwt(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=gk(o,"customTitle")||gk(n,"customTitle")||gk(o,"aiTitle")||gk(n,"aiTitle")||void 0,f=jXi(n)||void 0,h=jFr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||gk(o,"lastPrompt")||gk(o,"summary")||f;if(!g)return null;let A=gk(o,"gitBranch")||jFr(n,"gitBranch")||void 0,y=jFr(n,"cwd")||r||void 0,E=o.split(` +`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&gk(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 e8e(t,e,r){let n;try{n=await(0,Gve.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=Th(o.slice(0,-6));if(!s)return null;let c=(0,$ve.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,Gve.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function zXi(t){let e=await HXi(t.filePath);if(!e)return null;let r=Pwt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function t$c(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function r$c(t,e,r){t.sort(t$c);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 i$c(t,e,r){let n=await H8e(t),o;if(e)try{o=await q8e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await QN(n))h.push(...await e8e(m,r,n));return h}let s=yW(),c=process.platform==="win32",l=o.map(h=>{let m=j8e(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,Gve.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await QN(n))h.push(...await e8e(m,r,n));return h}let d=[],f=new Set;for(let h of await QN(n)){let m=(0,$ve.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await e8e(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>=m8e&&m.startsWith(A+"-")){f.add(m),d.push(...await e8e((0,$ve.join)(s,h.name),r,g));break}}}return d}async function o$c(t){let e=yW(),r;try{r=await(0,Gve.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>e8e((0,$ve.join)(e,n.name),t)))).flat()}async function s$c(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 i$c(e,o??!0,c):await o$c(c);return c?r$c(l,r,s):n$c(l)}async function a$c(t,e={}){let r=Th(t);if(!r)return;let n=await kwt(r,e.dir);if(!n)return;let o=await HXi(n.filePath);if(o)return Pwt(r,o,n.projectPath)??void 0}async function c$c(t,e,r={}){if(!Th(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=jm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` +`;await YXi(t,n,r)}async function l$c(t,e,r={}){if(!Th(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=s8e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=jm({type:"tag",tag:e??"",sessionId:t})+` +`;await YXi(t,n,r)}async function u$c(t,e={}){if(!Th(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await d$c(e)){let n=(0,Jie.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,$L.stat)(n))}catch(s){let c=NI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,$L.rm)(n,{force:!0}),await(0,$L.rm)((0,Jie.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 d$c(t){if(t.dir){let r=await H8e(t.dir),n=await QN(r),o;try{o=await q8e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await QN(s));return n}let e=yW();try{return(await(0,$L.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Jie.join)(e,r.name))}catch{return[]}}async function YXi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await H8e(r.dir);for(let u of await QN(c))if(await GFr((0,Jie.join)(u,n),e))return;let l;try{l=await q8e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await QN(u))if(await GFr((0,Jie.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=yW(),s;try{s=await(0,$L.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await GFr((0,Jie.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function GFr(t,e){let r;try{r=await(0,$L.open)(t,O8r.constants.O_WRONLY|O8r.constants.O_APPEND)}catch(n){let o=NI(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 f$c(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await xxt().readBytes((0,Oxt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await H8e(e);for(let u of await QN(c)){let d=await n(u);if(d)return d}let l;try{l=await q8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await QN(u)){let f=await n(d);if(f)return f}return null}let o=yW(),s;try{s=await xxt().list(o)}catch{return null}for(let c of s){let l=await n((0,Oxt.join)(o,c));if(l)return l}return null}function h$c(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{KXi(WN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function m$c(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||KXi(o,e,r,n);return{transcript:r,contentReplacements:n}}function KXi(t,e,r,n){p$c.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 g$c(t,e={}){if(!Th(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!Th(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await f$c(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}=A$c(r.buf,t,e);return await M8r((0,Oxt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function A$c(t,e,r){let n=h$c(t,e);return JXi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,W9)),c=t.toString("utf-8",Math.max(0,o-W9));return gk(c,"customTitle")||gk(s,"customTitle")||gk(c,"aiTitle")||gk(s,"aiTitle")||jXi(s)})}function y$c(t,e,r){let n=m$c(t,e);return JXi(n,e,r,()=>E$c(t))}function E$c(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||kGc(t)||void 0}function JXi(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,t8e.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,t8e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,t8e.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,t8e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function ZXi(t,e){let r=await kwt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,Lxt.join)(n,"subagents")}async function XXi(t){let e=[];async function r(n){let o;try{o=await(0,A8e.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,Lxt.join)(n,s.name)})}else s.isDirectory()&&await r((0,Lxt.join)(n,s.name))}return a(r,"J"),await r(t),e}function _$c(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=WN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function v$c(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 C$c(t,e){if(!Th(t))return[];let r=await ZXi(t,e?.dir);return r?(await XXi(r)).map(n=>n.agentId):[]}async function b$c(t,e,r){if(!Th(t))return[];if(!e)return[];let n=await ZXi(t,r?.dir);if(!n)return[];let o=(await XXi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,A8e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=WN(await(0,A8e.readFile)(l,"utf-8")).toolUseId}catch{}return eeo(s,r,c)}function eeo(t,e,r){if(t.length===0)return[];let n=_$c(t),o=v$c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>$Xi(s,r));return VXi(o,e)}function neo(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function ieo(t){return[...new Set(t)]}function S$c(){return"prod"}function k$c(){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 D$c(){let t=(()=>{switch(S$c()){case"local":return k$c();case"staging":return R$c??UKi;case"prod":return UKi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!P$c.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 M$c(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"):qve(),o=r?"":`-${(0,teo.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${D$c().OAUTH_FILE_SUFFIX}${t}${o}`}function L$c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,reo.userInfo)().username}catch{t="claude-code-user"}return O$c.test(t)?t:"claude-code-user"}function L8r(){return F$c}function ln(t,e){let r=L8r(),n=B8r({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===y8e?void 0:y8e].filter(o=>!!o)});t.common.issues.push(n)}function Zo(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 aeo(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 tVc(t){return new RegExp(`^${aeo(t)}$`)}function rVc(t){let e=`${seo}T${aeo(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 nVc(t,e){return!!((e==="v4"||!e)&&z$c.test(t)||(e==="v6"||!e)&&K$c.test(t))}function iVc(t,e){if(!G$c.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 oVc(t,e){return!!((e==="v4"||!e)&&Y$c.test(t)||(e==="v6"||!e)&&J$c.test(t))}function sVc(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 ive(t){if(t instanceof OI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=vk.create(ive(n))}return new OI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof mW?new mW({...t._def,type:ive(t.element)}):t instanceof vk?vk.create(ive(t.unwrap())):t instanceof Z9?Z9.create(ive(t.unwrap())):t instanceof J9?J9.create(t.items.map(e=>ive(e))):t}function U8r(t,e){let r=oW(t),n=oW(e);if(t===e)return{valid:!0,data:t};if(r===kn.object&&n===kn.object){let o=hc.objectKeys(e),s=hc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=U8r(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===kn.array&&n===kn.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 tC(t){return t&&Object.assign(Qxt,t),Qxt}function cVc(t){return t}function lVc(t){return t}function uVc(t){}function dVc(t){throw Error()}function fVc(t){}function e9r(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 Vr(t,e="|"){return t.map(r=>us(r)).join(e)}function feo(t,e){return typeof e=="bigint"?e.toString():e}function Dwt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function coe(t){return t==null}function Nwt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function peo(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 zc(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 t9r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pVc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function hVc(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 yVc(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 us(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function geo(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function EVc(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 zN(t,{...t._zod.def,shape:r,checks:[]})}function _Vc(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 zN(t,{...t._zod.def,shape:r,checks:[]})}function vVc(t,e){if(!k8e(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 t9r(this,"shape",n),n},checks:[]};return zN(t,r)}function CVc(t,e){return zN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return t9r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function bVc(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 zN(e,{...e._zod.def,shape:o,checks:[]})}function SVc(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 zN(e,{...e._zod.def,shape:o,checks:[]})}function uve(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function n8e(t){return typeof t=="string"?t:t?.message}function GN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=n8e(t.inst?._zod.def?.error?.(t))??n8e(e?.error?.(t))??n8e(r.customError?.(t))??n8e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function Mwt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Owt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Eeo(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function TVc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function i9r(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 o9r(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 ${Ceo(n.path)}`);return e.join(` +`)}function Neo(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Heo(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 Geo(t){return new RegExp(`^${Heo(t)}$`)}function $eo(t){let e=Heo({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(`^${qeo}T(?:${n})$`)}function GKi(t,e,r){t.issues.length&&e.issues.push(...Ek(r,t.issues))}function h9r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function qto(t){if(!d9r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return h9r(r)}function Gto(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 $Ki(t,e,r){t.issues.length&&e.issues.push(...Ek(r,t.issues)),e.value[r]=t.value}function QIt(t,e,r){t.issues.length&&e.issues.push(...Ek(r,t.issues)),e.value[r]=t.value}function VKi(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(...Ek(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function WKi(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=>GN(s,n,tC())))}),e}function H8r(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(k8e(t)&&k8e(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=H8r(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;nGN(l,c,tC()))})),e.issues.length&&(qxt.has(typeof n)?r.issues.push(...Ek(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>GN(l,c,tC()))})),r.value.set(t.value,e.value)}function KKi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function JKi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function ZKi(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 XKi(t,e,r){return uve(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function eJi(t){return t.value=Object.freeze(t.value),t}function tJi(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(Eeo(o))}}function BVc(){return{localeError:LVc()}}function UVc(){return{localeError:FVc()}}function rJi(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 qVc(){return{localeError:QVc()}}function HVc(){return{localeError:jVc()}}function $Vc(){return{localeError:GVc()}}function WVc(){return{localeError:VVc()}}function bro(){return{localeError:YVc()}}function ZVc(){return{localeError:JVc()}}function eWc(){return{localeError:XVc()}}function rWc(){return{localeError:tWc()}}function iWc(){return{localeError:nWc()}}function sWc(){return{localeError:oWc()}}function cWc(){return{localeError:aWc()}}function uWc(){return{localeError:lWc()}}function fWc(){return{localeError:dWc()}}function hWc(){return{localeError:pWc()}}function gWc(){return{localeError:mWc()}}function yWc(){return{localeError:AWc()}}function _Wc(){return{localeError:EWc()}}function CWc(){return{localeError:vWc()}}function SWc(){return{localeError:bWc()}}function IWc(){return{localeError:TWc()}}function wWc(){return{localeError:xWc()}}function kWc(){return{localeError:RWc()}}function DWc(){return{localeError:PWc()}}function MWc(){return{localeError:NWc()}}function LWc(){return{localeError:OWc()}}function FWc(){return{localeError:BWc()}}function nJi(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 QWc(){return{localeError:UWc()}}function jWc(){return{localeError:qWc()}}function GWc(){return{localeError:HWc()}}function VWc(){return{localeError:$Wc()}}function zWc(){return{localeError:WWc()}}function JWc(){return{localeError:KWc()}}function XWc(){return{localeError:ZWc()}}function tzc(){return{localeError:ezc()}}function nzc(){return{localeError:rzc()}}function ozc(){return{localeError:izc()}}function azc(){return{localeError:szc()}}function S9r(){return new P8e}function Iro(t,e){return new t({type:"string",...xr(e)})}function xro(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function T9r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function Vxt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function I9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function x9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function w9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function R9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function k9r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function P9r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function D9r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function N9r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function M9r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function O9r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function L9r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function B9r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function F9r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function U9r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function Q9r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function q9r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function j9r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function H9r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function G9r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function $9r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function Rro(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function kro(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function Pro(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function Dro(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function Nro(t,e){return new t({type:"number",checks:[],...xr(e)})}function Mro(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function Oro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function Lro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function Bro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function Fro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function Uro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function Qro(t,e){return new t({type:"boolean",...xr(e)})}function qro(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function jro(t,e){return new t({type:"bigint",...xr(e)})}function Hro(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Gro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function $ro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function Vro(t,e){return new t({type:"symbol",...xr(e)})}function Wro(t,e){return new t({type:"undefined",...xr(e)})}function zro(t,e){return new t({type:"null",...xr(e)})}function Yro(t){return new t({type:"any"})}function Wxt(t){return new t({type:"unknown"})}function Kro(t,e){return new t({type:"never",...xr(e)})}function Jro(t,e){return new t({type:"void",...xr(e)})}function Zro(t,e){return new t({type:"date",...xr(e)})}function Xro(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function eno(t,e){return new t({type:"nan",...xr(e)})}function ioe(t,e){return new f9r({check:"less_than",...xr(e),value:t,inclusive:!1})}function qN(t,e){return new f9r({check:"less_than",...xr(e),value:t,inclusive:!0})}function ooe(t,e){return new p9r({check:"greater_than",...xr(e),value:t,inclusive:!1})}function PI(t,e){return new p9r({check:"greater_than",...xr(e),value:t,inclusive:!0})}function tno(t){return ooe(0,t)}function rno(t){return ioe(0,t)}function nno(t){return qN(0,t)}function ino(t){return PI(0,t)}function D8e(t,e){return new rto({check:"multiple_of",...xr(e),value:t})}function Uwt(t,e){return new oto({check:"max_size",...xr(e),maximum:t})}function N8e(t,e){return new sto({check:"min_size",...xr(e),minimum:t})}function V9r(t,e){return new ato({check:"size_equals",...xr(e),size:t})}function Qwt(t,e){return new cto({check:"max_length",...xr(e),maximum:t})}function Nve(t,e){return new lto({check:"min_length",...xr(e),minimum:t})}function qwt(t,e){return new uto({check:"length_equals",...xr(e),length:t})}function W9r(t,e){return new dto({check:"string_format",format:"regex",...xr(e),pattern:t})}function z9r(t){return new fto({check:"string_format",format:"lowercase",...xr(t)})}function Y9r(t){return new pto({check:"string_format",format:"uppercase",...xr(t)})}function K9r(t,e){return new hto({check:"string_format",format:"includes",...xr(e),includes:t})}function J9r(t,e){return new mto({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function Z9r(t,e){return new gto({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function ono(t,e,r){return new Ato({check:"property",property:t,schema:e,...xr(r)})}function X9r(t,e){return new yto({check:"mime_type",mime:t,...xr(e)})}function uoe(t){return new Eto({check:"overwrite",tx:t})}function eUr(t){return uoe(e=>e.normalize(t))}function tUr(){return uoe(t=>t.trim())}function rUr(){return uoe(t=>t.toLowerCase())}function nUr(){return uoe(t=>t.toUpperCase())}function iUr(t,e,r){return new t({type:"array",element:e,...xr(r)})}function czc(t,e,r){return new t({type:"union",options:e,...xr(r)})}function lzc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function uzc(t,e,r){return new t({type:"intersection",left:e,right:r})}function sno(t,e,r,n){let o=r instanceof bo;return new t({type:"tuple",items:e,rest:o?r:null,...xr(o?n:r)})}function dzc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function fzc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function pzc(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function hzc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...xr(r)})}function mzc(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function gzc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function ano(t,e){return new t({type:"file",...xr(e)})}function Azc(t,e){return new t({type:"transform",transform:e})}function yzc(t,e){return new t({type:"optional",innerType:e})}function Ezc(t,e){return new t({type:"nullable",innerType:e})}function _zc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function vzc(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function Czc(t,e){return new t({type:"success",innerType:e})}function bzc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Szc(t,e,r){return new t({type:"pipe",in:e,out:r})}function Tzc(t,e){return new t({type:"readonly",innerType:e})}function Izc(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function xzc(t,e){return new t({type:"lazy",getter:e})}function wzc(t,e){return new t({type:"promise",innerType:e})}function cno(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function lno(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function uno(t,e){let r=xr(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??C9r,u=t.Boolean??g9r,d=t.String??V8e,f=new(t.Transform??v9r)({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 dno(t,e,r,n={}){let o=xr(n),s={...xr(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 fno(t){return new zxt({type:"function",input:Array.isArray(t?.input)?sno(Fwt,t?.input):t?.input??iUr(y9r,Wxt($xt)),output:t?.output??Wxt($xt)})}function oUr(t,e){if(t instanceof P8e){let n=new M8e(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 M8e(e);return r.process(t),r.emit(t,e)}function j0(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 j0(n.element,r);case"object":{for(let o in n.shape)if(j0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(j0(o,r))return!0;return!1}case"intersection":return j0(n.left,r)||j0(n.right,r);case"tuple":{for(let o of n.items)if(j0(o,r))return!0;return!!(n.rest&&j0(n.rest,r))}case"record":return j0(n.keyType,r)||j0(n.valueType,r);case"map":return j0(n.keyType,r)||j0(n.valueType,r);case"set":return j0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return j0(n.innerType,r);case"lazy":return j0(n.getter(),r);case"default":return j0(n.innerType,r);case"prefault":return j0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return j0(n.in,r)||j0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function iJi(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Pzc(r)}function WL(t){return!!t._zod}function sve(t){let e=Object.values(t);if(e.length===0)return iJi({});let r=e.every(WL),n=e.every(o=>!WL(o));if(r)return iJi(t);if(n)return aVc(t);throw Error("Mixed Zod versions detected in object shape.")}function a8e(t,e){return WL(t)?Lwt(t,e):t.safeParse(e)}async function VFr(t,e){return WL(t)?await Bwt(t,e):await t.safeParseAsync(e)}function W8e(t){if(!t)return;let e;if(WL(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function $Fe(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 sve(t)}}if(WL(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 WFr(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 Dzc(t){return t.description}function Nzc(t){if(WL(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function pno(t){if(WL(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 hno(t){return Rro(aUr,t)}function mno(t){return kro(cUr,t)}function gno(t){return Pro(lUr,t)}function Ano(t){return Dro(uUr,t)}function Tt(t){return Iro(jwt,t)}function Ozc(t){return T9r(fUr,t)}function Lzc(t){return Vxt(Yxt,t)}function Bzc(t){return I9r(Y9,t)}function Fzc(t){return x9r(Y9,t)}function Uzc(t){return w9r(Y9,t)}function Qzc(t){return R9r(Y9,t)}function qzc(t){return k9r(pUr,t)}function jzc(t){return P9r(hUr,t)}function Hzc(t){return D9r(mUr,t)}function Gzc(t){return N9r(gUr,t)}function $zc(t){return M9r(AUr,t)}function Vzc(t){return O9r(yUr,t)}function Wzc(t){return L9r(EUr,t)}function zzc(t){return B9r(_Ur,t)}function Yzc(t){return F9r(vUr,t)}function Kzc(t){return U9r(CUr,t)}function Jzc(t){return Q9r(bUr,t)}function Zzc(t){return q9r(SUr,t)}function Xzc(t){return j9r(TUr,t)}function eYc(t){return H9r(IUr,t)}function tYc(t){return G9r(xUr,t)}function rYc(t){return $9r(wUr,t)}function nYc(t,e,r={}){return dno(bno,t,e,r)}function Nc(t){return Nro(Hwt,t)}function G8r(t){return Oro(Vve,t)}function iYc(t){return Lro(Vve,t)}function oYc(t){return Bro(Vve,t)}function sYc(t){return Fro(Vve,t)}function aYc(t){return Uro(Vve,t)}function H0(t){return Qro(Gwt,t)}function cYc(t){return jro($wt,t)}function lYc(t){return Gro(RUr,t)}function uYc(t){return $ro(RUr,t)}function dYc(t){return Vro(Sno,t)}function fYc(t){return Wro(Tno,t)}function kUr(t){return zro(Ino,t)}function pYc(){return Yro(xno)}function af(){return Wxt(wno)}function Vwt(t){return Kro(Rno,t)}function hYc(t){return Jro(kno,t)}function mYc(t){return Zro(PUr,t)}function ba(t,e){return iUr(Pno,t,e)}function gYc(t){let e=t._zod.def.shape;return Xn(Object.keys(e))}function Tn(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Wwt(r)}function AYc(t,e){return new Wwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:Vwt(),...Ws.normalizeParams(e)})}function Zv(t,e){return new Wwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:af(),...Ws.normalizeParams(e)})}function ou(t,e){return new DUr({type:"union",options:t,...Ws.normalizeParams(e)})}function NUr(t,e,r){return new Dno({type:"union",options:e,discriminator:t,...Ws.normalizeParams(r)})}function zwt(t,e){return new Nno({type:"intersection",left:t,right:e})}function yYc(t,e,r){let n=e instanceof bo,o=n?r:e;return new Mno({type:"tuple",items:t,rest:n?e:null,...Ws.normalizeParams(o)})}function iu(t,e,r){return new MUr({type:"record",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function EYc(t,e,r){return new MUr({type:"record",keyType:ou([t,Vwt()]),valueType:e,...Ws.normalizeParams(r)})}function _Yc(t,e,r){return new Ono({type:"map",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function vYc(t,e){return new Lno({type:"set",valueType:t,...Ws.normalizeParams(e)})}function N1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new O8e({type:"enum",entries:r,...Ws.normalizeParams(e)})}function CYc(t,e){return new O8e({type:"enum",entries:t,...Ws.normalizeParams(e)})}function Xn(t,e){return new Bno({type:"literal",values:Array.isArray(t)?t:[t],...Ws.normalizeParams(e)})}function bYc(t){return ano(Fno,t)}function LUr(t){return new OUr({type:"transform",transform:t})}function Td(t){return new BUr({type:"optional",innerType:t})}function Kxt(t){return new Uno({type:"nullable",innerType:t})}function SYc(t){return Td(Kxt(t))}function qno(t,e){return new Qno({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Hno(t,e){return new jno({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Gno(t,e){return new FUr({type:"nonoptional",innerType:t,...Ws.normalizeParams(e)})}function TYc(t){return new $no({type:"success",innerType:t})}function Wno(t,e){return new Vno({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function IYc(t){return eno(zno,t)}function Jxt(t,e){return new UUr({type:"pipe",in:t,out:e})}function Kno(t){return new Yno({type:"readonly",innerType:t})}function xYc(t,e){return new Jno({type:"template_literal",parts:t,...Ws.normalizeParams(e)})}function Xno(t){return new Zno({type:"lazy",getter:t})}function wYc(t){return new eio({type:"promise",innerType:t})}function tio(t,e){let r=new Ih({check:"custom",...Ws.normalizeParams(e)});return r._zod.check=t,r}function rio(t,e){return cno(Ywt,t??(()=>!0),e)}function nio(t,e={}){return lno(Ywt,t,e)}function iio(t,e){let r=tio(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Ws.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(Ws.issue(s))}},t(n.value,n)),e);return r}function RYc(t,e={error:`Input not instance of ${t.name}`}){let r=new Ywt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Ws.normalizeParams(e)});return r._zod.bag.Class=t,r}function PYc(t){let e=Xno(()=>ou([Tt(t),Nc(),H0(),kUr(),ba(e),iu(Tt(),e)]));return e}function QUr(t,e){return Jxt(LUr(t),e)}function NYc(t){tC({customError:t})}function MYc(){return tC().customError}function OYc(t){return xro(jwt,t)}function LYc(t){return Mro(Hwt,t)}function BYc(t){return qro(Gwt,t)}function FYc(t){return Hro($wt,t)}function UYc(t){return Xro(PUr,t)}function hJc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function mJc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Gie(t){return t==="completed"||t==="failed"||t==="cancelled"}function bio(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function yl(t,e,r,n,o){t[e]=r,bio(t,e,n,o)}function D1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Sio(e,t.currentPath):e.join("/")}}function bJc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Dc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&yl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&yl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(yl(r,"minItems",t.exactLength.value,t.exactLength.message,e),yl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function SJc(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?yl(r,"minimum",n.value,n.message,e):yl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),yl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?yl(r,"maximum",n.value,n.message,e):yl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),yl(r,"maximum",n.value,n.message,e));break;case"multipleOf":yl(r,"multipleOf",n.value,n.message,e);break}return r}function TJc(){return{type:"boolean"}}function Tio(t,e){return Dc(t.type._def,e)}function Iio(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>Iio(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 xJc(t,e)}}function wJc(t,e){return{...Dc(t.innerType._def,e),default:t.defaultValue()}}function RJc(t,e){return e.effectStrategy==="input"?Dc(t.schema._def,e):D1(e)}function kJc(t){return{type:"string",enum:Array.from(t.values)}}function DJc(t,e){let r=[Dc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Dc(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(PJc(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 NJc(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 xio(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":yl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":yl(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":UN(r,"email",n.message,e);break;case"format:idn-email":UN(r,"idn-email",n.message,e);break;case"pattern:zod":Jv(r,FN.email,n.message,e);break}break;case"url":UN(r,"uri",n.message,e);break;case"uuid":UN(r,"uuid",n.message,e);break;case"regex":Jv(r,n.regex,n.message,e);break;case"cuid":Jv(r,FN.cuid,n.message,e);break;case"cuid2":Jv(r,FN.cuid2,n.message,e);break;case"startsWith":Jv(r,RegExp(`^${YFr(n.value,e)}`),n.message,e);break;case"endsWith":Jv(r,RegExp(`${YFr(n.value,e)}$`),n.message,e);break;case"datetime":UN(r,"date-time",n.message,e);break;case"date":UN(r,"date",n.message,e);break;case"time":UN(r,"time",n.message,e);break;case"duration":UN(r,"duration",n.message,e);break;case"length":yl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),yl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Jv(r,RegExp(YFr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&UN(r,"ipv4",n.message,e),n.version!=="v4"&&UN(r,"ipv6",n.message,e);break}case"base64url":Jv(r,FN.base64url,n.message,e);break;case"jwt":Jv(r,FN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Jv(r,FN.ipv4Cidr,n.message,e),n.version!=="v4"&&Jv(r,FN.ipv6Cidr,n.message,e);break}case"emoji":Jv(r,FN.emoji(),n.message,e);break;case"ulid":{Jv(r,FN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{UN(r,"binary",n.message,e);break}case"contentEncoding:base64":{yl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Jv(r,FN.base64,n.message,e);break}}break}case"nanoid":Jv(r,FN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function YFr(t,e){return e.patternStrategy==="escape"?OJc(t):t}function OJc(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}}})):yl(t,"format",e,r,n)}function Jv(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:aJi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):yl(t,"pattern",aJi(e,n),r,n)}function aJi(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]:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??D1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Dc(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}=Aio(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}=mio(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function yJc(t,e){if(e.mapStrategy==="record")return yio(t,e);let r=Dc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||D1(e),n=Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||D1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function EJc(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 _Jc(t){return t.target==="openAi"?void 0:{not:D1({...t,currentPath:[...t.currentPath,"not"]})}}function vJc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function CJc(t,e){if(e.target==="openApi3")return ZKi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Xxt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=Xxt[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 ZKi(t,e)}function bJc(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:Xxt[t.innerType._def.typeName],nullable:!0}:{type:[Xxt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function SJc(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",pio(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function TJc(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=xJc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Dc(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=IJc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function IJc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Dc(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 xJc(t){try{return t.isOptional()}catch{return!0}}function kJc(t,e){return Dc(t.type._def,e)}function PJc(t,e){let r={type:"array",uniqueItems:!0,items:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Al(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Al(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function DJc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Dc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function NJc(t){return{not:D1(t)}}function MJc(t){return D1(t)}function Dc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==rJc)return l}if(n&&!r){let l=BJc(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=LJc(t,t.typeName,e),c=typeof s=="function"?Dc(s(),e):s;if(c&&FJc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function QJc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function XKi(t,e){return VL(t)?eUr(t,{target:QJc(e?.target),io:e?.pipeStrategy??"input"}):UJc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function eJi(t){let e=j8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=nno(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function tJi(t,e){let r=r8e(t,e);if(!r.success)throw r.error;return r.data}function rJi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function jJc(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];rJi(c)&&rJi(s)?r[o]={...c,...s}:r[o]=s}return r}function $Jc(){let t=new HJc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return GJc.default(t),t}function VJc(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 WJc(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 nJi(t){return!!t&&typeof t=="object"&&Eio in t}function zJc(t){return t[Eio]?.complete}function KJc(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"),!YJc.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 JJc(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 oJi(t){let e=KJc(t);return JJc(t,e.warnings),e.isValid}function _io(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function vio(t){return"_def"in t||"_zod"in t||_io(t)}function e6r(t){return typeof t!="object"||t===null||vio(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(_io)}function sJi(t){if(t){if(e6r(t))return nve(t);if(!vio(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function XJc(t){let e=j8e(t);return e?Object.entries(e).map(([r,n])=>{let o=hzc(n),s=mzc(n);return{name:r,description:o,required:!s}}):[]}function XV(t){let e=j8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=nno(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function aJi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function eZc(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 tZc(t){let e=new X8r({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(!rZc(n))continue;let o=n.description;o&&!V9.has(n)&&V9.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 rZc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function iZc(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 mk("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 oZc(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:Qm(r)})}catch(s){throw new mk(`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 mk(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=nZc().safeParse(await n.json());if(!o.success)throw new mk(`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 lJi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function r6r(t,e,r){let n=sZc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=DI(),c=Qm(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,bio.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function sZc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function aZc(t){let{buffer:e,bytesRead:r}=DI().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 cZc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function lZc(t){let e=DI(),{resolvedPath:r,isSymlink:n}=mXi(e,t);n&&ru(`Reading through symlink: ${t} -> ${r}`);let o=aZc(r),s=e.readFileSync(r,{encoding:o}),c=cZc(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 wio(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]:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??D1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Dc(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}=xio(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}=Tio(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function LJc(t,e){if(e.mapStrategy==="record")return wio(t,e);let r=Dc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||D1(e),n=Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||D1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function BJc(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 FJc(t){return t.target==="openAi"?void 0:{not:D1({...t,currentPath:[...t.currentPath,"not"]})}}function UJc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function QJc(t,e){if(e.target==="openApi3")return cJi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in nwt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=nwt[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 cJi(t,e)}function qJc(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:nwt[t.innerType._def.typeName],nullable:!0}:{type:[nwt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function jJc(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",bio(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?yl(r,"minimum",n.value,n.message,e):yl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),yl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?yl(r,"maximum",n.value,n.message,e):yl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),yl(r,"maximum",n.value,n.message,e));break;case"multipleOf":yl(r,"multipleOf",n.value,n.message,e);break}return r}function HJc(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=$Jc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Dc(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=GJc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function GJc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Dc(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 $Jc(t){try{return t.isOptional()}catch{return!0}}function zJc(t,e){return Dc(t.type._def,e)}function YJc(t,e){let r={type:"array",uniqueItems:!0,items:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&yl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&yl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function KJc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Dc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function JJc(t){return{not:D1(t)}}function ZJc(t){return D1(t)}function Dc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==_Jc)return l}if(n&&!r){let l=tZc(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=eZc(t,t.typeName,e),c=typeof s=="function"?Dc(s(),e):s;if(c&&rZc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function iZc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function lJi(t,e){return WL(t)?oUr(t,{target:iZc(e?.target),io:e?.pipeStrategy??"input"}):nZc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function uJi(t){let e=W8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=pno(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function dJi(t,e){let r=a8e(t,e);if(!r.success)throw r.error;return r.data}function fJi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function sZc(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];fJi(c)&&fJi(s)?r[o]={...c,...s}:r[o]=s}return r}function lZc(){let t=new aZc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return cZc.default(t),t}function uZc(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 dZc(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 pJi(t){return!!t&&typeof t=="object"&&Rio in t}function fZc(t){return t[Rio]?.complete}function hZc(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"),!pZc.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 mZc(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 mJi(t){let e=hZc(t);return mZc(t,e.warnings),e.isValid}function kio(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function Pio(t){return"_def"in t||"_zod"in t||kio(t)}function o6r(t){return typeof t!="object"||t===null||Pio(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(kio)}function gJi(t){if(t){if(o6r(t))return sve(t);if(!Pio(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function AZc(t){let e=W8e(t);return e?Object.entries(e).map(([r,n])=>{let o=Dzc(n),s=Nzc(n);return{name:r,description:o,required:!s}}):[]}function nW(t){let e=W8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=pno(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function AJi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function yZc(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 EZc(t){let e=new i6r({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(!_Zc(n))continue;let o=n.description;o&&!z9.has(n)&&z9.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 _Zc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function CZc(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 Ak("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 bZc(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:jm(r)})}catch(s){throw new Ak(`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 Ak(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=vZc().safeParse(await n.json());if(!o.success)throw new Ak(`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 EJi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function a6r(t,e,r){let n=SZc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=MI(),c=jm(o)+` +`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,Nio.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function SZc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function TZc(t){let{buffer:e,bytesRead:r}=MI().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 IZc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function xZc(t){let e=MI(),{resolvedPath:r,isSymlink:n}=TXi(e,t);n&&ru(`Reading through symlink: ${t} -> ${r}`);let o=TZc(r),s=e.readFileSync(r,{encoding:o}),c=IZc(s.slice(0,4096));return{content:s.replaceAll(`\r `,` -`),encoding:o,lineEndings:c}}function Ywt(t){return lZc(t).content}function Sio(t){return t.startsWith("\uFEFF")?t.slice(1):t}function pZc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),ewt.default.platform==="darwin"?uZc(t):ewt.default.platform==="win32"?dZc(t):fZc(t)}function hZc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||s_(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function mZc(){return hZc()==="essential-traffic"}function AZc(t){$Fr.length>=gZc&&$Fr.shift(),$Fr.push(t)}function Tio(t){let e=M8e(t);try{if(s_(process.env.CLAUDE_CODE_USE_BEDROCK)||s_(process.env.CLAUDE_CODE_USE_VERTEX)||s_(process.env.CLAUDE_CODE_USE_FOUNDRY)||s_(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||s_(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||mZc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(AZc(r),mJi===null){yZc.push({type:"error",error:e});return}mJi.logError(e)}catch{}}function _Zc(t,e,r=100){let n=new o6r({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 Rio(t,e){try{return{ok:!0,value:JSON.parse(Sio(t))}}catch(r){return e&&Tio(r),{ok:!1}}}function NZc(){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:jFe(),shell:G.enum(DZc).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:jFe(),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:jFe(),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:jFe(),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:jFe(),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 zZc(t){return Nio.has(t.toLowerCase())?!1:WZc.test(t)?!0:VZc.test(t)}function AXc(t){let e=mXc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=gXc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(ru(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(ru(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function jio(){return wXc.filter(t=>Zwt[t].buildGate())}function RXc(t){let e={};for(let r of t)e={...e,...Zwt[r].shape()};return e}function kXc(t){let e={};for(let r of t)e={...e,...Zwt[r].permissionsShape?.()};return e}function PXc(t){let e=[];for(let r of t)e.push(...Zwt[r].permissionModes?.()??[]);return e}function DXc(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 X_e(t){return Object.hasOwn(vJi,t)?vJi[t]:t}function NXc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function MXc(t){let e=OXc(t,"(");if(e===-1)return{toolName:X_e(t)};let r=LXc(t,")");if(r===-1||r<=e)return{toolName:X_e(t)};if(r!==t.length-1)return{toolName:X_e(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:X_e(t)};if(o===""||o==="*")return{toolName:X_e(n)};let s=NXc(o);return{toolName:X_e(n),ruleContent:s}}function OXc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function LXc(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 BXc(t){return iwt.filePatternTools.includes(t)}function FXc(t){return iwt.bashPrefixTools.includes(t)}function UXc(t){return Object.hasOwn(iwt.customValidation,t)?iwt.customValidation[t]:void 0}function Gio(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function WFr(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 "${THc(String(n.toolName))}"`};let s=UXc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(FXc(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(BXc(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 Vio(t){return G.object({allow:G.array(zFr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(zFr()).optional().describe("List of permission rules for denied operations"),ask:G.array(zFr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...s7r,...PXc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...kXc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function GXc(t){return G.object({$schema:G.literal(xXc).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:HXc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...s_(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:qXc().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:Vio(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(Wio()).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(zio()).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:rwt().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=>CJi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(CJi))])).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(),jXc()).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(nwt()).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(nwt()).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:SZc().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(RZc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(IZc).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(TZc).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(xZc).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"),...RXc(t)}).passthrough()}function WXc(t){let e=$Xc.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=VXc[xHc(t.path,".")]),r}function bJi(t){return t.code==="invalid_type"}function SJi(t){return t.code==="invalid_value"}function zXc(t){return t.code==="unrecognized_keys"}function TJi(t){return t.code==="too_small"}function lve(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function IJi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function K8e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(SJi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(bJi(r)){l=r.expected;let h=IJi(r.message);u=h??lve(r.input),d=h??lve(r.input)}else TJi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=WXc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(SJi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(bJi(r)){let h=IJi(r.message)??lve(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(zXc(r)){let h=r.keys.join(", ");o=`Unrecognized ${IHc(r.keys.length,"field")}: ${h}`}else TJi(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 YXc(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=$io(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 JXc(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=lve(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(!KXc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${ywt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=lve(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 XXc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of ZXc){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 ${lve(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,Jio.execFile)(t,e,{encoding:"utf-8",timeout:rel},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function oel(){return(async()=>{if(process.platform==="darwin"){let t=nel(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,Zio.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await HFe(eel,[...tel,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([HFe(t,["query",u6r,"/v",ove]),HFe(t,["query",d6r,"/v",ove])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(Kio()){let[t,e]=await Promise.all([HFe(wJi,["query",u6r,"/v",ove]),HFe(wJi,["query",d6r,"/v",ove])]);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 sel(){return iel}function ael(){swt||(swt=(async()=>{let t=Date.now(),e=sel()??oel(),{mdm:r,hkcu:n,wslInherits:o}=fel(await e);Xio=r,eoo=n,too=o;let s=Date.now()-t;if(ru(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){ru(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{r6r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function cel(){swt||ael(),await swt}function lel(){return Xio??rW}function uel(){return eoo??rW}function del(){return too}function YFr(t,e){let r=uW(Kwt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Wve(r,e),o=Vve().safeParse(r);if(!o.success){let s=K8e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function RJi(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 fel(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=YFr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:rW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=RJi(t.hklmStdout);c&&(r=YFr(c,`Registry: ${u6r}\\${ove}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:rW,o=Kio(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||hel(),!s))return{mdm:n,hkcu:rW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:rW,wslInherits:s}}if(pel(s))return{mdm:n,hkcu:rW,wslInherits:s};if(t.hkcuStdout){let c=RJi(t.hkcuStdout);if(c){let l=YFr(c,`Registry: ${d6r}\\${ove}`);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:rW,wslInherits:s}}function pel(t){return t&&PJi(owt)?!0:PJi(P8e())}function kJi(t){let e=uW(Kwt(Ywt(t),!1));if(!e||typeof e!="object")return!1;Wve(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function hel(){function t(e){try{let r=Kwt(Ywt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Jie.join)(owt,"managed-settings.json")))return!0;try{let e=(0,Jie.join)(owt,"managed-settings.d");for(let r of DI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Jie.join)(e,r.name)))return!0}catch{}return!1}function PJi(t){try{if(kJi((0,Jie.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Jie.join)(t,"managed-settings.d"),r=DI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(kJi((0,Jie.join)(e,n.name)))return!0}catch{}}catch{}return!1}function mel(t,e,r){(r!==void 0&&!Ewt(t[e],r)||r===void 0&&!(e in t))&&B6r(t,e,r)}function gel(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 _el(t){return Qve(t)&&Q6r(t)}function xel(t){if(!Qve(t)||N8e(t)!=Cel)return!1;var e=lXi(t);if(e===null)return!0;var r=Tel.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&roo.call(r)==Iel}function Rel(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function kel(t){return UQc(t,sXi(t))}function Del(t,e,r,n,o,s,c){var l=p6r(t,r),u=p6r(e,r),d=c.get(u);if(d){f6r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=lW(u),g=!m&&F6r(u),A=!m&&!g&&iXi(u);f=u,m||g||A?lW(l)?f=l:vel(l)?f=tjc(l):g?(h=!1,f=cXi(u,!0)):A?(h=!1,f=ljc(u,!0)):f=[]:wel(u)||l8e(u)?(f=l,l8e(l)?f=Pel(l):(!z9(l)||I6r(l))&&(f=pjc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),f6r(t,r,f)}function noo(t,e,r,n,o){t!==e&&Eel(e,function(s,c){if(o||(o=new DQc),z9(s))Nel(t,e,c,r,noo,n,o);else{var l=n?n(p6r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),f6r(t,c,l)}},sXi)}function Oel(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 Bel(t,e,r){return e=DJi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=DJi(n.length-e,0),c=Array(s);++o0){if(++e>=jel)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function zel(t,e){return ooo(ioo(t,e,dXi),t+"")}function Kel(t,e,r){if(!z9(r))return!1;var n=typeof e;return(n=="number"?Q6r(r)&&bwt(e,r.length):n=="string"&&e in r)?Ewt(r[e],t):!1}function Zel(t){return Yel(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&&Jel(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?soo(l,e-1,r,n,o):njc(o,l):n||(o[o.length]=l)}return o}function utl(t){var e=t==null?0:t.length;return e?ltl(t,1):[]}function ftl(t){return ooo(ioo(t,void 0,dtl),t+"")}function Atl(){return void 0??(0,aoo.join)(Fve(),mtl)}function ytl(){try{let t=Ywt(Atl()),e=GN(Sio(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function Etl(){if(!void 0&>l!==!0)return null;if(JFr)return JFr;let t=ytl();return t?(JFr=t,$6r(),t):null}function c7r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),IXc.filter(r=>e.has(r))}function _tl(){return(0,ky.join)(P8e(),"managed-settings.json")}function coo(t){if(Jwt()==="wsl"&&t.wslInherits?.()){let e=ZFr(owt);if(e.settings)return e;let r=ZFr(P8e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return ZFr(P8e())}function ZFr(t){let e=[],r={},n=!1,{settings:o,errors:s}=awt((0,ky.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=oW(r,o,sW),n=!0);let c=(0,ky.join)(t,"managed-settings.d");try{let d=DI().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}=awt((0,ky.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=oW(r,h,sW),n=!0)}}catch(d){let f=PI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&ru(`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 vtl(t,e){O8e(t)?ru(`Broken symlink or missing file encountered for settings.json at path: ${e}`):ru(`settings file read failed at ${e}: ${t}`,{level:"error"})}function awt(t,e){let r=Kjc(t);if(r)return{settings:r.settings?uW(r.settings):null,errors:r.errors};let n=Ctl(t,e);return Jjc(t,n),{settings:n.settings?uW(n.settings):null,errors:n.errors}}function loo(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 uoo(t){let e=t?.remote?t.remote():Etl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"remote managed settings"),o=Vve().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"remote managed settings")]}}function doo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"parent managed settings"),o=Vve().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"parent managed settings")]}}function foo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"SDK inline settings"),o=Vve().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"SDK inline settings")]}}function Ctl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=mXi(DI(),t);r=Ywt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=uW(Kwt(r,!1)),o=Wve(n,t),s=Vve().safeParse(n);if(!s.success){let c=K8e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return vtl(r,t),{settings:null,errors:[]}}}function MJi(t,e){switch(t){case"userSettings":return(0,ky.resolve)(Fve());case"policySettings":case"projectSettings":case"localSettings":return(0,ky.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,ky.dirname)((0,ky.resolve)(e.flagPath)):(0,ky.resolve)(e.cwd)}}function btl(t){return t.coworkPlugins||s_(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function cwt(t,e){switch(t){case"userSettings":return(0,ky.join)(MJi(t,e),btl(e));case"projectSettings":case"localSettings":return(0,ky.join)(MJi(t,e),Stl(t));case"policySettings":return _tl();case"flagSettings":return e.flagPath}}function Stl(t){switch(t){case"projectSettings":return(0,ky.join)(".claude","settings.json");case"localSettings":return(0,ky.join)(".claude","settings.local.json")}}function poo(t,e){let r=Wjc(t);if(r!==void 0)return r;let n=Rtl(t,e);return zjc(t,n),n}function Ttl(t){return!t||t.parentSettingsBehavior==="merge"}function Itl(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=KFr(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=KFr(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=KFr(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 xtl(t){if(t.helper?.())return"helper";if(uoo(t).settings)return"remote";if(loo(t).settings)return Jwt()==="macos"?"plist":"hklm";if((t.file?.()??coo(t)).settings)return"file";if(doo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function wtl(t){let e=[],{settings:r,errors:n}=uoo(t);e.push(...n);let{settings:o,errors:s}=loo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??coo(t);e.push(...l);let{settings:u,errors:d}=doo(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&&Ttl(h)?Itl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function hoo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=wtl(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:oW({},n??{},r??{},sW),errors:o}}function Rtl(t,e){if(t==="policySettings")return hoo(e).settings;let r=cwt(t,e),{settings:n}=r?awt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=foo(e);if(o)return oW(n||{},o,sW)}return n}function ktl(t,e){return zXi([...t,...e])}function sW(t,e){if(Array.isArray(t)&&Array.isArray(e))return ktl(t,e)}function Ptl(t){if(XFr)return{settings:{},errors:[]};let e=Date.now();r6r("info","settings_load_started"),XFr=!0;try{let r=Xjc(),n={};r&&(n=oW(n,r,sW));let o=[],s=new Set,c=new Set;for(let l of c7r(t)){if(l==="policySettings"){let{settings:d,errors:f}=hoo(t);d&&(n=oW(n,d,sW));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=cwt(l,t);if(u){let d=(0,ky.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=awt(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=oW(n,f,sW))}}if(l==="flagSettings"){let{settings:d,errors:f}=foo(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=oW(n,d,sW))}}return r6r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{XFr=!1}}function Dtl(t){let e=$jc();if(e!==null)return e;let r=Ptl(t);return Vjc(r),r}function Ntl(t){let{settings:e}=Dtl(t);return e||{}}function Mtl(t){$6r();let e=[];for(let r of c7r(t)){let n=poo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:Ntl(t),sources:e}}function Otl(t,e){let r=c7r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(poo(o,e)?.[t]!==void 0)return o}return null}function Qtl(t){let e=t.effective.permissions?.defaultMode;if(!e||!Ftl.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(Utl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function qtl(t={}){await cel();let e={cwd:(0,Cio.resolve)(t.cwd??DI().cwd()),allowedSources:(t.settingSources??Btl).map(r=>Ltl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:lel,hkcu:uel,wslInherits:del,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=Mtl(e),o=xtl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:OJi[l],settings:u,path:l==="policySettings"?void 0:cwt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=Otl(l,e);u&&(c[l]={source:OJi[u],path:u==="policySettings"?void 0:cwt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{$6r()}}async function jtl(t){return qtl(t)}async function Htl(t,e){try{await(0,a_.copyFile)(t,e)}catch(r){if(!O8e(r))throw r}}async function Gtl(t,e){if(!t)return;let r=t;try{let n=GN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=Qm(n))}catch{}await(0,a_.writeFile)(e,r,{mode:384})}function $tl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=g$c(m$c);return new Promise(e=>{(0,iZi.execFile)("security",["find-generic-password","-a",y$c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function moo(t,e,r,n,o=6e4){if(!bh(e))return;let s=bk(r),c=await Vie(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,pc.join)((0,uve.tmpdir)(),`claude-resume-${(0,gwt.randomUUID)()}`);try{let u=(0,pc.join)(l,"projects",s);await(0,a_.mkdir)(u,{recursive:!0});let d=(0,pc.join)(u,`${e}.jsonl`);await R8r(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,pc.join)((0,uve.homedir)(),".claude"),m;try{m=await(0,a_.readFile)((0,pc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!O8e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await $tl()??m),await Gtl(m,(0,pc.join)(l,".credentials.json")),await Htl((0,pc.join)(f??(0,uve.homedir)(),".claude.json"),(0,pc.join)(l,".claude.json")),t.listSubkeys){let g=(0,pc.join)(u,e),A=await Vie(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,pc.resolve)(g,y+".jsonl");if(!y||(0,pc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+pc.sep)){ru(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Vie(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 _)g6r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,a_.mkdir)((0,pc.dirname)(E),{recursive:!0}),await R8r(E,b)),v.length>0){let T=v.at(-1),w=(0,pc.resolve)(g,y+".meta.json");await(0,a_.mkdir)((0,pc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,a_.writeFile)(w,Qm(x),{mode:384})}}}return l}catch(u){throw await lwt(l),u}}function h6r(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=t8r(),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:L=hZi()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:j,forkSession:Q,hooks:U,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:ge,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,mcpServers:ee,model:K,outputFormat:he,permissionMode:Z="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ne,getOAuthToken:ce,getHostAuthToken:Ne,workload:we,resume:Be,resumeSessionAt:rt,sessionId:st,skills:_t,stderr:Dt,strictMcpConfig:$t}=d;if(H&&ie===!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&&ru("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 Ge=(0,aZi.fileURLToPath)(importMetaUrlShim),J=(0,oZi.createRequire)(Ge),se=ZHc(me=>J.resolve(me));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.`);Gt=se}let Ie=he?.type==="json_schema"?he.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"),ce&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),j?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=j.askUserQuestion.previewFormat);let be={};if(wKi.propagation.inject(wKi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,J]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=J)}let Qe={},pe=new Map;if(ee)for(let[Ge,J]of Object.entries(ee))J.type==="sdk"&&J.instance?pe.set(Ge,J.instance):Qe[Ge]=J;let Se;if(le)switch(le.type){case"adaptive":Se={type:"adaptive",display:le.display};break;case"enabled":Se={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Se={type:"disabled"};break}else ge!==void 0&&(Se=ge===0?{type:"disabled"}:{type:"enabled",budgetTokens:ge});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 Fe=new S8r({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:we?{...q,workload:we}:q,pathToClaudeCodeExecutable:Gt,env:F,forkSession:Q,stderr:Dt,thinkingConfig:Se,effort:Le,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:Z,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:rt,sessionId:st,settings:typeof s=="object"?Qm(s):s,managedSettings:c?Qm(c):void 0,settingSources:l,skills:_t,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Qe,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,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:_t,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},Te=new I8r(Fe,e,b,U,g,pe,Ie,te,z,ce,Ne);if(H){let Ge=a(()=>(0,pc.join)(F.CLAUDE_CONFIG_DIR??(0,pc.join)((0,uve.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",se=new x8r(async(me,Ce)=>{let He=UJi(me,Ge());He?await H.append(He,Ce):ru(`[SessionStore] dropping mirror frame: filePath ${me} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(me,Ce)=>{let He=UJi(me,Ge());He&&Te.reportMirrorError(He,Ce.message)},J?0:W6r,J?0:z6r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Fe,abortController:g,processEnv:F}}function m6r(t,e,r,n){typeof r=="string"?e.write(Qm({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 lwt(t){for(let e=0;;e++)try{return await(0,a_.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!Vtl.has(PI(r)??""))return;await lZi((e+1)*100)}}function Wtl(t,e){t.waitForExit().catch(()=>{}).finally(()=>lwt(e))}function ztl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=h6r({...e},typeof t=="string",void 0,!0),d=(0,pc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Vie(f.listSessions(bk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return moo(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(()=>Wtl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=M8e(g);c.spawnAbort(A),s.setError(A)}),m6r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=h6r(e,typeof t=="string");return m6r(r,n,t,o),r}async function Ytl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,pc.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 Vie(t.sessionStore.listSessions(bk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await moo(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=h6r(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(()=>lwt(g))})}await Vie(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{m6r(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(()=>lwt(r))}throw await c,l}}async function Ktl(t,e){return e?.sessionStore?lrl(e.sessionStore,t,e):OGc(t,e)}async function Jtl(t){return t?.sessionStore?arl(t.sessionStore,t):jGc(t)}async function Ztl(t,e){return e?.sessionStore?url(e.sessionStore,t,e):HGc(t,e)}async function Xtl(t,e,r){return r?.sessionStore?drl(r.sessionStore,t,e,r.dir):GGc(t,e,r)}async function erl(t,e,r){return r?.sessionStore?frl(r.sessionStore,t,e,r.dir):$Gc(t,e,r)}async function trl(t,e){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=bk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return VGc(t,e)}async function rrl(t,e){return e?.sessionStore?prl(e.sessionStore,t,e):ZGc(t,e)}async function nrl(t,e,r){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);let n=await Iwt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=bk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:W6r;if(await LJi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,pc.join)(c,"subagents");for(let u of await irl(l)){let d=(0,pc.relative)(c,u).split(pc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await LJi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=GN(await(0,a_.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!O8e(m))throw m}}}async function LJi(t,e,r,n){let o=(0,sZi.createInterface)({input:(0,Awt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(GN(l)),c+=l.length,(s.length>=n||c>=z6r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function irl(t){let e=[];async function r(n){let o;try{o=await(0,a_.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,pc.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 orl(t,e){return e?.sessionStore?hrl(e.sessionStore,t,e.dir):i$c(t,e)}async function srl(t,e,r){return r?.sessionStore?mrl(r.sessionStore,t,e,r):o$c(t,e,r)}function goo(t){let e=(0,pc.resolve)(t??"."),r;try{r=(0,Awt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function bk(t){return B8e(goo(t))}function Aoo(t){return t.map(e=>Qm(e)).join(` +`),encoding:o,lineEndings:c}}function Xwt(t){return xZc(t).content}function Mio(t){return t.startsWith("\uFEFF")?t.slice(1):t}function PZc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),iwt.default.platform==="darwin"?wZc(t):iwt.default.platform==="win32"?RZc(t):kZc(t)}function DZc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||a_(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function NZc(){return DZc()==="essential-traffic"}function OZc(t){KFr.length>=MZc&&KFr.shift(),KFr.push(t)}function Oio(t){let e=U8e(t);try{if(a_(process.env.CLAUDE_CODE_USE_BEDROCK)||a_(process.env.CLAUDE_CODE_USE_VERTEX)||a_(process.env.CLAUDE_CODE_USE_FOUNDRY)||a_(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||a_(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||NZc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(OZc(r),TJi===null){LZc.push({type:"error",error:e});return}TJi.logError(e)}catch{}}function FZc(t,e,r=100){let n=new u6r({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 Uio(t,e){try{return{ok:!0,value:JSON.parse(Mio(t))}}catch(r){return e&&Oio(r),{ok:!1}}}function JZc(){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:WFe(),shell:G.enum(KZc).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:WFe(),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:WFe(),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:WFe(),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:WFe(),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 fXc(t){return Hio.has(t.toLowerCase())?!1:dXc.test(t)?!0:uXc.test(t)}function OXc(t){let e=NXc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=MXc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(ru(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(ru(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function Zio(){return VXc.filter(t=>rRt[t].buildGate())}function WXc(t){let e={};for(let r of t)e={...e,...rRt[r].shape()};return e}function zXc(t){let e={};for(let r of t)e={...e,...rRt[r].permissionsShape?.()};return e}function YXc(t){let e=[];for(let r of t)e.push(...rRt[r].permissionModes?.()??[]);return e}function KXc(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 rve(t){return Object.hasOwn(PJi,t)?PJi[t]:t}function JXc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function ZXc(t){let e=XXc(t,"(");if(e===-1)return{toolName:rve(t)};let r=eel(t,")");if(r===-1||r<=e)return{toolName:rve(t)};if(r!==t.length-1)return{toolName:rve(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:rve(t)};if(o===""||o==="*")return{toolName:rve(n)};let s=JXc(o);return{toolName:rve(n),ruleContent:s}}function XXc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function eel(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 tel(t){return cwt.filePatternTools.includes(t)}function rel(t){return cwt.bashPrefixTools.includes(t)}function nel(t){return Object.hasOwn(cwt.customValidation,t)?cwt.customValidation[t]:void 0}function eoo(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function ZFr(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 "${HHc(String(n.toolName))}"`};let s=nel(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(rel(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(tel(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 roo(t){return G.object({allow:G.array(XFr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(XFr()).optional().describe("List of permission rules for denied operations"),ask:G.array(XFr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...d7r,...YXc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...zXc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function cel(t){return G.object({$schema:G.literal($Xc).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:ael().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...a_(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:oel().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:roo(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(noo()).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(ioo()).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:swt().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=>DJi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(DJi))])).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(),sel()).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(awt()).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(awt()).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:jZc().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(WZc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(GZc).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(HZc).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($Zc).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"),...WXc(t)}).passthrough()}function del(t){let e=lel.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=uel[$Hc(t.path,".")]),r}function NJi(t){return t.code==="invalid_type"}function MJi(t){return t.code==="invalid_value"}function fel(t){return t.code==="unrecognized_keys"}function OJi(t){return t.code==="too_small"}function fve(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function LJi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function t6e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(MJi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(NJi(r)){l=r.expected;let h=LJi(r.message);u=h??fve(r.input),d=h??fve(r.input)}else OJi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=del({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(MJi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(NJi(r)){let h=LJi(r.message)??fve(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(fel(r)){let h=r.keys.join(", ");o=`Unrecognized ${GHc(r.keys.length,"field")}: ${h}`}else OJi(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 pel(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=too(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 mel(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=fve(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(!hel.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${Cwt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=fve(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 Ael(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of gel){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 ${fve(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,aoo.execFile)(t,e,{encoding:"utf-8",timeout:_el},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function bel(){return(async()=>{if(process.platform==="darwin"){let t=vel(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,coo.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await zFe(yel,[...Eel,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([zFe(t,["query",m6r,"/v",cve]),zFe(t,["query",g6r,"/v",cve])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(soo()){let[t,e]=await Promise.all([zFe(FJi,["query",m6r,"/v",cve]),zFe(FJi,["query",g6r,"/v",cve])]);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 Sel(){return Cel}function Tel(){uwt||(uwt=(async()=>{let t=Date.now(),e=Sel()??bel(),{mdm:r,hkcu:n,wslInherits:o}=kel(await e);loo=r,uoo=n,doo=o;let s=Date.now()-t;if(ru(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){ru(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{a6r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function Iel(){uwt||Tel(),await uwt}function xel(){return loo??sW}function wel(){return uoo??sW}function Rel(){return doo}function e8r(t,e){let r=hW(eRt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Kve(r,e),o=Yve().safeParse(r);if(!o.success){let s=t6e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function UJi(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 kel(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=e8r(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:sW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=UJi(t.hklmStdout);c&&(r=e8r(c,`Registry: ${m6r}\\${cve}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:sW,o=soo(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||Del(),!s))return{mdm:n,hkcu:sW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:sW,wslInherits:s}}if(Pel(s))return{mdm:n,hkcu:sW,wslInherits:s};if(t.hkcuStdout){let c=UJi(t.hkcuStdout);if(c){let l=e8r(c,`Registry: ${g6r}\\${cve}`);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:sW,wslInherits:s}}function Pel(t){return t&&qJi(lwt)?!0:qJi(L8e())}function QJi(t){let e=hW(eRt(Xwt(t),!1));if(!e||typeof e!="object")return!1;Kve(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function Del(){function t(e){try{let r=eRt(Xwt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Zie.join)(lwt,"managed-settings.json")))return!0;try{let e=(0,Zie.join)(lwt,"managed-settings.d");for(let r of MI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Zie.join)(e,r.name)))return!0}catch{}return!1}function qJi(t){try{if(QJi((0,Zie.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Zie.join)(t,"managed-settings.d"),r=MI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(QJi((0,Zie.join)(e,n.name)))return!0}catch{}}catch{}return!1}function Nel(t,e,r){(r!==void 0&&!bwt(t[e],r)||r===void 0&&!(e in t))&&j6r(t,e,r)}function Mel(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 Fel(t){return Hve(t)&&$6r(t)}function $el(t){if(!Hve(t)||F8e(t)!=Qel)return!1;var e=EXi(t);if(e===null)return!0;var r=Hel.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&foo.call(r)==Gel}function Wel(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function zel(t){return nqc(t,gXi(t))}function Kel(t,e,r,n,o,s,c){var l=y6r(t,r),u=y6r(e,r),d=c.get(u);if(d){A6r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=pW(u),g=!m&&H6r(u),A=!m&&!g&&hXi(u);f=u,m||g||A?pW(l)?f=l:Uel(l)?f=Ejc(l):g?(h=!1,f=yXi(u,!0)):A?(h=!1,f=xjc(u,!0)):f=[]:Vel(u)||h8e(u)?(f=l,h8e(l)?f=Yel(l):(!K9(l)||P6r(l))&&(f=Pjc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),A6r(t,r,f)}function poo(t,e,r,n,o){t!==e&&Bel(e,function(s,c){if(o||(o=new KQc),K9(s))Jel(t,e,c,r,poo,n,o);else{var l=n?n(y6r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),A6r(t,c,l)}},gXi)}function Xel(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 ttl(t,e,r){return e=jJi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=jJi(n.length-e,0),c=Array(s);++o0){if(++e>=stl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function ftl(t,e){return moo(hoo(t,e,vXi),t+"")}function htl(t,e,r){if(!K9(r))return!1;var n=typeof e;return(n=="number"?$6r(r)&&xwt(e,r.length):n=="string"&&e in r)?bwt(r[e],t):!1}function gtl(t){return ptl(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&&mtl(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?goo(l,e-1,r,n,o):vjc(o,l):n||(o[o.length]=l)}return o}function wtl(t){var e=t==null?0:t.length;return e?xtl(t,1):[]}function ktl(t){return moo(hoo(t,void 0,Rtl),t+"")}function Otl(){return void 0??(0,Aoo.join)(qve(),Ntl)}function Ltl(){try{let t=Xwt(Otl()),e=WN(Mio(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function Btl(){if(!void 0&&Mtl!==!0)return null;if(r8r)return r8r;let t=Ltl();return t?(r8r=t,K6r(),t):null}function p7r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),GXc.filter(r=>e.has(r))}function Ftl(){return(0,Py.join)(L8e(),"managed-settings.json")}function yoo(t){if(tRt()==="wsl"&&t.wslInherits?.()){let e=n8r(lwt);if(e.settings)return e;let r=n8r(L8e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return n8r(L8e())}function n8r(t){let e=[],r={},n=!1,{settings:o,errors:s}=dwt((0,Py.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=lW(r,o,uW),n=!0);let c=(0,Py.join)(t,"managed-settings.d");try{let d=MI().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}=dwt((0,Py.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=lW(r,h,uW),n=!0)}}catch(d){let f=NI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&ru(`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 Utl(t,e){Q8e(t)?ru(`Broken symlink or missing file encountered for settings.json at path: ${e}`):ru(`settings file read failed at ${e}: ${t}`,{level:"error"})}function dwt(t,e){let r=hHc(t);if(r)return{settings:r.settings?hW(r.settings):null,errors:r.errors};let n=Qtl(t,e);return mHc(t,n),{settings:n.settings?hW(n.settings):null,errors:n.errors}}function Eoo(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 _oo(t){let e=t?.remote?t.remote():Btl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=hW(e),n=Kve(r,"remote managed settings"),o=Yve().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...t6e(o.error,"remote managed settings")]}}function voo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=hW(e),n=Kve(r,"parent managed settings"),o=Yve().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...t6e(o.error,"parent managed settings")]}}function Coo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=hW(e),n=Kve(r,"SDK inline settings"),o=Yve().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...t6e(o.error,"SDK inline settings")]}}function Qtl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=TXi(MI(),t);r=Xwt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=hW(eRt(r,!1)),o=Kve(n,t),s=Yve().safeParse(n);if(!s.success){let c=t6e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return Utl(r,t),{settings:null,errors:[]}}}function GJi(t,e){switch(t){case"userSettings":return(0,Py.resolve)(qve());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 qtl(t){return t.coworkPlugins||a_(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function fwt(t,e){switch(t){case"userSettings":return(0,Py.join)(GJi(t,e),qtl(e));case"projectSettings":case"localSettings":return(0,Py.join)(GJi(t,e),jtl(t));case"policySettings":return Ftl();case"flagSettings":return e.flagPath}}function jtl(t){switch(t){case"projectSettings":return(0,Py.join)(".claude","settings.json");case"localSettings":return(0,Py.join)(".claude","settings.local.json")}}function boo(t,e){let r=dHc(t);if(r!==void 0)return r;let n=Wtl(t,e);return fHc(t,n),n}function Htl(t){return!t||t.parentSettingsBehavior==="merge"}function Gtl(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=t8r(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=t8r(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=t8r(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 $tl(t){if(t.helper?.())return"helper";if(_oo(t).settings)return"remote";if(Eoo(t).settings)return tRt()==="macos"?"plist":"hklm";if((t.file?.()??yoo(t)).settings)return"file";if(voo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function Vtl(t){let e=[],{settings:r,errors:n}=_oo(t);e.push(...n);let{settings:o,errors:s}=Eoo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??yoo(t);e.push(...l);let{settings:u,errors:d}=voo(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&&Htl(h)?Gtl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function Soo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=Vtl(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:lW({},n??{},r??{},uW),errors:o}}function Wtl(t,e){if(t==="policySettings")return Soo(e).settings;let r=fwt(t,e),{settings:n}=r?dwt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=Coo(e);if(o)return lW(n||{},o,uW)}return n}function ztl(t,e){return ieo([...t,...e])}function uW(t,e){if(Array.isArray(t)&&Array.isArray(e))return ztl(t,e)}function Ytl(t){if(i8r)return{settings:{},errors:[]};let e=Date.now();a6r("info","settings_load_started"),i8r=!0;try{let r=AHc(),n={};r&&(n=lW(n,r,uW));let o=[],s=new Set,c=new Set;for(let l of p7r(t)){if(l==="policySettings"){let{settings:d,errors:f}=Soo(t);d&&(n=lW(n,d,uW));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=fwt(l,t);if(u){let d=(0,Py.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=dwt(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=lW(n,f,uW))}}if(l==="flagSettings"){let{settings:d,errors:f}=Coo(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=lW(n,d,uW))}}return a6r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{i8r=!1}}function Ktl(t){let e=lHc();if(e!==null)return e;let r=Ytl(t);return uHc(r),r}function Jtl(t){let{settings:e}=Ktl(t);return e||{}}function Ztl(t){K6r();let e=[];for(let r of p7r(t)){let n=boo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:Jtl(t),sources:e}}function Xtl(t,e){let r=p7r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(boo(o,e)?.[t]!==void 0)return o}return null}function irl(t){let e=t.effective.permissions?.defaultMode;if(!e||!rrl.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(nrl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function orl(t={}){await Iel();let e={cwd:(0,Dio.resolve)(t.cwd??MI().cwd()),allowedSources:(t.settingSources??trl).map(r=>erl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:xel,hkcu:wel,wslInherits:Rel,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=Ztl(e),o=$tl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:$Ji[l],settings:u,path:l==="policySettings"?void 0:fwt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=Xtl(l,e);u&&(c[l]={source:$Ji[u],path:u==="policySettings"?void 0:fwt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{K6r()}}async function srl(t){return orl(t)}async function arl(t,e){try{await(0,c_.copyFile)(t,e)}catch(r){if(!Q8e(r))throw r}}async function crl(t,e){if(!t)return;let r=t;try{let n=WN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=jm(n))}catch{}await(0,c_.writeFile)(e,r,{mode:384})}function lrl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=M$c(N$c);return new Promise(e=>{(0,hZi.execFile)("security",["find-generic-password","-a",L$c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function Too(t,e,r,n,o=6e4){if(!Th(e))return;let s=Tk(r),c=await Wie(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,pc.join)((0,pve.tmpdir)(),`claude-resume-${(0,_wt.randomUUID)()}`);try{let u=(0,pc.join)(l,"projects",s);await(0,c_.mkdir)(u,{recursive:!0});let d=(0,pc.join)(u,`${e}.jsonl`);await M8r(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,pc.join)((0,pve.homedir)(),".claude"),m;try{m=await(0,c_.readFile)((0,pc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!Q8e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await lrl()??m),await crl(m,(0,pc.join)(l,".credentials.json")),await arl((0,pc.join)(f??(0,pve.homedir)(),".claude.json"),(0,pc.join)(l,".claude.json")),t.listSubkeys){let g=(0,pc.join)(u,e),A=await Wie(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,pc.resolve)(g,y+".jsonl");if(!y||(0,pc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+pc.sep)){ru(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Wie(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 _)v6r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,c_.mkdir)((0,pc.dirname)(E),{recursive:!0}),await M8r(E,b)),v.length>0){let T=v.at(-1),w=(0,pc.resolve)(g,y+".meta.json");await(0,c_.mkdir)((0,pc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,c_.writeFile)(w,jm(x),{mode:384})}}}return l}catch(u){throw await pwt(l),u}}function E6r(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=s8r(),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:L=SZi()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:j,forkSession:Q,hooks:U,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:ge,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,mcpServers:ee,model:K,outputFormat:he,permissionMode:Z="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ne,getOAuthToken:ce,getHostAuthToken:Me,workload:we,resume:Be,resumeSessionAt:rt,sessionId:st,skills:Et,stderr:Dt,strictMcpConfig:$t}=d;if(H&&ie===!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&&ru("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 Ge=(0,AZi.fileURLToPath)(importMetaUrlShim),J=(0,mZi.createRequire)(Ge),se=gGc(me=>J.resolve(me));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.`);Gt=se}let Ie=he?.type==="json_schema"?he.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"),ce&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Me&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),j?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=j.askUserQuestion.previewFormat);let be={};if(FKi.propagation.inject(FKi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,J]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=J)}let Qe={},pe=new Map;if(ee)for(let[Ge,J]of Object.entries(ee))J.type==="sdk"&&J.instance?pe.set(Ge,J.instance):Qe[Ge]=J;let Se;if(le)switch(le.type){case"adaptive":Se={type:"adaptive",display:le.display};break;case"enabled":Se={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Se={type:"disabled"};break}else ge!==void 0&&(Se=ge===0?{type:"disabled"}:{type:"enabled",budgetTokens:ge});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 Fe=new R8r({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:we?{...q,workload:we}:q,pathToClaudeCodeExecutable:Gt,env:F,forkSession:Q,stderr:Dt,thinkingConfig:Se,effort:Le,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:Z,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:rt,sessionId:st,settings:typeof s=="object"?jm(s):s,managedSettings:c?jm(c):void 0,settingSources:l,skills:Et,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Qe,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,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:V},Te=new P8r(Fe,e,b,U,g,pe,Ie,te,z,ce,Me);if(H){let Ge=a(()=>(0,pc.join)(F.CLAUDE_CONFIG_DIR??(0,pc.join)((0,pve.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",se=new D8r(async(me,Ce)=>{let He=YJi(me,Ge());He?await H.append(He,Ce):ru(`[SessionStore] dropping mirror frame: filePath ${me} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(me,Ce)=>{let He=YJi(me,Ge());He&&Te.reportMirrorError(He,Ce.message)},J?0:Z6r,J?0:X6r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Fe,abortController:g,processEnv:F}}function _6r(t,e,r,n){typeof r=="string"?e.write(jm({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 pwt(t){for(let e=0;;e++)try{return await(0,c_.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!url.has(NI(r)??""))return;await EZi((e+1)*100)}}function drl(t,e){t.waitForExit().catch(()=>{}).finally(()=>pwt(e))}function frl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=E6r({...e},typeof t=="string",void 0,!0),d=(0,pc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Wie(f.listSessions(Tk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return Too(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(()=>drl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=U8e(g);c.spawnAbort(A),s.setError(A)}),_6r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=E6r(e,typeof t=="string");return _6r(r,n,t,o),r}async function prl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,pc.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 Wie(t.sessionStore.listSessions(Tk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await Too(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=E6r(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(()=>pwt(g))})}await Wie(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{_6r(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(()=>pwt(r))}throw await c,l}}async function hrl(t,e){return e?.sessionStore?xrl(e.sessionStore,t,e):XGc(t,e)}async function mrl(t){return t?.sessionStore?Trl(t.sessionStore,t):s$c(t)}async function grl(t,e){return e?.sessionStore?wrl(e.sessionStore,t,e):a$c(t,e)}async function Arl(t,e,r){return r?.sessionStore?Rrl(r.sessionStore,t,e,r.dir):c$c(t,e,r)}async function yrl(t,e,r){return r?.sessionStore?krl(r.sessionStore,t,e,r.dir):l$c(t,e,r)}async function Erl(t,e){if(!Th(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=Tk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return u$c(t,e)}async function _rl(t,e){return e?.sessionStore?Prl(e.sessionStore,t,e):g$c(t,e)}async function vrl(t,e,r){if(!Th(t))throw Error(`Invalid sessionId: ${t}`);let n=await kwt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=Tk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:Z6r;if(await VJi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,pc.join)(c,"subagents");for(let u of await Crl(l)){let d=(0,pc.relative)(c,u).split(pc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await VJi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=WN(await(0,c_.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!Q8e(m))throw m}}}async function VJi(t,e,r,n){let o=(0,gZi.createInterface)({input:(0,vwt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(WN(l)),c+=l.length,(s.length>=n||c>=X6r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function Crl(t){let e=[];async function r(n){let o;try{o=await(0,c_.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,pc.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 brl(t,e){return e?.sessionStore?Drl(e.sessionStore,t,e.dir):C$c(t,e)}async function Srl(t,e,r){return r?.sessionStore?Nrl(r.sessionStore,t,e,r):b$c(t,e,r)}function Ioo(t){let e=(0,pc.resolve)(t??"."),r;try{r=(0,vwt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function Tk(t){return j8e(Ioo(t))}function xoo(t){return t.map(e=>jm(e)).join(` `)+` -`}function BJi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function g6r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function arl(t,e){let r=goo(e.dir),n=B8e(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 ru("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=BJi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await FJi(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=BJi(c,s,o);return FJi(t,l,e.dir,r)}async function FJi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await Eoo(t,o.sessionId,r);if(!s)return null;let c=xwt(o.sessionId,yoo(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 yoo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,$9).toString("utf-8"),s=n>$9?r.subarray(n-$9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function crl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=GN(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 Eoo(t,e,r){let n=bk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:Aoo(o)}async function lrl(t,e,r){if(!bh(e))return[];let n=bk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:MGc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function url(t,e,r){if(!bh(e))return;let n=await Eoo(t,e,r.dir);if(!n)return;let o=yoo(n,crl(n));return xwt(e,o)??void 0}async function drl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=bk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,gwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function frl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=t8e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=bk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,gwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function prl(t,e,r){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!bh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=bk(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}=e$c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function hrl(t,e,r){if(!bh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=bk(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 mrl(t,e,r,n){if(!bh(e))return[];if(!r)return[];let o=bk(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(g6r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!g6r(f));return d.length===0?[]:GXi(Buffer.from(Aoo(d)),{limit:n.limit,offset:n.offset},u)}function UJi(t,e){let r=(0,pc.relative)(e,t),n=r.split(pc.sep);if(n[0]===".."||(0,pc.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 QJi,iZi,gwt,Awt,a_,oZi,uve,pc,sZi,aZi,cZi,uZi,dZi,fZi,yZi,EZi,KZi,m8r,JZi,sA,ZZi,jL,y8r,fXi,Txt,l_,soe,vo,G0,hXi,HL,CXi,TXi,w8r,IXi,UN,mve,xXi,wXi,RXi,kXi,qve,jve,k8r,GL,Kie,KFe,Pxt,f8e,Dxt,$Xi,VXi,Cio,Jie,bio,nf,n7r,ewt,kio,Pio,o7r,s6r,Yio,Jio,Zio,ky,aoo,B8c,F8c,e8r,U8c,Q8c,j8c,H8c,A6r,Ht,G8c,WL,V8c,W8c,z8c,ef,tf,Y8c,K8c,J8c,qJi,Z8c,Dve,X8c,y6r,e6c,Nve,t6c,r6c,jJi,uwt,n6c,HJi,i6c,GJi,o6c,dwt,$Ji,E6r,_6r,VJi,v6r,WJi,zJi,s6c,YJi,a6c,c6c,l6c,u6c,d6c,f6c,p6c,h6c,m6c,g6c,A6c,y6c,E6c,_6c,v6c,C6c,b6c,S6c,GIt,NYi,Ns,mc,pW,fwt,T6c,KJi,JJi,$It,I6c,HN,x6c,w6c,ZJi,R6c,pwt,hwt,C6r,mwt,b6r,k6c,XJi,P6c,D6c,N6c,M6c,O6c,L6c,B6c,F6c,U6c,Q6c,q6c,j6c,H6c,G6c,$6c,S6r,V6c,W6c,z6c,Y6c,eZi,tZi,K6c,J6c,Z6c,X6c,e9c,rZi,t9c,r9c,n9c,i9c,o9c,s9c,a9c,c9c,l9c,u9c,d9c,f9c,p9c,h9c,m9c,g9c,nZi,A9c,y9c,E9c,_9c,ywt,C9c,b9c,S9c,T9c,I9c,r8r,R1,P9c,mZi,D9c,N9c,Mve,M9c,cW,gZi,O9c,L9c,bFe,F9c,U9c,Q9c,j9c,H9c,G9c,MYi,N8e,z9,W9c,z9c,Y9c,K9c,I6r,Z9c,CFr,OYi,eUc,tUc,rUc,iUc,oUc,sUc,aUc,cUc,lUc,uUc,dUc,pUc,mUc,x6r,AUc,n8e,EUc,vUc,CUc,bUc,SUc,IUc,xUc,wUc,kUc,PUc,NUc,LYi,OUc,Ewt,_wt,FUc,UUc,qUc,HUc,$Uc,WUc,vwt,zUc,AZi,KUc,ZUc,Cwt,t7c,n7c,o7c,a7c,w6r,c7c,Py,Fve,AKh,_Zi,n8r,Ri,Jv,kI,dve,VIt,WIt,zIt,YIt,KIt,JIt,ZIt,XIt,ext,l7c,u7c,i8r,BYi,f7c,vZi,p7c,nW,h7c,g7c,UYi,QYi,qYi,k6r,_7c,C7c,b7c,SZi,txt,S7c,T7c,D6r,I7c,jYi,bFr,x7c,nu,s8r,tu,HYi,GYi,rxt,VYi,k7c,WYi,Gie,RZi,P7c,D7c,N7c,M6r,M7c,PZi,xI,wI,Zie,SFe,Xie,a8r,$Fe,nxt,vIt,ixt,c8r,eoe,c_,OZi,LZi,O6r,YYi,z7c,Y7c,l8r,BZi,K7c,J7c,Sd,FZi,mr,KYi,tQc,$n,oxt,XFe,sxt,axt,cxt,lxt,o8e,uxt,dxt,fve,fxt,pxt,jZi,iQc,eve,oQc,sQc,$Zi,dk,KV,W_e,TFe,CIt,IFe,xFe,bIt,wFe,U9,RFe,SIt,TIt,Qie,IIt,xIt,kFe,SFr,ZYi,wIt,TFr,IFr,xFr,XYi,eKi,d8r,hxt,aQc,cQc,PFe,z_e,qie,Q0,w1,II,G9,JV,DFe,rKi,f8r,mxt,iKi,uQc,toe,gxt,Axt,pve,yxt,s8e,Ext,a8e,k1,_xt,fk,ZV,Y_e,NFe,RIt,MFe,OFe,kIt,LFe,Q9,BFe,PIt,DIt,jie,NIt,MIt,FFe,wFr,aKi,RFr,kFr,PFr,DFr,cKi,lKi,p8r,vxt,c8e,dKi,fQc,Cxt,h8r,L6r,jIt,zZi,pQc,hQc,Mp,hve,gQc,AQc,g8r,EQc,zie,K_e,CQc,SQc,IQc,wQc,RQc,PQc,DQc,NQc,Sxt,B6r,OQc,LQc,eXi,UQc,qQc,Qve,HQc,fKi,tXi,$Qc,VQc,WQc,l8e,zQc,lW,VFe,KQc,rXi,pKi,JQc,hKi,ZQc,XQc,F6r,eqc,tqc,bwt,nqc,U6r,oqc,sqc,aqc,cqc,lqc,uqc,dqc,fqc,pqc,hqc,mqc,gqc,Aqc,yqc,Eqc,_qc,vqc,Cqc,bqc,Sqc,Tqc,Iqc,xqc,wqc,Cd,kqc,Dqc,WFe,nXi,e8e,Nqc,NFr,Mqc,A8r,mKi,Oqc,iXi,Lqc,Bqc,Uqc,Qqc,oXi,Hqc,Q6r,Vqc,Wqc,zqc,Kqc,sXi,zFe,aXi,gKi,Zqc,AKi,yKi,cXi,tjc,njc,ijc,lXi,ojc,EKi,ajc,ljc,_Ki,ujc,djc,pjc,hjc,q6r,gjc,Ajc,Ejc,_jc,Cjc,bjc,Sjc,Tjc,Ijc,wjc,Rjc,vKi,CKi,kjc,Djc,Swt,Mjc,j6r,Bjc,Ujc,qjc,Hjc,dXi,H6r,Ixt,Yjc,G6r,Zjc,tHc,nHc,iHc,oHc,yKh,sHc,EKh,aHc,_Kh,cHc,vKh,lHc,CKh,E8r,fHc,hHc,vHc,CHc,bKh,SKh,wHc,SKi,TKi,RHc,kHc,IKi,_8r,NHc,MHc,v8r,OHc,gXi,AXi,BHc,FHc,OIt,MFr,UFe,OFr,C8r,vXi,TKh,qHc,rf,GN,VHc,xxt,xKi,S8r,J_e,wxt,eGc,T8r,I8r,W6r,z6r,rGc,x8r,wKi,LFr,oGc,lGc,$9,dGc,u8e,mGc,gGc,AGc,kxt,EGc,d8e,_Gc,vGc,LGc,YGc,a$c,YXi,c$c,l$c,u$c,xKh,RKi,d$c,p$c,m$c,A$c,hc,kKi,kn,tW,hr,yk,E$c,p8e,_$c,D8r,Zv,eo,JFe,P1,PKi,DKi,gve,Nxt,Zn,_k,NKi,Ms,v$c,C$c,b$c,S$c,T$c,I$c,x$c,w$c,R$c,QFr,k$c,P$c,D$c,N$c,M$c,O$c,KXi,L$c,Ave,h8e,m8e,g8e,A8e,y8e,yve,Eve,E8e,aW,$L,_8e,dW,NI,_ve,j9,N8r,vve,Y9,O8r,v8e,C8e,L8r,Cve,bve,Sve,Tve,roe,QN,Ek,K9,Ive,xve,b8e,Mxt,Oxt,wve,wKh,Cr,RKh,kKh,PKh,DKh,NKh,MKh,OKh,LKh,BKh,FKh,UKh,QKh,qKh,jKh,H$c,HKh,GKh,$Kh,VKh,WKh,zKh,YKh,KKh,JKh,ZKh,XKh,eJh,tJh,rJh,nJh,iJh,oJh,sJh,aJh,XXi,eeo,teo,fW,Lxt,Ws,J6r,ieo,X$c,Bxt,oeo,aeo,ceo,B8r,ueo,Z6r,U8e,t9r,Fxt,r9r,Uxt,n9r,Dwt,i9r,Nwt,o9r,heo,meo,geo,Aeo,yeo,Eeo,_eo,cVc,veo,Rve,lVc,uVc,dVc,Ceo,fVc,pVc,hVc,mVc,gVc,Seo,Teo,Ieo,xeo,weo,s9r,Reo,AVc,keo,Peo,Deo,Leo,Beo,Feo,Ueo,Qeo,qeo,jeo,Heo,Geo,Sh,$eo,a9r,c9r,Veo,Weo,zeo,Yeo,Keo,Jeo,Zeo,Xeo,eto,Q8e,tto,rto,nto,ito,oto,sto,ato,cto,lto,Qxt,uto,Co,q8e,Lu,dto,fto,pto,hto,mto,gto,Ato,yto,Eto,_to,vto,Cto,bto,Sto,Tto,Ito,xto,wto,Rto,kto,Dto,Nto,Oto,Lto,u9r,Bto,d9r,f9r,Fto,Uto,Qto,qto,jto,qxt,Hto,Gto,$to,p9r,h9r,m9r,Vto,Wto,Mwt,zto,Yto,Kto,Jto,Zto,Xto,g9r,ero,tro,rro,nro,iro,oro,sro,aro,A9r,cro,lro,uro,dro,fro,y9r,yVc,_Vc,CVc,SVc,IVc,wVc,kVc,PVc,DVc,NVc,OVc,BVc,UVc,qVc,HVc,$Vc,WVc,YVc,JVc,XVc,tWc,nWc,oWc,aWc,lWc,dWc,pWc,mWc,AWc,EWc,vWc,bWc,TWc,xWc,RWc,PWc,DWc,MWc,LWc,FWc,QWc,jWc,hro,mro,I8e,V9,yro,Gxt,R8e,dzc,fzc,pzc,G,tUr,rUr,nUr,iUr,oUr,cno,gzc,H8e,lno,uno,dno,fno,Os,sUr,Fwt,Td,aUr,$xt,W9,cUr,lUr,uUr,dUr,fUr,pUr,hUr,mUr,gUr,AUr,yUr,EUr,_Ur,vUr,CUr,bUr,pno,Uwt,Hve,Qwt,qwt,SUr,hno,mno,gno,Ano,yno,Eno,_no,IUr,vno,Hwt,xUr,Cno,bno,Sno,RUr,Tno,Ino,k8e,xno,wno,kUr,DUr,Rno,kno,Dno,NUr,Ono,Lno,Fno,MUr,Uno,qno,jno,Gno,$wt,fYc,hYc,Yno,CYc,Kno,Jno,bYc,$ie,Vwt,H0,Zno,Xno,cJh,SYc,TYc,LUr,MI,G8e,IYc,Dy,vk,Ck,Ny,Wwt,eio,YKi,tio,xYc,BUr,FIt,Bi,FUr,wYc,lJh,uJh,UUr,RYc,QUr,kYc,$8e,Pve,rio,PYc,DYc,NYc,MYc,OYc,LYc,nio,BYc,FYc,iio,qUr,UYc,QYc,jUr,qYc,V8e,W8e,jYc,z8e,zwt,HYc,zxt,HUr,GUr,$Ur,dJh,VUr,WUr,zUr,GYc,oio,sio,YUr,aio,Y8e,Gve,cio,$Yc,Q8r,VYc,q8r,WYc,KUr,zYc,j8r,YYc,KYc,JYc,ZYc,XYc,eKc,tKc,rKc,nKc,iKc,H8r,oKc,sKc,G8r,JUr,ZUr,XUr,aKc,cKc,lKc,e7r,uKc,dKc,fKc,pKc,hKc,lio,$8r,mKc,t7r,fJh,gKc,Yxt,AKc,pJh,Kxt,yKc,uio,EKc,_Kc,vKc,CKc,bKc,SKc,TKc,Jxt,IKc,xKc,wKc,r7r,dio,RKc,kKc,PKc,DKc,NKc,MKc,OKc,LKc,BKc,FKc,UKc,QKc,qKc,jKc,HKc,GKc,$Kc,VKc,Zxt,WKc,zKc,YKc,V8r,ZKc,XKc,eJc,fio,tJc,hJh,mJh,gJh,AJh,yJh,EJh,fi,W8r,rJc,KKi,nJc,iJc,hio,cJc,lJc,pJc,HFr,ON,gJc,Xxt,ZKi,wJc,RJc,OJc,LJc,BJc,FJc,UJc,qJc,z8r,HJc,GJc,Y8r,K8r,J8r,Eio,iJi,YJc,Z8r,X8r,ZJc,qFe,cJi,nZc,mk,t6r,uJi,_Jh,vJh,dJi,fJi,pJi,hJi,iW,i7r,ive,uZc,dZc,fZc,CJh,gZc,$Fr,yZc,mJi,bJh,Z_e,Iio,n6r,xio,twt,gJi,EZc,eW,wio,cve,i6r,o6r,vZc,AJi,Kwt,Jwt,TJh,IJh,xJh,P8e,wJh,CZc,bZc,SZc,TZc,IZc,xZc,wZc,RZc,RJh,s7r,kZc,PZc,kJh,PJh,DZc,jFe,MZc,OZc,rwt,DJh,NJh,$ve,mW,LZc,BZc,Dio,FZc,UZc,QZc,qZc,jZc,HZc,GZc,$Zc,a6r,MJh,Nio,VZc,WZc,jN,ooe,yJi,c6r,l6r,Mio,a7r,YZc,OJh,KZc,JZc,ZZc,XZc,eXc,Oio,Lio,tXc,EJi,rXc,nXc,Bio,iXc,oXc,_Ji,sXc,aXc,Fio,cXc,Uio,lXc,uXc,dXc,nwt,VFr,Qio,fXc,pXc,hXc,mXc,gXc,LJh,qio,yXc,EXc,_Xc,vXc,CXc,bXc,SXc,BJh,TXc,FJh,IXc,xXc,wXc,UIt,Zwt,vJi,Hio,UJh,QJh,iwt,zFr,qXc,qJh,jXc,Wio,zio,HXc,CJi,Vve,H9,$Xc,VXc,jJh,KXc,ZXc,xJi,u6r,d6r,ove,eel,tel,rel,wJi,owt,iel,rW,Xio,eoo,too,swt,f6r,Ael,yel,Eel,vel,Cel,bel,Sel,roo,Tel,Iel,wel,p6r,Pel,Nel,Mel,Lel,DJi,ioo,Uel,Qel,qel,jel,Hel,Gel,Vel,Wel,ooo,Yel,Jel,Xel,etl,oW,rtl,itl,stl,NJi,ctl,ltl,dtl,ptl,htl,KFr,mtl,JFr,gtl,XFr,Ltl,OJi,Btl,Ftl,Utl,Vtl,voo=ve(()=>{p();QJi=require("node:module"),iZi=require("child_process"),gwt=require("crypto"),Awt=require("fs"),a_=require("fs/promises"),oZi=require("module"),uve=require("os"),pc=require("path"),sZi=require("readline"),aZi=require("url"),cZi=require("events"),uZi=require("child_process"),dZi=require("fs"),fZi=require("readline"),yZi=require("os"),EZi=require("path"),KZi=require("crypto"),m8r=require("path"),JZi=require("async_hooks"),sA=require("fs/promises"),ZZi=require("crypto"),jL=require("fs/promises"),y8r=require("fs"),fXi=require("process"),Txt=require("crypto"),l_=require("fs/promises"),soe=require("path"),vo=de(require("fs"),1),G0=require("fs/promises"),hXi=require("fs"),HL=require("path"),CXi=require("fs"),TXi=require("fs/promises"),w8r=require("events"),IXi=require("fs"),UN=require("fs/promises"),mve=require("path"),xXi=require("child_process"),wXi=require("util"),RXi=require("child_process"),kXi=require("path"),qve=require("fs/promises"),jve=require("path"),k8r=require("fs"),GL=require("fs/promises"),Kie=require("path"),KFe=require("crypto"),Pxt=require("path"),f8e=require("fs/promises"),Dxt=require("path"),$Xi=require("crypto"),VXi=require("os"),Cio=require("path"),Jie=require("path"),bio=require("path"),nf=de(require("node:path"),1),n7r=de(require("node:os"),1),ewt=de(require("node:process"),1),kio=require("path"),Pio=require("fs/promises"),o7r=require("os"),s6r=require("path"),Yio=require("os"),Jio=require("child_process"),Zio=require("fs"),ky=require("path"),aoo=require("path"),B8c=Object.create,{getPrototypeOf:F8c,defineProperty:e8r,getOwnPropertyNames:U8c}=Object,Q8c=Object.prototype.hasOwnProperty;a(q8c,"a_");A6r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?j8c??=new WeakMap:H8c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?B8c(F8c(t)):{};let c=e||!t||!t.__esModule?e8r(r,"default",{value:t,enumerable:!0}):r;for(let l of U8c(t))Q8c.call(c,l)||e8r(c,l,{get:q8c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ht=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),G8c=a(t=>t,"$k");a($8c,"Qk");WL=a((t,e)=>{for(var r in e)e8r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:$8c.bind(e,r)})},"M4"),V8c=(0,QJi.createRequire)(importMetaUrlShim),W8c=Symbol.dispose||Symbol.for("Symbol.dispose"),z8c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),ef=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[z8c]),n===void 0&&(n=e[W8c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),tf=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$"),Y8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),K8c=Ht(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(Y8c(),t)}),J8c=Ht(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(K8c(),t)}),qJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),Z8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=qJi(),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)}),Dve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=J8c(),r=qJi(),n=Z8c(),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}),X8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=Dve();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")}),y6r=Ht(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={}))}),e6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=y6r();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}),Nve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=X8c(),r=e6c(),n=y6r(),o=Dve(),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}),t6c=Ht(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}),r6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),jJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=Nve(),r=t6c(),n=r6c(),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}),uwt=Ht(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}),n6c=Ht(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}),i6c=Ht(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={}))}),GJi=Ht(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)}}}),o6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=uwt();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}),dwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=o6c(),r=Dve(),n=Nve(),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}),$Ji=Ht(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={}))}),E6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=$Ji();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),_6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=E6r();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}),VJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=uwt(),r=_6r(),n=dwt(),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}),v6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=E6r(),r=_6r(),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}),WJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=dwt(),r=VJi(),n=_6r(),o=v6r(),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")}),zJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=WJi(),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}),s6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=WJi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),YJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=zJi(),r=s6c(),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}),a6c=Ht(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={}))}),c6c=Ht(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={}))}),l6c=Ht(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={}))}),u6c=Ht(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}),d6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=u6c(),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}),f6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=d6c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),p6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=dwt();t.context=e.ContextAPI.getInstance()}),h6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=Nve();t.diag=e.DiagAPI.instance()}),m6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=HJi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),g6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=m6c(),r=Dve(),n=Nve(),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}),A6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=g6c();t.metrics=e.MetricsAPI.getInstance()}),y6c=Ht(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}),E6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=dwt(),r=uwt(),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}),_6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=Dve(),r=y6c(),n=GJi(),o=E6c(),s=jJi(),c=Nve(),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}),v6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=_6c();t.propagation=e.PropagationAPI.getInstance()}),C6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=Dve(),r=YJi(),n=v6r(),o=VJi(),s=Nve(),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}),b6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=C6c();t.trace=e.TraceAPI.getInstance()}),S6c=Ht(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=jJi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=uwt();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=n6c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=y6r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=HJi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=i6c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=GJi();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=zJi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=YJi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=a6c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=c6c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=l6c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=$Ji();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=f6c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=v6r();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=E6r();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 _=p6c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=h6c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=A6c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=v6c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=b6c();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}}),GIt=Ht(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=GIt();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}),Ns=Ht(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=GIt(),r=NYi(),n=GIt();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=NYi();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,le){super(),this.varKind=H,this.name=re,this.rhs=le}render({es5:H,_n:re}){let le=H?r.varKinds.var:this.varKind,Le=this.rhs===void 0?"":` = ${this.rhs}`;return`${le} ${this.name}${Le};`+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,le){super(),this.lhs=H,this.rhs=re,this.sideEffects=le}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 q(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,le,Le){super(H,le,Le),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,le)=>re+le.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let le=H[re].optimizeNodes();Array.isArray(le)?H.splice(re,1,...le):le?H[re]=le:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:le}=this,Le=le.length;for(;Le--;){let ge=le[Le];ge.optimizeNames(H,re)||(O(H,ge.names),le.splice(Le,1))}return le.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>B(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 le=re.optimizeNodes();re=this.else=Array.isArray(le)?new E(le):le}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(j(H),re instanceof _?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var le;if(this.else=(le=this.else)===null||le===void 0?void 0:le.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 q(H,this.condition),this.else&&B(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 B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,le,Le){super(),this.varKind=H,this.name=re,this.from=le,this.to=Le}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:le,from:Le,to:ge}=this;return`for(${re} ${le}=${Le}; ${le}<${ge}; ${le}++)`+super.render(H)}get names(){let H=q(super.names,this.from);return q(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,le,Le){super(),this.loop=H,this.varKind=re,this.name=le,this.iterable=Le}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 B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,le){super(),this.name=H,this.args=re,this.async=le}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 le,Le;return super.optimizeNames(H,re),(le=this.catch)===null||le===void 0||le.optimizeNames(H,re),(Le=this.finally)===null||Le===void 0||Le.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&B(H,this.catch.names),this.finally&&B(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 L{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 le=this._extScope.value(H,re);return(this._values[le.prefix]||(this._values[le.prefix]=new Set)).add(le),le}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,le,Le){let ge=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[ge.str]=le),this._leafNode(new c(H,ge,le)),ge}const(H,re,le){return this._def(r.varKinds.const,H,re,le)}let(H,re,le){return this._def(r.varKinds.let,H,re,le)}var(H,re,le){return this._def(r.varKinds.var,H,re,le)}assign(H,re,le){return this._leafNode(new l(H,re,le))}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[le,Le]of H)re.length>1&&re.push(","),re.push(le),(le!==Le||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Le));return re.push("}"),new e._Code(re)}if(H,re,le){if(this._blockNode(new _(H)),re&&le)this.code(re).else().code(le).endIf();else if(re)this.code(re).endIf();else if(le)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,le,Le,ge=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ue=this._scope.toName(H);return this._for(new T(ge,Ue,re,le),()=>Le(Ue))}forOf(H,re,le,Le=r.varKinds.const){let ge=this._scope.toName(H);if(this.opts.es5){let Ue=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Ue}.length`,ke=>{this.var(ge,e._`${Ue}[${ke}]`),le(ge)})}return this._for(new w("of",Le,ge,re),()=>le(ge))}forIn(H,re,le,Le=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,le);let ge=this._scope.toName(H);return this._for(new w("in",Le,ge,re),()=>le(ge))}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,le){if(!re&&!le)throw Error('CodeGen: "try" without "catch" and "finally"');let Le=new P;if(this._blockNode(Le),this.code(H),re){let ge=this.name("e");this._currNode=Le.catch=new D(ge),re(ge)}return le&&(this._currNode=Le.finally=new N,this.code(le)),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 le=this._nodes.length-re;if(le<0||H!==void 0&&le!==H)throw Error(`CodeGen: wrong number of nodes: ${le} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,le,Le){return this._blockNode(new R(H,re,le)),Le&&this.code(Le).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 le=this._currNode;if(le instanceof H||re&&le 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=L;function B(ie,H){for(let re in H)ie[re]=(ie[re]||0)+(H[re]||0);return ie}a(B,"v0");function q(ie,H){return H instanceof e._CodeOrName?B(ie,H.names):ie}a(q,"ZW");function M(ie,H,re){if(ie instanceof e.Name)return le(ie);if(!Le(ie))return ie;return new e._Code(ie._items.reduce((ge,Ue)=>(Ue instanceof e.Name&&(Ue=le(Ue)),Ue instanceof e._Code?ge.push(...Ue._items):ge.push(Ue),ge),[]));function le(ge){let Ue=re[ge.str];return Ue===void 0||H[ge.str]!==1?ge:(delete H[ge.str],Ue)}function Le(ge){return ge instanceof e._Code&&ge._items.some(Ue=>Ue instanceof e.Name&&H[Ue.str]===1&&re[Ue.str]!==void 0)}}a(M,"V9");function O(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(O,"dp");function j(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(j,"vj"),t.not=j;var Q=V(t.operators.AND);function U(...ie){return ie.reduce(Q)}a(U,"np"),t.and=U;var Y=V(t.operators.OR);function W(...ie){return ie.reduce(Y)}a(W,"op"),t.or=W;function V(ie){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${z(H)} ${ie} ${z(re)}`}a(V,"Cj");function z(ie){return ie instanceof e.Name?ie:e._`(${ie})`}a(z,"zB")}),mc=Ht(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=Ns(),r=GIt();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 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 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,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):P(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,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}),pW=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),fwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ns(),r=mc(),n=pW();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:L}=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}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),T6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=fwt(),r=Ns(),n=pW(),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")}),KJi=Ht(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}),JJi=Ht(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}),$It=Ht(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=KJi(),r=JJi(),n=fwt(),o=Ns(),s=mc(),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 B of w)(f.has(B)||B==="array"&&P.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 WJi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function v6r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function Trl(t,e){let r=Ioo(e.dir),n=j8e(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 ru("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=WJi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await zJi(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=WJi(c,s,o);return zJi(t,l,e.dir,r)}async function zJi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await Roo(t,o.sessionId,r);if(!s)return null;let c=Pwt(o.sessionId,woo(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 woo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,W9).toString("utf-8"),s=n>W9?r.subarray(n-W9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function Irl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` +`)+1);try{let n=WN(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 Roo(t,e,r){let n=Tk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:xoo(o)}async function xrl(t,e,r){if(!Th(e))return[];let n=Tk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:ZGc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function wrl(t,e,r){if(!Th(e))return;let n=await Roo(t,e,r.dir);if(!n)return;let o=woo(n,Irl(n));return Pwt(e,o)??void 0}async function Rrl(t,e,r,n){if(!Th(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=Tk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,_wt.randomUUID)(),timestamp:new Date().toISOString()}])}async function krl(t,e,r,n){if(!Th(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=s8e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=Tk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,_wt.randomUUID)(),timestamp:new Date().toISOString()}])}async function Prl(t,e,r){if(!Th(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!Th(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=Tk(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}=y$c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function Drl(t,e,r){if(!Th(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=Tk(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 Nrl(t,e,r,n){if(!Th(e))return[];if(!r)return[];let o=Tk(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(v6r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!v6r(f));return d.length===0?[]:eeo(Buffer.from(xoo(d)),{limit:n.limit,offset:n.offset},u)}function YJi(t,e){let r=(0,pc.relative)(e,t),n=r.split(pc.sep);if(n[0]===".."||(0,pc.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 KJi,hZi,_wt,vwt,c_,mZi,pve,pc,gZi,AZi,yZi,_Zi,vZi,CZi,wZi,RZi,sXi,_8r,aXi,aA,cXi,HL,b8r,CXi,Rxt,u_,aoe,Co,$0,SXi,GL,DXi,OXi,N8r,LXi,jN,yve,BXi,FXi,UXi,QXi,Gve,$ve,O8r,$L,Jie,t8e,Oxt,A8e,Lxt,teo,reo,Dio,Zie,Nio,sf,c7r,iwt,Qio,qio,u7r,d6r,ooo,aoo,coo,Py,Aoo,t6c,r6c,o8r,n6c,i6c,s6c,a6c,C6r,Ht,c6c,zL,u6c,d6c,f6c,rf,nf,p6c,h6c,m6c,JJi,g6c,Ove,A6c,b6r,y6c,Lve,E6c,_6c,ZJi,hwt,v6c,XJi,C6c,eZi,b6c,mwt,tZi,S6r,T6r,rZi,I6r,nZi,iZi,S6c,oZi,T6c,I6c,x6c,w6c,R6c,k6c,P6c,D6c,N6c,M6c,O6c,L6c,B6c,F6c,U6c,Q6c,q6c,j6c,zIt,HYi,Ns,mc,AW,gwt,H6c,sZi,aZi,YIt,G6c,VN,$6c,V6c,cZi,W6c,Awt,ywt,x6r,Ewt,w6r,z6c,lZi,Y6c,K6c,J6c,Z6c,X6c,e9c,t9c,r9c,n9c,i9c,o9c,s9c,a9c,c9c,l9c,R6r,u9c,d9c,f9c,p9c,uZi,dZi,h9c,m9c,g9c,A9c,y9c,fZi,E9c,_9c,v9c,C9c,b9c,S9c,T9c,I9c,x9c,w9c,R9c,k9c,P9c,D9c,N9c,M9c,pZi,O9c,L9c,B9c,F9c,Cwt,Q9c,q9c,j9c,H9c,G9c,a8r,R1,Y9c,TZi,K9c,J9c,Bve,Z9c,fW,IZi,X9c,eUc,wFe,rUc,nUc,iUc,sUc,aUc,cUc,GYi,F8e,K9,dUc,fUc,pUc,hUc,P6r,gUc,xFr,$Yi,yUc,EUc,_Uc,CUc,bUc,SUc,TUc,IUc,xUc,wUc,RUc,PUc,NUc,D6r,OUc,c8e,BUc,UUc,QUc,qUc,jUc,GUc,$Uc,VUc,zUc,YUc,JUc,VYi,XUc,bwt,Swt,r7c,n7c,o7c,a7c,l7c,d7c,Twt,f7c,xZi,h7c,g7c,Iwt,E7c,v7c,b7c,T7c,N6r,I7c,Dy,qve,ZKh,kZi,c8r,Ri,Xv,DI,hve,KIt,JIt,ZIt,XIt,ext,txt,rxt,nxt,ixt,x7c,w7c,l8r,WYi,k7c,PZi,P7c,aW,D7c,M7c,YYi,KYi,JYi,O6r,F7c,Q7c,q7c,MZi,oxt,j7c,H7c,B6r,G7c,ZYi,wFr,$7c,nu,d8r,tu,XYi,eKi,sxt,rKi,z7c,nKi,$ie,UZi,Y7c,K7c,J7c,U6r,Z7c,qZi,RI,kI,Xie,RFe,eoe,f8r,KFe,axt,TIt,cxt,p8r,toe,l_,$Zi,VZi,Q6r,oKi,fQc,pQc,h8r,WZi,hQc,mQc,Id,zZi,mr,sKi,EQc,$n,lxt,i8e,uxt,dxt,fxt,pxt,u8e,hxt,mxt,mve,gxt,Axt,ZZi,CQc,nve,bQc,SQc,tXi,pk,eW,K_e,kFe,IIt,PFe,DFe,xIt,NFe,q9,MFe,wIt,RIt,qie,kIt,PIt,OFe,RFr,cKi,DIt,kFr,PFr,DFr,lKi,uKi,g8r,yxt,TQc,IQc,LFe,J_e,jie,q0,w1,wI,V9,tW,BFe,fKi,A8r,Ext,hKi,wQc,roe,_xt,vxt,gve,Cxt,d8e,bxt,f8e,k1,Sxt,hk,rW,Z_e,FFe,NIt,UFe,QFe,MIt,qFe,j9,jFe,OIt,LIt,Hie,BIt,FIt,HFe,NFr,AKi,MFr,OFr,LFr,BFr,yKi,EKi,y8r,Txt,p8e,vKi,kQc,Ixt,E8r,q6r,VIt,iXi,PQc,DQc,Lp,Ave,MQc,OQc,v8r,BQc,Yie,X_e,QQc,jQc,GQc,VQc,WQc,YQc,KQc,JQc,wxt,j6r,XQc,eqc,uXi,nqc,oqc,Hve,aqc,CKi,dXi,lqc,uqc,dqc,h8e,fqc,pW,JFe,hqc,fXi,bKi,mqc,SKi,gqc,Aqc,H6r,yqc,Eqc,xwt,vqc,G6r,bqc,Sqc,Tqc,Iqc,xqc,wqc,Rqc,kqc,Pqc,Dqc,Nqc,Mqc,Oqc,Lqc,Bqc,Fqc,Uqc,Qqc,qqc,jqc,Hqc,Gqc,$qc,Vqc,Sd,zqc,Kqc,ZFe,pXi,o8e,Jqc,FFr,Zqc,C8r,TKi,Xqc,hXi,ejc,tjc,njc,ijc,mXi,ajc,$6r,ujc,djc,fjc,hjc,gXi,XFe,AXi,IKi,gjc,xKi,wKi,yXi,Ejc,vjc,Cjc,EXi,bjc,RKi,Tjc,xjc,kKi,wjc,Rjc,Pjc,Djc,V6r,Mjc,Ojc,Bjc,Fjc,Qjc,qjc,jjc,Hjc,Gjc,Vjc,Wjc,PKi,DKi,zjc,Kjc,wwt,Zjc,W6r,tHc,nHc,oHc,aHc,vXi,z6r,kxt,pHc,Y6r,gHc,EHc,vHc,CHc,bHc,XKh,SHc,eJh,THc,tJh,IHc,rJh,xHc,nJh,S8r,kHc,DHc,UHc,QHc,iJh,oJh,VHc,MKi,OKi,WHc,zHc,LKi,T8r,JHc,ZHc,I8r,XHc,IXi,xXi,tGc,rGc,UIt,UFr,GFe,QFr,x8r,PXi,sJh,oGc,of,WN,uGc,Pxt,BKi,R8r,eve,Dxt,yGc,k8r,P8r,Z6r,X6r,_Gc,D8r,FKi,qFr,bGc,xGc,W9,RGc,m8e,NGc,MGc,OGc,Mxt,BGc,g8e,FGc,UGc,e$c,p$c,T$c,oeo,I$c,x$c,w$c,cJh,UKi,R$c,P$c,N$c,O$c,hc,QKi,kn,oW,hr,_k,B$c,y8e,F$c,B8r,eC,eo,r8e,P1,qKi,jKi,Eve,Bxt,Kn,Ck,HKi,Ms,U$c,Q$c,q$c,j$c,H$c,G$c,$$c,V$c,W$c,$Fr,z$c,Y$c,K$c,J$c,Z$c,X$c,seo,eVc,_ve,E8e,_8e,v8e,C8e,b8e,vve,Cve,S8e,dW,VL,T8e,mW,OI,bve,G9,F8r,Sve,J9,Q8r,I8e,x8e,q8r,Tve,Ive,xve,wve,noe,HN,vk,Z9,Rve,kve,w8e,Fxt,Uxt,Pve,lJh,Cr,uJh,dJh,fJh,pJh,hJh,mJh,gJh,AJh,yJh,EJh,_Jh,vJh,CJh,bJh,aVc,SJh,TJh,IJh,xJh,wJh,RJh,kJh,PJh,DJh,NJh,MJh,OJh,LJh,BJh,FJh,UJh,QJh,qJh,jJh,leo,ueo,deo,gW,Qxt,Ws,r9r,heo,AVc,qxt,meo,Aeo,yeo,j8r,_eo,n9r,G8e,s9r,jxt,a9r,Hxt,c9r,Lwt,l9r,Bwt,u9r,Seo,Teo,Ieo,xeo,weo,Reo,keo,IVc,Peo,Dve,xVc,wVc,RVc,Deo,kVc,PVc,DVc,NVc,MVc,Meo,Oeo,Leo,Beo,Feo,d9r,Ueo,OVc,Qeo,qeo,jeo,Veo,Weo,zeo,Yeo,Keo,Jeo,Zeo,Xeo,eto,Ih,tto,f9r,p9r,rto,nto,ito,oto,sto,ato,cto,lto,uto,$8e,dto,fto,pto,hto,mto,gto,Ato,yto,Eto,Gxt,_to,bo,V8e,Bu,vto,Cto,bto,Sto,Tto,Ito,xto,wto,Rto,kto,Pto,Dto,Nto,Mto,Oto,Lto,Bto,Fto,Uto,Qto,jto,Hto,$to,Vto,m9r,Wto,g9r,A9r,zto,Yto,Kto,Jto,Zto,$xt,Xto,ero,tro,y9r,E9r,_9r,rro,nro,Fwt,iro,oro,sro,aro,cro,lro,v9r,uro,dro,fro,pro,hro,mro,gro,Aro,C9r,yro,Ero,_ro,vro,Cro,b9r,LVc,FVc,QVc,jVc,GVc,VVc,zVc,YVc,KVc,JVc,XVc,tWc,nWc,oWc,aWc,lWc,dWc,pWc,mWc,AWc,EWc,vWc,bWc,TWc,xWc,RWc,PWc,NWc,OWc,BWc,UWc,qWc,HWc,$Wc,WWc,YWc,KWc,ZWc,ezc,rzc,izc,szc,Sro,Tro,P8e,z9,wro,zxt,M8e,Rzc,kzc,Pzc,G,sUr,aUr,cUr,lUr,uUr,yno,Mzc,z8e,Eno,_no,vno,Cno,Os,dUr,jwt,xd,fUr,Yxt,Y9,pUr,hUr,mUr,gUr,AUr,yUr,EUr,_Ur,vUr,CUr,bUr,SUr,TUr,IUr,xUr,wUr,bno,Hwt,Vve,Gwt,$wt,RUr,Sno,Tno,Ino,xno,wno,Rno,kno,PUr,Pno,Wwt,DUr,Dno,Nno,Mno,MUr,Ono,Lno,O8e,Bno,Fno,OUr,BUr,Uno,Qno,jno,FUr,$no,Vno,zno,UUr,Yno,Jno,Zno,eio,Ywt,kYc,DYc,oio,QYc,sio,aio,qYc,Vie,Kwt,G0,cio,lio,HJh,jYc,HYc,qUr,LI,Y8e,GYc,Ny,bk,Sk,My,Jwt,uio,oJi,dio,$Yc,jUr,jIt,Bi,HUr,VYc,GJh,$Jh,GUr,WYc,$Ur,zYc,K8e,Mve,fio,YYc,KYc,JYc,ZYc,XYc,eKc,pio,tKc,rKc,hio,VUr,nKc,iKc,WUr,oKc,J8e,Z8e,sKc,X8e,Zwt,aKc,Zxt,zUr,YUr,KUr,VJh,JUr,ZUr,XUr,cKc,mio,gio,e7r,Aio,e6e,Wve,yio,lKc,$8r,uKc,V8r,dKc,t7r,fKc,W8r,pKc,hKc,mKc,gKc,AKc,yKc,EKc,_Kc,vKc,CKc,z8r,bKc,SKc,Y8r,r7r,n7r,i7r,TKc,IKc,xKc,o7r,wKc,RKc,kKc,PKc,DKc,Eio,K8r,NKc,s7r,WJh,MKc,Xxt,OKc,zJh,ewt,LKc,_io,BKc,FKc,UKc,QKc,qKc,jKc,HKc,twt,GKc,$Kc,VKc,a7r,vio,WKc,zKc,YKc,KKc,JKc,ZKc,XKc,eJc,tJc,rJc,nJc,iJc,oJc,sJc,aJc,cJc,lJc,uJc,rwt,dJc,fJc,pJc,J8r,gJc,AJc,yJc,Cio,EJc,YJh,KJh,JJh,ZJh,XJh,eZh,fi,Z8r,_Jc,sJi,vJc,CJc,Sio,IJc,xJc,PJc,zFr,FN,MJc,nwt,cJi,VJc,WJc,XJc,eZc,tZc,rZc,nZc,oZc,X8r,aZc,cZc,e6r,t6r,r6r,Rio,hJi,pZc,n6r,i6r,gZc,VFe,yJi,vZc,Ak,s6r,_Ji,tZh,rZh,vJi,CJi,bJi,SJi,cW,l7r,ave,wZc,RZc,kZc,nZh,MZc,KFr,LZc,TJi,iZh,tve,Lio,c6r,Bio,owt,IJi,BZc,iW,Fio,dve,l6r,u6r,UZc,xJi,eRt,tRt,sZh,aZh,cZh,L8e,lZh,QZc,qZc,jZc,HZc,GZc,$Zc,VZc,WZc,uZh,d7r,zZc,YZc,dZh,fZh,KZc,WFe,ZZc,XZc,swt,pZh,hZh,zve,EW,eXc,tXc,jio,rXc,nXc,iXc,oXc,sXc,aXc,cXc,lXc,f6r,mZh,Hio,uXc,dXc,$N,soe,wJi,p6r,h6r,Gio,f7r,pXc,gZh,hXc,mXc,gXc,AXc,yXc,$io,Vio,EXc,RJi,_Xc,vXc,Wio,CXc,bXc,kJi,SXc,TXc,zio,IXc,Yio,xXc,wXc,RXc,awt,JFr,Kio,kXc,PXc,DXc,NXc,MXc,AZh,Jio,LXc,BXc,FXc,UXc,QXc,qXc,jXc,yZh,HXc,EZh,GXc,$Xc,VXc,HIt,rRt,PJi,Xio,_Zh,vZh,cwt,XFr,oel,CZh,sel,noo,ioo,ael,DJi,Yve,$9,lel,uel,bZh,hel,gel,BJi,m6r,g6r,cve,yel,Eel,_el,FJi,lwt,Cel,sW,loo,uoo,doo,uwt,A6r,Oel,Lel,Bel,Uel,Qel,qel,jel,foo,Hel,Gel,Vel,y6r,Yel,Jel,Zel,etl,jJi,hoo,ntl,itl,otl,stl,atl,ctl,utl,dtl,moo,ptl,mtl,Atl,ytl,lW,_tl,Ctl,Stl,HJi,Itl,xtl,Rtl,Ptl,Dtl,t8r,Ntl,r8r,Mtl,i8r,erl,$Ji,trl,rrl,nrl,url,Poo=ve(()=>{p();KJi=require("node:module"),hZi=require("child_process"),_wt=require("crypto"),vwt=require("fs"),c_=require("fs/promises"),mZi=require("module"),pve=require("os"),pc=require("path"),gZi=require("readline"),AZi=require("url"),yZi=require("events"),_Zi=require("child_process"),vZi=require("fs"),CZi=require("readline"),wZi=require("os"),RZi=require("path"),sXi=require("crypto"),_8r=require("path"),aXi=require("async_hooks"),aA=require("fs/promises"),cXi=require("crypto"),HL=require("fs/promises"),b8r=require("fs"),CXi=require("process"),Rxt=require("crypto"),u_=require("fs/promises"),aoe=require("path"),Co=de(require("fs"),1),$0=require("fs/promises"),SXi=require("fs"),GL=require("path"),DXi=require("fs"),OXi=require("fs/promises"),N8r=require("events"),LXi=require("fs"),jN=require("fs/promises"),yve=require("path"),BXi=require("child_process"),FXi=require("util"),UXi=require("child_process"),QXi=require("path"),Gve=require("fs/promises"),$ve=require("path"),O8r=require("fs"),$L=require("fs/promises"),Jie=require("path"),t8e=require("crypto"),Oxt=require("path"),A8e=require("fs/promises"),Lxt=require("path"),teo=require("crypto"),reo=require("os"),Dio=require("path"),Zie=require("path"),Nio=require("path"),sf=de(require("node:path"),1),c7r=de(require("node:os"),1),iwt=de(require("node:process"),1),Qio=require("path"),qio=require("fs/promises"),u7r=require("os"),d6r=require("path"),ooo=require("os"),aoo=require("child_process"),coo=require("fs"),Py=require("path"),Aoo=require("path"),t6c=Object.create,{getPrototypeOf:r6c,defineProperty:o8r,getOwnPropertyNames:n6c}=Object,i6c=Object.prototype.hasOwnProperty;a(o6c,"a_");C6r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?s6c??=new WeakMap:a6c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?t6c(r6c(t)):{};let c=e||!t||!t.__esModule?o8r(r,"default",{value:t,enumerable:!0}):r;for(let l of n6c(t))i6c.call(c,l)||o8r(c,l,{get:o6c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ht=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),c6c=a(t=>t,"$k");a(l6c,"Qk");zL=a((t,e)=>{for(var r in e)o8r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:l6c.bind(e,r)})},"M4"),u6c=(0,KJi.createRequire)(importMetaUrlShim),d6c=Symbol.dispose||Symbol.for("Symbol.dispose"),f6c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),rf=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[f6c]),n===void 0&&(n=e[d6c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),nf=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$"),p6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),h6c=Ht(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(p6c(),t)}),m6c=Ht(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(h6c(),t)}),JJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),g6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=JJi(),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)}),Ove=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=m6c(),r=JJi(),n=g6c(),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}),A6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=Ove();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")}),b6r=Ht(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={}))}),y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=b6r();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}),Lve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=A6c(),r=y6c(),n=b6r(),o=Ove(),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}),E6c=Ht(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}),_6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),ZJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=Lve(),r=E6c(),n=_6c(),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}),hwt=Ht(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}),v6c=Ht(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}),C6c=Ht(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={}))}),eZi=Ht(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)}}}),b6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=hwt();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}),mwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=b6c(),r=Ove(),n=Lve(),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}),tZi=Ht(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={}))}),S6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=tZi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),T6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=S6r();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}),rZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=hwt(),r=T6r(),n=mwt(),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}),I6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=S6r(),r=T6r(),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}),nZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=mwt(),r=rZi(),n=T6r(),o=I6r(),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")}),iZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=nZi(),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}),S6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=nZi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),oZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=iZi(),r=S6c(),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}),T6c=Ht(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={}))}),I6c=Ht(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={}))}),x6c=Ht(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={}))}),w6c=Ht(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}),R6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=w6c(),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}),k6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=R6c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),P6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=mwt();t.context=e.ContextAPI.getInstance()}),D6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=Lve();t.diag=e.DiagAPI.instance()}),N6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=XJi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),M6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=N6c(),r=Ove(),n=Lve(),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}),O6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=M6c();t.metrics=e.MetricsAPI.getInstance()}),L6c=Ht(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}),B6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=mwt(),r=hwt(),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}),F6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=Ove(),r=L6c(),n=eZi(),o=B6c(),s=ZJi(),c=Lve(),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}),U6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=F6c();t.propagation=e.PropagationAPI.getInstance()}),Q6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=Ove(),r=oZi(),n=I6r(),o=rZi(),s=Lve(),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}),q6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=Q6c();t.trace=e.TraceAPI.getInstance()}),j6c=Ht(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=ZJi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=hwt();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=v6c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=b6r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=XJi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=C6c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=eZi();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=iZi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=oZi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=T6c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=I6c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=x6c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=tZi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=k6c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=I6r();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=S6r();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 _=P6c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=D6c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=O6c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=U6c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=q6c();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}}),zIt=Ht(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=zIt();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}),Ns=Ht(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=zIt(),r=HYi(),n=zIt();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=HYi();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,le){super(),this.varKind=H,this.name=re,this.rhs=le}render({es5:H,_n:re}){let le=H?r.varKinds.var:this.varKind,Le=this.rhs===void 0?"":` = ${this.rhs}`;return`${le} ${this.name}${Le};`+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,le){super(),this.lhs=H,this.rhs=re,this.sideEffects=le}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 q(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,le,Le){super(H,le,Le),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,le)=>re+le.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let le=H[re].optimizeNodes();Array.isArray(le)?H.splice(re,1,...le):le?H[re]=le:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:le}=this,Le=le.length;for(;Le--;){let ge=le[Le];ge.optimizeNames(H,re)||(O(H,ge.names),le.splice(Le,1))}return le.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>B(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 le=re.optimizeNodes();re=this.else=Array.isArray(le)?new E(le):le}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(j(H),re instanceof _?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var le;if(this.else=(le=this.else)===null||le===void 0?void 0:le.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 q(H,this.condition),this.else&&B(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 B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,le,Le){super(),this.varKind=H,this.name=re,this.from=le,this.to=Le}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:le,from:Le,to:ge}=this;return`for(${re} ${le}=${Le}; ${le}<${ge}; ${le}++)`+super.render(H)}get names(){let H=q(super.names,this.from);return q(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,le,Le){super(),this.loop=H,this.varKind=re,this.name=le,this.iterable=Le}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 B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,le){super(),this.name=H,this.args=re,this.async=le}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 le,Le;return super.optimizeNames(H,re),(le=this.catch)===null||le===void 0||le.optimizeNames(H,re),(Le=this.finally)===null||Le===void 0||Le.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&B(H,this.catch.names),this.finally&&B(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 L{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 le=this._extScope.value(H,re);return(this._values[le.prefix]||(this._values[le.prefix]=new Set)).add(le),le}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,le,Le){let ge=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[ge.str]=le),this._leafNode(new c(H,ge,le)),ge}const(H,re,le){return this._def(r.varKinds.const,H,re,le)}let(H,re,le){return this._def(r.varKinds.let,H,re,le)}var(H,re,le){return this._def(r.varKinds.var,H,re,le)}assign(H,re,le){return this._leafNode(new l(H,re,le))}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[le,Le]of H)re.length>1&&re.push(","),re.push(le),(le!==Le||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Le));return re.push("}"),new e._Code(re)}if(H,re,le){if(this._blockNode(new _(H)),re&&le)this.code(re).else().code(le).endIf();else if(re)this.code(re).endIf();else if(le)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,le,Le,ge=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ue=this._scope.toName(H);return this._for(new T(ge,Ue,re,le),()=>Le(Ue))}forOf(H,re,le,Le=r.varKinds.const){let ge=this._scope.toName(H);if(this.opts.es5){let Ue=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Ue}.length`,ke=>{this.var(ge,e._`${Ue}[${ke}]`),le(ge)})}return this._for(new w("of",Le,ge,re),()=>le(ge))}forIn(H,re,le,Le=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,le);let ge=this._scope.toName(H);return this._for(new w("in",Le,ge,re),()=>le(ge))}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,le){if(!re&&!le)throw Error('CodeGen: "try" without "catch" and "finally"');let Le=new P;if(this._blockNode(Le),this.code(H),re){let ge=this.name("e");this._currNode=Le.catch=new D(ge),re(ge)}return le&&(this._currNode=Le.finally=new N,this.code(le)),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 le=this._nodes.length-re;if(le<0||H!==void 0&&le!==H)throw Error(`CodeGen: wrong number of nodes: ${le} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,le,Le){return this._blockNode(new R(H,re,le)),Le&&this.code(Le).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 le=this._currNode;if(le instanceof H||re&&le 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=L;function B(ie,H){for(let re in H)ie[re]=(ie[re]||0)+(H[re]||0);return ie}a(B,"v0");function q(ie,H){return H instanceof e._CodeOrName?B(ie,H.names):ie}a(q,"ZW");function M(ie,H,re){if(ie instanceof e.Name)return le(ie);if(!Le(ie))return ie;return new e._Code(ie._items.reduce((ge,Ue)=>(Ue instanceof e.Name&&(Ue=le(Ue)),Ue instanceof e._Code?ge.push(...Ue._items):ge.push(Ue),ge),[]));function le(ge){let Ue=re[ge.str];return Ue===void 0||H[ge.str]!==1?ge:(delete H[ge.str],Ue)}function Le(ge){return ge instanceof e._Code&&ge._items.some(Ue=>Ue instanceof e.Name&&H[Ue.str]===1&&re[Ue.str]!==void 0)}}a(M,"V9");function O(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(O,"dp");function j(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(j,"vj"),t.not=j;var Q=V(t.operators.AND);function U(...ie){return ie.reduce(Q)}a(U,"np"),t.and=U;var Y=V(t.operators.OR);function W(...ie){return ie.reduce(Y)}a(W,"op"),t.or=W;function V(ie){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${z(H)} ${ie} ${z(re)}`}a(V,"Cj");function z(ie){return ie instanceof e.Name?ie:e._`(${ie})`}a(z,"zB")}),mc=Ht(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=Ns(),r=zIt();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 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 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,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):P(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,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}),AW=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),gwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ns(),r=mc(),n=AW();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:L}=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}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),H6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=gwt(),r=Ns(),n=AW(),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")}),sZi=Ht(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}),aZi=Ht(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}),YIt=Ht(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=sZi(),r=aZi(),n=gwt(),o=Ns(),s=mc(),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 B of w)(f.has(B)||B==="array"&&P.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 || (${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,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")}),I6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ns(),r=mc();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")}),HN=Ht(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=Ns(),r=mc(),n=pW(),o=mc();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,L,B){let q=B?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._`${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,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 L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,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,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),x6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ns(),r=pW(),n=HN(),o=fwt();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)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(P,!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,j=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,j)}`,A.modifying)}a(B,"O");function q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),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}),w6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ns(),r=mc();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}),ZJi=Ht((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},"$")}),R6c=Ht((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=mc(),r=ZJi(),n=R6c(),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},(L,B,q,M)=>{if(M===void 0)return;let O=R+B,j=w[M];typeof L[v]=="string"&&(j=Q.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=j;function Q(Y){let W=this.opts.uriResolver.resolve;if(Y=m(j?W(j,Y):Y),P.has(Y))throw N(Y);P.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(L,V.schema,Y):Y!==m(O)&&(Y[0]==="#"?(D(L,x[Y],Y),x[Y]=L):this.refs[Y]=O),Y}a(Q,"M");function U(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);Q.call(this,`#${Y}`)}}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}),hwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=T6c(),r=$It(),n=JJi(),o=$It(),s=I6c(),c=x6c(),l=w6c(),u=Ns(),d=pW(),f=pwt(),h=mc(),m=fwt();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:he,schemaEnv:Z,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,Z.$async,()=>{ee.code(u._`"use strict"; ${b(he,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,Z.$async,()=>ee.code(b(he,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:he,gen:Z}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),L(ee),Z.let(d.default.vErrors,null),Z.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"Rn");function v(ee){let{gen:K,validateName:he}=ee;ee.evaluated=K.const("evaluated",u._`${he}.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 he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`: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 he in ee)if(K.RULES.all[he])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:he,gen:Z,opts:ue}=ee;ue.$comment&&he.$comment&&M(ee),B(ee),q(ee);let qe=Z.const("_errs",d.default.errors);D(ee,qe),Z.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 he=(0,r.getSchemaTypes)(ee.schema),Z=(0,r.coerceAndCheckDataType)(ee,he);Q(ee,he,!Z,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:Z,self:ue}=ee;K.$ref&&Z.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function L(ee){let{schema:K,opts:he}=ee;K.default!==void 0&&he.useDefaults&&he.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(L,"kn");function B(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(B,"Sn");function q(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(q,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:Z,opts:ue}){let qe=he.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ne=u.str`${Z}/$comment`,ce=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ne}, ${ce}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:Z,ValidationError:ue,opts:qe}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${Z}.errors`,d.default.vErrors),qe.unevaluated&&j(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function j({gen:ee,evaluated:K,props:he,items:Z}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),Z instanceof u.Name&&ee.assign(u._`${K}.items`,Z)}a(j,"Tn");function Q(ee,K,he,Z){let{gen:ue,schema:qe,data:ne,allErrors:ce,opts:Ne,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ge(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||Y(ee,K),ue.block(()=>{for(let st of Be.rules)rt(st);rt(Be.post)});function rt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&he&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),ce||ue.if(u._`${d.default.errors} === ${Z||0}`))}a(rt,"B")}a(Q,"gA");function U(ee,K){let{gen:he,schema:Z,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(Z,qe)&&ge(ee,qe.keyword,qe.definition,K.type)})}a(U,"hA");function Y(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&V(ee,K),z(ee,ee.dataTypes))}a(Y,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||le(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function V(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&le(ee,"use allowUnionTypes to allow union type keyword")}a(V,"fn");function z(ee,K){let he=ee.self.RULES.all;for(let Z in he){let ue=he[Z];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ne=>ie(K,ne))&&le(ee,`missing type "${qe.join(",")}" for keyword "${Z}"`)}}}a(z,"gn");function ie(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ie,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let he=[];for(let Z of ee.dataTypes)H(K,Z)?he.push(Z):K.includes("integer")&&Z==="number"&&he.push("integer");ee.dataTypes=he}a(re,"un");function le(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(le,"SB");class Le{static{a(this,"vB")}constructor(K,he,Z){if((0,c.validateKeywordUsage)(K,he,Z),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Z,this.data=K.data,this.schema=K.schema[Z],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,Z,this.$data),this.schemaType=he.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=he,this.$data)this.schemaCode=K.gen.const("vSchema",X(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${Z} value must be ${JSON.stringify(he.schemaType)}`);("code"in he?he.trackErrors:he.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,he,Z){this.failResult((0,u.not)(K),he,Z)}failResult(K,he,Z){this.gen.if(K),Z?Z():this.error(),he?(this.gen.else(),he(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,he){this.failResult((0,u.not)(K),void 0,he)}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:he}=this;this.fail(u._`${he} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,he,Z){if(he){this.setParams(he),this._error(K,Z),this.setParams({});return}this._error(K,Z)}_error(K,he){(K?m.reportExtraError:m.reportError)(this,this.def.error,he)}$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,he){he?Object.assign(this.params,K):this.params=K}block$data(K,he,Z=u.nil){this.gen.block(()=>{this.check$data(K,Z),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:Z,schemaCode:ue,schemaType:qe,def:ne}=this;Z.if((0,u.or)(u._`${ue} === undefined`,he)),K!==u.nil&&Z.assign(K,!0),(qe.length||ne.validateSchema)&&(Z.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&Z.assign(K,!1)),Z.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:Z,def:ue,it:qe}=this;return(0,u.or)(ne(),ce());function ne(){if(Z.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(Z)?Z:[Z];return u._`${(0,o.checkDataTypes)(Ne,he,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ce(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let Z=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(Z,this.it,K),(0,l.extendSubschemaMode)(Z,K);let ue={...this.it,...Z,items:void 0,props:void 0};return T(ue,he),ue}mergeEvaluated(K,he){let{it:Z,gen:ue}=this;Z.opts.unevaluated&&(Z.props!==!0&&K.props!==void 0&&(Z.props=h.mergeEvaluated.props(ue,K.props,Z.props,he)),Z.items!==!0&&K.items!==void 0&&(Z.items=h.mergeEvaluated.items(ue,K.items,Z.items,he)))}mergeValidEvaluated(K,he){let{it:Z,gen:ue}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ue.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function ge(ee,K,he,Z){let ue=new Le(ee,he,K);"code"in he?he.code(ue,Z):ue.$data&&he.validate?(0,c.funcKeywordCode)(ue,he):"macro"in he?(0,c.macroKeywordCode)(ue,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(ue,he)}a(ge,"rA");var Ue=/^\/(?:[^~]|~0|~1)*$/,ke=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function X(ee,{dataLevel:K,dataNames:he,dataPathArr:Z}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Ue.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=ke.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 Z[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=he[K-Be],!ue)return qe}let ne=qe,ce=ue.split("/");for(let we of ce)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ne=u._`${ne} && ${qe}`);return ne;function Ne(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(X,"oA"),t.getData=X}),C6r=Ht(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}),mwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pwt();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}),b6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ns(),r=C6r(),n=pW(),o=pwt(),s=mc(),c=hwt();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},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: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")}),k6c=Ht((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}}),XJi=Ht((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=[],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(j==="%"){if(!M(L,N,D))break;M=d}else{L.push(j);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 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}=XJi(),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 L=`${N}:${P.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.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(),L=`${D}:${P.nid||N}`,B=R(L);B&&(x=B.serialize(x,P));let q=x,M=x.nss;return q.path=`${N||P.nid}:${M}`,P.skipEscape=!0,q}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}}),D6c=Ht((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=XJi(),{SCHEMES:h,getSchemeHandler:m}=P6c();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=P(N,B),M=P(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 j=o(B);if(j!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(j),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let Q=B.path;!q.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),j===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}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 j=N.match(v);if(j){q.scheme=j[1],q.userinfo=j[3],q.host=j[4],q.port=parseInt(j[5],10),q.path=j[6]||"",q.query=j[7],q.fragment=j[8],isNaN(q.port)&&(q.port=j[5]);let Q=b(q,j);if(Q!==void 0&&(q.error=q.error||Q,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),O=Y.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(Y){q.error=q.error||"Host's domain name can not be converted to ASCII: "+Y}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 P(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(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}),N6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=D6c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),M6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=hwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ns();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=C6r(),o=mwt(),s=KJi(),c=b6r(),l=Ns(),u=pwt(),d=$It(),f=mc(),h=k6c(),m=N6c(),g=a((W,V)=>new RegExp(W,V),"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 V,z,ie,H,re,le,Le,ge,Ue,ke,X,ee,K,he,Z,ue,qe,ne,ce,Ne,we,Be,rt,st,_t;let Dt=W.strict,$t=(V=W.code)===null||V===void 0?void 0:V.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ie=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Dt)!==null&&le!==void 0?le:!0,strictNumbers:(ge=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Dt)!==null&&ge!==void 0?ge:!0,strictTypes:(ke=(Ue=W.strictTypes)!==null&&Ue!==void 0?Ue:Dt)!==null&&ke!==void 0?ke:"log",strictTuples:(ee=(X=W.strictTuples)!==null&&X!==void 0?X:Dt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Dt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:Gt,regExp:Ie}:{optimize:Gt,regExp:Ie},loopRequired:(Z=W.loopRequired)!==null&&Z!==void 0?Z:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ce=W.inlineRefs)!==null&&ce!==void 0?ce:!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:(rt=W.validateFormats)!==null&&rt!==void 0?rt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(_t=W.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:F}}a(b,"Wo");class T{static{a(this,"CW")}constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...b(V)};let{es5:z,lines:ie}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:z,lines:ie}),this.logger=B(V.logger);let H=V.validateFormats;V.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,V,"NOT SUPPORTED"),w.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&D.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),x.call(this),V.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:V,meta:z,schemaId:ie}=this.opts,H=h;ie==="id"&&(H={...h},H.id=H.$id,delete H.$id),z&&V&&this.addMetaSchema(H,H[ie],!1)}defaultMeta(){let{meta:V,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[z]||V:void 0}validate(V,z){let ie;if(typeof V=="string"){if(ie=this.getSchema(V),!ie)throw Error(`no schema with key or ref "${V}"`)}else ie=this.compile(V);let H=ie(z);return"$async"in ie||(this.errors=ie.errors),H}compile(V,z){let ie=this._addSchema(V,z);return ie.validate||this._compileSchemaEnv(ie)}compileAsync(V,z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ie}=this.opts;return H.call(this,V,z);async function H(ke,X){await re.call(this,ke.$schema);let ee=this._addSchema(ke,X);return ee.validate||le.call(this,ee)}async function re(ke){ke&&!this.getSchema(ke)&&await H.call(this,{$ref:ke},!0)}async function le(ke){try{return this._compileSchemaEnv(ke)}catch(X){if(!(X instanceof o.default))throw X;return Le.call(this,X),await ge.call(this,X.missingSchema),le.call(this,ke)}}function Le({missingSchema:ke,missingRef:X}){if(this.refs[ke])throw Error(`AnySchema ${ke} is loaded but ${X} cannot be resolved`)}async function ge(ke){let X=await Ue.call(this,ke);this.refs[ke]||await re.call(this,X.$schema),this.refs[ke]||this.addSchema(X,ke,z)}async function Ue(ke){let X=this._loading[ke];if(X)return X;try{return await(this._loading[ke]=ie(ke))}finally{delete this._loading[ke]}}}addSchema(V,z,ie,H=this.opts.validateSchema){if(Array.isArray(V)){for(let le of V)this.addSchema(le,void 0,ie,H);return this}let re;if(typeof V=="object"){let{schemaId:le}=this.opts;if(re=V[le],re!==void 0&&typeof re!="string")throw Error(`schema ${le} must be string`)}return z=(0,u.normalizeId)(z||re),this._checkUnique(z),this.schemas[z]=this._addSchema(V,ie,z,H,!0),this}addMetaSchema(V,z,ie=this.opts.validateSchema){return this.addSchema(V,z,!0,ie),this}validateSchema(V,z){if(typeof V=="boolean")return!0;let ie;if(ie=V.$schema,ie!==void 0&&typeof ie!="string")throw Error("$schema must be a string");if(ie=ie||this.opts.defaultMeta||this.defaultMeta(),!ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ie,V);if(!H&&z){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema(V){let z;for(;typeof(z=R.call(this,V))=="string";)V=z;if(z===void 0){let{schemaId:ie}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ie});if(z=c.resolveSchema.call(this,H,V),!z)return;this.refs[V]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let z=R.call(this,V);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{let z=V;this._cache.delete(z);let ie=V[this.opts.schemaId];return ie&&(ie=(0,u.normalizeId)(ie),delete this.schemas[ie],delete this.refs[ie]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(let z of V)this.addKeyword(z);return this}addKeyword(V,z){let ie;if(typeof V=="string")ie=V,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=ie);else if(typeof V=="object"&&z===void 0){if(z=V,ie=z.keyword,Array.isArray(ie)&&!ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ie,z),!z)return(0,f.eachItem)(ie,re=>O.call(this,re)),this;Q.call(this,z);let H={...z,type:(0,d.getJSONTypes)(z.type),schemaType:(0,d.getJSONTypes)(z.schemaType)};return(0,f.eachItem)(ie,H.type.length===0?re=>O.call(this,re,H):re=>H.type.forEach(le=>O.call(this,re,H,le))),this}getKeyword(V){let z=this.RULES.all[V];return typeof z=="object"?z.definition:!!z}removeKeyword(V){let{RULES:z}=this;delete z.keywords[V],delete z.all[V];for(let ie of z.rules){let H=ie.rules.findIndex(re=>re.keyword===V);H>=0&&ie.rules.splice(H,1)}return this}addFormat(V,z){return typeof z=="string"&&(z=new RegExp(z)),this.formats[V]=z,this}errorsText(V=this.errors,{separator:z=", ",dataVar:ie="data"}={}){return!V||V.length===0?"No errors":V.map(H=>`${ie}${H.instancePath} ${H.message}`).reduce((H,re)=>H+z+re)}$dataMetaSchema(V,z){let ie=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(let H of z){let re=H.split("/").slice(1),le=V;for(let Le of re)le=le[Le];for(let Le in ie){let ge=ie[Le];if(typeof ge!="object")continue;let{$data:Ue}=ge.definition,ke=le[Le];Ue&&ke&&(le[Le]=Y(ke))}}return V}_removeAllSchemas(V,z){for(let ie in V){let H=V[ie];(!z||z.test(ie))&&(typeof H=="string"?delete V[ie]:H&&!H.meta&&(this._cache.delete(H.schema),delete V[ie]))}}_addSchema(V,z,ie,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let le,{schemaId:Le}=this.opts;if(typeof V=="object")le=V[Le];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof V!="boolean")throw Error("schema must be object or boolean")}let ge=this._cache.get(V);if(ge!==void 0)return ge;ie=(0,u.normalizeId)(le||ie);let Ue=u.getSchemaRefs.call(this,V,ie);return ge=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Ue}),this._cache.set(ge.schema,ge),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=ge),H&&this.validateSchema(V,!0),ge}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):c.compileSchema.call(this,V),!V.validate)throw Error("ajv implementation error");return V.validate}_compileMetaSchema(V){let z=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,V)}finally{this.opts=z}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,V,z,ie="error"){for(let H in W){let re=H;re in V&&this.logger[ie](`${z}: 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 V in W)this.addSchema(W[V],V)}a(x,"Go");function P(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}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 V in W){let z=W[V];z.keyword||(z.keyword=V),this.addKeyword(z)}}a(D,"Ho");function N(){let W={...this.opts};for(let V of A)delete W[V];return W}a(N,"Ko");var L={log(){},warn(){},error(){}};function B(W){if(W===!1)return L;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(B,"Vo");var q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,V){let{RULES:z}=this;if((0,f.eachItem)(W,ie=>{if(z.keywords[ie])throw Error(`Keyword ${ie} is already defined`);if(!q.test(ie))throw Error(`Keyword ${ie} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(W,V,z){var ie;let H=V?.post;if(z&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,le=H?re.post:re.rules.find(({type:ge})=>ge===z);if(le||(le={type:z,rules:[]},re.rules.push(le)),re.keywords[W]=!0,!V)return;let Le={keyword:W,definition:{...V,type:(0,d.getJSONTypes)(V.type),schemaType:(0,d.getJSONTypes)(V.schemaType)}};V.before?j.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(ge=>this.addKeyword(ge))}a(O,"lB");function j(W,V,z){let ie=W.rules.findIndex(H=>H.keyword===z);ie>=0?W.rules.splice(ie,0,V):(W.rules.push(V),this.logger.warn(`rule ${z} is not defined`))}a(j,"No");function Q(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,U]}}a(Y,"CI")}),O6c=Ht(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}),L6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=mwt(),r=HN(),n=Ns(),o=pW(),s=b6r(),c=mc(),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"),L=f.subschema({schema:P,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 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 L=A.var("props",n._`${P}.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._`${P}.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}),B6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=O6c(),r=L6c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),F6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),U6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),Q6c=Ht(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=Ns(),r=mc(),n=Q6c(),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}),j6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=mc(),n=Ns(),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}),H6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),G6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=mc(),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}),$6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),S6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ZJi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),V6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=$It(),r=Ns(),n=mc(),o=S6r(),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}),W6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=S6r(),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}),z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=S6r(),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}),Y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=F6c(),r=U6c(),n=q6c(),o=j6c(),s=H6c(),c=G6c(),l=$6c(),u=V6c(),d=W6c(),f=z6c(),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}),eZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ns(),r=mc(),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}),tZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ns(),r=mc(),n=HN(),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}),K6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=tZi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),J6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=HN(),o=eZi(),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}),Z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),X6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ns(),r=mc(),n=HN();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(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,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")}),G6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ns(),r=mc();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")}),VN=Ht(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=Ns(),r=mc(),n=AW(),o=mc();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,L,B){let q=B?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._`${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,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 L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,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,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),$6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ns(),r=AW(),n=VN(),o=gwt();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)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(P,!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,j=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,j)}`,A.modifying)}a(B,"O");function q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),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}),V6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ns(),r=mc();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}),cZi=Ht((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},"$")}),W6c=Ht((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=mc(),r=cZi(),n=W6c(),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},(L,B,q,M)=>{if(M===void 0)return;let O=R+B,j=w[M];typeof L[v]=="string"&&(j=Q.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=j;function Q(Y){let W=this.opts.uriResolver.resolve;if(Y=m(j?W(j,Y):Y),P.has(Y))throw N(Y);P.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(L,V.schema,Y):Y!==m(O)&&(Y[0]==="#"?(D(L,x[Y],Y),x[Y]=L):this.refs[Y]=O),Y}a(Q,"M");function U(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);Q.call(this,`#${Y}`)}}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}),ywt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=H6c(),r=YIt(),n=aZi(),o=YIt(),s=G6c(),c=$6c(),l=V6c(),u=Ns(),d=AW(),f=Awt(),h=mc(),m=gwt();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:he,schemaEnv:Z,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,Z.$async,()=>{ee.code(u._`"use strict"; ${b(he,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,Z.$async,()=>ee.code(b(he,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:he,gen:Z}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),L(ee),Z.let(d.default.vErrors,null),Z.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"Rn");function v(ee){let{gen:K,validateName:he}=ee;ee.evaluated=K.const("evaluated",u._`${he}.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 he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`: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 he in ee)if(K.RULES.all[he])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:he,gen:Z,opts:ue}=ee;ue.$comment&&he.$comment&&M(ee),B(ee),q(ee);let qe=Z.const("_errs",d.default.errors);D(ee,qe),Z.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 he=(0,r.getSchemaTypes)(ee.schema),Z=(0,r.coerceAndCheckDataType)(ee,he);Q(ee,he,!Z,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:Z,self:ue}=ee;K.$ref&&Z.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function L(ee){let{schema:K,opts:he}=ee;K.default!==void 0&&he.useDefaults&&he.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(L,"kn");function B(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(B,"Sn");function q(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(q,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:Z,opts:ue}){let qe=he.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ne=u.str`${Z}/$comment`,ce=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ne}, ${ce}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:Z,ValidationError:ue,opts:qe}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${Z}.errors`,d.default.vErrors),qe.unevaluated&&j(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function j({gen:ee,evaluated:K,props:he,items:Z}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),Z instanceof u.Name&&ee.assign(u._`${K}.items`,Z)}a(j,"Tn");function Q(ee,K,he,Z){let{gen:ue,schema:qe,data:ne,allErrors:ce,opts:Me,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Me.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ge(ee,"$ref",Be.all.$ref.definition));return}Me.jtd||Y(ee,K),ue.block(()=>{for(let st of Be.rules)rt(st);rt(Be.post)});function rt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ne,Me.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&he&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),ce||ue.if(u._`${d.default.errors} === ${Z||0}`))}a(rt,"B")}a(Q,"gA");function U(ee,K){let{gen:he,schema:Z,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(Z,qe)&&ge(ee,qe.keyword,qe.definition,K.type)})}a(U,"hA");function Y(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&V(ee,K),z(ee,ee.dataTypes))}a(Y,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||le(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function V(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&le(ee,"use allowUnionTypes to allow union type keyword")}a(V,"fn");function z(ee,K){let he=ee.self.RULES.all;for(let Z in he){let ue=he[Z];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ne=>ie(K,ne))&&le(ee,`missing type "${qe.join(",")}" for keyword "${Z}"`)}}}a(z,"gn");function ie(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ie,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let he=[];for(let Z of ee.dataTypes)H(K,Z)?he.push(Z):K.includes("integer")&&Z==="number"&&he.push("integer");ee.dataTypes=he}a(re,"un");function le(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(le,"SB");class Le{static{a(this,"vB")}constructor(K,he,Z){if((0,c.validateKeywordUsage)(K,he,Z),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Z,this.data=K.data,this.schema=K.schema[Z],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,Z,this.$data),this.schemaType=he.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=he,this.$data)this.schemaCode=K.gen.const("vSchema",X(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${Z} value must be ${JSON.stringify(he.schemaType)}`);("code"in he?he.trackErrors:he.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,he,Z){this.failResult((0,u.not)(K),he,Z)}failResult(K,he,Z){this.gen.if(K),Z?Z():this.error(),he?(this.gen.else(),he(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,he){this.failResult((0,u.not)(K),void 0,he)}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:he}=this;this.fail(u._`${he} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,he,Z){if(he){this.setParams(he),this._error(K,Z),this.setParams({});return}this._error(K,Z)}_error(K,he){(K?m.reportExtraError:m.reportError)(this,this.def.error,he)}$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,he){he?Object.assign(this.params,K):this.params=K}block$data(K,he,Z=u.nil){this.gen.block(()=>{this.check$data(K,Z),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:Z,schemaCode:ue,schemaType:qe,def:ne}=this;Z.if((0,u.or)(u._`${ue} === undefined`,he)),K!==u.nil&&Z.assign(K,!0),(qe.length||ne.validateSchema)&&(Z.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&Z.assign(K,!1)),Z.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:Z,def:ue,it:qe}=this;return(0,u.or)(ne(),ce());function ne(){if(Z.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Me=Array.isArray(Z)?Z:[Z];return u._`${(0,o.checkDataTypes)(Me,he,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ce(){if(ue.validateSchema){let Me=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Me}(${he})`}return u.nil}}subschema(K,he){let Z=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(Z,this.it,K),(0,l.extendSubschemaMode)(Z,K);let ue={...this.it,...Z,items:void 0,props:void 0};return T(ue,he),ue}mergeEvaluated(K,he){let{it:Z,gen:ue}=this;Z.opts.unevaluated&&(Z.props!==!0&&K.props!==void 0&&(Z.props=h.mergeEvaluated.props(ue,K.props,Z.props,he)),Z.items!==!0&&K.items!==void 0&&(Z.items=h.mergeEvaluated.items(ue,K.items,Z.items,he)))}mergeValidEvaluated(K,he){let{it:Z,gen:ue}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ue.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function ge(ee,K,he,Z){let ue=new Le(ee,he,K);"code"in he?he.code(ue,Z):ue.$data&&he.validate?(0,c.funcKeywordCode)(ue,he):"macro"in he?(0,c.macroKeywordCode)(ue,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(ue,he)}a(ge,"rA");var Ue=/^\/(?:[^~]|~0|~1)*$/,ke=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function X(ee,{dataLevel:K,dataNames:he,dataPathArr:Z}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Ue.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=ke.exec(ee);if(!we)throw Error(`Invalid JSON-pointer: ${ee}`);let Be=+we[1];if(ue=we[2],ue==="#"){if(Be>=K)throw Error(Me("property/index",Be));return Z[K-Be]}if(Be>K)throw Error(Me("data",Be));if(qe=he[K-Be],!ue)return qe}let ne=qe,ce=ue.split("/");for(let we of ce)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ne=u._`${ne} && ${qe}`);return ne;function Me(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(X,"oA"),t.getData=X}),x6r=Ht(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}),Ewt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Awt();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}),w6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ns(),r=x6r(),n=AW(),o=Awt(),s=mc(),c=ywt();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},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: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")}),z6c=Ht((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}}),lZi=Ht((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=[],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(j==="%"){if(!M(L,N,D))break;M=d}else{L.push(j);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 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}=lZi(),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 L=`${N}:${P.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.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(),L=`${D}:${P.nid||N}`,B=R(L);B&&(x=B.serialize(x,P));let q=x,M=x.nss;return q.path=`${N||P.nid}:${M}`,P.skipEscape=!0,q}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}}),K6c=Ht((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=lZi(),{SCHEMES:h,getSchemeHandler:m}=Y6c();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=P(N,B),M=P(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 j=o(B);if(j!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(j),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let Q=B.path;!q.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),j===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}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 j=N.match(v);if(j){q.scheme=j[1],q.userinfo=j[3],q.host=j[4],q.port=parseInt(j[5],10),q.path=j[6]||"",q.query=j[7],q.fragment=j[8],isNaN(q.port)&&(q.port=j[5]);let Q=b(q,j);if(Q!==void 0&&(q.error=q.error||Q,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),O=Y.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(Y){q.error=q.error||"Host's domain name can not be converted to ASCII: "+Y}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 P(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(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}),J6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=K6c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),Z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=ywt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ns();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=x6r(),o=Ewt(),s=sZi(),c=w6r(),l=Ns(),u=Awt(),d=YIt(),f=mc(),h=z6c(),m=J6c(),g=a((W,V)=>new RegExp(W,V),"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 V,z,ie,H,re,le,Le,ge,Ue,ke,X,ee,K,he,Z,ue,qe,ne,ce,Me,we,Be,rt,st,Et;let Dt=W.strict,$t=(V=W.code)===null||V===void 0?void 0:V.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ie=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Dt)!==null&&le!==void 0?le:!0,strictNumbers:(ge=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Dt)!==null&&ge!==void 0?ge:!0,strictTypes:(ke=(Ue=W.strictTypes)!==null&&Ue!==void 0?Ue:Dt)!==null&&ke!==void 0?ke:"log",strictTuples:(ee=(X=W.strictTuples)!==null&&X!==void 0?X:Dt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Dt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:Gt,regExp:Ie}:{optimize:Gt,regExp:Ie},loopRequired:(Z=W.loopRequired)!==null&&Z!==void 0?Z:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ce=W.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(Me=W.schemaId)!==null&&Me!==void 0?Me:"$id",addUsedSchema:(we=W.addUsedSchema)!==null&&we!==void 0?we:!0,validateSchema:(Be=W.validateSchema)!==null&&Be!==void 0?Be:!0,validateFormats:(rt=W.validateFormats)!==null&&rt!==void 0?rt:!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(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...b(V)};let{es5:z,lines:ie}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:z,lines:ie}),this.logger=B(V.logger);let H=V.validateFormats;V.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,V,"NOT SUPPORTED"),w.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&D.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),x.call(this),V.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:V,meta:z,schemaId:ie}=this.opts,H=h;ie==="id"&&(H={...h},H.id=H.$id,delete H.$id),z&&V&&this.addMetaSchema(H,H[ie],!1)}defaultMeta(){let{meta:V,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[z]||V:void 0}validate(V,z){let ie;if(typeof V=="string"){if(ie=this.getSchema(V),!ie)throw Error(`no schema with key or ref "${V}"`)}else ie=this.compile(V);let H=ie(z);return"$async"in ie||(this.errors=ie.errors),H}compile(V,z){let ie=this._addSchema(V,z);return ie.validate||this._compileSchemaEnv(ie)}compileAsync(V,z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ie}=this.opts;return H.call(this,V,z);async function H(ke,X){await re.call(this,ke.$schema);let ee=this._addSchema(ke,X);return ee.validate||le.call(this,ee)}async function re(ke){ke&&!this.getSchema(ke)&&await H.call(this,{$ref:ke},!0)}async function le(ke){try{return this._compileSchemaEnv(ke)}catch(X){if(!(X instanceof o.default))throw X;return Le.call(this,X),await ge.call(this,X.missingSchema),le.call(this,ke)}}function Le({missingSchema:ke,missingRef:X}){if(this.refs[ke])throw Error(`AnySchema ${ke} is loaded but ${X} cannot be resolved`)}async function ge(ke){let X=await Ue.call(this,ke);this.refs[ke]||await re.call(this,X.$schema),this.refs[ke]||this.addSchema(X,ke,z)}async function Ue(ke){let X=this._loading[ke];if(X)return X;try{return await(this._loading[ke]=ie(ke))}finally{delete this._loading[ke]}}}addSchema(V,z,ie,H=this.opts.validateSchema){if(Array.isArray(V)){for(let le of V)this.addSchema(le,void 0,ie,H);return this}let re;if(typeof V=="object"){let{schemaId:le}=this.opts;if(re=V[le],re!==void 0&&typeof re!="string")throw Error(`schema ${le} must be string`)}return z=(0,u.normalizeId)(z||re),this._checkUnique(z),this.schemas[z]=this._addSchema(V,ie,z,H,!0),this}addMetaSchema(V,z,ie=this.opts.validateSchema){return this.addSchema(V,z,!0,ie),this}validateSchema(V,z){if(typeof V=="boolean")return!0;let ie;if(ie=V.$schema,ie!==void 0&&typeof ie!="string")throw Error("$schema must be a string");if(ie=ie||this.opts.defaultMeta||this.defaultMeta(),!ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ie,V);if(!H&&z){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema(V){let z;for(;typeof(z=R.call(this,V))=="string";)V=z;if(z===void 0){let{schemaId:ie}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ie});if(z=c.resolveSchema.call(this,H,V),!z)return;this.refs[V]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let z=R.call(this,V);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{let z=V;this._cache.delete(z);let ie=V[this.opts.schemaId];return ie&&(ie=(0,u.normalizeId)(ie),delete this.schemas[ie],delete this.refs[ie]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(let z of V)this.addKeyword(z);return this}addKeyword(V,z){let ie;if(typeof V=="string")ie=V,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=ie);else if(typeof V=="object"&&z===void 0){if(z=V,ie=z.keyword,Array.isArray(ie)&&!ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ie,z),!z)return(0,f.eachItem)(ie,re=>O.call(this,re)),this;Q.call(this,z);let H={...z,type:(0,d.getJSONTypes)(z.type),schemaType:(0,d.getJSONTypes)(z.schemaType)};return(0,f.eachItem)(ie,H.type.length===0?re=>O.call(this,re,H):re=>H.type.forEach(le=>O.call(this,re,H,le))),this}getKeyword(V){let z=this.RULES.all[V];return typeof z=="object"?z.definition:!!z}removeKeyword(V){let{RULES:z}=this;delete z.keywords[V],delete z.all[V];for(let ie of z.rules){let H=ie.rules.findIndex(re=>re.keyword===V);H>=0&&ie.rules.splice(H,1)}return this}addFormat(V,z){return typeof z=="string"&&(z=new RegExp(z)),this.formats[V]=z,this}errorsText(V=this.errors,{separator:z=", ",dataVar:ie="data"}={}){return!V||V.length===0?"No errors":V.map(H=>`${ie}${H.instancePath} ${H.message}`).reduce((H,re)=>H+z+re)}$dataMetaSchema(V,z){let ie=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(let H of z){let re=H.split("/").slice(1),le=V;for(let Le of re)le=le[Le];for(let Le in ie){let ge=ie[Le];if(typeof ge!="object")continue;let{$data:Ue}=ge.definition,ke=le[Le];Ue&&ke&&(le[Le]=Y(ke))}}return V}_removeAllSchemas(V,z){for(let ie in V){let H=V[ie];(!z||z.test(ie))&&(typeof H=="string"?delete V[ie]:H&&!H.meta&&(this._cache.delete(H.schema),delete V[ie]))}}_addSchema(V,z,ie,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let le,{schemaId:Le}=this.opts;if(typeof V=="object")le=V[Le];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof V!="boolean")throw Error("schema must be object or boolean")}let ge=this._cache.get(V);if(ge!==void 0)return ge;ie=(0,u.normalizeId)(le||ie);let Ue=u.getSchemaRefs.call(this,V,ie);return ge=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Ue}),this._cache.set(ge.schema,ge),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=ge),H&&this.validateSchema(V,!0),ge}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):c.compileSchema.call(this,V),!V.validate)throw Error("ajv implementation error");return V.validate}_compileMetaSchema(V){let z=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,V)}finally{this.opts=z}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,V,z,ie="error"){for(let H in W){let re=H;re in V&&this.logger[ie](`${z}: 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 V in W)this.addSchema(W[V],V)}a(x,"Go");function P(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}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 V in W){let z=W[V];z.keyword||(z.keyword=V),this.addKeyword(z)}}a(D,"Ho");function N(){let W={...this.opts};for(let V of A)delete W[V];return W}a(N,"Ko");var L={log(){},warn(){},error(){}};function B(W){if(W===!1)return L;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(B,"Vo");var q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,V){let{RULES:z}=this;if((0,f.eachItem)(W,ie=>{if(z.keywords[ie])throw Error(`Keyword ${ie} is already defined`);if(!q.test(ie))throw Error(`Keyword ${ie} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(W,V,z){var ie;let H=V?.post;if(z&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,le=H?re.post:re.rules.find(({type:ge})=>ge===z);if(le||(le={type:z,rules:[]},re.rules.push(le)),re.keywords[W]=!0,!V)return;let Le={keyword:W,definition:{...V,type:(0,d.getJSONTypes)(V.type),schemaType:(0,d.getJSONTypes)(V.schemaType)}};V.before?j.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(ge=>this.addKeyword(ge))}a(O,"lB");function j(W,V,z){let ie=W.rules.findIndex(H=>H.keyword===z);ie>=0?W.rules.splice(ie,0,V):(W.rules.push(V),this.logger.warn(`rule ${z} is not defined`))}a(j,"No");function Q(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,U]}}a(Y,"CI")}),X6c=Ht(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}),e9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=Ewt(),r=VN(),n=Ns(),o=AW(),s=w6r(),c=mc(),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"),L=f.subschema({schema:P,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 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 L=A.var("props",n._`${P}.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._`${P}.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}),t9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=X6c(),r=e9c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),r9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),n9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),i9c=Ht(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=Ns(),r=mc(),n=i9c(),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}),s9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=VN(),r=mc(),n=Ns(),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}),a9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),c9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=VN(),r=Ns(),n=mc(),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}),l9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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}),R6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cZi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),u9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=YIt(),r=Ns(),n=mc(),o=R6r(),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}),d9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=R6r(),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}),f9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=R6r(),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}),p9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=r9c(),r=n9c(),n=o9c(),o=s9c(),s=a9c(),c=c9c(),l=l9c(),u=u9c(),d=d9c(),f=f9c(),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}),uZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ns(),r=mc(),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}),dZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ns(),r=mc(),n=VN(),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}),h9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=dZi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),m9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=VN(),o=uZi(),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}),g9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),A9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ns(),r=mc(),n=VN();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}),e9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),rZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=pW(),o=mc(),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}),t9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=hwt(),r=HN(),n=mc(),o=rZi(),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}),r9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=mc(),o=mc(),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}),n9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),i9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),o9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),s9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),a9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),c9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),l9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=eZi(),r=K6c(),n=tZi(),o=J6c(),s=Z6c(),c=X6c(),l=e9c(),u=rZi(),d=t9c(),f=r9c(),h=n9c(),m=i9c(),g=o9c(),A=s9c(),y=a9c(),E=c9c();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=_}),u9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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,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 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}),d9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=u9c(),r=[e.default];t.default=r}),f9c=Ht(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"]}),p9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=B6c(),r=Y6c(),n=l9c(),o=d9c(),s=f9c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),h9c=Ht(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={}))}),m9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=h9c(),n=b6r(),o=mwt(),s=mc(),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 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}}),nZi=Ht((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=M6c(),n=p9c(),o=m9c(),s=g9c(),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=hwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ns();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=C6r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=mwt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),A9c=Ht(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: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(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||W>59||L&&!Q)return!1;if(M<=23&&O<=59&&j<60)return!0;let V=O-W*U,z=M-Y*U-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&j<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 P(){return!0}a(P,"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")}),y9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=nZi(),r=Ns(),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}),E9c=Ht((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=A9c(),n=y9c(),o=Ns(),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}),_9c=50;a(t8r,"g9");a(lZi,"K5");a(v9c,"Uk");a(Vie,"v4");ywt=["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"],C9c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],b9c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",S9c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,T9c=/(.*?)<\/command-name>/;a(T6r,"h9");I9c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(pZi,"q5");a(x9c,"JN");a(YV,"G1");a(w9c,"zk");a(R9c,"Nk");a(k9c,"wk");r8r=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=pZi(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()}},R1=class extends Error{static{a(this,"W6")}};a(hZi,"V5");a(s_,"R$");a(D8e,"U1");P9c=typeof global=="object"&&global&&global.Object===Object&&global,mZi=P9c,D9c=typeof self=="object"&&self&&self.Object===Object&&self,N9c=mZi||D9c||Function("return this")(),Mve=N9c,M9c=Mve.Symbol,cW=M9c,gZi=Object.prototype,O9c=gZi.hasOwnProperty,L9c=gZi.toString,bFe=cW?cW.toStringTag:void 0;a(B9c,"Ak");F9c=B9c,U9c=Object.prototype,Q9c=U9c.toString;a(q9c,"Pk");j9c=q9c,H9c="[object Null]",G9c="[object Undefined]",MYi=cW?cW.toStringTag:void 0;a($9c,"_k");N8e=$9c;a(V9c,"kk");z9=V9c,W9c="[object AsyncFunction]",z9c="[object Function]",Y9c="[object GeneratorFunction]",K9c="[object Proxy]";a(J9c,"xk");I6r=J9c,Z9c=Mve["__core-js_shared__"],CFr=Z9c,OYi=(function(){var t=/[^.]+$/.exec(CFr&&CFr.keys&&CFr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(X9c,"fk");eUc=X9c,tUc=Function.prototype,rUc=tUc.toString;a(nUc,"uk");iUc=nUc,oUc=/[\\^$.*+?()[\]{}|]/g,sUc=/^\[object .+?Constructor\]$/,aUc=Function.prototype,cUc=Object.prototype,lUc=aUc.toString,uUc=cUc.hasOwnProperty,dUc=RegExp("^"+lUc.call(uUc).replace(oUc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(fUc,"rk");pUc=fUc;a(hUc,"ok");mUc=hUc;a(gUc,"tk");x6r=gUc,AUc=x6r(Object,"create"),n8e=AUc;a(yUc,"sk");EUc=yUc;a(_Uc,"ek");vUc=_Uc,CUc="__lodash_hash_undefined__",bUc=Object.prototype,SUc=bUc.hasOwnProperty;a(TUc,"XS");IUc=TUc,xUc=Object.prototype,wUc=xUc.hasOwnProperty;a(RUc,"GS");kUc=RUc,PUc="__lodash_hash_undefined__";a(DUc,"HS");NUc=DUc;a(Ove,"a0");Ove.prototype.clear=EUc;Ove.prototype.delete=vUc;Ove.prototype.get=IUc;Ove.prototype.has=kUc;Ove.prototype.set=NUc;LYi=Ove;a(MUc,"KS");OUc=MUc;a(LUc,"qS");Ewt=LUc;a(BUc,"VS");_wt=BUc,FUc=Array.prototype,UUc=FUc.splice;a(QUc,"NS");qUc=QUc;a(jUc,"wS");HUc=jUc;a(GUc,"OS");$Uc=GUc;a(VUc,"DS");WUc=VUc;a(Lve,"s0");Lve.prototype.clear=OUc;Lve.prototype.delete=qUc;Lve.prototype.get=HUc;Lve.prototype.has=$Uc;Lve.prototype.set=WUc;vwt=Lve,zUc=x6r(Mve,"Map"),AZi=zUc;a(YUc,"ZS");KUc=YUc;a(JUc,"MS");ZUc=JUc;a(XUc,"LS");Cwt=XUc;a(e7c,"jS");t7c=e7c;a(r7c,"AS");n7c=r7c;a(i7c,"IS");o7c=i7c;a(s7c,"RS");a7c=s7c;a(Bve,"e0");Bve.prototype.clear=KUc;Bve.prototype.delete=t7c;Bve.prototype.get=n7c;Bve.prototype.has=o7c;Bve.prototype.set=a7c;w6r=Bve,c7c="Expected a function";a(R6r,"MG");R6r.Cache=w6r;Py=R6r,Fve=Py(()=>(process.env.CLAUDE_CONFIG_DIR??(0,EZi.join)((0,yZi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),AKh=Py(()=>s_(process.env.CLAUDE_CODE_SUPERVISED));a(En,"y");a(gt,"Z");_Zi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return _Zi=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(i8e,"T4");n8r=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"),Ri=class extends Error{static{a(this,"g")}},Jv=class t extends Ri{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 dve({message:n,cause:n8r(r)});let s=r,c=s?.error?.type;return e===400?new WIt(e,s,n,o,c):e===401?new zIt(e,s,n,o,c):e===403?new YIt(e,s,n,o,c):e===404?new KIt(e,s,n,o,c):e===409?new JIt(e,s,n,o,c):e===422?new ZIt(e,s,n,o,c):e===429?new XIt(e,s,n,o,c):e>=500?new ext(e,s,n,o,c):new t(e,s,n,o,c)}},kI=class extends Jv{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},dve=class extends Jv{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},VIt=class extends dve{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},WIt=class extends Jv{static{a(this,"p9")}},zIt=class extends Jv{static{a(this,"d9")}},YIt=class extends Jv{static{a(this,"i9")}},KIt=class extends Jv{static{a(this,"n9")}},JIt=class extends Jv{static{a(this,"r9")}},ZIt=class extends Jv{static{a(this,"o9")}},XIt=class extends Jv{static{a(this,"t9")}},ext=class extends Jv{static{a(this,"a9")}},l7c=/^[a-z][a-z0-9+.-]*:/i,u7c=a(t=>l7c.test(t),"bN"),i8r=a(t=>(i8r=Array.isArray,i8r(t)),"jG"),BYi=i8r;a(o8r,"w5");a(FYi,"IG");a(d7c,"_N");f7c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ri(`${t} must be an integer`);if(e<0)throw new Ri(`${t} must be a positive integer`);return e},"kN"),vZi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),p7c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),nW="0.94.0",h7c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(m7c,"SS");g7c=a(()=>{let t=m7c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":QYi(Deno.build.os),"X-Stainless-Arch":UYi(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":nW,"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":nW,"X-Stainless-OS":QYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":UYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=A7c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"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":nW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(A7c,"CS");UYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),QYi=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"),k6r=a(()=>qYi??(qYi=g7c()),"s9");a(y7c,"yN");a(CZi,"RG");a(bZi,"D5");a(P6r,"e9");a(E7c,"fN");_7c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(v7c,"hN");C7c="urn:ietf:params:oauth:grant-type:jwt-bearer",b7c="refresh_token",SZi="/v1/oauth/token",txt="oauth-2025-04-20",S7c="oidc-federation-2026-04-01",T7c=120,D6r=30,I7c=5,jYi=1048576;a(TZi,"Z5");a(IZi,"M5");bFr=2e3,x7c=new Set(["error","error_description","error_uri"]);a(gk,"Z6");a(xZi,"L5");a(wZi,"j5");a(w7c,"fS");nu=class extends Ri{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Wie,"Y4");s8r=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-Wie();return n>T7c?r.token:n>D6r?(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||Wie()-this.lastAdvisoryError{this.lastAdvisoryError=Wie(),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}},tu=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(R7c,"rN");a(N6r,"Q8");a($Yi,"bG");rxt={off:0,error:200,warn:300,info:400,debug:500},VYi=a((t,e,r)=>{if(t){if(d7c(rxt,t))return t;oA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(rxt))}`)}},"_G");a(GFe,"$Q");a(_It,"A5");k7c={error:GFe,warn:GFe,info:GFe,debug:GFe},WYi=new WeakMap;a(oA,"m$");Gie=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"),RZi="1.0",P7c=/^[A-Za-z0-9_.-]+$/;a(kZi,"tN");D7c=a(async t=>{var e,r;let n=await M6r();if(n===null)return null;let o=t??await PZi();if(o===null)return null;kZi(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=tu("ANTHROPIC_ORGANIZATION_ID"),h=tu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=tu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:tu("ANTHROPIC_WORKSPACE_ID"),base_url:tu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:tu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:tu("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=tu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=tu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=tu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=tu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=tu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=tu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),N7c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await M6r();if(!r)return null;let n=e??await PZi();return n?(kZi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),M6r=a(async()=>{if(!M7c())return null;let t=await import("node:path"),e=tu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(k6r()["X-Stainless-OS"]==="Windows"){let o=tu("APPDATA");if(o)return t.join(o,"Anthropic");let s=tu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=tu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=tu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),M7c=a(()=>{let t=k6r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),PZi=a(async()=>{let t=await M6r();if(!t)return null;let e=tu("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(zYi,"SG");a(O7c,"$w");a(L7c,"Qw");a(B7c,"Jw");a(DZi,"vG");a(F7c,"Xw");a(U7c,"mS");a(Q7c,"lS");a(q7c,"cS");Zie=class{static{a(this,"B1")}constructor(){xI.set(this,void 0),wI.set(this,void 0),En(this,xI,new Uint8Array,"f"),En(this,wI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?N6r(e):e;En(this,xI,R7c([gt(this,xI,"f"),r]),"f");let n=[],o;for(;(o=j7c(gt(this,xI,"f"),gt(this,wI,"f")))!=null;){if(o.carriage&>(this,wI,"f")==null){En(this,wI,o.index,"f");continue}if(gt(this,wI,"f")!=null&&(o.index!==gt(this,wI,"f")+1||o.carriage)){n.push($Yi(gt(this,xI,"f").subarray(0,gt(this,wI,"f")-1))),En(this,xI,gt(this,xI,"f").subarray(gt(this,wI,"f")),"f"),En(this,wI,null,"f");continue}let s=gt(this,wI,"f")!==null?o.preceding-1:o.preceding,c=$Yi(gt(this,xI,"f").subarray(0,s));n.push(c),En(this,xI,gt(this,xI,"f").subarray(o.index),"f"),En(this,wI,null,"f")}return n}flush(){return gt(this,xI,"f").length?this.decode(` -`):[]}};xI=new WeakMap,wI=new WeakMap;Zie.NEWLINE_CHARS=new Set([` -`,"\r"]);Zie.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(j7c,"pS");a(H7c,"Yw");Xie=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,SFe.set(this,void 0),this.controller=r,En(this,SFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?oA(n):console;async function*c(){if(o)throw new Ri("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of G7c(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=vZi(u.data)??u.data,f=d?.error?.type;throw new Jv(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(i8e(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 Zie,u=P6r(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 Ri("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(i8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(SFe=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,SFe,"f")),new t(()=>o(r),this.controller,gt(this,SFe,"f"))]}toReadableStream(){let e=this,r;return CZi({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=N6r(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(G7c,"dS");a($7c,"iS");a8r=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]=V7c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(V7c,"nS");a(NZi,"P5");a(MZi,"CG");nxt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=NZi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,$Fe.set(this,void 0),En(this,$Fe,e,"f")}_thenUnwrap(e){return new t(gt(this,$Fe,"f"),this.responsePromise,async(r,n)=>MZi(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,$Fe,"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)}};$Fe=new WeakMap;ixt=class{static{a(this,"TG")}constructor(e,r,n,o){vIt.set(this,void 0),En(this,vIt,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 Ri("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,vIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(vIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},c8r=class extends nxt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await NZi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},eoe=class extends ixt{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:{...o8r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...o8r(this.options.query),after_id:e}}:null}},c_=class extends ixt{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:{...o8r(this.options.query),page:e}}:null}},OZi=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(sve,"J0");a(QIt,"XQ");LZi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),O6r=a(async(t,e,r=!0)=>({...t,body:await z7c(t.body,e,r)}),"J8"),YYi=new WeakMap;a(W7c,"oS");z7c=a(async(t,e,r=!0)=>{if(!await W7c(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])=>l8r(n,o,s,r))),n},"tS"),Y7c=a(t=>t instanceof Blob&&"name"in t,"aS"),l8r=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,sve([await r.blob()],QIt(r,n),o))}else if(LZi(r))t.append(e,sve([await new Response(bZi(r)).blob()],QIt(r,n)));else if(Y7c(r))t.append(e,sve([r],QIt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>l8r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>l8r(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"),BZi=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"),K7c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&BZi(t),"sS"),J7c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(Z7c,"_5");a(u8r,"gG");a(X7c,"$v");Sd=class{static{a(this,"t")}constructor(e){this._client=e}},FZi=Symbol.for("brand.privateNullableHeaders");a(eQc,"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 eQc(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{[FZi]:!0,values:e,nulls:r}},"R");a(UZi,"qw");KYi=Object.freeze(Object.create(null)),tQc=a((t=UZi)=>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??KYi)??KYi)?.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 Ri(`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}),y9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),fZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=VN(),r=Ns(),n=AW(),o=mc(),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}),E9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ywt(),r=VN(),n=mc(),o=fZi(),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}),_9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=VN(),r=Ns(),n=mc(),o=mc(),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}),v9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),C9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=VN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),b9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),S9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),T9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),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}),I9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),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}),x9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uZi(),r=h9c(),n=dZi(),o=m9c(),s=g9c(),c=A9c(),l=y9c(),u=fZi(),d=E9c(),f=_9c(),h=v9c(),m=C9c(),g=b9c(),A=S9c(),y=T9c(),E=I9c();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=_}),w9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),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,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 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}),R9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=w9c(),r=[e.default];t.default=r}),k9c=Ht(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"]}),P9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=t9c(),r=p9c(),n=x9c(),o=R9c(),s=k9c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),D9c=Ht(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={}))}),N9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=D9c(),n=w6r(),o=Ewt(),s=mc(),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 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}}),pZi=Ht((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=Z6c(),n=P9c(),o=N9c(),s=M9c(),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=ywt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ns();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=x6r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=Ewt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),O9c=Ht(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: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(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||W>59||L&&!Q)return!1;if(M<=23&&O<=59&&j<60)return!0;let V=O-W*U,z=M-Y*U-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&j<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 P(){return!0}a(P,"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")}),L9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=pZi(),r=Ns(),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}),B9c=Ht((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=O9c(),n=L9c(),o=Ns(),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}),F9c=50;a(s8r,"g9");a(EZi,"K5");a(U9c,"Uk");a(Wie,"v4");Cwt=["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"],Q9c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],q9c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",j9c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,H9c=/(.*?)<\/command-name>/;a(k6r,"h9");G9c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(bZi,"q5");a($9c,"JN");a(XV,"G1");a(V9c,"zk");a(W9c,"Nk");a(z9c,"wk");a8r=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=bZi(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()}},R1=class extends Error{static{a(this,"W6")}};a(SZi,"V5");a(a_,"R$");a(B8e,"U1");Y9c=typeof global=="object"&&global&&global.Object===Object&&global,TZi=Y9c,K9c=typeof self=="object"&&self&&self.Object===Object&&self,J9c=TZi||K9c||Function("return this")(),Bve=J9c,Z9c=Bve.Symbol,fW=Z9c,IZi=Object.prototype,X9c=IZi.hasOwnProperty,eUc=IZi.toString,wFe=fW?fW.toStringTag:void 0;a(tUc,"Ak");rUc=tUc,nUc=Object.prototype,iUc=nUc.toString;a(oUc,"Pk");sUc=oUc,aUc="[object Null]",cUc="[object Undefined]",GYi=fW?fW.toStringTag:void 0;a(lUc,"_k");F8e=lUc;a(uUc,"kk");K9=uUc,dUc="[object AsyncFunction]",fUc="[object Function]",pUc="[object GeneratorFunction]",hUc="[object Proxy]";a(mUc,"xk");P6r=mUc,gUc=Bve["__core-js_shared__"],xFr=gUc,$Yi=(function(){var t=/[^.]+$/.exec(xFr&&xFr.keys&&xFr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(AUc,"fk");yUc=AUc,EUc=Function.prototype,_Uc=EUc.toString;a(vUc,"uk");CUc=vUc,bUc=/[\\^$.*+?()[\]{}|]/g,SUc=/^\[object .+?Constructor\]$/,TUc=Function.prototype,IUc=Object.prototype,xUc=TUc.toString,wUc=IUc.hasOwnProperty,RUc=RegExp("^"+xUc.call(wUc).replace(bUc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(kUc,"rk");PUc=kUc;a(DUc,"ok");NUc=DUc;a(MUc,"tk");D6r=MUc,OUc=D6r(Object,"create"),c8e=OUc;a(LUc,"sk");BUc=LUc;a(FUc,"ek");UUc=FUc,QUc="__lodash_hash_undefined__",qUc=Object.prototype,jUc=qUc.hasOwnProperty;a(HUc,"XS");GUc=HUc,$Uc=Object.prototype,VUc=$Uc.hasOwnProperty;a(WUc,"GS");zUc=WUc,YUc="__lodash_hash_undefined__";a(KUc,"HS");JUc=KUc;a(Fve,"a0");Fve.prototype.clear=BUc;Fve.prototype.delete=UUc;Fve.prototype.get=GUc;Fve.prototype.has=zUc;Fve.prototype.set=JUc;VYi=Fve;a(ZUc,"KS");XUc=ZUc;a(e7c,"qS");bwt=e7c;a(t7c,"VS");Swt=t7c,r7c=Array.prototype,n7c=r7c.splice;a(i7c,"NS");o7c=i7c;a(s7c,"wS");a7c=s7c;a(c7c,"OS");l7c=c7c;a(u7c,"DS");d7c=u7c;a(Uve,"s0");Uve.prototype.clear=XUc;Uve.prototype.delete=o7c;Uve.prototype.get=a7c;Uve.prototype.has=l7c;Uve.prototype.set=d7c;Twt=Uve,f7c=D6r(Bve,"Map"),xZi=f7c;a(p7c,"ZS");h7c=p7c;a(m7c,"MS");g7c=m7c;a(A7c,"LS");Iwt=A7c;a(y7c,"jS");E7c=y7c;a(_7c,"AS");v7c=_7c;a(C7c,"IS");b7c=C7c;a(S7c,"RS");T7c=S7c;a(Qve,"e0");Qve.prototype.clear=h7c;Qve.prototype.delete=E7c;Qve.prototype.get=v7c;Qve.prototype.has=b7c;Qve.prototype.set=T7c;N6r=Qve,I7c="Expected a function";a(M6r,"MG");M6r.Cache=N6r;Dy=M6r,qve=Dy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,RZi.join)((0,wZi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),ZKh=Dy(()=>a_(process.env.CLAUDE_CODE_SUPERVISED));a(En,"y");a(gt,"Z");kZi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return kZi=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(l8e,"T4");c8r=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"),Ri=class extends Error{static{a(this,"g")}},Xv=class t extends Ri{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 hve({message:n,cause:c8r(r)});let s=r,c=s?.error?.type;return e===400?new JIt(e,s,n,o,c):e===401?new ZIt(e,s,n,o,c):e===403?new XIt(e,s,n,o,c):e===404?new ext(e,s,n,o,c):e===409?new txt(e,s,n,o,c):e===422?new rxt(e,s,n,o,c):e===429?new nxt(e,s,n,o,c):e>=500?new ixt(e,s,n,o,c):new t(e,s,n,o,c)}},DI=class extends Xv{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},hve=class extends Xv{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},KIt=class extends hve{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},JIt=class extends Xv{static{a(this,"p9")}},ZIt=class extends Xv{static{a(this,"d9")}},XIt=class extends Xv{static{a(this,"i9")}},ext=class extends Xv{static{a(this,"n9")}},txt=class extends Xv{static{a(this,"r9")}},rxt=class extends Xv{static{a(this,"o9")}},nxt=class extends Xv{static{a(this,"t9")}},ixt=class extends Xv{static{a(this,"a9")}},x7c=/^[a-z][a-z0-9+.-]*:/i,w7c=a(t=>x7c.test(t),"bN"),l8r=a(t=>(l8r=Array.isArray,l8r(t)),"jG"),WYi=l8r;a(u8r,"w5");a(zYi,"IG");a(R7c,"_N");k7c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ri(`${t} must be an integer`);if(e<0)throw new Ri(`${t} must be a positive integer`);return e},"kN"),PZi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),P7c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),aW="0.94.0",D7c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(N7c,"SS");M7c=a(()=>{let t=N7c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":aW,"X-Stainless-OS":KYi(Deno.build.os),"X-Stainless-Arch":YYi(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":aW,"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":aW,"X-Stainless-OS":KYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":YYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=O7c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":aW,"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":aW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(O7c,"CS");YYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),KYi=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"),O6r=a(()=>JYi??(JYi=M7c()),"s9");a(L7c,"yN");a(DZi,"RG");a(NZi,"D5");a(L6r,"e9");a(B7c,"fN");F7c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(U7c,"hN");Q7c="urn:ietf:params:oauth:grant-type:jwt-bearer",q7c="refresh_token",MZi="/v1/oauth/token",oxt="oauth-2025-04-20",j7c="oidc-federation-2026-04-01",H7c=120,B6r=30,G7c=5,ZYi=1048576;a(OZi,"Z5");a(LZi,"M5");wFr=2e3,$7c=new Set(["error","error_description","error_uri"]);a(yk,"Z6");a(BZi,"L5");a(FZi,"j5");a(V7c,"fS");nu=class extends Ri{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(zie,"Y4");d8r=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-zie();return n>H7c?r.token:n>B6r?(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||zie()-this.lastAdvisoryError{this.lastAdvisoryError=zie(),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}},tu=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(W7c,"rN");a(F6r,"Q8");a(tKi,"bG");sxt={off:0,error:200,warn:300,info:400,debug:500},rKi=a((t,e,r)=>{if(t){if(R7c(sxt,t))return t;sA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(sxt))}`)}},"_G");a(YFe,"$Q");a(SIt,"A5");z7c={error:YFe,warn:YFe,info:YFe,debug:YFe},nKi=new WeakMap;a(sA,"m$");$ie=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"),UZi="1.0",Y7c=/^[A-Za-z0-9_.-]+$/;a(QZi,"tN");K7c=a(async t=>{var e,r;let n=await U6r();if(n===null)return null;let o=t??await qZi();if(o===null)return null;QZi(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=tu("ANTHROPIC_ORGANIZATION_ID"),h=tu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=tu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:tu("ANTHROPIC_WORKSPACE_ID"),base_url:tu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:tu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:tu("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=tu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=tu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=tu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=tu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=tu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=tu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),J7c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await U6r();if(!r)return null;let n=e??await qZi();return n?(QZi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),U6r=a(async()=>{if(!Z7c())return null;let t=await import("node:path"),e=tu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(O6r()["X-Stainless-OS"]==="Windows"){let o=tu("APPDATA");if(o)return t.join(o,"Anthropic");let s=tu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=tu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=tu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),Z7c=a(()=>{let t=O6r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),qZi=a(async()=>{let t=await U6r();if(!t)return null;let e=tu("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(iKi,"SG");a(X7c,"$w");a(eQc,"Qw");a(tQc,"Jw");a(jZi,"vG");a(rQc,"Xw");a(nQc,"mS");a(iQc,"lS");a(oQc,"cS");Xie=class{static{a(this,"B1")}constructor(){RI.set(this,void 0),kI.set(this,void 0),En(this,RI,new Uint8Array,"f"),En(this,kI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?F6r(e):e;En(this,RI,W7c([gt(this,RI,"f"),r]),"f");let n=[],o;for(;(o=sQc(gt(this,RI,"f"),gt(this,kI,"f")))!=null;){if(o.carriage&>(this,kI,"f")==null){En(this,kI,o.index,"f");continue}if(gt(this,kI,"f")!=null&&(o.index!==gt(this,kI,"f")+1||o.carriage)){n.push(tKi(gt(this,RI,"f").subarray(0,gt(this,kI,"f")-1))),En(this,RI,gt(this,RI,"f").subarray(gt(this,kI,"f")),"f"),En(this,kI,null,"f");continue}let s=gt(this,kI,"f")!==null?o.preceding-1:o.preceding,c=tKi(gt(this,RI,"f").subarray(0,s));n.push(c),En(this,RI,gt(this,RI,"f").subarray(o.index),"f"),En(this,kI,null,"f")}return n}flush(){return gt(this,RI,"f").length?this.decode(` +`):[]}};RI=new WeakMap,kI=new WeakMap;Xie.NEWLINE_CHARS=new Set([` +`,"\r"]);Xie.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(sQc,"pS");a(aQc,"Yw");eoe=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,RFe.set(this,void 0),this.controller=r,En(this,RFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?sA(n):console;async function*c(){if(o)throw new Ri("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of cQc(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=PZi(u.data)??u.data,f=d?.error?.type;throw new Xv(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(l8e(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 Xie,u=L6r(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 Ri("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(l8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(RFe=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,RFe,"f")),new t(()=>o(r),this.controller,gt(this,RFe,"f"))]}toReadableStream(){let e=this,r;return DZi({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=F6r(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(cQc,"dS");a(lQc,"iS");f8r=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]=uQc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(uQc,"nS");a(HZi,"P5");a(GZi,"CG");axt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=HZi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,KFe.set(this,void 0),En(this,KFe,e,"f")}_thenUnwrap(e){return new t(gt(this,KFe,"f"),this.responsePromise,async(r,n)=>GZi(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,KFe,"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)}};KFe=new WeakMap;cxt=class{static{a(this,"TG")}constructor(e,r,n,o){TIt.set(this,void 0),En(this,TIt,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 Ri("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,TIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(TIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},p8r=class extends axt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await HZi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},toe=class extends cxt{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:{...u8r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...u8r(this.options.query),after_id:e}}:null}},l_=class extends cxt{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:{...u8r(this.options.query),page:e}}:null}},$Zi=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(lve,"J0");a(GIt,"XQ");VZi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),Q6r=a(async(t,e,r=!0)=>({...t,body:await fQc(t.body,e,r)}),"J8"),oKi=new WeakMap;a(dQc,"oS");fQc=a(async(t,e,r=!0)=>{if(!await dQc(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])=>h8r(n,o,s,r))),n},"tS"),pQc=a(t=>t instanceof Blob&&"name"in t,"aS"),h8r=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,lve([await r.blob()],GIt(r,n),o))}else if(VZi(r))t.append(e,lve([await new Response(NZi(r)).blob()],GIt(r,n)));else if(pQc(r))t.append(e,lve([r],GIt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>h8r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>h8r(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"),WZi=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"),hQc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&WZi(t),"sS"),mQc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(gQc,"_5");a(m8r,"gG");a(AQc,"$v");Id=class{static{a(this,"t")}constructor(e){this._client=e}},zZi=Symbol.for("brand.privateNullableHeaders");a(yQc,"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 yQc(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{[zZi]:!0,values:e,nulls:r}},"R");a(YZi,"qw");sKi=Object.freeze(Object.create(null)),EQc=a((t=YZi)=>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??sKi)??sKi)?.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 Ri(`Path parameters result in path with invalid segments: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),$n=tQc(UZi),oxt=class extends Sd{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",c_,{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])})}},XFe=Symbol("anthropic.sdk.stainlessHelper");a(qIt,"k5");a(QZi,"hG");a(qZi,"S5");a(rQc,"Vw");sxt=class extends Sd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",eoe,{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",O6r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},rQc(o.file),r?.headers])},this._client))}},axt=class extends Sd{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",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},cxt=class extends Sd{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",c_,{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])})}},lxt=class extends Sd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},o8e=class extends Sd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new lxt(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",c_,{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])})}};o8e.Versions=lxt;uxt=class extends Sd{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`,c_,{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])})}},dxt=class extends Sd{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`,c_,{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])})}},fve=class extends Sd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new uxt(this._client),this.memoryVersions=new dxt(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",c_,{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])})}};fve.Memories=uxt;fve.MemoryVersions=dxt;fxt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Zie;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 Ri("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 Ri("Attempted to iterate over a response with no body");return new t(P6r(e.body),r)}},pxt=class extends Sd{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",eoe,{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 Ri(`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)=>fxt.fromResponse(l.response,l.controller))}},jZi={"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(HZi,"Bw");a(JYi,"uG");a(GZi,"mG");a(nQc,"Nv");iQc=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),eve(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),eve(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),eve(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),eve(t);break;case"delimiter":return t=t.slice(0,t.length-1),eve(t)}return t},"W8"),oQc=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"),sQc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),$Zi=a(t=>JSON.parse(sQc(oQc(eve(iQc(t))))),"C5"),eKi="__json_buf";a(tKi,"Ow");d8r=class t{static{a(this,"ZQ")}constructor(e,r){dk.add(this),this.messages=[],this.receivedMessages=[],KV.set(this,void 0),W_e.set(this,null),this.controller=new AbortController,TFe.set(this,void 0),CIt.set(this,()=>{}),IFe.set(this,()=>{}),xFe.set(this,void 0),bIt.set(this,()=>{}),wFe.set(this,()=>{}),U9.set(this,{}),RFe.set(this,!1),SIt.set(this,!1),TIt.set(this,!1),Qie.set(this,!1),IIt.set(this,void 0),xIt.set(this,void 0),kFe.set(this,void 0),wIt.set(this,n=>{if(En(this,SIt,!0,"f"),i8e(n)&&(n=new kI),n instanceof kI)return En(this,TIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,TFe,new Promise((n,o)=>{En(this,CIt,n,"f"),En(this,IFe,o,"f")}),"f"),En(this,xFe,new Promise((n,o)=>{En(this,bIt,n,"f"),En(this,wFe,o,"f")}),"f"),gt(this,TFe,"f").catch(()=>{}),gt(this,xFe,"f").catch(()=>{}),En(this,W_e,e,"f"),En(this,kFe,r?.logger??console,"f")}get response(){return gt(this,IIt,"f")}get request_id(){return gt(this,xIt,"f")}async withResponse(){En(this,Qie,!0,"f");let e=await gt(this,TFe,"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 En(s,W_e,{...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,wIt,"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,dk,"m",TFr).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,dk,"m",IFr).call(this,u);if(l.controller.signal?.aborted)throw new kI;gt(this,dk,"m",xFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,IIt,e,"f"),En(this,xIt,e?.headers.get("request-id"),"f"),gt(this,CIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,RFe,"f")}get errored(){return gt(this,SIt,"f")}get aborted(){return gt(this,TIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,U9,"f")[e]||(gt(this,U9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,U9,"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,U9,"f")[e]||(gt(this,U9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Qie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Qie,!0,"f"),await gt(this,xFe,"f")}get currentMessage(){return gt(this,KV,"f")}async finalMessage(){return await this.done(),gt(this,dk,"m",SFr).call(this)}async finalText(){return await this.done(),gt(this,dk,"m",ZYi).call(this)}_emit(e,...r){if(gt(this,RFe,"f"))return;e==="end"&&(En(this,RFe,!0,"f"),gt(this,bIt,"f").call(this));let n=gt(this,U9,"f")[e];if(n&&(gt(this,U9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,IFe,"f").call(this,o),gt(this,wFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,IFe,"f").call(this,o),gt(this,wFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,dk,"m",SFr).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,dk,"m",TFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,dk,"m",IFr).call(this,c);if(s.controller.signal?.aborted)throw new kI;gt(this,dk,"m",xFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(KV=new WeakMap,W_e=new WeakMap,TFe=new WeakMap,CIt=new WeakMap,IFe=new WeakMap,xFe=new WeakMap,bIt=new WeakMap,wFe=new WeakMap,U9=new WeakMap,RFe=new WeakMap,SIt=new WeakMap,TIt=new WeakMap,Qie=new WeakMap,IIt=new WeakMap,xIt=new WeakMap,kFe=new WeakMap,wIt=new WeakMap,dk=new WeakSet,SFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),ZYi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),TFr=a(function(){this.ended||En(this,KV,void 0,"f")},"cG"),IFr=a(function(e){if(this.ended)return;let r=gt(this,dk,"m",XYi).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":{tKi(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(JYi(r,gt(this,W_e,"f"),{logger:gt(this,kFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,KV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),xFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,KV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,KV,void 0,"f"),JYi(e,gt(this,W_e,"f"),{logger:gt(this,kFe,"f")})},"dG"),XYi=a(function(e){let r=gt(this,KV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&tKi(n)){let o=n[eKi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,eKi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=$Zi(o)}catch(c){let l=new Ri(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,wIt,"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 Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},hxt=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}},aQc=1e5,cQc=`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=EQc(YZi),lxt=class extends Id{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",l_,{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])})}},i8e=Symbol("anthropic.sdk.stainlessHelper");a($It,"k5");a(KZi,"hG");a(JZi,"S5");a(_Qc,"Vw");uxt=class extends Id{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",toe,{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",Q6r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},_Qc(o.file),r?.headers])},this._client))}},dxt=class extends Id{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",toe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},fxt=class extends Id{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",l_,{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])})}},pxt=class extends Id{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,l_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},u8e=class extends Id{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new pxt(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",l_,{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])})}};u8e.Versions=pxt;hxt=class extends Id{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`,l_,{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])})}},mxt=class extends Id{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`,l_,{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])})}},mve=class extends Id{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new hxt(this._client),this.memoryVersions=new mxt(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",l_,{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])})}};mve.Memories=hxt;mve.MemoryVersions=mxt;gxt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Xie;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 Ri("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 Ri("Attempted to iterate over a response with no body");return new t(L6r(e.body),r)}},Axt=class extends Id{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",toe,{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 Ri(`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)=>gxt.fromResponse(l.response,l.controller))}},ZZi={"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(XZi,"Bw");a(aKi,"uG");a(eXi,"mG");a(vQc,"Nv");CQc=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),nve(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),nve(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),nve(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),nve(t);break;case"delimiter":return t=t.slice(0,t.length-1),nve(t)}return t},"W8"),bQc=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"),SQc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),tXi=a(t=>JSON.parse(SQc(bQc(nve(CQc(t))))),"C5"),uKi="__json_buf";a(dKi,"Ow");g8r=class t{static{a(this,"ZQ")}constructor(e,r){pk.add(this),this.messages=[],this.receivedMessages=[],eW.set(this,void 0),K_e.set(this,null),this.controller=new AbortController,kFe.set(this,void 0),IIt.set(this,()=>{}),PFe.set(this,()=>{}),DFe.set(this,void 0),xIt.set(this,()=>{}),NFe.set(this,()=>{}),q9.set(this,{}),MFe.set(this,!1),wIt.set(this,!1),RIt.set(this,!1),qie.set(this,!1),kIt.set(this,void 0),PIt.set(this,void 0),OFe.set(this,void 0),DIt.set(this,n=>{if(En(this,wIt,!0,"f"),l8e(n)&&(n=new DI),n instanceof DI)return En(this,RIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,kFe,new Promise((n,o)=>{En(this,IIt,n,"f"),En(this,PFe,o,"f")}),"f"),En(this,DFe,new Promise((n,o)=>{En(this,xIt,n,"f"),En(this,NFe,o,"f")}),"f"),gt(this,kFe,"f").catch(()=>{}),gt(this,DFe,"f").catch(()=>{}),En(this,K_e,e,"f"),En(this,OFe,r?.logger??console,"f")}get response(){return gt(this,kIt,"f")}get request_id(){return gt(this,PIt,"f")}async withResponse(){En(this,qie,!0,"f");let e=await gt(this,kFe,"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 En(s,K_e,{...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,DIt,"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,pk,"m",kFr).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,pk,"m",PFr).call(this,u);if(l.controller.signal?.aborted)throw new DI;gt(this,pk,"m",DFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,kIt,e,"f"),En(this,PIt,e?.headers.get("request-id"),"f"),gt(this,IIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,MFe,"f")}get errored(){return gt(this,wIt,"f")}get aborted(){return gt(this,RIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,q9,"f")[e]||(gt(this,q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,q9,"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,q9,"f")[e]||(gt(this,q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,qie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,qie,!0,"f"),await gt(this,DFe,"f")}get currentMessage(){return gt(this,eW,"f")}async finalMessage(){return await this.done(),gt(this,pk,"m",RFr).call(this)}async finalText(){return await this.done(),gt(this,pk,"m",cKi).call(this)}_emit(e,...r){if(gt(this,MFe,"f"))return;e==="end"&&(En(this,MFe,!0,"f"),gt(this,xIt,"f").call(this));let n=gt(this,q9,"f")[e];if(n&&(gt(this,q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,qie,"f")&&!n?.length&&Promise.reject(o),gt(this,PFe,"f").call(this,o),gt(this,NFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,qie,"f")&&!n?.length&&Promise.reject(o),gt(this,PFe,"f").call(this,o),gt(this,NFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,pk,"m",RFr).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,pk,"m",kFr).call(this),this._connected(null);let s=eoe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,pk,"m",PFr).call(this,c);if(s.controller.signal?.aborted)throw new DI;gt(this,pk,"m",DFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(eW=new WeakMap,K_e=new WeakMap,kFe=new WeakMap,IIt=new WeakMap,PFe=new WeakMap,DFe=new WeakMap,xIt=new WeakMap,NFe=new WeakMap,q9=new WeakMap,MFe=new WeakMap,wIt=new WeakMap,RIt=new WeakMap,qie=new WeakMap,kIt=new WeakMap,PIt=new WeakMap,OFe=new WeakMap,DIt=new WeakMap,pk=new WeakSet,RFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),cKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),kFr=a(function(){this.ended||En(this,eW,void 0,"f")},"cG"),PFr=a(function(e){if(this.ended)return;let r=gt(this,pk,"m",lKi).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":{dKi(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(aKi(r,gt(this,K_e,"f"),{logger:gt(this,OFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,eW,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),DFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,eW,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,eW,void 0,"f"),aKi(e,gt(this,K_e,"f"),{logger:gt(this,OFe,"f")})},"dG"),lKi=a(function(e){let r=gt(this,eW,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&dKi(n)){let o=n[uKi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,uKi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=tXi(o)}catch(c){let l=new Ri(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,DIt,"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 eoe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},yxt=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}},TQc=1e5,IQc=`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 @@ -1571,24 +1571,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(nKi,"Lw");mxt=class{static{a(this,"jQ")}constructor(e,r,n){PFe.add(this),this.client=e,z_e.set(this,!1),qie.set(this,!1),Q0.set(this,void 0),w1.set(this,void 0),II.set(this,void 0),G9.set(this,void 0),JV.set(this,void 0),DFe.set(this,0),En(this,Q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...QZi(r.tools,r.messages)].join(", ");En(this,w1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),En(this,JV,nKi(),"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*[(z_e=new WeakMap,qie=new WeakMap,Q0=new WeakMap,w1=new WeakMap,II=new WeakMap,G9=new WeakMap,JV=new WeakMap,DFe=new WeakMap,PFe=new WeakSet,rKi=a(async function(){let e=gt(this,Q0,"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??aQc;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,Q0,"f").params.max_tokens},{signal:gt(this,w1,"f").signal,headers:mr([gt(this,w1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ri("Expected text response for compaction");return gt(this,Q0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,z_e,"f"))throw new Ri("Cannot iterate over a consumed stream");En(this,z_e,!0,"f"),En(this,qie,!0,"f"),En(this,G9,void 0,"f");try{for(;;){let r;try{if(gt(this,Q0,"f").params.max_iterations&>(this,DFe,"f")>=gt(this,Q0,"f").params.max_iterations)break;En(this,qie,!1,"f"),En(this,G9,void 0,"f"),En(this,DFe,(e=gt(this,DFe,"f"),e++,e),"f"),En(this,II,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,w1,"f")),En(this,II,r.finalMessage(),"f"),gt(this,II,"f").catch(()=>{}),yield r):(En(this,II,this.client.beta.messages.create({...s,stream:!1},gt(this,w1,"f")),"f"),yield gt(this,II,"f")),!await gt(this,PFe,"m",rKi).call(this)){if(!gt(this,qie,"f")){let{role:l,content:u}=await gt(this,II,"f");gt(this,Q0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,PFe,"m",f8r).call(this,gt(this,Q0,"f").params.messages.at(-1));if(c)gt(this,Q0,"f").params.messages.push(c);else if(!gt(this,qie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,II,"f"))throw new Ri("ToolRunner concluded without a message from the server");gt(this,JV,"f").resolve(await gt(this,II,"f"))}catch(r){throw En(this,z_e,!1,"f"),gt(this,JV,"f").promise.catch(()=>{}),gt(this,JV,"f").reject(r),En(this,JV,nKi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Q0,"f").params=e(gt(this,Q0,"f").params):gt(this,Q0,"f").params=e,En(this,qie,!0,"f"),En(this,G9,void 0,"f")}setRequestOptions(e){typeof e=="function"?En(this,w1,e(gt(this,w1,"f")),"f"):En(this,w1,{...gt(this,w1,"f"),...e},"f")}async generateToolResponse(e=gt(this,w1,"f").signal){let r=await gt(this,II,"f")??this.params.messages.at(-1);return r?gt(this,PFe,"m",f8r).call(this,r,e):null}done(){return gt(this,JV,"f").promise}async runUntilDone(){if(!gt(this,z_e,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};f8r=a(async function(t,e=gt(this,w1,"f").signal){return gt(this,G9,"f")!==void 0?gt(this,G9,"f"):(En(this,G9,lQc(gt(this,Q0,"f").params,t,{...gt(this,w1,"f"),signal:e}),"f"),gt(this,G9,"f"))},"iG");a(lQc,"Fv");iKi={"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"},uQc=["claude-mythos-preview","claude-opus-4-6"],toe=class extends Sd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new pxt(this._client)}create(e,r){let n=oKi(e),{betas:o,...s}=n;s.model in iKi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${iKi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),uQc.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=jZi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=qZi(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=>GZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return d8r.createMessage(this,e,r)}countTokens(e,r){let n=oKi(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 mxt(this._client,e,r)}};a(oKi,"Aw");toe.Batches=pxt;toe.BetaToolRunner=mxt;toe.ToolError=hxt;gxt=class extends Sd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,c_,{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})}},Axt=class extends Sd{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`,c_,{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])})}},pve=class extends Sd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new gxt(this._client),this.resources=new Axt(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",c_,{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])})}};pve.Events=gxt;pve.Resources=Axt;yxt=class extends Sd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,O6r({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`,c_,{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])})}},s8e=class extends Sd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new yxt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",O6r({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",c_,{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])})}};s8e.Versions=yxt;Ext=class extends Sd{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`,c_,{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])})}},a8e=class extends Sd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new Ext(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",c_,{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])})}};a8e.Credentials=Ext;k1=class extends Sd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new axt(this._client),this.messages=new toe(this._client),this.agents=new o8e(this._client),this.environments=new oxt(this._client),this.sessions=new pve(this._client),this.vaults=new a8e(this._client),this.memoryStores=new fve(this._client),this.files=new sxt(this._client),this.skills=new s8e(this._client),this.userProfiles=new cxt(this._client)}};k1.Models=axt;k1.Messages=toe;k1.Agents=o8e;k1.Environments=oxt;k1.Sessions=pve;k1.Vaults=a8e;k1.MemoryStores=fve;k1.Files=sxt;k1.Skills=s8e;k1.UserProfiles=cxt;_xt=class extends Sd{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(VZi,"Iw");a(sKi,"nG");a(WZi,"rG");a(dQc,"bv");lKi="__json_buf";a(uKi,"bw");p8r=class t{static{a(this,"CQ")}constructor(e,r){fk.add(this),this.messages=[],this.receivedMessages=[],ZV.set(this,void 0),Y_e.set(this,null),this.controller=new AbortController,NFe.set(this,void 0),RIt.set(this,()=>{}),MFe.set(this,()=>{}),OFe.set(this,void 0),kIt.set(this,()=>{}),LFe.set(this,()=>{}),Q9.set(this,{}),BFe.set(this,!1),PIt.set(this,!1),DIt.set(this,!1),jie.set(this,!1),NIt.set(this,void 0),MIt.set(this,void 0),FFe.set(this,void 0),RFr.set(this,n=>{if(En(this,PIt,!0,"f"),i8e(n)&&(n=new kI),n instanceof kI)return En(this,DIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,NFe,new Promise((n,o)=>{En(this,RIt,n,"f"),En(this,MFe,o,"f")}),"f"),En(this,OFe,new Promise((n,o)=>{En(this,kIt,n,"f"),En(this,LFe,o,"f")}),"f"),gt(this,NFe,"f").catch(()=>{}),gt(this,OFe,"f").catch(()=>{}),En(this,Y_e,e,"f"),En(this,FFe,r?.logger??console,"f")}get response(){return gt(this,NIt,"f")}get request_id(){return gt(this,MIt,"f")}async withResponse(){En(this,jie,!0,"f");let e=await gt(this,NFe,"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 En(s,Y_e,{...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,RFr,"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,fk,"m",kFr).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,fk,"m",PFr).call(this,u);if(l.controller.signal?.aborted)throw new kI;gt(this,fk,"m",DFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,NIt,e,"f"),En(this,MIt,e?.headers.get("request-id"),"f"),gt(this,RIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,BFe,"f")}get errored(){return gt(this,PIt,"f")}get aborted(){return gt(this,DIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,Q9,"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,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,jie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,jie,!0,"f"),await gt(this,OFe,"f")}get currentMessage(){return gt(this,ZV,"f")}async finalMessage(){return await this.done(),gt(this,fk,"m",wFr).call(this)}async finalText(){return await this.done(),gt(this,fk,"m",aKi).call(this)}_emit(e,...r){if(gt(this,BFe,"f"))return;e==="end"&&(En(this,BFe,!0,"f"),gt(this,kIt,"f").call(this));let n=gt(this,Q9,"f")[e];if(n&&(gt(this,Q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,MFe,"f").call(this,o),gt(this,LFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,MFe,"f").call(this,o),gt(this,LFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,fk,"m",wFr).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,fk,"m",kFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,fk,"m",PFr).call(this,c);if(s.controller.signal?.aborted)throw new kI;gt(this,fk,"m",DFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(ZV=new WeakMap,Y_e=new WeakMap,NFe=new WeakMap,RIt=new WeakMap,MFe=new WeakMap,OFe=new WeakMap,kIt=new WeakMap,LFe=new WeakMap,Q9=new WeakMap,BFe=new WeakMap,PIt=new WeakMap,DIt=new WeakMap,jie=new WeakMap,NIt=new WeakMap,MIt=new WeakMap,FFe=new WeakMap,RFr=new WeakMap,fk=new WeakSet,wFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),aKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),kFr=a(function(){this.ended||En(this,ZV,void 0,"f")},"aG"),PFr=a(function(e){if(this.ended)return;let r=gt(this,fk,"m",cKi).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":{uKi(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(sKi(r,gt(this,Y_e,"f"),{logger:gt(this,FFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,ZV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),DFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,ZV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,ZV,void 0,"f"),sKi(e,gt(this,Y_e,"f"),{logger:gt(this,FFe,"f")})},"eG"),cKi=a(function(e){let r=gt(this,ZV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&uKi(n)){let o=n[lKi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,lKi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=$Zi(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 Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},vxt=class extends Sd{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",eoe,{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 Ri(`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)=>fxt.fromResponse(s.response,s.controller))}},c8e=class extends Sd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new vxt(this._client)}create(e,r){e.model in dKi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${dKi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),fQc.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=jZi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=qZi(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=>WZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return p8r.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},dKi={"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"},fQc=["claude-mythos-preview","claude-opus-4-6"];c8e.Batches=vxt;Cxt=class extends Sd{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",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},pQc="\\n\\nHuman:",hQc="\\n\\nAssistant:",Mp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=tu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(h8r.add(this),this._requestAuthFlags=new WeakMap,jIt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:tu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:tu("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&&h7c())throw new Ri(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`;a(pKi,"Lw");Ext=class{static{a(this,"jQ")}constructor(e,r,n){LFe.add(this),this.client=e,J_e.set(this,!1),jie.set(this,!1),q0.set(this,void 0),w1.set(this,void 0),wI.set(this,void 0),V9.set(this,void 0),tW.set(this,void 0),BFe.set(this,0),En(this,q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...KZi(r.tools,r.messages)].join(", ");En(this,w1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),En(this,tW,pKi(),"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*[(J_e=new WeakMap,jie=new WeakMap,q0=new WeakMap,w1=new WeakMap,wI=new WeakMap,V9=new WeakMap,tW=new WeakMap,BFe=new WeakMap,LFe=new WeakSet,fKi=a(async function(){let e=gt(this,q0,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,wI,"f")!==void 0)try{let u=await gt(this,wI,"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??TQc;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,q0,"f").params.max_tokens},{signal:gt(this,w1,"f").signal,headers:mr([gt(this,w1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ri("Expected text response for compaction");return gt(this,q0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,J_e,"f"))throw new Ri("Cannot iterate over a consumed stream");En(this,J_e,!0,"f"),En(this,jie,!0,"f"),En(this,V9,void 0,"f");try{for(;;){let r;try{if(gt(this,q0,"f").params.max_iterations&>(this,BFe,"f")>=gt(this,q0,"f").params.max_iterations)break;En(this,jie,!1,"f"),En(this,V9,void 0,"f"),En(this,BFe,(e=gt(this,BFe,"f"),e++,e),"f"),En(this,wI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,w1,"f")),En(this,wI,r.finalMessage(),"f"),gt(this,wI,"f").catch(()=>{}),yield r):(En(this,wI,this.client.beta.messages.create({...s,stream:!1},gt(this,w1,"f")),"f"),yield gt(this,wI,"f")),!await gt(this,LFe,"m",fKi).call(this)){if(!gt(this,jie,"f")){let{role:l,content:u}=await gt(this,wI,"f");gt(this,q0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,LFe,"m",A8r).call(this,gt(this,q0,"f").params.messages.at(-1));if(c)gt(this,q0,"f").params.messages.push(c);else if(!gt(this,jie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,wI,"f"))throw new Ri("ToolRunner concluded without a message from the server");gt(this,tW,"f").resolve(await gt(this,wI,"f"))}catch(r){throw En(this,J_e,!1,"f"),gt(this,tW,"f").promise.catch(()=>{}),gt(this,tW,"f").reject(r),En(this,tW,pKi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,q0,"f").params=e(gt(this,q0,"f").params):gt(this,q0,"f").params=e,En(this,jie,!0,"f"),En(this,V9,void 0,"f")}setRequestOptions(e){typeof e=="function"?En(this,w1,e(gt(this,w1,"f")),"f"):En(this,w1,{...gt(this,w1,"f"),...e},"f")}async generateToolResponse(e=gt(this,w1,"f").signal){let r=await gt(this,wI,"f")??this.params.messages.at(-1);return r?gt(this,LFe,"m",A8r).call(this,r,e):null}done(){return gt(this,tW,"f").promise}async runUntilDone(){if(!gt(this,J_e,"f"))for await(let e of this);return this.done()}get params(){return gt(this,q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};A8r=a(async function(t,e=gt(this,w1,"f").signal){return gt(this,V9,"f")!==void 0?gt(this,V9,"f"):(En(this,V9,xQc(gt(this,q0,"f").params,t,{...gt(this,w1,"f"),signal:e}),"f"),gt(this,V9,"f"))},"iG");a(xQc,"Fv");hKi={"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"},wQc=["claude-mythos-preview","claude-opus-4-6"],roe=class extends Id{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new Axt(this._client)}create(e,r){let n=mKi(e),{betas:o,...s}=n;s.model in hKi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${hKi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),wQc.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=ZZi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=JZi(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=>eXi(n,e,{logger:this._client.logger??console}))}stream(e,r){return g8r.createMessage(this,e,r)}countTokens(e,r){let n=mKi(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 Ext(this._client,e,r)}};a(mKi,"Aw");roe.Batches=Axt;roe.BetaToolRunner=Ext;roe.ToolError=yxt;_xt=class extends Id{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,l_,{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})}},vxt=class extends Id{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`,l_,{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])})}},gve=class extends Id{static{a(this,"G0")}constructor(){super(...arguments),this.events=new _xt(this._client),this.resources=new vxt(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",l_,{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])})}};gve.Events=_xt;gve.Resources=vxt;Cxt=class extends Id{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,Q6r({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`,l_,{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])})}},d8e=class extends Id{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new Cxt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",Q6r({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",l_,{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])})}};d8e.Versions=Cxt;bxt=class extends Id{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`,l_,{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])})}},f8e=class extends Id{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new bxt(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",l_,{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])})}};f8e.Credentials=bxt;k1=class extends Id{static{a(this,"G6")}constructor(){super(...arguments),this.models=new dxt(this._client),this.messages=new roe(this._client),this.agents=new u8e(this._client),this.environments=new lxt(this._client),this.sessions=new gve(this._client),this.vaults=new f8e(this._client),this.memoryStores=new mve(this._client),this.files=new uxt(this._client),this.skills=new d8e(this._client),this.userProfiles=new fxt(this._client)}};k1.Models=dxt;k1.Messages=roe;k1.Agents=u8e;k1.Environments=lxt;k1.Sessions=gve;k1.Vaults=f8e;k1.MemoryStores=mve;k1.Files=uxt;k1.Skills=d8e;k1.UserProfiles=fxt;Sxt=class extends Id{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(rXi,"Iw");a(gKi,"nG");a(nXi,"rG");a(RQc,"bv");EKi="__json_buf";a(_Ki,"bw");y8r=class t{static{a(this,"CQ")}constructor(e,r){hk.add(this),this.messages=[],this.receivedMessages=[],rW.set(this,void 0),Z_e.set(this,null),this.controller=new AbortController,FFe.set(this,void 0),NIt.set(this,()=>{}),UFe.set(this,()=>{}),QFe.set(this,void 0),MIt.set(this,()=>{}),qFe.set(this,()=>{}),j9.set(this,{}),jFe.set(this,!1),OIt.set(this,!1),LIt.set(this,!1),Hie.set(this,!1),BIt.set(this,void 0),FIt.set(this,void 0),HFe.set(this,void 0),MFr.set(this,n=>{if(En(this,OIt,!0,"f"),l8e(n)&&(n=new DI),n instanceof DI)return En(this,LIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,FFe,new Promise((n,o)=>{En(this,NIt,n,"f"),En(this,UFe,o,"f")}),"f"),En(this,QFe,new Promise((n,o)=>{En(this,MIt,n,"f"),En(this,qFe,o,"f")}),"f"),gt(this,FFe,"f").catch(()=>{}),gt(this,QFe,"f").catch(()=>{}),En(this,Z_e,e,"f"),En(this,HFe,r?.logger??console,"f")}get response(){return gt(this,BIt,"f")}get request_id(){return gt(this,FIt,"f")}async withResponse(){En(this,Hie,!0,"f");let e=await gt(this,FFe,"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 En(s,Z_e,{...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,MFr,"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,hk,"m",OFr).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,hk,"m",LFr).call(this,u);if(l.controller.signal?.aborted)throw new DI;gt(this,hk,"m",BFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,BIt,e,"f"),En(this,FIt,e?.headers.get("request-id"),"f"),gt(this,NIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,jFe,"f")}get errored(){return gt(this,OIt,"f")}get aborted(){return gt(this,LIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,j9,"f")[e]||(gt(this,j9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,j9,"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,j9,"f")[e]||(gt(this,j9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Hie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Hie,!0,"f"),await gt(this,QFe,"f")}get currentMessage(){return gt(this,rW,"f")}async finalMessage(){return await this.done(),gt(this,hk,"m",NFr).call(this)}async finalText(){return await this.done(),gt(this,hk,"m",AKi).call(this)}_emit(e,...r){if(gt(this,jFe,"f"))return;e==="end"&&(En(this,jFe,!0,"f"),gt(this,MIt,"f").call(this));let n=gt(this,j9,"f")[e];if(n&&(gt(this,j9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Hie,"f")&&!n?.length&&Promise.reject(o),gt(this,UFe,"f").call(this,o),gt(this,qFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Hie,"f")&&!n?.length&&Promise.reject(o),gt(this,UFe,"f").call(this,o),gt(this,qFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,hk,"m",NFr).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,hk,"m",OFr).call(this),this._connected(null);let s=eoe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,hk,"m",LFr).call(this,c);if(s.controller.signal?.aborted)throw new DI;gt(this,hk,"m",BFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(rW=new WeakMap,Z_e=new WeakMap,FFe=new WeakMap,NIt=new WeakMap,UFe=new WeakMap,QFe=new WeakMap,MIt=new WeakMap,qFe=new WeakMap,j9=new WeakMap,jFe=new WeakMap,OIt=new WeakMap,LIt=new WeakMap,Hie=new WeakMap,BIt=new WeakMap,FIt=new WeakMap,HFe=new WeakMap,MFr=new WeakMap,hk=new WeakSet,NFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),AKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("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 Ri("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),OFr=a(function(){this.ended||En(this,rW,void 0,"f")},"aG"),LFr=a(function(e){if(this.ended)return;let r=gt(this,hk,"m",yKi).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":{_Ki(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(gKi(r,gt(this,Z_e,"f"),{logger:gt(this,HFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,rW,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),BFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,rW,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,rW,void 0,"f"),gKi(e,gt(this,Z_e,"f"),{logger:gt(this,HFe,"f")})},"eG"),yKi=a(function(e){let r=gt(this,rW,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`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&&_Ki(n)){let o=n[EKi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,EKi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=tXi(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 eoe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},Txt=class extends Id{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",toe,{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 Ri(`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)=>gxt.fromResponse(s.response,s.controller))}},p8e=class extends Id{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new Txt(this._client)}create(e,r){e.model in vKi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${vKi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),kQc.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=ZZi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=JZi(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=>nXi(n,e,{logger:this._client.logger??console}))}stream(e,r){return y8r.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},vKi={"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"},kQc=["claude-mythos-preview","claude-opus-4-6"];p8e.Batches=Txt;Ixt=class extends Id{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",toe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},PQc="\\n\\nHuman:",DQc="\\n\\nAssistant:",Lp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=tu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(E8r.add(this),this._requestAuthFlags=new WeakMap,VIt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:tu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:tu("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&&D7c())throw new Ri(`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??L6r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=VYi(s.logLevel,"ClientOptions.logLevel",this)??VYi(tu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??y7c(),En(this,jIt,_7c,"f");let l=tu("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=DZi(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=>{oA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{oA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new s8r(e,r=>{oA(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 F7c(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 Ri(`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 v7c(e)}getUserAgent(){return`${this.constructor.name}/JS ${nW}`}defaultIdempotencyKey(){return`stainless-node-retry-${_Zi()}`}makeStatusError(e,r,n,o){return Jv.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,h8r,"m",zZi).call(this)&&n||this.baseURL,s=u7c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!FYi(c)||!FYi(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 Ri("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(txt)||o.append("anthropic-beta",txt),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 nxt(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(oA(this).debug(`[${d}] sending request`,Gie({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new kI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(n8r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new kI;let v=i8e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new VIt:new dve({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 E7c(g.body),oA(this).info(`${E} - ${R}`),oA(this).debug(`[${d}] response error (${R})`,Gie({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";oA(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>n8r(R).message),T=vZi(b),w=T?void 0:b;throw oA(this).debug(`[${d}] response error (${v})`,Gie({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 oA(this).info(E),oA(this).debug(`[${d}] response start`,Gie({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 c8r(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 p7c(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 Ri("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&&f7c("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))}:{},...k6r(),...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:bZi(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,jIt,"f").call(this,{body:e,headers:n})}};L6r=Mp,jIt=new WeakMap,h8r=new WeakSet,zZi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Mp.Anthropic=L6r;Mp.HUMAN_PROMPT=pQc;Mp.AI_PROMPT=hQc;Mp.DEFAULT_TIMEOUT=6e5;Mp.AnthropicError=Ri;Mp.APIError=Jv;Mp.APIConnectionError=dve;Mp.APIConnectionTimeoutError=VIt;Mp.APIUserAbortError=kI;Mp.NotFoundError=KIt;Mp.ConflictError=JIt;Mp.RateLimitError=XIt;Mp.BadRequestError=WIt;Mp.AuthenticationError=zIt;Mp.InternalServerError=ext;Mp.PermissionDeniedError=YIt;Mp.UnprocessableEntityError=ZIt;Mp.toFile=Z7c;hve=class extends Mp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new _xt(this),this.messages=new c8e(this),this.models=new Cxt(this),this.beta=new k1(this)}};hve.Completions=_xt;hve.Messages=c8e;hve.Models=Cxt;hve.Beta=k1;a(M8e,"j4");a(HIt,"N8");a(PI,"o$");a(O8e,"D1");a(YZi,"JU");a(mQc,"Tw");gQc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),AQc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(yQc,"xw");g8r=class{static{a(this,"gw")}read(e){return(0,sA.readFile)(e,"utf8")}readBytes(e){return(0,sA.readFile)(e)}write(e,r,n){return(0,sA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,sA.mkdir)(e,{recursive:!0})}catch(r){if(PI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return yQc(e,r,n)}delete(e){return(0,sA.unlink)(e)}list(e){return(0,sA.readdir)(e)}append(e,r,n){return(0,sA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,sA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,sA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,sA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,sA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},EQc=new JZi.AsyncLocalStorage;a(bxt,"w8");K_e=null;a(XZi,"uw");a(_Qc,"mw");a(pk,"L6");a(vQc,"dv");CQc=vQc;a(bQc,"iv");SQc=bQc;a(TQc,"nv");IQc=TQc;a(xQc,"rv");wQc=xQc,RQc=200;a(kQc,"tv");PQc=kQc;a(Uve,"D8");Uve.prototype.clear=CQc;Uve.prototype.delete=SQc;Uve.prototype.get=IQc;Uve.prototype.has=wQc;Uve.prototype.set=PQc;DQc=Uve,NQc=(function(){try{var t=x6r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Sxt=NQc;a(MQc,"sv");B6r=MQc,OQc=Object.prototype,LQc=OQc.hasOwnProperty;a(BQc,"QC");eXi=BQc;a(FQc,"JC");UQc=FQc;a(QQc,"XC");qQc=QQc;a(jQc,"YC");Qve=jQc,HQc="[object Arguments]";a(GQc,"GC");fKi=GQc,tXi=Object.prototype,$Qc=tXi.hasOwnProperty,VQc=tXi.propertyIsEnumerable,WQc=fKi((function(){return arguments})())?fKi:function(t){return Qve(t)&&$Qc.call(t,"callee")&&!VQc.call(t,"callee")},l8e=WQc,zQc=Array.isArray,lW=zQc,VFe={};WL(VFe,{default:a(()=>F6r,"default")});a(YQc,"VC");KQc=YQc,rXi=typeof VFe=="object"&&VFe&&!VFe.nodeType&&VFe,pKi=rXi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,JQc=pKi&&pKi.exports===rXi,hKi=JQc?Mve.Buffer:void 0,ZQc=hKi?hKi.isBuffer:void 0,XQc=ZQc||KQc,F6r=XQc,eqc=9007199254740991,tqc=/^(?:0|[1-9]\d*)$/;a(rqc,"DC");bwt=rqc,nqc=9007199254740991;a(iqc,"ZC");U6r=iqc,oqc="[object Arguments]",sqc="[object Array]",aqc="[object Boolean]",cqc="[object Date]",lqc="[object Error]",uqc="[object Function]",dqc="[object Map]",fqc="[object Number]",pqc="[object Object]",hqc="[object RegExp]",mqc="[object Set]",gqc="[object String]",Aqc="[object WeakMap]",yqc="[object ArrayBuffer]",Eqc="[object DataView]",_qc="[object Float32Array]",vqc="[object Float64Array]",Cqc="[object Int8Array]",bqc="[object Int16Array]",Sqc="[object Int32Array]",Tqc="[object Uint8Array]",Iqc="[object Uint8ClampedArray]",xqc="[object Uint16Array]",wqc="[object Uint32Array]",Cd={};Cd[_qc]=Cd[vqc]=Cd[Cqc]=Cd[bqc]=Cd[Sqc]=Cd[Tqc]=Cd[Iqc]=Cd[xqc]=Cd[wqc]=!0;Cd[oqc]=Cd[sqc]=Cd[yqc]=Cd[aqc]=Cd[Eqc]=Cd[cqc]=Cd[lqc]=Cd[uqc]=Cd[dqc]=Cd[fqc]=Cd[pqc]=Cd[hqc]=Cd[mqc]=Cd[gqc]=Cd[Aqc]=!1;a(Rqc,"pC");kqc=Rqc;a(Pqc,"dC");Dqc=Pqc,WFe={};WL(WFe,{default:a(()=>A8r,"default")});nXi=typeof WFe=="object"&&WFe&&!WFe.nodeType&&WFe,e8e=nXi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,Nqc=e8e&&e8e.exports===nXi,NFr=Nqc&&mZi.process,Mqc=(function(){try{var t=e8e&&e8e.require&&e8e.require("util").types;return t||NFr&&NFr.binding&&NFr.binding("util")}catch{}})(),A8r=Mqc,mKi=A8r&&A8r.isTypedArray,Oqc=mKi?Dqc(mKi):kqc,iXi=Oqc,Lqc=Object.prototype,Bqc=Lqc.hasOwnProperty;a(Fqc,"aC");Uqc=Fqc,Qqc=Object.prototype;a(qqc,"eC");oXi=qqc;a(jqc,"$T");Hqc=jqc;a(Gqc,"QT");Q6r=Gqc;a($qc,"JT");Vqc=$qc,Wqc=Object.prototype,zqc=Wqc.hasOwnProperty;a(Yqc,"WT");Kqc=Yqc;a(Jqc,"GT");sXi=Jqc,zFe={};WL(zFe,{default:a(()=>cXi,"default")});aXi=typeof zFe=="object"&&zFe&&!zFe.nodeType&&zFe,gKi=aXi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,Zqc=gKi&&gKi.exports===aXi,AKi=Zqc?Mve.Buffer:void 0,yKi=AKi?AKi.allocUnsafe:void 0;a(Xqc,"HT");cXi=Xqc;a(ejc,"KT");tjc=ejc;a(rjc,"qT");njc=rjc,ijc=Hqc(Object.getPrototypeOf,Object),lXi=ijc,ojc=Mve.Uint8Array,EKi=ojc;a(sjc,"zT");ajc=sjc;a(cjc,"NT");ljc=cjc,_Ki=Object.create,ujc=(function(){function t(){}return a(t,"$"),function(e){if(!z9(e))return{};if(_Ki)return _Ki(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),djc=ujc;a(fjc,"OT");pjc=fjc,hjc="[object Symbol]";a(mjc,"FT");q6r=mjc,gjc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ajc=/^\w*$/;a(yjc,"LT");Ejc=yjc,_jc=500;a(vjc,"AT");Cjc=vjc,bjc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sjc=/\\(\\)?/g,Tjc=Cjc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(bjc,function(r,n,o,s){e.push(o?s.replace(Sjc,"$1"):n||r)}),e}),Ijc=Tjc;a(xjc,"ET");wjc=xjc,Rjc=1/0,vKi=cW?cW.prototype:void 0,CKi=vKi?vKi.toString:void 0;a(uXi,"PO");kjc=uXi;a(Pjc,"_T");Djc=Pjc;a(Njc,"kT");Swt=Njc,Mjc=1/0;a(Ojc,"vT");j6r=Ojc;a(Ljc,"CT");Bjc=Ljc;a(Fjc,"TT");Ujc=Fjc;a(Qjc,"xT");qjc=Qjc;a(jjc,"yT");Hjc=jjc;a(Gjc,"fT");dXi=Gjc,H6r=null;a($jc,"CO");a(Vjc,"TO");Ixt=new Map;a(Wjc,"xO");a(zjc,"yO");G6r=new Map;a(Kjc,"fO");a(Jjc,"gO");a($6r,"V0");a(Xjc,"hO");a(eHc,"uO");tHc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(rHc,"lT");nHc=rHc(),iHc=a(()=>{},"pT");a(pXi,"VU");oHc=D8e(),yKh=oHc.subscribe,sHc=D8e(),EKh=sHc.subscribe,aHc=D8e(),_Kh=aHc.subscribe,cHc=D8e(),vKh=cHc.subscribe,lHc=D8e(),CKh=lHc.subscribe;a(uHc,"lO");a(dHc,"tT");E8r=class{static{a(this,"cO")}#e=new Set;register(e){let r=dHc(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}},fHc=new E8r;a(pHc,"pO");hHc=Py(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(mHc,"sT");a(gHc,"eT");a(AHc,"iO");a(yHc,"tO");a(EHc,"Qx");a(bKi,"oO");a(_Hc,"aO");a(mXi,"HX");vHc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=ef(e,rf`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},async stat(t){return(0,G0.stat)(t)},async readdir(t){return(0,G0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,G0.unlink)(t)},async rmdir(t){return(0,G0.rmdir)(t)},async rm(t,e){return(0,G0.rm)(t,e)},async mkdir(t,e){try{await(0,G0.mkdir)(t,{recursive:!0,...e})}catch(r){if(PI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,G0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,G0.rename)(t,e)},statSync(t){let e=[];try{let o=ef(e,rf`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},lstatSync(t){let e=[];try{let o=ef(e,rf`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=ef(e,rf`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readSync(t,e){let r=[];try{let s=ef(r,rf`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{tf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=ef(n,rf`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{tf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},unlinkSync(t){let e=[];try{let o=ef(e,rf`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},renameSync(t,e){let r=[];try{let s=ef(r,rf`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},linkSync(t,e){let r=[];try{let s=ef(r,rf`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},readlinkSync(t){let e=[];try{let o=ef(e,rf`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},realpathSync(t){let e=[];try{let o=ef(e,rf`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{tf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=ef(r,rf`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{tf(r,n,o)}},readdirSync(t){let e=[];try{let o=ef(e,rf`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=ef(e,rf`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=ef(e,rf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmdirSync(t){let e=[];try{let o=ef(e,rf`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmSync(t,e){let r=[];try{let s=ef(r,rf`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,G0.readFile)(t);let r=await(0,G0.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(${RHc}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"}],IKi=null;a(PHc,"Ox");a(DHc,"W2");_8r={verbose:0,debug:1,info:2,warn:3,error:4},NHc=Py(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(_8r,t)?t:"debug"}),MHc=!1;a(Twt,"qX");v8r=Py(()=>{let t=Twt();return MHc||s_(process.env.DEBUG)||s_(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||gXi()||t.some(e=>e.startsWith("--debug="))||AXi()!==null}),OHc=Py(()=>{let t=Twt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return hHc(e)}),gXi=Py(()=>{let t=Twt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),AXi=Py(()=>{let t=Twt();for(let e=0;e{try{let t=_Xi(),e=(0,soe.dirname)(t),r=(0,soe.join)(e,"latest");await(0,l_.unlink)(r).catch(()=>{}),await(0,l_.symlink)(t,r)}catch{}}),TKh=(()=>{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})(),qHc={[Symbol.dispose](){}};a(jHc,"_x");rf=jHc;a(Qm,"B$");GN=a((t,e)=>{let r=[];try{let s=ef(r,rf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},"d$");a(HHc,"w2");a(uW,"A4");a(GHc,"kx");a($Hc,"O2");VHc=2e3,xxt=new Set,xKi=!1;a(WHc,"xx");a(zHc,"yx");S8r=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=t8r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||t8r(),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(M8e(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 hZi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,uZi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();pk(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:L,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:O}=this.options,{allowedTools:j=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(j);j=[...j,...H.filter(le=>!re.has(le))]}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",Qm(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=_Qc();H&&Q.push("--debug-file",H)}if(B){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),j.length>0&&Q.push("--allowedTools",j.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",Qm({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),L&&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"),q&&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 Y=$Hc(U,O);for(let[H,re]of Object.entries(Y))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,s_(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=YHc(u),V=W?u:s,z=W?[...c,...Q]:[...c,u,...Q],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(pk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(pk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,zHc(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 R1("Claude Code process aborted by user");else if(mQc(H)){let re=KHc(u,W);this.exitError=ReferenceError(re),pk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),pk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new R1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,pk(le.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 R1("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){pk("[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}`);pk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||pk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${HIt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new R1("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()},VHc,r,e).unref(),r.once("exit",()=>xxt.delete(r))):r&&(xxt.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,fZi.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=GN(n)}catch{pk(`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 R1("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(YHc,"fx");a(KHc,"gx");J_e="@anthropic-ai/claude-agent-sdk";a(JHc,"ux");a(ZHc,"F2");wxt=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(XHc,"mx");eGc=XHc();a(V6r,"BX");a(bXi,"AU");a(SXi,"IU");a(tGc,"Z2");a(q9,"I4");T8r=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?.())}},I8r=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new wxt;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,Txt.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&&(ru("[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 R1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);ru(`[Query.readMessages] Replacing exit error with result text. Original: ${HIt(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(Qm(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:HIt(n)}};try{await Promise.resolve(this.transport.write(Qm(o)+` -`))}catch(s){ru(`[Query.handleControlRequest] Error-response write failed: ${HIt(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 q9("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 q9("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 q9("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 q9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return q9("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(Qm(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 q9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return q9("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 q9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return q9("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){ru("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,ru(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(Qm(n)+` -`))}ru(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(ru("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),ru("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof R1))throw r}}waitForFirstResult(){return this.firstResultReceived?(ru("[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 T8r(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),ru(`[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,Txt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(Qm(n)+` -`)).catch(o=>{ru(`[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}})}},W6r=500,z6r=1048576,rGc=[200,800],x8r=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=W6r,s=z6r,c=rGc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=Qm(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 Vie(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=M8e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await lZi(f)}if(l){ru(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){ru(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},wKi=A6r(S6c(),1);a(nGc,"Ug");a(t8e,"O0");a(iGc,"qg");LFr=new Map,oGc=5e3;a(sGc,"Bg");a(aGc,"zg");a(cGc,"OZ");lGc=(0,wXi.promisify)(xXi.execFile);a(L8e,"m4");a(uGc,"jH");$9=65536,dGc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(bh,"L$");a(PXi,"ZZ");a(BFr,"IX");a(hk,"A6");a(R8r,"rQ");a(DXi,"RX");a(fGc,"MZ");a(NXi,"PX");u8e=200;a(pGc,"Lg");a(B8e,"F0");a(hW,"U4");a(hGc,"jg");a(F8e,"M1");a(BN,"j6");a(Iwt,"L1");mGc=1048576,gGc=5242880;a(yGc,"Rg");a(MXi,"jZ");a(Yie,"D0");a(Rxt,"jX");kxt=Buffer.from('{"type":"attribution-snapshot"'),EGc=Buffer.from('{"type":"system"'),d8e=10,_Gc=Buffer.from([d8e]),vGc=256;a(CGc,"_g");a(bGc,"kg");a(SGc,"Sg");a(TGc,"vg");a(IGc,"Cg");a(xGc,"AZ");a(wGc,"xg");a(RGc,"yg");a(kGc,"fg");a(FFr,"IH");a(PGc,"gg");a(DGc,"hg");a(NGc,"ug");a(OXi,"RH");a(LXi,"PH");a(MGc,"IZ");a(BXi,"RZ");a(OGc,"PZ");a(xwt,"k8");a(YFe,"oQ");a(FXi,"EZ");LGc=32;a(BGc,"pg");a(FGc,"dg");a(UGc,"ig");a(QGc,"ng");a(qGc,"rg");a(jGc,"bZ");a(HGc,"_Z");a(GGc,"CZ");a($Gc,"TZ");a(VGc,"xZ");a(WGc,"ag");a(UXi,"yZ");a(UFr,"_H");a(zGc,"sg");YGc=new Set(["user","assistant","attachment","system","progress"]);a(KGc,"$h");a(JGc,"Qh");a(QXi,"fZ");a(ZGc,"gZ");a(XGc,"Jh");a(e$c,"hZ");a(t$c,"Xh");a(qXi,"uZ");a(jXi,"lZ");a(HXi,"cZ");a(r$c,"Wh");a(n$c,"Gh");a(i$c,"pZ");a(o$c,"dZ");a(GXi,"vH");a(WXi,"CH");a(zXi,"bX");a(s$c,"Uh");a$c="user:inference",YXi="user:profile",c$c="org:create_api_key",l$c=[c$c,YXi],u$c=[YXi,a$c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],xKh=zXi([...l$c,...u$c]),RKi={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}"},d$c=void 0;a(f$c,"zh");p$c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(h$c,"rZ");m$c="-credentials";a(g$c,"tZ");A$c=/^[a-zA-Z0-9._-]+$/;a(y$c,"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})(hc||(hc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(kKi||(kKi={}));kn=hc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tW=a(t=>{switch(typeof t){case"undefined":return kn.undefined;case"string":return kn.string;case"number":return Number.isNaN(t)?kn.nan:kn.number;case"boolean":return kn.boolean;case"function":return kn.function;case"bigint":return kn.bigint;case"symbol":return kn.symbol;case"object":return Array.isArray(t)?kn.array:t===null?kn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?kn.promise:typeof Map<"u"&&t instanceof Map?kn.map:typeof Set<"u"&&t instanceof Set?kn.set:typeof Date<"u"&&t instanceof Date?kn.date:kn.object;default:return kn.unknown}},"l4"),hr=hc.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"]),yk=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()}};yk.create=t=>new yk(t);E$c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===kn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,hc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${hc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${hc.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}"`:hc.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,hc.assertNever(t)}return{message:r}},"Fh"),p8e=E$c,_$c=p8e;a(P8r,"tQ");D8r=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");Zv=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"}),JFe=a(t=>({status:"dirty",value:t}),"v8"),P1=a(t=>({status:"valid",value:t}),"z6"),PKi=a(t=>t.status==="aborted","TH"),DKi=a(t=>t.status==="dirty","xH"),gve=a(t=>t.status==="valid","Z0"),Nxt=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})(Zn||(Zn={}));_k=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}},NKi=a((t,e)=>{if(gve(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 yk(t.common.issues);return this._error=r,this._error}}},"eZ");a(Zo,"e");Ms=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return tW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:tW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zv,ctx:{common:e.parent.common,data:e.data,parsedType:tW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Nxt(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:tW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return NKi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return gve(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=>gve(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:tW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Nxt(o)?o:Promise.resolve(o));return NKi(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 QN({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 Ek.create(this,this._def)}nullable(){return K9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dW.create(this)}promise(){return roe.create(this,this._def)}or(e){return _ve.create([this,e],this._def)}and(e){return vve.create(this,e,this._def)}transform(e){return new QN({...Zo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ive({...Zo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Mxt({typeName:Cr.ZodBranded,type:this,...Zo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new xve({...Zo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Oxt.create(this,e)}readonly(){return wve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},v$c=/^c[^\s-]{8,}$/i,C$c=/^[0-9a-z]+$/,b$c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,S$c=/^[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,T$c=/^[a-z0-9_-]{21}$/i,I$c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,x$c=/^[-+]?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)?)??$/,w$c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k$c=/^(?:(?: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])$/,P$c=/^(?:(?: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])$/,D$c=/^(([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]))$/,N$c=/^(([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])$/,M$c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O$c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,KXi="((\\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])))",L$c=new RegExp(`^${KXi}$`);a(JXi,"QM");a(B$c,"yh");a(F$c,"fh");a(U$c,"gh");a(Q$c,"hh");a(q$c,"uh");Ave=class t extends Ms{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kn.string){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.string,received:o.parsedType}),eo}let r=new Zv,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(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,...Zn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Zn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Zn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Zn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Zn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Zn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Zn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Zn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Zn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Zn.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,...Zn.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,...Zn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Zn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Zn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Zn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Zn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Zn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Zn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Zn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Zn.errToObj(r)})}nonempty(e){return this.min(1,Zn.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 Ave({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Zo(t)});a(j$c,"mh");h8e=class t extends Ms{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)!==kn.number){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.number,received:o.parsedType}),eo}let r,n=new Zv;for(let o of this._def.checks)o.kind==="int"?hc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(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),ln(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?j$c(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(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),ln(r,{code:hr.not_finite,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Zn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Zn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Zn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Zn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Zn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Zn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Zn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zn.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"&&hc.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 h8e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Zo(t)});m8e=class t extends Ms{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)!==kn.bigint)return this._getInvalidInput(e);let r,n=new Zv;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: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),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.bigint,received:r.parsedType}),eo}gte(e,r){return this.setLimit("min",e,!0,Zn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Zn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Zn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Zn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Zn.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:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Zn.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 m8e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Zo(t)});g8e=class extends Ms{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kn.boolean){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.boolean,received:r.parsedType}),eo}return P1(e.data)}};g8e.create=t=>new g8e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Zo(t)});A8e=class t extends Ms{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kn.date){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_date}),eo}let r=new Zv,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):hc.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:Zn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Zn.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 A8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Zo(t)});y8e=class extends Ms{static{a(this,"SX")}_parse(e){if(this._getType(e)!==kn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.symbol,received:r.parsedType}),eo}return P1(e.data)}};y8e.create=t=>new y8e({typeName:Cr.ZodSymbol,...Zo(t)});yve=class extends Ms{static{a(this,"$7")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.undefined,received:r.parsedType}),eo}return P1(e.data)}};yve.create=t=>new yve({typeName:Cr.ZodUndefined,...Zo(t)});Eve=class extends Ms{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==kn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.null,received:r.parsedType}),eo}return P1(e.data)}};Eve.create=t=>new Eve({typeName:Cr.ZodNull,...Zo(t)});E8e=class extends Ms{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return P1(e.data)}};E8e.create=t=>new E8e({typeName:Cr.ZodAny,...Zo(t)});aW=class extends Ms{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return P1(e.data)}};aW.create=t=>new aW({typeName:Cr.ZodUnknown,...Zo(t)});$L=class extends Ms{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.never,received:r.parsedType}),eo}};$L.create=t=>new $L({typeName:Cr.ZodNever,...Zo(t)});_8e=class extends Ms{static{a(this,"CX")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.void,received:r.parsedType}),eo}return P1(e.data)}};_8e.create=t=>new _8e({typeName:Cr.ZodVoid,...Zo(t)});dW=class t extends Ms{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==kn.array)return ln(r,{code:hr.invalid_type,expected:kn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(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 _k(r,c,r.path,l)))).then(c=>Zv.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new _k(r,c,r.path,l)));return Zv.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Zn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Zn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Zn.toString(r)}})}nonempty(e){return this.min(1,e)}};dW.create=(t,e)=>new dW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Zo(e)});a(tve,"C8");NI=class t extends Ms{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=hc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==kn.object){let u=this._getOrReturnCtx(e);return ln(u,{code:hr.invalid_type,expected:kn.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 $L&&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 _k(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof $L){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: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 _k(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=>Zv.mergeObjectSync(r,u)):Zv.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Zn.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:Zn.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 hc.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 hc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return tve(this)}partial(e){let r={};for(let n of hc.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 hc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Ek;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return ZXi(hc.objectKeys(this.shape))}};NI.create=(t,e)=>new NI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});NI.strictCreate=(t,e)=>new NI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});NI.lazycreate=(t,e)=>new NI({shape:t,unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});_ve=class extends Ms{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 yk(l.ctx.common.issues));return ln(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 yk(u));return ln(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};_ve.create=(t,e)=>new _ve({options:t,typeName:Cr.ZodUnion,...Zo(e)});j9=a(t=>t instanceof Cve?j9(t.schema):t instanceof QN?j9(t.innerType()):t instanceof bve?[t.value]:t instanceof Sve?t.options:t instanceof Tve?hc.objectValues(t.enum):t instanceof Ive?j9(t._def.innerType):t instanceof yve?[void 0]:t instanceof Eve?[null]:t instanceof Ek?[void 0,...j9(t.unwrap())]:t instanceof K9?[null,...j9(t.unwrap())]:t instanceof Mxt||t instanceof wve?j9(t.unwrap()):t instanceof xve?j9(t._def.innerType):[],"c4"),N8r=class t extends Ms{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.object)return ln(r,{code:hr.invalid_type,expected:kn.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}):(ln(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=j9(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,...Zo(n)})}};a(M8r,"fH");vve=class extends Ms{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(PKi(s)||PKi(c))return eo;let l=M8r(s.value,c.value);return l.valid?((DKi(s)||DKi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(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}))}};vve.create=(t,e,r)=>new vve({left:t,right:e,typeName:Cr.ZodIntersection,...Zo(r)});Y9=class t extends Ms{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.array)return ln(n,{code:hr.invalid_type,expected:kn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(ln(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 _k(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Zv.mergeArray(r,s)):Zv.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Y9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y9({items:t,typeName:Cr.ZodTuple,rest:null,...Zo(e)})};O8r=class t extends Ms{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!==kn.object)return ln(n,{code:hr.invalid_type,expected:kn.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 _k(n,l,n.path,l)),value:c._parse(new _k(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Zv.mergeObjectAsync(r,o):Zv.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ms?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Zo(n)}):new t({keyType:Ave.create(),valueType:e,typeName:Cr.ZodRecord,...Zo(r)})}},v8e=class extends Ms{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!==kn.map)return ln(n,{code:hr.invalid_type,expected:kn.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 _k(n,l,n.path,[d,"key"])),value:s._parse(new _k(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}}}};v8e.create=(t,e,r)=>new v8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Zo(r)});C8e=class t extends Ms{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.set)return ln(n,{code:hr.invalid_type,expected:kn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(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 _k(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:Zn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Zn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};C8e.create=(t,e)=>new C8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Zo(e)});L8r=class t extends Ms{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.function)return ln(r,{code:hr.invalid_type,expected:kn.function,received:r.parsedType}),eo;function n(l,u){return D8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,P8r(),p8e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return D8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,P8r(),p8e].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 roe){let l=this;return P1(async function(...u){let d=new yk([]),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 P1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new yk([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new yk([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:Y9.create(e).rest(aW.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||Y9.create([]).rest(aW.create()),returns:r||aW.create(),typeName:Cr.ZodFunction,...Zo(n)})}},Cve=class extends Ms{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})}};Cve.create=(t,e)=>new Cve({getter:t,typeName:Cr.ZodLazy,...Zo(e)});bve=class extends Ms{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(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}};bve.create=(t,e)=>new bve({value:t,typeName:Cr.ZodLiteral,...Zo(e)});a(ZXi,"JM");Sve=class t extends Ms{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:hc.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 ln(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return P1(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})}};Sve.create=ZXi;Tve=class extends Ms{static{a(this,"G7")}_parse(e){let r=hc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kn.string&&n.parsedType!==kn.number){let o=hc.objectValues(r);return ln(n,{expected:hc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(hc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=hc.objectValues(r);return ln(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return P1(e.data)}get enum(){return this._def.values}};Tve.create=(t,e)=>new Tve({values:t,typeName:Cr.ZodNativeEnum,...Zo(e)});roe=class extends Ms{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.promise&&r.common.async===!1)return ln(r,{code:hr.invalid_type,expected:kn.promise,received:r.parsedType}),eo;let n=r.parsedType===kn.promise?r.data:Promise.resolve(r.data);return P1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};roe.create=(t,e)=>new roe({type:t,typeName:Cr.ZodPromise,...Zo(e)});QN=class extends Ms{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=>{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 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"?JFe(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"?JFe(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(!gve(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=>gve(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);hc.assertNever(o)}};QN.create=(t,e,r)=>new QN({schema:t,typeName:Cr.ZodEffects,effect:e,...Zo(r)});QN.createWithPreprocess=(t,e,r)=>new QN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Zo(r)});Ek=class extends Ms{static{a(this,"o6")}_parse(e){return this._getType(e)===kn.undefined?P1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ek.create=(t,e)=>new Ek({innerType:t,typeName:Cr.ZodOptional,...Zo(e)});K9=class extends Ms{static{a(this,"A1")}_parse(e){return this._getType(e)===kn.null?P1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};K9.create=(t,e)=>new K9({innerType:t,typeName:Cr.ZodNullable,...Zo(e)});Ive=class extends Ms{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ive.create=(t,e)=>new Ive({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zo(e)});xve=class extends Ms{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 Nxt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yk(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new yk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xve.create=(t,e)=>new xve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zo(e)});b8e=class extends Ms{static{a(this,"yX")}_parse(e){if(this._getType(e)!==kn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};b8e.create=t=>new b8e({typeName:Cr.ZodNaN,...Zo(t)});Mxt=class extends Ms{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}},Oxt=class t extends Ms{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(),JFe(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})}},wve=class extends Ms{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(gve(o)&&(o.value=Object.freeze(o.value)),o),"J");return Nxt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};wve.create=(t,e)=>new wve({innerType:t,typeName:Cr.ZodReadonly,...Zo(e)});wKh={object:NI.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={}));RKh=Ave.create,kKh=h8e.create,PKh=b8e.create,DKh=m8e.create,NKh=g8e.create,MKh=A8e.create,OKh=y8e.create,LKh=yve.create,BKh=Eve.create,FKh=E8e.create,UKh=aW.create,QKh=$L.create,qKh=_8e.create,jKh=dW.create,H$c=NI.create,HKh=NI.strictCreate,GKh=_ve.create,$Kh=N8r.create,VKh=vve.create,WKh=Y9.create,zKh=O8r.create,YKh=v8e.create,KKh=C8e.create,JKh=L8r.create,ZKh=Cve.create,XKh=bve.create,eJh=Sve.create,tJh=Tve.create,rJh=roe.create,nJh=QN.create,iJh=Ek.create,oJh=K9.create,sJh=QN.createWithPreprocess,aJh=Oxt.create,XXi={};WL(XXi,{version:a(()=>uto,"version"),util:a(()=>Ws,"util"),treeifyError:a(()=>deo,"treeifyError"),toJSONSchema:a(()=>eUr,"toJSONSchema"),toDotPath:a(()=>feo,"toDotPath"),safeParseAsync:a(()=>Nwt,"safeParseAsync"),safeParse:a(()=>Dwt,"safeParse"),registry:a(()=>E9r,"registry"),regexes:a(()=>o9r,"regexes"),prettifyError:a(()=>peo,"prettifyError"),parseAsync:a(()=>Uxt,"parseAsync"),parse:a(()=>Fxt,"parse"),locales:a(()=>y9r,"locales"),isValidJWT:a(()=>Mto,"isValidJWT"),isValidBase64URL:a(()=>Pto,"isValidBase64URL"),isValidBase64:a(()=>l9r,"isValidBase64"),globalRegistry:a(()=>V9,"globalRegistry"),globalConfig:a(()=>Lxt,"globalConfig"),function:a(()=>rno,"function"),formatError:a(()=>e9r,"formatError"),flattenError:a(()=>X6r,"flattenError"),config:a(()=>Xv,"config"),clone:a(()=>$N,"clone"),_xid:a(()=>P9r,"_xid"),_void:a(()=>qro,"_void"),_uuidv7:a(()=>S9r,"_uuidv7"),_uuidv6:a(()=>b9r,"_uuidv6"),_uuidv4:a(()=>C9r,"_uuidv4"),_uuid:a(()=>v9r,"_uuid"),_url:a(()=>T9r,"_url"),_uppercase:a(()=>G9r,"_uppercase"),_unknown:a(()=>Hxt,"_unknown"),_union:a(()=>GWc,"_union"),_undefined:a(()=>Bro,"_undefined"),_ulid:a(()=>k9r,"_ulid"),_uint64:a(()=>Oro,"_uint64"),_uint32:a(()=>Rro,"_uint32"),_tuple:a(()=>Kro,"_tuple"),_trim:a(()=>K9r,"_trim"),_transform:a(()=>XWc,"_transform"),_toUpperCase:a(()=>Z9r,"_toUpperCase"),_toLowerCase:a(()=>J9r,"_toLowerCase"),_templateLiteral:a(()=>czc,"_templateLiteral"),_symbol:a(()=>Lro,"_symbol"),_success:a(()=>izc,"_success"),_stringbool:a(()=>eno,"_stringbool"),_stringFormat:a(()=>tno,"_stringFormat"),_string:a(()=>gro,"_string"),_startsWith:a(()=>V9r,"_startsWith"),_size:a(()=>q9r,"_size"),_set:a(()=>YWc,"_set"),_safeParseAsync:a(()=>i9r,"_safeParseAsync"),_safeParse:a(()=>n9r,"_safeParse"),_regex:a(()=>j9r,"_regex"),_refine:a(()=>Xro,"_refine"),_record:a(()=>WWc,"_record"),_readonly:a(()=>azc,"_readonly"),_property:a(()=>Yro,"_property"),_promise:a(()=>uzc,"_promise"),_positive:a(()=>$ro,"_positive"),_pipe:a(()=>szc,"_pipe"),_parseAsync:a(()=>r9r,"_parseAsync"),_parse:a(()=>t9r,"_parse"),_overwrite:a(()=>loe,"_overwrite"),_optional:a(()=>ezc,"_optional"),_number:a(()=>bro,"_number"),_nullable:a(()=>tzc,"_nullable"),_null:a(()=>Fro,"_null"),_normalize:a(()=>Y9r,"_normalize"),_nonpositive:a(()=>Wro,"_nonpositive"),_nonoptional:a(()=>nzc,"_nonoptional"),_nonnegative:a(()=>zro,"_nonnegative"),_never:a(()=>Qro,"_never"),_negative:a(()=>Vro,"_negative"),_nativeEnum:a(()=>JWc,"_nativeEnum"),_nanoid:a(()=>x9r,"_nanoid"),_nan:a(()=>Gro,"_nan"),_multipleOf:a(()=>x8e,"_multipleOf"),_minSize:a(()=>w8e,"_minSize"),_minLength:a(()=>kve,"_minLength"),_min:a(()=>RI,"_min"),_mime:a(()=>z9r,"_mime"),_maxSize:a(()=>Owt,"_maxSize"),_maxLength:a(()=>Lwt,"_maxLength"),_max:a(()=>FN,"_max"),_map:a(()=>zWc,"_map"),_lte:a(()=>FN,"_lte"),_lt:a(()=>noe,"_lt"),_lowercase:a(()=>H9r,"_lowercase"),_literal:a(()=>ZWc,"_literal"),_length:a(()=>Bwt,"_length"),_lazy:a(()=>lzc,"_lazy"),_ksuid:a(()=>D9r,"_ksuid"),_jwt:a(()=>Q9r,"_jwt"),_isoTime:a(()=>vro,"_isoTime"),_isoDuration:a(()=>Cro,"_isoDuration"),_isoDateTime:a(()=>Ero,"_isoDateTime"),_isoDate:a(()=>_ro,"_isoDate"),_ipv6:a(()=>M9r,"_ipv6"),_ipv4:a(()=>N9r,"_ipv4"),_intersection:a(()=>VWc,"_intersection"),_int64:a(()=>Mro,"_int64"),_int32:a(()=>wro,"_int32"),_int:a(()=>Tro,"_int"),_includes:a(()=>$9r,"_includes"),_guid:a(()=>jxt,"_guid"),_gte:a(()=>RI,"_gte"),_gt:a(()=>ioe,"_gt"),_float64:a(()=>xro,"_float64"),_float32:a(()=>Iro,"_float32"),_file:a(()=>Jro,"_file"),_enum:a(()=>KWc,"_enum"),_endsWith:a(()=>W9r,"_endsWith"),_emoji:a(()=>I9r,"_emoji"),_email:a(()=>_9r,"_email"),_e164:a(()=>U9r,"_e164"),_discriminatedUnion:a(()=>$Wc,"_discriminatedUnion"),_default:a(()=>rzc,"_default"),_date:a(()=>jro,"_date"),_custom:a(()=>Zro,"_custom"),_cuid2:a(()=>R9r,"_cuid2"),_cuid:a(()=>w9r,"_cuid"),_coercedString:a(()=>Aro,"_coercedString"),_coercedNumber:a(()=>Sro,"_coercedNumber"),_coercedDate:a(()=>Hro,"_coercedDate"),_coercedBoolean:a(()=>Pro,"_coercedBoolean"),_coercedBigint:a(()=>Nro,"_coercedBigint"),_cidrv6:a(()=>L9r,"_cidrv6"),_cidrv4:a(()=>O9r,"_cidrv4"),_catch:a(()=>ozc,"_catch"),_boolean:a(()=>kro,"_boolean"),_bigint:a(()=>Dro,"_bigint"),_base64url:a(()=>F9r,"_base64url"),_base64:a(()=>B9r,"_base64"),_array:a(()=>X9r,"_array"),_any:a(()=>Uro,"_any"),TimePrecision:a(()=>yro,"TimePrecision"),NEVER:a(()=>eeo,"NEVER"),JSONSchemaGenerator:a(()=>R8e,"JSONSchemaGenerator"),JSONSchema:a(()=>dzc,"JSONSchema"),Doc:a(()=>Qxt,"Doc"),$output:a(()=>hro,"$output"),$input:a(()=>mro,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>teo,"$brand"),$ZodXID:a(()=>_to,"$ZodXID"),$ZodVoid:a(()=>Gto,"$ZodVoid"),$ZodUnknown:a(()=>qxt,"$ZodUnknown"),$ZodUnion:a(()=>m9r,"$ZodUnion"),$ZodUndefined:a(()=>Qto,"$ZodUndefined"),$ZodUUID:a(()=>fto,"$ZodUUID"),$ZodURL:a(()=>hto,"$ZodURL"),$ZodULID:a(()=>Eto,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>Mwt,"$ZodTuple"),$ZodTransform:a(()=>g9r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>lro,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Uto,"$ZodSymbol"),$ZodSuccess:a(()=>oro,"$ZodSuccess"),$ZodStringFormat:a(()=>Lu,"$ZodStringFormat"),$ZodString:a(()=>q8e,"$ZodString"),$ZodSet:a(()=>Kto,"$ZodSet"),$ZodRegistry:a(()=>I8e,"$ZodRegistry"),$ZodRecord:a(()=>zto,"$ZodRecord"),$ZodRealError:a(()=>U8e,"$ZodRealError"),$ZodReadonly:a(()=>cro,"$ZodReadonly"),$ZodPromise:a(()=>uro,"$ZodPromise"),$ZodPrefault:a(()=>nro,"$ZodPrefault"),$ZodPipe:a(()=>A9r,"$ZodPipe"),$ZodOptional:a(()=>ero,"$ZodOptional"),$ZodObject:a(()=>h9r,"$ZodObject"),$ZodNumberFormat:a(()=>Bto,"$ZodNumberFormat"),$ZodNumber:a(()=>u9r,"$ZodNumber"),$ZodNullable:a(()=>tro,"$ZodNullable"),$ZodNull:a(()=>qto,"$ZodNull"),$ZodNonOptional:a(()=>iro,"$ZodNonOptional"),$ZodNever:a(()=>Hto,"$ZodNever"),$ZodNanoID:a(()=>gto,"$ZodNanoID"),$ZodNaN:a(()=>aro,"$ZodNaN"),$ZodMap:a(()=>Yto,"$ZodMap"),$ZodLiteral:a(()=>Zto,"$ZodLiteral"),$ZodLazy:a(()=>dro,"$ZodLazy"),$ZodKSUID:a(()=>vto,"$ZodKSUID"),$ZodJWT:a(()=>Oto,"$ZodJWT"),$ZodIntersection:a(()=>Wto,"$ZodIntersection"),$ZodISOTime:a(()=>Sto,"$ZodISOTime"),$ZodISODuration:a(()=>Tto,"$ZodISODuration"),$ZodISODateTime:a(()=>Cto,"$ZodISODateTime"),$ZodISODate:a(()=>bto,"$ZodISODate"),$ZodIPv6:a(()=>xto,"$ZodIPv6"),$ZodIPv4:a(()=>Ito,"$ZodIPv4"),$ZodGUID:a(()=>dto,"$ZodGUID"),$ZodFunction:a(()=>Gxt,"$ZodFunction"),$ZodFile:a(()=>Xto,"$ZodFile"),$ZodError:a(()=>Z6r,"$ZodError"),$ZodEnum:a(()=>Jto,"$ZodEnum"),$ZodEmoji:a(()=>mto,"$ZodEmoji"),$ZodEmail:a(()=>pto,"$ZodEmail"),$ZodE164:a(()=>Nto,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Vto,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>rro,"$ZodDefault"),$ZodDate:a(()=>$to,"$ZodDate"),$ZodCustomStringFormat:a(()=>Lto,"$ZodCustomStringFormat"),$ZodCustom:a(()=>fro,"$ZodCustom"),$ZodCheckUpperCase:a(()=>nto,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>Q8e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>oto,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>Jeo,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>tto,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>ato,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>lto,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Weo,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Veo,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>Keo,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>Xeo,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>cto,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>Yeo,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>Zeo,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>rto,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>a9r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>eto,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>ito,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>c9r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>sto,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>zeo,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Sh,"$ZodCheck"),$ZodCatch:a(()=>sro,"$ZodCatch"),$ZodCUID2:a(()=>yto,"$ZodCUID2"),$ZodCUID:a(()=>Ato,"$ZodCUID"),$ZodCIDRv6:a(()=>Rto,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>wto,"$ZodCIDRv4"),$ZodBoolean:a(()=>d9r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Fto,"$ZodBigIntFormat"),$ZodBigInt:a(()=>f9r,"$ZodBigInt"),$ZodBase64URL:a(()=>Dto,"$ZodBase64URL"),$ZodBase64:a(()=>kto,"$ZodBase64"),$ZodAsyncError:a(()=>fW,"$ZodAsyncError"),$ZodArray:a(()=>p9r,"$ZodArray"),$ZodAny:a(()=>jto,"$ZodAny")});eeo=Object.freeze({status:"aborted"});a(ft,"F");teo=Symbol("zod_brand"),fW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Lxt={};a(Xv,"c$");Ws={};WL(Ws,{unwrapMessage:a(()=>ZFe,"unwrapMessage"),stringifyPrimitive:a(()=>us,"stringifyPrimitive"),required:a(()=>sVc,"required"),randomString:a(()=>J$c,"randomString"),propertyKeyTypes:a(()=>Bxt,"propertyKeyTypes"),promiseAllObject:a(()=>K$c,"promiseAllObject"),primitiveTypes:a(()=>oeo,"primitiveTypes"),prefixIssues:a(()=>Ak,"prefixIssues"),pick:a(()=>tVc,"pick"),partial:a(()=>oVc,"partial"),optionalKeys:a(()=>seo,"optionalKeys"),omit:a(()=>rVc,"omit"),numKeys:a(()=>Z$c,"numKeys"),nullish:a(()=>aoe,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>iVc,"merge"),jsonStringifyReplacer:a(()=>reo,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>leo,"issue"),isPlainObject:a(()=>T8e,"isPlainObject"),isObject:a(()=>S8e,"isObject"),getSizableOrigin:a(()=>kwt,"getSizableOrigin"),getParsedType:a(()=>X$c,"getParsedType"),getLengthableOrigin:a(()=>Pwt,"getLengthableOrigin"),getEnumValues:a(()=>Y6r,"getEnumValues"),getElementAtPath:a(()=>Y$c,"getElementAtPath"),floatSafeRemainder:a(()=>neo,"floatSafeRemainder"),finalizeIssue:a(()=>qN,"finalizeIssue"),extend:a(()=>nVc,"extend"),escapeRegex:a(()=>coe,"escapeRegex"),esc:a(()=>rve,"esc"),defineLazy:a(()=>zc,"defineLazy"),createTransparentProxy:a(()=>eVc,"createTransparentProxy"),clone:a(()=>$N,"clone"),cleanRegex:a(()=>Rwt,"cleanRegex"),cleanEnum:a(()=>aVc,"cleanEnum"),captureStackTrace:a(()=>J6r,"captureStackTrace"),cached:a(()=>wwt,"cached"),assignProp:a(()=>K6r,"assignProp"),assertNotEqual:a(()=>$$c,"assertNotEqual"),assertNever:a(()=>W$c,"assertNever"),assertIs:a(()=>V$c,"assertIs"),assertEqual:a(()=>G$c,"assertEqual"),assert:a(()=>z$c,"assert"),allowsEval:a(()=>ieo,"allowsEval"),aborted:a(()=>ave,"aborted"),NUMBER_FORMAT_RANGES:a(()=>aeo,"NUMBER_FORMAT_RANGES"),Class:a(()=>B8r,"Class"),BIGINT_FORMAT_RANGES:a(()=>ceo,"BIGINT_FORMAT_RANGES")});a(G$c,"lh");a($$c,"ch");a(V$c,"ph");a(W$c,"dh");a(z$c,"ih");a(Y6r,"B7");a(Vr,"P");a(reo,"mH");a(wwt,"z7");a(aoe,"I1");a(Rwt,"N7");a(neo,"lH");a(zc,"N$");a(K6r,"cH");a(Y$c,"nh");a(K$c,"rh");a(J$c,"oh");a(rve,"j0");J6r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(S8e,"g8");ieo=wwt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(T8e,"h8");a(Z$c,"th");X$c=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"),Bxt=new Set(["string","number","symbol"]),oeo=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(coe,"r4");a($N,"H6");a(xr,"k");a(eVc,"sh");a(us,"x");a(seo,"iH");aeo={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]},ceo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(tVc,"eh");a(rVc,"$u");a(nVc,"Qu");a(iVc,"Ju");a(oVc,"Xu");a(sVc,"Yu");a(ave,"A0");a(Ak,"I6");a(ZFe,"V7");a(qN,"g6");a(kwt,"O7");a(Pwt,"D7");a(leo,"oH");a(aVc,"Wu");B8r=class{static{a(this,"YM")}constructor(...e){}},ueo=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,reo,2)},enumerable:!0})},"WM"),Z6r=ft("$ZodError",ueo),U8e=ft("$ZodError",ueo,{Parent:Error});a(X6r,"m8");a(e9r,"l8");a(deo,"mX");a(feo,"GM");a(peo,"lX");t9r=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 fW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>qN(u,s,Xv())));throw J6r(l,o?.callee),l}return c.value},"cX"),Fxt=t9r(U8e),r9r=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=>qN(u,s,Xv())));throw J6r(l,o?.callee),l}return c.value},"pX"),Uxt=r9r(U8e),n9r=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 fW;return s.issues.length?{success:!1,error:new(t??Z6r)(s.issues.map(c=>qN(c,o,Xv())))}:{success:!0,data:s.value}},"dX"),Dwt=n9r(U8e),i9r=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=>qN(c,o,Xv())))}:{success:!0,data:s.value}},"iX"),Nwt=i9r(U8e),o9r={};WL(o9r,{xid:a(()=>Aeo,"xid"),uuid7:a(()=>dVc,"uuid7"),uuid6:a(()=>uVc,"uuid6"),uuid4:a(()=>lVc,"uuid4"),uuid:a(()=>Rve,"uuid"),uppercase:a(()=>Geo,"uppercase"),unicodeEmail:a(()=>hVc,"unicodeEmail"),undefined:a(()=>jeo,"undefined"),ulid:a(()=>geo,"ulid"),time:a(()=>Meo,"time"),string:a(()=>Leo,"string"),rfc5322Email:a(()=>pVc,"rfc5322Email"),number:a(()=>Ueo,"number"),null:a(()=>qeo,"null"),nanoid:a(()=>Eeo,"nanoid"),lowercase:a(()=>Heo,"lowercase"),ksuid:a(()=>yeo,"ksuid"),ipv6:a(()=>Teo,"ipv6"),ipv4:a(()=>Seo,"ipv4"),integer:a(()=>Feo,"integer"),html5Email:a(()=>fVc,"html5Email"),hostname:a(()=>Reo,"hostname"),guid:a(()=>veo,"guid"),extendedDuration:a(()=>cVc,"extendedDuration"),emoji:a(()=>beo,"emoji"),email:a(()=>Ceo,"email"),e164:a(()=>keo,"e164"),duration:a(()=>_eo,"duration"),domain:a(()=>AVc,"domain"),datetime:a(()=>Oeo,"datetime"),date:a(()=>Deo,"date"),cuid2:a(()=>meo,"cuid2"),cuid:a(()=>heo,"cuid"),cidrv6:a(()=>xeo,"cidrv6"),cidrv4:a(()=>Ieo,"cidrv4"),browserEmail:a(()=>mVc,"browserEmail"),boolean:a(()=>Qeo,"boolean"),bigint:a(()=>Beo,"bigint"),base64url:a(()=>s9r,"base64url"),base64:a(()=>weo,"base64"),_emoji:a(()=>gVc,"_emoji")});heo=/^[cC][^\s-]{8,}$/,meo=/^[0-9a-z]+$/,geo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Aeo=/^[0-9a-vA-V]{20}$/,yeo=/^[A-Za-z0-9]{27}$/,Eeo=/^[a-zA-Z0-9_-]{21}$/,_eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cVc=/^[-+]?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)?)??$/,veo=/^([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})$/,Rve=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"),lVc=Rve(4),uVc=Rve(6),dVc=Rve(7),Ceo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fVc=/^[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])?)*$/,pVc=/^(([^<>()\[\]\\.,;:\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,}))$/,hVc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mVc=/^[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])?)*$/,gVc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(beo,"WK");Seo=/^(?:(?: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])$/,Teo=/^(([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})$/,Ieo=/^((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])$/,xeo=/^(([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])$/,weo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s9r=/^[A-Za-z0-9_-]*$/,Reo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,AVc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,keo=/^\+(?:[0-9]){6,14}[0-9]$/,Peo="(?:(?:\\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])))",Deo=new RegExp(`^${Peo}$`);a(Neo,"HM");a(Meo,"NK");a(Oeo,"wK");Leo=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Beo=/^\d+n?$/,Feo=/^\d+$/,Ueo=/^-?\d+(?:\.\d+)?/i,Qeo=/true|false/i,qeo=/null/i,jeo=/undefined/i,Heo=/^[^A-Z]*$/,Geo=/^[^a-z]*$/,Sh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),$eo={number:"number",bigint:"bigint",object:"date"},a9r=ft("$ZodCheckLessThan",(t,e)=>{Sh.init(t,e);let r=$eo[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{Sh.init(t,e);let r=$eo[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})}}),Veo=ft("$ZodCheckMultipleOf",(t,e)=>{Sh.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):neo(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})}}),Weo=ft("$ZodCheckNumberFormat",(t,e)=>{Sh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=aeo[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=Feo)}),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})}}),zeo=ft("$ZodCheckBigIntFormat",(t,e)=>{Sh.init(t,e);let[r,n]=ceo[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})}}),Yeo=ft("$ZodCheckMaxSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:kwt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),Keo=ft("$ZodCheckMinSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:kwt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),Jeo=ft("$ZodCheckSizeEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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:kwt(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})}}),Zeo=ft("$ZodCheckMaxLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Pwt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Xeo=ft("$ZodCheckMinLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Pwt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),eto=ft("$ZodCheckLengthEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(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=Pwt(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})}}),Q8e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;Sh.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=()=>{})}),tto=ft("$ZodCheckRegex",(t,e)=>{Q8e.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})}}),rto=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Heo),Q8e.init(t,e)}),nto=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Geo),Q8e.init(t,e)}),ito=ft("$ZodCheckIncludes",(t,e)=>{Sh.init(t,e);let r=coe(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})}}),oto=ft("$ZodCheckStartsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`^${coe(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})}}),sto=ft("$ZodCheckEndsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`.*${coe(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(MKi,"KM");ato=ft("$ZodCheckProperty",(t,e)=>{Sh.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=>MKi(o,r,e.property));MKi(n,r,e.property)}}),cto=ft("$ZodCheckMimeType",(t,e)=>{Sh.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})}}),lto=ft("$ZodCheckOverwrite",(t,e)=>{Sh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),Qxt=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??q6r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=rKi(s.logLevel,"ClientOptions.logLevel",this)??rKi(tu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??L7c(),En(this,VIt,F7c,"f");let l=tu("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=jZi(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=>{sA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{sA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new d8r(e,r=>{sA(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 rQc(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 Ri(`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 U7c(e)}getUserAgent(){return`${this.constructor.name}/JS ${aW}`}defaultIdempotencyKey(){return`stainless-node-retry-${kZi()}`}makeStatusError(e,r,n,o){return Xv.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,E8r,"m",iXi).call(this)&&n||this.baseURL,s=w7c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!zYi(c)||!zYi(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 Ri("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(oxt)||o.append("anthropic-beta",oxt),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 axt(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(sA(this).debug(`[${d}] sending request`,$ie({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new DI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(c8r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new DI;let v=l8e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return sA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),sA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,$ie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw sA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),sA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,$ie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new KIt:new hve({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 B7c(g.body),sA(this).info(`${E} - ${R}`),sA(this).debug(`[${d}] response error (${R})`,$ie({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";sA(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>c8r(R).message),T=PZi(b),w=T?void 0:b;throw sA(this).debug(`[${d}] response error (${v})`,$ie({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 sA(this).info(E),sA(this).debug(`[${d}] response start`,$ie({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 p8r(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 P7c(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 Ri("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&&k7c("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))}:{},...O6r(),...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:NZi(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,VIt,"f").call(this,{body:e,headers:n})}};q6r=Lp,VIt=new WeakMap,E8r=new WeakSet,iXi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Lp.Anthropic=q6r;Lp.HUMAN_PROMPT=PQc;Lp.AI_PROMPT=DQc;Lp.DEFAULT_TIMEOUT=6e5;Lp.AnthropicError=Ri;Lp.APIError=Xv;Lp.APIConnectionError=hve;Lp.APIConnectionTimeoutError=KIt;Lp.APIUserAbortError=DI;Lp.NotFoundError=ext;Lp.ConflictError=txt;Lp.RateLimitError=nxt;Lp.BadRequestError=JIt;Lp.AuthenticationError=ZIt;Lp.InternalServerError=ixt;Lp.PermissionDeniedError=XIt;Lp.UnprocessableEntityError=rxt;Lp.toFile=gQc;Ave=class extends Lp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new Sxt(this),this.messages=new p8e(this),this.models=new Ixt(this),this.beta=new k1(this)}};Ave.Completions=Sxt;Ave.Messages=p8e;Ave.Models=Ixt;Ave.Beta=k1;a(U8e,"j4");a(WIt,"N8");a(NI,"o$");a(Q8e,"D1");a(oXi,"JU");a(NQc,"Tw");MQc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),OQc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(LQc,"xw");v8r=class{static{a(this,"gw")}read(e){return(0,aA.readFile)(e,"utf8")}readBytes(e){return(0,aA.readFile)(e)}write(e,r,n){return(0,aA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,aA.mkdir)(e,{recursive:!0})}catch(r){if(NI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return LQc(e,r,n)}delete(e){return(0,aA.unlink)(e)}list(e){return(0,aA.readdir)(e)}append(e,r,n){return(0,aA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,aA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,aA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,aA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,aA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},BQc=new aXi.AsyncLocalStorage;a(xxt,"w8");X_e=null;a(lXi,"uw");a(FQc,"mw");a(mk,"L6");a(UQc,"dv");QQc=UQc;a(qQc,"iv");jQc=qQc;a(HQc,"nv");GQc=HQc;a($Qc,"rv");VQc=$Qc,WQc=200;a(zQc,"tv");YQc=zQc;a(jve,"D8");jve.prototype.clear=QQc;jve.prototype.delete=jQc;jve.prototype.get=GQc;jve.prototype.has=VQc;jve.prototype.set=YQc;KQc=jve,JQc=(function(){try{var t=D6r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),wxt=JQc;a(ZQc,"sv");j6r=ZQc,XQc=Object.prototype,eqc=XQc.hasOwnProperty;a(tqc,"QC");uXi=tqc;a(rqc,"JC");nqc=rqc;a(iqc,"XC");oqc=iqc;a(sqc,"YC");Hve=sqc,aqc="[object Arguments]";a(cqc,"GC");CKi=cqc,dXi=Object.prototype,lqc=dXi.hasOwnProperty,uqc=dXi.propertyIsEnumerable,dqc=CKi((function(){return arguments})())?CKi:function(t){return Hve(t)&&lqc.call(t,"callee")&&!uqc.call(t,"callee")},h8e=dqc,fqc=Array.isArray,pW=fqc,JFe={};zL(JFe,{default:a(()=>H6r,"default")});a(pqc,"VC");hqc=pqc,fXi=typeof JFe=="object"&&JFe&&!JFe.nodeType&&JFe,bKi=fXi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,mqc=bKi&&bKi.exports===fXi,SKi=mqc?Bve.Buffer:void 0,gqc=SKi?SKi.isBuffer:void 0,Aqc=gqc||hqc,H6r=Aqc,yqc=9007199254740991,Eqc=/^(?:0|[1-9]\d*)$/;a(_qc,"DC");xwt=_qc,vqc=9007199254740991;a(Cqc,"ZC");G6r=Cqc,bqc="[object Arguments]",Sqc="[object Array]",Tqc="[object Boolean]",Iqc="[object Date]",xqc="[object Error]",wqc="[object Function]",Rqc="[object Map]",kqc="[object Number]",Pqc="[object Object]",Dqc="[object RegExp]",Nqc="[object Set]",Mqc="[object String]",Oqc="[object WeakMap]",Lqc="[object ArrayBuffer]",Bqc="[object DataView]",Fqc="[object Float32Array]",Uqc="[object Float64Array]",Qqc="[object Int8Array]",qqc="[object Int16Array]",jqc="[object Int32Array]",Hqc="[object Uint8Array]",Gqc="[object Uint8ClampedArray]",$qc="[object Uint16Array]",Vqc="[object Uint32Array]",Sd={};Sd[Fqc]=Sd[Uqc]=Sd[Qqc]=Sd[qqc]=Sd[jqc]=Sd[Hqc]=Sd[Gqc]=Sd[$qc]=Sd[Vqc]=!0;Sd[bqc]=Sd[Sqc]=Sd[Lqc]=Sd[Tqc]=Sd[Bqc]=Sd[Iqc]=Sd[xqc]=Sd[wqc]=Sd[Rqc]=Sd[kqc]=Sd[Pqc]=Sd[Dqc]=Sd[Nqc]=Sd[Mqc]=Sd[Oqc]=!1;a(Wqc,"pC");zqc=Wqc;a(Yqc,"dC");Kqc=Yqc,ZFe={};zL(ZFe,{default:a(()=>C8r,"default")});pXi=typeof ZFe=="object"&&ZFe&&!ZFe.nodeType&&ZFe,o8e=pXi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,Jqc=o8e&&o8e.exports===pXi,FFr=Jqc&&TZi.process,Zqc=(function(){try{var t=o8e&&o8e.require&&o8e.require("util").types;return t||FFr&&FFr.binding&&FFr.binding("util")}catch{}})(),C8r=Zqc,TKi=C8r&&C8r.isTypedArray,Xqc=TKi?Kqc(TKi):zqc,hXi=Xqc,ejc=Object.prototype,tjc=ejc.hasOwnProperty;a(rjc,"aC");njc=rjc,ijc=Object.prototype;a(ojc,"eC");mXi=ojc;a(sjc,"$T");ajc=sjc;a(cjc,"QT");$6r=cjc;a(ljc,"JT");ujc=ljc,djc=Object.prototype,fjc=djc.hasOwnProperty;a(pjc,"WT");hjc=pjc;a(mjc,"GT");gXi=mjc,XFe={};zL(XFe,{default:a(()=>yXi,"default")});AXi=typeof XFe=="object"&&XFe&&!XFe.nodeType&&XFe,IKi=AXi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,gjc=IKi&&IKi.exports===AXi,xKi=gjc?Bve.Buffer:void 0,wKi=xKi?xKi.allocUnsafe:void 0;a(Ajc,"HT");yXi=Ajc;a(yjc,"KT");Ejc=yjc;a(_jc,"qT");vjc=_jc,Cjc=ajc(Object.getPrototypeOf,Object),EXi=Cjc,bjc=Bve.Uint8Array,RKi=bjc;a(Sjc,"zT");Tjc=Sjc;a(Ijc,"NT");xjc=Ijc,kKi=Object.create,wjc=(function(){function t(){}return a(t,"$"),function(e){if(!K9(e))return{};if(kKi)return kKi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),Rjc=wjc;a(kjc,"OT");Pjc=kjc,Djc="[object Symbol]";a(Njc,"FT");V6r=Njc,Mjc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ojc=/^\w*$/;a(Ljc,"LT");Bjc=Ljc,Fjc=500;a(Ujc,"AT");Qjc=Ujc,qjc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jjc=/\\(\\)?/g,Hjc=Qjc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(qjc,function(r,n,o,s){e.push(o?s.replace(jjc,"$1"):n||r)}),e}),Gjc=Hjc;a($jc,"ET");Vjc=$jc,Wjc=1/0,PKi=fW?fW.prototype:void 0,DKi=PKi?PKi.toString:void 0;a(_Xi,"PO");zjc=_Xi;a(Yjc,"_T");Kjc=Yjc;a(Jjc,"kT");wwt=Jjc,Zjc=1/0;a(Xjc,"vT");W6r=Xjc;a(eHc,"CT");tHc=eHc;a(rHc,"TT");nHc=rHc;a(iHc,"xT");oHc=iHc;a(sHc,"yT");aHc=sHc;a(cHc,"fT");vXi=cHc,z6r=null;a(lHc,"CO");a(uHc,"TO");kxt=new Map;a(dHc,"xO");a(fHc,"yO");Y6r=new Map;a(hHc,"fO");a(mHc,"gO");a(K6r,"V0");a(AHc,"hO");a(yHc,"uO");EHc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(_Hc,"lT");vHc=_Hc(),CHc=a(()=>{},"pT");a(bXi,"VU");bHc=B8e(),XKh=bHc.subscribe,SHc=B8e(),eJh=SHc.subscribe,THc=B8e(),tJh=THc.subscribe,IHc=B8e(),rJh=IHc.subscribe,xHc=B8e(),nJh=xHc.subscribe;a(wHc,"lO");a(RHc,"tT");S8r=class{static{a(this,"cO")}#e=new Set;register(e){let r=RHc(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}},kHc=new S8r;a(PHc,"pO");DHc=Dy(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(NHc,"sT");a(MHc,"eT");a(OHc,"iO");a(LHc,"tO");a(BHc,"Qx");a(NKi,"oO");a(FHc,"aO");a(TXi,"HX");UHc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=rf(e,of`fs.existsSync(${t})`,0);return Co.existsSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},async stat(t){return(0,$0.stat)(t)},async readdir(t){return(0,$0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,$0.unlink)(t)},async rmdir(t){return(0,$0.rmdir)(t)},async rm(t,e){return(0,$0.rm)(t,e)},async mkdir(t,e){try{await(0,$0.mkdir)(t,{recursive:!0,...e})}catch(r){if(NI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,$0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,$0.rename)(t,e)},statSync(t){let e=[];try{let o=rf(e,of`fs.statSync(${t})`,0);return Co.statSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},lstatSync(t){let e=[];try{let o=rf(e,of`fs.lstatSync(${t})`,0);return Co.lstatSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=rf(r,of`fs.readFileSync(${t})`,0);return Co.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{nf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=rf(e,of`fs.readFileBytesSync(${t})`,0);return Co.readFileSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},readSync(t,e){let r=[];try{let s=rf(r,of`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=Co.openSync(t,"r");let l=Buffer.alloc(e.length),u=Co.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&Co.closeSync(c)}}catch(s){var n=s,o=1}finally{nf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=rf(n,of`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=Co.openSync(t,"ax",r.mode);try{Co.appendFileSync(l,e)}finally{Co.closeSync(l)}return}catch(l){if(NI(l)!=="EEXIST")throw l}Co.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{nf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=rf(r,of`fs.copyFileSync(${t} → ${e})`,0);Co.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{nf(r,n,o)}},unlinkSync(t){let e=[];try{let o=rf(e,of`fs.unlinkSync(${t})`,0);Co.unlinkSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},renameSync(t,e){let r=[];try{let s=rf(r,of`fs.renameSync(${t} → ${e})`,0);Co.renameSync(t,e)}catch(s){var n=s,o=1}finally{nf(r,n,o)}},linkSync(t,e){let r=[];try{let s=rf(r,of`fs.linkSync(${t} → ${e})`,0);Co.linkSync(t,e)}catch(s){var n=s,o=1}finally{nf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=rf(n,of`fs.symlinkSync(${t} → ${e})`,0);Co.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{nf(n,o,s)}},readlinkSync(t){let e=[];try{let o=rf(e,of`fs.readlinkSync(${t})`,0);return Co.readlinkSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},realpathSync(t){let e=[];try{let o=rf(e,of`fs.realpathSync(${t})`,0);return Co.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{nf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=rf(r,of`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{Co.mkdirSync(t,c)}catch(l){if(NI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{nf(r,n,o)}},readdirSync(t){let e=[];try{let o=rf(e,of`fs.readdirSync(${t})`,0);return Co.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{nf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=rf(e,of`fs.readdirStringSync(${t})`,0);return Co.readdirSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=rf(e,of`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{nf(e,r,n)}},rmdirSync(t){let e=[];try{let o=rf(e,of`fs.rmdirSync(${t})`,0);Co.rmdirSync(t)}catch(o){var r=o,n=1}finally{nf(e,r,n)}},rmSync(t,e){let r=[];try{let s=rf(r,of`fs.rmSync(${t})`,0);Co.rmSync(t,e)}catch(s){var n=s,o=1}finally{nf(r,n,o)}},createWriteStream(t){return Co.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,$0.readFile)(t);let r=await(0,$0.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(${WHc}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"}],LKi=null;a(YHc,"Ox");a(KHc,"W2");T8r={verbose:0,debug:1,info:2,warn:3,error:4},JHc=Dy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(T8r,t)?t:"debug"}),ZHc=!1;a(Rwt,"qX");I8r=Dy(()=>{let t=Rwt();return ZHc||a_(process.env.DEBUG)||a_(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||IXi()||t.some(e=>e.startsWith("--debug="))||xXi()!==null}),XHc=Dy(()=>{let t=Rwt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return DHc(e)}),IXi=Dy(()=>{let t=Rwt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),xXi=Dy(()=>{let t=Rwt();for(let e=0;e{try{let t=kXi(),e=(0,aoe.dirname)(t),r=(0,aoe.join)(e,"latest");await(0,u_.unlink)(r).catch(()=>{}),await(0,u_.symlink)(t,r)}catch{}}),sJh=(()=>{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})(),oGc={[Symbol.dispose](){}};a(sGc,"_x");of=sGc;a(jm,"B$");WN=a((t,e)=>{let r=[];try{let s=rf(r,of`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{nf(r,n,o)}},"d$");a(aGc,"w2");a(hW,"A4");a(cGc,"kx");a(lGc,"O2");uGc=2e3,Pxt=new Set,BKi=!1;a(dGc,"xx");a(fGc,"yx");R8r=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=s8r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||s8r(),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(U8e(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 SZi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=a_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,_Zi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(a_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();mk(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:L,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:O}=this.options,{allowedTools:j=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(j);j=[...j,...H.filter(le=>!re.has(le))]}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",jm(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=FQc();H&&Q.push("--debug-file",H)}if(B){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),j.length>0&&Q.push("--allowedTools",j.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",jm({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),L&&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"),q&&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 Y=lGc(U,O);for(let[H,re]of Object.entries(Y))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,a_(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=pGc(u),V=W?u:s,z=W?[...c,...Q]:[...c,u,...Q],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(mk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(mk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,fGc(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 R1("Claude Code process aborted by user");else if(NQc(H)){let re=hGc(u,W);this.exitError=ReferenceError(re),mk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),mk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new R1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,mk(le.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 R1("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){mk("[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}`);mk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||mk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${WIt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new R1("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()},uGc,r,e).unref(),r.once("exit",()=>Pxt.delete(r))):r&&(Pxt.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,CZi.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=WN(n)}catch{mk(`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 R1("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(pGc,"fx");a(hGc,"gx");eve="@anthropic-ai/claude-agent-sdk";a(mGc,"ux");a(gGc,"F2");Dxt=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(AGc,"mx");yGc=AGc();a(J6r,"BX");a(NXi,"AU");a(MXi,"IU");a(EGc,"Z2");a(H9,"I4");k8r=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?.())}},P8r=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new Dxt;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,Rxt.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&&(ru("[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 R1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);ru(`[Query.readMessages] Replacing exit error with result text. Original: ${WIt(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(jm(o)+` +`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:WIt(n)}};try{await Promise.resolve(this.transport.write(jm(o)+` +`))}catch(s){ru(`[Query.handleControlRequest] Error-response write failed: ${WIt(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 H9("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 H9("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 H9("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 H9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return H9("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(jm(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 H9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return H9("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 H9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return H9("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){ru("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,ru(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(jm(n)+` +`))}ru(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(ru("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),ru("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof R1))throw r}}waitForFirstResult(){return this.firstResultReceived?(ru("[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 k8r(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),ru(`[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,Rxt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(jm(n)+` +`)).catch(o=>{ru(`[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}})}},Z6r=500,X6r=1048576,_Gc=[200,800],D8r=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=Z6r,s=X6r,c=_Gc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=jm(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 Wie(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=U8e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await EZi(f)}if(l){ru(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){ru(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},FKi=C6r(j6c(),1);a(vGc,"Ug");a(s8e,"O0");a(CGc,"qg");qFr=new Map,bGc=5e3;a(SGc,"Bg");a(TGc,"zg");a(IGc,"OZ");xGc=(0,FXi.promisify)(BXi.execFile);a(q8e,"m4");a(wGc,"jH");W9=65536,RGc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(Th,"L$");a(qXi,"ZZ");a(jFr,"IX");a(gk,"A6");a(M8r,"rQ");a(jXi,"RX");a(kGc,"MZ");a(HXi,"PX");m8e=200;a(PGc,"Lg");a(j8e,"F0");a(yW,"U4");a(DGc,"jg");a(H8e,"M1");a(QN,"j6");a(kwt,"L1");NGc=1048576,MGc=5242880;a(LGc,"Rg");a(GXi,"jZ");a(Kie,"D0");a(Nxt,"jX");Mxt=Buffer.from('{"type":"attribution-snapshot"'),BGc=Buffer.from('{"type":"system"'),g8e=10,FGc=Buffer.from([g8e]),UGc=256;a(QGc,"_g");a(qGc,"kg");a(jGc,"Sg");a(HGc,"vg");a(GGc,"Cg");a($Gc,"AZ");a(VGc,"xg");a(WGc,"yg");a(zGc,"fg");a(HFr,"IH");a(YGc,"gg");a(KGc,"hg");a(JGc,"ug");a($Xi,"RH");a(VXi,"PH");a(ZGc,"IZ");a(WXi,"RZ");a(XGc,"PZ");a(Pwt,"k8");a(e8e,"oQ");a(zXi,"EZ");e$c=32;a(t$c,"pg");a(r$c,"dg");a(n$c,"ig");a(i$c,"ng");a(o$c,"rg");a(s$c,"bZ");a(a$c,"_Z");a(c$c,"CZ");a(l$c,"TZ");a(u$c,"xZ");a(d$c,"ag");a(YXi,"yZ");a(GFr,"_H");a(f$c,"sg");p$c=new Set(["user","assistant","attachment","system","progress"]);a(h$c,"$h");a(m$c,"Qh");a(KXi,"fZ");a(g$c,"gZ");a(A$c,"Jh");a(y$c,"hZ");a(E$c,"Xh");a(JXi,"uZ");a(ZXi,"lZ");a(XXi,"cZ");a(_$c,"Wh");a(v$c,"Gh");a(C$c,"pZ");a(b$c,"dZ");a(eeo,"vH");a(neo,"CH");a(ieo,"bX");a(S$c,"Uh");T$c="user:inference",oeo="user:profile",I$c="org:create_api_key",x$c=[I$c,oeo],w$c=[oeo,T$c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],cJh=ieo([...x$c,...w$c]),UKi={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}"},R$c=void 0;a(k$c,"zh");P$c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(D$c,"rZ");N$c="-credentials";a(M$c,"tZ");O$c=/^[a-zA-Z0-9._-]+$/;a(L$c,"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})(hc||(hc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(QKi||(QKi={}));kn=hc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),oW=a(t=>{switch(typeof t){case"undefined":return kn.undefined;case"string":return kn.string;case"number":return Number.isNaN(t)?kn.nan:kn.number;case"boolean":return kn.boolean;case"function":return kn.function;case"bigint":return kn.bigint;case"symbol":return kn.symbol;case"object":return Array.isArray(t)?kn.array:t===null?kn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?kn.promise:typeof Map<"u"&&t instanceof Map?kn.map:typeof Set<"u"&&t instanceof Set?kn.set:typeof Date<"u"&&t instanceof Date?kn.date:kn.object;default:return kn.unknown}},"l4"),hr=hc.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"]),_k=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()}};_k.create=t=>new _k(t);B$c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===kn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,hc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${hc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${hc.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}"`:hc.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,hc.assertNever(t)}return{message:r}},"Fh"),y8e=B$c,F$c=y8e;a(L8r,"tQ");B8r=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");eC=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"}),r8e=a(t=>({status:"dirty",value:t}),"v8"),P1=a(t=>({status:"valid",value:t}),"z6"),qKi=a(t=>t.status==="aborted","TH"),jKi=a(t=>t.status==="dirty","xH"),Eve=a(t=>t.status==="valid","Z0"),Bxt=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={}));Ck=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}},HKi=a((t,e)=>{if(Eve(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 _k(t.common.issues);return this._error=r,this._error}}},"eZ");a(Zo,"e");Ms=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return oW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:oW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new eC,ctx:{common:e.parent.common,data:e.data,parsedType:oW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Bxt(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:oW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return HKi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Eve(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=>Eve(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:oW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Bxt(o)?o:Promise.resolve(o));return HKi(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 HN({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 vk.create(this,this._def)}nullable(){return Z9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mW.create(this)}promise(){return noe.create(this,this._def)}or(e){return bve.create([this,e],this._def)}and(e){return Sve.create(this,e,this._def)}transform(e){return new HN({...Zo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Rve({...Zo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Fxt({typeName:Cr.ZodBranded,type:this,...Zo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new kve({...Zo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Uxt.create(this,e)}readonly(){return Pve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},U$c=/^c[^\s-]{8,}$/i,Q$c=/^[0-9a-z]+$/,q$c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j$c=/^[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,H$c=/^[a-z0-9_-]{21}$/i,G$c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$$c=/^[-+]?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)?)??$/,V$c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",z$c=/^(?:(?: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])$/,Y$c=/^(?:(?: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])$/,K$c=/^(([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]))$/,J$c=/^(([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])$/,Z$c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,X$c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,seo="((\\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])))",eVc=new RegExp(`^${seo}$`);a(aeo,"QM");a(tVc,"yh");a(rVc,"fh");a(nVc,"gh");a(iVc,"hh");a(oVc,"uh");_ve=class t extends Ms{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kn.string){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.string,received:o.parsedType}),eo}let r=new eC,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(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 _ve({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Zo(t)});a(sVc,"mh");E8e=class t extends Ms{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)!==kn.number){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.number,received:o.parsedType}),eo}let r,n=new eC;for(let o of this._def.checks)o.kind==="int"?hc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(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),ln(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?sVc(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(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),ln(r,{code:hr.not_finite,message:o.message}),n.dirty()):hc.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"&&hc.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 E8e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Zo(t)});_8e=class t extends Ms{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)!==kn.bigint)return this._getInvalidInput(e);let r,n=new eC;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: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),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.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 _8e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Zo(t)});v8e=class extends Ms{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kn.boolean){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.boolean,received:r.parsedType}),eo}return P1(e.data)}};v8e.create=t=>new v8e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Zo(t)});C8e=class t extends Ms{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kn.date){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_date}),eo}let r=new eC,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):hc.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 C8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Zo(t)});b8e=class extends Ms{static{a(this,"SX")}_parse(e){if(this._getType(e)!==kn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.symbol,received:r.parsedType}),eo}return P1(e.data)}};b8e.create=t=>new b8e({typeName:Cr.ZodSymbol,...Zo(t)});vve=class extends Ms{static{a(this,"$7")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.undefined,received:r.parsedType}),eo}return P1(e.data)}};vve.create=t=>new vve({typeName:Cr.ZodUndefined,...Zo(t)});Cve=class extends Ms{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==kn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.null,received:r.parsedType}),eo}return P1(e.data)}};Cve.create=t=>new Cve({typeName:Cr.ZodNull,...Zo(t)});S8e=class extends Ms{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return P1(e.data)}};S8e.create=t=>new S8e({typeName:Cr.ZodAny,...Zo(t)});dW=class extends Ms{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return P1(e.data)}};dW.create=t=>new dW({typeName:Cr.ZodUnknown,...Zo(t)});VL=class extends Ms{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.never,received:r.parsedType}),eo}};VL.create=t=>new VL({typeName:Cr.ZodNever,...Zo(t)});T8e=class extends Ms{static{a(this,"CX")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.void,received:r.parsedType}),eo}return P1(e.data)}};T8e.create=t=>new T8e({typeName:Cr.ZodVoid,...Zo(t)});mW=class t extends Ms{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==kn.array)return ln(r,{code:hr.invalid_type,expected:kn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(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 Ck(r,c,r.path,l)))).then(c=>eC.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new Ck(r,c,r.path,l)));return eC.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)}};mW.create=(t,e)=>new mW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Zo(e)});a(ive,"C8");OI=class t extends Ms{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=hc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==kn.object){let u=this._getOrReturnCtx(e);return ln(u,{code:hr.invalid_type,expected:kn.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 VL&&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 Ck(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof VL){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: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 Ck(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=>eC.mergeObjectSync(r,u)):eC.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 hc.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 hc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return ive(this)}partial(e){let r={};for(let n of hc.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 hc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof vk;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return ceo(hc.objectKeys(this.shape))}};OI.create=(t,e)=>new OI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:VL.create(),typeName:Cr.ZodObject,...Zo(e)});OI.strictCreate=(t,e)=>new OI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:VL.create(),typeName:Cr.ZodObject,...Zo(e)});OI.lazycreate=(t,e)=>new OI({shape:t,unknownKeys:"strip",catchall:VL.create(),typeName:Cr.ZodObject,...Zo(e)});bve=class extends Ms{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 _k(l.ctx.common.issues));return ln(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 _k(u));return ln(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};bve.create=(t,e)=>new bve({options:t,typeName:Cr.ZodUnion,...Zo(e)});G9=a(t=>t instanceof Tve?G9(t.schema):t instanceof HN?G9(t.innerType()):t instanceof Ive?[t.value]:t instanceof xve?t.options:t instanceof wve?hc.objectValues(t.enum):t instanceof Rve?G9(t._def.innerType):t instanceof vve?[void 0]:t instanceof Cve?[null]:t instanceof vk?[void 0,...G9(t.unwrap())]:t instanceof Z9?[null,...G9(t.unwrap())]:t instanceof Fxt||t instanceof Pve?G9(t.unwrap()):t instanceof kve?G9(t._def.innerType):[],"c4"),F8r=class t extends Ms{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.object)return ln(r,{code:hr.invalid_type,expected:kn.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}):(ln(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=G9(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,...Zo(n)})}};a(U8r,"fH");Sve=class extends Ms{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(qKi(s)||qKi(c))return eo;let l=U8r(s.value,c.value);return l.valid?((jKi(s)||jKi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(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}))}};Sve.create=(t,e,r)=>new Sve({left:t,right:e,typeName:Cr.ZodIntersection,...Zo(r)});J9=class t extends Ms{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.array)return ln(n,{code:hr.invalid_type,expected:kn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(ln(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 Ck(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>eC.mergeArray(r,s)):eC.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};J9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new J9({items:t,typeName:Cr.ZodTuple,rest:null,...Zo(e)})};Q8r=class t extends Ms{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!==kn.object)return ln(n,{code:hr.invalid_type,expected:kn.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 Ck(n,l,n.path,l)),value:c._parse(new Ck(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?eC.mergeObjectAsync(r,o):eC.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ms?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Zo(n)}):new t({keyType:_ve.create(),valueType:e,typeName:Cr.ZodRecord,...Zo(r)})}},I8e=class extends Ms{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!==kn.map)return ln(n,{code:hr.invalid_type,expected:kn.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 Ck(n,l,n.path,[d,"key"])),value:s._parse(new Ck(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}}}};I8e.create=(t,e,r)=>new I8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Zo(r)});x8e=class t extends Ms{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.set)return ln(n,{code:hr.invalid_type,expected:kn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(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 Ck(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)}};x8e.create=(t,e)=>new x8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Zo(e)});q8r=class t extends Ms{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.function)return ln(r,{code:hr.invalid_type,expected:kn.function,received:r.parsedType}),eo;function n(l,u){return B8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,L8r(),y8e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return B8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,L8r(),y8e].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 noe){let l=this;return P1(async function(...u){let d=new _k([]),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 P1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new _k([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new _k([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:J9.create(e).rest(dW.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||J9.create([]).rest(dW.create()),returns:r||dW.create(),typeName:Cr.ZodFunction,...Zo(n)})}},Tve=class extends Ms{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})}};Tve.create=(t,e)=>new Tve({getter:t,typeName:Cr.ZodLazy,...Zo(e)});Ive=class extends Ms{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(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}};Ive.create=(t,e)=>new Ive({value:t,typeName:Cr.ZodLiteral,...Zo(e)});a(ceo,"JM");xve=class t extends Ms{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:hc.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 ln(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return P1(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})}};xve.create=ceo;wve=class extends Ms{static{a(this,"G7")}_parse(e){let r=hc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kn.string&&n.parsedType!==kn.number){let o=hc.objectValues(r);return ln(n,{expected:hc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(hc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=hc.objectValues(r);return ln(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return P1(e.data)}get enum(){return this._def.values}};wve.create=(t,e)=>new wve({values:t,typeName:Cr.ZodNativeEnum,...Zo(e)});noe=class extends Ms{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.promise&&r.common.async===!1)return ln(r,{code:hr.invalid_type,expected:kn.promise,received:r.parsedType}),eo;let n=r.parsedType===kn.promise?r.data:Promise.resolve(r.data);return P1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};noe.create=(t,e)=>new noe({type:t,typeName:Cr.ZodPromise,...Zo(e)});HN=class extends Ms{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=>{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 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"?r8e(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"?r8e(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(!Eve(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=>Eve(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);hc.assertNever(o)}};HN.create=(t,e,r)=>new HN({schema:t,typeName:Cr.ZodEffects,effect:e,...Zo(r)});HN.createWithPreprocess=(t,e,r)=>new HN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Zo(r)});vk=class extends Ms{static{a(this,"o6")}_parse(e){return this._getType(e)===kn.undefined?P1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};vk.create=(t,e)=>new vk({innerType:t,typeName:Cr.ZodOptional,...Zo(e)});Z9=class extends Ms{static{a(this,"A1")}_parse(e){return this._getType(e)===kn.null?P1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z9.create=(t,e)=>new Z9({innerType:t,typeName:Cr.ZodNullable,...Zo(e)});Rve=class extends Ms{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Rve.create=(t,e)=>new Rve({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zo(e)});kve=class extends Ms{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 Bxt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new _k(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new _k(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};kve.create=(t,e)=>new kve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zo(e)});w8e=class extends Ms{static{a(this,"yX")}_parse(e){if(this._getType(e)!==kn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};w8e.create=t=>new w8e({typeName:Cr.ZodNaN,...Zo(t)});Fxt=class extends Ms{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}},Uxt=class t extends Ms{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(),r8e(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})}},Pve=class extends Ms{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(Eve(o)&&(o.value=Object.freeze(o.value)),o),"J");return Bxt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Pve.create=(t,e)=>new Pve({innerType:t,typeName:Cr.ZodReadonly,...Zo(e)});lJh={object:OI.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={}));uJh=_ve.create,dJh=E8e.create,fJh=w8e.create,pJh=_8e.create,hJh=v8e.create,mJh=C8e.create,gJh=b8e.create,AJh=vve.create,yJh=Cve.create,EJh=S8e.create,_Jh=dW.create,vJh=VL.create,CJh=T8e.create,bJh=mW.create,aVc=OI.create,SJh=OI.strictCreate,TJh=bve.create,IJh=F8r.create,xJh=Sve.create,wJh=J9.create,RJh=Q8r.create,kJh=I8e.create,PJh=x8e.create,DJh=q8r.create,NJh=Tve.create,MJh=Ive.create,OJh=xve.create,LJh=wve.create,BJh=noe.create,FJh=HN.create,UJh=vk.create,QJh=Z9.create,qJh=HN.createWithPreprocess,jJh=Uxt.create,leo={};zL(leo,{version:a(()=>_to,"version"),util:a(()=>Ws,"util"),treeifyError:a(()=>veo,"treeifyError"),toJSONSchema:a(()=>oUr,"toJSONSchema"),toDotPath:a(()=>Ceo,"toDotPath"),safeParseAsync:a(()=>Bwt,"safeParseAsync"),safeParse:a(()=>Lwt,"safeParse"),registry:a(()=>S9r,"registry"),regexes:a(()=>u9r,"regexes"),prettifyError:a(()=>beo,"prettifyError"),parseAsync:a(()=>Hxt,"parseAsync"),parse:a(()=>jxt,"parse"),locales:a(()=>b9r,"locales"),isValidJWT:a(()=>Gto,"isValidJWT"),isValidBase64URL:a(()=>qto,"isValidBase64URL"),isValidBase64:a(()=>h9r,"isValidBase64"),globalRegistry:a(()=>z9,"globalRegistry"),globalConfig:a(()=>Qxt,"globalConfig"),function:a(()=>fno,"function"),formatError:a(()=>o9r,"formatError"),flattenError:a(()=>i9r,"flattenError"),config:a(()=>tC,"config"),clone:a(()=>zN,"clone"),_xid:a(()=>L9r,"_xid"),_void:a(()=>Jro,"_void"),_uuidv7:a(()=>R9r,"_uuidv7"),_uuidv6:a(()=>w9r,"_uuidv6"),_uuidv4:a(()=>x9r,"_uuidv4"),_uuid:a(()=>I9r,"_uuid"),_url:a(()=>k9r,"_url"),_uppercase:a(()=>Y9r,"_uppercase"),_unknown:a(()=>Wxt,"_unknown"),_union:a(()=>czc,"_union"),_undefined:a(()=>Wro,"_undefined"),_ulid:a(()=>O9r,"_ulid"),_uint64:a(()=>$ro,"_uint64"),_uint32:a(()=>Uro,"_uint32"),_tuple:a(()=>sno,"_tuple"),_trim:a(()=>tUr,"_trim"),_transform:a(()=>Azc,"_transform"),_toUpperCase:a(()=>nUr,"_toUpperCase"),_toLowerCase:a(()=>rUr,"_toLowerCase"),_templateLiteral:a(()=>Izc,"_templateLiteral"),_symbol:a(()=>Vro,"_symbol"),_success:a(()=>Czc,"_success"),_stringbool:a(()=>uno,"_stringbool"),_stringFormat:a(()=>dno,"_stringFormat"),_string:a(()=>Iro,"_string"),_startsWith:a(()=>J9r,"_startsWith"),_size:a(()=>V9r,"_size"),_set:a(()=>pzc,"_set"),_safeParseAsync:a(()=>l9r,"_safeParseAsync"),_safeParse:a(()=>c9r,"_safeParse"),_regex:a(()=>W9r,"_regex"),_refine:a(()=>lno,"_refine"),_record:a(()=>dzc,"_record"),_readonly:a(()=>Tzc,"_readonly"),_property:a(()=>ono,"_property"),_promise:a(()=>wzc,"_promise"),_positive:a(()=>tno,"_positive"),_pipe:a(()=>Szc,"_pipe"),_parseAsync:a(()=>a9r,"_parseAsync"),_parse:a(()=>s9r,"_parse"),_overwrite:a(()=>uoe,"_overwrite"),_optional:a(()=>yzc,"_optional"),_number:a(()=>Nro,"_number"),_nullable:a(()=>Ezc,"_nullable"),_null:a(()=>zro,"_null"),_normalize:a(()=>eUr,"_normalize"),_nonpositive:a(()=>nno,"_nonpositive"),_nonoptional:a(()=>vzc,"_nonoptional"),_nonnegative:a(()=>ino,"_nonnegative"),_never:a(()=>Kro,"_never"),_negative:a(()=>rno,"_negative"),_nativeEnum:a(()=>mzc,"_nativeEnum"),_nanoid:a(()=>D9r,"_nanoid"),_nan:a(()=>eno,"_nan"),_multipleOf:a(()=>D8e,"_multipleOf"),_minSize:a(()=>N8e,"_minSize"),_minLength:a(()=>Nve,"_minLength"),_min:a(()=>PI,"_min"),_mime:a(()=>X9r,"_mime"),_maxSize:a(()=>Uwt,"_maxSize"),_maxLength:a(()=>Qwt,"_maxLength"),_max:a(()=>qN,"_max"),_map:a(()=>fzc,"_map"),_lte:a(()=>qN,"_lte"),_lt:a(()=>ioe,"_lt"),_lowercase:a(()=>z9r,"_lowercase"),_literal:a(()=>gzc,"_literal"),_length:a(()=>qwt,"_length"),_lazy:a(()=>xzc,"_lazy"),_ksuid:a(()=>B9r,"_ksuid"),_jwt:a(()=>$9r,"_jwt"),_isoTime:a(()=>Pro,"_isoTime"),_isoDuration:a(()=>Dro,"_isoDuration"),_isoDateTime:a(()=>Rro,"_isoDateTime"),_isoDate:a(()=>kro,"_isoDate"),_ipv6:a(()=>U9r,"_ipv6"),_ipv4:a(()=>F9r,"_ipv4"),_intersection:a(()=>uzc,"_intersection"),_int64:a(()=>Gro,"_int64"),_int32:a(()=>Fro,"_int32"),_int:a(()=>Oro,"_int"),_includes:a(()=>K9r,"_includes"),_guid:a(()=>Vxt,"_guid"),_gte:a(()=>PI,"_gte"),_gt:a(()=>ooe,"_gt"),_float64:a(()=>Bro,"_float64"),_float32:a(()=>Lro,"_float32"),_file:a(()=>ano,"_file"),_enum:a(()=>hzc,"_enum"),_endsWith:a(()=>Z9r,"_endsWith"),_emoji:a(()=>P9r,"_emoji"),_email:a(()=>T9r,"_email"),_e164:a(()=>G9r,"_e164"),_discriminatedUnion:a(()=>lzc,"_discriminatedUnion"),_default:a(()=>_zc,"_default"),_date:a(()=>Zro,"_date"),_custom:a(()=>cno,"_custom"),_cuid2:a(()=>M9r,"_cuid2"),_cuid:a(()=>N9r,"_cuid"),_coercedString:a(()=>xro,"_coercedString"),_coercedNumber:a(()=>Mro,"_coercedNumber"),_coercedDate:a(()=>Xro,"_coercedDate"),_coercedBoolean:a(()=>qro,"_coercedBoolean"),_coercedBigint:a(()=>Hro,"_coercedBigint"),_cidrv6:a(()=>q9r,"_cidrv6"),_cidrv4:a(()=>Q9r,"_cidrv4"),_catch:a(()=>bzc,"_catch"),_boolean:a(()=>Qro,"_boolean"),_bigint:a(()=>jro,"_bigint"),_base64url:a(()=>H9r,"_base64url"),_base64:a(()=>j9r,"_base64"),_array:a(()=>iUr,"_array"),_any:a(()=>Yro,"_any"),TimePrecision:a(()=>wro,"TimePrecision"),NEVER:a(()=>ueo,"NEVER"),JSONSchemaGenerator:a(()=>M8e,"JSONSchemaGenerator"),JSONSchema:a(()=>Rzc,"JSONSchema"),Doc:a(()=>Gxt,"Doc"),$output:a(()=>Sro,"$output"),$input:a(()=>Tro,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>deo,"$brand"),$ZodXID:a(()=>kto,"$ZodXID"),$ZodVoid:a(()=>ero,"$ZodVoid"),$ZodUnknown:a(()=>$xt,"$ZodUnknown"),$ZodUnion:a(()=>_9r,"$ZodUnion"),$ZodUndefined:a(()=>Kto,"$ZodUndefined"),$ZodUUID:a(()=>Cto,"$ZodUUID"),$ZodURL:a(()=>Sto,"$ZodURL"),$ZodULID:a(()=>Rto,"$ZodULID"),$ZodType:a(()=>bo,"$ZodType"),$ZodTuple:a(()=>Fwt,"$ZodTuple"),$ZodTransform:a(()=>v9r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>Ero,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Yto,"$ZodSymbol"),$ZodSuccess:a(()=>mro,"$ZodSuccess"),$ZodStringFormat:a(()=>Bu,"$ZodStringFormat"),$ZodString:a(()=>V8e,"$ZodString"),$ZodSet:a(()=>sro,"$ZodSet"),$ZodRegistry:a(()=>P8e,"$ZodRegistry"),$ZodRecord:a(()=>iro,"$ZodRecord"),$ZodRealError:a(()=>G8e,"$ZodRealError"),$ZodReadonly:a(()=>yro,"$ZodReadonly"),$ZodPromise:a(()=>_ro,"$ZodPromise"),$ZodPrefault:a(()=>pro,"$ZodPrefault"),$ZodPipe:a(()=>C9r,"$ZodPipe"),$ZodOptional:a(()=>uro,"$ZodOptional"),$ZodObject:a(()=>E9r,"$ZodObject"),$ZodNumberFormat:a(()=>Wto,"$ZodNumberFormat"),$ZodNumber:a(()=>m9r,"$ZodNumber"),$ZodNullable:a(()=>dro,"$ZodNullable"),$ZodNull:a(()=>Jto,"$ZodNull"),$ZodNonOptional:a(()=>hro,"$ZodNonOptional"),$ZodNever:a(()=>Xto,"$ZodNever"),$ZodNanoID:a(()=>Ito,"$ZodNanoID"),$ZodNaN:a(()=>Aro,"$ZodNaN"),$ZodMap:a(()=>oro,"$ZodMap"),$ZodLiteral:a(()=>cro,"$ZodLiteral"),$ZodLazy:a(()=>vro,"$ZodLazy"),$ZodKSUID:a(()=>Pto,"$ZodKSUID"),$ZodJWT:a(()=>$to,"$ZodJWT"),$ZodIntersection:a(()=>nro,"$ZodIntersection"),$ZodISOTime:a(()=>Mto,"$ZodISOTime"),$ZodISODuration:a(()=>Oto,"$ZodISODuration"),$ZodISODateTime:a(()=>Dto,"$ZodISODateTime"),$ZodISODate:a(()=>Nto,"$ZodISODate"),$ZodIPv6:a(()=>Bto,"$ZodIPv6"),$ZodIPv4:a(()=>Lto,"$ZodIPv4"),$ZodGUID:a(()=>vto,"$ZodGUID"),$ZodFunction:a(()=>zxt,"$ZodFunction"),$ZodFile:a(()=>lro,"$ZodFile"),$ZodError:a(()=>n9r,"$ZodError"),$ZodEnum:a(()=>aro,"$ZodEnum"),$ZodEmoji:a(()=>Tto,"$ZodEmoji"),$ZodEmail:a(()=>bto,"$ZodEmail"),$ZodE164:a(()=>Hto,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>rro,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>fro,"$ZodDefault"),$ZodDate:a(()=>tro,"$ZodDate"),$ZodCustomStringFormat:a(()=>Vto,"$ZodCustomStringFormat"),$ZodCustom:a(()=>Cro,"$ZodCustom"),$ZodCheckUpperCase:a(()=>pto,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>$8e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>mto,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>ato,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>dto,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>Ato,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>Eto,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>nto,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>rto,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>sto,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>lto,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>yto,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>oto,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>cto,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>fto,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>f9r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>uto,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>hto,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>p9r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>gto,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>ito,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Ih,"$ZodCheck"),$ZodCatch:a(()=>gro,"$ZodCatch"),$ZodCUID2:a(()=>wto,"$ZodCUID2"),$ZodCUID:a(()=>xto,"$ZodCUID"),$ZodCIDRv6:a(()=>Uto,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>Fto,"$ZodCIDRv4"),$ZodBoolean:a(()=>g9r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>zto,"$ZodBigIntFormat"),$ZodBigInt:a(()=>A9r,"$ZodBigInt"),$ZodBase64URL:a(()=>jto,"$ZodBase64URL"),$ZodBase64:a(()=>Qto,"$ZodBase64"),$ZodAsyncError:a(()=>gW,"$ZodAsyncError"),$ZodArray:a(()=>y9r,"$ZodArray"),$ZodAny:a(()=>Zto,"$ZodAny")});ueo=Object.freeze({status:"aborted"});a(ft,"F");deo=Symbol("zod_brand"),gW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Qxt={};a(tC,"c$");Ws={};zL(Ws,{unwrapMessage:a(()=>n8e,"unwrapMessage"),stringifyPrimitive:a(()=>us,"stringifyPrimitive"),required:a(()=>SVc,"required"),randomString:a(()=>mVc,"randomString"),propertyKeyTypes:a(()=>qxt,"propertyKeyTypes"),promiseAllObject:a(()=>hVc,"promiseAllObject"),primitiveTypes:a(()=>meo,"primitiveTypes"),prefixIssues:a(()=>Ek,"prefixIssues"),pick:a(()=>EVc,"pick"),partial:a(()=>bVc,"partial"),optionalKeys:a(()=>geo,"optionalKeys"),omit:a(()=>_Vc,"omit"),numKeys:a(()=>gVc,"numKeys"),nullish:a(()=>coe,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>CVc,"merge"),jsonStringifyReplacer:a(()=>feo,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>Eeo,"issue"),isPlainObject:a(()=>k8e,"isPlainObject"),isObject:a(()=>R8e,"isObject"),getSizableOrigin:a(()=>Mwt,"getSizableOrigin"),getParsedType:a(()=>AVc,"getParsedType"),getLengthableOrigin:a(()=>Owt,"getLengthableOrigin"),getEnumValues:a(()=>e9r,"getEnumValues"),getElementAtPath:a(()=>pVc,"getElementAtPath"),floatSafeRemainder:a(()=>peo,"floatSafeRemainder"),finalizeIssue:a(()=>GN,"finalizeIssue"),extend:a(()=>vVc,"extend"),escapeRegex:a(()=>loe,"escapeRegex"),esc:a(()=>ove,"esc"),defineLazy:a(()=>zc,"defineLazy"),createTransparentProxy:a(()=>yVc,"createTransparentProxy"),clone:a(()=>zN,"clone"),cleanRegex:a(()=>Nwt,"cleanRegex"),cleanEnum:a(()=>TVc,"cleanEnum"),captureStackTrace:a(()=>r9r,"captureStackTrace"),cached:a(()=>Dwt,"cached"),assignProp:a(()=>t9r,"assignProp"),assertNotEqual:a(()=>lVc,"assertNotEqual"),assertNever:a(()=>dVc,"assertNever"),assertIs:a(()=>uVc,"assertIs"),assertEqual:a(()=>cVc,"assertEqual"),assert:a(()=>fVc,"assert"),allowsEval:a(()=>heo,"allowsEval"),aborted:a(()=>uve,"aborted"),NUMBER_FORMAT_RANGES:a(()=>Aeo,"NUMBER_FORMAT_RANGES"),Class:a(()=>j8r,"Class"),BIGINT_FORMAT_RANGES:a(()=>yeo,"BIGINT_FORMAT_RANGES")});a(cVc,"lh");a(lVc,"ch");a(uVc,"ph");a(dVc,"dh");a(fVc,"ih");a(e9r,"B7");a(Vr,"P");a(feo,"mH");a(Dwt,"z7");a(coe,"I1");a(Nwt,"N7");a(peo,"lH");a(zc,"N$");a(t9r,"cH");a(pVc,"nh");a(hVc,"rh");a(mVc,"oh");a(ove,"j0");r9r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(R8e,"g8");heo=Dwt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(k8e,"h8");a(gVc,"th");AVc=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"),qxt=new Set(["string","number","symbol"]),meo=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(loe,"r4");a(zN,"H6");a(xr,"k");a(yVc,"sh");a(us,"x");a(geo,"iH");Aeo={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]},yeo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(EVc,"eh");a(_Vc,"$u");a(vVc,"Qu");a(CVc,"Ju");a(bVc,"Xu");a(SVc,"Yu");a(uve,"A0");a(Ek,"I6");a(n8e,"V7");a(GN,"g6");a(Mwt,"O7");a(Owt,"D7");a(Eeo,"oH");a(TVc,"Wu");j8r=class{static{a(this,"YM")}constructor(...e){}},_eo=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,feo,2)},enumerable:!0})},"WM"),n9r=ft("$ZodError",_eo),G8e=ft("$ZodError",_eo,{Parent:Error});a(i9r,"m8");a(o9r,"l8");a(veo,"mX");a(Ceo,"GM");a(beo,"lX");s9r=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 gW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>GN(u,s,tC())));throw r9r(l,o?.callee),l}return c.value},"cX"),jxt=s9r(G8e),a9r=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=>GN(u,s,tC())));throw r9r(l,o?.callee),l}return c.value},"pX"),Hxt=a9r(G8e),c9r=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 gW;return s.issues.length?{success:!1,error:new(t??n9r)(s.issues.map(c=>GN(c,o,tC())))}:{success:!0,data:s.value}},"dX"),Lwt=c9r(G8e),l9r=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=>GN(c,o,tC())))}:{success:!0,data:s.value}},"iX"),Bwt=l9r(G8e),u9r={};zL(u9r,{xid:a(()=>xeo,"xid"),uuid7:a(()=>RVc,"uuid7"),uuid6:a(()=>wVc,"uuid6"),uuid4:a(()=>xVc,"uuid4"),uuid:a(()=>Dve,"uuid"),uppercase:a(()=>eto,"uppercase"),unicodeEmail:a(()=>DVc,"unicodeEmail"),undefined:a(()=>Zeo,"undefined"),ulid:a(()=>Ieo,"ulid"),time:a(()=>Geo,"time"),string:a(()=>Veo,"string"),rfc5322Email:a(()=>PVc,"rfc5322Email"),number:a(()=>Yeo,"number"),null:a(()=>Jeo,"null"),nanoid:a(()=>Reo,"nanoid"),lowercase:a(()=>Xeo,"lowercase"),ksuid:a(()=>weo,"ksuid"),ipv6:a(()=>Oeo,"ipv6"),ipv4:a(()=>Meo,"ipv4"),integer:a(()=>zeo,"integer"),html5Email:a(()=>kVc,"html5Email"),hostname:a(()=>Ueo,"hostname"),guid:a(()=>Peo,"guid"),extendedDuration:a(()=>IVc,"extendedDuration"),emoji:a(()=>Neo,"emoji"),email:a(()=>Deo,"email"),e164:a(()=>Qeo,"e164"),duration:a(()=>keo,"duration"),domain:a(()=>OVc,"domain"),datetime:a(()=>$eo,"datetime"),date:a(()=>jeo,"date"),cuid2:a(()=>Teo,"cuid2"),cuid:a(()=>Seo,"cuid"),cidrv6:a(()=>Beo,"cidrv6"),cidrv4:a(()=>Leo,"cidrv4"),browserEmail:a(()=>NVc,"browserEmail"),boolean:a(()=>Keo,"boolean"),bigint:a(()=>Weo,"bigint"),base64url:a(()=>d9r,"base64url"),base64:a(()=>Feo,"base64"),_emoji:a(()=>MVc,"_emoji")});Seo=/^[cC][^\s-]{8,}$/,Teo=/^[0-9a-z]+$/,Ieo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xeo=/^[0-9a-vA-V]{20}$/,weo=/^[A-Za-z0-9]{27}$/,Reo=/^[a-zA-Z0-9_-]{21}$/,keo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,IVc=/^[-+]?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)?)??$/,Peo=/^([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})$/,Dve=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"),xVc=Dve(4),wVc=Dve(6),RVc=Dve(7),Deo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kVc=/^[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])?)*$/,PVc=/^(([^<>()\[\]\\.,;:\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,}))$/,DVc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,NVc=/^[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])?)*$/,MVc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(Neo,"WK");Meo=/^(?:(?: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])$/,Oeo=/^(([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})$/,Leo=/^((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])$/,Beo=/^(([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])$/,Feo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d9r=/^[A-Za-z0-9_-]*$/,Ueo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,OVc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Qeo=/^\+(?:[0-9]){6,14}[0-9]$/,qeo="(?:(?:\\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])))",jeo=new RegExp(`^${qeo}$`);a(Heo,"HM");a(Geo,"NK");a($eo,"wK");Veo=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Weo=/^\d+n?$/,zeo=/^\d+$/,Yeo=/^-?\d+(?:\.\d+)?/i,Keo=/true|false/i,Jeo=/null/i,Zeo=/undefined/i,Xeo=/^[^A-Z]*$/,eto=/^[^a-z]*$/,Ih=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),tto={number:"number",bigint:"bigint",object:"date"},f9r=ft("$ZodCheckLessThan",(t,e)=>{Ih.init(t,e);let r=tto[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{Ih.init(t,e);let r=tto[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})}}),rto=ft("$ZodCheckMultipleOf",(t,e)=>{Ih.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):peo(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})}}),nto=ft("$ZodCheckNumberFormat",(t,e)=>{Ih.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Aeo[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=zeo)}),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})}}),ito=ft("$ZodCheckBigIntFormat",(t,e)=>{Ih.init(t,e);let[r,n]=yeo[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})}}),oto=ft("$ZodCheckMaxSize",(t,e)=>{Ih.init(t,e),t._zod.when=r=>{let n=r.value;return!coe(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:Mwt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),sto=ft("$ZodCheckMinSize",(t,e)=>{Ih.init(t,e),t._zod.when=r=>{let n=r.value;return!coe(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:Mwt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),ato=ft("$ZodCheckSizeEquals",(t,e)=>{Ih.init(t,e),t._zod.when=r=>{let n=r.value;return!coe(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:Mwt(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})}}),cto=ft("$ZodCheckMaxLength",(t,e)=>{Ih.init(t,e),t._zod.when=r=>{let n=r.value;return!coe(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=Owt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),lto=ft("$ZodCheckMinLength",(t,e)=>{Ih.init(t,e),t._zod.when=r=>{let n=r.value;return!coe(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=Owt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),uto=ft("$ZodCheckLengthEquals",(t,e)=>{Ih.init(t,e),t._zod.when=r=>{let n=r.value;return!coe(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=Owt(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})}}),$8e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;Ih.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=()=>{})}),dto=ft("$ZodCheckRegex",(t,e)=>{$8e.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})}}),fto=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Xeo),$8e.init(t,e)}),pto=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=eto),$8e.init(t,e)}),hto=ft("$ZodCheckIncludes",(t,e)=>{Ih.init(t,e);let r=loe(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})}}),mto=ft("$ZodCheckStartsWith",(t,e)=>{Ih.init(t,e);let r=new RegExp(`^${loe(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})}}),gto=ft("$ZodCheckEndsWith",(t,e)=>{Ih.init(t,e);let r=new RegExp(`.*${loe(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(GKi,"KM");Ato=ft("$ZodCheckProperty",(t,e)=>{Ih.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=>GKi(o,r,e.property));GKi(n,r,e.property)}}),yto=ft("$ZodCheckMimeType",(t,e)=>{Ih.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})}}),Eto=ft("$ZodCheckOverwrite",(t,e)=>{Ih.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),Gxt=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(` -`))}},uto={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=uto;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=ave(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 fW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=ave(s,h)))});else{if(s.issues.length===h)continue;u||(u=ave(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 fW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Dwt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Nwt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),q8e=ft("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Leo(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}}),Lu=ft("$ZodStringFormat",(t,e)=>{Q8e.init(t,e),q8e.init(t,e)}),dto=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=veo),Lu.init(t,e)}),fto=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=Rve(r))}else e.pattern??(e.pattern=Rve());Lu.init(t,e)}),pto=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ceo),Lu.init(t,e)}),hto=ft("$ZodURL",(t,e)=>{Lu.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:Reo.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})}}}),mto=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=beo()),Lu.init(t,e)}),gto=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Eeo),Lu.init(t,e)}),Ato=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=heo),Lu.init(t,e)}),yto=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=meo),Lu.init(t,e)}),Eto=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=geo),Lu.init(t,e)}),_to=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Aeo),Lu.init(t,e)}),vto=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=yeo),Lu.init(t,e)}),Cto=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Oeo(e)),Lu.init(t,e)}),bto=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Deo),Lu.init(t,e)}),Sto=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Meo(e)),Lu.init(t,e)}),Tto=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=_eo),Lu.init(t,e)}),Ito=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Seo),Lu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),xto=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Teo),Lu.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})}}}),wto=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ieo),Lu.init(t,e)}),Rto=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=xeo),Lu.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(l9r,"oK");kto=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=weo),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{l9r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Pto,"AM");Dto=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=s9r),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Pto(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Nto=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=keo),Lu.init(t,e)});a(Mto,"IM");Oto=ft("$ZodJWT",(t,e)=>{Lu.init(t,e),t._zod.check=r=>{Mto(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Lto=ft("$ZodCustomStringFormat",(t,e)=>{Lu.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})}}),u9r=ft("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ueo,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}}),Bto=ft("$ZodNumber",(t,e)=>{Weo.init(t,e),u9r.init(t,e)}),d9r=ft("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=Qeo,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}}),f9r=ft("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=Beo,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}}),Fto=ft("$ZodBigInt",(t,e)=>{zeo.init(t,e),f9r.init(t,e)}),Uto=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}}),Qto=ft("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=jeo,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}}),qto=ft("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=qeo,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}}),jto=ft("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),qxt=ft("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),Hto=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)}),Gto=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}}),$to=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(OKi,"BM");p9r=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;cOKi(d,r,c))):OKi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(LIt,"aX");a(LKi,"zM");h9r=ft("$ZodObject",(t,e)=>{Co.init(t,e);let r=wwt(()=>{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=seo(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});zc(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 Qxt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=rve(_);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=rve(_);h.write(` +`))}},_to={major:4,minor:0,patch:0},bo=ft("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=_to;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=uve(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 gW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=uve(s,h)))});else{if(s.issues.length===h)continue;u||(u=uve(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 gW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Lwt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Bwt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),V8e=ft("$ZodString",(t,e)=>{bo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Veo(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}}),Bu=ft("$ZodStringFormat",(t,e)=>{$8e.init(t,e),V8e.init(t,e)}),vto=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Peo),Bu.init(t,e)}),Cto=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=Dve(r))}else e.pattern??(e.pattern=Dve());Bu.init(t,e)}),bto=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Deo),Bu.init(t,e)}),Sto=ft("$ZodURL",(t,e)=>{Bu.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:Ueo.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})}}}),Tto=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Neo()),Bu.init(t,e)}),Ito=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Reo),Bu.init(t,e)}),xto=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Seo),Bu.init(t,e)}),wto=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Teo),Bu.init(t,e)}),Rto=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Ieo),Bu.init(t,e)}),kto=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=xeo),Bu.init(t,e)}),Pto=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=weo),Bu.init(t,e)}),Dto=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=$eo(e)),Bu.init(t,e)}),Nto=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=jeo),Bu.init(t,e)}),Mto=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Geo(e)),Bu.init(t,e)}),Oto=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=keo),Bu.init(t,e)}),Lto=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Meo),Bu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Bto=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Oeo),Bu.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})}}}),Fto=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Leo),Bu.init(t,e)}),Uto=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Beo),Bu.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(h9r,"oK");Qto=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Feo),Bu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{h9r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(qto,"AM");jto=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=d9r),Bu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{qto(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Hto=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Qeo),Bu.init(t,e)});a(Gto,"IM");$to=ft("$ZodJWT",(t,e)=>{Bu.init(t,e),t._zod.check=r=>{Gto(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Vto=ft("$ZodCustomStringFormat",(t,e)=>{Bu.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})}}),m9r=ft("$ZodNumber",(t,e)=>{bo.init(t,e),t._zod.pattern=t._zod.bag.pattern??Yeo,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}}),Wto=ft("$ZodNumber",(t,e)=>{nto.init(t,e),m9r.init(t,e)}),g9r=ft("$ZodBoolean",(t,e)=>{bo.init(t,e),t._zod.pattern=Keo,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}}),A9r=ft("$ZodBigInt",(t,e)=>{bo.init(t,e),t._zod.pattern=Weo,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}}),zto=ft("$ZodBigInt",(t,e)=>{ito.init(t,e),A9r.init(t,e)}),Yto=ft("$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}}),Kto=ft("$ZodUndefined",(t,e)=>{bo.init(t,e),t._zod.pattern=Zeo,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}}),Jto=ft("$ZodNull",(t,e)=>{bo.init(t,e),t._zod.pattern=Jeo,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}}),Zto=ft("$ZodAny",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),$xt=ft("$ZodUnknown",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),Xto=ft("$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)}),ero=ft("$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}}),tro=ft("$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($Ki,"BM");y9r=ft("$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;c$Ki(d,r,c))):$Ki(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(QIt,"aX");a(VKi,"zM");E9r=ft("$ZodObject",(t,e)=>{bo.init(t,e);let r=Dwt(()=>{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=geo(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});zc(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 Gxt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=ove(_);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=ove(_);h.write(` if (${v}.issues.length) { if (input[${b}] === undefined) { if (${b} in input) { @@ -1610,20 +1610,20 @@ 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 ? [${rve(_)}, ...iss.path] : [${rve(_)}] - })));`),h.write(`newResult[${rve(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=S8e,c=!Lxt.jitless,l=c&&ieo.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?LKi(x,f,b,m):LIt(x,f,b))):R?LKi(w,f,b,m):LIt(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=>LIt(T,f,v))):LIt(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(BKi,"NM");m9r=ft("$ZodUnion",(t,e)=>{Co.init(t,e),zc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),zc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),zc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),zc(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=>Rwt(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=>BKi(c,r,t,n)):BKi(s,r,t,n)}}),Vto=ft("$ZodDiscriminatedUnion",(t,e)=>{m9r.init(t,e);let r=t._zod.parse;zc(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=wwt(()=>{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(!S8e(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)}}),Wto=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])=>FKi(r,l,u)):FKi(r,s,c)}});a(F8r,"pK");a(FKi,"wM");Mwt=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=>BIt(h,o,u))):BIt(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=>BIt(m,o,u))):BIt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(BIt,"sX");zto=ft("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!T8e(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(...Ak(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Ak(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=>qN(d,n,Xv())),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(...Ak(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Ak(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Yto=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])=>{UKi(f,h,r,c,o,t,n)})):UKi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(UKi,"OM");Kto=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=>QKi(u,r))):QKi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(QKi,"DM");Jto=ft("$ZodEnum",(t,e)=>{Co.init(t,e);let r=Y6r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Bxt.has(typeof n)).map(n=>typeof n=="string"?coe(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}}),Zto=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"?coe(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}}),Xto=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}}),g9r=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 fW;return r.value=o,r}}),ero=ft("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rwt(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)}),tro=ft("$ZodNullable",(t,e)=>{Co.init(t,e),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rwt(r.source)}|null)$`):void 0}),zc(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)}),rro=ft("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(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=>qKi(s,e)):qKi(o,e)}});a(qKi,"FM");nro=ft("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(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))}),iro=ft("$ZodNonOptional",(t,e)=>{Co.init(t,e),zc(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=>jKi(s,t)):jKi(o,t)}});a(jKi,"ZM");oro=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)}}),sro=ft("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(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=>qN(c,n,Xv()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>qN(s,n,Xv()))},input:r.value}),r.issues=[]),r)}}),aro=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)}),A9r=ft("$ZodPipe",(t,e)=>{Co.init(t,e),zc(t._zod,"values",()=>e.in._zod.values),zc(t._zod,"optin",()=>e.in._zod.optin),zc(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=>HKi(s,e,n)):HKi(o,e,n)}});a(HKi,"MM");cro=ft("$ZodReadonly",(t,e)=>{Co.init(t,e),zc(t._zod,"propValues",()=>e.innerType._zod.propValues),zc(t._zod,"values",()=>e.innerType._zod.values),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(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(GKi):GKi(o)}});a(GKi,"LM");lro=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||oeo.has(typeof n))r.push(coe(`${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)}),uro=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))}),dro=ft("$ZodLazy",(t,e)=>{Co.init(t,e),zc(t._zod,"innerType",()=>e.getter()),zc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),zc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),zc(t._zod,"optin",()=>t._zod.innerType._zod.optin),zc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),fro=ft("$ZodCustom",(t,e)=>{Sh.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=>$Ki(s,r,n,t));$Ki(o,r,n,t)}});a($Ki,"jM");y9r={};WL(y9r,{zhTW:a(()=>HWc,"zhTW"),zhCN:a(()=>qWc,"zhCN"),vi:a(()=>UWc,"vi"),ur:a(()=>BWc,"ur"),ua:a(()=>OWc,"ua"),tr:a(()=>NWc,"tr"),th:a(()=>kWc,"th"),ta:a(()=>wWc,"ta"),sv:a(()=>IWc,"sv"),sl:a(()=>SWc,"sl"),ru:a(()=>CWc,"ru"),pt:a(()=>_Wc,"pt"),ps:a(()=>gWc,"ps"),pl:a(()=>yWc,"pl"),ota:a(()=>hWc,"ota"),no:a(()=>fWc,"no"),nl:a(()=>uWc,"nl"),ms:a(()=>cWc,"ms"),mk:a(()=>sWc,"mk"),ko:a(()=>iWc,"ko"),kh:a(()=>rWc,"kh"),ja:a(()=>eWc,"ja"),it:a(()=>ZVc,"it"),id:a(()=>KVc,"id"),hu:a(()=>zVc,"hu"),he:a(()=>VVc,"he"),frCA:a(()=>GVc,"frCA"),fr:a(()=>jVc,"fr"),fi:a(()=>QVc,"fi"),fa:a(()=>FVc,"fa"),es:a(()=>LVc,"es"),eo:a(()=>MVc,"eo"),en:a(()=>pro,"en"),de:a(()=>RVc,"de"),cs:a(()=>xVc,"cs"),ca:a(()=>TVc,"ca"),be:a(()=>bVc,"be"),az:a(()=>vVc,"az"),ar:a(()=>EVc,"ar")});yVc=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 ${us(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: ${Vr(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":""}: ${Vr(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(EVc,"tK");_Vc=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 ${us(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Vr(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":""}: ${Vr(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(vVc,"aK");a(VKi,"PM");CVc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=VKi(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=VKi(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"}: ${Vr(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(bVc,"sK");SVc=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 ${us(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Vr(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":""}: ${Vr(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(TVc,"eK");IVc=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 ${us(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Vr(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: ${Vr(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(xVc,"$q");wVc=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 ${us(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Vr(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"}: ${Vr(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(RVc,"Qq");kVc=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"),PVc=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 ${kVc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${us(n.values[0])}`:`Invalid option: expected one of ${Vr(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":""}: ${Vr(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(pro,"A7");DVc=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"),NVc=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 ${DVc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${us(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Vr(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":""}: ${Vr(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(MVc,"Jq");OVc=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 ${us(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Vr(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":""}: ${Vr(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(LVc,"Xq");BVc=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 ${us(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 ${Vr(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: ${Vr(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(FVc,"Yq");UVc=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 ${us(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Vr(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"}: ${Vr(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(QVc,"Wq");qVc=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 : ${us(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Vr(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":""} : ${Vr(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(jVc,"Gq");HVc=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 ${us(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Vr(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":""} : ${Vr(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(GVc,"Uq");$Vc=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 ${us(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 ${Vr(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"}: ${Vr(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(VVc,"Hq");WVc=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 ${us(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Vr(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":""}: ${Vr(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(zVc,"Kq");YVc=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 ${us(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Vr(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":""}: ${Vr(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(KVc,"qq");JVc=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 ${us(o.values[0])}`:`Opzione non valida: atteso uno tra ${Vr(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"}: ${Vr(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(ZVc,"Vq");XVc=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: ${us(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Vr(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":""}: ${Vr(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(eWc,"Bq");tWc=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 ${us(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 ${Vr(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 ${Vr(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(rWc,"zq");nWc=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 ${us(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Vr(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: ${Vr(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(iWc,"Nq");oWc=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 ${us(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 ${Vr(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"}: ${Vr(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(sWc,"wq");aWc=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 ${us(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Vr(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: ${Vr(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(cWc,"Oq");lWc=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 ${us(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Vr(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":""}: ${Vr(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(uWc,"Dq");dWc=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 ${us(o.values[0])}`:`Ugyldig valg: forventet en av ${Vr(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"}: ${Vr(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(fWc,"Fq");pWc=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 ${us(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Vr(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":""}: ${Vr(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(hWc,"Zq");mWc=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 ${us(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Vr(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"}: ${Vr(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(gWc,"Mq");AWc=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 ${us(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Vr(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":""}: ${Vr(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(yWc,"Lq");EWc=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 ${us(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Vr(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":""}: ${Vr(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(_Wc,"jq");a(WKi,"EM");vWc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=WKi(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=WKi(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":""}: ${Vr(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(CWc,"Aq");bWc=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 ${us(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Vr(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"}: ${Vr(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(SWc,"Iq");TWc=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 ${us(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Vr(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"}: ${Vr(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(IWc,"Rq");xWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(wWc,"Pq");RWc=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 ${us(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 ${Vr(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: ${Vr(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(kWc,"Eq");PWc=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"),DWc=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 ${PWc(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${us(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Vr(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":""}: ${Vr(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(NWc,"bq");MWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(OWc,"_q");LWc=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: ${us(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Vr(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":""}: ${Vr(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(BWc,"kq");FWc=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 ${us(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 ${Vr(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: ${Vr(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(UWc,"Sq");QWc=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 ${us(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Vr(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): ${Vr(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(qWc,"vq");jWc=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 ${us(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Vr(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${Vr(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(HWc,"Cq");hro=Symbol("ZodOutput"),mro=Symbol("ZodInput"),I8e=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(E9r,"R7");V9=E9r();a(gro,"aY");a(Aro,"Tq");a(_9r,"P7");a(jxt,"o8");a(v9r,"E7");a(C9r,"b7");a(b9r,"_7");a(S9r,"k7");a(T9r,"S7");a(I9r,"v7");a(x9r,"C7");a(w9r,"T7");a(R9r,"x7");a(k9r,"y7");a(P9r,"f7");a(D9r,"g7");a(N9r,"h7");a(M9r,"u7");a(O9r,"m7");a(L9r,"l7");a(B9r,"c7");a(F9r,"p7");a(U9r,"d7");a(Q9r,"i7");yro={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(Ero,"xq");a(_ro,"yq");a(vro,"fq");a(Cro,"gq");a(bro,"eY");a(Sro,"hq");a(Tro,"$3");a(Iro,"Q3");a(xro,"J3");a(wro,"X3");a(Rro,"Y3");a(kro,"W3");a(Pro,"uq");a(Dro,"G3");a(Nro,"mq");a(Mro,"U3");a(Oro,"H3");a(Lro,"K3");a(Bro,"q3");a(Fro,"V3");a(Uro,"B3");a(Hxt,"b0");a(Qro,"z3");a(qro,"N3");a(jro,"w3");a(Hro,"lq");a(Gro,"O3");a(noe,"o4");a(FN,"t6");a(ioe,"t4");a(RI,"P6");a($ro,"cq");a(Vro,"pq");a(Wro,"dq");a(zro,"iq");a(x8e,"_0");a(Owt,"t8");a(w8e,"k0");a(q9r,"n7");a(Lwt,"a8");a(kve,"k1");a(Bwt,"s8");a(j9r,"r7");a(H9r,"o7");a(G9r,"t7");a($9r,"a7");a(V9r,"s7");a(W9r,"e7");a(Yro,"nq");a(z9r,"$J");a(loe,"a4");a(Y9r,"QJ");a(K9r,"JJ");a(J9r,"XJ");a(Z9r,"YJ");a(X9r,"WJ");a(GWc,"Wm");a($Wc,"Gm");a(VWc,"Um");a(Kro,"rq");a(WWc,"Hm");a(zWc,"Km");a(YWc,"qm");a(KWc,"Vm");a(JWc,"Bm");a(ZWc,"zm");a(Jro,"D3");a(XWc,"Nm");a(ezc,"wm");a(tzc,"Om");a(rzc,"Dm");a(nzc,"Fm");a(izc,"Zm");a(ozc,"Mm");a(szc,"Lm");a(azc,"jm");a(czc,"Am");a(lzc,"Im");a(uzc,"Rm");a(Zro,"F3");a(Xro,"Z3");a(eno,"M3");a(tno,"L3");Gxt=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?Fxt(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?Fxt(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 Uxt(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?Uxt(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 Mwt({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(rno,"j3");R8e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??V9,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=Y6r(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"&&q0(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 ? [${ove(_)}, ...iss.path] : [${ove(_)}] + })));`),h.write(`newResult[${ove(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=R8e,c=!Qxt.jitless,l=c&&heo.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?VKi(x,f,b,m):QIt(x,f,b))):R?VKi(w,f,b,m):QIt(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=>QIt(T,f,v))):QIt(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(WKi,"NM");_9r=ft("$ZodUnion",(t,e)=>{bo.init(t,e),zc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),zc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),zc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),zc(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=>Nwt(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=>WKi(c,r,t,n)):WKi(s,r,t,n)}}),rro=ft("$ZodDiscriminatedUnion",(t,e)=>{_9r.init(t,e);let r=t._zod.parse;zc(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=Dwt(()=>{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(!R8e(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)}}),nro=ft("$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])=>zKi(r,l,u)):zKi(r,s,c)}});a(H8r,"pK");a(zKi,"wM");Fwt=ft("$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=>qIt(h,o,u))):qIt(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=>qIt(m,o,u))):qIt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(qIt,"sX");iro=ft("$ZodRecord",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!k8e(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(...Ek(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Ek(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=>GN(d,n,tC())),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(...Ek(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Ek(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),oro=ft("$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])=>{YKi(f,h,r,c,o,t,n)})):YKi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(YKi,"OM");sro=ft("$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=>KKi(u,r))):KKi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(KKi,"DM");aro=ft("$ZodEnum",(t,e)=>{bo.init(t,e);let r=e9r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>qxt.has(typeof n)).map(n=>typeof n=="string"?loe(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}}),cro=ft("$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"?loe(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}}),lro=ft("$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}}),v9r=ft("$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 gW;return r.value=o,r}}),uro=ft("$ZodOptional",(t,e)=>{bo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Nwt(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)}),dro=ft("$ZodNullable",(t,e)=>{bo.init(t,e),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Nwt(r.source)}|null)$`):void 0}),zc(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)}),fro=ft("$ZodDefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",zc(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=>JKi(s,e)):JKi(o,e)}});a(JKi,"FM");pro=ft("$ZodPrefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",zc(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))}),hro=ft("$ZodNonOptional",(t,e)=>{bo.init(t,e),zc(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=>ZKi(s,t)):ZKi(o,t)}});a(ZKi,"ZM");mro=ft("$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)}}),gro=ft("$ZodCatch",(t,e)=>{bo.init(t,e),t._zod.optin="optional",zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(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=>GN(c,n,tC()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>GN(s,n,tC()))},input:r.value}),r.issues=[]),r)}}),Aro=ft("$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)}),C9r=ft("$ZodPipe",(t,e)=>{bo.init(t,e),zc(t._zod,"values",()=>e.in._zod.values),zc(t._zod,"optin",()=>e.in._zod.optin),zc(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=>XKi(s,e,n)):XKi(o,e,n)}});a(XKi,"MM");yro=ft("$ZodReadonly",(t,e)=>{bo.init(t,e),zc(t._zod,"propValues",()=>e.innerType._zod.propValues),zc(t._zod,"values",()=>e.innerType._zod.values),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(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(eJi):eJi(o)}});a(eJi,"LM");Ero=ft("$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||meo.has(typeof n))r.push(loe(`${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)}),_ro=ft("$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))}),vro=ft("$ZodLazy",(t,e)=>{bo.init(t,e),zc(t._zod,"innerType",()=>e.getter()),zc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),zc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),zc(t._zod,"optin",()=>t._zod.innerType._zod.optin),zc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),Cro=ft("$ZodCustom",(t,e)=>{Ih.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=>tJi(s,r,n,t));tJi(o,r,n,t)}});a(tJi,"jM");b9r={};zL(b9r,{zhTW:a(()=>azc,"zhTW"),zhCN:a(()=>ozc,"zhCN"),vi:a(()=>nzc,"vi"),ur:a(()=>tzc,"ur"),ua:a(()=>XWc,"ua"),tr:a(()=>JWc,"tr"),th:a(()=>zWc,"th"),ta:a(()=>VWc,"ta"),sv:a(()=>GWc,"sv"),sl:a(()=>jWc,"sl"),ru:a(()=>QWc,"ru"),pt:a(()=>FWc,"pt"),ps:a(()=>MWc,"ps"),pl:a(()=>LWc,"pl"),ota:a(()=>DWc,"ota"),no:a(()=>kWc,"no"),nl:a(()=>wWc,"nl"),ms:a(()=>IWc,"ms"),mk:a(()=>SWc,"mk"),ko:a(()=>CWc,"ko"),kh:a(()=>_Wc,"kh"),ja:a(()=>yWc,"ja"),it:a(()=>gWc,"it"),id:a(()=>hWc,"id"),hu:a(()=>fWc,"hu"),he:a(()=>uWc,"he"),frCA:a(()=>cWc,"frCA"),fr:a(()=>sWc,"fr"),fi:a(()=>iWc,"fi"),fa:a(()=>rWc,"fa"),es:a(()=>eWc,"es"),eo:a(()=>ZVc,"eo"),en:a(()=>bro,"en"),de:a(()=>WVc,"de"),cs:a(()=>$Vc,"cs"),ca:a(()=>HVc,"ca"),be:a(()=>qVc,"be"),az:a(()=>UVc,"az"),ar:a(()=>BVc,"ar")});LVc=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 ${us(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: ${Vr(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":""}: ${Vr(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(BVc,"tK");FVc=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 ${us(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Vr(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":""}: ${Vr(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(UVc,"aK");a(rJi,"PM");QVc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=rJi(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=rJi(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"}: ${Vr(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(qVc,"sK");jVc=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 ${us(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Vr(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":""}: ${Vr(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(HVc,"eK");GVc=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 ${us(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Vr(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: ${Vr(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($Vc,"$q");VVc=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 ${us(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Vr(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"}: ${Vr(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(WVc,"Qq");zVc=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"),YVc=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 ${zVc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${us(n.values[0])}`:`Invalid option: expected one of ${Vr(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":""}: ${Vr(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(bro,"A7");KVc=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"),JVc=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 ${KVc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${us(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Vr(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":""}: ${Vr(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(ZVc,"Jq");XVc=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 ${us(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Vr(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":""}: ${Vr(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(eWc,"Xq");tWc=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 ${us(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 ${Vr(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: ${Vr(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(rWc,"Yq");nWc=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 ${us(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Vr(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"}: ${Vr(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(iWc,"Wq");oWc=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 : ${us(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Vr(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":""} : ${Vr(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(sWc,"Gq");aWc=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 ${us(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Vr(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":""} : ${Vr(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(cWc,"Uq");lWc=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 ${us(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 ${Vr(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"}: ${Vr(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(uWc,"Hq");dWc=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 ${us(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Vr(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":""}: ${Vr(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(fWc,"Kq");pWc=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 ${us(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Vr(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":""}: ${Vr(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(hWc,"qq");mWc=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 ${us(o.values[0])}`:`Opzione non valida: atteso uno tra ${Vr(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"}: ${Vr(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(gWc,"Vq");AWc=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: ${us(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Vr(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":""}: ${Vr(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(yWc,"Bq");EWc=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 ${us(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 ${Vr(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 ${Vr(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(_Wc,"zq");vWc=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 ${us(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Vr(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: ${Vr(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(CWc,"Nq");bWc=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 ${us(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 ${Vr(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"}: ${Vr(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(SWc,"wq");TWc=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 ${us(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Vr(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: ${Vr(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(IWc,"Oq");xWc=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 ${us(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Vr(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":""}: ${Vr(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(wWc,"Dq");RWc=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 ${us(o.values[0])}`:`Ugyldig valg: forventet en av ${Vr(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"}: ${Vr(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(kWc,"Fq");PWc=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 ${us(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Vr(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":""}: ${Vr(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(DWc,"Zq");NWc=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 ${us(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Vr(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"}: ${Vr(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(MWc,"Mq");OWc=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 ${us(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Vr(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":""}: ${Vr(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(LWc,"Lq");BWc=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 ${us(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Vr(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":""}: ${Vr(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(FWc,"jq");a(nJi,"EM");UWc=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 ${us(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 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=nJi(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=nJi(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":""}: ${Vr(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(QWc,"Aq");qWc=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 ${us(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Vr(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"}: ${Vr(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(jWc,"Iq");HWc=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 ${us(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Vr(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"}: ${Vr(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(GWc,"Rq");$Wc=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 ${us(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 ${Vr(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":""}: ${Vr(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(VWc,"Pq");WWc=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 ${us(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 ${Vr(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: ${Vr(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(zWc,"Eq");YWc=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"),KWc=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 ${YWc(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${us(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Vr(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":""}: ${Vr(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(JWc,"bq");ZWc=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 ${us(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 ${Vr(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":""}: ${Vr(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(XWc,"_q");ezc=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: ${us(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Vr(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":""}: ${Vr(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(tzc,"kq");rzc=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 ${us(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 ${Vr(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: ${Vr(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(nzc,"Sq");izc=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 ${us(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Vr(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): ${Vr(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(ozc,"vq");szc=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 ${us(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Vr(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${Vr(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(azc,"Cq");Sro=Symbol("ZodOutput"),Tro=Symbol("ZodInput"),P8e=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(S9r,"R7");z9=S9r();a(Iro,"aY");a(xro,"Tq");a(T9r,"P7");a(Vxt,"o8");a(I9r,"E7");a(x9r,"b7");a(w9r,"_7");a(R9r,"k7");a(k9r,"S7");a(P9r,"v7");a(D9r,"C7");a(N9r,"T7");a(M9r,"x7");a(O9r,"y7");a(L9r,"f7");a(B9r,"g7");a(F9r,"h7");a(U9r,"u7");a(Q9r,"m7");a(q9r,"l7");a(j9r,"c7");a(H9r,"p7");a(G9r,"d7");a($9r,"i7");wro={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(Rro,"xq");a(kro,"yq");a(Pro,"fq");a(Dro,"gq");a(Nro,"eY");a(Mro,"hq");a(Oro,"$3");a(Lro,"Q3");a(Bro,"J3");a(Fro,"X3");a(Uro,"Y3");a(Qro,"W3");a(qro,"uq");a(jro,"G3");a(Hro,"mq");a(Gro,"U3");a($ro,"H3");a(Vro,"K3");a(Wro,"q3");a(zro,"V3");a(Yro,"B3");a(Wxt,"b0");a(Kro,"z3");a(Jro,"N3");a(Zro,"w3");a(Xro,"lq");a(eno,"O3");a(ioe,"o4");a(qN,"t6");a(ooe,"t4");a(PI,"P6");a(tno,"cq");a(rno,"pq");a(nno,"dq");a(ino,"iq");a(D8e,"_0");a(Uwt,"t8");a(N8e,"k0");a(V9r,"n7");a(Qwt,"a8");a(Nve,"k1");a(qwt,"s8");a(W9r,"r7");a(z9r,"o7");a(Y9r,"t7");a(K9r,"a7");a(J9r,"s7");a(Z9r,"e7");a(ono,"nq");a(X9r,"$J");a(uoe,"a4");a(eUr,"QJ");a(tUr,"JJ");a(rUr,"XJ");a(nUr,"YJ");a(iUr,"WJ");a(czc,"Wm");a(lzc,"Gm");a(uzc,"Um");a(sno,"rq");a(dzc,"Hm");a(fzc,"Km");a(pzc,"qm");a(hzc,"Vm");a(mzc,"Bm");a(gzc,"zm");a(ano,"D3");a(Azc,"Nm");a(yzc,"wm");a(Ezc,"Om");a(_zc,"Dm");a(vzc,"Fm");a(Czc,"Zm");a(bzc,"Mm");a(Szc,"Lm");a(Tzc,"jm");a(Izc,"Am");a(xzc,"Im");a(wzc,"Rm");a(cno,"F3");a(lno,"Z3");a(uno,"M3");a(dno,"L3");zxt=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?jxt(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?jxt(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 Hxt(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?Hxt(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 Fwt({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(fno,"j3");M8e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??z9,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=e9r(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"&&j0(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(eUr,"e8");a(q0,"t$");dzc={},fzc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>Fxt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Dwt(t,r,n),t.parseAsync=async(r,n)=>Uxt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Nwt(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)=>$N(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),pzc=ft("ZodMiniObject",(t,e)=>{h9r.init(t,e),fzc.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape)});a(zKi,"tq");a(VL,"a6");a(nve,"S0");a(r8e,"S1");a(qFr,"I3");a(j8e,"v1");a(QFe,"$9");a(jFr,"R3");a(hzc,"_M");a(mzc,"kM");a(nno,"P3");G={};WL(G,{xid:a(()=>Rzc,"xid"),void:a(()=>Kzc,"void"),uuidv7:a(()=>Czc,"uuidv7"),uuidv6:a(()=>vzc,"uuidv6"),uuidv4:a(()=>_zc,"uuidv4"),uuid:a(()=>Ezc,"uuid"),url:a(()=>bzc,"url"),uppercase:a(()=>G9r,"uppercase"),unknown:a(()=>of,"unknown"),union:a(()=>ou,"union"),undefined:a(()=>zzc,"undefined"),ulid:a(()=>wzc,"ulid"),uint64:a(()=>Vzc,"uint64"),uint32:a(()=>Hzc,"uint32"),tuple:a(()=>eYc,"tuple"),trim:a(()=>K9r,"trim"),treeifyError:a(()=>deo,"treeifyError"),transform:a(()=>PUr,"transform"),toUpperCase:a(()=>Z9r,"toUpperCase"),toLowerCase:a(()=>J9r,"toLowerCase"),toJSONSchema:a(()=>eUr,"toJSONSchema"),templateLiteral:a(()=>lYc,"templateLiteral"),symbol:a(()=>Wzc,"symbol"),superRefine:a(()=>zno,"superRefine"),success:a(()=>aYc,"success"),stringbool:a(()=>fYc,"stringbool"),stringFormat:a(()=>Uzc,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>Xzc,"strictObject"),startsWith:a(()=>V9r,"startsWith"),size:a(()=>q9r,"size"),setErrorMap:a(()=>mYc,"setErrorMap"),set:a(()=>nYc,"set"),safeParseAsync:a(()=>fno,"safeParseAsync"),safeParse:a(()=>dno,"safeParse"),registry:a(()=>E9r,"registry"),regexes:a(()=>o9r,"regexes"),regex:a(()=>j9r,"regex"),refine:a(()=>Wno,"refine"),record:a(()=>iu,"record"),readonly:a(()=>Qno,"readonly"),property:a(()=>Yro,"property"),promise:a(()=>uYc,"promise"),prettifyError:a(()=>peo,"prettifyError"),preprocess:a(()=>OUr,"preprocess"),prefault:a(()=>Nno,"prefault"),positive:a(()=>$ro,"positive"),pipe:a(()=>Wxt,"pipe"),partialRecord:a(()=>tYc,"partialRecord"),parseAsync:a(()=>uno,"parseAsync"),parse:a(()=>lno,"parse"),overwrite:a(()=>loe,"overwrite"),optional:a(()=>bd,"optional"),object:a(()=>Tn,"object"),number:a(()=>Nc,"number"),nullish:a(()=>sYc,"nullish"),nullable:a(()=>Vxt,"nullable"),null:a(()=>TUr,"null"),normalize:a(()=>Y9r,"normalize"),nonpositive:a(()=>Wro,"nonpositive"),nonoptional:a(()=>Mno,"nonoptional"),nonnegative:a(()=>zro,"nonnegative"),never:a(()=>jwt,"never"),negative:a(()=>Vro,"negative"),nativeEnum:a(()=>iYc,"nativeEnum"),nanoid:a(()=>Tzc,"nanoid"),nan:a(()=>cYc,"nan"),multipleOf:a(()=>x8e,"multipleOf"),minSize:a(()=>w8e,"minSize"),minLength:a(()=>kve,"minLength"),mime:a(()=>z9r,"mime"),maxSize:a(()=>Owt,"maxSize"),maxLength:a(()=>Lwt,"maxLength"),map:a(()=>rYc,"map"),lte:a(()=>FN,"lte"),lt:a(()=>noe,"lt"),lowercase:a(()=>H9r,"lowercase"),looseObject:a(()=>Kv,"looseObject"),locales:a(()=>y9r,"locales"),literal:a(()=>ti,"literal"),length:a(()=>Bwt,"length"),lazy:a(()=>Hno,"lazy"),ksuid:a(()=>kzc,"ksuid"),keyof:a(()=>Zzc,"keyof"),jwt:a(()=>Fzc,"jwt"),json:a(()=>pYc,"json"),iso:a(()=>tUr,"iso"),ipv6:a(()=>Dzc,"ipv6"),ipv4:a(()=>Pzc,"ipv4"),intersection:a(()=>Gwt,"intersection"),int64:a(()=>$zc,"int64"),int32:a(()=>jzc,"int32"),int:a(()=>U8r,"int"),instanceof:a(()=>dYc,"instanceof"),includes:a(()=>$9r,"includes"),guid:a(()=>yzc,"guid"),gte:a(()=>RI,"gte"),gt:a(()=>ioe,"gt"),globalRegistry:a(()=>V9,"globalRegistry"),getErrorMap:a(()=>gYc,"getErrorMap"),function:a(()=>rno,"function"),formatError:a(()=>e9r,"formatError"),float64:a(()=>qzc,"float64"),float32:a(()=>Qzc,"float32"),flattenError:a(()=>X6r,"flattenError"),file:a(()=>oYc,"file"),enum:a(()=>N1,"enum"),endsWith:a(()=>W9r,"endsWith"),emoji:a(()=>Szc,"emoji"),email:a(()=>Azc,"email"),e164:a(()=>Bzc,"e164"),discriminatedUnion:a(()=>wUr,"discriminatedUnion"),date:a(()=>Jzc,"date"),custom:a(()=>Vno,"custom"),cuid2:a(()=>xzc,"cuid2"),cuid:a(()=>Izc,"cuid"),core:a(()=>XXi,"core"),config:a(()=>Xv,"config"),coerce:a(()=>Yno,"coerce"),clone:a(()=>$N,"clone"),cidrv6:a(()=>Mzc,"cidrv6"),cidrv4:a(()=>Nzc,"cidrv4"),check:a(()=>$no,"check"),catch:a(()=>Bno,"catch"),boolean:a(()=>j0,"boolean"),bigint:a(()=>Gzc,"bigint"),base64url:a(()=>Lzc,"base64url"),base64:a(()=>Ozc,"base64"),array:a(()=>Ca,"array"),any:a(()=>Yzc,"any"),_default:a(()=>Pno,"_default"),_ZodString:a(()=>sUr,"_ZodString"),ZodXID:a(()=>hUr,"ZodXID"),ZodVoid:a(()=>_no,"ZodVoid"),ZodUnknown:a(()=>yno,"ZodUnknown"),ZodUnion:a(()=>xUr,"ZodUnion"),ZodUndefined:a(()=>mno,"ZodUndefined"),ZodUUID:a(()=>W9,"ZodUUID"),ZodURL:a(()=>cUr,"ZodURL"),ZodULID:a(()=>pUr,"ZodULID"),ZodType:a(()=>Os,"ZodType"),ZodTuple:a(()=>Sno,"ZodTuple"),ZodTransform:a(()=>kUr,"ZodTransform"),ZodTemplateLiteral:a(()=>qno,"ZodTemplateLiteral"),ZodSymbol:a(()=>hno,"ZodSymbol"),ZodSuccess:a(()=>Ono,"ZodSuccess"),ZodStringFormat:a(()=>Td,"ZodStringFormat"),ZodString:a(()=>Fwt,"ZodString"),ZodSet:a(()=>Ino,"ZodSet"),ZodRecord:a(()=>RUr,"ZodRecord"),ZodRealError:a(()=>H8e,"ZodRealError"),ZodReadonly:a(()=>Uno,"ZodReadonly"),ZodPromise:a(()=>Gno,"ZodPromise"),ZodPrefault:a(()=>Dno,"ZodPrefault"),ZodPipe:a(()=>MUr,"ZodPipe"),ZodOptional:a(()=>DUr,"ZodOptional"),ZodObject:a(()=>Hwt,"ZodObject"),ZodNumberFormat:a(()=>Hve,"ZodNumberFormat"),ZodNumber:a(()=>Uwt,"ZodNumber"),ZodNullable:a(()=>Rno,"ZodNullable"),ZodNull:a(()=>gno,"ZodNull"),ZodNonOptional:a(()=>NUr,"ZodNonOptional"),ZodNever:a(()=>Eno,"ZodNever"),ZodNanoID:a(()=>uUr,"ZodNanoID"),ZodNaN:a(()=>Fno,"ZodNaN"),ZodMap:a(()=>Tno,"ZodMap"),ZodLiteral:a(()=>xno,"ZodLiteral"),ZodLazy:a(()=>jno,"ZodLazy"),ZodKSUID:a(()=>mUr,"ZodKSUID"),ZodJWT:a(()=>bUr,"ZodJWT"),ZodIssueCode:a(()=>hYc,"ZodIssueCode"),ZodIntersection:a(()=>bno,"ZodIntersection"),ZodISOTime:a(()=>iUr,"ZodISOTime"),ZodISODuration:a(()=>oUr,"ZodISODuration"),ZodISODateTime:a(()=>rUr,"ZodISODateTime"),ZodISODate:a(()=>nUr,"ZodISODate"),ZodIPv6:a(()=>AUr,"ZodIPv6"),ZodIPv4:a(()=>gUr,"ZodIPv4"),ZodGUID:a(()=>$xt,"ZodGUID"),ZodFile:a(()=>wno,"ZodFile"),ZodError:a(()=>gzc,"ZodError"),ZodEnum:a(()=>k8e,"ZodEnum"),ZodEmoji:a(()=>lUr,"ZodEmoji"),ZodEmail:a(()=>aUr,"ZodEmail"),ZodE164:a(()=>CUr,"ZodE164"),ZodDiscriminatedUnion:a(()=>Cno,"ZodDiscriminatedUnion"),ZodDefault:a(()=>kno,"ZodDefault"),ZodDate:a(()=>IUr,"ZodDate"),ZodCustomStringFormat:a(()=>pno,"ZodCustomStringFormat"),ZodCustom:a(()=>$wt,"ZodCustom"),ZodCatch:a(()=>Lno,"ZodCatch"),ZodCUID2:a(()=>fUr,"ZodCUID2"),ZodCUID:a(()=>dUr,"ZodCUID"),ZodCIDRv6:a(()=>EUr,"ZodCIDRv6"),ZodCIDRv4:a(()=>yUr,"ZodCIDRv4"),ZodBoolean:a(()=>Qwt,"ZodBoolean"),ZodBigIntFormat:a(()=>SUr,"ZodBigIntFormat"),ZodBigInt:a(()=>qwt,"ZodBigInt"),ZodBase64URL:a(()=>vUr,"ZodBase64URL"),ZodBase64:a(()=>_Ur,"ZodBase64"),ZodArray:a(()=>vno,"ZodArray"),ZodAny:a(()=>Ano,"ZodAny"),TimePrecision:a(()=>yro,"TimePrecision"),NEVER:a(()=>eeo,"NEVER"),$output:a(()=>hro,"$output"),$input:a(()=>mro,"$input"),$brand:a(()=>teo,"$brand")});tUr={};WL(tUr,{time:a(()=>sno,"time"),duration:a(()=>ano,"duration"),datetime:a(()=>ino,"datetime"),date:a(()=>ono,"date"),ZodISOTime:a(()=>iUr,"ZodISOTime"),ZodISODuration:a(()=>oUr,"ZodISODuration"),ZodISODateTime:a(()=>rUr,"ZodISODateTime"),ZodISODate:a(()=>nUr,"ZodISODate")});rUr=ft("ZodISODateTime",(t,e)=>{Cto.init(t,e),Td.init(t,e)});a(ino,"aq");nUr=ft("ZodISODate",(t,e)=>{bto.init(t,e),Td.init(t,e)});a(ono,"sq");iUr=ft("ZodISOTime",(t,e)=>{Sto.init(t,e),Td.init(t,e)});a(sno,"eq");oUr=ft("ZodISODuration",(t,e)=>{Tto.init(t,e),Td.init(t,e)});a(ano,"$V");cno=a((t,e)=>{Z6r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>e9r(t,r),"value")},flatten:{value:a(r=>X6r(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"),gzc=ft("ZodError",cno),H8e=ft("ZodError",cno,{Parent:Error}),lno=t9r(H8e),uno=r9r(H8e),dno=n9r(H8e),fno=i9r(H8e),Os=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)=>$N(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>lno(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>dno(t,r,n),t.parseAsync=async(r,n)=>uno(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>fno(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Wno(r,n)),t.superRefine=r=>t.check(zno(r)),t.overwrite=r=>t.check(loe(r)),t.optional=()=>bd(t),t.nullable=()=>Vxt(t),t.nullish=()=>bd(Vxt(t)),t.nonoptional=r=>Mno(t,r),t.array=()=>Ca(t),t.or=r=>ou([t,r]),t.and=r=>Gwt(t,r),t.transform=r=>Wxt(t,PUr(r)),t.default=r=>Pno(t,r),t.prefault=r=>Nno(t,r),t.catch=r=>Bno(t,r),t.pipe=r=>Wxt(t,r),t.readonly=()=>Qno(t),t.describe=r=>{let n=t.clone();return V9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return V9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return V9.get(t);let n=t.clone();return V9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),sUr=ft("_ZodString",(t,e)=>{q8e.init(t,e),Os.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(j9r(...n)),t.includes=(...n)=>t.check($9r(...n)),t.startsWith=(...n)=>t.check(V9r(...n)),t.endsWith=(...n)=>t.check(W9r(...n)),t.min=(...n)=>t.check(kve(...n)),t.max=(...n)=>t.check(Lwt(...n)),t.length=(...n)=>t.check(Bwt(...n)),t.nonempty=(...n)=>t.check(kve(1,...n)),t.lowercase=n=>t.check(H9r(n)),t.uppercase=n=>t.check(G9r(n)),t.trim=()=>t.check(K9r()),t.normalize=(...n)=>t.check(Y9r(...n)),t.toLowerCase=()=>t.check(J9r()),t.toUpperCase=()=>t.check(Z9r())}),Fwt=ft("ZodString",(t,e)=>{q8e.init(t,e),sUr.init(t,e),t.email=r=>t.check(_9r(aUr,r)),t.url=r=>t.check(T9r(cUr,r)),t.jwt=r=>t.check(Q9r(bUr,r)),t.emoji=r=>t.check(I9r(lUr,r)),t.guid=r=>t.check(jxt($xt,r)),t.uuid=r=>t.check(v9r(W9,r)),t.uuidv4=r=>t.check(C9r(W9,r)),t.uuidv6=r=>t.check(b9r(W9,r)),t.uuidv7=r=>t.check(S9r(W9,r)),t.nanoid=r=>t.check(x9r(uUr,r)),t.guid=r=>t.check(jxt($xt,r)),t.cuid=r=>t.check(w9r(dUr,r)),t.cuid2=r=>t.check(R9r(fUr,r)),t.ulid=r=>t.check(k9r(pUr,r)),t.base64=r=>t.check(B9r(_Ur,r)),t.base64url=r=>t.check(F9r(vUr,r)),t.xid=r=>t.check(P9r(hUr,r)),t.ksuid=r=>t.check(D9r(mUr,r)),t.ipv4=r=>t.check(N9r(gUr,r)),t.ipv6=r=>t.check(M9r(AUr,r)),t.cidrv4=r=>t.check(O9r(yUr,r)),t.cidrv6=r=>t.check(L9r(EUr,r)),t.e164=r=>t.check(U9r(CUr,r)),t.datetime=r=>t.check(ino(r)),t.date=r=>t.check(ono(r)),t.time=r=>t.check(sno(r)),t.duration=r=>t.check(ano(r))});a(It,"L");Td=ft("ZodStringFormat",(t,e)=>{Lu.init(t,e),sUr.init(t,e)}),aUr=ft("ZodEmail",(t,e)=>{pto.init(t,e),Td.init(t,e)});a(Azc,"Cm");$xt=ft("ZodGUID",(t,e)=>{dto.init(t,e),Td.init(t,e)});a(yzc,"Tm");W9=ft("ZodUUID",(t,e)=>{fto.init(t,e),Td.init(t,e)});a(Ezc,"xm");a(_zc,"ym");a(vzc,"fm");a(Czc,"gm");cUr=ft("ZodURL",(t,e)=>{hto.init(t,e),Td.init(t,e)});a(bzc,"hm");lUr=ft("ZodEmoji",(t,e)=>{mto.init(t,e),Td.init(t,e)});a(Szc,"um");uUr=ft("ZodNanoID",(t,e)=>{gto.init(t,e),Td.init(t,e)});a(Tzc,"mm");dUr=ft("ZodCUID",(t,e)=>{Ato.init(t,e),Td.init(t,e)});a(Izc,"lm");fUr=ft("ZodCUID2",(t,e)=>{yto.init(t,e),Td.init(t,e)});a(xzc,"cm");pUr=ft("ZodULID",(t,e)=>{Eto.init(t,e),Td.init(t,e)});a(wzc,"pm");hUr=ft("ZodXID",(t,e)=>{_to.init(t,e),Td.init(t,e)});a(Rzc,"dm");mUr=ft("ZodKSUID",(t,e)=>{vto.init(t,e),Td.init(t,e)});a(kzc,"im");gUr=ft("ZodIPv4",(t,e)=>{Ito.init(t,e),Td.init(t,e)});a(Pzc,"nm");AUr=ft("ZodIPv6",(t,e)=>{xto.init(t,e),Td.init(t,e)});a(Dzc,"rm");yUr=ft("ZodCIDRv4",(t,e)=>{wto.init(t,e),Td.init(t,e)});a(Nzc,"om");EUr=ft("ZodCIDRv6",(t,e)=>{Rto.init(t,e),Td.init(t,e)});a(Mzc,"tm");_Ur=ft("ZodBase64",(t,e)=>{kto.init(t,e),Td.init(t,e)});a(Ozc,"am");vUr=ft("ZodBase64URL",(t,e)=>{Dto.init(t,e),Td.init(t,e)});a(Lzc,"sm");CUr=ft("ZodE164",(t,e)=>{Nto.init(t,e),Td.init(t,e)});a(Bzc,"em");bUr=ft("ZodJWT",(t,e)=>{Oto.init(t,e),Td.init(t,e)});a(Fzc,"$l");pno=ft("ZodCustomStringFormat",(t,e)=>{Lto.init(t,e),Td.init(t,e)});a(Uzc,"Ql");Uwt=ft("ZodNumber",(t,e)=>{u9r.init(t,e),Os.init(t,e),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(FN(n,o)),t.max=(n,o)=>t.check(FN(n,o)),t.int=n=>t.check(U8r(n)),t.safe=n=>t.check(U8r(n)),t.positive=n=>t.check(ioe(0,n)),t.nonnegative=n=>t.check(RI(0,n)),t.negative=n=>t.check(noe(0,n)),t.nonpositive=n=>t.check(FN(0,n)),t.multipleOf=(n,o)=>t.check(x8e(n,o)),t.step=(n,o)=>t.check(x8e(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(Nc,"z$");Hve=ft("ZodNumberFormat",(t,e)=>{Bto.init(t,e),Uwt.init(t,e)});a(U8r,"WV");a(Qzc,"Jl");a(qzc,"Xl");a(jzc,"Yl");a(Hzc,"Wl");Qwt=ft("ZodBoolean",(t,e)=>{d9r.init(t,e),Os.init(t,e)});a(j0,"i$");qwt=ft("ZodBigInt",(t,e)=>{f9r.init(t,e),Os.init(t,e),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(FN(n,o)),t.max=(n,o)=>t.check(FN(n,o)),t.positive=n=>t.check(ioe(BigInt(0),n)),t.negative=n=>t.check(noe(BigInt(0),n)),t.nonpositive=n=>t.check(FN(BigInt(0),n)),t.nonnegative=n=>t.check(RI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(x8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(Gzc,"Gl");SUr=ft("ZodBigIntFormat",(t,e)=>{Fto.init(t,e),qwt.init(t,e)});a($zc,"Ul");a(Vzc,"Hl");hno=ft("ZodSymbol",(t,e)=>{Uto.init(t,e),Os.init(t,e)});a(Wzc,"Kl");mno=ft("ZodUndefined",(t,e)=>{Qto.init(t,e),Os.init(t,e)});a(zzc,"ql");gno=ft("ZodNull",(t,e)=>{qto.init(t,e),Os.init(t,e)});a(TUr,"T3");Ano=ft("ZodAny",(t,e)=>{jto.init(t,e),Os.init(t,e)});a(Yzc,"Vl");yno=ft("ZodUnknown",(t,e)=>{qxt.init(t,e),Os.init(t,e)});a(of,"S$");Eno=ft("ZodNever",(t,e)=>{Hto.init(t,e),Os.init(t,e)});a(jwt,"x3");_no=ft("ZodVoid",(t,e)=>{Gto.init(t,e),Os.init(t,e)});a(Kzc,"Bl");IUr=ft("ZodDate",(t,e)=>{$to.init(t,e),Os.init(t,e),t.min=(n,o)=>t.check(RI(n,o)),t.max=(n,o)=>t.check(FN(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(Jzc,"zl");vno=ft("ZodArray",(t,e)=>{p9r.init(t,e),Os.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(kve(r,n)),t.nonempty=r=>t.check(kve(1,r)),t.max=(r,n)=>t.check(Lwt(r,n)),t.length=(r,n)=>t.check(Bwt(r,n)),t.unwrap=()=>t.element});a(Ca,"W$");a(Zzc,"Nl");Hwt=ft("ZodObject",(t,e)=>{h9r.init(t,e),Os.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>N1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:of()}),t.loose=()=>t.clone({...t._zod.def,catchall:of()}),t.strict=()=>t.clone({...t._zod.def,catchall:jwt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Ws.extend(t,r),t.merge=r=>Ws.merge(t,r),t.pick=r=>Ws.pick(t,r),t.omit=r=>Ws.omit(t,r),t.partial=(...r)=>Ws.partial(DUr,t,r[0]),t.required=(...r)=>Ws.required(NUr,t,r[0])});a(Tn,"h");a(Xzc,"wl");a(Kv,"K6");xUr=ft("ZodUnion",(t,e)=>{m9r.init(t,e),Os.init(t,e),t.options=e.options});a(ou,"A$");Cno=ft("ZodDiscriminatedUnion",(t,e)=>{xUr.init(t,e),Vto.init(t,e)});a(wUr,"g3");bno=ft("ZodIntersection",(t,e)=>{Wto.init(t,e),Os.init(t,e)});a(Gwt,"VJ");Sno=ft("ZodTuple",(t,e)=>{Mwt.init(t,e),Os.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(eYc,"Ol");RUr=ft("ZodRecord",(t,e)=>{zto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(iu,"I$");a(tYc,"Dl");Tno=ft("ZodMap",(t,e)=>{Yto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(rYc,"Fl");Ino=ft("ZodSet",(t,e)=>{Kto.init(t,e),Os.init(t,e),t.min=(...r)=>t.check(w8e(...r)),t.nonempty=r=>t.check(w8e(1,r)),t.max=(...r)=>t.check(Owt(...r)),t.size=(...r)=>t.check(q9r(...r))});a(nYc,"Zl");k8e=ft("ZodEnum",(t,e)=>{Jto.init(t,e),Os.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 k8e({...e,checks:[],...Ws.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 k8e({...e,checks:[],...Ws.normalizeParams(o),entries:s})}});a(N1,"N6");a(iYc,"Ml");xno=ft("ZodLiteral",(t,e)=>{Zto.init(t,e),Os.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(ti,"l");wno=ft("ZodFile",(t,e)=>{Xto.init(t,e),Os.init(t,e),t.min=(r,n)=>t.check(w8e(r,n)),t.max=(r,n)=>t.check(Owt(r,n)),t.mime=(r,n)=>t.check(z9r(Array.isArray(r)?r:[r],n))});a(oYc,"Ll");kUr=ft("ZodTransform",(t,e)=>{g9r.init(t,e),Os.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ws.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(Ws.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(PUr,"bV");DUr=ft("ZodOptional",(t,e)=>{ero.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(bd,"_$");Rno=ft("ZodNullable",(t,e)=>{tro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Vxt,"v3");a(sYc,"jl");kno=ft("ZodDefault",(t,e)=>{rro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Pno,"aM");Dno=ft("ZodPrefault",(t,e)=>{nro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Nno,"eM");NUr=ft("ZodNonOptional",(t,e)=>{iro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Mno,"$L");Ono=ft("ZodSuccess",(t,e)=>{oro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(aYc,"Al");Lno=ft("ZodCatch",(t,e)=>{sro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Bno,"XL");Fno=ft("ZodNaN",(t,e)=>{aro.init(t,e),Os.init(t,e)});a(cYc,"Il");MUr=ft("ZodPipe",(t,e)=>{A9r.init(t,e),Os.init(t,e),t.in=e.in,t.out=e.out});a(Wxt,"C3");Uno=ft("ZodReadonly",(t,e)=>{cro.init(t,e),Os.init(t,e)});a(Qno,"GL");qno=ft("ZodTemplateLiteral",(t,e)=>{lro.init(t,e),Os.init(t,e)});a(lYc,"Rl");jno=ft("ZodLazy",(t,e)=>{dro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Hno,"KL");Gno=ft("ZodPromise",(t,e)=>{uro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(uYc,"Pl");$wt=ft("ZodCustom",(t,e)=>{fro.init(t,e),Os.init(t,e)});a($no,"VL");a(Vno,"vV");a(Wno,"BL");a(zno,"zL");a(dYc,"El");fYc=a((...t)=>eno({Pipe:MUr,Boolean:Qwt,String:Fwt,Transform:kUr},...t),"bl");a(pYc,"_l");a(OUr,"u3");hYc={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(mYc,"Sl");a(gYc,"vl");Yno={};WL(Yno,{string:a(()=>AYc,"string"),number:a(()=>yYc,"number"),date:a(()=>vYc,"date"),boolean:a(()=>EYc,"boolean"),bigint:a(()=>_Yc,"bigint")});a(AYc,"Cl");a(yYc,"Tl");a(EYc,"xl");a(_Yc,"yl");a(vYc,"fl");Xv(pro());CYc=G,Kno=CYc,Jno="2025-11-25",bYc=[Jno,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$ie="io.modelcontextprotocol/related-task",Vwt="2.0",H0=Vno(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Zno=ou([It(),Nc().int()]),Xno=It(),cJh=Kv({ttl:Nc().optional(),pollInterval:Nc().optional()}),SYc=Tn({ttl:Nc().optional()}),TYc=Tn({taskId:It()}),LUr=Kv({progressToken:Zno.optional(),[$ie]:TYc.optional()}),MI=Tn({_meta:LUr.optional()}),G8e=MI.extend({task:SYc.optional()}),IYc=a(t=>G8e.safeParse(t).success,"FL"),Dy=Tn({method:It(),params:MI.loose().optional()}),vk=Tn({_meta:LUr.optional()}),Ck=Tn({method:It(),params:vk.loose().optional()}),Ny=Kv({_meta:LUr.optional()}),Wwt=ou([It(),Nc().int()]),eio=Tn({jsonrpc:ti(Vwt),id:Wwt,...Dy.shape}).strict(),YKi=a(t=>eio.safeParse(t).success,"fV"),tio=Tn({jsonrpc:ti(Vwt),...Ck.shape}).strict(),xYc=a(t=>tio.safeParse(t).success,"LL"),BUr=Tn({jsonrpc:ti(Vwt),id:Wwt,result:Ny}).strict(),FIt=a(t=>BUr.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={}));FUr=Tn({jsonrpc:ti(Vwt),id:Wwt.optional(),error:Tn({code:Nc().int(),message:It(),data:of().optional()})}).strict(),wYc=a(t=>FUr.safeParse(t).success,"jL"),lJh=ou([eio,tio,BUr,FUr]),uJh=ou([BUr,FUr]),UUr=Ny.strict(),RYc=vk.extend({requestId:Wwt.optional(),reason:It().optional()}),QUr=Ck.extend({method:ti("notifications/cancelled"),params:RYc}),kYc=Tn({src:It(),mimeType:It().optional(),sizes:Ca(It()).optional(),theme:N1(["light","dark"]).optional()}),$8e=Tn({icons:Ca(kYc).optional()}),Pve=Tn({name:It(),title:It().optional()}),rio=Pve.extend({...Pve.shape,...$8e.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),PYc=Gwt(Tn({applyDefaults:j0().optional()}),iu(It(),of())),DYc=OUr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Gwt(Tn({form:PYc.optional(),url:H0.optional()}),iu(It(),of()).optional())),NYc=Kv({list:H0.optional(),cancel:H0.optional(),requests:Kv({sampling:Kv({createMessage:H0.optional()}).optional(),elicitation:Kv({create:H0.optional()}).optional()}).optional()}),MYc=Kv({list:H0.optional(),cancel:H0.optional(),requests:Kv({tools:Kv({call:H0.optional()}).optional()}).optional()}),OYc=Tn({experimental:iu(It(),H0).optional(),sampling:Tn({context:H0.optional(),tools:H0.optional()}).optional(),elicitation:DYc.optional(),roots:Tn({listChanged:j0().optional()}).optional(),tasks:NYc.optional(),extensions:iu(It(),H0).optional()}),LYc=MI.extend({protocolVersion:It(),capabilities:OYc,clientInfo:rio}),nio=Dy.extend({method:ti("initialize"),params:LYc}),BYc=Tn({experimental:iu(It(),H0).optional(),logging:H0.optional(),completions:H0.optional(),prompts:Tn({listChanged:j0().optional()}).optional(),resources:Tn({subscribe:j0().optional(),listChanged:j0().optional()}).optional(),tools:Tn({listChanged:j0().optional()}).optional(),tasks:MYc.optional(),extensions:iu(It(),H0).optional()}),FYc=Ny.extend({protocolVersion:It(),capabilities:BYc,serverInfo:rio,instructions:It().optional()}),iio=Ck.extend({method:ti("notifications/initialized"),params:vk.optional()}),qUr=Dy.extend({method:ti("ping"),params:MI.optional()}),UYc=Tn({progress:Nc(),total:bd(Nc()),message:bd(It())}),QYc=Tn({...vk.shape,...UYc.shape,progressToken:Zno}),jUr=Ck.extend({method:ti("notifications/progress"),params:QYc}),qYc=MI.extend({cursor:Xno.optional()}),V8e=Dy.extend({params:qYc.optional()}),W8e=Ny.extend({nextCursor:Xno.optional()}),jYc=N1(["working","input_required","completed","failed","cancelled"]),z8e=Tn({taskId:It(),status:jYc,ttl:ou([Nc(),TUr()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:bd(Nc()),statusMessage:bd(It())}),zwt=Ny.extend({task:z8e}),HYc=vk.merge(z8e),zxt=Ck.extend({method:ti("notifications/tasks/status"),params:HYc}),HUr=Dy.extend({method:ti("tasks/get"),params:MI.extend({taskId:It()})}),GUr=Ny.merge(z8e),$Ur=Dy.extend({method:ti("tasks/result"),params:MI.extend({taskId:It()})}),dJh=Ny.loose(),VUr=V8e.extend({method:ti("tasks/list")}),WUr=W8e.extend({tasks:Ca(z8e)}),zUr=Dy.extend({method:ti("tasks/cancel"),params:MI.extend({taskId:It()})}),GYc=Ny.merge(z8e),oio=Tn({uri:It(),mimeType:bd(It()),_meta:iu(It(),of()).optional()}),sio=oio.extend({text:It()}),YUr=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),aio=oio.extend({blob:YUr}),Y8e=N1(["user","assistant"]),Gve=Tn({audience:Ca(Y8e).optional(),priority:Nc().min(0).max(1).optional(),lastModified:tUr.datetime({offset:!0}).optional()}),cio=Tn({...Pve.shape,...$8e.shape,uri:It(),description:bd(It()),mimeType:bd(It()),size:bd(Nc()),annotations:Gve.optional(),_meta:bd(Kv({}))}),$Yc=Tn({...Pve.shape,...$8e.shape,uriTemplate:It(),description:bd(It()),mimeType:bd(It()),annotations:Gve.optional(),_meta:bd(Kv({}))}),Q8r=V8e.extend({method:ti("resources/list")}),VYc=W8e.extend({resources:Ca(cio)}),q8r=V8e.extend({method:ti("resources/templates/list")}),WYc=W8e.extend({resourceTemplates:Ca($Yc)}),KUr=MI.extend({uri:It()}),zYc=KUr,j8r=Dy.extend({method:ti("resources/read"),params:zYc}),YYc=Ny.extend({contents:Ca(ou([sio,aio]))}),KYc=Ck.extend({method:ti("notifications/resources/list_changed"),params:vk.optional()}),JYc=KUr,ZYc=Dy.extend({method:ti("resources/subscribe"),params:JYc}),XYc=KUr,eKc=Dy.extend({method:ti("resources/unsubscribe"),params:XYc}),tKc=vk.extend({uri:It()}),rKc=Ck.extend({method:ti("notifications/resources/updated"),params:tKc}),nKc=Tn({name:It(),description:bd(It()),required:bd(j0())}),iKc=Tn({...Pve.shape,...$8e.shape,description:bd(It()),arguments:bd(Ca(nKc)),_meta:bd(Kv({}))}),H8r=V8e.extend({method:ti("prompts/list")}),oKc=W8e.extend({prompts:Ca(iKc)}),sKc=MI.extend({name:It(),arguments:iu(It(),It()).optional()}),G8r=Dy.extend({method:ti("prompts/get"),params:sKc}),JUr=Tn({type:ti("text"),text:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),ZUr=Tn({type:ti("image"),data:YUr,mimeType:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),XUr=Tn({type:ti("audio"),data:YUr,mimeType:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),aKc=Tn({type:ti("tool_use"),name:It(),id:It(),input:iu(It(),of()),_meta:iu(It(),of()).optional()}),cKc=Tn({type:ti("resource"),resource:ou([sio,aio]),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),lKc=cio.extend({type:ti("resource_link")}),e7r=ou([JUr,ZUr,XUr,lKc,cKc]),uKc=Tn({role:Y8e,content:e7r}),dKc=Ny.extend({description:It().optional(),messages:Ca(uKc)}),fKc=Ck.extend({method:ti("notifications/prompts/list_changed"),params:vk.optional()}),pKc=Tn({title:It().optional(),readOnlyHint:j0().optional(),destructiveHint:j0().optional(),idempotentHint:j0().optional(),openWorldHint:j0().optional()}),hKc=Tn({taskSupport:N1(["required","optional","forbidden"]).optional()}),lio=Tn({...Pve.shape,...$8e.shape,description:It().optional(),inputSchema:Tn({type:ti("object"),properties:iu(It(),H0).optional(),required:Ca(It()).optional()}).catchall(of()),outputSchema:Tn({type:ti("object"),properties:iu(It(),H0).optional(),required:Ca(It()).optional()}).catchall(of()).optional(),annotations:pKc.optional(),execution:hKc.optional(),_meta:iu(It(),of()).optional()}),$8r=V8e.extend({method:ti("tools/list")}),mKc=W8e.extend({tools:Ca(lio)}),t7r=Ny.extend({content:Ca(e7r).default([]),structuredContent:iu(It(),of()).optional(),isError:j0().optional()}),fJh=t7r.or(Ny.extend({toolResult:of()})),gKc=G8e.extend({name:It(),arguments:iu(It(),of()).optional()}),Yxt=Dy.extend({method:ti("tools/call"),params:gKc}),AKc=Ck.extend({method:ti("notifications/tools/list_changed"),params:vk.optional()}),pJh=Tn({autoRefresh:j0().default(!0),debounceMs:Nc().int().nonnegative().default(300)}),Kxt=N1(["debug","info","notice","warning","error","critical","alert","emergency"]),yKc=MI.extend({level:Kxt}),uio=Dy.extend({method:ti("logging/setLevel"),params:yKc}),EKc=vk.extend({level:Kxt,logger:It().optional(),data:of()}),_Kc=Ck.extend({method:ti("notifications/message"),params:EKc}),vKc=Tn({name:It().optional()}),CKc=Tn({hints:Ca(vKc).optional(),costPriority:Nc().min(0).max(1).optional(),speedPriority:Nc().min(0).max(1).optional(),intelligencePriority:Nc().min(0).max(1).optional()}),bKc=Tn({mode:N1(["auto","required","none"]).optional()}),SKc=Tn({type:ti("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:Ca(e7r).default([]),structuredContent:Tn({}).loose().optional(),isError:j0().optional(),_meta:iu(It(),of()).optional()}),TKc=wUr("type",[JUr,ZUr,XUr]),Jxt=wUr("type",[JUr,ZUr,XUr,aKc,SKc]),IKc=Tn({role:Y8e,content:ou([Jxt,Ca(Jxt)]),_meta:iu(It(),of()).optional()}),xKc=G8e.extend({messages:Ca(IKc),modelPreferences:CKc.optional(),systemPrompt:It().optional(),includeContext:N1(["none","thisServer","allServers"]).optional(),temperature:Nc().optional(),maxTokens:Nc().int(),stopSequences:Ca(It()).optional(),metadata:H0.optional(),tools:Ca(lio).optional(),toolChoice:bKc.optional()}),wKc=Dy.extend({method:ti("sampling/createMessage"),params:xKc}),r7r=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens"]).or(It())),role:Y8e,content:TKc}),dio=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:Y8e,content:ou([Jxt,Ca(Jxt)])}),RKc=Tn({type:ti("boolean"),title:It().optional(),description:It().optional(),default:j0().optional()}),kKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),minLength:Nc().optional(),maxLength:Nc().optional(),format:N1(["email","uri","date","date-time"]).optional(),default:It().optional()}),PKc=Tn({type:N1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:Nc().optional(),maximum:Nc().optional(),default:Nc().optional()}),DKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ca(It()),default:It().optional()}),NKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),oneOf:Ca(Tn({const:It(),title:It()})),default:It().optional()}),MKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ca(It()),enumNames:Ca(It()).optional(),default:It().optional()}),OKc=ou([DKc,NKc]),LKc=Tn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({type:ti("string"),enum:Ca(It())}),default:Ca(It()).optional()}),BKc=Tn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({anyOf:Ca(Tn({const:It(),title:It()}))}),default:Ca(It()).optional()}),FKc=ou([LKc,BKc]),UKc=ou([MKc,OKc,FKc]),QKc=ou([UKc,RKc,kKc,PKc]),qKc=G8e.extend({mode:ti("form").optional(),message:It(),requestedSchema:Tn({type:ti("object"),properties:iu(It(),QKc),required:Ca(It()).optional()})}),jKc=G8e.extend({mode:ti("url"),message:It(),elicitationId:It(),url:It().url()}),HKc=ou([qKc,jKc]),GKc=Dy.extend({method:ti("elicitation/create"),params:HKc}),$Kc=vk.extend({elicitationId:It()}),VKc=Ck.extend({method:ti("notifications/elicitation/complete"),params:$Kc}),Zxt=Ny.extend({action:N1(["accept","decline","cancel"]),content:OUr(t=>t===null?void 0:t,iu(It(),ou([It(),Nc(),j0(),Ca(It())])).optional())}),WKc=Tn({type:ti("ref/resource"),uri:It()}),zKc=Tn({type:ti("ref/prompt"),name:It()}),YKc=MI.extend({ref:ou([zKc,WKc]),argument:Tn({name:It(),value:It()}),context:Tn({arguments:iu(It(),It()).optional()}).optional()}),V8r=Dy.extend({method:ti("completion/complete"),params:YKc});a(KKc,"kL");a(JKc,"SL");ZKc=Ny.extend({completion:Kv({values:Ca(It()).max(100),total:bd(Nc().int()),hasMore:bd(j0())})}),XKc=Tn({uri:It().startsWith("file://"),name:It().optional(),_meta:iu(It(),of()).optional()}),eJc=Dy.extend({method:ti("roots/list"),params:MI.optional()}),fio=Ny.extend({roots:Ca(XKc)}),tJc=Ck.extend({method:ti("notifications/roots/list_changed"),params:vk.optional()}),hJh=ou([qUr,nio,V8r,uio,G8r,H8r,Q8r,q8r,j8r,ZYc,eKc,Yxt,$8r,HUr,$Ur,VUr,zUr]),mJh=ou([QUr,jUr,iio,tJc,zxt]),gJh=ou([UUr,r7r,dio,Zxt,fio,GUr,WUr,zwt]),AJh=ou([qUr,wKc,GKc,eJc,HUr,$Ur,VUr,zUr]),yJh=ou([QUr,jUr,_Kc,rKc,KYc,AKc,fKc,zxt,VKc]),EJh=ou([UUr,FYc,ZKc,dKc,oKc,VYc,WYc,YYc,t7r,mKc,GUr,WUr,zwt]),fi=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 W8r(o.elicitations,r)}return new t(e,r,n)}},W8r=class extends fi{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(Hie,"T1");rJc=Symbol("Let zodToJsonSchema decide on which parser to use"),KKi={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"},nJc=a(t=>typeof t=="string"?{...KKi,name:t}:{...KKi,...t},"xL"),iJc=a(t=>{let e=nJc(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(pio,"aV");a(Al,"H$");hio=a((t,e)=>{let r=0;for(;rDc(t.innerType._def,e),"uL");a(gio,"sV");lJc=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":Al(r,"minimum",n.value,n.message,e);break;case"max":Al(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(uJc,"mL");a(dJc,"lL");a(fJc,"cL");pJc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(hJc,"pL");a(mJc,"dL");HFr=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(()=>(HFr===void 0&&(HFr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),HFr),"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(Aio,"qW");a(GFr,"$B");gJc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(AJc,"Np");a(LN,"V4");a(Yv,"w6");a(JKi,"iL");a(yio,"VW");a(yJc,"nL");a(EJc,"rL");a(_Jc,"oL");a(vJc,"tL");Xxt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(CJc,"sL");ZKi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Dc(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(bJc,"eL");a(SJc,"$j");a(TJc,"Qj");a(IJc,"wp");a(xJc,"Op");wJc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Dc(t.innerType._def,e);let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:D1(e)},r]}:D1(e)},"Jj"),RJc=a((t,e)=>{if(e.pipeStrategy==="input")return Dc(t.in._def,e);if(e.pipeStrategy==="output")return Dc(t.out._def,e);let r=Dc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Dc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(kJc,"Yj");a(PJc,"Wj");a(DJc,"Gj");a(NJc,"Uj");a(MJc,"Hj");OJc=a((t,e)=>Dc(t.innerType._def,e),"Kj"),LJc=a((t,e,r)=>{switch(e){case Cr.ZodString:return Aio(t,r);case Cr.ZodNumber:return SJc(t,r);case Cr.ZodObject:return TJc(t,r);case Cr.ZodBigInt:return sJc(t,r);case Cr.ZodBoolean:return aJc();case Cr.ZodDate:return gio(t,r);case Cr.ZodUndefined:return NJc(r);case Cr.ZodNull:return vJc(r);case Cr.ZodArray:return oJc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return CJc(t,r);case Cr.ZodIntersection:return hJc(t,r);case Cr.ZodTuple:return DJc(t,r);case Cr.ZodRecord:return yio(t,r);case Cr.ZodLiteral:return mJc(t,r);case Cr.ZodEnum:return fJc(t);case Cr.ZodNativeEnum:return EJc(t);case Cr.ZodNullable:return bJc(t,r);case Cr.ZodOptional:return wJc(t,r);case Cr.ZodMap:return yJc(t,r);case Cr.ZodSet:return PJc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return kJc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return _Jc(r);case Cr.ZodEffects:return dJc(t,r);case Cr.ZodAny:return D1(r);case Cr.ZodUnknown:return MJc(r);case Cr.ZodDefault:return uJc(t,r);case Cr.ZodBranded:return mio(t,r);case Cr.ZodReadonly:return OJc(t,r);case Cr.ZodCatch:return cJc(t,r);case Cr.ZodPipeline:return RJc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Dc,"r");BJc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:hio(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`),D1(e)):e.$refStrategy==="seen"?D1(e):void 0}},"Dp"),FJc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),UJc=a((t,e)=>{let r=iJc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Dc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??D1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Dc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??D1(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(QJc,"Zp");a(XKi,"JB");a(eJi,"XB");a(tJi,"YB");qJc=6e4,z8r=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(QUr,r=>{this._oncancel(r)}),this.setNotificationHandler(jUr,r=>{this._onprogress(r)}),this.setRequestHandler(qUr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(HUr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler($Ur,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 fi(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 fi(Bi.InvalidParams,`Task not found: ${s}`);if(!Hie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Hie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[$ie]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(VUr,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 fi(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(zUr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Hie(o.status))throw new fi(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 fi(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof fi?o:new fi(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),fi.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),FIt(s)||wYc(s)?this._onresponse(s):YKi(s)?this._onrequest(s,c):xYc(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=fi.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?.[$ie]?.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=IYc(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 fi(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),FIt(e))n(e);else{let c=new fi(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(FIt(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),FIt(e))o(e);else{let c=fi.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 fi?c:new fi(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,zwt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new fi(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Hie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new fi(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new fi(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 fi?c:new fi(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||{},[$ie]: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 fi?v:new fi(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=r8e(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??qJc,E=a(()=>A(fi.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},GUr,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},WUr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},GYc,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||{},[$ie]: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||{},[$ie]: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||{},[$ie]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=eJi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=tJi(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=eJi(e);this._notificationHandlers.set(n,o=>{let s=tJi(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"&&YKi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new fi(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 fi(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new fi(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 fi(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=zxt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Hie(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 fi(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Hie(l.status))throw new fi(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=zxt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Hie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(rJi,"Vj");a(jJc,"Bj");HJc=A6r(nZi(),1),GJc=A6r(E9c(),1);a($Jc,"ps");Y8r=class{static{a(this,"qz")}constructor(e){this._ajv=e??$Jc()}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)}}},K8r=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},r7r,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},Zxt,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(VJc,"tP");a(WJc,"aP");J8r=class extends z8r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Kxt.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(iio,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(uio,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=Kxt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new K8r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=jJc(this._capabilities,e)}setRequestHandler(e,r){let n=j8e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(VL(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=r8e(Yxt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new fi(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=r8e(zwt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new fi(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=r8e(t7r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new fi(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){WJc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&VJc(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:bYc.includes(r)?r:Jno,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"},UUr)}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},dio,r):this.request({method:"sampling/createMessage",params:e},r7r,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},Zxt,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},Zxt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new fi(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof fi?s:new fi(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},fio,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"})}},Eio=Symbol.for("mcp.completable");a(nJi,"zz");a(zJc,"$E");(function(t){t.Completable="McpCompletable"})(iJi||(iJi={}));YJc=/^[A-Za-z0-9._-]{1,128}$/;a(KJc,"is");a(JJc,"ns");a(oJi,"Nz");Z8r=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)}},X8r=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 J8r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Z8r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(XV($8r)),this.server.assertCanSetRequestHandler(XV(Yxt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler($8r,()=>({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=QFe(r.inputSchema);return o?XKi(o,{strictUnions:!0,pipeStrategy:"input"}):ZJc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=QFe(r.outputSchema);o&&(n.outputSchema=XKi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Yxt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new fi(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 fi(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new fi(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 fi&&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=QFe(e.inputSchema)??e.inputSchema,s=await qFr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=jFr(c);throw new fi(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 fi(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=QFe(e.outputSchema),s=await qFr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=jFr(c);throw new fi(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 fi(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(XV(V8r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(V8r,async e=>{switch(e.params.ref.type){case"ref/prompt":return KKc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return JKc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new fi(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 fi(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return qFe;let o=j8e(n.argsSchema)?.[e.params.argument.name];if(!nJi(o))return qFe;let s=zJc(o);if(!s)return qFe;let c=await s(e.params.argument.value,e.params.context);return aJi(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 qFe;throw new fi(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return qFe;let s=await o(e.params.argument.value,e.params.context);return aJi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(XV(Q8r)),this.server.assertCanSetRequestHandler(XV(q8r)),this.server.assertCanSetRequestHandler(XV(j8r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Q8r,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(q8r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(j8r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new fi(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 fi(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(XV(H8r)),this.server.assertCanSetRequestHandler(XV(G8r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(H8r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?XJc(r.argsSchema):void 0}))})),this.server.setRequestHandler(G8r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=QFe(n.argsSchema),s=await qFr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=jFr(u);throw new fi(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:nve(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=nve(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 Ek?l._def?.innerType:l;return nJi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){oJi(e);let f={title:r,description:n,inputSchema:sJi(o),outputSchema:sJi(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"&&oJi(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=nve(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=nve(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(e6r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!e6r(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()}},ZJc={type:"object",properties:{}};a(_io,"XE");a(vio,"YE");a(e6r,"Oz");a(sJi,"QE");a(XJc,"os");a(XV,"l1");a(aJi,"JE");qFe={completion:{values:[],hasMore:!1}};a(eZc,"ts");a(tZc,"as");a(rZc,"ss");a(wr,"b");cJi=15e3,nZc=wr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),mk=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},t6r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new wxt;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 R1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new R1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await oZc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=M8e(s);if(!(c instanceof R1)){let l=c instanceof mk&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&lJi(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 mk(`WebSocket connection timeout after ${cJi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},cJi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,pk(`[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(oUr,"e8");a(j0,"t$");Rzc={},kzc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");bo.init(t,e),t.def=e,t.parse=(r,n)=>jxt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Lwt(t,r,n),t.parseAsync=async(r,n)=>Hxt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Bwt(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)=>zN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),Pzc=ft("ZodMiniObject",(t,e)=>{E9r.init(t,e),kzc.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape)});a(iJi,"tq");a(WL,"a6");a(sve,"S0");a(a8e,"S1");a(VFr,"I3");a(W8e,"v1");a($Fe,"$9");a(WFr,"R3");a(Dzc,"_M");a(Nzc,"kM");a(pno,"P3");G={};zL(G,{xid:a(()=>Wzc,"xid"),void:a(()=>hYc,"void"),uuidv7:a(()=>Qzc,"uuidv7"),uuidv6:a(()=>Uzc,"uuidv6"),uuidv4:a(()=>Fzc,"uuidv4"),uuid:a(()=>Bzc,"uuid"),url:a(()=>qzc,"url"),uppercase:a(()=>Y9r,"uppercase"),unknown:a(()=>af,"unknown"),union:a(()=>ou,"union"),undefined:a(()=>fYc,"undefined"),ulid:a(()=>Vzc,"ulid"),uint64:a(()=>uYc,"uint64"),uint32:a(()=>aYc,"uint32"),tuple:a(()=>yYc,"tuple"),trim:a(()=>tUr,"trim"),treeifyError:a(()=>veo,"treeifyError"),transform:a(()=>LUr,"transform"),toUpperCase:a(()=>nUr,"toUpperCase"),toLowerCase:a(()=>rUr,"toLowerCase"),toJSONSchema:a(()=>oUr,"toJSONSchema"),templateLiteral:a(()=>xYc,"templateLiteral"),symbol:a(()=>dYc,"symbol"),superRefine:a(()=>iio,"superRefine"),success:a(()=>TYc,"success"),stringbool:a(()=>kYc,"stringbool"),stringFormat:a(()=>nYc,"stringFormat"),string:a(()=>Tt,"string"),strictObject:a(()=>AYc,"strictObject"),startsWith:a(()=>J9r,"startsWith"),size:a(()=>V9r,"size"),setErrorMap:a(()=>NYc,"setErrorMap"),set:a(()=>vYc,"set"),safeParseAsync:a(()=>Cno,"safeParseAsync"),safeParse:a(()=>vno,"safeParse"),registry:a(()=>S9r,"registry"),regexes:a(()=>u9r,"regexes"),regex:a(()=>W9r,"regex"),refine:a(()=>nio,"refine"),record:a(()=>iu,"record"),readonly:a(()=>Kno,"readonly"),property:a(()=>ono,"property"),promise:a(()=>wYc,"promise"),prettifyError:a(()=>beo,"prettifyError"),preprocess:a(()=>QUr,"preprocess"),prefault:a(()=>Hno,"prefault"),positive:a(()=>tno,"positive"),pipe:a(()=>Jxt,"pipe"),partialRecord:a(()=>EYc,"partialRecord"),parseAsync:a(()=>_no,"parseAsync"),parse:a(()=>Eno,"parse"),overwrite:a(()=>uoe,"overwrite"),optional:a(()=>Td,"optional"),object:a(()=>Tn,"object"),number:a(()=>Nc,"number"),nullish:a(()=>SYc,"nullish"),nullable:a(()=>Kxt,"nullable"),null:a(()=>kUr,"null"),normalize:a(()=>eUr,"normalize"),nonpositive:a(()=>nno,"nonpositive"),nonoptional:a(()=>Gno,"nonoptional"),nonnegative:a(()=>ino,"nonnegative"),never:a(()=>Vwt,"never"),negative:a(()=>rno,"negative"),nativeEnum:a(()=>CYc,"nativeEnum"),nanoid:a(()=>Hzc,"nanoid"),nan:a(()=>IYc,"nan"),multipleOf:a(()=>D8e,"multipleOf"),minSize:a(()=>N8e,"minSize"),minLength:a(()=>Nve,"minLength"),mime:a(()=>X9r,"mime"),maxSize:a(()=>Uwt,"maxSize"),maxLength:a(()=>Qwt,"maxLength"),map:a(()=>_Yc,"map"),lte:a(()=>qN,"lte"),lt:a(()=>ioe,"lt"),lowercase:a(()=>z9r,"lowercase"),looseObject:a(()=>Zv,"looseObject"),locales:a(()=>b9r,"locales"),literal:a(()=>Xn,"literal"),length:a(()=>qwt,"length"),lazy:a(()=>Xno,"lazy"),ksuid:a(()=>zzc,"ksuid"),keyof:a(()=>gYc,"keyof"),jwt:a(()=>rYc,"jwt"),json:a(()=>PYc,"json"),iso:a(()=>sUr,"iso"),ipv6:a(()=>Kzc,"ipv6"),ipv4:a(()=>Yzc,"ipv4"),intersection:a(()=>zwt,"intersection"),int64:a(()=>lYc,"int64"),int32:a(()=>sYc,"int32"),int:a(()=>G8r,"int"),instanceof:a(()=>RYc,"instanceof"),includes:a(()=>K9r,"includes"),guid:a(()=>Lzc,"guid"),gte:a(()=>PI,"gte"),gt:a(()=>ooe,"gt"),globalRegistry:a(()=>z9,"globalRegistry"),getErrorMap:a(()=>MYc,"getErrorMap"),function:a(()=>fno,"function"),formatError:a(()=>o9r,"formatError"),float64:a(()=>oYc,"float64"),float32:a(()=>iYc,"float32"),flattenError:a(()=>i9r,"flattenError"),file:a(()=>bYc,"file"),enum:a(()=>N1,"enum"),endsWith:a(()=>Z9r,"endsWith"),emoji:a(()=>jzc,"emoji"),email:a(()=>Ozc,"email"),e164:a(()=>tYc,"e164"),discriminatedUnion:a(()=>NUr,"discriminatedUnion"),date:a(()=>mYc,"date"),custom:a(()=>rio,"custom"),cuid2:a(()=>$zc,"cuid2"),cuid:a(()=>Gzc,"cuid"),core:a(()=>leo,"core"),config:a(()=>tC,"config"),coerce:a(()=>oio,"coerce"),clone:a(()=>zN,"clone"),cidrv6:a(()=>Zzc,"cidrv6"),cidrv4:a(()=>Jzc,"cidrv4"),check:a(()=>tio,"check"),catch:a(()=>Wno,"catch"),boolean:a(()=>H0,"boolean"),bigint:a(()=>cYc,"bigint"),base64url:a(()=>eYc,"base64url"),base64:a(()=>Xzc,"base64"),array:a(()=>ba,"array"),any:a(()=>pYc,"any"),_default:a(()=>qno,"_default"),_ZodString:a(()=>dUr,"_ZodString"),ZodXID:a(()=>EUr,"ZodXID"),ZodVoid:a(()=>kno,"ZodVoid"),ZodUnknown:a(()=>wno,"ZodUnknown"),ZodUnion:a(()=>DUr,"ZodUnion"),ZodUndefined:a(()=>Tno,"ZodUndefined"),ZodUUID:a(()=>Y9,"ZodUUID"),ZodURL:a(()=>pUr,"ZodURL"),ZodULID:a(()=>yUr,"ZodULID"),ZodType:a(()=>Os,"ZodType"),ZodTuple:a(()=>Mno,"ZodTuple"),ZodTransform:a(()=>OUr,"ZodTransform"),ZodTemplateLiteral:a(()=>Jno,"ZodTemplateLiteral"),ZodSymbol:a(()=>Sno,"ZodSymbol"),ZodSuccess:a(()=>$no,"ZodSuccess"),ZodStringFormat:a(()=>xd,"ZodStringFormat"),ZodString:a(()=>jwt,"ZodString"),ZodSet:a(()=>Lno,"ZodSet"),ZodRecord:a(()=>MUr,"ZodRecord"),ZodRealError:a(()=>z8e,"ZodRealError"),ZodReadonly:a(()=>Yno,"ZodReadonly"),ZodPromise:a(()=>eio,"ZodPromise"),ZodPrefault:a(()=>jno,"ZodPrefault"),ZodPipe:a(()=>UUr,"ZodPipe"),ZodOptional:a(()=>BUr,"ZodOptional"),ZodObject:a(()=>Wwt,"ZodObject"),ZodNumberFormat:a(()=>Vve,"ZodNumberFormat"),ZodNumber:a(()=>Hwt,"ZodNumber"),ZodNullable:a(()=>Uno,"ZodNullable"),ZodNull:a(()=>Ino,"ZodNull"),ZodNonOptional:a(()=>FUr,"ZodNonOptional"),ZodNever:a(()=>Rno,"ZodNever"),ZodNanoID:a(()=>mUr,"ZodNanoID"),ZodNaN:a(()=>zno,"ZodNaN"),ZodMap:a(()=>Ono,"ZodMap"),ZodLiteral:a(()=>Bno,"ZodLiteral"),ZodLazy:a(()=>Zno,"ZodLazy"),ZodKSUID:a(()=>_Ur,"ZodKSUID"),ZodJWT:a(()=>wUr,"ZodJWT"),ZodIssueCode:a(()=>DYc,"ZodIssueCode"),ZodIntersection:a(()=>Nno,"ZodIntersection"),ZodISOTime:a(()=>lUr,"ZodISOTime"),ZodISODuration:a(()=>uUr,"ZodISODuration"),ZodISODateTime:a(()=>aUr,"ZodISODateTime"),ZodISODate:a(()=>cUr,"ZodISODate"),ZodIPv6:a(()=>CUr,"ZodIPv6"),ZodIPv4:a(()=>vUr,"ZodIPv4"),ZodGUID:a(()=>Yxt,"ZodGUID"),ZodFile:a(()=>Fno,"ZodFile"),ZodError:a(()=>Mzc,"ZodError"),ZodEnum:a(()=>O8e,"ZodEnum"),ZodEmoji:a(()=>hUr,"ZodEmoji"),ZodEmail:a(()=>fUr,"ZodEmail"),ZodE164:a(()=>xUr,"ZodE164"),ZodDiscriminatedUnion:a(()=>Dno,"ZodDiscriminatedUnion"),ZodDefault:a(()=>Qno,"ZodDefault"),ZodDate:a(()=>PUr,"ZodDate"),ZodCustomStringFormat:a(()=>bno,"ZodCustomStringFormat"),ZodCustom:a(()=>Ywt,"ZodCustom"),ZodCatch:a(()=>Vno,"ZodCatch"),ZodCUID2:a(()=>AUr,"ZodCUID2"),ZodCUID:a(()=>gUr,"ZodCUID"),ZodCIDRv6:a(()=>SUr,"ZodCIDRv6"),ZodCIDRv4:a(()=>bUr,"ZodCIDRv4"),ZodBoolean:a(()=>Gwt,"ZodBoolean"),ZodBigIntFormat:a(()=>RUr,"ZodBigIntFormat"),ZodBigInt:a(()=>$wt,"ZodBigInt"),ZodBase64URL:a(()=>IUr,"ZodBase64URL"),ZodBase64:a(()=>TUr,"ZodBase64"),ZodArray:a(()=>Pno,"ZodArray"),ZodAny:a(()=>xno,"ZodAny"),TimePrecision:a(()=>wro,"TimePrecision"),NEVER:a(()=>ueo,"NEVER"),$output:a(()=>Sro,"$output"),$input:a(()=>Tro,"$input"),$brand:a(()=>deo,"$brand")});sUr={};zL(sUr,{time:a(()=>gno,"time"),duration:a(()=>Ano,"duration"),datetime:a(()=>hno,"datetime"),date:a(()=>mno,"date"),ZodISOTime:a(()=>lUr,"ZodISOTime"),ZodISODuration:a(()=>uUr,"ZodISODuration"),ZodISODateTime:a(()=>aUr,"ZodISODateTime"),ZodISODate:a(()=>cUr,"ZodISODate")});aUr=ft("ZodISODateTime",(t,e)=>{Dto.init(t,e),xd.init(t,e)});a(hno,"aq");cUr=ft("ZodISODate",(t,e)=>{Nto.init(t,e),xd.init(t,e)});a(mno,"sq");lUr=ft("ZodISOTime",(t,e)=>{Mto.init(t,e),xd.init(t,e)});a(gno,"eq");uUr=ft("ZodISODuration",(t,e)=>{Oto.init(t,e),xd.init(t,e)});a(Ano,"$V");yno=a((t,e)=>{n9r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>o9r(t,r),"value")},flatten:{value:a(r=>i9r(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"),Mzc=ft("ZodError",yno),z8e=ft("ZodError",yno,{Parent:Error}),Eno=s9r(z8e),_no=a9r(z8e),vno=c9r(z8e),Cno=l9r(z8e),Os=ft("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)=>zN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>Eno(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>vno(t,r,n),t.parseAsync=async(r,n)=>_no(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Cno(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(nio(r,n)),t.superRefine=r=>t.check(iio(r)),t.overwrite=r=>t.check(uoe(r)),t.optional=()=>Td(t),t.nullable=()=>Kxt(t),t.nullish=()=>Td(Kxt(t)),t.nonoptional=r=>Gno(t,r),t.array=()=>ba(t),t.or=r=>ou([t,r]),t.and=r=>zwt(t,r),t.transform=r=>Jxt(t,LUr(r)),t.default=r=>qno(t,r),t.prefault=r=>Hno(t,r),t.catch=r=>Wno(t,r),t.pipe=r=>Jxt(t,r),t.readonly=()=>Kno(t),t.describe=r=>{let n=t.clone();return z9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return z9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return z9.get(t);let n=t.clone();return z9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),dUr=ft("_ZodString",(t,e)=>{V8e.init(t,e),Os.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(W9r(...n)),t.includes=(...n)=>t.check(K9r(...n)),t.startsWith=(...n)=>t.check(J9r(...n)),t.endsWith=(...n)=>t.check(Z9r(...n)),t.min=(...n)=>t.check(Nve(...n)),t.max=(...n)=>t.check(Qwt(...n)),t.length=(...n)=>t.check(qwt(...n)),t.nonempty=(...n)=>t.check(Nve(1,...n)),t.lowercase=n=>t.check(z9r(n)),t.uppercase=n=>t.check(Y9r(n)),t.trim=()=>t.check(tUr()),t.normalize=(...n)=>t.check(eUr(...n)),t.toLowerCase=()=>t.check(rUr()),t.toUpperCase=()=>t.check(nUr())}),jwt=ft("ZodString",(t,e)=>{V8e.init(t,e),dUr.init(t,e),t.email=r=>t.check(T9r(fUr,r)),t.url=r=>t.check(k9r(pUr,r)),t.jwt=r=>t.check($9r(wUr,r)),t.emoji=r=>t.check(P9r(hUr,r)),t.guid=r=>t.check(Vxt(Yxt,r)),t.uuid=r=>t.check(I9r(Y9,r)),t.uuidv4=r=>t.check(x9r(Y9,r)),t.uuidv6=r=>t.check(w9r(Y9,r)),t.uuidv7=r=>t.check(R9r(Y9,r)),t.nanoid=r=>t.check(D9r(mUr,r)),t.guid=r=>t.check(Vxt(Yxt,r)),t.cuid=r=>t.check(N9r(gUr,r)),t.cuid2=r=>t.check(M9r(AUr,r)),t.ulid=r=>t.check(O9r(yUr,r)),t.base64=r=>t.check(j9r(TUr,r)),t.base64url=r=>t.check(H9r(IUr,r)),t.xid=r=>t.check(L9r(EUr,r)),t.ksuid=r=>t.check(B9r(_Ur,r)),t.ipv4=r=>t.check(F9r(vUr,r)),t.ipv6=r=>t.check(U9r(CUr,r)),t.cidrv4=r=>t.check(Q9r(bUr,r)),t.cidrv6=r=>t.check(q9r(SUr,r)),t.e164=r=>t.check(G9r(xUr,r)),t.datetime=r=>t.check(hno(r)),t.date=r=>t.check(mno(r)),t.time=r=>t.check(gno(r)),t.duration=r=>t.check(Ano(r))});a(Tt,"L");xd=ft("ZodStringFormat",(t,e)=>{Bu.init(t,e),dUr.init(t,e)}),fUr=ft("ZodEmail",(t,e)=>{bto.init(t,e),xd.init(t,e)});a(Ozc,"Cm");Yxt=ft("ZodGUID",(t,e)=>{vto.init(t,e),xd.init(t,e)});a(Lzc,"Tm");Y9=ft("ZodUUID",(t,e)=>{Cto.init(t,e),xd.init(t,e)});a(Bzc,"xm");a(Fzc,"ym");a(Uzc,"fm");a(Qzc,"gm");pUr=ft("ZodURL",(t,e)=>{Sto.init(t,e),xd.init(t,e)});a(qzc,"hm");hUr=ft("ZodEmoji",(t,e)=>{Tto.init(t,e),xd.init(t,e)});a(jzc,"um");mUr=ft("ZodNanoID",(t,e)=>{Ito.init(t,e),xd.init(t,e)});a(Hzc,"mm");gUr=ft("ZodCUID",(t,e)=>{xto.init(t,e),xd.init(t,e)});a(Gzc,"lm");AUr=ft("ZodCUID2",(t,e)=>{wto.init(t,e),xd.init(t,e)});a($zc,"cm");yUr=ft("ZodULID",(t,e)=>{Rto.init(t,e),xd.init(t,e)});a(Vzc,"pm");EUr=ft("ZodXID",(t,e)=>{kto.init(t,e),xd.init(t,e)});a(Wzc,"dm");_Ur=ft("ZodKSUID",(t,e)=>{Pto.init(t,e),xd.init(t,e)});a(zzc,"im");vUr=ft("ZodIPv4",(t,e)=>{Lto.init(t,e),xd.init(t,e)});a(Yzc,"nm");CUr=ft("ZodIPv6",(t,e)=>{Bto.init(t,e),xd.init(t,e)});a(Kzc,"rm");bUr=ft("ZodCIDRv4",(t,e)=>{Fto.init(t,e),xd.init(t,e)});a(Jzc,"om");SUr=ft("ZodCIDRv6",(t,e)=>{Uto.init(t,e),xd.init(t,e)});a(Zzc,"tm");TUr=ft("ZodBase64",(t,e)=>{Qto.init(t,e),xd.init(t,e)});a(Xzc,"am");IUr=ft("ZodBase64URL",(t,e)=>{jto.init(t,e),xd.init(t,e)});a(eYc,"sm");xUr=ft("ZodE164",(t,e)=>{Hto.init(t,e),xd.init(t,e)});a(tYc,"em");wUr=ft("ZodJWT",(t,e)=>{$to.init(t,e),xd.init(t,e)});a(rYc,"$l");bno=ft("ZodCustomStringFormat",(t,e)=>{Vto.init(t,e),xd.init(t,e)});a(nYc,"Ql");Hwt=ft("ZodNumber",(t,e)=>{m9r.init(t,e),Os.init(t,e),t.gt=(n,o)=>t.check(ooe(n,o)),t.gte=(n,o)=>t.check(PI(n,o)),t.min=(n,o)=>t.check(PI(n,o)),t.lt=(n,o)=>t.check(ioe(n,o)),t.lte=(n,o)=>t.check(qN(n,o)),t.max=(n,o)=>t.check(qN(n,o)),t.int=n=>t.check(G8r(n)),t.safe=n=>t.check(G8r(n)),t.positive=n=>t.check(ooe(0,n)),t.nonnegative=n=>t.check(PI(0,n)),t.negative=n=>t.check(ioe(0,n)),t.nonpositive=n=>t.check(qN(0,n)),t.multipleOf=(n,o)=>t.check(D8e(n,o)),t.step=(n,o)=>t.check(D8e(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(Nc,"z$");Vve=ft("ZodNumberFormat",(t,e)=>{Wto.init(t,e),Hwt.init(t,e)});a(G8r,"WV");a(iYc,"Jl");a(oYc,"Xl");a(sYc,"Yl");a(aYc,"Wl");Gwt=ft("ZodBoolean",(t,e)=>{g9r.init(t,e),Os.init(t,e)});a(H0,"i$");$wt=ft("ZodBigInt",(t,e)=>{A9r.init(t,e),Os.init(t,e),t.gte=(n,o)=>t.check(PI(n,o)),t.min=(n,o)=>t.check(PI(n,o)),t.gt=(n,o)=>t.check(ooe(n,o)),t.gte=(n,o)=>t.check(PI(n,o)),t.min=(n,o)=>t.check(PI(n,o)),t.lt=(n,o)=>t.check(ioe(n,o)),t.lte=(n,o)=>t.check(qN(n,o)),t.max=(n,o)=>t.check(qN(n,o)),t.positive=n=>t.check(ooe(BigInt(0),n)),t.negative=n=>t.check(ioe(BigInt(0),n)),t.nonpositive=n=>t.check(qN(BigInt(0),n)),t.nonnegative=n=>t.check(PI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(D8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(cYc,"Gl");RUr=ft("ZodBigIntFormat",(t,e)=>{zto.init(t,e),$wt.init(t,e)});a(lYc,"Ul");a(uYc,"Hl");Sno=ft("ZodSymbol",(t,e)=>{Yto.init(t,e),Os.init(t,e)});a(dYc,"Kl");Tno=ft("ZodUndefined",(t,e)=>{Kto.init(t,e),Os.init(t,e)});a(fYc,"ql");Ino=ft("ZodNull",(t,e)=>{Jto.init(t,e),Os.init(t,e)});a(kUr,"T3");xno=ft("ZodAny",(t,e)=>{Zto.init(t,e),Os.init(t,e)});a(pYc,"Vl");wno=ft("ZodUnknown",(t,e)=>{$xt.init(t,e),Os.init(t,e)});a(af,"S$");Rno=ft("ZodNever",(t,e)=>{Xto.init(t,e),Os.init(t,e)});a(Vwt,"x3");kno=ft("ZodVoid",(t,e)=>{ero.init(t,e),Os.init(t,e)});a(hYc,"Bl");PUr=ft("ZodDate",(t,e)=>{tro.init(t,e),Os.init(t,e),t.min=(n,o)=>t.check(PI(n,o)),t.max=(n,o)=>t.check(qN(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(mYc,"zl");Pno=ft("ZodArray",(t,e)=>{y9r.init(t,e),Os.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Nve(r,n)),t.nonempty=r=>t.check(Nve(1,r)),t.max=(r,n)=>t.check(Qwt(r,n)),t.length=(r,n)=>t.check(qwt(r,n)),t.unwrap=()=>t.element});a(ba,"W$");a(gYc,"Nl");Wwt=ft("ZodObject",(t,e)=>{E9r.init(t,e),Os.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>N1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:af()}),t.loose=()=>t.clone({...t._zod.def,catchall:af()}),t.strict=()=>t.clone({...t._zod.def,catchall:Vwt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Ws.extend(t,r),t.merge=r=>Ws.merge(t,r),t.pick=r=>Ws.pick(t,r),t.omit=r=>Ws.omit(t,r),t.partial=(...r)=>Ws.partial(BUr,t,r[0]),t.required=(...r)=>Ws.required(FUr,t,r[0])});a(Tn,"h");a(AYc,"wl");a(Zv,"K6");DUr=ft("ZodUnion",(t,e)=>{_9r.init(t,e),Os.init(t,e),t.options=e.options});a(ou,"A$");Dno=ft("ZodDiscriminatedUnion",(t,e)=>{DUr.init(t,e),rro.init(t,e)});a(NUr,"g3");Nno=ft("ZodIntersection",(t,e)=>{nro.init(t,e),Os.init(t,e)});a(zwt,"VJ");Mno=ft("ZodTuple",(t,e)=>{Fwt.init(t,e),Os.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(yYc,"Ol");MUr=ft("ZodRecord",(t,e)=>{iro.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(iu,"I$");a(EYc,"Dl");Ono=ft("ZodMap",(t,e)=>{oro.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(_Yc,"Fl");Lno=ft("ZodSet",(t,e)=>{sro.init(t,e),Os.init(t,e),t.min=(...r)=>t.check(N8e(...r)),t.nonempty=r=>t.check(N8e(1,r)),t.max=(...r)=>t.check(Uwt(...r)),t.size=(...r)=>t.check(V9r(...r))});a(vYc,"Zl");O8e=ft("ZodEnum",(t,e)=>{aro.init(t,e),Os.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 O8e({...e,checks:[],...Ws.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 O8e({...e,checks:[],...Ws.normalizeParams(o),entries:s})}});a(N1,"N6");a(CYc,"Ml");Bno=ft("ZodLiteral",(t,e)=>{cro.init(t,e),Os.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");Fno=ft("ZodFile",(t,e)=>{lro.init(t,e),Os.init(t,e),t.min=(r,n)=>t.check(N8e(r,n)),t.max=(r,n)=>t.check(Uwt(r,n)),t.mime=(r,n)=>t.check(X9r(Array.isArray(r)?r:[r],n))});a(bYc,"Ll");OUr=ft("ZodTransform",(t,e)=>{v9r.init(t,e),Os.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ws.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(Ws.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(LUr,"bV");BUr=ft("ZodOptional",(t,e)=>{uro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Td,"_$");Uno=ft("ZodNullable",(t,e)=>{dro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Kxt,"v3");a(SYc,"jl");Qno=ft("ZodDefault",(t,e)=>{fro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(qno,"aM");jno=ft("ZodPrefault",(t,e)=>{pro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Hno,"eM");FUr=ft("ZodNonOptional",(t,e)=>{hro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Gno,"$L");$no=ft("ZodSuccess",(t,e)=>{mro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(TYc,"Al");Vno=ft("ZodCatch",(t,e)=>{gro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Wno,"XL");zno=ft("ZodNaN",(t,e)=>{Aro.init(t,e),Os.init(t,e)});a(IYc,"Il");UUr=ft("ZodPipe",(t,e)=>{C9r.init(t,e),Os.init(t,e),t.in=e.in,t.out=e.out});a(Jxt,"C3");Yno=ft("ZodReadonly",(t,e)=>{yro.init(t,e),Os.init(t,e)});a(Kno,"GL");Jno=ft("ZodTemplateLiteral",(t,e)=>{Ero.init(t,e),Os.init(t,e)});a(xYc,"Rl");Zno=ft("ZodLazy",(t,e)=>{vro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Xno,"KL");eio=ft("ZodPromise",(t,e)=>{_ro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(wYc,"Pl");Ywt=ft("ZodCustom",(t,e)=>{Cro.init(t,e),Os.init(t,e)});a(tio,"VL");a(rio,"vV");a(nio,"BL");a(iio,"zL");a(RYc,"El");kYc=a((...t)=>uno({Pipe:UUr,Boolean:Gwt,String:jwt,Transform:OUr},...t),"bl");a(PYc,"_l");a(QUr,"u3");DYc={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(NYc,"Sl");a(MYc,"vl");oio={};zL(oio,{string:a(()=>OYc,"string"),number:a(()=>LYc,"number"),date:a(()=>UYc,"date"),boolean:a(()=>BYc,"boolean"),bigint:a(()=>FYc,"bigint")});a(OYc,"Cl");a(LYc,"Tl");a(BYc,"xl");a(FYc,"yl");a(UYc,"fl");tC(bro());QYc=G,sio=QYc,aio="2025-11-25",qYc=[aio,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Vie="io.modelcontextprotocol/related-task",Kwt="2.0",G0=rio(t=>t!==null&&(typeof t=="object"||typeof t=="function")),cio=ou([Tt(),Nc().int()]),lio=Tt(),HJh=Zv({ttl:Nc().optional(),pollInterval:Nc().optional()}),jYc=Tn({ttl:Nc().optional()}),HYc=Tn({taskId:Tt()}),qUr=Zv({progressToken:cio.optional(),[Vie]:HYc.optional()}),LI=Tn({_meta:qUr.optional()}),Y8e=LI.extend({task:jYc.optional()}),GYc=a(t=>Y8e.safeParse(t).success,"FL"),Ny=Tn({method:Tt(),params:LI.loose().optional()}),bk=Tn({_meta:qUr.optional()}),Sk=Tn({method:Tt(),params:bk.loose().optional()}),My=Zv({_meta:qUr.optional()}),Jwt=ou([Tt(),Nc().int()]),uio=Tn({jsonrpc:Xn(Kwt),id:Jwt,...Ny.shape}).strict(),oJi=a(t=>uio.safeParse(t).success,"fV"),dio=Tn({jsonrpc:Xn(Kwt),...Sk.shape}).strict(),$Yc=a(t=>dio.safeParse(t).success,"LL"),jUr=Tn({jsonrpc:Xn(Kwt),id:Jwt,result:My}).strict(),jIt=a(t=>jUr.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={}));HUr=Tn({jsonrpc:Xn(Kwt),id:Jwt.optional(),error:Tn({code:Nc().int(),message:Tt(),data:af().optional()})}).strict(),VYc=a(t=>HUr.safeParse(t).success,"jL"),GJh=ou([uio,dio,jUr,HUr]),$Jh=ou([jUr,HUr]),GUr=My.strict(),WYc=bk.extend({requestId:Jwt.optional(),reason:Tt().optional()}),$Ur=Sk.extend({method:Xn("notifications/cancelled"),params:WYc}),zYc=Tn({src:Tt(),mimeType:Tt().optional(),sizes:ba(Tt()).optional(),theme:N1(["light","dark"]).optional()}),K8e=Tn({icons:ba(zYc).optional()}),Mve=Tn({name:Tt(),title:Tt().optional()}),fio=Mve.extend({...Mve.shape,...K8e.shape,version:Tt(),websiteUrl:Tt().optional(),description:Tt().optional()}),YYc=zwt(Tn({applyDefaults:H0().optional()}),iu(Tt(),af())),KYc=QUr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,zwt(Tn({form:YYc.optional(),url:G0.optional()}),iu(Tt(),af()).optional())),JYc=Zv({list:G0.optional(),cancel:G0.optional(),requests:Zv({sampling:Zv({createMessage:G0.optional()}).optional(),elicitation:Zv({create:G0.optional()}).optional()}).optional()}),ZYc=Zv({list:G0.optional(),cancel:G0.optional(),requests:Zv({tools:Zv({call:G0.optional()}).optional()}).optional()}),XYc=Tn({experimental:iu(Tt(),G0).optional(),sampling:Tn({context:G0.optional(),tools:G0.optional()}).optional(),elicitation:KYc.optional(),roots:Tn({listChanged:H0().optional()}).optional(),tasks:JYc.optional(),extensions:iu(Tt(),G0).optional()}),eKc=LI.extend({protocolVersion:Tt(),capabilities:XYc,clientInfo:fio}),pio=Ny.extend({method:Xn("initialize"),params:eKc}),tKc=Tn({experimental:iu(Tt(),G0).optional(),logging:G0.optional(),completions:G0.optional(),prompts:Tn({listChanged:H0().optional()}).optional(),resources:Tn({subscribe:H0().optional(),listChanged:H0().optional()}).optional(),tools:Tn({listChanged:H0().optional()}).optional(),tasks:ZYc.optional(),extensions:iu(Tt(),G0).optional()}),rKc=My.extend({protocolVersion:Tt(),capabilities:tKc,serverInfo:fio,instructions:Tt().optional()}),hio=Sk.extend({method:Xn("notifications/initialized"),params:bk.optional()}),VUr=Ny.extend({method:Xn("ping"),params:LI.optional()}),nKc=Tn({progress:Nc(),total:Td(Nc()),message:Td(Tt())}),iKc=Tn({...bk.shape,...nKc.shape,progressToken:cio}),WUr=Sk.extend({method:Xn("notifications/progress"),params:iKc}),oKc=LI.extend({cursor:lio.optional()}),J8e=Ny.extend({params:oKc.optional()}),Z8e=My.extend({nextCursor:lio.optional()}),sKc=N1(["working","input_required","completed","failed","cancelled"]),X8e=Tn({taskId:Tt(),status:sKc,ttl:ou([Nc(),kUr()]),createdAt:Tt(),lastUpdatedAt:Tt(),pollInterval:Td(Nc()),statusMessage:Td(Tt())}),Zwt=My.extend({task:X8e}),aKc=bk.merge(X8e),Zxt=Sk.extend({method:Xn("notifications/tasks/status"),params:aKc}),zUr=Ny.extend({method:Xn("tasks/get"),params:LI.extend({taskId:Tt()})}),YUr=My.merge(X8e),KUr=Ny.extend({method:Xn("tasks/result"),params:LI.extend({taskId:Tt()})}),VJh=My.loose(),JUr=J8e.extend({method:Xn("tasks/list")}),ZUr=Z8e.extend({tasks:ba(X8e)}),XUr=Ny.extend({method:Xn("tasks/cancel"),params:LI.extend({taskId:Tt()})}),cKc=My.merge(X8e),mio=Tn({uri:Tt(),mimeType:Td(Tt()),_meta:iu(Tt(),af()).optional()}),gio=mio.extend({text:Tt()}),e7r=Tt().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Aio=mio.extend({blob:e7r}),e6e=N1(["user","assistant"]),Wve=Tn({audience:ba(e6e).optional(),priority:Nc().min(0).max(1).optional(),lastModified:sUr.datetime({offset:!0}).optional()}),yio=Tn({...Mve.shape,...K8e.shape,uri:Tt(),description:Td(Tt()),mimeType:Td(Tt()),size:Td(Nc()),annotations:Wve.optional(),_meta:Td(Zv({}))}),lKc=Tn({...Mve.shape,...K8e.shape,uriTemplate:Tt(),description:Td(Tt()),mimeType:Td(Tt()),annotations:Wve.optional(),_meta:Td(Zv({}))}),$8r=J8e.extend({method:Xn("resources/list")}),uKc=Z8e.extend({resources:ba(yio)}),V8r=J8e.extend({method:Xn("resources/templates/list")}),dKc=Z8e.extend({resourceTemplates:ba(lKc)}),t7r=LI.extend({uri:Tt()}),fKc=t7r,W8r=Ny.extend({method:Xn("resources/read"),params:fKc}),pKc=My.extend({contents:ba(ou([gio,Aio]))}),hKc=Sk.extend({method:Xn("notifications/resources/list_changed"),params:bk.optional()}),mKc=t7r,gKc=Ny.extend({method:Xn("resources/subscribe"),params:mKc}),AKc=t7r,yKc=Ny.extend({method:Xn("resources/unsubscribe"),params:AKc}),EKc=bk.extend({uri:Tt()}),_Kc=Sk.extend({method:Xn("notifications/resources/updated"),params:EKc}),vKc=Tn({name:Tt(),description:Td(Tt()),required:Td(H0())}),CKc=Tn({...Mve.shape,...K8e.shape,description:Td(Tt()),arguments:Td(ba(vKc)),_meta:Td(Zv({}))}),z8r=J8e.extend({method:Xn("prompts/list")}),bKc=Z8e.extend({prompts:ba(CKc)}),SKc=LI.extend({name:Tt(),arguments:iu(Tt(),Tt()).optional()}),Y8r=Ny.extend({method:Xn("prompts/get"),params:SKc}),r7r=Tn({type:Xn("text"),text:Tt(),annotations:Wve.optional(),_meta:iu(Tt(),af()).optional()}),n7r=Tn({type:Xn("image"),data:e7r,mimeType:Tt(),annotations:Wve.optional(),_meta:iu(Tt(),af()).optional()}),i7r=Tn({type:Xn("audio"),data:e7r,mimeType:Tt(),annotations:Wve.optional(),_meta:iu(Tt(),af()).optional()}),TKc=Tn({type:Xn("tool_use"),name:Tt(),id:Tt(),input:iu(Tt(),af()),_meta:iu(Tt(),af()).optional()}),IKc=Tn({type:Xn("resource"),resource:ou([gio,Aio]),annotations:Wve.optional(),_meta:iu(Tt(),af()).optional()}),xKc=yio.extend({type:Xn("resource_link")}),o7r=ou([r7r,n7r,i7r,xKc,IKc]),wKc=Tn({role:e6e,content:o7r}),RKc=My.extend({description:Tt().optional(),messages:ba(wKc)}),kKc=Sk.extend({method:Xn("notifications/prompts/list_changed"),params:bk.optional()}),PKc=Tn({title:Tt().optional(),readOnlyHint:H0().optional(),destructiveHint:H0().optional(),idempotentHint:H0().optional(),openWorldHint:H0().optional()}),DKc=Tn({taskSupport:N1(["required","optional","forbidden"]).optional()}),Eio=Tn({...Mve.shape,...K8e.shape,description:Tt().optional(),inputSchema:Tn({type:Xn("object"),properties:iu(Tt(),G0).optional(),required:ba(Tt()).optional()}).catchall(af()),outputSchema:Tn({type:Xn("object"),properties:iu(Tt(),G0).optional(),required:ba(Tt()).optional()}).catchall(af()).optional(),annotations:PKc.optional(),execution:DKc.optional(),_meta:iu(Tt(),af()).optional()}),K8r=J8e.extend({method:Xn("tools/list")}),NKc=Z8e.extend({tools:ba(Eio)}),s7r=My.extend({content:ba(o7r).default([]),structuredContent:iu(Tt(),af()).optional(),isError:H0().optional()}),WJh=s7r.or(My.extend({toolResult:af()})),MKc=Y8e.extend({name:Tt(),arguments:iu(Tt(),af()).optional()}),Xxt=Ny.extend({method:Xn("tools/call"),params:MKc}),OKc=Sk.extend({method:Xn("notifications/tools/list_changed"),params:bk.optional()}),zJh=Tn({autoRefresh:H0().default(!0),debounceMs:Nc().int().nonnegative().default(300)}),ewt=N1(["debug","info","notice","warning","error","critical","alert","emergency"]),LKc=LI.extend({level:ewt}),_io=Ny.extend({method:Xn("logging/setLevel"),params:LKc}),BKc=bk.extend({level:ewt,logger:Tt().optional(),data:af()}),FKc=Sk.extend({method:Xn("notifications/message"),params:BKc}),UKc=Tn({name:Tt().optional()}),QKc=Tn({hints:ba(UKc).optional(),costPriority:Nc().min(0).max(1).optional(),speedPriority:Nc().min(0).max(1).optional(),intelligencePriority:Nc().min(0).max(1).optional()}),qKc=Tn({mode:N1(["auto","required","none"]).optional()}),jKc=Tn({type:Xn("tool_result"),toolUseId:Tt().describe("The unique identifier for the corresponding tool call."),content:ba(o7r).default([]),structuredContent:Tn({}).loose().optional(),isError:H0().optional(),_meta:iu(Tt(),af()).optional()}),HKc=NUr("type",[r7r,n7r,i7r]),twt=NUr("type",[r7r,n7r,i7r,TKc,jKc]),GKc=Tn({role:e6e,content:ou([twt,ba(twt)]),_meta:iu(Tt(),af()).optional()}),$Kc=Y8e.extend({messages:ba(GKc),modelPreferences:QKc.optional(),systemPrompt:Tt().optional(),includeContext:N1(["none","thisServer","allServers"]).optional(),temperature:Nc().optional(),maxTokens:Nc().int(),stopSequences:ba(Tt()).optional(),metadata:G0.optional(),tools:ba(Eio).optional(),toolChoice:qKc.optional()}),VKc=Ny.extend({method:Xn("sampling/createMessage"),params:$Kc}),a7r=My.extend({model:Tt(),stopReason:Td(N1(["endTurn","stopSequence","maxTokens"]).or(Tt())),role:e6e,content:HKc}),vio=My.extend({model:Tt(),stopReason:Td(N1(["endTurn","stopSequence","maxTokens","toolUse"]).or(Tt())),role:e6e,content:ou([twt,ba(twt)])}),WKc=Tn({type:Xn("boolean"),title:Tt().optional(),description:Tt().optional(),default:H0().optional()}),zKc=Tn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),minLength:Nc().optional(),maxLength:Nc().optional(),format:N1(["email","uri","date","date-time"]).optional(),default:Tt().optional()}),YKc=Tn({type:N1(["number","integer"]),title:Tt().optional(),description:Tt().optional(),minimum:Nc().optional(),maximum:Nc().optional(),default:Nc().optional()}),KKc=Tn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),enum:ba(Tt()),default:Tt().optional()}),JKc=Tn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),oneOf:ba(Tn({const:Tt(),title:Tt()})),default:Tt().optional()}),ZKc=Tn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),enum:ba(Tt()),enumNames:ba(Tt()).optional(),default:Tt().optional()}),XKc=ou([KKc,JKc]),eJc=Tn({type:Xn("array"),title:Tt().optional(),description:Tt().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({type:Xn("string"),enum:ba(Tt())}),default:ba(Tt()).optional()}),tJc=Tn({type:Xn("array"),title:Tt().optional(),description:Tt().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({anyOf:ba(Tn({const:Tt(),title:Tt()}))}),default:ba(Tt()).optional()}),rJc=ou([eJc,tJc]),nJc=ou([ZKc,XKc,rJc]),iJc=ou([nJc,WKc,zKc,YKc]),oJc=Y8e.extend({mode:Xn("form").optional(),message:Tt(),requestedSchema:Tn({type:Xn("object"),properties:iu(Tt(),iJc),required:ba(Tt()).optional()})}),sJc=Y8e.extend({mode:Xn("url"),message:Tt(),elicitationId:Tt(),url:Tt().url()}),aJc=ou([oJc,sJc]),cJc=Ny.extend({method:Xn("elicitation/create"),params:aJc}),lJc=bk.extend({elicitationId:Tt()}),uJc=Sk.extend({method:Xn("notifications/elicitation/complete"),params:lJc}),rwt=My.extend({action:N1(["accept","decline","cancel"]),content:QUr(t=>t===null?void 0:t,iu(Tt(),ou([Tt(),Nc(),H0(),ba(Tt())])).optional())}),dJc=Tn({type:Xn("ref/resource"),uri:Tt()}),fJc=Tn({type:Xn("ref/prompt"),name:Tt()}),pJc=LI.extend({ref:ou([fJc,dJc]),argument:Tn({name:Tt(),value:Tt()}),context:Tn({arguments:iu(Tt(),Tt()).optional()}).optional()}),J8r=Ny.extend({method:Xn("completion/complete"),params:pJc});a(hJc,"kL");a(mJc,"SL");gJc=My.extend({completion:Zv({values:ba(Tt()).max(100),total:Td(Nc().int()),hasMore:Td(H0())})}),AJc=Tn({uri:Tt().startsWith("file://"),name:Tt().optional(),_meta:iu(Tt(),af()).optional()}),yJc=Ny.extend({method:Xn("roots/list"),params:LI.optional()}),Cio=My.extend({roots:ba(AJc)}),EJc=Sk.extend({method:Xn("notifications/roots/list_changed"),params:bk.optional()}),YJh=ou([VUr,pio,J8r,_io,Y8r,z8r,$8r,V8r,W8r,gKc,yKc,Xxt,K8r,zUr,KUr,JUr,XUr]),KJh=ou([$Ur,WUr,hio,EJc,Zxt]),JJh=ou([GUr,a7r,vio,rwt,Cio,YUr,ZUr,Zwt]),ZJh=ou([VUr,VKc,cJc,yJc,zUr,KUr,JUr,XUr]),XJh=ou([$Ur,WUr,FKc,_Kc,hKc,OKc,kKc,Zxt,uJc]),eZh=ou([GUr,rKc,gJc,RKc,bKc,uKc,dKc,pKc,s7r,NKc,YUr,ZUr,Zwt]),fi=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 Z8r(o.elicitations,r)}return new t(e,r,n)}},Z8r=class extends fi{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(Gie,"T1");_Jc=Symbol("Let zodToJsonSchema decide on which parser to use"),sJi={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"},vJc=a(t=>typeof t=="string"?{...sJi,name:t}:{...sJi,...t},"xL"),CJc=a(t=>{let e=vJc(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(bio,"aV");a(yl,"H$");Sio=a((t,e)=>{let r=0;for(;rDc(t.innerType._def,e),"uL");a(Iio,"sV");xJc=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":yl(r,"minimum",n.value,n.message,e);break;case"max":yl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(wJc,"mL");a(RJc,"lL");a(kJc,"cL");PJc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(DJc,"pL");a(NJc,"dL");zFr=void 0,FN={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(()=>(zFr===void 0&&(zFr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),zFr),"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(xio,"qW");a(YFr,"$B");MJc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(OJc,"Np");a(UN,"V4");a(Jv,"w6");a(aJi,"iL");a(wio,"VW");a(LJc,"nL");a(BJc,"rL");a(FJc,"oL");a(UJc,"tL");nwt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(QJc,"sL");cJi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Dc(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(qJc,"eL");a(jJc,"$j");a(HJc,"Qj");a(GJc,"wp");a($Jc,"Op");VJc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Dc(t.innerType._def,e);let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:D1(e)},r]}:D1(e)},"Jj"),WJc=a((t,e)=>{if(e.pipeStrategy==="input")return Dc(t.in._def,e);if(e.pipeStrategy==="output")return Dc(t.out._def,e);let r=Dc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Dc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(zJc,"Yj");a(YJc,"Wj");a(KJc,"Gj");a(JJc,"Uj");a(ZJc,"Hj");XJc=a((t,e)=>Dc(t.innerType._def,e),"Kj"),eZc=a((t,e,r)=>{switch(e){case Cr.ZodString:return xio(t,r);case Cr.ZodNumber:return jJc(t,r);case Cr.ZodObject:return HJc(t,r);case Cr.ZodBigInt:return SJc(t,r);case Cr.ZodBoolean:return TJc();case Cr.ZodDate:return Iio(t,r);case Cr.ZodUndefined:return JJc(r);case Cr.ZodNull:return UJc(r);case Cr.ZodArray:return bJc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return QJc(t,r);case Cr.ZodIntersection:return DJc(t,r);case Cr.ZodTuple:return KJc(t,r);case Cr.ZodRecord:return wio(t,r);case Cr.ZodLiteral:return NJc(t,r);case Cr.ZodEnum:return kJc(t);case Cr.ZodNativeEnum:return BJc(t);case Cr.ZodNullable:return qJc(t,r);case Cr.ZodOptional:return VJc(t,r);case Cr.ZodMap:return LJc(t,r);case Cr.ZodSet:return YJc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return zJc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return FJc(r);case Cr.ZodEffects:return RJc(t,r);case Cr.ZodAny:return D1(r);case Cr.ZodUnknown:return ZJc(r);case Cr.ZodDefault:return wJc(t,r);case Cr.ZodBranded:return Tio(t,r);case Cr.ZodReadonly:return XJc(t,r);case Cr.ZodCatch:return IJc(t,r);case Cr.ZodPipeline:return WJc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Dc,"r");tZc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Sio(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`),D1(e)):e.$refStrategy==="seen"?D1(e):void 0}},"Dp"),rZc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),nZc=a((t,e)=>{let r=CJc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Dc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??D1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Dc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??D1(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(iZc,"Zp");a(lJi,"JB");a(uJi,"XB");a(dJi,"YB");oZc=6e4,X8r=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($Ur,r=>{this._oncancel(r)}),this.setNotificationHandler(WUr,r=>{this._onprogress(r)}),this.setRequestHandler(VUr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zUr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(KUr,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 fi(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 fi(Bi.InvalidParams,`Task not found: ${s}`);if(!Gie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Gie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Vie]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(JUr,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 fi(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(XUr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Gie(o.status))throw new fi(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 fi(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof fi?o:new fi(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),fi.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),jIt(s)||VYc(s)?this._onresponse(s):oJi(s)?this._onrequest(s,c):$Yc(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=fi.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?.[Vie]?.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=GYc(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 fi(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),jIt(e))n(e);else{let c=new fi(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(jIt(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),jIt(e))o(e);else{let c=fi.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 fi?c:new fi(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,Zwt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new fi(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Gie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new fi(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new fi(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 fi?c:new fi(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||{},[Vie]: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 fi?v:new fi(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=a8e(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??oZc,E=a(()=>A(fi.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},YUr,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},ZUr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},cKc,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||{},[Vie]: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||{},[Vie]: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||{},[Vie]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=uJi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=dJi(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=uJi(e);this._notificationHandlers.set(n,o=>{let s=dJi(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"&&oJi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new fi(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 fi(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new fi(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 fi(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=Zxt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Gie(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 fi(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Gie(l.status))throw new fi(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=Zxt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Gie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(fJi,"Vj");a(sZc,"Bj");aZc=C6r(pZi(),1),cZc=C6r(B9c(),1);a(lZc,"ps");e6r=class{static{a(this,"qz")}constructor(e){this._ajv=e??lZc()}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)}}},t6r=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},a7r,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},rwt,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(uZc,"tP");a(dZc,"aP");r6r=class extends X8r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ewt.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(hio,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(_io,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=ewt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new t6r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=sZc(this._capabilities,e)}setRequestHandler(e,r){let n=W8e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(WL(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=a8e(Xxt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new fi(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=a8e(Zwt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new fi(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=a8e(s7r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new fi(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){dZc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&uZc(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:qYc.includes(r)?r:aio,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"},GUr)}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},vio,r):this.request({method:"sampling/createMessage",params:e},a7r,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},rwt,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},rwt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new fi(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof fi?s:new fi(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},Cio,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"})}},Rio=Symbol.for("mcp.completable");a(pJi,"zz");a(fZc,"$E");(function(t){t.Completable="McpCompletable"})(hJi||(hJi={}));pZc=/^[A-Za-z0-9._-]{1,128}$/;a(hZc,"is");a(mZc,"ns");a(mJi,"Nz");n6r=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)}},i6r=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 r6r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new n6r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(nW(K8r)),this.server.assertCanSetRequestHandler(nW(Xxt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(K8r,()=>({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=$Fe(r.inputSchema);return o?lJi(o,{strictUnions:!0,pipeStrategy:"input"}):gZc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=$Fe(r.outputSchema);o&&(n.outputSchema=lJi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Xxt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new fi(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 fi(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new fi(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 fi&&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=$Fe(e.inputSchema)??e.inputSchema,s=await VFr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=WFr(c);throw new fi(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 fi(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=$Fe(e.outputSchema),s=await VFr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=WFr(c);throw new fi(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 fi(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(nW(J8r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(J8r,async e=>{switch(e.params.ref.type){case"ref/prompt":return hJc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return mJc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new fi(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 fi(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return VFe;let o=W8e(n.argsSchema)?.[e.params.argument.name];if(!pJi(o))return VFe;let s=fZc(o);if(!s)return VFe;let c=await s(e.params.argument.value,e.params.context);return AJi(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 VFe;throw new fi(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return VFe;let s=await o(e.params.argument.value,e.params.context);return AJi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(nW($8r)),this.server.assertCanSetRequestHandler(nW(V8r)),this.server.assertCanSetRequestHandler(nW(W8r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler($8r,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(V8r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(W8r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new fi(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 fi(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(nW(z8r)),this.server.assertCanSetRequestHandler(nW(Y8r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(z8r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?AZc(r.argsSchema):void 0}))})),this.server.setRequestHandler(Y8r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=$Fe(n.argsSchema),s=await VFr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=WFr(u);throw new fi(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:sve(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=sve(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 vk?l._def?.innerType:l;return pJi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){mJi(e);let f={title:r,description:n,inputSchema:gJi(o),outputSchema:gJi(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"&&mJi(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=sve(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=sve(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(o6r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!o6r(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()}},gZc={type:"object",properties:{}};a(kio,"XE");a(Pio,"YE");a(o6r,"Oz");a(gJi,"QE");a(AZc,"os");a(nW,"l1");a(AJi,"JE");VFe={completion:{values:[],hasMore:!1}};a(yZc,"ts");a(EZc,"as");a(_Zc,"ss");a(wr,"b");yJi=15e3,vZc=wr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),Ak=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},s6r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new Dxt;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 R1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new R1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await bZc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=U8e(s);if(!(c instanceof R1)){let l=c instanceof Ak&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&EJi(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 Ak(`WebSocket connection timeout after ${yJi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},yJi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,mk(`[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=GN(f)}catch(m){pk(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new mk("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 mk(`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"?bXi("transport_direct_connect"):e==="bad"?SXi("transport_direct_connect",r??"unknown"):tGc("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 R1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new mk("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&&lJi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(iZc,"$e");a(oZc,"Qe");a(lJi,"GE");a(r6r,"nJ");a(sZc,"Xe");a(aZc,"Ye");a(cZc,"We");a(lZc,"Ge");a(Ywt,"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"})(uJi||(uJi={}));_Jh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),vJh={" ":{"\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=WN(f)}catch(m){mk(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new Ak("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 Ak(`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"?NXi("transport_direct_connect"):e==="bad"?MXi("transport_direct_connect",r??"unknown"):EGc("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 R1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Ak("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&&EJi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(CZc,"$e");a(bZc,"Qe");a(EJi,"GE");a(a6r,"nJ");a(SZc,"Xe");a(TZc,"Ye");a(IZc,"We");a(xZc,"Ge");a(Xwt,"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"})(_Ji||(_Ji={}));tZh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),rZh={" ":{"\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}})(dJi||(dJi={}));(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"})(fJi||(fJi={}));(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"})(pJi||(pJi={}));(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"})(hJi||(hJi={}));a(Sio,"rW");iW=n7r.default.homedir(),i7r=n7r.default.tmpdir(),{env:ive}=ewt.default,uZc=a(t=>{let e=nf.default.join(iW,"Library");return{data:nf.default.join(e,"Application Support",t),config:nf.default.join(e,"Preferences",t),cache:nf.default.join(e,"Caches",t),log:nf.default.join(e,"Logs",t),temp:nf.default.join(i7r,t)}},"Oe"),dZc=a(t=>{let e=ive.APPDATA||nf.default.join(iW,"AppData","Roaming"),r=ive.LOCALAPPDATA||nf.default.join(iW,"AppData","Local");return{data:nf.default.join(r,t,"Data"),config:nf.default.join(e,t,"Config"),cache:nf.default.join(r,t,"Cache"),log:nf.default.join(r,t,"Log"),temp:nf.default.join(i7r,t)}},"De"),fZc=a(t=>{let e=nf.default.basename(iW);return{data:nf.default.join(ive.XDG_DATA_HOME||nf.default.join(iW,".local","share"),t),config:nf.default.join(ive.XDG_CONFIG_HOME||nf.default.join(iW,".config"),t),cache:nf.default.join(ive.XDG_CACHE_HOME||nf.default.join(iW,".cache"),t),log:nf.default.join(ive.XDG_STATE_HOME||nf.default.join(iW,".local","state"),t),temp:nf.default.join(i7r,e,t)}},"Fe");a(pZc,"Mz");CJh=pZc("claude-cli");a(hZc,"Ze");a(mZc,"wE");gZc=100,$Fr=[];a(AZc,"Le");yZc=[],mJi=null,bJh=Py(()=>process.argv.includes("--hard-fail"));a(Tio,"oW");Z_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Iio=new Set,n6r=typeof process=="object"&&process?process:{},xio=a((t,e,r,n)=>{typeof n6r.emitWarning=="function"?n6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),twt=globalThis.AbortController,gJi=globalThis.AbortSignal;if(typeof twt>"u"){gJi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},twt=class{static{a(this,"tW")}constructor(){e()}signal=new gJi;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=n6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,xio("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")}EZc=a(t=>!Iio.has(t),"Ae"),eW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),wio=a(t=>eW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cve:null:null,"ME"),cve=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},i6r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=wio(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]}},o6r=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&&!eW(r))throw TypeError("max option must be a nonnegative integer");let x=r?wio(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=i6r.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&&!eW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!eW(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=eW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!eW(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&&EZc("LRU_CACHE_UNBOUNDED")&&(Iio.add("LRU_CACHE_UNBOUNDED"),xio("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 cve(this.#e),r=new cve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Z_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?Z_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=Z_e.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");#L=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new cve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!eW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!eW(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");#B=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-(Z_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=Z_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=Z_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.#B(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.#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.#L(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.#P(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 twt,{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 twt}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.#P(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(_Zc,"LE");vZc=8192;a(Rio,"AE");AJi=_Zc(Rio,t=>t,50),Kwt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>vZc?Rio(t,e):AJi(t,e);return r.ok?r.value:null},{cache:AJi.cache}),Jwt=Py(()=>{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=DI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return Tio(t),"unknown"}}),TJh=Py(()=>{if(process.platform==="linux")try{let t=DI().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){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),IJh=Py(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,o7r.release)()};try{let e=await(0,Pio.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}),xJh=Py(()=>{if(process.platform!=="darwin")return;let t=(0,o7r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),P8e=Py(function(){switch(Jwt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),wJh=Py(function(){return(0,kio.join)(P8e(),"managed-settings.d")}),CZc=wr(()=>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()),bZc=wr(()=>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()),SZc=wr(()=>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:CZc(),filesystem:bZc(),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,s6r.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,s6r.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()),TZc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],IZc=["normal","vim"],xZc=["auto","tmux","in-process"],wZc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],RZc=["auto",...wZc],RJh=Jwt()==="macos"?"\u23FA":"\u25CF",s7r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],kZc=[...s7r,"bubble"],PZc=kZc,kJh=wr(()=>Kno.enum(PZc)),PJh=wr(()=>Kno.enum(s7r)),DZc=["bash","powershell"],jFe=wr(()=>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(NZc,"Se");MZc=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=NZc();return G.discriminatedUnion("type",[t,e,r,n,o])}),OZc=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(MZc()).describe("List of hooks to execute when the matcher matches")})),rwt=wr(()=>G.partialRecord(G.enum(ywt),G.array(OZc()))),DJh=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),NJh=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),$ve=wr(()=>G.literal("comms").optional().catch(void 0)),mW=wr(()=>G.number().int().positive()),LZc=wr(()=>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:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),BZc=wr(()=>G.boolean()),Dio=wr(()=>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:BZc().optional()})),FZc=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Dio().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),UZc=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),QZc=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),qZc=wr(()=>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:Dio().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),jZc=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),HZc=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:mW().optional(),alwaysLoad:G.boolean().optional()})),GZc=wr(()=>G.enum(["allow","ask","blocked"])),$Zc=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),GZc()).optional()})),a6r=wr(()=>G.union([LZc(),FZc(),UZc(),QZc(),qZc(),jZc(),HZc(),$Zc()])),MJh=wr(()=>G.object({mcpServers:G.record(G.string(),a6r())})),Nio=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"]),VZc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,WZc=/[^\u0020-\u007E]/;a(zZc,"pe");jN=wr(()=>G.string().startsWith("./")),ooe=wr(()=>jN().endsWith(".json")),yJi=wr(()=>G.union([jN().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")])),c6r=wr(()=>jN().endsWith(".md")),l6r=wr(()=>G.union([c6r(),jN()])),Mio=wr(()=>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=>!zZc(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/'})),a7r=wr(()=>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")})),YZc=wr(()=>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:a7r().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(EXc()).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.`)})),OJh=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>rwt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),KZc=wr(()=>G.object({hooks:G.union([ooe().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(()=>rwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([ooe().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(()=>rwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),JZc=wr(()=>G.object({source:l6r().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'})),ZZc=wr(()=>G.object({commands:G.union([l6r().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(l6r().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(),JZc()).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")')])})),XZc=wr(()=>G.object({agents:G.union([c6r().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(c6r().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.")])})),eXc=wr(()=>G.object({skills:G.union([jN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(jN().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.")])})),Oio=wr(()=>G.object({outputStyles:G.union([jN().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(jN().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.")])})),Lio=wr(()=>G.object({themes:G.union([jN().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(jN().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.")])})),tXc=wr(()=>G.object({})),EJi=wr(()=>G.string().min(1)),rXc=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),nXc=wr(()=>G.object({mcpServers:G.union([ooe().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),yJi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),a6r()).describe("MCP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to MCP servers configuration file"),yJi().describe("Path or URL to MCPB file"),G.record(G.string(),a6r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Bio=wr(()=>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()),iXc=wr(()=>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"),Bio()).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.")})),oXc=wr(()=>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(),Bio()).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.")})),_Ji=wr(()=>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(EJi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(rXc(),EJi()).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")})),sXc=wr(()=>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).')})),aXc=wr(()=>G.array(sXc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),Fio=wr(()=>G.object({monitors:G.union([ooe().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),aXc()]).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.")})),cXc=wr(()=>G.object({lspServers:G.union([ooe().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),_Ji()).describe("LSP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to LSP configuration file"),G.record(G.string(),_Ji()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Uio=wr(()=>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")),lXc=wr(()=>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.")})),uXc=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Lio().partial().shape,...Fio().partial().shape,...Oio().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."))})),dXc=wr(()=>G.object({...YZc().shape,...KZc().partial().shape,...ZZc().partial().shape,...XZc().partial().shape,...eXc().partial().shape,...Oio().partial().shape,...Lio().partial().shape,...tXc().shape,...oXc().partial().shape,...nXc().partial().shape,...cXc().partial().shape,...Fio().partial().shape,...lXc().partial().shape,...iXc().partial().shape,...uXc().partial().shape})),nwt=wr(()=>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:Uio().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:Mio().refine(t=>!Nio.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(fXc()).describe("Plugin entries declared inline in settings.json"),owner:a7r().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).")])),VFr=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Qio=wr(()=>G.union([jN().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:Uio().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:VFr().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:VFr().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:VFr().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.')])),fXc=wr(()=>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:Qio().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)."})),pXc=wr(()=>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.`)})),hXc=wr(()=>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:pXc().optional().describe("Matchers that determine when the plugin is relevant.")})),mXc=wr(()=>dXc().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:Qio().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,hXc().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.`)})),gXc=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(AXc,"z$$");LJh=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Mio(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:a7r().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(AXc).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.")})),qio=wr(()=>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")),yXc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,EXc=wr(()=>G.union([G.string().regex(yXc,"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)])),_Xc=wr(()=>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).")})),vXc=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(qio(),_Xc()).describe("Map of plugin IDs to their installation metadata")})),CXc=wr(()=>G.enum(["managed","user","project","local"])),bXc=wr(()=>G.object({scope:CXc().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.")})),SXc=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(qio(),G.array(bXc())).describe("Map of plugin IDs to arrays of installation entries")})),BJh=wr(()=>G.union([vXc(),SXc()])),TXc=wr(()=>G.object({source:nwt().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")})),FJh=wr(()=>G.record(G.string(),TXc())),IXc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],xXc="https://json.schemastore.org/claude-code-settings.json",wXc=["autoMode","deepLink","voice","assistant","briefView"],UIt={},Zwt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"shape"),permissionsShape:a(()=>UIt,"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(()=>UIt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"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(jio,"Ez");a(RXc,"tE");a(kXc,"aE");a(PXc,"sE");a(DXc,"eE");vJi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(X_e,"E9");Hio="workspace",UJh=`mcp__${Hio}__bash`,QJh=`mcp__${Hio}__web_fetch`;a(NXc,"A$$");a(MXc,"Jb");a(OXc,"I$$");a(LXc,"R$$");iwt={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(BXc,"Xb");a(FXc,"Yb");a(UXc,"Wb");a(Gio,"Gb");a(WFr,"bz");a(QXc,"P$$");a($io,"_z");zFr=wr(()=>G.string().superRefine((t,e)=>{let r=$io(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}})}})),qXc=wr(()=>G.record(G.string(),G.coerce.string()));a(Vio,"Hb");qJh=wr(()=>Vio(jio())),jXc=wr(()=>G.object({source:nwt().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")})),Wio=wr(()=>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=>WXi([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"'})),zio=wr(()=>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=>WXi([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"'})),HXc=wr(()=>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()})),CJi=["skills","agents","hooks","mcp"];a(GXc,"Kb");Vve=wr(()=>GXc(jio())),H9="https://code.claude.com/docs/en",$Xc=[{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:`${H9}/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:`${H9}/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:`${H9}/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:`${H9}/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:`${H9}/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:`${H9}/iam#working-directories`}}],VXc={permissions:`${H9}/iam#configuring-permissions`,env:`${H9}/settings#environment-variables`,hooks:`${H9}/hooks`};a(WXc,"qb");jJh=wr(()=>Vve().strict());a(bJi,"Vb");a(SJi,"Bb");a(zXc,"v$$");a(TJi,"zb");a(lve,"b9");a(IJi,"Nb");a(K8e,"d0");a(YXc,"C$$");KXc=new Set(ywt);a(JXc,"x$$");ZXc=[{key:"allowedMcpServers",schema:Wio},{key:"deniedMcpServers",schema:zio}];a(XXc,"f$$");a(Wve,"i1");xJi="com.anthropic.claudecode",u6r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",d6r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",ove="Settings",eel="/usr/bin/plutil",tel=["-convert","json","-o","-","--"],rel=5e3,wJi="/mnt/c/Windows/System32/reg.exe",owt="/mnt/c/Program Files/ClaudeCode";a(Kio,"XG");a(nel,"Zb");iel=null;a(HFe,"$5");a(oel,"Mb");a(sel,"Lb");rW=Object.freeze({settings:{},errors:[]}),Xio=null,eoo=null,too=!1,swt=null;a(ael,"l$$");a(cel,"bb");a(lel,"_b");a(uel,"kb");a(del,"Sb");a(YFr,"Cz");a(RJi,"jb");a(fel,"c$$");a(pel,"p$$");a(kJi,"Ab");a(hel,"d$$");a(PJi,"Ib");a(mel,"i$$");f6r=mel;a(gel,"n$$");Ael=gel,yel=Ael(),Eel=yel;a(_el,"o$$");vel=_el,Cel="[object Object]",bel=Function.prototype,Sel=Object.prototype,roo=bel.toString,Tel=Sel.hasOwnProperty,Iel=roo.call(Object);a(xel,"Q6$");wel=xel;a(Rel,"J6$");p6r=Rel;a(kel,"X6$");Pel=kel;a(Del,"Y6$");Nel=Del;a(noo,"hb");Mel=noo;a(Oel,"W6$");Lel=Oel,DJi=Math.max;a(Bel,"G6$");ioo=Bel;a(Fel,"U6$");Uel=Fel,Qel=Sxt?function(t,e){return Sxt(t,"toString",{configurable:!0,enumerable:!1,value:Uel(e),writable:!0})}:dXi,qel=Qel,jel=800,Hel=16,Gel=Date.now;a($el,"B6$");Vel=$el,Wel=Vel(qel),ooo=Wel;a(zel,"N6$");Yel=zel;a(Kel,"w6$");Jel=Kel;a(Zel,"O6$");Xel=Zel,etl=Xel(function(t,e,r,n){Mel(t,e,r,n)}),oW=etl;a(ttl,"F6$");rtl=ttl;a(ntl,"Z6$");itl=ntl;a(otl,"M6$");stl=otl,NJi=cW?cW.isConcatSpreadable:void 0;a(atl,"L6$");ctl=atl;a(soo,"$_");ltl=soo;a(utl,"j6$");dtl=utl;a(ftl,"A6$");ptl=ftl,htl=ptl(function(t,e){return t==null?{}:stl(t,e)}),KFr=htl,mtl="remote-settings.json",JFr=null;a(Atl,"b6$");a(ytl,"_6$");a(Etl,"W_");a(c7r,"fz");a(_tl,"S6$");a(coo,"U_");a(ZFr,"xz");a(vtl,"v6$");a(awt,"HG");a(loo,"H_");a(uoo,"K_");a(doo,"q_");a(foo,"V_");a(Ctl,"C6$");a(MJi,"G_");a(btl,"T6$");a(cwt,"Y5");a(Stl,"x6$");a(poo,"B_");a(Ttl,"y6$");a(Itl,"f6$");a(xtl,"z_");a(wtl,"g6$");a(hoo,"N_");a(Rtl,"h6$");a(ktl,"u6$");a(sW,"o1");XFr=!1;a(Ptl,"m6$");a(Dtl,"l6$");a(Ntl,"c6$");a(Mtl,"w_");a(Otl,"O_");Ltl={user:"userSettings",project:"projectSettings",local:"localSettings"},OJi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},Btl=["user","project","local"],Ftl=new Set(["bypassPermissions","auto","acceptEdits"]),Utl=new Set(["project"]);a(Qtl,"o6$");a(qtl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(jtl,"LA$");a(Htl,"G4$");a(Gtl,"U4$");a($tl,"H4$");a(moo,"b_");a(h6r,"uz");a(m6r,"mz");Vtl=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(lwt,"KG");a(Wtl,"q4$");a(ztl,"jA$");a(Ytl,"AA$");a(Ktl,"IA$");a(Jtl,"RA$");a(Ztl,"PA$");a(Xtl,"EA$");a(erl,"bA$");a(trl,"_A$");a(rrl,"kA$");a(nrl,"SA$");a(LJi,"M_");a(irl,"V4$");a(orl,"vA$");a(srl,"CA$");a(goo,"__");a(bk,"J4");a(Aoo,"k_");a(BJi,"L_");a(g6r,"lz");a(arl,"B4$");a(FJi,"j_");a(yoo,"S_");a(crl,"z4$");a(Eoo,"v_");a(lrl,"N4$");a(url,"w4$");a(drl,"O4$");a(frl,"D4$");a(prl,"F4$");a(hrl,"Z4$");a(mrl,"M4$");a(UJi,"A_")});var Lso=I((O7r,Oso)=>{p();O7r.createWatcher=W6e()("vscode-policy-watcher");if(require.main===Oso){let t=process.platform;O7r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var yao=I(H7r=>{p();var Aao="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");H7r.encode=function(t){if(0<=t&&t{p();var Eao=yao(),G7r=5,_ao=1<>1;return e?-r:r}a(eil,"fromVLQSigned");$7r.encode=a(function(e){var r="",n,o=Xnl(e);do n=o&vao,o>>>=G7r,o>0&&(n|=Cao),r+=Eao.encode(n);while(o>0);return r},"base64VLQ_encode");$7r.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=Eao.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Cao),u&=vao,s=s+(u<{p();function til(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(til,"getArg");p_.getArg=til;var bao=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ril=/^data:.+\,.+$/;function I6e(t){var e=t.match(bao);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(I6e,"urlParse");p_.urlParse=I6e;function lCe(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(lCe,"urlGenerate");p_.urlGenerate=lCe;function W7r(t){var e=t,r=I6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=p_.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,lCe(r)):e}a(W7r,"normalize");p_.normalize=W7r;function Sao(t,e){t===""&&(t="."),e===""&&(e=".");var r=I6e(e),n=I6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),lCe(r);if(r||e.match(ril))return e;if(n&&!n.host&&!n.path)return n.host=e,lCe(n);var o=e.charAt(0)==="/"?e:W7r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,lCe(n)):o}a(Sao,"join");p_.join=Sao;p_.isAbsolute=function(t){return t.charAt(0)==="/"||bao.test(t)};function nil(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(nil,"relative");p_.relative=nil;var Tao=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Iao(t){return t}a(Iao,"identity");function iil(t){return xao(t)?"$"+t:t}a(iil,"toSetString");p_.toSetString=Tao?Iao:iil;function oil(t){return xao(t)?t.slice(1):t}a(oil,"fromSetString");p_.fromSetString=Tao?Iao:oil;function xao(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(xao,"isProtoString");function sil(t,e,r){var n=uCe(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:uCe(t.name,e.name)}a(sil,"compareByOriginalPositions");p_.compareByOriginalPositions=sil;function ail(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=uCe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:uCe(t.name,e.name)}a(ail,"compareByGeneratedPositionsDeflated");p_.compareByGeneratedPositionsDeflated=ail;function uCe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(uCe,"strcmp");function cil(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=uCe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:uCe(t.name,e.name)}a(cil,"compareByGeneratedPositionsInflated");p_.compareByGeneratedPositionsInflated=cil;function lil(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(lil,"parseSourceMapInput");p_.parseSourceMapInput=lil;function uil(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=I6e(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=Sao(lCe(n),e)}return W7r(e)}a(uil,"computeSourceURL");p_.computeSourceURL=uil});var K7r=I(wao=>{p();var z7r=dCe(),Y7r=Object.prototype.hasOwnProperty,hoe=typeof Map<"u";function eU(){this._array=[],this._set=hoe?new Map:Object.create(null)}a(eU,"ArraySet");eU.fromArray=a(function(e,r){for(var n=new eU,o=0,s=e.length;o=0)return r}else{var n=z7r.toSetString(e);if(Y7r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");eU.prototype.at=a(function(e){if(e>=0&&e{p();var Rao=dCe();function dil(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Rao.compareByGeneratedPositionsInflated(t,e)<=0}a(dil,"generatedPositionAfter");function bkt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(bkt,"MappingList");bkt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");bkt.prototype.add=a(function(e){dil(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");bkt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Rao.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");kao.MappingList=bkt});var J7r=I(Dao=>{p();var x6e=V7r(),qm=dCe(),Skt=K7r().ArraySet,fil=Pao().MappingList;function xk(t){t||(t={}),this._file=qm.getArg(t,"file",null),this._sourceRoot=qm.getArg(t,"sourceRoot",null),this._skipValidation=qm.getArg(t,"skipValidation",!1),this._sources=new Skt,this._names=new Skt,this._mappings=new fil,this._sourcesContents=null}a(xk,"SourceMapGenerator");xk.prototype._version=3;xk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new xk({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=qm.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=qm.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");xk.prototype.addMapping=a(function(e){var r=qm.getArg(e,"generated"),n=qm.getArg(e,"original",null),o=qm.getArg(e,"source",null),s=qm.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");xk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=qm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[qm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[qm.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");xk.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=qm.relative(s,o));var c=new Skt,l=new Skt;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=qm.join(n,u.source)),s!=null&&(u.source=qm.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=qm.join(n,u)),s!=null&&(u=qm.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");xk.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");xk.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(!qm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=x6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=x6e.encode(h-c),c=h,u+=x6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=x6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=x6e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");xk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=qm.relative(r,n));var o=qm.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");xk.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");xk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Dao.SourceMapGenerator=xk});var Nao=I(moe=>{p();moe.GREATEST_LOWER_BOUND=1;moe.LEAST_UPPER_BOUND=2;function Z7r(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?Z7r(c,e,r,n,o,s):s==moe.LEAST_UPPER_BOUND?e1?Z7r(t,c,r,n,o,s):s==moe.LEAST_UPPER_BOUND?c:t<0?-1:t}a(Z7r,"recursiveSearch");moe.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=Z7r(-1,r.length,e,r,n,o||moe.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 Oao=I(Mao=>{p();function X7r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(X7r,"swap");function pil(t,e){return Math.round(t+Math.random()*(e-t))}a(pil,"randomIntInRange");function eQr(t,e,r,n){if(r{p();var jn=dCe(),tQr=Nao(),fCe=K7r().ArraySet,hil=V7r(),w6e=Oao().quickSort;function Id(t,e){var r=t;return typeof t=="string"&&(r=jn.parseSourceMapInput(t)),r.sections!=null?new JN(r,e):new My(r,e)}a(Id,"SourceMapConsumer");Id.fromSourceMap=function(t,e){return My.fromSourceMap(t,e)};Id.prototype._version=3;Id.prototype.__generatedMappings=null;Object.defineProperty(Id.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Id.prototype.__originalMappings=null;Object.defineProperty(Id.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Id.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Id.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Id.GENERATED_ORDER=1;Id.ORIGINAL_ORDER=2;Id.GREATEST_LOWER_BOUND=1;Id.LEAST_UPPER_BOUND=2;Id.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Id.GENERATED_ORDER,c;switch(s){case Id.GENERATED_ORDER:c=this._generatedMappings;break;case Id.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=jn.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");Id.prototype.allGeneratedPositionsFor=a(function(e){var r=jn.getArg(e,"line"),n={source:jn.getArg(e,"source"),originalLine:r,originalColumn:jn.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",jn.compareByOriginalPositions,tQr.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:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");Tkt.SourceMapConsumer=Id;function My(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sources"),s=jn.getArg(r,"names",[]),c=jn.getArg(r,"sourceRoot",null),l=jn.getArg(r,"sourcesContent",null),u=jn.getArg(r,"mappings"),d=jn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=jn.normalize(c)),o=o.map(String).map(jn.normalize).map(function(f){return c&&jn.isAbsolute(c)&&jn.isAbsolute(f)?jn.relative(c,f):f}),this._names=fCe.fromArray(s.map(String),!0),this._sources=fCe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return jn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(My,"BasicSourceMapConsumer");My.prototype=Object.create(Id.prototype);My.prototype.consumer=Id;My.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=jn.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)}w6e(A,jn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,w6e(g,jn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");My.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 tQr.search(e,r,s,c)},"SourceMapConsumer_findMapping");My.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=jn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=jn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=jn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:jn.getArg(o,"originalLine",null),column:jn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");My.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");My.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=jn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=jn.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");My.prototype.generatedPositionFor=a(function(e){var r=jn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:jn.getArg(e,"line"),originalColumn:jn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,jn.getArg(e,"bias",Id.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:jn.getArg(s,"generatedLine",null),column:jn.getArg(s,"generatedColumn",null),lastColumn:jn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Tkt.BasicSourceMapConsumer=My;function JN(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new fCe,this._names=new fCe;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=jn.getArg(c,"offset"),u=jn.getArg(l,"line"),d=jn.getArg(l,"column");if(u{p();var mil=J7r().SourceMapGenerator,Ikt=dCe(),gil=/(\r?\n)/,Ail=10,pCe="$$$isSourceNode$$$";function BI(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[pCe]=!0,n!=null&&this.add(n)}a(BI,"SourceNode");BI.fromStringWithSourceMap=a(function(e,r,n){var o=new BI,s=e.split(gil),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[pCe]||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");BI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();xkt.SourceMapGenerator=J7r().SourceMapGenerator;xkt.SourceMapConsumer=Bao().SourceMapConsumer;xkt.SourceNode=Uao().SourceNode});var jao=I((Wmm,qao)=>{p();var yil=Object.prototype.toString,rQr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Eil(t){return yil.call(t).slice(8,-1)==="ArrayBuffer"}a(Eil,"isArrayBuffer");function _il(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 rQr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(_il,"fromArrayBuffer");function vil(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return rQr?Buffer.from(t,e):new Buffer(t,e)}a(vil,"fromString");function Cil(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Eil(t)?_il(t,e,r):typeof t=="string"?vil(t,e):rQr?Buffer.from(t):new Buffer(t)}a(Cil,"bufferFrom");qao.exports=Cil});var Kao=I((Aoe,sQr)=>{p();var bil=Qao().SourceMapConsumer,nQr=require("path"),JL;try{JL=require("fs"),(!JL.existsSync||!JL.readFileSync)&&(JL=null)}catch{}var Sil=jao();function Hao(t,e){return t.require(e)}a(Hao,"dynamicRequire");var Gao=!1,$ao=!1,iQr=!1,R6e="auto",goe={},k6e={},Til=/^data:application\/json[^,]+base64,/,CW=[],bW=[];function aQr(){return R6e==="browser"?!0:R6e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(aQr,"isInBrowser");function Iil(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Iil,"hasGlobalProcessEventEmitter");function xil(){return typeof process=="object"&&process!==null?process.version:""}a(xil,"globalProcessVersion");function wil(){if(typeof process=="object"&&process!==null)return process.stderr}a(wil,"globalProcessStderr");function Ril(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Ril,"globalProcessExit");function wkt(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(Pil,"CallSiteToString");function Vao(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=Pil,e}a(Vao,"cloneCallSite");function zao(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(xil())?0:62;n===1&&o>c&&!aQr()&&!t.isEval()&&(o-=c);var l=uQr({source:r,line:n,column:o});e.curPosition=l,t=Vao(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=Wao(d),t=Vao(t),t.getEvalOrigin=function(){return d}),t}a(zao,"wrapCallSite");function Dil(t,e){iQr&&(goe={},k6e={});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 `+zao(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Dil,"prepareStackTrace");function Yao(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=goe[r];if(!s&&JL&&JL.existsSync(r))try{s=JL.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}})(vJi||(vJi={}));(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"})(CJi||(CJi={}));(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"})(bJi||(bJi={}));(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"})(SJi||(SJi={}));a(Mio,"rW");cW=c7r.default.homedir(),l7r=c7r.default.tmpdir(),{env:ave}=iwt.default,wZc=a(t=>{let e=sf.default.join(cW,"Library");return{data:sf.default.join(e,"Application Support",t),config:sf.default.join(e,"Preferences",t),cache:sf.default.join(e,"Caches",t),log:sf.default.join(e,"Logs",t),temp:sf.default.join(l7r,t)}},"Oe"),RZc=a(t=>{let e=ave.APPDATA||sf.default.join(cW,"AppData","Roaming"),r=ave.LOCALAPPDATA||sf.default.join(cW,"AppData","Local");return{data:sf.default.join(r,t,"Data"),config:sf.default.join(e,t,"Config"),cache:sf.default.join(r,t,"Cache"),log:sf.default.join(r,t,"Log"),temp:sf.default.join(l7r,t)}},"De"),kZc=a(t=>{let e=sf.default.basename(cW);return{data:sf.default.join(ave.XDG_DATA_HOME||sf.default.join(cW,".local","share"),t),config:sf.default.join(ave.XDG_CONFIG_HOME||sf.default.join(cW,".config"),t),cache:sf.default.join(ave.XDG_CACHE_HOME||sf.default.join(cW,".cache"),t),log:sf.default.join(ave.XDG_STATE_HOME||sf.default.join(cW,".local","state"),t),temp:sf.default.join(l7r,e,t)}},"Fe");a(PZc,"Mz");nZh=PZc("claude-cli");a(DZc,"Ze");a(NZc,"wE");MZc=100,KFr=[];a(OZc,"Le");LZc=[],TJi=null,iZh=Dy(()=>process.argv.includes("--hard-fail"));a(Oio,"oW");tve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Lio=new Set,c6r=typeof process=="object"&&process?process:{},Bio=a((t,e,r,n)=>{typeof c6r.emitWarning=="function"?c6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),owt=globalThis.AbortController,IJi=globalThis.AbortSignal;if(typeof owt>"u"){IJi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},owt=class{static{a(this,"tW")}constructor(){e()}signal=new IJi;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=c6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Bio("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")}BZc=a(t=>!Lio.has(t),"Ae"),iW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),Fio=a(t=>iW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?dve:null:null,"ME"),dve=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},l6r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=Fio(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]}},u6r=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&&!iW(r))throw TypeError("max option must be a nonnegative integer");let x=r?Fio(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=l6r.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&&!iW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!iW(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=iW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!iW(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&&BZc("LRU_CACHE_UNBOUNDED")&&(Lio.add("LRU_CACHE_UNBOUNDED"),Bio("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 dve(this.#e),r=new dve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=tve.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?tve.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=tve.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");#L=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new dve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!iW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!iW(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");#B=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-(tve.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=tve.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=tve.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.#B(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.#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.#L(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.#P(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 owt,{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 owt}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.#P(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(FZc,"LE");UZc=8192;a(Uio,"AE");xJi=FZc(Uio,t=>t,50),eRt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>UZc?Uio(t,e):xJi(t,e);return r.ok?r.value:null},{cache:xJi.cache}),tRt=Dy(()=>{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=MI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return Oio(t),"unknown"}}),sZh=Dy(()=>{if(process.platform==="linux")try{let t=MI().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){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),aZh=Dy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,u7r.release)()};try{let e=await(0,qio.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}),cZh=Dy(()=>{if(process.platform!=="darwin")return;let t=(0,u7r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),L8e=Dy(function(){switch(tRt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),lZh=Dy(function(){return(0,Qio.join)(L8e(),"managed-settings.d")}),QZc=wr(()=>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()),qZc=wr(()=>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()),jZc=wr(()=>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:QZc(),filesystem:qZc(),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,d6r.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,d6r.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()),HZc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],GZc=["normal","vim"],$Zc=["auto","tmux","in-process"],VZc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],WZc=["auto",...VZc],uZh=tRt()==="macos"?"\u23FA":"\u25CF",d7r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],zZc=[...d7r,"bubble"],YZc=zZc,dZh=wr(()=>sio.enum(YZc)),fZh=wr(()=>sio.enum(d7r)),KZc=["bash","powershell"],WFe=wr(()=>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(JZc,"Se");ZZc=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=JZc();return G.discriminatedUnion("type",[t,e,r,n,o])}),XZc=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(ZZc()).describe("List of hooks to execute when the matcher matches")})),swt=wr(()=>G.partialRecord(G.enum(Cwt),G.array(XZc()))),pZh=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),hZh=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),zve=wr(()=>G.literal("comms").optional().catch(void 0)),EW=wr(()=>G.number().int().positive()),eXc=wr(()=>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:EW().optional(),alwaysLoad:G.boolean().optional(),role:zve()})),tXc=wr(()=>G.boolean()),jio=wr(()=>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:tXc().optional()})),rXc=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:jio().optional(),timeout:EW().optional(),alwaysLoad:G.boolean().optional(),role:zve()})),nXc=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:EW().optional(),alwaysLoad:G.boolean().optional(),role:zve()})),iXc=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:EW().optional(),alwaysLoad:G.boolean().optional(),role:zve()})),oXc=wr(()=>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:jio().optional(),timeout:EW().optional(),alwaysLoad:G.boolean().optional(),role:zve()})),sXc=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:EW().optional(),alwaysLoad:G.boolean().optional(),role:zve()})),aXc=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:EW().optional(),alwaysLoad:G.boolean().optional()})),cXc=wr(()=>G.enum(["allow","ask","blocked"])),lXc=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:EW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),cXc()).optional()})),f6r=wr(()=>G.union([eXc(),rXc(),nXc(),iXc(),oXc(),sXc(),aXc(),lXc()])),mZh=wr(()=>G.object({mcpServers:G.record(G.string(),f6r())})),Hio=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"]),uXc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,dXc=/[^\u0020-\u007E]/;a(fXc,"pe");$N=wr(()=>G.string().startsWith("./")),soe=wr(()=>$N().endsWith(".json")),wJi=wr(()=>G.union([$N().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")])),p6r=wr(()=>$N().endsWith(".md")),h6r=wr(()=>G.union([p6r(),$N()])),Gio=wr(()=>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=>!fXc(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/'})),f7r=wr(()=>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")})),pXc=wr(()=>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:f7r().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(BXc()).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.`)})),gZh=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>swt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),hXc=wr(()=>G.object({hooks:G.union([soe().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(()=>swt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([soe().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(()=>swt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),mXc=wr(()=>G.object({source:h6r().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'})),gXc=wr(()=>G.object({commands:G.union([h6r().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(h6r().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(),mXc()).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")')])})),AXc=wr(()=>G.object({agents:G.union([p6r().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(p6r().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.")])})),yXc=wr(()=>G.object({skills:G.union([$N().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array($N().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.")])})),$io=wr(()=>G.object({outputStyles:G.union([$N().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($N().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.")])})),Vio=wr(()=>G.object({themes:G.union([$N().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($N().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.")])})),EXc=wr(()=>G.object({})),RJi=wr(()=>G.string().min(1)),_Xc=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),vXc=wr(()=>G.object({mcpServers:G.union([soe().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),wJi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),f6r()).describe("MCP server configurations keyed by server name"),G.array(G.union([soe().describe("Path to MCP servers configuration file"),wJi().describe("Path or URL to MCPB file"),G.record(G.string(),f6r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Wio=wr(()=>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()),CXc=wr(()=>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"),Wio()).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.")})),bXc=wr(()=>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(),Wio()).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.")})),kJi=wr(()=>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(RJi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(_Xc(),RJi()).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")})),SXc=wr(()=>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).')})),TXc=wr(()=>G.array(SXc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),zio=wr(()=>G.object({monitors:G.union([soe().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),TXc()]).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.")})),IXc=wr(()=>G.object({lspServers:G.union([soe().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),kJi()).describe("LSP server configurations keyed by server name"),G.array(G.union([soe().describe("Path to LSP configuration file"),G.record(G.string(),kJi()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Yio=wr(()=>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")),xXc=wr(()=>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.")})),wXc=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Vio().partial().shape,...zio().partial().shape,...$io().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."))})),RXc=wr(()=>G.object({...pXc().shape,...hXc().partial().shape,...gXc().partial().shape,...AXc().partial().shape,...yXc().partial().shape,...$io().partial().shape,...Vio().partial().shape,...EXc().shape,...bXc().partial().shape,...vXc().partial().shape,...IXc().partial().shape,...zio().partial().shape,...xXc().partial().shape,...CXc().partial().shape,...wXc().partial().shape})),awt=wr(()=>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:Yio().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:Gio().refine(t=>!Hio.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(kXc()).describe("Plugin entries declared inline in settings.json"),owner:f7r().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).")])),JFr=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Kio=wr(()=>G.union([$N().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:Yio().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:JFr().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:JFr().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:JFr().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.')])),kXc=wr(()=>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:Kio().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)."})),PXc=wr(()=>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.`)})),DXc=wr(()=>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:PXc().optional().describe("Matchers that determine when the plugin is relevant.")})),NXc=wr(()=>RXc().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:Kio().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,DXc().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.`)})),MXc=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(OXc,"z$$");AZh=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Gio(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:f7r().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(OXc).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.")})),Jio=wr(()=>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")),LXc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,BXc=wr(()=>G.union([G.string().regex(LXc,"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)])),FXc=wr(()=>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).")})),UXc=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(Jio(),FXc()).describe("Map of plugin IDs to their installation metadata")})),QXc=wr(()=>G.enum(["managed","user","project","local"])),qXc=wr(()=>G.object({scope:QXc().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.")})),jXc=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(Jio(),G.array(qXc())).describe("Map of plugin IDs to arrays of installation entries")})),yZh=wr(()=>G.union([UXc(),jXc()])),HXc=wr(()=>G.object({source:awt().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")})),EZh=wr(()=>G.record(G.string(),HXc())),GXc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],$Xc="https://json.schemastore.org/claude-code-settings.json",VXc=["autoMode","deepLink","voice","assistant","briefView"],HIt={},rRt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>HIt,"shape"),permissionsShape:a(()=>HIt,"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(()=>HIt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>HIt,"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(Zio,"Ez");a(WXc,"tE");a(zXc,"aE");a(YXc,"sE");a(KXc,"eE");PJi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(rve,"E9");Xio="workspace",_Zh=`mcp__${Xio}__bash`,vZh=`mcp__${Xio}__web_fetch`;a(JXc,"A$$");a(ZXc,"Jb");a(XXc,"I$$");a(eel,"R$$");cwt={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(tel,"Xb");a(rel,"Yb");a(nel,"Wb");a(eoo,"Gb");a(ZFr,"bz");a(iel,"P$$");a(too,"_z");XFr=wr(()=>G.string().superRefine((t,e)=>{let r=too(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}})}})),oel=wr(()=>G.record(G.string(),G.coerce.string()));a(roo,"Hb");CZh=wr(()=>roo(Zio())),sel=wr(()=>G.object({source:awt().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")})),noo=wr(()=>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=>neo([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"'})),ioo=wr(()=>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=>neo([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"'})),ael=wr(()=>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()})),DJi=["skills","agents","hooks","mcp"];a(cel,"Kb");Yve=wr(()=>cel(Zio())),$9="https://code.claude.com/docs/en",lel=[{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:`${$9}/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:`${$9}/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:`${$9}/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:`${$9}/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:`${$9}/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:`${$9}/iam#working-directories`}}],uel={permissions:`${$9}/iam#configuring-permissions`,env:`${$9}/settings#environment-variables`,hooks:`${$9}/hooks`};a(del,"qb");bZh=wr(()=>Yve().strict());a(NJi,"Vb");a(MJi,"Bb");a(fel,"v$$");a(OJi,"zb");a(fve,"b9");a(LJi,"Nb");a(t6e,"d0");a(pel,"C$$");hel=new Set(Cwt);a(mel,"x$$");gel=[{key:"allowedMcpServers",schema:noo},{key:"deniedMcpServers",schema:ioo}];a(Ael,"f$$");a(Kve,"i1");BJi="com.anthropic.claudecode",m6r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",g6r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",cve="Settings",yel="/usr/bin/plutil",Eel=["-convert","json","-o","-","--"],_el=5e3,FJi="/mnt/c/Windows/System32/reg.exe",lwt="/mnt/c/Program Files/ClaudeCode";a(soo,"XG");a(vel,"Zb");Cel=null;a(zFe,"$5");a(bel,"Mb");a(Sel,"Lb");sW=Object.freeze({settings:{},errors:[]}),loo=null,uoo=null,doo=!1,uwt=null;a(Tel,"l$$");a(Iel,"bb");a(xel,"_b");a(wel,"kb");a(Rel,"Sb");a(e8r,"Cz");a(UJi,"jb");a(kel,"c$$");a(Pel,"p$$");a(QJi,"Ab");a(Del,"d$$");a(qJi,"Ib");a(Nel,"i$$");A6r=Nel;a(Mel,"n$$");Oel=Mel,Lel=Oel(),Bel=Lel;a(Fel,"o$$");Uel=Fel,Qel="[object Object]",qel=Function.prototype,jel=Object.prototype,foo=qel.toString,Hel=jel.hasOwnProperty,Gel=foo.call(Object);a($el,"Q6$");Vel=$el;a(Wel,"J6$");y6r=Wel;a(zel,"X6$");Yel=zel;a(Kel,"Y6$");Jel=Kel;a(poo,"hb");Zel=poo;a(Xel,"W6$");etl=Xel,jJi=Math.max;a(ttl,"G6$");hoo=ttl;a(rtl,"U6$");ntl=rtl,itl=wxt?function(t,e){return wxt(t,"toString",{configurable:!0,enumerable:!1,value:ntl(e),writable:!0})}:vXi,otl=itl,stl=800,atl=16,ctl=Date.now;a(ltl,"B6$");utl=ltl,dtl=utl(otl),moo=dtl;a(ftl,"N6$");ptl=ftl;a(htl,"w6$");mtl=htl;a(gtl,"O6$");Atl=gtl,ytl=Atl(function(t,e,r,n){Zel(t,e,r,n)}),lW=ytl;a(Etl,"F6$");_tl=Etl;a(vtl,"Z6$");Ctl=vtl;a(btl,"M6$");Stl=btl,HJi=fW?fW.isConcatSpreadable:void 0;a(Ttl,"L6$");Itl=Ttl;a(goo,"$_");xtl=goo;a(wtl,"j6$");Rtl=wtl;a(ktl,"A6$");Ptl=ktl,Dtl=Ptl(function(t,e){return t==null?{}:Stl(t,e)}),t8r=Dtl,Ntl="remote-settings.json",r8r=null;a(Otl,"b6$");a(Ltl,"_6$");a(Btl,"W_");a(p7r,"fz");a(Ftl,"S6$");a(yoo,"U_");a(n8r,"xz");a(Utl,"v6$");a(dwt,"HG");a(Eoo,"H_");a(_oo,"K_");a(voo,"q_");a(Coo,"V_");a(Qtl,"C6$");a(GJi,"G_");a(qtl,"T6$");a(fwt,"Y5");a(jtl,"x6$");a(boo,"B_");a(Htl,"y6$");a(Gtl,"f6$");a($tl,"z_");a(Vtl,"g6$");a(Soo,"N_");a(Wtl,"h6$");a(ztl,"u6$");a(uW,"o1");i8r=!1;a(Ytl,"m6$");a(Ktl,"l6$");a(Jtl,"c6$");a(Ztl,"w_");a(Xtl,"O_");erl={user:"userSettings",project:"projectSettings",local:"localSettings"},$Ji={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},trl=["user","project","local"],rrl=new Set(["bypassPermissions","auto","acceptEdits"]),nrl=new Set(["project"]);a(irl,"o6$");a(orl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(srl,"LA$");a(arl,"G4$");a(crl,"U4$");a(lrl,"H4$");a(Too,"b_");a(E6r,"uz");a(_6r,"mz");url=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(pwt,"KG");a(drl,"q4$");a(frl,"jA$");a(prl,"AA$");a(hrl,"IA$");a(mrl,"RA$");a(grl,"PA$");a(Arl,"EA$");a(yrl,"bA$");a(Erl,"_A$");a(_rl,"kA$");a(vrl,"SA$");a(VJi,"M_");a(Crl,"V4$");a(brl,"vA$");a(Srl,"CA$");a(Ioo,"__");a(Tk,"J4");a(xoo,"k_");a(WJi,"L_");a(v6r,"lz");a(Trl,"B4$");a(zJi,"j_");a(woo,"S_");a(Irl,"z4$");a(Roo,"v_");a(xrl,"N4$");a(wrl,"w4$");a(Rrl,"O4$");a(krl,"D4$");a(Prl,"F4$");a(Drl,"Z4$");a(Nrl,"M4$");a(YJi,"A_")});var Vso=I((Q7r,$so)=>{p();Q7r.createWatcher=Z6e()("vscode-policy-watcher");if(require.main===$so){let t=process.platform;Q7r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var wao=I(z7r=>{p();var xao="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");z7r.encode=function(t){if(0<=t&&t{p();var Rao=wao(),Y7r=5,kao=1<>1;return e?-r:r}a(yil,"fromVLQSigned");K7r.encode=a(function(e){var r="",n,o=Ail(e);do n=o&Pao,o>>>=Y7r,o>0&&(n|=Dao),r+=Rao.encode(n);while(o>0);return r},"base64VLQ_encode");K7r.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=Rao.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Dao),u&=Pao,s=s+(u<{p();function Eil(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(Eil,"getArg");h_.getArg=Eil;var Nao=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_il=/^data:.+\,.+$/;function P6e(t){var e=t.match(Nao);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(P6e,"urlParse");h_.urlParse=P6e;function fCe(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(fCe,"urlGenerate");h_.urlGenerate=fCe;function Z7r(t){var e=t,r=P6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=h_.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,fCe(r)):e}a(Z7r,"normalize");h_.normalize=Z7r;function Mao(t,e){t===""&&(t="."),e===""&&(e=".");var r=P6e(e),n=P6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),fCe(r);if(r||e.match(_il))return e;if(n&&!n.host&&!n.path)return n.host=e,fCe(n);var o=e.charAt(0)==="/"?e:Z7r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,fCe(n)):o}a(Mao,"join");h_.join=Mao;h_.isAbsolute=function(t){return t.charAt(0)==="/"||Nao.test(t)};function vil(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(vil,"relative");h_.relative=vil;var Oao=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Lao(t){return t}a(Lao,"identity");function Cil(t){return Bao(t)?"$"+t:t}a(Cil,"toSetString");h_.toSetString=Oao?Lao:Cil;function bil(t){return Bao(t)?t.slice(1):t}a(bil,"fromSetString");h_.fromSetString=Oao?Lao:bil;function Bao(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(Bao,"isProtoString");function Sil(t,e,r){var n=pCe(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:pCe(t.name,e.name)}a(Sil,"compareByOriginalPositions");h_.compareByOriginalPositions=Sil;function Til(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=pCe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:pCe(t.name,e.name)}a(Til,"compareByGeneratedPositionsDeflated");h_.compareByGeneratedPositionsDeflated=Til;function pCe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(pCe,"strcmp");function Iil(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=pCe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:pCe(t.name,e.name)}a(Iil,"compareByGeneratedPositionsInflated");h_.compareByGeneratedPositionsInflated=Iil;function xil(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(xil,"parseSourceMapInput");h_.parseSourceMapInput=xil;function wil(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=P6e(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=Mao(fCe(n),e)}return Z7r(e)}a(wil,"computeSourceURL");h_.computeSourceURL=wil});var tQr=I(Fao=>{p();var X7r=hCe(),eQr=Object.prototype.hasOwnProperty,moe=typeof Map<"u";function rU(){this._array=[],this._set=moe?new Map:Object.create(null)}a(rU,"ArraySet");rU.fromArray=a(function(e,r){for(var n=new rU,o=0,s=e.length;o=0)return r}else{var n=X7r.toSetString(e);if(eQr.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");rU.prototype.at=a(function(e){if(e>=0&&e{p();var Uao=hCe();function Ril(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Uao.compareByGeneratedPositionsInflated(t,e)<=0}a(Ril,"generatedPositionAfter");function xkt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(xkt,"MappingList");xkt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");xkt.prototype.add=a(function(e){Ril(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");xkt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Uao.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Qao.MappingList=xkt});var rQr=I(jao=>{p();var D6e=J7r(),Hm=hCe(),wkt=tQr().ArraySet,kil=qao().MappingList;function Rk(t){t||(t={}),this._file=Hm.getArg(t,"file",null),this._sourceRoot=Hm.getArg(t,"sourceRoot",null),this._skipValidation=Hm.getArg(t,"skipValidation",!1),this._sources=new wkt,this._names=new wkt,this._mappings=new kil,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=Hm.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=Hm.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=Hm.getArg(e,"generated"),n=Hm.getArg(e,"original",null),o=Hm.getArg(e,"source",null),s=Hm.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=Hm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Hm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Hm.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=Hm.relative(s,o));var c=new wkt,l=new wkt;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=Hm.join(n,u.source)),s!=null&&(u.source=Hm.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=Hm.join(n,u)),s!=null&&(u=Hm.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(!Hm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=D6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=D6e.encode(h-c),c=h,u+=D6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=D6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=D6e.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=Hm.relative(r,n));var o=Hm.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");jao.SourceMapGenerator=Rk});var Hao=I(goe=>{p();goe.GREATEST_LOWER_BOUND=1;goe.LEAST_UPPER_BOUND=2;function nQr(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?nQr(c,e,r,n,o,s):s==goe.LEAST_UPPER_BOUND?e1?nQr(t,c,r,n,o,s):s==goe.LEAST_UPPER_BOUND?c:t<0?-1:t}a(nQr,"recursiveSearch");goe.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=nQr(-1,r.length,e,r,n,o||goe.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 $ao=I(Gao=>{p();function iQr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(iQr,"swap");function Pil(t,e){return Math.round(t+Math.random()*(e-t))}a(Pil,"randomIntInRange");function oQr(t,e,r,n){if(r{p();var jn=hCe(),sQr=Hao(),mCe=tQr().ArraySet,Dil=J7r(),N6e=$ao().quickSort;function wd(t,e){var r=t;return typeof t=="string"&&(r=jn.parseSourceMapInput(t)),r.sections!=null?new eM(r,e):new Oy(r,e)}a(wd,"SourceMapConsumer");wd.fromSourceMap=function(t,e){return Oy.fromSourceMap(t,e)};wd.prototype._version=3;wd.prototype.__generatedMappings=null;Object.defineProperty(wd.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});wd.prototype.__originalMappings=null;Object.defineProperty(wd.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});wd.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");wd.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");wd.GENERATED_ORDER=1;wd.ORIGINAL_ORDER=2;wd.GREATEST_LOWER_BOUND=1;wd.LEAST_UPPER_BOUND=2;wd.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||wd.GENERATED_ORDER,c;switch(s){case wd.GENERATED_ORDER:c=this._generatedMappings;break;case wd.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=jn.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");wd.prototype.allGeneratedPositionsFor=a(function(e){var r=jn.getArg(e,"line"),n={source:jn.getArg(e,"source"),originalLine:r,originalColumn:jn.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",jn.compareByOriginalPositions,sQr.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:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");Rkt.SourceMapConsumer=wd;function Oy(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sources"),s=jn.getArg(r,"names",[]),c=jn.getArg(r,"sourceRoot",null),l=jn.getArg(r,"sourcesContent",null),u=jn.getArg(r,"mappings"),d=jn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=jn.normalize(c)),o=o.map(String).map(jn.normalize).map(function(f){return c&&jn.isAbsolute(c)&&jn.isAbsolute(f)?jn.relative(c,f):f}),this._names=mCe.fromArray(s.map(String),!0),this._sources=mCe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return jn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(Oy,"BasicSourceMapConsumer");Oy.prototype=Object.create(wd.prototype);Oy.prototype.consumer=wd;Oy.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=jn.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)}N6e(A,jn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,N6e(g,jn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");Oy.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 sQr.search(e,r,s,c)},"SourceMapConsumer_findMapping");Oy.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=jn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=jn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=jn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:jn.getArg(o,"originalLine",null),column:jn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");Oy.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");Oy.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=jn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=jn.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");Oy.prototype.generatedPositionFor=a(function(e){var r=jn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:jn.getArg(e,"line"),originalColumn:jn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,jn.getArg(e,"bias",wd.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:jn.getArg(s,"generatedLine",null),column:jn.getArg(s,"generatedColumn",null),lastColumn:jn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Rkt.BasicSourceMapConsumer=Oy;function eM(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new mCe,this._names=new mCe;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=jn.getArg(c,"offset"),u=jn.getArg(l,"line"),d=jn.getArg(l,"column");if(u{p();var Nil=rQr().SourceMapGenerator,kkt=hCe(),Mil=/(\r?\n)/,Oil=10,gCe="$$$isSourceNode$$$";function UI(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[gCe]=!0,n!=null&&this.add(n)}a(UI,"SourceNode");UI.fromStringWithSourceMap=a(function(e,r,n){var o=new UI,s=e.split(Mil),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[gCe]||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");UI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();Pkt.SourceMapGenerator=rQr().SourceMapGenerator;Pkt.SourceMapConsumer=Wao().SourceMapConsumer;Pkt.SourceNode=Yao().SourceNode});var Zao=I((w0m,Jao)=>{p();var Lil=Object.prototype.toString,aQr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Bil(t){return Lil.call(t).slice(8,-1)==="ArrayBuffer"}a(Bil,"isArrayBuffer");function Fil(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 aQr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(Fil,"fromArrayBuffer");function Uil(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return aQr?Buffer.from(t,e):new Buffer(t,e)}a(Uil,"fromString");function Qil(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Bil(t)?Fil(t,e,r):typeof t=="string"?Uil(t,e):aQr?Buffer.from(t):new Buffer(t)}a(Qil,"bufferFrom");Jao.exports=Qil});var sco=I((yoe,dQr)=>{p();var qil=Kao().SourceMapConsumer,cQr=require("path"),ZL;try{ZL=require("fs"),(!ZL.existsSync||!ZL.readFileSync)&&(ZL=null)}catch{}var jil=Zao();function Xao(t,e){return t.require(e)}a(Xao,"dynamicRequire");var eco=!1,tco=!1,lQr=!1,M6e="auto",Aoe={},O6e={},Hil=/^data:application\/json[^,]+base64,/,IW=[],xW=[];function fQr(){return M6e==="browser"?!0:M6e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(fQr,"isInBrowser");function Gil(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Gil,"hasGlobalProcessEventEmitter");function $il(){return typeof process=="object"&&process!==null?process.version:""}a($il,"globalProcessVersion");function Vil(){if(typeof process=="object"&&process!==null)return process.stderr}a(Vil,"globalProcessStderr");function Wil(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Wil,"globalProcessExit");function Dkt(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(Yil,"CallSiteToString");function rco(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=Yil,e}a(rco,"cloneCallSite");function ico(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($il())?0:62;n===1&&o>c&&!fQr()&&!t.isEval()&&(o-=c);var l=mQr({source:r,line:n,column:o});e.curPosition=l,t=rco(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=nco(d),t=rco(t),t.getEvalOrigin=function(){return d}),t}a(ico,"wrapCallSite");function Kil(t,e){lQr&&(Aoe={},O6e={});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 `+ico(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Kil,"prepareStackTrace");function oco(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=Aoe[r];if(!s&&ZL&&ZL.existsSync(r))try{s=ZL.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(Yao,"getErrorSource");function Nil(t){var e=Yao(t),r=wil();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Ril(1)}a(Nil,"printErrorAndExit");function Mil(){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 Nil(arguments[1])}return t.apply(this,arguments)}}a(Mil,"shimEmitUncaughtException");var Oil=CW.slice(0),Lil=bW.slice(0);Aoe.wrapCallSite=zao;Aoe.getErrorSource=Yao;Aoe.mapSourcePosition=uQr;Aoe.retrieveSourceMap=lQr;Aoe.install=function(t){if(t=t||{},t.environment&&(R6e=t.environment,["node","browser","auto"].indexOf(R6e)===-1))throw new Error("environment "+R6e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(CW.length=0),CW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(bW.length=0),bW.unshift(t.retrieveSourceMap)),t.hookRequire&&!aQr()){var e=Hao(sQr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return goe[c]=s,k6e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(iQr||(iQr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Gao||(Gao=!0,Error.prepareStackTrace=Dil),!$ao){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Hao(sQr,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Iil()&&($ao=!0,Mil())}};Aoe.resetRetrieveHandlers=function(){CW.length=0,bW.length=0,CW=Oil.slice(0),bW=Lil.slice(0),lQr=wkt(bW),cQr=wkt(CW)}});var Jao=I(()=>{p();Kao().install()});var Uil={};ki(Uil,{getTokenizer:()=>ws,getTokenizerAsync:()=>hQ,main:()=>Xao});module.exports=ba(Uil);p();p();p();var mQr="auth.db",oco=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],sco=` +`+new Array(o).join(" ")+"^"}}return null}a(oco,"getErrorSource");function Jil(t){var e=oco(t),r=Vil();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Wil(1)}a(Jil,"printErrorAndExit");function Zil(){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 Jil(arguments[1])}return t.apply(this,arguments)}}a(Zil,"shimEmitUncaughtException");var Xil=IW.slice(0),eol=xW.slice(0);yoe.wrapCallSite=ico;yoe.getErrorSource=oco;yoe.mapSourcePosition=mQr;yoe.retrieveSourceMap=hQr;yoe.install=function(t){if(t=t||{},t.environment&&(M6e=t.environment,["node","browser","auto"].indexOf(M6e)===-1))throw new Error("environment "+M6e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(IW.length=0),IW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(xW.length=0),xW.unshift(t.retrieveSourceMap)),t.hookRequire&&!fQr()){var e=Xao(dQr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return Aoe[c]=s,O6e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(lQr||(lQr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),eco||(eco=!0,Error.prepareStackTrace=Kil),!tco){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Xao(dQr,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Gil()&&(tco=!0,Zil())}};yoe.resetRetrieveHandlers=function(){IW.length=0,xW.length=0,IW=Xil.slice(0),xW=eol.slice(0),hQr=Dkt(xW),pQr=Dkt(IW)}});var aco=I(()=>{p();sco().install()});var nol={};ki(nol,{getTokenizer:()=>ws,getTokenizerAsync:()=>gQ,main:()=>lco});module.exports=Sa(nol);p();p();p();var _Qr="auth.db",mco=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],gco=` CREATE TABLE IF NOT EXISTS oauth_tokens ( token_id INTEGER PRIMARY KEY AUTOINCREMENT, auth_authority TEXT NOT NULL, @@ -1638,83 +1638,83 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. last_used_at INTEGER NOT NULL, UNIQUE(auth_authority, oauth_client_id, user_login) ) -`,aco=` +`,Aco=` 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 ) -`,cco=` +`,yco=` CREATE TABLE IF NOT EXISTS editor_signout ( editor_id TEXT PRIMARY KEY, signed_out_at INTEGER NOT NULL ) -`,lco=` +`,Eco=` CREATE TABLE IF NOT EXISTS metadata ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) -`,uco=[sco,aco,cco,lco];function Pkt(t){for(let e of oco)t.exec(e);return dco(t),t}a(Pkt,"applyPragmas");function dco(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(dco,"ensureWalMode");function Dkt(t){for(let e of uco)t.exec(e);return t}a(Dkt,"applySchema");function tU(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(tU,"runInWriteTx");p();p();p();var Nkt="github.copilot",gQr="github-enterprise";p();var Ls=a((t,e)=>({editorId:t,displayName:e}),"id"),fco=Ls("unknown","Unknown"),AQr=Ls("eclipse","Eclipse"),yQr=Ls("xcode","Xcode"),rU=Ls("vim","Vim/Neovim"),EQr=Ls("helix","Helix"),pco={"copilot-eclipse":AQr,Copilot4Eclipse:AQr,"copilot-xcode":yQr,"Copilot for Xcode":yQr,"copilot-vs":Ls("visual-studio","Visual Studio"),"copilot.vim":rU,"copilot.lua":rU,"Github Copilot LSP for Neovim":rU,"coc-github-copilot":rU,"nvim-lspconfig":rU,"copilot-lsp-client-neovim":rU,"neovim-copilot-lsp":rU,"sidekick.nvim":rU,"helix-copilot":EQr,"copilot-helix":EQr,"copilot-sublime":Ls("sublime-text","Sublime Text"),"zed-copilot":Ls("zed","Zed"),RStudio:Ls("rstudio","RStudio"),"obsidian-copilot":Ls("obsidian","Obsidian"),marimo:Ls("marimo","marimo"),"Qt Creator Copilot plugin":Ls("qt-creator","Qt Creator"),"godot-copilot":Ls("godot","Godot"),"kakoune-lsp":Ls("kakoune","Kakoune"),"typora-copilot":Ls("typora","Typora"),"Copilot for Nova":Ls("nova","Nova")},hco={IU:Ls("intellij","IntelliJ IDEA"),IC:Ls("intellij","IntelliJ IDEA"),IE:Ls("intellij","IntelliJ IDEA"),PY:Ls("pycharm","PyCharm"),PC:Ls("pycharm","PyCharm"),PE:Ls("pycharm","PyCharm"),WS:Ls("webstorm","WebStorm"),PS:Ls("phpstorm","PhpStorm"),RD:Ls("rider","Rider"),RM:Ls("rubymine","RubyMine"),CL:Ls("clion","CLion"),GO:Ls("goland","GoLand"),RR:Ls("rustrover","RustRover"),DB:Ls("datagrip","DataGrip"),DS:Ls("dataspell","DataSpell"),AI:Ls("android-studio","Android Studio"),QA:Ls("aqua","Aqua"),MPS:Ls("mps","MPS"),JBC:Ls("jetbrains-client","JetBrains Client"),GW:Ls("jetbrains-gateway","JetBrains Gateway")},_Qr="JetBrains-",mco=Ls("jetbrains","JetBrains IDE");function vQr(t){let e=t.plugin.name?.trim();if(!e)return fco;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(_Qr)){let n=hco[r.slice(_Qr.length)];if(n)return n}return mco}return pco[e]??Ls(e,e)}a(vQr,"resolveEditorIdentity");p();p();p();p();var P6e=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 cliEnabled(){return this.userInfo?.cli_enabled}get raw(){return this.userInfo}};p();function Mkt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(Mkt,"findKnownOrg");function CQr(t){let e=t.organization_list??[];return Mkt(e)??""}a(CQr,"getUserKind");p();var qf=class{static{a(this,"LogTarget")}},ZL=class{static{a(this,"TelemetryLogSender")}},fe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(qf).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(ZL).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Nr=new fe("default");p();p();p();p();async function Juo(){let{getDeviceId:t}=await Promise.resolve().then(()=>de(eHr()));return t()}a(Juo,"loadDeviceId");var UI=class{constructor(e=Juo){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 kk=class{static{a(this,"InlineCompletionsUnification")}},Zuo={codeUnification:!1,modelUnification:!1,expAssignments:[]},boe=class extends kk{constructor(){super(...arguments);this.inlineCompletionsUnificationState=Zuo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var nC=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return K6e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(kk).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 E_="X-Copilot-RelatedPluginVersion-",Soe=(z=>(z.Market="X-MSEdge-Market",z.CorpNet="X-FD-Corpnet",z.Build="X-VSCode-Build",z.ApplicationVersion="X-VSCode-AppVersion",z.TargetPopulation="X-VSCode-TargetPopulation",z.ClientId="X-MSEdge-ClientId",z.DevDeviceId="X-VSCode-DevDeviceId",z.ExtensionName="X-VSCode-ExtensionName",z.ExtensionVersion="X-VSCode-ExtensionVersion",z.ExtensionRelease="X-VSCode-ExtensionRelease",z.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",z.Language="X-VSCode-Language",z.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",z.CopilotEngine="X-Copilot-Engine",z.CopilotOverrideEngine="X-Copilot-OverrideEngine",z.CopilotRepository="X-Copilot-Repository",z.CopilotFileType="X-Copilot-FileType",z.CopilotUserKind="X-Copilot-UserKind",z.CopilotDogfood="X-Copilot-Dogfood",z.CopilotOrgs="X-Copilot-Orgs",z.CopilotTrackingId="X-Copilot-CopilotTrackingId",z.CopilotClientVersion="X-Copilot-ClientVersion",z.CopilotSku="X-GitHub-Copilot-SKU",z.CopilotIsFcv1="X-GitHub-Copilot-IsFcv1",z.CopilotIsSn="X-GitHub-Copilot-IsSn",z.CopilotRelatedPluginVersionCppTools=E_+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=E_+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=E_+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=E_+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=E_+"mspythonpython",z.CopilotRelatedPluginVersionPylance=E_+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=E_+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=E_+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=E_+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=E_+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=E_+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=E_+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=E_+"githubcopilot",z))(Soe||{});var Xuo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},iB=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=Xuo[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 bs(t,e){let r=z0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(bs,"onCopilotToken");function oPt(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(oPt,"propertiesFromCopilotToken");var Op=class{constructor(e){this.#e={};this.optedIn=!1;bs(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=oPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var O9e=de(dU()),L9e=de(require("os"));var edo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function tdo(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(edo),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(tdo,"buildExceptionDetail");function cPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Op),s={"#editor":n.devName??n.name,"#editor_version":M1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":M1(r.getEditorPluginInfo()),"#session_id":t.get(Ua).sessionId,"#machine_id":t.get(Ua).machineId,"#architecture":L9e.arch(),"#os_platform":L9e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(cPt,"buildContext");function cGr(t,e,r){let n=t.get(ds),o=t.get(Ir).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:cPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=tdo(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,O9e.SHA256)(O9e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(cGr,"buildPayload");p();var B9e=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 uGr=de(dU());var Cn=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)}},Pk=class extends Cn{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"}},F9e=class extends Cn{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 dGr=7*86400*1e3,XN=class{constructor(e=5){this.perWeek=e;this.cache=new Cn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-dGr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(fGr(t.replace(/\\/g,"/")),"gi"):new RegExp(fGr(t),"gi"));function ndo(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(ido,"removePropertiesWithPossibleUserInfo");function odo(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(odo,"redactPaths");function hGr(t,e=rdo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=ido(s);if(c!==s){r[n]=c;continue}s=ndo(s,e);for(let l of e)s=s.replace(l,"");s=odo(s),r[n]=s}return r}a(hGr,"sanitizeTelemetryProperties");function fU(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(fU,"filterTelemetryProperties");p();var QI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:gGr(r,n),verboseLogging:ado(r,n),testMode:e,simulation:sdo(n)})}};function O1(t){return t.get(QI).flags.testMode}a(O1,"isRunningInTest");function RCe(t){return O1(t)}a(RCe,"shouldFailForDebugPurposes");function kCe(t){return t.get(QI).flags.debug}a(kCe,"isDebugEnabled");function mGr(t){return t.get(QI).flags.verboseLogging}a(mGr,"isVerboseLoggingEnabled");function gGr(t,e){return t.includes("--debug")||uPt(e,"DEBUG")}a(gGr,"determineDebugFlag");function sdo(t){return uPt(t,"SIMULATION")}a(sdo,"determineSimulationFlag");function Q9e(t){return t.get(QI).flags.simulation}a(Q9e,"isRunningInSimulation");function ado(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||uPt(e,"VERBOSE")||gGr(t,e)}a(ado,"determineVerboseLoggingEnabled");function uPt(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(uPt,"determineEnvFlagEnabled");p();var xd=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 EGr=require("os"),_Gr=de(require("path"));function PCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(PCe,"redactPaths");var cdo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),ldo=[/^[\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 fPt(t){if(cdo.has(t))return t;for(let e of ldo)if(e.test(t))return t;return PCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(fPt,"redactMessage");function Toe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Toe,"escapeForRegExp");var udo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Toe((0,EGr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function dPt(t){return t.replace(udo,"~")}a(dPt,"redactHomeDir");var vGr="[\\\\/]?([^:)]*)(?=:\\d)",AGr=new RegExp(Toe(_Gr.sep),"g"),yGr=new RegExp(Toe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+vGr,"gi");function pPt(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(yGr.test(l))o.stack+=` -${PCe(l.replace(yGr,(u,d)=>"./"+d.replace(AGr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${PCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Toe(f.replace(/[\\/]$/,""))+vGr,"gi");if(h.test(l)){o.stack+=` -${PCe(l.replace(h,(m,g)=>d+g.replace(AGr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${dPt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=dPt(s));return t.cause instanceof Error&&(o.cause=pPt(t.cause,e,r,n)),o}a(pPt,"cloneError");function CGr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(CGr,"errorMessageWithoutPath");function bGr(t,e){return pPt(t,a(function(n){return dPt(CGr(n))},"prepareMessage"),!0,e)}a(bGr,"prepareErrorForRestrictedTelemetry");function SGr(t,e,r=!1){return pPt(t,a(function(o){if(r)return fPt(CGr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=PCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(SGr,"redactError");p();p();var Ly={};ki(Ly,{HasPropertyKey:()=>q9e,IsArray:()=>Lp,IsAsyncIterator:()=>hPt,IsBigInt:()=>DCe,IsBoolean:()=>sB,IsDate:()=>xW,IsFunction:()=>mPt,IsIterator:()=>gPt,IsNull:()=>APt,IsNumber:()=>L1,IsObject:()=>Yc,IsRegExp:()=>NCe,IsString:()=>Ql,IsSymbol:()=>yPt,IsUint8Array:()=>aB,IsUndefined:()=>Bp});p();function q9e(t,e){return e in t}a(q9e,"HasPropertyKey");function hPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.asyncIterator in t}a(hPt,"IsAsyncIterator");function Lp(t){return Array.isArray(t)}a(Lp,"IsArray");function DCe(t){return typeof t=="bigint"}a(DCe,"IsBigInt");function sB(t){return typeof t=="boolean"}a(sB,"IsBoolean");function xW(t){return t instanceof globalThis.Date}a(xW,"IsDate");function mPt(t){return typeof t=="function"}a(mPt,"IsFunction");function gPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.iterator in t}a(gPt,"IsIterator");function APt(t){return t===null}a(APt,"IsNull");function L1(t){return typeof t=="number"}a(L1,"IsNumber");function Yc(t){return typeof t=="object"&&t!==null}a(Yc,"IsObject");function NCe(t){return t instanceof globalThis.RegExp}a(NCe,"IsRegExp");function Ql(t){return typeof t=="string"}a(Ql,"IsString");function yPt(t){return typeof t=="symbol"}a(yPt,"IsSymbol");function aB(t){return t instanceof globalThis.Uint8Array}a(aB,"IsUint8Array");function Bp(t){return t===void 0}a(Bp,"IsUndefined");function ddo(t){return t.map(e=>j9e(e))}a(ddo,"ArrayType");function fdo(t){return new Date(t.getTime())}a(fdo,"DateType");function pdo(t){return new Uint8Array(t)}a(pdo,"Uint8ArrayType");function hdo(t){return new RegExp(t.source,t.flags)}a(hdo,"RegExpType");function mdo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=j9e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=j9e(t[r]);return e}a(mdo,"ObjectType");function j9e(t){return Lp(t)?ddo(t):xW(t)?fdo(t):aB(t)?pdo(t):NCe(t)?hdo(t):Yc(t)?mdo(t):t}a(j9e,"Visit");function Bu(t){return j9e(t)}a(Bu,"Clone");function Ioe(t,e){return e===void 0?Bu(t):Bu({...e,...t})}a(Ioe,"CloneType");p();p();p();function H9e(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(H9e,"IsAsyncIterator");function G9e(t){return bo(t)&&globalThis.Symbol.iterator in t}a(G9e,"IsIterator");function EPt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(EPt,"IsStandardObject");function $9e(t){return t instanceof globalThis.Promise}a($9e,"IsPromise");function __(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(__,"IsDate");function TGr(t){return t instanceof globalThis.Map}a(TGr,"IsMap");function IGr(t){return t instanceof globalThis.Set}a(IGr,"IsSet");function qI(t){return globalThis.ArrayBuffer.isView(t)}a(qI,"IsTypedArray");function xoe(t){return t instanceof globalThis.Uint8Array}a(xoe,"IsUint8Array");function Qi(t,e){return e in t}a(Qi,"HasPropertyKey");function bo(t){return t!==null&&typeof t=="object"}a(bo,"IsObject");function Pi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Pi,"IsArray");function Fu(t){return t===void 0}a(Fu,"IsUndefined");function cB(t){return t===null}a(cB,"IsNull");function eM(t){return typeof t=="boolean"}a(eM,"IsBoolean");function ai(t){return typeof t=="number"}a(ai,"IsNumber");function V9e(t){return globalThis.Number.isInteger(t)}a(V9e,"IsInteger");function pA(t){return typeof t=="bigint"}a(pA,"IsBigInt");function Sa(t){return typeof t=="string"}a(Sa,"IsString");function pU(t){return typeof t=="function"}a(pU,"IsFunction");function lB(t){return typeof t=="symbol"}a(lB,"IsSymbol");function B1(t){return pA(t)||eM(t)||cB(t)||ai(t)||Sa(t)||lB(t)||Fu(t)}a(B1,"IsValueType");var su;(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&&!Pi(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?ai(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Fu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(su||(su={}));p();function gdo(t){return globalThis.Object.freeze(t).map(e=>MCe(e))}a(gdo,"ImmutableArray");function Ado(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=MCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=MCe(t[r]);return globalThis.Object.freeze(e)}a(Ado,"ImmutableObject");function MCe(t){return Lp(t)?gdo(t):xW(t)?t:aB(t)?t:NCe(t)?t:Yc(t)?Ado(t):t}a(MCe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(su.InstanceMode){case"freeze":return MCe(r);case"clone":return Bu(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 wd=Symbol.for("TypeBox.Transform"),Dk=Symbol.for("TypeBox.Readonly"),hA=Symbol.for("TypeBox.Optional"),jI=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function woe(t){return Yc(t)&&t[Dk]==="Readonly"}a(woe,"IsReadonly");function iC(t){return Yc(t)&&t[hA]==="Optional"}a(iC,"IsOptional");function _Pt(t){return aa(t,"Any")}a(_Pt,"IsAny");function vPt(t){return aa(t,"Argument")}a(vPt,"IsArgument");function Nk(t){return aa(t,"Array")}a(Nk,"IsArray");function wW(t){return aa(t,"AsyncIterator")}a(wW,"IsAsyncIterator");function RW(t){return aa(t,"BigInt")}a(RW,"IsBigInt");function uB(t){return aa(t,"Boolean")}a(uB,"IsBoolean");function Mk(t){return aa(t,"Computed")}a(Mk,"IsComputed");function Ok(t){return aa(t,"Constructor")}a(Ok,"IsConstructor");function ydo(t){return aa(t,"Date")}a(ydo,"IsDate");function Lk(t){return aa(t,"Function")}a(Lk,"IsFunction");function Bk(t){return aa(t,"Integer")}a(Bk,"IsInteger");function af(t){return aa(t,"Intersect")}a(af,"IsIntersect");function kW(t){return aa(t,"Iterator")}a(kW,"IsIterator");function aa(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(aa,"IsKindOf");function W9e(t){return sB(t)||L1(t)||Ql(t)}a(W9e,"IsLiteralValue");function F1(t){return aa(t,"Literal")}a(F1,"IsLiteral");function U1(t){return aa(t,"MappedKey")}a(U1,"IsMappedKey");function Uu(t){return aa(t,"MappedResult")}a(Uu,"IsMappedResult");function hU(t){return aa(t,"Never")}a(hU,"IsNever");function Edo(t){return aa(t,"Not")}a(Edo,"IsNot");function OCe(t){return aa(t,"Null")}a(OCe,"IsNull");function Fk(t){return aa(t,"Number")}a(Fk,"IsNumber");function Fp(t){return aa(t,"Object")}a(Fp,"IsObject");function PW(t){return aa(t,"Promise")}a(PW,"IsPromise");function DW(t){return aa(t,"Record")}a(DW,"IsRecord");function jf(t){return aa(t,"Ref")}a(jf,"IsRef");function CPt(t){return aa(t,"RegExp")}a(CPt,"IsRegExp");function dB(t){return aa(t,"String")}a(dB,"IsString");function LCe(t){return aa(t,"Symbol")}a(LCe,"IsSymbol");function Q1(t){return aa(t,"TemplateLiteral")}a(Q1,"IsTemplateLiteral");function _do(t){return aa(t,"This")}a(_do,"IsThis");function ec(t){return Yc(t)&&wd in t}a(ec,"IsTransform");function q1(t){return aa(t,"Tuple")}a(q1,"IsTuple");function fB(t){return aa(t,"Undefined")}a(fB,"IsUndefined");function Ta(t){return aa(t,"Union")}a(Ta,"IsUnion");function vdo(t){return aa(t,"Uint8Array")}a(vdo,"IsUint8Array");function Cdo(t){return aa(t,"Unknown")}a(Cdo,"IsUnknown");function bdo(t){return aa(t,"Unsafe")}a(bdo,"IsUnsafe");function Sdo(t){return aa(t,"Void")}a(Sdo,"IsVoid");function mU(t){return Yc(t)&&Tt in t&&Ql(t[Tt])}a(mU,"IsKind");function Rd(t){return _Pt(t)||vPt(t)||Nk(t)||uB(t)||RW(t)||wW(t)||Mk(t)||Ok(t)||ydo(t)||Lk(t)||Bk(t)||af(t)||kW(t)||F1(t)||U1(t)||Uu(t)||hU(t)||Edo(t)||OCe(t)||Fk(t)||Fp(t)||PW(t)||DW(t)||jf(t)||CPt(t)||dB(t)||LCe(t)||Q1(t)||_do(t)||q1(t)||fB(t)||Ta(t)||vdo(t)||Cdo(t)||bdo(t)||Sdo(t)||mU(t)}a(Rd,"IsSchema");var it={};ki(it,{IsAny:()=>kGr,IsArgument:()=>PGr,IsArray:()=>DGr,IsAsyncIterator:()=>NGr,IsBigInt:()=>MGr,IsBoolean:()=>OGr,IsComputed:()=>LGr,IsConstructor:()=>BGr,IsDate:()=>FGr,IsFunction:()=>UGr,IsImport:()=>kdo,IsInteger:()=>QGr,IsIntersect:()=>qGr,IsIterator:()=>jGr,IsKind:()=>h$r,IsKindOf:()=>Bs,IsLiteral:()=>FCe,IsLiteralBoolean:()=>Pdo,IsLiteralNumber:()=>GGr,IsLiteralString:()=>HGr,IsLiteralValue:()=>$Gr,IsMappedKey:()=>VGr,IsMappedResult:()=>WGr,IsNever:()=>zGr,IsNot:()=>YGr,IsNull:()=>KGr,IsNumber:()=>JGr,IsObject:()=>ZGr,IsOptional:()=>Rdo,IsPromise:()=>XGr,IsProperties:()=>z9e,IsReadonly:()=>wdo,IsRecord:()=>e$r,IsRecursive:()=>Ddo,IsRef:()=>t$r,IsRegExp:()=>r$r,IsSchema:()=>Qu,IsString:()=>n$r,IsSymbol:()=>i$r,IsTemplateLiteral:()=>o$r,IsThis:()=>s$r,IsTransform:()=>a$r,IsTuple:()=>c$r,IsUint8Array:()=>u$r,IsUndefined:()=>l$r,IsUnion:()=>IPt,IsUnionLiteral:()=>Ndo,IsUnknown:()=>d$r,IsUnsafe:()=>f$r,IsVoid:()=>p$r,TypeGuardUnknownTypeError:()=>bPt});p();var bPt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Tdo=["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 xGr(t){try{return new RegExp(t),!0}catch{return!1}}a(xGr,"IsPattern");function SPt(t){if(!Ql(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(SPt,"IsControlCharacterFree");function wGr(t){return TPt(t)||Qu(t)}a(wGr,"IsAdditionalProperties");function BCe(t){return Bp(t)||DCe(t)}a(BCe,"IsOptionalBigInt");function ql(t){return Bp(t)||L1(t)}a(ql,"IsOptionalNumber");function TPt(t){return Bp(t)||sB(t)}a(TPt,"IsOptionalBoolean");function Kc(t){return Bp(t)||Ql(t)}a(Kc,"IsOptionalString");function Ido(t){return Bp(t)||Ql(t)&&SPt(t)&&xGr(t)}a(Ido,"IsOptionalPattern");function xdo(t){return Bp(t)||Ql(t)&&SPt(t)}a(xdo,"IsOptionalFormat");function RGr(t){return Bp(t)||Qu(t)}a(RGr,"IsOptionalSchema");function wdo(t){return Yc(t)&&t[Dk]==="Readonly"}a(wdo,"IsReadonly");function Rdo(t){return Yc(t)&&t[hA]==="Optional"}a(Rdo,"IsOptional");function kGr(t){return Bs(t,"Any")&&Kc(t.$id)}a(kGr,"IsAny");function PGr(t){return Bs(t,"Argument")&&L1(t.index)}a(PGr,"IsArgument");function DGr(t){return Bs(t,"Array")&&t.type==="array"&&Kc(t.$id)&&Qu(t.items)&&ql(t.minItems)&&ql(t.maxItems)&&TPt(t.uniqueItems)&&RGr(t.contains)&&ql(t.minContains)&&ql(t.maxContains)}a(DGr,"IsArray");function NGr(t){return Bs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Kc(t.$id)&&Qu(t.items)}a(NGr,"IsAsyncIterator");function MGr(t){return Bs(t,"BigInt")&&t.type==="bigint"&&Kc(t.$id)&&BCe(t.exclusiveMaximum)&&BCe(t.exclusiveMinimum)&&BCe(t.maximum)&&BCe(t.minimum)&&BCe(t.multipleOf)}a(MGr,"IsBigInt");function OGr(t){return Bs(t,"Boolean")&&t.type==="boolean"&&Kc(t.$id)}a(OGr,"IsBoolean");function LGr(t){return Bs(t,"Computed")&&Ql(t.target)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))}a(LGr,"IsComputed");function BGr(t){return Bs(t,"Constructor")&&t.type==="Constructor"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(BGr,"IsConstructor");function FGr(t){return Bs(t,"Date")&&t.type==="Date"&&Kc(t.$id)&&ql(t.exclusiveMaximumTimestamp)&&ql(t.exclusiveMinimumTimestamp)&&ql(t.maximumTimestamp)&&ql(t.minimumTimestamp)&&ql(t.multipleOfTimestamp)}a(FGr,"IsDate");function UGr(t){return Bs(t,"Function")&&t.type==="Function"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(UGr,"IsFunction");function kdo(t){return Bs(t,"Import")&&q9e(t,"$defs")&&Yc(t.$defs)&&z9e(t.$defs)&&q9e(t,"$ref")&&Ql(t.$ref)&&t.$ref in t.$defs}a(kdo,"IsImport");function QGr(t){return Bs(t,"Integer")&&t.type==="integer"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(QGr,"IsInteger");function z9e(t){return Yc(t)&&Object.entries(t).every(([e,r])=>SPt(e)&&Qu(r))}a(z9e,"IsProperties");function qGr(t){return Bs(t,"Intersect")&&!(Ql(t.type)&&t.type!=="object")&&Lp(t.allOf)&&t.allOf.every(e=>Qu(e)&&!a$r(e))&&Kc(t.type)&&(TPt(t.unevaluatedProperties)||RGr(t.unevaluatedProperties))&&Kc(t.$id)}a(qGr,"IsIntersect");function jGr(t){return Bs(t,"Iterator")&&t.type==="Iterator"&&Kc(t.$id)&&Qu(t.items)}a(jGr,"IsIterator");function Bs(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(Bs,"IsKindOf");function HGr(t){return FCe(t)&&Ql(t.const)}a(HGr,"IsLiteralString");function GGr(t){return FCe(t)&&L1(t.const)}a(GGr,"IsLiteralNumber");function Pdo(t){return FCe(t)&&sB(t.const)}a(Pdo,"IsLiteralBoolean");function FCe(t){return Bs(t,"Literal")&&Kc(t.$id)&&$Gr(t.const)}a(FCe,"IsLiteral");function $Gr(t){return sB(t)||L1(t)||Ql(t)}a($Gr,"IsLiteralValue");function VGr(t){return Bs(t,"MappedKey")&&Lp(t.keys)&&t.keys.every(e=>L1(e)||Ql(e))}a(VGr,"IsMappedKey");function WGr(t){return Bs(t,"MappedResult")&&z9e(t.properties)}a(WGr,"IsMappedResult");function zGr(t){return Bs(t,"Never")&&Yc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(zGr,"IsNever");function YGr(t){return Bs(t,"Not")&&Qu(t.not)}a(YGr,"IsNot");function KGr(t){return Bs(t,"Null")&&t.type==="null"&&Kc(t.$id)}a(KGr,"IsNull");function JGr(t){return Bs(t,"Number")&&t.type==="number"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(JGr,"IsNumber");function ZGr(t){return Bs(t,"Object")&&t.type==="object"&&Kc(t.$id)&&z9e(t.properties)&&wGr(t.additionalProperties)&&ql(t.minProperties)&&ql(t.maxProperties)}a(ZGr,"IsObject");function XGr(t){return Bs(t,"Promise")&&t.type==="Promise"&&Kc(t.$id)&&Qu(t.item)}a(XGr,"IsPromise");function e$r(t){return Bs(t,"Record")&&t.type==="object"&&Kc(t.$id)&&wGr(t.additionalProperties)&&Yc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&xGr(r[0])&&Yc(e.patternProperties)&&Qu(e.patternProperties[r[0]])})(t)}a(e$r,"IsRecord");function Ddo(t){return Yc(t)&&jI in t&&t[jI]==="Recursive"}a(Ddo,"IsRecursive");function t$r(t){return Bs(t,"Ref")&&Kc(t.$id)&&Ql(t.$ref)}a(t$r,"IsRef");function r$r(t){return Bs(t,"RegExp")&&Kc(t.$id)&&Ql(t.source)&&Ql(t.flags)&&ql(t.maxLength)&&ql(t.minLength)}a(r$r,"IsRegExp");function n$r(t){return Bs(t,"String")&&t.type==="string"&&Kc(t.$id)&&ql(t.minLength)&&ql(t.maxLength)&&Ido(t.pattern)&&xdo(t.format)}a(n$r,"IsString");function i$r(t){return Bs(t,"Symbol")&&t.type==="symbol"&&Kc(t.$id)}a(i$r,"IsSymbol");function o$r(t){return Bs(t,"TemplateLiteral")&&t.type==="string"&&Ql(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(o$r,"IsTemplateLiteral");function s$r(t){return Bs(t,"This")&&Kc(t.$id)&&Ql(t.$ref)}a(s$r,"IsThis");function a$r(t){return Yc(t)&&wd in t}a(a$r,"IsTransform");function c$r(t){return Bs(t,"Tuple")&&t.type==="array"&&Kc(t.$id)&&L1(t.minItems)&&L1(t.maxItems)&&t.minItems===t.maxItems&&(Bp(t.items)&&Bp(t.additionalItems)&&t.minItems===0||Lp(t.items)&&t.items.every(e=>Qu(e)))}a(c$r,"IsTuple");function l$r(t){return Bs(t,"Undefined")&&t.type==="undefined"&&Kc(t.$id)}a(l$r,"IsUndefined");function Ndo(t){return IPt(t)&&t.anyOf.every(e=>HGr(e)||GGr(e))}a(Ndo,"IsUnionLiteral");function IPt(t){return Bs(t,"Union")&&Kc(t.$id)&&Yc(t)&&Lp(t.anyOf)&&t.anyOf.every(e=>Qu(e))}a(IPt,"IsUnion");function u$r(t){return Bs(t,"Uint8Array")&&t.type==="Uint8Array"&&Kc(t.$id)&&ql(t.minByteLength)&&ql(t.maxByteLength)}a(u$r,"IsUint8Array");function d$r(t){return Bs(t,"Unknown")&&Kc(t.$id)}a(d$r,"IsUnknown");function f$r(t){return Bs(t,"Unsafe")}a(f$r,"IsUnsafe");function p$r(t){return Bs(t,"Void")&&t.type==="void"&&Kc(t.$id)}a(p$r,"IsVoid");function h$r(t){return Yc(t)&&Tt in t&&Ql(t[Tt])&&!Tdo.includes(t[Tt])}a(h$r,"IsKind");function Qu(t){return Yc(t)&&(kGr(t)||PGr(t)||DGr(t)||OGr(t)||MGr(t)||NGr(t)||LGr(t)||BGr(t)||FGr(t)||UGr(t)||QGr(t)||qGr(t)||jGr(t)||FCe(t)||VGr(t)||WGr(t)||zGr(t)||YGr(t)||KGr(t)||JGr(t)||ZGr(t)||XGr(t)||e$r(t)||t$r(t)||r$r(t)||n$r(t)||i$r(t)||o$r(t)||s$r(t)||c$r(t)||l$r(t)||IPt(t)||u$r(t)||d$r(t)||f$r(t)||p$r(t)||h$r(t))}a(Qu,"IsSchema");p();var xPt="(true|false)",UCe="(0|[1-9][0-9]*)",wPt="(.*)",Mdo="(?!.*)",Hdl=`^${xPt}$`,gU=`^${UCe}$`,AU=`^${wPt}$`,m$r=`^${Mdo}$`;p();var Uk={};ki(Uk,{Clear:()=>Ldo,Delete:()=>Bdo,Entries:()=>Odo,Get:()=>Qdo,Has:()=>Fdo,Set:()=>Udo});p();var Roe=new Map;function Odo(){return new Map(Roe)}a(Odo,"Entries");function Ldo(){return Roe.clear()}a(Ldo,"Clear");function Bdo(t){return Roe.delete(t)}a(Bdo,"Delete");function Fdo(t){return Roe.has(t)}a(Fdo,"Has");function Udo(t,e){Roe.set(t,e)}a(Udo,"Set");function Qdo(t){return Roe.get(t)}a(Qdo,"Get");var v_={};ki(v_,{Clear:()=>jdo,Delete:()=>Hdo,Entries:()=>qdo,Get:()=>Vdo,Has:()=>Gdo,Set:()=>$do});p();var koe=new Map;function qdo(){return new Map(koe)}a(qdo,"Entries");function jdo(){return koe.clear()}a(jdo,"Clear");function Hdo(t){return koe.delete(t)}a(Hdo,"Delete");function Gdo(t){return koe.has(t)}a(Gdo,"Has");function $do(t,e){koe.set(t,e)}a($do,"Set");function Vdo(t){return koe.get(t)}a(Vdo,"Get");p();function g$r(t,e){return t.includes(e)}a(g$r,"SetIncludes");function A$r(t){return[...new Set(t)]}a(A$r,"SetDistinct");function Wdo(t,e){return t.filter(r=>e.includes(r))}a(Wdo,"SetIntersect");function zdo(t,e){return t.reduce((r,n)=>Wdo(r,n),e)}a(zdo,"SetIntersectManyResolve");function y$r(t){return t.length===1?t[0]:t.length>1?zdo(t.slice(1),t[0]):[]}a(y$r,"SetIntersectMany");function E$r(t){let e=[];for(let r of t)e.push(...r);return e}a(E$r,"SetUnionMany");p();function yU(t){return wt({[Tt]:"Any"},t)}a(yU,"Any");p();function Poe(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(Poe,"Array");p();function _$r(t){return wt({[Tt]:"Argument",index:t})}a(_$r,"Argument");p();function Doe(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Doe,"AsyncIterator");p();p();function au(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(au,"Computed");p();p();function Ydo(t,e){let{[e]:r,...n}=t;return n}a(Ydo,"DiscardKey");function cf(t,e){return e.reduce((r,n)=>Ydo(r,n),t)}a(cf,"Discard");p();function Xo(t){return wt({[Tt]:"Never",not:{}},t)}a(Xo,"Never");p();p();function Qa(t){return wt({[Tt]:"MappedResult",properties:t})}a(Qa,"MappedResult");p();p();function Noe(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Noe,"Constructor");p();function tM(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(tM,"Function");p();p();p();p();function QCe(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(QCe,"UnionCreate");function Kdo(t){return t.some(e=>iC(e))}a(Kdo,"IsUnionOptional");function v$r(t){return t.map(e=>iC(e)?Jdo(e):e)}a(v$r,"RemoveOptionalFromRest");function Jdo(t){return cf(t,[hA])}a(Jdo,"RemoveOptionalFromType");function Zdo(t,e){return Kdo(t)?By(QCe(v$r(t),e)):QCe(v$r(t),e)}a(Zdo,"ResolveUnion");function rM(t,e){return t.length===1?wt(t[0],e):t.length===0?Xo(e):Zdo(t,e)}a(rM,"UnionEvaluated");p();function tc(t,e){return t.length===0?Xo(e):t.length===1?wt(t[0],e):QCe(t,e)}a(tc,"Union");p();p();p();var Y9e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function Xdo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(Xdo,"Unescape");function RPt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(RPt,"IsNonEscaped");function hB(t,e){return RPt(t,e,"(")}a(hB,"IsOpenParen");function qCe(t,e){return RPt(t,e,")")}a(qCe,"IsCloseParen");function C$r(t,e){return RPt(t,e,"|")}a(C$r,"IsSeparator");function efo(t){if(!(hB(t,0)&&qCe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Moe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Moe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(ifo,"Or");function ofo(t){function e(o,s){if(!hB(o,s))throw new Y9e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Moe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(ofo,"And");function Moe(t){return efo(t)?Moe(tfo(t)):rfo(t)?ifo(t):nfo(t)?ofo(t):{type:"const",const:Xdo(t)}}a(Moe,"TemplateLiteralParse");function Ooe(t){return Moe(t.slice(1,t.length-1))}a(Ooe,"TemplateLiteralParseExact");var kPt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function sfo(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(sfo,"IsNumberExpression");function afo(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(afo,"IsBooleanExpression");function cfo(t){return t.type==="const"&&t.const===".*"}a(cfo,"IsStringExpression");function NW(t){return sfo(t)||cfo(t)?!1:afo(t)?!0:t.type==="and"?t.expr.every(e=>NW(e)):t.type==="or"?t.expr.every(e=>NW(e)):t.type==="const"?!0:(()=>{throw new kPt("Unknown expression type")})()}a(NW,"IsTemplateLiteralExpressionFinite");function K9e(t){let e=Ooe(t.pattern);return NW(e)}a(K9e,"IsTemplateLiteralFinite");p();var PPt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*b$r(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of b$r(t.slice(1)))yield`${e}${r}`}a(b$r,"GenerateReduce");function*lfo(t){return yield*b$r(t.expr.map(e=>[...jCe(e)]))}a(lfo,"GenerateAnd");function*ufo(t){for(let e of t.expr)yield*jCe(e)}a(ufo,"GenerateOr");function*dfo(t){return yield t.const}a(dfo,"GenerateConst");function*jCe(t){return t.type==="and"?yield*lfo(t):t.type==="or"?yield*ufo(t):t.type==="const"?yield*dfo(t):(()=>{throw new PPt("Unknown expression")})()}a(jCe,"TemplateLiteralExpressionGenerate");function Loe(t){let e=Ooe(t.pattern);return NW(e)?[...jCe(e)]:[]}a(Loe,"TemplateLiteralGenerate");p();p();function ca(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(ca,"Literal");p();function J9e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a(J9e,"Boolean");p();function Boe(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(Boe,"BigInt");p();function HI(t){return wt({[Tt]:"Number",type:"number"},t)}a(HI,"Number");p();function C_(t){return wt({[Tt]:"String",type:"string"},t)}a(C_,"String");function*ffo(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield J9e():e==="number"?yield HI():e==="bigint"?yield Boe():e==="string"?yield C_():yield(()=>{let r=e.split("|").map(n=>ca(n.trim()));return r.length===0?Xo():r.length===1?r[0]:rM(r)})()}a(ffo,"FromUnion");function*pfo(t){if(t[1]!=="{"){let e=ca("$"),r=DPt(t.slice(1));return yield*[e,...r]}for(let e=2;eT$r(r,e)).join("|")})`:Fk(t)?`${e}${UCe}`:Bk(t)?`${e}${UCe}`:RW(t)?`${e}${UCe}`:dB(t)?`${e}${wPt}`:F1(t)?`${e}${hfo(t.const.toString())}`:uB(t)?`${e}${xPt}`:(()=>{throw new NPt(`Unexpected Kind '${t[Tt]}'`)})()}a(T$r,"Visit");function MPt(t){return`^${t.map(e=>T$r(e,"")).join("")}$`}a(MPt,"TemplateLiteralPattern");p();function MW(t){let r=Loe(t).map(n=>ca(n));return rM(r)}a(MW,"TemplateLiteralToUnion");p();function Z9e(t,e){let r=Ql(t)?MPt(S$r(t)):MPt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(Z9e,"TemplateLiteral");function mfo(t){return Loe(t).map(r=>r.toString())}a(mfo,"FromTemplateLiteral");function gfo(t){let e=[];for(let r of t)e.push(...oC(r));return e}a(gfo,"FromUnion");function Afo(t){return[t.toString()]}a(Afo,"FromLiteral");function oC(t){return[...new Set(Q1(t)?mfo(t):Ta(t)?gfo(t.anyOf):F1(t)?Afo(t.const):Fk(t)?["[number]"]:Bk(t)?["[number]"]:[])]}a(oC,"IndexPropertyKeys");p();function yfo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=EU(t,oC(e[o]),r);return n}a(yfo,"FromProperties");function Efo(t,e,r){return yfo(t,e.properties,r)}a(Efo,"FromMappedResult");function I$r(t,e,r){let n=Efo(t,e,r);return Qa(n)}a(I$r,"IndexFromMappedResult");function w$r(t,e){return t.map(r=>R$r(r,e))}a(w$r,"FromRest");function _fo(t){return t.filter(e=>!hU(e))}a(_fo,"FromIntersectRest");function vfo(t,e){return X9e(_fo(w$r(t,e)))}a(vfo,"FromIntersect");function Cfo(t){return t.some(e=>hU(e))?[]:t}a(Cfo,"FromUnionRest");function bfo(t,e){return rM(Cfo(w$r(t,e)))}a(bfo,"FromUnion");function Sfo(t,e){return e in t?t[e]:e==="[number]"?rM(t):Xo()}a(Sfo,"FromTuple");function Tfo(t,e){return e==="[number]"?t:Xo()}a(Tfo,"FromArray");function Ifo(t,e){return e in t?t[e]:Xo()}a(Ifo,"FromProperty");function R$r(t,e){return af(t)?vfo(t.allOf,e):Ta(t)?bfo(t.anyOf,e):q1(t)?Sfo(t.items??[],e):Nk(t)?Tfo(t.items,e):Fp(t)?Ifo(t.properties,e):Xo()}a(R$r,"IndexFromPropertyKey");function HCe(t,e){return e.map(r=>R$r(t,r))}a(HCe,"IndexFromPropertyKeys");function x$r(t,e){return rM(HCe(t,e))}a(x$r,"FromSchema");function EU(t,e,r){if(jf(t)||jf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Rd(t)||!Rd(e))throw new qi(n);return au("Index",[t,e])}return Uu(e)?I$r(t,e,r):U1(e)?k$r(t,e,r):wt(Rd(e)?x$r(t,oC(e)):x$r(t,e),r)}a(EU,"Index");function xfo(t,e,r){return{[e]:EU(t,[e],Bu(r))}}a(xfo,"MappedIndexPropertyKey");function wfo(t,e,r){return e.reduce((n,o)=>({...n,...xfo(t,o,r)}),{})}a(wfo,"MappedIndexPropertyKeys");function Rfo(t,e,r){return wfo(t,e.keys,r)}a(Rfo,"MappedIndexProperties");function k$r(t,e,r){let n=Rfo(t,e,r);return Qa(n)}a(k$r,"IndexFromMappedKey");p();function Foe(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(Foe,"Iterator");p();function kfo(t){return globalThis.Object.keys(t).filter(e=>!iC(t[e]))}a(kfo,"RequiredArray");function Pfo(t,e){let r=kfo(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(Pfo,"_Object");var rc=Pfo;p();function eUe(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(eUe,"Promise");p();p();function Dfo(t){return wt(cf(t,[Dk]))}a(Dfo,"RemoveReadonly");function Nfo(t){return wt({...t,[Dk]:"Readonly"})}a(Nfo,"AddReadonly");function Mfo(t,e){return e===!1?Dfo(t):Nfo(t)}a(Mfo,"ReadonlyWithFlag");function sC(t,e){let r=e??!0;return Uu(t)?P$r(t,r):Mfo(t,r)}a(sC,"Readonly");function Ofo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=sC(t[n],e);return r}a(Ofo,"FromProperties");function Lfo(t,e){return Ofo(t.properties,e)}a(Lfo,"FromMappedResult");function P$r(t,e){let r=Lfo(t,e);return Qa(r)}a(P$r,"ReadonlyFromMappedResult");p();function GI(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(GI,"Tuple");function D$r(t,e){return t in e?$I(t,e[t]):Qa(e)}a(D$r,"FromMappedResult");function Bfo(t){return{[t]:ca(t)}}a(Bfo,"MappedKeyToKnownMappedResultProperties");function Ffo(t){let e={};for(let r of t)e[r]=ca(r);return e}a(Ffo,"MappedKeyToUnknownMappedResultProperties");function Ufo(t,e){return g$r(e,t)?Bfo(t):Ffo(e)}a(Ufo,"MappedKeyToMappedResultProperties");function Qfo(t,e){let r=Ufo(t,e);return D$r(t,r)}a(Qfo,"FromMappedKey");function GCe(t,e){return e.map(r=>$I(t,r))}a(GCe,"FromRest");function qfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=$I(t,e[n]);return r}a(qfo,"FromProperties");function $I(t,e){let r={...e};return iC(e)?By($I(t,cf(e,[hA]))):woe(e)?sC($I(t,cf(e,[Dk]))):Uu(e)?D$r(t,e.properties):U1(e)?Qfo(t,e.keys):Ok(e)?Noe(GCe(t,e.parameters),$I(t,e.returns),r):Lk(e)?tM(GCe(t,e.parameters),$I(t,e.returns),r):wW(e)?Doe($I(t,e.items),r):kW(e)?Foe($I(t,e.items),r):af(e)?Fy(GCe(t,e.allOf),r):Ta(e)?tc(GCe(t,e.anyOf),r):q1(e)?GI(GCe(t,e.items??[]),r):Fp(e)?rc(qfo(t,e.properties),r):Nk(e)?Poe($I(t,e.items),r):PW(e)?eUe($I(t,e.item),r):e}a($I,"FromSchemaType");function jfo(t,e){let r={};for(let n of t)r[n]=$I(n,e);return r}a(jfo,"MappedFunctionReturnType");function N$r(t,e,r){let n=Rd(t)?oC(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=jfo(n,o);return rc(s,r)}a(N$r,"Mapped");p();function Hfo(t){return wt(cf(t,[hA]))}a(Hfo,"RemoveOptional");function Gfo(t){return wt({...t,[hA]:"Optional"})}a(Gfo,"AddOptional");function $fo(t,e){return e===!1?Hfo(t):Gfo(t)}a($fo,"OptionalWithFlag");function By(t,e){let r=e??!0;return Uu(t)?M$r(t,r):$fo(t,r)}a(By,"Optional");function Vfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=By(t[n],e);return r}a(Vfo,"FromProperties");function Wfo(t,e){return Vfo(t.properties,e)}a(Wfo,"FromMappedResult");function M$r(t,e){let r=Wfo(t,e);return Qa(r)}a(M$r,"OptionalFromMappedResult");p();function $Ce(t,e={}){let r=t.every(o=>Fp(o)),n=Rd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||Rd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a($Ce,"IntersectCreate");function zfo(t){return t.every(e=>iC(e))}a(zfo,"IsIntersectOptional");function Yfo(t){return cf(t,[hA])}a(Yfo,"RemoveOptionalFromType");function O$r(t){return t.map(e=>iC(e)?Yfo(e):e)}a(O$r,"RemoveOptionalFromRest");function Kfo(t,e){return zfo(t)?By($Ce(O$r(t),e)):$Ce(O$r(t),e)}a(Kfo,"ResolveIntersect");function X9e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return Kfo(t,e)}a(X9e,"IntersectEvaluated");p();function Fy(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return $Ce(t,e)}a(Fy,"Intersect");p();function VI(...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(VI,"Ref");function Jfo(t,e){return au("Awaited",[au(t,e)])}a(Jfo,"FromComputed");function Zfo(t){return au("Awaited",[VI(t)])}a(Zfo,"FromRef");function Xfo(t){return Fy(L$r(t))}a(Xfo,"FromIntersect");function epo(t){return tc(L$r(t))}a(epo,"FromUnion");function tpo(t){return Uoe(t)}a(tpo,"FromPromise");function L$r(t){return t.map(e=>Uoe(e))}a(L$r,"FromRest");function Uoe(t,e){return wt(Mk(t)?Jfo(t.target,t.parameters):af(t)?Xfo(t.allOf):Ta(t)?epo(t.anyOf):PW(t)?tpo(t.item):jf(t)?Zfo(t.$ref):t,e)}a(Uoe,"Awaited");p();p();p();p();function B$r(t){let e=[];for(let r of t)e.push(aC(r));return e}a(B$r,"FromRest");function rpo(t){let e=B$r(t);return E$r(e)}a(rpo,"FromIntersect");function npo(t){let e=B$r(t);return y$r(e)}a(npo,"FromUnion");function ipo(t){return t.map((e,r)=>r.toString())}a(ipo,"FromTuple");function opo(t){return["[number]"]}a(opo,"FromArray");function spo(t){return globalThis.Object.getOwnPropertyNames(t)}a(spo,"FromProperties");function apo(t){return OPt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(apo,"FromPatternProperties");function aC(t){return af(t)?rpo(t.allOf):Ta(t)?npo(t.anyOf):q1(t)?ipo(t.items??[]):Nk(t)?opo(t.items):Fp(t)?spo(t.properties):DW(t)?apo(t.patternProperties):[]}a(aC,"KeyOfPropertyKeys");var OPt=!1;function mB(t){OPt=!0;let e=aC(t);return OPt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(mB,"KeyOfPattern");function cpo(t,e){return au("KeyOf",[au(t,e)])}a(cpo,"FromComputed");function lpo(t){return au("KeyOf",[VI(t)])}a(lpo,"FromRef");function upo(t,e){let r=aC(t),n=dpo(r),o=rM(n);return wt(o,e)}a(upo,"KeyOfFromType");function dpo(t){return t.map(e=>e==="[number]"?HI():ca(e))}a(dpo,"KeyOfPropertyKeysToRest");function Qoe(t,e){return Mk(t)?cpo(t.target,t.parameters):jf(t)?lpo(t.$ref):Uu(t)?F$r(t,e):upo(t,e)}a(Qoe,"KeyOf");function fpo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qoe(t[n],Bu(e));return r}a(fpo,"FromProperties");function ppo(t,e){return fpo(t.properties,e)}a(ppo,"FromMappedResult");function F$r(t,e){let r=ppo(t,e);return Qa(r)}a(F$r,"KeyOfFromMappedResult");p();function tUe(t){let e=aC(t),r=HCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(tUe,"KeyOfPropertyEntries");function hpo(t){let e=[];for(let r of t)e.push(...aC(r));return A$r(e)}a(hpo,"CompositeKeys");function mpo(t){return t.filter(e=>!hU(e))}a(mpo,"FilterNever");function gpo(t,e){let r=[];for(let n of t)r.push(...HCe(n,[e]));return mpo(r)}a(gpo,"CompositeProperty");function Apo(t,e){let r={};for(let n of e)r[n]=X9e(gpo(t,n));return r}a(Apo,"CompositeProperties");function U$r(t,e){let r=hpo(t),n=Apo(t,r);return rc(n,e)}a(U$r,"Composite");p();p();function rUe(t){return wt({[Tt]:"Date",type:"Date"},t)}a(rUe,"Date");p();function nUe(t){return wt({[Tt]:"Null",type:"null"},t)}a(nUe,"Null");p();function iUe(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(iUe,"Symbol");p();function oUe(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(oUe,"Undefined");p();function sUe(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(sUe,"Uint8Array");p();function Qk(t){return wt({[Tt]:"Unknown"},t)}a(Qk,"Unknown");function ypo(t){return t.map(e=>LPt(e,!1))}a(ypo,"FromArray");function Epo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=sC(LPt(t[r],!1));return e}a(Epo,"FromProperties");function aUe(t,e){return e===!0?t:sC(t)}a(aUe,"ConditionalReadonly");function LPt(t,e){return hPt(t)?aUe(yU(),e):gPt(t)?aUe(yU(),e):Lp(t)?sC(GI(ypo(t))):aB(t)?sUe():xW(t)?rUe():Yc(t)?aUe(rc(Epo(t)),e):mPt(t)?aUe(tM([],Qk()),e):Bp(t)?oUe():APt(t)?nUe():yPt(t)?iUe():DCe(t)?Boe():L1(t)?ca(t):sB(t)?ca(t):Ql(t)?ca(t):rc({})}a(LPt,"FromValue");function Q$r(t,e){return wt(LPt(t,!0),e)}a(Q$r,"Const");p();function q$r(t,e){return Ok(t)?GI(t.parameters,e):Xo(e)}a(q$r,"ConstructorParameters");p();function j$r(t,e){if(Bp(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=>ca(s));return tc(o,{...e,[jI]:"Enum"})}a(j$r,"Enum");p();p();p();var FPt=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 WI(t){return t===Rt.False?t:Rt.True}a(WI,"IntoBooleanResult");function qoe(t){throw new FPt(t)}a(qoe,"Throw");function Ih(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(Ih,"IsStructuralRight");function xh(t,e){return it.IsNever(e)?Y$r(t,e):it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsUnknown(e)?X$r(t,e):it.IsAny(e)?qPt(t,e):qoe("StructuralRight")}a(xh,"StructuralRight");function qPt(t,e){return Rt.True}a(qPt,"FromAnyRight");function _po(t,e){return it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)&&e.anyOf.some(r=>it.IsAny(r)||it.IsUnknown(r))?Rt.True:it.IsUnion(e)?Rt.Union:it.IsUnknown(e)||it.IsAny(e)?Rt.True:Rt.Union}a(_po,"FromAny");function vpo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(vpo,"FromArrayRight");function Cpo(t,e){return it.IsObject(e)&&lUe(e)?Rt.True:Ih(e)?xh(t,e):it.IsArray(e)?WI(Jc(t.items,e.items)):Rt.False}a(Cpo,"FromArray");function bpo(t,e){return Ih(e)?xh(t,e):it.IsAsyncIterator(e)?WI(Jc(t.items,e.items)):Rt.False}a(bpo,"FromAsyncIterator");function Spo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(Spo,"FromBigInt");function W$r(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(W$r,"FromBooleanRight");function Tpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(Tpo,"FromBoolean");function Ipo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>WI(Jc(e.parameters[n],r))===Rt.True)?WI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(Ipo,"FromConstructor");function xpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsDate(e)?Rt.True:Rt.False}a(xpo,"FromDate");function wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>WI(Jc(e.parameters[n],r))===Rt.True)?WI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(wpo,"FromFunction");function z$r(t,e){return it.IsLiteral(t)&&Ly.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(z$r,"FromIntegerRight");function Rpo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):Rt.False}a(Rpo,"FromInteger");function cUe(t,e){return e.allOf.every(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(cUe,"FromIntersectRight");function kpo(t,e){return t.allOf.some(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(kpo,"FromIntersect");function Ppo(t,e){return Ih(e)?xh(t,e):it.IsIterator(e)?WI(Jc(t.items,e.items)):Rt.False}a(Ppo,"FromIterator");function Dpo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsString(e)?Z$r(t,e):it.IsNumber(e)?K$r(t,e):it.IsInteger(e)?z$r(t,e):it.IsBoolean(e)?W$r(t,e):Rt.False}a(Dpo,"FromLiteral");function Y$r(t,e){return Rt.False}a(Y$r,"FromNeverRight");function Npo(t,e){return Rt.True}a(Npo,"FromNever");function H$r(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:Qk()}a(H$r,"UnwrapTNot");function Mpo(t,e){return it.IsNot(t)?Jc(H$r(t),e):it.IsNot(e)?Jc(t,H$r(e)):qoe("Invalid fallthrough for Not")}a(Mpo,"FromNot");function Opo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsNull(e)?Rt.True:Rt.False}a(Opo,"FromNull");function K$r(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(K$r,"FromNumberRight");function Lpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(Lpo,"FromNumber");function cC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(cC,"IsObjectPropertyCount");function G$r(t){return lUe(t)}a(G$r,"IsObjectStringLike");function $$r(t){return cC(t,0)||cC(t,1)&&"description"in t.properties&&it.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(it.IsString(t.properties.description.anyOf[0])&&it.IsUndefined(t.properties.description.anyOf[1])||it.IsString(t.properties.description.anyOf[1])&&it.IsUndefined(t.properties.description.anyOf[0]))}a($$r,"IsObjectSymbolLike");function BPt(t){return cC(t,0)}a(BPt,"IsObjectNumberLike");function V$r(t){return cC(t,0)}a(V$r,"IsObjectBooleanLike");function Bpo(t){return cC(t,0)}a(Bpo,"IsObjectBigIntLike");function Fpo(t){return cC(t,0)}a(Fpo,"IsObjectDateLike");function Upo(t){return lUe(t)}a(Upo,"IsObjectUint8ArrayLike");function Qpo(t){let e=HI();return cC(t,0)||cC(t,1)&&"length"in t.properties&&WI(Jc(t.properties.length,e))===Rt.True}a(Qpo,"IsObjectFunctionLike");function qpo(t){return cC(t,0)}a(qpo,"IsObjectConstructorLike");function lUe(t){let e=HI();return cC(t,0)||cC(t,1)&&"length"in t.properties&&WI(Jc(t.properties.length,e))===Rt.True}a(lUe,"IsObjectArrayLike");function jpo(t){let e=tM([yU()],yU());return cC(t,0)||cC(t,1)&&"then"in t.properties&&WI(Jc(t.properties.then,e))===Rt.True}a(jpo,"IsObjectPromiseLike");function J$r(t,e){return Jc(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(J$r,"Property");function Uy(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&G$r(e)||it.IsLiteralNumber(t)&&BPt(e)||it.IsLiteralBoolean(t)&&V$r(e)||it.IsSymbol(t)&&$$r(e)||it.IsBigInt(t)&&Bpo(e)||it.IsString(t)&&G$r(e)||it.IsSymbol(t)&&$$r(e)||it.IsNumber(t)&&BPt(e)||it.IsInteger(t)&&BPt(e)||it.IsBoolean(t)&&V$r(e)||it.IsUint8Array(t)&&Upo(e)||it.IsDate(t)&&Fpo(e)||it.IsConstructor(t)&&qpo(e)||it.IsFunction(t)&&Qpo(e)?Rt.True:it.IsRecord(t)&&it.IsString(UPt(t))?e[jI]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(UPt(t))&&cC(e,0)?Rt.True:Rt.False}a(Uy,"FromObjectRight");function Hpo(t,e){return Ih(e)?xh(t,e):it.IsRecord(e)?zI(t,e):it.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!it.IsOptional(e.properties[r]))return Rt.False;if(it.IsOptional(e.properties[r]))return Rt.True;if(J$r(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Hpo,"FromObject");function Gpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&jpo(e)?Rt.True:it.IsPromise(e)?WI(Jc(t.item,e.item)):Rt.False}a(Gpo,"FromPromise");function UPt(t){return gU in t.patternProperties?HI():AU in t.patternProperties?C_():qoe("Unknown record key pattern")}a(UPt,"RecordKey");function QPt(t){return gU in t.patternProperties?t.patternProperties[gU]:AU in t.patternProperties?t.patternProperties[AU]:qoe("Unable to get record value schema")}a(QPt,"RecordValue");function zI(t,e){let[r,n]=[UPt(e),QPt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&WI(Jc(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Jc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(J$r(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(zI,"FromRecordRight");function $po(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?Jc(QPt(t),QPt(e)):Rt.False}a($po,"FromRecord");function Vpo(t,e){let r=it.IsRegExp(t)?C_():t,n=it.IsRegExp(e)?C_():e;return Jc(r,n)}a(Vpo,"FromRegExp");function Z$r(t,e){return it.IsLiteral(t)&&Ly.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(Z$r,"FromStringRight");function Wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsString(e)?Rt.True:Rt.False}a(Wpo,"FromString");function zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(zpo,"FromSymbol");function Ypo(t,e){return it.IsTemplateLiteral(t)?Jc(MW(t),e):it.IsTemplateLiteral(e)?Jc(t,MW(e)):qoe("Invalid fallthrough for TemplateLiteral")}a(Ypo,"FromTemplateLiteral");function Kpo(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Jc(r,e.items)===Rt.True)}a(Kpo,"IsArrayOfTuple");function Jpo(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(Jpo,"FromTupleRight");function Zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&lUe(e)||it.IsArray(e)&&Kpo(t,e)?Rt.True:it.IsTuple(e)?Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||!Ly.IsUndefined(t.items)&&Ly.IsUndefined(e.items)?Rt.False:Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||t.items.every((r,n)=>Jc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(Zpo,"FromTuple");function Xpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(Xpo,"FromUint8Array");function eho(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsVoid(e)?nho(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(eho,"FromUndefined");function jPt(t,e){return e.anyOf.some(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(jPt,"FromUnionRight");function tho(t,e){return t.anyOf.every(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(tho,"FromUnion");function X$r(t,e){return Rt.True}a(X$r,"FromUnknownRight");function rho(t,e){return it.IsNever(e)?Y$r(t,e):it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsAny(e)?qPt(t,e):it.IsString(e)?Z$r(t,e):it.IsNumber(e)?K$r(t,e):it.IsInteger(e)?z$r(t,e):it.IsBoolean(e)?W$r(t,e):it.IsArray(e)?vpo(t,e):it.IsTuple(e)?Jpo(t,e):it.IsObject(e)?Uy(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(rho,"FromUnknown");function nho(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(nho,"FromVoidRight");function iho(t,e){return it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsUnknown(e)?X$r(t,e):it.IsAny(e)?qPt(t,e):it.IsObject(e)?Uy(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(iho,"FromVoid");function Jc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?Ypo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?Vpo(t,e):it.IsNot(t)||it.IsNot(e)?Mpo(t,e):it.IsAny(t)?_po(t,e):it.IsArray(t)?Cpo(t,e):it.IsBigInt(t)?Spo(t,e):it.IsBoolean(t)?Tpo(t,e):it.IsAsyncIterator(t)?bpo(t,e):it.IsConstructor(t)?Ipo(t,e):it.IsDate(t)?xpo(t,e):it.IsFunction(t)?wpo(t,e):it.IsInteger(t)?Rpo(t,e):it.IsIntersect(t)?kpo(t,e):it.IsIterator(t)?Ppo(t,e):it.IsLiteral(t)?Dpo(t,e):it.IsNever(t)?Npo(t,e):it.IsNull(t)?Opo(t,e):it.IsNumber(t)?Lpo(t,e):it.IsObject(t)?Hpo(t,e):it.IsRecord(t)?$po(t,e):it.IsString(t)?Wpo(t,e):it.IsSymbol(t)?zpo(t,e):it.IsTuple(t)?Zpo(t,e):it.IsPromise(t)?Gpo(t,e):it.IsUint8Array(t)?Xpo(t,e):it.IsUndefined(t)?eho(t,e):it.IsUnion(t)?tho(t,e):it.IsUnknown(t)?rho(t,e):it.IsVoid(t)?iho(t,e):qoe(`Unknown left type operand '${t[Tt]}'`)}a(Jc,"Visit");function _U(t,e){return Jc(t,e)}a(_U,"ExtendsCheck");p();p();p();function oho(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=joe(t[c],e,r,n,Bu(o));return s}a(oho,"FromProperties");function sho(t,e,r,n,o){return oho(t.properties,e,r,n,o)}a(sho,"FromMappedResult");function eVr(t,e,r,n,o){let s=sho(t,e,r,n,o);return Qa(s)}a(eVr,"ExtendsFromMappedResult");function aho(t,e,r,n){let o=_U(t,e);return o===Rt.Union?tc([r,n]):o===Rt.True?r:n}a(aho,"ExtendsResolve");function joe(t,e,r,n,o){return Uu(t)?eVr(t,e,r,n,o):U1(t)?wt(tVr(t,e,r,n,o)):wt(aho(t,e,r,n),o)}a(joe,"Extends");function cho(t,e,r,n,o){return{[t]:joe(ca(t),e,r,n,Bu(o))}}a(cho,"FromPropertyKey");function lho(t,e,r,n,o){return t.reduce((s,c)=>({...s,...cho(c,e,r,n,o)}),{})}a(lho,"FromPropertyKeys");function uho(t,e,r,n,o){return lho(t.keys,e,r,n,o)}a(uho,"FromMappedKey");function tVr(t,e,r,n,o){let s=uho(t,e,r,n,o);return Qa(s)}a(tVr,"ExtendsFromMappedKey");p();function dho(t){return t.allOf.every(e=>gB(e))}a(dho,"Intersect");function fho(t){return t.anyOf.some(e=>gB(e))}a(fho,"Union");function pho(t){return!gB(t.not)}a(pho,"Not");function gB(t){return t[Tt]==="Intersect"?dho(t):t[Tt]==="Union"?fho(t):t[Tt]==="Not"?pho(t):t[Tt]==="Undefined"}a(gB,"ExtendsUndefinedCheck");p();function rVr(t,e){return Hoe(MW(t),e)}a(rVr,"ExcludeFromTemplateLiteral");function hho(t,e){let r=t.filter(n=>_U(n,e)===Rt.False);return r.length===1?r[0]:tc(r)}a(hho,"ExcludeRest");function Hoe(t,e,r={}){return Q1(t)?wt(rVr(t,e),r):Uu(t)?wt(nVr(t,e),r):wt(Ta(t)?hho(t.anyOf,e):_U(t,e)!==Rt.False?Xo():t,r)}a(Hoe,"Exclude");function mho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Hoe(t[n],e);return r}a(mho,"FromProperties");function gho(t,e){return mho(t.properties,e)}a(gho,"FromMappedResult");function nVr(t,e){let r=gho(t,e);return Qa(r)}a(nVr,"ExcludeFromMappedResult");p();p();p();function iVr(t,e){return Goe(MW(t),e)}a(iVr,"ExtractFromTemplateLiteral");function Aho(t,e){let r=t.filter(n=>_U(n,e)!==Rt.False);return r.length===1?r[0]:tc(r)}a(Aho,"ExtractRest");function Goe(t,e,r){return Q1(t)?wt(iVr(t,e),r):Uu(t)?wt(oVr(t,e),r):wt(Ta(t)?Aho(t.anyOf,e):_U(t,e)!==Rt.False?t:Xo(),r)}a(Goe,"Extract");function yho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Goe(t[n],e);return r}a(yho,"FromProperties");function Eho(t,e){return yho(t.properties,e)}a(Eho,"FromMappedResult");function oVr(t,e){let r=Eho(t,e);return Qa(r)}a(oVr,"ExtractFromMappedResult");p();function sVr(t,e){return Ok(t)?wt(t.returns,e):Xo(e)}a(sVr,"InstanceType");p();p();function uUe(t){return sC(By(t))}a(uUe,"ReadonlyOptional");p();function OW(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(OW,"RecordCreateFromPattern");function HPt(t,e,r){let n={};for(let o of t)n[o]=e;return rc(n,{...r,[jI]:"Record"})}a(HPt,"RecordCreateFromKeys");function _ho(t,e,r){return K9e(t)?HPt(oC(t),e,r):OW(t.pattern,e,r)}a(_ho,"FromTemplateLiteralKey");function vho(t,e,r){return HPt(oC(tc(t)),e,r)}a(vho,"FromUnionKey");function Cho(t,e,r){return HPt([t.toString()],e,r)}a(Cho,"FromLiteralKey");function bho(t,e,r){return OW(t.source,e,r)}a(bho,"FromRegExpKey");function Sho(t,e,r){let n=Bp(t.pattern)?AU:t.pattern;return OW(n,e,r)}a(Sho,"FromStringKey");function Tho(t,e,r){return OW(AU,e,r)}a(Tho,"FromAnyKey");function Iho(t,e,r){return OW(m$r,e,r)}a(Iho,"FromNeverKey");function xho(t,e,r){return rc({true:e,false:e},r)}a(xho,"FromBooleanKey");function who(t,e,r){return OW(gU,e,r)}a(who,"FromIntegerKey");function Rho(t,e,r){return OW(gU,e,r)}a(Rho,"FromNumberKey");function dUe(t,e,r={}){return Ta(t)?vho(t.anyOf,e,r):Q1(t)?_ho(t,e,r):F1(t)?Cho(t.const,e,r):uB(t)?xho(t,e,r):Bk(t)?who(t,e,r):Fk(t)?Rho(t,e,r):CPt(t)?bho(t,e,r):dB(t)?Sho(t,e,r):_Pt(t)?Tho(t,e,r):hU(t)?Iho(t,e,r):Xo(r)}a(dUe,"Record");function fUe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(fUe,"RecordPattern");function aVr(t){let e=fUe(t);return e===AU?C_():e===gU?HI():C_({pattern:e})}a(aVr,"RecordKey");function pUe(t){return t.patternProperties[fUe(t)]}a(pUe,"RecordValue");function kho(t,e){return e.parameters=VCe(t,e.parameters),e.returns=qk(t,e.returns),e}a(kho,"FromConstructor");function Pho(t,e){return e.parameters=VCe(t,e.parameters),e.returns=qk(t,e.returns),e}a(Pho,"FromFunction");function Dho(t,e){return e.allOf=VCe(t,e.allOf),e}a(Dho,"FromIntersect");function Nho(t,e){return e.anyOf=VCe(t,e.anyOf),e}a(Nho,"FromUnion");function Mho(t,e){return Bp(e.items)||(e.items=VCe(t,e.items)),e}a(Mho,"FromTuple");function Oho(t,e){return e.items=qk(t,e.items),e}a(Oho,"FromArray");function Lho(t,e){return e.items=qk(t,e.items),e}a(Lho,"FromAsyncIterator");function Bho(t,e){return e.items=qk(t,e.items),e}a(Bho,"FromIterator");function Fho(t,e){return e.item=qk(t,e.item),e}a(Fho,"FromPromise");function Uho(t,e){let r=Hho(t,e.properties);return{...e,...rc(r)}}a(Uho,"FromObject");function Qho(t,e){let r=qk(t,aVr(e)),n=qk(t,pUe(e)),o=dUe(r,n);return{...e,...o}}a(Qho,"FromRecord");function qho(t,e){return e.index in t?t[e.index]:Qk()}a(qho,"FromArgument");function jho(t,e){let r=woe(e),n=iC(e),o=qk(t,e);return r&&n?uUe(o):r&&!n?sC(o):!r&&n?By(o):o}a(jho,"FromProperty");function Hho(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:jho(t,e[n])}),{})}a(Hho,"FromProperties");function VCe(t,e){return e.map(r=>qk(t,r))}a(VCe,"FromTypes");function qk(t,e){return Ok(e)?kho(t,e):Lk(e)?Pho(t,e):af(e)?Dho(t,e):Ta(e)?Nho(t,e):q1(e)?Mho(t,e):Nk(e)?Oho(t,e):wW(e)?Lho(t,e):kW(e)?Bho(t,e):PW(e)?Fho(t,e):Fp(e)?Uho(t,e):DW(e)?Qho(t,e):vPt(e)?qho(t,e):e}a(qk,"FromType");function cVr(t,e){return qk(e,Ioe(t))}a(cVr,"Instantiate");p();function lVr(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(lVr,"Integer");p();p();p();function Gho(t,e,r){return{[t]:jk(ca(t),e,Bu(r))}}a(Gho,"MappedIntrinsicPropertyKey");function $ho(t,e,r){return t.reduce((o,s)=>({...o,...Gho(s,e,r)}),{})}a($ho,"MappedIntrinsicPropertyKeys");function Vho(t,e,r){return $ho(t.keys,e,r)}a(Vho,"MappedIntrinsicProperties");function uVr(t,e,r){let n=Vho(t,e,r);return Qa(n)}a(uVr,"IntrinsicFromMappedKey");function Who(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Who,"ApplyUncapitalize");function zho(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(zho,"ApplyCapitalize");function Yho(t){return t.toUpperCase()}a(Yho,"ApplyUppercase");function Kho(t){return t.toLowerCase()}a(Kho,"ApplyLowercase");function Jho(t,e,r){let n=Ooe(t.pattern);if(!NW(n))return{...t,pattern:dVr(t.pattern,e)};let c=[...jCe(n)].map(d=>ca(d)),l=fVr(c,e),u=tc(l);return Z9e([u],r)}a(Jho,"FromTemplateLiteral");function dVr(t,e){return typeof t=="string"?e==="Uncapitalize"?Who(t):e==="Capitalize"?zho(t):e==="Uppercase"?Yho(t):e==="Lowercase"?Kho(t):t:t.toString()}a(dVr,"FromLiteralValue");function fVr(t,e){return t.map(r=>jk(r,e))}a(fVr,"FromRest");function jk(t,e,r={}){return U1(t)?uVr(t,e,r):Q1(t)?Jho(t,e,r):Ta(t)?tc(fVr(t.anyOf,e),r):F1(t)?ca(dVr(t.const,e),r):wt(t,r)}a(jk,"Intrinsic");function pVr(t,e={}){return jk(t,"Capitalize",e)}a(pVr,"Capitalize");p();function hVr(t,e={}){return jk(t,"Lowercase",e)}a(hVr,"Lowercase");p();function mVr(t,e={}){return jk(t,"Uncapitalize",e)}a(mVr,"Uncapitalize");p();function gVr(t,e={}){return jk(t,"Uppercase",e)}a(gVr,"Uppercase");p();p();p();p();p();function Zho(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=vU(t[o],e,Bu(r));return n}a(Zho,"FromProperties");function Xho(t,e,r){return Zho(t.properties,e,r)}a(Xho,"FromMappedResult");function AVr(t,e,r){let n=Xho(t,e,r);return Qa(n)}a(AVr,"OmitFromMappedResult");function emo(t,e){return t.map(r=>GPt(r,e))}a(emo,"FromIntersect");function tmo(t,e){return t.map(r=>GPt(r,e))}a(tmo,"FromUnion");function rmo(t,e){let{[e]:r,...n}=t;return n}a(rmo,"FromProperty");function nmo(t,e){return e.reduce((r,n)=>rmo(r,n),t)}a(nmo,"FromProperties");function imo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=nmo(r,e);return rc(o,n)}a(imo,"FromObject");function omo(t){let e=t.reduce((r,n)=>W9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(omo,"UnionFromPropertyKeys");function GPt(t,e){return af(t)?Fy(emo(t.allOf,e)):Ta(t)?tc(tmo(t.anyOf,e)):Fp(t)?imo(t,e,t.properties):rc({})}a(GPt,"OmitResolve");function vU(t,e,r){let n=Lp(e)?omo(e):e,o=Rd(e)?oC(e):e,s=jf(t),c=jf(e);return Uu(t)?AVr(t,o,r):U1(e)?yVr(t,e,r):s&&c?au("Omit",[t,n],r):!s&&c?au("Omit",[t,n],r):s&&!c?au("Omit",[t,n],r):wt({...GPt(t,o),...r})}a(vU,"Omit");function smo(t,e,r){return{[e]:vU(t,[e],Bu(r))}}a(smo,"FromPropertyKey");function amo(t,e,r){return e.reduce((n,o)=>({...n,...smo(t,o,r)}),{})}a(amo,"FromPropertyKeys");function cmo(t,e,r){return amo(t,e.keys,r)}a(cmo,"FromMappedKey");function yVr(t,e,r){let n=cmo(t,e,r);return Qa(n)}a(yVr,"OmitFromMappedKey");p();p();p();function lmo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=CU(t[o],e,Bu(r));return n}a(lmo,"FromProperties");function umo(t,e,r){return lmo(t.properties,e,r)}a(umo,"FromMappedResult");function EVr(t,e,r){let n=umo(t,e,r);return Qa(n)}a(EVr,"PickFromMappedResult");function dmo(t,e){return t.map(r=>$Pt(r,e))}a(dmo,"FromIntersect");function fmo(t,e){return t.map(r=>$Pt(r,e))}a(fmo,"FromUnion");function pmo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(pmo,"FromProperties");function hmo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=pmo(r,e);return rc(o,n)}a(hmo,"FromObject");function mmo(t){let e=t.reduce((r,n)=>W9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(mmo,"UnionFromPropertyKeys");function $Pt(t,e){return af(t)?Fy(dmo(t.allOf,e)):Ta(t)?tc(fmo(t.anyOf,e)):Fp(t)?hmo(t,e,t.properties):rc({})}a($Pt,"PickResolve");function CU(t,e,r){let n=Lp(e)?mmo(e):e,o=Rd(e)?oC(e):e,s=jf(t),c=jf(e);return Uu(t)?EVr(t,o,r):U1(e)?_Vr(t,e,r):s&&c?au("Pick",[t,n],r):!s&&c?au("Pick",[t,n],r):s&&!c?au("Pick",[t,n],r):wt({...$Pt(t,o),...r})}a(CU,"Pick");function gmo(t,e,r){return{[e]:CU(t,[e],Bu(r))}}a(gmo,"FromPropertyKey");function Amo(t,e,r){return e.reduce((n,o)=>({...n,...gmo(t,o,r)}),{})}a(Amo,"FromPropertyKeys");function ymo(t,e,r){return Amo(t,e.keys,r)}a(ymo,"FromMappedKey");function _Vr(t,e,r){let n=ymo(t,e,r);return Qa(n)}a(_Vr,"PickFromMappedKey");p();p();function Emo(t,e){return au("Partial",[au(t,e)])}a(Emo,"FromComputed");function _mo(t){return au("Partial",[VI(t)])}a(_mo,"FromRef");function vmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=By(t[r]);return e}a(vmo,"FromProperties");function Cmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=vmo(e);return rc(n,r)}a(Cmo,"FromObject");function vVr(t){return t.map(e=>CVr(e))}a(vVr,"FromRest");function CVr(t){return Mk(t)?Emo(t.target,t.parameters):jf(t)?_mo(t.$ref):af(t)?Fy(vVr(t.allOf)):Ta(t)?tc(vVr(t.anyOf)):Fp(t)?Cmo(t,t.properties):RW(t)||uB(t)||Bk(t)||F1(t)||OCe(t)||Fk(t)||dB(t)||LCe(t)||fB(t)?t:rc({})}a(CVr,"PartialResolve");function $oe(t,e){return Uu(t)?bVr(t,e):wt({...CVr(t),...e})}a($oe,"Partial");function bmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=$oe(t[n],Bu(e));return r}a(bmo,"FromProperties");function Smo(t,e){return bmo(t.properties,e)}a(Smo,"FromMappedResult");function bVr(t,e){let r=Smo(t,e);return Qa(r)}a(bVr,"PartialFromMappedResult");p();p();function Tmo(t,e){return au("Required",[au(t,e)])}a(Tmo,"FromComputed");function Imo(t){return au("Required",[VI(t)])}a(Imo,"FromRef");function xmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=cf(t[r],[hA]);return e}a(xmo,"FromProperties");function wmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=xmo(e);return rc(n,r)}a(wmo,"FromObject");function SVr(t){return t.map(e=>TVr(e))}a(SVr,"FromRest");function TVr(t){return Mk(t)?Tmo(t.target,t.parameters):jf(t)?Imo(t.$ref):af(t)?Fy(SVr(t.allOf)):Ta(t)?tc(SVr(t.anyOf)):Fp(t)?wmo(t,t.properties):RW(t)||uB(t)||Bk(t)||F1(t)||OCe(t)||Fk(t)||dB(t)||LCe(t)||fB(t)?t:rc({})}a(TVr,"RequiredResolve");function Voe(t,e){return Uu(t)?IVr(t,e):wt({...TVr(t),...e})}a(Voe,"Required");function Rmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Voe(t[n],e);return r}a(Rmo,"FromProperties");function kmo(t,e){return Rmo(t.properties,e)}a(kmo,"FromMappedResult");function IVr(t,e){let r=kmo(t,e);return Qa(r)}a(IVr,"RequiredFromMappedResult");function Pmo(t,e){return e.map(r=>jf(r)?VPt(t,r.$ref):j1(t,r))}a(Pmo,"DereferenceParameters");function VPt(t,e){return e in t?jf(t[e])?VPt(t,t[e].$ref):j1(t,t[e]):Xo()}a(VPt,"Dereference");function Dmo(t){return Uoe(t[0])}a(Dmo,"FromAwaited");function Nmo(t){return EU(t[0],t[1])}a(Nmo,"FromIndex");function Mmo(t){return Qoe(t[0])}a(Mmo,"FromKeyOf");function Omo(t){return $oe(t[0])}a(Omo,"FromPartial");function Lmo(t){return vU(t[0],t[1])}a(Lmo,"FromOmit");function Bmo(t){return CU(t[0],t[1])}a(Bmo,"FromPick");function Fmo(t){return Voe(t[0])}a(Fmo,"FromRequired");function Umo(t,e,r){let n=Pmo(t,r);return e==="Awaited"?Dmo(n):e==="Index"?Nmo(n):e==="KeyOf"?Mmo(n):e==="Partial"?Omo(n):e==="Omit"?Lmo(n):e==="Pick"?Bmo(n):e==="Required"?Fmo(n):Xo()}a(Umo,"FromComputed");function Qmo(t,e){return Poe(j1(t,e))}a(Qmo,"FromArray");function qmo(t,e){return Doe(j1(t,e))}a(qmo,"FromAsyncIterator");function jmo(t,e,r){return Noe(WCe(t,e),j1(t,r))}a(jmo,"FromConstructor");function Hmo(t,e,r){return tM(WCe(t,e),j1(t,r))}a(Hmo,"FromFunction");function Gmo(t,e){return Fy(WCe(t,e))}a(Gmo,"FromIntersect");function $mo(t,e){return Foe(j1(t,e))}a($mo,"FromIterator");function Vmo(t,e){return rc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:j1(t,e[n])}),{}))}a(Vmo,"FromObject");function Wmo(t,e){let[r,n]=[j1(t,pUe(e)),fUe(e)],o=Ioe(e);return o.patternProperties[n]=r,o}a(Wmo,"FromRecord");function zmo(t,e){return jf(e)?{...VPt(t,e.$ref),[wd]:e[wd]}:e}a(zmo,"FromTransform");function Ymo(t,e){return GI(WCe(t,e))}a(Ymo,"FromTuple");function Kmo(t,e){return tc(WCe(t,e))}a(Kmo,"FromUnion");function WCe(t,e){return e.map(r=>j1(t,r))}a(WCe,"FromTypes");function j1(t,e){return iC(e)?wt(j1(t,cf(e,[hA])),e):woe(e)?wt(j1(t,cf(e,[Dk])),e):ec(e)?wt(zmo(t,e),e):Nk(e)?wt(Qmo(t,e.items),e):wW(e)?wt(qmo(t,e.items),e):Mk(e)?wt(Umo(t,e.target,e.parameters)):Ok(e)?wt(jmo(t,e.parameters,e.returns),e):Lk(e)?wt(Hmo(t,e.parameters,e.returns),e):af(e)?wt(Gmo(t,e.allOf),e):kW(e)?wt($mo(t,e.items),e):Fp(e)?wt(Vmo(t,e.properties),e):DW(e)?wt(Wmo(t,e)):q1(e)?wt(Ymo(t,e.items||[]),e):Ta(e)?wt(Kmo(t,e.anyOf),e):e}a(j1,"FromType");function Jmo(t,e){return e in t?j1(t,t[e]):Xo()}a(Jmo,"ComputeType");function xVr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Jmo(t,r)}),{})}a(xVr,"ComputeModuleProperties");var WPt=class{static{a(this,"TModule")}constructor(e){let r=xVr(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 wVr(t){return new WPt(t)}a(wVr,"Module");p();function RVr(t,e){return wt({[Tt]:"Not",not:t},e)}a(RVr,"Not");p();function kVr(t,e){return Lk(t)?GI(t.parameters,e):Xo()}a(kVr,"Parameters");p();var Zmo=0;function PVr(t,e={}){Bp(e.$id)&&(e.$id=`T${Zmo++}`);let r=Ioe(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[jI]:"Recursive",...r},e)}a(PVr,"Recursive");p();function DVr(t,e){let r=Ql(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(DVr,"RegExp");p();function Xmo(t){return af(t)?t.allOf:Ta(t)?t.anyOf:q1(t)?t.items??[]:[]}a(Xmo,"RestResolve");function NVr(t){return Xmo(t)}a(NVr,"Rest");p();function MVr(t,e){return Lk(t)?wt(t.returns,e):Xo(e)}a(MVr,"ReturnType");p();var zPt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new YPt(this.schema,e)}},YPt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[wd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[wd].Decode(c)),"Decode")};return{...r,[wd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[wd]:n}}Encode(e){return ec(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function OVr(t){return new zPt(t)}a(OVr,"Transform");p();function LVr(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(LVr,"Unsafe");p();function BVr(t){return wt({[Tt]:"Void",type:"void"},t)}a(BVr,"Void");p();var KPt={};ki(KPt,{Any:()=>yU,Argument:()=>_$r,Array:()=>Poe,AsyncIterator:()=>Doe,Awaited:()=>Uoe,BigInt:()=>Boe,Boolean:()=>J9e,Capitalize:()=>pVr,Composite:()=>U$r,Const:()=>Q$r,Constructor:()=>Noe,ConstructorParameters:()=>q$r,Date:()=>rUe,Enum:()=>j$r,Exclude:()=>Hoe,Extends:()=>joe,Extract:()=>Goe,Function:()=>tM,Index:()=>EU,InstanceType:()=>sVr,Instantiate:()=>cVr,Integer:()=>lVr,Intersect:()=>Fy,Iterator:()=>Foe,KeyOf:()=>Qoe,Literal:()=>ca,Lowercase:()=>hVr,Mapped:()=>N$r,Module:()=>wVr,Never:()=>Xo,Not:()=>RVr,Null:()=>nUe,Number:()=>HI,Object:()=>rc,Omit:()=>vU,Optional:()=>By,Parameters:()=>kVr,Partial:()=>$oe,Pick:()=>CU,Promise:()=>eUe,Readonly:()=>sC,ReadonlyOptional:()=>uUe,Record:()=>dUe,Recursive:()=>PVr,Ref:()=>VI,RegExp:()=>DVr,Required:()=>Voe,Rest:()=>NVr,ReturnType:()=>MVr,String:()=>C_,Symbol:()=>iUe,TemplateLiteral:()=>Z9e,Transform:()=>OVr,Tuple:()=>GI,Uint8Array:()=>sUe,Uncapitalize:()=>mVr,Undefined:()=>oUe,Union:()=>tc,Unknown:()=>Qk,Unsafe:()=>LVr,Uppercase:()=>gVr,Void:()=>BVr});p();var S=KPt;p();p();function e0o(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(e0o,"DefaultErrorFunction");var t0o=e0o;function FVr(){return t0o}a(FVr,"GetErrorFunction");p();var JPt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function r0o(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new JPt(t);return Ia(r,e)}a(r0o,"Resolve");function Y0(t,e){return!Sa(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Y0,"Pushref");function Ia(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?r0o(t,e):t}a(Ia,"Deref");p();var ZPt=class extends qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},H1;(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"})(H1||(H1={}));var Woe=BigInt("14695981039346656037"),[n0o,i0o]=[BigInt("1099511628211"),BigInt("18446744073709551616")],o0o=Array.from({length:256}).map((t,e)=>BigInt(e)),UVr=new Float64Array(1),QVr=new DataView(UVr.buffer),qVr=new Uint8Array(UVr.buffer);function*s0o(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(s0o,"NumberToBytes");function a0o(t){Qy(H1.Array);for(let e of t)zoe(e)}a(a0o,"ArrayType");function c0o(t){Qy(H1.Boolean),Qy(t?1:0)}a(c0o,"BooleanType");function l0o(t){Qy(H1.BigInt),QVr.setBigInt64(0,t);for(let e of qVr)Qy(e)}a(l0o,"BigIntType");function u0o(t){Qy(H1.Date),zoe(t.getTime())}a(u0o,"DateType");function d0o(t){Qy(H1.Null)}a(d0o,"NullType");function f0o(t){Qy(H1.Number),QVr.setFloat64(0,t);for(let e of qVr)Qy(e)}a(f0o,"NumberType");function p0o(t){Qy(H1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())zoe(e),zoe(t[e])}a(p0o,"ObjectType");function h0o(t){Qy(H1.String);for(let e=0;e=t.minItems)||zs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!K0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=bU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(zs(t.contains)||ai(t.minContains)||ai(t.maxContains)))return!0;let n=zs(t.contains)?t.contains:Xo(),o=r.reduce((s,c)=>K0(n,e,c)?s+1:s,0);return!(o===0||ai(t.minContains)&&ot.maxContains)}a(v0o,"FromArray");function C0o(t,e,r){return H9e(r)}a(C0o,"FromAsyncIterator");function b0o(t,e,r){return!(!pA(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(b0o,"FromBigInt");function S0o(t,e,r){return eM(r)}a(S0o,"FromBoolean");function T0o(t,e,r){return K0(t.returns,e,r.prototype)}a(T0o,"FromConstructor");function I0o(t,e,r){return!(!__(r)||zs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||zs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||zs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||zs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(I0o,"FromDate");function x0o(t,e,r){return pU(r)}a(x0o,"FromFunction");function w0o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return K0(o,[...e,...n],r)}a(w0o,"FromImport");function R0o(t,e,r){return!(!V9e(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(R0o,"FromInteger");function k0o(t,e,r){let n=t.allOf.every(o=>K0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Rd(t.unevaluatedProperties)){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||K0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(k0o,"FromIntersect");function P0o(t,e,r){return G9e(r)}a(P0o,"FromIterator");function D0o(t,e,r){return r===t.const}a(D0o,"FromLiteral");function N0o(t,e,r){return!1}a(N0o,"FromNever");function M0o(t,e,r){return!K0(t.not,e,r)}a(M0o,"FromNot");function O0o(t,e,r){return cB(r)}a(O0o,"FromNull");function L0o(t,e,r){return!(!su.IsNumberLike(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(L0o,"FromNumber");function B0o(t,e,r){if(!su.IsObjectLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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(!K0(s,e,r[o])||(gB(s)||y0o(s))&&!(o in r))return!1}else if(su.IsExactOptionalProperty(r,o)&&!K0(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)||K0(t.additionalProperties,e,r[s])):!0}a(B0o,"FromObject");function F0o(t,e,r){return $9e(r)}a(F0o,"FromPromise");function U0o(t,e,r){if(!su.IsRecordLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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)?K0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:K0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(U0o,"FromRecord");function Q0o(t,e,r){return K0(Ia(t,e),e,r)}a(Q0o,"FromRef");function q0o(t,e,r){let n=new RegExp(t.source,t.flags);return zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(q0o,"FromRegExp");function j0o(t,e,r){return!Sa(r)||zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)||zs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:zs(t.format)?Uk.Has(t.format)?Uk.Get(t.format)(r):!1:!0}a(j0o,"FromString");function H0o(t,e,r){return lB(r)}a(H0o,"FromSymbol");function G0o(t,e,r){return Sa(r)&&new RegExp(t.pattern).test(r)}a(G0o,"FromTemplateLiteral");function $0o(t,e,r){return K0(Ia(t,e),e,r)}a($0o,"FromThis");function V0o(t,e,r){if(!Pi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nK0(n,e,r))}a(z0o,"FromUnion");function Y0o(t,e,r){return!(!xoe(r)||zs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||zs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Y0o,"FromUint8Array");function K0o(t,e,r){return!0}a(K0o,"FromUnknown");function J0o(t,e,r){return su.IsVoidLike(r)}a(J0o,"FromVoid");function Z0o(t,e,r){return v_.Has(t[Tt])?v_.Get(t[Tt])(t,r):!1}a(Z0o,"FromKind");function K0(t,e,r){let n=zs(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Any":return E0o(o,n,r);case"Argument":return _0o(o,n,r);case"Array":return v0o(o,n,r);case"AsyncIterator":return C0o(o,n,r);case"BigInt":return b0o(o,n,r);case"Boolean":return S0o(o,n,r);case"Constructor":return T0o(o,n,r);case"Date":return I0o(o,n,r);case"Function":return x0o(o,n,r);case"Import":return w0o(o,n,r);case"Integer":return R0o(o,n,r);case"Intersect":return k0o(o,n,r);case"Iterator":return P0o(o,n,r);case"Literal":return D0o(o,n,r);case"Never":return N0o(o,n,r);case"Not":return M0o(o,n,r);case"Null":return O0o(o,n,r);case"Number":return L0o(o,n,r);case"Object":return B0o(o,n,r);case"Promise":return F0o(o,n,r);case"Record":return U0o(o,n,r);case"Ref":return Q0o(o,n,r);case"RegExp":return q0o(o,n,r);case"String":return j0o(o,n,r);case"Symbol":return H0o(o,n,r);case"TemplateLiteral":return G0o(o,n,r);case"This":return $0o(o,n,r);case"Tuple":return V0o(o,n,r);case"Undefined":return W0o(o,n,r);case"Union":return z0o(o,n,r);case"Uint8Array":return Y0o(o,n,r);case"Unknown":return K0o(o,n,r);case"Void":return J0o(o,n,r);default:if(!v_.Has(o[Tt]))throw new XPt(o);return Z0o(o,n,r)}}a(K0,"Visit");function es(...t){return t.length===3?K0(t[0],t[1],t[2]):K0(t[0],[],t[1])}a(es,"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 e2t=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function AB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(AB,"EscapeKey");function Ys(t){return t!==void 0}a(Ys,"IsDefined");var SU=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 sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:FVr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*X0o(t,e,r,n){}a(X0o,"FromAny");function*ego(t,e,r,n){}a(ego,"FromArgument");function*tgo(t,e,r,n){if(!Pi(n))return yield sn(St.Array,t,r,n);Ys(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(St.ArrayMinItems,t,r,n)),Ys(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(St.ArrayMaxItems,t,r,n));for(let c=0;cJ0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(St.ArrayContains,t,r,n)),ai(t.minContains)&&st.maxContains&&(yield sn(St.ArrayMaxContains,t,r,n))}a(tgo,"FromArray");function*rgo(t,e,r,n){H9e(n)||(yield sn(St.AsyncIterator,t,r,n))}a(rgo,"FromAsyncIterator");function*ngo(t,e,r,n){if(!pA(n))return yield sn(St.BigInt,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.BigIntExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.BigIntMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.BigIntMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(St.BigIntMultipleOf,t,r,n))}a(ngo,"FromBigInt");function*igo(t,e,r,n){eM(n)||(yield sn(St.Boolean,t,r,n))}a(igo,"FromBoolean");function*ogo(t,e,r,n){yield*J0(t.returns,e,r,n.prototype)}a(ogo,"FromConstructor");function*sgo(t,e,r,n){if(!__(n))return yield sn(St.Date,t,r,n);Ys(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(St.DateExclusiveMinimumTimestamp,t,r,n)),Ys(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(St.DateMaximumTimestamp,t,r,n)),Ys(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(St.DateMinimumTimestamp,t,r,n)),Ys(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(St.DateMultipleOfTimestamp,t,r,n))}a(sgo,"FromDate");function*ago(t,e,r,n){pU(n)||(yield sn(St.Function,t,r,n))}a(ago,"FromFunction");function*cgo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*J0(s,[...e,...o],r,n)}a(cgo,"FromImport");function*lgo(t,e,r,n){if(!V9e(n))return yield sn(St.Integer,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.IntegerExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.IntegerMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.IntegerMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.IntegerMultipleOf,t,r,n))}a(lgo,"FromInteger");function*ugo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of J0(s,e,r,n))o=!0,yield c;if(o)return yield sn(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=J0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(ugo,"FromIntersect");function*dgo(t,e,r,n){G9e(n)||(yield sn(St.Iterator,t,r,n))}a(dgo,"FromIterator");function*fgo(t,e,r,n){n!==t.const&&(yield sn(St.Literal,t,r,n))}a(fgo,"FromLiteral");function*pgo(t,e,r,n){yield sn(St.Never,t,r,n)}a(pgo,"FromNever");function*hgo(t,e,r,n){J0(t.not,e,r,n).next().done===!0&&(yield sn(St.Not,t,r,n))}a(hgo,"FromNot");function*mgo(t,e,r,n){cB(n)||(yield sn(St.Null,t,r,n))}a(mgo,"FromNull");function*ggo(t,e,r,n){if(!su.IsNumberLike(n))return yield sn(St.Number,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.NumberExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.NumberMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.NumberMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.NumberMultipleOf,t,r,n))}a(ggo,"FromNumber");function*Ago(t,e,r,n){if(!su.IsObjectLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(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 sn(St.ObjectRequiredProperty,t.properties[l],`${r}/${AB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*J0(u,e,`${r}/${AB(l)}`,n[l]),gB(t)&&!(l in n)&&(yield sn(St.ObjectRequiredProperty,u,`${r}/${AB(l)}`,void 0))):su.IsExactOptionalProperty(n,l)&&(yield*J0(u,e,`${r}/${AB(l)}`,n[l]))}}a(Ago,"FromObject");function*ygo(t,e,r,n){$9e(n)||(yield sn(St.Promise,t,r,n))}a(ygo,"FromPromise");function*Ego(t,e,r,n){if(!su.IsRecordLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(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*J0(s,e,`${r}/${AB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,u)}}a(Ego,"FromRecord");function*_go(t,e,r,n){yield*J0(Ia(t,e),e,r,n)}a(_go,"FromRef");function*vgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);if(Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(St.RegExp,t,r,n)}a(vgo,"FromRegExp");function*Cgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),Sa(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))),Sa(t.format)&&(Uk.Has(t.format)?Uk.Get(t.format)(n)||(yield sn(St.StringFormat,t,r,n)):yield sn(St.StringFormatUnknown,t,r,n))}a(Cgo,"FromString");function*bgo(t,e,r,n){lB(n)||(yield sn(St.Symbol,t,r,n))}a(bgo,"FromSymbol");function*Sgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))}a(Sgo,"FromTemplateLiteral");function*Tgo(t,e,r,n){yield*J0(Ia(t,e),e,r,n)}a(Tgo,"FromThis");function*Igo(t,e,r,n){if(!Pi(n))return yield sn(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew SU(J0(s,e,r,n)));yield sn(St.Union,t,r,n,o)}a(wgo,"FromUnion");function*Rgo(t,e,r,n){if(!xoe(n))return yield sn(St.Uint8Array,t,r,n);Ys(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(St.Uint8ArrayMaxByteLength,t,r,n)),Ys(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(St.Uint8ArrayMinByteLength,t,r,n))}a(Rgo,"FromUint8Array");function*kgo(t,e,r,n){}a(kgo,"FromUnknown");function*Pgo(t,e,r,n){su.IsVoidLike(n)||(yield sn(St.Void,t,r,n))}a(Pgo,"FromVoid");function*Dgo(t,e,r,n){v_.Get(t[Tt])(t,n)||(yield sn(St.Kind,t,r,n))}a(Dgo,"FromKind");function*J0(t,e,r,n){let o=Ys(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*X0o(s,o,r,n);case"Argument":return yield*ego(s,o,r,n);case"Array":return yield*tgo(s,o,r,n);case"AsyncIterator":return yield*rgo(s,o,r,n);case"BigInt":return yield*ngo(s,o,r,n);case"Boolean":return yield*igo(s,o,r,n);case"Constructor":return yield*ogo(s,o,r,n);case"Date":return yield*sgo(s,o,r,n);case"Function":return yield*ago(s,o,r,n);case"Import":return yield*cgo(s,o,r,n);case"Integer":return yield*lgo(s,o,r,n);case"Intersect":return yield*ugo(s,o,r,n);case"Iterator":return yield*dgo(s,o,r,n);case"Literal":return yield*fgo(s,o,r,n);case"Never":return yield*pgo(s,o,r,n);case"Not":return yield*hgo(s,o,r,n);case"Null":return yield*mgo(s,o,r,n);case"Number":return yield*ggo(s,o,r,n);case"Object":return yield*Ago(s,o,r,n);case"Promise":return yield*ygo(s,o,r,n);case"Record":return yield*Ego(s,o,r,n);case"Ref":return yield*_go(s,o,r,n);case"RegExp":return yield*vgo(s,o,r,n);case"String":return yield*Cgo(s,o,r,n);case"Symbol":return yield*bgo(s,o,r,n);case"TemplateLiteral":return yield*Sgo(s,o,r,n);case"This":return yield*Tgo(s,o,r,n);case"Tuple":return yield*Igo(s,o,r,n);case"Undefined":return yield*xgo(s,o,r,n);case"Union":return yield*wgo(s,o,r,n);case"Uint8Array":return yield*Rgo(s,o,r,n);case"Unknown":return yield*kgo(s,o,r,n);case"Void":return yield*Pgo(s,o,r,n);default:if(!v_.Has(s[Tt]))throw new e2t(t);return yield*Dgo(s,o,r,n)}}a(J0,"Visit");function nM(...t){let e=t.length===3?J0(t[0],t[1],"",t[2]):J0(t[0],[],"",t[1]);return new SU(e)}a(nM,"Errors");p();p();var Yoe=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}},t2t=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 kd(t,e,r){try{return ec(t)?t[wd].Decode(r):r}catch(n){throw new t2t(t,e,r,n)}}a(kd,"Default");function Ngo(t,e,r,n){return Pi(n)?kd(t,r,n.map((o,s)=>Hk(t.items,e,`${r}/${s}`,o))):kd(t,r,n)}a(Ngo,"FromArray");function Mgo(t,e,r,n){if(!bo(n)||B1(n))return kd(t,r,n);let o=tUe(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=Hk(h,e,`${r}/${f}`,c[f]));if(!ec(t.unevaluatedProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Mgo,"FromIntersect");function Ogo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Hk(s,[...e,...o],r,n);return kd(t,r,c)}a(Ogo,"FromImport");function Lgo(t,e,r,n){return kd(t,r,Hk(t.not,e,r,n))}a(Lgo,"FromNot");function Bgo(t,e,r,n){if(!bo(n))return kd(t,r,n);let o=aC(t),s={...n};for(let d of o)Qi(s,d)&&(Fu(s[d])&&(!fB(t.properties[d])||su.IsExactOptionalProperty(s,d))||(s[d]=Hk(t.properties[d],e,`${r}/${d}`,s[d])));if(!Rd(t.additionalProperties))return kd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=kd(l,`${r}/${d}`,u[d]));return kd(t,r,u)}a(Bgo,"FromObject");function Fgo(t,e,r,n){if(!bo(n))return kd(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]=Hk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Rd(t.additionalProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Fgo,"FromRecord");function Ugo(t,e,r,n){let o=Ia(t,e);return kd(t,r,Hk(o,e,r,n))}a(Ugo,"FromRef");function Qgo(t,e,r,n){let o=Ia(t,e);return kd(t,r,Hk(o,e,r,n))}a(Qgo,"FromThis");function qgo(t,e,r,n){return Pi(n)&&Pi(t.items)?kd(t,r,t.items.map((o,s)=>Hk(o,e,`${r}/${s}`,n[s]))):kd(t,r,n)}a(qgo,"FromTuple");function jgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Hk(o,e,r,n);return kd(t,r,s)}return kd(t,r,n)}a(jgo,"FromUnion");function Hk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Ngo(s,o,r,n);case"Import":return Ogo(s,o,r,n);case"Intersect":return Mgo(s,o,r,n);case"Not":return Lgo(s,o,r,n);case"Object":return Bgo(s,o,r,n);case"Record":return Fgo(s,o,r,n);case"Ref":return Ugo(s,o,r,n);case"Symbol":return kd(s,r,n);case"This":return Qgo(s,o,r,n);case"Tuple":return qgo(s,o,r,n);case"Union":return jgo(s,o,r,n);default:return kd(s,r,n)}}a(Hk,"Visit");function Koe(t,e,r){return Hk(t,e,"",r)}a(Koe,"TransformDecode");p();var Joe=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}},r2t=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 mA(t,e,r){try{return ec(t)?t[wd].Encode(r):r}catch(n){throw new r2t(t,e,r,n)}}a(mA,"Default");function Hgo(t,e,r,n){let o=mA(t,r,n);return Pi(o)?o.map((s,c)=>Gk(t.items,e,`${r}/${c}`,s)):o}a(Hgo,"FromArray");function Ggo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=mA(t,r,n);return Gk(s,[...e,...o],r,c)}a(Ggo,"FromImport");function $go(t,e,r,n){let o=mA(t,r,n);if(!bo(n)||B1(n))return o;let s=tUe(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Gk(m,e,`${r}/${h}`,l[h]));if(!ec(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a($go,"FromIntersect");function Vgo(t,e,r,n){return mA(t.not,r,mA(t,r,n))}a(Vgo,"FromNot");function Wgo(t,e,r,n){let o=mA(t,r,n);if(!bo(o))return o;let s=aC(t),c={...o};for(let f of s)Qi(c,f)&&(Fu(c[f])&&(!fB(t.properties[f])||su.IsExactOptionalProperty(c,f))||(c[f]=Gk(t.properties[f],e,`${r}/${f}`,c[f])));if(!Rd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=mA(u,`${r}/${f}`,d[f]));return d}a(Wgo,"FromObject");function zgo(t,e,r,n){let o=mA(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]=Gk(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Rd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a(zgo,"FromRecord");function Ygo(t,e,r,n){let o=Ia(t,e),s=Gk(o,e,r,n);return mA(t,r,s)}a(Ygo,"FromRef");function Kgo(t,e,r,n){let o=Ia(t,e),s=Gk(o,e,r,n);return mA(t,r,s)}a(Kgo,"FromThis");function Jgo(t,e,r,n){let o=mA(t,r,n);return Pi(t.items)?t.items.map((s,c)=>Gk(s,e,`${r}/${c}`,o[c])):[]}a(Jgo,"FromTuple");function Zgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Gk(o,e,r,n);return mA(t,r,s)}for(let o of t.anyOf){let s=Gk(o,e,r,n);if(es(t,e,s))return mA(t,r,s)}return mA(t,r,n)}a(Zgo,"FromUnion");function Gk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Hgo(s,o,r,n);case"Import":return Ggo(s,o,r,n);case"Intersect":return $go(s,o,r,n);case"Not":return Vgo(s,o,r,n);case"Object":return Wgo(s,o,r,n);case"Record":return zgo(s,o,r,n);case"Ref":return Ygo(s,o,r,n);case"This":return Kgo(s,o,r,n);case"Tuple":return Jgo(s,o,r,n);case"Union":return Zgo(s,o,r,n);default:return mA(s,r,n)}}a(Gk,"Visit");function Zoe(t,e,r){return Gk(t,e,"",r)}a(Zoe,"TransformEncode");p();function Xgo(t,e){return ec(t)||Hm(t.items,e)}a(Xgo,"FromArray");function eAo(t,e){return ec(t)||Hm(t.items,e)}a(eAo,"FromAsyncIterator");function tAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(tAo,"FromConstructor");function rAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(rAo,"FromFunction");function nAo(t,e){return ec(t)||ec(t.unevaluatedProperties)||t.allOf.some(r=>Hm(r,e))}a(nAo,"FromIntersect");function iAo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return ec(t)||Hm(n,[...r,...e])}a(iAo,"FromImport");function oAo(t,e){return ec(t)||Hm(t.items,e)}a(oAo,"FromIterator");function sAo(t,e){return ec(t)||Hm(t.not,e)}a(sAo,"FromNot");function aAo(t,e){return ec(t)||Object.values(t.properties).some(r=>Hm(r,e))||Rd(t.additionalProperties)&&Hm(t.additionalProperties,e)}a(aAo,"FromObject");function cAo(t,e){return ec(t)||Hm(t.item,e)}a(cAo,"FromPromise");function lAo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return ec(t)||Hm(n,e)||Rd(t.additionalProperties)&&ec(t.additionalProperties)}a(lAo,"FromRecord");function uAo(t,e){return ec(t)?!0:Hm(Ia(t,e),e)}a(uAo,"FromRef");function dAo(t,e){return ec(t)?!0:Hm(Ia(t,e),e)}a(dAo,"FromThis");function fAo(t,e){return ec(t)||!Fu(t.items)&&t.items.some(r=>Hm(r,e))}a(fAo,"FromTuple");function pAo(t,e){return ec(t)||t.anyOf.some(r=>Hm(r,e))}a(pAo,"FromUnion");function Hm(t,e){let r=Y0(t,e),n=t;if(t.$id&&n2t.has(t.$id))return!1;switch(t.$id&&n2t.add(t.$id),t[Tt]){case"Array":return Xgo(n,r);case"AsyncIterator":return eAo(n,r);case"Constructor":return tAo(n,r);case"Function":return rAo(n,r);case"Import":return iAo(n,r);case"Intersect":return nAo(n,r);case"Iterator":return oAo(n,r);case"Not":return sAo(n,r);case"Object":return aAo(n,r);case"Promise":return cAo(n,r);case"Record":return lAo(n,r);case"Ref":return uAo(n,r);case"This":return dAo(n,r);case"Tuple":return fAo(n,r);case"Union":return pAo(n,r);default:return ec(t)}}a(Hm,"Visit");var n2t=new Set;function yB(t,e){return n2t.clear(),Hm(t,e)}a(yB,"HasTransform");var i2t=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=yB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return nM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Yoe(this.schema,e,this.Errors(e).First());return this.hasTransform?Koe(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Zoe(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Joe(this.schema,e,this.Errors(e).First());return r}},EB;(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})(EB||(EB={}));var hUe;(function(t){function e(s){return s.length===0?!1:EB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${X.minItems}`);let ue=z(X.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${ue})) { return false }; return true; })(${K})`,Qu(X.contains)||ai(X.minContains)||ai(X.maxContains)){let qe=Qu(X.contains)?X.contains:Xo(),ne=z(qe,ee,"value"),ce=ai(X.minContains)?[`(count >= ${X.minContains})`]:[],Ne=ai(X.maxContains)?[`(count <= ${X.maxContains})`]:[],we=`const count = value.reduce((${Z}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...ce,...Ne].join(" && ");yield`((${he}) => { ${we}; return ${Be}})(${K})`}X.uniqueItems===!0&&(yield`((${he}) => { 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(X,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(X,ee,K){yield`(typeof ${K} === 'bigint')`,pA(X.exclusiveMaximum)&&(yield`${K} < BigInt(${X.exclusiveMaximum})`),pA(X.exclusiveMinimum)&&(yield`${K} > BigInt(${X.exclusiveMinimum})`),pA(X.maximum)&&(yield`${K} <= BigInt(${X.maximum})`),pA(X.minimum)&&(yield`${K} >= BigInt(${X.minimum})`),pA(X.multipleOf)&&(yield`(${K} % BigInt(${X.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(X,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(X,ee,K){yield*W(X.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(X,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ai(X.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${X.exclusiveMaximumTimestamp}`),ai(X.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${X.exclusiveMinimumTimestamp}`),ai(X.maximumTimestamp)&&(yield`${K}.getTime() <= ${X.maximumTimestamp}`),ai(X.minimumTimestamp)&&(yield`${K}.getTime() >= ${X.minimumTimestamp}`),ai(X.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${X.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(X,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(X,ee,K){let he=globalThis.Object.getOwnPropertyNames(X.$defs).reduce((Z,ue)=>[...Z,X.$defs[ue]],[]);yield*W(VI(X.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(X,ee,K){yield`Number.isInteger(${K})`,ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(m,"FromInteger");function*g(X,ee,K){let he=X.allOf.map(Z=>z(Z,ee,K)).join(" && ");if(X.unevaluatedProperties===!1){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key))`;yield`(${he} && ${ue})`}else if(Qu(X.unevaluatedProperties)){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key) || ${z(X.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${ue})`}else yield`(${he})`}a(g,"FromIntersect");function*A(X,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(X,ee,K){typeof X.const=="number"||typeof X.const=="boolean"?yield`(${K} === ${X.const})`:yield`(${K} === '${s2t.Escape(X.const)}')`}a(y,"FromLiteral");function*E(X,ee,K){yield"false"}a(E,"FromNever");function*_(X,ee,K){yield`(!${z(X.not,ee,K)})`}a(_,"FromNot");function*v(X,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(X,ee,K){yield LW.IsNumberLike(K),ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(b,"FromNumber");function*T(X,ee,K){yield LW.IsObjectLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let he=Object.getOwnPropertyNames(X.properties);for(let Z of he){let ue=hUe.Encode(K,Z),qe=X.properties[Z];if(X.required&&X.required.includes(Z))yield*W(qe,ee,ue),(gB(qe)||e(qe))&&(yield`('${Z}' in ${K})`);else{let ne=z(qe,ee,ue);yield LW.IsExactOptionalProperty(K,Z,ne)}}if(X.additionalProperties===!1)if(X.required&&X.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let Z=`[${he.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${Z}.includes(key))`}if(typeof X.additionalProperties=="object"){let Z=z(X.additionalProperties,ee,`${K}[key]`),ue=`[${he.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${Z}))`}}a(T,"FromObject");function*w(X,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(X,ee,K){yield LW.IsRecordLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let[he,Z]=Object.entries(X.patternProperties)[0],ue=H(`${new RegExp(he)}`),qe=z(Z,ee,"value"),ne=Qu(X.additionalProperties)?z(X.additionalProperties,ee,K):X.additionalProperties===!1?"false":"true",ce=`(${ue}.test(key) ? ${qe} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ce}))`}a(R,"FromRecord");function*x(X,ee,K){let he=Ia(X,ee);if(V.functions.has(X.$ref))return yield`${ie(X.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*P(X,ee,K){let he=H(`${new RegExp(X.source,X.flags)};`);yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(X,ee,K){yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),X.pattern!==void 0&&(yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`),X.format!==void 0&&(yield`format('${X.format}', ${K})`)}a(D,"FromString");function*N(X,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(X,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(X,ee,K){yield`${ie(X.$ref)}(${K})`}a(B,"FromThis");function*q(X,ee,K){if(yield`Array.isArray(${K})`,X.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${X.maxItems})`;for(let he=0;hez(Z,ee,K)).join(" || ")})`}a(O,"FromUnion");function*j(X,ee,K){yield`${K} instanceof Uint8Array`,ai(X.maxByteLength)&&(yield`(${K}.length <= ${X.maxByteLength})`),ai(X.minByteLength)&&(yield`(${K}.length >= ${X.minByteLength})`)}a(j,"FromUint8Array");function*Q(X,ee,K){yield"true"}a(Q,"FromUnknown");function*U(X,ee,K){yield LW.IsVoidLike(K)}a(U,"FromVoid");function*Y(X,ee,K){let he=V.instances.size;V.instances.set(he,X),yield`kind('${X[Tt]}', ${he}, ${K})`}a(Y,"FromKind");function*W(X,ee,K,he=!0){let Z=Sa(X.$id)?[...ee,X]:ee,ue=X;if(he&&Sa(X.$id)){let qe=ie(X.$id);if(V.functions.has(qe))return yield`${qe}(${K})`;{V.functions.set(qe,"");let ne=re(qe,X,ee,"value",!1);return V.functions.set(qe,ne),yield`${qe}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,Z,K);case"Argument":return yield*n(ue,Z,K);case"Array":return yield*o(ue,Z,K);case"AsyncIterator":return yield*s(ue,Z,K);case"BigInt":return yield*c(ue,Z,K);case"Boolean":return yield*l(ue,Z,K);case"Constructor":return yield*u(ue,Z,K);case"Date":return yield*d(ue,Z,K);case"Function":return yield*f(ue,Z,K);case"Import":return yield*h(ue,Z,K);case"Integer":return yield*m(ue,Z,K);case"Intersect":return yield*g(ue,Z,K);case"Iterator":return yield*A(ue,Z,K);case"Literal":return yield*y(ue,Z,K);case"Never":return yield*E(ue,Z,K);case"Not":return yield*_(ue,Z,K);case"Null":return yield*v(ue,Z,K);case"Number":return yield*b(ue,Z,K);case"Object":return yield*T(ue,Z,K);case"Promise":return yield*w(ue,Z,K);case"Record":return yield*R(ue,Z,K);case"Ref":return yield*x(ue,Z,K);case"RegExp":return yield*P(ue,Z,K);case"String":return yield*D(ue,Z,K);case"Symbol":return yield*N(ue,Z,K);case"TemplateLiteral":return yield*L(ue,Z,K);case"This":return yield*B(ue,Z,K);case"Tuple":return yield*q(ue,Z,K);case"Undefined":return yield*M(ue,Z,K);case"Union":return yield*O(ue,Z,K);case"Uint8Array":return yield*j(ue,Z,K);case"Unknown":return yield*Q(ue,Z,K);case"Void":return yield*U(ue,Z,K);default:if(!v_.Has(ue[Tt]))throw new a2t(X);return yield*Y(ue,Z,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(X,ee,K,he=!0){return`(${[...W(X,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(X){return`check_${o2t.Encode(X)}`}a(ie,"CreateFunctionName");function H(X){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${X}`),ee}a(H,"CreateVariable");function re(X,ee,K,he,Z=!0){let[ue,qe]=[` -`,we=>"".padStart(we," ")],ne=le("value","any"),ce=Le("boolean"),Ne=[...W(ee,K,he,Z)].map(we=>`${qe(4)}${we}`).join(` &&${ue}`);return`function ${X}(${ne})${ce} {${ue}${qe(2)}return (${ue}${Ne}${ue}${qe(2)}) -}`}a(re,"CreateFunction");function le(X,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${X}${K}`}a(le,"CreateParameter");function Le(X){return V.language==="typescript"?`: ${X}`:""}a(Le,"CreateReturns");function ge(X,ee,K){let he=re("check",X,ee,"value"),Z=le("value","any"),ue=Le("boolean"),qe=[...V.functions.values()],ne=[...V.variables.values()],ce=Sa(X.$id)?`return function check(${Z})${ue} { +`,_co=[gco,Aco,yco,Eco];function Okt(t){for(let e of mco)t.exec(e);return vco(t),t}a(Okt,"applyPragmas");function vco(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(vco,"ensureWalMode");function Lkt(t){for(let e of _co)t.exec(e);return t}a(Lkt,"applySchema");function nU(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(nU,"runInWriteTx");p();p();p();var Bkt="github.copilot",vQr="github-enterprise";p();var Ls=a((t,e)=>({editorId:t,displayName:e}),"id"),Cco=Ls("unknown","Unknown"),CQr=Ls("eclipse","Eclipse"),bQr=Ls("xcode","Xcode"),iU=Ls("vim","Vim/Neovim"),SQr=Ls("helix","Helix"),bco={"copilot-eclipse":CQr,Copilot4Eclipse:CQr,"copilot-xcode":bQr,"Copilot for Xcode":bQr,"copilot-vs":Ls("visual-studio","Visual Studio"),"copilot.vim":iU,"copilot.lua":iU,"Github Copilot LSP for Neovim":iU,"coc-github-copilot":iU,"nvim-lspconfig":iU,"copilot-lsp-client-neovim":iU,"neovim-copilot-lsp":iU,"sidekick.nvim":iU,"helix-copilot":SQr,"copilot-helix":SQr,"copilot-sublime":Ls("sublime-text","Sublime Text"),"zed-copilot":Ls("zed","Zed"),RStudio:Ls("rstudio","RStudio"),"obsidian-copilot":Ls("obsidian","Obsidian"),marimo:Ls("marimo","marimo"),"Qt Creator Copilot plugin":Ls("qt-creator","Qt Creator"),"godot-copilot":Ls("godot","Godot"),"kakoune-lsp":Ls("kakoune","Kakoune"),"typora-copilot":Ls("typora","Typora"),"Copilot for Nova":Ls("nova","Nova")},Sco={IU:Ls("intellij","IntelliJ IDEA"),IC:Ls("intellij","IntelliJ IDEA"),IE:Ls("intellij","IntelliJ IDEA"),PY:Ls("pycharm","PyCharm"),PC:Ls("pycharm","PyCharm"),PE:Ls("pycharm","PyCharm"),WS:Ls("webstorm","WebStorm"),PS:Ls("phpstorm","PhpStorm"),RD:Ls("rider","Rider"),RM:Ls("rubymine","RubyMine"),CL:Ls("clion","CLion"),GO:Ls("goland","GoLand"),RR:Ls("rustrover","RustRover"),DB:Ls("datagrip","DataGrip"),DS:Ls("dataspell","DataSpell"),AI:Ls("android-studio","Android Studio"),QA:Ls("aqua","Aqua"),MPS:Ls("mps","MPS"),JBC:Ls("jetbrains-client","JetBrains Client"),GW:Ls("jetbrains-gateway","JetBrains Gateway")},TQr="JetBrains-",Tco=Ls("jetbrains","JetBrains IDE");function IQr(t){let e=t.plugin.name?.trim();if(!e)return Cco;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(TQr)){let n=Sco[r.slice(TQr.length)];if(n)return n}return Tco}return bco[e]??Ls(e,e)}a(IQr,"resolveEditorIdentity");p();p();p();p();var L6e=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 cliEnabled(){return this.userInfo?.cli_enabled}get raw(){return this.userInfo}};p();function Fkt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(Fkt,"findKnownOrg");function xQr(t){let e=t.organization_list??[];return Fkt(e)??""}a(xQr,"getUserKind");p();var Hf=class{static{a(this,"LogTarget")}},XL=class{static{a(this,"TelemetryLogSender")}},fe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Hf).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(XL).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Nr=new fe("default");p();p();p();p();async function ado(){let{getDeviceId:t}=await Promise.resolve().then(()=>de(oHr()));return t()}a(ado,"loadDeviceId");var qI=class{constructor(e=ado){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 Dk=class{static{a(this,"InlineCompletionsUnification")}},cdo={codeUnification:!1,modelUnification:!1,expAssignments:[]},Soe=class extends Dk{constructor(){super(...arguments);this.inlineCompletionsUnificationState=cdo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var jI=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return t9e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(Dk).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 __="X-Copilot-RelatedPluginVersion-",Toe=(z=>(z.Market="X-MSEdge-Market",z.CorpNet="X-FD-Corpnet",z.Build="X-VSCode-Build",z.ApplicationVersion="X-VSCode-AppVersion",z.TargetPopulation="X-VSCode-TargetPopulation",z.ClientId="X-MSEdge-ClientId",z.DevDeviceId="X-VSCode-DevDeviceId",z.ExtensionName="X-VSCode-ExtensionName",z.ExtensionVersion="X-VSCode-ExtensionVersion",z.ExtensionRelease="X-VSCode-ExtensionRelease",z.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",z.Language="X-VSCode-Language",z.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",z.CopilotEngine="X-Copilot-Engine",z.CopilotOverrideEngine="X-Copilot-OverrideEngine",z.CopilotRepository="X-Copilot-Repository",z.CopilotFileType="X-Copilot-FileType",z.CopilotUserKind="X-Copilot-UserKind",z.CopilotDogfood="X-Copilot-Dogfood",z.CopilotOrgs="X-Copilot-Orgs",z.CopilotTrackingId="X-Copilot-CopilotTrackingId",z.CopilotClientVersion="X-Copilot-ClientVersion",z.CopilotSku="X-GitHub-Copilot-SKU",z.CopilotIsFcv1="X-GitHub-Copilot-IsFcv1",z.CopilotIsSn="X-GitHub-Copilot-IsSn",z.CopilotRelatedPluginVersionCppTools=__+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=__+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=__+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=__+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=__+"mspythonpython",z.CopilotRelatedPluginVersionPylance=__+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=__+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=__+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=__+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=__+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=__+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=__+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=__+"githubcopilot",z))(Toe||{});var ldo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},oB=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=ldo[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 bs(t,e){let r=Y0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(bs,"onCopilotToken");function lPt(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(lPt,"propertiesFromCopilotToken");var Bp=class{constructor(e){this.#e={};this.optedIn=!1;bs(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=lPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var Q9e=de(pU()),q9e=de(require("os"));var udo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function ddo(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(udo),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(ddo,"buildExceptionDetail");function fPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Bp),s={"#editor":n.devName??n.name,"#editor_version":M1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":M1(r.getEditorPluginInfo()),"#session_id":t.get(Qa).sessionId,"#machine_id":t.get(Qa).machineId,"#architecture":q9e.arch(),"#os_platform":q9e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(fPt,"buildContext");function pGr(t,e,r){let n=t.get(ds),o=t.get(Ir).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:fPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=ddo(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,Q9e.SHA256)(Q9e.enc.Utf16.parse(f.join(` +`))).toString()),c}a(pGr,"buildPayload");p();var j9e=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 mGr=de(pU());var Cn=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)}},Nk=class extends Cn{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"}},H9e=class extends Cn{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 gGr=7*86400*1e3,rM=class{constructor(e=5){this.perWeek=e;this.cache=new Cn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-gGr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(AGr(t.replace(/\\/g,"/")),"gi"):new RegExp(AGr(t),"gi"));function pdo(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(hdo,"removePropertiesWithPossibleUserInfo");function mdo(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(mdo,"redactPaths");function EGr(t,e=fdo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=hdo(s);if(c!==s){r[n]=c;continue}s=pdo(s,e);for(let l of e)s=s.replace(l,"");s=mdo(s),r[n]=s}return r}a(EGr,"sanitizeTelemetryProperties");function hU(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(hU,"filterTelemetryProperties");p();var HI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:vGr(r,n),verboseLogging:Ado(r,n),testMode:e,simulation:gdo(n)})}};function O1(t){return t.get(HI).flags.testMode}a(O1,"isRunningInTest");function DCe(t){return O1(t)}a(DCe,"shouldFailForDebugPurposes");function NCe(t){return t.get(HI).flags.debug}a(NCe,"isDebugEnabled");function _Gr(t){return t.get(HI).flags.verboseLogging}a(_Gr,"isVerboseLoggingEnabled");function vGr(t,e){return t.includes("--debug")||hPt(e,"DEBUG")}a(vGr,"determineDebugFlag");function gdo(t){return hPt(t,"SIMULATION")}a(gdo,"determineSimulationFlag");function $9e(t){return t.get(HI).flags.simulation}a($9e,"isRunningInSimulation");function Ado(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||hPt(e,"VERBOSE")||vGr(t,e)}a(Ado,"determineVerboseLoggingEnabled");function hPt(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(hPt,"determineEnvFlagEnabled");p();var Rd=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 SGr=require("os"),TGr=de(require("path"));function MCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(MCe,"redactPaths");var ydo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),Edo=[/^[\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 gPt(t){if(ydo.has(t))return t;for(let e of Edo)if(e.test(t))return t;return MCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(gPt,"redactMessage");function Ioe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ioe,"escapeForRegExp");var _do=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Ioe((0,SGr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function mPt(t){return t.replace(_do,"~")}a(mPt,"redactHomeDir");var IGr="[\\\\/]?([^:)]*)(?=:\\d)",CGr=new RegExp(Ioe(TGr.sep),"g"),bGr=new RegExp(Ioe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+IGr,"gi");function APt(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(bGr.test(l))o.stack+=` +${MCe(l.replace(bGr,(u,d)=>"./"+d.replace(CGr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` +${MCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Ioe(f.replace(/[\\/]$/,""))+IGr,"gi");if(h.test(l)){o.stack+=` +${MCe(l.replace(h,(m,g)=>d+g.replace(CGr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` +${mPt(l)}`:o.stack+=` + at [redacted]:0:0`}}else r&&s&&(o.stack=mPt(s));return t.cause instanceof Error&&(o.cause=APt(t.cause,e,r,n)),o}a(APt,"cloneError");function xGr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(xGr,"errorMessageWithoutPath");function wGr(t,e){return APt(t,a(function(n){return mPt(xGr(n))},"prepareMessage"),!0,e)}a(wGr,"prepareErrorForRestrictedTelemetry");function RGr(t,e,r=!1){return APt(t,a(function(o){if(r)return gPt(xGr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=MCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(RGr,"redactError");p();p();var By={};ki(By,{HasPropertyKey:()=>V9e,IsArray:()=>Fp,IsAsyncIterator:()=>yPt,IsBigInt:()=>OCe,IsBoolean:()=>aB,IsDate:()=>PW,IsFunction:()=>EPt,IsIterator:()=>_Pt,IsNull:()=>vPt,IsNumber:()=>L1,IsObject:()=>Yc,IsRegExp:()=>LCe,IsString:()=>ql,IsSymbol:()=>CPt,IsUint8Array:()=>cB,IsUndefined:()=>Up});p();function V9e(t,e){return e in t}a(V9e,"HasPropertyKey");function yPt(t){return Yc(t)&&!Fp(t)&&!cB(t)&&Symbol.asyncIterator in t}a(yPt,"IsAsyncIterator");function Fp(t){return Array.isArray(t)}a(Fp,"IsArray");function OCe(t){return typeof t=="bigint"}a(OCe,"IsBigInt");function aB(t){return typeof t=="boolean"}a(aB,"IsBoolean");function PW(t){return t instanceof globalThis.Date}a(PW,"IsDate");function EPt(t){return typeof t=="function"}a(EPt,"IsFunction");function _Pt(t){return Yc(t)&&!Fp(t)&&!cB(t)&&Symbol.iterator in t}a(_Pt,"IsIterator");function vPt(t){return t===null}a(vPt,"IsNull");function L1(t){return typeof t=="number"}a(L1,"IsNumber");function Yc(t){return typeof t=="object"&&t!==null}a(Yc,"IsObject");function LCe(t){return t instanceof globalThis.RegExp}a(LCe,"IsRegExp");function ql(t){return typeof t=="string"}a(ql,"IsString");function CPt(t){return typeof t=="symbol"}a(CPt,"IsSymbol");function cB(t){return t instanceof globalThis.Uint8Array}a(cB,"IsUint8Array");function Up(t){return t===void 0}a(Up,"IsUndefined");function vdo(t){return t.map(e=>W9e(e))}a(vdo,"ArrayType");function Cdo(t){return new Date(t.getTime())}a(Cdo,"DateType");function bdo(t){return new Uint8Array(t)}a(bdo,"Uint8ArrayType");function Sdo(t){return new RegExp(t.source,t.flags)}a(Sdo,"RegExpType");function Tdo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=W9e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=W9e(t[r]);return e}a(Tdo,"ObjectType");function W9e(t){return Fp(t)?vdo(t):PW(t)?Cdo(t):cB(t)?bdo(t):LCe(t)?Sdo(t):Yc(t)?Tdo(t):t}a(W9e,"Visit");function Fu(t){return W9e(t)}a(Fu,"Clone");function xoe(t,e){return e===void 0?Fu(t):Fu({...e,...t})}a(xoe,"CloneType");p();p();p();function z9e(t){return So(t)&&globalThis.Symbol.asyncIterator in t}a(z9e,"IsAsyncIterator");function Y9e(t){return So(t)&&globalThis.Symbol.iterator in t}a(Y9e,"IsIterator");function bPt(t){return So(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(bPt,"IsStandardObject");function K9e(t){return t instanceof globalThis.Promise}a(K9e,"IsPromise");function v_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(v_,"IsDate");function kGr(t){return t instanceof globalThis.Map}a(kGr,"IsMap");function PGr(t){return t instanceof globalThis.Set}a(PGr,"IsSet");function GI(t){return globalThis.ArrayBuffer.isView(t)}a(GI,"IsTypedArray");function woe(t){return t instanceof globalThis.Uint8Array}a(woe,"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 Pi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Pi,"IsArray");function Uu(t){return t===void 0}a(Uu,"IsUndefined");function lB(t){return t===null}a(lB,"IsNull");function nM(t){return typeof t=="boolean"}a(nM,"IsBoolean");function si(t){return typeof t=="number"}a(si,"IsNumber");function J9e(t){return globalThis.Number.isInteger(t)}a(J9e,"IsInteger");function hA(t){return typeof t=="bigint"}a(hA,"IsBigInt");function Ta(t){return typeof t=="string"}a(Ta,"IsString");function mU(t){return typeof t=="function"}a(mU,"IsFunction");function uB(t){return typeof t=="symbol"}a(uB,"IsSymbol");function B1(t){return hA(t)||nM(t)||lB(t)||si(t)||Ta(t)||uB(t)||Uu(t)}a(B1,"IsValueType");var su;(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&&!Pi(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?si(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Uu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(su||(su={}));p();function Ido(t){return globalThis.Object.freeze(t).map(e=>BCe(e))}a(Ido,"ImmutableArray");function xdo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=BCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=BCe(t[r]);return globalThis.Object.freeze(e)}a(xdo,"ImmutableObject");function BCe(t){return Fp(t)?Ido(t):PW(t)?t:cB(t)?t:LCe(t)?t:Yc(t)?xdo(t):t}a(BCe,"Immutable");function xt(t,e){let r=e!==void 0?{...e,...t}:t;switch(su.InstanceMode){case"freeze":return BCe(r);case"clone":return Fu(r);default:return r}}a(xt,"CreateType");p();var qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var kd=Symbol.for("TypeBox.Transform"),Mk=Symbol.for("TypeBox.Readonly"),mA=Symbol.for("TypeBox.Optional"),$I=Symbol.for("TypeBox.Hint"),St=Symbol.for("TypeBox.Kind");function Roe(t){return Yc(t)&&t[Mk]==="Readonly"}a(Roe,"IsReadonly");function oC(t){return Yc(t)&&t[mA]==="Optional"}a(oC,"IsOptional");function SPt(t){return ca(t,"Any")}a(SPt,"IsAny");function TPt(t){return ca(t,"Argument")}a(TPt,"IsArgument");function Ok(t){return ca(t,"Array")}a(Ok,"IsArray");function DW(t){return ca(t,"AsyncIterator")}a(DW,"IsAsyncIterator");function NW(t){return ca(t,"BigInt")}a(NW,"IsBigInt");function dB(t){return ca(t,"Boolean")}a(dB,"IsBoolean");function Lk(t){return ca(t,"Computed")}a(Lk,"IsComputed");function Bk(t){return ca(t,"Constructor")}a(Bk,"IsConstructor");function wdo(t){return ca(t,"Date")}a(wdo,"IsDate");function Fk(t){return ca(t,"Function")}a(Fk,"IsFunction");function Uk(t){return ca(t,"Integer")}a(Uk,"IsInteger");function lf(t){return ca(t,"Intersect")}a(lf,"IsIntersect");function MW(t){return ca(t,"Iterator")}a(MW,"IsIterator");function ca(t,e){return Yc(t)&&St in t&&t[St]===e}a(ca,"IsKindOf");function Z9e(t){return aB(t)||L1(t)||ql(t)}a(Z9e,"IsLiteralValue");function F1(t){return ca(t,"Literal")}a(F1,"IsLiteral");function U1(t){return ca(t,"MappedKey")}a(U1,"IsMappedKey");function Qu(t){return ca(t,"MappedResult")}a(Qu,"IsMappedResult");function gU(t){return ca(t,"Never")}a(gU,"IsNever");function Rdo(t){return ca(t,"Not")}a(Rdo,"IsNot");function FCe(t){return ca(t,"Null")}a(FCe,"IsNull");function Qk(t){return ca(t,"Number")}a(Qk,"IsNumber");function Qp(t){return ca(t,"Object")}a(Qp,"IsObject");function OW(t){return ca(t,"Promise")}a(OW,"IsPromise");function LW(t){return ca(t,"Record")}a(LW,"IsRecord");function Gf(t){return ca(t,"Ref")}a(Gf,"IsRef");function IPt(t){return ca(t,"RegExp")}a(IPt,"IsRegExp");function fB(t){return ca(t,"String")}a(fB,"IsString");function UCe(t){return ca(t,"Symbol")}a(UCe,"IsSymbol");function Q1(t){return ca(t,"TemplateLiteral")}a(Q1,"IsTemplateLiteral");function kdo(t){return ca(t,"This")}a(kdo,"IsThis");function tc(t){return Yc(t)&&kd in t}a(tc,"IsTransform");function q1(t){return ca(t,"Tuple")}a(q1,"IsTuple");function pB(t){return ca(t,"Undefined")}a(pB,"IsUndefined");function Ia(t){return ca(t,"Union")}a(Ia,"IsUnion");function Pdo(t){return ca(t,"Uint8Array")}a(Pdo,"IsUint8Array");function Ddo(t){return ca(t,"Unknown")}a(Ddo,"IsUnknown");function Ndo(t){return ca(t,"Unsafe")}a(Ndo,"IsUnsafe");function Mdo(t){return ca(t,"Void")}a(Mdo,"IsVoid");function AU(t){return Yc(t)&&St in t&&ql(t[St])}a(AU,"IsKind");function Pd(t){return SPt(t)||TPt(t)||Ok(t)||dB(t)||NW(t)||DW(t)||Lk(t)||Bk(t)||wdo(t)||Fk(t)||Uk(t)||lf(t)||MW(t)||F1(t)||U1(t)||Qu(t)||gU(t)||Rdo(t)||FCe(t)||Qk(t)||Qp(t)||OW(t)||LW(t)||Gf(t)||IPt(t)||fB(t)||UCe(t)||Q1(t)||kdo(t)||q1(t)||pB(t)||Ia(t)||Pdo(t)||Ddo(t)||Ndo(t)||Mdo(t)||AU(t)}a(Pd,"IsSchema");var it={};ki(it,{IsAny:()=>OGr,IsArgument:()=>LGr,IsArray:()=>BGr,IsAsyncIterator:()=>FGr,IsBigInt:()=>UGr,IsBoolean:()=>QGr,IsComputed:()=>qGr,IsConstructor:()=>jGr,IsDate:()=>HGr,IsFunction:()=>GGr,IsImport:()=>Qdo,IsInteger:()=>$Gr,IsIntersect:()=>VGr,IsIterator:()=>WGr,IsKind:()=>E$r,IsKindOf:()=>Bs,IsLiteral:()=>qCe,IsLiteralBoolean:()=>qdo,IsLiteralNumber:()=>YGr,IsLiteralString:()=>zGr,IsLiteralValue:()=>KGr,IsMappedKey:()=>JGr,IsMappedResult:()=>ZGr,IsNever:()=>XGr,IsNot:()=>e$r,IsNull:()=>t$r,IsNumber:()=>r$r,IsObject:()=>n$r,IsOptional:()=>Udo,IsPromise:()=>i$r,IsProperties:()=>X9e,IsReadonly:()=>Fdo,IsRecord:()=>o$r,IsRecursive:()=>jdo,IsRef:()=>s$r,IsRegExp:()=>a$r,IsSchema:()=>qu,IsString:()=>c$r,IsSymbol:()=>l$r,IsTemplateLiteral:()=>u$r,IsThis:()=>d$r,IsTransform:()=>f$r,IsTuple:()=>p$r,IsUint8Array:()=>m$r,IsUndefined:()=>h$r,IsUnion:()=>kPt,IsUnionLiteral:()=>Hdo,IsUnknown:()=>g$r,IsUnsafe:()=>A$r,IsVoid:()=>y$r,TypeGuardUnknownTypeError:()=>xPt});p();var xPt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Odo=["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 DGr(t){try{return new RegExp(t),!0}catch{return!1}}a(DGr,"IsPattern");function wPt(t){if(!ql(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(wPt,"IsControlCharacterFree");function NGr(t){return RPt(t)||qu(t)}a(NGr,"IsAdditionalProperties");function QCe(t){return Up(t)||OCe(t)}a(QCe,"IsOptionalBigInt");function jl(t){return Up(t)||L1(t)}a(jl,"IsOptionalNumber");function RPt(t){return Up(t)||aB(t)}a(RPt,"IsOptionalBoolean");function Kc(t){return Up(t)||ql(t)}a(Kc,"IsOptionalString");function Ldo(t){return Up(t)||ql(t)&&wPt(t)&&DGr(t)}a(Ldo,"IsOptionalPattern");function Bdo(t){return Up(t)||ql(t)&&wPt(t)}a(Bdo,"IsOptionalFormat");function MGr(t){return Up(t)||qu(t)}a(MGr,"IsOptionalSchema");function Fdo(t){return Yc(t)&&t[Mk]==="Readonly"}a(Fdo,"IsReadonly");function Udo(t){return Yc(t)&&t[mA]==="Optional"}a(Udo,"IsOptional");function OGr(t){return Bs(t,"Any")&&Kc(t.$id)}a(OGr,"IsAny");function LGr(t){return Bs(t,"Argument")&&L1(t.index)}a(LGr,"IsArgument");function BGr(t){return Bs(t,"Array")&&t.type==="array"&&Kc(t.$id)&&qu(t.items)&&jl(t.minItems)&&jl(t.maxItems)&&RPt(t.uniqueItems)&&MGr(t.contains)&&jl(t.minContains)&&jl(t.maxContains)}a(BGr,"IsArray");function FGr(t){return Bs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Kc(t.$id)&&qu(t.items)}a(FGr,"IsAsyncIterator");function UGr(t){return Bs(t,"BigInt")&&t.type==="bigint"&&Kc(t.$id)&&QCe(t.exclusiveMaximum)&&QCe(t.exclusiveMinimum)&&QCe(t.maximum)&&QCe(t.minimum)&&QCe(t.multipleOf)}a(UGr,"IsBigInt");function QGr(t){return Bs(t,"Boolean")&&t.type==="boolean"&&Kc(t.$id)}a(QGr,"IsBoolean");function qGr(t){return Bs(t,"Computed")&&ql(t.target)&&Fp(t.parameters)&&t.parameters.every(e=>qu(e))}a(qGr,"IsComputed");function jGr(t){return Bs(t,"Constructor")&&t.type==="Constructor"&&Kc(t.$id)&&Fp(t.parameters)&&t.parameters.every(e=>qu(e))&&qu(t.returns)}a(jGr,"IsConstructor");function HGr(t){return Bs(t,"Date")&&t.type==="Date"&&Kc(t.$id)&&jl(t.exclusiveMaximumTimestamp)&&jl(t.exclusiveMinimumTimestamp)&&jl(t.maximumTimestamp)&&jl(t.minimumTimestamp)&&jl(t.multipleOfTimestamp)}a(HGr,"IsDate");function GGr(t){return Bs(t,"Function")&&t.type==="Function"&&Kc(t.$id)&&Fp(t.parameters)&&t.parameters.every(e=>qu(e))&&qu(t.returns)}a(GGr,"IsFunction");function Qdo(t){return Bs(t,"Import")&&V9e(t,"$defs")&&Yc(t.$defs)&&X9e(t.$defs)&&V9e(t,"$ref")&&ql(t.$ref)&&t.$ref in t.$defs}a(Qdo,"IsImport");function $Gr(t){return Bs(t,"Integer")&&t.type==="integer"&&Kc(t.$id)&&jl(t.exclusiveMaximum)&&jl(t.exclusiveMinimum)&&jl(t.maximum)&&jl(t.minimum)&&jl(t.multipleOf)}a($Gr,"IsInteger");function X9e(t){return Yc(t)&&Object.entries(t).every(([e,r])=>wPt(e)&&qu(r))}a(X9e,"IsProperties");function VGr(t){return Bs(t,"Intersect")&&!(ql(t.type)&&t.type!=="object")&&Fp(t.allOf)&&t.allOf.every(e=>qu(e)&&!f$r(e))&&Kc(t.type)&&(RPt(t.unevaluatedProperties)||MGr(t.unevaluatedProperties))&&Kc(t.$id)}a(VGr,"IsIntersect");function WGr(t){return Bs(t,"Iterator")&&t.type==="Iterator"&&Kc(t.$id)&&qu(t.items)}a(WGr,"IsIterator");function Bs(t,e){return Yc(t)&&St in t&&t[St]===e}a(Bs,"IsKindOf");function zGr(t){return qCe(t)&&ql(t.const)}a(zGr,"IsLiteralString");function YGr(t){return qCe(t)&&L1(t.const)}a(YGr,"IsLiteralNumber");function qdo(t){return qCe(t)&&aB(t.const)}a(qdo,"IsLiteralBoolean");function qCe(t){return Bs(t,"Literal")&&Kc(t.$id)&&KGr(t.const)}a(qCe,"IsLiteral");function KGr(t){return aB(t)||L1(t)||ql(t)}a(KGr,"IsLiteralValue");function JGr(t){return Bs(t,"MappedKey")&&Fp(t.keys)&&t.keys.every(e=>L1(e)||ql(e))}a(JGr,"IsMappedKey");function ZGr(t){return Bs(t,"MappedResult")&&X9e(t.properties)}a(ZGr,"IsMappedResult");function XGr(t){return Bs(t,"Never")&&Yc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(XGr,"IsNever");function e$r(t){return Bs(t,"Not")&&qu(t.not)}a(e$r,"IsNot");function t$r(t){return Bs(t,"Null")&&t.type==="null"&&Kc(t.$id)}a(t$r,"IsNull");function r$r(t){return Bs(t,"Number")&&t.type==="number"&&Kc(t.$id)&&jl(t.exclusiveMaximum)&&jl(t.exclusiveMinimum)&&jl(t.maximum)&&jl(t.minimum)&&jl(t.multipleOf)}a(r$r,"IsNumber");function n$r(t){return Bs(t,"Object")&&t.type==="object"&&Kc(t.$id)&&X9e(t.properties)&&NGr(t.additionalProperties)&&jl(t.minProperties)&&jl(t.maxProperties)}a(n$r,"IsObject");function i$r(t){return Bs(t,"Promise")&&t.type==="Promise"&&Kc(t.$id)&&qu(t.item)}a(i$r,"IsPromise");function o$r(t){return Bs(t,"Record")&&t.type==="object"&&Kc(t.$id)&&NGr(t.additionalProperties)&&Yc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&DGr(r[0])&&Yc(e.patternProperties)&&qu(e.patternProperties[r[0]])})(t)}a(o$r,"IsRecord");function jdo(t){return Yc(t)&&$I in t&&t[$I]==="Recursive"}a(jdo,"IsRecursive");function s$r(t){return Bs(t,"Ref")&&Kc(t.$id)&&ql(t.$ref)}a(s$r,"IsRef");function a$r(t){return Bs(t,"RegExp")&&Kc(t.$id)&&ql(t.source)&&ql(t.flags)&&jl(t.maxLength)&&jl(t.minLength)}a(a$r,"IsRegExp");function c$r(t){return Bs(t,"String")&&t.type==="string"&&Kc(t.$id)&&jl(t.minLength)&&jl(t.maxLength)&&Ldo(t.pattern)&&Bdo(t.format)}a(c$r,"IsString");function l$r(t){return Bs(t,"Symbol")&&t.type==="symbol"&&Kc(t.$id)}a(l$r,"IsSymbol");function u$r(t){return Bs(t,"TemplateLiteral")&&t.type==="string"&&ql(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(u$r,"IsTemplateLiteral");function d$r(t){return Bs(t,"This")&&Kc(t.$id)&&ql(t.$ref)}a(d$r,"IsThis");function f$r(t){return Yc(t)&&kd in t}a(f$r,"IsTransform");function p$r(t){return Bs(t,"Tuple")&&t.type==="array"&&Kc(t.$id)&&L1(t.minItems)&&L1(t.maxItems)&&t.minItems===t.maxItems&&(Up(t.items)&&Up(t.additionalItems)&&t.minItems===0||Fp(t.items)&&t.items.every(e=>qu(e)))}a(p$r,"IsTuple");function h$r(t){return Bs(t,"Undefined")&&t.type==="undefined"&&Kc(t.$id)}a(h$r,"IsUndefined");function Hdo(t){return kPt(t)&&t.anyOf.every(e=>zGr(e)||YGr(e))}a(Hdo,"IsUnionLiteral");function kPt(t){return Bs(t,"Union")&&Kc(t.$id)&&Yc(t)&&Fp(t.anyOf)&&t.anyOf.every(e=>qu(e))}a(kPt,"IsUnion");function m$r(t){return Bs(t,"Uint8Array")&&t.type==="Uint8Array"&&Kc(t.$id)&&jl(t.minByteLength)&&jl(t.maxByteLength)}a(m$r,"IsUint8Array");function g$r(t){return Bs(t,"Unknown")&&Kc(t.$id)}a(g$r,"IsUnknown");function A$r(t){return Bs(t,"Unsafe")}a(A$r,"IsUnsafe");function y$r(t){return Bs(t,"Void")&&t.type==="void"&&Kc(t.$id)}a(y$r,"IsVoid");function E$r(t){return Yc(t)&&St in t&&ql(t[St])&&!Odo.includes(t[St])}a(E$r,"IsKind");function qu(t){return Yc(t)&&(OGr(t)||LGr(t)||BGr(t)||QGr(t)||UGr(t)||FGr(t)||qGr(t)||jGr(t)||HGr(t)||GGr(t)||$Gr(t)||VGr(t)||WGr(t)||qCe(t)||JGr(t)||ZGr(t)||XGr(t)||e$r(t)||t$r(t)||r$r(t)||n$r(t)||i$r(t)||o$r(t)||s$r(t)||a$r(t)||c$r(t)||l$r(t)||u$r(t)||d$r(t)||p$r(t)||h$r(t)||kPt(t)||m$r(t)||g$r(t)||A$r(t)||y$r(t)||E$r(t))}a(qu,"IsSchema");p();var PPt="(true|false)",jCe="(0|[1-9][0-9]*)",DPt="(.*)",Gdo="(?!.*)",afl=`^${PPt}$`,yU=`^${jCe}$`,EU=`^${DPt}$`,_$r=`^${Gdo}$`;p();var qk={};ki(qk,{Clear:()=>Vdo,Delete:()=>Wdo,Entries:()=>$do,Get:()=>Kdo,Has:()=>zdo,Set:()=>Ydo});p();var koe=new Map;function $do(){return new Map(koe)}a($do,"Entries");function Vdo(){return koe.clear()}a(Vdo,"Clear");function Wdo(t){return koe.delete(t)}a(Wdo,"Delete");function zdo(t){return koe.has(t)}a(zdo,"Has");function Ydo(t,e){koe.set(t,e)}a(Ydo,"Set");function Kdo(t){return koe.get(t)}a(Kdo,"Get");var C_={};ki(C_,{Clear:()=>Zdo,Delete:()=>Xdo,Entries:()=>Jdo,Get:()=>rfo,Has:()=>efo,Set:()=>tfo});p();var Poe=new Map;function Jdo(){return new Map(Poe)}a(Jdo,"Entries");function Zdo(){return Poe.clear()}a(Zdo,"Clear");function Xdo(t){return Poe.delete(t)}a(Xdo,"Delete");function efo(t){return Poe.has(t)}a(efo,"Has");function tfo(t,e){Poe.set(t,e)}a(tfo,"Set");function rfo(t){return Poe.get(t)}a(rfo,"Get");p();function v$r(t,e){return t.includes(e)}a(v$r,"SetIncludes");function C$r(t){return[...new Set(t)]}a(C$r,"SetDistinct");function nfo(t,e){return t.filter(r=>e.includes(r))}a(nfo,"SetIntersect");function ifo(t,e){return t.reduce((r,n)=>nfo(r,n),e)}a(ifo,"SetIntersectManyResolve");function b$r(t){return t.length===1?t[0]:t.length>1?ifo(t.slice(1),t[0]):[]}a(b$r,"SetIntersectMany");function S$r(t){let e=[];for(let r of t)e.push(...r);return e}a(S$r,"SetUnionMany");p();function _U(t){return xt({[St]:"Any"},t)}a(_U,"Any");p();function Doe(t,e){return xt({[St]:"Array",type:"array",items:t},e)}a(Doe,"Array");p();function T$r(t){return xt({[St]:"Argument",index:t})}a(T$r,"Argument");p();function Noe(t,e){return xt({[St]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Noe,"AsyncIterator");p();p();function au(t,e,r){return xt({[St]:"Computed",target:t,parameters:e},r)}a(au,"Computed");p();p();function ofo(t,e){let{[e]:r,...n}=t;return n}a(ofo,"DiscardKey");function uf(t,e){return e.reduce((r,n)=>ofo(r,n),t)}a(uf,"Discard");p();function Xo(t){return xt({[St]:"Never",not:{}},t)}a(Xo,"Never");p();p();function qa(t){return xt({[St]:"MappedResult",properties:t})}a(qa,"MappedResult");p();p();function Moe(t,e,r){return xt({[St]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Moe,"Constructor");p();function iM(t,e,r){return xt({[St]:"Function",type:"Function",parameters:t,returns:e},r)}a(iM,"Function");p();p();p();p();function HCe(t,e){return xt({[St]:"Union",anyOf:t},e)}a(HCe,"UnionCreate");function sfo(t){return t.some(e=>oC(e))}a(sfo,"IsUnionOptional");function I$r(t){return t.map(e=>oC(e)?afo(e):e)}a(I$r,"RemoveOptionalFromRest");function afo(t){return uf(t,[mA])}a(afo,"RemoveOptionalFromType");function cfo(t,e){return sfo(t)?Fy(HCe(I$r(t),e)):HCe(I$r(t),e)}a(cfo,"ResolveUnion");function oM(t,e){return t.length===1?xt(t[0],e):t.length===0?Xo(e):cfo(t,e)}a(oM,"UnionEvaluated");p();function rc(t,e){return t.length===0?Xo(e):t.length===1?xt(t[0],e):HCe(t,e)}a(rc,"Union");p();p();p();var eUe=class extends qi{static{a(this,"TemplateLiteralParserError")}};function lfo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(lfo,"Unescape");function NPt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(NPt,"IsNonEscaped");function mB(t,e){return NPt(t,e,"(")}a(mB,"IsOpenParen");function GCe(t,e){return NPt(t,e,")")}a(GCe,"IsCloseParen");function x$r(t,e){return NPt(t,e,"|")}a(x$r,"IsSeparator");function ufo(t){if(!(mB(t,0)&&GCe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Ooe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Ooe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(hfo,"Or");function mfo(t){function e(o,s){if(!mB(o,s))throw new eUe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Ooe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(mfo,"And");function Ooe(t){return ufo(t)?Ooe(dfo(t)):ffo(t)?hfo(t):pfo(t)?mfo(t):{type:"const",const:lfo(t)}}a(Ooe,"TemplateLiteralParse");function Loe(t){return Ooe(t.slice(1,t.length-1))}a(Loe,"TemplateLiteralParseExact");var MPt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function gfo(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(gfo,"IsNumberExpression");function Afo(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(Afo,"IsBooleanExpression");function yfo(t){return t.type==="const"&&t.const===".*"}a(yfo,"IsStringExpression");function BW(t){return gfo(t)||yfo(t)?!1:Afo(t)?!0:t.type==="and"?t.expr.every(e=>BW(e)):t.type==="or"?t.expr.every(e=>BW(e)):t.type==="const"?!0:(()=>{throw new MPt("Unknown expression type")})()}a(BW,"IsTemplateLiteralExpressionFinite");function tUe(t){let e=Loe(t.pattern);return BW(e)}a(tUe,"IsTemplateLiteralFinite");p();var OPt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*w$r(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of w$r(t.slice(1)))yield`${e}${r}`}a(w$r,"GenerateReduce");function*Efo(t){return yield*w$r(t.expr.map(e=>[...$Ce(e)]))}a(Efo,"GenerateAnd");function*_fo(t){for(let e of t.expr)yield*$Ce(e)}a(_fo,"GenerateOr");function*vfo(t){return yield t.const}a(vfo,"GenerateConst");function*$Ce(t){return t.type==="and"?yield*Efo(t):t.type==="or"?yield*_fo(t):t.type==="const"?yield*vfo(t):(()=>{throw new OPt("Unknown expression")})()}a($Ce,"TemplateLiteralExpressionGenerate");function Boe(t){let e=Loe(t.pattern);return BW(e)?[...$Ce(e)]:[]}a(Boe,"TemplateLiteralGenerate");p();p();function la(t,e){return xt({[St]:"Literal",const:t,type:typeof t},e)}a(la,"Literal");p();function rUe(t){return xt({[St]:"Boolean",type:"boolean"},t)}a(rUe,"Boolean");p();function Foe(t){return xt({[St]:"BigInt",type:"bigint"},t)}a(Foe,"BigInt");p();function VI(t){return xt({[St]:"Number",type:"number"},t)}a(VI,"Number");p();function b_(t){return xt({[St]:"String",type:"string"},t)}a(b_,"String");function*Cfo(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield rUe():e==="number"?yield VI():e==="bigint"?yield Foe():e==="string"?yield b_():yield(()=>{let r=e.split("|").map(n=>la(n.trim()));return r.length===0?Xo():r.length===1?r[0]:oM(r)})()}a(Cfo,"FromUnion");function*bfo(t){if(t[1]!=="{"){let e=la("$"),r=LPt(t.slice(1));return yield*[e,...r]}for(let e=2;ek$r(r,e)).join("|")})`:Qk(t)?`${e}${jCe}`:Uk(t)?`${e}${jCe}`:NW(t)?`${e}${jCe}`:fB(t)?`${e}${DPt}`:F1(t)?`${e}${Sfo(t.const.toString())}`:dB(t)?`${e}${PPt}`:(()=>{throw new BPt(`Unexpected Kind '${t[St]}'`)})()}a(k$r,"Visit");function FPt(t){return`^${t.map(e=>k$r(e,"")).join("")}$`}a(FPt,"TemplateLiteralPattern");p();function FW(t){let r=Boe(t).map(n=>la(n));return oM(r)}a(FW,"TemplateLiteralToUnion");p();function nUe(t,e){let r=ql(t)?FPt(R$r(t)):FPt(t);return xt({[St]:"TemplateLiteral",type:"string",pattern:r},e)}a(nUe,"TemplateLiteral");function Tfo(t){return Boe(t).map(r=>r.toString())}a(Tfo,"FromTemplateLiteral");function Ifo(t){let e=[];for(let r of t)e.push(...sC(r));return e}a(Ifo,"FromUnion");function xfo(t){return[t.toString()]}a(xfo,"FromLiteral");function sC(t){return[...new Set(Q1(t)?Tfo(t):Ia(t)?Ifo(t.anyOf):F1(t)?xfo(t.const):Qk(t)?["[number]"]:Uk(t)?["[number]"]:[])]}a(sC,"IndexPropertyKeys");p();function wfo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=vU(t,sC(e[o]),r);return n}a(wfo,"FromProperties");function Rfo(t,e,r){return wfo(t,e.properties,r)}a(Rfo,"FromMappedResult");function P$r(t,e,r){let n=Rfo(t,e,r);return qa(n)}a(P$r,"IndexFromMappedResult");function N$r(t,e){return t.map(r=>M$r(r,e))}a(N$r,"FromRest");function kfo(t){return t.filter(e=>!gU(e))}a(kfo,"FromIntersectRest");function Pfo(t,e){return iUe(kfo(N$r(t,e)))}a(Pfo,"FromIntersect");function Dfo(t){return t.some(e=>gU(e))?[]:t}a(Dfo,"FromUnionRest");function Nfo(t,e){return oM(Dfo(N$r(t,e)))}a(Nfo,"FromUnion");function Mfo(t,e){return e in t?t[e]:e==="[number]"?oM(t):Xo()}a(Mfo,"FromTuple");function Ofo(t,e){return e==="[number]"?t:Xo()}a(Ofo,"FromArray");function Lfo(t,e){return e in t?t[e]:Xo()}a(Lfo,"FromProperty");function M$r(t,e){return lf(t)?Pfo(t.allOf,e):Ia(t)?Nfo(t.anyOf,e):q1(t)?Mfo(t.items??[],e):Ok(t)?Ofo(t.items,e):Qp(t)?Lfo(t.properties,e):Xo()}a(M$r,"IndexFromPropertyKey");function VCe(t,e){return e.map(r=>M$r(t,r))}a(VCe,"IndexFromPropertyKeys");function D$r(t,e){return oM(VCe(t,e))}a(D$r,"FromSchema");function vU(t,e,r){if(Gf(t)||Gf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Pd(t)||!Pd(e))throw new qi(n);return au("Index",[t,e])}return Qu(e)?P$r(t,e,r):U1(e)?O$r(t,e,r):xt(Pd(e)?D$r(t,sC(e)):D$r(t,e),r)}a(vU,"Index");function Bfo(t,e,r){return{[e]:vU(t,[e],Fu(r))}}a(Bfo,"MappedIndexPropertyKey");function Ffo(t,e,r){return e.reduce((n,o)=>({...n,...Bfo(t,o,r)}),{})}a(Ffo,"MappedIndexPropertyKeys");function Ufo(t,e,r){return Ffo(t,e.keys,r)}a(Ufo,"MappedIndexProperties");function O$r(t,e,r){let n=Ufo(t,e,r);return qa(n)}a(O$r,"IndexFromMappedKey");p();function Uoe(t,e){return xt({[St]:"Iterator",type:"Iterator",items:t},e)}a(Uoe,"Iterator");p();function Qfo(t){return globalThis.Object.keys(t).filter(e=>!oC(t[e]))}a(Qfo,"RequiredArray");function qfo(t,e){let r=Qfo(t),n=r.length>0?{[St]:"Object",type:"object",required:r,properties:t}:{[St]:"Object",type:"object",properties:t};return xt(n,e)}a(qfo,"_Object");var nc=qfo;p();function oUe(t,e){return xt({[St]:"Promise",type:"Promise",item:t},e)}a(oUe,"Promise");p();p();function jfo(t){return xt(uf(t,[Mk]))}a(jfo,"RemoveReadonly");function Hfo(t){return xt({...t,[Mk]:"Readonly"})}a(Hfo,"AddReadonly");function Gfo(t,e){return e===!1?jfo(t):Hfo(t)}a(Gfo,"ReadonlyWithFlag");function aC(t,e){let r=e??!0;return Qu(t)?L$r(t,r):Gfo(t,r)}a(aC,"Readonly");function $fo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=aC(t[n],e);return r}a($fo,"FromProperties");function Vfo(t,e){return $fo(t.properties,e)}a(Vfo,"FromMappedResult");function L$r(t,e){let r=Vfo(t,e);return qa(r)}a(L$r,"ReadonlyFromMappedResult");p();function WI(t,e){return xt(t.length>0?{[St]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[St]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(WI,"Tuple");function B$r(t,e){return t in e?zI(t,e[t]):qa(e)}a(B$r,"FromMappedResult");function Wfo(t){return{[t]:la(t)}}a(Wfo,"MappedKeyToKnownMappedResultProperties");function zfo(t){let e={};for(let r of t)e[r]=la(r);return e}a(zfo,"MappedKeyToUnknownMappedResultProperties");function Yfo(t,e){return v$r(e,t)?Wfo(t):zfo(e)}a(Yfo,"MappedKeyToMappedResultProperties");function Kfo(t,e){let r=Yfo(t,e);return B$r(t,r)}a(Kfo,"FromMappedKey");function WCe(t,e){return e.map(r=>zI(t,r))}a(WCe,"FromRest");function Jfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=zI(t,e[n]);return r}a(Jfo,"FromProperties");function zI(t,e){let r={...e};return oC(e)?Fy(zI(t,uf(e,[mA]))):Roe(e)?aC(zI(t,uf(e,[Mk]))):Qu(e)?B$r(t,e.properties):U1(e)?Kfo(t,e.keys):Bk(e)?Moe(WCe(t,e.parameters),zI(t,e.returns),r):Fk(e)?iM(WCe(t,e.parameters),zI(t,e.returns),r):DW(e)?Noe(zI(t,e.items),r):MW(e)?Uoe(zI(t,e.items),r):lf(e)?Uy(WCe(t,e.allOf),r):Ia(e)?rc(WCe(t,e.anyOf),r):q1(e)?WI(WCe(t,e.items??[]),r):Qp(e)?nc(Jfo(t,e.properties),r):Ok(e)?Doe(zI(t,e.items),r):OW(e)?oUe(zI(t,e.item),r):e}a(zI,"FromSchemaType");function Zfo(t,e){let r={};for(let n of t)r[n]=zI(n,e);return r}a(Zfo,"MappedFunctionReturnType");function F$r(t,e,r){let n=Pd(t)?sC(t):t,o=e({[St]:"MappedKey",keys:n}),s=Zfo(n,o);return nc(s,r)}a(F$r,"Mapped");p();function Xfo(t){return xt(uf(t,[mA]))}a(Xfo,"RemoveOptional");function epo(t){return xt({...t,[mA]:"Optional"})}a(epo,"AddOptional");function tpo(t,e){return e===!1?Xfo(t):epo(t)}a(tpo,"OptionalWithFlag");function Fy(t,e){let r=e??!0;return Qu(t)?U$r(t,r):tpo(t,r)}a(Fy,"Optional");function rpo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Fy(t[n],e);return r}a(rpo,"FromProperties");function npo(t,e){return rpo(t.properties,e)}a(npo,"FromMappedResult");function U$r(t,e){let r=npo(t,e);return qa(r)}a(U$r,"OptionalFromMappedResult");p();function zCe(t,e={}){let r=t.every(o=>Qp(o)),n=Pd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return xt(e.unevaluatedProperties===!1||Pd(e.unevaluatedProperties)||r?{...n,[St]:"Intersect",type:"object",allOf:t}:{...n,[St]:"Intersect",allOf:t},e)}a(zCe,"IntersectCreate");function ipo(t){return t.every(e=>oC(e))}a(ipo,"IsIntersectOptional");function opo(t){return uf(t,[mA])}a(opo,"RemoveOptionalFromType");function Q$r(t){return t.map(e=>oC(e)?opo(e):e)}a(Q$r,"RemoveOptionalFromRest");function spo(t,e){return ipo(t)?Fy(zCe(Q$r(t),e)):zCe(Q$r(t),e)}a(spo,"ResolveIntersect");function iUe(t,e={}){if(t.length===1)return xt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>tc(r)))throw new Error("Cannot intersect transform types");return spo(t,e)}a(iUe,"IntersectEvaluated");p();function Uy(t,e){if(t.length===1)return xt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>tc(r)))throw new Error("Cannot intersect transform types");return zCe(t,e)}a(Uy,"Intersect");p();function YI(...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 xt({[St]:"Ref",$ref:e},r)}a(YI,"Ref");function apo(t,e){return au("Awaited",[au(t,e)])}a(apo,"FromComputed");function cpo(t){return au("Awaited",[YI(t)])}a(cpo,"FromRef");function lpo(t){return Uy(q$r(t))}a(lpo,"FromIntersect");function upo(t){return rc(q$r(t))}a(upo,"FromUnion");function dpo(t){return Qoe(t)}a(dpo,"FromPromise");function q$r(t){return t.map(e=>Qoe(e))}a(q$r,"FromRest");function Qoe(t,e){return xt(Lk(t)?apo(t.target,t.parameters):lf(t)?lpo(t.allOf):Ia(t)?upo(t.anyOf):OW(t)?dpo(t.item):Gf(t)?cpo(t.$ref):t,e)}a(Qoe,"Awaited");p();p();p();p();function j$r(t){let e=[];for(let r of t)e.push(cC(r));return e}a(j$r,"FromRest");function fpo(t){let e=j$r(t);return S$r(e)}a(fpo,"FromIntersect");function ppo(t){let e=j$r(t);return b$r(e)}a(ppo,"FromUnion");function hpo(t){return t.map((e,r)=>r.toString())}a(hpo,"FromTuple");function mpo(t){return["[number]"]}a(mpo,"FromArray");function gpo(t){return globalThis.Object.getOwnPropertyNames(t)}a(gpo,"FromProperties");function Apo(t){return UPt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(Apo,"FromPatternProperties");function cC(t){return lf(t)?fpo(t.allOf):Ia(t)?ppo(t.anyOf):q1(t)?hpo(t.items??[]):Ok(t)?mpo(t.items):Qp(t)?gpo(t.properties):LW(t)?Apo(t.patternProperties):[]}a(cC,"KeyOfPropertyKeys");var UPt=!1;function gB(t){UPt=!0;let e=cC(t);return UPt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(gB,"KeyOfPattern");function ypo(t,e){return au("KeyOf",[au(t,e)])}a(ypo,"FromComputed");function Epo(t){return au("KeyOf",[YI(t)])}a(Epo,"FromRef");function _po(t,e){let r=cC(t),n=vpo(r),o=oM(n);return xt(o,e)}a(_po,"KeyOfFromType");function vpo(t){return t.map(e=>e==="[number]"?VI():la(e))}a(vpo,"KeyOfPropertyKeysToRest");function qoe(t,e){return Lk(t)?ypo(t.target,t.parameters):Gf(t)?Epo(t.$ref):Qu(t)?H$r(t,e):_po(t,e)}a(qoe,"KeyOf");function Cpo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=qoe(t[n],Fu(e));return r}a(Cpo,"FromProperties");function bpo(t,e){return Cpo(t.properties,e)}a(bpo,"FromMappedResult");function H$r(t,e){let r=bpo(t,e);return qa(r)}a(H$r,"KeyOfFromMappedResult");p();function sUe(t){let e=cC(t),r=VCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(sUe,"KeyOfPropertyEntries");function Spo(t){let e=[];for(let r of t)e.push(...cC(r));return C$r(e)}a(Spo,"CompositeKeys");function Tpo(t){return t.filter(e=>!gU(e))}a(Tpo,"FilterNever");function Ipo(t,e){let r=[];for(let n of t)r.push(...VCe(n,[e]));return Tpo(r)}a(Ipo,"CompositeProperty");function xpo(t,e){let r={};for(let n of e)r[n]=iUe(Ipo(t,n));return r}a(xpo,"CompositeProperties");function G$r(t,e){let r=Spo(t),n=xpo(t,r);return nc(n,e)}a(G$r,"Composite");p();p();function aUe(t){return xt({[St]:"Date",type:"Date"},t)}a(aUe,"Date");p();function cUe(t){return xt({[St]:"Null",type:"null"},t)}a(cUe,"Null");p();function lUe(t){return xt({[St]:"Symbol",type:"symbol"},t)}a(lUe,"Symbol");p();function uUe(t){return xt({[St]:"Undefined",type:"undefined"},t)}a(uUe,"Undefined");p();function dUe(t){return xt({[St]:"Uint8Array",type:"Uint8Array"},t)}a(dUe,"Uint8Array");p();function jk(t){return xt({[St]:"Unknown"},t)}a(jk,"Unknown");function wpo(t){return t.map(e=>QPt(e,!1))}a(wpo,"FromArray");function Rpo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=aC(QPt(t[r],!1));return e}a(Rpo,"FromProperties");function fUe(t,e){return e===!0?t:aC(t)}a(fUe,"ConditionalReadonly");function QPt(t,e){return yPt(t)?fUe(_U(),e):_Pt(t)?fUe(_U(),e):Fp(t)?aC(WI(wpo(t))):cB(t)?dUe():PW(t)?aUe():Yc(t)?fUe(nc(Rpo(t)),e):EPt(t)?fUe(iM([],jk()),e):Up(t)?uUe():vPt(t)?cUe():CPt(t)?lUe():OCe(t)?Foe():L1(t)?la(t):aB(t)?la(t):ql(t)?la(t):nc({})}a(QPt,"FromValue");function $$r(t,e){return xt(QPt(t,!0),e)}a($$r,"Const");p();function V$r(t,e){return Bk(t)?WI(t.parameters,e):Xo(e)}a(V$r,"ConstructorParameters");p();function W$r(t,e){if(Up(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=>la(s));return rc(o,{...e,[$I]:"Enum"})}a(W$r,"Enum");p();p();p();var jPt=class extends qi{static{a(this,"ExtendsResolverError")}},wt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(wt||(wt={}));function KI(t){return t===wt.False?t:wt.True}a(KI,"IntoBooleanResult");function joe(t){throw new jPt(t)}a(joe,"Throw");function wh(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(wh,"IsStructuralRight");function Rh(t,e){return it.IsNever(e)?eVr(t,e):it.IsIntersect(e)?pUe(t,e):it.IsUnion(e)?VPt(t,e):it.IsUnknown(e)?iVr(t,e):it.IsAny(e)?$Pt(t,e):joe("StructuralRight")}a(Rh,"StructuralRight");function $Pt(t,e){return wt.True}a($Pt,"FromAnyRight");function kpo(t,e){return it.IsIntersect(e)?pUe(t,e):it.IsUnion(e)&&e.anyOf.some(r=>it.IsAny(r)||it.IsUnknown(r))?wt.True:it.IsUnion(e)?wt.Union:it.IsUnknown(e)||it.IsAny(e)?wt.True:wt.Union}a(kpo,"FromAny");function Ppo(t,e){return it.IsUnknown(t)?wt.False:it.IsAny(t)?wt.Union:it.IsNever(t)?wt.True:wt.False}a(Ppo,"FromArrayRight");function Dpo(t,e){return it.IsObject(e)&&hUe(e)?wt.True:wh(e)?Rh(t,e):it.IsArray(e)?KI(Jc(t.items,e.items)):wt.False}a(Dpo,"FromArray");function Npo(t,e){return wh(e)?Rh(t,e):it.IsAsyncIterator(e)?KI(Jc(t.items,e.items)):wt.False}a(Npo,"FromAsyncIterator");function Mpo(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsBigInt(e)?wt.True:wt.False}a(Mpo,"FromBigInt");function Z$r(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?wt.True:wt.False}a(Z$r,"FromBooleanRight");function Opo(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsBoolean(e)?wt.True:wt.False}a(Opo,"FromBoolean");function Lpo(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?wt.False:t.parameters.every((r,n)=>KI(Jc(e.parameters[n],r))===wt.True)?KI(Jc(t.returns,e.returns)):wt.False:wt.False}a(Lpo,"FromConstructor");function Bpo(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsDate(e)?wt.True:wt.False}a(Bpo,"FromDate");function Fpo(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?wt.False:t.parameters.every((r,n)=>KI(Jc(e.parameters[n],r))===wt.True)?KI(Jc(t.returns,e.returns)):wt.False:wt.False}a(Fpo,"FromFunction");function X$r(t,e){return it.IsLiteral(t)&&By.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?wt.True:wt.False}a(X$r,"FromIntegerRight");function Upo(t,e){return it.IsInteger(e)||it.IsNumber(e)?wt.True:wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):wt.False}a(Upo,"FromInteger");function pUe(t,e){return e.allOf.every(r=>Jc(t,r)===wt.True)?wt.True:wt.False}a(pUe,"FromIntersectRight");function Qpo(t,e){return t.allOf.some(r=>Jc(r,e)===wt.True)?wt.True:wt.False}a(Qpo,"FromIntersect");function qpo(t,e){return wh(e)?Rh(t,e):it.IsIterator(e)?KI(Jc(t.items,e.items)):wt.False}a(qpo,"FromIterator");function jpo(t,e){return it.IsLiteral(e)&&e.const===t.const?wt.True:wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsString(e)?nVr(t,e):it.IsNumber(e)?tVr(t,e):it.IsInteger(e)?X$r(t,e):it.IsBoolean(e)?Z$r(t,e):wt.False}a(jpo,"FromLiteral");function eVr(t,e){return wt.False}a(eVr,"FromNeverRight");function Hpo(t,e){return wt.True}a(Hpo,"FromNever");function z$r(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:jk()}a(z$r,"UnwrapTNot");function Gpo(t,e){return it.IsNot(t)?Jc(z$r(t),e):it.IsNot(e)?Jc(t,z$r(e)):joe("Invalid fallthrough for Not")}a(Gpo,"FromNot");function $po(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsNull(e)?wt.True:wt.False}a($po,"FromNull");function tVr(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?wt.True:wt.False}a(tVr,"FromNumberRight");function Vpo(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsInteger(e)||it.IsNumber(e)?wt.True:wt.False}a(Vpo,"FromNumber");function lC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(lC,"IsObjectPropertyCount");function Y$r(t){return hUe(t)}a(Y$r,"IsObjectStringLike");function K$r(t){return lC(t,0)||lC(t,1)&&"description"in t.properties&&it.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(it.IsString(t.properties.description.anyOf[0])&&it.IsUndefined(t.properties.description.anyOf[1])||it.IsString(t.properties.description.anyOf[1])&&it.IsUndefined(t.properties.description.anyOf[0]))}a(K$r,"IsObjectSymbolLike");function qPt(t){return lC(t,0)}a(qPt,"IsObjectNumberLike");function J$r(t){return lC(t,0)}a(J$r,"IsObjectBooleanLike");function Wpo(t){return lC(t,0)}a(Wpo,"IsObjectBigIntLike");function zpo(t){return lC(t,0)}a(zpo,"IsObjectDateLike");function Ypo(t){return hUe(t)}a(Ypo,"IsObjectUint8ArrayLike");function Kpo(t){let e=VI();return lC(t,0)||lC(t,1)&&"length"in t.properties&&KI(Jc(t.properties.length,e))===wt.True}a(Kpo,"IsObjectFunctionLike");function Jpo(t){return lC(t,0)}a(Jpo,"IsObjectConstructorLike");function hUe(t){let e=VI();return lC(t,0)||lC(t,1)&&"length"in t.properties&&KI(Jc(t.properties.length,e))===wt.True}a(hUe,"IsObjectArrayLike");function Zpo(t){let e=iM([_U()],_U());return lC(t,0)||lC(t,1)&&"then"in t.properties&&KI(Jc(t.properties.then,e))===wt.True}a(Zpo,"IsObjectPromiseLike");function rVr(t,e){return Jc(t,e)===wt.False||it.IsOptional(t)&&!it.IsOptional(e)?wt.False:wt.True}a(rVr,"Property");function Qy(t,e){return it.IsUnknown(t)?wt.False:it.IsAny(t)?wt.Union:it.IsNever(t)||it.IsLiteralString(t)&&Y$r(e)||it.IsLiteralNumber(t)&&qPt(e)||it.IsLiteralBoolean(t)&&J$r(e)||it.IsSymbol(t)&&K$r(e)||it.IsBigInt(t)&&Wpo(e)||it.IsString(t)&&Y$r(e)||it.IsSymbol(t)&&K$r(e)||it.IsNumber(t)&&qPt(e)||it.IsInteger(t)&&qPt(e)||it.IsBoolean(t)&&J$r(e)||it.IsUint8Array(t)&&Ypo(e)||it.IsDate(t)&&zpo(e)||it.IsConstructor(t)&&Jpo(e)||it.IsFunction(t)&&Kpo(e)?wt.True:it.IsRecord(t)&&it.IsString(HPt(t))?e[$I]==="Record"?wt.True:wt.False:it.IsRecord(t)&&it.IsNumber(HPt(t))&&lC(e,0)?wt.True:wt.False}a(Qy,"FromObjectRight");function Xpo(t,e){return wh(e)?Rh(t,e):it.IsRecord(e)?JI(t,e):it.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!it.IsOptional(e.properties[r]))return wt.False;if(it.IsOptional(e.properties[r]))return wt.True;if(rVr(t.properties[r],e.properties[r])===wt.False)return wt.False}return wt.True})():wt.False}a(Xpo,"FromObject");function eho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)&&Zpo(e)?wt.True:it.IsPromise(e)?KI(Jc(t.item,e.item)):wt.False}a(eho,"FromPromise");function HPt(t){return yU in t.patternProperties?VI():EU in t.patternProperties?b_():joe("Unknown record key pattern")}a(HPt,"RecordKey");function GPt(t){return yU in t.patternProperties?t.patternProperties[yU]:EU in t.patternProperties?t.patternProperties[EU]:joe("Unable to get record value schema")}a(GPt,"RecordValue");function JI(t,e){let[r,n]=[HPt(e),GPt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&KI(Jc(t,n))===wt.True?wt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Jc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(rVr(n,t.properties[o])===wt.False)return wt.False;return wt.True})():wt.False}a(JI,"FromRecordRight");function tho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?Jc(GPt(t),GPt(e)):wt.False}a(tho,"FromRecord");function rho(t,e){let r=it.IsRegExp(t)?b_():t,n=it.IsRegExp(e)?b_():e;return Jc(r,n)}a(rho,"FromRegExp");function nVr(t,e){return it.IsLiteral(t)&&By.IsString(t.const)||it.IsString(t)?wt.True:wt.False}a(nVr,"FromStringRight");function nho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsString(e)?wt.True:wt.False}a(nho,"FromString");function iho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsSymbol(e)?wt.True:wt.False}a(iho,"FromSymbol");function oho(t,e){return it.IsTemplateLiteral(t)?Jc(FW(t),e):it.IsTemplateLiteral(e)?Jc(t,FW(e)):joe("Invalid fallthrough for TemplateLiteral")}a(oho,"FromTemplateLiteral");function sho(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Jc(r,e.items)===wt.True)}a(sho,"IsArrayOfTuple");function aho(t,e){return it.IsNever(t)?wt.True:it.IsUnknown(t)?wt.False:it.IsAny(t)?wt.Union:wt.False}a(aho,"FromTupleRight");function cho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)&&hUe(e)||it.IsArray(e)&&sho(t,e)?wt.True:it.IsTuple(e)?By.IsUndefined(t.items)&&!By.IsUndefined(e.items)||!By.IsUndefined(t.items)&&By.IsUndefined(e.items)?wt.False:By.IsUndefined(t.items)&&!By.IsUndefined(e.items)||t.items.every((r,n)=>Jc(r,e.items[n])===wt.True)?wt.True:wt.False:wt.False}a(cho,"FromTuple");function lho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsUint8Array(e)?wt.True:wt.False}a(lho,"FromUint8Array");function uho(t,e){return wh(e)?Rh(t,e):it.IsObject(e)?Qy(t,e):it.IsRecord(e)?JI(t,e):it.IsVoid(e)?pho(t,e):it.IsUndefined(e)?wt.True:wt.False}a(uho,"FromUndefined");function VPt(t,e){return e.anyOf.some(r=>Jc(t,r)===wt.True)?wt.True:wt.False}a(VPt,"FromUnionRight");function dho(t,e){return t.anyOf.every(r=>Jc(r,e)===wt.True)?wt.True:wt.False}a(dho,"FromUnion");function iVr(t,e){return wt.True}a(iVr,"FromUnknownRight");function fho(t,e){return it.IsNever(e)?eVr(t,e):it.IsIntersect(e)?pUe(t,e):it.IsUnion(e)?VPt(t,e):it.IsAny(e)?$Pt(t,e):it.IsString(e)?nVr(t,e):it.IsNumber(e)?tVr(t,e):it.IsInteger(e)?X$r(t,e):it.IsBoolean(e)?Z$r(t,e):it.IsArray(e)?Ppo(t,e):it.IsTuple(e)?aho(t,e):it.IsObject(e)?Qy(t,e):it.IsUnknown(e)?wt.True:wt.False}a(fho,"FromUnknown");function pho(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?wt.True:wt.False}a(pho,"FromVoidRight");function hho(t,e){return it.IsIntersect(e)?pUe(t,e):it.IsUnion(e)?VPt(t,e):it.IsUnknown(e)?iVr(t,e):it.IsAny(e)?$Pt(t,e):it.IsObject(e)?Qy(t,e):it.IsVoid(e)?wt.True:wt.False}a(hho,"FromVoid");function Jc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?oho(t,e):it.IsRegExp(t)||it.IsRegExp(e)?rho(t,e):it.IsNot(t)||it.IsNot(e)?Gpo(t,e):it.IsAny(t)?kpo(t,e):it.IsArray(t)?Dpo(t,e):it.IsBigInt(t)?Mpo(t,e):it.IsBoolean(t)?Opo(t,e):it.IsAsyncIterator(t)?Npo(t,e):it.IsConstructor(t)?Lpo(t,e):it.IsDate(t)?Bpo(t,e):it.IsFunction(t)?Fpo(t,e):it.IsInteger(t)?Upo(t,e):it.IsIntersect(t)?Qpo(t,e):it.IsIterator(t)?qpo(t,e):it.IsLiteral(t)?jpo(t,e):it.IsNever(t)?Hpo(t,e):it.IsNull(t)?$po(t,e):it.IsNumber(t)?Vpo(t,e):it.IsObject(t)?Xpo(t,e):it.IsRecord(t)?tho(t,e):it.IsString(t)?nho(t,e):it.IsSymbol(t)?iho(t,e):it.IsTuple(t)?cho(t,e):it.IsPromise(t)?eho(t,e):it.IsUint8Array(t)?lho(t,e):it.IsUndefined(t)?uho(t,e):it.IsUnion(t)?dho(t,e):it.IsUnknown(t)?fho(t,e):it.IsVoid(t)?hho(t,e):joe(`Unknown left type operand '${t[St]}'`)}a(Jc,"Visit");function CU(t,e){return Jc(t,e)}a(CU,"ExtendsCheck");p();p();p();function mho(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Hoe(t[c],e,r,n,Fu(o));return s}a(mho,"FromProperties");function gho(t,e,r,n,o){return mho(t.properties,e,r,n,o)}a(gho,"FromMappedResult");function oVr(t,e,r,n,o){let s=gho(t,e,r,n,o);return qa(s)}a(oVr,"ExtendsFromMappedResult");function Aho(t,e,r,n){let o=CU(t,e);return o===wt.Union?rc([r,n]):o===wt.True?r:n}a(Aho,"ExtendsResolve");function Hoe(t,e,r,n,o){return Qu(t)?oVr(t,e,r,n,o):U1(t)?xt(sVr(t,e,r,n,o)):xt(Aho(t,e,r,n),o)}a(Hoe,"Extends");function yho(t,e,r,n,o){return{[t]:Hoe(la(t),e,r,n,Fu(o))}}a(yho,"FromPropertyKey");function Eho(t,e,r,n,o){return t.reduce((s,c)=>({...s,...yho(c,e,r,n,o)}),{})}a(Eho,"FromPropertyKeys");function _ho(t,e,r,n,o){return Eho(t.keys,e,r,n,o)}a(_ho,"FromMappedKey");function sVr(t,e,r,n,o){let s=_ho(t,e,r,n,o);return qa(s)}a(sVr,"ExtendsFromMappedKey");p();function vho(t){return t.allOf.every(e=>AB(e))}a(vho,"Intersect");function Cho(t){return t.anyOf.some(e=>AB(e))}a(Cho,"Union");function bho(t){return!AB(t.not)}a(bho,"Not");function AB(t){return t[St]==="Intersect"?vho(t):t[St]==="Union"?Cho(t):t[St]==="Not"?bho(t):t[St]==="Undefined"}a(AB,"ExtendsUndefinedCheck");p();function aVr(t,e){return Goe(FW(t),e)}a(aVr,"ExcludeFromTemplateLiteral");function Sho(t,e){let r=t.filter(n=>CU(n,e)===wt.False);return r.length===1?r[0]:rc(r)}a(Sho,"ExcludeRest");function Goe(t,e,r={}){return Q1(t)?xt(aVr(t,e),r):Qu(t)?xt(cVr(t,e),r):xt(Ia(t)?Sho(t.anyOf,e):CU(t,e)!==wt.False?Xo():t,r)}a(Goe,"Exclude");function Tho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Goe(t[n],e);return r}a(Tho,"FromProperties");function Iho(t,e){return Tho(t.properties,e)}a(Iho,"FromMappedResult");function cVr(t,e){let r=Iho(t,e);return qa(r)}a(cVr,"ExcludeFromMappedResult");p();p();p();function lVr(t,e){return $oe(FW(t),e)}a(lVr,"ExtractFromTemplateLiteral");function xho(t,e){let r=t.filter(n=>CU(n,e)!==wt.False);return r.length===1?r[0]:rc(r)}a(xho,"ExtractRest");function $oe(t,e,r){return Q1(t)?xt(lVr(t,e),r):Qu(t)?xt(uVr(t,e),r):xt(Ia(t)?xho(t.anyOf,e):CU(t,e)!==wt.False?t:Xo(),r)}a($oe,"Extract");function who(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=$oe(t[n],e);return r}a(who,"FromProperties");function Rho(t,e){return who(t.properties,e)}a(Rho,"FromMappedResult");function uVr(t,e){let r=Rho(t,e);return qa(r)}a(uVr,"ExtractFromMappedResult");p();function dVr(t,e){return Bk(t)?xt(t.returns,e):Xo(e)}a(dVr,"InstanceType");p();p();function mUe(t){return aC(Fy(t))}a(mUe,"ReadonlyOptional");p();function UW(t,e,r){return xt({[St]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(UW,"RecordCreateFromPattern");function WPt(t,e,r){let n={};for(let o of t)n[o]=e;return nc(n,{...r,[$I]:"Record"})}a(WPt,"RecordCreateFromKeys");function kho(t,e,r){return tUe(t)?WPt(sC(t),e,r):UW(t.pattern,e,r)}a(kho,"FromTemplateLiteralKey");function Pho(t,e,r){return WPt(sC(rc(t)),e,r)}a(Pho,"FromUnionKey");function Dho(t,e,r){return WPt([t.toString()],e,r)}a(Dho,"FromLiteralKey");function Nho(t,e,r){return UW(t.source,e,r)}a(Nho,"FromRegExpKey");function Mho(t,e,r){let n=Up(t.pattern)?EU:t.pattern;return UW(n,e,r)}a(Mho,"FromStringKey");function Oho(t,e,r){return UW(EU,e,r)}a(Oho,"FromAnyKey");function Lho(t,e,r){return UW(_$r,e,r)}a(Lho,"FromNeverKey");function Bho(t,e,r){return nc({true:e,false:e},r)}a(Bho,"FromBooleanKey");function Fho(t,e,r){return UW(yU,e,r)}a(Fho,"FromIntegerKey");function Uho(t,e,r){return UW(yU,e,r)}a(Uho,"FromNumberKey");function gUe(t,e,r={}){return Ia(t)?Pho(t.anyOf,e,r):Q1(t)?kho(t,e,r):F1(t)?Dho(t.const,e,r):dB(t)?Bho(t,e,r):Uk(t)?Fho(t,e,r):Qk(t)?Uho(t,e,r):IPt(t)?Nho(t,e,r):fB(t)?Mho(t,e,r):SPt(t)?Oho(t,e,r):gU(t)?Lho(t,e,r):Xo(r)}a(gUe,"Record");function AUe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(AUe,"RecordPattern");function fVr(t){let e=AUe(t);return e===EU?b_():e===yU?VI():b_({pattern:e})}a(fVr,"RecordKey");function yUe(t){return t.patternProperties[AUe(t)]}a(yUe,"RecordValue");function Qho(t,e){return e.parameters=YCe(t,e.parameters),e.returns=Hk(t,e.returns),e}a(Qho,"FromConstructor");function qho(t,e){return e.parameters=YCe(t,e.parameters),e.returns=Hk(t,e.returns),e}a(qho,"FromFunction");function jho(t,e){return e.allOf=YCe(t,e.allOf),e}a(jho,"FromIntersect");function Hho(t,e){return e.anyOf=YCe(t,e.anyOf),e}a(Hho,"FromUnion");function Gho(t,e){return Up(e.items)||(e.items=YCe(t,e.items)),e}a(Gho,"FromTuple");function $ho(t,e){return e.items=Hk(t,e.items),e}a($ho,"FromArray");function Vho(t,e){return e.items=Hk(t,e.items),e}a(Vho,"FromAsyncIterator");function Who(t,e){return e.items=Hk(t,e.items),e}a(Who,"FromIterator");function zho(t,e){return e.item=Hk(t,e.item),e}a(zho,"FromPromise");function Yho(t,e){let r=Xho(t,e.properties);return{...e,...nc(r)}}a(Yho,"FromObject");function Kho(t,e){let r=Hk(t,fVr(e)),n=Hk(t,yUe(e)),o=gUe(r,n);return{...e,...o}}a(Kho,"FromRecord");function Jho(t,e){return e.index in t?t[e.index]:jk()}a(Jho,"FromArgument");function Zho(t,e){let r=Roe(e),n=oC(e),o=Hk(t,e);return r&&n?mUe(o):r&&!n?aC(o):!r&&n?Fy(o):o}a(Zho,"FromProperty");function Xho(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Zho(t,e[n])}),{})}a(Xho,"FromProperties");function YCe(t,e){return e.map(r=>Hk(t,r))}a(YCe,"FromTypes");function Hk(t,e){return Bk(e)?Qho(t,e):Fk(e)?qho(t,e):lf(e)?jho(t,e):Ia(e)?Hho(t,e):q1(e)?Gho(t,e):Ok(e)?$ho(t,e):DW(e)?Vho(t,e):MW(e)?Who(t,e):OW(e)?zho(t,e):Qp(e)?Yho(t,e):LW(e)?Kho(t,e):TPt(e)?Jho(t,e):e}a(Hk,"FromType");function pVr(t,e){return Hk(e,xoe(t))}a(pVr,"Instantiate");p();function hVr(t){return xt({[St]:"Integer",type:"integer"},t)}a(hVr,"Integer");p();p();p();function emo(t,e,r){return{[t]:Gk(la(t),e,Fu(r))}}a(emo,"MappedIntrinsicPropertyKey");function tmo(t,e,r){return t.reduce((o,s)=>({...o,...emo(s,e,r)}),{})}a(tmo,"MappedIntrinsicPropertyKeys");function rmo(t,e,r){return tmo(t.keys,e,r)}a(rmo,"MappedIntrinsicProperties");function mVr(t,e,r){let n=rmo(t,e,r);return qa(n)}a(mVr,"IntrinsicFromMappedKey");function nmo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(nmo,"ApplyUncapitalize");function imo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(imo,"ApplyCapitalize");function omo(t){return t.toUpperCase()}a(omo,"ApplyUppercase");function smo(t){return t.toLowerCase()}a(smo,"ApplyLowercase");function amo(t,e,r){let n=Loe(t.pattern);if(!BW(n))return{...t,pattern:gVr(t.pattern,e)};let c=[...$Ce(n)].map(d=>la(d)),l=AVr(c,e),u=rc(l);return nUe([u],r)}a(amo,"FromTemplateLiteral");function gVr(t,e){return typeof t=="string"?e==="Uncapitalize"?nmo(t):e==="Capitalize"?imo(t):e==="Uppercase"?omo(t):e==="Lowercase"?smo(t):t:t.toString()}a(gVr,"FromLiteralValue");function AVr(t,e){return t.map(r=>Gk(r,e))}a(AVr,"FromRest");function Gk(t,e,r={}){return U1(t)?mVr(t,e,r):Q1(t)?amo(t,e,r):Ia(t)?rc(AVr(t.anyOf,e),r):F1(t)?la(gVr(t.const,e),r):xt(t,r)}a(Gk,"Intrinsic");function yVr(t,e={}){return Gk(t,"Capitalize",e)}a(yVr,"Capitalize");p();function EVr(t,e={}){return Gk(t,"Lowercase",e)}a(EVr,"Lowercase");p();function _Vr(t,e={}){return Gk(t,"Uncapitalize",e)}a(_Vr,"Uncapitalize");p();function vVr(t,e={}){return Gk(t,"Uppercase",e)}a(vVr,"Uppercase");p();p();p();p();p();function cmo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=bU(t[o],e,Fu(r));return n}a(cmo,"FromProperties");function lmo(t,e,r){return cmo(t.properties,e,r)}a(lmo,"FromMappedResult");function CVr(t,e,r){let n=lmo(t,e,r);return qa(n)}a(CVr,"OmitFromMappedResult");function umo(t,e){return t.map(r=>zPt(r,e))}a(umo,"FromIntersect");function dmo(t,e){return t.map(r=>zPt(r,e))}a(dmo,"FromUnion");function fmo(t,e){let{[e]:r,...n}=t;return n}a(fmo,"FromProperty");function pmo(t,e){return e.reduce((r,n)=>fmo(r,n),t)}a(pmo,"FromProperties");function hmo(t,e,r){let n=uf(t,[kd,"$id","required","properties"]),o=pmo(r,e);return nc(o,n)}a(hmo,"FromObject");function mmo(t){let e=t.reduce((r,n)=>Z9e(n)?[...r,la(n)]:r,[]);return rc(e)}a(mmo,"UnionFromPropertyKeys");function zPt(t,e){return lf(t)?Uy(umo(t.allOf,e)):Ia(t)?rc(dmo(t.anyOf,e)):Qp(t)?hmo(t,e,t.properties):nc({})}a(zPt,"OmitResolve");function bU(t,e,r){let n=Fp(e)?mmo(e):e,o=Pd(e)?sC(e):e,s=Gf(t),c=Gf(e);return Qu(t)?CVr(t,o,r):U1(e)?bVr(t,e,r):s&&c?au("Omit",[t,n],r):!s&&c?au("Omit",[t,n],r):s&&!c?au("Omit",[t,n],r):xt({...zPt(t,o),...r})}a(bU,"Omit");function gmo(t,e,r){return{[e]:bU(t,[e],Fu(r))}}a(gmo,"FromPropertyKey");function Amo(t,e,r){return e.reduce((n,o)=>({...n,...gmo(t,o,r)}),{})}a(Amo,"FromPropertyKeys");function ymo(t,e,r){return Amo(t,e.keys,r)}a(ymo,"FromMappedKey");function bVr(t,e,r){let n=ymo(t,e,r);return qa(n)}a(bVr,"OmitFromMappedKey");p();p();p();function Emo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=SU(t[o],e,Fu(r));return n}a(Emo,"FromProperties");function _mo(t,e,r){return Emo(t.properties,e,r)}a(_mo,"FromMappedResult");function SVr(t,e,r){let n=_mo(t,e,r);return qa(n)}a(SVr,"PickFromMappedResult");function vmo(t,e){return t.map(r=>YPt(r,e))}a(vmo,"FromIntersect");function Cmo(t,e){return t.map(r=>YPt(r,e))}a(Cmo,"FromUnion");function bmo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(bmo,"FromProperties");function Smo(t,e,r){let n=uf(t,[kd,"$id","required","properties"]),o=bmo(r,e);return nc(o,n)}a(Smo,"FromObject");function Tmo(t){let e=t.reduce((r,n)=>Z9e(n)?[...r,la(n)]:r,[]);return rc(e)}a(Tmo,"UnionFromPropertyKeys");function YPt(t,e){return lf(t)?Uy(vmo(t.allOf,e)):Ia(t)?rc(Cmo(t.anyOf,e)):Qp(t)?Smo(t,e,t.properties):nc({})}a(YPt,"PickResolve");function SU(t,e,r){let n=Fp(e)?Tmo(e):e,o=Pd(e)?sC(e):e,s=Gf(t),c=Gf(e);return Qu(t)?SVr(t,o,r):U1(e)?TVr(t,e,r):s&&c?au("Pick",[t,n],r):!s&&c?au("Pick",[t,n],r):s&&!c?au("Pick",[t,n],r):xt({...YPt(t,o),...r})}a(SU,"Pick");function Imo(t,e,r){return{[e]:SU(t,[e],Fu(r))}}a(Imo,"FromPropertyKey");function xmo(t,e,r){return e.reduce((n,o)=>({...n,...Imo(t,o,r)}),{})}a(xmo,"FromPropertyKeys");function wmo(t,e,r){return xmo(t,e.keys,r)}a(wmo,"FromMappedKey");function TVr(t,e,r){let n=wmo(t,e,r);return qa(n)}a(TVr,"PickFromMappedKey");p();p();function Rmo(t,e){return au("Partial",[au(t,e)])}a(Rmo,"FromComputed");function kmo(t){return au("Partial",[YI(t)])}a(kmo,"FromRef");function Pmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Fy(t[r]);return e}a(Pmo,"FromProperties");function Dmo(t,e){let r=uf(t,[kd,"$id","required","properties"]),n=Pmo(e);return nc(n,r)}a(Dmo,"FromObject");function IVr(t){return t.map(e=>xVr(e))}a(IVr,"FromRest");function xVr(t){return Lk(t)?Rmo(t.target,t.parameters):Gf(t)?kmo(t.$ref):lf(t)?Uy(IVr(t.allOf)):Ia(t)?rc(IVr(t.anyOf)):Qp(t)?Dmo(t,t.properties):NW(t)||dB(t)||Uk(t)||F1(t)||FCe(t)||Qk(t)||fB(t)||UCe(t)||pB(t)?t:nc({})}a(xVr,"PartialResolve");function Voe(t,e){return Qu(t)?wVr(t,e):xt({...xVr(t),...e})}a(Voe,"Partial");function Nmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Voe(t[n],Fu(e));return r}a(Nmo,"FromProperties");function Mmo(t,e){return Nmo(t.properties,e)}a(Mmo,"FromMappedResult");function wVr(t,e){let r=Mmo(t,e);return qa(r)}a(wVr,"PartialFromMappedResult");p();p();function Omo(t,e){return au("Required",[au(t,e)])}a(Omo,"FromComputed");function Lmo(t){return au("Required",[YI(t)])}a(Lmo,"FromRef");function Bmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=uf(t[r],[mA]);return e}a(Bmo,"FromProperties");function Fmo(t,e){let r=uf(t,[kd,"$id","required","properties"]),n=Bmo(e);return nc(n,r)}a(Fmo,"FromObject");function RVr(t){return t.map(e=>kVr(e))}a(RVr,"FromRest");function kVr(t){return Lk(t)?Omo(t.target,t.parameters):Gf(t)?Lmo(t.$ref):lf(t)?Uy(RVr(t.allOf)):Ia(t)?rc(RVr(t.anyOf)):Qp(t)?Fmo(t,t.properties):NW(t)||dB(t)||Uk(t)||F1(t)||FCe(t)||Qk(t)||fB(t)||UCe(t)||pB(t)?t:nc({})}a(kVr,"RequiredResolve");function Woe(t,e){return Qu(t)?PVr(t,e):xt({...kVr(t),...e})}a(Woe,"Required");function Umo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Woe(t[n],e);return r}a(Umo,"FromProperties");function Qmo(t,e){return Umo(t.properties,e)}a(Qmo,"FromMappedResult");function PVr(t,e){let r=Qmo(t,e);return qa(r)}a(PVr,"RequiredFromMappedResult");function qmo(t,e){return e.map(r=>Gf(r)?KPt(t,r.$ref):j1(t,r))}a(qmo,"DereferenceParameters");function KPt(t,e){return e in t?Gf(t[e])?KPt(t,t[e].$ref):j1(t,t[e]):Xo()}a(KPt,"Dereference");function jmo(t){return Qoe(t[0])}a(jmo,"FromAwaited");function Hmo(t){return vU(t[0],t[1])}a(Hmo,"FromIndex");function Gmo(t){return qoe(t[0])}a(Gmo,"FromKeyOf");function $mo(t){return Voe(t[0])}a($mo,"FromPartial");function Vmo(t){return bU(t[0],t[1])}a(Vmo,"FromOmit");function Wmo(t){return SU(t[0],t[1])}a(Wmo,"FromPick");function zmo(t){return Woe(t[0])}a(zmo,"FromRequired");function Ymo(t,e,r){let n=qmo(t,r);return e==="Awaited"?jmo(n):e==="Index"?Hmo(n):e==="KeyOf"?Gmo(n):e==="Partial"?$mo(n):e==="Omit"?Vmo(n):e==="Pick"?Wmo(n):e==="Required"?zmo(n):Xo()}a(Ymo,"FromComputed");function Kmo(t,e){return Doe(j1(t,e))}a(Kmo,"FromArray");function Jmo(t,e){return Noe(j1(t,e))}a(Jmo,"FromAsyncIterator");function Zmo(t,e,r){return Moe(KCe(t,e),j1(t,r))}a(Zmo,"FromConstructor");function Xmo(t,e,r){return iM(KCe(t,e),j1(t,r))}a(Xmo,"FromFunction");function e0o(t,e){return Uy(KCe(t,e))}a(e0o,"FromIntersect");function t0o(t,e){return Uoe(j1(t,e))}a(t0o,"FromIterator");function r0o(t,e){return nc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:j1(t,e[n])}),{}))}a(r0o,"FromObject");function n0o(t,e){let[r,n]=[j1(t,yUe(e)),AUe(e)],o=xoe(e);return o.patternProperties[n]=r,o}a(n0o,"FromRecord");function i0o(t,e){return Gf(e)?{...KPt(t,e.$ref),[kd]:e[kd]}:e}a(i0o,"FromTransform");function o0o(t,e){return WI(KCe(t,e))}a(o0o,"FromTuple");function s0o(t,e){return rc(KCe(t,e))}a(s0o,"FromUnion");function KCe(t,e){return e.map(r=>j1(t,r))}a(KCe,"FromTypes");function j1(t,e){return oC(e)?xt(j1(t,uf(e,[mA])),e):Roe(e)?xt(j1(t,uf(e,[Mk])),e):tc(e)?xt(i0o(t,e),e):Ok(e)?xt(Kmo(t,e.items),e):DW(e)?xt(Jmo(t,e.items),e):Lk(e)?xt(Ymo(t,e.target,e.parameters)):Bk(e)?xt(Zmo(t,e.parameters,e.returns),e):Fk(e)?xt(Xmo(t,e.parameters,e.returns),e):lf(e)?xt(e0o(t,e.allOf),e):MW(e)?xt(t0o(t,e.items),e):Qp(e)?xt(r0o(t,e.properties),e):LW(e)?xt(n0o(t,e)):q1(e)?xt(o0o(t,e.items||[]),e):Ia(e)?xt(s0o(t,e.anyOf),e):e}a(j1,"FromType");function a0o(t,e){return e in t?j1(t,t[e]):Xo()}a(a0o,"ComputeType");function DVr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:a0o(t,r)}),{})}a(DVr,"ComputeModuleProperties");var JPt=class{static{a(this,"TModule")}constructor(e){let r=DVr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:xt(this.$defs[e],r)};return xt({[St]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function NVr(t){return new JPt(t)}a(NVr,"Module");p();function MVr(t,e){return xt({[St]:"Not",not:t},e)}a(MVr,"Not");p();function OVr(t,e){return Fk(t)?WI(t.parameters,e):Xo()}a(OVr,"Parameters");p();var c0o=0;function LVr(t,e={}){Up(e.$id)&&(e.$id=`T${c0o++}`);let r=xoe(t({[St]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,xt({[$I]:"Recursive",...r},e)}a(LVr,"Recursive");p();function BVr(t,e){let r=ql(t)?new globalThis.RegExp(t):t;return xt({[St]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(BVr,"RegExp");p();function l0o(t){return lf(t)?t.allOf:Ia(t)?t.anyOf:q1(t)?t.items??[]:[]}a(l0o,"RestResolve");function FVr(t){return l0o(t)}a(FVr,"Rest");p();function UVr(t,e){return Fk(t)?xt(t.returns,e):Xo(e)}a(UVr,"ReturnType");p();var ZPt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new XPt(this.schema,e)}},XPt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[kd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[kd].Decode(c)),"Decode")};return{...r,[kd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[kd]:n}}Encode(e){return tc(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function QVr(t){return new ZPt(t)}a(QVr,"Transform");p();function qVr(t={}){return xt({[St]:t[St]??"Unsafe"},t)}a(qVr,"Unsafe");p();function jVr(t){return xt({[St]:"Void",type:"void"},t)}a(jVr,"Void");p();var e2t={};ki(e2t,{Any:()=>_U,Argument:()=>T$r,Array:()=>Doe,AsyncIterator:()=>Noe,Awaited:()=>Qoe,BigInt:()=>Foe,Boolean:()=>rUe,Capitalize:()=>yVr,Composite:()=>G$r,Const:()=>$$r,Constructor:()=>Moe,ConstructorParameters:()=>V$r,Date:()=>aUe,Enum:()=>W$r,Exclude:()=>Goe,Extends:()=>Hoe,Extract:()=>$oe,Function:()=>iM,Index:()=>vU,InstanceType:()=>dVr,Instantiate:()=>pVr,Integer:()=>hVr,Intersect:()=>Uy,Iterator:()=>Uoe,KeyOf:()=>qoe,Literal:()=>la,Lowercase:()=>EVr,Mapped:()=>F$r,Module:()=>NVr,Never:()=>Xo,Not:()=>MVr,Null:()=>cUe,Number:()=>VI,Object:()=>nc,Omit:()=>bU,Optional:()=>Fy,Parameters:()=>OVr,Partial:()=>Voe,Pick:()=>SU,Promise:()=>oUe,Readonly:()=>aC,ReadonlyOptional:()=>mUe,Record:()=>gUe,Recursive:()=>LVr,Ref:()=>YI,RegExp:()=>BVr,Required:()=>Woe,Rest:()=>FVr,ReturnType:()=>UVr,String:()=>b_,Symbol:()=>lUe,TemplateLiteral:()=>nUe,Transform:()=>QVr,Tuple:()=>WI,Uint8Array:()=>dUe,Uncapitalize:()=>_Vr,Undefined:()=>uUe,Union:()=>rc,Unknown:()=>jk,Unsafe:()=>qVr,Uppercase:()=>vVr,Void:()=>jVr});p();var S=e2t;p();p();function u0o(t){switch(t.errorType){case bt.ArrayContains:return"Expected array to contain at least one matching value";case bt.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case bt.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case bt.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case bt.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case bt.ArrayUniqueItems:return"Expected array elements to be unique";case bt.Array:return"Expected array";case bt.AsyncIterator:return"Expected AsyncIterator";case bt.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case bt.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case bt.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case bt.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case bt.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case bt.BigInt:return"Expected bigint";case bt.Boolean:return"Expected boolean";case bt.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case bt.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case bt.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case bt.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case bt.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case bt.Date:return"Expected Date";case bt.Function:return"Expected function";case bt.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case bt.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case bt.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case bt.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case bt.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case bt.Integer:return"Expected integer";case bt.IntersectUnevaluatedProperties:return"Unexpected property";case bt.Intersect:return"Expected all values to match";case bt.Iterator:return"Expected Iterator";case bt.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case bt.Never:return"Never";case bt.Not:return"Value should not match";case bt.Null:return"Expected null";case bt.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case bt.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case bt.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case bt.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case bt.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case bt.Number:return"Expected number";case bt.Object:return"Expected object";case bt.ObjectAdditionalProperties:return"Unexpected property";case bt.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case bt.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case bt.ObjectRequiredProperty:return"Expected required property";case bt.Promise:return"Expected Promise";case bt.RegExp:return"Expected string to match regular expression";case bt.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case bt.StringFormat:return`Expected string to match '${t.schema.format}' format`;case bt.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case bt.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case bt.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case bt.String:return"Expected string";case bt.Symbol:return"Expected symbol";case bt.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case bt.Tuple:return"Expected tuple";case bt.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case bt.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case bt.Uint8Array:return"Expected Uint8Array";case bt.Undefined:return"Expected undefined";case bt.Union:return"Expected union value";case bt.Void:return"Expected void";case bt.Kind:return`Expected kind '${t.schema[St]}'`;default:return"Unknown error type"}}a(u0o,"DefaultErrorFunction");var d0o=u0o;function HVr(){return d0o}a(HVr,"GetErrorFunction");p();var t2t=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function f0o(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new t2t(t);return xa(r,e)}a(f0o,"Resolve");function K0(t,e){return!Ta(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(K0,"Pushref");function xa(t,e){return t[St]==="This"||t[St]==="Ref"?f0o(t,e):t}a(xa,"Deref");p();var r2t=class extends qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},H1;(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"})(H1||(H1={}));var zoe=BigInt("14695981039346656037"),[p0o,h0o]=[BigInt("1099511628211"),BigInt("18446744073709551616")],m0o=Array.from({length:256}).map((t,e)=>BigInt(e)),GVr=new Float64Array(1),$Vr=new DataView(GVr.buffer),VVr=new Uint8Array(GVr.buffer);function*g0o(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(g0o,"NumberToBytes");function A0o(t){qy(H1.Array);for(let e of t)Yoe(e)}a(A0o,"ArrayType");function y0o(t){qy(H1.Boolean),qy(t?1:0)}a(y0o,"BooleanType");function E0o(t){qy(H1.BigInt),$Vr.setBigInt64(0,t);for(let e of VVr)qy(e)}a(E0o,"BigIntType");function _0o(t){qy(H1.Date),Yoe(t.getTime())}a(_0o,"DateType");function v0o(t){qy(H1.Null)}a(v0o,"NullType");function C0o(t){qy(H1.Number),$Vr.setFloat64(0,t);for(let e of VVr)qy(e)}a(C0o,"NumberType");function b0o(t){qy(H1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Yoe(e),Yoe(t[e])}a(b0o,"ObjectType");function S0o(t){qy(H1.String);for(let e=0;e=t.minItems)||zs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!J0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=TU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(zs(t.contains)||si(t.minContains)||si(t.maxContains)))return!0;let n=zs(t.contains)?t.contains:Xo(),o=r.reduce((s,c)=>J0(n,e,c)?s+1:s,0);return!(o===0||si(t.minContains)&&ot.maxContains)}a(P0o,"FromArray");function D0o(t,e,r){return z9e(r)}a(D0o,"FromAsyncIterator");function N0o(t,e,r){return!(!hA(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(N0o,"FromBigInt");function M0o(t,e,r){return nM(r)}a(M0o,"FromBoolean");function O0o(t,e,r){return J0(t.returns,e,r.prototype)}a(O0o,"FromConstructor");function L0o(t,e,r){return!(!v_(r)||zs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||zs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||zs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||zs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(L0o,"FromDate");function B0o(t,e,r){return mU(r)}a(B0o,"FromFunction");function F0o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return J0(o,[...e,...n],r)}a(F0o,"FromImport");function U0o(t,e,r){return!(!J9e(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(U0o,"FromInteger");function Q0o(t,e,r){let n=t.allOf.every(o=>J0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(gB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Pd(t.unevaluatedProperties)){let o=new RegExp(gB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||J0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Q0o,"FromIntersect");function q0o(t,e,r){return Y9e(r)}a(q0o,"FromIterator");function j0o(t,e,r){return r===t.const}a(j0o,"FromLiteral");function H0o(t,e,r){return!1}a(H0o,"FromNever");function G0o(t,e,r){return!J0(t.not,e,r)}a(G0o,"FromNot");function $0o(t,e,r){return lB(r)}a($0o,"FromNull");function V0o(t,e,r){return!(!su.IsNumberLike(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(V0o,"FromNumber");function W0o(t,e,r){if(!su.IsObjectLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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(!J0(s,e,r[o])||(AB(s)||w0o(s))&&!(o in r))return!1}else if(su.IsExactOptionalProperty(r,o)&&!J0(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)||J0(t.additionalProperties,e,r[s])):!0}a(W0o,"FromObject");function z0o(t,e,r){return K9e(r)}a(z0o,"FromPromise");function Y0o(t,e,r){if(!su.IsRecordLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(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)?J0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:J0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Y0o,"FromRecord");function K0o(t,e,r){return J0(xa(t,e),e,r)}a(K0o,"FromRef");function J0o(t,e,r){let n=new RegExp(t.source,t.flags);return zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(J0o,"FromRegExp");function Z0o(t,e,r){return!Ta(r)||zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)||zs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:zs(t.format)?qk.Has(t.format)?qk.Get(t.format)(r):!1:!0}a(Z0o,"FromString");function X0o(t,e,r){return uB(r)}a(X0o,"FromSymbol");function ego(t,e,r){return Ta(r)&&new RegExp(t.pattern).test(r)}a(ego,"FromTemplateLiteral");function tgo(t,e,r){return J0(xa(t,e),e,r)}a(tgo,"FromThis");function rgo(t,e,r){if(!Pi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nJ0(n,e,r))}a(igo,"FromUnion");function ogo(t,e,r){return!(!woe(r)||zs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||zs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(ogo,"FromUint8Array");function sgo(t,e,r){return!0}a(sgo,"FromUnknown");function ago(t,e,r){return su.IsVoidLike(r)}a(ago,"FromVoid");function cgo(t,e,r){return C_.Has(t[St])?C_.Get(t[St])(t,r):!1}a(cgo,"FromKind");function J0(t,e,r){let n=zs(t.$id)?K0(t,e):e,o=t;switch(o[St]){case"Any":return R0o(o,n,r);case"Argument":return k0o(o,n,r);case"Array":return P0o(o,n,r);case"AsyncIterator":return D0o(o,n,r);case"BigInt":return N0o(o,n,r);case"Boolean":return M0o(o,n,r);case"Constructor":return O0o(o,n,r);case"Date":return L0o(o,n,r);case"Function":return B0o(o,n,r);case"Import":return F0o(o,n,r);case"Integer":return U0o(o,n,r);case"Intersect":return Q0o(o,n,r);case"Iterator":return q0o(o,n,r);case"Literal":return j0o(o,n,r);case"Never":return H0o(o,n,r);case"Not":return G0o(o,n,r);case"Null":return $0o(o,n,r);case"Number":return V0o(o,n,r);case"Object":return W0o(o,n,r);case"Promise":return z0o(o,n,r);case"Record":return Y0o(o,n,r);case"Ref":return K0o(o,n,r);case"RegExp":return J0o(o,n,r);case"String":return Z0o(o,n,r);case"Symbol":return X0o(o,n,r);case"TemplateLiteral":return ego(o,n,r);case"This":return tgo(o,n,r);case"Tuple":return rgo(o,n,r);case"Undefined":return ngo(o,n,r);case"Union":return igo(o,n,r);case"Uint8Array":return ogo(o,n,r);case"Unknown":return sgo(o,n,r);case"Void":return ago(o,n,r);default:if(!C_.Has(o[St]))throw new n2t(o);return cgo(o,n,r)}}a(J0,"Visit");function es(...t){return t.length===3?J0(t[0],t[1],t[2]):J0(t[0],[],t[1])}a(es,"Check");var bt;(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"})(bt||(bt={}));var i2t=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function yB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(yB,"EscapeKey");function Ys(t){return t!==void 0}a(Ys,"IsDefined");var IU=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 sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:HVr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*lgo(t,e,r,n){}a(lgo,"FromAny");function*ugo(t,e,r,n){}a(ugo,"FromArgument");function*dgo(t,e,r,n){if(!Pi(n))return yield sn(bt.Array,t,r,n);Ys(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(bt.ArrayMinItems,t,r,n)),Ys(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(bt.ArrayMaxItems,t,r,n));for(let c=0;cZ0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(bt.ArrayContains,t,r,n)),si(t.minContains)&&st.maxContains&&(yield sn(bt.ArrayMaxContains,t,r,n))}a(dgo,"FromArray");function*fgo(t,e,r,n){z9e(n)||(yield sn(bt.AsyncIterator,t,r,n))}a(fgo,"FromAsyncIterator");function*pgo(t,e,r,n){if(!hA(n))return yield sn(bt.BigInt,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(bt.BigIntExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(bt.BigIntMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(bt.BigIntMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(bt.BigIntMultipleOf,t,r,n))}a(pgo,"FromBigInt");function*hgo(t,e,r,n){nM(n)||(yield sn(bt.Boolean,t,r,n))}a(hgo,"FromBoolean");function*mgo(t,e,r,n){yield*Z0(t.returns,e,r,n.prototype)}a(mgo,"FromConstructor");function*ggo(t,e,r,n){if(!v_(n))return yield sn(bt.Date,t,r,n);Ys(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(bt.DateExclusiveMinimumTimestamp,t,r,n)),Ys(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(bt.DateMaximumTimestamp,t,r,n)),Ys(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(bt.DateMinimumTimestamp,t,r,n)),Ys(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(bt.DateMultipleOfTimestamp,t,r,n))}a(ggo,"FromDate");function*Ago(t,e,r,n){mU(n)||(yield sn(bt.Function,t,r,n))}a(Ago,"FromFunction");function*ygo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Z0(s,[...e,...o],r,n)}a(ygo,"FromImport");function*Ego(t,e,r,n){if(!J9e(n))return yield sn(bt.Integer,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(bt.IntegerExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(bt.IntegerMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(bt.IntegerMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(bt.IntegerMultipleOf,t,r,n))}a(Ego,"FromInteger");function*_go(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Z0(s,e,r,n))o=!0,yield c;if(o)return yield sn(bt.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(gB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(bt.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(gB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Z0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(_go,"FromIntersect");function*vgo(t,e,r,n){Y9e(n)||(yield sn(bt.Iterator,t,r,n))}a(vgo,"FromIterator");function*Cgo(t,e,r,n){n!==t.const&&(yield sn(bt.Literal,t,r,n))}a(Cgo,"FromLiteral");function*bgo(t,e,r,n){yield sn(bt.Never,t,r,n)}a(bgo,"FromNever");function*Sgo(t,e,r,n){Z0(t.not,e,r,n).next().done===!0&&(yield sn(bt.Not,t,r,n))}a(Sgo,"FromNot");function*Tgo(t,e,r,n){lB(n)||(yield sn(bt.Null,t,r,n))}a(Tgo,"FromNull");function*Igo(t,e,r,n){if(!su.IsNumberLike(n))return yield sn(bt.Number,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(bt.NumberExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(bt.NumberMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(bt.NumberMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(bt.NumberMultipleOf,t,r,n))}a(Igo,"FromNumber");function*xgo(t,e,r,n){if(!su.IsObjectLike(n))return yield sn(bt.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(bt.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(bt.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(bt.ObjectRequiredProperty,t.properties[l],`${r}/${yB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(bt.ObjectAdditionalProperties,t,`${r}/${yB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Z0(t.additionalProperties,e,`${r}/${yB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Z0(u,e,`${r}/${yB(l)}`,n[l]),AB(t)&&!(l in n)&&(yield sn(bt.ObjectRequiredProperty,u,`${r}/${yB(l)}`,void 0))):su.IsExactOptionalProperty(n,l)&&(yield*Z0(u,e,`${r}/${yB(l)}`,n[l]))}}a(xgo,"FromObject");function*wgo(t,e,r,n){K9e(n)||(yield sn(bt.Promise,t,r,n))}a(wgo,"FromPromise");function*Rgo(t,e,r,n){if(!su.IsRecordLike(n))return yield sn(bt.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(bt.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(bt.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*Z0(s,e,`${r}/${yB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Z0(t.additionalProperties,e,`${r}/${yB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(bt.ObjectAdditionalProperties,t,`${r}/${yB(l)}`,u)}}a(Rgo,"FromRecord");function*kgo(t,e,r,n){yield*Z0(xa(t,e),e,r,n)}a(kgo,"FromRef");function*Pgo(t,e,r,n){if(!Ta(n))return yield sn(bt.String,t,r,n);if(Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(bt.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(bt.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(bt.RegExp,t,r,n)}a(Pgo,"FromRegExp");function*Dgo(t,e,r,n){if(!Ta(n))return yield sn(bt.String,t,r,n);Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(bt.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(bt.StringMaxLength,t,r,n)),Ta(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(bt.StringPattern,t,r,n))),Ta(t.format)&&(qk.Has(t.format)?qk.Get(t.format)(n)||(yield sn(bt.StringFormat,t,r,n)):yield sn(bt.StringFormatUnknown,t,r,n))}a(Dgo,"FromString");function*Ngo(t,e,r,n){uB(n)||(yield sn(bt.Symbol,t,r,n))}a(Ngo,"FromSymbol");function*Mgo(t,e,r,n){if(!Ta(n))return yield sn(bt.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(bt.StringPattern,t,r,n))}a(Mgo,"FromTemplateLiteral");function*Ogo(t,e,r,n){yield*Z0(xa(t,e),e,r,n)}a(Ogo,"FromThis");function*Lgo(t,e,r,n){if(!Pi(n))return yield sn(bt.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(bt.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(bt.TupleLength,t,r,n);if(t.items)for(let o=0;onew IU(Z0(s,e,r,n)));yield sn(bt.Union,t,r,n,o)}a(Fgo,"FromUnion");function*Ugo(t,e,r,n){if(!woe(n))return yield sn(bt.Uint8Array,t,r,n);Ys(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(bt.Uint8ArrayMaxByteLength,t,r,n)),Ys(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(bt.Uint8ArrayMinByteLength,t,r,n))}a(Ugo,"FromUint8Array");function*Qgo(t,e,r,n){}a(Qgo,"FromUnknown");function*qgo(t,e,r,n){su.IsVoidLike(n)||(yield sn(bt.Void,t,r,n))}a(qgo,"FromVoid");function*jgo(t,e,r,n){C_.Get(t[St])(t,n)||(yield sn(bt.Kind,t,r,n))}a(jgo,"FromKind");function*Z0(t,e,r,n){let o=Ys(t.$id)?[...e,t]:e,s=t;switch(s[St]){case"Any":return yield*lgo(s,o,r,n);case"Argument":return yield*ugo(s,o,r,n);case"Array":return yield*dgo(s,o,r,n);case"AsyncIterator":return yield*fgo(s,o,r,n);case"BigInt":return yield*pgo(s,o,r,n);case"Boolean":return yield*hgo(s,o,r,n);case"Constructor":return yield*mgo(s,o,r,n);case"Date":return yield*ggo(s,o,r,n);case"Function":return yield*Ago(s,o,r,n);case"Import":return yield*ygo(s,o,r,n);case"Integer":return yield*Ego(s,o,r,n);case"Intersect":return yield*_go(s,o,r,n);case"Iterator":return yield*vgo(s,o,r,n);case"Literal":return yield*Cgo(s,o,r,n);case"Never":return yield*bgo(s,o,r,n);case"Not":return yield*Sgo(s,o,r,n);case"Null":return yield*Tgo(s,o,r,n);case"Number":return yield*Igo(s,o,r,n);case"Object":return yield*xgo(s,o,r,n);case"Promise":return yield*wgo(s,o,r,n);case"Record":return yield*Rgo(s,o,r,n);case"Ref":return yield*kgo(s,o,r,n);case"RegExp":return yield*Pgo(s,o,r,n);case"String":return yield*Dgo(s,o,r,n);case"Symbol":return yield*Ngo(s,o,r,n);case"TemplateLiteral":return yield*Mgo(s,o,r,n);case"This":return yield*Ogo(s,o,r,n);case"Tuple":return yield*Lgo(s,o,r,n);case"Undefined":return yield*Bgo(s,o,r,n);case"Union":return yield*Fgo(s,o,r,n);case"Uint8Array":return yield*Ugo(s,o,r,n);case"Unknown":return yield*Qgo(s,o,r,n);case"Void":return yield*qgo(s,o,r,n);default:if(!C_.Has(s[St]))throw new i2t(t);return yield*jgo(s,o,r,n)}}a(Z0,"Visit");function sM(...t){let e=t.length===3?Z0(t[0],t[1],"",t[2]):Z0(t[0],[],"",t[1]);return new IU(e)}a(sM,"Errors");p();p();var Koe=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}},o2t=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 Dd(t,e,r){try{return tc(t)?t[kd].Decode(r):r}catch(n){throw new o2t(t,e,r,n)}}a(Dd,"Default");function Hgo(t,e,r,n){return Pi(n)?Dd(t,r,n.map((o,s)=>$k(t.items,e,`${r}/${s}`,o))):Dd(t,r,n)}a(Hgo,"FromArray");function Ggo(t,e,r,n){if(!So(n)||B1(n))return Dd(t,r,n);let o=sUe(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=$k(h,e,`${r}/${f}`,c[f]));if(!tc(t.unevaluatedProperties))return Dd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Dd(u,`${r}/${f}`,d[f]));return Dd(t,r,d)}a(Ggo,"FromIntersect");function $go(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=$k(s,[...e,...o],r,n);return Dd(t,r,c)}a($go,"FromImport");function Vgo(t,e,r,n){return Dd(t,r,$k(t.not,e,r,n))}a(Vgo,"FromNot");function Wgo(t,e,r,n){if(!So(n))return Dd(t,r,n);let o=cC(t),s={...n};for(let d of o)Qi(s,d)&&(Uu(s[d])&&(!pB(t.properties[d])||su.IsExactOptionalProperty(s,d))||(s[d]=$k(t.properties[d],e,`${r}/${d}`,s[d])));if(!Pd(t.additionalProperties))return Dd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Dd(l,`${r}/${d}`,u[d]));return Dd(t,r,u)}a(Wgo,"FromObject");function zgo(t,e,r,n){if(!So(n))return Dd(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]=$k(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Pd(t.additionalProperties))return Dd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Dd(u,`${r}/${f}`,d[f]));return Dd(t,r,d)}a(zgo,"FromRecord");function Ygo(t,e,r,n){let o=xa(t,e);return Dd(t,r,$k(o,e,r,n))}a(Ygo,"FromRef");function Kgo(t,e,r,n){let o=xa(t,e);return Dd(t,r,$k(o,e,r,n))}a(Kgo,"FromThis");function Jgo(t,e,r,n){return Pi(n)&&Pi(t.items)?Dd(t,r,t.items.map((o,s)=>$k(o,e,`${r}/${s}`,n[s]))):Dd(t,r,n)}a(Jgo,"FromTuple");function Zgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=$k(o,e,r,n);return Dd(t,r,s)}return Dd(t,r,n)}a(Zgo,"FromUnion");function $k(t,e,r,n){let o=K0(t,e),s=t;switch(t[St]){case"Array":return Hgo(s,o,r,n);case"Import":return $go(s,o,r,n);case"Intersect":return Ggo(s,o,r,n);case"Not":return Vgo(s,o,r,n);case"Object":return Wgo(s,o,r,n);case"Record":return zgo(s,o,r,n);case"Ref":return Ygo(s,o,r,n);case"Symbol":return Dd(s,r,n);case"This":return Kgo(s,o,r,n);case"Tuple":return Jgo(s,o,r,n);case"Union":return Zgo(s,o,r,n);default:return Dd(s,r,n)}}a($k,"Visit");function Joe(t,e,r){return $k(t,e,"",r)}a(Joe,"TransformDecode");p();var Zoe=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}},s2t=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 gA(t,e,r){try{return tc(t)?t[kd].Encode(r):r}catch(n){throw new s2t(t,e,r,n)}}a(gA,"Default");function Xgo(t,e,r,n){let o=gA(t,r,n);return Pi(o)?o.map((s,c)=>Vk(t.items,e,`${r}/${c}`,s)):o}a(Xgo,"FromArray");function eAo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=gA(t,r,n);return Vk(s,[...e,...o],r,c)}a(eAo,"FromImport");function tAo(t,e,r,n){let o=gA(t,r,n);if(!So(n)||B1(n))return o;let s=sUe(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Vk(m,e,`${r}/${h}`,l[h]));if(!tc(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=gA(d,`${r}/${h}`,f[h]));return f}a(tAo,"FromIntersect");function rAo(t,e,r,n){return gA(t.not,r,gA(t,r,n))}a(rAo,"FromNot");function nAo(t,e,r,n){let o=gA(t,r,n);if(!So(o))return o;let s=cC(t),c={...o};for(let f of s)Qi(c,f)&&(Uu(c[f])&&(!pB(t.properties[f])||su.IsExactOptionalProperty(c,f))||(c[f]=Vk(t.properties[f],e,`${r}/${f}`,c[f])));if(!Pd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=gA(u,`${r}/${f}`,d[f]));return d}a(nAo,"FromObject");function iAo(t,e,r,n){let o=gA(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]=Vk(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Pd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=gA(d,`${r}/${h}`,f[h]));return f}a(iAo,"FromRecord");function oAo(t,e,r,n){let o=xa(t,e),s=Vk(o,e,r,n);return gA(t,r,s)}a(oAo,"FromRef");function sAo(t,e,r,n){let o=xa(t,e),s=Vk(o,e,r,n);return gA(t,r,s)}a(sAo,"FromThis");function aAo(t,e,r,n){let o=gA(t,r,n);return Pi(t.items)?t.items.map((s,c)=>Vk(s,e,`${r}/${c}`,o[c])):[]}a(aAo,"FromTuple");function cAo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Vk(o,e,r,n);return gA(t,r,s)}for(let o of t.anyOf){let s=Vk(o,e,r,n);if(es(t,e,s))return gA(t,r,s)}return gA(t,r,n)}a(cAo,"FromUnion");function Vk(t,e,r,n){let o=K0(t,e),s=t;switch(t[St]){case"Array":return Xgo(s,o,r,n);case"Import":return eAo(s,o,r,n);case"Intersect":return tAo(s,o,r,n);case"Not":return rAo(s,o,r,n);case"Object":return nAo(s,o,r,n);case"Record":return iAo(s,o,r,n);case"Ref":return oAo(s,o,r,n);case"This":return sAo(s,o,r,n);case"Tuple":return aAo(s,o,r,n);case"Union":return cAo(s,o,r,n);default:return gA(s,r,n)}}a(Vk,"Visit");function Xoe(t,e,r){return Vk(t,e,"",r)}a(Xoe,"TransformEncode");p();function lAo(t,e){return tc(t)||$m(t.items,e)}a(lAo,"FromArray");function uAo(t,e){return tc(t)||$m(t.items,e)}a(uAo,"FromAsyncIterator");function dAo(t,e){return tc(t)||$m(t.returns,e)||t.parameters.some(r=>$m(r,e))}a(dAo,"FromConstructor");function fAo(t,e){return tc(t)||$m(t.returns,e)||t.parameters.some(r=>$m(r,e))}a(fAo,"FromFunction");function pAo(t,e){return tc(t)||tc(t.unevaluatedProperties)||t.allOf.some(r=>$m(r,e))}a(pAo,"FromIntersect");function hAo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return tc(t)||$m(n,[...r,...e])}a(hAo,"FromImport");function mAo(t,e){return tc(t)||$m(t.items,e)}a(mAo,"FromIterator");function gAo(t,e){return tc(t)||$m(t.not,e)}a(gAo,"FromNot");function AAo(t,e){return tc(t)||Object.values(t.properties).some(r=>$m(r,e))||Pd(t.additionalProperties)&&$m(t.additionalProperties,e)}a(AAo,"FromObject");function yAo(t,e){return tc(t)||$m(t.item,e)}a(yAo,"FromPromise");function EAo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return tc(t)||$m(n,e)||Pd(t.additionalProperties)&&tc(t.additionalProperties)}a(EAo,"FromRecord");function _Ao(t,e){return tc(t)?!0:$m(xa(t,e),e)}a(_Ao,"FromRef");function vAo(t,e){return tc(t)?!0:$m(xa(t,e),e)}a(vAo,"FromThis");function CAo(t,e){return tc(t)||!Uu(t.items)&&t.items.some(r=>$m(r,e))}a(CAo,"FromTuple");function bAo(t,e){return tc(t)||t.anyOf.some(r=>$m(r,e))}a(bAo,"FromUnion");function $m(t,e){let r=K0(t,e),n=t;if(t.$id&&a2t.has(t.$id))return!1;switch(t.$id&&a2t.add(t.$id),t[St]){case"Array":return lAo(n,r);case"AsyncIterator":return uAo(n,r);case"Constructor":return dAo(n,r);case"Function":return fAo(n,r);case"Import":return hAo(n,r);case"Intersect":return pAo(n,r);case"Iterator":return mAo(n,r);case"Not":return gAo(n,r);case"Object":return AAo(n,r);case"Promise":return yAo(n,r);case"Record":return EAo(n,r);case"Ref":return _Ao(n,r);case"This":return vAo(n,r);case"Tuple":return CAo(n,r);case"Union":return bAo(n,r);default:return tc(t)}}a($m,"Visit");var a2t=new Set;function EB(t,e){return a2t.clear(),$m(t,e)}a(EB,"HasTransform");var c2t=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=EB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return sM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Koe(this.schema,e,this.Errors(e).First());return this.hasTransform?Joe(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Xoe(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Zoe(this.schema,e,this.Errors(e).First());return r}},_B;(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})(_B||(_B={}));var EUe;(function(t){function e(s){return s.length===0?!1:_B.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${X.minItems}`);let ue=z(X.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${ue})) { return false }; return true; })(${K})`,qu(X.contains)||si(X.minContains)||si(X.maxContains)){let qe=qu(X.contains)?X.contains:Xo(),ne=z(qe,ee,"value"),ce=si(X.minContains)?[`(count >= ${X.minContains})`]:[],Me=si(X.maxContains)?[`(count <= ${X.maxContains})`]:[],we=`const count = value.reduce((${Z}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...ce,...Me].join(" && ");yield`((${he}) => { ${we}; return ${Be}})(${K})`}X.uniqueItems===!0&&(yield`((${he}) => { 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(X,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(X,ee,K){yield`(typeof ${K} === 'bigint')`,hA(X.exclusiveMaximum)&&(yield`${K} < BigInt(${X.exclusiveMaximum})`),hA(X.exclusiveMinimum)&&(yield`${K} > BigInt(${X.exclusiveMinimum})`),hA(X.maximum)&&(yield`${K} <= BigInt(${X.maximum})`),hA(X.minimum)&&(yield`${K} >= BigInt(${X.minimum})`),hA(X.multipleOf)&&(yield`(${K} % BigInt(${X.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(X,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(X,ee,K){yield*W(X.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(X,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,si(X.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${X.exclusiveMaximumTimestamp}`),si(X.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${X.exclusiveMinimumTimestamp}`),si(X.maximumTimestamp)&&(yield`${K}.getTime() <= ${X.maximumTimestamp}`),si(X.minimumTimestamp)&&(yield`${K}.getTime() >= ${X.minimumTimestamp}`),si(X.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${X.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(X,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(X,ee,K){let he=globalThis.Object.getOwnPropertyNames(X.$defs).reduce((Z,ue)=>[...Z,X.$defs[ue]],[]);yield*W(YI(X.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(X,ee,K){yield`Number.isInteger(${K})`,si(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),si(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),si(X.maximum)&&(yield`${K} <= ${X.maximum}`),si(X.minimum)&&(yield`${K} >= ${X.minimum}`),si(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(m,"FromInteger");function*g(X,ee,K){let he=X.allOf.map(Z=>z(Z,ee,K)).join(" && ");if(X.unevaluatedProperties===!1){let Z=H(`${new RegExp(gB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key))`;yield`(${he} && ${ue})`}else if(qu(X.unevaluatedProperties)){let Z=H(`${new RegExp(gB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key) || ${z(X.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${ue})`}else yield`(${he})`}a(g,"FromIntersect");function*A(X,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(X,ee,K){typeof X.const=="number"||typeof X.const=="boolean"?yield`(${K} === ${X.const})`:yield`(${K} === '${u2t.Escape(X.const)}')`}a(y,"FromLiteral");function*E(X,ee,K){yield"false"}a(E,"FromNever");function*_(X,ee,K){yield`(!${z(X.not,ee,K)})`}a(_,"FromNot");function*v(X,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(X,ee,K){yield QW.IsNumberLike(K),si(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),si(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),si(X.maximum)&&(yield`${K} <= ${X.maximum}`),si(X.minimum)&&(yield`${K} >= ${X.minimum}`),si(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(b,"FromNumber");function*T(X,ee,K){yield QW.IsObjectLike(K),si(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),si(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let he=Object.getOwnPropertyNames(X.properties);for(let Z of he){let ue=EUe.Encode(K,Z),qe=X.properties[Z];if(X.required&&X.required.includes(Z))yield*W(qe,ee,ue),(AB(qe)||e(qe))&&(yield`('${Z}' in ${K})`);else{let ne=z(qe,ee,ue);yield QW.IsExactOptionalProperty(K,Z,ne)}}if(X.additionalProperties===!1)if(X.required&&X.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let Z=`[${he.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${Z}.includes(key))`}if(typeof X.additionalProperties=="object"){let Z=z(X.additionalProperties,ee,`${K}[key]`),ue=`[${he.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${Z}))`}}a(T,"FromObject");function*w(X,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(X,ee,K){yield QW.IsRecordLike(K),si(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),si(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let[he,Z]=Object.entries(X.patternProperties)[0],ue=H(`${new RegExp(he)}`),qe=z(Z,ee,"value"),ne=qu(X.additionalProperties)?z(X.additionalProperties,ee,K):X.additionalProperties===!1?"false":"true",ce=`(${ue}.test(key) ? ${qe} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ce}))`}a(R,"FromRecord");function*x(X,ee,K){let he=xa(X,ee);if(V.functions.has(X.$ref))return yield`${ie(X.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*P(X,ee,K){let he=H(`${new RegExp(X.source,X.flags)};`);yield`(typeof ${K} === 'string')`,si(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),si(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(X,ee,K){yield`(typeof ${K} === 'string')`,si(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),si(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),X.pattern!==void 0&&(yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`),X.format!==void 0&&(yield`format('${X.format}', ${K})`)}a(D,"FromString");function*N(X,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(X,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(X,ee,K){yield`${ie(X.$ref)}(${K})`}a(B,"FromThis");function*q(X,ee,K){if(yield`Array.isArray(${K})`,X.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${X.maxItems})`;for(let he=0;hez(Z,ee,K)).join(" || ")})`}a(O,"FromUnion");function*j(X,ee,K){yield`${K} instanceof Uint8Array`,si(X.maxByteLength)&&(yield`(${K}.length <= ${X.maxByteLength})`),si(X.minByteLength)&&(yield`(${K}.length >= ${X.minByteLength})`)}a(j,"FromUint8Array");function*Q(X,ee,K){yield"true"}a(Q,"FromUnknown");function*U(X,ee,K){yield QW.IsVoidLike(K)}a(U,"FromVoid");function*Y(X,ee,K){let he=V.instances.size;V.instances.set(he,X),yield`kind('${X[St]}', ${he}, ${K})`}a(Y,"FromKind");function*W(X,ee,K,he=!0){let Z=Ta(X.$id)?[...ee,X]:ee,ue=X;if(he&&Ta(X.$id)){let qe=ie(X.$id);if(V.functions.has(qe))return yield`${qe}(${K})`;{V.functions.set(qe,"");let ne=re(qe,X,ee,"value",!1);return V.functions.set(qe,ne),yield`${qe}(${K})`}}switch(ue[St]){case"Any":return yield*r(ue,Z,K);case"Argument":return yield*n(ue,Z,K);case"Array":return yield*o(ue,Z,K);case"AsyncIterator":return yield*s(ue,Z,K);case"BigInt":return yield*c(ue,Z,K);case"Boolean":return yield*l(ue,Z,K);case"Constructor":return yield*u(ue,Z,K);case"Date":return yield*d(ue,Z,K);case"Function":return yield*f(ue,Z,K);case"Import":return yield*h(ue,Z,K);case"Integer":return yield*m(ue,Z,K);case"Intersect":return yield*g(ue,Z,K);case"Iterator":return yield*A(ue,Z,K);case"Literal":return yield*y(ue,Z,K);case"Never":return yield*E(ue,Z,K);case"Not":return yield*_(ue,Z,K);case"Null":return yield*v(ue,Z,K);case"Number":return yield*b(ue,Z,K);case"Object":return yield*T(ue,Z,K);case"Promise":return yield*w(ue,Z,K);case"Record":return yield*R(ue,Z,K);case"Ref":return yield*x(ue,Z,K);case"RegExp":return yield*P(ue,Z,K);case"String":return yield*D(ue,Z,K);case"Symbol":return yield*N(ue,Z,K);case"TemplateLiteral":return yield*L(ue,Z,K);case"This":return yield*B(ue,Z,K);case"Tuple":return yield*q(ue,Z,K);case"Undefined":return yield*M(ue,Z,K);case"Union":return yield*O(ue,Z,K);case"Uint8Array":return yield*j(ue,Z,K);case"Unknown":return yield*Q(ue,Z,K);case"Void":return yield*U(ue,Z,K);default:if(!C_.Has(ue[St]))throw new d2t(X);return yield*Y(ue,Z,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(X,ee,K,he=!0){return`(${[...W(X,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(X){return`check_${l2t.Encode(X)}`}a(ie,"CreateFunctionName");function H(X){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${X}`),ee}a(H,"CreateVariable");function re(X,ee,K,he,Z=!0){let[ue,qe]=[` +`,we=>"".padStart(we," ")],ne=le("value","any"),ce=Le("boolean"),Me=[...W(ee,K,he,Z)].map(we=>`${qe(4)}${we}`).join(` &&${ue}`);return`function ${X}(${ne})${ce} {${ue}${qe(2)}return (${ue}${Me}${ue}${qe(2)}) +}`}a(re,"CreateFunction");function le(X,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${X}${K}`}a(le,"CreateParameter");function Le(X){return V.language==="typescript"?`: ${X}`:""}a(Le,"CreateReturns");function ge(X,ee,K){let he=re("check",X,ee,"value"),Z=le("value","any"),ue=Le("boolean"),qe=[...V.functions.values()],ne=[...V.variables.values()],ce=Ta(X.$id)?`return function check(${Z})${ue} { return ${ie(X.$id)}(value) }`:`return ${he}`;return[...ne,...qe,ce].join(` -`)}a(ge,"Build");function Ue(...X){let ee={language:"javascript"},[K,he,Z]=X.length===2&&Pi(X[1])?[X[0],X[1],ee]:X.length===2&&!Pi(X[1])?[X[0],[],X[1]]:X.length===3?[X[0],X[1],X[2]]:X.length===1?[X[0],[],ee]:[null,[],ee];if(V.language=Z.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Qu(K))throw new mUe(K);for(let ue of he)if(!Qu(ue))throw new mUe(ue);return ge(K,he,Z)}a(Ue,"Code"),t.Code=Ue;function ke(X,ee=[]){let K=Ue(X,ee,{language:"javascript"}),he=globalThis.Function("kind","format","hash",K),Z=new Map(V.instances);function ue(Ne,we,Be){if(!v_.Has(Ne)||!Z.has(we))return!1;let rt=v_.Get(Ne),st=Z.get(we);return rt(st,Be)}a(ue,"typeRegistryFunction");function qe(Ne,we){return Uk.Has(Ne)?Uk.Get(Ne)(we):!1}a(qe,"formatRegistryFunction");function ne(Ne){return bU(Ne)}a(ne,"hashFunction");let ce=he(ue,qe,ne);return new i2t(X,ee,ce,K)}a(ke,"Compile"),t.Compile=ke})(qu||(qu={}));var t7e=de(dU()),yse=de(require("os"));Mo();var r7e=de(ri());function obe(t){return t===1}a(obe,"isRestricted");var ibe=8192,Ayo=21;var X0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return obe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(_se(e))return this.reporterRestricted;if(RCe(e))return new B9e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},yyo=S.Object({},{additionalProperties:S.String()}),Eyo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),_yo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function vyo(t){return _yo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(vyo,"isOomError");function Cyo(t){return XI(t)?"network":vyo(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(Cyo,"getErrorType");var Wt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=qu.Compile(yyo)}static{this.validateTelemetryMeasurements=qu.Compile(Eyo)}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||{},yl())}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=yl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Zt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=M1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=M1(e.get(Ir).getEditorPluginInfo());let r=e.get(Ua);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${V1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Ir);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=M1(r.getEditorInfo());let n=e.get(tr);this.properties.fetcher=n.name;let o=e.get(Lo).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=CKr(e);r["copilot.build"]=bKr(e),r["copilot.buildType"]=MU(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(obe(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>ibe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+ibe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Ese,"telemetrizePromptLength");function yl(){return performance.now()}a(yl,"now");function Iyo(t){return Math.floor(t/1e3)}a(Iyo,"nowSeconds");function _se(t){return t.get(Op).optedIn}a(_se,"shouldSendRestricted");function Et(t,e,r,n){return t.get(xd).register(xyo(t,e,yl(),r?.extendedBy(),n))}a(Et,"telemetry");function ZI(t,e,r){return t.get(xd).register(i7e(t,e,r?.extendedBy()))}a(ZI,"telemetryMsft");function At(t,e,r,n){let o=Wt.createAndMarkAsIssued(r,n);return t.get(xd).register(i7e(t,e,o))}a(At,"telemetryMs");function n7e(t,e,r,n){let o=(n||Wt.createAndMarkAsIssued()).extendedBy(AKr(r));return t.get(xd).register(i7e(t,e,o))}a(n7e,"telemetryMsftWithError");function Vn(t,e,r,n,o){let s=Wt.createAndMarkAsIssued({...n,...AKr(r)},o);return t.get(xd).register(i7e(t,e,s))}a(Vn,"telemetryMsWithError");function AKr(t){let e={};if(t){let r=kyo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(AKr,"buildErrorProperties");async function xyo(t,e,r,n,o=0){let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!obe(o)||_se(t))&&sbe(t,o,e,s),byo(t,e,s)}a(xyo,"_telemetry");async function i7e(t,e,r){let n=r||Wt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Tyo(t,e,n)}a(i7e,"_telemetryMsft");function K6e(t,e){return t.get(xd).register(wyo(t,e,yl()))}a(K6e,"telemetryExpProblem");async function wyo(t,e,r){let n="expProblem",o=Wt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),sbe(t,0,n,o)}a(wyo,"_telemetryExpProblem");function vse(t,e,r,n,o=0){let s={...r,...yKr(t)};sbe(t,o,e,{properties:s,measurements:n})}a(vse,"telemetryRaw");function yKr(t){let e=t.get(Ir),r={unique_id:Mt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:M1(e.getEditorInfo())};return{...t.get(Op).getProperties(),...r}}a(yKr,"createRequiredProperties");var ODt=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,t7e.SHA256)(t7e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function qa(t,e,r,n,o){return t.get(xd).register(EKr(t,e,yl(),r,{...n},o))}a(qa,"telemetryException");async function EKr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Gm(c)||c instanceof r7e.ConnectionError||c instanceof r7e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new ODt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`)}a(ge,"Build");function Ue(...X){let ee={language:"javascript"},[K,he,Z]=X.length===2&&Pi(X[1])?[X[0],X[1],ee]:X.length===2&&!Pi(X[1])?[X[0],[],X[1]]:X.length===3?[X[0],X[1],X[2]]:X.length===1?[X[0],[],ee]:[null,[],ee];if(V.language=Z.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!qu(K))throw new _Ue(K);for(let ue of he)if(!qu(ue))throw new _Ue(ue);return ge(K,he,Z)}a(Ue,"Code"),t.Code=Ue;function ke(X,ee=[]){let K=Ue(X,ee,{language:"javascript"}),he=globalThis.Function("kind","format","hash",K),Z=new Map(V.instances);function ue(Me,we,Be){if(!C_.Has(Me)||!Z.has(we))return!1;let rt=C_.Get(Me),st=Z.get(we);return rt(st,Be)}a(ue,"typeRegistryFunction");function qe(Me,we){return qk.Has(Me)?qk.Get(Me)(we):!1}a(qe,"formatRegistryFunction");function ne(Me){return TU(Me)}a(ne,"hashFunction");let ce=he(ue,qe,ne);return new c2t(X,ee,ce,K)}a(ke,"Compile"),t.Compile=ke})(ju||(ju={}));var s7e=de(pU()),Ese=de(require("os"));Oo();var a7e=de(ei());function cbe(t){return t===1}a(cbe,"isRestricted");var abe=8192,xyo=21;var eg=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return cbe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(vse(e))return this.reporterRestricted;if(DCe(e))return new j9e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},wyo=S.Object({},{additionalProperties:S.String()}),Ryo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),kyo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function Pyo(t){return kyo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(Pyo,"isOomError");function Dyo(t){return rx(t)?"network":Pyo(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(Dyo,"getErrorType");var Wt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=ju.Compile(wyo)}static{this.validateTelemetryMeasurements=ju.Compile(Ryo)}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||{},El())}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=El())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Zt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=M1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=M1(e.get(Ir).getEditorPluginInfo());let r=e.get(Qa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${V1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Ir);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=M1(r.getEditorInfo());let n=e.get(nr);this.properties.fetcher=n.name;let o=e.get(Bo).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=xKr(e);r["copilot.build"]=wKr(e),r["copilot.buildType"]=LU(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(cbe(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>abe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+abe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(_se,"telemetrizePromptLength");function El(){return performance.now()}a(El,"now");function Lyo(t){return Math.floor(t/1e3)}a(Lyo,"nowSeconds");function vse(t){return t.get(Bp).optedIn}a(vse,"shouldSendRestricted");function At(t,e,r,n){return t.get(Rd).register(Byo(t,e,El(),r?.extendedBy(),n))}a(At,"telemetry");function tx(t,e,r){return t.get(Rd).register(l7e(t,e,r?.extendedBy()))}a(tx,"telemetryMsft");function Rt(t,e,r,n){let o=Wt.createAndMarkAsIssued(r,n);return t.get(Rd).register(l7e(t,e,o))}a(Rt,"telemetryMs");function c7e(t,e,r,n){let o=(n||Wt.createAndMarkAsIssued()).extendedBy(CKr(r));return t.get(Rd).register(l7e(t,e,o))}a(c7e,"telemetryMsftWithError");function ai(t,e,r,n,o){let s=Wt.createAndMarkAsIssued({...n,...CKr(r)},o);return t.get(Rd).register(l7e(t,e,s))}a(ai,"telemetryMsWithError");function CKr(t){let e={};if(t){let r=Qyo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(CKr,"buildErrorProperties");async function Byo(t,e,r,n,o=0){let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!cbe(o)||vse(t))&&lbe(t,o,e,s),Nyo(t,e,s)}a(Byo,"_telemetry");async function l7e(t,e,r){let n=r||Wt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Oyo(t,e,n)}a(l7e,"_telemetryMsft");function t9e(t,e){return t.get(Rd).register(Fyo(t,e,El()))}a(t9e,"telemetryExpProblem");async function Fyo(t,e,r){let n="expProblem",o=Wt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),lbe(t,0,n,o)}a(Fyo,"_telemetryExpProblem");function Cse(t,e,r,n,o=0){let s={...r,...bKr(t)};lbe(t,o,e,{properties:s,measurements:n})}a(Cse,"telemetryRaw");function bKr(t){let e=t.get(Ir),r={unique_id:Mt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:M1(e.getEditorInfo())};return{...t.get(Bp).getProperties(),...r}}a(bKr,"createRequiredProperties");var UDt=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,s7e.SHA256)(s7e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function ua(t,e,r,n,o){return t.get(Rd).register(SKr(t,e,El(),r,{...n},o))}a(ua,"telemetryException");async function SKr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Vm(c)||c instanceof a7e.ConnectionError||c instanceof a7e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new UDt(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(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=_se(t),f=SGr(c,u,d),h=Cyo(c),m=h==="exception",g=Wt.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=fPt(y.value):y.value="[redacted]");s??=cGr(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(XN).isThrottled(A)){if(d){let y=bGr(c,u),E=Wt.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,sbe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),sbe(t,0,`error.${h}`,g)}}a(EKr,"_telemetryException");function z0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await EKr(t,c,yl(),r,n)}},"wrapped");return(...s)=>t.get(xd).register(o(...s))}a(z0,"telemetryCatch");function eg(t,e,r,n){return t.get(xd).register(Ryo(t,e,yl(),r?.extendedBy(),n))}a(eg,"telemetryError");async function Ryo(t,e,r,n,o=0){if(obe(o)&&!_se(t))return;let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Syo(t,o,e,s)}a(Ryo,"_telemetryError");function _Kr(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=Wt.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),Et(t,"engine.completion",u,1)}a(_Kr,"logEngineCompletion");function vKr(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 Et(t,"engine.prompt",o,1)}a(vKr,"logEnginePrompt");function kyo(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(kyo,"buildErrorFromUnknown");p();var jW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Gm(t){return!t||typeof t!="object"?!1:t instanceof jW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Gm,"isAbortError");var Cse=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},aM=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}`}},Pyo=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 XI(t,e=!0){return t instanceof Error?e&&"cause"in t&&XI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Cse||t instanceof aM||t?.message?.startsWith("net::")||Pyo.has(t.code??""):!1}a(XI,"isNetworkError");var ex=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 Cse(`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 Cse(`Response body truncated: actualLength=${s}`,"Truncated"):new Cse(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function OU(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(OU,"parseRetryAfterSeconds");var tr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function HW(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...Gy(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(Ua).sessionId,g["VScode-MachineId"]=t.get(Ua).machineId,g["X-GitHub-Api-Version"]="2026-01-09"),n&&(g["OpenAI-Intent"]=n);let A={method:"POST",headers:g,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:g,messages:h,body:s});let y=t.get(tr);if(c){let _=new AbortController;c.onCancellationRequested(()=>{Et(t,"networking.cancelRequest",Wt.createAndMarkAsIssued({headerRequestId:o})),_.abort()}),A.signal=_.signal}return y.fetch(e,A).catch(_=>{if(Dyo(_))return Et(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(HW,"postRequest");function Dyo(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(Dyo,"isInterruptedNetworkError");p();function o7e(){return typeof process>"u"}a(o7e,"isWeb");function CB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(CB,"isMsBenchModeEnabled");var LDt=class extends aM{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 Gf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...o7e()?{}:Gy(t),...n.headers}};let o=await t.get(tr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new aM(o);if(!o.headers.get("x-github-request-id"))throw new LDt(o);return o}a(Gf,"apiFetch");p();p();var ts=class{constructor(){this.recentNotifications=new Cn(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 la=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 IKr=require("os"),s7e=require("path");p();var SKr;(()=>{"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,j){for(var Q,U="",Y=0,W=-1,V=0,z=0;z<=O.length;++z){if(z2){var ie=U.lastIndexOf("/");if(ie!==U.length-1){ie===-1?(U="",Y=0):Y=(U=U.slice(0,ie)).length-1-U.lastIndexOf("/"),W=z,V=0;continue}}else if(U.length===2||U.length===1){U="",Y=0,W=z,V=0;continue}}j&&(U.length>0?U+="/..":U="..",Y=2)}else U.length>0?U+="/"+O.slice(W+1,z):U=O.slice(W+1,z),Y=z-W-1;W=z,V=0}else Q===46&&V!==-1?++V:V=-1}return U}a(q,"r");var M={resolve:a(function(){for(var O,j="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var Y;U>=0?Y=arguments[U]:(O===void 0&&(O=process.cwd()),Y=O),B(Y),Y.length!==0&&(j=Y+"/"+j,Q=Y.charCodeAt(0)===47)}return j=q(j,!Q),Q?j.length>0?"/"+j:"/":j.length>0?j:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var j=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=q(O,!j)).length!==0||j||(O="."),O.length>0&&Q&&(O+="/"),j?"/"+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,j=0;j0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,j){if(B(O),B(j),O===j||(O=M.resolve(O))===(j=M.resolve(j)))return"";for(var Q=1;Qz){if(j.charCodeAt(W+H)===47)return j.slice(W+H+1);if(H===0)return j.slice(W+H)}else Y>z&&(O.charCodeAt(Q+H)===47?ie=H:H===0&&(ie=0));break}var re=O.charCodeAt(Q+H);if(re!==j.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=Q+ie+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+j.slice(W+ie):(W+=ie,j.charCodeAt(W)===47&&++W,j.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var j=O.charCodeAt(0),Q=j===47,U=-1,Y=!0,W=O.length-1;W>=1;--W)if((j=O.charCodeAt(W))===47){if(!Y){U=W;break}}else Y=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,j){if(j!==void 0&&typeof j!="string")throw new TypeError('"ext" argument must be a string');B(O);var Q,U=0,Y=-1,W=!0;if(j!==void 0&&j.length>0&&j.length<=O.length){if(j.length===O.length&&j===O)return"";var V=j.length-1,z=-1;for(Q=O.length-1;Q>=0;--Q){var ie=O.charCodeAt(Q);if(ie===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1),V>=0&&(ie===j.charCodeAt(V)?--V==-1&&(Y=Q):(V=-1,Y=z))}return U===Y?Y=z:Y===-1&&(Y=O.length),O.slice(U,Y)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else Y===-1&&(W=!1,Y=Q+1);return Y===-1?"":O.slice(U,Y)},"basename"),extname:a(function(O){B(O);for(var j=-1,Q=0,U=-1,Y=!0,W=0,V=O.length-1;V>=0;--V){var z=O.charCodeAt(V);if(z!==47)U===-1&&(Y=!1,U=V+1),z===46?j===-1?j=V:W!==1&&(W=1):j!==-1&&(W=-1);else if(!Y){Q=V+1;break}}return j===-1||U===-1||W===0||W===1&&j===U-1&&j===Q+1?"":O.slice(j,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(j,Q){var U=Q.dir||Q.root,Y=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+Y:U+"/"+Y:Y})(0,O)},"format"),parse:a(function(O){B(O);var j={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return j;var Q,U=O.charCodeAt(0),Y=U===47;Y?(j.root="/",Q=1):Q=0;for(var W=-1,V=0,z=-1,ie=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),U===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ie){V=H+1;break}return W===-1||z===-1||re===0||re===1&&W===z-1&&W===V+1?z!==-1&&(j.base=j.name=V===0&&Y?O.slice(1,z):O.slice(V,z)):(V===0&&Y?(j.name=O.slice(1,W),j.base=O.slice(1,z)):(j.name=O.slice(V,W),j.base=O.slice(V,z)),j.ext=O.slice(W,z)),V>0?j.dir=O.slice(0,V-1):Y&&(j.dir="/"),j},"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,j,Q=!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,Y){return U||Y?U:"file"})(B,Q),this.authority=q||d,this.path=(function(U,Y){switch(U){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=O||d,this.fragment=j||d,u(this,Q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:O,query:j,fragment:Q}=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),j===void 0?j=this.query:j===null&&(j=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),q===this.scheme&&M===this.authority&&O===this.path&&j===this.query&&Q===this.fragment?this:new A(q,M,O,j,Q)}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 j=0;j=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||B&&Q===47||q&&Q===91||q&&Q===93||q&&Q===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M!==void 0&&(M+=L.charAt(j));else{M===void 0&&(M=L.substr(0,j));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M+=U):O===-1&&(O=j)}}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:j,path:Q,query:U,fragment:Y}=L;if(O&&(M+=O,M+=":"),(j||O==="file")&&(M+=f,M+=f),j){let W=j.indexOf("@");if(W!==-1){let V=j.substr(0,W);j=j.substr(W+1),W=V.lastIndexOf(":"),W===-1?M+=q(V,!1,!1):(M+=q(V.substr(0,W),!1,!1),M+=":",M+=q(V.substr(W+1),!1,!0)),M+="@"}j=j.toLowerCase(),W=j.lastIndexOf(":"),W===-1?M+=q(j,!1,!0):(M+=q(j.substr(0,W),!1,!0),M+=j.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+=q(Q,!0,!1)}return U&&(M+="?",M+=q(U,!1,!1)),Y&&(M+="#",M+=B?Y:E(Y,!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 P=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...q){return B.with({path:P.join(B.path,...q)})},L.resolvePath=function(B,...q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let j=P.resolve(M,...q);return O&&j[0]===D&&!B.authority&&(j=j.substring(1)),B.with({path:j})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=P.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},L.basename=function(B){return P.basename(B.path)},L.extname=function(B){return P.extname(B.path)}})(N||(N={})),SKr=n})();var{URI:LU,Utils:abe}=SKr;function xKr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+xKr(t.substring(3)):t}}a(xKr,"decodeURIComponentGraceful");var TKr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BDt(t){return t.match(TKr)?t.replace(TKr,e=>xKr(e)):t}a(BDt,"percentDecode");function Ks(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 LU.file(t).toString()}a(Ks,"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?LU.parse(e[1]+e[2],!0):LU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(to,"parseUri");function a7e(t){return to(t),t}a(a7e,"validateUri");function Fs(t){try{return to(t).toString()}catch{return t}}a(Fs,"normalizeUri");function wKr(t){let e=Fs(t);return e.endsWith("/")?e.slice(0,-1):e}a(wKr,"normalizeUriNoTrailingSlash");var GW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=to(t);if(!GW.has(e.scheme)&&!la.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,IKr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,s7e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function rs(t){try{return un(t)}catch{return}}a(rs,"getFsPath");function RKr(t){let e=rs(t);if(e)return LU.file(e).toString()}a(RKr,"getFsUri");function $W(t,...e){let r,n=rs(t);return n?r=Ks((0,s7e.resolve)(n,...e)):r=abe.resolvePath(to(t),...e.map(o=>kKr(o))).toString(),typeof t=="string"?r:{uri:r}}a($W,"resolveFilePath");function wa(t,...e){let r=abe.joinPath(to(t),...e.map(kKr)).toString();return typeof t=="string"?r:{uri:r}}a(wa,"joinPath");function kKr(t){return Nyo(t)?t.replaceAll("\\","/"):t}a(kKr,"pathToURIPath");function Nyo(t){return/^[^/\\]*\\/.test(t)}a(Nyo,"isWinPath");function Ji(t){return BDt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ji,"basename");function uf(t){let e=abe.dirname(to(t)),r;return GW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(uf,"dirname");function PKr(t){return abe.extname(to(t))}a(PKr,"extname");var $m=class{static{a(this,"NetworkConfiguration")}};function c7e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!UDt(t)&&r.protocol==="http:")return r.href}catch{}}a(c7e,"ensurePermittedUrl");var VW={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 FDt(t,e,r){if(r&&O1(t)){for(let n of r){let o=Ft(t,n);if(o)return o}return}for(let n of e){let o=Ft(t,n);if(o)return o}}a(FDt,"urlConfigOverride");function Myo(t,e){switch(e){case"api":return FDt(t,[Ye.DebugOverrideCapiUrl,Ye.DebugOverrideCapiUrlLegacy],[Ye.DebugTestOverrideCapiUrl,Ye.DebugTestOverrideCapiUrlLegacy]);case"proxy":return FDt(t,[Ye.DebugOverrideProxyUrl,Ye.DebugOverrideProxyUrlLegacy],[Ye.DebugTestOverrideProxyUrl,Ye.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!UDt(t))return FDt(t,[Ye.DebugSnippyOverrideUrl])}}a(Myo,"getEndpointOverrideUrl");function tx(t,e,r,...n){let o=Myo(t,r)??e.endpoints[r];return wa(o,...n)}a(tx,"getEndpointUrl");function bB(t){return rx(t)?.endpoints??VW}a(bB,"getLastKnownEndpoints");function l7e(t,e){if(e&&!c7e(t,e)){t.get(ts).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get($m).setConfiguredUrls(t,{serverUrl:e})}a(l7e,"updateServerUrl");p();var Vm=class{static{a(this,"UrlOpener")}};var b_=new fe("auth"),QDt=60,Oyo=300;var Lyo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Byo="4535c7beffc844b46bb1ed4aa04d759a";function $y(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($y,"fillGitHubUrls");function BU(){return Math.floor(Date.now()/1e3)}a(BU,"nowSeconds");async function qDt(t,e,r){let n=Wt.createAndMarkAsIssued({},{});Et(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Gf(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json();if(s.status===401){let h="Failed to get copilot token due to 401 status. Please sign out and try again.",m=s.headers.get("x-github-request-id")??"",g=c.error_details,A=[];m&&A.push(`request_id=${m}`),g?.url&&A.push(`url=${g.url}`),g?.notification_id&&A.push(`notification_id=${g.notification_id}`),g?.message&&A.push(`error=${g.message}`);let y=A.length>0?` (${A.join(", ")})`:"";return b_.info(t,`${h}${y}`),eg(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){b_.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),eg(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let h=c.error_details;return h?.notification_id!=="not_signed_up"&&Fyo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=BU()+c.refresh_in+QDt,u=await cbe(t,e),d;u.ok&&(d=await u.json());let f=new WW(c,d,l);return Et(t,"auth.new_token",n.extendedBy({...oPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:BU()})),{copilotToken:f}}a(qDt,"authFromGitHubSession");var Rh=class{static{a(this,"CopilotTokenFetcher")}},u7e=class extends Rh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await qDt(e,r,n)}};async function cbe(t,e){return await Gf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(cbe,"fetchCopilotUserInfo");function Fyo(t,e,r){e&&t.get(ts).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(Ir).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(Vm).open(l)}e.notification_id&&s&&await Uyo(t,e.notification_id,r)}).catch(n=>{b_.exception(t,n,"copilotToken.notification")})}a(Fyo,"notifyUser");async function Uyo(t,e,r){let n=await Gf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&b_.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(Uyo,"sendNotificationResultToGitHub");var WW=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 P6e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...VW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Oyo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Byo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var yi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function d7e(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(d7e,"authEnvVarConflictMessage");var FU=class extends yi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function DKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new yi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new yi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new yi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(DKr,"validateGitHubServerUrl");p();p();var nx=class{static{a(this,"AuthRepository")}};p();function NKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=DKr(r),{apiUrl:o}=$y({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(NKr,"buildAuthServerEndpoint");function UU(t,e){if(e!==void 0)return NKr(e);{let r=t.get($m),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(UU,"resolveAuthServerEndpoint");function jDt(t){if(!t)return!1;try{return NKr(t),!0}catch{return!1}}a(jDt,"isValidAuthServer");p();p();p();p();p();p();p();p();function IB(t,e){return t||e}a(IB,"_pureAssign");function Wm(t,e){return t[e]}a(Wm,"_pureRef");var pC=void 0,kh=null,nNt="",E7e="function",ube="object",SB="prototype",tNt="__proto__",zW="undefined",m7e="constructor",iNt="Symbol",Qyo="_polyfill",YW="length",g7e="name",AA="call",_7e="toString",ix=IB(Object),oNt=Wm(ix,SB),UKr=IB(String),KW=Wm(UKr,SB),dbe=IB(Math),QKr=IB(Array),v7e=Wm(QKr,SB),TB=Wm(v7e,"slice");function $f(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a($f,"safe");function qyo(t,e){var r=$f(t);return r.e?e:r.v}a(qyo,"safeGet");var HDt;function C7e(t){return function(e){return typeof e===t}}a(C7e,"_createIs");function qKr(t){var e="[object "+t+"]";return function(r){return!!(r&&fbe(r)===e)}}a(qKr,"_createObjIs");function fbe(t){return oNt[_7e].call(t)}a(fbe,"objToString");function Nn(t){return typeof t===zW||t===zW}a(Nn,"isUndefined");function jyo(t){return!Tse(t)}a(jyo,"isStrictUndefined");function Xt(t){return t===kh||Nn(t)}a(Xt,"isNullOrUndefined");function Hyo(t){return t===kh||!Tse(t)}a(Hyo,"isStrictNullOrUndefined");function Tse(t){return!!t||t!==pC}a(Tse,"isDefined");function Gyo(t){return!HDt&&(HDt=["string","number","boolean",zW,"symbol","bigint"]),t!==ube&&HDt.indexOf(t)!==-1}a(Gyo,"isPrimitiveType");var Ei=C7e("string"),Or=C7e(E7e);function Gu(t){return!t&&Xt(t)?!1:!!t&&typeof t===ube}a(Gu,"isObject");var ur=Wm(QKr,"isArray"),b7e=qKr("Date"),Dh=C7e("number"),Wk=C7e("boolean");var xB=qKr("Error");function tg(t){return!!(t&&t.then&&Or(t.then))}a(tg,"isPromiseLike");function W1(t){return!(!t||qyo(function(){return!(t&&0+t)},!t))}a(W1,"isTruthy");var Ise=Wm(ix,"getOwnPropertyDescriptor");function rg(t,e){return!!t&&oNt.hasOwnProperty[AA](t,e)}a(rg,"objHasOwnProperty");var yA=IB(Wm(ix,"hasOwn"),$yo);function $yo(t,e){return rg(t,e)||!!Ise(t,e)}a($yo,"polyObjHasOwn");function Yr(t,e,r){if(t&&Gu(t)){for(var n in t)if(yA(t,n)&&e[AA](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var f7e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function Vyo(t){var e={};if(e[f7e.c]=!0,e[f7e.e]=!0,t.l){e.get=function(){return t.l.v};var r=Ise(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[f7e[n]]=jyo(o)?e[f7e[n]]:o}),e}a(Vyo,"_createProp");var S_=Wm(ix,"defineProperty"),jKr=Wm(ix,"defineProperties");function ji(t,e,r){return S_(t,e,Vyo(r))}a(ji,"objDefine");function HKr(t,e,r,n,o){var s={};return Yr(t,function(c,l){A7e(s,c,e?l:c),A7e(s,l,r?l:c)}),n?n(s):s}a(HKr,"_createKeyValueMap");function A7e(t,e,r,n){S_(t,e,{value:r,enumerable:!0,writable:!1})}a(A7e,"_assignMapValue");var Hu=IB(UKr),Wyo="[object Error]";function dr(t,e){var r=nNt,n=oNt[_7e][AA](t);n===Wyo&&(t={stack:Hu(t.stack),message:Hu(t.message),name:Hu(t.name)});try{r=JSON.stringify(t,kh,e?typeof e=="number"?e:4:pC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):kh)||Hu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function Zc(t){throw new Error(t)}a(Zc,"throwError");function zm(t){throw new TypeError(t)}a(zm,"throwTypeError");var GKr=Wm(ix,"freeze");function zyo(t){return t}a(zyo,"_doNothing");function Yyo(t){return t[tNt]||kh}a(Yyo,"_getProto");var wB=Wm(ix,"assign"),$u=Wm(ix,"keys");function T_(t){return GKr&&Yr(t,function(e,r){(ur(r)||Gu(r))&&T_(r)}),Nh(t)}a(T_,"objDeepFreeze");var Nh=IB(GKr,zyo);var rNt=IB(Wm(ix,"getPrototypeOf"),Yyo);function S7e(t){return HKr(t,1,0,Nh)}a(S7e,"createEnum");function Kyo(t){return HKr(t,0,0,Nh)}a(Kyo,"createEnumKeyMap");function Jyo(t){var e={};return Yr(t,function(r,n){A7e(e,r,n[1]),A7e(e,n[0],n[1])}),Nh(e)}a(Jyo,"createSimpleMap");function sNt(t){return Jyo(t)}a(sNt,"createTypeMap");var $Kr=Kyo({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}),MKr="__tsUtils$gblCfg",GDt;function VKr(){var t;return typeof globalThis!==zW&&(t=globalThis),!t&&typeof self!==zW&&(t=self),!t&&typeof window!==zW&&(t=window),!t&&typeof global!==zW&&(t=global),t}a(VKr,"_getGlobalValue");function WKr(){if(!GDt){var t=$f(VKr).v||{};GDt=t[MKr]=t[MKr]||{}}return GDt}a(WKr,"_getGlobalConfig");var xse=pbe;function pbe(t,e,r){var n=e?e[t]:kh;return function(o){var s=(o?o[t]:kh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?TB[AA](c,1):c)}zm('"'+Hu(t)+'" not defined for '+dr(o))}}a(pbe,"_unwrapFunctionWithPoly");function Zyo(t){return function(e){return e[t]}}a(Zyo,"_unwrapProp");var QU=Wm(dbe,"min"),zk=Wm(dbe,"max"),OKr=xse("slice",KW),Vf=xse("substring",KW),T7e=pbe("substr",KW,Xyo);function Xyo(t,e,r){return Xt(t)&&zm("Invalid "+dr(t)),r<0?nNt:(e=e||0,e<0&&(e=zk(e+t[YW],0)),Nn(r)?OKr(t,e):OKr(t,e,e+r))}a(Xyo,"polyStrSubstr");function cM(t,e){return Vf(t,0,e)}a(cM,"strLeft");var LKr="_urid",$Dt;function eEo(){if(!$Dt){var t=WKr();$Dt=t.gblSym=t.gblSym||{k:{},s:{}}}return $Dt}a(eEo,"_globalSymbolRegistry");var p7e;function aNt(t){var e={description:Hu(t),toString:a(function(){return iNt+"("+t+")"},"toString")};return e[Qyo]=!0,e}a(aNt,"polyNewSymbol");function tEo(t){var e=eEo();if(!yA(e.k,t)){var r=aNt(t),n=$u(e.s).length;r[LKr]=function(){return n+"_"+r[_7e]()},e.k[t]=r,e.s[r[LKr]()]=Hu(t)}return e.k[t]}a(tEo,"polySymbolFor");function rEo(t){!p7e&&(p7e={});var e,r=$Kr[t];return r&&(e=p7e[r]=p7e[r]||aNt(iNt+"."+r)),e}a(rEo,"polyGetKnownSymbol");var Ph;function qU(){Ph=WKr()}a(qU,"_initTestHooks");function I7e(t){var e={};return!Ph&&qU(),e.b=Ph.lzy,S_(e,"v",{configurable:!0,get:a(function(){var r=t();return Ph.lzy||S_(e,"v",{value:r}),e.b=Ph.lzy,r},"get")}),e}a(I7e,"getLazy");function z1(t){return S_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(z1,"createCachedValue");var zKr="window",lbe;function x7e(t,e){var r;return function(){return!Ph&&qU(),(!r||Ph.lzy)&&(r=z1($f(t,e).v)),r.v}}a(x7e,"_getGlobalInstFn");function Vy(t){return!Ph&&qU(),(!lbe||t===!1||Ph.lzy)&&(lbe=z1($f(VKr).v||kh)),lbe.v}a(Vy,"getGlobal");function Di(t,e){var r;if(!lbe||e===!1?r=Vy(e):r=lbe.v,r&&r[t])return r[t];if(t===zKr)try{return window}catch{}return kh}a(Di,"getInst");function RB(){return!!df()}a(RB,"hasDocument");var df=x7e(Di,["document"]);function wse(){return!!ff()}a(wse,"hasWindow");var ff=x7e(Di,[zKr]);function JW(){return!!Vu()}a(JW,"hasNavigator");var Vu=x7e(Di,["navigator"]);var YKr=x7e(function(){return!!$f(function(){return process&&(process.versions||{}).node}).v});var Sse,VDt;function w7e(){return Sse=z1($f(Di,[iNt]).v),Sse}a(w7e,"_initSymbol");function nEo(t){var e=(Ph.lzy?0:Sse)||w7e();return e.v?e.v[t]:pC}a(nEo,"_getSymbolKey");function KKr(){return!!iEo()}a(KKr,"hasSymbol");function iEo(){return!Ph&&qU(),((Ph.lzy?0:Sse)||w7e()).v}a(iEo,"getSymbol");function hbe(t,e){var r=$Kr[t];!Ph&&qU();var n=(Ph.lzy?0:Sse)||w7e();return n.v?n.v[r||t]:e?pC:rEo(t)}a(hbe,"getKnownSymbol");function ox(t,e){!Ph&&qU();var r=(Ph.lzy?0:Sse)||w7e();return r.v?r.v(t):e?kh:aNt(t)}a(ox,"newSymbol");function jU(t){return!Ph&&qU(),VDt=(Ph.lzy?0:VDt)||z1($f(nEo,["for"]).v),(VDt.v||tEo)(t)}a(jU,"symbolFor");function y7e(t){return!!t&&Or(t.next)}a(y7e,"isIterator");function cNt(t){return!Hyo(t)&&Or(t[hbe(3)])}a(cNt,"isIterable");var h7e;function R7e(t,e,r){if(t&&(y7e(t)||(!h7e&&(h7e=z1(hbe(3))),t=t[h7e.v]?t[h7e.v]():kh),y7e(t))){var n=pC,o=pC;try{for(var s=0;!(o=t.next()).done&&e[AA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=kh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(R7e,"iterForOf");function bse(t,e,r){return t.apply(e,r)}a(bse,"fnApply");function Mh(t,e){return!Nn(e)&&t&&(ur(e)?bse(t.push,t,e):y7e(e)||cNt(e)?R7e(e,function(r){t.push(r)}):t.push(e)),t}a(Mh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[YW]>>>0,o=0;o0?r:0;return Vf(t,o,o+n[YW])===n}a(EEo,"polyStrStartsWith");var ZDt="ref",XDt="unref",eNt="hasRef",_Eo="enabled";function vEo(t,e,r){var n=!0,o=t?e(kh):kh,s;function c(){return n=!1,o&&o[XDt]&&o[XDt](),s}a(c,"_unref");function l(){o&&r(o),o=kh}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[eNt]=function(){return o&&o[eNt]?o[eNt]():n},s[ZDt]=function(){return n=!0,o&&o[ZDt]&&o[ZDt](),s},s[XDt]=c,s=S_(s,_Eo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=kh},"dn")}}a(vEo,"_createTimerHandler");function uNt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?pC:e)||setTimeout,c=(o>1?e[1]:pC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),bse(l,pC,TB[AA](arguments))};var u=vEo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;bse(c,pC,[d])}return bse(s,pC,r)},function(d){bse(c,pC,[d])});return u.h}a(uNt,"_createTimeoutWith");function Up(t,e){return uNt(!0,pC,TB[AA](arguments))}a(Up,"scheduleTimeout");function rJr(t,e,r){return uNt(!0,t,TB[AA](arguments,1))}a(rJr,"scheduleTimeoutWith");function k7e(t,e){return uNt(!1,pC,TB[AA](arguments))}a(k7e,"createTimeout");var Ebe=S7e,dNt=sNt;p();var Yk=Ebe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Kk="toLowerCase",dn="length",Pse="warnToConsole",DB="throwInternal",uM="watch",GU="apply",Fi="push",sx="splice",Wu="logger",dM="cancel",NB="initialize",fM="identifier",Dse="removeNotificationListener",Nse="addNotificationListener",hC="isInitialized",_be="getNotifyMgr",$U="getPlugin",K1="name",Ym="processNext",P7e="getProcessTelContext",MB="value",VU="enabled",fNt="stopPollingInternalLogs",ax="unload",vbe="onComplete",D7e="version",N7e="loggingLevelConsole",pM="createNew",J1="teardown",Mse="messageId",hM="message",mC="diagLog",WU="_doTeardown",XW="update",Z1="getNext",zU="setNextPlugin",Cbe="userAgent",cx="split",Jk="replace",bbe="substring",Sbe="indexOf",OB="type",pNt="evtName",Zk="status",hNt="getAllResponseHeaders",Tbe="isChildEvt",X1="data",ez="getCtx",Xk="setCtx",mNt="itemsReceived",Ibe="headers",Ose="urlString",tz="timeout";var M7e="traceFlags";var gNt;function nJr(t,e){gNt||(gNt=gbe("AggregationError",function(n,o){o[dn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new gNt(r,e||[])}a(nJr,"throwAggregationError");p();p();p();var Lse="function",lx="object",eS="undefined",tS="prototype";var YU=Object,xbe=YU[tS];p();var XRl=(Vy()||{}).Symbol,ekl=(Vy()||{}).Reflect;var iJr="hasOwnProperty",bEo=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(wNt,"_hasVisited");function IEo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[_Nt]&&n){var m=u[q7e]||{};m[wbe]!==!1&&(h=(m[d[Bse]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=lM(null);j7e(r,function(u){s[u]=o(e,r,u)});for(var c=nz(t),l=[];c&&!INt(c)&&!wNt(l,c);)j7e(c,function(u){!s[u]&&xNt(c,u,!Rbe)&&(s[u]=o(e,c,u))}),l.push(c),c=nz(c);return s}a(IEo,"_getBaseFuncs");function xEo(t,e,r,n){var o=null;if(t&&rg(r,Bse)){var s=t[q7e]||lM(null);if(o=(s[r[Bse]]||lM(null))[e],o||H7e("Missing ["+e+"] "+Q7e),!o[vNt]&&s[wbe]!==!1){for(var c=!rg(t,e),l=nz(t),u=[];c&&l&&!INt(l)&&!wNt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=nz(l)}try{c&&(t[e]=o),o[vNt]=1}catch{s[wbe]=!1}}}return o}a(xEo,"_getInstFunc");function wEo(t,e,r){var n=e[t];return n===r&&(n=nz(e)[t]),typeof n!==Q7e&&H7e("["+t+"] is not a "+Q7e),n}a(wEo,"_getProtoFunc");function REo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=xEo(this,d,u,f)||wEo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[_Nt]=1,f}if(a(s,"_createDynamicPrototype"),!F7e(t)){var c=r[q7e]=r[q7e]||lM(null);if(!F7e(c)){var l=c[e]=c[e]||lM(null);c[wbe]!==!1&&(c[wbe]=!!o),F7e(l)||j7e(r,function(u){xNt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!rg(t,u)||t[u]&&!t[u][_Nt])&&(t[u]=s(t,u)))})}}}a(REo,"_populatePrototype");function kEo(t,e){if(Rbe){for(var r=[],n=nz(e);n&&!INt(n)&&!wNt(r,n);){if(n===t)return!0;r.push(n),n=nz(n)}return!1}return!0}a(kEo,"_checkPrototype");function ENt(t,e){return rg(t,LB)?t.name||e||oJr:((t||{})[U7e]||{}).name||e||oJr}a(ENt,"_getObjName");function Si(t,e,r,n){rg(t,LB)||H7e("theClass is an invalid class definition.");var o=t[LB];kEo(o,e)||H7e("["+ENt(t)+"] not in hierarchy of ["+ENt(e)+"]");var s=null;rg(o,Bse)?s=o[Bse]:(s=SEo+ENt(t,"_")+"$"+bNt.n,bNt.n++,o[Bse]=s);var c=Si[lJr],l=!!c[B7e];l&&n&&n[B7e]!==void 0&&(l=!!n[B7e]);var u=TEo(e),d=IEo(o,e,u,l);r(e,d);var f=!!Rbe&&!!c[CNt];f&&n&&(f=!!n[CNt]),REo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[lJr]=bNt.o;p();var $7e="Promise";var LNt="rejected";function _l(t,e){return V7e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:LNt,rejected:!0,reason:r}):r})}a(_l,"doAwaitResponse");function V7e(t,e,r,n){var o=t;try{if(tg(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&&PEo(o,n)}return o}a(V7e,"doAwait");function PEo(t,e){var r=t;return e&&(tg(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(PEo,"doFinally");var RNt,kNt,PNt,uJr=!1;function DEo(t,e,r,n){RNt=RNt||{toString:a(function(){return"[[PromiseState]]"},"toString")},kNt=kNt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},PNt=PNt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[RNt]={get:e},o[kNt]={get:r},o[PNt]={get:n},jKr(t,o)}a(DEo,"_addDebugState$1");var pJr=["pending","resolving","resolved",LNt],dJr="dispatchEvent",G7e;function NEo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(NEo,"_hasInitEventFn");function MEo(t,e,r,n){var o=df();!G7e&&(G7e=z1(!!$f(NEo,[o]).v));var s=G7e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),G7e.v&&s.initEvent(e,!1,!0),s&&t[dJr])t[dJr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Di("console");l&&(l.error||l.log)(e,dr(s))}}}a(MEo,"emitEvent");var hJr="unhandledRejection",OEo=hJr.toLowerCase(),kbe=[],LEo=0,BEo=10;var DNt;function fJr(t){return Or(t)?t.toString():dr(t)}a(fJr,"dumpFnObj");function mJr(t,e,r){var n=HU(arguments,3),o=0,s=!1,c,l=[],u=LEo++,d=kbe.length>0?kbe[kbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{kbe.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,L=Nn(N)?c:Or(N)?N(c):N;tg(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{kbe.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 pJr[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&&tg(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=Up(b,BEo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,YKr())process.emit(hJr,c,m);else{var w=ff()||Vy();!DNt&&(DNt=z1($f(Di,[$7e+"RejectionEvent"]).v)),MEo(w,OEo,function(R){return ji(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!DNt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},S_(m,"state",{get:E}),uJr&&DEo(m,E,function(){return fbe(c)},function(){return f}),KKr()&&(m[hbe(11)]="IPromise");function T(){return"IPromise"+(uJr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+fJr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||zm($7e+": executor is not a function - "+fJr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(mJr,"_createPromise");function FEo(t){return function(e){var r=HU(arguments,1);return t(function(n,o){try{var s=[],c=1;R7e(e,function(l,u){l&&(c++,V7e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(FEo,"_createAllPromise");function UEo(t){return z1(function(e){var r=HU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,_l(u,function(f){f.rejected?s[d]={status:LNt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?Ct(e,l):cNt(e)?R7e(e,l):zm("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(UEo,"_createAllSettledPromise");function gJr(t){Ct(t,function(e){try{e()}catch{}})}a(gJr,"syncItemProcessor");function QEo(t){var e=Dh(t)?t:0;return function(r){Up(function(){gJr(r)},e)}}a(QEo,"timeoutItemProcessor");function AJr(t,e){return mJr(AJr,QEo(e),t,e)}a(AJr,"createAsyncPromise");var NNt;function qEo(t,e){!NNt&&(NNt=z1($f(Di,[$7e]).v||null));var r=NNt.v;if(!r)return AJr(t);Or(t)||zm($7e+": executor is not a function - "+dr(t));var n=0;function o(){return pJr[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(qEo,"createNativePromise");var MNt;function Pbe(t){return mJr(Pbe,gJr,t)}a(Pbe,"createSyncPromise");function W7e(t,e){return!MNt&&(MNt=UEo(Pbe)),MNt.v(t,e)}a(W7e,"createSyncAllSettledPromise");var ONt;function Dd(t,e){return!ONt&&(ONt=z1(qEo)),ONt.v.call(this,t,e)}a(Dd,"createPromise");var z7e=FEo(Dd);var Nkl=hbe(11);p();p();p();p();var rS=void 0,So="",iz="channels",Wf="core",Y7e="createPerfMgr",Dbe="disabled",BB="extensionConfig",oz="extensions",gC="processTelemetry",sz="priority",Fse="eventsSent",KU="eventsDiscarded",Use="eventsSendRequest",mM="perfEvent",K7e="offlineEventsStored",J7e="offlineBatchSent",Z7e="offlineBatchDrop",Qse="getPerfMgr",X7e="domain",eQe="path",yJr="Not dynamic - ",EJr="REDACTED",BNt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var jEo="getPrototypeOf",HEo=/-([a-z])/g,GEo=/([^\w\d_$])/g,$Eo=/^(\d+[\w\d_$])/,Hkl=Object[jEo];function JU(t){return!Xt(t)}a(JU,"isNotNullOrUndefined");function Nbe(t){var e=t;return e&&Ei(e)&&(e=e[Jk](HEo,function(r,n){return n.toUpperCase()}),e=e[Jk](GEo,"_"),e=e[Jk]($Eo,function(r,n){return"_"+n})),e}a(Nbe,"normalizeJsName");function Km(t,e){return t&&e?lu(t,e)!==-1:!1}a(Km,"strContains");function ZU(t){return t&&t.toISOString()||""}a(ZU,"toISOString");function Qp(t){return xB(t)?t[K1]:So}a(Qp,"getExceptionName");function gM(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(gM,"setValue");function FNt(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(FNt,"getSetValue");function VEo(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][GU](n,o)}}a(VEo,"_createProxyFunction");function az(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=VEo(r,n))}a(az,"proxyFunctionAs");function cz(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&az(t,o,e,o,n)}),t}a(cz,"proxyFunctions");function UNt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(UNt,"createClassFromInterface");function rQe(t){return t&&wB&&(t=YU(wB({},t))),t}a(rQe,"optimizeObject");function nQe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[dn],d=!1,f=1;for(u>0&&Wk(l)&&(d=l,l=c[f]||{},f++),Gu(l)||(l={});f>>=0),Fbe=xJr+t&uz,Ube=wJr-t&uz,RJr=!0}a(s_o,"_mwcSeed");function a_o(){try{var t=El()&2147483647;s_o((Math.random()*IJr^t)+t)}catch{}}a(a_o,"_autoSeedMwc");function TJr(t){var e=0,r=zNt()||YNt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&uz),e===0&&Hse()&&(RJr||a_o(),e=c_o()&uz),e===0&&(e=Y1(IJr*Math.random()|0)),t||(e>>>=0),e}a(TJr,"random32");function c_o(t){Ube=36969*(Ube&65535)+(Ube>>16)&uz,Fbe=18e3*(Fbe&65535)+(Fbe>>16)&uz;var e=(Ube<<16)+(Fbe&65535)>>>0&uz|0;return t||(e>>>=0),e}a(c_o,"mwcRandom32");function kJr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=TJr()>>>0,n=0,o=So;o[dn]>>=6,n===5&&(r=(TJr()<<2&4294967295|r&3)>>>0,n=0);return o}a(kJr,"newId");var PJr="3.3.11",l_o="."+kJr(6),u_o=0;function DJr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(DJr,"_canAcceptData");function d_o(t,e){var r=e[t.id];if(!r){r={};try{DJr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(d_o,"_getCache");function nS(t,e){return e===void 0&&(e=!1),Nbe(t+u_o+++(e?"."+PJr:So)+l_o)}a(nS,"createUniqueNamespace");function sQe(t){var e={id:nS("_aiData-"+(t||So)+"."+PJr),accept:a(function(r){return DJr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Nbe(n)]:(s&&(c=d_o(e,r),c[Nbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(sQe,"createElmNodeData");p();function aQe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(aQe,"_isConfigDefaults");function NJr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&nJr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[dn]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(FB(t[0],e),function(){fQe(HU(t,1),e,r)}):r(),n}a(fQe,"doUnloadAll");p();var FJr=500,tMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function E_o(t,e,r){return!t&&Xt(t)?e:Wk(t)?t:Hu(t)[Kk]()==="true"}a(E_o,"_stringToBoolOrDefault");function rMt(t){return{mrg:!0,v:t}}a(rMt,"cfgDfMerge");function $se(t,e,r){return{fb:r,isVal:t,v:e}}a($se,"cfgDfValidate");function fx(t,e){return{fb:e,set:E_o,v:!!t}}a(fx,"cfgDfBoolean");p();p();var nMt=[Fse,KU,Use,mM],hQe=null,pQe;function __o(t,e){return function(){var r=arguments,n=iMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][GU](o,r)}}}a(__o,"_listenerProxyFunc");function v_o(){var t=Di("Microsoft");return t&&(hQe=t.ApplicationInsights),hQe}a(v_o,"_getExtensionNamespace");function iMt(t){var e=hQe;return!e&&t.disableDbgExt!==!0&&(e=hQe||v_o()),e?e.ChromeDbgExt:null}a(iMt,"getDebugExt");function UJr(t){if(!pQe){pQe={};for(var e=0;e=A&&(d[T](b[hM]),n[w]=!0)}else o>=A&&d[T](b[hM]);f(A,b)}},d.debugToConsole=function(A){oMt("debug",A),g("warning",A)},d[Pse]=function(A){oMt("warn",A),g("warning",A)},d.errorToConsole=function(A){oMt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[ax]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=S_o+y[Mse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Fi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new $be(23,v,!1);d.queue[Fi](b),A===1?d.errorToConsole(v):d[Pse](v)}}}a(f,"_logInternalMessage");function h(A){return dx(Oh(A,T_o,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=iMt(e||{});E&&E[mC]&&E[mC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function jJr(t){return t||new Wse}a(jJr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),jJr(t)[DB](e,r,n,o,s)}a(Wr,"_throwInternal");function UB(t,e){jJr(t)[Pse](e)}a(UB,"_warnToConsole");var sMt,t7,HJr="toGMTString",GJr="toUTCString",uMt="cookie",aMt="expires",$Jr="isCookieUseDisabled",Vbe="disableCookiesUsage",VJr="_ckMgr",mQe=null,cMt=null,WJr=null,yM,zJr={},YJr={},x_o=(sMt={cookieCfg:rMt((t7={},t7[X7e]={fb:"cookieDomain",dfVal:JU},t7.path={fb:"cookiePath",dfVal:JU},t7.enabled=rS,t7.ignoreCookies=rS,t7.blockedCookies=rS,t7.disableCookieDefer=!1,t7)),cookieDomain:rS,cookiePath:rS},sMt[Vbe]=rS,sMt);function dMt(){!yM&&(yM=I7e(function(){return df()}))}a(dMt,"_getDoc");function gQe(t){return t?t.isEnabled():!0}a(gQe,"_isMgrEnabled");function tZr(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(tZr,"_isIgnoredCookie");function KJr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:tZr(t,e)}a(KJr,"_isBlockedCookie");function JJr(t,e){var r=e[VU];if(Xt(r)){var n=void 0;Nn(t[$Jr])||(n=!t[$Jr]),Nn(t[Vbe])||(n=!t[Vbe]),r=n}return r}a(JJr,"_isCfgEnabled");function rZr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[eQe]=E||"/",_[aMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Hse()||(v["max-age"]="0"),XJr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||So),R=lu(w,";");if(R!==-1&&(w=Ni(cM(E,R)),T=nZr(Vf(E,R+1))),gM(T,X7e,v||o,W1,Nn),!Xt(_)){var x=Hse();if(Nn(T[aMt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),gM(T,aMt,ZJr(N,x?HJr:GJr)||ZJr(N,x?HJr:GJr)||So,W1)}}x||gM(T,"max-age",So+_,null,Nn)}var L=Lbe();return L&&L.protocol==="https:"&&(gM(T,"secure",null,null,Nn),cMt===null&&(cMt=!R_o((Vu()||{})[Cbe])),cMt&&gM(T,"SameSite","None",null,Nn)),gM(T,eQe,b||n,null,Nn),XJr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[dn]-1;_>=0;_--)f[_].n===E&&f[sx](_,1)}a(g,"_removePendingCookie");function A(){lMt(e)&&f&&(Ct(f,function(E){KJr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Oh(t||YJr,null,e).cfg,s=dx(t,function(E){E.setDf(E.cfg,x_o),r=E.ref(E.cfg,"cookieCfg"),n=r[eQe]||"/",o=r[X7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=JJr(t,r)!==!1,l=r.getCookie||w_o,u=r.setCookie||eZr,d=r.delCookie||eZr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=JJr(t,r)!==!1&&c&&lMt(e),_=YJr[VJr];return E&&_&&y!==_&&(E=gQe(_)),E},"isEnabled"),setEnabled:a(function(E){r[VU]=E,Nn(t[Vbe])||(t[Vbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=KJr(r,E);if(!R){var x=m(_,v,b,T);gQe(y)?(u(E,x),w=!0):f&&(g(E),f[Fi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=So,v=tZr(r,E);if(!v){if(gQe(y))_=l(E);else if(f)for(var b=f[dn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(cM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return gQe(y)?v=y.purge(E,_):f&&(g(E),f[Fi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return lMt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[VJr]=y,y}a(rZr,"createCookieMgr");function lMt(t){if(mQe===null){mQe=!1,!yM&&dMt();try{var e=yM.v||{};mQe=e[uMt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+Qp(r),{exception:dr(r)})}}return mQe}a(lMt,"areCookiesSupported");function nZr(t){var e={};if(t&&t[dn]){var r=Ni(t)[cx](";");Ct(r,function(n){if(n=Ni(n||So),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(cM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(nZr,"_extractParts");function ZJr(t,e){return Or(t[e])?t[e]():null}a(ZJr,"_formatDate");function XJr(t,e){var r=t||So;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?So:"="+o)}),r}a(XJr,"_formatCookieValue");function w_o(t){var e=So;if(!yM&&dMt(),yM.v){var r=yM.v[uMt]||So;WJr!==r&&(zJr=nZr(r),WJr=r),e=Ni(zJr[t]||So)}return e}a(w_o,"_getCookieValue");function eZr(t,e){!yM&&dMt(),yM.v&&(yM.v[uMt]=t+"="+e)}a(eZr,"_setCookieValue");function R_o(t){return Ei(t)?!!(Km(t,"CPU iPhone OS 12")||Km(t,"iPad; CPU OS 12")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&Km(t,"Version/")&&Km(t,"Safari")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Km(t,"Chrome/5")||Km(t,"Chrome/6")||Km(t,"UnrealEngine")&&!Km(t,"Chrome")||Km(t,"UCBrowser/12")||Km(t,"UCBrowser/11")):!1}a(R_o,"uaDisallowsSameSiteNone");p();var k_o={perfEvtsSendAll:!1};function P_o(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(P_o,"_runScheduledListeners");function r7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Fi]({fn:n,arg:o}),r.h=r.h||Up(P_o,0,r)):$f(n,[o]))})}a(r7,"_runListeners");var iZr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Oh(e,k_o);n=c[uM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[Nse]=function(u){o[Fi](u)},l[Dse]=function(u){for(var d=Vo(o,u);d>-1;)o[sx](d,1),d=Vo(o,u)},l[Fse]=function(u){r7(o,Fse,s,function(d){d[Fse](u)})},l[KU]=function(u,d,f){r7(o,KU,s,function(h){h[KU](u,d,f)})},l[Use]=function(u,d){r7(o,Use,d?s:null,function(f){f[Use](u,d)})},l[mM]=function(u){u&&(r||!u[Tbe]())&&r7(o,mM,null,function(d){u.isAsync?Up(function(){return d[mM](u)},0):d[mM](u)})},l[K7e]=function(u){u&&u[dn]&&r7(o,K7e,s,function(d){d[K7e](u)})},l[J7e]=function(u){u&&u[X1]&&r7(o,J7e,s,function(d){d[J7e](u)})},l[Z7e]=function(u,d){if(u>0){var f=d||0;r7(o,Z7e,s,function(h){h[Z7e](u,f)})}},l[ax]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[dM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(r7(o,"unload",null,function(h){var m=h[ax](u);m&&(f||(f=[]),f[Fi](m))}),f)return Dd(function(h){return _l(z7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var zse="ctx",pMt="ParentContextKey",Wbe="ChildrenContextKey",D_o=null,AQe=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[K1]=e,o.isAsync=n,o[Tbe]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[ez]=function(c){return c?c===t[pMt]||c===t[Wbe]?o[c]:(o[zse]||{})[c]:null},o[Xk]=function(c,l){if(c)if(c===t[pMt])o[c]||(o[Tbe]=function(){return!0}),o[c]=l;else if(c===t[Wbe])o[c]=l;else{var u=o[zse]=o[zse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[ez](t[Wbe]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[Wu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[BB];!_&&A&&(_={}),E[BB]=_,_=e.ref(E,BB),_&&(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&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}Qbe(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]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[$U]();y&&g(y)}}return a(m,"_iterateChain"),c}a(AMt,"_createInternalContext");function eP(t,e,r,n){var o=Oh(e),s=AMt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[gC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=n7(d,o.cfg,r,f)),eP(d||c[Z1](),o.cfg,r,f)}return a(u,"_createNew"),c[Ym]=l,c[pM]=u,c}a(eP,"createProcessTelemetryContext");function Yse(t,e,r){var n=Oh(e.config),o=AMt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[ax](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=n7(u,n.cfg,e,d)),Yse(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[pM]=l,s}a(Yse,"createProcessTelemetryUnloadContext");function zbe(t,e,r){var n=Oh(e.config),o=AMt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[XW])&&d[XW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=n7(u,n.cfg,e,d)),zbe(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[pM]=l,s}a(zbe,"createProcessTelemetryUpdateContext");function n7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[dn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[gC])){var u=F_o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?n7([n],e,r):o}a(n7,"createTelemetryProxyChain");function F_o(t,e,r){var n=null,o=Or(t[gC]),s=Or(t[zU]),c;t?c=t[fM]+"-"+t[sz]+"-"+dZr++:c="Unknown-0-"+dZr++;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[uZr])&&(g=t[uZr]()),g||(g=eP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[fM]:L_o,T=g[lZr];return T||(T=g[lZr]={}),g.setNext(n),t&&yQe(g[Wf](),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)&&Wr(g[mC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=QB(t);return _[J1]||_[Dbe]?!1:(s&&t[zU](n),t[gC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Ym](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&(_[Wf]=null,_[J1]=!0,_[hC]=!1,t[J1]&&t[J1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Ym](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&t[XW]&&t[XW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Ym](A)}return a(m,"_updatePlugin"),Nh(l)}a(F_o,"createTelemetryPluginProxy");var U_o=(function(){function t(e,r,n,o){var s=this,c=eP(e,r,n,o);cz(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function _Qe(){var t=[];function e(n){n&&t[Fi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Wr(n[mC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(_Qe,"createUnloadHandlerContainer");p();var vQe,CQe;function bQe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Wr(n,2,73,"Unloading:"+dr(c))}}),vQe&&o[dn]>vQe&&(CQe?CQe("doUnload",o):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),vQe&&t[dn]>vQe&&(CQe?CQe("Add",t):Wr(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(bQe,"createUnloadHookContainer");var yMt,i7="getPlugin",Q_o=(yMt={},yMt[BB]={isVal:JU,v:{}},yMt),Ybe=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[NB]=function(h,m,g,A){u(h,m,A),r=!0},f[J1]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||Yse(null,g,o&&o[i7]?o[i7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[mC]()),A===!0&&E[Ym](_),d())}return a(v,"_unloadCallback"),!f[WU]||f[WU](E,_,v)!==!0?v():A=!0,A},f[XW]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||zbe(null,g,o&&o[i7]?o[i7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[Z1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},az(f,"_addUnloadCb",function(){return s},"add"),az(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[mC]=function(f){return l(f)[mC]()},e[hC]=function(){return r},e.setInitialized=function(f){r=f},e[zU]=function(f){o=f},e[Ym]=function(f,h){h?h[Ym](f):o&&Or(o[gC])&&o[gC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||eP(null,{},e[Wf]);o&&o[i7]?h=m[pM](null,o[i7]):h=m[pM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Oh(f,Q_o,dz(h)),!m&&h&&(m=h[P7e]()[Z1]());var g=o;o&&o[i7]&&(g=o[i7]()),e[Wf]=h,n=eP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Wf]=null,n=null,o=null,c=bQe(),s=_Qe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function q_o(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[sx](c,1),-1})},"remove")};return o}a(q_o,"_addInitializer");function j_o(t,e,r){for(var n=!1,o=t[dn],s=0;s"},"v")})}a(Z_o,"_createUnloadHook");var vMt=(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,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[hC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[NB]=function(ne,ce,Ne,we){g&&Zc(pZr),U[hC]()&&Zc("Core cannot be initialized more than once"),e=Oh(ne,EMt,Ne||U[Wu],!1),ne=e.cfg,qe(e[uM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||$_o,Y(_t);var Dt=st.ref(st.cfg,BB);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=J_o(e,v,s&&U[_be](),b),K(),U[Wu]=Ne;var Be=ne[oz];if(f=[],f[Fi].apply(f,rz(rz([],ce,!1),Be,!1)),h=ne[iz],Le(null),(!m||m[dn]===0)&&Zc("No "+iz+" available"),h&&h[dn]>1){var rt=U[$U]("TeeChannelController");(!rt||!rt.plugin)&&Wr(n,1,28,"TeeChannel required")}K_o(ne,R,n),R=null,r=!0,N===Yk.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[Fi](ce)}),Nh(ne)},U.track=function(ne){yQe(U[Qse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[K1]&&Xt(ne[K1])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||ZU(new Date),ne.ver=ne.ver||"4.0",!g&&U[hC]()&&N===Yk.ACTIVE?le()[Ym](ne):N!==Yk.INACTIVE&&o[dn]<=B&&o[Fi](ne)},function(){return{item:ne}},!ne.sync)},U[P7e]=le,U[_be]=function(){return s||(s=new iZr(e.cfg),U[H_o]=s),s},U[Nse]=function(ne){U.getNotifyMgr()[Nse](ne)},U[Dse]=function(ne){s&&s[Dse](ne)},U.getCookieMgr=function(){return u||(u=rZr(e.cfg,U[Wu])),u},U.setCookieMgr=function(ne){u!==ne&&(FB(u,!1),u=ne)},U[Qse]=function(){return c||l||sZr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[dn]},U.releaseQueue=function(){if(r&&o[dn]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Ym](ce)}):Wr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[dM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=Yk.INACTIVE;var we="Please provide instrumentation key";r?(Wr(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[Fi](ce),w=null):w=ce,tg(Ne)?(Be[Fi](Ne),L=null):L=Ne,Be[dn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=JU(ne.initTimeOut)?ne.initTimeOut:V_o,we=W7e(ce);M&&M[dM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[MB];if(rt&&rt[dn]){var st=rt[0];if(w=st&&st[MB],rt[dn]>1){var _t=rt[1];L=_t&&_t[MB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=Yk.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=Yk.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[VU])&&!Q){var ce=ne||n&&n.queue[dn]>0;ce&&(j||(j=!0,qe(e[uM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[VU],O[dM]()),O=k7e(X,we),O.unref(),O[VU]=Be}))),O[VU]=!0)}return O}a(ie,"_startLogPoller"),U[fNt]=function(){Q=!0,O&&O[dM](),X()},cz(U,function(){return A},["addTelemetryInitializer"]),U[ax]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc(G_o),g&&Zc(pZr);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Yse(Ue(),U);rt[vbe](function(){v.run(U[Wu]),fQe([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[fNt](),rt[Ym](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[$U]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(gZr);return}var Be=ge(ne[fM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[fM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[Fi](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[hC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[oz]=we[oz],ne[iz]=we[iz]}e._block(function(Be){var rt=Be.cfg;_Mt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,rS)}),Be.setDf(rt,EMt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=cZr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,az(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=dx(e.cfg,ne,U[Wu]):ce=Y_o(R,ne),Z_o(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[fM]&&we[D7e]&&!ne[we.identifier]){var Be=we[fM]+"="+we[D7e];P[Fi](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Oh({},EMt,U[Wu]),e.cfg[N7e]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||So},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Wse(e.cfg),e[Wu]=n),n},"g"),s:a(function(ce){e[Wu]=ce,n!==ce&&(FB(n,!1),n=ce)},"s")}),U[Wu]=new Wse(e.cfg),x=[];var ne=U.config[oz]||[];ne.splice(0,ne[dn]),Mh(ne,x),A=new fZr,o=[],FB(s,!1),s=null,c=null,l=null,FB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=nS("AIBaseCore",!0),_=_Qe(),T=null,w=null,v=bQe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=eP(Ue(),e.cfg,U);return ne[vbe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=z_o(U[Wu],FJr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=EQe(Mh(m,ce[iz]));var Ne=Mh(EQe(ce[Wf]),m);x=Nh(Ne);var we=U.config[oz]||[];we.splice(0,we[dn]),Mh(we,x);var Be=le();m&&m[dn]>0&&gMt(Be[pM](m),Ne),gMt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[fM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[Fi](Be)}),!Ne&&we[dn]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){QB(Ne)[Dbe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=QB(Ne);return!Be[J1]&&!Be[Dbe]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[Fi](A),d=n7(EQe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[dn]>0){var we=n7(ne,e.cfg,U),Be=Yse(we,U);Be[vbe](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){hZr(Dt,ne)?rt=!0:st[Fi](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){hZr(Ie,ne)?rt=!0:Gt[Fi](Ie)}),_t[Fi](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Ym](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[dn]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[Mse],iKey:w,time:ZU(new Date),baseType:$be.dataType,baseData:{message:ce[hM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[dM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[dn]>0){var Dt=le()[pM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[uM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[Y7e];(ne!==we||!ne)&&(we||(we=W_o),FNt(ce.cfg,Y7e,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[_be]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=zbe(Ue(),U);ce[vbe](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Ym](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[Wu];ce?(Wr(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[_be]();ce&&ce[KU]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function Kbe(t,e){try{if(t&&t!==""){var r=I_().parse(t);if(r&&r[mNt]&&r[mNt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[dn])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[K1]||dr(n)),{response:t})}return null}a(Kbe,"parseResponse");p();var tP="",X_o="NoResponseBody",AZr="&"+X_o+"=true",CMt="POST",bMt=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[NB]=function(M,O){o=O,n&&Wr(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=Lbe();O&&O.protocol&&O.protocol[Kk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[dn]?R(M,O):null},E.getFallbackInst=function(){return d},E[WU]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[X1]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[X1])?new TextEncoder().encode(j[X1]):j[X1]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[MB];if(!Le.done)return z[Fi](Le[MB]),ie+=Le.value[dn],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[Ibe]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=AZr)):le=!0);var ke=new Request(U,Ue);try{ke[tMt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?tP:K):x(O,s?0:400,{},s?tP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[Zk],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||tP,he):x(O,ue,{},Z||tP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[hM],499),ie&&ie(K.reason);else{var he=K[MB];try{!s&&!he.ok?(he[Zk]?X(he.statusText,he[Zk]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,tP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[MB]),z&&z(!0)})}catch(Z){he&&he[Zk]?X(dr(Z),he[Zk]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[tz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[tz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[X1];U.onload=function(){var H=qse(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?tP:Mbe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Ose];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Wr(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[Jk](/^(https?:)/,"");U.open(CMt,ie),M[tz]&&(U[tz]=M[tz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.send(Y)}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 SZr="on",yZr="attachEvent",EZr="addEventListener",_Zr="detachEvent",vZr="removeEventListener",SMt="events";var JNl=nS("aiEvtPageHide"),ZNl=nS("aiEvtPageShow"),evo=/\.[\.]+/g,tvo=/[\.]+$/,rvo=1,SQe=sQe("events"),nvo=/^([^.]*)(?:\.(.+)|)/;function CZr(t){return t&&t[Jk]?t[Jk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(CZr,"_normalizeNamespace");function TMt(t,e){if(e){var r=So;ur(e)?(r=So,Ct(e,function(o){o=CZr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=CZr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=nvo.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(evo,".").replace(tvo,So)[cx](".").sort().join(".")}}a(TMt,"_getEvtNamespace");function TZr(t,e,r){r===void 0&&(r=!0);var n=SQe.get(t,SMt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(TZr,"_getRegisteredEvents");function IZr(t,e,r,n){t&&e&&e[OB]&&(t[vZr]?t[vZr](e[OB],r,n):t[_Zr]&&t[_Zr](SZr+e[OB],r))}a(IZr,"_doDetach");function ivo(t,e,r,n){var o=!1;return t&&e&&e[OB]&&r&&(t[EZr]?(t[EZr](e[OB],r,n),o=!0):t[yZr]&&(t[yZr](SZr+e[OB],r),o=!0)),o}a(ivo,"_doAttach");function bZr(t,e,r,n){for(var o=e[dn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[pNt].ns)&&(!n||n(s))&&(IZr(t,s[pNt],s.handler,s.capture),e[sx](o,1))}}a(bZr,"_doUnregister");function ovo(t,e,r){if(e[OB])bZr(t,TZr(t,e[OB]),e,r);else{var n=SQe.get(t,SMt,{});Yr(n,function(o,s){bZr(t,s,e,r)}),$u(n)[dn]===0&&SQe.kill(t,SMt)}}a(ovo,"_unregisterEvents");function Jbe(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=TMt("xx",r).ns[cx](".")):r=t,r}a(Jbe,"mergeEvtNamespace");function TQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=TMt(e,n);if(s=ivo(t,c,r,o),s&&SQe.accept(t)){var l={guid:rvo++,evtName:c,handler:r,capture:o};TZr(t,c.type)[Fi](l)}}catch{}return s}a(TQe,"eventOn");function IMt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=TMt(e,n),c=!1;ovo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||IZr(t,s,r,o)}catch{}}a(IMt,"eventOff");p();var Zbe="sampleRate",Xbe="ProcessLegacy",IQe="http.method",fz="https://dc.services.visualstudio.com",EM="/v2/track",zy="not_specified";p();var xQe=dNt({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 pz="split",mo="length",hz="toLowerCase",s7="ingestionendpoint",a7="toString",xMt="removeItem",Kse="message",NZr="count";var e1e="stringify",t1e="pathname",mz="match";var Yy="name";var EA="properties",Ky="measurements",r1e="sizeInBytes",n1e="typeName",Jse="exceptions",gz="severityLevel",wQe="problemGroup",Az="parsedStack",i1e="hasFullStack",o1e="assembly",_M="fileName",yz="line",Zse="aiDataContract",Ez="duration";function wMt(t,e,r){var n=e[mo],o=MZr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Vf(o,0,147)+OZr(s);o=c}return o}a(wMt,"dataSanitizeKeyAndAddUniqueness");function MZr(t,e){var r;return e&&(e=Ni(Hu(e)),e[mo]>150&&(r=Vf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(MZr,"dataSanitizeKey");function uu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Ni(Hu(e)),e[mo]>r&&(n=Vf(e,0,r),Wr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(uu,"dataSanitizeString");function _z(t,e,r){return Ei(e)&&(e=ZNt(e,r)),PMt(t,e,2048,66)}a(_z,"dataSanitizeUrl");function s1e(t,e){var r;return e&&e[mo]>32768&&(r=Vf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(s1e,"dataSanitizeMessage");function RMt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Vf(n,0,32768),Wr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(RMt,"dataSanitizeException");function x_(t,e){if(e){var r={};Yr(e,function(n,o){if(Gu(o)&&XU())try{o=I_()[e1e](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=uu(t,o,8192),n=wMt(t,n,r),r[n]=o}),e=r}return e}a(x_,"dataSanitizeProperties");function w_(t,e){if(e){var r={};Yr(e,function(n,o){n=wMt(t,n,r),r[n]=o}),e=r}return e}a(w_,"dataSanitizeMeasurements");function kMt(t,e){return e&&PMt(t,e,128,69)[a7]()}a(kMt,"dataSanitizeId");function PMt(t,e,r,n){var o;return e&&(e=Ni(Hu(e)),e[mo]>r&&(o=Vf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(PMt,"dataSanitizeInput");function OZr(t){var e="00"+t;return T7e(e,e[mo]-3)}a(OZr,"dsPadNumber");p();var LZr=df()||{},BZr=0,avo=[null,null,null,null,null];function FZr(t){var e=BZr,r=avo,n=r[e];return LZr.createElement?r[e]||(n=r[e]=LZr.createElement("a")):n={host:cvo(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),BZr=e,n}a(FZr,"urlParseUrl");function cvo(t,e){var r=UZr(t,e)||"";if(r){var n=r[mz](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&Ei(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(cvo,"urlParseHost");function UZr(t,e){var r=null;if(t){var n=t[mz](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&Ei(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[hz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(UZr,"urlParseFullHost");var lvo=[fz+EM,"https://breeze.aimon.applicationinsights.io"+EM,"https://dc-int.services.visualstudio.com"+EM];function RQe(t){return Vo(lvo,t[hz]())!==-1}a(RQe,"isInternalApplicationInsightsEndpoint");function QZr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=FZr(e);if(o=l.host,!s)if(l[t1e]!=null){var u=l.pathname[mo]===0?"/":l[t1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[t1e],s=uu(t,r?r+" "+u:u)}else s=uu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(QZr,"AjaxHelperParseDependencyPath");p();p();var kQe=Ebe({LocalStorage:0,SessionStorage:1});var Xse=void 0,qZr="";function jZr(t){try{if(Xt(Vy()))return null;var e=new Date()[a7](),r=Di(t===kQe.LocalStorage?"localStorage":"sessionStorage"),n=qZr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[xMt](n),!o)return r}catch{}return null}a(jZr,"_getVerifiedStorageObject");function DMt(){return PQe()?jZr(kQe.SessionStorage):null}a(DMt,"_getSessionStorageObject");function NMt(t){qZr=t||""}a(NMt,"utlSetStoragePrefix");function PQe(t){return(t||Xse===void 0)&&(Xse=!!jZr(kQe.SessionStorage)),Xse}a(PQe,"utlCanUseSessionStorage");function MMt(t,e){var r=DMt();if(r!==null)try{return r.getItem(e)}catch(n){Xse=!1,Wr(t,2,2,"Browser failed read of session storage. "+Qp(n),{exception:dr(n)})}return null}a(MMt,"utlGetSessionStorage");function OMt(t,e,r){var n=DMt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Xse=!1,Wr(t,2,4,"Browser failed write to session storage. "+Qp(o),{exception:dr(o)})}return!1}a(OMt,"utlSetSessionStorage");function LMt(t,e){var r=DMt();if(r!==null)try{return r[xMt](e),!0}catch(n){Xse=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+Qp(n),{exception:dr(n)})}return!1}a(LMt,"utlRemoveSessionStorage");p();var uvo=";",dvo="=";function a1e(t){if(!t)return{};var e=t[pz](uvo),r=mbe(e,function(o,s){var c=s[pz](dvo);if(c[mo]===2){var l=c[0][hz](),u=c[1];o[l]=u}return o},{});if($u(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[s7]=r[s7]||"https://"+n+"dc."+r.endpointsuffix}r[s7]=r[s7]||fz,PB(r[s7],"/")&&(r[s7]=r[s7].slice(0,-1))}return r}a(a1e,"parseConnectionString");p();var BMt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Yy]=uu(e,n)||zy,s.data=r,s.time=ZU(new Date),s[Zse]={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 qB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Yy]=uu(e,r)||zy,s[EA]=x_(e,n),s[Ky]=w_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var fvo=58,pvo=/^\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\?]+)?)/,hvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,mvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,gvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Avo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,yvo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Evo=/([^\(\s\n]+):([0-9]+)$/,HZr="",eae="error",px="stack",UMt="stackDetails",GZr="errorSrc",QMt="message",zZr="description",$Zr=[{re:hvo,len:5,m:1,fn:2,ln:3,col:4},{chk:vvo,pre:_vo,re:mvo,len:4,m:1,fn:2,ln:3},{re:gvo,len:3,m:1,fn:2,hdl:WZr},{re:Avo,len:2,fn:1,hdl:WZr}];function _vo(t){return t.replace(/(\(anonymous\))/,"")}a(_vo,"_scrubAnonymous");function vvo(t){return lu(t,"[native")<0}a(vvo,"_ignoreNative");function qMt(t,e){var r=t;return r&&!Ei(r)&&(JSON&&JSON[e1e]?(r=JSON[e1e](t),e&&(!r||r==="{}")&&(Or(t[a7])?r=t[a7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(qMt,"_stringify");function YZr(t,e){var r=t;return t&&(r&&!Ei(r)&&(r=t[QMt]||t[zZr]||r),r&&!Ei(r)&&(r=qMt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&lu(r||"",e)===-1&&(r=e+": "+r),r||""}a(YZr,"_formatMessage");function Cvo(t){try{if(Gu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Cvo,"_isExceptionDetailsInternal");function bvo(t){try{if(Gu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(bvo,"_isExceptionInternal");function VZr(t){return t&&t.src&&Ei(t.src)&&t.obj&&ur(t.obj)}a(VZr,"_isStackDetails");function vz(t){var e=t||"";Ei(e)||(Ei(e[px])?e=e[px]:e=""+e);var r=e[pz](` -`);return{src:e,obj:r}}a(vz,"_convertStackObj");function Svo(t){for(var e=[],r=t[pz](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||kvo(y)){var E=Hu(y);o=!0;var _=Pvo(E,n);_&&(s+=_[r1e],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(Ivo,"_parseStack");function DQe(t){var e="";if(t&&(e=t.typeName||t[Yy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[a7]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(DQe,"_getErrorType");function FMt(t){if(t)try{if(!Ei(t)){var e=DQe(t),r=qMt(t,!1);return(!r||r==="{}")&&(t[eae]&&(t=t[eae],e=DQe(t)),r=qMt(t,!0)),lu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(FMt,"_formatErrorCode");var Cz=(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,bvo(r)?(l[Jse]=r[Jse]||[],l[EA]=r[EA],l[Ky]=r[Ky],r[gz]&&(l[gz]=r[gz]),r.id&&(l.id=r.id,r[EA].id=r.id),r[wQe]&&(l[wQe]=r[wQe]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Jse]=[JZr(e,r,n)],l[EA]=x_(e,n),l[Ky]=w_(e,o),s&&(l[gz]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=DQe(s||c||e);return{message:YZr(e,d),url:r,lineNumber:n,columnNumber:o,error:FMt(s||c||e),evt:FMt(c||e),typeName:d,stackDetails:KZr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Jse]&&kB(r[Jse],function(l){return Rvo(e,l)}),c=new t(e,ux(ux({},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[i1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=FMt,t})();var xvo=Nh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function wvo(){var t=this,e=ur(t[Az])&&kB(t[Az],function(n){return Nvo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[n1e],message:t[Kse],hasFullStack:t[i1e],stack:t[px],parsedStack:e||void 0};return r}a(wvo,"_toInterface");function JZr(t,e,r){var n,o,s,c,l,u,d,f;if(Cvo(e))c=e[n1e],l=e[Kse],d=e[px],f=e[Az]||[],u=e[i1e];else{var h=e,m=h&&h.evt;xB(h)||(h=h[eae]||m||h),c=uu(t,DQe(h))||zy,l=s1e(t,YZr(e||h,c))||zy;var g=e[UMt]||KZr(e);f=Ivo(g),ur(f)&&kB(f,function(A){A[o1e]=uu(t,A[o1e]),A[_M]=uu(t,A[_M])}),d=RMt(t,Tvo(g)),u=ur(f)&&f[mo]>0,r&&(r[n1e]=r[n1e]||c)}return n={},n[Zse]=xvo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[i1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=wvo,n}a(JZr,"_createExceptionDetails");function Rvo(t,e){var r=ur(e[Az])&&kB(e[Az],function(o){return Dvo(o)})||e[Az],n=JZr(t,ux(ux({},e),{parsedStack:r}));return n}a(Rvo,"_createExDetailsFromInterface");function ZZr(t,e){var r=e[mz](yvo);if(r&&r[mo]>=4)t[_M]=r[1],t[yz]=parseInt(r[2]);else{var n=e[mz](Evo);n&&n[mo]>=3?(t[_M]=n[1],t[yz]=parseInt(n[2])):t[_M]=e}}a(ZZr,"_parseFilename");function WZr(t,e,r){var n=t[_M];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Ni(r[e.fn]||""),t[yz]=parseInt(Ni(r[e.ln]||""))||0):n=Ni(r[e.fn]||"")),n&&ZZr(t,n)}a(WZr,"_handleFilename");function kvo(t){var e=!1;if(t&&Ei(t)){var r=Ni(t);r&&(e=pvo.test(r))}return e}a(kvo,"_isStackFrame");var XZr=Nh({level:1,method:1,assembly:0,fileName:0,line:0});function Pvo(t,e){var r,n;if(t&&Ei(t)&&Ni(t)){n=(r={},r[Zse]=XZr,r.level=e,r.assembly=Ni(t),r.method=HZr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o<$Zr[mo];){var s=$Zr[o];if(s.chk&&!s.chk(t))break;s.pre&&(t=s.pre(t));var c=t[mz](s.re);if(c&&c[mo]>=s.len){s.m&&(n.method=Ni(c[s.m]||HZr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[_M]=Ni(c[s.fn]||""),n[yz]=parseInt(Ni(c[s.ln]||""))||0):ZZr(n,c[s.fn]||""));break}o++}}return eXr(n)}a(Pvo,"_extractStackFrame");function Dvo(t){var e,r=(e={},e[Zse]=XZr,e.level=t.level,e.method=t.method,e.assembly=t[o1e],e.fileName=t[_M],e.line=t[yz],e.sizeInBytes=0,e);return eXr(r)}a(Dvo,"_stackFrameFromInterface");function eXr(t){var e=fvo;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[r1e]=e),t}a(eXr,"_populateFrameSizeInBytes");function Nvo(t){return{level:t.level,method:t.method,assembly:t[o1e],fileName:t[_M],line:t[yz]}}a(Nvo,"_parsedFrameToInterface");p();p();var tXr=(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 jB=(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 tXr;h[NZr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Yy]=uu(e,r)||zy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[EA]=x_(e,u),f[Ky]=w_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var c1e="";function NQe(t){(isNaN(t)||t<0)&&(t=0),t=tJr(t);var e=c1e+t%1e3,r=c1e+Y1(t/1e3)%60,n=c1e+Y1(t/(1e3*60))%60,o=c1e+Y1(t/(1e3*60*60))%24,s=Y1(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+".":c1e)+o+":"+n+":"+r+"."+e}a(NQe,"msToTimeSpan");var bz=(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=kMt(e,l),u.url=_z(e,n),u[Yy]=uu(e,r)||zy,isNaN(o)||(u[Ez]=NQe(o)),u[EA]=x_(e,s),u[Ky]=w_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var Sz=(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[Ez]=NQe(s),g.success=c,g.resultCode=l+"",g.type=uu(e,d);var A=QZr(e,n,u,o);g.data=_z(e,o)||A.data,g.target=uu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Yy]=uu(e,A[Yy]),g[EA]=x_(e,h),g[Ky]=w_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var Tz=(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||zy,c[Kse]=s1e(e,r),c[EA]=x_(e,o),c[Ky]=w_(e,s),n&&(c[gz]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var Iz=(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=_z(e,n),u[Yy]=uu(e,r)||zy,u[EA]=x_(e,s),u[Ky]=w_(e,c),l&&(u.domProcessing=l.domProcessing,u[Ez]=l[Ez],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 HB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function l7(t){var e="ai."+t+".";return function(r){return e+r}}a(l7,"_aiNameFunc");var l1e=l7("application"),Jm=l7("device"),MQe=l7("location"),tae=l7("operation"),jMt=l7("session"),c7=l7("user"),xz=l7("cloud"),u1e=l7("internal"),d1e=(function(t){Wy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(UNt({applicationVersion:l1e("ver"),applicationBuild:l1e("build"),applicationTypeId:l1e("typeId"),applicationId:l1e("applicationId"),applicationLayer:l1e("layer"),deviceId:Jm("id"),deviceIp:Jm("ip"),deviceLanguage:Jm("language"),deviceLocale:Jm("locale"),deviceModel:Jm("model"),deviceFriendlyName:Jm("friendlyName"),deviceNetwork:Jm("network"),deviceNetworkName:Jm("networkName"),deviceOEMName:Jm("oemName"),deviceOS:Jm("os"),deviceOSVersion:Jm("osVersion"),deviceRoleInstance:Jm("roleInstance"),deviceRoleName:Jm("roleName"),deviceScreenResolution:Jm("screenResolution"),deviceType:Jm("type"),deviceMachineName:Jm("machineName"),deviceVMName:Jm("vmName"),deviceBrowser:Jm("browser"),deviceBrowserVersion:Jm("browserVersion"),locationIp:MQe("ip"),locationCountry:MQe("country"),locationProvince:MQe("province"),locationCity:MQe("city"),operationId:tae("id"),operationName:tae("name"),operationParentId:tae("parentId"),operationRootId:tae("rootId"),operationSyntheticSource:tae("syntheticSource"),operationCorrelationVector:tae("correlationVector"),sessionId:jMt("id"),sessionIsFirst:jMt("isFirst"),sessionIsNew:jMt("isNew"),userAccountAcquisitionDate:c7("accountAcquisitionDate"),userAccountId:c7("accountId"),userAgent:c7("userAgent"),userId:c7("id"),userStoreRegion:c7("storeRegion"),userAuthUserId:c7("authUserId"),userAnonymousUserAcquisitionDate:c7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:c7("authUserAcquisitionDate"),cloudName:xz("name"),cloudRole:xz("role"),cloudRoleVer:xz("roleVer"),cloudRoleInstance:xz("roleInstance"),cloudEnvironment:xz("environment"),cloudLocation:xz("location"),cloudDeploymentUnit:xz("deploymentUnit"),internalNodeName:u1e("nodeName"),internalSdkVersion:u1e("sdkVersion"),internalAgentVersion:u1e("agentVersion"),internalSnippet:u1e("snippet"),internalSdkSrc:u1e("sdkSrc")}));p();var Lh=new d1e;p();function rXr(t,e){IMt(t,null,null,e)}a(rXr,"_disableEvents");function HMt(t){var e=df(),r=Vu(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Jbe(nS("OfflineListener"),t);try{if(f(ff())&&(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=TQe(b,"online",y,u),T&&TQe(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=ff();if(b&&n){if(rXr(b,u),e){var T=e.body||e;Nn(T.ononline)||rXr(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(HMt,"createOfflineListener");var OQe="AppInsightsChannelPlugin";p();p();p();p();p();var u7="duration";p();var Bh="tags",LQe="deviceType",AC="data",vM="name",wz="traceID",Bo="length",d7="stringify",f7="measurements",hx="dataType",p7="envelopeType",GB="toString",$B="enqueue",VB="count",mx="push",f1e="emitLineDelimitedJson",h7="clear",rae="markAsSent",Rz="clearSent",p1e="bufferOverride",nae="BUFFER_KEY",WB="SENT_BUFFER_KEY",m7="concat",iae="MAX_BUFFER_SIZE",oae="triggerSend",_A="diagLog",BQe="initialize",sae="_sender",aae="endpointUrl",cae="instrumentationKey",FQe="customHeaders",GMt="maxBatchSizeInBytes",UQe="onunloadDisableBeacon",QQe="isBeaconApiDisabled",$Mt="alwaysUseXhrOverride",VMt="enableSessionStorageBuffer",rP="_buffer",WMt="onunloadDisableFetch",zMt="disableSendBeaconSplit",h1e="getSenderInst",g7="_onError",qQe="_onPartialSuccess",m1e="_onSuccess",jQe="itemsReceived",HQe="itemsAccepted",GQe="baseType",lae="sampleRate",nXr="getHashCodeScore";var YMt="baseType",Nd="baseData",ng="properties",iXr="true";function qp(t,e,r){return gM(t,e,r,W1)}a(qp,"_setValueIf");function Mvo(t,e,r){var n=r[Bh]=r[Bh]||{},o=e.ext=e.ext||{},s=e[Bh]=e[Bh]||[],c=o.user;c&&(qp(n,Lh.userAuthUserId,c.authId),qp(n,Lh.userId,c.id||c.localId));var l=o.app;l&&qp(n,Lh.sessionId,l.sesId);var u=o.device;u&&(qp(n,Lh.deviceId,u.id||u.localId),qp(n,Lh[LQe],u.deviceClass),qp(n,Lh.deviceIp,u.ip),qp(n,Lh.deviceModel,u.model),qp(n,Lh[LQe],u[LQe]));var d=e.ext.web;if(d){qp(n,Lh.deviceLanguage,d.browserLang),qp(n,Lh.deviceBrowserVersion,d.browserVer),qp(n,Lh.deviceBrowser,d.browser);var f=r[AC]=r[AC]||{},h=f[Nd]=f[Nd]||{},m=h[ng]=h[ng]||{};qp(m,"domain",d.domain),qp(m,"isManual",d.isManual?iXr:null),qp(m,"screenRes",d.screenRes),qp(m,"userConsent",d.userConsent?iXr:null)}var g=o.os;g&&(qp(n,Lh.deviceOS,g[vM]),qp(n,Lh.deviceOSVersion,g.osVer));var A=o.trace;A&&(qp(n,Lh.operationParentId,A.parentID),qp(n,Lh.operationName,uu(t,A[vM])),qp(n,Lh.operationId,A[wz]));for(var y={},E=s[Bo]-1;E>=0;E--){var _=s[E];Yr(_,function(b,T){y[b]=T}),s.splice(E,1)}Yr(s,function(b,T){y[b]=T});var v=ux(ux({},n),y);v[Lh.internalSdkVersion]||(v[Lh.internalSdkVersion]=uu(t,"javascript:".concat(Ovo.Version),64)),r[Bh]=rQe(v)}a(Mvo,"_extractPartAExtensions");function A7(t,e,r){Xt(t)||Yr(t,function(n,o){Dh(o)?r[n]=o:Ei(o)?e[n]=o:XU()&&(e[n]=I_()[d7](o))})}a(A7,"_extractPropsAndMeasurements");function kz(t,e){Xt(t)||Yr(t,function(r,n){t[r]=n||e})}a(kz,"_convertPropsUndefinedToCustomDefinedValue");function Pz(t,e,r,n){var o=new BMt(t,n,e);qp(o,"sampleRate",r[Zbe]),(r[Nd]||{}).startTime&&(o.time=ZU(r[Nd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[vM]=o[vM].replace("{0}",s),Mvo(t,r,o),r[Bh]=r[Bh]||[],rQe(o)}a(Pz,"_createEnvelope");function Dz(t,e){Xt(e[Nd])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(Dz,"EnvelopeCreatorInit");var Ovo={Version:"3.3.11"};function oXr(t,e,r){Dz(t,e);var n=e[Nd][f7]||{},o=e[Nd][ng]||{};A7(e[AC],o,n),Xt(r)||kz(o,r);var s=e[Nd];if(Xt(s))return UB(t,"Invalid input for dependency data"),null;var c=s[ng]&&s[ng][IQe]?s[ng][IQe]:"GET",l=new Sz(t,s.id,s.target,s[vM],s[u7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new HB(Sz[hx],l);return Pz(t,Sz[p7],e,u)}a(oXr,"DependencyEnvelopeCreator");function KMt(t,e,r){Dz(t,e);var n={},o={};e[YMt]!==qB[hx]&&(n.baseTypeSource=e[YMt]),e[YMt]===qB[hx]?(n=e[Nd][ng]||{},o=e[Nd][f7]||{}):e[Nd]&&A7(e[Nd],n,o),A7(e[AC],n,o),Xt(r)||kz(n,r);var s=e[Nd][vM],c=new qB(t,s,n,o),l=new HB(qB[hx],c);return Pz(t,qB[p7],e,l)}a(KMt,"EventEnvelopeCreator");function sXr(t,e,r){Dz(t,e);var n=e[Nd][f7]||{},o=e[Nd][ng]||{};A7(e[AC],o,n),Xt(r)||kz(o,r);var s=e[Nd],c=Cz.CreateFromInterface(t,s,o,n),l=new HB(Cz[hx],c);return Pz(t,Cz[p7],e,l)}a(sXr,"ExceptionEnvelopeCreator");function aXr(t,e,r){Dz(t,e);var n=e[Nd],o=n[ng]||{},s=n[f7]||{};A7(e[AC],o,s),Xt(r)||kz(o,r);var c=new jB(t,n[vM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new HB(jB[hx],c);return Pz(t,jB[p7],e,l)}a(aXr,"MetricEnvelopeCreator");function cXr(t,e,r){Dz(t,e);var n,o=e[Nd];!Xt(o)&&!Xt(o[ng])&&!Xt(o[ng][u7])?(n=o[ng][u7],delete o[ng][u7]):!Xt(e[AC])&&!Xt(e[AC][u7])&&(n=e[AC][u7],delete e[AC][u7]);var s=e[Nd],c;((e.ext||{}).trace||{})[wz]&&(c=e.ext.trace[wz]);var l=s.id||c,u=s[vM],d=s.uri,f=s[ng]||{},h=s[f7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[GB]()),!Xt(s[ng])){var m=s[ng];Yr(m,function(y,E){f[y]=E})}A7(e[AC],f,h),Xt(r)||kz(f,r);var g=new bz(t,u,d,n,f,h,l),A=new HB(bz[hx],g);return Pz(t,bz[p7],e,A)}a(cXr,"PageViewEnvelopeCreator");function lXr(t,e,r){Dz(t,e);var n=e[Nd],o=n[vM],s=n.uri||n.url,c=n[ng]||{},l=n[f7]||{};A7(e[AC],c,l),Xt(r)||kz(c,r);var u=new Iz(t,o,s,void 0,c,l,n),d=new HB(Iz[hx],u);return Pz(t,Iz[p7],e,d)}a(lXr,"PageViewPerformanceEnvelopeCreator");function uXr(t,e,r){Dz(t,e);var n=e[Nd].message,o=e[Nd].severityLevel,s=e[Nd][ng]||{},c=e[Nd][f7]||{};A7(e[AC],s,c),Xt(r)||kz(s,r);var l=new Tz(t,n,o,s,c),u=new HB(Tz[hx],l);return Pz(t,Tz[p7],e,u)}a(uXr,"TraceEnvelopeCreator");p();var dXr=(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},Si(t,this,function(c){c[$B]=function(l){if(c[VB]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[VB](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[mx](l)},c[VB]=function(){return n[Bo]},c.size=function(){for(var l=n[Bo],u=0;u0){var u=[];Ct(l,function(f){u[mx](f.item)});var d=r[f1e]?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 JMt(l,u):new $Qe(l,u);return Ct(f,function(m){h[$B](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),$Qe=(function(t){Wy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[rae]=function(l){c[h7]()},s[Rz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(dXr);var Lvo=["AI_buffer","AI_sentBuffer"],JMt=(function(t){Wy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[p1e]||{getItem:MMt,setItem:OMt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[nae]),y=T(e[WB]),E=x(),_=y[m7](E),v=m._set(A[m7](_));v[Bo]>e[iae]&&(v[Bo]=e[iae]),R(e[WB],[]),R(e[nae],v),m[$B]=function(D){if(m[VB]()>=e[iae]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[VB](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[$B](D),R(e[nae],m._get()))},m[h7]=function(){g[h7](),R(e[nae],m._get()),R(e[WB],[]),c=!1},m[rae]=function(D){R(e[nae],m._set(b(D,m._get())));var N=T(e[WB]);N instanceof Array&&D instanceof Array&&(N=N[m7](D),N[Bo]>e[iae]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Bo],!0),N[Bo]=e[iae]),R(e[WB],N))},m[Rz]=function(D){var N=T(e[WB]);N=b(D,N),R(e[WB],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),q=T(e[WB]).slice(0);D=D||n,N=N||{},m[h7]();var M=L?new e(D,N):new $Qe(D,N);return Ct(B,function(O){M[$B](O)}),L&&M[rae](q),M};function b(D,N){var L=[],B=[];return Ct(D,function(q){B[mx](q.item)}),Ct(N,function(q){!Or(q)&&Vo(B,q.item)===-1&&L[mx](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=I_().parse(N);if(Ei(L)&&(L=I_().parse(L)),L&&ur(L))return L}}catch(B){Wr(n,1,42," storage key: "+D+", "+Qp(B),{exception:dr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[d7](N);f(n,L,B)}catch(q){f(n,L,JSON[d7]([])),Wr(n,2,41," storage key: "+L+", "+Qp(q)+". Buffer cleared",{exception:dr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Lvo,function(N){var L=P(N);if(D=D[m7](L),l){var B=l+"_"+N,q=P(B);D=D[m7](q)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+Qp(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return Ct(N,function(B){var q={item:B,cnt:0};L[mx](q)}),LMt(n,D),L}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})(dXr);p();var fXr=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return I_()[d7](l)}catch(u){Wr(e,1,48,u&&Or(u[GB])?u[GB]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Wr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Wr(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(ur(c))d=o(c,l);else{Wr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{I_()[d7](c),d=c}catch(f){Wr(e,1,48,f&&Or(f[GB])?f[GB]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Yr(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=Gu(c[f])&&c[f]!==null;if(m&&!y&&!A)Wr(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(!ur(c))Wr(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[lae]=e,this.samplingScoreGenerator=new hXr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[lae],n=!1;return r==null||r>=100||e.baseType===jB[hx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Qvo,"_chkSampling");var qvo=(zB={},zB[qB.dataType]=KMt,zB[Tz.dataType]=uXr,zB[bz.dataType]=cXr,zB[Iz.dataType]=lXr,zB[Cz.dataType]=sXr,zB[jB.dataType]=aXr,zB[Sz.dataType]=oXr,zB),ZMt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=OQe;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,L,B,q,M,O,j,Q,U,Y,W,V,z,ie;return Si(e,r,function(H,re){Ge(),H.pause=function(){pe(),c=!0},H.resume=function(){c&&(c=!1,o=null,rt(),Qe())},H.flush=function(J,se,me){if(J===void 0&&(J=!0),!c){pe();try{var Ce=H[oae](J,null,me||1);return _l(Ce,function(He){return se?(se(!He.rejected),!0):J?Dd(function($e){$e(!He.rejected)}):Ce})}catch(He){Wr(H[_A](),1,22,"flush failed, telemetry will not be collected: "+Qp(He),{exception:dr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[oae](!0,Dt,2)}catch(J){Wr(H[_A](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Qp(J),{exception:dr(J)})}else H.flush(!1)},H.addHeader=function(J,se){f[J]=se},H[BQe]=function(J,se,me,Ce){H.isInitialized()&&Wr(H[_A](),1,28,"Sender is already initialized"),re[BQe](J,se,me,Ce);var He=H.identifier;u=new fXr(se.logger),n=0,o=null,s=0,H[sae]=null,d=0;var $e=H[_A]();A=Jbe(nS("Sender"),se.evtNamespace&&se.evtNamespace()),g=HMt(A),H._addHook(dx(J,function(et){var ct=et.cfg;ct.storagePrefix&&NMt(ct.storagePrefix);var bt=eP(null,ct,se),ht=bt.getExtCfg(He,yXr),We=ht[aae];if(y&&We===y){var ae=ct[aae];ae&&ae!==We&&(ht[aae]=ae)}var Re=Di("CompressionStream");ie=QNt("zipPayload",ct,!1),Or(Re)||(ie=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(EXr,Me):delete f[EXr],tg(ht[cae])&&(ht[cae]=ct[cae]),ji(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[aae]&&(y=E=ht[aae]),se.activeStatus()===Yk.PENDING?H.pause():se.activeStatus()===Yk.ACTIVE&&H.resume(),w&&w!==ht[FQe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[GMt],v=(ht[UQe]===!1||ht[QQe]===!1)&&e7(),b=ht[UQe]===!1&&e7(),T=ht[QQe]===!1&&e7(),O=ht[$Mt],j=!!ht.disableXhr,z=ht.retryCodes;var ye=ht[p1e],oe=!!ht[VMt]&&(!!ye||PQe()),ze=ht.namePrefix,at=oe!==L||oe&&q!==ze||oe&&B!==ye;if(H[rP]){if(at)try{H[rP]=H[rP].createNew($e,ht,oe)}catch(_r){Wr(H[_A](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Qp(_r),{exception:dr(_r)})}rt()}else H[rP]=oe?new JMt($e,ht):new $Qe($e,ht);q=ze,L=oe,B=ye,Q=!ht[WMt]&&Bbe(!0),W=!!ht[zMt],H._sample=new mXr(ht.samplingPercentage,$e),x=ht[cae],!tg(x)&&!Te(x,ct)&&Wr($e,1,100,"Invalid Instrumentation key "+x),w=ht[FQe],Ei(y)&&!RQe(y)&&w&&w[Bo]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var Vt=Le();V?V.SetConfig(Vt):(V=new bMt,V[BQe](Vt,$e));var gr=ht.httpXHROverride,cr=null,Mr=null,Hr=iQe([3,1,2],ht.transports);cr=V&&V[h1e](Hr,!1);var Gr=V&&V.getFallbackInst();U=a(function(_r,$0){return Ne(Gr,_r,$0)},"_xhrSend"),Y=a(function(_r,$0){return Ne(Gr,_r,$0,!1)},"_fallbackSend"),cr=O?gr:cr||gr||Gr,H[sae]=function(_r,$0){return Ne(cr,_r,$0)},Q&&(m=Ie);var Yt=iQe([3,1],ht.unloadTransports);Q||(Yt=Yt.filter(function(_r){return _r!==2})),Mr=V&&V[h1e](Yt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,$0){return Ne(Mr,_r,$0)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||nP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(J,se){se=H._getTelCtx(se);var me=se[_A]();try{var Ce=K(J,me);if(!Ce)return;var He=he(J,me);if(!He)return;var $e=u.serialize(He),et=H[rP];rt($e);var ct={item:$e,cnt:0};et[$B](ct),Qe()}catch(bt){Wr(me,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Qp(bt),{exception:dr(bt)})}H.processNext(J,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[VB]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,se,me){if(!Gt(se))return ge(J,se,me)},H[oae]=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!c)try{var He=H[rP];if(R)He[h7]();else{if(He[VB]()>0){var $e=He.getItems();te(me||0,J),se?Ce=se.call(H,$e,J):Ce=H[sae]($e,J)}s=+new Date}pe()}catch(ct){var et=KNt();(!et||et>9)&&Wr(H[_A](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Qp(ct),{exception:dr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:Z,batch:ue,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,se){H.onunloadFlush(),FB(g,!1),Ge()},H[g7]=function(J,se,me){if(!Gt(J))return Ue(J,se,me)},H[qQe]=function(J,se){if(!Gt(J))return ke(J,se)},H[m1e]=function(J,se){if(!Gt(J))return X(J,se)},H._xdrOnLoad=function(J,se){if(!Gt(se))return le(J,se)};function le(J,se){var me=AXr(J);if(J&&(me+""=="200"||me===""))n=0,H[m1e](se,0);else{var Ce=Kbe(me);Ce&&Ce[jQe]&&Ce[jQe]>Ce[HQe]&&!D?H[qQe](se,Ce):H[g7](se,Mbe(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return le(me,$e)},"xdrOnComplete"),fetchOnComplete:a(function(me,Ce,He,$e){var et=ee($e);if(et)return st(me.status,et,me.url,et[Bo],me.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ge(me,$e,$e[Bo])},"xhrOnComplete"),beaconOnRetry:a(function(me,Ce,He){return $t(me,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:j,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:J};return se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(J,se,me){J.readyState===4&&st(J.status,se,J.responseURL,me,lz(J),AXr(J)||J.response)}a(ge,"_xhrReadyStateChange");function Ue(J,se,me){Wr(H[_A](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[Rz](J)}a(Ue,"_onError");function ke(J,se){for(var me=[],Ce=[],He=se.errors.reverse(),$e=0,et=He;$e0&&H[m1e](J,se[HQe]),me[Bo]>0&&H[g7](me,lz(null,["partial success",se[HQe],"of",se.itemsReceived].join(" "))),Ce[Bo]>0&&(F(Ce),Wr(H[_A](),2,40,"Partial success. Delivered: "+J[Bo]+", Failed: "+me[Bo]+". Will retry to send "+Ce[Bo]+" our of "+se[jQe]+" items"))}a(ke,"_onPartialSuccess");function X(J,se){H._buffer&&H._buffer[Rz](J)}a(X,"_onSuccess");function ee(J){try{if(J){var se=J,me=se.oriPayload;return me&&me[Bo]?me:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,se){if(R)return!1;if(!J)return se&&Wr(se,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[GQe])return se&&Wr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[GQe]||(J[GQe]="EventData"),!H[sae])return se&&Wr(se,1,28,"Sender was not initialized"),!1;if(ne(J))J[Zbe]=H._sample[lae];else return se&&Wr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[lae]}),!1;return!0}a(K,"_validate");function he(J,se){var me=J.iKey||x,Ce=e.constructEnvelope(J,me,se,P);if(!Ce){Wr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(J[Bh]&&J[Bh][Xbe]&&(Ct(J[Bh][Xbe],function($e){try{$e&&$e(Ce)===!1&&(He=!0,UB(se,"Telemetry processor check returns false"))}catch(et){Wr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Qp(et),{exception:dr(et)},!0)}}),delete J[Bh][Xbe]),!He)return Ce}a(he,"_getEnvelope");function Z(J){var se=gXr,me=H[_A]();try{var Ce=K(J,me),He=null;Ce&&(He=he(J,me)),He&&(se=u.serialize(He))}catch{}return se}a(Z,"_serialize");function ue(J){var se=gXr;return J&&J[Bo]&&(se="["+J.join(",")+"]"),se}a(ue,"_batch");function qe(J){var se=Be();return{urlString:y,data:J,headers:se}}a(qe,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ce(J,se,me,Ce){se===200&&J?H._onSuccess(J,J[Bo]):Ce&&H[g7](J,Ce)}a(ce,"_getOnComplete");function Ne(J,se,me,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ae,Re,Me){return ce(se,ae,Re,Me)},"onComplete"),$e=we(se),et=J&&J.sendPOST;if(et&&$e){Ce&&H._buffer[rae](se);var ct,bt=!1,ht,We;return V.preparePayload(function(ae){ct=et(ae,He,!me),bt=!0,ht&&V7e(ct,ht,We)},ie,$e,!me),bt?ct:Dd(function(ae,Re){ht=ae,We=Re})}return null}a(Ne,"_doSend");function we(J){if(ur(J)&&J[Bo]>0){var se=H[rP].batchPayloads(J),me=Be(),Ce={data:se,urlString:y,headers:me,disableXhrSync:j,disableFetchKeepAlive:!Q,oriPayload:J};return Ce}return null}a(we,"_getPayload");function Be(){try{var J=f||{};return RQe(y)&&(J[xQe[6]]=xQe[7]),J}catch{}return null}a(Be,"_getHeaders");function rt(J){var se=J?J[Bo]:0;return H[rP].size()+se>_?((!g||g.isOnline())&&H[oae](!0,null,10),!0):!1}a(rt,"_checkMaxSize");function st(J,se,me,Ce,He,$e){var et=null;if(H._appId||(et=Kbe($e),et&&et.appId&&(H._appId=et.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!_t(me)){H[g7](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Wr(H[_A](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(J)?(F(se),Wr(H[_A](),2,40,". Response code "+J+". Will retry to send "+se[Bo]+" items.")):H[g7](se,He)}else _t(me),J===206?(et||(et=Kbe($e)),et&&!D?H[qQe](se,et):H[g7](se,He)):(n=0,H[m1e](se,Ce))}a(st,"_checkResponsStatus");function _t(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(_t,"_checkAndUpdateEndPointUrl");function Dt(J,se){if(m)m(J,!1);else{var me=V&&V[h1e]([3],!0);return Ne(me,J,se)}}a(Dt,"_doUnloadSend");function $t(J,se,me){var Ce=J,He=Ce&&Ce.oriPayload;if(W)Y&&Y(He,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],et=0;et0&&(Y&&Y($e,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(J){try{if(J&&J[Bo])return Ei(J[0])}catch{}return null}a(Gt,"_isStringArr");function Ie(J,se){var me=null;if(ur(J)){for(var Ce=J[Bo],He=0;He-1}a(Se,"_isRetriable");function Fe(){var J="getNotifyMgr",se,me=H.core;return me&&(me[J]?se=me[J]():se=me._notificationManager),se}a(Fe,"_getNotifyMgr");function te(J,se){var me=Fe();if(me&&me.eventsSendRequest)try{me.eventsSendRequest(J,se)}catch(Ce){Wr(H[_A](),1,74,"send request notification failed: "+Qp(Ce),{exception:dr(Ce)})}}a(te,"_notifySendRequest");function Te(J,se){var me=se.disableInstrumentationKeyValidation,Ce=Xt(me)?!1:me;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(J)}a(Te,"_validateInstrumentationKey");function Ge(){H[sae]=null,H[rP]=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=nP,D=!1,L=null,q=nP,j=!1,Q=!1,W=!1,U=null,Y=null,V=null,ji(H,"_senderConfig",{g:a(function(){return nQe({},yXr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=ux(ux({},r),{iKey:n}):c=r;var l=qvo[c.baseType]||KMt;return l(o,c,s)},e})(Ybe);p();var Nz="instrumentationKey",g1e="connectionString",uae="endpointUrl",dae="userOverrideEndpointUrl";var Mz,XMt,eOt=void 0,jvo=(Mz={diagnosticLogInterval:$se(Hvo,1e4)},Mz[g1e]=eOt,Mz.endpointUrl=eOt,Mz[Nz]=eOt,Mz.featureOptIn=(XMt={},XMt.zipPayload={mode:1},XMt),Mz.extensionConfig={},Mz);function Hvo(t){return t&&t>0}a(Hvo,"_chkDiagLevel");var _Xr=(function(){function t(e){var r=new vMt,n;(Xt(e)||Xt(e[Nz])&&Xt(e[g1e]))&&Zc("Invalid input configuration"),Si(t,this,function(s){ji(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,cz(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Oh(e||{},jvo);n=l.cfg,r.addUnloadHook(dx(l,function(){var u=n[g1e];if(tg(u)){var d=Pbe(function(g,A){_l(u,function(y){var E=y.value,_=n[Nz];if(!y.rejected&&E){n[g1e]=E;var v=a1e(E);_=v.instrumentationkey||_}g(_)})}),f=Pbe(function(g,A){_l(u,function(y){var E=y.value,_=n[uae];if(!y.rejected&&E){var v=a1e(E),b=v.ingestionendpoint;_=b?b+EM:_}g(_)})});n[Nz]=d,n[uae]=n[dae]||f}if(Ei(u)){var h=a1e(u),m=h.ingestionendpoint;n[uae]=n[dae]?n[dae]:m+EM,n[Nz]=h.instrumentationkey||n[Nz]}n[uae]=n[dae]?n[dae]:n[uae]})),r.initialize(n,[new ZMt])}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 iS=de(require("os"));var fae=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.onCopilotToken=a(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";let o={method:"POST",headers:n,body:e.data};this.ctx.get(tr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new _Xr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[OQe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Gvo(e),this.commonProperties=n?.excludeCommonProperties?{}:$vo(e),this.#e=bs(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 Gvo(t){let e={},r=t.get(Ua);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${iS.type()} ${iS.release()}`,e["ai.device.osArchitecture"]=iS.arch(),e["ai.device.osPlatform"]=iS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Gvo,"getTags");function $vo(t){let e={};e.common_os=iS.platform(),e.common_platformversion=iS.release(),e.common_arch=iS.arch(),e.common_cpu=Array.from(new Set(iS.cpus().map(n=>n.model))).join();let r=t.get(Ua);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($vo,"getCommonProperties");p();p();p();p();p();p();var A1e=S7e;var CM=A1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var y7=A1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Oz="toLowerCase",In="length",pae="warnToConsole",YB="throwInternal",bM="watch",E7="apply",ro="push",gx="splice",zu="logger",SM="cancel",KB="initialize",TM="identifier",hae="removeNotificationListener",mae="addNotificationListener",yC="isInitialized",y1e="getNotifyMgr",_7="getPlugin",iP="name",Zm="processNext",VQe="getProcessTelContext",JB="value",v7="enabled",tOt="stopPollingInternalLogs",Ax="unload",E1e="onComplete",WQe="version",zQe="loggingLevelConsole",IM="createNew",oS="teardown",gae="messageId",xM="message",EC="diagLog",C7="_doTeardown",Lz="update",sS="getNext",b7="setNextPlugin",_1e="userAgent",ZB="split",oP="replace",rOt="substring",YQe="indexOf",XB="type",nOt="evtName",sP="status",iOt="getAllResponseHeaders",v1e="isChildEvt",aS="data",Bz="getCtx",aP="setCtx";var C1e="headers",Aae="urlString",Fz="timeout";var KQe="traceFlags";var oOt;function vXr(t,e){oOt||(oOt=gbe("AggregationError",function(n,o){o[In]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new oOt(r,e||[])}a(vXr,"throwAggregationError");p();p();p();p();p();var cS=void 0,Ss="",Uz="channels",zf="core",JQe="createPerfMgr",b1e="disabled",e3="extensionConfig",Qz="extensions",_C="processTelemetry",qz="priority",yae="eventsSent",S7="eventsDiscarded",Eae="eventsSendRequest",wM="perfEvent",ZQe="offlineEventsStored",XQe="offlineBatchSent",eqe="offlineBatchDrop",_ae="getPerfMgr",tqe="domain",rqe="path",CXr="Not dynamic - ";var Vvo="getPrototypeOf",Wvo=/-([a-z])/g,zvo=/([^\w\d_$])/g,Yvo=/^(\d+[\w\d_$])/,GBl=Object[Vvo];function T7(t){return!Xt(t)}a(T7,"isNotNullOrUndefined");function vae(t){var e=t;return e&&Ei(e)&&(e=e[oP](Wvo,function(r,n){return n.toUpperCase()}),e=e[oP](zvo,"_"),e=e[oP](Yvo,function(r,n){return"_"+n})),e}a(vae,"normalizeJsName");function ig(t,e){return t&&e?lu(t,e)!==-1:!1}a(ig,"strContains");function Cae(t){return t&&t.toISOString()||""}a(Cae,"toISOString");function bae(t){return xB(t)?t[iP]:Ss}a(bae,"getExceptionName");function t3(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(t3,"setValue");function nqe(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(nqe,"getSetValue");function Kvo(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][E7](n,o)}}a(Kvo,"_createProxyFunction");function I7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=Kvo(r,n))}a(I7,"proxyFunctionAs");function x7(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&I7(t,o,e,o,n)}),t}a(x7,"proxyFunctions");function RM(t){return t&&wB&&(t=YU(wB({},t))),t}a(RM,"optimizeObject");function iqe(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(iqe,"isFeatureEnabled");function kM(t){try{return t.responseText}catch{}return null}a(kM,"getResponseText");function oqe(t,e){return t?"XDomainRequest,Response:"+kM(t)||"":e}a(oqe,"formatErrorMessageXdr");function T1e(t,e){return t?"XMLHttpRequest,Status:"+t[sP]+",Response:"+kM(t)||t.response||"":e}a(T1e,"formatErrorMessageXhr");function I1e(t,e){return e&&(Dh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(I1e,"prependTransports");var Jvo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",bXr="withCredentials",Zvo="timeout";function sOt(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,Jvo,n),r&&c(l,bXr,r),l.open(t,e,!o),r&&c(l,bXr,r),!o&&s&&c(l,Zvo,s),l}a(sOt,"openXhr");function aOt(t){var e={};if(Ei(t)){var r=Ni(t)[ZB](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[YQe](": ");if(o!==-1){var s=Ni(n.substring(0,o))[Oz](),c=Ni(n[rOt](o+1));e[s]=c}else e[Ni(n)]=1}})}return e}a(aOt,"convertAllHeadersToMap");function S1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Ni(n))}return t}a(S1e,"_appendHeader");var Xvo="kill-duration",eCo="kill-duration-seconds",tCo="time-delta-millis";function w7(t,e){var r={};return t[iOt]?r=aOt(t[iOt]()):e&&(r=S1e(r,t,tCo),r=S1e(r,t,Xvo),r=S1e(r,t,eCo)),r}a(w7,"_getAllResponseHeaders");p();p();var rCo="location",nCo="console",SXr="JSON",iCo="crypto",oCo="msCrypto",sCo="ReactNative",aCo="msie",cCo="trident/",TXr="XMLHttpRequest",cOt=null,lOt=null,lCo=!1,Sae=null,uOt=null;function IXr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[tS];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(IXr,"_hasProperty");function Tae(t){if(t&&lCo){var e=Di("__mockLocation");if(e)return e}return typeof location===lx&&location?location:Di(rCo)}a(Tae,"getLocation");function sqe(){return typeof console!==eS?console:Di(nCo)}a(sqe,"getConsole");function x1e(){return!!(typeof JSON===lx&&JSON||Di(SXr)!==null)}a(x1e,"hasJSON");function aqe(){return x1e()?JSON||Di(SXr):null}a(aqe,"getJSON");function cqe(){return Di(iCo)}a(cqe,"getCrypto");function lqe(){return Di(oCo)}a(lqe,"getMsCrypto");function Iae(){var t=Vu();return t&&t.product?t.product===sCo:!1}a(Iae,"isReactNative");function jz(){var t=Vu();if(t&&(t[_1e]!==lOt||cOt===null)){lOt=t[_1e];var e=(lOt||Ss)[Oz]();cOt=ig(e,aCo)||ig(e,cCo)}return cOt}a(jz,"isIE");function xae(t){return(uOt===null||t===!1)&&(uOt=JW()&&!!Vu().sendBeacon),uOt}a(xae,"isBeaconsSupported");function wae(t){var e=!1;try{e=!!Di("fetch");var r=Di("Request");e&&t&&r&&(e=IXr(r,"keepalive"))}catch{}return e}a(wae,"isFetchSupported");function uqe(){return Sae===null&&(Sae=typeof XDomainRequest!==eS,Sae&&w1e()&&(Sae=Sae&&!IXr(Di(TXr),"withCredentials"))),Sae}a(uqe,"useXDomainRequest");function w1e(){var t=!1;try{var e=Di(TXr);t=!!e}catch{}return t}a(w1e,"isXhrSupported");var xXr=4294967296,Hz=4294967295,wXr=123456789,RXr=987654321,kXr=!1,R1e=wXr,k1e=RXr;function uCo(t){t<0&&(t>>>=0),R1e=wXr+t&Hz,k1e=RXr-t&Hz,kXr=!0}a(uCo,"_mwcSeed");function dCo(){try{var t=El()&2147483647;uCo((Math.random()*xXr^t)+t)}catch{}}a(dCo,"_autoSeedMwc");function dOt(t){var e=0,r=cqe()||lqe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Hz),e===0&&jz()&&(kXr||dCo(),e=fCo()&Hz),e===0&&(e=Y1(xXr*Math.random()|0)),t||(e>>>=0),e}a(dOt,"random32");function fCo(t){k1e=36969*(k1e&65535)+(k1e>>16)&Hz,R1e=18e3*(R1e&65535)+(R1e>>16)&Hz;var e=(k1e<<16)+(R1e&65535)>>>0&Hz|0;return t||(e>>>=0),e}a(fCo,"mwcRandom32");function fOt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=dOt()>>>0,n=0,o=Ss;o[In]>>=6,n===5&&(r=(dOt()<<2&4294967295|r&3)>>>0,n=0);return o}a(fOt,"newId");var PXr="3.3.10",pCo="."+fOt(6),hCo=0;function DXr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(DXr,"_canAcceptData");function mCo(t,e){var r=e[t.id];if(!r){r={};try{DXr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(mCo,"_getCache");function yx(t,e){return e===void 0&&(e=!1),vae(t+hCo+++(e?"."+PXr:Ss)+pCo)}a(yx,"createUniqueNamespace");function dqe(t){var e={id:yx("_aiData-"+(t||Ss)+"."+PXr),accept:a(function(r){return DXr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[vae(n)]:(s&&(c=mCo(e,r),c[vae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(dqe,"createElmNodeData");p();function fqe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(fqe,"_isConfigDefaults");function NXr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&vXr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[In]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(kae(t[0],e),function(){AOt(HU(t,1),e,r)}):r(),n}a(AOt,"doUnloadAll");p();var LXr=500,yOt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function BXr(t){return{mrg:!0,v:t}}a(BXr,"cfgDfMerge");p();p();var EOt=[yae,S7,Eae,wM],yqe=null,Aqe;function bCo(t,e){return function(){var r=arguments,n=_Ot(e);if(n){var o=n.listener;o&&o[t]&&o[t][E7](o,r)}}}a(bCo,"_listenerProxyFunc");function SCo(){var t=Di("Microsoft");return t&&(yqe=t.ApplicationInsights),yqe}a(SCo,"_getExtensionNamespace");function _Ot(t){var e=yqe;return!e&&t.disableDbgExt!==!0&&(e=yqe||SCo()),e?e.ChromeDbgExt:null}a(_Ot,"getDebugExt");function FXr(t){if(!Aqe){Aqe={};for(var e=0;e=A&&(d[T](b[xM]),n[w]=!0)}else o>=A&&d[T](b[xM]);f(A,b)}},d.debugToConsole=function(A){vOt("debug",A),g("warning",A)},d[pae]=function(A){vOt("warn",A),g("warning",A)},d.errorToConsole=function(A){vOt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Ax]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=xCo+y[gae];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 Dae(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[pae](v)}}}a(f,"_logInternalMessage");function h(A){return lS(jp(A,wCo,d).cfg,function(y){var E=y.cfg;o=E[zQe],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=_Ot(e||{});E&&E[EC]&&E[EC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function qXr(t){return t||new Gz}a(qXr,"_getLogger");function Ra(t,e,r,n,o,s){s===void 0&&(s=!1),qXr(t)[YB](e,r,n,o,s)}a(Ra,"_throwInternal");function DM(t,e){qXr(t)[pae](e)}a(DM,"_warnToConsole");var COt,R7,jXr="toGMTString",HXr="toUTCString",TOt="cookie",bOt="expires",GXr="isCookieUseDisabled",B1e="disableCookiesUsage",$Xr="_ckMgr",Eqe=null,SOt=null,VXr=null,NM,WXr={},zXr={},kCo=(COt={cookieCfg:BXr((R7={},R7[tqe]={fb:"cookieDomain",dfVal:T7},R7.path={fb:"cookiePath",dfVal:T7},R7.enabled=cS,R7.ignoreCookies=cS,R7.blockedCookies=cS,R7.disableCookieDefer=!1,R7)),cookieDomain:cS,cookiePath:cS},COt[B1e]=cS,COt);function IOt(){!NM&&(NM=I7e(function(){return df()}))}a(IOt,"_getDoc");function _qe(t){return t?t.isEnabled():!0}a(_qe,"_isMgrEnabled");function een(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(een,"_isIgnoredCookie");function YXr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:een(t,e)}a(YXr,"_isBlockedCookie");function KXr(t,e){var r=e[v7];if(Xt(r)){var n=void 0;Nn(t[GXr])||(n=!t[GXr]),Nn(t[B1e])||(n=!t[B1e]),r=n}return r}a(KXr,"_isCfgEnabled");function xOt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[rqe]=E||"/",_[bOt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return jz()||(v["max-age"]="0"),ZXr(Ss,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||Ss),R=lu(w,";");if(R!==-1&&(w=Ni(cM(E,R)),T=ten(Vf(E,R+1))),t3(T,tqe,v||o,W1,Nn),!Xt(_)){var x=jz();if(Nn(T[bOt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),t3(T,bOt,JXr(N,x?jXr:HXr)||JXr(N,x?jXr:HXr)||Ss,W1)}}x||t3(T,"max-age",Ss+_,null,Nn)}var L=Tae();return L&&L.protocol==="https:"&&(t3(T,"secure",null,null,Nn),SOt===null&&(SOt=!ren((Vu()||{})[_1e])),SOt&&t3(T,"SameSite","None",null,Nn)),t3(T,rqe,b||n,null,Nn),ZXr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[In]-1;_>=0;_--)f[_].n===E&&f[gx](_,1)}a(g,"_removePendingCookie");function A(){L1e(e)&&f&&(Ct(f,function(E){YXr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=jp(t||zXr,null,e).cfg,s=lS(t,function(E){E.setDf(E.cfg,kCo),r=E.ref(E.cfg,"cookieCfg"),n=r[rqe]||"/",o=r[tqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=KXr(t,r)!==!1,l=r.getCookie||PCo,u=r.setCookie||XXr,d=r.delCookie||XXr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=KXr(t,r)!==!1&&c&&L1e(e),_=zXr[$Xr];return E&&_&&y!==_&&(E=_qe(_)),E},"isEnabled"),setEnabled:a(function(E){r[v7]=E,Nn(t[B1e])||(t[B1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=YXr(r,E);if(!R){var x=m(_,v,b,T);_qe(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 _=Ss,v=een(r,E);if(!v){if(_qe(y))_=l(E);else if(f)for(var b=f[In]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(cM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return _qe(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 L1e(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[$Xr]=y,y}a(xOt,"createCookieMgr");function L1e(t){if(Eqe===null){Eqe=!1,!NM&&IOt();try{var e=NM.v||{};Eqe=e[TOt]!==void 0}catch(r){Ra(t,2,68,"Cannot access document.cookie - "+bae(r),{exception:dr(r)})}}return Eqe}a(L1e,"areCookiesSupported");function ten(t){var e={};if(t&&t[In]){var r=Ni(t)[ZB](";");Ct(r,function(n){if(n=Ni(n||Ss),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(cM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(ten,"_extractParts");function JXr(t,e){return Or(t[e])?t[e]():null}a(JXr,"_formatDate");function ZXr(t,e){var r=t||Ss;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?Ss:"="+o)}),r}a(ZXr,"_formatCookieValue");function PCo(t){var e=Ss;if(!NM&&IOt(),NM.v){var r=NM.v[TOt]||Ss;VXr!==r&&(WXr=ten(r),VXr=r),e=Ni(WXr[t]||Ss)}return e}a(PCo,"_getCookieValue");function XXr(t,e){!NM&&IOt(),NM.v&&(NM.v[TOt]=t+"="+e)}a(XXr,"_setCookieValue");function ren(t){return Ei(t)?!!(ig(t,"CPU iPhone OS 12")||ig(t,"iPad; CPU OS 12")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&ig(t,"Version/")&&ig(t,"Safari")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||ig(t,"Chrome/5")||ig(t,"Chrome/6")||ig(t,"UnrealEngine")&&!ig(t,"Chrome")||ig(t,"UCBrowser/12")||ig(t,"UCBrowser/11")):!1}a(ren,"uaDisallowsSameSiteNone");p();var DCo={perfEvtsSendAll:!1};function NCo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(NCo,"_runScheduledListeners");function k7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||Up(NCo,0,r)):$f(n,[o]))})}a(k7,"_runListeners");var wOt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=jp(e,DCo);n=c[bM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[mae]=function(u){o[ro](u)},l[hae]=function(u){for(var d=Vo(o,u);d>-1;)o[gx](d,1),d=Vo(o,u)},l[yae]=function(u){k7(o,yae,s,function(d){d[yae](u)})},l[S7]=function(u,d){k7(o,S7,s,function(f){f[S7](u,d)})},l[Eae]=function(u,d){k7(o,Eae,d?s:null,function(f){f[Eae](u,d)})},l[wM]=function(u){u&&(r||!u[v1e]())&&k7(o,wM,null,function(d){u.isAsync?Up(function(){return d[wM](u)},0):d[wM](u)})},l[ZQe]=function(u){u&&u[In]&&k7(o,ZQe,s,function(d){d[ZQe](u)})},l[XQe]=function(u){u&&u[aS]&&k7(o,XQe,s,function(d){d[XQe](u)})},l[eqe]=function(u,d){if(u>0){var f=d||0;k7(o,eqe,s,function(h){h[eqe](u,f)})}},l[Ax]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[SM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(k7(o,"unload",null,function(h){var m=h[Ax](u);m&&(f||(f=[]),f[ro](m))}),f)return Dd(function(h){return _l(z7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Mae="ctx",kOt="ParentContextKey",F1e="ChildrenContextKey",MCo=null,Oae=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[iP]=e,o.isAsync=n,o[v1e]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[Bz]=function(c){return c?c===t[kOt]||c===t[F1e]?o[c]:(o[Mae]||{})[c]:null},o[aP]=function(c,l){if(c)if(c===t[kOt])o[c]||(o[v1e]=function(){return!0}),o[c]=l;else if(c===t[F1e])o[c]=l;else{var u=o[Mae]=o[Mae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Bz](t[F1e]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Ra(r[zu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[e3];!_&&A&&(_={}),E[e3]=_,_=e.ref(E,e3),_&&(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&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}P1e(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]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[_7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(OOt,"_createInternalContext");function Ex(t,e,r,n){var o=jp(e),s=OOt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[_C](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=P7(d,o.cfg,r,f)),Ex(d||c[sS](),o.cfg,r,f)}return a(u,"_createNew"),c[Zm]=l,c[IM]=u,c}a(Ex,"createProcessTelemetryContext");function Lae(t,e,r){var n=jp(e.config),o=OOt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Ax](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=P7(u,n.cfg,e,d)),Lae(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[IM]=l,s}a(Lae,"createProcessTelemetryUnloadContext");function U1e(t,e,r){var n=jp(e.config),o=OOt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[Lz])&&d[Lz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=P7(u,n.cfg,e,d)),U1e(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[IM]=l,s}a(U1e,"createProcessTelemetryUpdateContext");function P7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[In]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[_C])){var u=QCo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?P7([n],e,r):o}a(P7,"createTelemetryProxyChain");function QCo(t,e,r){var n=null,o=Or(t[_C]),s=Or(t[b7]),c;t?c=t[TM]+"-"+t[qz]+"-"+aen++:c="Unknown-0-"+aen++;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[sen])&&(g=t[sen]()),g||(g=Ex(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[TM]:FCo,T=g[oen];return T||(T=g[oen]={}),g.setNext(n),t&&Hp(g[zf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Ss;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Ra(g[EC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=r3(t);return _[oS]||_[b1e]?!1:(s&&t[b7](n),t[_C](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Zm](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&(_[zf]=null,_[oS]=!0,_[yC]=!1,t[oS]&&t[oS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Zm](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&t[Lz]&&t[Lz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Zm](A)}return a(m,"_updatePlugin"),Nh(l)}a(QCo,"createTelemetryPluginProxy");var cen=(function(){function t(e,r,n,o){var s=this,c=Ex(e,r,n,o);x7(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function Q1e(){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){Ra(n[EC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(Q1e,"createUnloadHandlerContainer");p();var bqe,Sqe;function Tqe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Ra(n,2,73,"Unloading:"+dr(c))}}),bqe&&o[In]>bqe&&(Sqe?Sqe("doUnload",o):Ra(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),bqe&&t[In]>bqe&&(Sqe?Sqe("Add",t):Ra(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(Tqe,"createUnloadHookContainer");var LOt,D7="getPlugin",qCo=(LOt={},LOt[e3]={isVal:T7,v:{}},LOt),Bae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[KB]=function(h,m,g,A){u(h,m,A),r=!0},f[oS]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||Lae(null,g,o&&o[D7]?o[D7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[EC]()),A===!0&&E[Zm](_),d())}return a(v,"_unloadCallback"),!f[C7]||f[C7](E,_,v)!==!0?v():A=!0,A},f[Lz]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||U1e(null,g,o&&o[D7]?o[D7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[sS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},I7(f,"_addUnloadCb",function(){return s},"add"),I7(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[EC]=function(f){return l(f)[EC]()},e[yC]=function(){return r},e.setInitialized=function(f){r=f},e[b7]=function(f){o=f},e[Zm]=function(f,h){h?h[Zm](f):o&&Or(o[_C])&&o[_C](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||Ex(null,{},e[zf]);o&&o[D7]?h=m[IM](null,o[D7]):h=m[IM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){jp(f,qCo,Nae(h)),!m&&h&&(m=h[VQe]()[sS]());var g=o;o&&o[D7]&&(g=o[D7]()),e[zf]=h,n=Ex(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[zf]=null,n=null,o=null,c=Tqe(),s=Q1e()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function jCo(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[gx](c,1),-1})},"remove")};return o}a(jCo,"_addInitializer");function HCo(t,e,r){for(var n=!1,o=t[In],s=0;s"},"v")})}a(XCo,"_createUnloadHook");var Iqe=(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,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[yC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[KB]=function(ne,ce,Ne,we){g&&Zc(uen),U[yC]()&&Zc("Core cannot be initialized more than once"),e=jp(ne,BOt,Ne||U[zu],!1),ne=e.cfg,qe(e[bM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||VCo,Y(_t);var Dt=st.ref(st.cfg,e3);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=ZCo(e,v,s&&U[y1e](),b),K(),U[zu]=Ne;var Be=ne[Qz];if(f=[],f[ro].apply(f,rz(rz([],ce,!1),Be,!1)),h=ne[Uz],Le(null),(!m||m[In]===0)&&Zc("No "+Uz+" available"),h&&h[In]>1){var rt=U[_7]("TeeChannelController");(!rt||!rt.plugin)&&Ra(n,1,28,"TeeChannel required")}JCo(ne,R,n),R=null,r=!0,N===y7.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[ro](ce)}),Nh(ne)},U.track=function(ne){Hp(U[_ae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[iP]&&Xt(ne[iP])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Cae(new Date),ne.ver=ne.ver||"4.0",!g&&U[yC]()&&N===y7.ACTIVE?le()[Zm](ne):N!==y7.INACTIVE&&o[In]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[VQe]=le,U[y1e]=function(){return s||(s=new wOt(e.cfg),U[GCo]=s),s},U[mae]=function(ne){U.getNotifyMgr()[mae](ne)},U[hae]=function(ne){s&&s[hae](ne)},U.getCookieMgr=function(){return u||(u=xOt(e.cfg,U[zu])),u},U.setCookieMgr=function(ne){u!==ne&&(kae(u,!1),u=ne)},U[_ae]=function(){return c||l||POt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[In]},U.releaseQueue=function(){if(r&&o[In]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Zm](ce)}):Ra(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[SM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=y7.INACTIVE;var we="Please provide instrumentation key";r?(Ra(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[ro](ce),w=null):w=ce,tg(Ne)?(Be[ro](Ne),L=null):L=Ne,Be[In]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=T7(ne.initTimeOut)?ne.initTimeOut:WCo,we=W7e(ce);M&&M[SM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[JB];if(rt&&rt[In]){var st=rt[0];if(w=st&&st[JB],rt[In]>1){var _t=rt[1];L=_t&&_t[JB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=y7.INACTIVE,Ra(n,1,112,"ikey can't be resolved from promises")):N=y7.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[v7])&&!Q){var ce=ne||n&&n.queue[In]>0;ce&&(j||(j=!0,qe(e[bM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[v7],O[SM]()),O=k7e(X,we),O.unref(),O[v7]=Be}))),O[v7]=!0)}return O}a(ie,"_startLogPoller"),U[tOt]=function(){Q=!0,O&&O[SM](),X()},x7(U,function(){return A},["addTelemetryInitializer"]),U[Ax]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc($Co),g&&Zc(uen);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Lae(Ue(),U);rt[E1e](function(){v.run(U[zu]),AOt([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[tOt](),rt[Zm](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[_7]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(pen);return}var Be=ge(ne[TM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[TM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[ro](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[yC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[Qz]=we[Qz],ne[Uz]=we[Uz]}e._block(function(Be){var rt=Be.cfg;FOt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,cS)}),Be.setDf(rt,BOt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=ien()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,I7(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=lS(e.cfg,ne,U[zu]):ce=KCo(R,ne),XCo(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[TM]&&we[WQe]&&!ne[we.identifier]){var Be=we[TM]+"="+we[WQe];P[ro](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=jp({},BOt,U[zu]),e.cfg[zQe]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Ss},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Gz(e.cfg),e[zu]=n),n},"g"),s:a(function(ce){e[zu]=ce,n!==ce&&(kae(n,!1),n=ce)},"s")}),U[zu]=new Gz(e.cfg),x=[];var ne=U.config[Qz]||[];ne.splice(0,ne[In]),Mh(ne,x),A=new len,o=[],kae(s,!1),s=null,c=null,l=null,kae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=yx("AIBaseCore",!0),_=Q1e(),T=null,w=null,v=Tqe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=Ex(Ue(),e.cfg,U);return ne[E1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=YCo(U[zu],LXr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=Cqe(Mh(m,ce[Uz]));var Ne=Mh(Cqe(ce[zf]),m);x=Nh(Ne);var we=U.config[Qz]||[];we.splice(0,we[In]),Mh(we,x);var Be=le();m&&m[In]>0&&MOt(Be[IM](m),Ne),MOt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[TM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[ro](Be)}),!Ne&&we[In]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){r3(Ne)[b1e]=!Be},"setEnabled"),isEnabled:a(function(){var Be=r3(Ne);return!Be[oS]&&!Be[b1e]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[ro](A),d=P7(Cqe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[In]>0){var we=P7(ne,e.cfg,U),Be=Lae(we,U);Be[E1e](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){den(Dt,ne)?rt=!0:st[ro](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){den(Ie,ne)?rt=!0:Gt[ro](Ie)}),_t[ro](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Zm](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[In]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[gae],iKey:w,time:Cae(new Date),baseType:Dae.dataType,baseData:{message:ce[xM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[SM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[In]>0){var Dt=le()[IM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[bM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[JQe];(ne!==we||!ne)&&(we||(we=zCo),nqe(ce.cfg,JQe,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[y1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=U1e(Ue(),U);ce[E1e](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Zm](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[zu];ce?(Ra(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[y1e]();ce&&ce[S7]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var cP="",ebo="NoResponseBody",hen="&"+ebo+"=true",UOt="POST",xqe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[KB]=function(M,O){o=O,n&&Ra(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=Tae();O&&O.protocol&&O.protocol[Oz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[In]?R(M,O):null},E.getFallbackInst=function(){return d},E[C7]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[aS]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[aS])?new TextEncoder().encode(j[aS]):j[aS]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[JB];if(!Le.done)return z[ro](Le[JB]),ie+=Le.value[In],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[C1e]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=hen)):le=!0);var ke=new Request(U,Ue);try{ke[yOt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?cP:K):x(O,s?0:400,{},s?cP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[sP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||cP,he):x(O,ue,{},Z||cP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[xM],499),ie&&ie(K.reason);else{var he=K[JB];try{!s&&!he.ok?(he[sP]?X(he.statusText,he[sP]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,cP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[JB]),z&&z(!0)})}catch(Z){he&&he[sP]?X(dr(Z),he[sP]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[Fz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[Fz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[aS];U.onload=function(){var H=kM(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?cP:oqe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Aae];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Ra(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[oP](/^(https?:)/,"");U.open(UOt,ie),M[Fz]&&(U[Fz]=M[Fz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.send(Y)}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 ven="on",men="attachEvent",gen="addEventListener",Aen="detachEvent",yen="removeEventListener",QOt="events",H1e="visibilitychange",Rqe="pagehide",Cen="pageshow",ben="unload",Sen="beforeunload",Ten=yx("aiEvtPageHide"),Ien=yx("aiEvtPageShow"),tbo=/\.[\.]+/g,rbo=/[\.]+$/,nbo=1,wqe=dqe("events"),ibo=/^([^.]*)(?:\.(.+)|)/;function Een(t){return t&&t[oP]?t[oP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Ss):t}a(Een,"_normalizeNamespace");function qOt(t,e){if(e){var r=Ss;ur(e)?(r=Ss,Ct(e,function(o){o=Een(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Een(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Ss)+r)}var n=ibo.exec(t||Ss)||[];return{type:n[1],ns:(n[2]||Ss).replace(tbo,".").replace(rbo,Ss)[ZB](".").sort().join(".")}}a(qOt,"_getEvtNamespace");function xen(t,e,r){r===void 0&&(r=!0);var n=wqe.get(t,QOt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(xen,"_getRegisteredEvents");function wen(t,e,r,n){t&&e&&e[XB]&&(t[yen]?t[yen](e[XB],r,n):t[Aen]&&t[Aen](ven+e[XB],r))}a(wen,"_doDetach");function obo(t,e,r,n){var o=!1;return t&&e&&e[XB]&&r&&(t[gen]?(t[gen](e[XB],r,n),o=!0):t[men]&&(t[men](ven+e[XB],r),o=!0)),o}a(obo,"_doAttach");function _en(t,e,r,n){for(var o=e[In];o--;){var s=e[o];s&&(!r.ns||r.ns===s[nOt].ns)&&(!n||n(s))&&(wen(t,s[nOt],s.handler,s.capture),e[gx](o,1))}}a(_en,"_doUnregister");function sbo(t,e,r){if(e[XB])_en(t,xen(t,e[XB]),e,r);else{var n=wqe.get(t,QOt,{});Yr(n,function(o,s){_en(t,s,e,r)}),$u(n)[In]===0&&wqe.kill(t,QOt)}}a(sbo,"_unregisterEvents");function M7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=qOt("xx",r).ns[ZB](".")):r=t,r}a(M7,"mergeEvtNamespace");function q1e(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=qOt(e,n);if(s=obo(t,c,r,o),s&&wqe.accept(t)){var l={guid:nbo++,evtName:c,handler:r,capture:o};xen(t,c.type)[ro](l)}}catch{}return s}a(q1e,"eventOn");function j1e(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=qOt(e,n),c=!1;sbo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||wen(t,s,r,o)}catch{}}a(j1e,"eventOff");function jOt(t,e,r){var n=!1,o=ff();o&&(n=q1e(o,t,e,r),n=q1e(o.body,t,e,r)||n);var s=df();return s&&(n=q1e(s,t,e,r)||n),n}a(jOt,"addEventHandler");function HOt(t,e,r){var n=ff();n&&(j1e(n,t,e,r),j1e(n.body,t,e,r));var o=df();o&&j1e(o,t,e,r)}a(HOt,"removeEventHandler");function Fae(t,e,r,n){var o=!1;return e&&t&&t[In]>0&&Ct(t,function(s){s&&(!r||Vo(r,s)===-1)&&(o=jOt(s,e,n)||o)}),o}a(Fae,"_addEventListeners");function GOt(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=Fae(t,e,r,n),!o&&r&&r[In]>0&&(o=Fae(t,e,null,n))),o}a(GOt,"addEventListeners");function $z(t,e,r){t&&ur(t)&&Ct(t,function(n){n&&HOt(n,e,r)})}a($z,"removeEventListeners");function kqe(t,e,r){return GOt([Sen,ben,Rqe],t,e,r)}a(kqe,"addPageUnloadEventListener");function Pqe(t,e){$z([Sen,ben,Rqe],t,e)}a(Pqe,"removePageUnloadEventListener");function G1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=M7(Ten,r),s=Fae([Rqe],t,e,o);return(!e||Vo(e,H1e)===-1)&&(s=Fae([H1e],n,e,o)||s),!s&&e&&(s=G1e(t,null,r)),s}a(G1e,"addPageHideEventListener");function Dqe(t,e){var r=M7(Ten,e);$z([Rqe],t,r),$z([H1e],null,r)}a(Dqe,"removePageHideEventListener");function $1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=M7(Ien,r),s=Fae([Cen],t,e,o);return s=Fae([H1e],n,e,o)||s,!s&&e&&(s=$1e(t,null,r)),s}a($1e,"addPageShowEventListener");function Nqe(t,e){var r=M7(Ien,e);$z([Cen],t,r),$z([H1e],null,r)}a(Nqe,"removePageShowEventListener");p();var Uae="",Ren="https://browser.events.data.microsoft.com/OneCollector/1.0/",$Ot="version",Mqe="properties";p();p();var VOt="initialize",WOt="indexOf",MM="timings",zOt="pollInternalLogs",uS="value",Oqe="length",Lqe="processTelemetryStart";var n3,ken="4.3.10",V1e="1DS-Web-JS-"+ken,Pen=xbe.hasOwnProperty;var gbo=(n3={},n3[0]=0,n3[2]=6,n3[1]=1,n3[3]=7,n3[4098]=6,n3[4097]=1,n3[4099]=7,n3);var Abo=RB(),ybo=wse();function _x(t){return!(t===Uae||Xt(t))}a(_x,"isValueAssigned");function YOt(t){if(t){var e=lu(t,"-");if(e>-1)return cM(t,e)}return Uae}a(YOt,"getTenantId");function KOt(t){return!!(t&&Dh(t)&&t>=1&&t<=4)}a(KOt,"isLatency");function JOt(t,e,r){if(!e&&!_x(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||ur(e))e={value:e};else if(n==="object"&&!Pen.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[uS])||e[uS]===Uae||!Ei(e[uS])&&!Dh(e[uS])&&!Wk(e[uS])&&!ur(e[uS]))return null;if(ur(e[uS])&&!Nen(e[uS]))return null;if(!Xt(e.kind)){if(ur(e[uS])||!Den(e.kind))return null;e[uS]=e[uS].toString()}return e}a(JOt,"sanitizeProperty");function W1e(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),Ebo(r))n===-1&&(n=0),n|=r;else{var o=gbo[Bqe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(W1e,"getCommonSchemaMetaData");function Qae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[Oqe],d=arguments;for(Wk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Den,"isValueKind");function Ebo(t){return t>=0&&t<=9}a(Ebo,"isDataType");function Nen(t){return t[Oqe]>0}a(Nen,"isArrayValid");function Fqe(t,e){var r=t;r[MM]=r[MM]||{},r[MM][Lqe]=r[MM][Lqe]||{},r[MM][Lqe][e]=dS()}a(Fqe,"setProcessTelemetryTimings");function Bqe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===lx&&(e=4,ur(t)?(e=4096,t[Oqe]>0&&(e|=Bqe(t[0]))):Pen.call(t,"value")&&(e=8192|Bqe(t[uS])))}return e}a(Bqe,"getFieldValueType");function ZOt(){return!!Di("chrome")}a(ZOt,"isChromium");function Vz(t){return t>0}a(Vz,"isGreaterThanZero");var _bo=T_({endpointUrl:Ren,propertyStorageOverride:{isVal:vbo}});function vbo(t){return t&&(!t.getProperty||!t.setProperty)&&Zc("Invalid property storage override passed."),!0}a(vbo,"_chkPropOverride");var XOt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[VOt]=function(s,c,l,u){Hp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[VOt](jp(s,_bo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[WOt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),Ra(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){Hp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[MM]=c[MM]||{},c[MM].trackStart=dS(),KOt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=V1e;var u=c.baseData=c.baseData||{};u[Mqe]=u[Mqe]||{};var d=u[Mqe];d[$Ot]=d[$Ot]||n.pluginVersionString||Uae}o.track(c)},function(){return{item:s}},!s.sync)},n[zOt]=function(s){return o[zOt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(Iqe);p();p();var z1e="REAL_TIME",Men="NEAR_REAL_TIME",Oen="BEST_EFFORT";p();p();p();var lP="";var Uqe="drop",Len="send",e5t="requeue",Ben="rspFail",Fen="oth",t5t="no-cache, no-store",Qqe="application/x-json-stream",Y1e="cache-control",qae="content-type",Uen="kill-tokens",Qen="kill-duration";var qen="time-delta-millis",qqe="client-version",r5t="client-id",jqe="time-delta-to-apply-millis",Hqe="upload-time",Gqe="apikey",K1e="AuthMsaDeviceTicket",n5t="WebAuthToken",i5t="AuthXToken";var jen="NoResponseBody",jae="msfpc",o5t="trace",$qe="user";p();var J1e="allowRequestSending",Vqe="shouldAddClockSkewHeaders",Wqe="getClockSkewHeaderValue",Z1e="setClockSkew",Wo="length",OM="concat",fS="iKey",Yf="count",LM="events",Xm="push",BM="split",zqe="toLowerCase",Wz="hdrs",Yqe="useHdrs",zz="initialize",Kqe="setTimeoutOverride",Jqe="clearTimeoutOverride",Hen="payloadPreprocessor",s5t="overrideEndpointUrl",a5t="avoidOptions",Gen="disableEventTimings",Zqe="enableCompoundKey",c5t="disableXhrSync",l5t="disableFetchKeepAlive",$en="addNoResponse",u5t="useSendBeacon",d5t="fetchCredentials",f5t="alwaysUseXhrOverride",Xqe="serializeOfflineEvt",eje="getOfflineRequestDetails",tje="createPayload",X1e="createOneDSPayload",p5t="payloadBlob",uP="headers",Hae="_thePayload",Jy="batches",vC="sendType",eSe="canSendRequest",Gae="sendQueuedRequests",tSe="setUnloading",Ven="isTenantKilled",rje="sendSynchronousBatch",nje="_transport",$ae="getWParam",h5t="isBeacon",rSe="timings",ije="isTeardown",oje="_sendReason",sje="setKillSwitchTenants",aje="_backOffTransmission",nSe="identifier",Wen="ignoreMc1Ms0CookieProcessing",m5t="autoFlushEventsLimit",zen="disableAutoBatchFlushLimit",Yen="overrideInstrumentationKey",iSe="sendAttempt",O7="latency",Yz="sync";function Jen(t){var e=(t.ext||{}).intweb;return e&&_x(e[jae])?e[jae]:null}a(Jen,"_getEventMsfpc");function Ken(t){for(var e=null,r=0;e===null&&rEl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var bbo=.8,Sbo=1.2,etn=3e3,Tbo=6e5;function ttn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(ttn,"retryPolicyShouldRetryForStatus");function cje(t){var e=0,r=etn*bbo,n=etn*Sbo,o=Y1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,QU(e,Tbo)}a(cje,"retryPolicyGetMillisToBackoffForRetry");p();var Ibo=20,xbo=3145728,ntn=65e3,itn=2e6,wbo=QU(itn,ntn),rtn="metadata",lje="f",Rbo=/\./,otn=(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||W1e,_=kbo(l),v=uje(_.requestLimit,xbo,0),b=uje(_.requestLimit,ntn,1),T=uje(_.recordLimit,itn,0),w=Math.min(uje(_.recordLimit,wbo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,L,B,q,M){return{apiKeys:[],payloadBlob:lP,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&&Hp(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,O=D.numEvents,j=!1,Q=[],U=[],Y=D.isBeacon,W=Y?b:v,V=Y?w:T,z=0,ie=0;z=L){D.overflow=N.split(z);break}var re=R.getEventBlob(H);if(re&&re.length<=V){var le=re.length,Le=M.length;if(Le+le>W){D.overflow=N.split(z);break}M&&(M+=` -`),M+=re,ie++,ie>Ibo&&(T7e(M,0,1),ie=0),j=!0,O++}else re?Q.push(H):U.push(H),q.splice(z,1),z--}z++}if(Q.length>0&&D.sizeExceed.push(L7.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(L7.create(N.iKey(),U)),j){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ge=N.iKey();Vo(D.apiKeys,ge)===-1&&D.apiKeys.push(ge)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Hp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+YOt(D.iKey);var L={},B;y||(B=a(function(j,Q,U){Pbo(E,L,j,Q,U)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=L,Yr(q,function(j,Q){var U=L[j]={};P(Q,U,"ext."+j,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],B,m),P(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=kse(D,"ext.metadata")||kse(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,q,M,O){Yr(D,function(j,Q){var U=null;if(Q||_x(Q)){var Y=L,W=j,V=q,z=N;if(h&&!B&&Rbo.test(j)){var ie=j.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(uje,"_validateSizeLimit");function kbo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(kbo,"_getSizeLimtCfg");function Pbo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[rtn];c||(c=e[rtn]={f:{}});var l=c[lje];if(l||(l=c[lje]={}),r)for(var u=0;u0)for(var o=e[zqe](),s=0;s0&&(n&&A5t[e]?(t[Wz][A5t[e]]=r,t[Yqe]=!0):t.url+="&"+e+"="+r)}a(Wae,"_addRequestDetails");function Obo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[Xqe]=function(pe){try{if(b)return b.getEventBlob(pe)}catch{}return lP},H[eje]=function(){try{var pe=b&&b[tje](0,!1,!1,!1,1,0);return we(pe,x)}catch{}return null},H[X1e]=function(pe,Se){try{var Fe=[];Ct(pe,function(se){Se&&(se=RM(se));var me=L7.create(se[fS],[se]);Fe[Xm](me)});for(var te=null;Fe[Wo]>0&&b;){var Te=Fe.shift();Te&&Te[Yf]()>0&&(te=te||b[tje](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ie))}var Ge=we(te,x),J={data:te[p5t],urlString:Ge.url,headers:Ge[Wz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(dje(J[uP],Y1e)||(J[uP][Y1e]=t5t),dje(J[uP],qae)||(J[uP][qae]=Qqe)),J}catch{}return null};function le(pe,Se){try{return V&&V.getSenderInst(pe,Se)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Le(),s,ie]};function Le(){try{var pe={xdrOnComplete:ge,fetchOnComplete:ke,xhrOnComplete:X,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:pe};return Se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(pe,Se,Fe){var te=kM(pe);ee(Se,200,{},te),F(te)}a(ge,"_xdrOncomplete");function Ue(){var pe;s=null,c=new Xen,l=!1,u=new Zen,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=pe,N=pe,L=pe,B=pe,q=pe,M=[],O=pe,j=pe,Q=[],U=!1,Y=Vae(),W=!1,V=null,ie=null}a(Ue,"_initDefaults");function ke(pe,Se,Fe,te){var Te=a(function(se,me,Ce){ee(Se,se,me,Ce),F(Ce)},"handleResponse"),Ge={},J=pe[uP];J&&J.forEach(function(se,me){Ge[me]=se}),Te(pe.status,Ge,Fe||lP)}a(ke,"_fetchOnComplete");function X(pe,Se,Fe){var te=kM(pe);ee(Se,pe.status,w7(pe,!0),te),F(te)}a(X,"_xhrOnComplete");function ee(pe,Se,Fe,te){try{pe(Se,Fe,te)}catch(Te){Ra(m,2,518,dr(Te))}}a(ee,"_doOnComplete");function K(pe,Se,Fe){var te=pe,Te=200,Ge=te[Hae],J=pe.urlString+(q?Dbo:lP);try{var se=Vu();if(Ge){var me=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[Jy],function($e){if(Ce&&$e&&$e[Yf]()>0)for(var et=$e[LM](),ct=0;ct0&&(Ge.sentEvts=He),me||be(Ce,8003,Ge[vC],!0)}else Te=0}catch($e){DM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr($e)),Te=0}finally{ee(Se,Te,{},lP)}}a(K,"_onBeaconRetry");function he(pe){return pe===2||pe===3}a(he,"_isBeaconPayload");function Z(pe){return R&&he(pe)&&(pe=2),pe}a(Z,"_adjustSendType"),H.addHeader=function(pe,Se){_[pe]=Se},H.removeHeader=function(pe){delete _[pe]},H[eSe]=function(){return ue()&&u[J1e]()},H[Gae]=function(pe,Se){Nn(pe)&&(pe=0),R&&(pe=Z(pe),Se=2),ne(v,pe,0)&&Ne(qe(),0,!1,pe,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Wo]===0},H[tSe]=function(pe){R=pe},H.addBatch=function(pe){if(pe&&pe[Yf]()>0){if(c.isTenantKilled(pe[fS]()))return!1;v[Xm](pe)}return!0},H.teardown=function(){v[Wo]>0&&Ne(qe(),0,!0,2,2),Ct(M,function(pe){pe&&pe.rm&&pe.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Gae](0,4)},H[rje]=function(pe,Se,Fe){pe&&pe[Yf]()>0&&(Xt(Se)&&(Se=1),R&&(Se=Z(Se),Fe=2),Ne([pe],0,!1,Se,Fe||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Fe>0||u[J1e]())),te}a(ne,"_canSendPayload");function ce(pe){var Se={};return pe&&Ct(pe,function(Fe,te){Se[te]={iKey:Fe[fS](),evts:Fe[LM]()}}),Se}a(ce,"_createDebugBatches");function Ne(pe,Se,Fe,te,Te){if(!(!pe||pe[Wo]===0)){if(l){be(pe,1,te);return}te=Z(te);try{var Ge=pe,J=te!==0;Hp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(pe=pe.slice(0));for(var me=[],Ce=null,He=dS(),$e=g[te]||(J?g[1]:g[0]),et=$e&&$e[nje],ct=B&&(R||he(te)||et===3||$e._isSync&&et===2);ne(pe,te,Se);){var bt=pe.shift();bt&&bt[Yf]()>0&&(c.isTenantKilled(bt[fS]())?me[Xm](bt):(Ce=Ce||b[tje](Se,Fe,J,ct,Te,te),b.appendPayload(Ce,bt,ie)?Ce.overflow!==null&&(pe=[Ce.overflow][OM](pe),Ce.overflow=null,rt(Ce,He,dS(),Te),He=dS(),Ce=null):(rt(Ce,He,dS(),Te),He=dS(),pe=[bt][OM](pe),Ce=null)))}Ce&&rt(Ce,He,dS(),Te),pe[Wo]>0&&(v=pe[OM](v)),be(me,8004,te)},function(){return{batches:ce(Ge),retryCount:Se,isTeardown:Fe,isSynchronous:J,sendReason:Te,useSendBeacon:he(te),sendType:te}},!J)}catch(se){Ra(m,2,48,"Unexpected Exception sending batch: "+dr(se))}}}a(Ne,"_sendBatches");function we(pe,Se){var Fe={url:s,hdrs:{},useHdrs:!1};Se?(Fe[Wz]=Qae(Fe[Wz],_),Fe.useHdrs=$u(Fe.hdrs)[Wo]>0):Yr(_,function(se,me){y5t[se]?Wae(Fe,y5t[se],me,!1):(Fe[Wz][se]=me,Fe[Yqe]=!0)}),Wae(Fe,r5t,"NO_AUTH",Se),Wae(Fe,qqe,V1e,Se);var te=lP;Ct(pe.apiKeys,function(se){te[Wo]>0&&(te+=","),te+=se}),Wae(Fe,Gqe,te,Se),Wae(Fe,Hqe,El().toString(),Se);var Te=Ie(pe);if(_x(Te)&&(Fe.url+="&ext.intweb.msfpc="+Te),u[Vqe]()&&Wae(Fe,jqe,u[Wqe](),Se),A[$ae]){var Ge=A[$ae]();Ge>=0&&(Fe.url+="&w="+Ge)}for(var J=0;J0){var Te=!!O,Ge=g[pe.sendType];!he(pe[vC])&&pe[h5t]&&pe.sendReason===2&&(Ge=g[2]||g[3]||Ge);var J=x;(pe.isBeacon||Ge[nje]===3)&&(J=!1);var se=we(pe,J);J=J||se[Yqe];var me=dS();Hp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[g5t]++:ct[g5t]=1}be(pe[Jy],1e3+(te||0),pe[vC],!0);var ht={data:pe[p5t],urlString:se.url,headers:se[Wz],_thePayload:pe,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};J&&(dje(ht[uP],Y1e)||(ht[uP][Y1e]=t5t),dje(ht[uP],qae)||(ht[uP][qae]=Qqe));var We=null;Ge&&(We=a(function(ae){u.firstRequestSent();var Re=a(function(ye,oe){_t(ye,oe,pe,te)},"onComplete"),Me=pe[ije]||pe.isSync;V.preparePayload(function(ye){try{Ge.sendPOST(ye,Re,Me),j&&j(ht,ye,Me,pe[h5t])}catch(oe){ee(Re,0,{}),DM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ae,Me)},"sender")),Hp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(pe[vC]===0&&f++,Te&&!pe.isBeacon&&Ge[nje]!==3){var ae={data:ht.data,urlString:ht.urlString,headers:Qae({},ht[uP]),timeout:ht.timeout,disableXhrSync:ht[c5t],disableFetchKeepAlive:ht[l5t]},Re=!1;Hp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ae,function(Me){Re=!0,!y&&!Me[Hae]&&(Me[Hae]=Me[Hae]||ht[Hae],Me[oje]=Me[oje]||ht[oje]),We(Me)},pe.isSync||pe[ije])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:pe,serializationStart:Se,serializationCompleted:Fe,sendReason:te}},pe.isSync)}pe.sizeExceed&&pe.sizeExceed[Wo]>0&&be(pe.sizeExceed,8003,pe[vC]),pe.failedEvts&&pe.failedEvts[Wo]>0&&be(pe.failedEvts,8002,pe[vC])}a(rt,"_doPayloadSend");function st(pe,Se){T&&Ct(pe,function(Fe){var te=Fe[rSe]=Fe[rSe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function _t(pe,Se,Fe,te){var Te=9e3,Ge=null,J=!1,se=!1;try{var me=!0;if(typeof pe!==eS){if(Se){u[Z1e](Se[qen]);var Ce=Se[Qen]||Se["kill-duration-seconds"];Ct(c[sje](Se[Uen],Ce),function($e){Ct(Fe[Jy],function(et){if(et[fS]()===$e){Ge=Ge||[];var ct=et[BM](0);Fe.numEvents-=ct[Yf](),Ge[Xm](ct)}})})}if(pe==200||pe==204){Te=200;return}(!ttn(pe)||Fe.numEvents<=0)&&(me=!1),Te=9e3+pe%1e3}if(me){Te=100;var He=Fe.retryCnt;Fe[vC]===0&&(He0&&st(Fe[LM](),Se)})}}a($t,"_addCompleteTimings");function Gt(pe,Se,Fe){Se?pe():Y.set(pe,Fe)}a(Gt,"_doAction");function Ie(pe){for(var Se=0;Se0&&o){var Te=o[Qe(Se)];if(Te){var Ge=Fe!==0;Hp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{Te.call(o,pe,Se,Ge,Fe)}catch(J){Ra(m,1,74,"send request notification failed: "+J)}},te||Ge,0)},function(){return{batches:ce(pe),reason:Se,isSync:Ge,sendSync:te,sendType:Fe}},!Ge)}}}a(be,"_sendBatchesNotification");function Qe(pe){var Se=Mbo[pe];return _x(Se)||(Se=Fen,pe>=9e3&&pe<=9999?Se=Ben:pe>=8e3&&pe<=8999?Se=Uqe:pe>=1e3&&pe<=1999&&(Se=Len)),Se}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Bbo=.25,ltn=500,Fbo=20,utn=6,dtn=2,Ubo=4,atn=2,Qbo=1,E5t=1e4,Zz="eventsDiscarded",ctn="",Fh=void 0,qbo=T_({eventsLimitInMem:{isVal:Vz,v:E5t},immediateEventLimit:{isVal:Vz,v:500},autoFlushEventsLimit:{isVal:Vz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:jbo,v:Fh},overrideInstrumentationKey:Fh,overrideEndpointUrl:Fh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Fh,clearTimeoutOverride:Fh,payloadPreprocessor:Fh,payloadListener:Fh,disableEventTimings:Fh,valueSanitizer:Fh,stringifyObjects:Fh,enableCompoundKey:Fh,disableOptimizeObj:!1,fetchCredentials:Fh,transports:Fh,unloadTransports:Fh,useSendBeacon:Fh,disableFetchKeepAlive:Fh,avoidOptions:!1,xhrTimeout:Fh,disableXhrSync:Fh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Dh,v:utn},maxUnloadEventRetryAttempts:{isVal:Dh,v:dtn},addNoResponse:Fh,maxEvtPerBatch:{isVal:Dh,v:ltn},excludeCsMetaData:Fh,requestLimit:{}});function jbo(t){return t&&t.sendPOST}a(jbo,"isOverrideFn");var _5t=(function(t){Wy(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=z1e,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W;return Si(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[zz]=function(J,se,me){Hp(se,function(){return"PostChannel:initialize"},function(){z[zz](J,se,me),j=se.getNotifyMgr();try{B=M7(yx(V[nSe]),se.evtNamespace&&se.evtNamespace()),V._addHook(lS(J,function(Ce){var He=Ce.cfg,$e=Ex(null,He,se);n=$e.getExtCfg(V[nSe],qbo),q=Vae(n[Kqe],n[Jqe]),P=!n.disableOptimizeObj&&ZOt(),M=n[Wen],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[m5t],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[zen],W=n.maxEvtPerBatch,tg(He.endpointUrl)?V.pause():l&&V.resume(),Ge(),U=n[Yen],Y=!!n.disableTelemetry,Q&&ie();var et=He.disablePageUnloadEvents||[];Q=kqe(Le,et,B),Q=G1e(Le,et,B)||Q,Q=$1e(ge,He.disablePageShowEvents,B)||Q})),v[zz](J,V.core,V)}catch(Ce){throw V.setInitialized(!1),Ce}},function(){return{theConfig:J,core:se,extensions:me}})},V.processTelemetry=function(J,se){Fqe(J,V[nSe]),se=se||V._getTelCtx(se);var me=J;!Y&&!o&&(U&&(me[fS]=U),ke(me,!0),D?qe(2,2):K()),V.processNext(me,se)},V.getOfflineSupport=function(){try{var J=v&&v[eje]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(se){return!Y},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[X1e])return v[X1e](se,P)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,se){qe(2,2),o=!0,v.teardown(),ie(),he()};function ie(){Pqe(null,B),Dqe(null,B),Nqe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var se=J[$ae];J[$ae]=function(){var me=0;return M&&(me=me|2),me|se.call(J)}}a(H,"_hookWParam");function re(J){var se=ctn;return J&&J[Wo]&&Ct(J,function(me){se&&(se+=` -`),se+=me}),se}a(re,"_batch");function le(J){var se=ctn;try{Ue(J),se=v[Xqe](J)}catch{}return se}a(le,"_serialize");function Le(J){var se=J||ff().event;se.type!=="beforeunload"&&(D=!0,v[tSe](D)),qe(2,2)}a(Le,"_handleUnloadEvents");function ge(J){D=!1,v[tSe](D)}a(ge,"_handleShowEvents");function Ue(J){J.ext&&J.ext[o5t]&&delete J.ext[o5t],J.ext&&J.ext[$qe]&&J.ext[$qe].id&&delete J.ext[$qe].id,P&&(J.ext=RM(J.ext),J.baseData&&(J.baseData=RM(J.baseData)),J.data&&(J.data=RM(J.data)))}a(Ue,"_cleanEvent");function ke(J,se){if(J[iSe]||(J[iSe]=0),J[O7]||(J[O7]=1),Ue(J),J[Yz]){if(E||l)J[O7]=3,J[Yz]=!1;else if(v){P&&(J=RM(J)),v[rje](L7.create(J[fS],[J]),J[Yz]===!0?1:J[Yz],3);return}}var me=J[O7],Ce=f,He=h;me===4&&(Ce=u,He=d);var $e=!1;if(CeJ;if(!me&&w>0)for(var Ce=1;!me&&Ce<=3;Ce++){var He=b[Ce];He&&He[Jy]&&Ct(He[Jy],function($e){$e&&$e[Yf]()>=w&&(me=!0)})}Ne(!0,me)},V.pause=function(){ue(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){$t(),Yr(J,function(se,me){var Ce=me[Wo];if(Ce>=2){var He=Ce>2?me[2]:0;if(me.splice(0,Ce-2),me[1]<0&&(me[0]=-1),me[1]>0&&me[0]>0){var $e=me[0]/me[1];me[0]=ZKr($e)*me[1]}He>=0&&me[1]>=0&&He>me[1]&&(He=me[1]),me[Xm](He),m[se]=me}})},V.flush=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!l)if(me=me||1,J)se||(Ce=Dd(function($e){se=$e})),c==null?(ue(),st(1,0,me),c=Z(function(){c=null,_t(se,me)},0)):s[Xm](se);else{var He=ue();X(1,1,me),se&&se(),He&&K()}return Ce},V.setMsaAuthTicket=function(J){v.addHeader(K1e,J)},V.setAuthPluginHeader=function(J){v.addHeader(n5t,J)},V.removeAuthPluginHeader=function(){v.removeHeader(n5t)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(ue(),g=J,K())},x7(V,function(){return v},["addResponseHandler"]);function X(J,se,me){var Ce=st(J,se,me);return v[Gae](se,me),Ce}a(X,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Gae](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=Z(function(){y=null,X(4,0,1),K()},J))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=Z(function(){A=null,X(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),V[aje]=function(){E0&&f>T&&(se=!0),se&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function we(J,se){P&&(J=RM(J));var me=J[O7],Ce=ce(J[fS],me,!0);return Ce.addEvent(J)?(me!==4?(f++,se&&J[iSe]===0&&Ne(!J.sync,w>0&&Ce[Yf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(J,se,me,Ce){for(;me<=se;){var He=ce(J,se,!0);if(He&&He[Yf]()>0){var $e=He[BM](0,Ce),et=$e[Yf]();if(et>0)return me===4?u-=et:f-=et,Qe(Zz,[$e],CM.QueueFull),!0}me++}return rt(),!1}a(Be,"_dropEventWithLatencyOrLess");function rt(){for(var J=0,se=0,me=a(function(He){var $e=b[He];$e&&$e[Jy]&&Ct($e[Jy],function(et){He===4?J+=et[Yf]():se+=et[Yf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)me(Ce);f=se,u=J}a(rt,"_resetQueueCounts");function st(J,se,me){var Ce=!1,He=se===0;return!He||v[eSe]()?Hp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],et=4;et>=J;){var ct=b[et];ct&&ct.batches&&ct.batches[Wo]>0&&(Ct(ct[Jy],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[Yf]()>0:$e=$e[OM](bt[LM]()),et===4?u-=bt[Yf]():f-=bt[Yf]()}),ct[Jy]=[],ct.iKeyMap={}),et--}$e[Wo]>0&&be(Zz,$e,CM.KillSwitch),Ce&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:se,sendReason:me}},!He):(R=R>=0?QU(R,J):J,x=zk(x,me)),Ce}a(st,"_queueBatches");function _t(J,se){X(1,0,se),rt(),Dt(function(){J&&J(),s[Wo]>0?c=Z(function(){c=null,_t(s.shift(),se)},0):(c=null,K())})}a(_t,"_flushImpl");function Dt(J){v.isCompletelyIdle()?J():c=Z(function(){c=null,Dt(J)},Bbo)}a(Dt,"_waitForIdleManager");function $t(){ue(),Gt(),g=z1e,K()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[z1e]=[2,1,0],m[Men]=[6,3,0],m[Oen]=[18,9,0]}a(Gt,"_initializeProfiles");function Ie(J,se){var me=[],Ce=N;D&&(Ce=L),Ct(J,function(He){He&&He[Yf]()>0&&Ct(He[LM](),function($e){$e&&($e[Yz]&&($e[O7]=4,$e[Yz]=!1),$e[iSe]0&&be(Zz,me,CM.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(J,se){var me=j||{},Ce=me[J];if(Ce)try{Ce.apply(me,se)}catch(He){Ra(V.diagLog(),1,74,J+" notification failed: "+He)}}a(F,"_callNotification");function be(J,se){for(var me=[],Ce=2;Ce0&&F(J,[se][OM](me))}a(be,"_notifyEvents");function Qe(J,se){for(var me=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[Yf]()>0&&F(J,[He.events()][OM](me))})}a(Qe,"_notifyBatchEvents");function pe(J,se,me){J&&J[Wo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,me!==!0])}a(pe,"_sendingEvent");function Se(J,se){Qe("eventsSent",J,se),K()}a(Se,"_eventsSentEvent");function Fe(J,se){Qe(Zz,J,se>=8e3&&se<=8999?se-8e3:CM.Unknown)}a(Fe,"_eventsDropped");function te(J){Qe(Zz,J,CM.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(J,se){Qe(Zz,J,CM.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=zk(W*(atn+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Bae);var pS=de(require("os"));var fje=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=Hbo(e),this.commonProperties=Gbo(e),this.#e=bs(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new XOt,n=new _5t,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){Nr.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){Nr.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){Nr.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(tr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Hbo(t){let e={},r=t.get(Ua);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${pS.type()} ${pS.release()}`,e["ai.device.osArchitecture"]=pS.arch(),e["ai.device.osPlatform"]=pS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Hbo,"getTags");function Gbo(t){let e={};e.common_os=pS.platform(),e.common_platformversion=pS.release(),e.common_arch=pS.arch(),e.common_cpu=Array.from(new Set(pS.cpus().map(n=>n.model))).join();let r=t.get(Ua);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(Gbo,"getCommonProperties");var $bo="7d7048df-6dd0-4048-bb23-b716c1461f8f",Vbo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Wbo="b73649cf-ca8f-4768-9e0e-b789d8529db5",zbo="5fb6107a-6a29-423f-a824-22e3724fa2a6",Ybo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function Kbo(t){return MU(t)==="prod"?Wbo:zbo}a(Kbo,"getMsftInstrumentationKey");function ftn(t){return new URL(t).hostname==="github.com"?VW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(ftn,"getEndpointForServerUrl");var pf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=ftn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];bs(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(X0);if(o.setReporter(new fae(r,this.namespace,{instrumentationKey:$bo,endpointUrl:n})),o.setRestrictedReporter(new fae(r,this.namespace,{instrumentationKey:Vbo,endpointUrl:n})),o.setMsftReporter(new fae(r,`copilot/${this.namespace}`,{instrumentationKey:Kbo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new fje(r,"ThirdParty.copilot-chat",Ybo,!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(X0);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(X0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=ftn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function Jbo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Gf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(pf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return b_.exception(t,n,"signUpLimited failed"),!1}}a(Jbo,"apiFetchSignUpLimited");async function C5t(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 Jbo(t,e)?C5t(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(C5t,"getTokenWithSignUpLimited");p();p();var ptn=de(ri());var Wi=class extends ptn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var Zbo={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},bn=class{constructor(){this.capabilities={...Zbo};this.emitter=new Wi;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 i3=require("fs"),zae=require("os"),Yae=de(require("path")),B7=require("process");var Yn=class{static{a(this,"PersistenceManager")}},b5t=class extends Yn{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 i3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Yae.dirname(s);c!==this.directory&&await i3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await oSe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await i3.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 oSe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` +`)}`}}let l=t.get(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=vse(t),f=RGr(c,u,d),h=Dyo(c),m=h==="exception",g=Wt.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=gPt(y.value):y.value="[redacted]");s??=pGr(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(rM).isThrottled(A)){if(d){let y=wGr(c,u),E=Wt.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,lbe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),lbe(t,0,`error.${h}`,g)}}a(SKr,"_telemetryException");function Y0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await SKr(t,c,El(),r,n)}},"wrapped");return(...s)=>t.get(Rd).register(o(...s))}a(Y0,"telemetryCatch");function tg(t,e,r,n){return t.get(Rd).register(Uyo(t,e,El(),r?.extendedBy(),n))}a(tg,"telemetryError");async function Uyo(t,e,r,n,o=0){if(cbe(o)&&!vse(t))return;let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Myo(t,o,e,s)}a(Uyo,"_telemetryError");function TKr(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=Wt.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),At(t,"engine.completion",u,1)}a(TKr,"logEngineCompletion");function IKr(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 At(t,"engine.prompt",o,1)}a(IKr,"logEnginePrompt");function Qyo(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(Qyo,"buildErrorFromUnknown");p();var VW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Vm(t){return!t||typeof t!="object"?!1:t instanceof VW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Vm,"isAbortError");var bse=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},uM=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}`}},qyo=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 rx(t,e=!0){return t instanceof Error?e&&"cause"in t&&rx(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof bse||t instanceof uM||t?.message?.startsWith("net::")||qyo.has(t.code??""):!1}a(rx,"isNetworkError");var nx=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 bse(`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 bse(`Response body truncated: actualLength=${s}`,"Truncated"):new bse(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function BU(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(BU,"parseRetryAfterSeconds");var nr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function WW(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...$y(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(Qa).sessionId,g["VScode-MachineId"]=t.get(Qa).machineId,g["X-GitHub-Api-Version"]="2026-01-09"),n&&(g["OpenAI-Intent"]=n);let A={method:"POST",headers:g,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:g,messages:h,body:s});let y=t.get(nr);if(c){let _=new AbortController;c.onCancellationRequested(()=>{At(t,"networking.cancelRequest",Wt.createAndMarkAsIssued({headerRequestId:o})),_.abort()}),A.signal=_.signal}return y.fetch(e,A).catch(_=>{if(jyo(_))return At(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(WW,"postRequest");function jyo(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(jyo,"isInterruptedNetworkError");p();function u7e(){return typeof process>"u"}a(u7e,"isWeb");function bB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(bB,"isMsBenchModeEnabled");var QDt=class extends uM{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 Vf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...u7e()?{}:$y(t),...n.headers}};let o=await t.get(nr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new uM(o);if(!o.headers.get("x-github-request-id"))throw new QDt(o);return o}a(Vf,"apiFetch");p();p();var ts=class{constructor(){this.recentNotifications=new Cn(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 da=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 PKr=require("os"),d7e=require("path");p();var RKr;(()=>{"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,j){for(var Q,U="",Y=0,W=-1,V=0,z=0;z<=O.length;++z){if(z2){var ie=U.lastIndexOf("/");if(ie!==U.length-1){ie===-1?(U="",Y=0):Y=(U=U.slice(0,ie)).length-1-U.lastIndexOf("/"),W=z,V=0;continue}}else if(U.length===2||U.length===1){U="",Y=0,W=z,V=0;continue}}j&&(U.length>0?U+="/..":U="..",Y=2)}else U.length>0?U+="/"+O.slice(W+1,z):U=O.slice(W+1,z),Y=z-W-1;W=z,V=0}else Q===46&&V!==-1?++V:V=-1}return U}a(q,"r");var M={resolve:a(function(){for(var O,j="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var Y;U>=0?Y=arguments[U]:(O===void 0&&(O=process.cwd()),Y=O),B(Y),Y.length!==0&&(j=Y+"/"+j,Q=Y.charCodeAt(0)===47)}return j=q(j,!Q),Q?j.length>0?"/"+j:"/":j.length>0?j:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var j=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=q(O,!j)).length!==0||j||(O="."),O.length>0&&Q&&(O+="/"),j?"/"+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,j=0;j0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,j){if(B(O),B(j),O===j||(O=M.resolve(O))===(j=M.resolve(j)))return"";for(var Q=1;Qz){if(j.charCodeAt(W+H)===47)return j.slice(W+H+1);if(H===0)return j.slice(W+H)}else Y>z&&(O.charCodeAt(Q+H)===47?ie=H:H===0&&(ie=0));break}var re=O.charCodeAt(Q+H);if(re!==j.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=Q+ie+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+j.slice(W+ie):(W+=ie,j.charCodeAt(W)===47&&++W,j.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var j=O.charCodeAt(0),Q=j===47,U=-1,Y=!0,W=O.length-1;W>=1;--W)if((j=O.charCodeAt(W))===47){if(!Y){U=W;break}}else Y=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,j){if(j!==void 0&&typeof j!="string")throw new TypeError('"ext" argument must be a string');B(O);var Q,U=0,Y=-1,W=!0;if(j!==void 0&&j.length>0&&j.length<=O.length){if(j.length===O.length&&j===O)return"";var V=j.length-1,z=-1;for(Q=O.length-1;Q>=0;--Q){var ie=O.charCodeAt(Q);if(ie===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1),V>=0&&(ie===j.charCodeAt(V)?--V==-1&&(Y=Q):(V=-1,Y=z))}return U===Y?Y=z:Y===-1&&(Y=O.length),O.slice(U,Y)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else Y===-1&&(W=!1,Y=Q+1);return Y===-1?"":O.slice(U,Y)},"basename"),extname:a(function(O){B(O);for(var j=-1,Q=0,U=-1,Y=!0,W=0,V=O.length-1;V>=0;--V){var z=O.charCodeAt(V);if(z!==47)U===-1&&(Y=!1,U=V+1),z===46?j===-1?j=V:W!==1&&(W=1):j!==-1&&(W=-1);else if(!Y){Q=V+1;break}}return j===-1||U===-1||W===0||W===1&&j===U-1&&j===Q+1?"":O.slice(j,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(j,Q){var U=Q.dir||Q.root,Y=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+Y:U+"/"+Y:Y})(0,O)},"format"),parse:a(function(O){B(O);var j={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return j;var Q,U=O.charCodeAt(0),Y=U===47;Y?(j.root="/",Q=1):Q=0;for(var W=-1,V=0,z=-1,ie=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),U===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ie){V=H+1;break}return W===-1||z===-1||re===0||re===1&&W===z-1&&W===V+1?z!==-1&&(j.base=j.name=V===0&&Y?O.slice(1,z):O.slice(V,z)):(V===0&&Y?(j.name=O.slice(1,W),j.base=O.slice(1,z)):(j.name=O.slice(V,W),j.base=O.slice(V,z)),j.ext=O.slice(W,z)),V>0?j.dir=O.slice(0,V-1):Y&&(j.dir="/"),j},"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,j,Q=!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,Y){return U||Y?U:"file"})(B,Q),this.authority=q||d,this.path=(function(U,Y){switch(U){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=O||d,this.fragment=j||d,u(this,Q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:O,query:j,fragment:Q}=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),j===void 0?j=this.query:j===null&&(j=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),q===this.scheme&&M===this.authority&&O===this.path&&j===this.query&&Q===this.fragment?this:new A(q,M,O,j,Q)}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 j=0;j=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||B&&Q===47||q&&Q===91||q&&Q===93||q&&Q===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M!==void 0&&(M+=L.charAt(j));else{M===void 0&&(M=L.substr(0,j));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M+=U):O===-1&&(O=j)}}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:j,path:Q,query:U,fragment:Y}=L;if(O&&(M+=O,M+=":"),(j||O==="file")&&(M+=f,M+=f),j){let W=j.indexOf("@");if(W!==-1){let V=j.substr(0,W);j=j.substr(W+1),W=V.lastIndexOf(":"),W===-1?M+=q(V,!1,!1):(M+=q(V.substr(0,W),!1,!1),M+=":",M+=q(V.substr(W+1),!1,!0)),M+="@"}j=j.toLowerCase(),W=j.lastIndexOf(":"),W===-1?M+=q(j,!1,!0):(M+=q(j.substr(0,W),!1,!0),M+=j.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+=q(Q,!0,!1)}return U&&(M+="?",M+=q(U,!1,!1)),Y&&(M+="#",M+=B?Y:E(Y,!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 P=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...q){return B.with({path:P.join(B.path,...q)})},L.resolvePath=function(B,...q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let j=P.resolve(M,...q);return O&&j[0]===D&&!B.authority&&(j=j.substring(1)),B.with({path:j})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=P.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},L.basename=function(B){return P.basename(B.path)},L.extname=function(B){return P.extname(B.path)}})(N||(N={})),RKr=n})();var{URI:FU,Utils:ube}=RKr;function DKr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+DKr(t.substring(3)):t}}a(DKr,"decodeURIComponentGraceful");var kKr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function qDt(t){return t.match(kKr)?t.replace(kKr,e=>DKr(e)):t}a(qDt,"percentDecode");function Ks(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 FU.file(t).toString()}a(Ks,"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?FU.parse(e[1]+e[2],!0):FU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(to,"parseUri");function f7e(t){return to(t),t}a(f7e,"validateUri");function Fs(t){try{return to(t).toString()}catch{return t}}a(Fs,"normalizeUri");function NKr(t){let e=Fs(t);return e.endsWith("/")?e.slice(0,-1):e}a(NKr,"normalizeUriNoTrailingSlash");var zW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=to(t);if(!zW.has(e.scheme)&&!da.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,PKr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,d7e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function rs(t){try{return un(t)}catch{return}}a(rs,"getFsPath");function MKr(t){let e=rs(t);if(e)return FU.file(e).toString()}a(MKr,"getFsUri");function YW(t,...e){let r,n=rs(t);return n?r=Ks((0,d7e.resolve)(n,...e)):r=ube.resolvePath(to(t),...e.map(o=>OKr(o))).toString(),typeof t=="string"?r:{uri:r}}a(YW,"resolveFilePath");function Ra(t,...e){let r=ube.joinPath(to(t),...e.map(OKr)).toString();return typeof t=="string"?r:{uri:r}}a(Ra,"joinPath");function OKr(t){return Hyo(t)?t.replaceAll("\\","/"):t}a(OKr,"pathToURIPath");function Hyo(t){return/^[^/\\]*\\/.test(t)}a(Hyo,"isWinPath");function Ji(t){return qDt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ji,"basename");function ff(t){let e=ube.dirname(to(t)),r;return zW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(ff,"dirname");function LKr(t){return ube.extname(to(t))}a(LKr,"extname");var Wm=class{static{a(this,"NetworkConfiguration")}};function p7e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!HDt(t)&&r.protocol==="http:")return r.href}catch{}}a(p7e,"ensurePermittedUrl");var KW={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 jDt(t,e,r){if(r&&O1(t)){for(let n of r){let o=Ft(t,n);if(o)return o}return}for(let n of e){let o=Ft(t,n);if(o)return o}}a(jDt,"urlConfigOverride");function Gyo(t,e){switch(e){case"api":return jDt(t,[Ye.DebugOverrideCapiUrl,Ye.DebugOverrideCapiUrlLegacy],[Ye.DebugTestOverrideCapiUrl,Ye.DebugTestOverrideCapiUrlLegacy]);case"proxy":return jDt(t,[Ye.DebugOverrideProxyUrl,Ye.DebugOverrideProxyUrlLegacy],[Ye.DebugTestOverrideProxyUrl,Ye.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!HDt(t))return jDt(t,[Ye.DebugSnippyOverrideUrl])}}a(Gyo,"getEndpointOverrideUrl");function ix(t,e,r,...n){let o=Gyo(t,r)??e.endpoints[r];return Ra(o,...n)}a(ix,"getEndpointUrl");function SB(t){return ox(t)?.endpoints??KW}a(SB,"getLastKnownEndpoints");function h7e(t,e){if(e&&!p7e(t,e)){t.get(ts).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(Wm).setConfiguredUrls(t,{serverUrl:e})}a(h7e,"updateServerUrl");p();var zm=class{static{a(this,"UrlOpener")}};var S_=new fe("auth"),GDt=60,$yo=300;var Vyo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Wyo="4535c7beffc844b46bb1ed4aa04d759a";function Vy(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(Vy,"fillGitHubUrls");function UU(){return Math.floor(Date.now()/1e3)}a(UU,"nowSeconds");async function $Dt(t,e,r){let n=Wt.createAndMarkAsIssued({},{});At(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Vf(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json();if(s.status===401){let h="Failed to get copilot token due to 401 status. Please sign out and try again.",m=s.headers.get("x-github-request-id")??"",g=c.error_details,A=[];m&&A.push(`request_id=${m}`),g?.url&&A.push(`url=${g.url}`),g?.notification_id&&A.push(`notification_id=${g.notification_id}`),g?.message&&A.push(`error=${g.message}`);let y=A.length>0?` (${A.join(", ")})`:"";return S_.info(t,`${h}${y}`),tg(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){S_.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),tg(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let h=c.error_details;return h?.notification_id!=="not_signed_up"&&zyo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=UU()+c.refresh_in+GDt,u=await dbe(t,e),d;u.ok&&(d=await u.json());let f=new JW(c,d,l);return At(t,"auth.new_token",n.extendedBy({...lPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:UU()})),{copilotToken:f}}a($Dt,"authFromGitHubSession");var Ph=class{static{a(this,"CopilotTokenFetcher")}},m7e=class extends Ph{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await $Dt(e,r,n)}};async function dbe(t,e){return await Vf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(dbe,"fetchCopilotUserInfo");function zyo(t,e,r){e&&t.get(ts).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(Ir).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(zm).open(l)}e.notification_id&&s&&await Yyo(t,e.notification_id,r)}).catch(n=>{S_.exception(t,n,"copilotToken.notification")})}a(zyo,"notifyUser");async function Yyo(t,e,r){let n=await Vf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&S_.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(Yyo,"sendNotificationResultToGitHub");var JW=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 L6e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...KW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-$yo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Wyo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var yi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function g7e(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(g7e,"authEnvVarConflictMessage");var QU=class extends yi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function BKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new yi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new yi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new yi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(BKr,"validateGitHubServerUrl");p();p();var sx=class{static{a(this,"AuthRepository")}};p();function FKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=BKr(r),{apiUrl:o}=Vy({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(FKr,"buildAuthServerEndpoint");function qU(t,e){if(e!==void 0)return FKr(e);{let r=t.get(Wm),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(qU,"resolveAuthServerEndpoint");function VDt(t){if(!t)return!1;try{return FKr(t),!0}catch{return!1}}a(VDt,"isValidAuthServer");p();p();p();p();p();p();p();p();function xB(t,e){return t||e}a(xB,"_pureAssign");function Ym(t,e){return t[e]}a(Ym,"_pureRef");var hC=void 0,Dh=null,aNt="",S7e="function",pbe="object",TB="prototype",oNt="__proto__",ZW="undefined",_7e="constructor",cNt="Symbol",Kyo="_polyfill",XW="length",v7e="name",yA="call",T7e="toString",ax=xB(Object),lNt=Ym(ax,TB),GKr=xB(String),ez=Ym(GKr,TB),hbe=xB(Math),$Kr=xB(Array),I7e=Ym($Kr,TB),IB=Ym(I7e,"slice");function Wf(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(Wf,"safe");function Jyo(t,e){var r=Wf(t);return r.e?e:r.v}a(Jyo,"safeGet");var WDt;function x7e(t){return function(e){return typeof e===t}}a(x7e,"_createIs");function VKr(t){var e="[object "+t+"]";return function(r){return!!(r&&mbe(r)===e)}}a(VKr,"_createObjIs");function mbe(t){return lNt[T7e].call(t)}a(mbe,"objToString");function Nn(t){return typeof t===ZW||t===ZW}a(Nn,"isUndefined");function Zyo(t){return!Ise(t)}a(Zyo,"isStrictUndefined");function Xt(t){return t===Dh||Nn(t)}a(Xt,"isNullOrUndefined");function Xyo(t){return t===Dh||!Ise(t)}a(Xyo,"isStrictNullOrUndefined");function Ise(t){return!!t||t!==hC}a(Ise,"isDefined");function eEo(t){return!WDt&&(WDt=["string","number","boolean",ZW,"symbol","bigint"]),t!==pbe&&WDt.indexOf(t)!==-1}a(eEo,"isPrimitiveType");var Ei=x7e("string"),Or=x7e(S7e);function $u(t){return!t&&Xt(t)?!1:!!t&&typeof t===pbe}a($u,"isObject");var ur=Ym($Kr,"isArray"),w7e=VKr("Date"),Mh=x7e("number"),Yk=x7e("boolean");var wB=VKr("Error");function rg(t){return!!(t&&t.then&&Or(t.then))}a(rg,"isPromiseLike");function W1(t){return!(!t||Jyo(function(){return!(t&&0+t)},!t))}a(W1,"isTruthy");var xse=Ym(ax,"getOwnPropertyDescriptor");function ng(t,e){return!!t&&lNt.hasOwnProperty[yA](t,e)}a(ng,"objHasOwnProperty");var EA=xB(Ym(ax,"hasOwn"),tEo);function tEo(t,e){return ng(t,e)||!!xse(t,e)}a(tEo,"polyObjHasOwn");function Yr(t,e,r){if(t&&$u(t)){for(var n in t)if(EA(t,n)&&e[yA](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var A7e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function rEo(t){var e={};if(e[A7e.c]=!0,e[A7e.e]=!0,t.l){e.get=function(){return t.l.v};var r=xse(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[A7e[n]]=Zyo(o)?e[A7e[n]]:o}),e}a(rEo,"_createProp");var T_=Ym(ax,"defineProperty"),WKr=Ym(ax,"defineProperties");function ji(t,e,r){return T_(t,e,rEo(r))}a(ji,"objDefine");function zKr(t,e,r,n,o){var s={};return Yr(t,function(c,l){C7e(s,c,e?l:c),C7e(s,l,r?l:c)}),n?n(s):s}a(zKr,"_createKeyValueMap");function C7e(t,e,r,n){T_(t,e,{value:r,enumerable:!0,writable:!1})}a(C7e,"_assignMapValue");var Gu=xB(GKr),nEo="[object Error]";function dr(t,e){var r=aNt,n=lNt[T7e][yA](t);n===nEo&&(t={stack:Gu(t.stack),message:Gu(t.message),name:Gu(t.name)});try{r=JSON.stringify(t,Dh,e?typeof e=="number"?e:4:hC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Dh)||Gu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function Zc(t){throw new Error(t)}a(Zc,"throwError");function Km(t){throw new TypeError(t)}a(Km,"throwTypeError");var YKr=Ym(ax,"freeze");function iEo(t){return t}a(iEo,"_doNothing");function oEo(t){return t[oNt]||Dh}a(oEo,"_getProto");var RB=Ym(ax,"assign"),Vu=Ym(ax,"keys");function I_(t){return YKr&&Yr(t,function(e,r){(ur(r)||$u(r))&&I_(r)}),Oh(t)}a(I_,"objDeepFreeze");var Oh=xB(YKr,iEo);var sNt=xB(Ym(ax,"getPrototypeOf"),oEo);function R7e(t){return zKr(t,1,0,Oh)}a(R7e,"createEnum");function sEo(t){return zKr(t,0,0,Oh)}a(sEo,"createEnumKeyMap");function aEo(t){var e={};return Yr(t,function(r,n){C7e(e,r,n[1]),C7e(e,n[0],n[1])}),Oh(e)}a(aEo,"createSimpleMap");function uNt(t){return aEo(t)}a(uNt,"createTypeMap");var KKr=sEo({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}),UKr="__tsUtils$gblCfg",zDt;function JKr(){var t;return typeof globalThis!==ZW&&(t=globalThis),!t&&typeof self!==ZW&&(t=self),!t&&typeof window!==ZW&&(t=window),!t&&typeof global!==ZW&&(t=global),t}a(JKr,"_getGlobalValue");function ZKr(){if(!zDt){var t=Wf(JKr).v||{};zDt=t[UKr]=t[UKr]||{}}return zDt}a(ZKr,"_getGlobalConfig");var wse=gbe;function gbe(t,e,r){var n=e?e[t]:Dh;return function(o){var s=(o?o[t]:Dh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?IB[yA](c,1):c)}Km('"'+Gu(t)+'" not defined for '+dr(o))}}a(gbe,"_unwrapFunctionWithPoly");function cEo(t){return function(e){return e[t]}}a(cEo,"_unwrapProp");var jU=Ym(hbe,"min"),Kk=Ym(hbe,"max"),QKr=wse("slice",ez),zf=wse("substring",ez),k7e=gbe("substr",ez,lEo);function lEo(t,e,r){return Xt(t)&&Km("Invalid "+dr(t)),r<0?aNt:(e=e||0,e<0&&(e=Kk(e+t[XW],0)),Nn(r)?QKr(t,e):QKr(t,e,e+r))}a(lEo,"polyStrSubstr");function dM(t,e){return zf(t,0,e)}a(dM,"strLeft");var qKr="_urid",YDt;function uEo(){if(!YDt){var t=ZKr();YDt=t.gblSym=t.gblSym||{k:{},s:{}}}return YDt}a(uEo,"_globalSymbolRegistry");var y7e;function dNt(t){var e={description:Gu(t),toString:a(function(){return cNt+"("+t+")"},"toString")};return e[Kyo]=!0,e}a(dNt,"polyNewSymbol");function dEo(t){var e=uEo();if(!EA(e.k,t)){var r=dNt(t),n=Vu(e.s).length;r[qKr]=function(){return n+"_"+r[T7e]()},e.k[t]=r,e.s[r[qKr]()]=Gu(t)}return e.k[t]}a(dEo,"polySymbolFor");function fEo(t){!y7e&&(y7e={});var e,r=KKr[t];return r&&(e=y7e[r]=y7e[r]||dNt(cNt+"."+r)),e}a(fEo,"polyGetKnownSymbol");var Nh;function HU(){Nh=ZKr()}a(HU,"_initTestHooks");function P7e(t){var e={};return!Nh&&HU(),e.b=Nh.lzy,T_(e,"v",{configurable:!0,get:a(function(){var r=t();return Nh.lzy||T_(e,"v",{value:r}),e.b=Nh.lzy,r},"get")}),e}a(P7e,"getLazy");function z1(t){return T_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(z1,"createCachedValue");var XKr="window",fbe;function D7e(t,e){var r;return function(){return!Nh&&HU(),(!r||Nh.lzy)&&(r=z1(Wf(t,e).v)),r.v}}a(D7e,"_getGlobalInstFn");function Wy(t){return!Nh&&HU(),(!fbe||t===!1||Nh.lzy)&&(fbe=z1(Wf(JKr).v||Dh)),fbe.v}a(Wy,"getGlobal");function Di(t,e){var r;if(!fbe||e===!1?r=Wy(e):r=fbe.v,r&&r[t])return r[t];if(t===XKr)try{return window}catch{}return Dh}a(Di,"getInst");function kB(){return!!pf()}a(kB,"hasDocument");var pf=D7e(Di,["document"]);function Rse(){return!!hf()}a(Rse,"hasWindow");var hf=D7e(Di,[XKr]);function tz(){return!!Wu()}a(tz,"hasNavigator");var Wu=D7e(Di,["navigator"]);var eJr=D7e(function(){return!!Wf(function(){return process&&(process.versions||{}).node}).v});var Tse,KDt;function N7e(){return Tse=z1(Wf(Di,[cNt]).v),Tse}a(N7e,"_initSymbol");function pEo(t){var e=(Nh.lzy?0:Tse)||N7e();return e.v?e.v[t]:hC}a(pEo,"_getSymbolKey");function tJr(){return!!hEo()}a(tJr,"hasSymbol");function hEo(){return!Nh&&HU(),((Nh.lzy?0:Tse)||N7e()).v}a(hEo,"getSymbol");function Abe(t,e){var r=KKr[t];!Nh&&HU();var n=(Nh.lzy?0:Tse)||N7e();return n.v?n.v[r||t]:e?hC:fEo(t)}a(Abe,"getKnownSymbol");function cx(t,e){!Nh&&HU();var r=(Nh.lzy?0:Tse)||N7e();return r.v?r.v(t):e?Dh:dNt(t)}a(cx,"newSymbol");function GU(t){return!Nh&&HU(),KDt=(Nh.lzy?0:KDt)||z1(Wf(pEo,["for"]).v),(KDt.v||dEo)(t)}a(GU,"symbolFor");function b7e(t){return!!t&&Or(t.next)}a(b7e,"isIterator");function fNt(t){return!Xyo(t)&&Or(t[Abe(3)])}a(fNt,"isIterable");var E7e;function M7e(t,e,r){if(t&&(b7e(t)||(!E7e&&(E7e=z1(Abe(3))),t=t[E7e.v]?t[E7e.v]():Dh),b7e(t))){var n=hC,o=hC;try{for(var s=0;!(o=t.next()).done&&e[yA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=Dh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(M7e,"iterForOf");function Sse(t,e,r){return t.apply(e,r)}a(Sse,"fnApply");function Lh(t,e){return!Nn(e)&&t&&(ur(e)?Sse(t.push,t,e):b7e(e)||fNt(e)?M7e(e,function(r){t.push(r)}):t.push(e)),t}a(Lh,"arrAppend");function vt(t,e,r){if(t)for(var n=t[XW]>>>0,o=0;o0?r:0;return zf(t,o,o+n[XW])===n}a(REo,"polyStrStartsWith");var rNt="ref",nNt="unref",iNt="hasRef",kEo="enabled";function PEo(t,e,r){var n=!0,o=t?e(Dh):Dh,s;function c(){return n=!1,o&&o[nNt]&&o[nNt](),s}a(c,"_unref");function l(){o&&r(o),o=Dh}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[iNt]=function(){return o&&o[iNt]?o[iNt]():n},s[rNt]=function(){return n=!0,o&&o[rNt]&&o[rNt](),s},s[nNt]=c,s=T_(s,kEo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Dh},"dn")}}a(PEo,"_createTimerHandler");function hNt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?hC:e)||setTimeout,c=(o>1?e[1]:hC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),Sse(l,hC,IB[yA](arguments))};var u=PEo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;Sse(c,hC,[d])}return Sse(s,hC,r)},function(d){Sse(c,hC,[d])});return u.h}a(hNt,"_createTimeoutWith");function qp(t,e){return hNt(!0,hC,IB[yA](arguments))}a(qp,"scheduleTimeout");function aJr(t,e,r){return hNt(!0,t,IB[yA](arguments,1))}a(aJr,"scheduleTimeoutWith");function O7e(t,e){return hNt(!1,hC,IB[yA](arguments))}a(O7e,"createTimeout");var Cbe=R7e,mNt=uNt;p();var Jk=Cbe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Zk="toLowerCase",dn="length",Dse="warnToConsole",NB="throwInternal",pM="watch",VU="apply",Fi="push",lx="splice",zu="logger",hM="cancel",MB="initialize",mM="identifier",Nse="removeNotificationListener",Mse="addNotificationListener",mC="isInitialized",bbe="getNotifyMgr",WU="getPlugin",K1="name",Jm="processNext",L7e="getProcessTelContext",OB="value",zU="enabled",gNt="stopPollingInternalLogs",ux="unload",Sbe="onComplete",B7e="version",F7e="loggingLevelConsole",gM="createNew",J1="teardown",Ose="messageId",AM="message",gC="diagLog",YU="_doTeardown",nz="update",Z1="getNext",KU="setNextPlugin",Tbe="userAgent",dx="split",Xk="replace",Ibe="substring",xbe="indexOf",LB="type",ANt="evtName",eP="status",yNt="getAllResponseHeaders",wbe="isChildEvt",X1="data",iz="getCtx",tP="setCtx",ENt="itemsReceived",Rbe="headers",Lse="urlString",oz="timeout";var U7e="traceFlags";var _Nt;function cJr(t,e){_Nt||(_Nt=Ebe("AggregationError",function(n,o){o[dn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw vt(e,function(n,o){r+=` +`.concat(o," > ").concat(dr(n))}),new _Nt(r,e||[])}a(cJr,"throwAggregationError");p();p();p();var Bse="function",fx="object",eS="undefined",tS="prototype";var JU=Object,kbe=JU[tS];p();var Akl=(Wy()||{}).Symbol,ykl=(Wy()||{}).Reflect;var lJr="hasOwnProperty",NEo=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(DNt,"_hasVisited");function LEo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[SNt]&&n){var m=u[V7e]||{};m[Pbe]!==!1&&(h=(m[d[Fse]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=fM(null);W7e(r,function(u){s[u]=o(e,r,u)});for(var c=az(t),l=[];c&&!kNt(c)&&!DNt(l,c);)W7e(c,function(u){!s[u]&&PNt(c,u,!Dbe)&&(s[u]=o(e,c,u))}),l.push(c),c=az(c);return s}a(LEo,"_getBaseFuncs");function BEo(t,e,r,n){var o=null;if(t&&ng(r,Fse)){var s=t[V7e]||fM(null);if(o=(s[r[Fse]]||fM(null))[e],o||z7e("Missing ["+e+"] "+$7e),!o[TNt]&&s[Pbe]!==!1){for(var c=!ng(t,e),l=az(t),u=[];c&&l&&!kNt(l)&&!DNt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=az(l)}try{c&&(t[e]=o),o[TNt]=1}catch{s[Pbe]=!1}}}return o}a(BEo,"_getInstFunc");function FEo(t,e,r){var n=e[t];return n===r&&(n=az(e)[t]),typeof n!==$7e&&z7e("["+t+"] is not a "+$7e),n}a(FEo,"_getProtoFunc");function UEo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=BEo(this,d,u,f)||FEo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[SNt]=1,f}if(a(s,"_createDynamicPrototype"),!H7e(t)){var c=r[V7e]=r[V7e]||fM(null);if(!H7e(c)){var l=c[e]=c[e]||fM(null);c[Pbe]!==!1&&(c[Pbe]=!!o),H7e(l)||W7e(r,function(u){PNt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!ng(t,u)||t[u]&&!t[u][SNt])&&(t[u]=s(t,u)))})}}}a(UEo,"_populatePrototype");function QEo(t,e){if(Dbe){for(var r=[],n=az(e);n&&!kNt(n)&&!DNt(r,n);){if(n===t)return!0;r.push(n),n=az(n)}return!1}return!0}a(QEo,"_checkPrototype");function bNt(t,e){return ng(t,BB)?t.name||e||uJr:((t||{})[G7e]||{}).name||e||uJr}a(bNt,"_getObjName");function Si(t,e,r,n){ng(t,BB)||z7e("theClass is an invalid class definition.");var o=t[BB];QEo(o,e)||z7e("["+bNt(t)+"] not in hierarchy of ["+bNt(e)+"]");var s=null;ng(o,Fse)?s=o[Fse]:(s=MEo+bNt(t,"_")+"$"+xNt.n,xNt.n++,o[Fse]=s);var c=Si[hJr],l=!!c[j7e];l&&n&&n[j7e]!==void 0&&(l=!!n[j7e]);var u=OEo(e),d=LEo(o,e,u,l);r(e,d);var f=!!Dbe&&!!c[INt];f&&n&&(f=!!n[INt]),UEo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[hJr]=xNt.o;p();var K7e="Promise";var QNt="rejected";function vl(t,e){return J7e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:QNt,rejected:!0,reason:r}):r})}a(vl,"doAwaitResponse");function J7e(t,e,r,n){var o=t;try{if(rg(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&&qEo(o,n)}return o}a(J7e,"doAwait");function qEo(t,e){var r=t;return e&&(rg(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(qEo,"doFinally");var NNt,MNt,ONt,mJr=!1;function jEo(t,e,r,n){NNt=NNt||{toString:a(function(){return"[[PromiseState]]"},"toString")},MNt=MNt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},ONt=ONt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[NNt]={get:e},o[MNt]={get:r},o[ONt]={get:n},WKr(t,o)}a(jEo,"_addDebugState$1");var yJr=["pending","resolving","resolved",QNt],gJr="dispatchEvent",Y7e;function HEo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(HEo,"_hasInitEventFn");function GEo(t,e,r,n){var o=pf();!Y7e&&(Y7e=z1(!!Wf(HEo,[o]).v));var s=Y7e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),Y7e.v&&s.initEvent(e,!1,!0),s&&t[gJr])t[gJr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Di("console");l&&(l.error||l.log)(e,dr(s))}}}a(GEo,"emitEvent");var EJr="unhandledRejection",$Eo=EJr.toLowerCase(),Nbe=[],VEo=0,WEo=10;var LNt;function AJr(t){return Or(t)?t.toString():dr(t)}a(AJr,"dumpFnObj");function _Jr(t,e,r){var n=$U(arguments,3),o=0,s=!1,c,l=[],u=VEo++,d=Nbe.length>0?Nbe[Nbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{Nbe.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,L=Nn(N)?c:Or(N)?N(c):N;rg(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{Nbe.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 yJr[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&&rg(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=qp(b,WEo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,eJr())process.emit(EJr,c,m);else{var w=hf()||Wy();!LNt&&(LNt=z1(Wf(Di,[K7e+"RejectionEvent"]).v)),GEo(w,$Eo,function(R){return ji(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!LNt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},T_(m,"state",{get:E}),mJr&&jEo(m,E,function(){return mbe(c)},function(){return f}),tJr()&&(m[Abe(11)]="IPromise");function T(){return"IPromise"+(mJr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+AJr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||Km(K7e+": executor is not a function - "+AJr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(_Jr,"_createPromise");function zEo(t){return function(e){var r=$U(arguments,1);return t(function(n,o){try{var s=[],c=1;M7e(e,function(l,u){l&&(c++,J7e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(zEo,"_createAllPromise");function YEo(t){return z1(function(e){var r=$U(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,vl(u,function(f){f.rejected?s[d]={status:QNt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?vt(e,l):fNt(e)?M7e(e,l):Km("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(YEo,"_createAllSettledPromise");function vJr(t){vt(t,function(e){try{e()}catch{}})}a(vJr,"syncItemProcessor");function KEo(t){var e=Mh(t)?t:0;return function(r){qp(function(){vJr(r)},e)}}a(KEo,"timeoutItemProcessor");function CJr(t,e){return _Jr(CJr,KEo(e),t,e)}a(CJr,"createAsyncPromise");var BNt;function JEo(t,e){!BNt&&(BNt=z1(Wf(Di,[K7e]).v||null));var r=BNt.v;if(!r)return CJr(t);Or(t)||Km(K7e+": executor is not a function - "+dr(t));var n=0;function o(){return yJr[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 T_(s,"state",{get:o}),s}a(JEo,"createNativePromise");var FNt;function Mbe(t){return _Jr(Mbe,vJr,t)}a(Mbe,"createSyncPromise");function Z7e(t,e){return!FNt&&(FNt=YEo(Mbe)),FNt.v(t,e)}a(Z7e,"createSyncAllSettledPromise");var UNt;function Md(t,e){return!UNt&&(UNt=z1(JEo)),UNt.v.call(this,t,e)}a(Md,"createPromise");var X7e=zEo(Md);var Jkl=Abe(11);p();p();p();p();var rS=void 0,To="",cz="channels",Yf="core",eQe="createPerfMgr",Obe="disabled",FB="extensionConfig",lz="extensions",AC="processTelemetry",uz="priority",Use="eventsSent",ZU="eventsDiscarded",Qse="eventsSendRequest",yM="perfEvent",tQe="offlineEventsStored",rQe="offlineBatchSent",nQe="offlineBatchDrop",qse="getPerfMgr",iQe="domain",oQe="path",bJr="Not dynamic - ",SJr="REDACTED",qNt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var ZEo="getPrototypeOf",XEo=/-([a-z])/g,e_o=/([^\w\d_$])/g,t_o=/^(\d+[\w\d_$])/,aPl=Object[ZEo];function XU(t){return!Xt(t)}a(XU,"isNotNullOrUndefined");function Lbe(t){var e=t;return e&&Ei(e)&&(e=e[Xk](XEo,function(r,n){return n.toUpperCase()}),e=e[Xk](e_o,"_"),e=e[Xk](t_o,function(r,n){return"_"+n})),e}a(Lbe,"normalizeJsName");function Zm(t,e){return t&&e?lu(t,e)!==-1:!1}a(Zm,"strContains");function e7(t){return t&&t.toISOString()||""}a(e7,"toISOString");function jp(t){return wB(t)?t[K1]:To}a(jp,"getExceptionName");function EM(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(EM,"setValue");function jNt(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(jNt,"getSetValue");function r_o(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][VU](n,o)}}a(r_o,"_createProxyFunction");function dz(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=r_o(r,n))}a(dz,"proxyFunctionAs");function fz(t,e,r,n){return t&&e&&$u(t)&&ur(r)&&vt(r,function(o){Ei(o)&&dz(t,o,e,o,n)}),t}a(fz,"proxyFunctions");function HNt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(HNt,"createClassFromInterface");function aQe(t){return t&&RB&&(t=JU(RB({},t))),t}a(aQe,"optimizeObject");function cQe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[dn],d=!1,f=1;for(u>0&&Yk(l)&&(d=l,l=c[f]||{},f++),$u(l)||(l={});f>>=0),qbe=DJr+t&hz,jbe=NJr-t&hz,MJr=!0}a(g_o,"_mwcSeed");function A_o(){try{var t=_l()&2147483647;g_o((Math.random()*PJr^t)+t)}catch{}}a(A_o,"_autoSeedMwc");function kJr(t){var e=0,r=ZNt()||XNt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&hz),e===0&&Gse()&&(MJr||A_o(),e=y_o()&hz),e===0&&(e=Y1(PJr*Math.random()|0)),t||(e>>>=0),e}a(kJr,"random32");function y_o(t){jbe=36969*(jbe&65535)+(jbe>>16)&hz,qbe=18e3*(qbe&65535)+(qbe>>16)&hz;var e=(jbe<<16)+(qbe&65535)>>>0&hz|0;return t||(e>>>=0),e}a(y_o,"mwcRandom32");function OJr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=kJr()>>>0,n=0,o=To;o[dn]>>=6,n===5&&(r=(kJr()<<2&4294967295|r&3)>>>0,n=0);return o}a(OJr,"newId");var LJr="3.3.11",E_o="."+OJr(6),__o=0;function BJr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(BJr,"_canAcceptData");function v_o(t,e){var r=e[t.id];if(!r){r={};try{BJr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(v_o,"_getCache");function nS(t,e){return e===void 0&&(e=!1),Lbe(t+__o+++(e?"."+LJr:To)+E_o)}a(nS,"createUniqueNamespace");function dQe(t){var e={id:nS("_aiData-"+(t||To)+"."+LJr),accept:a(function(r){return BJr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Lbe(n)]:(s&&(c=v_o(e,r),c[Lbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(dQe,"createElmNodeData");p();function fQe(t){return t&&$u(t)&&!ur(t)&&(t.isVal||t.fb||EA(t,"v")||EA(t,"mrg")||EA(t,"ref")||t.set)}a(fQe,"_isConfigDefaults");function FJr(t,e,r){var n,o=r.dfVal||Ise;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&cJr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[dn]>0){c||(c=[]),l||(l=qp(function(){l=null,f()},0));for(var A=0;A0?vl(UB(t[0],e),function(){AQe($U(t,1),e,r)}):r(),n}a(AQe,"doUnloadAll");p();var HJr=500,oMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function R_o(t,e,r){return!t&&Xt(t)?e:Yk(t)?t:Gu(t)[Zk]()==="true"}a(R_o,"_stringToBoolOrDefault");function sMt(t){return{mrg:!0,v:t}}a(sMt,"cfgDfMerge");function Vse(t,e,r){return{fb:r,isVal:t,v:e}}a(Vse,"cfgDfValidate");function mx(t,e){return{fb:e,set:R_o,v:!!t}}a(mx,"cfgDfBoolean");p();p();var aMt=[Use,ZU,Qse,yM],EQe=null,yQe;function k_o(t,e){return function(){var r=arguments,n=cMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][VU](o,r)}}}a(k_o,"_listenerProxyFunc");function P_o(){var t=Di("Microsoft");return t&&(EQe=t.ApplicationInsights),EQe}a(P_o,"_getExtensionNamespace");function cMt(t){var e=EQe;return!e&&t.disableDbgExt!==!0&&(e=EQe||P_o()),e?e.ChromeDbgExt:null}a(cMt,"getDebugExt");function GJr(t){if(!yQe){yQe={};for(var e=0;e=A&&(d[T](b[AM]),n[w]=!0)}else o>=A&&d[T](b[AM]);f(A,b)}},d.debugToConsole=function(A){lMt("debug",A),g("warning",A)},d[Dse]=function(A){lMt("warn",A),g("warning",A)},d.errorToConsole=function(A){lMt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[ux]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=M_o+y[Ose];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Fi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new zbe(23,v,!1);d.queue[Fi](b),A===1?d.errorToConsole(v):d[Dse](v)}}}a(f,"_logInternalMessage");function h(A){return hx(Bh(A,O_o,d).cfg,function(y){var E=y.cfg;o=E[F7e],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=cMt(e||{});E&&E[gC]&&E[gC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function WJr(t){return t||new zse}a(WJr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),WJr(t)[NB](e,r,n,o,s)}a(Wr,"_throwInternal");function QB(t,e){WJr(t)[Dse](e)}a(QB,"_warnToConsole");var uMt,n7,zJr="toGMTString",YJr="toUTCString",hMt="cookie",dMt="expires",KJr="isCookieUseDisabled",Ybe="disableCookiesUsage",JJr="_ckMgr",_Qe=null,fMt=null,ZJr=null,vM,XJr={},eZr={},B_o=(uMt={cookieCfg:sMt((n7={},n7[iQe]={fb:"cookieDomain",dfVal:XU},n7.path={fb:"cookiePath",dfVal:XU},n7.enabled=rS,n7.ignoreCookies=rS,n7.blockedCookies=rS,n7.disableCookieDefer=!1,n7)),cookieDomain:rS,cookiePath:rS},uMt[Ybe]=rS,uMt);function mMt(){!vM&&(vM=P7e(function(){return pf()}))}a(mMt,"_getDoc");function vQe(t){return t?t.isEnabled():!0}a(vQe,"_isMgrEnabled");function sZr(t,e){return e&&t&&ur(t.ignoreCookies)?Wo(t.ignoreCookies,e)!==-1:!1}a(sZr,"_isIgnoredCookie");function tZr(t,e){return e&&t&&ur(t.blockedCookies)&&Wo(t.blockedCookies,e)!==-1?!0:sZr(t,e)}a(tZr,"_isBlockedCookie");function rZr(t,e){var r=e[zU];if(Xt(r)){var n=void 0;Nn(t[KJr])||(n=!t[KJr]),Nn(t[Ybe])||(n=!t[Ybe]),r=n}return r}a(rZr,"_isCfgEnabled");function aZr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[oQe]=E||"/",_[dMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Gse()||(v["max-age"]="0"),iZr(To,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||To),R=lu(w,";");if(R!==-1&&(w=Ni(dM(E,R)),T=cZr(zf(E,R+1))),EM(T,iQe,v||o,W1,Nn),!Xt(_)){var x=Gse();if(Nn(T[dMt])){var P=_l(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),EM(T,dMt,nZr(N,x?zJr:YJr)||nZr(N,x?zJr:YJr)||To,W1)}}x||EM(T,"max-age",To+_,null,Nn)}var L=Ube();return L&&L.protocol==="https:"&&(EM(T,"secure",null,null,Nn),fMt===null&&(fMt=!U_o((Wu()||{})[Tbe])),fMt&&EM(T,"SameSite","None",null,Nn)),EM(T,oQe,b||n,null,Nn),iZr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[dn]-1;_>=0;_--)f[_].n===E&&f[lx](_,1)}a(g,"_removePendingCookie");function A(){pMt(e)&&f&&(vt(f,function(E){tZr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Bh(t||eZr,null,e).cfg,s=hx(t,function(E){E.setDf(E.cfg,B_o),r=E.ref(E.cfg,"cookieCfg"),n=r[oQe]||"/",o=r[iQe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=rZr(t,r)!==!1,l=r.getCookie||F_o,u=r.setCookie||oZr,d=r.delCookie||oZr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=rZr(t,r)!==!1&&c&&pMt(e),_=eZr[JJr];return E&&_&&y!==_&&(E=vQe(_)),E},"isEnabled"),setEnabled:a(function(E){r[zU]=E,Nn(t[Ybe])||(t[Ybe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=tZr(r,E);if(!R){var x=m(_,v,b,T);vQe(y)?(u(E,x),w=!0):f&&(g(E),f[Fi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=To,v=sZr(r,E);if(!v){if(vQe(y))_=l(E);else if(f)for(var b=f[dn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(dM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return vQe(y)?v=y.purge(E,_):f&&(g(E),f[Fi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return pMt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[JJr]=y,y}a(aZr,"createCookieMgr");function pMt(t){if(_Qe===null){_Qe=!1,!vM&&mMt();try{var e=vM.v||{};_Qe=e[hMt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+jp(r),{exception:dr(r)})}}return _Qe}a(pMt,"areCookiesSupported");function cZr(t){var e={};if(t&&t[dn]){var r=Ni(t)[dx](";");vt(r,function(n){if(n=Ni(n||To),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(dM(n,o))]=Ni(zf(n,o+1))}})}return e}a(cZr,"_extractParts");function nZr(t,e){return Or(t[e])?t[e]():null}a(nZr,"_formatDate");function iZr(t,e){var r=t||To;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?To:"="+o)}),r}a(iZr,"_formatCookieValue");function F_o(t){var e=To;if(!vM&&mMt(),vM.v){var r=vM.v[hMt]||To;ZJr!==r&&(XJr=cZr(r),ZJr=r),e=Ni(XJr[t]||To)}return e}a(F_o,"_getCookieValue");function oZr(t,e){!vM&&mMt(),vM.v&&(vM.v[hMt]=t+"="+e)}a(oZr,"_setCookieValue");function U_o(t){return Ei(t)?!!(Zm(t,"CPU iPhone OS 12")||Zm(t,"iPad; CPU OS 12")||Zm(t,"Macintosh; Intel Mac OS X 10_14")&&Zm(t,"Version/")&&Zm(t,"Safari")||Zm(t,"Macintosh; Intel Mac OS X 10_14")&&DB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Zm(t,"Chrome/5")||Zm(t,"Chrome/6")||Zm(t,"UnrealEngine")&&!Zm(t,"Chrome")||Zm(t,"UCBrowser/12")||Zm(t,"UCBrowser/11")):!1}a(U_o,"uaDisallowsSameSiteNone");p();var Q_o={perfEvtsSendAll:!1};function q_o(t){t.h=null;var e=t.cb;t.cb=[],vt(e,function(r){Wf(r.fn,[r.arg])})}a(q_o,"_runScheduledListeners");function i7(t,e,r,n){vt(t,function(o){o&&o[e]&&(r?(r.cb[Fi]({fn:n,arg:o}),r.h=r.h||qp(q_o,0,r)):Wf(n,[o]))})}a(i7,"_runListeners");var lZr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Bh(e,Q_o);n=c[pM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[Mse]=function(u){o[Fi](u)},l[Nse]=function(u){for(var d=Wo(o,u);d>-1;)o[lx](d,1),d=Wo(o,u)},l[Use]=function(u){i7(o,Use,s,function(d){d[Use](u)})},l[ZU]=function(u,d,f){i7(o,ZU,s,function(h){h[ZU](u,d,f)})},l[Qse]=function(u,d){i7(o,Qse,d?s:null,function(f){f[Qse](u,d)})},l[yM]=function(u){u&&(r||!u[wbe]())&&i7(o,yM,null,function(d){u.isAsync?qp(function(){return d[yM](u)},0):d[yM](u)})},l[tQe]=function(u){u&&u[dn]&&i7(o,tQe,s,function(d){d[tQe](u)})},l[rQe]=function(u){u&&u[X1]&&i7(o,rQe,s,function(d){d[rQe](u)})},l[nQe]=function(u,d){if(u>0){var f=d||0;i7(o,nQe,s,function(h){h[nQe](u,f)})}},l[ux]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[hM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(i7(o,"unload",null,function(h){var m=h[ux](u);m&&(f||(f=[]),f[Fi](m))}),f)return Md(function(h){return vl(X7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Yse="ctx",AMt="ParentContextKey",Kbe="ChildrenContextKey",j_o=null,CQe=(function(){function t(e,r,n){var o=this;if(o.start=_l(),o[K1]=e,o.isAsync=n,o[wbe]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[iz]=function(c){return c?c===t[AMt]||c===t[Kbe]?o[c]:(o[Yse]||{})[c]:null},o[tP]=function(c,l){if(c)if(c===t[AMt])o[c]||(o[wbe]=function(){return!0}),o[c]=l;else if(c===t[Kbe])o[c]=l;else{var u=o[Yse]=o[Yse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[iz](t[Kbe]);if(ur(l))for(var u=0;u0&&(vt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[zu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[FB];!_&&A&&(_={}),E[FB]=_,_=e.ref(E,FB),_&&(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&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}Hbe(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]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[WU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(vMt,"_createInternalContext");function rP(t,e,r,n){var o=Bh(e),s=vMt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[AC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=o7(d,o.cfg,r,f)),rP(d||c[Z1](),o.cfg,r,f)}return a(u,"_createNew"),c[Jm]=l,c[gM]=u,c}a(rP,"createProcessTelemetryContext");function Kse(t,e,r){var n=Bh(e.config),o=vMt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[ux](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=o7(u,n.cfg,e,d)),Kse(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Jm]=c,s[gM]=l,s}a(Kse,"createProcessTelemetryUnloadContext");function Jbe(t,e,r){var n=Bh(e.config),o=vMt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[nz])&&d[nz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=o7(u,n.cfg,e,d)),Jbe(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Jm]=c,s[gM]=l,s}a(Jbe,"createProcessTelemetryUpdateContext");function o7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[dn]>0){var c=null;vt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[AC])){var u=z_o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?o7([n],e,r):o}a(o7,"createTelemetryProxyChain");function z_o(t,e,r){var n=null,o=Or(t[AC]),s=Or(t[KU]),c;t?c=t[mM]+"-"+t[uz]+"-"+gZr++:c="Unknown-0-"+gZr++;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[mZr])&&(g=t[mZr]()),g||(g=rP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[mM]:V_o,T=g[hZr];return T||(T=g[hZr]={}),g.setNext(n),t&&bQe(g[Yf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:To;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Wr(g[gC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=qB(t);return _[J1]||_[Obe]?!1:(s&&t[KU](n),t[AC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Jm](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=qB(t),v=t[Yf]||_[Yf];t&&(!v||v===g.core())&&!_[J1]&&(_[Yf]=null,_[J1]=!0,_[mC]=!1,t[J1]&&t[J1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Jm](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=qB(t),v=t[Yf]||_[Yf];t&&(!v||v===g.core())&&!_[J1]&&t[nz]&&t[nz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Jm](A)}return a(m,"_updatePlugin"),Oh(l)}a(z_o,"createTelemetryPluginProxy");var Y_o=(function(){function t(e,r,n,o){var s=this,c=rP(e,r,n,o);fz(s,c,Vu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function TQe(){var t=[];function e(n){n&&t[Fi](n)}a(e,"_addHandler");function r(n,o){vt(t,function(s){try{s(n,o)}catch(c){Wr(n[gC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(TQe,"createUnloadHandlerContainer");p();var IQe,xQe;function wQe(){var t=[];function e(n){var o=t;t=[],vt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Wr(n,2,73,"Unloading:"+dr(c))}}),IQe&&o[dn]>IQe&&(xQe?xQe("doUnload",o):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Lh(t,n),IQe&&t[dn]>IQe&&(xQe?xQe("Add",t):Wr(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(wQe,"createUnloadHookContainer");var CMt,s7="getPlugin",K_o=(CMt={},CMt[FB]={isVal:XU,v:{}},CMt),Zbe=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[MB]=function(h,m,g,A){u(h,m,A),r=!0},f[J1]=function(h,m){var g=f[Yf];if(!g||h&&g!==h[Yf]())return;var A,y=!1,E=h||Kse(null,g,o&&o[s7]?o[s7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[gC]()),A===!0&&E[Jm](_),d())}return a(v,"_unloadCallback"),!f[YU]||f[YU](E,_,v)!==!0?v():A=!0,A},f[nz]=function(h,m){var g=f[Yf];if(!g||h&&g!==h[Yf]())return;var A,y=!1,E=h||Jbe(null,g,o&&o[s7]?o[s7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[Z1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},dz(f,"_addUnloadCb",function(){return s},"add"),dz(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[gC]=function(f){return l(f)[gC]()},e[mC]=function(){return r},e.setInitialized=function(f){r=f},e[KU]=function(f){o=f},e[Jm]=function(f,h){h?h[Jm](f):o&&Or(o[AC])&&o[AC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||rP(null,{},e[Yf]);o&&o[s7]?h=m[gM](null,o[s7]):h=m[gM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Bh(f,K_o,mz(h)),!m&&h&&(m=h[L7e]()[Z1]());var g=o;o&&o[s7]&&(g=o[s7]()),e[Yf]=h,n=rP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Yf]=null,n=null,o=null,c=wQe(),s=TQe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function J_o(t,e,r){var n={id:e,fn:r};Lh(t,n);var o={remove:a(function(){vt(t,function(s,c){if(s.id===n.id)return t[lx](c,1),-1})},"remove")};return o}a(J_o,"_addInitializer");function Z_o(t,e,r){for(var n=!1,o=t[dn],s=0;s"},"v")})}a(cvo,"_createUnloadHook");var TMt=(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,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[mC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[MB]=function(ne,ce,Me,we){g&&Zc(yZr),U[mC]()&&Zc("Core cannot be initialized more than once"),e=Bh(ne,bMt,Me||U[zu],!1),ne=e.cfg,qe(e[pM](function(st){var Et=st.cfg;B=Et.initInMemoMaxSize||tvo,Y(Et);var Dt=st.ref(st.cfg,FB);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=avo(e,v,s&&U[bbe](),b),K(),U[zu]=Me;var Be=ne[lz];if(f=[],f[Fi].apply(f,sz(sz([],ce,!1),Be,!1)),h=ne[cz],Le(null),(!m||m[dn]===0)&&Zc("No "+cz+" available"),h&&h[dn]>1){var rt=U[WU]("TeeChannelController");(!rt||!rt.plugin)&&Wr(n,1,28,"TeeChannel required")}svo(ne,R,n),R=null,r=!0,N===Jk.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&vt(m,function(ce){ne[Fi](ce)}),Oh(ne)},U.track=function(ne){bQe(U[qse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[K1]&&Xt(ne[K1])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||e7(new Date),ne.ver=ne.ver||"4.0",!g&&U[mC]()&&N===Jk.ACTIVE?le()[Jm](ne):N!==Jk.INACTIVE&&o[dn]<=B&&o[Fi](ne)},function(){return{item:ne}},!ne.sync)},U[L7e]=le,U[bbe]=function(){return s||(s=new lZr(e.cfg),U[X_o]=s),s},U[Mse]=function(ne){U.getNotifyMgr()[Mse](ne)},U[Nse]=function(ne){s&&s[Nse](ne)},U.getCookieMgr=function(){return u||(u=aZr(e.cfg,U[zu])),u},U.setCookieMgr=function(ne){u!==ne&&(UB(u,!1),u=ne)},U[qse]=function(){return c||l||dZr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[dn]},U.releaseQueue=function(){if(r&&o[dn]>0){var ne=o;o=[],N===2?vt(ne,function(ce){ce.iKey=ce.iKey||w,le()[Jm](ce)}):Wr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[hM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Me=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=Jk.INACTIVE;var we="Please provide instrumentation key";r?(Wr(n,1,100,we),z()):Zc(we);return}var Be=[];rg(ce)?(Be[Fi](ce),w=null):w=ce,rg(Me)?(Be[Fi](Me),L=null):L=Me,Be[dn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Me=XU(ne.initTimeOut)?ne.initTimeOut:rvo,we=Z7e(ce);M&&M[hM](),M=qp(function(){M=null,q||V()},Me),vl(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[OB];if(rt&&rt[dn]){var st=rt[0];if(w=st&&st[OB],rt[dn]>1){var Et=rt[1];L=Et&&Et[OB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=Jk.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=Jk.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[zU])&&!Q){var ce=ne||n&&n.queue[dn]>0;ce&&(j||(j=!0,qe(e[pM](function(Me){var we=Me.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[zU],O[hM]()),O=O7e(X,we),O.unref(),O[zU]=Be}))),O[zU]=!0)}return O}a(ie,"_startLogPoller"),U[gNt]=function(){Q=!0,O&&O[hM](),X()},fz(U,function(){return A},["addTelemetryInitializer"]),U[ux]=function(ne,ce,Me){ne===void 0&&(ne=!0),r||Zc(evo),g&&Zc(yZr);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Md(function(Et){ce=Et}));var rt=Kse(Ue(),U);rt[Sbe](function(){v.run(U[zu]),AQe([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(Et){we.flushComplete=Et,g=!0,_.run(rt,we),U[gNt](),rt[Jm](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Me)||st(!1),Be},U[WU]=ge,U.addPlugin=function(ne,ce,Me,we){if(!ne){we&&we(!1),Z(vZr);return}var Be=ge(ne[mM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[mM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[Fi](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var Et=[Be.plugin],Dt={reason:2,isAsync:!!Me};ke(Et,Dt,function($t){$t?(rt.removed=Et,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Me;if(U[mC]()){Me={reason:1,cfg:e.cfg,oldCfg:kse({},e.cfg),newConfig:kse({},ne),merge:ce},ne=Me.newConfig;var we=e.cfg;ne[lz]=we[lz],ne[cz]=we[cz]}e._block(function(Be){var rt=Be.cfg;SMt(Be,rt,ne,ce),ce||Yr(rt,function(st){EA(ne,st)||Be.set(rt,st,rS)}),Be.setDf(rt,bMt)},!0),e.notify(),Me&&he(Me)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=pZr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,dz(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=hx(e.cfg,ne,U[zu]):ce=ovo(R,ne),cvo(ce)},U.getWParam=function(){return kB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Me){Me&&vt(Me,function(we){if(we[mM]&&we[B7e]&&!ne[we.identifier]){var Be=we[mM]+"="+we[B7e];P[Fi](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&vt(h,function(Me){ce(Me)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Bh({},bMt,U[zu]),e.cfg[F7e]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||To},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new zse(e.cfg),e[zu]=n),n},"g"),s:a(function(ce){e[zu]=ce,n!==ce&&(UB(n,!1),n=ce)},"s")}),U[zu]=new zse(e.cfg),x=[];var ne=U.config[lz]||[];ne.splice(0,ne[dn]),Lh(ne,x),A=new AZr,o=[],UB(s,!1),s=null,c=null,l=null,UB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=nS("AIBaseCore",!0),_=TQe(),T=null,w=null,v=wQe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=rP(Ue(),e.cfg,U);return ne[Sbe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=ivo(U[zu],HJr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=SQe(Lh(m,ce[cz]));var Me=Lh(SQe(ce[Yf]),m);x=Oh(Me);var we=U.config[lz]||[];we.splice(0,we[dn]),Lh(we,x);var Be=le();m&&m[dn]>0&&_Mt(Be[gM](m),Me),_Mt(Be,Me),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Me=null,we=[];return vt(x,function(Be){if(Be[mM]===ne&&Be!==A)return Me=Be,-1;Be.getChannel&&we[Fi](Be)}),!Me&&we[dn]>0&&vt(we,function(Be){if(Me=Be.getChannel(ne),!Me)return-1}),Me&&(ce={plugin:Me,setEnabled:a(function(Be){qB(Me)[Obe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=qB(Me);return!Be[J1]&&!Be[Obe]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Me],Et={reason:1,isAsync:Be};ke(st,Et,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Wo(ne,A)===-1&&ne[Fi](A),d=o7(SQe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Me){if(ne&&ne[dn]>0){var we=o7(ne,e.cfg,U),Be=Kse(we,U);Be[Sbe](function(){var rt=!1,st=[];vt(f,function(Dt,$t){EZr(Dt,ne)?rt=!0:st[Fi](Dt)}),f=st,D=null,P=null;var Et=[];h&&(vt(h,function(Dt,$t){var Gt=[];vt(Dt,function(Ie){EZr(Ie,ne)?rt=!0:Gt[Fi](Ie)}),Et[Fi](Gt)}),h=Et),Me&&Me(rt),ie()}),Be[Jm](ce)}else Me(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[dn]=0,vt(ne,function(ce){var Me={name:y||"InternalMessageId: "+ce[Ose],iKey:w,time:e7(new Date),baseType:zbe.dataType,baseData:{message:ce[AM]}};U.track(Me)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Me,we){var Be=1,rt=!1,st=null;we=we||5e3;function Et(){Be--,rt&&Be===0&&(st&&st[hM](),st=null,ce&&ce(rt),ce=null)}if(a(Et,"doCallback"),m&&m[dn]>0){var Dt=le()[gM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,Et()},Me)||Gt||(ne&&st==null?st=qp(function(){st=null,Et()},we):Et())}})}return rt=!0,Et(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[pM](function(ce){var Me=ce.cfg.enablePerfMgr;if(Me){var we=ce.cfg[eQe];(ne!==we||!ne)&&(we||(we=nvo),jNt(ce.cfg,eQe,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[bbe]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=Jbe(Ue(),U);ce[Sbe](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Jm](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[zu];ce?(Wr(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[bbe]();ce&&ce[ZU]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function Xbe(t,e){try{if(t&&t!==""){var r=x_().parse(t);if(r&&r[ENt]&&r[ENt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[dn])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[K1]||dr(n)),{response:t})}return null}a(Xbe,"parseResponse");p();var nP="",lvo="NoResponseBody",CZr="&"+lvo+"=true",IMt="POST",xMt=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[MB]=function(M,O){o=O,n&&Wr(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=Ube();O&&O.protocol&&O.protocol[Zk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[dn]?R(M,O):null},E.getFallbackInst=function(){return d},E[YU]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[X1]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[X1])?new TextEncoder().encode(j[X1]):j[X1]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return vl(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[OB];if(!Le.done)return z[Fi](Le[OB]),ie+=Le.value[dn],vl(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(vt(Vu(ge),function(K){H.append(K,ge[K])}),Ue[Rbe]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=CZr)):le=!0);var ke=new Request(U,Ue);try{ke[oMt]=!0}catch{}if(!j&&r&&(V=Md(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?nP:K):x(O,s?0:400,{},s?nP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[eP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||nP,he):x(O,ue,{},Z||nP)}a(ee,"_onFetchComplete");try{vl(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[AM],499),ie&&ie(K.reason);else{var he=K[OB];try{!s&&!he.ok?(he[eP]?X(he.statusText,he[eP]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,nP),z&&z(!0)):vl(he.text(),function(Z){ee(he,M,Z[OB]),z&&z(!0)})}catch(Z){he&&he[eP]?X(dr(Z),he[eP]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[oz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[oz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=hf(),U=new XDomainRequest,Y=M[X1];U.onload=function(){var H=jse(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?nP:Bbe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Lse];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Wr(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[Xk](/^(https?:)/,"");U.open(IMt,ie),M[oz]&&(U[oz]=M[oz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.send(Y)}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 RZr="on",bZr="attachEvent",SZr="addEventListener",TZr="detachEvent",IZr="removeEventListener",wMt="events";var mMl=nS("aiEvtPageHide"),gMl=nS("aiEvtPageShow"),uvo=/\.[\.]+/g,dvo=/[\.]+$/,fvo=1,RQe=dQe("events"),pvo=/^([^.]*)(?:\.(.+)|)/;function xZr(t){return t&&t[Xk]?t[Xk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,To):t}a(xZr,"_normalizeNamespace");function RMt(t,e){if(e){var r=To;ur(e)?(r=To,vt(e,function(o){o=xZr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=xZr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||To)+r)}var n=pvo.exec(t||To)||[];return{type:n[1],ns:(n[2]||To).replace(uvo,".").replace(dvo,To)[dx](".").sort().join(".")}}a(RMt,"_getEvtNamespace");function kZr(t,e,r){r===void 0&&(r=!0);var n=RQe.get(t,wMt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(kZr,"_getRegisteredEvents");function PZr(t,e,r,n){t&&e&&e[LB]&&(t[IZr]?t[IZr](e[LB],r,n):t[TZr]&&t[TZr](RZr+e[LB],r))}a(PZr,"_doDetach");function hvo(t,e,r,n){var o=!1;return t&&e&&e[LB]&&r&&(t[SZr]?(t[SZr](e[LB],r,n),o=!0):t[bZr]&&(t[bZr](RZr+e[LB],r),o=!0)),o}a(hvo,"_doAttach");function wZr(t,e,r,n){for(var o=e[dn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[ANt].ns)&&(!n||n(s))&&(PZr(t,s[ANt],s.handler,s.capture),e[lx](o,1))}}a(wZr,"_doUnregister");function mvo(t,e,r){if(e[LB])wZr(t,kZr(t,e[LB]),e,r);else{var n=RQe.get(t,wMt,{});Yr(n,function(o,s){wZr(t,s,e,r)}),Vu(n)[dn]===0&&RQe.kill(t,wMt)}}a(mvo,"_unregisterEvents");function e1e(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=RMt("xx",r).ns[dx](".")):r=t,r}a(e1e,"mergeEvtNamespace");function kQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=RMt(e,n);if(s=hvo(t,c,r,o),s&&RQe.accept(t)){var l={guid:fvo++,evtName:c,handler:r,capture:o};kZr(t,c.type)[Fi](l)}}catch{}return s}a(kQe,"eventOn");function kMt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=RMt(e,n),c=!1;mvo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||PZr(t,s,r,o)}catch{}}a(kMt,"eventOff");p();var t1e="sampleRate",r1e="ProcessLegacy",PQe="http.method",gz="https://dc.services.visualstudio.com",CM="/v2/track",Yy="not_specified";p();var DQe=mNt({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 Az="split",go="length",yz="toLowerCase",c7="ingestionendpoint",l7="toString",PMt="removeItem",Jse="message",FZr="count";var n1e="stringify",i1e="pathname",Ez="match";var Ky="name";var _A="properties",Jy="measurements",o1e="sizeInBytes",s1e="typeName",Zse="exceptions",_z="severityLevel",NQe="problemGroup",vz="parsedStack",a1e="hasFullStack",c1e="assembly",bM="fileName",Cz="line",Xse="aiDataContract",bz="duration";function DMt(t,e,r){var n=e[go],o=UZr(t,e);if(o[go]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=zf(o,0,147)+QZr(s);o=c}return o}a(DMt,"dataSanitizeKeyAndAddUniqueness");function UZr(t,e){var r;return e&&(e=Ni(Gu(e)),e[go]>150&&(r=zf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(UZr,"dataSanitizeKey");function uu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Ni(Gu(e)),e[go]>r&&(n=zf(e,0,r),Wr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(uu,"dataSanitizeString");function Sz(t,e,r){return Ei(e)&&(e=rMt(e,r)),OMt(t,e,2048,66)}a(Sz,"dataSanitizeUrl");function l1e(t,e){var r;return e&&e[go]>32768&&(r=zf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(l1e,"dataSanitizeMessage");function NMt(t,e){var r;if(e){var n=""+e;n[go]>32768&&(r=zf(n,0,32768),Wr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(NMt,"dataSanitizeException");function w_(t,e){if(e){var r={};Yr(e,function(n,o){if($u(o)&&t7())try{o=x_()[n1e](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=uu(t,o,8192),n=DMt(t,n,r),r[n]=o}),e=r}return e}a(w_,"dataSanitizeProperties");function R_(t,e){if(e){var r={};Yr(e,function(n,o){n=DMt(t,n,r),r[n]=o}),e=r}return e}a(R_,"dataSanitizeMeasurements");function MMt(t,e){return e&&OMt(t,e,128,69)[l7]()}a(MMt,"dataSanitizeId");function OMt(t,e,r,n){var o;return e&&(e=Ni(Gu(e)),e[go]>r&&(o=zf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(OMt,"dataSanitizeInput");function QZr(t){var e="00"+t;return k7e(e,e[go]-3)}a(QZr,"dsPadNumber");p();var qZr=pf()||{},jZr=0,Avo=[null,null,null,null,null];function HZr(t){var e=jZr,r=Avo,n=r[e];return qZr.createElement?r[e]||(n=r[e]=qZr.createElement("a")):n={host:yvo(t,!0)},n.href=t,e++,e>=r[go]&&(e=0),jZr=e,n}a(HZr,"urlParseUrl");function yvo(t,e){var r=GZr(t,e)||"";if(r){var n=r[Ez](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[go]>3&&Ei(n[2])&&n[2][go]>0)return n[2]+(n[3]||"")}return r}a(yvo,"urlParseHost");function GZr(t,e){var r=null;if(t){var n=t[Ez](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[go]>2&&Ei(n[2])&&n[2][go]>0&&(r=n[2]||"",e&&n[go]>2)){var o=(n[1]||"")[yz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(GZr,"urlParseFullHost");var Evo=[gz+CM,"https://breeze.aimon.applicationinsights.io"+CM,"https://dc-int.services.visualstudio.com"+CM];function MQe(t){return Wo(Evo,t[yz]())!==-1}a(MQe,"isInternalApplicationInsightsEndpoint");function $Zr(t,e,r,n){var o,s=n,c=n;if(e&&e[go]>0){var l=HZr(e);if(o=l.host,!s)if(l[i1e]!=null){var u=l.pathname[go]===0?"/":l[i1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[i1e],s=uu(t,r?r+" "+u:u)}else s=uu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a($Zr,"AjaxHelperParseDependencyPath");p();p();var OQe=Cbe({LocalStorage:0,SessionStorage:1});var eae=void 0,VZr="";function WZr(t){try{if(Xt(Wy()))return null;var e=new Date()[l7](),r=Di(t===OQe.LocalStorage?"localStorage":"sessionStorage"),n=VZr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[PMt](n),!o)return r}catch{}return null}a(WZr,"_getVerifiedStorageObject");function LMt(){return LQe()?WZr(OQe.SessionStorage):null}a(LMt,"_getSessionStorageObject");function BMt(t){VZr=t||""}a(BMt,"utlSetStoragePrefix");function LQe(t){return(t||eae===void 0)&&(eae=!!WZr(OQe.SessionStorage)),eae}a(LQe,"utlCanUseSessionStorage");function FMt(t,e){var r=LMt();if(r!==null)try{return r.getItem(e)}catch(n){eae=!1,Wr(t,2,2,"Browser failed read of session storage. "+jp(n),{exception:dr(n)})}return null}a(FMt,"utlGetSessionStorage");function UMt(t,e,r){var n=LMt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){eae=!1,Wr(t,2,4,"Browser failed write to session storage. "+jp(o),{exception:dr(o)})}return!1}a(UMt,"utlSetSessionStorage");function QMt(t,e){var r=LMt();if(r!==null)try{return r[PMt](e),!0}catch(n){eae=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+jp(n),{exception:dr(n)})}return!1}a(QMt,"utlRemoveSessionStorage");p();var _vo=";",vvo="=";function u1e(t){if(!t)return{};var e=t[Az](_vo),r=ybe(e,function(o,s){var c=s[Az](vvo);if(c[go]===2){var l=c[0][yz](),u=c[1];o[l]=u}return o},{});if(Vu(r)[go]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[c7]=r[c7]||"https://"+n+"dc."+r.endpointsuffix}r[c7]=r[c7]||gz,DB(r[c7],"/")&&(r[c7]=r[c7].slice(0,-1))}return r}a(u1e,"parseConnectionString");p();var qMt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Ky]=uu(e,n)||Yy,s.data=r,s.time=e7(new Date),s[Xse]={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 jB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Ky]=uu(e,r)||Yy,s[_A]=w_(e,n),s[Jy]=R_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var Cvo=58,bvo=/^\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\?]+)?)/,Svo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,Tvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,Ivo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,xvo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,wvo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Rvo=/([^\(\s\n]+):([0-9]+)$/,zZr="",tae="error",gx="stack",HMt="stackDetails",YZr="errorSrc",GMt="message",XZr="description",KZr=[{re:Svo,len:5,m:1,fn:2,ln:3,col:4},{chk:Pvo,pre:kvo,re:Tvo,len:4,m:1,fn:2,ln:3},{re:Ivo,len:3,m:1,fn:2,hdl:ZZr},{re:xvo,len:2,fn:1,hdl:ZZr}];function kvo(t){return t.replace(/(\(anonymous\))/,"")}a(kvo,"_scrubAnonymous");function Pvo(t){return lu(t,"[native")<0}a(Pvo,"_ignoreNative");function $Mt(t,e){var r=t;return r&&!Ei(r)&&(JSON&&JSON[n1e]?(r=JSON[n1e](t),e&&(!r||r==="{}")&&(Or(t[l7])?r=t[l7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a($Mt,"_stringify");function eXr(t,e){var r=t;return t&&(r&&!Ei(r)&&(r=t[GMt]||t[XZr]||r),r&&!Ei(r)&&(r=$Mt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&lu(r||"",e)===-1&&(r=e+": "+r),r||""}a(eXr,"_formatMessage");function Dvo(t){try{if($u(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Dvo,"_isExceptionDetailsInternal");function Nvo(t){try{if($u(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(Nvo,"_isExceptionInternal");function JZr(t){return t&&t.src&&Ei(t.src)&&t.obj&&ur(t.obj)}a(JZr,"_isStackDetails");function Tz(t){var e=t||"";Ei(e)||(Ei(e[gx])?e=e[gx]:e=""+e);var r=e[Az](` +`);return{src:e,obj:r}}a(Tz,"_convertStackObj");function Mvo(t){for(var e=[],r=t[Az](` +`),n=0;n0){e=[];var n=0,o=!1,s=0;vt(r,function(y){if(o||Qvo(y)){var E=Gu(y);o=!0;var _=qvo(E,n);_&&(s+=_[o1e],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[go]-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(Lvo,"_parseStack");function BQe(t){var e="";if(t&&(e=t.typeName||t[Ky]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[l7]());e=n&&n[go]>1?n[1]:""}catch{}return e}a(BQe,"_getErrorType");function jMt(t){if(t)try{if(!Ei(t)){var e=BQe(t),r=$Mt(t,!1);return(!r||r==="{}")&&(t[tae]&&(t=t[tae],e=BQe(t)),r=$Mt(t,!0)),lu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(jMt,"_formatErrorCode");var Iz=(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,Nvo(r)?(l[Zse]=r[Zse]||[],l[_A]=r[_A],l[Jy]=r[Jy],r[_z]&&(l[_z]=r[_z]),r.id&&(l.id=r.id,r[_A].id=r.id),r[NQe]&&(l[NQe]=r[NQe]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Zse]=[rXr(e,r,n)],l[_A]=w_(e,n),l[Jy]=R_(e,o),s&&(l[_z]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=BQe(s||c||e);return{message:eXr(e,d),url:r,lineNumber:n,columnNumber:o,error:jMt(s||c||e),evt:jMt(c||e),typeName:d,stackDetails:tXr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Zse]&&PB(r[Zse],function(l){return Uvo(e,l)}),c=new t(e,px(px({},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&&PB(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[a1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=jMt,t})();var Bvo=Oh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function Fvo(){var t=this,e=ur(t[vz])&&PB(t[vz],function(n){return Hvo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[s1e],message:t[Jse],hasFullStack:t[a1e],stack:t[gx],parsedStack:e||void 0};return r}a(Fvo,"_toInterface");function rXr(t,e,r){var n,o,s,c,l,u,d,f;if(Dvo(e))c=e[s1e],l=e[Jse],d=e[gx],f=e[vz]||[],u=e[a1e];else{var h=e,m=h&&h.evt;wB(h)||(h=h[tae]||m||h),c=uu(t,BQe(h))||Yy,l=l1e(t,eXr(e||h,c))||Yy;var g=e[HMt]||tXr(e);f=Lvo(g),ur(f)&&PB(f,function(A){A[c1e]=uu(t,A[c1e]),A[bM]=uu(t,A[bM])}),d=NMt(t,Ovo(g)),u=ur(f)&&f[go]>0,r&&(r[s1e]=r[s1e]||c)}return n={},n[Xse]=Bvo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[a1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=Fvo,n}a(rXr,"_createExceptionDetails");function Uvo(t,e){var r=ur(e[vz])&&PB(e[vz],function(o){return jvo(o)})||e[vz],n=rXr(t,px(px({},e),{parsedStack:r}));return n}a(Uvo,"_createExDetailsFromInterface");function nXr(t,e){var r=e[Ez](wvo);if(r&&r[go]>=4)t[bM]=r[1],t[Cz]=parseInt(r[2]);else{var n=e[Ez](Rvo);n&&n[go]>=3?(t[bM]=n[1],t[Cz]=parseInt(n[2])):t[bM]=e}}a(nXr,"_parseFilename");function ZZr(t,e,r){var n=t[bM];e.fn&&r&&r[go]>e.fn&&(e.ln&&r[go]>e.ln?(n=Ni(r[e.fn]||""),t[Cz]=parseInt(Ni(r[e.ln]||""))||0):n=Ni(r[e.fn]||"")),n&&nXr(t,n)}a(ZZr,"_handleFilename");function Qvo(t){var e=!1;if(t&&Ei(t)){var r=Ni(t);r&&(e=bvo.test(r))}return e}a(Qvo,"_isStackFrame");var iXr=Oh({level:1,method:1,assembly:0,fileName:0,line:0});function qvo(t,e){var r,n;if(t&&Ei(t)&&Ni(t)){n=(r={},r[Xse]=iXr,r.level=e,r.assembly=Ni(t),r.method=zZr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Ni(c[s.m]||zZr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[bM]=Ni(c[s.fn]||""),n[Cz]=parseInt(Ni(c[s.ln]||""))||0):nXr(n,c[s.fn]||""));break}o++}}return oXr(n)}a(qvo,"_extractStackFrame");function jvo(t){var e,r=(e={},e[Xse]=iXr,e.level=t.level,e.method=t.method,e.assembly=t[c1e],e.fileName=t[bM],e.line=t[Cz],e.sizeInBytes=0,e);return oXr(r)}a(jvo,"_stackFrameFromInterface");function oXr(t){var e=Cvo;return t&&(e+=t.method[go],e+=t.assembly[go],e+=t.fileName[go],e+=t.level.toString()[go],e+=t.line.toString()[go],t[o1e]=e),t}a(oXr,"_populateFrameSizeInBytes");function Hvo(t){return{level:t.level,method:t.method,assembly:t[c1e],fileName:t[bM],line:t[Cz]}}a(Hvo,"_parsedFrameToInterface");p();p();var sXr=(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 HB=(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 sXr;h[FZr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Ky]=uu(e,r)||Yy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[_A]=w_(e,u),f[Jy]=R_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var d1e="";function FQe(t){(isNaN(t)||t<0)&&(t=0),t=sJr(t);var e=d1e+t%1e3,r=d1e+Y1(t/1e3)%60,n=d1e+Y1(t/(1e3*60))%60,o=d1e+Y1(t/(1e3*60*60))%24,s=Y1(t/(1e3*60*60*24));return e=e[go]===1?"00"+e:e[go]===2?"0"+e:e,r=r[go]<2?"0"+r:r,n=n[go]<2?"0"+n:n,o=o[go]<2?"0"+o:o,(s>0?s+".":d1e)+o+":"+n+":"+r+"."+e}a(FQe,"msToTimeSpan");var xz=(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=MMt(e,l),u.url=Sz(e,n),u[Ky]=uu(e,r)||Yy,isNaN(o)||(u[bz]=FQe(o)),u[_A]=w_(e,s),u[Jy]=R_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var wz=(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[bz]=FQe(s),g.success=c,g.resultCode=l+"",g.type=uu(e,d);var A=$Zr(e,n,u,o);g.data=Sz(e,o)||A.data,g.target=uu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Ky]=uu(e,A[Ky]),g[_A]=w_(e,h),g[Jy]=R_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var Rz=(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||Yy,c[Jse]=l1e(e,r),c[_A]=w_(e,o),c[Jy]=R_(e,s),n&&(c[_z]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var kz=(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=Sz(e,n),u[Ky]=uu(e,r)||Yy,u[_A]=w_(e,s),u[Jy]=R_(e,c),l&&(u.domProcessing=l.domProcessing,u[bz]=l[bz],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 GB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function d7(t){var e="ai."+t+".";return function(r){return e+r}}a(d7,"_aiNameFunc");var f1e=d7("application"),Xm=d7("device"),UQe=d7("location"),rae=d7("operation"),VMt=d7("session"),u7=d7("user"),Pz=d7("cloud"),p1e=d7("internal"),h1e=(function(t){zy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(HNt({applicationVersion:f1e("ver"),applicationBuild:f1e("build"),applicationTypeId:f1e("typeId"),applicationId:f1e("applicationId"),applicationLayer:f1e("layer"),deviceId:Xm("id"),deviceIp:Xm("ip"),deviceLanguage:Xm("language"),deviceLocale:Xm("locale"),deviceModel:Xm("model"),deviceFriendlyName:Xm("friendlyName"),deviceNetwork:Xm("network"),deviceNetworkName:Xm("networkName"),deviceOEMName:Xm("oemName"),deviceOS:Xm("os"),deviceOSVersion:Xm("osVersion"),deviceRoleInstance:Xm("roleInstance"),deviceRoleName:Xm("roleName"),deviceScreenResolution:Xm("screenResolution"),deviceType:Xm("type"),deviceMachineName:Xm("machineName"),deviceVMName:Xm("vmName"),deviceBrowser:Xm("browser"),deviceBrowserVersion:Xm("browserVersion"),locationIp:UQe("ip"),locationCountry:UQe("country"),locationProvince:UQe("province"),locationCity:UQe("city"),operationId:rae("id"),operationName:rae("name"),operationParentId:rae("parentId"),operationRootId:rae("rootId"),operationSyntheticSource:rae("syntheticSource"),operationCorrelationVector:rae("correlationVector"),sessionId:VMt("id"),sessionIsFirst:VMt("isFirst"),sessionIsNew:VMt("isNew"),userAccountAcquisitionDate:u7("accountAcquisitionDate"),userAccountId:u7("accountId"),userAgent:u7("userAgent"),userId:u7("id"),userStoreRegion:u7("storeRegion"),userAuthUserId:u7("authUserId"),userAnonymousUserAcquisitionDate:u7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:u7("authUserAcquisitionDate"),cloudName:Pz("name"),cloudRole:Pz("role"),cloudRoleVer:Pz("roleVer"),cloudRoleInstance:Pz("roleInstance"),cloudEnvironment:Pz("environment"),cloudLocation:Pz("location"),cloudDeploymentUnit:Pz("deploymentUnit"),internalNodeName:p1e("nodeName"),internalSdkVersion:p1e("sdkVersion"),internalAgentVersion:p1e("agentVersion"),internalSnippet:p1e("snippet"),internalSdkSrc:p1e("sdkSrc")}));p();var Fh=new h1e;p();function aXr(t,e){kMt(t,null,null,e)}a(aXr,"_disableEvents");function WMt(t){var e=pf(),r=Wu(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=e1e(nS("OfflineListener"),t);try{if(f(hf())&&(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=kQe(b,"online",y,u),T&&kQe(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,vt(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=hf();if(b&&n){if(aXr(b,u),e){var T=e.body||e;Nn(T.ononline)||aXr(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(WMt,"createOfflineListener");var QQe="AppInsightsChannelPlugin";p();p();p();p();p();var f7="duration";p();var Uh="tags",qQe="deviceType",yC="data",SM="name",Dz="traceID",Fo="length",p7="stringify",h7="measurements",Ax="dataType",m7="envelopeType",$B="toString",VB="enqueue",WB="count",yx="push",m1e="emitLineDelimitedJson",g7="clear",nae="markAsSent",Nz="clearSent",g1e="bufferOverride",iae="BUFFER_KEY",zB="SENT_BUFFER_KEY",A7="concat",oae="MAX_BUFFER_SIZE",sae="triggerSend",vA="diagLog",jQe="initialize",aae="_sender",cae="endpointUrl",lae="instrumentationKey",HQe="customHeaders",zMt="maxBatchSizeInBytes",GQe="onunloadDisableBeacon",$Qe="isBeaconApiDisabled",YMt="alwaysUseXhrOverride",KMt="enableSessionStorageBuffer",iP="_buffer",JMt="onunloadDisableFetch",ZMt="disableSendBeaconSplit",A1e="getSenderInst",y7="_onError",VQe="_onPartialSuccess",y1e="_onSuccess",WQe="itemsReceived",zQe="itemsAccepted",YQe="baseType",uae="sampleRate",cXr="getHashCodeScore";var XMt="baseType",Od="baseData",ig="properties",lXr="true";function Hp(t,e,r){return EM(t,e,r,W1)}a(Hp,"_setValueIf");function Gvo(t,e,r){var n=r[Uh]=r[Uh]||{},o=e.ext=e.ext||{},s=e[Uh]=e[Uh]||[],c=o.user;c&&(Hp(n,Fh.userAuthUserId,c.authId),Hp(n,Fh.userId,c.id||c.localId));var l=o.app;l&&Hp(n,Fh.sessionId,l.sesId);var u=o.device;u&&(Hp(n,Fh.deviceId,u.id||u.localId),Hp(n,Fh[qQe],u.deviceClass),Hp(n,Fh.deviceIp,u.ip),Hp(n,Fh.deviceModel,u.model),Hp(n,Fh[qQe],u[qQe]));var d=e.ext.web;if(d){Hp(n,Fh.deviceLanguage,d.browserLang),Hp(n,Fh.deviceBrowserVersion,d.browserVer),Hp(n,Fh.deviceBrowser,d.browser);var f=r[yC]=r[yC]||{},h=f[Od]=f[Od]||{},m=h[ig]=h[ig]||{};Hp(m,"domain",d.domain),Hp(m,"isManual",d.isManual?lXr:null),Hp(m,"screenRes",d.screenRes),Hp(m,"userConsent",d.userConsent?lXr:null)}var g=o.os;g&&(Hp(n,Fh.deviceOS,g[SM]),Hp(n,Fh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Hp(n,Fh.operationParentId,A.parentID),Hp(n,Fh.operationName,uu(t,A[SM])),Hp(n,Fh.operationId,A[Dz]));for(var y={},E=s[Fo]-1;E>=0;E--){var _=s[E];Yr(_,function(b,T){y[b]=T}),s.splice(E,1)}Yr(s,function(b,T){y[b]=T});var v=px(px({},n),y);v[Fh.internalSdkVersion]||(v[Fh.internalSdkVersion]=uu(t,"javascript:".concat($vo.Version),64)),r[Uh]=aQe(v)}a(Gvo,"_extractPartAExtensions");function E7(t,e,r){Xt(t)||Yr(t,function(n,o){Mh(o)?r[n]=o:Ei(o)?e[n]=o:t7()&&(e[n]=x_()[p7](o))})}a(E7,"_extractPropsAndMeasurements");function Mz(t,e){Xt(t)||Yr(t,function(r,n){t[r]=n||e})}a(Mz,"_convertPropsUndefinedToCustomDefinedValue");function Oz(t,e,r,n){var o=new qMt(t,n,e);Hp(o,"sampleRate",r[t1e]),(r[Od]||{}).startTime&&(o.time=e7(r[Od].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[SM]=o[SM].replace("{0}",s),Gvo(t,r,o),r[Uh]=r[Uh]||[],aQe(o)}a(Oz,"_createEnvelope");function Lz(t,e){Xt(e[Od])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(Lz,"EnvelopeCreatorInit");var $vo={Version:"3.3.11"};function uXr(t,e,r){Lz(t,e);var n=e[Od][h7]||{},o=e[Od][ig]||{};E7(e[yC],o,n),Xt(r)||Mz(o,r);var s=e[Od];if(Xt(s))return QB(t,"Invalid input for dependency data"),null;var c=s[ig]&&s[ig][PQe]?s[ig][PQe]:"GET",l=new wz(t,s.id,s.target,s[SM],s[f7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new GB(wz[Ax],l);return Oz(t,wz[m7],e,u)}a(uXr,"DependencyEnvelopeCreator");function eOt(t,e,r){Lz(t,e);var n={},o={};e[XMt]!==jB[Ax]&&(n.baseTypeSource=e[XMt]),e[XMt]===jB[Ax]?(n=e[Od][ig]||{},o=e[Od][h7]||{}):e[Od]&&E7(e[Od],n,o),E7(e[yC],n,o),Xt(r)||Mz(n,r);var s=e[Od][SM],c=new jB(t,s,n,o),l=new GB(jB[Ax],c);return Oz(t,jB[m7],e,l)}a(eOt,"EventEnvelopeCreator");function dXr(t,e,r){Lz(t,e);var n=e[Od][h7]||{},o=e[Od][ig]||{};E7(e[yC],o,n),Xt(r)||Mz(o,r);var s=e[Od],c=Iz.CreateFromInterface(t,s,o,n),l=new GB(Iz[Ax],c);return Oz(t,Iz[m7],e,l)}a(dXr,"ExceptionEnvelopeCreator");function fXr(t,e,r){Lz(t,e);var n=e[Od],o=n[ig]||{},s=n[h7]||{};E7(e[yC],o,s),Xt(r)||Mz(o,r);var c=new HB(t,n[SM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new GB(HB[Ax],c);return Oz(t,HB[m7],e,l)}a(fXr,"MetricEnvelopeCreator");function pXr(t,e,r){Lz(t,e);var n,o=e[Od];!Xt(o)&&!Xt(o[ig])&&!Xt(o[ig][f7])?(n=o[ig][f7],delete o[ig][f7]):!Xt(e[yC])&&!Xt(e[yC][f7])&&(n=e[yC][f7],delete e[yC][f7]);var s=e[Od],c;((e.ext||{}).trace||{})[Dz]&&(c=e.ext.trace[Dz]);var l=s.id||c,u=s[SM],d=s.uri,f=s[ig]||{},h=s[h7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[$B]()),!Xt(s[ig])){var m=s[ig];Yr(m,function(y,E){f[y]=E})}E7(e[yC],f,h),Xt(r)||Mz(f,r);var g=new xz(t,u,d,n,f,h,l),A=new GB(xz[Ax],g);return Oz(t,xz[m7],e,A)}a(pXr,"PageViewEnvelopeCreator");function hXr(t,e,r){Lz(t,e);var n=e[Od],o=n[SM],s=n.uri||n.url,c=n[ig]||{},l=n[h7]||{};E7(e[yC],c,l),Xt(r)||Mz(c,r);var u=new kz(t,o,s,void 0,c,l,n),d=new GB(kz[Ax],u);return Oz(t,kz[m7],e,d)}a(hXr,"PageViewPerformanceEnvelopeCreator");function mXr(t,e,r){Lz(t,e);var n=e[Od].message,o=e[Od].severityLevel,s=e[Od][ig]||{},c=e[Od][h7]||{};E7(e[yC],s,c),Xt(r)||Mz(s,r);var l=new Rz(t,n,o,s,c),u=new GB(Rz[Ax],l);return Oz(t,Rz[m7],e,u)}a(mXr,"TraceEnvelopeCreator");p();var gXr=(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},Si(t,this,function(c){c[VB]=function(l){if(c[WB]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[WB](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[yx](l)},c[WB]=function(){return n[Fo]},c.size=function(){for(var l=n[Fo],u=0;u0){var u=[];vt(l,function(f){u[yx](f.item)});var d=r[m1e]?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 tOt(l,u):new KQe(l,u);return vt(f,function(m){h[VB](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),KQe=(function(t){zy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[nae]=function(l){c[g7]()},s[Nz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(gXr);var Vvo=["AI_buffer","AI_sentBuffer"],tOt=(function(t){zy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[g1e]||{getItem:FMt,setItem:UMt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[iae]),y=T(e[zB]),E=x(),_=y[A7](E),v=m._set(A[A7](_));v[Fo]>e[oae]&&(v[Fo]=e[oae]),R(e[zB],[]),R(e[iae],v),m[VB]=function(D){if(m[WB]()>=e[oae]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[WB](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[VB](D),R(e[iae],m._get()))},m[g7]=function(){g[g7](),R(e[iae],m._get()),R(e[zB],[]),c=!1},m[nae]=function(D){R(e[iae],m._set(b(D,m._get())));var N=T(e[zB]);N instanceof Array&&D instanceof Array&&(N=N[A7](D),N[Fo]>e[oae]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Fo],!0),N[Fo]=e[oae]),R(e[zB],N))},m[Nz]=function(D){var N=T(e[zB]);N=b(D,N),R(e[zB],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),q=T(e[zB]).slice(0);D=D||n,N=N||{},m[g7]();var M=L?new e(D,N):new KQe(D,N);return vt(B,function(O){M[VB](O)}),L&&M[nae](q),M};function b(D,N){var L=[],B=[];return vt(D,function(q){B[yx](q.item)}),vt(N,function(q){!Or(q)&&Wo(B,q.item)===-1&&L[yx](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=x_().parse(N);if(Ei(L)&&(L=x_().parse(L)),L&&ur(L))return L}}catch(B){Wr(n,1,42," storage key: "+D+", "+jp(B),{exception:dr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[p7](N);f(n,L,B)}catch(q){f(n,L,JSON[p7]([])),Wr(n,2,41," storage key: "+L+", "+jp(q)+". Buffer cleared",{exception:dr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return vt(Vvo,function(N){var L=P(N);if(D=D[A7](L),l){var B=l+"_"+N,q=P(B);D=D[A7](q)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+jp(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return vt(N,function(B){var q={item:B,cnt:0};L[yx](q)}),QMt(n,D),L}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})(gXr);p();var AXr=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return x_()[p7](l)}catch(u){Wr(e,1,48,u&&Or(u[$B])?u[$B]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Wr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Wr(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(ur(c))d=o(c,l);else{Wr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{x_()[p7](c),d=c}catch(f){Wr(e,1,48,f&&Or(f[$B])?f[$B]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Yr(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=$u(c[f])&&c[f]!==null;if(m&&!y&&!A)Wr(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(!ur(c))Wr(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[uae]=e,this.samplingScoreGenerator=new EXr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[uae],n=!1;return r==null||r>=100||e.baseType===HB[Ax]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Kvo,"_chkSampling");var Jvo=(YB={},YB[jB.dataType]=eOt,YB[Rz.dataType]=mXr,YB[xz.dataType]=pXr,YB[kz.dataType]=hXr,YB[Iz.dataType]=dXr,YB[HB.dataType]=fXr,YB[wz.dataType]=uXr,YB),rOt=(function(t){zy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=QQe;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,L,B,q,M,O,j,Q,U,Y,W,V,z,ie;return Si(e,r,function(H,re){Ge(),H.pause=function(){pe(),c=!0},H.resume=function(){c&&(c=!1,o=null,rt(),Qe())},H.flush=function(J,se,me){if(J===void 0&&(J=!0),!c){pe();try{var Ce=H[sae](J,null,me||1);return vl(Ce,function(He){return se?(se(!He.rejected),!0):J?Md(function($e){$e(!He.rejected)}):Ce})}catch(He){Wr(H[vA](),1,22,"flush failed, telemetry will not be collected: "+jp(He),{exception:dr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[sae](!0,Dt,2)}catch(J){Wr(H[vA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+jp(J),{exception:dr(J)})}else H.flush(!1)},H.addHeader=function(J,se){f[J]=se},H[jQe]=function(J,se,me,Ce){H.isInitialized()&&Wr(H[vA](),1,28,"Sender is already initialized"),re[jQe](J,se,me,Ce);var He=H.identifier;u=new AXr(se.logger),n=0,o=null,s=0,H[aae]=null,d=0;var $e=H[vA]();A=e1e(nS("Sender"),se.evtNamespace&&se.evtNamespace()),g=WMt(A),H._addHook(hx(J,function(et){var ct=et.cfg;ct.storagePrefix&&BMt(ct.storagePrefix);var Ct=rP(null,ct,se),ht=Ct.getExtCfg(He,bXr),We=ht[cae];if(y&&We===y){var ae=ct[cae];ae&&ae!==We&&(ht[cae]=ae)}var Re=Di("CompressionStream");ie=GNt("zipPayload",ct,!1),Or(Re)||(ie=!1);var Oe=ht.corsPolicy;Oe?(Oe==="same-origin"||Oe==="same-site"||Oe==="cross-origin")&&r.addHeader(SXr,Oe):delete f[SXr],rg(ht[lae])&&(ht[lae]=ct[lae]),ji(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[cae]&&(y=E=ht[cae]),se.activeStatus()===Jk.PENDING?H.pause():se.activeStatus()===Jk.ACTIVE&&H.resume(),w&&w!==ht[HQe]&&vt(w,function(_r){delete f[_r.header]}),_=ht[zMt],v=(ht[GQe]===!1||ht[$Qe]===!1)&&r7(),b=ht[GQe]===!1&&r7(),T=ht[$Qe]===!1&&r7(),O=ht[YMt],j=!!ht.disableXhr,z=ht.retryCodes;var ye=ht[g1e],oe=!!ht[KMt]&&(!!ye||LQe()),ze=ht.namePrefix,at=oe!==L||oe&&q!==ze||oe&&B!==ye;if(H[iP]){if(at)try{H[iP]=H[iP].createNew($e,ht,oe)}catch(_r){Wr(H[vA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+jp(_r),{exception:dr(_r)})}rt()}else H[iP]=oe?new tOt($e,ht):new KQe($e,ht);q=ze,L=oe,B=ye,Q=!ht[JMt]&&Qbe(!0),W=!!ht[ZMt],H._sample=new _Xr(ht.samplingPercentage,$e),x=ht[lae],!rg(x)&&!Te(x,ct)&&Wr($e,1,100,"Invalid Instrumentation key "+x),w=ht[HQe],Ei(y)&&!MQe(y)&&w&&w[Fo]>0?vt(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var Vt=Le();V?V.SetConfig(Vt):(V=new xMt,V[jQe](Vt,$e));var gr=ht.httpXHROverride,cr=null,Mr=null,Hr=lQe([3,1,2],ht.transports);cr=V&&V[A1e](Hr,!1);var Gr=V&&V.getFallbackInst();U=a(function(_r,V0){return Me(Gr,_r,V0)},"_xhrSend"),Y=a(function(_r,V0){return Me(Gr,_r,V0,!1)},"_fallbackSend"),cr=O?gr:cr||gr||Gr,H[aae]=function(_r,V0){return Me(cr,_r,V0)},Q&&(m=Ie);var Yt=lQe([3,1],ht.unloadTransports);Q||(Yt=Yt.filter(function(_r){return _r!==2})),Mr=V&&V[A1e](Yt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,V0){return Me(Mr,_r,V0)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||oP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(J,se){se=H._getTelCtx(se);var me=se[vA]();try{var Ce=K(J,me);if(!Ce)return;var He=he(J,me);if(!He)return;var $e=u.serialize(He),et=H[iP];rt($e);var ct={item:$e,cnt:0};et[VB](ct),Qe()}catch(Ct){Wr(me,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+jp(Ct),{exception:dr(Ct)})}H.processNext(J,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[WB]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,se,me){if(!Gt(se))return ge(J,se,me)},H[sae]=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!c)try{var He=H[iP];if(R)He[g7]();else{if(He[WB]()>0){var $e=He.getItems();te(me||0,J),se?Ce=se.call(H,$e,J):Ce=H[aae]($e,J)}s=+new Date}pe()}catch(ct){var et=eMt();(!et||et>9)&&Wr(H[vA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+jp(ct),{exception:dr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:Z,batch:ue,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,se){H.onunloadFlush(),UB(g,!1),Ge()},H[y7]=function(J,se,me){if(!Gt(J))return Ue(J,se,me)},H[VQe]=function(J,se){if(!Gt(J))return ke(J,se)},H[y1e]=function(J,se){if(!Gt(J))return X(J,se)},H._xdrOnLoad=function(J,se){if(!Gt(se))return le(J,se)};function le(J,se){var me=CXr(J);if(J&&(me+""=="200"||me===""))n=0,H[y1e](se,0);else{var Ce=Xbe(me);Ce&&Ce[WQe]&&Ce[WQe]>Ce[zQe]&&!D?H[VQe](se,Ce):H[y7](se,Bbe(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return le(me,$e)},"xdrOnComplete"),fetchOnComplete:a(function(me,Ce,He,$e){var et=ee($e);if(et)return st(me.status,et,me.url,et[Fo],me.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ge(me,$e,$e[Fo])},"xhrOnComplete"),beaconOnRetry:a(function(me,Ce,He){return $t(me,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:j,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:J};return se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(J,se,me){J.readyState===4&&st(J.status,se,J.responseURL,me,pz(J),CXr(J)||J.response)}a(ge,"_xhrReadyStateChange");function Ue(J,se,me){Wr(H[vA](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[Nz](J)}a(Ue,"_onError");function ke(J,se){for(var me=[],Ce=[],He=se.errors.reverse(),$e=0,et=He;$e0&&H[y1e](J,se[zQe]),me[Fo]>0&&H[y7](me,pz(null,["partial success",se[zQe],"of",se.itemsReceived].join(" "))),Ce[Fo]>0&&(F(Ce),Wr(H[vA](),2,40,"Partial success. Delivered: "+J[Fo]+", Failed: "+me[Fo]+". Will retry to send "+Ce[Fo]+" our of "+se[WQe]+" items"))}a(ke,"_onPartialSuccess");function X(J,se){H._buffer&&H._buffer[Nz](J)}a(X,"_onSuccess");function ee(J){try{if(J){var se=J,me=se.oriPayload;return me&&me[Fo]?me:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,se){if(R)return!1;if(!J)return se&&Wr(se,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[YQe])return se&&Wr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[YQe]||(J[YQe]="EventData"),!H[aae])return se&&Wr(se,1,28,"Sender was not initialized"),!1;if(ne(J))J[t1e]=H._sample[uae];else return se&&Wr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[uae]}),!1;return!0}a(K,"_validate");function he(J,se){var me=J.iKey||x,Ce=e.constructEnvelope(J,me,se,P);if(!Ce){Wr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(J[Uh]&&J[Uh][r1e]&&(vt(J[Uh][r1e],function($e){try{$e&&$e(Ce)===!1&&(He=!0,QB(se,"Telemetry processor check returns false"))}catch(et){Wr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+jp(et),{exception:dr(et)},!0)}}),delete J[Uh][r1e]),!He)return Ce}a(he,"_getEnvelope");function Z(J){var se=vXr,me=H[vA]();try{var Ce=K(J,me),He=null;Ce&&(He=he(J,me)),He&&(se=u.serialize(He))}catch{}return se}a(Z,"_serialize");function ue(J){var se=vXr;return J&&J[Fo]&&(se="["+J.join(",")+"]"),se}a(ue,"_batch");function qe(J){var se=Be();return{urlString:y,data:J,headers:se}}a(qe,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ce(J,se,me,Ce){se===200&&J?H._onSuccess(J,J[Fo]):Ce&&H[y7](J,Ce)}a(ce,"_getOnComplete");function Me(J,se,me,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ae,Re,Oe){return ce(se,ae,Re,Oe)},"onComplete"),$e=we(se),et=J&&J.sendPOST;if(et&&$e){Ce&&H._buffer[nae](se);var ct,Ct=!1,ht,We;return V.preparePayload(function(ae){ct=et(ae,He,!me),Ct=!0,ht&&J7e(ct,ht,We)},ie,$e,!me),Ct?ct:Md(function(ae,Re){ht=ae,We=Re})}return null}a(Me,"_doSend");function we(J){if(ur(J)&&J[Fo]>0){var se=H[iP].batchPayloads(J),me=Be(),Ce={data:se,urlString:y,headers:me,disableXhrSync:j,disableFetchKeepAlive:!Q,oriPayload:J};return Ce}return null}a(we,"_getPayload");function Be(){try{var J=f||{};return MQe(y)&&(J[DQe[6]]=DQe[7]),J}catch{}return null}a(Be,"_getHeaders");function rt(J){var se=J?J[Fo]:0;return H[iP].size()+se>_?((!g||g.isOnline())&&H[sae](!0,null,10),!0):!1}a(rt,"_checkMaxSize");function st(J,se,me,Ce,He,$e){var et=null;if(H._appId||(et=Xbe($e),et&&et.appId&&(H._appId=et.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!Et(me)){H[y7](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Wr(H[vA](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(J)?(F(se),Wr(H[vA](),2,40,". Response code "+J+". Will retry to send "+se[Fo]+" items.")):H[y7](se,He)}else Et(me),J===206?(et||(et=Xbe($e)),et&&!D?H[VQe](se,et):H[y7](se,He)):(n=0,H[y1e](se,Ce))}a(st,"_checkResponsStatus");function Et(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(Et,"_checkAndUpdateEndPointUrl");function Dt(J,se){if(m)m(J,!1);else{var me=V&&V[A1e]([3],!0);return Me(me,J,se)}}a(Dt,"_doUnloadSend");function $t(J,se,me){var Ce=J,He=Ce&&Ce.oriPayload;if(W)Y&&Y(He,!0),Wr(H[vA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],et=0;et0&&(Y&&Y($e,!0),Wr(H[vA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(J){try{if(J&&J[Fo])return Ei(J[0])}catch{}return null}a(Gt,"_isStringArr");function Ie(J,se){var me=null;if(ur(J)){for(var Ce=J[Fo],He=0;He-1}a(Se,"_isRetriable");function Fe(){var J="getNotifyMgr",se,me=H.core;return me&&(me[J]?se=me[J]():se=me._notificationManager),se}a(Fe,"_getNotifyMgr");function te(J,se){var me=Fe();if(me&&me.eventsSendRequest)try{me.eventsSendRequest(J,se)}catch(Ce){Wr(H[vA](),1,74,"send request notification failed: "+jp(Ce),{exception:dr(Ce)})}}a(te,"_notifySendRequest");function Te(J,se){var me=se.disableInstrumentationKeyValidation,Ce=Xt(me)?!1:me;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(J)}a(Te,"_validateInstrumentationKey");function Ge(){H[aae]=null,H[iP]=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=oP,D=!1,L=null,q=oP,j=!1,Q=!1,W=!1,U=null,Y=null,V=null,ji(H,"_senderConfig",{g:a(function(){return cQe({},bXr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=px(px({},r),{iKey:n}):c=r;var l=Jvo[c.baseType]||eOt;return l(o,c,s)},e})(Zbe);p();var Bz="instrumentationKey",E1e="connectionString",dae="endpointUrl",fae="userOverrideEndpointUrl";var Fz,nOt,iOt=void 0,Zvo=(Fz={diagnosticLogInterval:Vse(Xvo,1e4)},Fz[E1e]=iOt,Fz.endpointUrl=iOt,Fz[Bz]=iOt,Fz.featureOptIn=(nOt={},nOt.zipPayload={mode:1},nOt),Fz.extensionConfig={},Fz);function Xvo(t){return t&&t>0}a(Xvo,"_chkDiagLevel");var TXr=(function(){function t(e){var r=new TMt,n;(Xt(e)||Xt(e[Bz])&&Xt(e[E1e]))&&Zc("Invalid input configuration"),Si(t,this,function(s){ji(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,fz(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Bh(e||{},Zvo);n=l.cfg,r.addUnloadHook(hx(l,function(){var u=n[E1e];if(rg(u)){var d=Mbe(function(g,A){vl(u,function(y){var E=y.value,_=n[Bz];if(!y.rejected&&E){n[E1e]=E;var v=u1e(E);_=v.instrumentationkey||_}g(_)})}),f=Mbe(function(g,A){vl(u,function(y){var E=y.value,_=n[dae];if(!y.rejected&&E){var v=u1e(E),b=v.ingestionendpoint;_=b?b+CM:_}g(_)})});n[Bz]=d,n[dae]=n[fae]||f}if(Ei(u)){var h=u1e(u),m=h.ingestionendpoint;n[dae]=n[fae]?n[fae]:m+CM,n[Bz]=h.instrumentationkey||n[Bz]}n[dae]=n[fae]?n[fae]:n[dae]})),r.initialize(n,[new rOt])}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 iS=de(require("os"));var pae=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.onCopilotToken=a(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";let o={method:"POST",headers:n,body:e.data};this.ctx.get(nr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new TXr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[QQe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:eCo(e),this.commonProperties=n?.excludeCommonProperties?{}:tCo(e),this.#e=bs(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 eCo(t){let e={},r=t.get(Qa);e["ai.session.id"]=r.sessionId;let n=t.get(Bp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${iS.type()} ${iS.release()}`,e["ai.device.osArchitecture"]=iS.arch(),e["ai.device.osPlatform"]=iS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(eCo,"getTags");function tCo(t){let e={};e.common_os=iS.platform(),e.common_platformversion=iS.release(),e.common_arch=iS.arch(),e.common_cpu=Array.from(new Set(iS.cpus().map(n=>n.model))).join();let r=t.get(Qa);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(tCo,"getCommonProperties");p();p();p();p();p();p();var _1e=R7e;var TM=_1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var _7=_1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Uz="toLowerCase",In="length",hae="warnToConsole",KB="throwInternal",IM="watch",v7="apply",ro="push",Ex="splice",Yu="logger",xM="cancel",JB="initialize",wM="identifier",mae="removeNotificationListener",gae="addNotificationListener",EC="isInitialized",v1e="getNotifyMgr",C7="getPlugin",sP="name",e0="processNext",JQe="getProcessTelContext",ZB="value",b7="enabled",oOt="stopPollingInternalLogs",_x="unload",C1e="onComplete",ZQe="version",XQe="loggingLevelConsole",RM="createNew",oS="teardown",Aae="messageId",kM="message",_C="diagLog",S7="_doTeardown",Qz="update",sS="getNext",T7="setNextPlugin",b1e="userAgent",XB="split",aP="replace",sOt="substring",eqe="indexOf",e3="type",aOt="evtName",cP="status",cOt="getAllResponseHeaders",S1e="isChildEvt",aS="data",qz="getCtx",lP="setCtx";var T1e="headers",yae="urlString",jz="timeout";var tqe="traceFlags";var lOt;function IXr(t,e){lOt||(lOt=Ebe("AggregationError",function(n,o){o[In]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw vt(e,function(n,o){r+=` +`.concat(o," > ").concat(dr(n))}),new lOt(r,e||[])}a(IXr,"throwAggregationError");p();p();p();p();p();var cS=void 0,Ss="",Hz="channels",Kf="core",rqe="createPerfMgr",I1e="disabled",t3="extensionConfig",Gz="extensions",vC="processTelemetry",$z="priority",Eae="eventsSent",I7="eventsDiscarded",_ae="eventsSendRequest",PM="perfEvent",nqe="offlineEventsStored",iqe="offlineBatchSent",oqe="offlineBatchDrop",vae="getPerfMgr",sqe="domain",aqe="path",xXr="Not dynamic - ";var rCo="getPrototypeOf",nCo=/-([a-z])/g,iCo=/([^\w\d_$])/g,oCo=/^(\d+[\w\d_$])/,c3l=Object[rCo];function x7(t){return!Xt(t)}a(x7,"isNotNullOrUndefined");function Cae(t){var e=t;return e&&Ei(e)&&(e=e[aP](nCo,function(r,n){return n.toUpperCase()}),e=e[aP](iCo,"_"),e=e[aP](oCo,function(r,n){return"_"+n})),e}a(Cae,"normalizeJsName");function og(t,e){return t&&e?lu(t,e)!==-1:!1}a(og,"strContains");function bae(t){return t&&t.toISOString()||""}a(bae,"toISOString");function Sae(t){return wB(t)?t[sP]:Ss}a(Sae,"getExceptionName");function r3(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(r3,"setValue");function cqe(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(cqe,"getSetValue");function sCo(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][v7](n,o)}}a(sCo,"_createProxyFunction");function w7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=sCo(r,n))}a(w7,"proxyFunctionAs");function R7(t,e,r,n){return t&&e&&$u(t)&&ur(r)&&vt(r,function(o){Ei(o)&&w7(t,o,e,o,n)}),t}a(R7,"proxyFunctions");function DM(t){return t&&RB&&(t=JU(RB({},t))),t}a(DM,"optimizeObject");function lqe(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(lqe,"isFeatureEnabled");function NM(t){try{return t.responseText}catch{}return null}a(NM,"getResponseText");function uqe(t,e){return t?"XDomainRequest,Response:"+NM(t)||"":e}a(uqe,"formatErrorMessageXdr");function w1e(t,e){return t?"XMLHttpRequest,Status:"+t[cP]+",Response:"+NM(t)||t.response||"":e}a(w1e,"formatErrorMessageXhr");function R1e(t,e){return e&&(Mh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(R1e,"prependTransports");var aCo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",wXr="withCredentials",cCo="timeout";function uOt(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,aCo,n),r&&c(l,wXr,r),l.open(t,e,!o),r&&c(l,wXr,r),!o&&s&&c(l,cCo,s),l}a(uOt,"openXhr");function dOt(t){var e={};if(Ei(t)){var r=Ni(t)[XB](/[\r\n]+/);vt(r,function(n){if(n){var o=n[eqe](": ");if(o!==-1){var s=Ni(n.substring(0,o))[Uz](),c=Ni(n[sOt](o+1));e[s]=c}else e[Ni(n)]=1}})}return e}a(dOt,"convertAllHeadersToMap");function x1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Ni(n))}return t}a(x1e,"_appendHeader");var lCo="kill-duration",uCo="kill-duration-seconds",dCo="time-delta-millis";function k7(t,e){var r={};return t[cOt]?r=dOt(t[cOt]()):e&&(r=x1e(r,t,dCo),r=x1e(r,t,lCo),r=x1e(r,t,uCo)),r}a(k7,"_getAllResponseHeaders");p();p();var fCo="location",pCo="console",RXr="JSON",hCo="crypto",mCo="msCrypto",gCo="ReactNative",ACo="msie",yCo="trident/",kXr="XMLHttpRequest",fOt=null,pOt=null,ECo=!1,Tae=null,hOt=null;function PXr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[tS];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(PXr,"_hasProperty");function Iae(t){if(t&&ECo){var e=Di("__mockLocation");if(e)return e}return typeof location===fx&&location?location:Di(fCo)}a(Iae,"getLocation");function dqe(){return typeof console!==eS?console:Di(pCo)}a(dqe,"getConsole");function k1e(){return!!(typeof JSON===fx&&JSON||Di(RXr)!==null)}a(k1e,"hasJSON");function fqe(){return k1e()?JSON||Di(RXr):null}a(fqe,"getJSON");function pqe(){return Di(hCo)}a(pqe,"getCrypto");function hqe(){return Di(mCo)}a(hqe,"getMsCrypto");function xae(){var t=Wu();return t&&t.product?t.product===gCo:!1}a(xae,"isReactNative");function Vz(){var t=Wu();if(t&&(t[b1e]!==pOt||fOt===null)){pOt=t[b1e];var e=(pOt||Ss)[Uz]();fOt=og(e,ACo)||og(e,yCo)}return fOt}a(Vz,"isIE");function wae(t){return(hOt===null||t===!1)&&(hOt=tz()&&!!Wu().sendBeacon),hOt}a(wae,"isBeaconsSupported");function Rae(t){var e=!1;try{e=!!Di("fetch");var r=Di("Request");e&&t&&r&&(e=PXr(r,"keepalive"))}catch{}return e}a(Rae,"isFetchSupported");function mqe(){return Tae===null&&(Tae=typeof XDomainRequest!==eS,Tae&&P1e()&&(Tae=Tae&&!PXr(Di(kXr),"withCredentials"))),Tae}a(mqe,"useXDomainRequest");function P1e(){var t=!1;try{var e=Di(kXr);t=!!e}catch{}return t}a(P1e,"isXhrSupported");var DXr=4294967296,Wz=4294967295,NXr=123456789,MXr=987654321,OXr=!1,D1e=NXr,N1e=MXr;function _Co(t){t<0&&(t>>>=0),D1e=NXr+t&Wz,N1e=MXr-t&Wz,OXr=!0}a(_Co,"_mwcSeed");function vCo(){try{var t=_l()&2147483647;_Co((Math.random()*DXr^t)+t)}catch{}}a(vCo,"_autoSeedMwc");function mOt(t){var e=0,r=pqe()||hqe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Wz),e===0&&Vz()&&(OXr||vCo(),e=CCo()&Wz),e===0&&(e=Y1(DXr*Math.random()|0)),t||(e>>>=0),e}a(mOt,"random32");function CCo(t){N1e=36969*(N1e&65535)+(N1e>>16)&Wz,D1e=18e3*(D1e&65535)+(D1e>>16)&Wz;var e=(N1e<<16)+(D1e&65535)>>>0&Wz|0;return t||(e>>>=0),e}a(CCo,"mwcRandom32");function gOt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=mOt()>>>0,n=0,o=Ss;o[In]>>=6,n===5&&(r=(mOt()<<2&4294967295|r&3)>>>0,n=0);return o}a(gOt,"newId");var LXr="3.3.10",bCo="."+gOt(6),SCo=0;function BXr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(BXr,"_canAcceptData");function TCo(t,e){var r=e[t.id];if(!r){r={};try{BXr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(TCo,"_getCache");function vx(t,e){return e===void 0&&(e=!1),Cae(t+SCo+++(e?"."+LXr:Ss)+bCo)}a(vx,"createUniqueNamespace");function gqe(t){var e={id:vx("_aiData-"+(t||Ss)+"."+LXr),accept:a(function(r){return BXr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Cae(n)]:(s&&(c=TCo(e,r),c[Cae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(gqe,"createElmNodeData");p();function Aqe(t){return t&&$u(t)&&!ur(t)&&(t.isVal||t.fb||EA(t,"v")||EA(t,"mrg")||EA(t,"ref")||t.set)}a(Aqe,"_isConfigDefaults");function FXr(t,e,r){var n,o=r.dfVal||Ise;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&IXr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[In]>0){c||(c=[]),l||(l=qp(function(){l=null,f()},0));for(var A=0;A0?vl(Pae(t[0],e),function(){vOt($U(t,1),e,r)}):r(),n}a(vOt,"doUnloadAll");p();var qXr=500,COt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function jXr(t){return{mrg:!0,v:t}}a(jXr,"cfgDfMerge");p();p();var bOt=[Eae,I7,_ae,PM],bqe=null,Cqe;function NCo(t,e){return function(){var r=arguments,n=SOt(e);if(n){var o=n.listener;o&&o[t]&&o[t][v7](o,r)}}}a(NCo,"_listenerProxyFunc");function MCo(){var t=Di("Microsoft");return t&&(bqe=t.ApplicationInsights),bqe}a(MCo,"_getExtensionNamespace");function SOt(t){var e=bqe;return!e&&t.disableDbgExt!==!0&&(e=bqe||MCo()),e?e.ChromeDbgExt:null}a(SOt,"getDebugExt");function HXr(t){if(!Cqe){Cqe={};for(var e=0;e=A&&(d[T](b[kM]),n[w]=!0)}else o>=A&&d[T](b[kM]);f(A,b)}},d.debugToConsole=function(A){TOt("debug",A),g("warning",A)},d[hae]=function(A){TOt("warn",A),g("warning",A)},d.errorToConsole=function(A){TOt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[_x]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=BCo+y[Aae];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 Nae(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[hae](v)}}}a(f,"_logInternalMessage");function h(A){return lS(Gp(A,FCo,d).cfg,function(y){var E=y.cfg;o=E[XQe],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=SOt(e||{});E&&E[_C]&&E[_C](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function VXr(t){return t||new zz}a(VXr,"_getLogger");function ka(t,e,r,n,o,s){s===void 0&&(s=!1),VXr(t)[KB](e,r,n,o,s)}a(ka,"_throwInternal");function OM(t,e){VXr(t)[hae](e)}a(OM,"_warnToConsole");var IOt,P7,WXr="toGMTString",zXr="toUTCString",ROt="cookie",xOt="expires",YXr="isCookieUseDisabled",Q1e="disableCookiesUsage",KXr="_ckMgr",Sqe=null,wOt=null,JXr=null,LM,ZXr={},XXr={},QCo=(IOt={cookieCfg:jXr((P7={},P7[sqe]={fb:"cookieDomain",dfVal:x7},P7.path={fb:"cookiePath",dfVal:x7},P7.enabled=cS,P7.ignoreCookies=cS,P7.blockedCookies=cS,P7.disableCookieDefer=!1,P7)),cookieDomain:cS,cookiePath:cS},IOt[Q1e]=cS,IOt);function kOt(){!LM&&(LM=P7e(function(){return pf()}))}a(kOt,"_getDoc");function Tqe(t){return t?t.isEnabled():!0}a(Tqe,"_isMgrEnabled");function oen(t,e){return e&&t&&ur(t.ignoreCookies)?Wo(t.ignoreCookies,e)!==-1:!1}a(oen,"_isIgnoredCookie");function een(t,e){return e&&t&&ur(t.blockedCookies)&&Wo(t.blockedCookies,e)!==-1?!0:oen(t,e)}a(een,"_isBlockedCookie");function ten(t,e){var r=e[b7];if(Xt(r)){var n=void 0;Nn(t[YXr])||(n=!t[YXr]),Nn(t[Q1e])||(n=!t[Q1e]),r=n}return r}a(ten,"_isCfgEnabled");function POt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[aqe]=E||"/",_[xOt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Vz()||(v["max-age"]="0"),nen(Ss,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||Ss),R=lu(w,";");if(R!==-1&&(w=Ni(dM(E,R)),T=sen(zf(E,R+1))),r3(T,sqe,v||o,W1,Nn),!Xt(_)){var x=Vz();if(Nn(T[xOt])){var P=_l(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),r3(T,xOt,ren(N,x?WXr:zXr)||ren(N,x?WXr:zXr)||Ss,W1)}}x||r3(T,"max-age",Ss+_,null,Nn)}var L=Iae();return L&&L.protocol==="https:"&&(r3(T,"secure",null,null,Nn),wOt===null&&(wOt=!aen((Wu()||{})[b1e])),wOt&&r3(T,"SameSite","None",null,Nn)),r3(T,aqe,b||n,null,Nn),nen(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[In]-1;_>=0;_--)f[_].n===E&&f[Ex](_,1)}a(g,"_removePendingCookie");function A(){U1e(e)&&f&&(vt(f,function(E){een(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Gp(t||XXr,null,e).cfg,s=lS(t,function(E){E.setDf(E.cfg,QCo),r=E.ref(E.cfg,"cookieCfg"),n=r[aqe]||"/",o=r[sqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=ten(t,r)!==!1,l=r.getCookie||qCo,u=r.setCookie||ien,d=r.delCookie||ien,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=ten(t,r)!==!1&&c&&U1e(e),_=XXr[KXr];return E&&_&&y!==_&&(E=Tqe(_)),E},"isEnabled"),setEnabled:a(function(E){r[b7]=E,Nn(t[Q1e])||(t[Q1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=een(r,E);if(!R){var x=m(_,v,b,T);Tqe(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 _=Ss,v=oen(r,E);if(!v){if(Tqe(y))_=l(E);else if(f)for(var b=f[In]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(dM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return Tqe(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 U1e(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[KXr]=y,y}a(POt,"createCookieMgr");function U1e(t){if(Sqe===null){Sqe=!1,!LM&&kOt();try{var e=LM.v||{};Sqe=e[ROt]!==void 0}catch(r){ka(t,2,68,"Cannot access document.cookie - "+Sae(r),{exception:dr(r)})}}return Sqe}a(U1e,"areCookiesSupported");function sen(t){var e={};if(t&&t[In]){var r=Ni(t)[XB](";");vt(r,function(n){if(n=Ni(n||Ss),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(dM(n,o))]=Ni(zf(n,o+1))}})}return e}a(sen,"_extractParts");function ren(t,e){return Or(t[e])?t[e]():null}a(ren,"_formatDate");function nen(t,e){var r=t||Ss;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?Ss:"="+o)}),r}a(nen,"_formatCookieValue");function qCo(t){var e=Ss;if(!LM&&kOt(),LM.v){var r=LM.v[ROt]||Ss;JXr!==r&&(ZXr=sen(r),JXr=r),e=Ni(ZXr[t]||Ss)}return e}a(qCo,"_getCookieValue");function ien(t,e){!LM&&kOt(),LM.v&&(LM.v[ROt]=t+"="+e)}a(ien,"_setCookieValue");function aen(t){return Ei(t)?!!(og(t,"CPU iPhone OS 12")||og(t,"iPad; CPU OS 12")||og(t,"Macintosh; Intel Mac OS X 10_14")&&og(t,"Version/")&&og(t,"Safari")||og(t,"Macintosh; Intel Mac OS X 10_14")&&DB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||og(t,"Chrome/5")||og(t,"Chrome/6")||og(t,"UnrealEngine")&&!og(t,"Chrome")||og(t,"UCBrowser/12")||og(t,"UCBrowser/11")):!1}a(aen,"uaDisallowsSameSiteNone");p();var jCo={perfEvtsSendAll:!1};function HCo(t){t.h=null;var e=t.cb;t.cb=[],vt(e,function(r){Wf(r.fn,[r.arg])})}a(HCo,"_runScheduledListeners");function D7(t,e,r,n){vt(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||qp(HCo,0,r)):Wf(n,[o]))})}a(D7,"_runListeners");var DOt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Gp(e,jCo);n=c[IM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[gae]=function(u){o[ro](u)},l[mae]=function(u){for(var d=Wo(o,u);d>-1;)o[Ex](d,1),d=Wo(o,u)},l[Eae]=function(u){D7(o,Eae,s,function(d){d[Eae](u)})},l[I7]=function(u,d){D7(o,I7,s,function(f){f[I7](u,d)})},l[_ae]=function(u,d){D7(o,_ae,d?s:null,function(f){f[_ae](u,d)})},l[PM]=function(u){u&&(r||!u[S1e]())&&D7(o,PM,null,function(d){u.isAsync?qp(function(){return d[PM](u)},0):d[PM](u)})},l[nqe]=function(u){u&&u[In]&&D7(o,nqe,s,function(d){d[nqe](u)})},l[iqe]=function(u){u&&u[aS]&&D7(o,iqe,s,function(d){d[iqe](u)})},l[oqe]=function(u,d){if(u>0){var f=d||0;D7(o,oqe,s,function(h){h[oqe](u,f)})}},l[_x]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[xM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(D7(o,"unload",null,function(h){var m=h[_x](u);m&&(f||(f=[]),f[ro](m))}),f)return Md(function(h){return vl(X7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Oae="ctx",MOt="ParentContextKey",q1e="ChildrenContextKey",GCo=null,Lae=(function(){function t(e,r,n){var o=this;if(o.start=_l(),o[sP]=e,o.isAsync=n,o[S1e]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[qz]=function(c){return c?c===t[MOt]||c===t[q1e]?o[c]:(o[Oae]||{})[c]:null},o[lP]=function(c,l){if(c)if(c===t[MOt])o[c]||(o[S1e]=function(){return!0}),o[c]=l;else if(c===t[q1e])o[c]=l;else{var u=o[Oae]=o[Oae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[qz](t[q1e]);if(ur(l))for(var u=0;u0&&(vt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){ka(r[Yu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[t3];!_&&A&&(_={}),E[t3]=_,_=e.ref(E,t3),_&&(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&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}M1e(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]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[C7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(UOt,"_createInternalContext");function Cx(t,e,r,n){var o=Gp(e),s=UOt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[vC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=N7(d,o.cfg,r,f)),Cx(d||c[sS](),o.cfg,r,f)}return a(u,"_createNew"),c[e0]=l,c[RM]=u,c}a(Cx,"createProcessTelemetryContext");function Bae(t,e,r){var n=Gp(e.config),o=UOt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[_x](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=N7(u,n.cfg,e,d)),Bae(u||s[sS](),e,d)}return a(l,"_createNew"),s[e0]=c,s[RM]=l,s}a(Bae,"createProcessTelemetryUnloadContext");function j1e(t,e,r){var n=Gp(e.config),o=UOt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[Qz])&&d[Qz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=N7(u,n.cfg,e,d)),j1e(u||s[sS](),e,d)}return a(l,"_createNew"),s[e0]=c,s[RM]=l,s}a(j1e,"createProcessTelemetryUpdateContext");function N7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[In]>0){var c=null;vt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[vC])){var u=KCo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?N7([n],e,r):o}a(N7,"createTelemetryProxyChain");function KCo(t,e,r){var n=null,o=Or(t[vC]),s=Or(t[T7]),c;t?c=t[wM]+"-"+t[$z]+"-"+fen++:c="Unknown-0-"+fen++;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[den])&&(g=t[den]()),g||(g=Cx(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[wM]:zCo,T=g[uen];return T||(T=g[uen]={}),g.setNext(n),t&&$p(g[Kf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Ss;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&ka(g[_C](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=n3(t);return _[oS]||_[I1e]?!1:(s&&t[T7](n),t[vC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[e0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=n3(t),v=t[Kf]||_[Kf];t&&(!v||v===g.core())&&!_[oS]&&(_[Kf]=null,_[oS]=!0,_[EC]=!1,t[oS]&&t[oS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[e0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=n3(t),v=t[Kf]||_[Kf];t&&(!v||v===g.core())&&!_[oS]&&t[Qz]&&t[Qz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[e0](A)}return a(m,"_updatePlugin"),Oh(l)}a(KCo,"createTelemetryPluginProxy");var pen=(function(){function t(e,r,n,o){var s=this,c=Cx(e,r,n,o);R7(s,c,Vu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function H1e(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){vt(t,function(s){try{s(n,o)}catch(c){ka(n[_C](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(H1e,"createUnloadHandlerContainer");p();var wqe,Rqe;function kqe(){var t=[];function e(n){var o=t;t=[],vt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){ka(n,2,73,"Unloading:"+dr(c))}}),wqe&&o[In]>wqe&&(Rqe?Rqe("doUnload",o):ka(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Lh(t,n),wqe&&t[In]>wqe&&(Rqe?Rqe("Add",t):ka(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(kqe,"createUnloadHookContainer");var QOt,M7="getPlugin",JCo=(QOt={},QOt[t3]={isVal:x7,v:{}},QOt),Fae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[JB]=function(h,m,g,A){u(h,m,A),r=!0},f[oS]=function(h,m){var g=f[Kf];if(!g||h&&g!==h[Kf]())return;var A,y=!1,E=h||Bae(null,g,o&&o[M7]?o[M7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[_C]()),A===!0&&E[e0](_),d())}return a(v,"_unloadCallback"),!f[S7]||f[S7](E,_,v)!==!0?v():A=!0,A},f[Qz]=function(h,m){var g=f[Kf];if(!g||h&&g!==h[Kf]())return;var A,y=!1,E=h||j1e(null,g,o&&o[M7]?o[M7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[sS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},w7(f,"_addUnloadCb",function(){return s},"add"),w7(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[_C]=function(f){return l(f)[_C]()},e[EC]=function(){return r},e.setInitialized=function(f){r=f},e[T7]=function(f){o=f},e[e0]=function(f,h){h?h[e0](f):o&&Or(o[vC])&&o[vC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||Cx(null,{},e[Kf]);o&&o[M7]?h=m[RM](null,o[M7]):h=m[RM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Gp(f,JCo,Mae(h)),!m&&h&&(m=h[JQe]()[sS]());var g=o;o&&o[M7]&&(g=o[M7]()),e[Kf]=h,n=Cx(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Kf]=null,n=null,o=null,c=kqe(),s=H1e()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function ZCo(t,e,r){var n={id:e,fn:r};Lh(t,n);var o={remove:a(function(){vt(t,function(s,c){if(s.id===n.id)return t[Ex](c,1),-1})},"remove")};return o}a(ZCo,"_addInitializer");function XCo(t,e,r){for(var n=!1,o=t[In],s=0;s"},"v")})}a(lbo,"_createUnloadHook");var Pqe=(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,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[EC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[JB]=function(ne,ce,Me,we){g&&Zc(men),U[EC]()&&Zc("Core cannot be initialized more than once"),e=Gp(ne,qOt,Me||U[Yu],!1),ne=e.cfg,qe(e[IM](function(st){var Et=st.cfg;B=Et.initInMemoMaxSize||rbo,Y(Et);var Dt=st.ref(st.cfg,t3);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=cbo(e,v,s&&U[v1e](),b),K(),U[Yu]=Me;var Be=ne[Gz];if(f=[],f[ro].apply(f,sz(sz([],ce,!1),Be,!1)),h=ne[Hz],Le(null),(!m||m[In]===0)&&Zc("No "+Hz+" available"),h&&h[In]>1){var rt=U[C7]("TeeChannelController");(!rt||!rt.plugin)&&ka(n,1,28,"TeeChannel required")}abo(ne,R,n),R=null,r=!0,N===_7.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&vt(m,function(ce){ne[ro](ce)}),Oh(ne)},U.track=function(ne){$p(U[vae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[sP]&&Xt(ne[sP])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||bae(new Date),ne.ver=ne.ver||"4.0",!g&&U[EC]()&&N===_7.ACTIVE?le()[e0](ne):N!==_7.INACTIVE&&o[In]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[JQe]=le,U[v1e]=function(){return s||(s=new DOt(e.cfg),U[ebo]=s),s},U[gae]=function(ne){U.getNotifyMgr()[gae](ne)},U[mae]=function(ne){s&&s[mae](ne)},U.getCookieMgr=function(){return u||(u=POt(e.cfg,U[Yu])),u},U.setCookieMgr=function(ne){u!==ne&&(Pae(u,!1),u=ne)},U[vae]=function(){return c||l||OOt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[In]},U.releaseQueue=function(){if(r&&o[In]>0){var ne=o;o=[],N===2?vt(ne,function(ce){ce.iKey=ce.iKey||w,le()[e0](ce)}):ka(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[xM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Me=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=_7.INACTIVE;var we="Please provide instrumentation key";r?(ka(n,1,100,we),z()):Zc(we);return}var Be=[];rg(ce)?(Be[ro](ce),w=null):w=ce,rg(Me)?(Be[ro](Me),L=null):L=Me,Be[In]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Me=x7(ne.initTimeOut)?ne.initTimeOut:nbo,we=Z7e(ce);M&&M[xM](),M=qp(function(){M=null,q||V()},Me),vl(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[ZB];if(rt&&rt[In]){var st=rt[0];if(w=st&&st[ZB],rt[In]>1){var Et=rt[1];L=Et&&Et[ZB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=_7.INACTIVE,ka(n,1,112,"ikey can't be resolved from promises")):N=_7.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[b7])&&!Q){var ce=ne||n&&n.queue[In]>0;ce&&(j||(j=!0,qe(e[IM](function(Me){var we=Me.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[b7],O[xM]()),O=O7e(X,we),O.unref(),O[b7]=Be}))),O[b7]=!0)}return O}a(ie,"_startLogPoller"),U[oOt]=function(){Q=!0,O&&O[xM](),X()},R7(U,function(){return A},["addTelemetryInitializer"]),U[_x]=function(ne,ce,Me){ne===void 0&&(ne=!0),r||Zc(tbo),g&&Zc(men);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Md(function(Et){ce=Et}));var rt=Bae(Ue(),U);rt[C1e](function(){v.run(U[Yu]),vOt([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(Et){we.flushComplete=Et,g=!0,_.run(rt,we),U[oOt](),rt[e0](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Me)||st(!1),Be},U[C7]=ge,U.addPlugin=function(ne,ce,Me,we){if(!ne){we&&we(!1),Z(yen);return}var Be=ge(ne[wM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[wM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[ro](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var Et=[Be.plugin],Dt={reason:2,isAsync:!!Me};ke(Et,Dt,function($t){$t?(rt.removed=Et,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Me;if(U[EC]()){Me={reason:1,cfg:e.cfg,oldCfg:kse({},e.cfg),newConfig:kse({},ne),merge:ce},ne=Me.newConfig;var we=e.cfg;ne[Gz]=we[Gz],ne[Hz]=we[Hz]}e._block(function(Be){var rt=Be.cfg;jOt(Be,rt,ne,ce),ce||Yr(rt,function(st){EA(ne,st)||Be.set(rt,st,cS)}),Be.setDf(rt,qOt)},!0),e.notify(),Me&&he(Me)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=len()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,w7(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=lS(e.cfg,ne,U[Yu]):ce=sbo(R,ne),lbo(ce)},U.getWParam=function(){return kB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Me){Me&&vt(Me,function(we){if(we[wM]&&we[ZQe]&&!ne[we.identifier]){var Be=we[wM]+"="+we[ZQe];P[ro](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&vt(h,function(Me){ce(Me)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Gp({},qOt,U[Yu]),e.cfg[XQe]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Ss},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new zz(e.cfg),e[Yu]=n),n},"g"),s:a(function(ce){e[Yu]=ce,n!==ce&&(Pae(n,!1),n=ce)},"s")}),U[Yu]=new zz(e.cfg),x=[];var ne=U.config[Gz]||[];ne.splice(0,ne[In]),Lh(ne,x),A=new hen,o=[],Pae(s,!1),s=null,c=null,l=null,Pae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=vx("AIBaseCore",!0),_=H1e(),T=null,w=null,v=kqe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=Cx(Ue(),e.cfg,U);return ne[C1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=obo(U[Yu],qXr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=xqe(Lh(m,ce[Hz]));var Me=Lh(xqe(ce[Kf]),m);x=Oh(Me);var we=U.config[Gz]||[];we.splice(0,we[In]),Lh(we,x);var Be=le();m&&m[In]>0&&FOt(Be[RM](m),Me),FOt(Be,Me),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Me=null,we=[];return vt(x,function(Be){if(Be[wM]===ne&&Be!==A)return Me=Be,-1;Be.getChannel&&we[ro](Be)}),!Me&&we[In]>0&&vt(we,function(Be){if(Me=Be.getChannel(ne),!Me)return-1}),Me&&(ce={plugin:Me,setEnabled:a(function(Be){n3(Me)[I1e]=!Be},"setEnabled"),isEnabled:a(function(){var Be=n3(Me);return!Be[oS]&&!Be[I1e]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Me],Et={reason:1,isAsync:Be};ke(st,Et,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Wo(ne,A)===-1&&ne[ro](A),d=N7(xqe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Me){if(ne&&ne[In]>0){var we=N7(ne,e.cfg,U),Be=Bae(we,U);Be[C1e](function(){var rt=!1,st=[];vt(f,function(Dt,$t){gen(Dt,ne)?rt=!0:st[ro](Dt)}),f=st,D=null,P=null;var Et=[];h&&(vt(h,function(Dt,$t){var Gt=[];vt(Dt,function(Ie){gen(Ie,ne)?rt=!0:Gt[ro](Ie)}),Et[ro](Gt)}),h=Et),Me&&Me(rt),ie()}),Be[e0](ce)}else Me(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[In]=0,vt(ne,function(ce){var Me={name:y||"InternalMessageId: "+ce[Aae],iKey:w,time:bae(new Date),baseType:Nae.dataType,baseData:{message:ce[kM]}};U.track(Me)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Me,we){var Be=1,rt=!1,st=null;we=we||5e3;function Et(){Be--,rt&&Be===0&&(st&&st[xM](),st=null,ce&&ce(rt),ce=null)}if(a(Et,"doCallback"),m&&m[In]>0){var Dt=le()[RM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,Et()},Me)||Gt||(ne&&st==null?st=qp(function(){st=null,Et()},we):Et())}})}return rt=!0,Et(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[IM](function(ce){var Me=ce.cfg.enablePerfMgr;if(Me){var we=ce.cfg[rqe];(ne!==we||!ne)&&(we||(we=ibo),cqe(ce.cfg,rqe,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[v1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=j1e(Ue(),U);ce[C1e](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[e0](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[Yu];ce?(ka(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[v1e]();ce&&ce[I7]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var uP="",ubo="NoResponseBody",Een="&"+ubo+"=true",HOt="POST",Dqe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[JB]=function(M,O){o=O,n&&ka(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=Iae();O&&O.protocol&&O.protocol[Uz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[In]?R(M,O):null},E.getFallbackInst=function(){return d},E[S7]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[aS]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[aS])?new TextEncoder().encode(j[aS]):j[aS]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return vl(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[ZB];if(!Le.done)return z[ro](Le[ZB]),ie+=Le.value[In],vl(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(vt(Vu(ge),function(K){H.append(K,ge[K])}),Ue[T1e]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=Een)):le=!0);var ke=new Request(U,Ue);try{ke[COt]=!0}catch{}if(!j&&r&&(V=Md(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?uP:K):x(O,s?0:400,{},s?uP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[cP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||uP,he):x(O,ue,{},Z||uP)}a(ee,"_onFetchComplete");try{vl(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[kM],499),ie&&ie(K.reason);else{var he=K[ZB];try{!s&&!he.ok?(he[cP]?X(he.statusText,he[cP]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,uP),z&&z(!0)):vl(he.text(),function(Z){ee(he,M,Z[ZB]),z&&z(!0)})}catch(Z){he&&he[cP]?X(dr(Z),he[cP]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[jz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[jz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=hf(),U=new XDomainRequest,Y=M[aS];U.onload=function(){var H=NM(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?uP:uqe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[yae];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";ka(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[aP](/^(https?:)/,"");U.open(HOt,ie),M[jz]&&(U[jz]=M[jz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.send(Y)}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 Ien="on",_en="attachEvent",ven="addEventListener",Cen="detachEvent",ben="removeEventListener",GOt="events",V1e="visibilitychange",Mqe="pagehide",xen="pageshow",wen="unload",Ren="beforeunload",ken=vx("aiEvtPageHide"),Pen=vx("aiEvtPageShow"),dbo=/\.[\.]+/g,fbo=/[\.]+$/,pbo=1,Nqe=gqe("events"),hbo=/^([^.]*)(?:\.(.+)|)/;function Sen(t){return t&&t[aP]?t[aP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Ss):t}a(Sen,"_normalizeNamespace");function $Ot(t,e){if(e){var r=Ss;ur(e)?(r=Ss,vt(e,function(o){o=Sen(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Sen(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Ss)+r)}var n=hbo.exec(t||Ss)||[];return{type:n[1],ns:(n[2]||Ss).replace(dbo,".").replace(fbo,Ss)[XB](".").sort().join(".")}}a($Ot,"_getEvtNamespace");function Den(t,e,r){r===void 0&&(r=!0);var n=Nqe.get(t,GOt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Den,"_getRegisteredEvents");function Nen(t,e,r,n){t&&e&&e[e3]&&(t[ben]?t[ben](e[e3],r,n):t[Cen]&&t[Cen](Ien+e[e3],r))}a(Nen,"_doDetach");function mbo(t,e,r,n){var o=!1;return t&&e&&e[e3]&&r&&(t[ven]?(t[ven](e[e3],r,n),o=!0):t[_en]&&(t[_en](Ien+e[e3],r),o=!0)),o}a(mbo,"_doAttach");function Ten(t,e,r,n){for(var o=e[In];o--;){var s=e[o];s&&(!r.ns||r.ns===s[aOt].ns)&&(!n||n(s))&&(Nen(t,s[aOt],s.handler,s.capture),e[Ex](o,1))}}a(Ten,"_doUnregister");function gbo(t,e,r){if(e[e3])Ten(t,Den(t,e[e3]),e,r);else{var n=Nqe.get(t,GOt,{});Yr(n,function(o,s){Ten(t,s,e,r)}),Vu(n)[In]===0&&Nqe.kill(t,GOt)}}a(gbo,"_unregisterEvents");function L7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=$Ot("xx",r).ns[XB](".")):r=t,r}a(L7,"mergeEvtNamespace");function G1e(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=$Ot(e,n);if(s=mbo(t,c,r,o),s&&Nqe.accept(t)){var l={guid:pbo++,evtName:c,handler:r,capture:o};Den(t,c.type)[ro](l)}}catch{}return s}a(G1e,"eventOn");function $1e(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=$Ot(e,n),c=!1;gbo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Nen(t,s,r,o)}catch{}}a($1e,"eventOff");function VOt(t,e,r){var n=!1,o=hf();o&&(n=G1e(o,t,e,r),n=G1e(o.body,t,e,r)||n);var s=pf();return s&&(n=G1e(s,t,e,r)||n),n}a(VOt,"addEventHandler");function WOt(t,e,r){var n=hf();n&&($1e(n,t,e,r),$1e(n.body,t,e,r));var o=pf();o&&$1e(o,t,e,r)}a(WOt,"removeEventHandler");function Uae(t,e,r,n){var o=!1;return e&&t&&t[In]>0&&vt(t,function(s){s&&(!r||Wo(r,s)===-1)&&(o=VOt(s,e,n)||o)}),o}a(Uae,"_addEventListeners");function zOt(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=Uae(t,e,r,n),!o&&r&&r[In]>0&&(o=Uae(t,e,null,n))),o}a(zOt,"addEventListeners");function Yz(t,e,r){t&&ur(t)&&vt(t,function(n){n&&WOt(n,e,r)})}a(Yz,"removeEventListeners");function Oqe(t,e,r){return zOt([Ren,wen,Mqe],t,e,r)}a(Oqe,"addPageUnloadEventListener");function Lqe(t,e){Yz([Ren,wen,Mqe],t,e)}a(Lqe,"removePageUnloadEventListener");function W1e(t,e,r){function n(c){var l=pf();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=L7(ken,r),s=Uae([Mqe],t,e,o);return(!e||Wo(e,V1e)===-1)&&(s=Uae([V1e],n,e,o)||s),!s&&e&&(s=W1e(t,null,r)),s}a(W1e,"addPageHideEventListener");function Bqe(t,e){var r=L7(ken,e);Yz([Mqe],t,r),Yz([V1e],null,r)}a(Bqe,"removePageHideEventListener");function z1e(t,e,r){function n(c){var l=pf();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=L7(Pen,r),s=Uae([xen],t,e,o);return s=Uae([V1e],n,e,o)||s,!s&&e&&(s=z1e(t,null,r)),s}a(z1e,"addPageShowEventListener");function Fqe(t,e){var r=L7(Pen,e);Yz([xen],t,r),Yz([V1e],null,r)}a(Fqe,"removePageShowEventListener");p();var Qae="",Men="https://browser.events.data.microsoft.com/OneCollector/1.0/",YOt="version",Uqe="properties";p();p();var KOt="initialize",JOt="indexOf",BM="timings",ZOt="pollInternalLogs",uS="value",Qqe="length",qqe="processTelemetryStart";var i3,Oen="4.3.10",Y1e="1DS-Web-JS-"+Oen,Len=kbe.hasOwnProperty;var Ibo=(i3={},i3[0]=0,i3[2]=6,i3[1]=1,i3[3]=7,i3[4098]=6,i3[4097]=1,i3[4099]=7,i3);var xbo=kB(),wbo=Rse();function bx(t){return!(t===Qae||Xt(t))}a(bx,"isValueAssigned");function XOt(t){if(t){var e=lu(t,"-");if(e>-1)return dM(t,e)}return Qae}a(XOt,"getTenantId");function e5t(t){return!!(t&&Mh(t)&&t>=1&&t<=4)}a(e5t,"isLatency");function t5t(t,e,r){if(!e&&!bx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||ur(e))e={value:e};else if(n==="object"&&!Len.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[uS])||e[uS]===Qae||!Ei(e[uS])&&!Mh(e[uS])&&!Yk(e[uS])&&!ur(e[uS]))return null;if(ur(e[uS])&&!Fen(e[uS]))return null;if(!Xt(e.kind)){if(ur(e[uS])||!Ben(e.kind))return null;e[uS]=e[uS].toString()}return e}a(t5t,"sanitizeProperty");function K1e(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),Rbo(r))n===-1&&(n=0),n|=r;else{var o=Ibo[jqe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(K1e,"getCommonSchemaMetaData");function qae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[Qqe],d=arguments;for(Yk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Ben,"isValueKind");function Rbo(t){return t>=0&&t<=9}a(Rbo,"isDataType");function Fen(t){return t[Qqe]>0}a(Fen,"isArrayValid");function Hqe(t,e){var r=t;r[BM]=r[BM]||{},r[BM][qqe]=r[BM][qqe]||{},r[BM][qqe][e]=dS()}a(Hqe,"setProcessTelemetryTimings");function jqe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===fx&&(e=4,ur(t)?(e=4096,t[Qqe]>0&&(e|=jqe(t[0]))):Len.call(t,"value")&&(e=8192|jqe(t[uS])))}return e}a(jqe,"getFieldValueType");function r5t(){return!!Di("chrome")}a(r5t,"isChromium");function Kz(t){return t>0}a(Kz,"isGreaterThanZero");var kbo=I_({endpointUrl:Men,propertyStorageOverride:{isVal:Pbo}});function Pbo(t){return t&&(!t.getProperty||!t.setProperty)&&Zc("Invalid property storage override passed."),!0}a(Pbo,"_chkPropOverride");var n5t=(function(t){zy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[KOt]=function(s,c,l,u){$p(n,function(){return"AppInsightsCore.initialize"},function(){try{o[KOt](Gp(s,kbo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[JOt]("channels")!==-1&&(f+=` + - Channels must be provided through config.channels only!`),ka(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){$p(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[BM]=c[BM]||{},c[BM].trackStart=dS(),e5t(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=Y1e;var u=c.baseData=c.baseData||{};u[Uqe]=u[Uqe]||{};var d=u[Uqe];d[YOt]=d[YOt]||n.pluginVersionString||Qae}o.track(c)},function(){return{item:s}},!s.sync)},n[ZOt]=function(s){return o[ZOt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(Pqe);p();p();var J1e="REAL_TIME",Uen="NEAR_REAL_TIME",Qen="BEST_EFFORT";p();p();p();var dP="";var Gqe="drop",qen="send",i5t="requeue",jen="rspFail",Hen="oth",o5t="no-cache, no-store",$qe="application/x-json-stream",Z1e="cache-control",jae="content-type",Gen="kill-tokens",$en="kill-duration";var Ven="time-delta-millis",Vqe="client-version",s5t="client-id",Wqe="time-delta-to-apply-millis",zqe="upload-time",Yqe="apikey",X1e="AuthMsaDeviceTicket",a5t="WebAuthToken",c5t="AuthXToken";var Wen="NoResponseBody",Hae="msfpc",l5t="trace",Kqe="user";p();var eSe="allowRequestSending",Jqe="shouldAddClockSkewHeaders",Zqe="getClockSkewHeaderValue",tSe="setClockSkew",zo="length",FM="concat",fS="iKey",Jf="count",UM="events",t0="push",QM="split",Xqe="toLowerCase",Jz="hdrs",eje="useHdrs",Zz="initialize",tje="setTimeoutOverride",rje="clearTimeoutOverride",zen="payloadPreprocessor",u5t="overrideEndpointUrl",d5t="avoidOptions",Yen="disableEventTimings",nje="enableCompoundKey",f5t="disableXhrSync",p5t="disableFetchKeepAlive",Ken="addNoResponse",h5t="useSendBeacon",m5t="fetchCredentials",g5t="alwaysUseXhrOverride",ije="serializeOfflineEvt",oje="getOfflineRequestDetails",sje="createPayload",rSe="createOneDSPayload",A5t="payloadBlob",fP="headers",Gae="_thePayload",Zy="batches",CC="sendType",nSe="canSendRequest",$ae="sendQueuedRequests",iSe="setUnloading",Jen="isTenantKilled",aje="sendSynchronousBatch",cje="_transport",Vae="getWParam",y5t="isBeacon",oSe="timings",lje="isTeardown",uje="_sendReason",dje="setKillSwitchTenants",fje="_backOffTransmission",sSe="identifier",Zen="ignoreMc1Ms0CookieProcessing",E5t="autoFlushEventsLimit",Xen="disableAutoBatchFlushLimit",etn="overrideInstrumentationKey",aSe="sendAttempt",B7="latency",Xz="sync";function rtn(t){var e=(t.ext||{}).intweb;return e&&bx(e[Hae])?e[Hae]:null}a(rtn,"_getEventMsfpc");function ttn(t){for(var e=null,r=0;e===null&&r_l()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var Nbo=.8,Mbo=1.2,otn=3e3,Obo=6e5;function stn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(stn,"retryPolicyShouldRetryForStatus");function pje(t){var e=0,r=otn*Nbo,n=otn*Mbo,o=Y1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,jU(e,Obo)}a(pje,"retryPolicyGetMillisToBackoffForRetry");p();var Lbo=20,Bbo=3145728,ctn=65e3,ltn=2e6,Fbo=jU(ltn,ctn),atn="metadata",hje="f",Ubo=/\./,utn=(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||K1e,_=Qbo(l),v=mje(_.requestLimit,Bbo,0),b=mje(_.requestLimit,ctn,1),T=mje(_.recordLimit,ltn,0),w=Math.min(mje(_.recordLimit,Fbo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,L,B,q,M){return{apiKeys:[],payloadBlob:dP,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&&$p(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,O=D.numEvents,j=!1,Q=[],U=[],Y=D.isBeacon,W=Y?b:v,V=Y?w:T,z=0,ie=0;z=L){D.overflow=N.split(z);break}var re=R.getEventBlob(H);if(re&&re.length<=V){var le=re.length,Le=M.length;if(Le+le>W){D.overflow=N.split(z);break}M&&(M+=` +`),M+=re,ie++,ie>Lbo&&(k7e(M,0,1),ie=0),j=!0,O++}else re?Q.push(H):U.push(H),q.splice(z,1),z--}z++}if(Q.length>0&&D.sizeExceed.push(F7.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(F7.create(N.iKey(),U)),j){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ge=N.iKey();Wo(D.apiKeys,ge)===-1&&D.apiKeys.push(ge)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return $p(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+XOt(D.iKey);var L={},B;y||(B=a(function(j,Q,U){qbo(E,L,j,Q,U)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=L,Yr(q,function(j,Q){var U=L[j]={};P(Q,U,"ext."+j,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],B,m),P(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=Pse(D,"ext.metadata")||Pse(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,q,M,O){Yr(D,function(j,Q){var U=null;if(Q||bx(Q)){var Y=L,W=j,V=q,z=N;if(h&&!B&&Ubo.test(j)){var ie=j.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(mje,"_validateSizeLimit");function Qbo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(Qbo,"_getSizeLimtCfg");function qbo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[atn];c||(c=e[atn]={f:{}});var l=c[hje];if(l||(l=c[hje]={}),r)for(var u=0;u0)for(var o=e[Xqe](),s=0;s0&&(n&&v5t[e]?(t[Jz][v5t[e]]=r,t[eje]=!0):t.url+="&"+e+"="+r)}a(zae,"_addRequestDetails");function $bo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[ije]=function(pe){try{if(b)return b.getEventBlob(pe)}catch{}return dP},H[oje]=function(){try{var pe=b&&b[sje](0,!1,!1,!1,1,0);return we(pe,x)}catch{}return null},H[rSe]=function(pe,Se){try{var Fe=[];vt(pe,function(se){Se&&(se=DM(se));var me=F7.create(se[fS],[se]);Fe[t0](me)});for(var te=null;Fe[zo]>0&&b;){var Te=Fe.shift();Te&&Te[Jf]()>0&&(te=te||b[sje](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ie))}var Ge=we(te,x),J={data:te[A5t],urlString:Ge.url,headers:Ge[Jz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(gje(J[fP],Z1e)||(J[fP][Z1e]=o5t),gje(J[fP],jae)||(J[fP][jae]=$qe)),J}catch{}return null};function le(pe,Se){try{return V&&V.getSenderInst(pe,Se)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Le(),s,ie]};function Le(){try{var pe={xdrOnComplete:ge,fetchOnComplete:ke,xhrOnComplete:X,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:pe};return Se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(pe,Se,Fe){var te=NM(pe);ee(Se,200,{},te),F(te)}a(ge,"_xdrOncomplete");function Ue(){var pe;s=null,c=new itn,l=!1,u=new ntn,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=pe,N=pe,L=pe,B=pe,q=pe,M=[],O=pe,j=pe,Q=[],U=!1,Y=Wae(),W=!1,V=null,ie=null}a(Ue,"_initDefaults");function ke(pe,Se,Fe,te){var Te=a(function(se,me,Ce){ee(Se,se,me,Ce),F(Ce)},"handleResponse"),Ge={},J=pe[fP];J&&J.forEach(function(se,me){Ge[me]=se}),Te(pe.status,Ge,Fe||dP)}a(ke,"_fetchOnComplete");function X(pe,Se,Fe){var te=NM(pe);ee(Se,pe.status,k7(pe,!0),te),F(te)}a(X,"_xhrOnComplete");function ee(pe,Se,Fe,te){try{pe(Se,Fe,te)}catch(Te){ka(m,2,518,dr(Te))}}a(ee,"_doOnComplete");function K(pe,Se,Fe){var te=pe,Te=200,Ge=te[Gae],J=pe.urlString+(q?jbo:dP);try{var se=Wu();if(Ge){var me=!!A.getPlugin("LocalStorage"),Ce=[],He=[];vt(Ge[Zy],function($e){if(Ce&&$e&&$e[Jf]()>0)for(var et=$e[UM](),ct=0;ct0&&(Ge.sentEvts=He),me||be(Ce,8003,Ge[CC],!0)}else Te=0}catch($e){OM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr($e)),Te=0}finally{ee(Se,Te,{},dP)}}a(K,"_onBeaconRetry");function he(pe){return pe===2||pe===3}a(he,"_isBeaconPayload");function Z(pe){return R&&he(pe)&&(pe=2),pe}a(Z,"_adjustSendType"),H.addHeader=function(pe,Se){_[pe]=Se},H.removeHeader=function(pe){delete _[pe]},H[nSe]=function(){return ue()&&u[eSe]()},H[$ae]=function(pe,Se){Nn(pe)&&(pe=0),R&&(pe=Z(pe),Se=2),ne(v,pe,0)&&Me(qe(),0,!1,pe,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[zo]===0},H[iSe]=function(pe){R=pe},H.addBatch=function(pe){if(pe&&pe[Jf]()>0){if(c.isTenantKilled(pe[fS]()))return!1;v[t0](pe)}return!0},H.teardown=function(){v[zo]>0&&Me(qe(),0,!0,2,2),vt(M,function(pe){pe&&pe.rm&&pe.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[$ae](0,4)},H[aje]=function(pe,Se,Fe){pe&&pe[Jf]()>0&&(Xt(Se)&&(Se=1),R&&(Se=Z(Se),Fe=2),Me([pe],0,!1,Se,Fe||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Fe>0||u[eSe]())),te}a(ne,"_canSendPayload");function ce(pe){var Se={};return pe&&vt(pe,function(Fe,te){Se[te]={iKey:Fe[fS](),evts:Fe[UM]()}}),Se}a(ce,"_createDebugBatches");function Me(pe,Se,Fe,te,Te){if(!(!pe||pe[zo]===0)){if(l){be(pe,1,te);return}te=Z(te);try{var Ge=pe,J=te!==0;$p(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(pe=pe.slice(0));for(var me=[],Ce=null,He=dS(),$e=g[te]||(J?g[1]:g[0]),et=$e&&$e[cje],ct=B&&(R||he(te)||et===3||$e._isSync&&et===2);ne(pe,te,Se);){var Ct=pe.shift();Ct&&Ct[Jf]()>0&&(c.isTenantKilled(Ct[fS]())?me[t0](Ct):(Ce=Ce||b[sje](Se,Fe,J,ct,Te,te),b.appendPayload(Ce,Ct,ie)?Ce.overflow!==null&&(pe=[Ce.overflow][FM](pe),Ce.overflow=null,rt(Ce,He,dS(),Te),He=dS(),Ce=null):(rt(Ce,He,dS(),Te),He=dS(),pe=[Ct][FM](pe),Ce=null)))}Ce&&rt(Ce,He,dS(),Te),pe[zo]>0&&(v=pe[FM](v)),be(me,8004,te)},function(){return{batches:ce(Ge),retryCount:Se,isTeardown:Fe,isSynchronous:J,sendReason:Te,useSendBeacon:he(te),sendType:te}},!J)}catch(se){ka(m,2,48,"Unexpected Exception sending batch: "+dr(se))}}}a(Me,"_sendBatches");function we(pe,Se){var Fe={url:s,hdrs:{},useHdrs:!1};Se?(Fe[Jz]=qae(Fe[Jz],_),Fe.useHdrs=Vu(Fe.hdrs)[zo]>0):Yr(_,function(se,me){C5t[se]?zae(Fe,C5t[se],me,!1):(Fe[Jz][se]=me,Fe[eje]=!0)}),zae(Fe,s5t,"NO_AUTH",Se),zae(Fe,Vqe,Y1e,Se);var te=dP;vt(pe.apiKeys,function(se){te[zo]>0&&(te+=","),te+=se}),zae(Fe,Yqe,te,Se),zae(Fe,zqe,_l().toString(),Se);var Te=Ie(pe);if(bx(Te)&&(Fe.url+="&ext.intweb.msfpc="+Te),u[Jqe]()&&zae(Fe,Wqe,u[Zqe](),Se),A[Vae]){var Ge=A[Vae]();Ge>=0&&(Fe.url+="&w="+Ge)}for(var J=0;J0){var Te=!!O,Ge=g[pe.sendType];!he(pe[CC])&&pe[y5t]&&pe.sendReason===2&&(Ge=g[2]||g[3]||Ge);var J=x;(pe.isBeacon||Ge[cje]===3)&&(J=!1);var se=we(pe,J);J=J||se[eje];var me=dS();$p(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[_5t]++:ct[_5t]=1}be(pe[Zy],1e3+(te||0),pe[CC],!0);var ht={data:pe[A5t],urlString:se.url,headers:se[Jz],_thePayload:pe,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};J&&(gje(ht[fP],Z1e)||(ht[fP][Z1e]=o5t),gje(ht[fP],jae)||(ht[fP][jae]=$qe));var We=null;Ge&&(We=a(function(ae){u.firstRequestSent();var Re=a(function(ye,oe){Et(ye,oe,pe,te)},"onComplete"),Oe=pe[lje]||pe.isSync;V.preparePayload(function(ye){try{Ge.sendPOST(ye,Re,Oe),j&&j(ht,ye,Oe,pe[y5t])}catch(oe){ee(Re,0,{}),OM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ae,Oe)},"sender")),$p(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(pe[CC]===0&&f++,Te&&!pe.isBeacon&&Ge[cje]!==3){var ae={data:ht.data,urlString:ht.urlString,headers:qae({},ht[fP]),timeout:ht.timeout,disableXhrSync:ht[f5t],disableFetchKeepAlive:ht[p5t]},Re=!1;$p(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ae,function(Oe){Re=!0,!y&&!Oe[Gae]&&(Oe[Gae]=Oe[Gae]||ht[Gae],Oe[uje]=Oe[uje]||ht[uje]),We(Oe)},pe.isSync||pe[lje])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:pe,serializationStart:Se,serializationCompleted:Fe,sendReason:te}},pe.isSync)}pe.sizeExceed&&pe.sizeExceed[zo]>0&&be(pe.sizeExceed,8003,pe[CC]),pe.failedEvts&&pe.failedEvts[zo]>0&&be(pe.failedEvts,8002,pe[CC])}a(rt,"_doPayloadSend");function st(pe,Se){T&&vt(pe,function(Fe){var te=Fe[oSe]=Fe[oSe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function Et(pe,Se,Fe,te){var Te=9e3,Ge=null,J=!1,se=!1;try{var me=!0;if(typeof pe!==eS){if(Se){u[tSe](Se[Ven]);var Ce=Se[$en]||Se["kill-duration-seconds"];vt(c[dje](Se[Gen],Ce),function($e){vt(Fe[Zy],function(et){if(et[fS]()===$e){Ge=Ge||[];var ct=et[QM](0);Fe.numEvents-=ct[Jf](),Ge[t0](ct)}})})}if(pe==200||pe==204){Te=200;return}(!stn(pe)||Fe.numEvents<=0)&&(me=!1),Te=9e3+pe%1e3}if(me){Te=100;var He=Fe.retryCnt;Fe[CC]===0&&(He0&&st(Fe[UM](),Se)})}}a($t,"_addCompleteTimings");function Gt(pe,Se,Fe){Se?pe():Y.set(pe,Fe)}a(Gt,"_doAction");function Ie(pe){for(var Se=0;Se0&&o){var Te=o[Qe(Se)];if(Te){var Ge=Fe!==0;$p(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{Te.call(o,pe,Se,Ge,Fe)}catch(J){ka(m,1,74,"send request notification failed: "+J)}},te||Ge,0)},function(){return{batches:ce(pe),reason:Se,isSync:Ge,sendSync:te,sendType:Fe}},!Ge)}}}a(be,"_sendBatchesNotification");function Qe(pe){var Se=Gbo[pe];return bx(Se)||(Se=Hen,pe>=9e3&&pe<=9999?Se=jen:pe>=8e3&&pe<=8999?Se=Gqe:pe>=1e3&&pe<=1999&&(Se=qen)),Se}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Wbo=.25,htn=500,zbo=20,mtn=6,gtn=2,Ybo=4,ftn=2,Kbo=1,b5t=1e4,rY="eventsDiscarded",ptn="",Qh=void 0,Jbo=I_({eventsLimitInMem:{isVal:Kz,v:b5t},immediateEventLimit:{isVal:Kz,v:500},autoFlushEventsLimit:{isVal:Kz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:Zbo,v:Qh},overrideInstrumentationKey:Qh,overrideEndpointUrl:Qh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Qh,clearTimeoutOverride:Qh,payloadPreprocessor:Qh,payloadListener:Qh,disableEventTimings:Qh,valueSanitizer:Qh,stringifyObjects:Qh,enableCompoundKey:Qh,disableOptimizeObj:!1,fetchCredentials:Qh,transports:Qh,unloadTransports:Qh,useSendBeacon:Qh,disableFetchKeepAlive:Qh,avoidOptions:!1,xhrTimeout:Qh,disableXhrSync:Qh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Mh,v:mtn},maxUnloadEventRetryAttempts:{isVal:Mh,v:gtn},addNoResponse:Qh,maxEvtPerBatch:{isVal:Mh,v:htn},excludeCsMetaData:Qh,requestLimit:{}});function Zbo(t){return t&&t.sendPOST}a(Zbo,"isOverrideFn");var S5t=(function(t){zy(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=J1e,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W;return Si(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[Zz]=function(J,se,me){$p(se,function(){return"PostChannel:initialize"},function(){z[Zz](J,se,me),j=se.getNotifyMgr();try{B=L7(vx(V[sSe]),se.evtNamespace&&se.evtNamespace()),V._addHook(lS(J,function(Ce){var He=Ce.cfg,$e=Cx(null,He,se);n=$e.getExtCfg(V[sSe],Jbo),q=Wae(n[tje],n[rje]),P=!n.disableOptimizeObj&&r5t(),M=n[Zen],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[E5t],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[Xen],W=n.maxEvtPerBatch,rg(He.endpointUrl)?V.pause():l&&V.resume(),Ge(),U=n[etn],Y=!!n.disableTelemetry,Q&&ie();var et=He.disablePageUnloadEvents||[];Q=Oqe(Le,et,B),Q=W1e(Le,et,B)||Q,Q=z1e(ge,He.disablePageShowEvents,B)||Q})),v[Zz](J,V.core,V)}catch(Ce){throw V.setInitialized(!1),Ce}},function(){return{theConfig:J,core:se,extensions:me}})},V.processTelemetry=function(J,se){Hqe(J,V[sSe]),se=se||V._getTelCtx(se);var me=J;!Y&&!o&&(U&&(me[fS]=U),ke(me,!0),D?qe(2,2):K()),V.processNext(me,se)},V.getOfflineSupport=function(){try{var J=v&&v[oje]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(se){return!Y},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[rSe])return v[rSe](se,P)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,se){qe(2,2),o=!0,v.teardown(),ie(),he()};function ie(){Lqe(null,B),Bqe(null,B),Fqe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var se=J[Vae];J[Vae]=function(){var me=0;return M&&(me=me|2),me|se.call(J)}}a(H,"_hookWParam");function re(J){var se=ptn;return J&&J[zo]&&vt(J,function(me){se&&(se+=` +`),se+=me}),se}a(re,"_batch");function le(J){var se=ptn;try{Ue(J),se=v[ije](J)}catch{}return se}a(le,"_serialize");function Le(J){var se=J||hf().event;se.type!=="beforeunload"&&(D=!0,v[iSe](D)),qe(2,2)}a(Le,"_handleUnloadEvents");function ge(J){D=!1,v[iSe](D)}a(ge,"_handleShowEvents");function Ue(J){J.ext&&J.ext[l5t]&&delete J.ext[l5t],J.ext&&J.ext[Kqe]&&J.ext[Kqe].id&&delete J.ext[Kqe].id,P&&(J.ext=DM(J.ext),J.baseData&&(J.baseData=DM(J.baseData)),J.data&&(J.data=DM(J.data)))}a(Ue,"_cleanEvent");function ke(J,se){if(J[aSe]||(J[aSe]=0),J[B7]||(J[B7]=1),Ue(J),J[Xz]){if(E||l)J[B7]=3,J[Xz]=!1;else if(v){P&&(J=DM(J)),v[aje](F7.create(J[fS],[J]),J[Xz]===!0?1:J[Xz],3);return}}var me=J[B7],Ce=f,He=h;me===4&&(Ce=u,He=d);var $e=!1;if(CeJ;if(!me&&w>0)for(var Ce=1;!me&&Ce<=3;Ce++){var He=b[Ce];He&&He[Zy]&&vt(He[Zy],function($e){$e&&$e[Jf]()>=w&&(me=!0)})}Me(!0,me)},V.pause=function(){ue(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){$t(),Yr(J,function(se,me){var Ce=me[zo];if(Ce>=2){var He=Ce>2?me[2]:0;if(me.splice(0,Ce-2),me[1]<0&&(me[0]=-1),me[1]>0&&me[0]>0){var $e=me[0]/me[1];me[0]=nJr($e)*me[1]}He>=0&&me[1]>=0&&He>me[1]&&(He=me[1]),me[t0](He),m[se]=me}})},V.flush=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!l)if(me=me||1,J)se||(Ce=Md(function($e){se=$e})),c==null?(ue(),st(1,0,me),c=Z(function(){c=null,Et(se,me)},0)):s[t0](se);else{var He=ue();X(1,1,me),se&&se(),He&&K()}return Ce},V.setMsaAuthTicket=function(J){v.addHeader(X1e,J)},V.setAuthPluginHeader=function(J){v.addHeader(a5t,J)},V.removeAuthPluginHeader=function(){v.removeHeader(a5t)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(ue(),g=J,K())},R7(V,function(){return v},["addResponseHandler"]);function X(J,se,me){var Ce=st(J,se,me);return v[$ae](se,me),Ce}a(X,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[$ae](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=Z(function(){y=null,X(4,0,1),K()},J))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=Z(function(){A=null,X(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),V[fje]=function(){E0&&f>T&&(se=!0),se&&c==null&&V.flush(J,function(){},20))}a(Me,"_performAutoFlush");function we(J,se){P&&(J=DM(J));var me=J[B7],Ce=ce(J[fS],me,!0);return Ce.addEvent(J)?(me!==4?(f++,se&&J[aSe]===0&&Me(!J.sync,w>0&&Ce[Jf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(J,se,me,Ce){for(;me<=se;){var He=ce(J,se,!0);if(He&&He[Jf]()>0){var $e=He[QM](0,Ce),et=$e[Jf]();if(et>0)return me===4?u-=et:f-=et,Qe(rY,[$e],TM.QueueFull),!0}me++}return rt(),!1}a(Be,"_dropEventWithLatencyOrLess");function rt(){for(var J=0,se=0,me=a(function(He){var $e=b[He];$e&&$e[Zy]&&vt($e[Zy],function(et){He===4?J+=et[Jf]():se+=et[Jf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)me(Ce);f=se,u=J}a(rt,"_resetQueueCounts");function st(J,se,me){var Ce=!1,He=se===0;return!He||v[nSe]()?$p(V.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],et=4;et>=J;){var ct=b[et];ct&&ct.batches&&ct.batches[zo]>0&&(vt(ct[Zy],function(Ct){v.addBatch(Ct)?Ce=Ce||Ct&&Ct[Jf]()>0:$e=$e[FM](Ct[UM]()),et===4?u-=Ct[Jf]():f-=Ct[Jf]()}),ct[Zy]=[],ct.iKeyMap={}),et--}$e[zo]>0&&be(rY,$e,TM.KillSwitch),Ce&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:se,sendReason:me}},!He):(R=R>=0?jU(R,J):J,x=Kk(x,me)),Ce}a(st,"_queueBatches");function Et(J,se){X(1,0,se),rt(),Dt(function(){J&&J(),s[zo]>0?c=Z(function(){c=null,Et(s.shift(),se)},0):(c=null,K())})}a(Et,"_flushImpl");function Dt(J){v.isCompletelyIdle()?J():c=Z(function(){c=null,Dt(J)},Wbo)}a(Dt,"_waitForIdleManager");function $t(){ue(),Gt(),g=J1e,K()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[J1e]=[2,1,0],m[Uen]=[6,3,0],m[Qen]=[18,9,0]}a(Gt,"_initializeProfiles");function Ie(J,se){var me=[],Ce=N;D&&(Ce=L),vt(J,function(He){He&&He[Jf]()>0&&vt(He[UM](),function($e){$e&&($e[Xz]&&($e[B7]=4,$e[Xz]=!1),$e[aSe]0&&be(rY,me,TM.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(J,se){var me=j||{},Ce=me[J];if(Ce)try{Ce.apply(me,se)}catch(He){ka(V.diagLog(),1,74,J+" notification failed: "+He)}}a(F,"_callNotification");function be(J,se){for(var me=[],Ce=2;Ce0&&F(J,[se][FM](me))}a(be,"_notifyEvents");function Qe(J,se){for(var me=[],Ce=2;Ce0&&vt(se,function(He){He&&He[Jf]()>0&&F(J,[He.events()][FM](me))})}a(Qe,"_notifyBatchEvents");function pe(J,se,me){J&&J[zo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,me!==!0])}a(pe,"_sendingEvent");function Se(J,se){Qe("eventsSent",J,se),K()}a(Se,"_eventsSentEvent");function Fe(J,se){Qe(rY,J,se>=8e3&&se<=8999?se-8e3:TM.Unknown)}a(Fe,"_eventsDropped");function te(J){Qe(rY,J,TM.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(J,se){Qe(rY,J,TM.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=Kk(W*(ftn+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Fae);var pS=de(require("os"));var Aje=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=Xbo(e),this.commonProperties=e1o(e),this.#e=bs(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new n5t,n=new S5t,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){Nr.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){Nr.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(Lr).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Nr.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(nr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Xbo(t){let e={},r=t.get(Qa);e["ai.session.id"]=r.sessionId;let n=t.get(Bp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${pS.type()} ${pS.release()}`,e["ai.device.osArchitecture"]=pS.arch(),e["ai.device.osPlatform"]=pS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Xbo,"getTags");function e1o(t){let e={};e.common_os=pS.platform(),e.common_platformversion=pS.release(),e.common_arch=pS.arch(),e.common_cpu=Array.from(new Set(pS.cpus().map(n=>n.model))).join();let r=t.get(Qa);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(e1o,"getCommonProperties");var t1o="7d7048df-6dd0-4048-bb23-b716c1461f8f",r1o="3fdd7f28-937a-48c8-9a21-ba337db23bd1",n1o="b73649cf-ca8f-4768-9e0e-b789d8529db5",i1o="5fb6107a-6a29-423f-a824-22e3724fa2a6",o1o="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function s1o(t){return LU(t)==="prod"?n1o:i1o}a(s1o,"getMsftInstrumentationKey");function Atn(t){return new URL(t).hostname==="github.com"?KW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(Atn,"getEndpointForServerUrl");var mf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=Atn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];bs(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(eg);if(o.setReporter(new pae(r,this.namespace,{instrumentationKey:t1o,endpointUrl:n})),o.setRestrictedReporter(new pae(r,this.namespace,{instrumentationKey:r1o,endpointUrl:n})),o.setMsftReporter(new pae(r,`copilot/${this.namespace}`,{instrumentationKey:s1o(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new Aje(r,"ThirdParty.copilot-chat",o1o,!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(eg);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(eg).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=Atn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function a1o(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Vf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(mf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return S_.exception(t,n,"signUpLimited failed"),!1}}a(a1o,"apiFetchSignUpLimited");async function I5t(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 a1o(t,e)?I5t(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(I5t,"getTokenWithSignUpLimited");p();p();var ytn=de(ei());var Wi=class extends ytn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var c1o={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},bn=class{constructor(){this.capabilities={...c1o};this.emitter=new Wi;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 o3=require("fs"),Yae=require("os"),Kae=de(require("path")),U7=require("process");var ti=class{static{a(this,"PersistenceManager")}},x5t=class extends ti{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 o3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Kae.dirname(s);c!==this.directory&&await o3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await cSe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await o3.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 cSe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` `;l===`{} -`?await i3.promises.rm(o):await i3.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 oSe.acquire(n),await i3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await i3.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 i3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},oSe=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 Xbo(){if(B7.env.XDG_CONFIG_HOME&&Yae.isAbsolute(B7.env.XDG_CONFIG_HOME))return B7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,zae.platform)()==="win32"){let e=B7.env.USERPROFILE||S5t.homedir();return e?e+"\\AppData\\Local\\github-copilot":htn()}let t=B7.env.HOME&&B7.env.HOME.length>0?B7.env.HOME:S5t.homedir();return t?t+"/.config/github-copilot":htn()}a(Xbo,"getXdgConfigPath");var S5t={homedir:zae.homedir,tmpdir:zae.tmpdir};function htn(){return Yae.join(S5t.tmpdir(),"github-copilot")}a(htn,"tmpdirConfigPath");function mtn(){return new b5t(Xbo())}a(mtn,"makeXdgPersistenceManager");p();var ps=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}}},pje=class extends ps{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var gtn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Atn(t,e){At(t,gtn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Atn,"telemetryAuthPickerListed");function T5t(t,e){At(t,gtn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(T5t,"telemetryAuthPickerUsed");p();var F7={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",EncryptionDecryptV1ToV0:"auth.encryption.decryptV1ToV0"};function ytn(t,e){Vn(t,F7.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(ytn,"telemetryAuthStoreInitialize");function Etn(t,e){Vn(t,F7.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(Etn,"telemetryAuthStoreError");function _tn(t,e){Vn(t,F7.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(_tn,"telemetryAuthStoreMigration");function I5t(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)),At(t,F7.SessionActivated,r,{durationMs:e.durationMs})}a(I5t,"telemetryAuthSessionActivated");function vtn(t,e){At(t,F7.SessionDeactivated,{editorId:e.editorId})}a(vtn,"telemetryAuthSessionDeactivated");function sSe(t,e){At(t,F7.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(sSe,"telemetryAuthTokenRevoked");function hje(t,e){Vn(t,F7.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(hje,"telemetryAuthEncryptionInitialize");function x5t(t,e){Vn(t,F7.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(x5t,"telemetryAuthEncryptionDecryptV1ToV0");var e1o="apps",Ctn="hosts",Md=new fe("AuthManager"),btn="legacy_files_migration_done",t1o=5,r1o=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($m).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"),Md.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(ps).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 C5t(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(Lo).requireReady();let{session:r,sourceEnvVar:n}=R5t(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Md.info(this.ctx,`resolveSessionWithSource: resolved from env var ${n}`),{session:{...r,...$y(r)},sourceEnvVar:n};let o=await this.transientSession;if(o)return o.accessToken===void 0?(Md.info(this.ctx,"resolveSessionWithSource: transient session is a shadow, no session"),{session:void 0}):(Md.info(this.ctx,"resolveSessionWithSource: resolved from transient session"),{session:{...o,...$y(o)}});let s=await this.resolvePersistedSession({authAuthority:e});return Md.info(this.ctx,`resolveSessionWithSource: persisted store ${s?"resolved a session":"returned no session"}`),{session:s}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},mje=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(nx)}async tracked(r,n){try{return await n()}catch(o){throw Md.exception(this.ctx,o,`authStore.${r}`),Etn(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Ir).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=UU(this.ctx,r.authAuthority)}catch(o){Md.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:i1o(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(btn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Yn),h=this.editorId(),[m,g]=await Promise.all([f.readAll(e1o).catch(()=>({})),f.readAll(Ctn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Stn(y);if(!E){c++;continue}let[_,v]=n1o(A)??["github.com",Kae],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!jDt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:w5t(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Stn(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(!jDt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Kae,scopes:w5t(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(btn,String(Date.now())))}catch{}this.ctx.get(Yn).deleteSetting(Ctn).catch(()=>{}),_tn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Md.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(t1o);if(Md.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Rh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Md.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{Md.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Md.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){Md.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),I5t(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Md.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Md.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Md.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new yi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new yi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Md.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:w5t(r.scopes)}));Md.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),I5t(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=UU(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 Md.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),vtn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Md.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Md.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),sSe(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 T5t(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,f=!1;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{f=!0,d="NotSignedIn"}let h;switch(d){case"OK":h="ok";break;case"NotAuthorized":h="not_entitled";break;default:h=f?"transient":"revoked";break}return T5t(this.ctx,{editorId:o,status:h,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:h}}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 Atn(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(bn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o),u=!l&&!s&&!c;if(u&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Md.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=UU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Md.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Md.info(this.ctx,`resolvePersistedSession: active session appId mismatch editorId=${o}`);return}let f=this.tokenRecordToSession(l.record);if(!f){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let h=Date.now();return h-this.lastTouchAt>=r1o&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function n1o(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(n1o,"splitAppsKey");function i1o(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(i1o,"normalizeScopes");function w5t(t){return t?typeof t=="string"?t:t.join(" "):""}a(w5t,"scopesToString");function Stn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Stn,"asLegacyAuthRecord");function R5t(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...$y({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:{...$y({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:{...$y({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(R5t,"getSessionFromEnv");p();var o1o=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Ttn="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.",Itn="https://gh.io/copilot-network-errors",CC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&o1o.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new fe("certificates").error(e,`${Ttn} Please visit ${Itn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ts).showWarningMessage(Ttn,n).then(o=>{if(o?.title===n.title)return e.get(Vm).open(Itn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var vA=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 bC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(bC,"delay");async function vx(t,e,r){let n=new Array(t.length),o=Math.floor(e)>0?Math.floor(e):1,s=Math.max(1,Math.min(o,t.length)),c=0,l=a(async()=>{for(let u=c++;ul())),n}a(vx,"mapWithConcurrency");function Jae(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Jae,"fireAndForget");function xtn(t){let e=Math.floor(t)>0?Math.floor(t):1,r=0,n=[],o=a(()=>rn.push(()=>{r++,c()})),"acquire"),s=a(()=>{r--,n.shift()?.()},"release");return{async run(c){await o();try{return await c()}finally{s()}}}}a(xtn,"createLimiter");function o3(t,e,r){return new Promise(n=>{let o=!1,s=setTimeout(()=>{o||(o=!0,n(r))},e),c=a(l=>{o||(o=!0,clearTimeout(s),n(l))},"finish");t.then(c,()=>c(r))})}a(o3,"withTimeout");function Zae(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Zae,"safeInit");var k5t=class extends yi{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 Wi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Wi;this.onDidResetToken=this.didResetToken.event}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(Rh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),ktn(this.ctx).value)return;let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(wtn(this.ctx,"started",r),this.startTokenRefresh(n=>{wtn(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 b_.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(ps).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(Rtn(this.ctx))throw this.tokenPrimingError=r,r;b_.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(ps);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"});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(CC).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=BU(),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?Vn(this.ctx,"auth.token_reset_complete",e.exception,s,l):At(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=BU(),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 k5t(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}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){b_.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(Et(this.ctx,"auth.reset_token_"+r),b_.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):b_.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=BU(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;At(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.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function rx(t){return t.get(Qt).getLastToken()}a(rx,"getLastCopilotToken");function wtn(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?Vn(t,"auth.proactive_copilot_token_refresh",o,s,c):At(t,"auth.proactive_copilot_token_refresh",s,c)}a(wtn,"telemetryProactiveCopilotTokenRefresh");p();var Cx=class{static{a(this,"Clock")}now(){return new Date}};p();var dP=class{static{a(this,"ExpConfigMaker")}},aSe=class extends dP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(tr),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 nC.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return nC.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return qa(r,m,"fetchExperiments"),nC.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 nC(f.Parameters,d.AssignmentContext,h.join(";"))}},gje=class extends dP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(nC.createEmptyConfig())}};p();p();var Aje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},P5t=class extends Aje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Ptn=a(t=>new P5t(t),"DEFAULT_GRANULARITY"),yje=class extends Aje{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 Dtn="X-Copilot-ClientTimeBucket",Eje=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Ptn(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 yje(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(Dtn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Dtn,s))}}};p();p();p();p();var D5t=new Map;async function a1o(t){if(D5t.has(t))return D5t.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return D5t.set(t,e),e}a(a1o,"getCachedHmacKey");async function c1o(t){if(t)try{let e=await a1o(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(c1o,"createRequestHMAC");async function Ntn(t,e){let r=await c1o(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Ntn,"createMsBenchHmacHeaders");p();p();p();p();var vje="4.13.1",Xz="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Mtn="common",_je;(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"})(_je||(_je={}));var cSe=_je.AzurePublicCloud,Otn="login.microsoftonline.com",Ltn=["*"],Btn="cae",Ftn="nocae",Utn="msal.cache";var N5t;var l1o,Cje,qtn;function jtn(){return Cje!==void 0&&qtn!==void 0}a(jtn,"hasVSCodePlugin");function u1o(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(N5t===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||Utn;e.cache.cachePlugin=N5t({name:`${r}.${Ftn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=N5t({name:`${r}.${Btn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=f1o(t.isVSCodeCredential||!1)),e}a(u1o,"generatePluginConfiguration");var Qtn={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")},d1o={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return qtn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return l1o}}};function f1o(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=d1o[t?"vsCode":"native"];if(o===void 0)throw new Error(Qtn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(Qtn.unavailable(e,r));return o.broker}a(f1o,"getBrokerPlugin");var Htn={generatePluginConfiguration:u1o};p();p();p();function p1o(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(p1o,"isErrorResponse");var $tn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=$tn}},bje="AuthenticationError",U7=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(p1o(r))o=Gtn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=Gtn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?await o3.promises.rm(o):await o3.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 cSe.acquire(n),await o3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await o3.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 o3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},cSe=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 l1o(){if(U7.env.XDG_CONFIG_HOME&&Kae.isAbsolute(U7.env.XDG_CONFIG_HOME))return U7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Yae.platform)()==="win32"){let e=U7.env.USERPROFILE||w5t.homedir();return e?e+"\\AppData\\Local\\github-copilot":Etn()}let t=U7.env.HOME&&U7.env.HOME.length>0?U7.env.HOME:w5t.homedir();return t?t+"/.config/github-copilot":Etn()}a(l1o,"getXdgConfigPath");var w5t={homedir:Yae.homedir,tmpdir:Yae.tmpdir};function Etn(){return Kae.join(w5t.tmpdir(),"github-copilot")}a(Etn,"tmpdirConfigPath");function _tn(){return new x5t(l1o())}a(_tn,"makeXdgPersistenceManager");p();var ps=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}}},yje=class extends ps{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var vtn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Ctn(t,e){Rt(t,vtn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Ctn,"telemetryAuthPickerListed");function R5t(t,e){Rt(t,vtn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(R5t,"telemetryAuthPickerUsed");p();var Q7={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",EncryptionDecryptV1ToV0:"auth.encryption.decryptV1ToV0"};function btn(t,e){ai(t,Q7.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(btn,"telemetryAuthStoreInitialize");function Stn(t,e){ai(t,Q7.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(Stn,"telemetryAuthStoreError");function Ttn(t,e){ai(t,Q7.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(Ttn,"telemetryAuthStoreMigration");function k5t(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)),Rt(t,Q7.SessionActivated,r,{durationMs:e.durationMs})}a(k5t,"telemetryAuthSessionActivated");function Itn(t,e){Rt(t,Q7.SessionDeactivated,{editorId:e.editorId})}a(Itn,"telemetryAuthSessionDeactivated");function lSe(t,e){Rt(t,Q7.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(lSe,"telemetryAuthTokenRevoked");function Eje(t,e){ai(t,Q7.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(Eje,"telemetryAuthEncryptionInitialize");function P5t(t,e){ai(t,Q7.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(P5t,"telemetryAuthEncryptionDecryptV1ToV0");var u1o="apps",xtn="hosts",Ld=new fe("AuthManager"),wtn="legacy_files_migration_done",d1o=5,f1o=6e4,Lr=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(Wm).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"),Ld.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(ps).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 I5t(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(Bo).requireReady();let{session:r,sourceEnvVar:n}=N5t(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Ld.info(this.ctx,`resolveSessionWithSource: resolved from env var ${n}`),{session:{...r,...Vy(r)},sourceEnvVar:n};let o=await this.transientSession;if(o)return o.accessToken===void 0?(Ld.info(this.ctx,"resolveSessionWithSource: transient session is a shadow, no session"),{session:void 0}):(Ld.info(this.ctx,"resolveSessionWithSource: resolved from transient session"),{session:{...o,...Vy(o)}});let s=await this.resolvePersistedSession({authAuthority:e});return Ld.info(this.ctx,`resolveSessionWithSource: persisted store ${s?"resolved a session":"returned no session"}`),{session:s}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},_je=class extends Lr{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(sx)}async tracked(r,n){try{return await n()}catch(o){throw Ld.exception(this.ctx,o,`authStore.${r}`),Stn(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Ir).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=qU(this.ctx,r.authAuthority)}catch(o){Ld.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:h1o(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(wtn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(ti),h=this.editorId(),[m,g]=await Promise.all([f.readAll(u1o).catch(()=>({})),f.readAll(xtn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Rtn(y);if(!E){c++;continue}let[_,v]=p1o(A)??["github.com",Jae],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!VDt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:D5t(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Rtn(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(!VDt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Jae,scopes:D5t(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(wtn,String(Date.now())))}catch{}this.ctx.get(ti).deleteSetting(xtn).catch(()=>{}),Ttn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Ld.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(d1o);if(Ld.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Ph);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Ld.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{Ld.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Ld.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){Ld.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),k5t(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Ld.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Ld.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Ld.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new yi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new yi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Ld.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:D5t(r.scopes)}));Ld.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),k5t(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=qU(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 Ld.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),Itn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Ld.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Ld.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),lSe(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),await this.checkAndUpdateStatus({forceRefresh:!0})),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return R5t(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,f=!1;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{f=!0,d="NotSignedIn"}let h;switch(d){case"OK":h="ok";break;case"NotAuthorized":h="not_entitled";break;default:h=f?"transient":"revoked";break}return R5t(this.ctx,{editorId:o,status:h,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:h}}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 Ctn(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(bn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o),u=!l&&!s&&!c;if(u&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Ld.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=qU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Ld.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Ld.info(this.ctx,`resolvePersistedSession: active session appId mismatch editorId=${o}`);return}let f=this.tokenRecordToSession(l.record);if(!f){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let h=Date.now();return h-this.lastTouchAt>=f1o&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function p1o(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(p1o,"splitAppsKey");function h1o(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(h1o,"normalizeScopes");function D5t(t){return t?typeof t=="string"?t:t.join(" "):""}a(D5t,"scopesToString");function Rtn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Rtn,"asLegacyAuthRecord");function N5t(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...Vy({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:{...Vy({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:{...Vy({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(N5t,"getSessionFromEnv");p();var m1o=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],ktn="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.",Ptn="https://gh.io/copilot-network-errors",bC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&m1o.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new fe("certificates").error(e,`${ktn} Please visit ${Ptn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ts).showWarningMessage(ktn,n).then(o=>{if(o?.title===n.title)return e.get(zm).open(Ptn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var CA=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 SC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(SC,"delay");async function hS(t,e,r){let n=new Array(t.length),o=Math.floor(e)>0?Math.floor(e):1,s=Math.max(1,Math.min(o,t.length)),c=0,l=a(async()=>{for(let u=c++;ul())),n}a(hS,"mapWithConcurrency");function Zae(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Zae,"fireAndForget");function Dtn(t){let e=Math.floor(t)>0?Math.floor(t):1,r=0,n=[],o=a(()=>rn.push(()=>{r++,c()})),"acquire"),s=a(()=>{r--,n.shift()?.()},"release");return{async run(c){await o();try{return await c()}finally{s()}}}}a(Dtn,"createLimiter");function s3(t,e,r){return new Promise(n=>{let o=!1,s=setTimeout(()=>{o||(o=!0,n(r))},e),c=a(l=>{o||(o=!0,clearTimeout(s),n(l))},"finish");t.then(c,()=>c(r))})}a(s3,"withTimeout");function Xae(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Xae,"safeInit");var M5t=class extends yi{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 Wi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Wi;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Lr).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(Ph).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),Otn(this.ctx).value)return;let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(Ntn(this.ctx,"started",r),this.startTokenRefresh(n=>{Ntn(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 S_.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(ps).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(Mtn(this.ctx))throw this.tokenPrimingError=r,r;S_.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(ps);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"});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(bC).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=UU(),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?ai(this.ctx,"auth.token_reset_complete",e.exception,s,l):Rt(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=UU(),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 M5t(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}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){S_.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(At(this.ctx,"auth.reset_token_"+r),S_.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):S_.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=UU(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;Rt(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.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function ox(t){return t.get(Qt).getLastToken()}a(ox,"getLastCopilotToken");function Ntn(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?ai(t,"auth.proactive_copilot_token_refresh",o,s,c):Rt(t,"auth.proactive_copilot_token_refresh",s,c)}a(Ntn,"telemetryProactiveCopilotTokenRefresh");p();var Sx=class{static{a(this,"Clock")}now(){return new Date}};p();var pP=class{static{a(this,"ExpConfigMaker")}},A1o=5e3,y1o=2e3,uSe=class extends pP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=Object.keys(o).length===0?this.defaultFilters:o,c=new URL("telemetry",n.telemetry).href,l=await this.fetchOnce(r,c,s,A1o);return l.kind==="failure"&&l.retryable&&(l=await this.fetchOnce(r,c,s,y1o)),l.kind==="failure"?jI.createFallbackConfig(r,l.reason):l.config}async fetchOnce(r,n,o,s){let c=r.get(nr),l;try{l=await c.fetch(n,{method:"GET",headers:o,timeout:s})}catch(h){return{kind:"failure",reason:`Error fetching ExP config: ${String(h)}`,retryable:!0}}if(!l.ok){let h=l.status>=500||l.status===429;return{kind:"failure",reason:`ExP responded with ${l.status}`,retryable:h}}let u;try{u=await l.json()}catch(h){if(h instanceof SyntaxError)return ua(r,h,"fetchExperiments"),{kind:"failure",reason:"ExP responded with invalid JSON",retryable:!1};throw h}let d=u.Configs.find(h=>h.Id==="vscode")??{Id:"vscode",Parameters:{}},f=Object.entries(d.Parameters).map(([h,m])=>h+(m?"":"cf"));return{kind:"success",config:new jI(d.Parameters,u.AssignmentContext,f.join(";"))}}},vje=class extends pP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(jI.createEmptyConfig())}};p();p();var Cje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},O5t=class extends Cje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Ltn=a(t=>new O5t(t),"DEFAULT_GRANULARITY"),bje=class extends Cje{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 Btn="X-Copilot-ClientTimeBucket",Sje=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Ltn(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 bje(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(Btn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Btn,s))}}};p();p();p();p();var L5t=new Map;async function E1o(t){if(L5t.has(t))return L5t.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return L5t.set(t,e),e}a(E1o,"getCachedHmacKey");async function _1o(t){if(t)try{let e=await E1o(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(_1o,"createRequestHMAC");async function Ftn(t,e){let r=await _1o(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Ftn,"createMsBenchHmacHeaders");p();p();p();p();var Ije="4.13.1",nY="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Utn="common",Tje;(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"})(Tje||(Tje={}));var dSe=Tje.AzurePublicCloud,Qtn="login.microsoftonline.com",qtn=["*"],jtn="cae",Htn="nocae",Gtn="msal.cache";var B5t;var v1o,xje,Vtn;function Wtn(){return xje!==void 0&&Vtn!==void 0}a(Wtn,"hasVSCodePlugin");function C1o(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(B5t===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||Gtn;e.cache.cachePlugin=B5t({name:`${r}.${Htn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=B5t({name:`${r}.${jtn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=S1o(t.isVSCodeCredential||!1)),e}a(C1o,"generatePluginConfiguration");var $tn={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")},b1o={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return Vtn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return v1o}}};function S1o(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=b1o[t?"vsCode":"native"];if(o===void 0)throw new Error($tn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error($tn.unavailable(e,r));return o.broker}a(S1o,"getBrokerPlugin");var ztn={generatePluginConfiguration:C1o};p();p();p();function T1o(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(T1o,"isErrorResponse");var Ktn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=Ktn}},wje="AuthenticationError",q7=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(T1o(r))o=Ytn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=Ytn(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=bje}},Vtn="AggregateAuthenticationError",lSe=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=wje}},Jtn="AggregateAuthenticationError",fSe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=Vtn}};function Gtn(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(Gtn,"convertOAuthErrorResponseToErrorResponse");var bx=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 Wtn=require("node:os"),ztn=de(require("node:util"),1),Ytn=de(require("node:process"),1);function Ktn(t,...e){Ytn.stderr.write(`${ztn.default.format(t,...e)}${Wtn.EOL}`)}a(Ktn,"log");var Jtn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Ztn,M5t=[],O5t=[],Sje=[];Jtn&&L5t(Jtn);var Xtn=Object.assign(t=>ern(t),{enable:L5t,enabled:B5t,disable:h1o,log:Ktn});function L5t(t){Ztn=t,M5t=[],O5t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?O5t.push(new RegExp(`^${n.substr(1)}$`)):M5t.push(new RegExp(`^${n}$`));for(let n of Sje)n.enabled=B5t(n.namespace)}a(L5t,"enable");function B5t(t){if(t.endsWith("*"))return!0;for(let e of O5t)if(e.test(t))return!1;for(let e of M5t)if(e.test(t))return!0;return!1}a(B5t,"enabled");function h1o(){let t=Ztn||"";return L5t(""),t}a(h1o,"disable");function ern(t){let e=Object.assign(r,{enabled:B5t(t),destroy:m1o,log:Xtn.log,namespace:t,extend:g1o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Sje.push(e),e}a(ern,"createDebugger");function m1o(){let t=Sje.indexOf(this);return t>=0?(Sje.splice(t,1),!0):!1}a(m1o,"destroy");function g1o(t){let e=ern(`${this.namespace}:${t}`);return e.log=this.log,e}a(g1o,"extend");var Xae=Xtn;var rrn=new Set,Tje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,xje,F5t=Xae("azure");F5t.log=(...t)=>{Xae.log(...t)};var U5t=["verbose","info","warning","error"];Tje&&(orn(Tje)?A1o(Tje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Tje}'; logging is not enabled. Acceptable values: ${U5t.join(", ")}.`));function A1o(t){if(t&&!orn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${U5t.join(",")}`);xje=t;let e=[];for(let r of rrn)irn(r)&&e.push(r.namespace);Xae.enable(e.join(","))}a(A1o,"setLogLevel");function wje(){return xje}a(wje,"getLogLevel");var trn={verbose:400,info:300,warning:200,error:100};function Q7(t){let e=F5t.extend(t);return nrn(F5t,e),{error:Ije(e,"error"),warning:Ije(e,"warning"),info:Ije(e,"info"),verbose:Ije(e,"verbose")}}a(Q7,"createClientLogger");function nrn(t,e){e.log=(...r)=>{t.log(...r)}}a(nrn,"patchLogMethod");function Ije(t,e){let r=Object.assign(t.extend(e),{level:e});if(nrn(t,r),irn(r)){let n=Xae.disable();Xae.enable(n+","+r.namespace)}return rrn.add(r),r}a(Ije,"createLogger");function irn(t){return!!(xje&&trn[t.level]<=trn[xje])}a(irn,"shouldEnable");function orn(t){return U5t.includes(t)}a(orn,"isAzureLogLevel");var hS=Q7("identity");function Rje(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(Rje,"processEnvVars");function e0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(e0,"formatSuccess");function Us(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(Us,"formatError");function srn(t,e,r=hS){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(srn,"credentialLoggerInstance");function lo(t,e=hS){let r=srn(t,void 0,e);return{...r,parent:e,getToken:srn("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var ece={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function arn(t={}){let e=new Q5t(t.parentContext);return t.span&&(e=e.setValue(ece.span,t.span)),t.namespace&&(e=e.setValue(ece.namespace,t.namespace)),e}a(arn,"createTracingContext");var Q5t=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 crn=de(q5t(),1),Pje=crn.state;function y1o(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(y1o,"createDefaultTracingSpan");function E1o(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:y1o(),tracingContext:arn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(E1o,"createDefaultInstrumenter");function uSe(){return Pje.instrumenterImplementation||(Pje.instrumenterImplementation=E1o()),Pje.instrumenterImplementation}a(uSe,"getInstrumenter");p();function dSe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=uSe().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(ece.namespace)||(A=A.setValue(ece.namespace,e)),y.setAttribute("az.namespace",A.getValue(ece.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 uSe().withContext(d,f,...h)}a(c,"withContext");function l(d){return uSe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return uSe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(dSe,"createTracingClient");var Mc=dSe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:vje});var j5t=lo("ChainedTokenCredential"),fSe=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 Mc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new lSe(s,"ChainedTokenCredential authentication failed.");throw j5t.getToken.info(Us(e,l)),l}if(j5t.getToken.info(`Result for ${o.constructor.name}: ${e0(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var _S={};ki(_S,{AuthError:()=>Fo,AuthErrorCodes:()=>vce,AzureCloudInstance:()=>l3,ClientAssertion:()=>p3,ClientAuthError:()=>G7,ClientAuthErrorCodes:()=>$p,ClientConfigurationError:()=>cce,ClientConfigurationErrorCodes:()=>uce,ConfidentialClientApplication:()=>Fce,CryptoProvider:()=>jM,DistributedCachePlugin:()=>mGe,InteractionRequiredAuthError:()=>AS,InteractionRequiredAuthErrorCodes:()=>fHe,LogLevel:()=>mf,Logger:()=>r0,ManagedIdentityApplication:()=>Uce,ManagedIdentitySourceNames:()=>no,PromptValue:()=>f2o,ProtocolMode:()=>Xy,PublicClientApplication:()=>Lce,ResponseMode:()=>p2o,ServerError:()=>k_,TokenCache:()=>Sce,TokenCacheContext:()=>mS,internals:()=>mBt,version:()=>ES});p();var mBt={};ki(mBt,{Deserializer:()=>f3,Serializer:()=>q7});p();p();var q7=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 an={};ki(an,{addApplicationTelemetry:()=>ISe,addAuthorizationCode:()=>HLt,addBrokerParameters:()=>c3,addCcsOid:()=>s3,addCcsUpn:()=>$7,addClaims:()=>uY,addCliData:()=>VLt,addClientAssertion:()=>RSe,addClientAssertionType:()=>kSe,addClientCapabilitiesToClaims:()=>prn,addClientId:()=>cY,addClientInfo:()=>fY,addClientSecret:()=>wSe,addCodeChallengeParams:()=>TSo,addCodeVerifier:()=>$Lt,addCorrelationId:()=>dY,addDeviceCode:()=>ISo,addDomainHint:()=>QLt,addEARParameters:()=>PSo,addExtraParameters:()=>a3,addGrantType:()=>PSe,addIdTokenHint:()=>ULt,addInstanceAware:()=>DSe,addLibraryInfo:()=>TSe,addLoginHint:()=>fce,addLogoutHint:()=>WLt,addNativeBroker:()=>SSo,addNonce:()=>jLt,addOboAssertion:()=>xSo,addPassword:()=>kSo,addPopToken:()=>NSe,addPostLogoutRedirectUri:()=>FLt,addPrompt:()=>qLt,addRedirectUri:()=>lY,addRefreshToken:()=>GLt,addRequestTokenUse:()=>wSo,addResource:()=>BSe,addResponseMode:()=>BLt,addResponseType:()=>bSo,addScopes:()=>aY,addServerTelemetry:()=>OSe,addSid:()=>tHe,addSshJwk:()=>MSe,addState:()=>xSe,addThrottling:()=>LSe,addUsername:()=>RSo,instrumentBrokerParams:()=>sY});p();var er={};ki(er,{AADAuthority:()=>fP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>W5t,AAD_TENANT_DOMAIN_SUFFIX:()=>z5t,ADFS:()=>$5t,APP_METADATA:()=>oce,AUTHORITY_METADATA_CACHE_KEY:()=>sce,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>u4t,AUTHORIZATION_PENDING:()=>b1o,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>Z5t,AuthenticationScheme:()=>hf,AuthorityMetadataSource:()=>Zy,CACHE_ACCOUNT_TYPE_ADFS:()=>c4t,CACHE_ACCOUNT_TYPE_GENERIC:()=>Uje,CACHE_ACCOUNT_TYPE_MSAV1:()=>j1o,CACHE_ACCOUNT_TYPE_MSSTS:()=>a4t,CACHE_KEY_SEPARATOR:()=>tY,CIAM_AUTH_URL:()=>Dje,CLIENT_INFO:()=>l4t,CLIENT_INFO_SEPARATOR:()=>ice,CLIENT_MISMATCH_ERROR:()=>_4t,CODE_GRANT_TYPE:()=>v1o,CONSUMER_UTID:()=>_1o,CacheOutcome:()=>pP,CacheType:()=>H1o,ClaimsRequestKeys:()=>nce,CodeChallengeMethodValues:()=>Q1o,CredentialType:()=>t0,DEFAULT_AUTHORITY:()=>lrn,DEFAULT_AUTHORITY_HOST:()=>G5t,DEFAULT_COMMON_TENANT:()=>pSe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>A4t,DEFAULT_THROTTLE_TIME_SECONDS:()=>g4t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>v4t,DSTS:()=>V5t,EMAIL_SCOPE:()=>frn,EncodingTypes:()=>W1o,FORWARD_SLASH:()=>tce,GrantType:()=>gSe,HTTP_BAD_REQUEST:()=>Bje,HTTP_CLIENT_ERROR:()=>w1o,HTTP_CLIENT_ERROR_RANGE_END:()=>n4t,HTTP_CLIENT_ERROR_RANGE_START:()=>r4t,HTTP_GATEWAY_TIMEOUT:()=>L1o,HTTP_GONE:()=>D1o,HTTP_MULTI_SIDED_ERROR:()=>B1o,HTTP_NOT_FOUND:()=>k1o,HTTP_REDIRECT:()=>x1o,HTTP_REQUEST_TIMEOUT:()=>P1o,HTTP_SERVER_ERROR:()=>M1o,HTTP_SERVER_ERROR_RANGE_END:()=>o4t,HTTP_SERVER_ERROR_RANGE_START:()=>i4t,HTTP_SERVICE_UNAVAILABLE:()=>O1o,HTTP_SUCCESS:()=>Lje,HTTP_SUCCESS_RANGE_END:()=>I1o,HTTP_SUCCESS_RANGE_START:()=>T1o,HTTP_TOO_MANY_REQUESTS:()=>N1o,HTTP_UNAUTHORIZED:()=>R1o,HeaderNames:()=>Gp,HttpMethod:()=>F1o,IMDS_ENDPOINT:()=>Oje,IMDS_TIMEOUT:()=>J5t,IMDS_VERSION:()=>K5t,INVALID_GRANT_ERROR:()=>E4t,INVALID_INSTANCE:()=>t4t,JsonWebTokenTypes:()=>$1o,KNOWN_PUBLIC_CLOUDS:()=>e4t,NOT_APPLICABLE:()=>hSe,NOT_AVAILABLE:()=>eY,OAuthResponseType:()=>q1o,OFFLINE_ACCESS_SCOPE:()=>Mje,OIDC_DEFAULT_SCOPES:()=>rce,OIDC_SCOPES:()=>Fje,ONE_DAY_IN_MS:()=>V1o,OPENID_SCOPE:()=>urn,PROFILE_SCOPE:()=>drn,PasswordGrantConstants:()=>jje,PersistentCacheKeys:()=>U1o,PromptValue:()=>mSe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>X5t,RESOURCE_DELIM:()=>Nje,RegionDiscoveryOutcomes:()=>ESe,RegionDiscoverySources:()=>H7,ResponseMode:()=>s4t,S256_CODE_CHALLENGE_METHOD:()=>C1o,SERVER_TELEM_CACHE_KEY:()=>ASe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>qje,SERVER_TELEM_MAX_CACHED_ERRORS:()=>f4t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>G1o,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>d4t,SERVER_TELEM_OVERFLOW_FALSE:()=>h4t,SERVER_TELEM_OVERFLOW_TRUE:()=>p4t,SERVER_TELEM_SCHEMA_VERSION:()=>Qje,SERVER_TELEM_UNKNOWN_ERROR:()=>m4t,SERVER_TELEM_VALUE_SEPARATOR:()=>j7,SHR_NONCE_VALIDITY:()=>S1o,SKU:()=>H5t,THE_FAMILY_ID:()=>rY,THROTTLING_PREFIX:()=>ySe,URL_FORM_CONTENT_TYPE:()=>Y5t,X_MS_LIB_CAPABILITY_VALUE:()=>y4t});p();var H5t="msal.js.common",lrn="https://login.microsoftonline.com/common/",G5t="login.microsoftonline.com",pSe="common",$5t="adfs",V5t="dstsv2",W5t=`${lrn}discovery/instance?api-version=1.1&authorization_endpoint=`,Dje=".ciamlogin.com",z5t=".onmicrosoft.com",Nje="|",_1o="9188040d-6c67-4c5b-b112-36a304b66dad",urn="openid",drn="profile",Mje="offline_access",frn="email",v1o="authorization_code",C1o="S256",Y5t="application/x-www-form-urlencoded;charset=utf-8",b1o="authorization_pending",hSe="N/A",eY="Not Available",tce="/",Oje="http://169.254.169.254/metadata/instance/compute/location",K5t="2020-06-01",J5t=2e3,Z5t="TryAutoDetect",X5t="login.microsoft.com",e4t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],S1o=240,t4t="invalid_instance",Lje=200,T1o=200,I1o=299,x1o=302,w1o=400,r4t=400,Bje=400,R1o=401,k1o=404,P1o=408,D1o=410,N1o=429,n4t=499,M1o=500,i4t=500,O1o=503,L1o=504,o4t=599,B1o=600,F1o={GET:"GET",POST:"POST"},rce=[urn,drn,Mje],Fje=[...rce,frn],Gp={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"},U1o={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},fP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},nce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},mSe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Q1o={PLAIN:"plain",S256:"S256"},q1o={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},s4t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},gSe={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"},a4t="MSSTS",c4t="ADFS",j1o="MSA",Uje="Generic",tY="-",ice=".",t0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},H1o={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},oce="appmetadata",l4t="client_info",rY="1",sce="authority-metadata",u4t=3600*24,Zy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Qje=5,G1o=80,d4t=330,f4t=50,ASe="server-telemetry",qje="|",j7=",",p4t="1",h4t="0",m4t="unknown_error",hf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},g4t=60,A4t=3600,ySe="throttling",y4t="retry-after, h429",E4t="invalid_grant",_4t="client_mismatch",jje={username:"username",password:"password"},H7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},ESe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},pP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},$1o={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},V1o=864e5,v4t=300,W1o={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var nY={};ki(nY,{ACCESS_TOKEN:()=>K1o,BROKER_CLIENT_ID:()=>_Se,BROKER_REDIRECT_URI:()=>Wje,CCS_HEADER:()=>iSo,CLAIMS:()=>T4t,CLIENT_ASSERTION:()=>Y4t,CLIENT_ASSERTION_TYPE:()=>K4t,CLIENT_ID:()=>FM,CLIENT_INFO:()=>tSo,CLIENT_REQUEST_ID:()=>O4t,CLIENT_SECRET:()=>z4t,CLI_DATA:()=>aLt,CODE:()=>P4t,CODE_CHALLENGE:()=>D4t,CODE_CHALLENGE_METHOD:()=>N4t,CODE_VERIFIER:()=>M4t,DEVICE_CODE:()=>W4t,DOMAIN_HINT:()=>nLt,EAR_JWE_CRYPTO:()=>oLt,EAR_JWK:()=>iLt,ERROR:()=>z1o,ERROR_DESCRIPTION:()=>Y1o,EXPIRES_IN:()=>Z1o,FOCI:()=>nSo,GRANT_TYPE:()=>S4t,ID_TOKEN:()=>J1o,ID_TOKEN_HINT:()=>V4t,INSTANCE_AWARE:()=>ace,LOGIN_HINT:()=>rLt,LOGOUT_HINT:()=>eLt,NATIVE_BROKER:()=>X4t,NONCE:()=>R4t,OBO_ASSERTION:()=>J4t,ON_BEHALF_OF:()=>rSo,POST_LOGOUT_URI:()=>$4t,PROMPT:()=>k4t,REDIRECT_URI:()=>Hje,REFRESH_TOKEN:()=>x4t,REFRESH_TOKEN_EXPIRES_IN:()=>X1o,REQUESTED_TOKEN_USE:()=>Z4t,REQ_CNF:()=>$je,RESOURCE:()=>sLt,RESPONSE_MODE:()=>b4t,RESPONSE_TYPE:()=>C4t,RETURN_SPA_CODE:()=>Vje,SCOPE:()=>I4t,SESSION_STATE:()=>eSo,SID:()=>tLt,STATE:()=>w4t,TOKEN_TYPE:()=>Gje,X_APP_NAME:()=>H4t,X_APP_VER:()=>G4t,X_CLIENT_CPU:()=>U4t,X_CLIENT_CURR_TELEM:()=>Q4t,X_CLIENT_EXTRA_SKU:()=>oSo,X_CLIENT_LAST_TELEM:()=>q4t,X_CLIENT_OS:()=>F4t,X_CLIENT_SKU:()=>L4t,X_CLIENT_VER:()=>B4t,X_MS_LIB_CAPABILITY:()=>j4t});p();var FM="client_id",Hje="redirect_uri",C4t="response_type",b4t="response_mode",S4t="grant_type",T4t="claims",I4t="scope",z1o="error",Y1o="error_description",K1o="access_token",J1o="id_token",x4t="refresh_token",Z1o="expires_in",X1o="refresh_token_expires_in",w4t="state",R4t="nonce",k4t="prompt",eSo="session_state",tSo="client_info",P4t="code",D4t="code_challenge",N4t="code_challenge_method",M4t="code_verifier",O4t="client-request-id",L4t="x-client-SKU",B4t="x-client-VER",F4t="x-client-OS",U4t="x-client-CPU",Q4t="x-client-current-telemetry",q4t="x-client-last-telemetry",j4t="x-ms-lib-capability",H4t="x-app-name",G4t="x-app-ver",$4t="post_logout_redirect_uri",V4t="id_token_hint",W4t="device_code",z4t="client_secret",Y4t="client_assertion",K4t="client_assertion_type",Gje="token_type",$je="req_cnf",J4t="assertion",Z4t="requested_token_use",rSo="on_behalf_of",nSo="foci",iSo="X-AnchorMailbox",Vje="return_spa_code",X4t="nativebroker",eLt="logout_hint",tLt="sid",rLt="login_hint",nLt="domain_hint",oSo="x-client-xtra-sku",_Se="brk_client_id",Wje="brk_redirect_uri",ace="instance_aware",iLt="ear_jwk",oLt="ear_jwe_crypto",sLt="resource",aLt="clidata";p();p();p();function zje(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(zje,"getDefaultErrorMessage");var Fo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?zje(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 iY(t,e){return new Fo(t,e||zje(t))}a(iY,"createAuthError");var cce=class t extends Fo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function vl(t){return new cce(t)}a(vl,"createClientConfigurationError");p();var fu=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 G7=class t extends Fo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function kt(t,e){return new G7(t,e)}a(kt,"createClientAuthError");var uce={};ki(uce,{authorityMismatch:()=>pSo,authorityUriInsecure:()=>lLt,cannotAllowPlatformBroker:()=>fSo,cannotSetOIDCOptions:()=>dSo,claimsRequestParsingError:()=>sSo,emptyInputScopesError:()=>dLt,invalidAuthenticationHeader:()=>uSo,invalidAuthorityMetadata:()=>mLt,invalidClaims:()=>Yje,invalidCloudDiscoveryMetadata:()=>Kje,invalidCodeChallengeMethod:()=>aSo,invalidRequestMethodForEAR:()=>hSo,logoutRequestEmpty:()=>pLt,missingNonceAuthenticationHeader:()=>lSo,missingSshJwk:()=>vSe,missingSshKid:()=>cSo,pkceParamsMissing:()=>hLt,redirectUriEmpty:()=>cLt,tokenRequestEmpty:()=>fLt,untrustedAuthority:()=>gLt,urlEmptyError:()=>uLt,urlParseError:()=>lce});p();var cLt="redirect_uri_empty",sSo="claims_request_parsing_error",lLt="authority_uri_insecure",lce="url_parse_error",uLt="empty_url_error",dLt="empty_input_scopes_error",Yje="invalid_claims",fLt="token_request_empty",pLt="logout_request_empty",aSo="invalid_code_challenge_method",hLt="pkce_params_missing",Kje="invalid_cloud_discovery_metadata",mLt="invalid_authority_metadata",gLt="untrusted_authority",vSe="missing_ssh_jwk",cSo="missing_ssh_kid",lSo="missing_nonce_authentication_header",uSo="invalid_authentication_header",dSo="cannot_set_OIDCOptions",fSo="cannot_allow_platform_broker",pSo="authority_mismatch",hSo="invalid_request_method_for_EAR";var $p={};ki($p,{authTimeNotFound:()=>CSe,authorizationCodeMissingFromServerResponse:()=>DLt,bindingKeyNotRemoved:()=>ySo,cannotAppendScopeSet:()=>wLt,cannotRemoveEmptyScope:()=>xLt,clientInfoDecodingError:()=>Jje,clientInfoEmptyError:()=>ALt,emptyInputScopeSet:()=>eHe,endSessionEndpointNotSupported:()=>NLt,endpointResolutionError:()=>hP,hashNotDeserialized:()=>vLt,invalidCacheEnvironment:()=>SSe,invalidCacheRecord:()=>RLt,invalidState:()=>oY,keyIdMissing:()=>MLt,maxAgeTranspired:()=>SLt,methodNotImplemented:()=>Ts,misplacedResourceParam:()=>LLt,multipleMatchingAppMetadata:()=>TLt,multipleMatchingTokens:()=>mSo,nestedAppAuthBridgeDisabled:()=>vSo,networkError:()=>ELt,noAccountFound:()=>gSo,noAccountInSilentRequest:()=>bSe,noCryptoObject:()=>kLt,noNetworkConnectivity:()=>ESo,nonceMismatch:()=>bLt,nullOrEmptyToken:()=>yLt,openIdConfigError:()=>_Lt,platformBrokerError:()=>CSo,requestCannotBeMade:()=>ILt,resourceParameterRequired:()=>OLt,stateMismatch:()=>CLt,stateNotFound:()=>Xje,tokenClaimsCnfRequiredForSignedJwt:()=>PLt,tokenParsingError:()=>Zje,tokenRefreshRequired:()=>dce,unexpectedCredentialType:()=>ASo,userCanceled:()=>_So});p();var Jje="client_info_decoding_error",ALt="client_info_empty_error",Zje="token_parsing_error",yLt="null_or_empty_token",hP="endpoints_resolution_error",ELt="network_error",_Lt="openid_config_error",vLt="hash_not_deserialized",oY="invalid_state",CLt="state_mismatch",Xje="state_not_found",bLt="nonce_mismatch",CSe="auth_time_not_found",SLt="max_age_transpired",mSo="multiple_matching_tokens",TLt="multiple_matching_appMetadata",ILt="request_cannot_be_made",xLt="cannot_remove_empty_scope",wLt="cannot_append_scopeset",eHe="empty_input_scopeset",bSe="no_account_in_silent_request",RLt="invalid_cache_record",SSe="invalid_cache_environment",gSo="no_account_found",kLt="no_crypto_object",ASo="unexpected_credential_type",dce="token_refresh_required",PLt="token_claims_cnf_required_for_signedjwt",DLt="authorization_code_missing_from_server_response",ySo="binding_key_not_removed",NLt="end_session_endpoint_not_supported",MLt="key_id_missing",ESo="no_network_connectivity",_So="user_canceled",Ts="method_not_implemented",vSo="nested_app_auth_bridge_disabled",CSo="platform_broker_error",OLt="resource_parameter_required",LLt="misplaced_resource_parameter";var Uh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?fu.trimArrayEntries([...e]):[],n=r?fu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw vl(dLt);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:[...rce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(Mje):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 Fje.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 kt(wLt)}}removeScope(e){if(!e)throw kt(xLt);this.scopes.delete(e.trim())}removeOIDCScopes(){Fje.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw kt(eHe);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 kt(eHe);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 sY(t,e,r){if(!e)return;let n=t.get(FM);n&&t.has(_Se)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(Hje)},e)}a(sY,"instrumentBrokerParams");function bSo(t,e){t.set(C4t,e)}a(bSo,"addResponseType");function BLt(t,e){t.set(b4t,e||s4t.QUERY)}a(BLt,"addResponseMode");function SSo(t){t.set(X4t,"1")}a(SSo,"addNativeBroker");function aY(t,e,r=!0,n=rce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new Uh(o);t.set(I4t,s.printScopes())}a(aY,"addScopes");function cY(t,e){t.set(FM,e)}a(cY,"addClientId");function lY(t,e){t.set(Hje,e)}a(lY,"addRedirectUri");function FLt(t,e){t.set($4t,e)}a(FLt,"addPostLogoutRedirectUri");function ULt(t,e){t.set(V4t,e)}a(ULt,"addIdTokenHint");function QLt(t,e){t.set(nLt,e)}a(QLt,"addDomainHint");function fce(t,e){t.set(rLt,e)}a(fce,"addLoginHint");function $7(t,e){t.set(Gp.CCS_HEADER,`UPN:${e}`)}a($7,"addCcsUpn");function s3(t,e){t.set(Gp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(s3,"addCcsOid");function tHe(t,e){t.set("sid",e)}a(tHe,"addSid");function uY(t,e,r){let n=prn(e,r);try{JSON.parse(n)}catch{throw vl(Yje)}t.set(T4t,n)}a(uY,"addClaims");function dY(t,e){t.set(O4t,e)}a(dY,"addCorrelationId");function TSe(t,e){t.set(L4t,e.sku),t.set(B4t,e.version),e.os&&t.set(F4t,e.os),e.cpu&&t.set(U4t,e.cpu)}a(TSe,"addLibraryInfo");function ISe(t,e){e?.appName&&t.set(H4t,e.appName),e?.appVersion&&t.set(G4t,e.appVersion)}a(ISe,"addApplicationTelemetry");function qLt(t,e){t.set(k4t,e)}a(qLt,"addPrompt");function xSe(t,e){e&&t.set(w4t,e)}a(xSe,"addState");function jLt(t,e){t.set(R4t,e)}a(jLt,"addNonce");function TSo(t,e,r){if(e&&r)t.set(D4t,e),t.set(N4t,r);else throw vl(hLt)}a(TSo,"addCodeChallengeParams");function HLt(t,e){t.set(P4t,e)}a(HLt,"addAuthorizationCode");function ISo(t,e){t.set(W4t,e)}a(ISo,"addDeviceCode");function GLt(t,e){t.set(x4t,e)}a(GLt,"addRefreshToken");function $Lt(t,e){t.set(M4t,e)}a($Lt,"addCodeVerifier");function wSe(t,e){t.set(z4t,e)}a(wSe,"addClientSecret");function RSe(t,e){e&&t.set(Y4t,e)}a(RSe,"addClientAssertion");function kSe(t,e){e&&t.set(K4t,e)}a(kSe,"addClientAssertionType");function xSo(t,e){t.set(J4t,e)}a(xSo,"addOboAssertion");function wSo(t,e){t.set(Z4t,e)}a(wSo,"addRequestTokenUse");function PSe(t,e){t.set(S4t,e)}a(PSe,"addGrantType");function fY(t){t.set(l4t,"1")}a(fY,"addClientInfo");function VLt(t){t.set(aLt,"1")}a(VLt,"addCliData");function DSe(t){t.has(ace)||t.set(ace,"true")}a(DSe,"addInstanceAware");function a3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(a3,"addExtraParameters");function prn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw vl(Yje)}return e&&e.length>0&&(r.hasOwnProperty(nce.ACCESS_TOKEN)||(r[nce.ACCESS_TOKEN]={}),r[nce.ACCESS_TOKEN][nce.XMS_CC]={values:e}),JSON.stringify(r)}a(prn,"addClientCapabilitiesToClaims");function RSo(t,e){t.set(jje.username,e)}a(RSo,"addUsername");function kSo(t,e){t.set(jje.password,e)}a(kSo,"addPassword");function NSe(t,e){e&&(t.set(Gje,hf.POP),t.set($je,e))}a(NSe,"addPopToken");function MSe(t,e){e&&(t.set(Gje,hf.SSH),t.set($je,e))}a(MSe,"addSshJwk");function OSe(t,e){t.set(Q4t,e.generateCurrentRequestHeaderValue()),t.set(q4t,e.generateLastRequestHeaderValue())}a(OSe,"addServerTelemetry");function LSe(t){t.set(j4t,y4t)}a(LSe,"addThrottling");function WLt(t,e){t.set(eLt,e)}a(WLt,"addLogoutHint");function c3(t,e,r){t.has(_Se)||t.set(_Se,e),t.has(Wje)||t.set(Wje,r)}a(c3,"addBrokerParameters");function PSo(t,e){t.set(iLt,encodeURIComponent(e)),t.set(oLt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(PSo,"addEARParameters");function BSe(t,e){e&&t.set(sLt,e)}a(BSe,"addResource");var CA={};ki(CA,{getDeserializedResponse:()=>DSo,mapToQueryString:()=>UM,normalizeUrlForComparison:()=>NSo,stripLeadingHashOrQuery:()=>mrn});p();function hrn(t){if(!t)return t;let e=t.toLowerCase();return fu.endsWith(e,"?")?e=e.slice(0,-1):fu.endsWith(e,"?/")&&(e=e.slice(0,-2)),fu.endsWith(e,"/")||(e+="/"),e}a(hrn,"canonicalizeUrl");function mrn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(mrn,"stripLeadingHashOrQuery");function DSo(t){if(!t||t.indexOf("=")<0)return null;try{let e=mrn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw kt(vLt)}return null}a(DSo,"getDeserializedResponse");function UM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(UM,"mapToQueryString");function NSo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return hrn(n)}catch{return hrn(e)}}a(NSo,"normalizeUrlForComparison");p();p();var pce={createNewGuid:a(()=>{throw kt(Ts)},"createNewGuid"),base64Decode:a(()=>{throw kt(Ts)},"base64Decode"),base64Encode:a(()=>{throw kt(Ts)},"base64Encode"),base64UrlEncode:a(()=>{throw kt(Ts)},"base64UrlEncode"),encodeKid:a(()=>{throw kt(Ts)},"encodeKid"),async getPublicKeyThumbprint(){throw kt(Ts)},async removeTokenBindingKey(){throw kt(Ts)},async clearKeystore(){throw kt(Ts)},async signJwt(){throw kt(Ts)},async hashString(){throw kt(Ts)}};p();var mf;(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"})(mf||(mf={}));var MSo=50,OSo=500,pY=new Map;function LSo(t,e){pY.delete(t),pY.set(t,e)}a(LSo,"markAsRecentlyUsed");function BSo(t,e){let r=Date.now(),n=pY.get(t);if(n)LSo(t,n);else if(n={logs:[],firstEventTime:r},pY.set(t,n),pY.size>MSo){let o=pY.keys().next().value;o&&pY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>OSo&&n.logs.shift()}a(BSo,"addLogToCache");function FSo(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(FSo,"isHashedString");var r0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=mf.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:mf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.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(FSo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};BSo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${mf[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:mf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:mf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var V7="@azure/msal-common",QM="16.4.1";p();var l3={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 grn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(grn,"tenantIdMatchesHomeTenant");function hY(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:grn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:grn(r,t)}}a(hY,"buildTenantProfile");function rHe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=hY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(rHe,"updateAccountTenantProfileData");var nHe={};ki(nHe,{checkMaxAge:()=>FSe,extractTokenClaims:()=>u3,getJWSPayload:()=>Arn,isKmsi:()=>zLt});p();function u3(t,e){let r=Arn(t);try{let n=e(r);return JSON.parse(n)}catch{throw kt(Zje)}}a(u3,"extractTokenClaims");function zLt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(zLt,"isKmsi");function Arn(t){if(!t)throw kt(yLt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw kt(Zje);return r[2]}a(Arn,"getJWSPayload");function FSe(t,e){if(e===0||Date.now()-3e5>t+e)throw kt(SLt)}a(FSe,"checkMaxAge");p();p();var Is=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw vl(uLt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return fu.endsWith(r,"?")?r=r.slice(0,-1):fu.endsWith(r,"?/")&&(r=r.slice(0,-2)),fu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw vl(lce)}if(!e.HostNameAndPort||!e.PathSegments)throw vl(lce);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw vl(lLt)}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 vl(lce);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 vl(lce);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===tce){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 USo=[{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 QSo(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(QSo,"buildOpenIdConfig");var qSo=USo.reduce((t,{host:e,issuerHost:r})=>(t[e]=QSo(e,r||e),t),{}),Ern={endpointMetadata:qSo,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"]}]}},YLt=Ern.endpointMetadata,KLt=Ern.instanceDiscoveryMetadata,JLt=new Set;KLt.metadata.forEach(t=>{t.aliases.forEach(e=>{JLt.add(e)})});function _rn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Is(o).getUrlComponents().HostNameAndPort;n=yrn(e,r,s,t.cloudDiscoveryMetadata?.metadata,Zy.CONFIG)||yrn(e,r,s,KLt.metadata,Zy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(_rn,"getAliasesFromStaticSources");function yrn(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=USe(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(yrn,"getAliasesFromMetadata");function vrn(t){return USe(KLt.metadata,t)}a(vrn,"getCloudDiscoveryMetadataFromHardcodedValues");function USe(t,e){for(let r=0;rZLt,createAccountEntityFromAccountInfo:()=>GSo,generateAccountId:()=>jSo,generateHomeAccountId:()=>XLt,getAccountInfo:()=>mce,isAccountEntity:()=>$So,isSingleTenant:()=>HSo});p();p();function hce(t,e){if(!t)throw kt(ALt);try{let r=e(t);return JSON.parse(r)}catch{throw kt(Jje)}}a(hce,"buildClientInfo");function qM(t){if(!t)throw kt(Jje);let e=t.split(ice,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(qM,"buildClientInfoFromHomeAccountId");p();var Sx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function iHe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(iHe,"getTenantIdFromIdTokenClaims");p();var Xy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function jSo(t){return[t.homeAccountId,t.environment].join(tY).toLowerCase()}a(jSo,"generateAccountId");function mce(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(hY(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(mce,"getAccountInfo");function HSo(t){return!t.tenantProfiles}a(HSo,"isSingleTenant");function ZLt(t,e,r){let n;e.authorityType===Sx.Adfs?n=c4t:e.protocolMode===Xy.OIDC?n=Uje:n=a4t;let o,s;t.clientInfo&&r&&(o=hce(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw kt(SSe);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||iHe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[hY(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(ZLt,"createAccountEntity");function GSo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(hY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||Uje,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(GSo,"createAccountEntityFromAccountInfo");function XLt(t,e,r,n,o,s){if(!(e===Sx.Adfs||e===Sx.Dsts)){if(t)try{let c=hce(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(XLt,"generateHomeAccountId");function $So(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a($So,"isAccountEntity");var W7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(V7,QM),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?mce(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=u3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=rHe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=mce(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 kt(RLt);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 Fo?c:Srn(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=Uh.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)&&Uh.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===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===hf.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()===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===hf.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:t0.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=Uh.createSearchScopes(r.scopes),l=r.authenticationScheme||hf.BEARER,u=l&&l.toLowerCase()!==hf.BEARER.toLowerCase()?t0.ACCESS_TOKEN_WITH_AUTH_SCHEME:t0.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?rY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:t0.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 kt(TLt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===rY)}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=_rn(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!==t0.ACCESS_TOKEN&&e.credentialType!==t0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Uh.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(oce)!==-1}isAuthorityMetadata(e){return e.indexOf(sce)!==-1}generateAuthorityMetadataCacheKey(e){return`${sce}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},qSe=class extends W7{static{a(this,"DefaultStorageClass")}async setAccount(){throw kt(Ts)}getAccount(){throw kt(Ts)}async setIdTokenCredential(){throw kt(Ts)}getIdTokenCredential(){throw kt(Ts)}async setAccessTokenCredential(){throw kt(Ts)}getAccessTokenCredential(){throw kt(Ts)}async setRefreshTokenCredential(){throw kt(Ts)}getRefreshTokenCredential(){throw kt(Ts)}setAppMetadata(){throw kt(Ts)}getAppMetadata(){throw kt(Ts)}setServerTelemetry(){throw kt(Ts)}getServerTelemetry(){throw kt(Ts)}setAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadataKeys(){throw kt(Ts)}setThrottlingCache(){throw kt(Ts)}getThrottlingCache(){throw kt(Ts)}removeItem(){throw kt(Ts)}getKeys(){throw kt(Ts)}getAccountKeys(){throw kt(Ts)}getTokenKeys(){throw kt(Ts)}generateCredentialKey(){throw kt(Ts)}generateAccountKey(){throw kt(Ts)}};p();p();var Trn={NotStarted:0,InProgress:1,Completed:2};var Qh=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:Trn.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 Irn={tokenRenewalOffsetSeconds:v4t,preventCorsPreflight:!1},VSo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info,correlationId:""},WSo={async sendGetRequestAsync(){throw kt(Ts)},async sendPostRequestAsync(){throw kt(Ts)}},zSo={sku:H5t,version:QM,cpu:"",os:""},YSo={clientSecret:"",clientAssertion:void 0},KSo={azureCloudInstance:l3.None,tenant:`${pSe}`},JSo={application:{appName:"",appVersion:""}};function d3({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={...VSo,...r};return{authOptions:ZSo(t),systemOptions:{...Irn,...e},loggerOptions:m,storageInterface:n||new qSe(t.clientId,pce,new r0(m),new Qh),networkInterface:o||WSo,cryptoInterface:s||pce,clientCredentials:c||YSo,libraryInfo:{...zSo,...l},telemetry:{...JSo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(d3,"buildClientConfiguration");function ZSo(t){return{clientCapabilities:[],azureCloudOptions:KSo,instanceAware:!1,isMcp:!1,...t}}a(ZSo,"buildAuthOptions");function oHe(t){return t.authOptions.authority.options.protocolMode===Xy.OIDC}a(oHe,"isOidcProtocolMode");p();p();var mS=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 R_={};ki(R_,{createAccessTokenEntity:()=>rBt,createIdTokenEntity:()=>tBt,createRefreshTokenEntity:()=>nBt,generateAppMetadataKey:()=>aTo,generateAuthorityMetadataExpiresAt:()=>aHe,isAccessTokenEntity:()=>rTo,isAppMetadataEntity:()=>cTo,isAuthorityMetadataEntity:()=>lTo,isAuthorityMetadataExpired:()=>cHe,isCredentialEntity:()=>sHe,isIdTokenEntity:()=>nTo,isRefreshTokenEntity:()=>iTo,isServerTelemetryEntity:()=>oTo,isThrottlingEntity:()=>sTo,updateAuthorityEndpointMetadata:()=>Ace,updateCloudDiscoveryMetadata:()=>HSe});p();var Yu={};ki(Yu,{delay:()=>tTo,isCacheExpired:()=>eTo,isTokenExpired:()=>gce,nowSeconds:()=>gS,toDateFromSeconds:()=>jSe,toSecondsFromDate:()=>XSo,wasClockTurnedBack:()=>eBt});p();function gS(){return Math.round(new Date().getTime()/1e3)}a(gS,"nowSeconds");function XSo(t){return t.getTime()/1e3}a(XSo,"toSecondsFromDate");function jSe(t){return t?new Date(Number(t)*1e3):new Date}a(jSe,"toDateFromSeconds");function gce(t,e){let r=Number(t)||0;return gS()+e>r}a(gce,"isTokenExpired");function eTo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(eTo,"isCacheExpired");function eBt(t){return Number(t)>gS()}a(eBt,"wasClockTurnedBack");function tTo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(tTo,"delay");function tBt(t,e,r,n,o){return{credentialType:t0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(tBt,"createIdTokenEntity");function rBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:t0.ACCESS_TOKEN,secret:r,cachedAt:gS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||hf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==hf.BEARER.toLowerCase())switch(g.credentialType=t0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case hf.POP:let A=u3(r,u);if(!A?.cnf?.kid)throw kt(PLt);g.keyId=A.cnf.kid;break;case hf.SSH:g.keyId=m}return g}a(rBt,"createAccessTokenEntity");function nBt(t,e,r,n,o,s,c){let l={credentialType:t0.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(nBt,"createRefreshTokenEntity");function sHe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(sHe,"isCredentialEntity");function rTo(t){return t?sHe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===t0.ACCESS_TOKEN||t.credentialType===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(rTo,"isAccessTokenEntity");function nTo(t){return t?sHe(t)&&t.hasOwnProperty("realm")&&t.credentialType===t0.ID_TOKEN:!1}a(nTo,"isIdTokenEntity");function iTo(t){return t?sHe(t)&&t.credentialType===t0.REFRESH_TOKEN:!1}a(iTo,"isRefreshTokenEntity");function oTo(t,e){let r=t.indexOf(ASe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(oTo,"isServerTelemetryEntity");function sTo(t,e){let r=!1;t&&(r=t.indexOf(ySe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(sTo,"isThrottlingEntity");function aTo({environment:t,clientId:e}){return[oce,t,e].join(tY).toLowerCase()}a(aTo,"generateAppMetadataKey");function cTo(t,e){return e?t.indexOf(oce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(cTo,"isAppMetadataEntity");function lTo(t,e){return e?t.indexOf(sce)===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(lTo,"isAuthorityMetadataEntity");function aHe(){return gS()+u4t}a(aHe,"generateAuthorityMetadataExpiresAt");function Ace(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(Ace,"updateAuthorityEndpointMetadata");function HSe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(HSe,"updateCloudDiscoveryMetadata");function cHe(t){return t.expiresAt<=gS()}a(cHe,"isAuthorityMetadataExpired");p();p();var xrn="networkClientSendPostRequestAsync",wrn="refreshTokenClientExecutePostToTokenEndpoint",Rrn="authorizationCodeClientExecutePostToTokenEndpoint",krn="refreshTokenClientExecuteTokenRequest",Prn="refreshTokenClientAcquireToken",lHe="refreshTokenClientAcquireTokenWithCachedRefreshToken",Drn="refreshTokenClientCreateTokenRequestBody",Nrn="silentFlowClientGenerateResultFromCacheRecord";var Mrn="authClientExecuteTokenRequest",Orn="authClientCreateTokenRequestBody",Lrn="updateTokenEndpointAuthority",yce="popTokenGenerateCnf",uHe="handleServerTokenResponse",Brn="authorityResolveEndpointsAsync",Frn="authorityGetCloudDiscoveryMetadataFromNetwork",Urn="authorityUpdateCloudDiscoveryMetadata",Qrn="authorityGetEndpointMetadataFromNetwork",qrn="authorityUpdateEndpointMetadata",iBt="authorityUpdateMetadataWithRegionalInformation",jrn="regionDiscoveryDetectRegion",oBt="regionDiscoveryGetRegionFromIMDS",Hrn="regionDiscoveryGetCurrentVersion",Grn="cacheManagerGetRefreshToken";p();var $rn=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"),Js=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 uTo={SW:"sw"},z7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Js(this.generateKid.bind(this),yce,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:uTo.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 Is(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:gS(),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 fHe={};ki(fHe,{badToken:()=>GSe,consentRequired:()=>lBt,interactionRequired:()=>cBt,interruptedUser:()=>dBt,loginRequired:()=>uBt,nativeAccountUnavailable:()=>dTo,noTokensFound:()=>dHe,refreshTokenExpired:()=>sBt,uxNotAllowed:()=>aBt});p();var dHe="no_tokens_found",dTo="native_account_unavailable",sBt="refresh_token_expired",aBt="ux_not_allowed",cBt="interaction_required",lBt="consent_required",uBt="login_required",GSe="bad_token",dBt="interrupted_user";var Vrn=[cBt,lBt,uBt,GSe,aBt,dBt],fTo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],AS=class t extends Fo{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 pHe(t,e,r){let n=!!t&&Vrn.indexOf(t)>-1,o=!!r&&fTo.indexOf(r)>-1,s=!!e&&Vrn.some(c=>e.indexOf(c)>-1);return n||s||o}a(pHe,"isInteractionRequiredError");function hHe(t,e){return new AS(t,e)}a(hHe,"createInteractionRequiredAuthError");p();var k_=class t extends Fo{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 Wrn(t,e){if(!t)throw kt(kLt);if(!e)throw kt(oY);try{let r=e.split(Nje),n=r[0],o=r.length>1?r.slice(1).join(Nje):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw kt(oY)}}a(Wrn,"parseRequestState");var Vp=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||eY} - Timestamp: ${e.timestamp||eY} - Description: ${e.error_description||eY} - Correlation ID: ${e.correlation_id||eY} - Trace ID: ${e.trace_id||eY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new k_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=i4t&&e.status<=o4t){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>=r4t&&e.status<=n4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw pHe(e.error,e.error_description,e.suberror)?new AS(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=u3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw kt(bLt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw kt(CSe);FSe(y,o.maxAge)}}this.homeAccountIdentifier=XLt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Wrn(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 mS(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,zLt(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 kt(SSe);let d=iHe(s),f,h;e.id_token&&s&&(f=tBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=zrn(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?Uh.fromString(e.scope):new Uh(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=rBt(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=nBt(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===hf.POP&&!s.popKid){let T=new z7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw kt(MLt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=Uh.fromString(n.accessToken.target).asArray(),g=jSe(n.accessToken.expiresOn),A=jSe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=jSe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===rY?rY:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?rHe(mce(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 zrn(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)||ZLt({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=hY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(zrn,"buildAccountToCache");p();var P_={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 Ece(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(Ece,"getRequestThumbprint");var gY={};ki(gY,{createTokenQueryParameters:()=>WSe,createTokenRequestHeaders:()=>VSe,executePostToTokenEndpoint:()=>zSe,sendPostRequest:()=>Yrn});p();p();var $Se=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${ySe}.${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(Gp.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||g4t),n+A4t)*1e3)}static removeThrottle(e,r,n,o){let s=Ece(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var _ce=class t extends Fo{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 fBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new _ce(t,e,r)}a(fBt,"createNetworkError");function VSe(t,e,r){let n={};if(n[Gp.CONTENT_TYPE]=Y5t,!e&&r)switch(r.type){case P_.HOME_ACCOUNT_ID:try{let o=qM(r.credential);n[Gp.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[Gp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(VSe,"createTokenRequestHeaders");function WSe(t,e,r,n){let o=new Map;return t.embeddedClientId&&c3(o,e,r),t.extraQueryParameters&&a3(o,t.extraQueryParameters),dY(o,t.correlationId),sY(o,t.correlationId,n),UM(o)}a(WSe,"createTokenQueryParameters");async function zSe(t,e,r,n,o,s,c,l,u,d){let f=await Yrn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(zSe,"executePostToTokenEndpoint");async function Yrn(t,e,r,n,o,s,c,l){$Se.preProcess(o,t,n);let u;try{u=await Js(s.sendPostRequestAsync.bind(s),xrn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Gp.X_MS_HTTP_VERSION]||"",requestId:d[Gp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof _ce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Gp.X_MS_HTTP_VERSION]||"",requestId:f[Gp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Gp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Gp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Fo?d:kt(ELt)}return $Se.postProcess(o,t,u,n),u}a(Yrn,"sendPostRequest");var gHe={};ki(gHe,{createDiscoveredInstance:()=>hBt});p();p();p();function Krn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(Krn,"isOpenIdConfigResponse");p();function Jrn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(Jrn,"isCloudInstanceDiscoveryResponse");p();function Zrn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(Zrn,"isCloudInstanceDiscoveryErrorResponse");p();var YSe=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=H7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Js(this.getRegionFromIMDS.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(K5t,o);if(s.status===Lje&&(n=s.body,r.region_source=H7.IMDS),s.status===Bje){let c=await Js(this.getCurrentVersion.bind(this),Hrn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=H7.FAILED_AUTO_DETECTION,null;let l=await Js(this.getRegionFromIMDS.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===Lje&&(n=l.body,r.region_source=H7.IMDS)}}catch{return r.region_source=H7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=H7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${Oje}?api-version=${e}&format=text`,r,J5t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${Oje}?format=json`,e);return r.status===Bje&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};YSe.IMDS_OPTIONS={headers:{Metadata:"true"}};var mP=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 YSe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Dje))return Sx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case $5t:return Sx.Adfs;case V5t:return Sx.Dsts}return Sx.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 Is(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 kt(hP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw kt(hP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw kt(hP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw kt(NLt);return this.replacePath(this.metadata.end_session_endpoint)}else throw kt(hP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw kt(hP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw kt(hP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Sx.Default&&this.protocolMode!==Xy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Is(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 Is(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===Sx.Adfs||this.protocolMode===Xy.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 Js(this.updateCloudDiscoveryMetadata.bind(this),Urn,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Js(this.updateEndpointMetadata.bind(this),qrn,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:aHe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Zy.CACHE&&n?.source!==Zy.CACHE&&(e.expiresAt=aHe(),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===Zy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Js(this.updateMetadataWithRegionalInformation.bind(this),iBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);Ace(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Js(this.getEndpointMetadataFromNetwork.bind(this),Qrn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Js(this.updateMetadataWithRegionalInformation.bind(this),iBt,this.logger,this.performanceClient,this.correlationId)(n)),Ace(e,n,!0),Zy.NETWORK;throw kt(_Lt,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),Ace(e,r,!1),{source:Zy.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 Ace(e,n,!1),{source:Zy.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=cHe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Zy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Is(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw vl(mLt)}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 Krn(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 YLt?YLt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==Z5t)return this.regionDiscoveryMetadata.region_outcome=ESe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Js(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),jrn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=ESe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=ESe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Js(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Frn,this.logger,this.performanceClient,this.correlationId)();if(n)return HSe(e,n,!0),Zy.NETWORK;throw vl(gLt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||hSe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||hSe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||hSe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),HSe(e,r,!1),Zy.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=vrn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),HSe(e,n,!1),Zy.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=cHe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Zy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Sx.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=USe(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),vl(Kje)}}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=`${W5t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(Jrn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(Zrn(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===t4t)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=USe(c,this.hostnameAndPort)}catch(o){if(o instanceof Fo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=Jtn}};function Ytn(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(Ytn,"convertOAuthErrorResponseToErrorResponse");var Tx=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 Ztn=require("node:os"),Xtn=de(require("node:util"),1),ern=de(require("node:process"),1);function trn(t,...e){ern.stderr.write(`${Xtn.default.format(t,...e)}${Ztn.EOL}`)}a(trn,"log");var rrn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,nrn,F5t=[],U5t=[],Rje=[];rrn&&Q5t(rrn);var irn=Object.assign(t=>orn(t),{enable:Q5t,enabled:q5t,disable:I1o,log:trn});function Q5t(t){nrn=t,F5t=[],U5t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?U5t.push(new RegExp(`^${n.substr(1)}$`)):F5t.push(new RegExp(`^${n}$`));for(let n of Rje)n.enabled=q5t(n.namespace)}a(Q5t,"enable");function q5t(t){if(t.endsWith("*"))return!0;for(let e of U5t)if(e.test(t))return!1;for(let e of F5t)if(e.test(t))return!0;return!1}a(q5t,"enabled");function I1o(){let t=nrn||"";return Q5t(""),t}a(I1o,"disable");function orn(t){let e=Object.assign(r,{enabled:q5t(t),destroy:x1o,log:irn.log,namespace:t,extend:w1o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Rje.push(e),e}a(orn,"createDebugger");function x1o(){let t=Rje.indexOf(this);return t>=0?(Rje.splice(t,1),!0):!1}a(x1o,"destroy");function w1o(t){let e=orn(`${this.namespace}:${t}`);return e.log=this.log,e}a(w1o,"extend");var ece=irn;var arn=new Set,kje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,Dje,j5t=ece("azure");j5t.log=(...t)=>{ece.log(...t)};var H5t=["verbose","info","warning","error"];kje&&(urn(kje)?R1o(kje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${kje}'; logging is not enabled. Acceptable values: ${H5t.join(", ")}.`));function R1o(t){if(t&&!urn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${H5t.join(",")}`);Dje=t;let e=[];for(let r of arn)lrn(r)&&e.push(r.namespace);ece.enable(e.join(","))}a(R1o,"setLogLevel");function Nje(){return Dje}a(Nje,"getLogLevel");var srn={verbose:400,info:300,warning:200,error:100};function j7(t){let e=j5t.extend(t);return crn(j5t,e),{error:Pje(e,"error"),warning:Pje(e,"warning"),info:Pje(e,"info"),verbose:Pje(e,"verbose")}}a(j7,"createClientLogger");function crn(t,e){e.log=(...r)=>{t.log(...r)}}a(crn,"patchLogMethod");function Pje(t,e){let r=Object.assign(t.extend(e),{level:e});if(crn(t,r),lrn(r)){let n=ece.disable();ece.enable(n+","+r.namespace)}return arn.add(r),r}a(Pje,"createLogger");function lrn(t){return!!(Dje&&srn[t.level]<=srn[Dje])}a(lrn,"shouldEnable");function urn(t){return H5t.includes(t)}a(urn,"isAzureLogLevel");var mS=j7("identity");function Mje(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(Mje,"processEnvVars");function r0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(r0,"formatSuccess");function Us(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(Us,"formatError");function drn(t,e,r=mS){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(drn,"credentialLoggerInstance");function lo(t,e=mS){let r=drn(t,void 0,e);return{...r,parent:e,getToken:drn("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var tce={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function frn(t={}){let e=new G5t(t.parentContext);return t.span&&(e=e.setValue(tce.span,t.span)),t.namespace&&(e=e.setValue(tce.namespace,t.namespace)),e}a(frn,"createTracingContext");var G5t=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 prn=de($5t(),1),Lje=prn.state;function k1o(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(k1o,"createDefaultTracingSpan");function P1o(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:k1o(),tracingContext:frn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(P1o,"createDefaultInstrumenter");function pSe(){return Lje.instrumenterImplementation||(Lje.instrumenterImplementation=P1o()),Lje.instrumenterImplementation}a(pSe,"getInstrumenter");p();function hSe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=pSe().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(tce.namespace)||(A=A.setValue(tce.namespace,e)),y.setAttribute("az.namespace",A.getValue(tce.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 pSe().withContext(d,f,...h)}a(c,"withContext");function l(d){return pSe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return pSe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(hSe,"createTracingClient");var Mc=hSe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:Ije});var V5t=lo("ChainedTokenCredential"),mSe=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 Mc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new fSe(s,"ChainedTokenCredential authentication failed.");throw V5t.getToken.info(Us(e,l)),l}if(V5t.getToken.info(`Result for ${o.constructor.name}: ${r0(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var vS={};ki(vS,{AuthError:()=>Uo,AuthErrorCodes:()=>Cce,AzureCloudInstance:()=>u3,ClientAssertion:()=>h3,ClientAuthError:()=>V7,ClientAuthErrorCodes:()=>Wp,ClientConfigurationError:()=>lce,ClientConfigurationErrorCodes:()=>dce,ConfidentialClientApplication:()=>Uce,CryptoProvider:()=>$M,DistributedCachePlugin:()=>_Ge,InteractionRequiredAuthError:()=>yS,InteractionRequiredAuthErrorCodes:()=>AHe,LogLevel:()=>Af,Logger:()=>i0,ManagedIdentityApplication:()=>Qce,ManagedIdentitySourceNames:()=>no,PromptValue:()=>S2o,ProtocolMode:()=>eE,PublicClientApplication:()=>Bce,ResponseMode:()=>T2o,ServerError:()=>P_,TokenCache:()=>Tce,TokenCacheContext:()=>gS,internals:()=>EBt,version:()=>_S});p();var EBt={};ki(EBt,{Deserializer:()=>p3,Serializer:()=>H7});p();p();var H7=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 an={};ki(an,{addApplicationTelemetry:()=>RSe,addAuthorizationCode:()=>WLt,addBrokerParameters:()=>l3,addCcsOid:()=>a3,addCcsUpn:()=>W7,addClaims:()=>hY,addCliData:()=>KLt,addClientAssertion:()=>DSe,addClientAssertionType:()=>NSe,addClientCapabilitiesToClaims:()=>yrn,addClientId:()=>fY,addClientInfo:()=>gY,addClientSecret:()=>PSe,addCodeChallengeParams:()=>BSo,addCodeVerifier:()=>YLt,addCorrelationId:()=>mY,addDeviceCode:()=>FSo,addDomainHint:()=>GLt,addEARParameters:()=>HSo,addExtraParameters:()=>c3,addGrantType:()=>MSe,addIdTokenHint:()=>HLt,addInstanceAware:()=>OSe,addLibraryInfo:()=>wSe,addLoginHint:()=>pce,addLogoutHint:()=>JLt,addNativeBroker:()=>LSo,addNonce:()=>VLt,addOboAssertion:()=>USo,addPassword:()=>jSo,addPopToken:()=>LSe,addPostLogoutRedirectUri:()=>jLt,addPrompt:()=>$Lt,addRedirectUri:()=>pY,addRefreshToken:()=>zLt,addRequestTokenUse:()=>QSo,addResource:()=>QSe,addResponseMode:()=>qLt,addResponseType:()=>OSo,addScopes:()=>dY,addServerTelemetry:()=>FSe,addSid:()=>sHe,addSshJwk:()=>BSe,addState:()=>kSe,addThrottling:()=>USe,addUsername:()=>qSo,instrumentBrokerParams:()=>uY});p();var er={};ki(er,{AADAuthority:()=>hP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>J5t,AAD_TENANT_DOMAIN_SUFFIX:()=>Z5t,ADFS:()=>Y5t,APP_METADATA:()=>sce,AUTHORITY_METADATA_CACHE_KEY:()=>ace,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>h4t,AUTHORIZATION_PENDING:()=>O1o,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>r4t,AuthenticationScheme:()=>gf,AuthorityMetadataSource:()=>Xy,CACHE_ACCOUNT_TYPE_ADFS:()=>f4t,CACHE_ACCOUNT_TYPE_GENERIC:()=>Gje,CACHE_ACCOUNT_TYPE_MSAV1:()=>eSo,CACHE_ACCOUNT_TYPE_MSSTS:()=>d4t,CACHE_KEY_SEPARATOR:()=>oY,CIAM_AUTH_URL:()=>Bje,CLIENT_INFO:()=>p4t,CLIENT_INFO_SEPARATOR:()=>oce,CLIENT_MISMATCH_ERROR:()=>S4t,CODE_GRANT_TYPE:()=>N1o,CONSUMER_UTID:()=>D1o,CacheOutcome:()=>mP,CacheType:()=>tSo,ClaimsRequestKeys:()=>ice,CodeChallengeMethodValues:()=>Z1o,CredentialType:()=>n0,DEFAULT_AUTHORITY:()=>hrn,DEFAULT_AUTHORITY_HOST:()=>z5t,DEFAULT_COMMON_TENANT:()=>gSe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>v4t,DEFAULT_THROTTLE_TIME_SECONDS:()=>_4t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>T4t,DSTS:()=>K5t,EMAIL_SCOPE:()=>Arn,EncodingTypes:()=>oSo,FORWARD_SLASH:()=>rce,GrantType:()=>ESe,HTTP_BAD_REQUEST:()=>jje,HTTP_CLIENT_ERROR:()=>Q1o,HTTP_CLIENT_ERROR_RANGE_END:()=>a4t,HTTP_CLIENT_ERROR_RANGE_START:()=>s4t,HTTP_GATEWAY_TIMEOUT:()=>z1o,HTTP_GONE:()=>G1o,HTTP_MULTI_SIDED_ERROR:()=>Y1o,HTTP_NOT_FOUND:()=>j1o,HTTP_REDIRECT:()=>U1o,HTTP_REQUEST_TIMEOUT:()=>H1o,HTTP_SERVER_ERROR:()=>V1o,HTTP_SERVER_ERROR_RANGE_END:()=>l4t,HTTP_SERVER_ERROR_RANGE_START:()=>c4t,HTTP_SERVICE_UNAVAILABLE:()=>W1o,HTTP_SUCCESS:()=>qje,HTTP_SUCCESS_RANGE_END:()=>F1o,HTTP_SUCCESS_RANGE_START:()=>B1o,HTTP_TOO_MANY_REQUESTS:()=>$1o,HTTP_UNAUTHORIZED:()=>q1o,HeaderNames:()=>Vp,HttpMethod:()=>K1o,IMDS_ENDPOINT:()=>Qje,IMDS_TIMEOUT:()=>t4t,IMDS_VERSION:()=>e4t,INVALID_GRANT_ERROR:()=>b4t,INVALID_INSTANCE:()=>o4t,JsonWebTokenTypes:()=>nSo,KNOWN_PUBLIC_CLOUDS:()=>i4t,NOT_APPLICABLE:()=>ASe,NOT_AVAILABLE:()=>iY,OAuthResponseType:()=>X1o,OFFLINE_ACCESS_SCOPE:()=>Uje,OIDC_DEFAULT_SCOPES:()=>nce,OIDC_SCOPES:()=>Hje,ONE_DAY_IN_MS:()=>iSo,OPENID_SCOPE:()=>mrn,PROFILE_SCOPE:()=>grn,PasswordGrantConstants:()=>Wje,PersistentCacheKeys:()=>J1o,PromptValue:()=>ySe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>n4t,RESOURCE_DELIM:()=>Fje,RegionDiscoveryOutcomes:()=>CSe,RegionDiscoverySources:()=>$7,ResponseMode:()=>u4t,S256_CODE_CHALLENGE_METHOD:()=>M1o,SERVER_TELEM_CACHE_KEY:()=>_Se,SERVER_TELEM_CATEGORY_SEPARATOR:()=>Vje,SERVER_TELEM_MAX_CACHED_ERRORS:()=>g4t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>rSo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>m4t,SERVER_TELEM_OVERFLOW_FALSE:()=>y4t,SERVER_TELEM_OVERFLOW_TRUE:()=>A4t,SERVER_TELEM_SCHEMA_VERSION:()=>$je,SERVER_TELEM_UNKNOWN_ERROR:()=>E4t,SERVER_TELEM_VALUE_SEPARATOR:()=>G7,SHR_NONCE_VALIDITY:()=>L1o,SKU:()=>W5t,THE_FAMILY_ID:()=>sY,THROTTLING_PREFIX:()=>vSe,URL_FORM_CONTENT_TYPE:()=>X5t,X_MS_LIB_CAPABILITY_VALUE:()=>C4t});p();var W5t="msal.js.common",hrn="https://login.microsoftonline.com/common/",z5t="login.microsoftonline.com",gSe="common",Y5t="adfs",K5t="dstsv2",J5t=`${hrn}discovery/instance?api-version=1.1&authorization_endpoint=`,Bje=".ciamlogin.com",Z5t=".onmicrosoft.com",Fje="|",D1o="9188040d-6c67-4c5b-b112-36a304b66dad",mrn="openid",grn="profile",Uje="offline_access",Arn="email",N1o="authorization_code",M1o="S256",X5t="application/x-www-form-urlencoded;charset=utf-8",O1o="authorization_pending",ASe="N/A",iY="Not Available",rce="/",Qje="http://169.254.169.254/metadata/instance/compute/location",e4t="2020-06-01",t4t=2e3,r4t="TryAutoDetect",n4t="login.microsoft.com",i4t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],L1o=240,o4t="invalid_instance",qje=200,B1o=200,F1o=299,U1o=302,Q1o=400,s4t=400,jje=400,q1o=401,j1o=404,H1o=408,G1o=410,$1o=429,a4t=499,V1o=500,c4t=500,W1o=503,z1o=504,l4t=599,Y1o=600,K1o={GET:"GET",POST:"POST"},nce=[mrn,grn,Uje],Hje=[...nce,Arn],Vp={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"},J1o={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},hP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},ice={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},ySe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Z1o={PLAIN:"plain",S256:"S256"},X1o={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},u4t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},ESe={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"},d4t="MSSTS",f4t="ADFS",eSo="MSA",Gje="Generic",oY="-",oce=".",n0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},tSo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},sce="appmetadata",p4t="client_info",sY="1",ace="authority-metadata",h4t=3600*24,Xy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},$je=5,rSo=80,m4t=330,g4t=50,_Se="server-telemetry",Vje="|",G7=",",A4t="1",y4t="0",E4t="unknown_error",gf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},_4t=60,v4t=3600,vSe="throttling",C4t="retry-after, h429",b4t="invalid_grant",S4t="client_mismatch",Wje={username:"username",password:"password"},$7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},CSe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},mP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},nSo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},iSo=864e5,T4t=300,oSo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var aY={};ki(aY,{ACCESS_TOKEN:()=>cSo,BROKER_CLIENT_ID:()=>bSe,BROKER_REDIRECT_URI:()=>Zje,CCS_HEADER:()=>gSo,CLAIMS:()=>R4t,CLIENT_ASSERTION:()=>X4t,CLIENT_ASSERTION_TYPE:()=>eLt,CLIENT_ID:()=>qM,CLIENT_INFO:()=>pSo,CLIENT_REQUEST_ID:()=>U4t,CLIENT_SECRET:()=>Z4t,CLI_DATA:()=>dLt,CODE:()=>O4t,CODE_CHALLENGE:()=>L4t,CODE_CHALLENGE_METHOD:()=>B4t,CODE_VERIFIER:()=>F4t,DEVICE_CODE:()=>J4t,DOMAIN_HINT:()=>aLt,EAR_JWE_CRYPTO:()=>lLt,EAR_JWK:()=>cLt,ERROR:()=>sSo,ERROR_DESCRIPTION:()=>aSo,EXPIRES_IN:()=>uSo,FOCI:()=>mSo,GRANT_TYPE:()=>w4t,ID_TOKEN:()=>lSo,ID_TOKEN_HINT:()=>K4t,INSTANCE_AWARE:()=>cce,LOGIN_HINT:()=>sLt,LOGOUT_HINT:()=>iLt,NATIVE_BROKER:()=>nLt,NONCE:()=>N4t,OBO_ASSERTION:()=>tLt,ON_BEHALF_OF:()=>hSo,POST_LOGOUT_URI:()=>Y4t,PROMPT:()=>M4t,REDIRECT_URI:()=>zje,REFRESH_TOKEN:()=>P4t,REFRESH_TOKEN_EXPIRES_IN:()=>dSo,REQUESTED_TOKEN_USE:()=>rLt,REQ_CNF:()=>Kje,RESOURCE:()=>uLt,RESPONSE_MODE:()=>x4t,RESPONSE_TYPE:()=>I4t,RETURN_SPA_CODE:()=>Jje,SCOPE:()=>k4t,SESSION_STATE:()=>fSo,SID:()=>oLt,STATE:()=>D4t,TOKEN_TYPE:()=>Yje,X_APP_NAME:()=>W4t,X_APP_VER:()=>z4t,X_CLIENT_CPU:()=>H4t,X_CLIENT_CURR_TELEM:()=>G4t,X_CLIENT_EXTRA_SKU:()=>ASo,X_CLIENT_LAST_TELEM:()=>$4t,X_CLIENT_OS:()=>j4t,X_CLIENT_SKU:()=>Q4t,X_CLIENT_VER:()=>q4t,X_MS_LIB_CAPABILITY:()=>V4t});p();var qM="client_id",zje="redirect_uri",I4t="response_type",x4t="response_mode",w4t="grant_type",R4t="claims",k4t="scope",sSo="error",aSo="error_description",cSo="access_token",lSo="id_token",P4t="refresh_token",uSo="expires_in",dSo="refresh_token_expires_in",D4t="state",N4t="nonce",M4t="prompt",fSo="session_state",pSo="client_info",O4t="code",L4t="code_challenge",B4t="code_challenge_method",F4t="code_verifier",U4t="client-request-id",Q4t="x-client-SKU",q4t="x-client-VER",j4t="x-client-OS",H4t="x-client-CPU",G4t="x-client-current-telemetry",$4t="x-client-last-telemetry",V4t="x-ms-lib-capability",W4t="x-app-name",z4t="x-app-ver",Y4t="post_logout_redirect_uri",K4t="id_token_hint",J4t="device_code",Z4t="client_secret",X4t="client_assertion",eLt="client_assertion_type",Yje="token_type",Kje="req_cnf",tLt="assertion",rLt="requested_token_use",hSo="on_behalf_of",mSo="foci",gSo="X-AnchorMailbox",Jje="return_spa_code",nLt="nativebroker",iLt="logout_hint",oLt="sid",sLt="login_hint",aLt="domain_hint",ASo="x-client-xtra-sku",bSe="brk_client_id",Zje="brk_redirect_uri",cce="instance_aware",cLt="ear_jwk",lLt="ear_jwe_crypto",uLt="resource",dLt="clidata";p();p();p();function Xje(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(Xje,"getDefaultErrorMessage");var Uo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?Xje(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 cY(t,e){return new Uo(t,e||Xje(t))}a(cY,"createAuthError");var lce=class t extends Uo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function Cl(t){return new lce(t)}a(Cl,"createClientConfigurationError");p();var fu=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 V7=class t extends Uo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function kt(t,e){return new V7(t,e)}a(kt,"createClientAuthError");var dce={};ki(dce,{authorityMismatch:()=>TSo,authorityUriInsecure:()=>pLt,cannotAllowPlatformBroker:()=>SSo,cannotSetOIDCOptions:()=>bSo,claimsRequestParsingError:()=>ySo,emptyInputScopesError:()=>mLt,invalidAuthenticationHeader:()=>CSo,invalidAuthorityMetadata:()=>ELt,invalidClaims:()=>eHe,invalidCloudDiscoveryMetadata:()=>tHe,invalidCodeChallengeMethod:()=>ESo,invalidRequestMethodForEAR:()=>ISo,logoutRequestEmpty:()=>ALt,missingNonceAuthenticationHeader:()=>vSo,missingSshJwk:()=>SSe,missingSshKid:()=>_So,pkceParamsMissing:()=>yLt,redirectUriEmpty:()=>fLt,tokenRequestEmpty:()=>gLt,untrustedAuthority:()=>_Lt,urlEmptyError:()=>hLt,urlParseError:()=>uce});p();var fLt="redirect_uri_empty",ySo="claims_request_parsing_error",pLt="authority_uri_insecure",uce="url_parse_error",hLt="empty_url_error",mLt="empty_input_scopes_error",eHe="invalid_claims",gLt="token_request_empty",ALt="logout_request_empty",ESo="invalid_code_challenge_method",yLt="pkce_params_missing",tHe="invalid_cloud_discovery_metadata",ELt="invalid_authority_metadata",_Lt="untrusted_authority",SSe="missing_ssh_jwk",_So="missing_ssh_kid",vSo="missing_nonce_authentication_header",CSo="invalid_authentication_header",bSo="cannot_set_OIDCOptions",SSo="cannot_allow_platform_broker",TSo="authority_mismatch",ISo="invalid_request_method_for_EAR";var Wp={};ki(Wp,{authTimeNotFound:()=>TSe,authorizationCodeMissingFromServerResponse:()=>LLt,bindingKeyNotRemoved:()=>kSo,cannotAppendScopeSet:()=>DLt,cannotRemoveEmptyScope:()=>PLt,clientInfoDecodingError:()=>rHe,clientInfoEmptyError:()=>vLt,emptyInputScopeSet:()=>oHe,endSessionEndpointNotSupported:()=>BLt,endpointResolutionError:()=>gP,hashNotDeserialized:()=>TLt,invalidCacheEnvironment:()=>xSe,invalidCacheRecord:()=>NLt,invalidState:()=>lY,keyIdMissing:()=>FLt,maxAgeTranspired:()=>wLt,methodNotImplemented:()=>Ts,misplacedResourceParam:()=>QLt,multipleMatchingAppMetadata:()=>RLt,multipleMatchingTokens:()=>xSo,nestedAppAuthBridgeDisabled:()=>NSo,networkError:()=>bLt,noAccountFound:()=>wSo,noAccountInSilentRequest:()=>ISe,noCryptoObject:()=>MLt,noNetworkConnectivity:()=>PSo,nonceMismatch:()=>xLt,nullOrEmptyToken:()=>CLt,openIdConfigError:()=>SLt,platformBrokerError:()=>MSo,requestCannotBeMade:()=>kLt,resourceParameterRequired:()=>ULt,stateMismatch:()=>ILt,stateNotFound:()=>iHe,tokenClaimsCnfRequiredForSignedJwt:()=>OLt,tokenParsingError:()=>nHe,tokenRefreshRequired:()=>fce,unexpectedCredentialType:()=>RSo,userCanceled:()=>DSo});p();var rHe="client_info_decoding_error",vLt="client_info_empty_error",nHe="token_parsing_error",CLt="null_or_empty_token",gP="endpoints_resolution_error",bLt="network_error",SLt="openid_config_error",TLt="hash_not_deserialized",lY="invalid_state",ILt="state_mismatch",iHe="state_not_found",xLt="nonce_mismatch",TSe="auth_time_not_found",wLt="max_age_transpired",xSo="multiple_matching_tokens",RLt="multiple_matching_appMetadata",kLt="request_cannot_be_made",PLt="cannot_remove_empty_scope",DLt="cannot_append_scopeset",oHe="empty_input_scopeset",ISe="no_account_in_silent_request",NLt="invalid_cache_record",xSe="invalid_cache_environment",wSo="no_account_found",MLt="no_crypto_object",RSo="unexpected_credential_type",fce="token_refresh_required",OLt="token_claims_cnf_required_for_signedjwt",LLt="authorization_code_missing_from_server_response",kSo="binding_key_not_removed",BLt="end_session_endpoint_not_supported",FLt="key_id_missing",PSo="no_network_connectivity",DSo="user_canceled",Ts="method_not_implemented",NSo="nested_app_auth_bridge_disabled",MSo="platform_broker_error",ULt="resource_parameter_required",QLt="misplaced_resource_parameter";var qh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?fu.trimArrayEntries([...e]):[],n=r?fu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw Cl(mLt);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:[...nce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(Uje):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 Hje.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 kt(DLt)}}removeScope(e){if(!e)throw kt(PLt);this.scopes.delete(e.trim())}removeOIDCScopes(){Hje.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw kt(oHe);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 kt(oHe);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 uY(t,e,r){if(!e)return;let n=t.get(qM);n&&t.has(bSe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(zje)},e)}a(uY,"instrumentBrokerParams");function OSo(t,e){t.set(I4t,e)}a(OSo,"addResponseType");function qLt(t,e){t.set(x4t,e||u4t.QUERY)}a(qLt,"addResponseMode");function LSo(t){t.set(nLt,"1")}a(LSo,"addNativeBroker");function dY(t,e,r=!0,n=nce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new qh(o);t.set(k4t,s.printScopes())}a(dY,"addScopes");function fY(t,e){t.set(qM,e)}a(fY,"addClientId");function pY(t,e){t.set(zje,e)}a(pY,"addRedirectUri");function jLt(t,e){t.set(Y4t,e)}a(jLt,"addPostLogoutRedirectUri");function HLt(t,e){t.set(K4t,e)}a(HLt,"addIdTokenHint");function GLt(t,e){t.set(aLt,e)}a(GLt,"addDomainHint");function pce(t,e){t.set(sLt,e)}a(pce,"addLoginHint");function W7(t,e){t.set(Vp.CCS_HEADER,`UPN:${e}`)}a(W7,"addCcsUpn");function a3(t,e){t.set(Vp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(a3,"addCcsOid");function sHe(t,e){t.set("sid",e)}a(sHe,"addSid");function hY(t,e,r){let n=yrn(e,r);try{JSON.parse(n)}catch{throw Cl(eHe)}t.set(R4t,n)}a(hY,"addClaims");function mY(t,e){t.set(U4t,e)}a(mY,"addCorrelationId");function wSe(t,e){t.set(Q4t,e.sku),t.set(q4t,e.version),e.os&&t.set(j4t,e.os),e.cpu&&t.set(H4t,e.cpu)}a(wSe,"addLibraryInfo");function RSe(t,e){e?.appName&&t.set(W4t,e.appName),e?.appVersion&&t.set(z4t,e.appVersion)}a(RSe,"addApplicationTelemetry");function $Lt(t,e){t.set(M4t,e)}a($Lt,"addPrompt");function kSe(t,e){e&&t.set(D4t,e)}a(kSe,"addState");function VLt(t,e){t.set(N4t,e)}a(VLt,"addNonce");function BSo(t,e,r){if(e&&r)t.set(L4t,e),t.set(B4t,r);else throw Cl(yLt)}a(BSo,"addCodeChallengeParams");function WLt(t,e){t.set(O4t,e)}a(WLt,"addAuthorizationCode");function FSo(t,e){t.set(J4t,e)}a(FSo,"addDeviceCode");function zLt(t,e){t.set(P4t,e)}a(zLt,"addRefreshToken");function YLt(t,e){t.set(F4t,e)}a(YLt,"addCodeVerifier");function PSe(t,e){t.set(Z4t,e)}a(PSe,"addClientSecret");function DSe(t,e){e&&t.set(X4t,e)}a(DSe,"addClientAssertion");function NSe(t,e){e&&t.set(eLt,e)}a(NSe,"addClientAssertionType");function USo(t,e){t.set(tLt,e)}a(USo,"addOboAssertion");function QSo(t,e){t.set(rLt,e)}a(QSo,"addRequestTokenUse");function MSe(t,e){t.set(w4t,e)}a(MSe,"addGrantType");function gY(t){t.set(p4t,"1")}a(gY,"addClientInfo");function KLt(t){t.set(dLt,"1")}a(KLt,"addCliData");function OSe(t){t.has(cce)||t.set(cce,"true")}a(OSe,"addInstanceAware");function c3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(c3,"addExtraParameters");function yrn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw Cl(eHe)}return e&&e.length>0&&(r.hasOwnProperty(ice.ACCESS_TOKEN)||(r[ice.ACCESS_TOKEN]={}),r[ice.ACCESS_TOKEN][ice.XMS_CC]={values:e}),JSON.stringify(r)}a(yrn,"addClientCapabilitiesToClaims");function qSo(t,e){t.set(Wje.username,e)}a(qSo,"addUsername");function jSo(t,e){t.set(Wje.password,e)}a(jSo,"addPassword");function LSe(t,e){e&&(t.set(Yje,gf.POP),t.set(Kje,e))}a(LSe,"addPopToken");function BSe(t,e){e&&(t.set(Yje,gf.SSH),t.set(Kje,e))}a(BSe,"addSshJwk");function FSe(t,e){t.set(G4t,e.generateCurrentRequestHeaderValue()),t.set($4t,e.generateLastRequestHeaderValue())}a(FSe,"addServerTelemetry");function USe(t){t.set(V4t,C4t)}a(USe,"addThrottling");function JLt(t,e){t.set(iLt,e)}a(JLt,"addLogoutHint");function l3(t,e,r){t.has(bSe)||t.set(bSe,e),t.has(Zje)||t.set(Zje,r)}a(l3,"addBrokerParameters");function HSo(t,e){t.set(cLt,encodeURIComponent(e)),t.set(lLt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(HSo,"addEARParameters");function QSe(t,e){e&&t.set(uLt,e)}a(QSe,"addResource");var bA={};ki(bA,{getDeserializedResponse:()=>GSo,mapToQueryString:()=>jM,normalizeUrlForComparison:()=>$So,stripLeadingHashOrQuery:()=>_rn});p();function Ern(t){if(!t)return t;let e=t.toLowerCase();return fu.endsWith(e,"?")?e=e.slice(0,-1):fu.endsWith(e,"?/")&&(e=e.slice(0,-2)),fu.endsWith(e,"/")||(e+="/"),e}a(Ern,"canonicalizeUrl");function _rn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(_rn,"stripLeadingHashOrQuery");function GSo(t){if(!t||t.indexOf("=")<0)return null;try{let e=_rn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw kt(TLt)}return null}a(GSo,"getDeserializedResponse");function jM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(jM,"mapToQueryString");function $So(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return Ern(n)}catch{return Ern(e)}}a($So,"normalizeUrlForComparison");p();p();var hce={createNewGuid:a(()=>{throw kt(Ts)},"createNewGuid"),base64Decode:a(()=>{throw kt(Ts)},"base64Decode"),base64Encode:a(()=>{throw kt(Ts)},"base64Encode"),base64UrlEncode:a(()=>{throw kt(Ts)},"base64UrlEncode"),encodeKid:a(()=>{throw kt(Ts)},"encodeKid"),async getPublicKeyThumbprint(){throw kt(Ts)},async removeTokenBindingKey(){throw kt(Ts)},async clearKeystore(){throw kt(Ts)},async signJwt(){throw kt(Ts)},async hashString(){throw kt(Ts)}};p();var Af;(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"})(Af||(Af={}));var VSo=50,WSo=500,AY=new Map;function zSo(t,e){AY.delete(t),AY.set(t,e)}a(zSo,"markAsRecentlyUsed");function YSo(t,e){let r=Date.now(),n=AY.get(t);if(n)zSo(t,n);else if(n={logs:[],firstEventTime:r},AY.set(t,n),AY.size>VSo){let o=AY.keys().next().value;o&&AY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>WSo&&n.logs.shift()}a(YSo,"addLogToCache");function KSo(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(KSo,"isHashedString");var i0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=Af.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:Af.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:Af.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(KSo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};YSo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${Af[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:Af.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:Af.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:Af.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:Af.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:Af.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:Af.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:Af.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:Af.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:Af.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:Af.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var z7="@azure/msal-common",HM="16.4.1";p();var u3={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 vrn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(vrn,"tenantIdMatchesHomeTenant");function yY(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:vrn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:vrn(r,t)}}a(yY,"buildTenantProfile");function aHe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=yY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(aHe,"updateAccountTenantProfileData");var cHe={};ki(cHe,{checkMaxAge:()=>qSe,extractTokenClaims:()=>d3,getJWSPayload:()=>Crn,isKmsi:()=>ZLt});p();function d3(t,e){let r=Crn(t);try{let n=e(r);return JSON.parse(n)}catch{throw kt(nHe)}}a(d3,"extractTokenClaims");function ZLt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(ZLt,"isKmsi");function Crn(t){if(!t)throw kt(CLt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw kt(nHe);return r[2]}a(Crn,"getJWSPayload");function qSe(t,e){if(e===0||Date.now()-3e5>t+e)throw kt(wLt)}a(qSe,"checkMaxAge");p();p();var Is=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Cl(hLt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return fu.endsWith(r,"?")?r=r.slice(0,-1):fu.endsWith(r,"?/")&&(r=r.slice(0,-2)),fu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Cl(uce)}if(!e.HostNameAndPort||!e.PathSegments)throw Cl(uce);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Cl(pLt)}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]===hP.COMMON||n[0]===hP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Cl(uce);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 Cl(uce);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===rce){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 JSo=[{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 ZSo(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(ZSo,"buildOpenIdConfig");var XSo=JSo.reduce((t,{host:e,issuerHost:r})=>(t[e]=ZSo(e,r||e),t),{}),Srn={endpointMetadata:XSo,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"]}]}},XLt=Srn.endpointMetadata,eBt=Srn.instanceDiscoveryMetadata,tBt=new Set;eBt.metadata.forEach(t=>{t.aliases.forEach(e=>{tBt.add(e)})});function Trn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Is(o).getUrlComponents().HostNameAndPort;n=brn(e,r,s,t.cloudDiscoveryMetadata?.metadata,Xy.CONFIG)||brn(e,r,s,eBt.metadata,Xy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(Trn,"getAliasesFromStaticSources");function brn(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=jSe(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(brn,"getAliasesFromMetadata");function Irn(t){return jSe(eBt.metadata,t)}a(Irn,"getCloudDiscoveryMetadataFromHardcodedValues");function jSe(t,e){for(let r=0;rrBt,createAccountEntityFromAccountInfo:()=>rTo,generateAccountId:()=>eTo,generateHomeAccountId:()=>nBt,getAccountInfo:()=>gce,isAccountEntity:()=>nTo,isSingleTenant:()=>tTo});p();p();function mce(t,e){if(!t)throw kt(vLt);try{let r=e(t);return JSON.parse(r)}catch{throw kt(rHe)}}a(mce,"buildClientInfo");function GM(t){if(!t)throw kt(rHe);let e=t.split(oce,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(GM,"buildClientInfoFromHomeAccountId");p();var Ix={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function lHe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(lHe,"getTenantIdFromIdTokenClaims");p();var eE={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function eTo(t){return[t.homeAccountId,t.environment].join(oY).toLowerCase()}a(eTo,"generateAccountId");function gce(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(yY(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(gce,"getAccountInfo");function tTo(t){return!t.tenantProfiles}a(tTo,"isSingleTenant");function rBt(t,e,r){let n;e.authorityType===Ix.Adfs?n=f4t:e.protocolMode===eE.OIDC?n=Gje:n=d4t;let o,s;t.clientInfo&&r&&(o=mce(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw kt(xSe);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||lHe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[yY(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(rBt,"createAccountEntity");function rTo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(yY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||Gje,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(rTo,"createAccountEntityFromAccountInfo");function nBt(t,e,r,n,o,s){if(!(e===Ix.Adfs||e===Ix.Dsts)){if(t)try{let c=mce(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(nBt,"generateHomeAccountId");function nTo(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(nTo,"isAccountEntity");var Y7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(z7,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?gce(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=d3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=aHe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=gce(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 kt(NLt);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 Uo?c:Rrn(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=qh.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)&&qh.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===n0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===gf.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()===n0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===gf.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:n0.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=qh.createSearchScopes(r.scopes),l=r.authenticationScheme||gf.BEARER,u=l&&l.toLowerCase()!==gf.BEARER.toLowerCase()?n0.ACCESS_TOKEN_WITH_AUTH_SCHEME:n0.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?sY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:n0.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 kt(RLt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===sY)}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=Trn(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!==n0.ACCESS_TOKEN&&e.credentialType!==n0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:qh.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(sce)!==-1}isAuthorityMetadata(e){return e.indexOf(ace)!==-1}generateAuthorityMetadataCacheKey(e){return`${ace}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},GSe=class extends Y7{static{a(this,"DefaultStorageClass")}async setAccount(){throw kt(Ts)}getAccount(){throw kt(Ts)}async setIdTokenCredential(){throw kt(Ts)}getIdTokenCredential(){throw kt(Ts)}async setAccessTokenCredential(){throw kt(Ts)}getAccessTokenCredential(){throw kt(Ts)}async setRefreshTokenCredential(){throw kt(Ts)}getRefreshTokenCredential(){throw kt(Ts)}setAppMetadata(){throw kt(Ts)}getAppMetadata(){throw kt(Ts)}setServerTelemetry(){throw kt(Ts)}getServerTelemetry(){throw kt(Ts)}setAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadataKeys(){throw kt(Ts)}setThrottlingCache(){throw kt(Ts)}getThrottlingCache(){throw kt(Ts)}removeItem(){throw kt(Ts)}getKeys(){throw kt(Ts)}getAccountKeys(){throw kt(Ts)}getTokenKeys(){throw kt(Ts)}generateCredentialKey(){throw kt(Ts)}generateAccountKey(){throw kt(Ts)}};p();p();var krn={NotStarted:0,InProgress:1,Completed:2};var jh=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:krn.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 Prn={tokenRenewalOffsetSeconds:T4t,preventCorsPreflight:!1},iTo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:Af.Info,correlationId:""},oTo={async sendGetRequestAsync(){throw kt(Ts)},async sendPostRequestAsync(){throw kt(Ts)}},sTo={sku:W5t,version:HM,cpu:"",os:""},aTo={clientSecret:"",clientAssertion:void 0},cTo={azureCloudInstance:u3.None,tenant:`${gSe}`},lTo={application:{appName:"",appVersion:""}};function f3({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={...iTo,...r};return{authOptions:uTo(t),systemOptions:{...Prn,...e},loggerOptions:m,storageInterface:n||new GSe(t.clientId,hce,new i0(m),new jh),networkInterface:o||oTo,cryptoInterface:s||hce,clientCredentials:c||aTo,libraryInfo:{...sTo,...l},telemetry:{...lTo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(f3,"buildClientConfiguration");function uTo(t){return{clientCapabilities:[],azureCloudOptions:cTo,instanceAware:!1,isMcp:!1,...t}}a(uTo,"buildAuthOptions");function uHe(t){return t.authOptions.authority.options.protocolMode===eE.OIDC}a(uHe,"isOidcProtocolMode");p();p();var gS=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 k_={};ki(k_,{createAccessTokenEntity:()=>sBt,createIdTokenEntity:()=>oBt,createRefreshTokenEntity:()=>aBt,generateAppMetadataKey:()=>ETo,generateAuthorityMetadataExpiresAt:()=>fHe,isAccessTokenEntity:()=>hTo,isAppMetadataEntity:()=>_To,isAuthorityMetadataEntity:()=>vTo,isAuthorityMetadataExpired:()=>pHe,isCredentialEntity:()=>dHe,isIdTokenEntity:()=>mTo,isRefreshTokenEntity:()=>gTo,isServerTelemetryEntity:()=>ATo,isThrottlingEntity:()=>yTo,updateAuthorityEndpointMetadata:()=>yce,updateCloudDiscoveryMetadata:()=>VSe});p();var Ku={};ki(Ku,{delay:()=>pTo,isCacheExpired:()=>fTo,isTokenExpired:()=>Ace,nowSeconds:()=>AS,toDateFromSeconds:()=>$Se,toSecondsFromDate:()=>dTo,wasClockTurnedBack:()=>iBt});p();function AS(){return Math.round(new Date().getTime()/1e3)}a(AS,"nowSeconds");function dTo(t){return t.getTime()/1e3}a(dTo,"toSecondsFromDate");function $Se(t){return t?new Date(Number(t)*1e3):new Date}a($Se,"toDateFromSeconds");function Ace(t,e){let r=Number(t)||0;return AS()+e>r}a(Ace,"isTokenExpired");function fTo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(fTo,"isCacheExpired");function iBt(t){return Number(t)>AS()}a(iBt,"wasClockTurnedBack");function pTo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(pTo,"delay");function oBt(t,e,r,n,o){return{credentialType:n0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(oBt,"createIdTokenEntity");function sBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:n0.ACCESS_TOKEN,secret:r,cachedAt:AS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||gf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==gf.BEARER.toLowerCase())switch(g.credentialType=n0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case gf.POP:let A=d3(r,u);if(!A?.cnf?.kid)throw kt(OLt);g.keyId=A.cnf.kid;break;case gf.SSH:g.keyId=m}return g}a(sBt,"createAccessTokenEntity");function aBt(t,e,r,n,o,s,c){let l={credentialType:n0.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(aBt,"createRefreshTokenEntity");function dHe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(dHe,"isCredentialEntity");function hTo(t){return t?dHe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===n0.ACCESS_TOKEN||t.credentialType===n0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(hTo,"isAccessTokenEntity");function mTo(t){return t?dHe(t)&&t.hasOwnProperty("realm")&&t.credentialType===n0.ID_TOKEN:!1}a(mTo,"isIdTokenEntity");function gTo(t){return t?dHe(t)&&t.credentialType===n0.REFRESH_TOKEN:!1}a(gTo,"isRefreshTokenEntity");function ATo(t,e){let r=t.indexOf(_Se)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(ATo,"isServerTelemetryEntity");function yTo(t,e){let r=!1;t&&(r=t.indexOf(vSe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(yTo,"isThrottlingEntity");function ETo({environment:t,clientId:e}){return[sce,t,e].join(oY).toLowerCase()}a(ETo,"generateAppMetadataKey");function _To(t,e){return e?t.indexOf(sce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(_To,"isAppMetadataEntity");function vTo(t,e){return e?t.indexOf(ace)===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(vTo,"isAuthorityMetadataEntity");function fHe(){return AS()+h4t}a(fHe,"generateAuthorityMetadataExpiresAt");function yce(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(yce,"updateAuthorityEndpointMetadata");function VSe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(VSe,"updateCloudDiscoveryMetadata");function pHe(t){return t.expiresAt<=AS()}a(pHe,"isAuthorityMetadataExpired");p();p();var Drn="networkClientSendPostRequestAsync",Nrn="refreshTokenClientExecutePostToTokenEndpoint",Mrn="authorizationCodeClientExecutePostToTokenEndpoint",Orn="refreshTokenClientExecuteTokenRequest",Lrn="refreshTokenClientAcquireToken",hHe="refreshTokenClientAcquireTokenWithCachedRefreshToken",Brn="refreshTokenClientCreateTokenRequestBody",Frn="silentFlowClientGenerateResultFromCacheRecord";var Urn="authClientExecuteTokenRequest",Qrn="authClientCreateTokenRequestBody",qrn="updateTokenEndpointAuthority",Ece="popTokenGenerateCnf",mHe="handleServerTokenResponse",jrn="authorityResolveEndpointsAsync",Hrn="authorityGetCloudDiscoveryMetadataFromNetwork",Grn="authorityUpdateCloudDiscoveryMetadata",$rn="authorityGetEndpointMetadataFromNetwork",Vrn="authorityUpdateEndpointMetadata",cBt="authorityUpdateMetadataWithRegionalInformation",Wrn="regionDiscoveryDetectRegion",lBt="regionDiscoveryGetRegionFromIMDS",zrn="regionDiscoveryGetCurrentVersion",Yrn="cacheManagerGetRefreshToken";p();var Krn=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"),Js=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 CTo={SW:"sw"},K7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Js(this.generateKid.bind(this),Ece,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:CTo.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 Is(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:AS(),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 AHe={};ki(AHe,{badToken:()=>WSe,consentRequired:()=>pBt,interactionRequired:()=>fBt,interruptedUser:()=>mBt,loginRequired:()=>hBt,nativeAccountUnavailable:()=>bTo,noTokensFound:()=>gHe,refreshTokenExpired:()=>uBt,uxNotAllowed:()=>dBt});p();var gHe="no_tokens_found",bTo="native_account_unavailable",uBt="refresh_token_expired",dBt="ux_not_allowed",fBt="interaction_required",pBt="consent_required",hBt="login_required",WSe="bad_token",mBt="interrupted_user";var Jrn=[fBt,pBt,hBt,WSe,dBt,mBt],STo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],yS=class t extends Uo{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 yHe(t,e,r){let n=!!t&&Jrn.indexOf(t)>-1,o=!!r&&STo.indexOf(r)>-1,s=!!e&&Jrn.some(c=>e.indexOf(c)>-1);return n||s||o}a(yHe,"isInteractionRequiredError");function EHe(t,e){return new yS(t,e)}a(EHe,"createInteractionRequiredAuthError");p();var P_=class t extends Uo{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 Zrn(t,e){if(!t)throw kt(MLt);if(!e)throw kt(lY);try{let r=e.split(Fje),n=r[0],o=r.length>1?r.slice(1).join(Fje):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw kt(lY)}}a(Zrn,"parseRequestState");var zp=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||iY} - Timestamp: ${e.timestamp||iY} - Description: ${e.error_description||iY} - Correlation ID: ${e.correlation_id||iY} - Trace ID: ${e.trace_id||iY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new P_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=c4t&&e.status<=l4t){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>=s4t&&e.status<=a4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${c}`,r);return}throw yHe(e.error,e.error_description,e.suberror)?new yS(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=d3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw kt(xLt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw kt(TSe);qSe(y,o.maxAge)}}this.homeAccountIdentifier=nBt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Zrn(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 gS(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,ZLt(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 kt(xSe);let d=lHe(s),f,h;e.id_token&&s&&(f=oBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=Xrn(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?qh.fromString(e.scope):new qh(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=sBt(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=aBt(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===gf.POP&&!s.popKid){let T=new K7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw kt(FLt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=qh.fromString(n.accessToken.target).asArray(),g=$Se(n.accessToken.expiresOn),A=$Se(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=$Se(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===sY?sY:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?aHe(gce(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 Xrn(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)||rBt({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=yY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(Xrn,"buildAccountToCache");p();var D_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function N_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(N_,"getClientAssertion");p();function _ce(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(_ce,"getRequestThumbprint");var _Y={};ki(_Y,{createTokenQueryParameters:()=>KSe,createTokenRequestHeaders:()=>YSe,executePostToTokenEndpoint:()=>JSe,sendPostRequest:()=>enn});p();p();var zSe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${vSe}.${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(Vp.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||_4t),n+v4t)*1e3)}static removeThrottle(e,r,n,o){let s=_ce(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var vce=class t extends Uo{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 gBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new vce(t,e,r)}a(gBt,"createNetworkError");function YSe(t,e,r){let n={};if(n[Vp.CONTENT_TYPE]=X5t,!e&&r)switch(r.type){case D_.HOME_ACCOUNT_ID:try{let o=GM(r.credential);n[Vp.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case D_.UPN:n[Vp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(YSe,"createTokenRequestHeaders");function KSe(t,e,r,n){let o=new Map;return t.embeddedClientId&&l3(o,e,r),t.extraQueryParameters&&c3(o,t.extraQueryParameters),mY(o,t.correlationId),uY(o,t.correlationId,n),jM(o)}a(KSe,"createTokenQueryParameters");async function JSe(t,e,r,n,o,s,c,l,u,d){let f=await enn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(JSe,"executePostToTokenEndpoint");async function enn(t,e,r,n,o,s,c,l){zSe.preProcess(o,t,n);let u;try{u=await Js(s.sendPostRequestAsync.bind(s),Drn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Vp.X_MS_HTTP_VERSION]||"",requestId:d[Vp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof vce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Vp.X_MS_HTTP_VERSION]||"",requestId:f[Vp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Vp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Vp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Uo?d:kt(bLt)}return zSe.postProcess(o,t,u,n),u}a(enn,"sendPostRequest");var vHe={};ki(vHe,{createDiscoveredInstance:()=>yBt});p();p();p();function tnn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(tnn,"isOpenIdConfigResponse");p();function rnn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(rnn,"isCloudInstanceDiscoveryResponse");p();function nnn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(nnn,"isCloudInstanceDiscoveryErrorResponse");p();var ZSe=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=$7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Js(this.getRegionFromIMDS.bind(this),lBt,this.logger,this.performanceClient,this.correlationId)(e4t,o);if(s.status===qje&&(n=s.body,r.region_source=$7.IMDS),s.status===jje){let c=await Js(this.getCurrentVersion.bind(this),zrn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=$7.FAILED_AUTO_DETECTION,null;let l=await Js(this.getRegionFromIMDS.bind(this),lBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===qje&&(n=l.body,r.region_source=$7.IMDS)}}catch{return r.region_source=$7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=$7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${Qje}?api-version=${e}&format=text`,r,t4t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${Qje}?format=json`,e);return r.status===jje&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};ZSe.IMDS_OPTIONS={headers:{Metadata:"true"}};var AP=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 ZSe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Bje))return Ix.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case Y5t:return Ix.Adfs;case K5t: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 Is(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 kt(gP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw kt(gP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw kt(gP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw kt(BLt);return this.replacePath(this.metadata.end_session_endpoint)}else throw kt(gP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw kt(gP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw kt(gP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Ix.Default&&this.protocolMode!==eE.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Is(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 Is(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===eE.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 Js(this.updateCloudDiscoveryMetadata.bind(this),Grn,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Js(this.updateEndpointMetadata.bind(this),Vrn,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:fHe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Xy.CACHE&&n?.source!==Xy.CACHE&&(e.expiresAt=fHe(),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===Xy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Js(this.updateMetadataWithRegionalInformation.bind(this),cBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);yce(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Js(this.getEndpointMetadataFromNetwork.bind(this),$rn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Js(this.updateMetadataWithRegionalInformation.bind(this),cBt,this.logger,this.performanceClient,this.correlationId)(n)),yce(e,n,!0),Xy.NETWORK;throw kt(SLt,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),yce(e,r,!1),{source:Xy.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 yce(e,n,!1),{source:Xy.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=pHe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Xy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Is(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Cl(ELt)}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 tnn(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 XLt?XLt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==r4t)return this.regionDiscoveryMetadata.region_outcome=CSe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Js(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),Wrn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=CSe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=CSe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Js(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Hrn,this.logger,this.performanceClient,this.correlationId)();if(n)return VSe(e,n,!0),Xy.NETWORK;throw Cl(_Lt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||ASe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||ASe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||ASe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),VSe(e,r,!1),Xy.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=Irn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),VSe(e,n,!1),Xy.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=pHe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Xy.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=jSe(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),Cl(tHe)}}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=`${J5t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(rnn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(nnn(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===o4t)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=jSe(c,this.hostnameAndPort)}catch(o){if(o instanceof Uo)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&&Is.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==l3.None){let o=r.tenant?r.tenant:pSe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return G5t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw kt(hP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return JLt.has(e)}static isPublicCloudAuthority(e){return e4t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Is(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${X5t}`);let l=Is.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 Is(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(Dje)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${z5t}`}return r}};mP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",fP.COMMON,fP.CONSUMERS,fP.ORGANIZATIONS]);function Xrn(t){let n=new Is(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case fP.COMMON:case fP.ORGANIZATIONS:case fP.CONSUMERS:return;default:return n}}a(Xrn,"getTenantFromAuthorityString");function mHe(t){return t.endsWith(tce)?t:`${t}${tce}`}a(mHe,"formatAuthorityUri");function pBt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw vl(Kje)}return{canonicalAuthority:t.authority?mHe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(pBt,"buildStaticAuthorityOptions");async function hBt(t,e,r,n,o,s,c){let l=mP.transformCIAMAuthority(mHe(t)),u=new mP(l,e,r,n,o,s,c);try{return await Js(u.resolveEndpointsAsync.bind(u),Brn,o,c,s)(),u}catch{throw kt(hP)}}a(hBt,"createDiscoveredInstance");var KSe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),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 kt(ILt);n&&n.cloud_instance_host_name&&await Js(this.updateTokenEndpointAuthority.bind(this),Lrn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=gS(),s=await Js(this.executeTokenRequest.bind(this),Mrn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Gp.X_MS_REQUEST_ID],l=new Vp(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),Js(l.handleServerTokenResponse.bind(l),uHe,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 vl(pLt);let r=this.createLogoutUrlQueryString(e);return Is.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=WSe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Is.appendQueryString(e.tokenEndpoint,o),c=await Js(this.createTokenRequestBody.bind(this),Orn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=hce(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${ice}${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=VSe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=Ece(this.config.authOptions.clientId,r);return Js(zSe,Rrn,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(cY(r,e.embeddedClientId||e.extraParameters?.[FM]||this.config.authOptions.clientId),this.includeRedirectUri)lY(r,e.redirectUri);else if(!e.redirectUri)throw vl(cLt);if(aY(r,e.scopes,!0,this.oidcDefaultScopes),BSe(r,e.resource),HLt(r,e.code),TSe(r,this.config.libraryInfo),ISe(r,this.config.telemetry.application),LSe(r),this.serverTelemetryManager&&!oHe(this.config)&&OSe(r,this.serverTelemetryManager),e.codeVerifier&&$Lt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&wSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;RSe(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kSe(r,o.assertionType)}if(PSe(r,gSe.AUTHORIZATION_CODE_GRANT),fY(r),e.authenticationScheme===hf.POP){let o=new z7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Js(o.generateCnf.bind(o),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,NSe(r,s)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)MSe(r,e.sshJwk);else throw vl(vSe);(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&uY(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=hce(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${ice}${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=qM(n.credential);s3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case P_.UPN:$7(r,n.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[Vje])&&a3(r,{[Vje]:"1"}),sY(r,e.correlationId,this.performanceClient),UM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&FLt(r,e.postLogoutRedirectUri),e.correlationId&&dY(r,e.correlationId),e.idTokenHint&&ULt(r,e.idTokenHint),e.state&&xSe(r,e.state),e.logoutHint&&WLt(r,e.logoutHint),e.extraQueryParameters&&a3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&DSe(r),UM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await hBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var pTo=300,AY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),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=gS(),o=await Js(this.executeTokenRequest.bind(this),krn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Gp.X_MS_REQUEST_ID],c=new Vp(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),Js(c.handleServerTokenResponse.bind(c),uHe,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 vl(fLt);if(!e.account)throw kt(bSe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof AS&&o.errorCode===dHe,c=o instanceof k_&&o.errorCode===E4t&&o.subError===_4t;if(s||c)return Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=$rn(this.cacheManager.getRefreshToken.bind(this.cacheManager),Grn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw hHe(dHe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||pTo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),gce(o.expiresOn,c))throw hHe(sBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||hf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:P_.HOME_ACCOUNT_ID}};try{return await Js(this.acquireToken.bind(this),Prn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof AS&&c.subError===GSe){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=WSe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Is.appendQueryString(r.tokenEndpoint,n),s=await Js(this.createTokenRequestBody.bind(this),Drn,this.logger,this.performanceClient,e.correlationId)(e),c=VSe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=Ece(this.config.authOptions.clientId,e);return Js(zSe,wrn,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(cY(r,e.embeddedClientId||e.extraParameters?.[FM]||this.config.authOptions.clientId),e.redirectUri&&lY(r,e.redirectUri),aY(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),PSe(r,gSe.REFRESH_TOKEN_GRANT),fY(r),TSe(r,this.config.libraryInfo),ISe(r,this.config.telemetry.application),LSe(r),this.serverTelemetryManager&&!oHe(this.config)&&OSe(r,this.serverTelemetryManager),GLt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&wSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;RSe(r,await D_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kSe(r,n.assertionType)}if(e.authenticationScheme===hf.POP){let n=new z7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Js(n.generateCnf.bind(n),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,NSe(r,o)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)MSe(r,e.sshJwk);else throw vl(vSe);if((!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&uY(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=qM(e.ccsCredential.credential);s3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case P_.UPN:$7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,{...e.extraParameters}),sY(r,e.correlationId,this.performanceClient),UM(r)}};p();var JSe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),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=pP.NOT_APPLICABLE;if(e.forceRefresh||!fu.isEmptyObj(e.claims))throw this.setCacheOutcome(pP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),kt(dce);if(!e.account)throw kt(bSe);let n=e.account.tenantId||Xrn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(eBt(s.cachedAt)||gce(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(pP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),kt(dce);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(pP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce)}else s.refreshOn&&gce(s.refreshOn,0)&&(r=pP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(pP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce);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 Js(this.generateResultFromCacheRecord.bind(this),Nrn,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==pP.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=u3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw kt(CSe);FSe(o,r.maxAge)}return Vp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var ZSe={};ki(ZSe,{getAuthorizationCodePayload:()=>gTo,getAuthorizeUrl:()=>mTo,getStandardAuthorizeRequestParameters:()=>hTo,validateAuthorizationResponse:()=>enn});p();function hTo(t,e,r,n){let o=e.correlationId,s=new Map;cY(s,e.embeddedClientId||e.extraQueryParameters?.[FM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(aY(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),BSe(s,e.resource),lY(s,e.redirectUri),dY(s,o),BLt(s,e.responseMode),fY(s),VLt(s),e.prompt&&(qLt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(QLt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==mSe.SELECT_ACCOUNT)if(e.sid&&e.prompt===mSe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),tHe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=yTo(e.account),u=ETo(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),fce(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=qM(e.account.homeAccountId);s3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===mSe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),tHe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=qM(e.account.homeAccountId);s3(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),fce(s,e.loginHint),$7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),fce(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=qM(e.account.homeAccountId);s3(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),fce(s,e.loginHint),$7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&jLt(s,e.nonce),e.state&&xSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&uY(s,e.claims,t.clientCapabilities),e.embeddedClientId&&c3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(ace))&&DSe(s),s}a(hTo,"getStandardAuthorizeRequestParameters");function mTo(t,e){let r=UM(e);return Is.appendQueryString(t.authorizationEndpoint,r)}a(mTo,"getAuthorizeUrl");function gTo(t,e){if(enn(t,e),!t.code)throw kt(DLt);return t}a(gTo,"getAuthorizationCodePayload");function enn(t,e){if(!t.state||!e)throw t.state?kt(Xje,"Cached State"):kt(Xje,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw kt(oY,t.state)}try{n=decodeURIComponent(e)}catch{throw kt(oY,t.state)}if(r!==n)throw kt(CLt);if(t.error||t.error_description||t.suberror){let o=ATo(t);throw pHe(t.error,t.error_description,t.suberror)?new AS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new k_(t.error||"",t.error_description,t.suberror,o)}}a(enn,"validateAuthorizationResponse");function ATo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(ATo,"parseServerErrorNo");function yTo(t){return t.idTokenClaims?.sid||null}a(yTo,"extractAccountSid");function ETo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(ETo,"extractLoginHint");p();function yY(t,e){if(t){if(e.resource&&(tnn(e.extraParameters)||tnn(e.extraQueryParameters)))throw kt(LLt);if(!e.resource)throw kt(OLt)}}a(yY,"enforceResourceParameter");function tnn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(tnn,"containsResourceParam");var vce={};ki(vce,{postRequestFailed:()=>vTo,unexpectedError:()=>_To});p();var _To="unexpected_error",vTo="post_request_failed";p();var rnn=",",nnn="|";function CTo(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(rnn),l.length<4)return e}else l=Array.from({length:4},()=>nnn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&bTo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(rnn)}a(CTo,"makeExtraSkuString");function bTo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(nnn))}a(bTo,"setSku");var EY=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=pP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=ASe+tY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${j7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(j7),s=this.getRegionDiscoveryFields(),c=[e,s].join(j7);return[Qje,c,o].join(qje)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(j7),o=e.errors.slice(0,r).join(j7),s=e.errors.length,c=r=f4t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Fo?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(m4t),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={};W7.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 inn="system_assigned_managed_identity",STo="managed_identity",gBt=`https://login.microsoftonline.com/${STo}/`,SC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},qh={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"},no={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},gf={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"},Kf={GET:"GET",POST:"POST"},onn="REGION_NAME",snn="MSAL_FORCE_REGION",ann=32,cnn={SHA256:"sha256"},AHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},ABt={KEY_SEPARATOR:"-"},Tx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Af={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Ix={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"},yHe={INTERVAL_MS:100,TIMEOUT_MS:5e3},lnn=4096;p();p();p();var Cce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Kf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Kf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:ITo(n),signal:s.signal};r===Kf.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 iY($p.networkError,"Request timeout");let f=iY($p.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw fBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:TTo(u.headers),body:await u.json(),status:u.status}}catch(d){throw iY($p.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function TTo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(TTo,"getHeaderDict");function ITo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(ITo,"getFetchHeaders");p();p();p();var EHe="invalid_file_extension",_He="invalid_file_path",Y7="invalid_managed_identity_id_type",vHe="invalid_secret",unn="missing_client_id",dnn="network_unavailable",CHe="platform_not_supported",bHe="unable_to_create_azure_arc",SHe="unable_to_create_cloud_shell",THe="unable_to_create_source",XSe="unable_to_read_secret_file",fnn="user_assigned_not_available_at_runtime",IHe="www_authenticate_header_missing",xHe="www_authenticate_header_unsupported_format",_Y={[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 xTo={[EHe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[_He]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[Y7]:"More than one ManagedIdentityIdType was provided.",[vHe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[CHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[unn]:"A ManagedIdentityId id was not provided.",[_Y.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[_Y.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[_Y.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[_Y.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[dnn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[bHe]:"Azure Arc Managed Identities can only be system assigned.",[SHe]:"Cloud Shell Managed Identities can only be system assigned.",[THe]:"Unable to create a Managed Identity source based on environment variables.",[XSe]:"Unable to read the secret file.",[fnn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[IHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[xHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},yBt=class t extends Fo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,xTo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Wp(t){return new yBt(t)}a(Wp,"createManagedIdentityError");var wHe=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 Wp(Y7);this.id=r,this.idType=gf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Wp(Y7);this.id=n,this.idType=gf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Wp(Y7);this.id=o,this.idType=gf.USER_ASSIGNED_OBJECT_ID}else this.id=inn,this.idType=gf.SYSTEM_ASSIGNED}};p();var jh={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."}},eE=class t extends Fo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(jh.invalidLoopbackAddressType.code,`${jh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(jh.unableToLoadRedirectUri.code,`${jh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(jh.noAuthCodeInResponse.code,`${jh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(jh.noLoopbackServerExists.code,`${jh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(jh.loopbackServerAlreadyExists.code,`${jh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(jh.loopbackServerTimeout.code,`${jh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(jh.stateNotFoundError.code,jh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(jh.thumbprintMissing.code,jh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(jh.redirectUriNotSupported.code,jh.redirectUriNotSupported.desc)}};var wTo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:l3.None,tenant:""},isMcp:!1},EBt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info},RTo={loggerOptions:EBt,networkClient:new Cce,disableInternalRetries:!1,protocolMode:Xy.AAD},kTo={application:{appName:"",appVersion:""}};function pnn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...RTo,networkClient:new Cce,loggerOptions:n?.loggerOptions||EBt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw eE.createStateNotFoundError();return{auth:{...wTo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...kTo,...o}}}a(pnn,"buildAppConfiguration");function hnn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new wHe(e),o=r?.loggerOptions||EBt,s;return r?.networkClient?s=r.networkClient:s=new Cce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(hnn,"buildManagedIdentityConfiguration");p();p();Mo();var bce=class{static{a(this,"GuidGenerator")}generateGuid(){return Mt()}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 yS=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(er.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,er.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 mnn=de(require("crypto"),1);var K7=class{static{a(this,"HashUtils")}sha256(e){return mnn.default.createHash(cnn.SHA256).update(e).digest()}};var gnn=de(require("crypto"),1);var RHe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new K7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%AHe.CV_CHARSET.length;for(;e.length<=ann;){let o=gnn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%AHe.CV_CHARSET.length;e.push(AHe.CV_CHARSET[s])}let n=e.join("");return yS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return yS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var jM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new RHe,this.guidGenerator=new bce,this.hashUtils=new K7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return yS.base64Encode(e)}base64Decode(e){return yS.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 yS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function Ann(t){let e=t.credentialType===er.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(ABt.KEY_SEPARATOR).toLowerCase()}a(Ann,"generateCredentialKey");function ynn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(ABt.KEY_SEPARATOR).toLowerCase()}a(ynn,"generateAccountKey");var J7=class extends W7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Qh,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(mY.isAccountEntity(o))r.accounts[n]=o;else if(R_.isIdTokenEntity(o))r.idTokens[n]=o;else if(R_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(R_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(R_.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 Ann(e)}generateAccountKey(e){return ynn(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(mY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return R_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return R_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return R_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return R_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=R_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&R_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&R_.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&&R_.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 f3.deserializeAllCache(f3.deserializeJSONBlob(e))}static generateJsonCache(e){return q7.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 eTe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Sce=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=q7.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=f3.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=J7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new jM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new mS(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 mS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new bce().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 mS(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:{...eTe.Account,...e.Account},IdToken:{...eTe.IdToken,...e.IdToken},AccessToken:{...eTe.AccessToken,...e.AccessToken},RefreshToken:{...eTe.RefreshToken,...e.RefreshToken},AppMetadata:{...eTe.AppMetadata,...e.AppMetadata}}}};p();var ran=de(Ysn(),1);p();var Ksn="missing_tenant_id_error",Jsn="user_timeout_reached",Zsn="invalid_assertion",u3t="invalid_client_credential",Xsn="device_code_polling_cancelled",ean="device_code_expired",tan="device_code_unknown_error";var p3=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 kt(Zsn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Yu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?Ix.PSS_256:Ix.RSA_256},l=this.useSha256?Ix.X5T_256:Ix.X5T;Object.assign(c,{[l]:yS.base64EncodeUrl(this.thumbprint,er.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[Ix.X5C]:this.publicCertificate});let u={[Ix.AUDIENCE]:this.jwtAudience,[Ix.EXPIRATION_TIME]:this.expirationTime,[Ix.ISSUER]:this.issuer,[Ix.SUBJECT]:this.issuer,[Ix.NOT_BEFORE]:o,[Ix.JWT_ID]:e.createNewGuid()};return this.jwt=ran.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&an.addCcsUpn(r,e.username),CA.mapToQueryString(r)}};p();function nan(t,e,r,n){let o=ZSe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return an.addLibraryInfo(o,{sku:Tx.MSAL_SKU,version:ES,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Xy.OIDC&&an.addApplicationTelemetry(o,t.telemetry.application),an.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&an.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),an.addExtraParameters(o,r.extraQueryParameters||{}),ZSe.getAuthorizeUrl(e,o)}a(nan,"getAuthCodeRequestUrl");var Oce=class{static{a(this,"ClientApplication")}constructor(e){this.config=pnn(e),this.cryptoProvider=new jM,this.logger=new r0(this.config.system.loggerOptions,Mce,ES),this.storage=new J7(this.logger,this.config.auth.clientId,this.cryptoProvider,pBt(this.config.auth)),this.tokenCache=new Sce(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||er.ResponseMode.QUERY,authenticationScheme:er.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return nan(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:er.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(Af.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 KSe(c,new Qh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,Af.acquireTokenByCode,r)}catch(s){throw s instanceof Fo&&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:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(Af.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 AY(s,new Qh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,Af.acquireTokenByRefreshToken)}catch(o){throw o instanceof Fo&&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(Af.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 JSe(s,new Qh);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 G7&&l.errorCode===$p.tokenRefreshRequired)return new AY(s,new Qh).acquireTokenByRefreshToken(r,Af.acquireTokenSilent);throw l}}catch(o){throw o instanceof Fo&&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:[...er.OIDC_DEFAULT_SCOPES]});if(s===er.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 AY(n,new Qh);try{await c.acquireTokenByRefreshToken(e,Af.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(Af.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 oGe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw eE.createStateNotFoundError();if(e!==r)throw kt($p.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:Tx.MSAL_SKU,version:ES,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=p3.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:Tx.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===er.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=er.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...er.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 EY(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=mP.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 gHe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Qh)}clearCache(){this.storage.clear()}};p();var ian=de(require("http"),1);var sGe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw eE.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=ian.default.createServer((s,c)=>{let l=s.url;if(l){if(l===er.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(eE.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=CA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(er.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 eE.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),eE.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Tx.HTTP_PROTOCOL}${Tx.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 aGe=class extends $M{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Yu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Vp(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,Af.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Is.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&&an.addExtraParameters(r,e.extraQueryParameters),CA.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 an.addScopes(r,e.scopes),an.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),kt(Xsn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),kt(Jsn);if(Yu.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}`,""),kt(ean);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Is.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Yu.nowSeconds()+e.timeout:void 0,u=Yu.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===er.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Yu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),iY(vce.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),kt(tan)}createTokenRequestBody(e,r){let n=new Map;an.addScopes(n,e.scopes),an.addClientId(n,this.config.authOptions.clientId),an.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),an.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return an.addCorrelationId(n,o),an.addClientInfo(n),an.addLibraryInfo(n,this.config.libraryInfo),an.addApplicationTelemetry(n,this.config.telemetry.application),an.addThrottling(n),this.serverTelemetryManager&&an.addServerTelemetry(n,this.serverTelemetryManager),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(n)}};var Lce=class extends Oce{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=EY.makeExtraSkuString({libraryName:Tx.MSAL_SKU,libraryVersion:ES})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),yY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(Af.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 aGe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),yY(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||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[nY.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 eE.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new sGe,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||er.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:er.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:er.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new k_(m.error,m.error_description,m.suberror);if(!m.code)throw eE.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),yY(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[nY.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 eE.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return yY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return yY(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(yHe.TIMEOUT_MS/yHe.INTERVAL_MS1)throw kt($p.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=Yu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:er.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Is.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=Yu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Vp(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,Af.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes,!1),an.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};p();var cGe=class extends $M{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new Uh(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(Yu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(er.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),kt($p.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),kt($p.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=nHe.extractTokenClaims(n.secret,yS.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(),Vp.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:er.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||er.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?er.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:er.CredentialType.ACCESS_TOKEN,clientId:e,target:Uh.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 kt($p.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Is.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=Yu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Vp(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,Af.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes),an.addGrantType(r,er.GrantType.JWT_BEARER),an.addClientInfo(r),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),an.addRequestTokenUse(r,nY.ON_BEHALF_OF),an.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};var Fce=class extends Oce{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 kt(u3t);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?p3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):p3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw kt(u3t);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:Tx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!er.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Is(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw kt(Ksn);let u=process.env[snn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[onn]},h=this.initializeServerTelemetryManager(Af.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 Bce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Fo&&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 cGe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Fo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function oan(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(oan,"isIso8601");p();var lGe=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===Kf.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[er.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.POST,e,r)}};var bY={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"},M_=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&&(oan(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Yu.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[qh.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[qh.XMS_CC]=g}let c=s.headers;c[er.HeaderNames.CONTENT_TYPE]=er.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new lGe(this.networkClient,s.retryPolicy,this.logger),d=Yu.nowSeconds(),f;try{s.httpMethod===Kf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Fo?g:kt($p.networkError)}let h=new Vp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Qh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,Af.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case gf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?bY.MANAGED_IDENTITY_CLIENT_ID_2017:bY.MANAGED_IDENTITY_CLIENT_ID;case gf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?bY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:bY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case gf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),bY.MANAGED_IDENTITY_OBJECT_ID;default:throw Wp(Y7)}}};M_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Is(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Wp(_Y[t])}};p();p();p();var uGe=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 WPo=3,zPo=1e3,YPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_TOO_MANY_REQUESTS,er.HTTP_SERVER_ERROR,er.HTTP_SERVICE_UNAVAILABLE,er.HTTP_GATEWAY_TIMEOUT],dGe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new uGe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return zPo}async pauseForRetry(e,r,n,o){if(YPo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var TC=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 dGe}computeUri(){let e=new Map;this.queryParameters&&an.addExtraParameters(e,this.queryParameters);let r=CA.mapToQueryString(e);return Is.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&an.addExtraParameters(e,this.bodyParameters),CA.mapToQueryString(e)}};var KPo="2019-08-01",uTe=class t extends M_{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] ${no.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,no.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${no.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=KPo,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var h3=require("fs"),lan=de(require("path"),1);var JPo="2019-11-01",san="http://127.0.0.1:40342/metadata/identity/oauth2/token",aan="N/A: himds executable exists",can={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},ZPo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},dTe=class t extends M_{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=ZPo[process.platform];try{(0,h3.accessSync)(n,h3.constants.F_OK|h3.constants.R_OK),e=san,r=aan}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] ${no.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${no.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===aan)e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${no.AZURE_ARC} endpoint: ${san}. Creating ${no.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,no.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,no.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${no.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${no.AZURE_ARC} managed identity.`,"")}if(c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(bHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new TC(Kf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[SC.METADATA_HEADER_NAME]="true",r.queryParameters[qh.API_VERSION]=JPo,r.queryParameters[qh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===er.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Wp(IHe);if(!c.includes("Basic realm="))throw Wp(xHe);let l=c.split("Basic realm=")[1];if(!can.hasOwnProperty(process.platform))throw Wp(CHe);let u=can[process.platform],d=lan.default.basename(l);if(!d.endsWith(".key"))throw Wp(EHe);if(u+d!==l)throw Wp(_He);let f;try{f=await(0,h3.statSync)(l).size}catch{throw Wp(XSe)}if(f>lnn)throw Wp(vHe);let h;try{h=(0,h3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw Wp(XSe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[SC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Fo?g:kt($p.networkError)}}return this.getServerTokenResponse(s||e)}};p();var fTe=class t extends M_{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] ${no.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,no.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${no.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${no.CLOUD_SHELL} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(SHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new TC(Kf.POST,this.msiEndpoint);return r.headers[SC.METADATA_HEADER_NAME]="true",r.bodyParameters[qh.RESOURCE]=e,r}};p();p();p();var fGe=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 XPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],e2o=3,t2o=7,r2o=1e3,n2o=4e3,i2o=2e3,o2o=10*1e3,pGe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new fGe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return r2o}static get MAX_EXPONENTIAL_BACKOFF_MS(){return n2o}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return i2o}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return o2o}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?t2o:e2o),(XPo.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var uan="/metadata/identity/oauth2/token",s2o=`http://169.254.169.254${uan}`,a2o="2018-02-01",hGe=class t extends M_{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 ${no.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]}${uan}`,no.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${no.IMDS}, using the default endpoint.`,""),c=s2o),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.METADATA_HEADER_NAME]="true",n.queryParameters[qh.API_VERSION]=a2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new pGe,n}};p();var c2o="2019-07-01-preview",pTe=class t extends M_{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] ${no.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,no.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${no.SERVICE_FABRIC} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${no.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 TC(Kf.GET,this.identityEndpoint);return n.headers[SC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=c2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var l2o="2017-09-01",u2o=`Only client id is supported for user-assigned managed identity in ${no.MACHINE_LEARNING}.`,hTe=class t extends M_{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] ${no.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,no.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${no.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new TC(Kf.GET,this.msiEndpoint);if(n.headers[SC.METADATA_HEADER_NAME]="true",n.headers[SC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[qh.API_VERSION]=l2o,n.queryParameters[qh.RESOURCE]=e,r.idType===gf.SYSTEM_ASSIGNED)n.queryParameters[bY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===gf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(u2o);return n}};var mTe=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(pTe.getEnvironmentVariables())?no.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(uTe.getEnvironmentVariables())?no.APP_SERVICE:this.allEnvironmentVariablesAreDefined(hTe.getEnvironmentVariables())?no.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(fTe.getEnvironmentVariables())?no.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(dTe.getEnvironmentVariables())?no.AZURE_ARC:no.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=pTe.tryCreate(e,r,n,o,s,c)||uTe.tryCreate(e,r,n,o,s)||hTe.tryCreate(e,r,n,o,s)||fTe.tryCreate(e,r,n,o,s,c)||dTe.tryCreate(e,r,n,o,s,c)||hGe.tryCreate(e,r,n,o,s);if(!l)throw Wp(THe);return l}};var d2o=[no.SERVICE_FABRIC],Uce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=hnn(e||{}),this.logger=new r0(this.config.system.loggerOptions,Mce,ES);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new J7(this.logger,this.config.managedIdentityId.id,pce,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new jM;let n={protocolMode:Xy.AAD,knownAuthorities:[gBt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new mP(gBt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Qh,!0),this.fakeClientCredentialClient=new Bce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new mTe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new K7}async acquireToken(e){if(!e.resource)throw vl(uce.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&&d2o.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(er.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===er.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 mTe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var mGe=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=>mY.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 f2o=er.PromptValue,p2o=er.ResponseMode;p();p();p();p();p();function gTe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(gTe,"getRandomIntegerInclusive");function ATe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+gTe(0,n/2)}}a(ATe,"calculateRetryDelay");p();function Qce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Qce,"isObject");p();function SY(t){if(Qce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(SY,"isError");p();p();var dan=require("node:crypto");var d3t,h2o=typeof((d3t=globalThis?.crypto)===null||d3t===void 0?void 0:d3t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):dan.randomUUID;function qce(){return h2o()}a(qce,"randomUUID");p();var f3t,p3t,h3t,m3t,fan=typeof window<"u"&&typeof window.document<"u",pan=typeof self=="object"&&typeof self?.importScripts=="function"&&(((f3t=self.constructor)===null||f3t===void 0?void 0:f3t.name)==="DedicatedWorkerGlobalScope"||((p3t=self.constructor)===null||p3t===void 0?void 0:p3t.name)==="ServiceWorkerGlobalScope"||((h3t=self.constructor)===null||h3t===void 0?void 0:h3t.name)==="SharedWorkerGlobalScope"),han=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",man=typeof Bun<"u"&&typeof Bun.version<"u",tQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((m3t=globalThis.process.versions)===null||m3t===void 0)&&m3t.node);var gan=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function IC(t,e){return Buffer.from(t,e)}a(IC,"stringToUint8Array");p();var g3t="REDACTED",m2o=["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"],g2o=["api-version"],yP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=m2o.concat(e),r=g2o.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)||Qce(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,g3t);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]=g3t;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]=g3t;return r}};p();p();p();p();var TY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function y3t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new TY(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(y3t,"createAbortablePromise");p();var v2o="The delay was aborted.";function E3t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return y3t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??v2o})}a(E3t,"delay");p();function jce(t){if(SY(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(jce,"getErrorMessage");p();function Aan(t,e){return ATe(t,e)}a(Aan,"calculateRetryDelay");function gGe(t){return SY(t)}a(gGe,"isError");var AGe=tQ,Hce=tQ;p();var yTe=lo("IdentityUtils"),yan="1.0";function IY(t,e,r){let n=a(o=>(yTe.getToken.info(o),new bx({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(IY,"ensureValidMsalToken");function _3t(t){let e=t?.authorityHost;return!e&&Hce&&(e=process.env.AZURE_AUTHORITY_HOST),e??cSe}a(_3t,"getAuthorityHost");function v3t(t,e){return e||(e=cSe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(v3t,"getAuthority");function Ean(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Ean,"getKnownAuthorities");var yGe=a((t,e=AGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case _S.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case _S.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case _S.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case _S.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function EGe(t){switch(t){case"error":return _S.LogLevel.Error;case"info":return _S.LogLevel.Info;case"verbose":return _S.LogLevel.Verbose;case"warning":return _S.LogLevel.Warning;default:return _S.LogLevel.Info}}a(EGe,"getMSALLogLevel");function xY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return yTe.info(Us(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new TY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":yTe.info(Us(t,`Authentication returned errorCode ${n.errorCode}`));break;default:yTe.info(Us(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"?(yTe.info(Us(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new bx({scopes:t,getTokenOptions:r,message:e.message})}a(xY,"handleMsalError");function _an(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(_an,"publicToMsal");function van(t,e){return{authority:e.environment??Otn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Mtn,username:e.username,clientId:t,version:yan}}a(van,"msalToPublic");function C3t(t){let e=JSON.parse(t);if(e.version&&e.version!==yan)throw Error("Unsupported AuthenticationRecord version");return e}a(C3t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function b2o(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(b2o,"isPrimitiveBody");function S2o(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(S2o,"handleNullableResponseAndWrappableBody");function b3t(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 S2o({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:b2o(t.parsedBody,l)})}a(b3t,"flattenResponse");var VM={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 WM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var Can=require("node:os"),ban=de(require("node:util"),1),San=de(require("node:process"),1);function Tan(t,...e){San.stderr.write(`${ban.default.format(t,...e)}${Can.EOL}`)}a(Tan,"log");var Ian=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,xan,S3t=[],T3t=[],vGe=[];Ian&&I3t(Ian);var wan=Object.assign(t=>Ran(t),{enable:I3t,enabled:x3t,disable:T2o,log:Tan});function I3t(t){xan=t,S3t=[],T3t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?T3t.push(new RegExp(`^${n.substr(1)}$`)):S3t.push(new RegExp(`^${n}$`));for(let n of vGe)n.enabled=x3t(n.namespace)}a(I3t,"enable");function x3t(t){if(t.endsWith("*"))return!0;for(let e of T3t)if(e.test(t))return!1;for(let e of S3t)if(e.test(t))return!0;return!1}a(x3t,"enabled");function T2o(){let t=xan||"";return I3t(""),t}a(T2o,"disable");function Ran(t){let e=Object.assign(r,{enabled:x3t(t),destroy:I2o,log:wan.log,namespace:t,extend:x2o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),vGe.push(e),e}a(Ran,"createDebugger");function I2o(){let t=vGe.indexOf(this);return t>=0?(vGe.splice(t,1),!0):!1}a(I2o,"destroy");function x2o(t){let e=Ran(`${this.namespace}:${t}`);return e.log=this.log,e}a(x2o,"extend");var Gce=wan;var w3t=["verbose","info","warning","error"],kan={verbose:400,info:300,warning:200,error:100};function Pan(t,e){e.log=(...r)=>{t.log(...r)}}a(Pan,"patchLogMethod");function Dan(t){return w3t.includes(t)}a(Dan,"isTypeSpecRuntimeLogLevel");function w2o(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Gce(t.namespace);o.log=(...f)=>{Gce.log(...f)};function s(f){if(f&&!Dan(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${w3t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Gce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Dan(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${w3t.join(", ")}.`));function c(f){return!!(n&&kan[f.level]<=kan[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Pan(f,m),c(m)){let g=Gce.disable();Gce.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 Pan(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(w2o,"createLoggerContext");var Nan=w2o({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),R2o=Nan.logger;function _Te(t){return Nan.createClientLogger(t)}a(_Te,"createClientLogger");p();function CGe(t){return t.toLowerCase()}a(CGe,"normalizeName");function*k2o(t){for(let e of t.values())yield[e.name,e.value]}a(k2o,"headerIterator");var R3t=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(CGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(CGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(CGe(e))}delete(e){this._headersMap.delete(CGe(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 k2o(this._headersMap)}};function vS(t){return new R3t(t)}a(vS,"createHttpHeaders");p();p();p();var k3t=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:vS(),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||qce(),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 bGe(t){return new k3t(t)}a(bGe,"createPipelineRequest");p();var Man=new Set(["Deserialize","Serialize","Retry","Sign"]),P3t=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&&!Man.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Man.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 SGe(){return P3t.create()}a(SGe,"createEmptyPipeline");p();p();var Oan=require("node:util"),Lan=Oan.inspect.custom;var P2o=new yP,TA=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,Lan,{value:a(()=>`RestError: ${this.message} - ${P2o.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};TA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";TA.PARSE_ERROR="PARSE_ERROR";function TGe(t){return t instanceof TA?!0:SY(t)&&t.name==="RestError"}a(TGe,"isRestError");p();p();var $ce=de(require("node:http"),1),Vce=de(require("node:https"),1),xGe=de(require("node:zlib"),1),Fan=require("node:stream");p();var kx=_Te("ts-http-runtime");var D2o={};function vTe(t){return t&&typeof t.pipe=="function"}a(vTe,"isReadableStream");function Ban(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(Ban,"isStreamComplete");function Uan(t){return t&&typeof t.byteLength=="number"}a(Uan,"isArrayBuffer");var IGe=class extends Fan.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}},D3t=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 WM("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 yP;kx.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=L2o(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new IGe(_);v.on("error",b=>{kx.error("Error in upload progress",b)}),vTe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=N2o(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?M2o(m,g):m;let E=e.onDownloadProgress;if(E){let _=new IGe(E);_.on("error",v=>{kx.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 O2o(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();vTe(f)&&(m=Ban(f));let g=Promise.resolve();vTe(h)&&(g=Ban(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{kx.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?$ce.request(u,d):Vce.request(u,d);h.once("error",m=>{var g;f(new TA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:TA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new WM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&vTe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Uan(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(kx.error("Unrecognized body type",n),f(new TA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?$ce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new $ce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Vce.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:D2o,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(kx.info("No cached TLS Agent exist, creating a new Agent"),c=new Vce.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function N2o(t){let e=vS();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(N2o,"getResponseHeaders");function M2o(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=xGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=xGe.createInflate();return t.pipe(n),n}return t}a(M2o,"getDecodedResponseStream");function O2o(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 TA(`Error reading response as text: ${o.message}`,{code:TA.PARSE_ERROR}))})})}a(O2o,"streamToText");function L2o(t){return t?Buffer.isBuffer(t)?t.length:vTe(t)?null:Uan(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(L2o,"getBodyLength");function Qan(){return new D3t}a(Qan,"createNodeHttpClient");function wGe(){return Qan()}a(wGe,"createDefaultHttpClient");p();p();p();p();var N3t="logPolicy";function RGe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:kx.info,n=new yP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:N3t,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(RGe,"logPolicy");p();var M3t="redirectPolicy",qan=["GET","HEAD"];function kGe(t={}){let{maxRetries:e=20}=t;return{name:M3t,async sendRequest(r,n){let o=await n(r);return jan(n,o,e)}}}a(kGe,"redirectPolicy");async function jan(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&qan.includes(o.method)||s===302&&qan.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new WM(r?.abortErrorMsg?r?.abortErrorMsg:B2o)),"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($an,"delay");function Van(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Van,"parseHeaderValueAsNumber");var L3t="Retry-After",F2o=["retry-after-ms","x-ms-retry-after-ms",L3t];function Wan(t){if(t&&[429,503].includes(t.status))try{for(let o of F2o){let s=Van(t,o);if(s===0||s)return s*(o===L3t?1e3:1)}let e=t.headers.get(L3t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Wan,"getRetryAfterInMs");function zan(t){return Number.isFinite(Wan(t))}a(zan,"isThrottlingRetryResponse");function B3t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Wan(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(B3t,"throttlingRetryStrategy");var U2o=1e3,Q2o=1e3*64;function DGe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:U2o,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:Q2o;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=j2o(l),d=u&&t.ignoreSystemErrors,f=q2o(c),h=f&&t.ignoreHttpStatusCodes;return c&&(zan(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:ATe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(DGe,"exponentialRetryStrategy");function q2o(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(q2o,"isExponentialRetryResponse");function j2o(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(j2o,"isSystemError");p();var H2o=_Te("ts-http-runtime retryPolicy"),G2o="retryPolicy";function rQ(t,e={maxRetries:3}){let r=e.logger||H2o;return{name:G2o,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 WM;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 $an(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(rQ,"retryPolicy");var F3t="defaultRetryPolicy";function NGe(t={}){var e;return{name:F3t,sendRequest:rQ([B3t(),DGe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(NGe,"defaultRetryPolicy");p();var U3t="formDataPolicy";function $2o(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($2o,"formDataToFormDataMap");function MGe(){return{name:U3t,async sendRequest(t,e){if(tQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=$2o(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=V2o(t.formData):await W2o(t.formData,t),t.formData=void 0}return e(t)}}}a(MGe,"formDataPolicy");function V2o(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(V2o,"wwwFormUrlEncode");async function W2o(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:vS({"Content-Disposition":`form-data; name="${o}"`}),body:IC(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=vS();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(W2o,"prepareFormData");p();var Ecn=de(W3t(),1),_cn=de(z3t(),1);var qDo="HTTPS_PROXY",jDo="HTTP_PROXY",HDo="ALL_PROXY",GDo="NO_PROXY",Y3t="proxyPolicy",gcn=[],vcn=!1,$Do=new Map;function jGe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(jGe,"getEnvironmentValue");function VDo(){if(!process)return;let t=jGe(qDo),e=jGe(HDo),r=jGe(jDo);return t||e||r}a(VDo,"loadEnvironmentProxyValue");function WDo(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(WDo,"isBypassed");function zDo(){let t=jGe(GDo);return vcn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(zDo,"loadNoProxy");function YDo(){let t=VDo();return t?new URL(t):void 0}a(YDo,"getDefaultProxySettingsInternal");function Acn(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(Acn,"getUrlFromProxySettings");function ycn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&kx.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 _cn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Ecn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(ycn,"setProxyAgentOnRequest");function HGe(t,e){vcn||gcn.push(...zDo());let r=t?Acn(t):YDo(),n={};return{name:Y3t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!WDo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:gcn,e?.customNoProxyList?void 0:$Do)?ycn(o,n,r):o.proxySettings&&ycn(o,n,Acn(o.proxySettings)),s(o)}}}a(HGe,"proxyPolicy");p();var K3t="agentPolicy";function GGe(t){return{name:K3t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(GGe,"agentPolicy");p();var J3t="tlsPolicy";function $Ge(t){return{name:J3t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a($Ge,"tlsPolicy");p();p();function VGe(t){return typeof t.stream=="function"}a(VGe,"isBlob");p();m3();var JGe=require("stream");function Wcn(){return bTe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield SS(e.read());if(r)return yield SS(void 0);yield yield SS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Wcn,"streamAsyncIterator");function XDo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Wcn.bind(t)),t.values||(t.values=Wcn.bind(t))}a(XDo,"makeAsyncIterable");function zcn(t){return t instanceof ReadableStream?(XDo(t),JGe.Readable.fromWeb(t)):t}a(zcn,"ensureNodeStream");function eNo(t){return t instanceof Uint8Array?JGe.Readable.from(Buffer.from(t)):VGe(t)?zcn(t.stream()):zcn(t)}a(eNo,"toStream");async function Ycn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(eNo);return JGe.Readable.from((function(){return bTe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,KGe(d)),u;u=yield SS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield SS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield SS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Ycn,"concat");function tNo(){return`----AzSDKFormBoundary${qce()}`}a(tNo,"generateBoundary");function rNo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(rNo,"encodeHeaders");function nNo(t){return t instanceof Uint8Array?t.byteLength:VGe(t)?t.size===-1?void 0:t.size:void 0}a(nNo,"getLength");function iNo(t){let e=0;for(let r of t){let n=nNo(r);if(n===void 0)return;e+=n}return e}a(iNo,"getTotalLength");async function oNo(t,e,r){let n=[IC(`--${r}`,"utf-8"),...e.flatMap(s=>[IC(`\r -`,"utf-8"),IC(rNo(s.headers),"utf-8"),IC(`\r -`,"utf-8"),s.body,IC(`\r ---${r}`,"utf-8")]),IC(`--\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&&Is.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==u3.None){let o=r.tenant?r.tenant:gSe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return z5t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw kt(gP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return tBt.has(e)}static isPublicCloudAuthority(e){return i4t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Is(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${n4t}`);let l=Is.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 Is(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(Bje)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${Z5t}`}return r}};AP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",hP.COMMON,hP.CONSUMERS,hP.ORGANIZATIONS]);function inn(t){let n=new Is(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case hP.COMMON:case hP.ORGANIZATIONS:case hP.CONSUMERS:return;default:return n}}a(inn,"getTenantFromAuthorityString");function _He(t){return t.endsWith(rce)?t:`${t}${rce}`}a(_He,"formatAuthorityUri");function ABt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw Cl(tHe)}return{canonicalAuthority:t.authority?_He(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(ABt,"buildStaticAuthorityOptions");async function yBt(t,e,r,n,o,s,c){let l=AP.transformCIAMAuthority(_He(t)),u=new AP(l,e,r,n,o,s,c);try{return await Js(u.resolveEndpointsAsync.bind(u),jrn,o,c,s)(),u}catch{throw kt(gP)}}a(yBt,"createDiscoveredInstance");var XSe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=f3(e),this.logger=new i0(this.config.loggerOptions,z7,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 kt(kLt);n&&n.cloud_instance_host_name&&await Js(this.updateTokenEndpointAuthority.bind(this),qrn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=AS(),s=await Js(this.executeTokenRequest.bind(this),Urn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Vp.X_MS_REQUEST_ID],l=new zp(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),Js(l.handleServerTokenResponse.bind(l),mHe,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 Cl(ALt);let r=this.createLogoutUrlQueryString(e);return Is.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=KSe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Is.appendQueryString(e.tokenEndpoint,o),c=await Js(this.createTokenRequestBody.bind(this),Qrn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=mce(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${oce}${f.utid}`,type:D_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=YSe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=_ce(this.config.authOptions.clientId,r);return Js(JSe,Mrn,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(fY(r,e.embeddedClientId||e.extraParameters?.[qM]||this.config.authOptions.clientId),this.includeRedirectUri)pY(r,e.redirectUri);else if(!e.redirectUri)throw Cl(fLt);if(dY(r,e.scopes,!0,this.oidcDefaultScopes),QSe(r,e.resource),WLt(r,e.code),wSe(r,this.config.libraryInfo),RSe(r,this.config.telemetry.application),USe(r),this.serverTelemetryManager&&!uHe(this.config)&&FSe(r,this.serverTelemetryManager),e.codeVerifier&&YLt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&PSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;DSe(r,await N_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),NSe(r,o.assertionType)}if(MSe(r,ESe.AUTHORIZATION_CODE_GRANT),gY(r),e.authenticationScheme===gf.POP){let o=new K7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Js(o.generateCnf.bind(o),Ece,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,LSe(r,s)}else if(e.authenticationScheme===gf.SSH)if(e.sshJwk)BSe(r,e.sshJwk);else throw Cl(SSe);(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&hY(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=mce(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${oce}${o.utid}`,type:D_.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 D_.HOME_ACCOUNT_ID:try{let o=GM(n.credential);a3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case D_.UPN:W7(r,n.credential);break}return e.embeddedClientId&&l3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&c3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[Jje])&&c3(r,{[Jje]:"1"}),uY(r,e.correlationId,this.performanceClient),jM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&jLt(r,e.postLogoutRedirectUri),e.correlationId&&mY(r,e.correlationId),e.idTokenHint&&HLt(r,e.idTokenHint),e.state&&kSe(r,e.state),e.logoutHint&&JLt(r,e.logoutHint),e.extraQueryParameters&&c3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&OSe(r),jM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await yBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var TTo=300,vY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=f3(e),this.logger=new i0(this.config.loggerOptions,z7,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=AS(),o=await Js(this.executeTokenRequest.bind(this),Orn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Vp.X_MS_REQUEST_ID],c=new zp(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),Js(c.handleServerTokenResponse.bind(c),mHe,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 Cl(gLt);if(!e.account)throw kt(ISe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Js(this.acquireTokenWithCachedRefreshToken.bind(this),hHe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof yS&&o.errorCode===gHe,c=o instanceof P_&&o.errorCode===b4t&&o.subError===S4t;if(s||c)return Js(this.acquireTokenWithCachedRefreshToken.bind(this),hHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Js(this.acquireTokenWithCachedRefreshToken.bind(this),hHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=Krn(this.cacheManager.getRefreshToken.bind(this.cacheManager),Yrn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw EHe(gHe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||TTo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),Ace(o.expiresOn,c))throw EHe(uBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||gf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:D_.HOME_ACCOUNT_ID}};try{return await Js(this.acquireToken.bind(this),Lrn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof yS&&c.subError===WSe){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=KSe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Is.appendQueryString(r.tokenEndpoint,n),s=await Js(this.createTokenRequestBody.bind(this),Brn,this.logger,this.performanceClient,e.correlationId)(e),c=YSe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=_ce(this.config.authOptions.clientId,e);return Js(JSe,Nrn,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(fY(r,e.embeddedClientId||e.extraParameters?.[qM]||this.config.authOptions.clientId),e.redirectUri&&pY(r,e.redirectUri),dY(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),MSe(r,ESe.REFRESH_TOKEN_GRANT),gY(r),wSe(r,this.config.libraryInfo),RSe(r,this.config.telemetry.application),USe(r),this.serverTelemetryManager&&!uHe(this.config)&&FSe(r,this.serverTelemetryManager),zLt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&PSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;DSe(r,await N_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),NSe(r,n.assertionType)}if(e.authenticationScheme===gf.POP){let n=new K7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Js(n.generateCnf.bind(n),Ece,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,LSe(r,o)}else if(e.authenticationScheme===gf.SSH)if(e.sshJwk)BSe(r,e.sshJwk);else throw Cl(SSe);if((!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&hY(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case D_.HOME_ACCOUNT_ID:try{let n=GM(e.ccsCredential.credential);a3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case D_.UPN:W7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&l3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&c3(r,{...e.extraParameters}),uY(r,e.correlationId,this.performanceClient),jM(r)}};p();var eTe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=f3(e),this.logger=new i0(this.config.loggerOptions,z7,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=mP.NOT_APPLICABLE;if(e.forceRefresh||!fu.isEmptyObj(e.claims))throw this.setCacheOutcome(mP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),kt(fce);if(!e.account)throw kt(ISe);let n=e.account.tenantId||inn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(iBt(s.cachedAt)||Ace(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(mP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),kt(fce);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(mP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(fce)}else s.refreshOn&&Ace(s.refreshOn,0)&&(r=mP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(mP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(fce);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 Js(this.generateResultFromCacheRecord.bind(this),Frn,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==mP.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=d3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw kt(TSe);qSe(o,r.maxAge)}return zp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var tTe={};ki(tTe,{getAuthorizationCodePayload:()=>wTo,getAuthorizeUrl:()=>xTo,getStandardAuthorizeRequestParameters:()=>ITo,validateAuthorizationResponse:()=>onn});p();function ITo(t,e,r,n){let o=e.correlationId,s=new Map;fY(s,e.embeddedClientId||e.extraQueryParameters?.[qM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(dY(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),QSe(s,e.resource),pY(s,e.redirectUri),mY(s,o),qLt(s,e.responseMode),gY(s),KLt(s),e.prompt&&($Lt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(GLt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==ySe.SELECT_ACCOUNT)if(e.sid&&e.prompt===ySe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),sHe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=kTo(e.account),u=PTo(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),pce(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=GM(e.account.homeAccountId);a3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===ySe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),sHe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=GM(e.account.homeAccountId);a3(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),pce(s,e.loginHint),W7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),pce(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=GM(e.account.homeAccountId);a3(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),pce(s,e.loginHint),W7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&VLt(s,e.nonce),e.state&&kSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&hY(s,e.claims,t.clientCapabilities),e.embeddedClientId&&l3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(cce))&&OSe(s),s}a(ITo,"getStandardAuthorizeRequestParameters");function xTo(t,e){let r=jM(e);return Is.appendQueryString(t.authorizationEndpoint,r)}a(xTo,"getAuthorizeUrl");function wTo(t,e){if(onn(t,e),!t.code)throw kt(LLt);return t}a(wTo,"getAuthorizationCodePayload");function onn(t,e){if(!t.state||!e)throw t.state?kt(iHe,"Cached State"):kt(iHe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw kt(lY,t.state)}try{n=decodeURIComponent(e)}catch{throw kt(lY,t.state)}if(r!==n)throw kt(ILt);if(t.error||t.error_description||t.suberror){let o=RTo(t);throw yHe(t.error,t.error_description,t.suberror)?new yS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new P_(t.error||"",t.error_description,t.suberror,o)}}a(onn,"validateAuthorizationResponse");function RTo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(RTo,"parseServerErrorNo");function kTo(t){return t.idTokenClaims?.sid||null}a(kTo,"extractAccountSid");function PTo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(PTo,"extractLoginHint");p();function CY(t,e){if(t){if(e.resource&&(snn(e.extraParameters)||snn(e.extraQueryParameters)))throw kt(QLt);if(!e.resource)throw kt(ULt)}}a(CY,"enforceResourceParameter");function snn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(snn,"containsResourceParam");var Cce={};ki(Cce,{postRequestFailed:()=>NTo,unexpectedError:()=>DTo});p();var DTo="unexpected_error",NTo="post_request_failed";p();var ann=",",cnn="|";function MTo(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(ann),l.length<4)return e}else l=Array.from({length:4},()=>cnn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&OTo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(ann)}a(MTo,"makeExtraSkuString");function OTo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(cnn))}a(OTo,"setSku");var bY=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=mP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=_Se+oY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${G7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(G7),s=this.getRegionDiscoveryFields(),c=[e,s].join(G7);return[$je,c,o].join(Vje)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(G7),o=e.errors.slice(0,r).join(G7),s=e.errors.length,c=r=g4t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Uo?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(E4t),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={};Y7.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 lnn="system_assigned_managed_identity",LTo="managed_identity",_Bt=`https://login.microsoftonline.com/${LTo}/`,TC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},Hh={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"},no={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},yf={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"},Zf={GET:"GET",POST:"POST"},unn="REGION_NAME",dnn="MSAL_FORCE_REGION",fnn=32,pnn={SHA256:"sha256"},CHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},vBt={KEY_SEPARATOR:"-"},xx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Ef={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},wx={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"},bHe={INTERVAL_MS:100,TIMEOUT_MS:5e3},hnn=4096;p();p();p();var bce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Zf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Zf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:FTo(n),signal:s.signal};r===Zf.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 cY(Wp.networkError,"Request timeout");let f=cY(Wp.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw gBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:BTo(u.headers),body:await u.json(),status:u.status}}catch(d){throw cY(Wp.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function BTo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(BTo,"getHeaderDict");function FTo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(FTo,"getFetchHeaders");p();p();p();var SHe="invalid_file_extension",THe="invalid_file_path",J7="invalid_managed_identity_id_type",IHe="invalid_secret",mnn="missing_client_id",gnn="network_unavailable",xHe="platform_not_supported",wHe="unable_to_create_azure_arc",RHe="unable_to_create_cloud_shell",kHe="unable_to_create_source",rTe="unable_to_read_secret_file",Ann="user_assigned_not_available_at_runtime",PHe="www_authenticate_header_missing",DHe="www_authenticate_header_unsupported_format",SY={[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 UTo={[SHe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[THe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[J7]:"More than one ManagedIdentityIdType was provided.",[IHe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[xHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[mnn]:"A ManagedIdentityId id was not provided.",[SY.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[SY.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[SY.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[SY.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[gnn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[wHe]:"Azure Arc Managed Identities can only be system assigned.",[RHe]:"Cloud Shell Managed Identities can only be system assigned.",[kHe]:"Unable to create a Managed Identity source based on environment variables.",[rTe]:"Unable to read the secret file.",[Ann]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[PHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[DHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},CBt=class t extends Uo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,UTo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Yp(t){return new CBt(t)}a(Yp,"createManagedIdentityError");var NHe=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 Yp(J7);this.id=r,this.idType=yf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Yp(J7);this.id=n,this.idType=yf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Yp(J7);this.id=o,this.idType=yf.USER_ASSIGNED_OBJECT_ID}else this.id=lnn,this.idType=yf.SYSTEM_ASSIGNED}};p();var Gh={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."}},tE=class t extends Uo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(Gh.invalidLoopbackAddressType.code,`${Gh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(Gh.unableToLoadRedirectUri.code,`${Gh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(Gh.noAuthCodeInResponse.code,`${Gh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(Gh.noLoopbackServerExists.code,`${Gh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(Gh.loopbackServerAlreadyExists.code,`${Gh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(Gh.loopbackServerTimeout.code,`${Gh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(Gh.stateNotFoundError.code,Gh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(Gh.thumbprintMissing.code,Gh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(Gh.redirectUriNotSupported.code,Gh.redirectUriNotSupported.desc)}};var QTo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:u3.None,tenant:""},isMcp:!1},bBt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:Af.Info},qTo={loggerOptions:bBt,networkClient:new bce,disableInternalRetries:!1,protocolMode:eE.AAD},jTo={application:{appName:"",appVersion:""}};function ynn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...qTo,networkClient:new bce,loggerOptions:n?.loggerOptions||bBt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw tE.createStateNotFoundError();return{auth:{...QTo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...jTo,...o}}}a(ynn,"buildAppConfiguration");function Enn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new NHe(e),o=r?.loggerOptions||bBt,s;return r?.networkClient?s=r.networkClient:s=new bce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(Enn,"buildManagedIdentityConfiguration");p();p();Oo();var Sce=class{static{a(this,"GuidGenerator")}generateGuid(){return Mt()}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 ES=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(er.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,er.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 _nn=de(require("crypto"),1);var Z7=class{static{a(this,"HashUtils")}sha256(e){return _nn.default.createHash(pnn.SHA256).update(e).digest()}};var vnn=de(require("crypto"),1);var MHe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new Z7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%CHe.CV_CHARSET.length;for(;e.length<=fnn;){let o=vnn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%CHe.CV_CHARSET.length;e.push(CHe.CV_CHARSET[s])}let n=e.join("");return ES.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return ES.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var $M=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new MHe,this.guidGenerator=new Sce,this.hashUtils=new Z7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return ES.base64Encode(e)}base64Decode(e){return ES.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 ES.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function Cnn(t){let e=t.credentialType===er.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(vBt.KEY_SEPARATOR).toLowerCase()}a(Cnn,"generateCredentialKey");function bnn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(vBt.KEY_SEPARATOR).toLowerCase()}a(bnn,"generateAccountKey");var X7=class extends Y7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new jh,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(EY.isAccountEntity(o))r.accounts[n]=o;else if(k_.isIdTokenEntity(o))r.idTokens[n]=o;else if(k_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(k_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(k_.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 Cnn(e)}generateAccountKey(e){return bnn(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(EY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return k_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return k_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return k_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return k_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=k_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&k_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&k_.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&&k_.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 p3.deserializeAllCache(p3.deserializeJSONBlob(e))}static generateJsonCache(e){return H7.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 nTe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Tce=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=H7.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=p3.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=X7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new $M().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new gS(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 gS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new Sce().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 gS(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:{...nTe.Account,...e.Account},IdToken:{...nTe.IdToken,...e.IdToken},AccessToken:{...nTe.AccessToken,...e.AccessToken},RefreshToken:{...nTe.RefreshToken,...e.RefreshToken},AppMetadata:{...nTe.AppMetadata,...e.AppMetadata}}}};p();var aan=de(ean(),1);p();var tan="missing_tenant_id_error",ran="user_timeout_reached",nan="invalid_assertion",h3t="invalid_client_credential",ian="device_code_polling_cancelled",oan="device_code_expired",san="device_code_unknown_error";var h3=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 kt(nan)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Ku.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?wx.PSS_256:wx.RSA_256},l=this.useSha256?wx.X5T_256:wx.X5T;Object.assign(c,{[l]:ES.base64EncodeUrl(this.thumbprint,er.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[wx.X5C]:this.publicCertificate});let u={[wx.AUDIENCE]:this.jwtAudience,[wx.EXPIRATION_TIME]:this.expirationTime,[wx.ISSUER]:this.issuer,[wx.SUBJECT]:this.issuer,[wx.NOT_BEFORE]:o,[wx.JWT_ID]:e.createNewGuid()};return this.jwt=aan.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&an.addCcsUpn(r,e.username),bA.mapToQueryString(r)}};p();function can(t,e,r,n){let o=tTe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return an.addLibraryInfo(o,{sku:xx.MSAL_SKU,version:_S,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==eE.OIDC&&an.addApplicationTelemetry(o,t.telemetry.application),an.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&an.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),an.addExtraParameters(o,r.extraQueryParameters||{}),tTe.getAuthorizeUrl(e,o)}a(can,"getAuthCodeRequestUrl");var Lce=class{static{a(this,"ClientApplication")}constructor(e){this.config=ynn(e),this.cryptoProvider=new $M,this.logger=new i0(this.config.system.loggerOptions,Oce,_S),this.storage=new X7(this.logger,this.config.auth.clientId,this.cryptoProvider,ABt(this.config.auth)),this.tokenCache=new Tce(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||er.ResponseMode.QUERY,authenticationScheme:er.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return can(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:er.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(Ef.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 XSe(c,new jh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,Ef.acquireTokenByCode,r)}catch(s){throw s instanceof Uo&&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:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(Ef.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 vY(s,new jh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,Ef.acquireTokenByRefreshToken)}catch(o){throw o instanceof Uo&&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(Ef.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 eTe(s,new jh);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 V7&&l.errorCode===Wp.tokenRefreshRequired)return new vY(s,new jh).acquireTokenByRefreshToken(r,Ef.acquireTokenSilent);throw l}}catch(o){throw o instanceof Uo&&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:[...er.OIDC_DEFAULT_SCOPES]});if(s===er.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 vY(n,new jh);try{await c.acquireTokenByRefreshToken(e,Ef.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(Ef.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 uGe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Uo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw tE.createStateNotFoundError();if(e!==r)throw kt(Wp.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:xx.MSAL_SKU,version:_S,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=h3.fromAssertion(await N_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:xx.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===er.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=er.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...er.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 bY(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=AP.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 vHe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new jh)}clearCache(){this.storage.clear()}};p();var lan=de(require("http"),1);var dGe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw tE.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=lan.default.createServer((s,c)=>{let l=s.url;if(l){if(l===er.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(tE.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=bA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(er.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 tE.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),tE.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${xx.HTTP_PROTOCOL}${xx.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 fGe=class extends zM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Ku.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new zp(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,Ef.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Is.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&&an.addExtraParameters(r,e.extraQueryParameters),bA.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 an.addScopes(r,e.scopes),an.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),bA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),kt(ian);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),kt(ran);if(Ku.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}`,""),kt(oan);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Is.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Ku.nowSeconds()+e.timeout:void 0,u=Ku.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===er.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Ku.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),cY(Cce.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),kt(san)}createTokenRequestBody(e,r){let n=new Map;an.addScopes(n,e.scopes),an.addClientId(n,this.config.authOptions.clientId),an.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),an.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return an.addCorrelationId(n,o),an.addClientInfo(n),an.addLibraryInfo(n,this.config.libraryInfo),an.addApplicationTelemetry(n,this.config.telemetry.application),an.addThrottling(n),this.serverTelemetryManager&&an.addServerTelemetry(n,this.serverTelemetryManager),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),bA.mapToQueryString(n)}};var Bce=class extends Lce{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=bY.makeExtraSkuString({libraryName:xx.MSAL_SKU,libraryVersion:_S})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),CY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(Ef.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 fGe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Uo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),CY(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||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[aY.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 tE.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new dGe,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||er.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:er.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:er.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new P_(m.error,m.error_description,m.suberror);if(!m.code)throw tE.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),CY(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[aY.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 tE.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return CY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return CY(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(bHe.TIMEOUT_MS/bHe.INTERVAL_MS1)throw kt(Wp.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=Ku.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:er.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Is.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=Ku.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new zp(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,Ef.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes,!1),an.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await N_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),bA.mapToQueryString(r)}};p();var pGe=class extends zM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new qh(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(Ku.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(er.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),kt(Wp.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),kt(Wp.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=cHe.extractTokenClaims(n.secret,ES.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(),zp.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:er.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||er.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?er.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:er.CredentialType.ACCESS_TOKEN,clientId:e,target:qh.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 kt(Wp.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Is.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=Ku.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new zp(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,Ef.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes),an.addGrantType(r,er.GrantType.JWT_BEARER),an.addClientInfo(r),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),an.addRequestTokenUse(r,aY.ON_BEHALF_OF),an.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await N_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),bA.mapToQueryString(r)}};var Uce=class extends Lce{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 kt(h3t);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?h3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):h3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw kt(h3t);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 N_(e.clientAssertion,this.config.auth.clientId),assertionType:xx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!er.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Is(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw kt(tan);let u=process.env[dnn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[unn]},h=this.initializeServerTelemetryManager(Ef.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 Fce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Uo&&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 pGe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Uo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function uan(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(uan,"isIso8601");p();var hGe=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===Zf.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[er.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(Zf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Zf.POST,e,r)}};var xY={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"},O_=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&&(uan(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Ku.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[Hh.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[Hh.XMS_CC]=g}let c=s.headers;c[er.HeaderNames.CONTENT_TYPE]=er.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new hGe(this.networkClient,s.retryPolicy,this.logger),d=Ku.nowSeconds(),f;try{s.httpMethod===Zf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Uo?g:kt(Wp.networkError)}let h=new zp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new jh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,Ef.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case yf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?xY.MANAGED_IDENTITY_CLIENT_ID_2017:xY.MANAGED_IDENTITY_CLIENT_ID;case yf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?xY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:xY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case yf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),xY.MANAGED_IDENTITY_OBJECT_ID;default:throw Yp(J7)}}};O_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Is(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Yp(SY[t])}};p();p();p();var mGe=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 o2o=3,s2o=1e3,a2o=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_TOO_MANY_REQUESTS,er.HTTP_SERVER_ERROR,er.HTTP_SERVICE_UNAVAILABLE,er.HTTP_GATEWAY_TIMEOUT],gGe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new mGe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return s2o}async pauseForRetry(e,r,n,o){if(a2o.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var IC=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 gGe}computeUri(){let e=new Map;this.queryParameters&&an.addExtraParameters(e,this.queryParameters);let r=bA.mapToQueryString(e);return Is.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&an.addExtraParameters(e,this.bodyParameters),bA.mapToQueryString(e)}};var c2o="2019-08-01",pTe=class t extends O_{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] ${no.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,no.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${no.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new IC(Zf.GET,this.identityEndpoint);return n.headers[TC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Hh.API_VERSION]=c2o,n.queryParameters[Hh.RESOURCE]=e,r.idType!==yf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var m3=require("fs"),han=de(require("path"),1);var l2o="2019-11-01",dan="http://127.0.0.1:40342/metadata/identity/oauth2/token",fan="N/A: himds executable exists",pan={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},u2o={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},hTe=class t extends O_{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=u2o[process.platform];try{(0,m3.accessSync)(n,m3.constants.F_OK|m3.constants.R_OK),e=dan,r=fan}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] ${no.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${no.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===fan)e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${no.AZURE_ARC} endpoint: ${dan}. Creating ${no.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,no.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,no.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${no.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${no.AZURE_ARC} managed identity.`,"")}if(c.idType!==yf.SYSTEM_ASSIGNED)throw Yp(wHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new IC(Zf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[TC.METADATA_HEADER_NAME]="true",r.queryParameters[Hh.API_VERSION]=l2o,r.queryParameters[Hh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===er.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Yp(PHe);if(!c.includes("Basic realm="))throw Yp(DHe);let l=c.split("Basic realm=")[1];if(!pan.hasOwnProperty(process.platform))throw Yp(xHe);let u=pan[process.platform],d=han.default.basename(l);if(!d.endsWith(".key"))throw Yp(SHe);if(u+d!==l)throw Yp(THe);let f;try{f=await(0,m3.statSync)(l).size}catch{throw Yp(rTe)}if(f>hnn)throw Yp(IHe);let h;try{h=(0,m3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw Yp(rTe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[TC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Uo?g:kt(Wp.networkError)}}return this.getServerTokenResponse(s||e)}};p();var mTe=class t extends O_{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] ${no.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,no.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${no.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${no.CLOUD_SHELL} managed identity.`,""),c.idType!==yf.SYSTEM_ASSIGNED)throw Yp(RHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new IC(Zf.POST,this.msiEndpoint);return r.headers[TC.METADATA_HEADER_NAME]="true",r.bodyParameters[Hh.RESOURCE]=e,r}};p();p();p();var AGe=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 d2o=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],f2o=3,p2o=7,h2o=1e3,m2o=4e3,g2o=2e3,A2o=10*1e3,yGe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new AGe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return h2o}static get MAX_EXPONENTIAL_BACKOFF_MS(){return m2o}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return g2o}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return A2o}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?p2o:f2o),(d2o.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var man="/metadata/identity/oauth2/token",y2o=`http://169.254.169.254${man}`,E2o="2018-02-01",EGe=class t extends O_{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 ${no.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]}${man}`,no.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${no.IMDS}, using the default endpoint.`,""),c=y2o),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new IC(Zf.GET,this.identityEndpoint);return n.headers[TC.METADATA_HEADER_NAME]="true",n.queryParameters[Hh.API_VERSION]=E2o,n.queryParameters[Hh.RESOURCE]=e,r.idType!==yf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new yGe,n}};p();var _2o="2019-07-01-preview",gTe=class t extends O_{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] ${no.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,no.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${no.SERVICE_FABRIC} managed identity.`,""),c.idType!==yf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${no.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 IC(Zf.GET,this.identityEndpoint);return n.headers[TC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Hh.API_VERSION]=_2o,n.queryParameters[Hh.RESOURCE]=e,r.idType!==yf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var v2o="2017-09-01",C2o=`Only client id is supported for user-assigned managed identity in ${no.MACHINE_LEARNING}.`,ATe=class t extends O_{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] ${no.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,no.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${no.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new IC(Zf.GET,this.msiEndpoint);if(n.headers[TC.METADATA_HEADER_NAME]="true",n.headers[TC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[Hh.API_VERSION]=v2o,n.queryParameters[Hh.RESOURCE]=e,r.idType===yf.SYSTEM_ASSIGNED)n.queryParameters[xY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===yf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(C2o);return n}};var yTe=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(gTe.getEnvironmentVariables())?no.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(pTe.getEnvironmentVariables())?no.APP_SERVICE:this.allEnvironmentVariablesAreDefined(ATe.getEnvironmentVariables())?no.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(mTe.getEnvironmentVariables())?no.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(hTe.getEnvironmentVariables())?no.AZURE_ARC:no.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=gTe.tryCreate(e,r,n,o,s,c)||pTe.tryCreate(e,r,n,o,s)||ATe.tryCreate(e,r,n,o,s)||mTe.tryCreate(e,r,n,o,s,c)||hTe.tryCreate(e,r,n,o,s,c)||EGe.tryCreate(e,r,n,o,s);if(!l)throw Yp(kHe);return l}};var b2o=[no.SERVICE_FABRIC],Qce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=Enn(e||{}),this.logger=new i0(this.config.system.loggerOptions,Oce,_S);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new X7(this.logger,this.config.managedIdentityId.id,hce,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new $M;let n={protocolMode:eE.AAD,knownAuthorities:[_Bt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new AP(_Bt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new jh,!0),this.fakeClientCredentialClient=new Fce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new yTe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new Z7}async acquireToken(e){if(!e.resource)throw Cl(dce.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&&b2o.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(er.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===er.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 yTe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var _Ge=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=>EY.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 S2o=er.PromptValue,T2o=er.ResponseMode;p();p();p();p();p();function ETe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(ETe,"getRandomIntegerInclusive");function _Te(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+ETe(0,n/2)}}a(_Te,"calculateRetryDelay");p();function qce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(qce,"isObject");p();function wY(t){if(qce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(wY,"isError");p();p();var gan=require("node:crypto");var m3t,I2o=typeof((m3t=globalThis?.crypto)===null||m3t===void 0?void 0:m3t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):gan.randomUUID;function jce(){return I2o()}a(jce,"randomUUID");p();var g3t,A3t,y3t,E3t,Aan=typeof window<"u"&&typeof window.document<"u",yan=typeof self=="object"&&typeof self?.importScripts=="function"&&(((g3t=self.constructor)===null||g3t===void 0?void 0:g3t.name)==="DedicatedWorkerGlobalScope"||((A3t=self.constructor)===null||A3t===void 0?void 0:A3t.name)==="ServiceWorkerGlobalScope"||((y3t=self.constructor)===null||y3t===void 0?void 0:y3t.name)==="SharedWorkerGlobalScope"),Ean=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",_an=typeof Bun<"u"&&typeof Bun.version<"u",nQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((E3t=globalThis.process.versions)===null||E3t===void 0)&&E3t.node);var van=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function xC(t,e){return Buffer.from(t,e)}a(xC,"stringToUint8Array");p();var _3t="REDACTED",x2o=["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"],w2o=["api-version"],_P=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=x2o.concat(e),r=w2o.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)||qce(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,_3t);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]=_3t;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]=_3t;return r}};p();p();p();p();var RY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function C3t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new RY(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(C3t,"createAbortablePromise");p();var N2o="The delay was aborted.";function b3t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return C3t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??N2o})}a(b3t,"delay");p();function Hce(t){if(wY(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(Hce,"getErrorMessage");p();function Can(t,e){return _Te(t,e)}a(Can,"calculateRetryDelay");function vGe(t){return wY(t)}a(vGe,"isError");var CGe=nQ,Gce=nQ;p();var vTe=lo("IdentityUtils"),ban="1.0";function kY(t,e,r){let n=a(o=>(vTe.getToken.info(o),new Tx({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(kY,"ensureValidMsalToken");function S3t(t){let e=t?.authorityHost;return!e&&Gce&&(e=process.env.AZURE_AUTHORITY_HOST),e??dSe}a(S3t,"getAuthorityHost");function T3t(t,e){return e||(e=dSe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(T3t,"getAuthority");function San(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(San,"getKnownAuthorities");var bGe=a((t,e=CGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case vS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case vS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case vS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case vS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function SGe(t){switch(t){case"error":return vS.LogLevel.Error;case"info":return vS.LogLevel.Info;case"verbose":return vS.LogLevel.Verbose;case"warning":return vS.LogLevel.Warning;default:return vS.LogLevel.Info}}a(SGe,"getMSALLogLevel");function PY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return vTe.info(Us(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new RY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":vTe.info(Us(t,`Authentication returned errorCode ${n.errorCode}`));break;default:vTe.info(Us(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"?(vTe.info(Us(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new Tx({scopes:t,getTokenOptions:r,message:e.message})}a(PY,"handleMsalError");function Tan(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(Tan,"publicToMsal");function Ian(t,e){return{authority:e.environment??Qtn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Utn,username:e.username,clientId:t,version:ban}}a(Ian,"msalToPublic");function I3t(t){let e=JSON.parse(t);if(e.version&&e.version!==ban)throw Error("Unsupported AuthenticationRecord version");return e}a(I3t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function O2o(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(O2o,"isPrimitiveBody");function L2o(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(L2o,"handleNullableResponseAndWrappableBody");function x3t(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 L2o({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:O2o(t.parsedBody,l)})}a(x3t,"flattenResponse");var YM={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 KM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var xan=require("node:os"),wan=de(require("node:util"),1),Ran=de(require("node:process"),1);function kan(t,...e){Ran.stderr.write(`${wan.default.format(t,...e)}${xan.EOL}`)}a(kan,"log");var Pan=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Dan,w3t=[],R3t=[],IGe=[];Pan&&k3t(Pan);var Nan=Object.assign(t=>Man(t),{enable:k3t,enabled:P3t,disable:B2o,log:kan});function k3t(t){Dan=t,w3t=[],R3t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?R3t.push(new RegExp(`^${n.substr(1)}$`)):w3t.push(new RegExp(`^${n}$`));for(let n of IGe)n.enabled=P3t(n.namespace)}a(k3t,"enable");function P3t(t){if(t.endsWith("*"))return!0;for(let e of R3t)if(e.test(t))return!1;for(let e of w3t)if(e.test(t))return!0;return!1}a(P3t,"enabled");function B2o(){let t=Dan||"";return k3t(""),t}a(B2o,"disable");function Man(t){let e=Object.assign(r,{enabled:P3t(t),destroy:F2o,log:Nan.log,namespace:t,extend:U2o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),IGe.push(e),e}a(Man,"createDebugger");function F2o(){let t=IGe.indexOf(this);return t>=0?(IGe.splice(t,1),!0):!1}a(F2o,"destroy");function U2o(t){let e=Man(`${this.namespace}:${t}`);return e.log=this.log,e}a(U2o,"extend");var $ce=Nan;var D3t=["verbose","info","warning","error"],Oan={verbose:400,info:300,warning:200,error:100};function Lan(t,e){e.log=(...r)=>{t.log(...r)}}a(Lan,"patchLogMethod");function Ban(t){return D3t.includes(t)}a(Ban,"isTypeSpecRuntimeLogLevel");function Q2o(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=$ce(t.namespace);o.log=(...f)=>{$ce.log(...f)};function s(f){if(f&&!Ban(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${D3t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);$ce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Ban(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${D3t.join(", ")}.`));function c(f){return!!(n&&Oan[f.level]<=Oan[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Lan(f,m),c(m)){let g=$ce.disable();$ce.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 Lan(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(Q2o,"createLoggerContext");var Fan=Q2o({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),q2o=Fan.logger;function bTe(t){return Fan.createClientLogger(t)}a(bTe,"createClientLogger");p();function xGe(t){return t.toLowerCase()}a(xGe,"normalizeName");function*j2o(t){for(let e of t.values())yield[e.name,e.value]}a(j2o,"headerIterator");var N3t=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(xGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(xGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(xGe(e))}delete(e){this._headersMap.delete(xGe(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 j2o(this._headersMap)}};function CS(t){return new N3t(t)}a(CS,"createHttpHeaders");p();p();p();var M3t=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||jce(),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 wGe(t){return new M3t(t)}a(wGe,"createPipelineRequest");p();var Uan=new Set(["Deserialize","Serialize","Retry","Sign"]),O3t=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&&!Uan.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Uan.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 RGe(){return O3t.create()}a(RGe,"createEmptyPipeline");p();p();var Qan=require("node:util"),qan=Qan.inspect.custom;var H2o=new _P,IA=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,qan,{value:a(()=>`RestError: ${this.message} + ${H2o.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};IA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";IA.PARSE_ERROR="PARSE_ERROR";function kGe(t){return t instanceof IA?!0:wY(t)&&t.name==="RestError"}a(kGe,"isRestError");p();p();var Vce=de(require("node:http"),1),Wce=de(require("node:https"),1),DGe=de(require("node:zlib"),1),Han=require("node:stream");p();var Dx=bTe("ts-http-runtime");var G2o={};function STe(t){return t&&typeof t.pipe=="function"}a(STe,"isReadableStream");function jan(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(jan,"isStreamComplete");function Gan(t){return t&&typeof t.byteLength=="number"}a(Gan,"isArrayBuffer");var PGe=class extends Han.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}},L3t=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 KM("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 _P;Dx.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=z2o(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new PGe(_);v.on("error",b=>{Dx.error("Error in upload progress",b)}),STe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=$2o(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?V2o(m,g):m;let E=e.onDownloadProgress;if(E){let _=new PGe(E);_.on("error",v=>{Dx.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 W2o(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();STe(f)&&(m=jan(f));let g=Promise.resolve();STe(h)&&(g=jan(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{Dx.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?Vce.request(u,d):Wce.request(u,d);h.once("error",m=>{var g;f(new IA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:IA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new KM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&STe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Gan(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(Dx.error("Unrecognized body type",n),f(new IA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Vce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Vce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Wce.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:G2o,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(Dx.info("No cached TLS Agent exist, creating a new Agent"),c=new Wce.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function $2o(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($2o,"getResponseHeaders");function V2o(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=DGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=DGe.createInflate();return t.pipe(n),n}return t}a(V2o,"getDecodedResponseStream");function W2o(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 IA(`Error reading response as text: ${o.message}`,{code:IA.PARSE_ERROR}))})})}a(W2o,"streamToText");function z2o(t){return t?Buffer.isBuffer(t)?t.length:STe(t)?null:Gan(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(z2o,"getBodyLength");function $an(){return new L3t}a($an,"createNodeHttpClient");function NGe(){return $an()}a(NGe,"createDefaultHttpClient");p();p();p();p();var B3t="logPolicy";function MGe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:Dx.info,n=new _P({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:B3t,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(MGe,"logPolicy");p();var F3t="redirectPolicy",Van=["GET","HEAD"];function OGe(t={}){let{maxRetries:e=20}=t;return{name:F3t,async sendRequest(r,n){let o=await n(r);return Wan(n,o,e)}}}a(OGe,"redirectPolicy");async function Wan(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&Van.includes(o.method)||s===302&&Van.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new KM(r?.abortErrorMsg?r?.abortErrorMsg:Y2o)),"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(Kan,"delay");function Jan(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Jan,"parseHeaderValueAsNumber");var Q3t="Retry-After",K2o=["retry-after-ms","x-ms-retry-after-ms",Q3t];function Zan(t){if(t&&[429,503].includes(t.status))try{for(let o of K2o){let s=Jan(t,o);if(s===0||s)return s*(o===Q3t?1e3:1)}let e=t.headers.get(Q3t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Zan,"getRetryAfterInMs");function Xan(t){return Number.isFinite(Zan(t))}a(Xan,"isThrottlingRetryResponse");function q3t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Zan(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(q3t,"throttlingRetryStrategy");var J2o=1e3,Z2o=1e3*64;function BGe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:J2o,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:Z2o;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=eDo(l),d=u&&t.ignoreSystemErrors,f=X2o(c),h=f&&t.ignoreHttpStatusCodes;return c&&(Xan(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:_Te(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(BGe,"exponentialRetryStrategy");function X2o(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(X2o,"isExponentialRetryResponse");function eDo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(eDo,"isSystemError");p();var tDo=bTe("ts-http-runtime retryPolicy"),rDo="retryPolicy";function iQ(t,e={maxRetries:3}){let r=e.logger||tDo;return{name:rDo,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 KM;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 Kan(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(iQ,"retryPolicy");var j3t="defaultRetryPolicy";function FGe(t={}){var e;return{name:j3t,sendRequest:iQ([q3t(),BGe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(FGe,"defaultRetryPolicy");p();var H3t="formDataPolicy";function nDo(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(nDo,"formDataToFormDataMap");function UGe(){return{name:H3t,async sendRequest(t,e){if(nQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=nDo(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=iDo(t.formData):await oDo(t.formData,t),t.formData=void 0}return e(t)}}}a(UGe,"formDataPolicy");function iDo(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(iDo,"wwwFormUrlEncode");async function oDo(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:xC(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(oDo,"prepareFormData");p();var Scn=de(J3t(),1),Tcn=de(Z3t(),1);var XDo="HTTPS_PROXY",eNo="HTTP_PROXY",tNo="ALL_PROXY",rNo="NO_PROXY",X3t="proxyPolicy",vcn=[],Icn=!1,nNo=new Map;function WGe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(WGe,"getEnvironmentValue");function iNo(){if(!process)return;let t=WGe(XDo),e=WGe(tNo),r=WGe(eNo);return t||e||r}a(iNo,"loadEnvironmentProxyValue");function oNo(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(oNo,"isBypassed");function sNo(){let t=WGe(rNo);return Icn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(sNo,"loadNoProxy");function aNo(){let t=iNo();return t?new URL(t):void 0}a(aNo,"getDefaultProxySettingsInternal");function Ccn(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(Ccn,"getUrlFromProxySettings");function bcn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&Dx.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 Tcn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Scn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(bcn,"setProxyAgentOnRequest");function zGe(t,e){Icn||vcn.push(...sNo());let r=t?Ccn(t):aNo(),n={};return{name:X3t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!oNo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:vcn,e?.customNoProxyList?void 0:nNo)?bcn(o,n,r):o.proxySettings&&bcn(o,n,Ccn(o.proxySettings)),s(o)}}}a(zGe,"proxyPolicy");p();var eFt="agentPolicy";function YGe(t){return{name:eFt,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(YGe,"agentPolicy");p();var tFt="tlsPolicy";function KGe(t){return{name:tFt,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(KGe,"tlsPolicy");p();p();function JGe(t){return typeof t.stream=="function"}a(JGe,"isBlob");p();g3();var r$e=require("stream");function Zcn(){return ITe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield TS(e.read());if(r)return yield TS(void 0);yield yield TS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Zcn,"streamAsyncIterator");function dNo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Zcn.bind(t)),t.values||(t.values=Zcn.bind(t))}a(dNo,"makeAsyncIterable");function Xcn(t){return t instanceof ReadableStream?(dNo(t),r$e.Readable.fromWeb(t)):t}a(Xcn,"ensureNodeStream");function fNo(t){return t instanceof Uint8Array?r$e.Readable.from(Buffer.from(t)):JGe(t)?Xcn(t.stream()):Xcn(t)}a(fNo,"toStream");async function eln(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(fNo);return r$e.Readable.from((function(){return ITe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,t$e(d)),u;u=yield TS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield TS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield TS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(eln,"concat");function pNo(){return`----AzSDKFormBoundary${jce()}`}a(pNo,"generateBoundary");function hNo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(hNo,"encodeHeaders");function mNo(t){return t instanceof Uint8Array?t.byteLength:JGe(t)?t.size===-1?void 0:t.size:void 0}a(mNo,"getLength");function gNo(t){let e=0;for(let r of t){let n=mNo(r);if(n===void 0)return;e+=n}return e}a(gNo,"getTotalLength");async function ANo(t,e,r){let n=[xC(`--${r}`,"utf-8"),...e.flatMap(s=>[xC(`\r +`,"utf-8"),xC(hNo(s.headers),"utf-8"),xC(`\r +`,"utf-8"),s.body,xC(`\r +--${r}`,"utf-8")]),xC(`--\r \r -`,"utf-8")],o=iNo(n);o&&t.headers.set("Content-Length",o),t.body=await Ycn(n)}a(oNo,"buildRequestBody");var STe="multipartPolicy",sNo=70,aNo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function cNo(t){if(t.length>sNo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!aNo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(cNo,"assertValidBoundary");function ZGe(){return{name:STe,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?cNo(n):n=tNo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await oNo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(ZGe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function XGe(){return SGe()}a(XGe,"createEmptyPipeline");p();p();p();var YM=Q7("core-rest-pipeline");p();p();p();p();function rFt(t={}){return RGe(Object.assign({logger:YM.info},t))}a(rFt,"logPolicy");p();function nFt(t={}){return kGe(t)}a(nFt,"redirectPolicy");p();p();p();var Yce=de(require("node:os"),1),e$e=de(require("node:process"),1);function Kcn(){return"User-Agent"}a(Kcn,"getHeaderName");async function Jcn(t){if(e$e&&e$e.versions){let e=e$e.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",`(${Yce.arch()}-${Yce.type()}-${Yce.release()})`)}a(Jcn,"setPlatformSpecificData");p();var t$e="1.22.0";function ANo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(ANo,"getUserAgentString");function Zcn(){return Kcn()}a(Zcn,"getUserAgentHeaderName");async function r$e(t){let e=new Map;e.set("core-rest-pipeline",t$e),await Jcn(e);let r=ANo(e);return t?`${t} ${r}`:r}a(r$e,"getUserAgentValue");var Xcn=Zcn(),eln="userAgentPolicy";function iFt(t={}){let e=r$e(t.userAgentPrefix);return{name:eln,async sendRequest(r,n){return r.headers.has(Xcn)||r.headers.set(Xcn,await e),n(r)}}}a(iFt,"userAgentPolicy");p();p();var tln=Symbol("rawContent");function oFt(t){return typeof t[tln]=="function"}a(oFt,"hasRawContent");function rln(t){return oFt(t)?t[tln]():t}a(rln,"getRawContent");var n$e=STe;function sFt(){let t=ZGe();return{name:n$e,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)oFt(n.body)&&(n.body=rln(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(sFt,"multipartPolicy");p();function aFt(){return PGe()}a(aFt,"decompressResponsePolicy");p();function cFt(t={}){return NGe(t)}a(cFt,"defaultRetryPolicy");p();function lFt(){return MGe()}a(lFt,"formDataPolicy");p();function uFt(t,e){return HGe(t,e)}a(uFt,"proxyPolicy");p();var nln="setClientRequestIdPolicy";function dFt(t="x-ms-client-request-id"){return{name:nln,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(dFt,"setClientRequestIdPolicy");p();function fFt(t){return GGe(t)}a(fFt,"agentPolicy");p();function pFt(t){return $Ge(t)}a(pFt,"tlsPolicy");p();p();var Kce=TA;function TTe(t){return TGe(t)}a(TTe,"isRestError");var iln="tracingPolicy";function hFt(t={}){let e=r$e(t.userAgentPrefix),r=new yP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=yNo();return{name:iln,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=ENo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return vNo(d,h),h}catch(h){throw _No(d,h),h}}}}a(hFt,"tracingPolicy");function yNo(){try{return dSe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:t$e})}catch(t){YM.warning(`Error when creating the TracingClient: ${jce(t)}`);return}}a(yNo,"tryCreateTracingClient");function ENo(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){YM.warning(`Skipping creating a tracing span due to an error: ${jce(n)}`);return}}a(ENo,"tryCreateSpan");function _No(t,e){try{t.setStatus({status:"error",error:gGe(e)?e:void 0}),TTe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){YM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(_No,"tryProcessError");function vNo(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){YM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(vNo,"tryProcessResponse");p();p();function i$e(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(i$e,"wrapAbortSignalLike");var CNo="wrapAbortSignalLikePolicy";function oln(){return{name:CNo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=i$e(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(oln,"wrapAbortSignalLikePolicy");function mFt(t){var e;let r=XGe();return Hce&&(t.agent&&r.addPolicy(fFt(t.agent)),t.tlsOptions&&r.addPolicy(pFt(t.tlsOptions)),r.addPolicy(uFt(t.proxyOptions)),r.addPolicy(aFt())),r.addPolicy(oln()),r.addPolicy(lFt(),{beforePolicies:[n$e]}),r.addPolicy(iFt(t.userAgentOptions)),r.addPolicy(dFt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(sFt(),{afterPhase:"Deserialize"}),r.addPolicy(cFt(t.retryOptions),{phase:"Retry"}),r.addPolicy(hFt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Hce&&r.addPolicy(nFt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(rFt(t.loggingOptions),{afterPhase:"Sign"}),r}a(mFt,"createPipelineFromOptions");p();function gFt(){let t=wGe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?i$e(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(gFt,"createDefaultHttpClient");p();function oQ(t){return vS(t)}a(oQ,"createHttpHeaders");p();function _P(t){return bGe(t)}a(_P,"createPipelineRequest");p();p();p();p();var SNo=Q7("core-rest-pipeline retryPolicy");function AFt(t,e={maxRetries:3}){return rQ(t,Object.assign({logger:SNo},e))}a(AFt,"retryPolicy");p();p();var TNo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function INo(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(yFt,"createTokenCycler");var lln="bearerTokenAuthenticationPolicy";async function o$e(t,e){try{return[await e(t),void 0]}catch(r){if(TTe(r)&&r.response)return[r.response,r];throw r}}a(o$e,"trySendRequest");async function xNo(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(xNo,"defaultAuthorizeRequest");function sln(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(sln,"isChallengeResponse");async function aln(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(aln,"authorizeRequestOnCaeChallenge");function s$e(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||YM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:xNo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?yFt(o):()=>Promise.resolve(null);return{name:lln,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 o$e(f,h),sln(m)){let y=cln(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 aln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await o$e(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 o$e(f,h)),sln(m)&&(y=cln(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 aln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await o$e(f,h))}}if(g)throw g;return m}}}a(s$e,"bearerTokenAuthenticationPolicy");function wNo(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(wNo,"parseChallenges");function cln(t){var e;return t?(e=wNo(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(cln,"getCaeChallengeClaims");p();p();p();p();p();p();var dln=de(uln(),1),EFt=dln.state;function sQ(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=fln(t,n);!c.propertyFound&&r&&(c=fln(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=sQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(sQ,"getOperationArgumentValueFromParameter");function fln(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(MNo,"deserializeResponseBody");function ONo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(ONo,"isOperationSpecEmpty");function LNo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(ONo(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 Kce(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===VM.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(LNo,"handleErrorResponse");async function BNo(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||Kce.PARSE_ERROR;throw new Kce(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(BNo,"parse");p();p();function mln(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===VM.Stream&&e.add(Number(r))}return e}a(mln,"getStreamingResponseStatusCodes");function KM(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(KM,"getPathStringFromParameter");var gln="serializationPolicy";function vFt(t={}){let e=t.stringifyXML;return{name:gln,async sendRequest(r,n){let o=g3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(FNo(r,c,s),UNo(r,c,s,e)),n(r)}}}a(vFt,"serializationPolicy");function FNo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=sQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,KM(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||KM(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(FNo,"serializeHeaders");function UNo(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=sQ(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=KM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===VM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=QNo(_,x,T,t.body,f);T===VM.Sequence?t.body=n(qNo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===VM.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=sQ(e,m);if(g!=null){let A=m.mapper.serializedName||KM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,KM(m),f)}}}}a(UNo,"serializeRequestBody");function QNo(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(QNo,"getXmlValueWithNamespace");function qNo(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(qNo,"prepareXMLRootList");function CFt(t={}){let e=mFt(t??{});return t.credentialOptions&&e.addPolicy(s$e({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(vFt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(_Ft(t.deserializationOptions),{phase:"Deserialize"}),e}a(CFt,"createClientPipeline");p();var bFt;function Aln(){return bFt||(bFt=gFt()),bFt}a(Aln,"getCachedDefaultHttpClient");p();var jNo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Eln(t,e,r,n){let o=HNo(e,r,n),s=!1,c=yln(t,o);if(e.path){let d=yln(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),GNo(d)?(c=d,s=!0):c=$No(c,d)}let{queryParams:l,sequenceParams:u}=VNo(e,r,n);return c=zNo(c,l,u,s),c}a(Eln,"getRequestUrl");function yln(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(yln,"replaceAll");function HNo(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=sQ(e,s,r),l=KM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(HNo,"calculateUrlReplacements");function GNo(t){return t.includes("://")}a(GNo,"isAbsoluteUrl");function $No(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($No,"appendPath");function VNo(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=sQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,KM(c));let u=c.collectionFormat?jNo[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||KM(c),l)}}return{queryParams:o,sequenceParams:s}}a(VNo,"calculateQueryParameters");function WNo(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(WNo,"simpleParseQueryParams");function zNo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=WNo(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(zNo,"appendQueryParams");p();var SFt=Q7("core-client");var ITe=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&&SFt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Aln(),this.pipeline=e.pipeline||YNo(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=Eln(n,r,e,this),s=_P({url:o});s.method=r.httpMethod;let c=g3(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=mln(r));try{let d=await this.sendRequest(s),f=b3t(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=b3t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function YNo(t){let e=KNo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return CFt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(YNo,"createDefaultPipeline");function KNo(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(KNo,"getCredentialScopes");p();p();p();function _ln(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(_ln,"getIdentityTokenEndpointSuffix");p();var vln="/.default",Cln="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 xTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(vln)?e.substr(0,e.lastIndexOf(vln)):e}a(xTe,"mapScopesToResource");function bln(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(bln,"parseExpirationTimestamp");function Sln(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(Sln,"parseRefreshTimestamp");var wTe="noCorrelationId";function JNo(t){let e=t?.authorityHost;return AGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??cSe}a(JNo,"getIdentityClientAuthorityHost");var aQ=class extends ITe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${vje}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=JNo(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){hS.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:bln(n),refreshAfterTimestamp:Sln(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return hS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new U7(r.status,r.bodyAsText);throw hS.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;hS.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 Mc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=_ln(e),h=_P({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:oQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return hS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===bje&&f.errorResponse.error==="interaction_required")return hS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw hS.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||wTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(wTe)||[]];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]||wTe}async sendGetRequestAsync(e,r){let n=_P({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:oQ(r?.headers),abortSignal:this.generateAbortSignal(wTe)}),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:oQ(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"));hS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){hS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var TFt;(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"})(TFt||(TFt={}));function c$e(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===TFt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(c$e,"calculateRegionalAuthority");p();p();function ZNo(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(ZNo,"createConfigurationErrorMessage");function yf(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=ZNo(o);throw n?.info(s),new Mn(s)}return o}a(yf,"processMultiTenantRequest");function sg(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(Us("",r)),r}}a(sg,"checkTenantId");function Jce(t,e,r){return e?(sg(t,e),e):(r||(r=Xz),r!==Xz?"common":"organizations")}a(Jce,"resolveTenantId");function Jf(t){return!t||t.length===0?[]:t.includes("*")?Ltn:t}a(Jf,"resolveAdditionallyAllowedTenantIds");var O_=lo("MsalClient");function hMo(t,e,r={}){let n=Jce(r.logger??O_,e,t),o=v3t(n,_3t(r)),s=new aQ({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Ean(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:yGe(r.logger??O_),logLevel:EGe(wje()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(hMo,"generateMsalConfiguration");function tE(t,e,r={}){let n={msalConfig:hMo(t,e,r),cachedAccount:r.authenticationRecord?_an(r.authenticationRecord):null,pluginConfiguration:Htn.generatePluginConfiguration(r),logger:r.logger??O_},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 Lce({...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 Fce({...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 bx({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(L){throw xY(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?v3t(x.tenantId,_3t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let L=null;try{L=await u(x,P,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new bx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw xY(P,B,D)}return IY(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(e0(P)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.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 L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,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 L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims,clientAssertion:P});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,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 L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,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 L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,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,P,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:P,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return van(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,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:P,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){O_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(O_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(O_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(O_.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:P});return IY(x,B,N),O_.getToken.info(e0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw xY(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(p$e(),Xln))).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={}){O_.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):O_.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"),P?(L.prompt="none",O_.verbose("Attempting broker authentication using the default broker account")):O_.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(O_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new bx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){O_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return IY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(e0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){O_.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(tE,"createMsalClient");var NTe=require("node:crypto");var tun=require("node:fs/promises");var DTe="ClientCertificateCredential",eun=lo(DTe),MTe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${DTe}: 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(`${DTe}: 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(`${DTe}: 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=tE(r,e,{...o,logger:eun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${DTe}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,eun);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await mMo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,NTe.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 mMo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,tun.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,NTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,NTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(mMo,"parseCertificate");p();p();function Mx(t){return Array.isArray(t)?t:[t]}a(Mx,"ensureScopes");function ele(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(Us(t,r)),r}}a(ele,"ensureValidScopeForDevTimeCreds");function h$e(t){return t.replace(/\/.default$/,"")}a(h$e,"getScopeResource");var nun=lo("ClientSecretCredential"),OTe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Mn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Mn("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=tE(r,e,{...o,logger:nun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,nun);let o=Mx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var gMo=lo("UsernamePasswordCredential"),LTe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Mn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Mn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Mn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Mn("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=tE(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,gMo);let o=Mx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var AMo=["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 yMo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(yMo,"getAdditionallyAllowedTenants");var m$e="EnvironmentCredential",A3=lo(m$e);function EMo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return A3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(EMo,"getSendCertificateChain");var BTe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=Rje(AMo).assigned.join(", ");A3.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=yMo(),l=EMo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&sg(A3,n),n&&o&&s){A3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new OTe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){A3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new MTe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(A3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),A3.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 LTe(n,o,h,m,u))}async getToken(e,r={}){return Mc.withSpan(`${m$e}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return A3.getToken.info(e0(e)),o}catch(o){let s=new U7(400,{error:`${m$e} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw A3.getToken.info(Us(e,s)),s}throw new Mn(`${m$e} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var _Mo=1e3*64,vMo=3e3;function iun(t){return AFt([{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(vMo,t.startDelayInMs):t.startDelayInMs;return Aan(e,{retryDelayInMs:n,maxRetryDelayInMs:_Mo})},"retry")}],{maxRetries:t.maxRetries})}a(iun,"imdsRetryPolicy");p();var y3="ManagedIdentityCredential - IMDS",RY=lo(y3),CMo="http://169.254.169.254",bMo="/metadata/identity/oauth2/token";function SMo(t){if(!xTe(t))throw new Error(`${y3}: Multiple scopes are not supported.`);let r=new URL(bMo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??CMo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:oQ(n)}}a(SMo,"prepareInvalidRequestOptions");var oun={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=xTe(e);if(!o)return RY.info(`${y3}: 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=SMo(o);return Mc.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{RY.info(`${y3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return gGe(d)&&RY.verbose(`${y3}: Caught error ${d.name}: ${d.message}`),RY.info(`${y3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(RY.info(`${y3}: The Azure IMDS endpoint is unavailable`),RY.info(`${y3}: ${u.bodyAsText}`),!1):(RY.info(`${y3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var sun=lo("ClientAssertionCredential"),tle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Mn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Mn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=tE(r,e,{...o,logger:sun,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,sun);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var aun=require("node:fs/promises");var kY="WorkloadIdentityCredential",TMo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],FTe=lo(kY),E3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=Rje(TMo).assigned.join(", ");FTe.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&&sg(FTe,o),!s)throw new Mn(`${kY}: 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 Mn(`${kY}: 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 Mn(`${kY}: 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`);FTe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new tle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${kY}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"utf-8")],o=gNo(n);o&&t.headers.set("Content-Length",o),t.body=await eln(n)}a(ANo,"buildRequestBody");var xTe="multipartPolicy",yNo=70,ENo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function _No(t){if(t.length>yNo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!ENo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(_No,"assertValidBoundary");function n$e(){return{name:xTe,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?_No(n):n=pNo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await ANo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(n$e,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function i$e(){return RGe()}a(i$e,"createEmptyPipeline");p();p();p();var ZM=j7("core-rest-pipeline");p();p();p();p();function sFt(t={}){return MGe(Object.assign({logger:ZM.info},t))}a(sFt,"logPolicy");p();function aFt(t={}){return OGe(t)}a(aFt,"redirectPolicy");p();p();p();var Kce=de(require("node:os"),1),o$e=de(require("node:process"),1);function tln(){return"User-Agent"}a(tln,"getHeaderName");async function rln(t){if(o$e&&o$e.versions){let e=o$e.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",`(${Kce.arch()}-${Kce.type()}-${Kce.release()})`)}a(rln,"setPlatformSpecificData");p();var s$e="1.22.0";function RNo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(RNo,"getUserAgentString");function nln(){return tln()}a(nln,"getUserAgentHeaderName");async function a$e(t){let e=new Map;e.set("core-rest-pipeline",s$e),await rln(e);let r=RNo(e);return t?`${t} ${r}`:r}a(a$e,"getUserAgentValue");var iln=nln(),oln="userAgentPolicy";function cFt(t={}){let e=a$e(t.userAgentPrefix);return{name:oln,async sendRequest(r,n){return r.headers.has(iln)||r.headers.set(iln,await e),n(r)}}}a(cFt,"userAgentPolicy");p();p();var sln=Symbol("rawContent");function lFt(t){return typeof t[sln]=="function"}a(lFt,"hasRawContent");function aln(t){return lFt(t)?t[sln]():t}a(aln,"getRawContent");var c$e=xTe;function uFt(){let t=n$e();return{name:c$e,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)lFt(n.body)&&(n.body=aln(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(uFt,"multipartPolicy");p();function dFt(){return LGe()}a(dFt,"decompressResponsePolicy");p();function fFt(t={}){return FGe(t)}a(fFt,"defaultRetryPolicy");p();function pFt(){return UGe()}a(pFt,"formDataPolicy");p();function hFt(t,e){return zGe(t,e)}a(hFt,"proxyPolicy");p();var cln="setClientRequestIdPolicy";function mFt(t="x-ms-client-request-id"){return{name:cln,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(mFt,"setClientRequestIdPolicy");p();function gFt(t){return YGe(t)}a(gFt,"agentPolicy");p();function AFt(t){return KGe(t)}a(AFt,"tlsPolicy");p();p();var Jce=IA;function wTe(t){return kGe(t)}a(wTe,"isRestError");var lln="tracingPolicy";function yFt(t={}){let e=a$e(t.userAgentPrefix),r=new _P({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=kNo();return{name:lln,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=PNo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return NNo(d,h),h}catch(h){throw DNo(d,h),h}}}}a(yFt,"tracingPolicy");function kNo(){try{return hSe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:s$e})}catch(t){ZM.warning(`Error when creating the TracingClient: ${Hce(t)}`);return}}a(kNo,"tryCreateTracingClient");function PNo(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){ZM.warning(`Skipping creating a tracing span due to an error: ${Hce(n)}`);return}}a(PNo,"tryCreateSpan");function DNo(t,e){try{t.setStatus({status:"error",error:vGe(e)?e:void 0}),wTe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){ZM.warning(`Skipping tracing span processing due to an error: ${Hce(r)}`)}}a(DNo,"tryProcessError");function NNo(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){ZM.warning(`Skipping tracing span processing due to an error: ${Hce(r)}`)}}a(NNo,"tryProcessResponse");p();p();function l$e(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(l$e,"wrapAbortSignalLike");var MNo="wrapAbortSignalLikePolicy";function uln(){return{name:MNo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=l$e(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(uln,"wrapAbortSignalLikePolicy");function EFt(t){var e;let r=i$e();return Gce&&(t.agent&&r.addPolicy(gFt(t.agent)),t.tlsOptions&&r.addPolicy(AFt(t.tlsOptions)),r.addPolicy(hFt(t.proxyOptions)),r.addPolicy(dFt())),r.addPolicy(uln()),r.addPolicy(pFt(),{beforePolicies:[c$e]}),r.addPolicy(cFt(t.userAgentOptions)),r.addPolicy(mFt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(uFt(),{afterPhase:"Deserialize"}),r.addPolicy(fFt(t.retryOptions),{phase:"Retry"}),r.addPolicy(yFt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Gce&&r.addPolicy(aFt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(sFt(t.loggingOptions),{afterPhase:"Sign"}),r}a(EFt,"createPipelineFromOptions");p();function _Ft(){let t=NGe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?l$e(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(_Ft,"createDefaultHttpClient");p();function aQ(t){return CS(t)}a(aQ,"createHttpHeaders");p();function CP(t){return wGe(t)}a(CP,"createPipelineRequest");p();p();p();p();var LNo=j7("core-rest-pipeline retryPolicy");function vFt(t,e={maxRetries:3}){return iQ(t,Object.assign({logger:LNo},e))}a(vFt,"retryPolicy");p();p();var BNo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function FNo(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(CFt,"createTokenCycler");var hln="bearerTokenAuthenticationPolicy";async function u$e(t,e){try{return[await e(t),void 0]}catch(r){if(wTe(r)&&r.response)return[r.response,r];throw r}}a(u$e,"trySendRequest");async function UNo(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(UNo,"defaultAuthorizeRequest");function dln(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(dln,"isChallengeResponse");async function fln(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(fln,"authorizeRequestOnCaeChallenge");function d$e(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||ZM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:UNo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?CFt(o):()=>Promise.resolve(null);return{name:hln,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 u$e(f,h),dln(m)){let y=pln(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 fln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await u$e(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 u$e(f,h)),dln(m)&&(y=pln(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 fln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await u$e(f,h))}}if(g)throw g;return m}}}a(d$e,"bearerTokenAuthenticationPolicy");function QNo(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(QNo,"parseChallenges");function pln(t){var e;return t?(e=QNo(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(pln,"getCaeChallengeClaims");p();p();p();p();p();p();var gln=de(mln(),1),bFt=gln.state;function cQ(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=Aln(t,n);!c.propertyFound&&r&&(c=Aln(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=cQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(cQ,"getOperationArgumentValueFromParameter");function Aln(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(VNo,"deserializeResponseBody");function WNo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(WNo,"isOperationSpecEmpty");function zNo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(WNo(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 Jce(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===YM.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(zNo,"handleErrorResponse");async function YNo(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||Jce.PARSE_ERROR;throw new Jce(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(YNo,"parse");p();p();function _ln(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===YM.Stream&&e.add(Number(r))}return e}a(_ln,"getStreamingResponseStatusCodes");function XM(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(XM,"getPathStringFromParameter");var vln="serializationPolicy";function TFt(t={}){let e=t.stringifyXML;return{name:vln,async sendRequest(r,n){let o=A3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(KNo(r,c,s),JNo(r,c,s,e)),n(r)}}}a(TFt,"serializationPolicy");function KNo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=cQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,XM(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||XM(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(KNo,"serializeHeaders");function JNo(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=cQ(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=XM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===YM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=ZNo(_,x,T,t.body,f);T===YM.Sequence?t.body=n(XNo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===YM.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=cQ(e,m);if(g!=null){let A=m.mapper.serializedName||XM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,XM(m),f)}}}}a(JNo,"serializeRequestBody");function ZNo(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(ZNo,"getXmlValueWithNamespace");function XNo(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(XNo,"prepareXMLRootList");function IFt(t={}){let e=EFt(t??{});return t.credentialOptions&&e.addPolicy(d$e({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(TFt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(SFt(t.deserializationOptions),{phase:"Deserialize"}),e}a(IFt,"createClientPipeline");p();var xFt;function Cln(){return xFt||(xFt=_Ft()),xFt}a(Cln,"getCachedDefaultHttpClient");p();var eMo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Sln(t,e,r,n){let o=tMo(e,r,n),s=!1,c=bln(t,o);if(e.path){let d=bln(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),rMo(d)?(c=d,s=!0):c=nMo(c,d)}let{queryParams:l,sequenceParams:u}=iMo(e,r,n);return c=sMo(c,l,u,s),c}a(Sln,"getRequestUrl");function bln(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(bln,"replaceAll");function tMo(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=cQ(e,s,r),l=XM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(tMo,"calculateUrlReplacements");function rMo(t){return t.includes("://")}a(rMo,"isAbsoluteUrl");function nMo(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(nMo,"appendPath");function iMo(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=cQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,XM(c));let u=c.collectionFormat?eMo[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||XM(c),l)}}return{queryParams:o,sequenceParams:s}}a(iMo,"calculateQueryParameters");function oMo(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(oMo,"simpleParseQueryParams");function sMo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=oMo(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(sMo,"appendQueryParams");p();var wFt=j7("core-client");var RTe=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&&wFt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Cln(),this.pipeline=e.pipeline||aMo(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=Sln(n,r,e,this),s=CP({url:o});s.method=r.httpMethod;let c=A3(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=_ln(r));try{let d=await this.sendRequest(s),f=x3t(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=x3t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function aMo(t){let e=cMo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return IFt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(aMo,"createDefaultPipeline");function cMo(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(cMo,"getCredentialScopes");p();p();p();function Tln(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(Tln,"getIdentityTokenEndpointSuffix");p();var Iln="/.default",xln="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 kTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(Iln)?e.substr(0,e.lastIndexOf(Iln)):e}a(kTe,"mapScopesToResource");function wln(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(wln,"parseExpirationTimestamp");function Rln(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(Rln,"parseRefreshTimestamp");var PTe="noCorrelationId";function lMo(t){let e=t?.authorityHost;return CGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??dSe}a(lMo,"getIdentityClientAuthorityHost");var lQ=class extends RTe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${Ije}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=lMo(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){mS.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:wln(n),refreshAfterTimestamp:Rln(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return mS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new q7(r.status,r.bodyAsText);throw mS.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;mS.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 Mc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=Tln(e),h=CP({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:aQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return mS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===wje&&f.errorResponse.error==="interaction_required")return mS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw mS.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||PTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(PTe)||[]];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]||PTe}async sendGetRequestAsync(e,r){let n=CP({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:aQ(r?.headers),abortSignal:this.generateAbortSignal(PTe)}),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=CP({url:e,method:"POST",body:r?.body,headers:aQ(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"));mS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){mS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var RFt;(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"})(RFt||(RFt={}));function p$e(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===RFt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(p$e,"calculateRegionalAuthority");p();p();function uMo(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(uMo,"createConfigurationErrorMessage");function _f(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=uMo(o);throw n?.info(s),new Mn(s)}return o}a(_f,"processMultiTenantRequest");function ag(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(Us("",r)),r}}a(ag,"checkTenantId");function Zce(t,e,r){return e?(ag(t,e),e):(r||(r=nY),r!==nY?"common":"organizations")}a(Zce,"resolveTenantId");function Xf(t){return!t||t.length===0?[]:t.includes("*")?qtn:t}a(Xf,"resolveAdditionallyAllowedTenantIds");var L_=lo("MsalClient");function IMo(t,e,r={}){let n=Zce(r.logger??L_,e,t),o=T3t(n,S3t(r)),s=new lQ({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:San(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:bGe(r.logger??L_),logLevel:SGe(Nje()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(IMo,"generateMsalConfiguration");function rE(t,e,r={}){let n={msalConfig:IMo(t,e,r),cachedAccount:r.authenticationRecord?Tan(r.authenticationRecord):null,pluginConfiguration:ztn.generatePluginConfiguration(r),logger:r.logger??L_},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 Bce({...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 Uce({...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 Tx({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(L){throw PY(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?T3t(x.tenantId,S3t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let L=null;try{L=await u(x,P,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new Tx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw PY(P,B,D)}return kY(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(r0(P)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.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 L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:p$e(),claims:D?.claims});return kY(x,L,D),n.logger.getToken.info(r0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw PY(x,L,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 L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:p$e(),claims:D?.claims,clientAssertion:P});return kY(x,L,D),n.logger.getToken.info(r0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw PY(x,L,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 L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:p$e(),claims:D?.claims});return kY(x,L,D),n.logger.getToken.info(r0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw PY(x,L,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 L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,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,P,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:P,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return Ian(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,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:P,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){L_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(L_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(L_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(L_.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:P});return kY(x,B,N),L_.getToken.info(r0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw PY(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(y$e(),oun))).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={}){L_.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):L_.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"),P?(L.prompt="none",L_.verbose("Attempting broker authentication using the default broker account")):L_.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(L_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new Tx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){L_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return kY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(r0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){L_.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(rE,"createMsalClient");var LTe=require("node:crypto");var aun=require("node:fs/promises");var OTe="ClientCertificateCredential",sun=lo(OTe),BTe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${OTe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=Xf(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(`${OTe}: 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(`${OTe}: 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=rE(r,e,{...o,logger:sun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${OTe}.getToken`,r,async n=>{n.tenantId=_f(this.tenantId,n,this.additionallyAllowedTenantIds,sun);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await xMo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,LTe.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 xMo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,aun.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,LTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,LTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(xMo,"parseCertificate");p();p();function Lx(t){return Array.isArray(t)?t:[t]}a(Lx,"ensureScopes");function tle(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(Us(t,r)),r}}a(tle,"ensureValidScopeForDevTimeCreds");function E$e(t){return t.replace(/\/.default$/,"")}a(E$e,"getScopeResource");var cun=lo("ClientSecretCredential"),FTe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Mn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Mn("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=Xf(o?.additionallyAllowedTenants),this.msalClient=rE(r,e,{...o,logger:cun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=_f(this.tenantId,n,this.additionallyAllowedTenantIds,cun);let o=Lx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var wMo=lo("UsernamePasswordCredential"),UTe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Mn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Mn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Mn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Mn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=Xf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=rE(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=_f(this.tenantId,n,this.additionallyAllowedTenantIds,wMo);let o=Lx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var RMo=["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 kMo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(kMo,"getAdditionallyAllowedTenants");var _$e="EnvironmentCredential",y3=lo(_$e);function PMo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return y3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(PMo,"getSendCertificateChain");var QTe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=Mje(RMo).assigned.join(", ");y3.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=kMo(),l=PMo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&ag(y3,n),n&&o&&s){y3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new FTe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){y3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new BTe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(y3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),y3.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 UTe(n,o,h,m,u))}async getToken(e,r={}){return Mc.withSpan(`${_$e}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return y3.getToken.info(r0(e)),o}catch(o){let s=new q7(400,{error:`${_$e} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw y3.getToken.info(Us(e,s)),s}throw new Mn(`${_$e} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var DMo=1e3*64,NMo=3e3;function lun(t){return vFt([{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(NMo,t.startDelayInMs):t.startDelayInMs;return Can(e,{retryDelayInMs:n,maxRetryDelayInMs:DMo})},"retry")}],{maxRetries:t.maxRetries})}a(lun,"imdsRetryPolicy");p();var E3="ManagedIdentityCredential - IMDS",NY=lo(E3),MMo="http://169.254.169.254",OMo="/metadata/identity/oauth2/token";function LMo(t){if(!kTe(t))throw new Error(`${E3}: Multiple scopes are not supported.`);let r=new URL(OMo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??MMo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:aQ(n)}}a(LMo,"prepareInvalidRequestOptions");var uun={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=kTe(e);if(!o)return NY.info(`${E3}: 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=LMo(o);return Mc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=CP(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{NY.info(`${E3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return vGe(d)&&NY.verbose(`${E3}: Caught error ${d.name}: ${d.message}`),NY.info(`${E3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(NY.info(`${E3}: The Azure IMDS endpoint is unavailable`),NY.info(`${E3}: ${u.bodyAsText}`),!1):(NY.info(`${E3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var dun=lo("ClientAssertionCredential"),rle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Mn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Mn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=Xf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=rE(r,e,{...o,logger:dun,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=_f(this.tenantId,n,this.additionallyAllowedTenantIds,dun);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var fun=require("node:fs/promises");var MY="WorkloadIdentityCredential",BMo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],qTe=lo(MY),_3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=Mje(BMo).assigned.join(", ");qTe.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&&ag(qTe,o),!s)throw new Mn(`${MY}: 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 Mn(`${MY}: 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 Mn(`${MY}: 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`);qTe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new rle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${MY}: 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 FTe.info(n),new Mn(n)}return FTe.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 Mn(`${kY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,aun.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${kY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var cun="ManagedIdentityCredential - Token Exchange",IMo=lo(cun),$Ft={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||IMo.info(`${cun}: 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 E3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var TS=lo("ManagedIdentityCredential"),dQ=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 aQ({...n,additionalPolicies:[{policy:iun(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Uce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:EGe(wje()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:yGe(TS)}}}),this.isAvailableIdentityClient=new aQ({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw TS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn("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 TS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn(`ManagedIdentityCredential: ${Cln}`);if(TS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];TS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){TS.getToken.info("Using the MSAL provider for Managed Identity.");let n=xTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Mc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await $Ft.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(TS.getToken.info(`MSAL Identity source: ${s}`),o){TS.getToken.info("Using the token exchange managed identity.");let u=await $Ft.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Mn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(TS.getToken.info("Using the IMDS endpoint to probe for availability."),!await oun.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Mn("Attempted to use the IMDS endpoint, but it is not available.");TS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),TS.getToken.info(e0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw TS.getToken.error(Us(e,o)),o.name==="AuthenticationRequiredError"?o:xMo(o)?new Mn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Mn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(TS.getToken.info(s),new bx({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 xMo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(xMo,"isNetworkError");p();var lun=de(require("child_process"),1);var JM=lo("AzureDeveloperCliCredential"),g$e={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:"},uun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(JM.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(" ");lun.default.exec(d,{cwd:uun.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},UTe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(JM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=yf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&sg(JM,n);let o;return typeof e=="string"?o=[e]:o=e,JM.getToken.info(`Using the scopes ${e}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{ele(d,JM)});let s=await uun.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 Mn(g$e.notInstalled);throw JM.getToken.info(Us(e,d)),d}if(l){let d=new Mn(g$e.login);throw JM.getToken.info(Us(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${g$e.claim} ${f}`);throw JM.getToken.info(Us(e,h)),h}try{let d=JSON.parse(s.stdout);return JM.getToken.info(e0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Mn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Mn(s.message||g$e.unknown);throw JM.getToken.info(Us(e,c)),c}})}};p();var dun=de(require("child_process"),1);p();function VFt(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(Us("",r)),r}}a(VFt,"checkSubscription");var IS=lo("AzureCliCredential"),QTe={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:'},fun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(IS.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(" ");dun.default.exec(d,{cwd:fun.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},qTe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(sg(IS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(VFt(IS,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 Mn(`${QTe.claim} ${l}`);throw IS.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&sg(IS,s),this.subscription&&VFt(IS,this.subscription),IS.getToken.info(`Using the scope ${n}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{ele(n,IS);let c=h$e(n),l=await fun.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 Mn(QTe.notInstalled);throw IS.getToken.info(Us(e,h)),h}if(d){let h=new Mn(QTe.login);throw IS.getToken.info(Us(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return IS.getToken.info(e0(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||QTe.unknown);throw IS.getToken.info(Us(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 IS.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 Mn(`${QTe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var pun=de(require("node:child_process"),1),hun={execFile(t,e,r){return new Promise((n,o)=>{pun.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 ZM=lo("AzurePowerShellCredential"),gun=process.platform==="win32";function Aun(t){return gun?`${t}.exe`:t}a(Aun,"formatCommand");async function mun(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await hun.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(mun,"runCommands");var yun={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"},A$e={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."},wMo=a(t=>t.message.match(`(.*)${yun.login}(.*)`),"isLoginError"),RMo=a(t=>t.message.match(yun.installed),"isNotInstalledError"),WFt=[Aun("pwsh")];gun&&WFt.push(Aun("powershell"));var jTe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(ZM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...WFt]){try{await mun([[o,"/?"]],n)}catch{WFt.shift();continue}let c=(await mun([[o,"-NoProfile","-NonInteractive","-Command",` + "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw qTe.info(n),new Mn(n)}return qTe.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 Mn(`${MY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,fun.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${MY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var pun="ManagedIdentityCredential - Token Exchange",FMo=lo(pun),YFt={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||FMo.info(`${pun}: 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 _3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var IS=lo("ManagedIdentityCredential"),pQ=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 lQ({...n,additionalPolicies:[{policy:lun(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Qce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:SGe(Nje()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:bGe(IS)}}}),this.isAvailableIdentityClient=new lQ({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw IS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn("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 IS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn(`ManagedIdentityCredential: ${xln}`);if(IS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];IS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){IS.getToken.info("Using the MSAL provider for Managed Identity.");let n=kTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Mc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await YFt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(IS.getToken.info(`MSAL Identity source: ${s}`),o){IS.getToken.info("Using the token exchange managed identity.");let u=await YFt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Mn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(IS.getToken.info("Using the IMDS endpoint to probe for availability."),!await uun.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Mn("Attempted to use the IMDS endpoint, but it is not available.");IS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),IS.getToken.info(r0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw IS.getToken.error(Us(e,o)),o.name==="AuthenticationRequiredError"?o:UMo(o)?new Mn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Mn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(IS.getToken.info(s),new Tx({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 UMo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(UMo,"isNetworkError");p();var hun=de(require("child_process"),1);var eO=lo("AzureDeveloperCliCredential"),v$e={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:"},mun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(eO.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(" ");hun.default.exec(d,{cwd:mun.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},jTe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(ag(eO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Xf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=_f(this.tenantId,r,this.additionallyAllowedTenantIds);n&&ag(eO,n);let o;return typeof e=="string"?o=[e]:o=e,eO.getToken.info(`Using the scopes ${e}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{tle(d,eO)});let s=await mun.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 Mn(v$e.notInstalled);throw eO.getToken.info(Us(e,d)),d}if(l){let d=new Mn(v$e.login);throw eO.getToken.info(Us(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${v$e.claim} ${f}`);throw eO.getToken.info(Us(e,h)),h}try{let d=JSON.parse(s.stdout);return eO.getToken.info(r0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Mn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Mn(s.message||v$e.unknown);throw eO.getToken.info(Us(e,c)),c}})}};p();var gun=de(require("child_process"),1);p();function KFt(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(Us("",r)),r}}a(KFt,"checkSubscription");var xS=lo("AzureCliCredential"),HTe={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:'},Aun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(xS.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(" ");gun.default.exec(d,{cwd:Aun.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},GTe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(ag(xS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(KFt(xS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=Xf(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 Mn(`${HTe.claim} ${l}`);throw xS.getToken.info(Us(n,d)),d}let s=_f(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&ag(xS,s),this.subscription&&KFt(xS,this.subscription),xS.getToken.info(`Using the scope ${n}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{tle(n,xS);let c=E$e(n),l=await Aun.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 Mn(HTe.notInstalled);throw xS.getToken.info(Us(e,h)),h}if(d){let h=new Mn(HTe.login);throw xS.getToken.info(Us(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return xS.getToken.info(r0(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||HTe.unknown);throw xS.getToken.info(Us(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 xS.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 Mn(`${HTe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var yun=de(require("node:child_process"),1),Eun={execFile(t,e,r){return new Promise((n,o)=>{yun.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 tO=lo("AzurePowerShellCredential"),vun=process.platform==="win32";function Cun(t){return vun?`${t}.exe`:t}a(Cun,"formatCommand");async function _un(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await Eun.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(_un,"runCommands");var bun={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"},C$e={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."},QMo=a(t=>t.message.match(`(.*)${bun.login}(.*)`),"isLoginError"),qMo=a(t=>t.message.match(bun.installed),"isNotInstalledError"),JFt=[Cun("pwsh")];vun&&JFt.push(Cun("powershell"));var $Te=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(ag(tO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Xf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...JFt]){try{await _un([[o,"/?"]],n)}catch{JFt.shift();continue}let c=(await _un([[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' @@ -1755,26 +1755,26 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return kMo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Mc.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 Mn(`${A$e.claim} ${l}`);throw ZM.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&sg(ZM,s);try{ele(n,ZM),ZM.getToken.info(`Using the scope ${n}`);let c=h$e(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return ZM.getToken.info(e0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(RMo(c)){let u=new Mn(A$e.installed);throw ZM.getToken.info(Us(n,u)),u}else if(wMo(c)){let u=new Mn(A$e.login);throw ZM.getToken.info(Us(n,u)),u}let l=new Mn(`${c}. ${A$e.troubleshoot}`);throw ZM.getToken.info(Us(n,l)),l}})}};async function kMo(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&&ZM.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(kMo,"parseJsonToken");p();var Eun=require("node:fs/promises");var PMo="common",DMo="aebc6443-996d-45c2-90f0-388ff96faa56",zFt=lo("VisualStudioCodeCredential"),NMo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function MMo(t){let e=NMo[t];if(e)throw new Mn(e)}a(MMo,"checkUnsupportedTenant");var HTe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(sg(zFt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=PMo,this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),MMo(this.tenantId)}async prepare(e){let r=yf(this.tenantId,this.options,this.additionallyAllowedTenantIds,zFt)||this.tenantId;if(!jtn()||!Cje)throw new Mn("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(Cje,e);this.msalClient=tE(DMo,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=Mx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Mn("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,Eun.readFile)(e,{encoding:"utf8"});return C3t(n)}catch(n){throw zFt.getToken.info(Us(r,n)),new Mn("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 y$e=lo("BrokerCredential"),E$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Jce(y$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:y$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=tE(Xz,this.brokerTenantId,r)}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,y$e);let o=Mx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw y$e.getToken.info(Us(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function _un(t={}){return new E$e(t)}a(_un,"createDefaultBrokerCredential");function YFt(t={}){return new HTe(t)}a(YFt,"createDefaultVisualStudioCodeCredential");function KFt(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 dQ(c)}if(o&&r){let c={...t,tenantId:s};return new dQ(r,c)}if(e){let c={...t,clientId:e};return new dQ(c)}return new dQ(t)}a(KFt,"createDefaultManagedIdentityCredential");function JFt(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 E3(s)}if(o){let s={...t,tenantId:o};return new E3(s)}return new E3(t)}a(JFt,"createDefaultWorkloadIdentityCredential");function ZFt(t={}){return new UTe(t)}a(ZFt,"createDefaultAzureDeveloperCliCredential");function XFt(t={}){return new qTe(t)}a(XFt,"createDefaultAzureCliCredential");function e8t(t={}){return new jTe(t)}a(e8t,"createDefaultAzurePowershellCredential");function t8t(t={}){return new BTe(t)}a(t8t,"createDefaultEnvironmentCredential");var _$e=lo("DefaultAzureCredential"),r8t=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return _$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},rle=class extends fSe{static{a(this,"DefaultAzureCredential")}constructor(e){OMo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[YFt,XFt,e8t,ZFt,_un],o=[t8t,JFt,KFt],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=[t8t];break;case"workloadidentitycredential":s=[JFt];break;case"managedidentitycredential":s=[()=>KFt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[YFt];break;case"azureclicredential":s=[XFt];break;case"azurepowershellcredential":s=[e8t];break;case"azuredeveloperclicredential":s=[ZFt];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 _$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return _$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new r8t(u.name,d.message)}});super(...l)}};function OMo(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 _$e.warning(n),new Error(n)}}}a(OMo,"validateRequiredEnvVars");p();var ICu=lo("InteractiveBrowserCredential");p();var LCu=lo("DeviceCodeCredential");p();var LMo="AzurePipelinesCredential",VCu=lo(LMo);p();var rbu=lo("AuthorizationCodeCredential");p();var BMo="OnBehalfOfCredential",fbu=lo(BMo);p();var v$e=new fe("capiFetchUtilities");function i0(t){let e={...Gy(t),"X-GitHub-Api-Version":"2026-06-01"},r=S$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(i0,"getCapiHeaders");function vun(t,e){return v$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":VW.api,"Copilot-Integration-Id":"autodev-test"}}a(vun,"addMsBenchCesProxyHeaders");async function Cun(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;v$e.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Ntn(process.env.HMAC_SECRET,r);return{...e,...n}}a(Cun,"addMsBenchHmacHeaders");function FMo(){return CB()&&!!process.env.HMAC_SECRET}a(FMo,"isMsBenchHmacModeEnabled");function n8t(){return CB()&&!process.env.HMAC_SECRET}a(n8t,"isMsBenchCesProxyModeEnabled");async function C$e(t,e){return process.env.HMAC_SECRET?await Cun(t,e):vun(t,e)}a(C$e,"addMsBenchHeaders");async function nle(t,e,r){let n=r;n8t()&&(n=await UMo());let o={...e,Authorization:`Bearer ${n}`};return{headers:FMo()?await Cun(t,o):n8t()?vun(t,o):o,token:n}}a(nle,"applyMsBenchAuth");function ile(t,e,...r){if(n8t()){v$e.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 tx(t,e,"api",...r)}a(ile,"getCapiUrl");function ole(t,e,r){(e.status===401||e.status===403)&&(v$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(ole,"handleCapiAuthError");async function PY(t,e,r){r??=await t.get(Qt).getToken();let n=ile(t,r,e),{headers:o}=await nle(t,i0(t),r.token),s=await t.get(tr).fetch(new URL(n).href,{method:"GET",headers:o});return ole(t,s,e),s}a(PY,"fetchCapiUrl");async function b$e(t,e,r){let n=await t.get(Qt).getToken(),o=ile(t,n,e),{headers:s}=await nle(t,i0(t),n.token),c=await t.get(tr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return ole(t,c,e),c}a(b$e,"postCapiUrl");async function UMo(){let e=await new rle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(UMo,"getMsBenchToken");p();var Sun=600*1e3,Rn={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"},x$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},sle=new Set([Rn.O1Ga,Rn.O3Mini,Rn.O1Mini,Rn.Gemini20Pro,Rn.Gemini20Flash]);function w$e(t){return t.startsWith("claude")}a(w$e,"isClaudeFamily");function xS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Rn.Gpt4o]:r=[Rn.Gpt4o,Rn.Gpt4turbo,Rn.Gpt4,Rn.O1Mini,Rn.O1Ga,Rn.Claude35Sonnet,Rn.O3Mini,Rn.Gemini20Flash,Rn.Claude37Sonnet,Rn.Claude37SonnetThought,Rn.Gpt45,Rn.Gpt41,Rn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt35turbo,Rn.Gpt41,Rn.CopilotBase];break;case"gitCommit":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt4,Rn.Gpt41,Rn.CopilotBase];break;case"nesStubs":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt41,Rn.CopilotBase];break;case"codeMapper":r=[Rn.Gpt41]}return r}a(xS,"getSupportedModelFamiliesForPrompt");var Tun={textEmbedding3Small:"text-embedding-3-small"},QMo=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())}))}),bun=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())}),qMo=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:QMo,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(bun),long_context:S.Optional(bun)}))})),custom_model:S.Optional(S.Object({key_name:S.Optional(S.String()),owner_name:S.Optional(S.String()),owner_type:S.Optional(S.String()),provider:S.Optional(S.String())})),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()})))}),Iun=S.Object({data:S.Array(qMo)});function xun(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(xun,"getDegradationReason");var xs=class{static{a(this,"ModelMetadataProvider")}},T$e=class extends xs{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(r){return(r||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 PY(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){Nr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Nr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new aM(r)}await this.processModels(r)}async fetchModel(r){let n=await PY(this.ctx,`/models/${r}`);if(!n.ok){Nr.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 b$e(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){Nr.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>Sun}},I$e=class extends xs{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(r){let n=this.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments(),s=n.ideChatExpModelIds(o),c=[];if(s){let l=s?.split(",");for(let u of l){let d=await this.fetchModel(u.trim());d!==void 0&&(d.isExperimental=!0,c.push(d))}}return c.concat(await this.delegate.getMetadata(r))}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(wun,"getUserSelectedModelConfiguration");p();p();p();var fQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Run=de(require("node:fs/promises")),R$e=de(require("node:path"));async function k$e(t){return await Run.readFile(GTe(t))}a(k$e,"readFile");function GTe(t){return R$e.default.resolve(R$e.default.extname(__filename)!==".ts"?__dirname:R$e.default.resolve(__dirname,"../../dist"),t)}a(GTe,"locateFile");var i8t=de(require("node:fs")),$Te=de(require("node:path"));function Pun(){let t=$Te.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[$Te.join(__dirname,t),$Te.join(__dirname,"../../../packages/copilot-tokenizer",t)],r=[];for(let n of e)try{return{binding:require(n)}}catch(o){r.push(`${n}: ${o instanceof Error?o.message:String(o)}`)}return{error:new Error(`could not load copilot-tokenizer.node: + `]]))[0];return jMo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Mc.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 Mn(`${C$e.claim} ${l}`);throw tO.getToken.info(Us(n,d)),d}let s=_f(this.tenantId,r,this.additionallyAllowedTenantIds);s&&ag(tO,s);try{tle(n,tO),tO.getToken.info(`Using the scope ${n}`);let c=E$e(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return tO.getToken.info(r0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(qMo(c)){let u=new Mn(C$e.installed);throw tO.getToken.info(Us(n,u)),u}else if(QMo(c)){let u=new Mn(C$e.login);throw tO.getToken.info(Us(n,u)),u}let l=new Mn(`${c}. ${C$e.troubleshoot}`);throw tO.getToken.info(Us(n,l)),l}})}};async function jMo(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&&tO.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(jMo,"parseJsonToken");p();var Sun=require("node:fs/promises");var HMo="common",GMo="aebc6443-996d-45c2-90f0-388ff96faa56",ZFt=lo("VisualStudioCodeCredential"),$Mo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function VMo(t){let e=$Mo[t];if(e)throw new Mn(e)}a(VMo,"checkUnsupportedTenant");var VTe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(ag(ZFt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=HMo,this.additionallyAllowedTenantIds=Xf(e?.additionallyAllowedTenants),VMo(this.tenantId)}async prepare(e){let r=_f(this.tenantId,this.options,this.additionallyAllowedTenantIds,ZFt)||this.tenantId;if(!Wtn()||!xje)throw new Mn("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(xje,e);this.msalClient=rE(GMo,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=Lx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Mn("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,Sun.readFile)(e,{encoding:"utf8"});return I3t(n)}catch(n){throw ZFt.getToken.info(Us(r,n)),new Mn("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 b$e=lo("BrokerCredential"),S$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Zce(b$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=Xf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:b$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=rE(nY,this.brokerTenantId,r)}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=_f(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,b$e);let o=Lx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw b$e.getToken.info(Us(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function Tun(t={}){return new S$e(t)}a(Tun,"createDefaultBrokerCredential");function XFt(t={}){return new VTe(t)}a(XFt,"createDefaultVisualStudioCodeCredential");function e8t(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 pQ(c)}if(o&&r){let c={...t,tenantId:s};return new pQ(r,c)}if(e){let c={...t,clientId:e};return new pQ(c)}return new pQ(t)}a(e8t,"createDefaultManagedIdentityCredential");function t8t(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 _3(s)}if(o){let s={...t,tenantId:o};return new _3(s)}return new _3(t)}a(t8t,"createDefaultWorkloadIdentityCredential");function r8t(t={}){return new jTe(t)}a(r8t,"createDefaultAzureDeveloperCliCredential");function n8t(t={}){return new GTe(t)}a(n8t,"createDefaultAzureCliCredential");function i8t(t={}){return new $Te(t)}a(i8t,"createDefaultAzurePowershellCredential");function o8t(t={}){return new QTe(t)}a(o8t,"createDefaultEnvironmentCredential");var T$e=lo("DefaultAzureCredential"),s8t=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return T$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},nle=class extends mSe{static{a(this,"DefaultAzureCredential")}constructor(e){WMo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[XFt,n8t,i8t,r8t,Tun],o=[o8t,t8t,e8t],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=[o8t];break;case"workloadidentitycredential":s=[t8t];break;case"managedidentitycredential":s=[()=>e8t({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[XFt];break;case"azureclicredential":s=[n8t];break;case"azurepowershellcredential":s=[i8t];break;case"azuredeveloperclicredential":s=[r8t];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 T$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return T$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new s8t(u.name,d.message)}});super(...l)}};function WMo(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 T$e.warning(n),new Error(n)}}}a(WMo,"validateRequiredEnvVars");p();var GCu=lo("InteractiveBrowserCredential");p();var ebu=lo("DeviceCodeCredential");p();var zMo="AzurePipelinesCredential",ubu=lo(zMo);p();var _bu=lo("AuthorizationCodeCredential");p();var YMo="OnBehalfOfCredential",kbu=lo(YMo);p();var I$e=new fe("capiFetchUtilities");function s0(t){let e={...$y(t),"X-GitHub-Api-Version":"2026-06-01"},r=R$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(s0,"getCapiHeaders");function Iun(t,e){return I$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":KW.api,"Copilot-Integration-Id":"autodev-test"}}a(Iun,"addMsBenchCesProxyHeaders");async function xun(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;I$e.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Ftn(process.env.HMAC_SECRET,r);return{...e,...n}}a(xun,"addMsBenchHmacHeaders");function KMo(){return bB()&&!!process.env.HMAC_SECRET}a(KMo,"isMsBenchHmacModeEnabled");function a8t(){return bB()&&!process.env.HMAC_SECRET}a(a8t,"isMsBenchCesProxyModeEnabled");async function x$e(t,e){return process.env.HMAC_SECRET?await xun(t,e):Iun(t,e)}a(x$e,"addMsBenchHeaders");async function ile(t,e,r){let n=r;a8t()&&(n=await JMo());let o={...e,Authorization:`Bearer ${n}`};return{headers:KMo()?await xun(t,o):a8t()?Iun(t,o):o,token:n}}a(ile,"applyMsBenchAuth");function ole(t,e,...r){if(a8t()){I$e.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 ix(t,e,"api",...r)}a(ole,"getCapiUrl");function sle(t,e,r){(e.status===401||e.status===403)&&(I$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(sle,"handleCapiAuthError");async function OY(t,e,r){r??=await t.get(Qt).getToken();let n=ole(t,r,e),{headers:o}=await ile(t,s0(t),r.token),s=await t.get(nr).fetch(new URL(n).href,{method:"GET",headers:o});return sle(t,s,e),s}a(OY,"fetchCapiUrl");async function w$e(t,e,r){let n=await t.get(Qt).getToken(),o=ole(t,n,e),{headers:s}=await ile(t,s0(t),n.token),c=await t.get(nr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return sle(t,c,e),c}a(w$e,"postCapiUrl");async function JMo(){let e=await new nle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(JMo,"getMsBenchToken");p();var Run=600*1e3,Rn={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"},D$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},ale=new Set([Rn.O1Ga,Rn.O3Mini,Rn.O1Mini,Rn.Gemini20Pro,Rn.Gemini20Flash]);function N$e(t){return t.startsWith("claude")}a(N$e,"isClaudeFamily");function wS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Rn.Gpt4o]:r=[Rn.Gpt4o,Rn.Gpt4turbo,Rn.Gpt4,Rn.O1Mini,Rn.O1Ga,Rn.Claude35Sonnet,Rn.O3Mini,Rn.Gemini20Flash,Rn.Claude37Sonnet,Rn.Claude37SonnetThought,Rn.Gpt45,Rn.Gpt41,Rn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt35turbo,Rn.Gpt41,Rn.CopilotBase];break;case"gitCommit":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt4,Rn.Gpt41,Rn.CopilotBase];break;case"nesStubs":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt41,Rn.CopilotBase];break;case"codeMapper":r=[Rn.Gpt41]}return r}a(wS,"getSupportedModelFamiliesForPrompt");var kun={textEmbedding3Small:"text-embedding-3-small"},ZMo=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())}))}),wun=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())}),XMo=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:ZMo,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(wun),long_context:S.Optional(wun)}))})),custom_model:S.Optional(S.Object({key_name:S.Optional(S.String()),owner_name:S.Optional(S.String()),owner_type:S.Optional(S.String()),provider:S.Optional(S.String())})),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()})))}),Pun=S.Object({data:S.Array(XMo)});function Dun(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(Dun,"getDegradationReason");var xs=class{static{a(this,"ModelMetadataProvider")}},k$e=class extends xs{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(r){return(r||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 OY(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){Nr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Nr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new uM(r)}await this.processModels(r)}async fetchModel(r){let n=await OY(this.ctx,`/models/${r}`);if(!n.ok){Nr.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 w$e(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){Nr.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>Run}},P$e=class extends xs{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(r){let n=this.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments(),s=n.ideChatExpModelIds(o),c=[];if(s){let l=s?.split(",");for(let u of l){let d=await this.fetchModel(u.trim());d!==void 0&&(d.isExperimental=!0,c.push(d))}}return c.concat(await this.delegate.getMetadata(r))}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(Nun,"getUserSelectedModelConfiguration");p();p();p();var hQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Mun=de(require("node:fs/promises")),M$e=de(require("node:path"));async function O$e(t){return await Mun.readFile(WTe(t))}a(O$e,"readFile");function WTe(t){return M$e.default.resolve(M$e.default.extname(__filename)!==".ts"?__dirname:M$e.default.resolve(__dirname,"../../dist"),t)}a(WTe,"locateFile");var c8t=de(require("node:fs")),zTe=de(require("node:path"));function Lun(){let t=zTe.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[zTe.join(__dirname,t),zTe.join(__dirname,"../../../packages/copilot-tokenizer",t)],r=[];for(let n of e)try{return{binding:require(n)}}catch(o){r.push(`${n}: ${o instanceof Error?o.message:String(o)}`)}return{error:new Error(`could not load copilot-tokenizer.node: ${r.join(` -`)}`)}}a(Pun,"loadNativeTokenizer");var kun=new Set;function jMo(t){return[GTe(`resources/${t}.tiktoken.noindex`),$Te.join(__dirname,"resources",`${t}.tiktoken.noindex`)]}a(jMo,"vocabularyCandidates");async function Dun(t,e){if(!kun.has(e)){if(!t.tokenEncoderInitialized(e)){let r=await i8t.promises.readFile(await HMo(e));t.tokenInitEncoder(e,r)}kun.add(e)}}a(Dun,"initializeEncoderAsync");async function HMo(t){let e=jMo(t);for(let r of e)try{return await i8t.promises.access(r),r}catch{}throw new Error(`vocabulary for "${t}" not found at ${e.join(" or ")}`)}a(HMo,"firstExistingVocabulary");var D$e=new Map;function ws(t="o200k_base"){c8t(t);let e=D$e.get(t);return e!==void 0?e:GMo(t)}a(ws,"getTokenizer");var Nun=new Map;function GMo(t){let e=Nun.get(t);if(!e){let r=new pQ(t),n=a(()=>D$e.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")},Nun.set(t,e)}return e}a(GMo,"getUpgradingTokenizer");async function hQ(t="o200k_base"){return await c8t(t),ws(t)}a(hQ,"getTokenizerAsync");var P$e=Pun(),s8t=class t{constructor(e,r){this._binding=e;this._encoder=r}static{a(this,"TTokenizer")}static async create(e){if(e!=="cl100k_base"&&e!=="o200k_base")throw new fQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(P$e.error)throw new fQ("Could not load tokenizer",P$e.error);try{return await Dun(P$e.binding,e),new t(P$e.binding,e)}catch(r){throw r instanceof Error?new fQ("Could not load tokenizer",r):r}}tokenize(e){return this._binding.tokenEncode(e,this._encoder)}encode(e,r){return r!==void 0&&r.length>0?this._binding.tokenEncodeWithSpecial(e,this._encoder,[...r]):this._binding.tokenEncode(e,this._encoder)}detokenize(e){return this._binding.tokenDecode(e,this._encoder)}tokenLength(e){return this._binding.tokenCount(e,this._encoder)}tokenizeStrings(e){return this._binding.tokenEncodeStrings(e,this._encoder)}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.lengthB$e.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")},Uun.set(t,e)}return e}a(rOo,"getUpgradingTokenizer");async function gQ(t="o200k_base"){return await f8t(t),ws(t)}a(gQ,"getTokenizerAsync");var L$e=Lun(),u8t=class t{constructor(e,r){this._binding=e;this._encoder=r}static{a(this,"TTokenizer")}static async create(e){if(e!=="cl100k_base"&&e!=="o200k_base")throw new hQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(L$e.error)throw new hQ("Could not load tokenizer",L$e.error);try{return await Fun(L$e.binding,e),new t(L$e.binding,e)}catch(r){throw r instanceof Error?new hQ("Could not load tokenizer",r):r}}tokenize(e){return this._binding.tokenEncode(e,this._encoder)}encode(e,r){return r!==void 0&&r.length>0?this._binding.tokenEncodeWithSpecial(e,this._encoder,[...r]):this._binding.tokenEncode(e,this._encoder)}detokenize(e){return this._binding.tokenDecode(e,this._encoder)}tokenLength(e){return this._binding.tokenCount(e,this._encoder)}tokenizeStrings(e){return this._binding.tokenEncodeStrings(e,this._encoder)}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)}},d8t=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)}},$Mo={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}},o8t=4,pQ=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(-o8t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-o8t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?$Mo[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)}},nOo={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}},l8t=4,mQ=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(-l8t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-l8t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?nOo[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 VMo(t){try{let e=await s8t.create(t);D$e.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(VMo,"setTokenizer");var Mun=new Map,Oun=!1;function c8t(t="o200k_base"){if(Oun||(Oun=!0,D$e.set("mock",new a8t)),t==="mock")return Promise.resolve();let e=Mun.get(t);return e||(e=VMo(t).catch(()=>{}),Mun.set(t,e)),e}a(c8t,"_ensureLoaded");async function Lun(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await c8t(e)}a(Lun,"ensureNativeTokenizersLoaded");p();p();var WMo=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},Uun=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)},l8t,N$e,Qun,u8t=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),l8t.add(this),N$e.set(this,void 0),WMo(this,N$e,e,"f"),this.error=r}Errors(){return new SU(Uun(this,l8t,"m",Qun).call(this))}};N$e=new WeakMap,l8t=new WeakSet,Qun=a(function*(){this.error&&(yield this.error),yield*Uun(this,N$e,"f")},"_AssertError_Iterator");function Fun(t,e,r){if(!es(t,e,r))throw new u8t(nM(t,e,r))}a(Fun,"AssertValue");function M$e(...t){return t.length===3?Fun(t[0],t[1],t[2]):Fun(t[0],[],t[1])}a(M$e,"Assert");p();p();p();function zMo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ja(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ja(t[r]);return e}a(zMo,"FromObject");function YMo(t){return t.map(e=>ja(e))}a(YMo,"FromArray");function KMo(t){return t.slice()}a(KMo,"FromTypedArray");function JMo(t){return new Map(ja([...t.entries()]))}a(JMo,"FromMap");function ZMo(t){return new Set(ja([...t.entries()]))}a(ZMo,"FromSet");function XMo(t){return new Date(t.toISOString())}a(XMo,"FromDate");function ja(t){if(Pi(t))return YMo(t);if(__(t))return XMo(t);if(qI(t))return KMo(t);if(TGr(t))return JMo(t);if(IGr(t))return ZMo(t);if(bo(t))return zMo(t);if(B1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(ja,"Clone");var wS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ha(t){return pU(t)?t():ja(t)}a(Ha,"FromDefault");function eOo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(eOo,"FromAny");function tOo(t,e){return{}}a(tOo,"FromArgument");function rOo(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new wS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new wS(t,"Array with the contains constraint requires a default value");return"default"in t?Ha(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>RS(t.items,e)):[]}a(rOo,"FromArray");function nOo(t,e){return Qi(t,"default")?Ha(t.default):(async function*(){})()}a(nOo,"FromAsyncIterator");function iOo(t,e){return Qi(t,"default")?Ha(t.default):BigInt(0)}a(iOo,"FromBigInt");function oOo(t,e){return Qi(t,"default")?Ha(t.default):!1}a(oOo,"FromBoolean");function sOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=RS(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(sOo,"FromConstructor");function aOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(aOo,"FromDate");function cOo(t,e){return Qi(t,"default")?Ha(t.default):()=>RS(t.returns,e)}a(cOo,"FromFunction");function lOo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return RS(n,[...e,...r])}a(lOo,"FromImport");function uOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(uOo,"FromInteger");function dOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=t.allOf.reduce((n,o)=>{let s=RS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!es(t,e,r))throw new wS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(dOo,"FromIntersect");function fOo(t,e){return Qi(t,"default")?Ha(t.default):(function*(){})()}a(fOo,"FromIterator");function pOo(t,e){return Qi(t,"default")?Ha(t.default):t.const}a(pOo,"FromLiteral");function hOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"Never types cannot be created. Consider using a default value.")}a(hOo,"FromNever");function mOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"Not types must have a default value")}a(mOo,"FromNot");function gOo(t,e){return Qi(t,"default")?Ha(t.default):null}a(gOo,"FromNull");function AOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(AOo,"FromNumber");function yOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=RS(s,e));return n}}a(yOo,"FromObject");function EOo(t,e){return Qi(t,"default")?Ha(t.default):Promise.resolve(RS(t.item,e))}a(EOo,"FromPromise");function _Oo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(_Oo,"FromRecord");function vOo(t,e){return Qi(t,"default")?Ha(t.default):RS(Ia(t,e),e)}a(vOo,"FromRef");function COo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"RegExp types cannot be created. Consider using a default value.")}a(COo,"FromRegExp");function bOo(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?Ha(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(bOo,"FromString");function SOo(t,e){return Qi(t,"default")?Ha(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(SOo,"FromSymbol");function TOo(t,e){if(Qi(t,"default"))return Ha(t.default);if(!K9e(t))throw new wS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Loe(t)[0]}a(TOo,"FromTemplateLiteral");function IOo(t,e){if(qun++>MOo)throw new wS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?Ha(t.default):RS(Ia(t,e),e)}a(IOo,"FromThis");function xOo(t,e){return Qi(t,"default")?Ha(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>RS(t.items[n],e))}a(xOo,"FromTuple");function wOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(wOo,"FromUndefined");function ROo(t,e){if(Qi(t,"default"))return Ha(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return RS(t.anyOf[0],e)}a(ROo,"FromUnion");function kOo(t,e){return Qi(t,"default")?Ha(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(kOo,"FromUint8Array");function POo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(POo,"FromUnknown");function DOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(DOo,"FromVoid");function NOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new Error("User defined types must specify a default value")}a(NOo,"FromKind");function RS(t,e){let r=Y0(t,e),n=t;switch(n[Tt]){case"Any":return eOo(n,r);case"Argument":return tOo(n,r);case"Array":return rOo(n,r);case"AsyncIterator":return nOo(n,r);case"BigInt":return iOo(n,r);case"Boolean":return oOo(n,r);case"Constructor":return sOo(n,r);case"Date":return aOo(n,r);case"Function":return cOo(n,r);case"Import":return lOo(n,r);case"Integer":return uOo(n,r);case"Intersect":return dOo(n,r);case"Iterator":return fOo(n,r);case"Literal":return pOo(n,r);case"Never":return hOo(n,r);case"Not":return mOo(n,r);case"Null":return gOo(n,r);case"Number":return AOo(n,r);case"Object":return yOo(n,r);case"Promise":return EOo(n,r);case"Record":return _Oo(n,r);case"Ref":return vOo(n,r);case"RegExp":return COo(n,r);case"String":return bOo(n,r);case"Symbol":return SOo(n,r);case"TemplateLiteral":return TOo(n,r);case"This":return IOo(n,r);case"Tuple":return xOo(n,r);case"Undefined":return wOo(n,r);case"Union":return ROo(n,r);case"Uint8Array":return kOo(n,r);case"Unknown":return POo(n,r);case"Void":return DOo(n,r);default:if(!v_.Has(n[Tt]))throw new wS(n,"Unknown type");return NOo(n,r)}}a(RS,"Visit");var MOo=512,qun=0;function vP(...t){return qun=0,t.length===2?RS(t[0],t[1]):RS(t[0],[])}a(vP,"Create");var O$e=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function jun(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!cB(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=es(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=>Ia(s,e)).map(s=>jun(s,e,r));return Math.max(...o)}else return es(t,e,r)?1:0}a(jun,"ScoreUnion");function OOo(t,e,r){let n=t.anyOf.map(c=>Ia(c,e)),[o,s]=[n[0],0];for(let c of n){let l=jun(c,e,r);l>s&&(o=c,s=l)}return o}a(OOo,"SelectUnion");function LOo(t,e,r){if("default"in t)return typeof r=="function"?t.default:ja(t.default);{let n=OOo(t,e,r);return VTe(n,e,r)}}a(LOo,"CastUnion");function BOo(t,e,r){return es(t,e,r)?ja(r):vP(t,e)}a(BOo,"DefaultClone");function FOo(t,e,r){return es(t,e,r)?r:vP(t,e)}a(FOo,"Default");function UOo(t,e,r){if(es(t,e,r))return ja(r);let n=Pi(r)?ja(r):vP(t,e),o=ai(t.minItems)&&n.lengthnull)]:n,c=(ai(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>CP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!es(t,e,l))throw new O$e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(UOo,"FromArray");function QOo(t,e,r){if(es(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]=CP(c,e,r.prototype[s]));return o}a(QOo,"FromConstructor");function qOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return CP(o,[...e,...n],r)}a(qOo,"FromImport");function Hun(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?Hun(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Hun,"IntersectAssign");function jOo(t,e,r){if(es(t,e,r))return r;let n=vP(t,e),o=Hun(n,r);return es(t,e,o)?o:n}a(jOo,"FromIntersect");function HOo(t,e,r){throw new O$e(t,"Never types cannot be cast")}a(HOo,"FromNever");function GOo(t,e,r){if(es(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]=CP(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]=CP(t.additionalProperties,e,r[c]))}return o}a(GOo,"FromObject");function $Oo(t,e,r){if(es(t,e,r))return ja(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]=CP(o,e,l);return s}a($Oo,"FromRecord");function VOo(t,e,r){return CP(Ia(t,e),e,r)}a(VOo,"FromRef");function WOo(t,e,r){return CP(Ia(t,e),e,r)}a(WOo,"FromThis");function zOo(t,e,r){return es(t,e,r)?ja(r):Pi(r)?t.items===void 0?[]:t.items.map((n,o)=>CP(n,e,r[o])):vP(t,e)}a(zOo,"FromTuple");function YOo(t,e,r){return es(t,e,r)?ja(r):LOo(t,e,r)}a(YOo,"FromUnion");function CP(t,e,r){let n=Sa(t.$id)?Y0(t,e):e,o=t;switch(t[Tt]){case"Array":return UOo(o,n,r);case"Constructor":return QOo(o,n,r);case"Import":return qOo(o,n,r);case"Intersect":return jOo(o,n,r);case"Never":return HOo(o,n,r);case"Object":return GOo(o,n,r);case"Record":return $Oo(o,n,r);case"Ref":return VOo(o,n,r);case"This":return WOo(o,n,r);case"Tuple":return zOo(o,n,r);case"Union":return YOo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return BOo(t,e,r);default:return FOo(o,n,r)}}a(CP,"Visit");function VTe(...t){return t.length===3?CP(t[0],t[1],t[2]):CP(t[0],[],t[1])}a(VTe,"Cast");p();function KOo(t){return mU(t)&&t[Tt]!=="Unsafe"}a(KOo,"IsCheckable");function JOo(t,e,r){return Pi(r)?r.map(n=>wC(t.items,e,n)):r}a(JOo,"FromArray");function ZOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return wC(o,[...e,...n],r)}a(ZOo,"FromImport");function XOo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>wC(l,e,ja(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!mU(n))return s;let c=aC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||es(n,e,r[l])&&(s[l]=wC(n,e,r[l]));return s}a(XOo,"FromIntersect");function e5o(t,e,r){if(!bo(r)||Pi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=wC(t.properties[o],e,r[o]);continue}if(mU(n)&&es(n,e,r[o])){r[o]=wC(n,e,r[o]);continue}delete r[o]}return r}a(e5o,"FromObject");function t5o(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]=wC(c,e,r[u]);continue}if(mU(n)&&es(n,e,r[u])){r[u]=wC(n,e,r[u]);continue}delete r[u]}return r}a(t5o,"FromRecord");function r5o(t,e,r){return wC(Ia(t,e),e,r)}a(r5o,"FromRef");function n5o(t,e,r){return wC(Ia(t,e),e,r)}a(n5o,"FromThis");function i5o(t,e,r){if(!Pi(r))return r;if(Fu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(i5o,"FromTuple");function o5o(t,e,r){for(let n of t.anyOf)if(KOo(n)&&es(n,e,r))return wC(n,e,r);return r}a(o5o,"FromUnion");function wC(t,e,r){let n=Sa(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Array":return JOo(o,n,r);case"Import":return ZOo(o,n,r);case"Intersect":return XOo(o,n,r);case"Object":return e5o(o,n,r);case"Record":return t5o(o,n,r);case"Ref":return r5o(o,n,r);case"This":return n5o(o,n,r);case"Tuple":return i5o(o,n,r);case"Union":return o5o(o,n,r);default:return r}}a(wC,"Visit");function L$e(...t){return t.length===3?wC(t[0],t[1],t[2]):wC(t[0],[],t[1])}a(L$e,"Clean");p();function B$e(t){return Sa(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(B$e,"IsStringNumeric");function s5o(t){return pA(t)||eM(t)||ai(t)}a(s5o,"IsValueToString");function WTe(t){return t===!0||ai(t)&&t===1||pA(t)&&t===BigInt("1")||Sa(t)&&(t.toLowerCase()==="true"||t==="1")}a(WTe,"IsValueTrue");function zTe(t){return t===!1||ai(t)&&(t===0||Object.is(t,-0))||pA(t)&&t===BigInt("0")||Sa(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(zTe,"IsValueFalse");function a5o(t){return Sa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(a5o,"IsTimeStringWithTimeZone");function c5o(t){return Sa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(c5o,"IsTimeStringWithoutTimeZone");function l5o(t){return Sa(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(l5o,"IsDateTimeStringWithTimeZone");function u5o(t){return Sa(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(u5o,"IsDateTimeStringWithoutTimeZone");function d5o(t){return Sa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(d5o,"IsDateString");function f5o(t,e){let r=$un(t);return r===e?r:t}a(f5o,"TryConvertLiteralString");function p5o(t,e){let r=Vun(t);return r===e?r:t}a(p5o,"TryConvertLiteralNumber");function h5o(t,e){let r=Gun(t);return r===e?r:t}a(h5o,"TryConvertLiteralBoolean");function m5o(t,e){return Sa(t.const)?f5o(e,t.const):ai(t.const)?p5o(e,t.const):eM(t.const)?h5o(e,t.const):e}a(m5o,"TryConvertLiteral");function Gun(t){return WTe(t)?!0:zTe(t)?!1:t}a(Gun,"TryConvertBoolean");function g5o(t){let e=a(r=>r.split(".")[0],"truncateInteger");return B$e(t)?BigInt(e(t)):ai(t)?BigInt(Math.trunc(t)):zTe(t)?BigInt(0):WTe(t)?BigInt(1):t}a(g5o,"TryConvertBigInt");function $un(t){return lB(t)&&t.description!==void 0?t.description.toString():s5o(t)?t.toString():t}a($un,"TryConvertString");function Vun(t){return B$e(t)?parseFloat(t):WTe(t)?1:zTe(t)?0:t}a(Vun,"TryConvertNumber");function A5o(t){return B$e(t)?parseInt(t):ai(t)?Math.trunc(t):WTe(t)?1:zTe(t)?0:t}a(A5o,"TryConvertInteger");function y5o(t){return Sa(t)&&t.toLowerCase()==="null"?null:t}a(y5o,"TryConvertNull");function E5o(t){return Sa(t)&&t==="undefined"?void 0:t}a(E5o,"TryConvertUndefined");function _5o(t){return __(t)?t:ai(t)?new Date(t):WTe(t)?new Date(1):zTe(t)?new Date(0):B$e(t)?new Date(parseInt(t)):c5o(t)?new Date(`1970-01-01T${t}.000Z`):a5o(t)?new Date(`1970-01-01T${t}`):u5o(t)?new Date(`${t}.000Z`):l5o(t)?new Date(t):d5o(t)?new Date(`${t}T00:00:00.000Z`):t}a(_5o,"TryConvertDate");function v5o(t,e,r){return(Pi(r)?r:[r]).map(o=>bP(t.items,e,o))}a(v5o,"FromArray");function C5o(t,e,r){return g5o(r)}a(C5o,"FromBigInt");function b5o(t,e,r){return Gun(r)}a(b5o,"FromBoolean");function S5o(t,e,r){return _5o(r)}a(S5o,"FromDate");function T5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return bP(o,[...e,...n],r)}a(T5o,"FromImport");function I5o(t,e,r){return A5o(r)}a(I5o,"FromInteger");function x5o(t,e,r){return t.allOf.reduce((n,o)=>bP(o,e,n),r)}a(x5o,"FromIntersect");function w5o(t,e,r){return m5o(t,r)}a(w5o,"FromLiteral");function R5o(t,e,r){return y5o(r)}a(R5o,"FromNull");function k5o(t,e,r){return Vun(r)}a(k5o,"FromNumber");function P5o(t,e,r){if(!bo(r)||Pi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=bP(t.properties[n],e,r[n]));return r}a(P5o,"FromObject");function D5o(t,e,r){if(!(bo(r)&&!Pi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=bP(s,e,l);return r}a(D5o,"FromRecord");function N5o(t,e,r){return bP(Ia(t,e),e,r)}a(N5o,"FromRef");function M5o(t,e,r){return $un(r)}a(M5o,"FromString");function O5o(t,e,r){return Sa(r)||ai(r)?Symbol(r):r}a(O5o,"FromSymbol");function L5o(t,e,r){return bP(Ia(t,e),e,r)}a(L5o,"FromThis");function B5o(t,e,r){return Pi(r)&&!Fu(t.items)?r.map((o,s)=>s{let c=L_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(H5o,"FromIntersect");function G5o(t,e,r){let n=_3(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=L_(t.properties[s],e,n[s]);Fu(c)||(n[s]=L_(t.properties[s],e,n[s]))}if(!d8t(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=L_(t.additionalProperties,e,n[s]));return n}a(G5o,"FromObject");function $5o(t,e,r){let n=_3(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)&&d8t(c)&&(n[u]=L_(c,e,n[u]));if(!d8t(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=L_(o,e,n[u]));return n}a($5o,"FromRecord");function V5o(t,e,r){return L_(Ia(t,e),e,_3(t,r))}a(V5o,"FromRef");function W5o(t,e,r){return L_(Ia(t,e),e,r)}a(W5o,"FromThis");function z5o(t,e,r){let n=_3(t,r);if(!Pi(n)||Fu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cJ5o,Format:()=>YTe,Get:()=>X5o,Has:()=>Z5o,Set:()=>K5o,ValuePointerRootDeleteError:()=>q$e,ValuePointerRootSetError:()=>Q$e});p();var Q$e=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}},q$e=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function zun(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(zun,"Escape");function*YTe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nDY(t[o],e[o]))}a(e4o,"ObjectType");function t4o(t,e){return __(e)&&t.getTime()===e.getTime()}a(t4o,"DateType");function r4o(t,e){return!Pi(e)||t.length!==e.length?!1:t.every((r,n)=>DY(r,e[n]))}a(r4o,"ArrayType");function n4o(t,e){return!qI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>DY(r,e[n]))}a(n4o,"TypedArrayType");function i4o(t,e){return t===e}a(i4o,"ValueType");function DY(t,e){if(__(t))return t4o(t,e);if(qI(t))return n4o(t,e);if(Pi(t))return r4o(t,e);if(bo(t))return e4o(t,e);if(B1(t))return i4o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(DY,"Equal");var o4o=rc({type:ca("insert"),path:C_(),value:Qk()}),s4o=rc({type:ca("update"),path:C_(),value:Qk()}),a4o=rc({type:ca("delete"),path:C_()}),Kun=tc([o4o,s4o,a4o]),j$e=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function H$e(t,e){return{type:"update",path:t,value:e}}a(H$e,"CreateUpdate");function Jun(t,e){return{type:"insert",path:t,value:e}}a(Jun,"CreateInsert");function Zun(t){return{type:"delete",path:t}}a(Zun,"CreateDelete");function Yun(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new j$e(t,"Cannot diff objects with symbols")}a(Yun,"AssertDiffable");function*c4o(t,e,r){if(Yun(e),Yun(r),!EPt(r))return yield H$e(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield Jun(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(DY(e,r)||(yield*G$e(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield Zun(`${t}/${s}`))}a(c4o,"ObjectType");function*l4o(t,e,r){if(!Pi(r))return yield H$e(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(f4o,"IsRootUpdate");function p4o(t){return t.length===0}a(p4o,"IsIdentity");function edn(t,e){if(f4o(e))return ja(e[0].value);if(p4o(e))return ja(t);let r=ja(t);for(let n of e)switch(n.type){case"insert":{SP.Set(r,n.path,n.value);break}case"update":{SP.Set(r,n.path,n.value);break}case"delete":{SP.Delete(r,n.path);break}}return r}a(edn,"Patch");p();function tdn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=yB(e,r)?Zoe(e,r,n):n;if(!es(e,r,o))throw new Joe(e,o,nM(e,r,o).First());return o}a(tdn,"Encode");p();function $$e(t){return bo(t)&&!Pi(t)}a($$e,"IsStandardObject");var V$e=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function h4o(t,e,r,n){if(!$$e(r))SP.Set(t,e,ja(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)f8t(t,`${e}/${c}`,r[c],n[c])}}a(h4o,"ObjectType");function m4o(t,e,r,n){if(!Pi(r))SP.Set(t,e,ja(n));else{for(let o=0;o(M$e(s,c,l),l)],["Cast",(s,c,l)=>VTe(s,c,l)],["Clean",(s,c,l)=>L$e(s,c,l)],["Clone",(s,c,l)=>ja(l)],["Convert",(s,c,l)=>F$e(s,c,l)],["Decode",(s,c,l)=>yB(s,c)?Koe(s,c,l):l],["Default",(s,c,l)=>U$e(s,c,l)],["Encode",(s,c,l)=>yB(s,c)?Zoe(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})(p8t||(p8t={}));var idn=["Clone","Clean","Default","Convert","Assert","Decode"];function E4o(t,e,r,n){return t.reduce((o,s)=>{let c=p8t.Get(s);if(Fu(c))throw new W$e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(E4o,"ParseValue");function odn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Pi(t[0])?[t[0],t[1],[],t[2]]:[idn,t[0],t[1],t[2]]:t.length===2?[idn,t[0],[],t[1]]:(()=>{throw new W$e("Invalid Arguments")})();return E4o(e,r,n,o)}a(odn,"Parse");p();var XM={};ki(XM,{Assert:()=>M$e,Cast:()=>VTe,Check:()=>es,Clean:()=>L$e,Clone:()=>ja,Convert:()=>F$e,Create:()=>vP,Decode:()=>Wun,Default:()=>U$e,Diff:()=>Xun,Edit:()=>Kun,Encode:()=>tdn,Equal:()=>DY,Errors:()=>nM,Hash:()=>bU,Mutate:()=>ndn,Parse:()=>odn,Patch:()=>edn,ValueErrorIterator:()=>SU});p();var _4o="gpt-41-copilot",Ox=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&bs(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 _4o}parseModelsResponse(e){try{return XM.Parse(Iun,e)}catch(r){Nr.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 PY(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Nr.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=wun(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Nr.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=Ft(this._ctx,Ye.DebugOverrideEngine)||Ft(this._ctx,Ye.DebugOverrideEngineLegacy);if(o)return new NY(o,"override");let s=e?this._ctx.get(Zt).customEngine(e):"",c=e?this._ctx.get(Zt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new NY(s,"exp"):new NY(n,"modelpicker"):s?new NY(s,"exp"):new NY(r,"default")}},NY=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function mQ(t,e=void 0){let r=t.get(Ox),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(mQ,"getEngineRequestInfo");p();p();var Qo=class{static{a(this,"FileSystem")}};var bdn=de(Cdn());function Sdn(t){return t!==void 0&&t!==0}a(Sdn,"isRepoInfo");function Tdn(t){if(t===void 0||t===0)return"";let e=MY(t);if(e==="github/github")return e;let r=V4o(t)?.toLowerCase();return r!==void 0?r:""}a(Tdn,"getDogFood");function MY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(MY,"tryGetGitHubNWO");function V4o(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(V4o,"tryGetADONWO");function gQ(t,e){let r=uf(e);return W4o(t,r)}a(gQ,"extractRepoInfoInBackground");var W4o=J4o(z4o,1e4);async function z4o(t,e){let r=RKr(e);if(!r)return;let n=await Y4o(t,r);if(!n)return;let o=t.get(Qo),s=wa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=K4o(c)??"",u=A8t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(z4o,"extractRepoInfo");function A8t(t){let e;try{if(e=(0,bdn.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(A8t,"parseRepoUrl");async function Y4o(t,e){let r=e+"_add_to_make_longer",n=t.get(Qo);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 g8t(d)),n.delete(c)}),0}}a(J4o,"computeInBackgroundAndMemoize");p();var KTe=500,Idn=8192-KTe,xdn=4,z$e=10,wdn=1e3*5,Y$e={prefix:35,suffix:15,stableContext:35,volatileContext:15},Z4o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function JTe(t){return t=t.toLowerCase(),Z4o[t]??t}a(JTe,"normalizeLanguageId");var y8t=class{constructor(e){this.ctx=e;this.cache=new Cn(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 E8t(()=>this.ctx.get(dP).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()}},E8t=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 X4o(t){return"uri"in t}a(X4o,"isCompletionsFiltersInfo");var Zt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new y8t(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=Wt.createAndMarkAsIssued()){if(n instanceof JI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&X4o(r)?gQ(this.ctx,r.uri):void 0,s=MY(o)??"",c=Tdn(o)??"",l=r?.languageId??"",u=mQ(this.ctx).modelId,d=CQr(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Op).getProperties(),E=e.endpoints,_={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-Orgs":f,"X-Copilot-CopilotTrackingId":h,"X-GitHub-Copilot-SKU":y.sku||"","X-GitHub-Copilot-IsFcv1":m?"1":"0","X-GitHub-Copilot-IsSn":g?"1":"0"},v=this.getGranularityDirectory(),b=this.makeFilterSettings(_),T=v.extendFilters(b),w=await this.getExpConfig(T.newFilterSettings,E);v.update(b,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(b),x=R.newFilterSettings,P=await this.getExpConfig(x,E),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(L=>setTimeout(L,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,E)});return this.prepareForUpcomingFilters(x,E),new JI(n.properties,n.measurements,n.issuedTime,{filters:x,exp:P})}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(Ua).machineId;this.granularityDirectory=new Eje(e,this.ctx.get(Cx))}return this.granularityDirectory}makeFilterSettings(e){return new iB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return nC.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 iB({}));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??Y$e.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??z$e}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??Idn+KTe}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??wdn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??Y$e.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??Y$e.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}appmodProblemsViewEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodproblemsviewenabled??!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 K$e(t){let e=Ft(t,Ye.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(K$e,"isSearchAgentEnabled");function kdn(t,e){let r=Ft(t,Ye.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Zt).ideEnableCopilotNesNonFreeEnabled(e)}a(kdn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var J$e=de(ale());var v8t={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 kS(t){return t in v8t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(kS,"isSupportedLanguageId");function Z$e(t){if(!(t in v8t))throw new Error(`Unrecognized language: ${t}`);return v8t[t]}a(Z$e,"languageIdToWasmLanguage");var _8t=new Map;async function eLo(t){let e;try{e=await k$e(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new fQ(`Could not load tree-sitter-${t}.wasm`,r):r}return J$e.default.Language.load(e)}a(eLo,"loadWasmLanguage");function b8t(t){let e=Z$e(t);if(!_8t.has(e)){let r=eLo(e);_8t.set(e,r)}return _8t.get(e)}a(b8t,"getLanguage");var C8t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function AQ(t,e){return(await S8t(t,e))[0]}a(AQ,"parseTreeSitter");async function S8t(t,e){await J$e.default.init({locateFile:a(s=>GTe(s),"locateFile")});let r;try{r=new J$e.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 C8t(`Could not init Parse for language <${t}>`,s):s}let n=await b8t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(S8t,"parseTreeSitterIncludingVersion");function Pdn(t){switch(Z$e(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(Pdn,"getBlockCloseToken");function tLo(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(tLo,"innerQuery");var rLo=[`[ +`);return n.substring(o+1)}};async function iOo(t){try{let e=await u8t.create(t);B$e.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(iOo,"setTokenizer");var Qun=new Map,qun=!1;function f8t(t="o200k_base"){if(qun||(qun=!0,B$e.set("mock",new d8t)),t==="mock")return Promise.resolve();let e=Qun.get(t);return e||(e=iOo(t).catch(()=>{}),Qun.set(t,e)),e}a(f8t,"_ensureLoaded");async function jun(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await f8t(e)}a(jun,"ensureNativeTokenizersLoaded");p();p();var oOo=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},Gun=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)},p8t,F$e,$un,h8t=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),p8t.add(this),F$e.set(this,void 0),oOo(this,F$e,e,"f"),this.error=r}Errors(){return new IU(Gun(this,p8t,"m",$un).call(this))}};F$e=new WeakMap,p8t=new WeakSet,$un=a(function*(){this.error&&(yield this.error),yield*Gun(this,F$e,"f")},"_AssertError_Iterator");function Hun(t,e,r){if(!es(t,e,r))throw new h8t(sM(t,e,r))}a(Hun,"AssertValue");function U$e(...t){return t.length===3?Hun(t[0],t[1],t[2]):Hun(t[0],[],t[1])}a(U$e,"Assert");p();p();p();function sOo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ja(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ja(t[r]);return e}a(sOo,"FromObject");function aOo(t){return t.map(e=>ja(e))}a(aOo,"FromArray");function cOo(t){return t.slice()}a(cOo,"FromTypedArray");function lOo(t){return new Map(ja([...t.entries()]))}a(lOo,"FromMap");function uOo(t){return new Set(ja([...t.entries()]))}a(uOo,"FromSet");function dOo(t){return new Date(t.toISOString())}a(dOo,"FromDate");function ja(t){if(Pi(t))return aOo(t);if(v_(t))return dOo(t);if(GI(t))return cOo(t);if(kGr(t))return lOo(t);if(PGr(t))return uOo(t);if(So(t))return sOo(t);if(B1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(ja,"Clone");var RS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ha(t){return mU(t)?t():ja(t)}a(Ha,"FromDefault");function fOo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(fOo,"FromAny");function pOo(t,e){return{}}a(pOo,"FromArgument");function hOo(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new RS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new RS(t,"Array with the contains constraint requires a default value");return"default"in t?Ha(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>kS(t.items,e)):[]}a(hOo,"FromArray");function mOo(t,e){return Qi(t,"default")?Ha(t.default):(async function*(){})()}a(mOo,"FromAsyncIterator");function gOo(t,e){return Qi(t,"default")?Ha(t.default):BigInt(0)}a(gOo,"FromBigInt");function AOo(t,e){return Qi(t,"default")?Ha(t.default):!1}a(AOo,"FromBoolean");function yOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=kS(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(yOo,"FromConstructor");function EOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(EOo,"FromDate");function _Oo(t,e){return Qi(t,"default")?Ha(t.default):()=>kS(t.returns,e)}a(_Oo,"FromFunction");function vOo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return kS(n,[...e,...r])}a(vOo,"FromImport");function COo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(COo,"FromInteger");function bOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=t.allOf.reduce((n,o)=>{let s=kS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!es(t,e,r))throw new RS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(bOo,"FromIntersect");function SOo(t,e){return Qi(t,"default")?Ha(t.default):(function*(){})()}a(SOo,"FromIterator");function TOo(t,e){return Qi(t,"default")?Ha(t.default):t.const}a(TOo,"FromLiteral");function IOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new RS(t,"Never types cannot be created. Consider using a default value.")}a(IOo,"FromNever");function xOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new RS(t,"Not types must have a default value")}a(xOo,"FromNot");function wOo(t,e){return Qi(t,"default")?Ha(t.default):null}a(wOo,"FromNull");function ROo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(ROo,"FromNumber");function kOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=kS(s,e));return n}}a(kOo,"FromObject");function POo(t,e){return Qi(t,"default")?Ha(t.default):Promise.resolve(kS(t.item,e))}a(POo,"FromPromise");function DOo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(DOo,"FromRecord");function NOo(t,e){return Qi(t,"default")?Ha(t.default):kS(xa(t,e),e)}a(NOo,"FromRef");function MOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new RS(t,"RegExp types cannot be created. Consider using a default value.")}a(MOo,"FromRegExp");function OOo(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new RS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new RS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?Ha(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(OOo,"FromString");function LOo(t,e){return Qi(t,"default")?Ha(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(LOo,"FromSymbol");function BOo(t,e){if(Qi(t,"default"))return Ha(t.default);if(!tUe(t))throw new RS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Boe(t)[0]}a(BOo,"FromTemplateLiteral");function FOo(t,e){if(Vun++>VOo)throw new RS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?Ha(t.default):kS(xa(t,e),e)}a(FOo,"FromThis");function UOo(t,e){return Qi(t,"default")?Ha(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>kS(t.items[n],e))}a(UOo,"FromTuple");function QOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(QOo,"FromUndefined");function qOo(t,e){if(Qi(t,"default"))return Ha(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return kS(t.anyOf[0],e)}a(qOo,"FromUnion");function jOo(t,e){return Qi(t,"default")?Ha(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(jOo,"FromUint8Array");function HOo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(HOo,"FromUnknown");function GOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(GOo,"FromVoid");function $Oo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new Error("User defined types must specify a default value")}a($Oo,"FromKind");function kS(t,e){let r=K0(t,e),n=t;switch(n[St]){case"Any":return fOo(n,r);case"Argument":return pOo(n,r);case"Array":return hOo(n,r);case"AsyncIterator":return mOo(n,r);case"BigInt":return gOo(n,r);case"Boolean":return AOo(n,r);case"Constructor":return yOo(n,r);case"Date":return EOo(n,r);case"Function":return _Oo(n,r);case"Import":return vOo(n,r);case"Integer":return COo(n,r);case"Intersect":return bOo(n,r);case"Iterator":return SOo(n,r);case"Literal":return TOo(n,r);case"Never":return IOo(n,r);case"Not":return xOo(n,r);case"Null":return wOo(n,r);case"Number":return ROo(n,r);case"Object":return kOo(n,r);case"Promise":return POo(n,r);case"Record":return DOo(n,r);case"Ref":return NOo(n,r);case"RegExp":return MOo(n,r);case"String":return OOo(n,r);case"Symbol":return LOo(n,r);case"TemplateLiteral":return BOo(n,r);case"This":return FOo(n,r);case"Tuple":return UOo(n,r);case"Undefined":return QOo(n,r);case"Union":return qOo(n,r);case"Uint8Array":return jOo(n,r);case"Unknown":return HOo(n,r);case"Void":return GOo(n,r);default:if(!C_.Has(n[St]))throw new RS(n,"Unknown type");return $Oo(n,r)}}a(kS,"Visit");var VOo=512,Vun=0;function bP(...t){return Vun=0,t.length===2?kS(t[0],t[1]):kS(t[0],[])}a(bP,"Create");var Q$e=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Wun(t,e,r){if(t[St]==="Object"&&typeof r=="object"&&!lB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[St]==="Literal"&&u.const===r[l]?100:0,f=es(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[St]==="Union"){let o=t.anyOf.map(s=>xa(s,e)).map(s=>Wun(s,e,r));return Math.max(...o)}else return es(t,e,r)?1:0}a(Wun,"ScoreUnion");function WOo(t,e,r){let n=t.anyOf.map(c=>xa(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Wun(c,e,r);l>s&&(o=c,s=l)}return o}a(WOo,"SelectUnion");function zOo(t,e,r){if("default"in t)return typeof r=="function"?t.default:ja(t.default);{let n=WOo(t,e,r);return YTe(n,e,r)}}a(zOo,"CastUnion");function YOo(t,e,r){return es(t,e,r)?ja(r):bP(t,e)}a(YOo,"DefaultClone");function KOo(t,e,r){return es(t,e,r)?r:bP(t,e)}a(KOo,"Default");function JOo(t,e,r){if(es(t,e,r))return ja(r);let n=Pi(r)?ja(r):bP(t,e),o=si(t.minItems)&&n.lengthnull)]:n,c=(si(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>SP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!es(t,e,l))throw new Q$e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(JOo,"FromArray");function ZOo(t,e,r){if(es(t,e,r))return bP(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]=SP(c,e,r.prototype[s]));return o}a(ZOo,"FromConstructor");function XOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return SP(o,[...e,...n],r)}a(XOo,"FromImport");function zun(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?zun(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(zun,"IntersectAssign");function e5o(t,e,r){if(es(t,e,r))return r;let n=bP(t,e),o=zun(n,r);return es(t,e,o)?o:n}a(e5o,"FromIntersect");function t5o(t,e,r){throw new Q$e(t,"Never types cannot be cast")}a(t5o,"FromNever");function r5o(t,e,r){if(es(t,e,r))return r;if(r===null||typeof r!="object")return bP(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]=SP(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]=SP(t.additionalProperties,e,r[c]))}return o}a(r5o,"FromObject");function n5o(t,e,r){if(es(t,e,r))return ja(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return bP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=SP(o,e,l);return s}a(n5o,"FromRecord");function i5o(t,e,r){return SP(xa(t,e),e,r)}a(i5o,"FromRef");function o5o(t,e,r){return SP(xa(t,e),e,r)}a(o5o,"FromThis");function s5o(t,e,r){return es(t,e,r)?ja(r):Pi(r)?t.items===void 0?[]:t.items.map((n,o)=>SP(n,e,r[o])):bP(t,e)}a(s5o,"FromTuple");function a5o(t,e,r){return es(t,e,r)?ja(r):zOo(t,e,r)}a(a5o,"FromUnion");function SP(t,e,r){let n=Ta(t.$id)?K0(t,e):e,o=t;switch(t[St]){case"Array":return JOo(o,n,r);case"Constructor":return ZOo(o,n,r);case"Import":return XOo(o,n,r);case"Intersect":return e5o(o,n,r);case"Never":return t5o(o,n,r);case"Object":return r5o(o,n,r);case"Record":return n5o(o,n,r);case"Ref":return i5o(o,n,r);case"This":return o5o(o,n,r);case"Tuple":return s5o(o,n,r);case"Union":return a5o(o,n,r);case"Date":case"Symbol":case"Uint8Array":return YOo(t,e,r);default:return KOo(o,n,r)}}a(SP,"Visit");function YTe(...t){return t.length===3?SP(t[0],t[1],t[2]):SP(t[0],[],t[1])}a(YTe,"Cast");p();function c5o(t){return AU(t)&&t[St]!=="Unsafe"}a(c5o,"IsCheckable");function l5o(t,e,r){return Pi(r)?r.map(n=>RC(t.items,e,n)):r}a(l5o,"FromArray");function u5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return RC(o,[...e,...n],r)}a(u5o,"FromImport");function d5o(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>RC(l,e,ja(r))).reduce((l,u)=>So(u)?{...l,...u}:u,{});if(!So(r)||!So(s)||!AU(n))return s;let c=cC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||es(n,e,r[l])&&(s[l]=RC(n,e,r[l]));return s}a(d5o,"FromIntersect");function f5o(t,e,r){if(!So(r)||Pi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=RC(t.properties[o],e,r[o]);continue}if(AU(n)&&es(n,e,r[o])){r[o]=RC(n,e,r[o]);continue}delete r[o]}return r}a(f5o,"FromObject");function p5o(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]=RC(c,e,r[u]);continue}if(AU(n)&&es(n,e,r[u])){r[u]=RC(n,e,r[u]);continue}delete r[u]}return r}a(p5o,"FromRecord");function h5o(t,e,r){return RC(xa(t,e),e,r)}a(h5o,"FromRef");function m5o(t,e,r){return RC(xa(t,e),e,r)}a(m5o,"FromThis");function g5o(t,e,r){if(!Pi(r))return r;if(Uu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(g5o,"FromTuple");function A5o(t,e,r){for(let n of t.anyOf)if(c5o(n)&&es(n,e,r))return RC(n,e,r);return r}a(A5o,"FromUnion");function RC(t,e,r){let n=Ta(t.$id)?K0(t,e):e,o=t;switch(o[St]){case"Array":return l5o(o,n,r);case"Import":return u5o(o,n,r);case"Intersect":return d5o(o,n,r);case"Object":return f5o(o,n,r);case"Record":return p5o(o,n,r);case"Ref":return h5o(o,n,r);case"This":return m5o(o,n,r);case"Tuple":return g5o(o,n,r);case"Union":return A5o(o,n,r);default:return r}}a(RC,"Visit");function q$e(...t){return t.length===3?RC(t[0],t[1],t[2]):RC(t[0],[],t[1])}a(q$e,"Clean");p();function j$e(t){return Ta(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(j$e,"IsStringNumeric");function y5o(t){return hA(t)||nM(t)||si(t)}a(y5o,"IsValueToString");function KTe(t){return t===!0||si(t)&&t===1||hA(t)&&t===BigInt("1")||Ta(t)&&(t.toLowerCase()==="true"||t==="1")}a(KTe,"IsValueTrue");function JTe(t){return t===!1||si(t)&&(t===0||Object.is(t,-0))||hA(t)&&t===BigInt("0")||Ta(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(JTe,"IsValueFalse");function E5o(t){return Ta(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(E5o,"IsTimeStringWithTimeZone");function _5o(t){return Ta(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(_5o,"IsTimeStringWithoutTimeZone");function v5o(t){return Ta(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(v5o,"IsDateTimeStringWithTimeZone");function C5o(t){return Ta(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(C5o,"IsDateTimeStringWithoutTimeZone");function b5o(t){return Ta(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(b5o,"IsDateString");function S5o(t,e){let r=Kun(t);return r===e?r:t}a(S5o,"TryConvertLiteralString");function T5o(t,e){let r=Jun(t);return r===e?r:t}a(T5o,"TryConvertLiteralNumber");function I5o(t,e){let r=Yun(t);return r===e?r:t}a(I5o,"TryConvertLiteralBoolean");function x5o(t,e){return Ta(t.const)?S5o(e,t.const):si(t.const)?T5o(e,t.const):nM(t.const)?I5o(e,t.const):e}a(x5o,"TryConvertLiteral");function Yun(t){return KTe(t)?!0:JTe(t)?!1:t}a(Yun,"TryConvertBoolean");function w5o(t){let e=a(r=>r.split(".")[0],"truncateInteger");return j$e(t)?BigInt(e(t)):si(t)?BigInt(Math.trunc(t)):JTe(t)?BigInt(0):KTe(t)?BigInt(1):t}a(w5o,"TryConvertBigInt");function Kun(t){return uB(t)&&t.description!==void 0?t.description.toString():y5o(t)?t.toString():t}a(Kun,"TryConvertString");function Jun(t){return j$e(t)?parseFloat(t):KTe(t)?1:JTe(t)?0:t}a(Jun,"TryConvertNumber");function R5o(t){return j$e(t)?parseInt(t):si(t)?Math.trunc(t):KTe(t)?1:JTe(t)?0:t}a(R5o,"TryConvertInteger");function k5o(t){return Ta(t)&&t.toLowerCase()==="null"?null:t}a(k5o,"TryConvertNull");function P5o(t){return Ta(t)&&t==="undefined"?void 0:t}a(P5o,"TryConvertUndefined");function D5o(t){return v_(t)?t:si(t)?new Date(t):KTe(t)?new Date(1):JTe(t)?new Date(0):j$e(t)?new Date(parseInt(t)):_5o(t)?new Date(`1970-01-01T${t}.000Z`):E5o(t)?new Date(`1970-01-01T${t}`):C5o(t)?new Date(`${t}.000Z`):v5o(t)?new Date(t):b5o(t)?new Date(`${t}T00:00:00.000Z`):t}a(D5o,"TryConvertDate");function N5o(t,e,r){return(Pi(r)?r:[r]).map(o=>TP(t.items,e,o))}a(N5o,"FromArray");function M5o(t,e,r){return w5o(r)}a(M5o,"FromBigInt");function O5o(t,e,r){return Yun(r)}a(O5o,"FromBoolean");function L5o(t,e,r){return D5o(r)}a(L5o,"FromDate");function B5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return TP(o,[...e,...n],r)}a(B5o,"FromImport");function F5o(t,e,r){return R5o(r)}a(F5o,"FromInteger");function U5o(t,e,r){return t.allOf.reduce((n,o)=>TP(o,e,n),r)}a(U5o,"FromIntersect");function Q5o(t,e,r){return x5o(t,r)}a(Q5o,"FromLiteral");function q5o(t,e,r){return k5o(r)}a(q5o,"FromNull");function j5o(t,e,r){return Jun(r)}a(j5o,"FromNumber");function H5o(t,e,r){if(!So(r)||Pi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=TP(t.properties[n],e,r[n]));return r}a(H5o,"FromObject");function G5o(t,e,r){if(!(So(r)&&!Pi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=TP(s,e,l);return r}a(G5o,"FromRecord");function $5o(t,e,r){return TP(xa(t,e),e,r)}a($5o,"FromRef");function V5o(t,e,r){return Kun(r)}a(V5o,"FromString");function W5o(t,e,r){return Ta(r)||si(r)?Symbol(r):r}a(W5o,"FromSymbol");function z5o(t,e,r){return TP(xa(t,e),e,r)}a(z5o,"FromThis");function Y5o(t,e,r){return Pi(r)&&!Uu(t.items)?r.map((o,s)=>s{let c=B_(s,e,n);return So(c)?{...o,...c}:c},{})}a(t4o,"FromIntersect");function r4o(t,e,r){let n=v3(t,r);if(!So(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=B_(t.properties[s],e,n[s]);Uu(c)||(n[s]=B_(t.properties[s],e,n[s]))}if(!m8t(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=B_(t.additionalProperties,e,n[s]));return n}a(r4o,"FromObject");function n4o(t,e,r){let n=v3(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)&&m8t(c)&&(n[u]=B_(c,e,n[u]));if(!m8t(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=B_(o,e,n[u]));return n}a(n4o,"FromRecord");function i4o(t,e,r){return B_(xa(t,e),e,v3(t,r))}a(i4o,"FromRef");function o4o(t,e,r){return B_(xa(t,e),e,r)}a(o4o,"FromThis");function s4o(t,e,r){let n=v3(t,r);if(!Pi(n)||Uu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cl4o,Format:()=>ZTe,Get:()=>d4o,Has:()=>u4o,Set:()=>c4o,ValuePointerRootDeleteError:()=>V$e,ValuePointerRootSetError:()=>$$e});p();var $$e=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}},V$e=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Xun(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Xun,"Escape");function*ZTe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nLY(t[o],e[o]))}a(f4o,"ObjectType");function p4o(t,e){return v_(e)&&t.getTime()===e.getTime()}a(p4o,"DateType");function h4o(t,e){return!Pi(e)||t.length!==e.length?!1:t.every((r,n)=>LY(r,e[n]))}a(h4o,"ArrayType");function m4o(t,e){return!GI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>LY(r,e[n]))}a(m4o,"TypedArrayType");function g4o(t,e){return t===e}a(g4o,"ValueType");function LY(t,e){if(v_(t))return p4o(t,e);if(GI(t))return m4o(t,e);if(Pi(t))return h4o(t,e);if(So(t))return f4o(t,e);if(B1(t))return g4o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(LY,"Equal");var A4o=nc({type:la("insert"),path:b_(),value:jk()}),y4o=nc({type:la("update"),path:b_(),value:jk()}),E4o=nc({type:la("delete"),path:b_()}),tdn=rc([A4o,y4o,E4o]),W$e=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function z$e(t,e){return{type:"update",path:t,value:e}}a(z$e,"CreateUpdate");function rdn(t,e){return{type:"insert",path:t,value:e}}a(rdn,"CreateInsert");function ndn(t){return{type:"delete",path:t}}a(ndn,"CreateDelete");function edn(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new W$e(t,"Cannot diff objects with symbols")}a(edn,"AssertDiffable");function*_4o(t,e,r){if(edn(e),edn(r),!bPt(r))return yield z$e(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield rdn(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(LY(e,r)||(yield*Y$e(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield ndn(`${t}/${s}`))}a(_4o,"ObjectType");function*v4o(t,e,r){if(!Pi(r))return yield z$e(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(S4o,"IsRootUpdate");function T4o(t){return t.length===0}a(T4o,"IsIdentity");function odn(t,e){if(S4o(e))return ja(e[0].value);if(T4o(e))return ja(t);let r=ja(t);for(let n of e)switch(n.type){case"insert":{IP.Set(r,n.path,n.value);break}case"update":{IP.Set(r,n.path,n.value);break}case"delete":{IP.Delete(r,n.path);break}}return r}a(odn,"Patch");p();function sdn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=EB(e,r)?Xoe(e,r,n):n;if(!es(e,r,o))throw new Zoe(e,o,sM(e,r,o).First());return o}a(sdn,"Encode");p();function K$e(t){return So(t)&&!Pi(t)}a(K$e,"IsStandardObject");var J$e=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function I4o(t,e,r,n){if(!K$e(r))IP.Set(t,e,ja(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)g8t(t,`${e}/${c}`,r[c],n[c])}}a(I4o,"ObjectType");function x4o(t,e,r,n){if(!Pi(r))IP.Set(t,e,ja(n));else{for(let o=0;o(U$e(s,c,l),l)],["Cast",(s,c,l)=>YTe(s,c,l)],["Clean",(s,c,l)=>q$e(s,c,l)],["Clone",(s,c,l)=>ja(l)],["Convert",(s,c,l)=>H$e(s,c,l)],["Decode",(s,c,l)=>EB(s,c)?Joe(s,c,l):l],["Default",(s,c,l)=>G$e(s,c,l)],["Encode",(s,c,l)=>EB(s,c)?Xoe(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})(A8t||(A8t={}));var ldn=["Clone","Clean","Default","Convert","Assert","Decode"];function P4o(t,e,r,n){return t.reduce((o,s)=>{let c=A8t.Get(s);if(Uu(c))throw new Z$e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(P4o,"ParseValue");function udn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Pi(t[0])?[t[0],t[1],[],t[2]]:[ldn,t[0],t[1],t[2]]:t.length===2?[ldn,t[0],[],t[1]]:(()=>{throw new Z$e("Invalid Arguments")})();return P4o(e,r,n,o)}a(udn,"Parse");p();var rO={};ki(rO,{Assert:()=>U$e,Cast:()=>YTe,Check:()=>es,Clean:()=>q$e,Clone:()=>ja,Convert:()=>H$e,Create:()=>bP,Decode:()=>Zun,Default:()=>G$e,Diff:()=>idn,Edit:()=>tdn,Encode:()=>sdn,Equal:()=>LY,Errors:()=>sM,Hash:()=>TU,Mutate:()=>cdn,Parse:()=>udn,Patch:()=>odn,ValueErrorIterator:()=>IU});p();var D4o="gpt-41-copilot",Bx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&bs(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 D4o}parseModelsResponse(e){try{return rO.Parse(Pun,e)}catch(r){Nr.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 OY(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Nr.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=Nun(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Nr.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=Ft(this._ctx,Ye.DebugOverrideEngine)||Ft(this._ctx,Ye.DebugOverrideEngineLegacy);if(o)return new BY(o,"override");let s=e?this._ctx.get(Zt).customEngine(e):"",c=e?this._ctx.get(Zt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new BY(s,"exp"):new BY(n,"modelpicker"):s?new BY(s,"exp"):new BY(r,"default")}},BY=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function AQ(t,e=void 0){let r=t.get(Bx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(AQ,"getEngineRequestInfo");p();p();var qo=class{static{a(this,"FileSystem")}};var wdn=de(xdn());function Rdn(t){return t!==void 0&&t!==0}a(Rdn,"isRepoInfo");function kdn(t){if(t===void 0||t===0)return"";let e=FY(t);if(e==="github/github")return e;let r=iLo(t)?.toLowerCase();return r!==void 0?r:""}a(kdn,"getDogFood");function FY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(FY,"tryGetGitHubNWO");function iLo(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(iLo,"tryGetADONWO");function yQ(t,e){let r=ff(e);return oLo(t,r)}a(yQ,"extractRepoInfoInBackground");var oLo=lLo(sLo,1e4);async function sLo(t,e){let r=MKr(e);if(!r)return;let n=await aLo(t,r);if(!n)return;let o=t.get(qo),s=Ra(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=cLo(c)??"",u=v8t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(sLo,"extractRepoInfo");function v8t(t){let e;try{if(e=(0,wdn.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(v8t,"parseRepoUrl");async function aLo(t,e){let r=e+"_add_to_make_longer",n=t.get(qo);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 _8t(d)),n.delete(c)}),0}}a(lLo,"computeInBackgroundAndMemoize");p();var XTe=500,Pdn=8192-XTe,Ddn=4,X$e=10,Ndn=1e3*5,eVe={prefix:35,suffix:15,stableContext:35,volatileContext:15},uLo={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function eIe(t){return t=t.toLowerCase(),uLo[t]??t}a(eIe,"normalizeLanguageId");var C8t=class{constructor(e){this.ctx=e;this.cache=new Cn(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 b8t(()=>this.ctx.get(pP).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()}},b8t=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 dLo(t){return"uri"in t}a(dLo,"isCompletionsFiltersInfo");var Zt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new C8t(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=Wt.createAndMarkAsIssued()){if(n instanceof ex)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&dLo(r)?yQ(this.ctx,r.uri):void 0,s=FY(o)??"",c=kdn(o)??"",l=r?.languageId??"",u=AQ(this.ctx).modelId,d=xQr(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Bp).getProperties(),E=e.endpoints,_={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-Orgs":f,"X-Copilot-CopilotTrackingId":h,"X-GitHub-Copilot-SKU":y.sku||"","X-GitHub-Copilot-IsFcv1":m?"1":"0","X-GitHub-Copilot-IsSn":g?"1":"0"},v=this.getGranularityDirectory(),b=this.makeFilterSettings(_),T=v.extendFilters(b),w=await this.getExpConfig(T.newFilterSettings,E);v.update(b,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(b),x=R.newFilterSettings,P=await this.getExpConfig(x,E),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(L=>setTimeout(L,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,E)});return this.prepareForUpcomingFilters(x,E),new ex(n.properties,n.measurements,n.issuedTime,{filters:x,exp:P})}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(Qa).machineId;this.granularityDirectory=new Sje(e,this.ctx.get(Sx))}return this.granularityDirectory}makeFilterSettings(e){return new oB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return jI.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 oB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=SB(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??eVe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??X$e}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??Pdn+XTe}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??Ndn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??eVe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??eVe.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}appmodProblemsViewEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodproblemsviewenabled??!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 tVe(t){let e=Ft(t,Ye.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(tVe,"isSearchAgentEnabled");function Odn(t,e){let r=Ft(t,Ye.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Zt).ideEnableCopilotNesNonFreeEnabled(e)}a(Odn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var rVe=de(cle());var T8t={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 PS(t){return t in T8t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(PS,"isSupportedLanguageId");function nVe(t){if(!(t in T8t))throw new Error(`Unrecognized language: ${t}`);return T8t[t]}a(nVe,"languageIdToWasmLanguage");var S8t=new Map;async function fLo(t){let e;try{e=await O$e(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new hQ(`Could not load tree-sitter-${t}.wasm`,r):r}return rVe.default.Language.load(e)}a(fLo,"loadWasmLanguage");function x8t(t){let e=nVe(t);if(!S8t.has(e)){let r=fLo(e);S8t.set(e,r)}return S8t.get(e)}a(x8t,"getLanguage");var I8t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function EQ(t,e){return(await w8t(t,e))[0]}a(EQ,"parseTreeSitter");async function w8t(t,e){await rVe.default.init({locateFile:a(s=>WTe(s),"locateFile")});let r;try{r=new rVe.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 I8t(`Could not init Parse for language <${t}>`,s):s}let n=await x8t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(w8t,"parseTreeSitterIncludingVersion");function Ldn(t){switch(nVe(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(Ldn,"getBlockCloseToken");function pLo(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(pLo,"innerQuery");var hLo=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Ddn(t){return tLo([rLo],t).length==1}a(Ddn,"queryPythonIsDocstring");var eO=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 Bdn(t){return pLo([hLo],t).length==1}a(Bdn,"queryPythonIsDocstring");var nO=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}}},ag=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 cle.languageIds.has(e)||lle.languageIds.has(e)||ZTe.languageIds.has(e)||ule.languageIds.has(e)||XTe.languageIds.has(e)||eIe.languageIds.has(e)||tIe.languageIds.has(e)||rIe.languageIds.has(e)||nIe.languageIds.has(e)}static isTrimmedByDefault(e){return cle.languageIds.has(e)||lle.languageIds.has(e)||ule.languageIds.has(e)}static create(e,r,n,o){if(cle.languageIds.has(e))return new cle(e,r,n,o);if(lle.languageIds.has(e))return new lle(e,r,n,o);if(ZTe.languageIds.has(e))return new ZTe(e,r,n,o);if(ule.languageIds.has(e))return new ule(e,r,n,o);if(tIe.languageIds.has(e))return new tIe(e,r,n,o);if(XTe.languageIds.has(e))return new XTe(e,r,n,o);if(eIe.languageIds.has(e))return new eIe(e,r,n,o);if(rIe.languageIds.has(e))return new rIe(e,r,n,o);if(nIe.languageIds.has(e))return new nIe(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 AQ(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}}},cg=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 lle.languageIds.has(e)||ule.languageIds.has(e)||tIe.languageIds.has(e)||dle.languageIds.has(e)||rIe.languageIds.has(e)||nIe.languageIds.has(e)||iIe.languageIds.has(e)||oIe.languageIds.has(e)||sIe.languageIds.has(e)}static isTrimmedByDefault(e){return lle.languageIds.has(e)||ule.languageIds.has(e)||dle.languageIds.has(e)}static create(e,r,n,o){if(lle.languageIds.has(e))return new lle(e,r,n,o);if(ule.languageIds.has(e))return new ule(e,r,n,o);if(tIe.languageIds.has(e))return new tIe(e,r,n,o);if(dle.languageIds.has(e))return new dle(e,r,n,o);if(iIe.languageIds.has(e))return new iIe(e,r,n,o);if(rIe.languageIds.has(e))return new rIe(e,r,n,o);if(nIe.languageIds.has(e))return new nIe(e,r,n,o);if(oIe.languageIds.has(e))return new oIe(e,r,n,o);if(sIe.languageIds.has(e))return new sIe(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 EQ(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(` -`)}},X$e=class t extends eO{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"}},cle=class extends ag{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new X$e(e)}getStatementQueryText(){return`[ +`)}},iVe=class t extends nO{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"}},lle=class extends cg{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new iVe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1797,7 +1797,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},lle=class extends ag{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new X$e(e)}getStatementQueryText(){return`[ + ] @statement`}},ule=class extends cg{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new iVe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1820,7 +1820,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},T8t=class t extends eO{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}},ZTe=class extends ag{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new T8t(e)}getStatementQueryText(){return`[ + ] @statement`}},R8t=class t extends nO{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}},tIe=class extends cg{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new R8t(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1846,24 +1846,24 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},I8t=class t extends eO{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)}},ule=class extends ag{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new I8t(e)}getStatementQueryText(){return`[ + ] @statement`}},k8t=class t extends nO{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)}},dle=class extends cg{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new k8t(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},x8t=class t extends eO{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)}},XTe=class extends ag{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new x8t(e)}getStatementQueryText(){return`[ + ] @statement`}},P8t=class t extends nO{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)}},rIe=class extends cg{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new P8t(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},w8t=class t extends eO{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)}},eIe=class extends ag{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new w8t(e)}getStatementQueryText(){return`[ + ] @statement`}},D8t=class t extends nO{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)}},nIe=class extends cg{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new D8t(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},R8t=class t extends eO{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"}},tIe=class extends ag{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new R8t(e)}getStatementQueryText(){return`[ + ] @statement`}},N8t=class t extends nO{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"}},iIe=class extends cg{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new N8t(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -1876,7 +1876,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},k8t=class t extends eO{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"}},rIe=class extends ag{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new k8t(e)}getStatementQueryText(){return`[ + ] @statement`}},M8t=class t extends nO{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"}},oIe=class extends cg{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new M8t(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1888,7 +1888,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},P8t=class t extends eO{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)}},nIe=class extends ag{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new P8t(e)}getStatementQueryText(){return`[ + ] @statement`}},O8t=class t extends nO{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)}},sIe=class extends cg{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new O8t(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -1925,7 +1925,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var tO=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return ag.isSupported(e)}static isTrimmedByDefault(e){return ag.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=Rkt(n,ag.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{kkt(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 eVe=class extends tO{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.endIndexpLo,build:()=>uLo,buildType:()=>dLo,default:()=>ELo,dependencies:()=>gLo,description:()=>cLo,devDependencies:()=>mLo,displayName:()=>aLo,engines:()=>fLo,name:()=>sLo,overrides:()=>ALo,overridesComments:()=>yLo,scripts:()=>hLo,version:()=>lLo});var sLo="copilot",aLo="GitHub Copilot",cLo="Your AI pair programmer",lLo="1.517.0",uLo="64",dLo="prod",fLo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},pLo={cliPackageVersion:"2.1.159"},hLo={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}" "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"},mLo={"@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.125.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.3",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.7.0","js-yaml":"^4.2.0",mocha:"^11.7.6","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.45.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.3.0",tsx:"^4.22.4",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},gLo={"@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.63","@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","@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.54.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@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","jsonc-parser":"^3.3.1",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.5",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.28.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"},ALo={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"},yLo={"//":"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'."},ELo={name:sLo,displayName:aLo,description:cLo,version:lLo,build:uLo,buildType:dLo,engines:fLo,anthropicClaude:pLo,scripts:hLo,devDependencies:mLo,dependencies:gLo,overrides:ALo,overridesComments:yLo};var Ye={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",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",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",CodexCliPath:"agent.codex.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 Ldn(t){return["server","parsingandserver"].includes(t)}a(Ldn,"shouldDoServerTrimming");var TP=class{static{a(this,"BlockModeConfig")}},dle=class extends TP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Zt).overrideBlockMode(n);if(o)return D8t(o,r);let s=e.get(Zt).enableProgressiveReveal(n);return(Ft(e,Ye.AlwaysRequestMultiline)??s)||tO.isTrimmedByDefault(r)?D8t("moremultiline",r):r=="ruby"?"parsing":kS(r)?"parsingandserver":"server"}};function _Lo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(_Lo,"blockModeRequiresTreeSitter");function D8t(t,e){return t==="moremultiline"&&ag.isSupported(e)?t:_Lo(t)&&!kS(e)?"server":t}a(D8t,"toApplicableBlockMode");var Lo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},fle=class extends Lo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return vLo(r)}getOptionalConfig(r){return CLo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},OY=class extends Lo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Wi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Wi;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=iIe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ye.ShowEditorCompletions,Ye.EnableAutoCompletions,Ye.DelayCompletions,Ye.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Bdn(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(Bdn,"getConfigKeyRecursively");function vLo(t){if(tVe.has(t))return tVe.get(t);throw new Error(`Missing config default value: ${Nkt}.${t}`)}a(vLo,"getConfigDefaultForKey");function CLo(t){return tVe.get(t)}a(CLo,"getOptionalConfigDefaultForKey");function ple(t){return t.get(Lo).getExplicitlySetConfigs()}a(ple,"getExplicitlySetConfigs");var bLo={[Ye.DebugOverrideCppHeadersEnableSwitch]:!1,[Ye.RelatedFilesVSCodeCSharp]:!1,[Ye.RelatedFilesVSCodeTypeScript]:!1,[Ye.RelatedFilesVSCode]:!1,[Ye.IncludeNeighboringFiles]:!1,[Ye.ExcludeRelatedFiles]:!1,[Ye.ContextProviders]:[],[Ye.DebugUseEditorFetcher]:null,[Ye.DebugUseElectronFetcher]:null,[Ye.DebugOverrideLogLevels]:{},[Ye.DebugSnippyOverrideUrl]:"",[Ye.AgentDebugLogsDirectory]:void 0,[Ye.ClaudeCliPath]:void 0,[Ye.CodexCliPath]:void 0,[Ye.FetchStrategy]:"auto",[Ye.ToolConfirmAutoApprove]:!1,[Ye.AutoApproveUnmatchedTerminal]:void 0,[Ye.AutoApproveUnmatchedFileOp]:void 0,[Ye.TrustToolAnnotations]:!1,[Ye.AutoApproveYoloMode]:!1,[Ye.EditorHandlesAllConfirmation]:!1,[Ye.MaxToolCallingLoop]:25,[Ye.AutoCompress]:!1,[Ye.AnthropicThinkingBudgetToken]:1024,[Ye.EnableSkills]:!1,[Ye.EnableHooks]:!1,[Ye.EnableSandbox]:!1,[Ye.SandboxAddCurrentWorkingDirectory]:void 0,[Ye.SandboxUserPolicy]:void 0,[Ye.EnablePlugins]:!1,[Ye.EnableCustomAgents]:!0,[Ye.EnableOrgCustomAgents]:!0,[Ye.UseAgentsMd]:!1,[Ye.UseNestedAgentsMd]:!1,[Ye.UseClaudeMd]:!1,[Ye.UseNestedClaudeMd]:!1,[Ye.UseSubsetMatching]:null,[Ye.ContextProviderTimeBudget]:void 0,[Ye.DebugOverrideCapiUrl]:"",[Ye.DebugTestOverrideCapiUrl]:"",[Ye.DebugOverrideProxyUrl]:"",[Ye.DebugTestOverrideProxyUrl]:"",[Ye.DebugOverrideEngine]:"",[Ye.AlwaysRequestMultiline]:void 0,[Ye.ModelAlwaysTerminatesSingleline]:void 0,[Ye.TrimCompletionsAggressively]:void 0,[Ye.CompletionsDebounce]:void 0,[Ye.NESXTab]:void 0,[Ye.UseWorkspaceContextCoordinator]:void 0,[Ye.ShowWorkspaceContextDebugger]:!1,[Ye.CompletionsDelay]:void 0,[Ye.UseSplitContextPrompt]:void 0,[Ye.UseCompletionsComparisonPanel]:void 0,[Ye.ComparisonPanelModelIds]:void 0,[Ye.ComparisonPanelRandomizedMode]:void 0,[Ye.UseFetchFetcher]:void 0,[Ye.UseChatLibCompletions]:void 0,[Ye.TranscriptDirectory]:void 0,[Ye.EnableThinking]:!0,[Ye.ShowEditorCompletions]:void 0,[Ye.EnableAutoCompletions]:void 0,[Ye.DelayCompletions]:void 0,[Ye.FilterCompletions]:void 0,[Ye.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ye.UserSelectedCompletionModel]:"",[Ye.DebugFilterLogCategories]:[],[Ye.DebugOverrideEngineLegacy]:"",[Ye.DebugTestOverrideProxyUrlLegacy]:"",[Ye.DebugOverrideProxyUrlLegacy]:"",[Ye.DebugTestOverrideCapiUrlLegacy]:"",[Ye.DebugOverrideCapiUrlLegacy]:"",[Ye.HookErrorOccurredStackTrace]:!1,[Ye.NESUseExplicitRejection]:!1,[Ye.AppendPromptTokenCache]:"",[Ye.PromptPersistBasePath]:void 0,[Ye.AnthropicMessagesEndpoint]:"",[Ye.EnableCopilotNesNonFree]:"",[Ye.UseHelixFetcher]:"",[Ye.EnableMapCodeFallback]:"enabled",[Ye.SearchAgent]:"",[Ye.PerfEnabled]:"",[Ye.NESExtendedRange]:!1,[Ye.TransparentTokenRefresh]:"",[Ye.AuthTokenEncryption]:"",[Ye.DisableWorkspaceIndex]:""},tVe=new Map(Object.entries(bLo));for(let t of Object.values(Ye))if(!tVe.has(t))throw new Error(`Missing config default value ${Nkt}.${t}`);function Ft(t,e){return t.get(Lo).getConfig(e)}a(Ft,"getConfig");function IP(t){return Ft(t,Ye.DisableWorkspaceIndex)==="true"}a(IP,"isWorkspaceIndexDisabled");function CKr(t){return t.get(Lo).dumpForTelemetry()}a(CKr,"dumpForTelemetry");var ds=class{constructor(){this.packageJson=oIe}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 UDt(t){return t.get(ds).isProduction()}a(UDt,"isProduction");function Rtn(t){return t.get(ds).getBuildType()==="dev"}a(Rtn,"isDevBuild");function MU(t){return t.get(ds).getBuildType()}a(MU,"getBuildType");function bKr(t){return t.get(ds).getBuild()}a(bKr,"getBuild");function V1(t){return t.get(ds).getVersion()}a(V1,"getVersion");var Ua=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 M1({name:t,version:e}){return`${t}/${e}`}a(M1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return vQr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function S$e(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(S$e,"getIntegrationId");function Gy(t){let e=t.get(Ir);return{"Editor-Version":M1(e.getEditorInfo()),"Editor-Plugin-Version":M1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":V1(t)}}a(Gy,"editorVersionHeaders");var Fdn="Iv1.b507a08c87ecfe98",SLo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Kae="Ov23liV9UpD7Rnfnskm3",TLo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",ILo={[Fdn]:SLo,[Kae]:TLo},zp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Fdn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=ILo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var xLo=new fe("expConfigManager"),wLo=3600*1e3,rO=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(Zt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){xLo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function ktn(t){let e=Ft(t,Ye.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(rO).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(ktn,"resolveTransparentTokenRefresh");function Udn(t){return Ft(t,Ye.AuthTokenEncryption)==="false"}a(Udn,"isAuthTokenEncryptionDisabled");p();var Vdn=de(require("node:crypto"));var N8t=new fe("KeytarMasterKey"),jdn="copilot-language-server",Hdn="oauth-token-key",Gdn=5e3,Wdn=32,M8t;function PLo(t){return M8t??=DLo(t).finally(()=>{M8t=void 0}),M8t}a(PLo,"resolveMasterKey");async function DLo(t){let e;try{e=await L8t.loadKeytar()}catch(n){return N8t.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:O8t("loadModule",n)}}let r;try{r=await MLo(e)}catch(n){return n instanceof rVe?(N8t.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:O8t("corruptExistingEntry",n)}):(N8t.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:O8t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(DLo,"doResolveMasterKey");function NLo(){return Promise.resolve().then(()=>de(qdn()))}a(NLo,"loadKeytar");var L8t={resolveMasterKey:PLo,loadKeytar:NLo};async function MLo(t){let e=await $dn(t.getPassword(jdn,Hdn),Gdn,"getMasterKey");if(e){let n=OLo(e);if(n)return{key:n,source:"useExisting"};throw new rVe}let r=Vdn.randomBytes(Wdn);return await $dn(t.setPassword(jdn,Hdn,r.toString("base64")),Gdn,"setMasterKey"),{key:r,source:"createNew"}}a(MLo,"getOrCreateMasterKey");function $dn(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($dn,"withTimeout");var rVe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function O8t(t,e){return{available:!1,errorPhase:t,error:e}}a(O8t,"unavailable");function OLo(t){let e=Buffer.from(t,"base64");return e.length===Wdn?e:void 0}a(OLo,"decodeMasterKey");p();var hle=de(require("node:crypto"));var U8t=0,sVe=1,yQ=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")}},iVe=class{static{a(this,"SecretCodec")}},F8t=class extends iVe{constructor(){super(...arguments);this.schemaVersion=U8t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},nVe=12,B8t=16,zdn=32,oVe=class extends iVe{constructor(r){super();this.key=r;this.schemaVersion=sVe;if(r.length!==zdn)throw new Error(`AesGcmCodec requires a ${zdn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=hle.randomBytes(nVe),o=hle.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.length0}};var oVe=class extends iO{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.endIndexTLo,build:()=>CLo,buildType:()=>bLo,default:()=>PLo,dependencies:()=>wLo,description:()=>_Lo,devDependencies:()=>xLo,displayName:()=>ELo,engines:()=>SLo,name:()=>yLo,overrides:()=>RLo,overridesComments:()=>kLo,scripts:()=>ILo,version:()=>vLo});var yLo="copilot",ELo="GitHub Copilot",_Lo="Your AI pair programmer",vLo="1.520.0",CLo="71",bLo="prod",SLo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},TLo={cliPackageVersion:"2.1.159"},ILo={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}" "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"},xLo={"@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":"^22.0.0","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.21.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^18.0.0",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.7.0","js-yaml":"^4.2.0",mocha:"^11.7.6","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.45.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.3.0",tsx:"^4.23.0",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},wLo={"@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.63","@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","@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.54.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@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","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.3.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.28.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"},RLo={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"},kLo={"//":"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'."},PLo={name:yLo,displayName:ELo,description:_Lo,version:vLo,build:CLo,buildType:bLo,engines:SLo,anthropicClaude:TLo,scripts:ILo,devDependencies:xLo,dependencies:wLo,overrides:RLo,overridesComments:kLo};var Ye={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",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",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",CodexCliPath:"agent.codex.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 qdn(t){return["server","parsingandserver"].includes(t)}a(qdn,"shouldDoServerTrimming");var xP=class{static{a(this,"BlockModeConfig")}},fle=class extends xP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Zt).overrideBlockMode(n);if(o)return L8t(o,r);let s=e.get(Zt).enableProgressiveReveal(n);return(Ft(e,Ye.AlwaysRequestMultiline)??s)||iO.isTrimmedByDefault(r)?L8t("moremultiline",r):r=="ruby"?"parsing":PS(r)?"parsingandserver":"server"}};function DLo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(DLo,"blockModeRequiresTreeSitter");function L8t(t,e){return t==="moremultiline"&&cg.isSupported(e)?t:DLo(t)&&!PS(e)?"server":t}a(L8t,"toApplicableBlockMode");var Bo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},ple=class extends Bo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return NLo(r)}getOptionalConfig(r){return MLo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},UY=class extends Bo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Wi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Wi;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=aIe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ye.ShowEditorCompletions,Ye.EnableAutoCompletions,Ye.DelayCompletions,Ye.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function jdn(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(jdn,"getConfigKeyRecursively");function NLo(t){if(sVe.has(t))return sVe.get(t);throw new Error(`Missing config default value: ${Bkt}.${t}`)}a(NLo,"getConfigDefaultForKey");function MLo(t){return sVe.get(t)}a(MLo,"getOptionalConfigDefaultForKey");function hle(t){return t.get(Bo).getExplicitlySetConfigs()}a(hle,"getExplicitlySetConfigs");var OLo={[Ye.DebugOverrideCppHeadersEnableSwitch]:!1,[Ye.RelatedFilesVSCodeCSharp]:!1,[Ye.RelatedFilesVSCodeTypeScript]:!1,[Ye.RelatedFilesVSCode]:!1,[Ye.IncludeNeighboringFiles]:!1,[Ye.ExcludeRelatedFiles]:!1,[Ye.ContextProviders]:[],[Ye.DebugUseEditorFetcher]:null,[Ye.DebugUseElectronFetcher]:null,[Ye.DebugOverrideLogLevels]:{},[Ye.DebugSnippyOverrideUrl]:"",[Ye.AgentDebugLogsDirectory]:void 0,[Ye.ClaudeCliPath]:void 0,[Ye.CodexCliPath]:void 0,[Ye.FetchStrategy]:"auto",[Ye.ToolConfirmAutoApprove]:!1,[Ye.AutoApproveUnmatchedTerminal]:void 0,[Ye.AutoApproveUnmatchedFileOp]:void 0,[Ye.TrustToolAnnotations]:!1,[Ye.AutoApproveYoloMode]:!1,[Ye.EditorHandlesAllConfirmation]:!1,[Ye.MaxToolCallingLoop]:25,[Ye.AutoCompress]:!1,[Ye.AnthropicThinkingBudgetToken]:1024,[Ye.EnableSkills]:!1,[Ye.EnableHooks]:!1,[Ye.EnableSandbox]:!1,[Ye.SandboxAddCurrentWorkingDirectory]:void 0,[Ye.SandboxUserPolicy]:void 0,[Ye.EnablePlugins]:!1,[Ye.EnableCustomAgents]:!0,[Ye.EnableOrgCustomAgents]:!0,[Ye.UseAgentsMd]:!1,[Ye.UseNestedAgentsMd]:!1,[Ye.UseClaudeMd]:!1,[Ye.UseNestedClaudeMd]:!1,[Ye.UseSubsetMatching]:null,[Ye.ContextProviderTimeBudget]:void 0,[Ye.DebugOverrideCapiUrl]:"",[Ye.DebugTestOverrideCapiUrl]:"",[Ye.DebugOverrideProxyUrl]:"",[Ye.DebugTestOverrideProxyUrl]:"",[Ye.DebugOverrideEngine]:"",[Ye.AlwaysRequestMultiline]:void 0,[Ye.ModelAlwaysTerminatesSingleline]:void 0,[Ye.TrimCompletionsAggressively]:void 0,[Ye.CompletionsDebounce]:void 0,[Ye.NESXTab]:void 0,[Ye.UseWorkspaceContextCoordinator]:void 0,[Ye.ShowWorkspaceContextDebugger]:!1,[Ye.CompletionsDelay]:void 0,[Ye.UseSplitContextPrompt]:void 0,[Ye.UseCompletionsComparisonPanel]:void 0,[Ye.ComparisonPanelModelIds]:void 0,[Ye.ComparisonPanelRandomizedMode]:void 0,[Ye.UseFetchFetcher]:void 0,[Ye.UseChatLibCompletions]:void 0,[Ye.TranscriptDirectory]:void 0,[Ye.EnableThinking]:!0,[Ye.ShowEditorCompletions]:void 0,[Ye.EnableAutoCompletions]:void 0,[Ye.DelayCompletions]:void 0,[Ye.FilterCompletions]:void 0,[Ye.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ye.UserSelectedCompletionModel]:"",[Ye.DebugFilterLogCategories]:[],[Ye.DebugOverrideEngineLegacy]:"",[Ye.DebugTestOverrideProxyUrlLegacy]:"",[Ye.DebugOverrideProxyUrlLegacy]:"",[Ye.DebugTestOverrideCapiUrlLegacy]:"",[Ye.DebugOverrideCapiUrlLegacy]:"",[Ye.HookErrorOccurredStackTrace]:!1,[Ye.NESUseExplicitRejection]:!1,[Ye.AppendPromptTokenCache]:"",[Ye.PromptPersistBasePath]:void 0,[Ye.AnthropicMessagesEndpoint]:"",[Ye.EnableCopilotNesNonFree]:"",[Ye.UseHelixFetcher]:"",[Ye.EnableMapCodeFallback]:"enabled",[Ye.SearchAgent]:"",[Ye.PerfEnabled]:"",[Ye.NESExtendedRange]:!1,[Ye.TransparentTokenRefresh]:"",[Ye.AuthTokenEncryption]:"",[Ye.DisableWorkspaceIndex]:""},sVe=new Map(Object.entries(OLo));for(let t of Object.values(Ye))if(!sVe.has(t))throw new Error(`Missing config default value ${Bkt}.${t}`);function Ft(t,e){return t.get(Bo).getConfig(e)}a(Ft,"getConfig");function wP(t){return Ft(t,Ye.DisableWorkspaceIndex)==="true"}a(wP,"isWorkspaceIndexDisabled");function xKr(t){return t.get(Bo).dumpForTelemetry()}a(xKr,"dumpForTelemetry");var ds=class{constructor(){this.packageJson=cIe}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 HDt(t){return t.get(ds).isProduction()}a(HDt,"isProduction");function Mtn(t){return t.get(ds).getBuildType()==="dev"}a(Mtn,"isDevBuild");function LU(t){return t.get(ds).getBuildType()}a(LU,"getBuildType");function wKr(t){return t.get(ds).getBuild()}a(wKr,"getBuild");function V1(t){return t.get(ds).getVersion()}a(V1,"getVersion");var Qa=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 M1({name:t,version:e}){return`${t}/${e}`}a(M1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return IQr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function R$e(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(R$e,"getIntegrationId");function $y(t){let e=t.get(Ir);return{"Editor-Version":M1(e.getEditorInfo()),"Editor-Plugin-Version":M1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":V1(t)}}a($y,"editorVersionHeaders");var Hdn="Iv1.b507a08c87ecfe98",LLo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Jae="Ov23liV9UpD7Rnfnskm3",BLo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",FLo={[Hdn]:LLo,[Jae]:BLo},Kp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Hdn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=FLo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var ULo=new fe("expConfigManager"),QLo=3600*1e3,oO=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(Zt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){ULo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function Otn(t){let e=Ft(t,Ye.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(oO).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(Otn,"resolveTransparentTokenRefresh");function Gdn(t){return Ft(t,Ye.AuthTokenEncryption)==="false"}a(Gdn,"isAuthTokenEncryptionDisabled");p();var Jdn=de(require("node:crypto"));var B8t=new fe("KeytarMasterKey"),Wdn="copilot-language-server",zdn="oauth-token-key",Ydn=5e3,Zdn=32,F8t;function HLo(t){return F8t??=GLo(t).finally(()=>{F8t=void 0}),F8t}a(HLo,"resolveMasterKey");async function GLo(t){let e;try{e=await Q8t.loadKeytar()}catch(n){return B8t.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:U8t("loadModule",n)}}let r;try{r=await VLo(e)}catch(n){return n instanceof aVe?(B8t.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:U8t("corruptExistingEntry",n)}):(B8t.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:U8t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(GLo,"doResolveMasterKey");function $Lo(){return Promise.resolve().then(()=>de(Vdn()))}a($Lo,"loadKeytar");var Q8t={resolveMasterKey:HLo,loadKeytar:$Lo};async function VLo(t){let e=await Kdn(t.getPassword(Wdn,zdn),Ydn,"getMasterKey");if(e){let n=WLo(e);if(n)return{key:n,source:"useExisting"};throw new aVe}let r=Jdn.randomBytes(Zdn);return await Kdn(t.setPassword(Wdn,zdn,r.toString("base64")),Ydn,"setMasterKey"),{key:r,source:"createNew"}}a(VLo,"getOrCreateMasterKey");function Kdn(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(Kdn,"withTimeout");var aVe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function U8t(t,e){return{available:!1,errorPhase:t,error:e}}a(U8t,"unavailable");function WLo(t){let e=Buffer.from(t,"base64");return e.length===Zdn?e:void 0}a(WLo,"decodeMasterKey");p();var mle=de(require("node:crypto"));var H8t=0,dVe=1,_Q=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")}},lVe=class{static{a(this,"SecretCodec")}},j8t=class extends lVe{constructor(){super(...arguments);this.schemaVersion=H8t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},cVe=12,q8t=16,Xdn=32,uVe=class extends lVe{constructor(r){super();this.key=r;this.schemaVersion=dVe;if(r.length!==Xdn)throw new Error(`AesGcmCodec requires a ${Xdn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=mle.randomBytes(cVe),o=mle.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();tU(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();tU(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 tU(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();tU(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:U8t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=tU(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 decryptOauthTokensFromV1ToV0(){let r=this.stmts.selectEncryptedTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{l=this.secretStorage.unwrap({schemaVersion:sVe,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof yQ){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,sSe(this.ctx,{editorId:c.source_editor_id,trigger:"unwrap_failure",affectedEditors:f})):s++;continue}s++;continue}this.writePlaintextRow(c.token_id,l)===1?n++:s++}return{attempted:r.length,decrypted:n,purged:o,skipped:s}}writePlaintextRow(r,n){let o=tU(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(n,"utf8"),r));return Number(o.changes)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===sVe){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){Q8t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read/boot)`,c)}})}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 yQ&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(Q8t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),sSe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>Q8t.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 Jdn=de(require("fs")),q8t=de(require("node:sqlite")),Zdn=de(require("path"));var EQ=new fe("AuthRepoInit");function mle(){return typeof performance<"u"?performance.now():Date.now()}a(mle,"nowMs");function Kdn(t){try{t.close()}catch{}}a(Kdn,"safeClose");function LLo(t){let e=mle(),r={durationMs:0};try{Jdn.mkdirSync(Zdn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=mle()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new q8t.default.DatabaseSync(t)}catch(o){return r.durationMs=mle()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{Pkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applyPragmas",r.error=o,Kdn(n),{db:void 0,diagnostics:r}}try{Dkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applySchema",r.error=o,Kdn(n),{db:void 0,diagnostics:r}}return r.durationMs=mle()-e,{db:n,diagnostics:r}}a(LLo,"tryOpenAuthDb");function BLo(t,e){let r=new q8t.default.DatabaseSync(":memory:");return Pkt(r),Dkt(r),new sIe(t,r,e)}a(BLo,"openInMemoryAuthRepo");function Xdn(t,e,r){let{db:n,diagnostics:o}=LLo(e);return n?{repo:new sIe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:BLo(t,r),diagnostics:{...o,repoKind:"memory"}}}a(Xdn,"buildAuthRepository");function efn(t,e){if(e.repoKind==="memory"){EQ.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ts).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=>{EQ.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){EQ.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(efn,"reportAuthRepoFallbackNotice");function tfn(t,e){ytn(t,e)}a(tfn,"reportAuthRepoTelemetry");async function j8t(t){let e=t.get(v3),r=t.get(pf);if(Udn(t)){EQ.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await L8t.resolveMasterKey(t);if(!n)return ULo(t,o),r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new oVe(n);return e.addReader(s),r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:o})),FLo(t),{diagnostics:o}}a(j8t,"initializeSecretStorage");function FLo(t){let e=t.get(pf);setImmediate(()=>{t.get(nx).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>x5t(t,{result:r}))}).catch(r=>{EQ.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>x5t(t,{error:r}))})})}a(FLo,"scheduleDecryptOauthTokensFromV1ToV0");function ULo(t,e){EQ.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ts).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{EQ.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){EQ.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(ULo,"reportSecretStorageFallbackNotice");p();p();var QLo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function qLo(t){return QLo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(qLo,"isOomError");function LY(t,e,r,n=Nr){if(!Gm(e)){if(e instanceof Error){let o=e;qLo(o)?t.get(ps).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ps).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ps).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ps).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ps).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(LY,"handleException");function rfn(t){process.addListener("uncaughtException",r=>{LY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,LY(t,r,"unhandledRejection")}finally{e=!1}})}a(rfn,"registerDefaultHandlers");function nfn(){hQ("o200k_base").catch(()=>{})}a(nfn,"prewarmTokenizers");p();p();p();var C3={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 ifn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],ofn={".php":[".blade"]},_Q=Object.keys(C3).flatMap(t=>C3[t].extensions);var H8t=de(require("node:path"));var Ale=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},aIe=class{static{a(this,"LanguageDetection")}},G8t=new Map,gle=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(C3)){for(let n of e)G8t.set(n,[...G8t.get(n)??[],t]);for(let n of r??[])gle.set(n,[...gle.get(n)??[],t])}var $8t=class extends aIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ji(e.uri),n=H8t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Ale(s.languageId,s.isGuess,c):new Ale(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(ifn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=H8t.extname(n).toLowerCase();if(o.length>0&&_Q.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ofn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1};let n=G8t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},V8t=class extends aIe{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 Ale("cpp",n.isGuess,n.fileExtension):n}},W8t=class extends aIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Ale(r.languageId,!0,""):this.delegate.detectLanguage(r)}},jLo=new V8t(new W8t(new $8t));function nO({uri:t,languageId:e}){let r=jLo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(nO,"detectLanguage");p();p();p();p();function Hh(t){if(t.isCancellationRequested)throw new aVe}a(Hh,"throwIfCancellationRequested");function xP(t){return t instanceof aVe?!0:t instanceof Error&&t.name===z8t&&t.message===z8t}a(xP,"isCancellationError");var aVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(z8t),this.name=this.message}},z8t="Canceled",cVe=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 BY(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(BY,"isTypeDefinition");var hu=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=afn(e,e.length,o),sfn(n,r);o{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();nU(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();nU(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 nU(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();nU(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:H8t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=nU(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 decryptOauthTokensFromV1ToV0(){let r=this.stmts.selectEncryptedTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{l=this.secretStorage.unwrap({schemaVersion:dVe,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof _Q){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,lSe(this.ctx,{editorId:c.source_editor_id,trigger:"unwrap_failure",affectedEditors:f})):s++;continue}s++;continue}this.writePlaintextRow(c.token_id,l)===1?n++:s++}return{attempted:r.length,decrypted:n,purged:o,skipped:s}}writePlaintextRow(r,n){let o=nU(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(n,"utf8"),r));return Number(o.changes)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===dVe){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){G8t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read/boot)`,c)}})}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 _Q&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(G8t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),lSe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>G8t.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 rfn=de(require("fs")),$8t=de(require("node:sqlite")),nfn=de(require("path"));var vQ=new fe("AuthRepoInit");function gle(){return typeof performance<"u"?performance.now():Date.now()}a(gle,"nowMs");function tfn(t){try{t.close()}catch{}}a(tfn,"safeClose");function zLo(t){let e=gle(),r={durationMs:0};try{rfn.mkdirSync(nfn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=gle()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new $8t.default.DatabaseSync(t)}catch(o){return r.durationMs=gle()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{Okt(n)}catch(o){return r.durationMs=gle()-e,r.errorPhase="applyPragmas",r.error=o,tfn(n),{db:void 0,diagnostics:r}}try{Lkt(n)}catch(o){return r.durationMs=gle()-e,r.errorPhase="applySchema",r.error=o,tfn(n),{db:void 0,diagnostics:r}}return r.durationMs=gle()-e,{db:n,diagnostics:r}}a(zLo,"tryOpenAuthDb");function YLo(t,e){let r=new $8t.default.DatabaseSync(":memory:");return Okt(r),Lkt(r),new lIe(t,r,e)}a(YLo,"openInMemoryAuthRepo");function ifn(t,e,r){let{db:n,diagnostics:o}=zLo(e);return n?{repo:new lIe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:YLo(t,r),diagnostics:{...o,repoKind:"memory"}}}a(ifn,"buildAuthRepository");function ofn(t,e){if(e.repoKind==="memory"){vQ.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ts).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=>{vQ.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){vQ.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(ofn,"reportAuthRepoFallbackNotice");function sfn(t,e){btn(t,e)}a(sfn,"reportAuthRepoTelemetry");async function V8t(t){let e=t.get(C3),r=t.get(mf);if(Gdn(t)){vQ.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>Eje(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await Q8t.resolveMasterKey(t);if(!n)return JLo(t,o),r.onInitialized(()=>Eje(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new uVe(n);return e.addReader(s),r.onInitialized(()=>Eje(t,{writerKind:"plaintext",diagnostics:o})),KLo(t),{diagnostics:o}}a(V8t,"initializeSecretStorage");function KLo(t){let e=t.get(mf);setImmediate(()=>{t.get(sx).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>P5t(t,{result:r}))}).catch(r=>{vQ.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>P5t(t,{error:r}))})})}a(KLo,"scheduleDecryptOauthTokensFromV1ToV0");function JLo(t,e){vQ.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ts).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{vQ.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){vQ.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(JLo,"reportSecretStorageFallbackNotice");p();p();var ZLo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function XLo(t){return ZLo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(XLo,"isOomError");function QY(t,e,r,n=Nr){if(!Vm(e)){if(e instanceof Error){let o=e;XLo(o)?t.get(ps).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ps).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ps).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ps).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ps).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(QY,"handleException");function afn(t){process.addListener("uncaughtException",r=>{QY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,QY(t,r,"unhandledRejection")}finally{e=!1}})}a(afn,"registerDefaultHandlers");function cfn(){gQ("o200k_base").catch(()=>{})}a(cfn,"prewarmTokenizers");p();p();p();var b3={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 lfn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],ufn={".php":[".blade"]},CQ=Object.keys(b3).flatMap(t=>b3[t].extensions);var W8t=de(require("node:path"));var yle=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},uIe=class{static{a(this,"LanguageDetection")}},z8t=new Map,Ale=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(b3)){for(let n of e)z8t.set(n,[...z8t.get(n)??[],t]);for(let n of r??[])Ale.set(n,[...Ale.get(n)??[],t])}var Y8t=class extends uIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ji(e.uri),n=W8t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new yle(s.languageId,s.isGuess,c):new yle(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(lfn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=W8t.extname(n).toLowerCase();if(o.length>0&&CQ.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ufn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Ale.has(e))return{languageId:Ale.get(e)[0],isGuess:!1};let n=z8t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Ale.has(e))return{languageId:Ale.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},K8t=class extends uIe{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 yle("cpp",n.isGuess,n.fileExtension):n}},J8t=class extends uIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new yle(r.languageId,!0,""):this.delegate.detectLanguage(r)}},eBo=new K8t(new J8t(new Y8t));function sO({uri:t,languageId:e}){let r=eBo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(sO,"detectLanguage");p();p();p();p();function $h(t){if(t.isCancellationRequested)throw new fVe}a($h,"throwIfCancellationRequested");function RP(t){return t instanceof fVe?!0:t instanceof Error&&t.name===Z8t&&t.message===Z8t}a(RP,"isCancellationError");var fVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(Z8t),this.name=this.message}},Z8t="Canceled",pVe=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 qY(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(qY,"isTypeDefinition");var hu=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=ffn(e,e.length,o),dfn(n,r);o0||u>0||d>0||f>0?new Bx(r,"","",hu.fromBounds(s,c),hu.fromBounds(d,f),hu.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 Bx(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 lVe=class extends Gh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,HLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},uVe=class extends Gh{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,$Lo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,VLo),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}},dVe=class extends Gh{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,GLo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f,h-f),g=new hu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=hu.empty,y=hu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Bx(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},HLo=` +`),o=ffn(e,e.length,++o),dfn(n,r)):o++;return n.join("")}};function dfn(t,e){for(let r=0;r0||u>0||d>0||f>0?new Ux(r,"","",hu.fromBounds(s,c),hu.fromBounds(d,f),hu.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 Ux(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 hVe=class extends Vh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,tBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},mVe=class extends Vh{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,nBo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,iBo),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}},gVe=class extends Vh{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,rBo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f,h-f),g=new hu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=hu.empty,y=hu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Ux(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},tBo=` ( ((comment)* @comment) . @@ -2013,7 +2013,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,GLo=` +`,rBo=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -2024,15 +2024,15 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,$Lo=` +`,nBo=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,VLo=` +`,iBo=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var pVe=class extends Gh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,WLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hVe=class extends Gh{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,YLo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,KLo),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}},mVe=class extends Gh{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,zLo)).filter(o=>o.kind===0)}},WLo=` +`;p();var yVe=class extends Vh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,oBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},EVe=class extends Vh{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,aBo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,cBo),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}},_Ve=class extends Vh{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,sBo)).filter(o=>o.kind===0)}},oBo=` ( [ (block_comment) @comment @@ -2095,7 +2095,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,zLo=` +`,sBo=` ( [ ((line_comment)* @comment) @@ -2107,19 +2107,19 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,YLo=` +`,aBo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,KLo=` +`,cBo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var JLo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),gVe=class extends Gh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,ZLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},AVe=class extends Gh{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,XLo)).filter(o=>!JLo.has(o.unqualifiedName))}};var ZLo=` +`;p();var lBo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),vVe=class extends Vh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,uBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},CVe=class extends Vh{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,dBo)).filter(o=>!lBo.has(o.unqualifiedName))}};var uBo=` ( ((comment)* @comment) . @@ -2129,9 +2129,9 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,XLo=` +`,dBo=` (call_expression function: (_) @name) @reference -`;p();var eBo=new Set(["int","str","float","bool","list","dict","tuple","set"]),yVe=class extends Gh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,tBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},EVe=class extends Gh{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,rBo)).filter(o=>!eBo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,iBo),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}},_Ve=class extends Gh{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,nBo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new hu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=hu.empty,A=hu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Bx(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},tBo=` +`;p();var fBo=new Set(["int","str","float","bool","list","dict","tuple","set"]),bVe=class extends Vh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,pBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},SVe=class extends Vh{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,hBo)).filter(o=>!fBo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,gBo),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}},TVe=class extends Vh{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,mBo),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 hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new hu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=hu.empty,A=hu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Ux(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},pBo=` ( ((comment)* @comment) . @@ -2143,7 +2143,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,rBo=` +`,hBo=` (call function: (_) @name) @reference (type [ @@ -2152,7 +2152,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,nBo=` +`,mBo=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2167,7 +2167,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,iBo=` +`,gBo=` (call function: (_) @name) @reference (type [ @@ -2176,7 +2176,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var oBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),yle=class extends Gh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,sBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},Ele=class extends Gh{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,aBo)).filter(o=>!oBo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var sBo=` +`;p();var ABo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),Ele=class extends Vh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,yBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},_le=class extends Vh{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,EBo)).filter(o=>!ABo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var yBo=` ( ((comment)* @comment) . @@ -2201,13 +2201,13 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,aBo=` +`,EBo=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var cBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),vVe=class extends yle{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,lBo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},CVe=class extends Ele{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,uBo),super.extractReferences(e,r)]);return[...n.filter(s=>!cBo.has(s.unqualifiedName)),...o]}},lBo=` +`;p();var _Bo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),IVe=class extends Ele{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,vBo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},xVe=class extends _le{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,CBo),super.extractReferences(e,r)]);return[...n.filter(s=>!_Bo.has(s.unqualifiedName)),...o]}},vBo=` ( ((comment)* @comment) . @@ -2220,58 +2220,58 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,uBo=` +`,CBo=` (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 cIe=[{symbolExtractor:new pVe,referenceExtractor:new hVe,importExtractor:new mVe,languageId:"java"},{symbolExtractor:new lVe,referenceExtractor:new uVe,importExtractor:new dVe,languageId:"go"},{symbolExtractor:new yVe,referenceExtractor:new EVe,importExtractor:new _Ve,languageId:"python"},{symbolExtractor:new yle,referenceExtractor:new Ele,languageId:"typescript"},{symbolExtractor:new vVe,referenceExtractor:new CVe,languageId:"typescriptreact"},{symbolExtractor:new gVe,referenceExtractor:new AVe,languageId:"javascript"}];function cfn(t){let e=nO({uri:t});if(e&&cIe.some(r=>e===r.languageId))return e}a(cfn,"getSupportedLanguageIdForMultiLanguageProvider");var lfn=new Map(cIe.map(t=>[t.languageId,t.referenceExtractor])),ufn=new Map(cIe.map(t=>[t.languageId,t.symbolExtractor])),dfn=new Map(cIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),Y8t=cIe.map(t=>C3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function K8t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(K8t,"virtualNode");function ffn(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(ffn,"lineNode");function J8t(t){return{type:"blank",lineNumber:t,subs:[]}}a(J8t,"blankNode");function bVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(bVe,"topNode");function xA(t){return t.type==="blank"}a(xA,"isBlank");function FY(t){return t.type==="line"}a(FY,"isLine");function UY(t){return t.type==="virtual"}a(UY,"isVirtual");p();function pfn(t,e){return rE(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(pfn,"clearLabelsIf");function QY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>QY(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=>QY(r,e)),label:t.label?e(t.label):void 0}}}a(QY,"mapLabels");function rE(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(rE,"visitTree");function Z8t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),rE(t,s,n),o}a(Z8t,"foldTree");function SVe(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:bVe()}a(SVe,"rebuildTree");p();function fBo(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[ffn(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"),rE(t,r,"bottomUp")}a(lIe,"labelLines");function TVe(t){function e(r){if(UY(r)&&r.label===void 0){let n=r.subs.filter(o=>!xA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),rE(t,e,"bottomUp")}a(TVe,"labelVirtualInherited");function uIe(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(uIe,"buildLabelRules");function X8t(t){let r=SVe(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&&(FY(l)||UY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&xA(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?[K8t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),xA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return pfn(t,n=>n==="newVirtual"),r}a(X8t,"combineClosersAndOpeners");function hfn(t,e=xA,r){return SVe(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=K8t(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)!xA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(gfn,"processJava");p();var ABo={heading:/^# /,subheading:/^## /,subsubheading:/### /},yBo=uIe(ABo);function Afn(t){let e=t;if(lIe(e,yBo),xA(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||xA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=hfn(e),e=qY(e),TVe(e),e}a(Afn,"processMarkdown");p();function yfn(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(yfn,"deparseLine");e6t("markdown",Afn);e6t("java",gfn);var EBo={worthUp:.9,worthSibling:.88,worthDown:.8};function t6t(t,e,r=ws(),n=EBo){let o=QY(t,s=>s?1:void 0);return rE(o,s=>{if(xA(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"),rE(o,s=>{if(xA(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"),_Bo(o,e,r)}a(t6t,"fromTreeWithFocussedLines");function _Bo(t,e,r=ws()){let n=Z8t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[yfn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(_Bo,"fromTreeWithValuedLines");function PS(t,e=!0,r=!0,n,o=ws()){let s=typeof t=="string"?jY(t):jY(t.source,t.languageId);qY(s);let c=QY(s,l=>e&&l!=="closer");return rE(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&rE(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&&rE(c,l=>{l.label||=(FY(l)||xA(l))&&l.lineNumber==0},"topDown"),t6t(c,n,o)}a(PS,"elidableTextForSourceCode");p();var dIe=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(` +`;var dIe=[{symbolExtractor:new yVe,referenceExtractor:new EVe,importExtractor:new _Ve,languageId:"java"},{symbolExtractor:new hVe,referenceExtractor:new mVe,importExtractor:new gVe,languageId:"go"},{symbolExtractor:new bVe,referenceExtractor:new SVe,importExtractor:new TVe,languageId:"python"},{symbolExtractor:new Ele,referenceExtractor:new _le,languageId:"typescript"},{symbolExtractor:new IVe,referenceExtractor:new xVe,languageId:"typescriptreact"},{symbolExtractor:new vVe,referenceExtractor:new CVe,languageId:"javascript"}];function pfn(t){let e=sO({uri:t});if(e&&dIe.some(r=>e===r.languageId))return e}a(pfn,"getSupportedLanguageIdForMultiLanguageProvider");var hfn=new Map(dIe.map(t=>[t.languageId,t.referenceExtractor])),mfn=new Map(dIe.map(t=>[t.languageId,t.symbolExtractor])),gfn=new Map(dIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),X8t=dIe.map(t=>b3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function e6t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(e6t,"virtualNode");function Afn(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(Afn,"lineNode");function t6t(t){return{type:"blank",lineNumber:t,subs:[]}}a(t6t,"blankNode");function wVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(wVe,"topNode");function wA(t){return t.type==="blank"}a(wA,"isBlank");function jY(t){return t.type==="line"}a(jY,"isLine");function HY(t){return t.type==="virtual"}a(HY,"isVirtual");p();function yfn(t,e){return nE(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(yfn,"clearLabelsIf");function GY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>GY(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=>GY(r,e)),label:t.label?e(t.label):void 0}}}a(GY,"mapLabels");function nE(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(nE,"visitTree");function r6t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),nE(t,s,n),o}a(r6t,"foldTree");function RVe(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:wVe()}a(RVe,"rebuildTree");p();function SBo(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[Afn(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"),nE(t,r,"bottomUp")}a(fIe,"labelLines");function kVe(t){function e(r){if(HY(r)&&r.label===void 0){let n=r.subs.filter(o=>!wA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),nE(t,e,"bottomUp")}a(kVe,"labelVirtualInherited");function pIe(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(pIe,"buildLabelRules");function n6t(t){let r=RVe(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&&(jY(l)||HY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&wA(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?[e6t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),wA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return yfn(t,n=>n==="newVirtual"),r}a(n6t,"combineClosersAndOpeners");function Efn(t,e=wA,r){return RVe(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=e6t(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)!wA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(vfn,"processJava");p();var RBo={heading:/^# /,subheading:/^## /,subsubheading:/### /},kBo=pIe(RBo);function Cfn(t){let e=t;if(fIe(e,kBo),wA(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||wA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=Efn(e),e=$Y(e),kVe(e),e}a(Cfn,"processMarkdown");p();function bfn(t){return" ".repeat(t.indentation)+t.sourceLine+` +`}a(bfn,"deparseLine");i6t("markdown",Cfn);i6t("java",vfn);var PBo={worthUp:.9,worthSibling:.88,worthDown:.8};function o6t(t,e,r=ws(),n=PBo){let o=GY(t,s=>s?1:void 0);return nE(o,s=>{if(wA(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"),nE(o,s=>{if(wA(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"),DBo(o,e,r)}a(o6t,"fromTreeWithFocussedLines");function DBo(t,e,r=ws()){let n=r6t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[bfn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(DBo,"fromTreeWithValuedLines");function DS(t,e=!0,r=!0,n,o=ws()){let s=typeof t=="string"?VY(t):VY(t.source,t.languageId);$Y(s);let c=GY(s,l=>e&&l!=="closer");return nE(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&nE(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&&nE(c,l=>{l.label||=(jY(l)||wA(l))&&l.lineNumber==0},"topDown"),o6t(c,n,o)}a(DS,"elidableTextForSourceCode");p();var hIe=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=>ws().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=ws()){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 dIe(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&&PS(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=>ws().tokenLength(r+` +`).forEach(u=>o.push(new hIe(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&&DS(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=>ws().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}=CBo(this.lines,o);if(u<=e)return r6t(l);bBo(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?SBo(l,m):"",y=Efn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];IVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return r6t([Efn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)IVe(h[m],r)&&IVe(h[m-1],r)&&h.splice(m,1);return r6t(h)}};function vBo(t){return t?.text.match(/^\s*/)?.[0]??""}a(vBo,"getIndentation");function IVe(t,e){return t?.text.trim()===e.trim()}a(IVe,"isEllipsis");function r6t(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(r6t,"produceElidedText");function CBo(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(CBo,"initializeElisionContext");function bBo(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(bBo,"sortPriorityQueue");function SBo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=vBo(o);break}}return r}a(SBo,"getClosestIndentation");function Efn(t,e,r,n){let o=t+e;return new dIe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(Efn,"getNewEllipsis");p();var _fn=require("fs");async function vfn(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;Hh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await TBo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(vfn,"symbolRangesToCodeSnippets");async function TBo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=rs(e);o&&(n=(await _fn.promises.readFile(o)).toString())}catch{}for(let o of t)Cfn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(TBo,"sameFileSymbolRangeToElidableText");function Cfn(t,e){let n=[],o=t.node,s=e.substring(n6t(e,o.commentRange.start),o.commentRange.end);n.push([i6t(s),1-3e-4]);let c=n6t(e,o.bodyRange.start),l=n6t(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(BY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([i6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Cfn(d,e));else{let d=1-(BY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([i6t(f),d])}return BY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Cfn,"prepareForElidableText");function n6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(n6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function i6t(t){let e=0;for(;ee)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=MBo(this.lines,o);if(u<=e)return s6t(l);OBo(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?LBo(l,m):"",y=Sfn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];PVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return s6t([Sfn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)PVe(h[m],r)&&PVe(h[m-1],r)&&h.splice(m,1);return s6t(h)}};function NBo(t){return t?.text.match(/^\s*/)?.[0]??""}a(NBo,"getIndentation");function PVe(t,e){return t?.text.trim()===e.trim()}a(PVe,"isEllipsis");function s6t(t){return{getText:a(()=>t.map(e=>e.text).join(` +`),"getText"),getLines:a(()=>t,"getLines")}}a(s6t,"produceElidedText");function MBo(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(MBo,"initializeElisionContext");function OBo(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(OBo,"sortPriorityQueue");function LBo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=NBo(o);break}}return r}a(LBo,"getClosestIndentation");function Sfn(t,e,r,n){let o=t+e;return new hIe(o,1/0,r.tokenLength(o+` +`),"loose",n?.metadata)}a(Sfn,"getNewEllipsis");p();var Tfn=require("fs");async function Ifn(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;$h(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await BBo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Ifn,"symbolRangesToCodeSnippets");async function BBo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=rs(e);o&&(n=(await Tfn.promises.readFile(o)).toString())}catch{}for(let o of t)xfn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(BBo,"sameFileSymbolRangeToElidableText");function xfn(t,e){let n=[],o=t.node,s=e.substring(a6t(e,o.commentRange.start),o.commentRange.end);n.push([c6t(s),1-3e-4]);let c=a6t(e,o.bodyRange.start),l=a6t(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(qY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([c6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...xfn(d,e));else{let d=1-(qY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([c6t(f),d])}return qY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(xfn,"prepareForElidableText");function a6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(a6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function c6t(t){let e=0;for(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(i6t,"trimLineEndingsAndTrailingWhitespace");var o6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},vQ=class extends o6t{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[];Hh(c);let u=await l.extractReferences(e,r);Hh(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=>BY(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(Hh(r),BY(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}},xVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new vQ(e,r,!0,!0)),this.strategies.set("java",new vQ(e,r,!0,!0)),this.strategies.set("python",new vQ(e,r,!0,!1)),this.strategies.set("typescript",new vQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new vQ(e,r,!0,!0)),this.strategies.set("javascript",new vQ(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);Hh(l);let d=ws();return vfn(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 HY={Id:"id"},DS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},ua={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 wVe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new s6t(HY.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(c6t,"trimLineEndingsAndTrailingWhitespace");var l6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},bQ=class extends l6t{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[];$h(c);let u=await l.extractReferences(e,r);$h(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=>qY(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($h(r),qY(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}},DVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new bQ(e,r,!0,!0)),this.strategies.set("java",new bQ(e,r,!0,!0)),this.strategies.set("python",new bQ(e,r,!0,!1)),this.strategies.set("typescript",new bQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new bQ(e,r,!0,!0)),this.strategies.set("javascript",new bQ(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);$h(l);let d=ws();return Ifn(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 WY={Id:"id"},NS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},fa={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 NVe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new u6t(WY.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(", ")})`}}},fIe=class t extends wVe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${DS.FilePath}');`]);this.fields=[new mIe(DS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new kC(DS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},pIe=class t extends wVe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${ua.DocumentId}', '${ua.ExtentStart}', '${ua.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${ua.UnqualifiedName}');`],`FOREIGN KEY(${ua.DocumentId}) REFERENCES Document(${HY.Id}) ON DELETE CASCADE`);this.fields=[new kC(ua.DocumentId),new mIe(ua.FullyQualifiedName,{notNull:!0}),new mIe(ua.UnqualifiedName,{notNull:!0}),new kC(ua.CommentStart,{notNull:!0}),new kC(ua.CommentLength,{notNull:!0}),new kC(ua.NameStart,{notNull:!0}),new kC(ua.NameLength,{notNull:!0}),new kC(ua.BodyStart,{notNull:!0}),new kC(ua.BodyLength,{notNull:!0}),new kC(ua.ExtentStart,{notNull:!0}),new kC(ua.ExtentLength,{notNull:!0}),new kC(ua.SymbolKind,{notNull:!0}),new kC(ua.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},hIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},mIe=class extends hIe{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}`}},kC=class extends hIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},s6t=class extends hIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var RVe=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&&kVe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${HY.Id} = ?`,[e])}},b3=class t extends RVe{static{a(this,"DocumentTable")}static{this.tableName=fIe.tableName}createQueryGenerator(){return new fIe}async updateTimestamp(e,r){let n=await this.init;n&&kVe(n,`UPDATE ${t.tableName} SET ${DS.LastWriteTimeUtc} = ? WHERE ${DS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${t.tableName} WHERE ${DS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?PVe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${DS.FilePath} = ?`,[e]):[]}},$h=class t extends RVe{static{a(this,"SymbolTable")}static{this.tableName=pIe.tableName}createQueryGenerator(){return new pIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${t.tableName} WHERE ${ua.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 kVe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(kVe,"runDBCommand");var bfn=de(require("node:sqlite"));var DVe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${b3.tableName} ON ${$h.tableName}.${ua.DocumentId} = ${b3.tableName}.${HY.Id}`;this.db=this.initDb(e),this.documentTable=new b3(this.db),this.symbolTable=new $h(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new bfn.default.DatabaseSync(e,{open:!0});return r.exec(` +VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},mIe=class t extends NVe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${NS.FilePath}');`]);this.fields=[new yIe(NS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new PC(NS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},gIe=class t extends NVe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${fa.DocumentId}', '${fa.ExtentStart}', '${fa.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${fa.UnqualifiedName}');`],`FOREIGN KEY(${fa.DocumentId}) REFERENCES Document(${WY.Id}) ON DELETE CASCADE`);this.fields=[new PC(fa.DocumentId),new yIe(fa.FullyQualifiedName,{notNull:!0}),new yIe(fa.UnqualifiedName,{notNull:!0}),new PC(fa.CommentStart,{notNull:!0}),new PC(fa.CommentLength,{notNull:!0}),new PC(fa.NameStart,{notNull:!0}),new PC(fa.NameLength,{notNull:!0}),new PC(fa.BodyStart,{notNull:!0}),new PC(fa.BodyLength,{notNull:!0}),new PC(fa.ExtentStart,{notNull:!0}),new PC(fa.ExtentLength,{notNull:!0}),new PC(fa.SymbolKind,{notNull:!0}),new PC(fa.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},AIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},yIe=class extends AIe{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}`}},PC=class extends AIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},u6t=class extends AIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var MVe=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?LVe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&OVe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${WY.Id} = ?`,[e])}},S3=class t extends MVe{static{a(this,"DocumentTable")}static{this.tableName=mIe.tableName}createQueryGenerator(){return new mIe}async updateTimestamp(e,r){let n=await this.init;n&&OVe(n,`UPDATE ${t.tableName} SET ${NS.LastWriteTimeUtc} = ? WHERE ${NS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&OVe(r,`DELETE FROM ${t.tableName} WHERE ${NS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?LVe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${NS.FilePath} = ?`,[e]):[]}},Wh=class t extends MVe{static{a(this,"SymbolTable")}static{this.tableName=gIe.tableName}createQueryGenerator(){return new gIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&OVe(r,`DELETE FROM ${t.tableName} WHERE ${fa.DocumentId} = ?`,[e])}};function LVe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(LVe,"runDBQuery");function OVe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(OVe,"runDBCommand");var wfn=de(require("node:sqlite"));var BVe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${S3.tableName} ON ${Wh.tableName}.${fa.DocumentId} = ${S3.tableName}.${WY.Id}`;this.db=this.initDb(e),this.documentTable=new S3(this.db),this.symbolTable=new Wh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new wfn.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 ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.UnqualifiedName} BETWEEN ? AND (? || '~')`,`ORDER BY ${ua.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 ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.UnqualifiedName} ${o}IN (${n})`].join(` -`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.FullyQualifiedName} = ?`].join(` -`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} <= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) >= ?`].join(` -`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} >= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) <= ?`,`ORDER BY ${$h.tableName}.${ua.ExtentStart}`].join(` -`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.FullyQualifiedName} LIKE ?`,`ORDER BY ${$h.tableName}.${ua.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 NVe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new DVe(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 _le(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Bx(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new hu(e.commentStart,e.commentLength),new hu(e.nameStart,e.nameLength),new hu(e.bodyStart,e.bodyLength),new hu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(_le,"symbolsToSymbolRanges");var OVe=de(require("fs/promises"));var MVe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new NVe(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=rs(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await OVe.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 OVe.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 a6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>IBo(r))}a(a6t,"isIndexWorkerData");var gIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},CQ=class extends gIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},LVe=class extends gIe{constructor(r){super(nE.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},nE={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},BVe=class extends CQ{constructor(r,n,o){super(r,nE.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},FVe=class extends CQ{constructor(r,n){super(r,nE.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},UVe=class extends CQ{constructor(r,n,o){super(r,nE.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},QVe=class extends CQ{constructor(r,n){super(r,nE.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},qVe=class extends CQ{constructor(r,n,o,s,c,l){super(r,nE.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},jVe=class extends CQ{static{a(this,"ExitRequest")}constructor(e){super(e,nE.Exit)}},wP=class extends gIe{constructor(r,n,o){super(nE.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 IBo(t){return"databaseFilePath"in t&&"rootPath"in t}a(IBo,"isIndexableWorkspaceFolder");var Sfn=de(ri()),bQ=require("worker_threads");var HVe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new MVe(e,ufn,dfn,r),this.contextRetreival=new xVe(this.index.reader,lfn)}},c6t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=un(o.rootPath);this.indices.set(s,new HVe(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 Sfn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case nE.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case nE.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case nE.Cancel:n.get(e.id)?.cancel(),s=new wP(e.id,void 0,void 0);break;case nE.Exit:s=await this.dispatchExit(e,r,o.token);break;case nE.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case nE.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case nE.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 wP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=un(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 wP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=un(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 wP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=un(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 wP(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 wP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new HVe(e.databaseFilePath)),new wP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new wP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Tfn(){return a6t(bQ.workerData)}a(Tfn,"isIndexWorker");function Ifn(){let t=bQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!a6t(bQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=bQ.workerData.cwd;process.cwd=()=>e,new c6t(t,bQ.workerData.indexWorkspaceRoots,bQ.workerData.params)}a(Ifn,"runIndexWorker");p();p();var AIe=require("fs"),xfn=require("path");var SQ=class extends Qo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await AIe.promises.readFile(un(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(un(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=un(e),n=await AIe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,xfn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await AIe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await AIe.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 xBo(t){if(t.isCancellationRequested)return;let e=new vA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(xBo,"cancellationTokenToPromise");async function wfn(t,e){if(e){let r=xBo(e);await Promise.race([t,r])}else await t}a(wfn,"raceCancellation");function l6t(t){return Array.isArray(t)}a(l6t,"isArrayOfT");async function Rfn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await u6t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Rfn,"resolveAll");async function u6t(t,e){let r;return t instanceof Promise?r=await wBo(t,e):r=await RBo(t,e),r}a(u6t,"resolve");async function wBo(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:l6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await wfn(o,e),n.resolutionTime=performance.now()-r,n}a(wBo,"resolvePromise");async function RBo(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 wfn(o,e),n.resolutionTime=performance.now()-r,n}a(RBo,"resolveIterable");p();p();var GVe="[...]",kBo=0,PC=-1;function Ef(){return kBo++}a(Ef,"getAvailableNodeId");function PBo(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(PBo,"elideChildren");function kfn(t,e=GVe){return r=>t.tokenLength(PBo(r,e))}a(kfn,"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 DBo(t){let e={id:t.id??Ef(),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??GVe,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(DBo,"createRenderNode");function NBo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(NBo,"isRenderedChildRequired");function Pfn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Pfn,"rectifiedValue");function yIe(t,e){let r=Dfn(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(yIe,"rectifyWeights");function Dfn(t,e){let r=t.children.map(s=>Dfn(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(Dfn,"recursivelyRectifyWeights");function Nfn(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(f6t(t,m,h,g),m.length===0)return d6t(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:Pfn(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,Pfn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(f6t(t,h,m,g),h.length===0)return d6t(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 d6t(t,o)}a(Nfn,"render");function d6t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(d6t,"renderEmpty");function f6t(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=NBo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=f6t(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(f6t,"recursivelyRender");function EIe(t,e,r=GVe){let n=t.children.map(c=>EIe(c,e,r));r=t.elisionMarker??r;let o=e(t);return DBo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(EIe,"snapshot");var xQ={id:Ef(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var RP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var VVe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function MBo(t,e,r=VVe,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=wa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(MBo,"getDirectoryChildren");function OBo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=uf(e);for(;o.startsWith(r);){n.push(o);let s=uf(o);if(s.length>=o.length)break;o=s}return n}a(OBo,"getAncestors");function LBo(t,e,r=VVe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=OBo(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(LBo,"getAncestorWeights");async function*p6t(t,e,r,n,o,s){let c={...VVe,...r},l=c.MaxResults,u=c.Decay,d=LBo(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 MBo(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(p6t,"getNearbyDocuments");var $Ve=class extends RP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=VVe;this.cache=new Pk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of p6t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function o0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(o0,"setDefault");var BBo={MaxActiveSymbols:500,SymbolCacheSize:1e6},WVe=class extends RP{constructor(){super(...arguments);this.config=BBo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Cn(this.config.SymbolCacheSize);this.textSymbols=new Cn(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=o0(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 h6t(l)){let d=o0(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())o0(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&&Mfn(o))}},FBo=/^[a-zA-Z_]{2,}\w+$/;function Mfn(t){return FBo.test(t)}a(Mfn,"isSymbol");function UBo(t){return t.toLowerCase()}a(UBo,"normalizeWord");function*h6t(t){for(let e of t.split(/\W/))Mfn(e)&&(yield UBo(e))}a(h6t,"getTextSymbols");var QBo={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},zVe=class extends WVe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=QBo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new Pk(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 h6t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=o0(this.textSymbols,l,()=>this.createSymbol(!1));o0(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 p6t(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 Ofn(t){return t.nodeId!==void 0}a(Ofn,"isNodeLocation");var Lfn={"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}},YVe=class extends RP{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=Lfn[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)Ofn(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(Ofn(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:PC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=Lfn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};o0(this.eventsByType,r,()=>new Cn(s.maxEventCount)).set(++this.nextId,c)}};p();var KVe=class extends RP{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)??PC,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 qBo(t){return t.id!==void 0}a(qBo,"isNodeItem");function jBo(t){return!("uri"in t)&&!("id"in t)}a(jBo,"isNullItem");var Bfn={"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 Ffn(t){return t in Bfn}a(Ffn,"isSourceId");var wQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",vle=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!==PC),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}},JVe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Bfn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new vle([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new vle(r.items):new vle([])}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(PC);if(l!==void 0&&l>0){s.delete(PC);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 vle(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(jBo(r))return{weight:r.weight,uri:wQ,id:PC};let n=qBo(r)?r.id:PC,o=r.uri??this.activeContext.getUri(n)??wQ;return o===wQ&&(n=PC),{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=o0(r,s,()=>new Map),d=PC;(!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!==wQ?this.activeContext.normalizeUri(u)??wQ:wQ;for(let[h,m]of d.entries())u===wQ||h===PC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(wQ),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:PC,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 m6t=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*Ufn(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=GBo(e,this.document),o=new m6t(Ef(),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;mHBo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function GBo(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(GBo,"buildText");function*Ufn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*Ufn(r,e))}a(Ufn,"walk");p();p();p();var XVe=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 g6t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:g6t(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=g6t(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 XVe(Ef(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(g6t,"recursivelyBuildNode");function Qfn(t){let e=jY(t.getText(),t.detectedLanguageId);return g6t(e,t.lineCount,t)??new XVe(Ef(),e,[],0,t.lineCount-1,t)}a(Qfn,"parse");var eWe={source:"indentation",parse:Qfn,update(t,e){return{root:Qfn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var jfn=de(ale());function qfn(t){return{line:t.row,character:t.column}}a(qfn,"asPosition");var iO=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)}},RQ=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 jfn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return eWe.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:qfn(e.startPosition),end:qfn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var $Bo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),VBo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),WBo=new Set(["identifier"]),zBo=new Set(["string","comment"]),Hfn=new iO($Bo,VBo,WBo,zBo);p();var YBo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),KBo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),JBo=new Set(["identifier"]),ZBo=new Set(["string_literal","line_comment","block_comment"]),Gfn=new iO(YBo,KBo,JBo,ZBo);p();var XBo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),e3o=new Set(["module","block","parameters","dictionary","list"]),t3o=new Set(["identifier"]),r3o=new Set(["string","comment"]),$fn=new iO(XBo,e3o,t3o,r3o);p();var n3o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),i3o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),o3o=new Set(["identifier"]),s3o=new Set(["string","comment"]),Vfn=new iO(n3o,i3o,o3o,s3o);var Wfn=de(ale());async function zfn(t){await Wfn.default.init();try{let e=await b8t(t);switch(t){case"python":return new RQ(e,"tree-sitter-python",$fn);case"typescript":return new RQ(e,"tree-sitter-typescript",Vfn);case"java":return new RQ(e,"tree-sitter-java",Gfn);case"cpp":return new RQ(e,"tree-sitter-cpp",Hfn);default:return new RQ(e,"tree-sitter-generic")}}catch{return eWe}}a(zfn,"getParser");var A6t=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}))}},tWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Yfn=500,rWe=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 Cn(Yfn);this.allowedExtensions=new Set(_Q);this.invalidDocumentCache=new Pk(Yfn,this.config.InvalidCacheTime),this.cachedDocuments=new F9e(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=>C3[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(a7e(e),r=Fs(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(PKr(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 A6t(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 tWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new vA;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 tWe(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 ZVe(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=o0(this.createdNodes,e,()=>new Set),o=o0(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 zfn(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 a3o="WorkspaceContextWorker";function y6t(t){let e=t;return e?.workerId===a3o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(y6t,"isContextWorkerData");var c3o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function Kfn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return c3o.includes(e)?e:void 0}a(Kfn,"getContextMessageType");var kQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();_6t();p();var tpn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(tpn||(tpn={}));var v6t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(v6t||(v6t={}));var rpn;(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})(rpn||(rpn={}));var iWe;(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})(iWe||(iWe={}));var iE;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=iWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=iWe.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})(iE||(iE={}));var mu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:iE.create(n,o),end:iE.create(s,c)};if(iE.is(n)&&iE.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)&&iE.is(o.start)&&iE.is(o.end)}a(r,"is"),t.is=r})(mu||(mu={}));var oWe;(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)&&mu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(oWe||(oWe={}));var npn;(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)&&mu.is(o.targetRange)&&mt.string(o.targetUri)&&mu.is(o.targetSelectionRange)&&(mu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(npn||(npn={}));var C6t;(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})(C6t||(C6t={}));var ipn;(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)&&mu.is(o.range)&&C6t.is(o.color)}a(r,"is"),t.is=r})(ipn||(ipn={}));var opn;(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)||ble.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,ble.is))}a(r,"is"),t.is=r})(opn||(opn={}));var spn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(spn||(spn={}));var apn;(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})(apn||(apn={}));var b6t;(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)&&oWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(b6t||(b6t={}));var cpn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(cpn||(cpn={}));var lpn;(function(t){t.Unnecessary=1,t.Deprecated=2})(lpn||(lpn={}));var upn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(upn||(upn={}));var sWe;(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)&&mu.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,b6t.is))}a(r,"is"),t.is=r})(sWe||(sWe={}));var Cle;(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})(Cle||(Cle={}));var ble;(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)&&mu.is(c.range)}a(o,"is"),t.is=o})(ble||(ble={}));var S6t;(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})(S6t||(S6t={}));var Sle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Sle||(Sle={}));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 ble.is(c)&&(S6t.is(c.annotationId)||Sle.is(c.annotationId))}a(o,"is"),t.is=o})(dpn||(dpn={}));var T6t;(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)&&k6t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(T6t||(T6t={}));var I6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(I6t||(I6t={}));var x6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(x6t||(x6t={}));var w6t;(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||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(w6t||(w6t={}));var R6t;(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)?I6t.is(o)||x6t.is(o)||w6t.is(o):T6t.is(o)))}a(e,"is"),t.is=e})(R6t||(R6t={}));var fpn;(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})(fpn||(fpn={}));var ppn;(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})(ppn||(ppn={}));var k6t;(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})(k6t||(k6t={}));var hpn;(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})(hpn||(hpn={}));var P6t;(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})(P6t||(P6t={}));var _Ie;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&P6t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(_Ie||(_Ie={}));var mpn;(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})(mpn||(mpn={}));var gpn;(function(t){t.PlainText=1,t.Snippet=2})(gpn||(gpn={}));var Apn;(function(t){t.Deprecated=1})(Apn||(Apn={}));var ypn;(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)&&mu.is(o.insert)&&mu.is(o.replace)}a(r,"is"),t.is=r})(ypn||(ypn={}));var Epn;(function(t){t.asIs=1,t.adjustIndentation=2})(Epn||(Epn={}));var _pn;(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})(_pn||(_pn={}));var vpn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(vpn||(vpn={}));var Cpn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Cpn||(Cpn={}));var aWe;(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})(aWe||(aWe={}));var bpn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(_Ie.is(n.contents)||aWe.is(n.contents)||mt.typedArray(n.contents,aWe.is))&&(r.range===void 0||mu.is(r.range))}a(e,"is"),t.is=e})(bpn||(bpn={}));var Spn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(Spn||(Spn={}));var Tpn;(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})(Tpn||(Tpn={}));var Ipn;(function(t){t.Text=1,t.Read=2,t.Write=3})(Ipn||(Ipn={}));var xpn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(xpn||(xpn={}));var wpn;(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})(wpn||(wpn={}));var Rpn;(function(t){t.Deprecated=1})(Rpn||(Rpn={}));var kpn;(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})(kpn||(kpn={}));var Ppn;(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})(Ppn||(Ppn={}));var Dpn;(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)&&mu.is(o.range)&&mu.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})(Dpn||(Dpn={}));var Npn;(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"})(Npn||(Npn={}));var cWe;(function(t){t.Invoked=1,t.Automatic=2})(cWe||(cWe={}));var Mpn;(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,sWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===cWe.Invoked||o.triggerKind===cWe.Automatic)}a(r,"is"),t.is=r})(Mpn||(Mpn={}));var Opn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Cle.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,sWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Cle.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||R6t.is(o.edit))}a(r,"is"),t.is=r})(Opn||(Opn={}));var Lpn;(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)&&mu.is(o.range)&&(mt.undefined(o.command)||Cle.is(o.command))}a(r,"is"),t.is=r})(Lpn||(Lpn={}));var Bpn;(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})(Bpn||(Bpn={}));var Fpn;(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)&&mu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(Fpn||(Fpn={}));var Upn;(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)&&mu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Upn||(Upn={}));var Qpn;(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"})(Qpn||(Qpn={}));var qpn;(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"})(qpn||(qpn={}));var jpn;(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})(jpn||(jpn={}));var Hpn;(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&&mu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(Hpn||(Hpn={}));var Gpn;(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&&mu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(Gpn||(Gpn={}));var $pn;(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&&mu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})($pn||($pn={}));var Vpn;(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)&&mu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Vpn||(Vpn={}));var D6t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(D6t||(D6t={}));var N6t;(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)||_Ie.is(o.tooltip))&&(o.location===void 0||oWe.is(o.location))&&(o.command===void 0||Cle.is(o.command))}a(r,"is"),t.is=r})(N6t||(N6t={}));var Wpn;(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)&&iE.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,N6t.is))&&(o.kind===void 0||D6t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,ble.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||_Ie.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})(Wpn||(Wpn={}));var zpn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(zpn||(zpn={}));var Ypn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(Ypn||(Ypn={}));var Kpn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(Kpn||(Kpn={}));var Jpn;(function(t){t.Invoked=0,t.Automatic=1})(Jpn||(Jpn={}));var Zpn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(Zpn||(Zpn={}));var Xpn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(Xpn||(Xpn={}));var ehn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&v6t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(ehn||(ehn={}));var thn;(function(t){function e(s,c,l,u){return new M6t(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(;f"?").join(", "),o=r?"COLLATE NOCASE ":"";return await this.query([`SELECT * FROM ${Wh.tableName}`,this.innerJoinStatement,`WHERE ${fa.UnqualifiedName} ${o}IN (${n})`].join(` +`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Wh.tableName}`,this.innerJoinStatement,`WHERE ${fa.FullyQualifiedName} = ?`].join(` +`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Wh.tableName}`,this.innerJoinStatement,`WHERE ${S3.tableName}.${NS.FilePath} = ? AND ${Wh.tableName}.${fa.ExtentStart} <= ? AND (${Wh.tableName}.${fa.ExtentStart} + ${Wh.tableName}.${fa.ExtentLength}) >= ?`].join(` +`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Wh.tableName}`,this.innerJoinStatement,`WHERE ${S3.tableName}.${NS.FilePath} = ? AND ${Wh.tableName}.${fa.ExtentStart} >= ? AND (${Wh.tableName}.${fa.ExtentStart} + ${Wh.tableName}.${fa.ExtentLength}) <= ?`,`ORDER BY ${Wh.tableName}.${fa.ExtentStart}`].join(` +`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Wh.tableName}`,this.innerJoinStatement,`WHERE ${S3.tableName}.${NS.FilePath} = ? AND ${Wh.tableName}.${fa.FullyQualifiedName} LIKE ?`,`ORDER BY ${Wh.tableName}.${fa.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,LVe(n,e,r)):[]}};var FVe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new BVe(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 vle(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Ux(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new hu(e.commentStart,e.commentLength),new hu(e.nameStart,e.nameLength),new hu(e.bodyStart,e.bodyLength),new hu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(vle,"symbolsToSymbolRanges");var QVe=de(require("fs/promises"));var UVe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new FVe(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=rs(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await QVe.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 QVe.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 d6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>FBo(r))}a(d6t,"isIndexWorkerData");var EIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},SQ=class extends EIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},qVe=class extends EIe{constructor(r){super(iE.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},iE={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},jVe=class extends SQ{constructor(r,n,o){super(r,iE.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},HVe=class extends SQ{constructor(r,n){super(r,iE.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},GVe=class extends SQ{constructor(r,n,o){super(r,iE.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},$Ve=class extends SQ{constructor(r,n){super(r,iE.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},VVe=class extends SQ{constructor(r,n,o,s,c,l){super(r,iE.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},WVe=class extends SQ{static{a(this,"ExitRequest")}constructor(e){super(e,iE.Exit)}},kP=class extends EIe{constructor(r,n,o){super(iE.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 FBo(t){return"databaseFilePath"in t&&"rootPath"in t}a(FBo,"isIndexableWorkspaceFolder");var Rfn=de(ei()),TQ=require("worker_threads");var zVe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new UVe(e,mfn,gfn,r),this.contextRetreival=new DVe(this.index.reader,hfn)}},f6t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=un(o.rootPath);this.indices.set(s,new zVe(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 Rfn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case iE.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case iE.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case iE.Cancel:n.get(e.id)?.cancel(),s=new kP(e.id,void 0,void 0);break;case iE.Exit:s=await this.dispatchExit(e,r,o.token);break;case iE.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case iE.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case iE.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 kP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=un(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 kP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=un(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 kP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=un(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 kP(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 kP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new zVe(e.databaseFilePath)),new kP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new kP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function kfn(){return d6t(TQ.workerData)}a(kfn,"isIndexWorker");function Pfn(){let t=TQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!d6t(TQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=TQ.workerData.cwd;process.cwd=()=>e,new f6t(t,TQ.workerData.indexWorkspaceRoots,TQ.workerData.params)}a(Pfn,"runIndexWorker");p();p();var _Ie=require("fs"),Dfn=require("path");var IQ=class extends qo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await _Ie.promises.readFile(un(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(un(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=un(e),n=await _Ie.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Dfn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await _Ie.promises.lstat(e);if(r.isSymbolicLink())try{let n=await _Ie.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 UBo(t){if(t.isCancellationRequested)return;let e=new CA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(UBo,"cancellationTokenToPromise");async function Nfn(t,e){if(e){let r=UBo(e);await Promise.race([t,r])}else await t}a(Nfn,"raceCancellation");function p6t(t){return Array.isArray(t)}a(p6t,"isArrayOfT");async function Mfn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await h6t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Mfn,"resolveAll");async function h6t(t,e){let r;return t instanceof Promise?r=await QBo(t,e):r=await qBo(t,e),r}a(h6t,"resolve");async function QBo(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:p6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Nfn(o,e),n.resolutionTime=performance.now()-r,n}a(QBo,"resolvePromise");async function qBo(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 Nfn(o,e),n.resolutionTime=performance.now()-r,n}a(qBo,"resolveIterable");p();p();var YVe="[...]",jBo=0,DC=-1;function vf(){return jBo++}a(vf,"getAvailableNodeId");function HBo(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(HBo,"elideChildren");function Ofn(t,e=YVe){return r=>t.tokenLength(HBo(r,e))}a(Ofn,"getTokenizerCostFunction");p();var wQ=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 GBo(t){let e={id:t.id??vf(),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??YVe,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(GBo,"createRenderNode");function $Bo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a($Bo,"isRenderedChildRequired");function Lfn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Lfn,"rectifiedValue");function vIe(t,e){let r=Bfn(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(vIe,"rectifyWeights");function Bfn(t,e){let r=t.children.map(s=>Bfn(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 wQ([]);let n=new wQ(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(Bfn,"recursivelyRectifyWeights");function Ffn(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(g6t(t,m,h,g),m.length===0)return m6t(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 wQ([{item:t,priority:Lfn(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,Lfn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(g6t(t,h,m,g),h.length===0)return m6t(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 m6t(t,o)}a(Ffn,"render");function m6t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(m6t,"renderEmpty");function g6t(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=$Bo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=g6t(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(g6t,"recursivelyRender");function CIe(t,e,r=YVe){let n=t.children.map(c=>CIe(c,e,r));r=t.elisionMarker??r;let o=e(t);return GBo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(CIe,"snapshot");var RQ={id:vf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var PP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var JVe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function VBo(t,e,r=JVe,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=Ra(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(VBo,"getDirectoryChildren");function WBo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=ff(e);for(;o.startsWith(r);){n.push(o);let s=ff(o);if(s.length>=o.length)break;o=s}return n}a(WBo,"getAncestors");function zBo(t,e,r=JVe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=WBo(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(zBo,"getAncestorWeights");async function*A6t(t,e,r,n,o,s){let c={...JVe,...r},l=c.MaxResults,u=c.Decay,d=zBo(t,e,u),f=new wQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await VBo(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(A6t,"getNearbyDocuments");var KVe=class extends PP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=JVe;this.cache=new Nk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of A6t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function a0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(a0,"setDefault");var YBo={MaxActiveSymbols:500,SymbolCacheSize:1e6},ZVe=class extends PP{constructor(){super(...arguments);this.config=YBo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Cn(this.config.SymbolCacheSize);this.textSymbols=new Cn(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=a0(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 y6t(l)){let d=a0(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())a0(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&&Ufn(o))}},KBo=/^[a-zA-Z_]{2,}\w+$/;function Ufn(t){return KBo.test(t)}a(Ufn,"isSymbol");function JBo(t){return t.toLowerCase()}a(JBo,"normalizeWord");function*y6t(t){for(let e of t.split(/\W/))Ufn(e)&&(yield JBo(e))}a(y6t,"getTextSymbols");var ZBo={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},XVe=class extends ZVe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=ZBo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new Nk(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 y6t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=a0(this.textSymbols,l,()=>this.createSymbol(!1));a0(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 A6t(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 Qfn(t){return t.nodeId!==void 0}a(Qfn,"isNodeLocation");var qfn={"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}},eWe=class extends PP{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=qfn[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)Qfn(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(Qfn(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:DC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=qfn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};a0(this.eventsByType,r,()=>new Cn(s.maxEventCount)).set(++this.nextId,c)}};p();var tWe=class extends PP{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)??DC,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 XBo(t){return t.id!==void 0}a(XBo,"isNodeItem");function e3o(t){return!("uri"in t)&&!("id"in t)}a(e3o,"isNullItem");var jfn={"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 Hfn(t){return t in jfn}a(Hfn,"isSourceId");var kQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",Cle=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!==DC),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}},rWe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=jfn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new Cle([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new Cle(r.items):new Cle([])}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(DC);if(l!==void 0&&l>0){s.delete(DC);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 Cle(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(e3o(r))return{weight:r.weight,uri:kQ,id:DC};let n=XBo(r)?r.id:DC,o=r.uri??this.activeContext.getUri(n)??kQ;return o===kQ&&(n=DC),{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=a0(r,s,()=>new Map),d=DC;(!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!==kQ?this.activeContext.normalizeUri(u)??kQ:kQ;for(let[h,m]of d.entries())u===kQ||h===DC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(kQ),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:DC,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 E6t=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*Gfn(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=r3o(e,this.document),o=new E6t(vf(),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;mt3o}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function r3o(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(r3o,"buildText");function*Gfn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*Gfn(r,e))}a(Gfn,"walk");p();p();p();var iWe=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 _6t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:_6t(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=_6t(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 iWe(vf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(_6t,"recursivelyBuildNode");function $fn(t){let e=VY(t.getText(),t.detectedLanguageId);return _6t(e,t.lineCount,t)??new iWe(vf(),e,[],0,t.lineCount-1,t)}a($fn,"parse");var oWe={source:"indentation",parse:$fn,update(t,e){return{root:$fn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var Wfn=de(cle());function Vfn(t){return{line:t.row,character:t.column}}a(Vfn,"asPosition");var aO=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)}},PQ=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 Wfn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return oWe.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:Vfn(e.startPosition),end:Vfn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var n3o=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),i3o=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),o3o=new Set(["identifier"]),s3o=new Set(["string","comment"]),zfn=new aO(n3o,i3o,o3o,s3o);p();var a3o=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),c3o=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),l3o=new Set(["identifier"]),u3o=new Set(["string_literal","line_comment","block_comment"]),Yfn=new aO(a3o,c3o,l3o,u3o);p();var d3o=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),f3o=new Set(["module","block","parameters","dictionary","list"]),p3o=new Set(["identifier"]),h3o=new Set(["string","comment"]),Kfn=new aO(d3o,f3o,p3o,h3o);p();var m3o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),g3o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),A3o=new Set(["identifier"]),y3o=new Set(["string","comment"]),Jfn=new aO(m3o,g3o,A3o,y3o);var Zfn=de(cle());async function Xfn(t){await Zfn.default.init();try{let e=await x8t(t);switch(t){case"python":return new PQ(e,"tree-sitter-python",Kfn);case"typescript":return new PQ(e,"tree-sitter-typescript",Jfn);case"java":return new PQ(e,"tree-sitter-java",Yfn);case"cpp":return new PQ(e,"tree-sitter-cpp",zfn);default:return new PQ(e,"tree-sitter-generic")}}catch{return oWe}}a(Xfn,"getParser");var v6t=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}))}},sWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},epn=500,aWe=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 Cn(epn);this.allowedExtensions=new Set(CQ);this.invalidDocumentCache=new Nk(epn,this.config.InvalidCacheTime),this.cachedDocuments=new H9e(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=>b3[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(f7e(e),r=Fs(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(LKr(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 v6t(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 sWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new CA;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 sWe(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 nWe(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=a0(this.createdNodes,e,()=>new Set),o=a0(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 Xfn(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 E3o="WorkspaceContextWorker";function C6t(t){let e=t;return e?.workerId===E3o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(C6t,"isContextWorkerData");var _3o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function tpn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return _3o.includes(e)?e:void 0}a(tpn,"getContextMessageType");var DQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();S6t();p();var spn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(spn||(spn={}));var T6t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(T6t||(T6t={}));var apn;(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})(apn||(apn={}));var lWe;(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})(lWe||(lWe={}));var oE;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=lWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=lWe.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})(oE||(oE={}));var mu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:oE.create(n,o),end:oE.create(s,c)};if(oE.is(n)&&oE.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)&&oE.is(o.start)&&oE.is(o.end)}a(r,"is"),t.is=r})(mu||(mu={}));var uWe;(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)&&mu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(uWe||(uWe={}));var cpn;(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)&&mu.is(o.targetRange)&&mt.string(o.targetUri)&&mu.is(o.targetSelectionRange)&&(mu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(cpn||(cpn={}));var I6t;(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})(I6t||(I6t={}));var lpn;(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)&&mu.is(o.range)&&I6t.is(o.color)}a(r,"is"),t.is=r})(lpn||(lpn={}));var upn;(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)||Sle.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,Sle.is))}a(r,"is"),t.is=r})(upn||(upn={}));var dpn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(dpn||(dpn={}));var fpn;(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})(fpn||(fpn={}));var x6t;(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)&&uWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(x6t||(x6t={}));var ppn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(ppn||(ppn={}));var hpn;(function(t){t.Unnecessary=1,t.Deprecated=2})(hpn||(hpn={}));var mpn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(mpn||(mpn={}));var dWe;(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)&&mu.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,x6t.is))}a(r,"is"),t.is=r})(dWe||(dWe={}));var ble;(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})(ble||(ble={}));var Sle;(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)&&mu.is(c.range)}a(o,"is"),t.is=o})(Sle||(Sle={}));var w6t;(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})(w6t||(w6t={}));var Tle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Tle||(Tle={}));var gpn;(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 Sle.is(c)&&(w6t.is(c.annotationId)||Tle.is(c.annotationId))}a(o,"is"),t.is=o})(gpn||(gpn={}));var R6t;(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)&&M6t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(R6t||(R6t={}));var k6t;(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||Tle.is(o.annotationId))}a(r,"is"),t.is=r})(k6t||(k6t={}));var P6t;(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||Tle.is(o.annotationId))}a(r,"is"),t.is=r})(P6t||(P6t={}));var D6t;(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||Tle.is(o.annotationId))}a(r,"is"),t.is=r})(D6t||(D6t={}));var N6t;(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)?k6t.is(o)||P6t.is(o)||D6t.is(o):R6t.is(o)))}a(e,"is"),t.is=e})(N6t||(N6t={}));var Apn;(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})(Apn||(Apn={}));var ypn;(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})(ypn||(ypn={}));var M6t;(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})(M6t||(M6t={}));var Epn;(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})(Epn||(Epn={}));var O6t;(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})(O6t||(O6t={}));var bIe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&O6t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(bIe||(bIe={}));var _pn;(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})(_pn||(_pn={}));var vpn;(function(t){t.PlainText=1,t.Snippet=2})(vpn||(vpn={}));var Cpn;(function(t){t.Deprecated=1})(Cpn||(Cpn={}));var bpn;(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)&&mu.is(o.insert)&&mu.is(o.replace)}a(r,"is"),t.is=r})(bpn||(bpn={}));var Spn;(function(t){t.asIs=1,t.adjustIndentation=2})(Spn||(Spn={}));var Tpn;(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})(Tpn||(Tpn={}));var Ipn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(Ipn||(Ipn={}));var xpn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(xpn||(xpn={}));var fWe;(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})(fWe||(fWe={}));var wpn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(bIe.is(n.contents)||fWe.is(n.contents)||mt.typedArray(n.contents,fWe.is))&&(r.range===void 0||mu.is(r.range))}a(e,"is"),t.is=e})(wpn||(wpn={}));var Rpn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(Rpn||(Rpn={}));var kpn;(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})(kpn||(kpn={}));var Ppn;(function(t){t.Text=1,t.Read=2,t.Write=3})(Ppn||(Ppn={}));var Dpn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(Dpn||(Dpn={}));var Npn;(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})(Npn||(Npn={}));var Mpn;(function(t){t.Deprecated=1})(Mpn||(Mpn={}));var Opn;(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})(Opn||(Opn={}));var Lpn;(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})(Lpn||(Lpn={}));var Bpn;(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)&&mu.is(o.range)&&mu.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})(Bpn||(Bpn={}));var Fpn;(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"})(Fpn||(Fpn={}));var pWe;(function(t){t.Invoked=1,t.Automatic=2})(pWe||(pWe={}));var Upn;(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,dWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===pWe.Invoked||o.triggerKind===pWe.Automatic)}a(r,"is"),t.is=r})(Upn||(Upn={}));var Qpn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):ble.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,dWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||ble.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||N6t.is(o.edit))}a(r,"is"),t.is=r})(Qpn||(Qpn={}));var qpn;(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)&&mu.is(o.range)&&(mt.undefined(o.command)||ble.is(o.command))}a(r,"is"),t.is=r})(qpn||(qpn={}));var jpn;(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})(jpn||(jpn={}));var Hpn;(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)&&mu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(Hpn||(Hpn={}));var Gpn;(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)&&mu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Gpn||(Gpn={}));var $pn;(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"})($pn||($pn={}));var Vpn;(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"})(Vpn||(Vpn={}));var Wpn;(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})(Wpn||(Wpn={}));var zpn;(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&&mu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(zpn||(zpn={}));var Ypn;(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&&mu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(Ypn||(Ypn={}));var Kpn;(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&&mu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(Kpn||(Kpn={}));var Jpn;(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)&&mu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Jpn||(Jpn={}));var L6t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(L6t||(L6t={}));var B6t;(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)||bIe.is(o.tooltip))&&(o.location===void 0||uWe.is(o.location))&&(o.command===void 0||ble.is(o.command))}a(r,"is"),t.is=r})(B6t||(B6t={}));var Zpn;(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)&&oE.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,B6t.is))&&(o.kind===void 0||L6t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,Sle.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||bIe.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})(Zpn||(Zpn={}));var Xpn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(Xpn||(Xpn={}));var ehn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(ehn||(ehn={}));var thn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(thn||(thn={}));var rhn;(function(t){t.Invoked=0,t.Automatic=1})(rhn||(rhn={}));var nhn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(nhn||(nhn={}));var ihn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(ihn||(ihn={}));var ohn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&T6t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(ohn||(ohn={}));var shn;(function(t){function e(s,c,l,u){return new F6t(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 iE.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return iE.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 gu=class{static{a(this,"LocationFactory")}static{this.range=mu.create.bind(mu)}static{this.position=iE.create.bind(iE)}},NS=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=S3.create(e.clientUri,e.clientLanguageId,n,e.getText());return S3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=S3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return S3.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=nO({uri:e,languageId:r})){return new t(Fs(e),S3.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=mu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=mu.create(iE.create(r,0),iE.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var oO=require("worker_threads");var u3o=5,rhn=3e4,O6t=class extends SQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Wi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Fs(n))}getWorkspaceFolder(r){let n=Fs(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:NS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},L6t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new O6t(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 rWe(this.fileSystem,n),this.coordinator=new JVe(this.documentManager,n),this.recentActivityProvider=new YVe,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(!Kfn(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 kQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new kQ(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 ${rhn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},rhn);r=new vA,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 kQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(u6t(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 kQ(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 B6t(){return oO.parentPort!==null&&y6t(oO.workerData)}a(B6t,"isContextWorker");function nhn(){if(!B6t())throw new Error("This must be run in a worker thread.");if(!y6t(oO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(oO.workerData)}`);let t=oO.workerData.cwd;process.cwd=()=>t;let e=new L6t(oO.parentPort,oO.workerData.workspaceRoots,oO.workerData.config);e.addLocalProvider(new $Ve(e.fileSystem,e.documentManager)),e.addLocalProvider(new zVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new KVe)}a(nhn,"runContextWorker");p();var vIe=de(require("util"));function ihn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(MU(t)==="dev")return t.get(qf).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:",vIe.format(...o)))},e.dir=(n,o)=>r(4,vIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(vIe.format(...n));o.name="Trace",e.log(o)},e}a(ihn,"createConsole");p();p();var uWe=de(require("path")),ohn=require("worker_threads");var dWe=new Map,d3o=0;function CIe(t,e){let r=d3o++;dWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,dWe.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(CIe,"registerWorker");function shn(t,e){let r=new ohn.Worker(uWe.default.resolve(f3o(),t),{workerData:e});return CIe(r,t),r}a(shn,"createWorker");function f3o(){return uWe.default.extname(__filename)!==".ts"?__dirname:uWe.default.resolve(__dirname,"../../dist")}a(f3o,"workerBundleDir");function ahn(){return dWe.size}a(ahn,"getActiveWorkerCount");async function chn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of dWe)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(chn,"collectWorkerPerfStats");var fWe=de(require("os")),lhn=de(require("v8"));function p3o(t){let e=Ft(t,Ye.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(p3o,"getPerfState");var GY=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=p3o(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=lhn.getHeapStatistics(),o=this.cpuDelta(),s=ahn(),c=0,l="";try{let u=await chn();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(At(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:fWe.freemem(),systemTotalMemBytes:fWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:IP(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 wk=de(PP()),Zao=require("worker_threads");p();p();var XWe=require("assert");p();p();var IFo={right:PFo,center:DFo},xFo=0,HWe=1,wFo=2,GWe=3,l9t=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&&MS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),MS.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=MS.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>MS.stringWidth(c)&&(f+=" ".repeat(d-MS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=IFo[e[l].align];f=m(f,d),MS.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=MS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=MS.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 oE.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return oE.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 gu=class{static{a(this,"LocationFactory")}static{this.range=mu.create.bind(mu)}static{this.position=oE.create.bind(oE)}},MS=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=T3.create(e.clientUri,e.clientLanguageId,n,e.getText());return T3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=T3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return T3.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=sO({uri:e,languageId:r})){return new t(Fs(e),T3.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=mu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=mu.create(oE.create(r,0),oE.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var cO=require("worker_threads");var C3o=5,ahn=3e4,U6t=class extends IQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Wi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Fs(n))}getWorkspaceFolder(r){let n=Fs(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:MS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},Q6t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new U6t(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 aWe(this.fileSystem,n),this.coordinator=new rWe(this.documentManager,n),this.recentActivityProvider=new eWe,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(!tpn(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 DQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new DQ(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 ${ahn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},ahn);r=new CA,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 DQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(h6t(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 DQ(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 q6t(){return cO.parentPort!==null&&C6t(cO.workerData)}a(q6t,"isContextWorker");function chn(){if(!q6t())throw new Error("This must be run in a worker thread.");if(!C6t(cO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(cO.workerData)}`);let t=cO.workerData.cwd;process.cwd=()=>t;let e=new Q6t(cO.parentPort,cO.workerData.workspaceRoots,cO.workerData.config);e.addLocalProvider(new KVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new XVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new tWe)}a(chn,"runContextWorker");p();var SIe=de(require("util"));function lhn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(LU(t)==="dev")return t.get(Hf).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:",SIe.format(...o)))},e.dir=(n,o)=>r(4,SIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(SIe.format(...n));o.name="Trace",e.log(o)},e}a(lhn,"createConsole");p();p();var mWe=de(require("path")),uhn=require("worker_threads");var gWe=new Map,b3o=0;function TIe(t,e){let r=b3o++;gWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,gWe.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(TIe,"registerWorker");function dhn(t,e){let r=new uhn.Worker(mWe.default.resolve(S3o(),t),{workerData:e});return TIe(r,t),r}a(dhn,"createWorker");function S3o(){return mWe.default.extname(__filename)!==".ts"?__dirname:mWe.default.resolve(__dirname,"../../dist")}a(S3o,"workerBundleDir");function fhn(){return gWe.size}a(fhn,"getActiveWorkerCount");async function phn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of gWe)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(phn,"collectWorkerPerfStats");var AWe=de(require("os")),hhn=de(require("v8"));function T3o(t){let e=Ft(t,Ye.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(T3o,"getPerfState");var zY=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=T3o(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=hhn.getHeapStatistics(),o=this.cpuDelta(),s=fhn(),c=0,l="";try{let u=await phn();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(Rt(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:AWe.freemem(),systemTotalMemBytes:AWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:wP(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 kk=de(NP()),cco=require("worker_threads");p();p();var ize=require("assert");p();p();var FFo={right:HFo,center:GFo},UFo=0,zWe=1,QFo=2,YWe=3,p9t=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&&OS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),OS.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=OS.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>OS.stringWidth(c)&&(f+=" ".repeat(d-OS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=FFo[e[l].align];f=m(f,d),OS.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=OS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=OS.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[xFo]||0).fill("")),o.push(...new Array(s.padding[wFo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||MS.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,RFo(e[l])):c)}};function nmn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(nmn,"addBorder");function RFo(t){let e=t.padding||[],r=1+(e[GWe]||0)+(e[HWe]||0);return t.border?r+4:r}a(RFo,"_minWidth");function kFo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(kFo,"getWindowWidth");function PFo(t,e){t=t.trim();let r=MS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(DFo,"alignCenter");var MS;function imn(t,e){return MS=e,new l9t({width:t?.width||kFo(),wrap:t?.wrap})}a(imn,"cliui");p();p();p();function u9t({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(u9t,"ansiRegex");var NFo=u9t();function zY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(NFo,"")}a(zY,"stripAnsi");p();p();function omn(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(omn,"isAmbiguous");function smn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(smn,"isFullWidth");function amn(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(amn,"isWide");function MFo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(MFo,"validate");function $We(t,{ambiguousAsWide:e=!1}={}){return MFo(t),smn(t)||amn(t)||e&&omn(t)?2:1}a($We,"eastAsianWidth");p();var cmn=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 OFo=new Intl.Segmenter,LFo=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=zY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of OFo.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)&&!LFo.test(c)){if(cmn().test(c)){o+=2;continue}o+=$We(l,s)}}return o}a(T3,"stringWidth");p();p();var lmn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),umn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),dmn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Od={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]}},qLu=Object.keys(Od.modifier),BFo=Object.keys(Od.color),FFo=Object.keys(Od.bgColor),jLu=[...BFo,...FFo];function UFo(){let t=new Map;for(let[e,r]of Object.entries(Od)){for(let[n,o]of Object.entries(r))Od[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Od[n],t.set(o[0],o[1]);Object.defineProperty(Od,e,{value:r,enumerable:!1})}return Object.defineProperty(Od,"codes",{value:t,enumerable:!1}),Od.color.close="\x1B[39m",Od.bgColor.close="\x1B[49m",Od.color.ansi=lmn(),Od.color.ansi256=umn(),Od.color.ansi16m=dmn(),Od.bgColor.ansi=lmn(10),Od.bgColor.ansi256=umn(10),Od.bgColor.ansi16m=dmn(10),Object.defineProperties(Od,{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=>Od.rgbToAnsi256(...Od.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)=>Od.ansi256ToAnsi(Od.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Od.ansi256ToAnsi(Od.hexToAnsi256(e)),"value"),enumerable:!1}}),Od}a(UFo,"assembleStyles");var QFo=UFo(),fmn=QFo;var WWe=new Set(["\x1B","\x9B"]),qFo=39,f9t="\x07",mmn="[",jFo="]",gmn="m",VWe=`${jFo}8;;`,pmn=a(t=>`${WWe.values().next().value}${mmn}${t}${gmn}`,"wrapAnsiCode"),hmn=a(t=>`${WWe.values().next().value}${VWe}${t}${f9t}`,"wrapAnsiHyperlink"),HFo=a(t=>t.split(" ").map(e=>T3(e)),"wordLengths"),d9t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=T3(zY(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),WWe.has(u)&&(o=!0,s=n.slice(l+1,l+1+VWe.length).join("")===VWe),o){s?u===f9t&&(o=!1,s=!1):u===gmn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),GFo=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"),$Fo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=HFo(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){d9t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>GFo(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,WWe.has(m)){let{groups:A}=new RegExp(`(?:\\${mmn}(?\\d+)m|\\${VWe}(?.*)${f9t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===qFo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=fmn.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=hmn("")),o&&g&&(n+=pmn(g))):m===` -`&&(o&&g&&(n+=pmn(o)),s&&(n+=hmn(s))),f+=m.length}return n},"exec");function p9t(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[UFo]||0).fill("")),o.push(...new Array(s.padding[QFo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||OS.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,qFo(e[l])):c)}};function cmn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(cmn,"addBorder");function qFo(t){let e=t.padding||[],r=1+(e[YWe]||0)+(e[zWe]||0);return t.border?r+4:r}a(qFo,"_minWidth");function jFo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(jFo,"getWindowWidth");function HFo(t,e){t=t.trim();let r=OS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(GFo,"alignCenter");var OS;function lmn(t,e){return OS=e,new p9t({width:t?.width||jFo(),wrap:t?.wrap})}a(lmn,"cliui");p();p();p();function h9t({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(h9t,"ansiRegex");var $Fo=h9t();function ZY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace($Fo,"")}a(ZY,"stripAnsi");p();p();function umn(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(umn,"isAmbiguous");function dmn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(dmn,"isFullWidth");function fmn(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(fmn,"isWide");function VFo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(VFo,"validate");function KWe(t,{ambiguousAsWide:e=!1}={}){return VFo(t),dmn(t)||fmn(t)||e&&umn(t)?2:1}a(KWe,"eastAsianWidth");p();var pmn=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 WFo=new Intl.Segmenter,zFo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function I3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=ZY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of WFo.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)&&!zFo.test(c)){if(pmn().test(c)){o+=2;continue}o+=KWe(l,s)}}return o}a(I3,"stringWidth");p();p();var hmn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),mmn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),gmn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Bd={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]}},oBu=Object.keys(Bd.modifier),YFo=Object.keys(Bd.color),KFo=Object.keys(Bd.bgColor),sBu=[...YFo,...KFo];function JFo(){let t=new Map;for(let[e,r]of Object.entries(Bd)){for(let[n,o]of Object.entries(r))Bd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Bd[n],t.set(o[0],o[1]);Object.defineProperty(Bd,e,{value:r,enumerable:!1})}return Object.defineProperty(Bd,"codes",{value:t,enumerable:!1}),Bd.color.close="\x1B[39m",Bd.bgColor.close="\x1B[49m",Bd.color.ansi=hmn(),Bd.color.ansi256=mmn(),Bd.color.ansi16m=gmn(),Bd.bgColor.ansi=hmn(10),Bd.bgColor.ansi256=mmn(10),Bd.bgColor.ansi16m=gmn(10),Object.defineProperties(Bd,{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=>Bd.rgbToAnsi256(...Bd.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)=>Bd.ansi256ToAnsi(Bd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Bd.ansi256ToAnsi(Bd.hexToAnsi256(e)),"value"),enumerable:!1}}),Bd}a(JFo,"assembleStyles");var ZFo=JFo(),Amn=ZFo;var ZWe=new Set(["\x1B","\x9B"]),XFo=39,g9t="\x07",_mn="[",e8o="]",vmn="m",JWe=`${e8o}8;;`,ymn=a(t=>`${ZWe.values().next().value}${_mn}${t}${vmn}`,"wrapAnsiCode"),Emn=a(t=>`${ZWe.values().next().value}${JWe}${t}${g9t}`,"wrapAnsiHyperlink"),t8o=a(t=>t.split(" ").map(e=>I3(e)),"wordLengths"),m9t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=I3(ZY(t.at(-1)));for(let[l,u]of n.entries()){let d=I3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),ZWe.has(u)&&(o=!0,s=n.slice(l+1,l+1+JWe.length).join("")===JWe),o){s?u===g9t&&(o=!1,s=!1):u===vmn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),r8o=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(I3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),n8o=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=t8o(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=I3(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){m9t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>r8o(h)));let u=l.join(` +`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,ZWe.has(m)){let{groups:A}=new RegExp(`(?:\\${_mn}(?\\d+)m|\\${JWe}(?.*)${g9t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===XFo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=Amn.codes.get(Number(o));d[h+1]===` +`?(s&&(n+=Emn("")),o&&g&&(n+=ymn(g))):m===` +`&&(o&&g&&(n+=ymn(o)),s&&(n+=Emn(s))),f+=m.length}return n},"exec");function A9t(t,e,r){return String(t).normalize().replaceAll(`\r `,` `).split(` -`).map(n=>$Fo(n,e,r)).join(` -`)}a(p9t,"wrapAnsi");function h9t(t){return imn(t,{stringWidth:T3,stripAnsi:zY,wrap:p9t})}a(h9t,"ui");p();var wle=require("path"),zWe=require("fs");function m9t(t,e){let r=(0,wle.resolve)(".",t),n;for((0,zWe.statSync)(r).isDirectory()||(r=(0,wle.dirname)(r));;){if(n=e(r,(0,zWe.readdirSync)(r)),n)return(0,wle.resolve)(r,n);if(r=(0,wle.dirname)(n=r),n===r)break}}a(m9t,"default");var Omn=require("util"),I9t=require("url");p();var Cmn=require("util"),ZWe=require("path");p();function YY(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(YWe,"decamelize");function KWe(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(KWe,"looksLikeNumber");p();p();function Amn(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[Z]=ue,E.keys.push(Z))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([Z,ue])=>{typeof ue=="function"&&(E.coercions[Z]=ue,E.keys.push(Z))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(Z){E.configs[Z]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([Z,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[Z]=ue)})),ie(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(Z){(E.aliases[Z]||[]).forEach(function(ue){u[ue]=u[Z]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let Z=0;Z=3&&(H(we[1],E.arrays)?Z=D(Z,we[1],o,we[2]):H(we[1],E.nargs)!==!1?Z=P(Z,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&&(ce=we[1],N(ce,H(ce,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&&(ce=we[1],H(ce,E.arrays)?Z=D(Z,ce,o):H(ce,E.nargs)!==!1?Z=P(Z,ce,o):(Be=o[Z+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(ce,E.bools)&&!H(ce,E.counts)||/^(true|false)$/.test(Be)?(N(ce,Be),Z++):N(ce,ke(ce))));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[Z+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(ce,E.bools)&&!H(ce,E.counts)?(N(ce,Be),Z++):N(ce,ke(ce)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ne=!1;for(let st=0;stZ!=="--"&&Z.includes("-")).forEach(Z=>{delete w[Z]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(Z=>c[Z])).forEach(Z=>{l["camel-case-expansion"]&&Z.includes("-")&&delete w[Z.split(".").map(ue=>YY(ue)).join(".")],delete w[Z]});function x(Z){let ue=q("_",Z);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(Z,ue,qe,ne){let ce,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,ke(ue)),Z;let we=K(ne)?0:1;if(l["nargs-eats-options"])qe.length-(Z+1)+we0&&(N(ue,ne),Be--),ce=Z+1;ce0||we&&typeof we=="number"&&ce.length>=we||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ge(Ne)));Be++)Z=Be,ce.push(B(ue,Ne,s))}return typeof we=="number"&&(we&&ce.length1&&l["dot-notation"]&&(E.aliases[ce[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Be=[].concat(ce);Be.shift(),we=we.concat(Be),(E.aliases[Z]||[]).includes(we.join("."))||z(w,we,ne)}),H(Z,E.normalize)&&!H(Z,E.arrays)&&[Z].concat(E.aliases[Z]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?I3.normalize(Be):Be}})})}a(N,"setArg");function L(Z,ue){E.aliases[Z]&&E.aliases[Z].length||(E.aliases[Z]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||L(ue,Z)}a(L,"addNewAlias");function B(Z,ue,qe){qe&&(ue=WFo(ue)),(H(Z,E.bools)||H(Z,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ne=Array.isArray(ue)?ue.map(function(ce){return q(Z,ce)}):q(Z,ue);return H(Z,E.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=g9t()),H(Z,E.normalize)&&H(Z,E.arrays)&&(Array.isArray(ue)?ne=ue.map(ce=>I3.normalize(ce)):ne=I3.normalize(ue)),ne}a(B,"processValue");function q(Z,ue){return!l["parse-positional-numbers"]&&Z==="_"||!H(Z,E.strings)&&!H(Z,E.bools)&&!Array.isArray(ue)&&(KWe(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(Z,E.numbers))&&(ue=Number(ue)),ue}a(q,"maybeCoerceNumber");function M(Z){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ne=Z[qe]||ue[qe];if(ne)try{let ce=null,Ne=I3.resolve(I3.cwd(),ne),we=E.configs[qe];if(typeof we=="function"){try{ce=we(Ne)}catch(Be){ce=Be}if(ce instanceof Error){b=ce;return}}else ce=I3.require(Ne);O(ce)}catch(ce){ce.name==="PermissionDenied"?b=ce:Z[qe]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(Z,ue){Object.keys(Z).forEach(function(qe){let ne=Z[qe],ce=ue?ue+"."+qe:qe;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,ce):(!V(w,ce.split("."))||H(ce,E.arrays)&&l["combine-arrays"])&&N(ce,ne)})}a(O,"setConfigObject");function j(){typeof d<"u"&&d.forEach(function(Z){O(Z)})}a(j,"setConfigObjects");function Q(Z,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ne=I3.env();Object.keys(ne).forEach(function(ce){if(qe===""||ce.lastIndexOf(qe,0)===0){let Ne=ce.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),YY(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!V(Z,Ne)&&N(Ne.join("."),ne[ce])}})}a(Q,"applyEnvVars");function U(Z){let ue,qe=new Set;Object.keys(Z).forEach(function(ne){if(!qe.has(ne)&&(ue=H(ne,E.coercions),typeof ue=="function"))try{let ce=q(ne,ue(Z[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ne=>{qe.add(Ne),Z[Ne]=ce})}catch(ce){b=ce}})}a(U,"applyCoercions");function Y(Z){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof Z[ue]>"u"&&(Z[ue]=void 0)}),Z}a(Y,"setPlaceholderKeys");function W(Z,ue,qe,ne=!1){Object.keys(qe).forEach(function(ce){V(Z,ce.split("."))||(z(Z,ce.split("."),qe[ce]),ne&&(A[ce]=!0),(ue[ce]||[]).forEach(function(Ne){V(Z,Ne.split("."))||z(Z,Ne.split("."),qe[ce])}))})}a(W,"applyDefaultsAndAliases");function V(Z,ue){let qe=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(ce){qe=qe[ce]||{}});let ne=ue[ue.length-1];return typeof qe!="object"?!1:ne in qe}a(V,"hasKey");function z(Z,ue,qe){let ne=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(rt){rt=ymn(rt),typeof ne=="object"&&ne[rt]===void 0&&(ne[rt]={}),typeof ne[rt]!="object"||Array.isArray(ne[rt])?(Array.isArray(ne[rt])?ne[rt].push({}):ne[rt]=[ne[rt],{}],ne=ne[rt][ne[rt].length-1]):ne=ne[rt]});let ce=ymn(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(ce,E.nargs)&&(Be=!0,(!K(ne[ce])&&E.nargs[ce]===1||Array.isArray(ne[ce])&&ne[ce].length===E.nargs[ce])&&(ne[ce]=void 0)),qe===g9t()?ne[ce]=g9t(ne[ce]):Array.isArray(ne[ce])?Be&&Ne&&we?ne[ce]=l["flatten-duplicate-arrays"]?ne[ce].concat(qe):(Array.isArray(ne[ce][0])?ne[ce]:[ne[ce]]).concat([qe]):!Be&&!!Ne==!!we?ne[ce]=qe:ne[ce]=ne[ce].concat([qe]):ne[ce]===void 0&&Ne?ne[ce]=we?qe:[qe]:Be&&!(ne[ce]===void 0||H(ce,E.counts)||H(ce,E.bools))?ne[ce]=[ne[ce],qe]:ne[ce]=qe}a(z,"setKey");function ie(...Z){Z.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(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ce=YY(ne);ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ce=YWe(ne,"-");ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].forEach(function(ne){E.aliases[ne]=[qe].concat(E.aliases[qe].filter(function(ce){return ne!==ce}))}))})})}a(ie,"extendAliases");function H(Z,ue){let qe=[].concat(E.aliases[Z]||[],Z),ne=Object.keys(ue),ce=qe.find(Ne=>ne.includes(Ne));return ce?ue[ce]:!1}a(H,"checkAllAliases");function re(Z){let ue=Object.keys(E);return[].concat(ue.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(Z):ne[Z]})}a(re,"hasAnyFlag");function le(Z,...ue){return[].concat(...ue).some(function(ne){let ce=Z.match(ne);return ce&&re(ce[1])})}a(le,"hasFlagsMatching");function Le(Z){if(Z.match(_)||!Z.match(/^-[^-]+/))return!1;let ue=!0,qe,ne=Z.slice(1).split("");for(let ce=0;ceH(Z,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",Z)),!0):H(Z,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",Z)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function VFo(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;ozFo,"env"),format:Cmn.format,normalize:ZWe.normalize,resolve:ZWe.resolve,require:a(t=>{if(typeof vmn<"u")return vmn(t);if(t.match(/\.json$/))return JSON.parse((0,bmn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),RIe=a(function(e,r){return Smn.parse(e.slice(),r).argv},"Parser");RIe.detailed=function(t,e){return Smn.parse(t.slice(),e)};RIe.camelCase=YY;RIe.decamelize=YWe;RIe.looksLikeNumber=KWe;var Tmn=RIe;var OS=require("path");p();function YFo(){return KFo()?0:1}a(YFo,"getProcessArgvBinIndex");function KFo(){return JFo()&&!process.defaultApp}a(KFo,"isBundledElectronApp");function JFo(){return!!process.versions.electron}a(JFo,"isElectronApp");function Imn(){return process.argv[YFo()]}a(Imn,"getProcessArgvBin");p();p();p();function v9t({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(v9t,"ansiRegex");var ZFo=v9t();function C9t(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(ZFo,"")}a(C9t,"stripAnsi");p();var xmn=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 XFo=new Intl.Segmenter,e8o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function b9t(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=C9t(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of XFo.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)&&!e8o.test(c)){if(xmn().test(c)){o+=2;continue}o+=$We(l,s)}}return o}a(b9t,"stringWidth");p();p();var Rle=require("fs"),wmn=require("util"),Rmn=require("path");var kmn={fs:{readFileSync:Rle.readFileSync,writeFile:Rle.writeFile},format:wmn.format,resolve:Rmn.resolve,exists:a(t=>{try{return(0,Rle.statSync)(t).isFile()}catch{return!1}},"exists")};p();var DP,S9t=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(),DP.format.apply(DP.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),DP.format.apply(DP.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);DP.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{DP.fs.readFileSync&&(e=JSON.parse(DP.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=DP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=DP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return DP.exists(e)}};function Pmn(t,e){DP=e;let r=new S9t(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(Pmn,"y18n");var t8o=a(t=>Pmn(t,kmn),"y18n"),Dmn=t8o;var Lmn=require("node:module"),Bmn=de(Mmn(),1),eze=require("node:fs");var T9t=(0,I9t.fileURLToPath)(importMetaUrlShim),r8o=T9t.substring(0,T9t.lastIndexOf("node_modules")),n8o=(0,Lmn.createRequire)(importMetaUrlShim),Fmn={assert:{notStrictEqual:XWe.notStrictEqual,strictEqual:XWe.strictEqual},cliui:h9t,findUp:m9t,getEnv:a(t=>process.env[t],"getEnv"),inspect:Omn.inspect,getProcessArgvBin:Imn,mainFilename:r8o||process.cwd(),Parser:Tmn,path:{basename:OS.basename,dirname:OS.dirname,extname:OS.extname,relative:OS.relative,resolve:OS.resolve,join:OS.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:eze.readFileSync,readdirSync:eze.readdirSync,require:n8o,getCallerFile:a(()=>{let t=(0,Bmn.default)(3);return t.match(/^file:\/\//)?(0,I9t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:b9t,y18n:Dmn({directory:(0,OS.resolve)(T9t,"../../../locales"),updateFiles:!1})};p();p();p();function B_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(B_,"assertNotStrictEqual");function x9t(t,e){e.assert.strictEqual(typeof t,"string")}a(x9t,"assertSingleKey");function kle(t){return Object.keys(t)}a(kle,"objectKeys");p();function Ju(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Ju,"isPromise");p();p();p();var Yp=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 MQ(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(MQ,"parseCommand");var i8o=["first","second","third","fourth","fifth","sixth"];function Ln(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[MQ(`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 Yp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=Umn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Qmn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=Umn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Qmn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Ln,"argsert");function Umn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(Umn,"guessType");function Qmn(t,e,r){throw new Yp(`Invalid ${i8o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(Qmn,"argumentTypeError");var tze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Ln(" [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 qmn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(qmn,"commandMiddlewareFactory");function KY(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(Ju(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Ju(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(KY,"applyMiddleware");p();function JY(t,e,r=n=>{throw n}){try{let n=o8o(t)?t():t;return Ju(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(JY,"maybeAsyncResult");function o8o(t){return typeof t=="function"}a(o8o,"isFunction");var Ple=/(^\*)|(^\$0)/,w9t=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=qmn(s);if(o=o||(()=>{}),Array.isArray(e))if(s8o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(c8o(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(jmn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=MQ(e);l=l.map(m=>MQ(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ple.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(Ple,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 Ju(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(rze(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Ju(h))return h.then(m=>(f=Gmn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else a8o(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 Ju(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=Ple.test(r.original)?r.original.replace(Ple,"").trim():r.original,o=e.filter(s=>!Ple.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=JY(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=KY(n,c,l,!1),n=JY(n,f=>{let h=r.handler(f);return Ju(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Ju(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=KY(n,l,d,!0);return Ju(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=MQ(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=Ple.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(rze(r))return r(e,!0);jmn(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;B_(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();B_(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 Hmn(t,e,r,n){return new w9t(t,e,r,n)}a(Hmn,"command");function jmn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(jmn,"isCommandBuilderDefinition");function s8o(t){return t.every(e=>typeof e=="string")}a(s8o,"isCommandAndAliases");function rze(t){return typeof t=="function"}a(rze,"isCommandBuilderCallback");function a8o(t){return typeof t=="object"}a(a8o,"isCommandBuilderOptionDefinitions");function c8o(t){return typeof t=="object"&&!Array.isArray(t)}a(c8o,"isCommandHandlerDefinition");p();p();function OQ(t={},e=()=>!0){let r={};return kle(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(OQ,"objFilter");p();function LQ(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(LQ,"setBlocking");function l8o(t){return typeof t=="boolean"}a(l8o,"isBoolean");function Vmn(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 j=o[O];if(l8o(j)){if(q)throw q;if(B)throw Error(B)}else j(B,q,n)}else{if(t.getExitProcess()&&LQ(!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 Yp(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,j=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([B,q||"",M,O,j])},"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=P(),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(),j=t.getGroups(),Q=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(Q.default)),U=U.filter(R),U=Object.keys(U.reduce((le,Le)=>(Le!=="_"&&(le[Le]=!0),le),{}));let Y=n.getWrap(),W=e.cliui({width:Y,wrap:!!Y});if(!f){if(d.length)d.forEach(le=>{W.div({text:`${le[0].replace(/\$0/g,B)}`}),le[1]&&W.div({text:`${le[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let le=null;M._?le=`${B} <${r("command")}> +`).map(n=>n8o(n,e,r)).join(` +`)}a(A9t,"wrapAnsi");function y9t(t){return lmn(t,{stringWidth:I3,stripAnsi:ZY,wrap:A9t})}a(y9t,"ui");p();var Rle=require("path"),XWe=require("fs");function E9t(t,e){let r=(0,Rle.resolve)(".",t),n;for((0,XWe.statSync)(r).isDirectory()||(r=(0,Rle.dirname)(r));;){if(n=e(r,(0,XWe.readdirSync)(r)),n)return(0,Rle.resolve)(r,n);if(r=(0,Rle.dirname)(n=r),n===r)break}}a(E9t,"default");var Qmn=require("util"),k9t=require("url");p();var xmn=require("util"),nze=require("path");p();function XY(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(eze,"decamelize");function tze(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(tze,"looksLikeNumber");p();p();function Cmn(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[Z]=ue,E.keys.push(Z))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([Z,ue])=>{typeof ue=="function"&&(E.coercions[Z]=ue,E.keys.push(Z))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(Z){E.configs[Z]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([Z,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[Z]=ue)})),ie(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(Z){(E.aliases[Z]||[]).forEach(function(ue){u[ue]=u[Z]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let Z=0;Z=3&&(H(we[1],E.arrays)?Z=D(Z,we[1],o,we[2]):H(we[1],E.nargs)!==!1?Z=P(Z,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&&(ce=we[1],N(ce,H(ce,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&&(ce=we[1],H(ce,E.arrays)?Z=D(Z,ce,o):H(ce,E.nargs)!==!1?Z=P(Z,ce,o):(Be=o[Z+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(ce,E.bools)&&!H(ce,E.counts)||/^(true|false)$/.test(Be)?(N(ce,Be),Z++):N(ce,ke(ce))));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[Z+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(ce,E.bools)&&!H(ce,E.counts)?(N(ce,Be),Z++):N(ce,ke(ce)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Me=ue.slice(1,-1).split(""),ne=!1;for(let st=0;stZ!=="--"&&Z.includes("-")).forEach(Z=>{delete w[Z]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(Z=>c[Z])).forEach(Z=>{l["camel-case-expansion"]&&Z.includes("-")&&delete w[Z.split(".").map(ue=>XY(ue)).join(".")],delete w[Z]});function x(Z){let ue=q("_",Z);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(Z,ue,qe,ne){let ce,Me=H(ue,E.nargs);if(Me=typeof Me!="number"||isNaN(Me)?1:Me,Me===0)return K(ne)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,ke(ue)),Z;let we=K(ne)?0:1;if(l["nargs-eats-options"])qe.length-(Z+1)+we0&&(N(ue,ne),Be--),ce=Z+1;ce0||we&&typeof we=="number"&&ce.length>=we||(Me=qe[Be],/^-/.test(Me)&&!_.test(Me)&&!ge(Me)));Be++)Z=Be,ce.push(B(ue,Me,s))}return typeof we=="number"&&(we&&ce.length1&&l["dot-notation"]&&(E.aliases[ce[0]]||[]).forEach(function(Me){let we=Me.split("."),Be=[].concat(ce);Be.shift(),we=we.concat(Be),(E.aliases[Z]||[]).includes(we.join("."))||z(w,we,ne)}),H(Z,E.normalize)&&!H(Z,E.arrays)&&[Z].concat(E.aliases[Z]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?x3.normalize(Be):Be}})})}a(N,"setArg");function L(Z,ue){E.aliases[Z]&&E.aliases[Z].length||(E.aliases[Z]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||L(ue,Z)}a(L,"addNewAlias");function B(Z,ue,qe){qe&&(ue=o8o(ue)),(H(Z,E.bools)||H(Z,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ne=Array.isArray(ue)?ue.map(function(ce){return q(Z,ce)}):q(Z,ue);return H(Z,E.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=_9t()),H(Z,E.normalize)&&H(Z,E.arrays)&&(Array.isArray(ue)?ne=ue.map(ce=>x3.normalize(ce)):ne=x3.normalize(ue)),ne}a(B,"processValue");function q(Z,ue){return!l["parse-positional-numbers"]&&Z==="_"||!H(Z,E.strings)&&!H(Z,E.bools)&&!Array.isArray(ue)&&(tze(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(Z,E.numbers))&&(ue=Number(ue)),ue}a(q,"maybeCoerceNumber");function M(Z){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ne=Z[qe]||ue[qe];if(ne)try{let ce=null,Me=x3.resolve(x3.cwd(),ne),we=E.configs[qe];if(typeof we=="function"){try{ce=we(Me)}catch(Be){ce=Be}if(ce instanceof Error){b=ce;return}}else ce=x3.require(Me);O(ce)}catch(ce){ce.name==="PermissionDenied"?b=ce:Z[qe]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(Z,ue){Object.keys(Z).forEach(function(qe){let ne=Z[qe],ce=ue?ue+"."+qe:qe;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,ce):(!V(w,ce.split("."))||H(ce,E.arrays)&&l["combine-arrays"])&&N(ce,ne)})}a(O,"setConfigObject");function j(){typeof d<"u"&&d.forEach(function(Z){O(Z)})}a(j,"setConfigObjects");function Q(Z,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ne=x3.env();Object.keys(ne).forEach(function(ce){if(qe===""||ce.lastIndexOf(qe,0)===0){let Me=ce.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),XY(we)});(ue&&E.configs[Me.join(".")]||!ue)&&!V(Z,Me)&&N(Me.join("."),ne[ce])}})}a(Q,"applyEnvVars");function U(Z){let ue,qe=new Set;Object.keys(Z).forEach(function(ne){if(!qe.has(ne)&&(ue=H(ne,E.coercions),typeof ue=="function"))try{let ce=q(ne,ue(Z[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Me=>{qe.add(Me),Z[Me]=ce})}catch(ce){b=ce}})}a(U,"applyCoercions");function Y(Z){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof Z[ue]>"u"&&(Z[ue]=void 0)}),Z}a(Y,"setPlaceholderKeys");function W(Z,ue,qe,ne=!1){Object.keys(qe).forEach(function(ce){V(Z,ce.split("."))||(z(Z,ce.split("."),qe[ce]),ne&&(A[ce]=!0),(ue[ce]||[]).forEach(function(Me){V(Z,Me.split("."))||z(Z,Me.split("."),qe[ce])}))})}a(W,"applyDefaultsAndAliases");function V(Z,ue){let qe=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(ce){qe=qe[ce]||{}});let ne=ue[ue.length-1];return typeof qe!="object"?!1:ne in qe}a(V,"hasKey");function z(Z,ue,qe){let ne=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(rt){rt=bmn(rt),typeof ne=="object"&&ne[rt]===void 0&&(ne[rt]={}),typeof ne[rt]!="object"||Array.isArray(ne[rt])?(Array.isArray(ne[rt])?ne[rt].push({}):ne[rt]=[ne[rt],{}],ne=ne[rt][ne[rt].length-1]):ne=ne[rt]});let ce=bmn(ue[ue.length-1]),Me=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(ce,E.nargs)&&(Be=!0,(!K(ne[ce])&&E.nargs[ce]===1||Array.isArray(ne[ce])&&ne[ce].length===E.nargs[ce])&&(ne[ce]=void 0)),qe===_9t()?ne[ce]=_9t(ne[ce]):Array.isArray(ne[ce])?Be&&Me&&we?ne[ce]=l["flatten-duplicate-arrays"]?ne[ce].concat(qe):(Array.isArray(ne[ce][0])?ne[ce]:[ne[ce]]).concat([qe]):!Be&&!!Me==!!we?ne[ce]=qe:ne[ce]=ne[ce].concat([qe]):ne[ce]===void 0&&Me?ne[ce]=we?qe:[qe]:Be&&!(ne[ce]===void 0||H(ce,E.counts)||H(ce,E.bools))?ne[ce]=[ne[ce],qe]:ne[ce]=qe}a(z,"setKey");function ie(...Z){Z.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(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ce=XY(ne);ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ce=eze(ne,"-");ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].forEach(function(ne){E.aliases[ne]=[qe].concat(E.aliases[qe].filter(function(ce){return ne!==ce}))}))})})}a(ie,"extendAliases");function H(Z,ue){let qe=[].concat(E.aliases[Z]||[],Z),ne=Object.keys(ue),ce=qe.find(Me=>ne.includes(Me));return ce?ue[ce]:!1}a(H,"checkAllAliases");function re(Z){let ue=Object.keys(E);return[].concat(ue.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(Z):ne[Z]})}a(re,"hasAnyFlag");function le(Z,...ue){return[].concat(...ue).some(function(ne){let ce=Z.match(ne);return ce&&re(ce[1])})}a(le,"hasFlagsMatching");function Le(Z){if(Z.match(_)||!Z.match(/^-[^-]+/))return!1;let ue=!0,qe,ne=Z.slice(1).split("");for(let ce=0;ceH(Z,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",Z)),!0):H(Z,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",Z)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function i8o(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;os8o,"env"),format:xmn.format,normalize:nze.normalize,resolve:nze.resolve,require:a(t=>{if(typeof Imn<"u")return Imn(t);if(t.match(/\.json$/))return JSON.parse((0,wmn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),DIe=a(function(e,r){return Rmn.parse(e.slice(),r).argv},"Parser");DIe.detailed=function(t,e){return Rmn.parse(t.slice(),e)};DIe.camelCase=XY;DIe.decamelize=eze;DIe.looksLikeNumber=tze;var kmn=DIe;var LS=require("path");p();function a8o(){return c8o()?0:1}a(a8o,"getProcessArgvBinIndex");function c8o(){return l8o()&&!process.defaultApp}a(c8o,"isBundledElectronApp");function l8o(){return!!process.versions.electron}a(l8o,"isElectronApp");function Pmn(){return process.argv[a8o()]}a(Pmn,"getProcessArgvBin");p();p();p();function T9t({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(T9t,"ansiRegex");var u8o=T9t();function I9t(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(u8o,"")}a(I9t,"stripAnsi");p();var Dmn=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 d8o=new Intl.Segmenter,f8o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function x9t(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=I9t(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of d8o.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)&&!f8o.test(c)){if(Dmn().test(c)){o+=2;continue}o+=KWe(l,s)}}return o}a(x9t,"stringWidth");p();p();var kle=require("fs"),Nmn=require("util"),Mmn=require("path");var Omn={fs:{readFileSync:kle.readFileSync,writeFile:kle.writeFile},format:Nmn.format,resolve:Mmn.resolve,exists:a(t=>{try{return(0,kle.statSync)(t).isFile()}catch{return!1}},"exists")};p();var MP,w9t=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(),MP.format.apply(MP.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),MP.format.apply(MP.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);MP.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{MP.fs.readFileSync&&(e=JSON.parse(MP.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=MP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=MP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return MP.exists(e)}};function Lmn(t,e){MP=e;let r=new w9t(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(Lmn,"y18n");var p8o=a(t=>Lmn(t,Omn),"y18n"),Bmn=p8o;var qmn=require("node:module"),jmn=de(Umn(),1),oze=require("node:fs");var R9t=(0,k9t.fileURLToPath)(importMetaUrlShim),h8o=R9t.substring(0,R9t.lastIndexOf("node_modules")),m8o=(0,qmn.createRequire)(importMetaUrlShim),Hmn={assert:{notStrictEqual:ize.notStrictEqual,strictEqual:ize.strictEqual},cliui:y9t,findUp:E9t,getEnv:a(t=>process.env[t],"getEnv"),inspect:Qmn.inspect,getProcessArgvBin:Pmn,mainFilename:h8o||process.cwd(),Parser:kmn,path:{basename:LS.basename,dirname:LS.dirname,extname:LS.extname,relative:LS.relative,resolve:LS.resolve,join:LS.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:oze.readFileSync,readdirSync:oze.readdirSync,require:m8o,getCallerFile:a(()=>{let t=(0,jmn.default)(3);return t.match(/^file:\/\//)?(0,k9t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:x9t,y18n:Bmn({directory:(0,LS.resolve)(R9t,"../../../locales"),updateFiles:!1})};p();p();p();function F_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(F_,"assertNotStrictEqual");function P9t(t,e){e.assert.strictEqual(typeof t,"string")}a(P9t,"assertSingleKey");function Ple(t){return Object.keys(t)}a(Ple,"objectKeys");p();function Zu(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Zu,"isPromise");p();p();p();var Jp=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 LQ(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(LQ,"parseCommand");var g8o=["first","second","third","fourth","fifth","sixth"];function Ln(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[LQ(`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 Jp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=Gmn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&$mn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=Gmn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&$mn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Ln,"argsert");function Gmn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(Gmn,"guessType");function $mn(t,e,r){throw new Jp(`Invalid ${g8o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a($mn,"argumentTypeError");var sze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Ln(" [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 Vmn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(Vmn,"commandMiddlewareFactory");function eK(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(Zu(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Zu(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(eK,"applyMiddleware");p();function tK(t,e,r=n=>{throw n}){try{let n=A8o(t)?t():t;return Zu(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(tK,"maybeAsyncResult");function A8o(t){return typeof t=="function"}a(A8o,"isFunction");var Dle=/(^\*)|(^\$0)/,D9t=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=Vmn(s);if(o=o||(()=>{}),Array.isArray(e))if(y8o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(_8o(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(Wmn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=LQ(e);l=l.map(m=>LQ(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Dle.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(Dle,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 Zu(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(aze(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Zu(h))return h.then(m=>(f=Ymn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else E8o(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 Zu(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=Dle.test(r.original)?r.original.replace(Dle,"").trim():r.original,o=e.filter(s=>!Dle.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=tK(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=eK(n,c,l,!1),n=tK(n,f=>{let h=r.handler(f);return Zu(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Zu(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=eK(n,l,d,!0);return Zu(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=LQ(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=Dle.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(aze(r))return r(e,!0);Wmn(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;F_(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();F_(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 zmn(t,e,r,n){return new D9t(t,e,r,n)}a(zmn,"command");function Wmn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(Wmn,"isCommandBuilderDefinition");function y8o(t){return t.every(e=>typeof e=="string")}a(y8o,"isCommandAndAliases");function aze(t){return typeof t=="function"}a(aze,"isCommandBuilderCallback");function E8o(t){return typeof t=="object"}a(E8o,"isCommandBuilderOptionDefinitions");function _8o(t){return typeof t=="object"&&!Array.isArray(t)}a(_8o,"isCommandHandlerDefinition");p();p();function BQ(t={},e=()=>!0){let r={};return Ple(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(BQ,"objFilter");p();function FQ(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(FQ,"setBlocking");function v8o(t){return typeof t=="boolean"}a(v8o,"isBoolean");function Jmn(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 j=o[O];if(v8o(j)){if(q)throw q;if(B)throw Error(B)}else j(B,q,n)}else{if(t.getExitProcess()&&FQ(!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 Jp(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,j=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([B,q||"",M,O,j])},"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=P(),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(),j=t.getGroups(),Q=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(Q.default)),U=U.filter(R),U=Object.keys(U.reduce((le,Le)=>(Le!=="_"&&(le[Le]=!0),le),{}));let Y=n.getWrap(),W=e.cliui({width:Y,wrap:!!Y});if(!f){if(d.length)d.forEach(le=>{W.div({text:`${le[0].replace(/\$0/g,B)}`}),le[1]&&W.div({text:`${le[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let le=null;M._?le=`${B} <${r("command")}> `:le=`${B} [${r("command")}] -`,W.div(`${le}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let le=t.getInternalMethods().getContext(),Le=le.commands.length?`${le.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Ue,ke)=>Ue[0].localeCompare(ke[0])));let ge=B?`${B} `:"";m.forEach(Ue=>{let ke=`${ge}${Le}${Ue[0].replace(/^\$0 ?/,"")}`;W.span({text:ke,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Ue[1]});let X=[];Ue[2]&&X.push(`[${r("default")}]`),Ue[3]&&Ue[3].length&&X.push(`[${r("aliases:")} ${Ue[3].join(", ")}]`),Ue[4]&&(typeof Ue[4]=="string"?X.push(`[${r("deprecated: %s",Ue[4])}]`):X.push(`[${r("deprecated")}]`)),X.length?W.div({text:X.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(Q.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");j[z]||(j[z]=[]),w(U,Q.alias,j,z);let ie=a(le=>/^--/.test(nze(le)),"isLongSwitch"),H=Object.keys(j).filter(le=>j[le].length>0).map(le=>{let Le=j[le].filter(R).map(ge=>{if(V.includes(ge))return ge;for(let Ue=0,ke;(ke=V[Ue])!==void 0;Ue++)if((Q.alias[ke]||[]).includes(ge))return ke;return ge});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let ge=Le.reduce((Ue,ke)=>(Ue[ke]=[ke].concat(Q.alias[ke]||[]).map(X=>le===n.getPositionalGroupName()?X:(/^[0-9]$/.test(X)?Q.boolean.includes(ke)?"-":"--":X.length>1?"--":"-")+X).sort((X,ee)=>ie(X)===ie(ee)?0:ie(X)?1:-1).join(", "),Ue),{});return{groupName:le,normalizedKeys:Le,switches:ge}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(ge=>ie(Le[ge])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(ge=>{ie(Le[ge])&&(Le[ge]=u8o(Le[ge],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:ge})=>{W.div(le),Le.forEach(Ue=>{let ke=ge[Ue],X=g[Ue]||"",ee=null;X.includes(_)&&(X=r(X.substring(_.length))),Q.boolean.includes(Ue)&&(ee=`[${r("boolean")}]`),Q.count.includes(Ue)&&(ee=`[${r("count")}]`),Q.string.includes(Ue)&&(ee=`[${r("string")}]`),Q.normalize.includes(Ue)&&(ee=`[${r("string")}]`),Q.array.includes(Ue)&&(ee=`[${r("array")}]`),Q.number.includes(Ue)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Ue in O?K(O[Ue]):null,ee,Ue in q?`[${r("required")}]`:null,Q.choices&&Q.choices[Ue]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Ue])}]`:null,x(Q.default[Ue],Q.defaultDescription[Ue])].filter(Boolean).join(" ");W.span({text:nze(ke),padding:[0,2,0,2+$mn(ke)],width:v(ge,Y)+4},X);let Z=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!Z?W.div({text:he,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(le=>{le[0]=le[0].replace(/\$0/g,B)}),h.forEach(le=>{le[1]===""?W.div({text:le[0],padding:[0,2,0,2]}):W.div({text:le[0],padding:[0,2,0,2],width:v(h,Y)+4},{text:le[1]})}),W.div()),A.length>0){let le=A.map(Le=>Le.replace(/\$0/g,B)).join(` +`,W.div(`${le}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let le=t.getInternalMethods().getContext(),Le=le.commands.length?`${le.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Ue,ke)=>Ue[0].localeCompare(ke[0])));let ge=B?`${B} `:"";m.forEach(Ue=>{let ke=`${ge}${Le}${Ue[0].replace(/^\$0 ?/,"")}`;W.span({text:ke,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Ue[1]});let X=[];Ue[2]&&X.push(`[${r("default")}]`),Ue[3]&&Ue[3].length&&X.push(`[${r("aliases:")} ${Ue[3].join(", ")}]`),Ue[4]&&(typeof Ue[4]=="string"?X.push(`[${r("deprecated: %s",Ue[4])}]`):X.push(`[${r("deprecated")}]`)),X.length?W.div({text:X.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(Q.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");j[z]||(j[z]=[]),w(U,Q.alias,j,z);let ie=a(le=>/^--/.test(cze(le)),"isLongSwitch"),H=Object.keys(j).filter(le=>j[le].length>0).map(le=>{let Le=j[le].filter(R).map(ge=>{if(V.includes(ge))return ge;for(let Ue=0,ke;(ke=V[Ue])!==void 0;Ue++)if((Q.alias[ke]||[]).includes(ge))return ke;return ge});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let ge=Le.reduce((Ue,ke)=>(Ue[ke]=[ke].concat(Q.alias[ke]||[]).map(X=>le===n.getPositionalGroupName()?X:(/^[0-9]$/.test(X)?Q.boolean.includes(ke)?"-":"--":X.length>1?"--":"-")+X).sort((X,ee)=>ie(X)===ie(ee)?0:ie(X)?1:-1).join(", "),Ue),{});return{groupName:le,normalizedKeys:Le,switches:ge}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(ge=>ie(Le[ge])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(ge=>{ie(Le[ge])&&(Le[ge]=C8o(Le[ge],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:ge})=>{W.div(le),Le.forEach(Ue=>{let ke=ge[Ue],X=g[Ue]||"",ee=null;X.includes(_)&&(X=r(X.substring(_.length))),Q.boolean.includes(Ue)&&(ee=`[${r("boolean")}]`),Q.count.includes(Ue)&&(ee=`[${r("count")}]`),Q.string.includes(Ue)&&(ee=`[${r("string")}]`),Q.normalize.includes(Ue)&&(ee=`[${r("string")}]`),Q.array.includes(Ue)&&(ee=`[${r("array")}]`),Q.number.includes(Ue)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Ue in O?K(O[Ue]):null,ee,Ue in q?`[${r("required")}]`:null,Q.choices&&Q.choices[Ue]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Ue])}]`:null,x(Q.default[Ue],Q.defaultDescription[Ue])].filter(Boolean).join(" ");W.span({text:cze(ke),padding:[0,2,0,2+Kmn(ke)],width:v(ge,Y)+4},X);let Z=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!Z?W.div({text:he,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(le=>{le[0]=le[0].replace(/\$0/g,B)}),h.forEach(le=>{le[1]===""?W.div({text:le[0],padding:[0,2,0,2]}):W.div({text:le[0],padding:[0,2,0,2],width:v(h,Y)+4},{text:le[1]})}),W.div()),A.length>0){let le=A.map(Le=>Le.replace(/\$0/g,B)).join(` `);W.div(`${le} -`)}return W.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} ${nze(O[0])}`:nze(O[0]))+$mn(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=[],j=null;return Object.keys(q).forEach(Q=>{O=O.concat(q[Q])}),L.forEach(Q=>{j=[Q].concat(B[Q]),j.some(U=>O.indexOf(U)!==-1)||q[M].push(Q)}),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||", ",j=[].concat(B);return!B||!j.length||j.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),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 P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"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=OQ(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(Vmn,"usage");function R9t(t){return typeof t=="object"}a(R9t,"isIndentedText");function u8o(t,e){return R9t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(u8o,"addIndentation");function $mn(t){return R9t(t)?t.indentation:0}a($mn,"getIndentation");function nze(t){return R9t(t)?t.text:t}a(nze,"getText");p();p();var Wmn=`###-begin-{{app_name}}-completions-### +`)}return W.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} ${cze(O[0])}`:cze(O[0]))+Kmn(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=[],j=null;return Object.keys(q).forEach(Q=>{O=O.concat(q[Q])}),L.forEach(Q=>{j=[Q].concat(B[Q]),j.some(U=>O.indexOf(U)!==-1)||q[M].push(Q)}),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||", ",j=[].concat(B);return!B||!j.length||j.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),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 P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"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=BQ(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(Jmn,"usage");function N9t(t){return typeof t=="object"}a(N9t,"isIndentedText");function C8o(t,e){return N9t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(C8o,"addIndentation");function Kmn(t){return N9t(t)?t.indentation:0}a(Kmn,"getIndentation");function cze(t){return N9t(t)?t.text:t}a(cze,"getText");p();p();var Zmn=`###-begin-{{app_name}}-completions-### # # yargs command completion script # @@ -2300,7 +2300,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,zmn=`#compdef {{app_name}} +`,Xmn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2327,68 +2327,68 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var k9t=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=MQ(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(B_(this.customCompletionFunction,null,this.shim),f8o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Ju(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 p8o(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 Ju(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?zmn:Wmn,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 Ymn(t,e,r,n){return new k9t(t,e,r,n)}a(Ymn,"completion");function f8o(t){return t.length<3}a(f8o,"isSyncCompletionFunction");function p8o(t){return t.length>3}a(p8o,"isFallbackCompletionFunction");p();p();function Kmn(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(Kmn,"levenshtein");var Jmn=["$0","--","_"];function Zmn(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 M9t=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=LQ(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(F_(this.customCompletionFunction,null,this.shim),S8o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Zu(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 T8o(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 Zu(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?Xmn:Zmn,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 e0n(t,e,r,n){return new M9t(t,e,r,n)}a(e0n,"completion");function S8o(t){return t.length<3}a(S8o,"isSyncCompletionFunction");function T8o(t){return t.length>3}a(T8o,"isFallbackCompletionFunction");p();p();function t0n(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(t0n,"levenshtein");var r0n=["$0","--","_"];function n0n(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=>{!Jmn.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=>{Jmn.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){Ln(" [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)):(B_(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){Ln(" [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=Kmn(h,_);v<=3&&v!h[m]),u=OQ(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();B_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Zmn,"validation");p();var g8o={};var P9t=[],kIe;function ize(t,e,r,n){kIe=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=m8o(e,t.extends);else try{c=g8o.resolve(t.extends)}catch{return t}h8o(c),P9t.push(c),o=s?JSON.parse(kIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=ize(o,kIe.path.dirname(c),r,kIe)}return P9t=[],r?Xmn(o,t):Object.assign({},o,t)}a(ize,"applyExtends");function h8o(t){if(P9t.indexOf(t)>-1)throw new Yp(`Circular extended configurations: '${t}'.`)}a(h8o,"checkForCircularExtends");function m8o(t,e){return kIe.path.resolve(t,e)}a(m8o,"getPathToDefaultConfig");function Xmn(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]=Xmn(t[o],e[o]):r[o]=e[o];return r}a(Xmn,"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},Pe=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)},Kp,ZY,PIe,NC,LS,oze,BQ,XY,sze,Hx,aze,Gx,sO,BS,$x,cze,eK,cg,ni,lze,uze,FS,tK,Dle,rK,FQ,dze,Yi,nK,iK,oK,go,fze,aO,Zf;function E0n(t){return(e=[],r=t.process.cwd(),n)=>{let o=new j9t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(E0n,"YargsFactory");var e0n=Symbol("copyDoubleDash"),t0n=Symbol("copyDoubleDash"),D9t=Symbol("deleteFromParserHintObject"),r0n=Symbol("emitWarning"),n0n=Symbol("freeze"),i0n=Symbol("getDollarZero"),sK=Symbol("getParserConfiguration"),o0n=Symbol("getUsageConfiguration"),N9t=Symbol("guessLocale"),s0n=Symbol("guessVersion"),a0n=Symbol("parsePositionalNumbers"),M9t=Symbol("pkgUp"),UQ=Symbol("populateParserHintArray"),Nle=Symbol("populateParserHintSingleValueDictionary"),O9t=Symbol("populateParserHintArrayDictionary"),L9t=Symbol("populateParserHintDictionary"),B9t=Symbol("sanitizeKey"),F9t=Symbol("setKey"),U9t=Symbol("unfreeze"),c0n=Symbol("validateAsync"),l0n=Symbol("getCommandInstance"),u0n=Symbol("getContext"),d0n=Symbol("getHasOutput"),f0n=Symbol("getLoggerInstance"),p0n=Symbol("getParseContext"),h0n=Symbol("getUsageInstance"),m0n=Symbol("getValidationInstance"),pze=Symbol("hasParseCallback"),g0n=Symbol("isGlobalContext"),aK=Symbol("postProcess"),A0n=Symbol("rebase"),Q9t=Symbol("reset"),DIe=Symbol("runYargsParserAndExecuteCommands"),q9t=Symbol("runValidation"),y0n=Symbol("setHasOutput"),cK=Symbol("kTrackManuallySetKeys"),A8o="en_US",j9t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Kp.set(this,void 0),ZY.set(this,void 0),PIe.set(this,{commands:[],fullCommands:[]}),NC.set(this,null),LS.set(this,null),oze.set(this,"show-hidden"),BQ.set(this,null),XY.set(this,!0),sze.set(this,{}),Hx.set(this,!0),aze.set(this,[]),Gx.set(this,void 0),sO.set(this,{}),BS.set(this,!1),$x.set(this,null),cze.set(this,!0),eK.set(this,void 0),cg.set(this,""),ni.set(this,void 0),lze.set(this,void 0),uze.set(this,{}),FS.set(this,null),tK.set(this,null),Dle.set(this,{}),rK.set(this,{}),FQ.set(this,void 0),dze.set(this,!1),Yi.set(this,void 0),nK.set(this,!1),iK.set(this,!1),oK.set(this,!1),go.set(this,void 0),fze.set(this,{}),aO.set(this,null),Zf.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,FQ,e,"f"),Bn(this,ZY,r,"f"),Bn(this,lze,n,"f"),Bn(this,Gx,new tze(this),"f"),this.$0=this[i0n](),this[Q9t](),Bn(this,Kp,Pe(this,Kp,"f"),"f"),Bn(this,go,Pe(this,go,"f"),"f"),Bn(this,Zf,Pe(this,Zf,"f"),"f"),Bn(this,ni,Pe(this,ni,"f"),"f"),Pe(this,ni,"f").showHiddenOpt=Pe(this,oze,"f"),Bn(this,eK,this[t0n](),"f"),Pe(this,Yi,"f").y18n.setLocale(A8o)}addHelpOpt(e,r){let n="help";return Ln("[string|boolean] [string]",[e,r],arguments.length),Pe(this,$x,"f")&&(this[D9t](Pe(this,$x,"f")),Bn(this,$x,null,"f")),e===!1&&r===void 0?this:(Bn(this,$x,typeof e=="string"?e:n,"f"),this.boolean(Pe(this,$x,"f")),this.describe(Pe(this,$x,"f"),r||Pe(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Ln("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Pe(this,oze,"f");return this.boolean(n),this.describe(n,r||Pe(this,go,"f").deferY18nLookup("Show hidden options")),Pe(this,ni,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[O9t](this.alias.bind(this),"alias",e,r),this}array(e){return Ln("",[e],arguments.length),this[UQ]("array",e),this[cK](e),this}boolean(e){return Ln("",[e],arguments.length),this[UQ]("boolean",e),this[cK](e),this}check(e,r){return Ln(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>JY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Pe(this,go,"f").fail(s.toString(),s):Pe(this,go,"f").fail(Pe(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Pe(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[O9t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Ln(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Yp("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 Yp("coerce callback must be provided");let n=e;return Pe(this,ni,"f").key[n]=!0,Pe(this,Gx,"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:JY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Yp(d.message)})},n),this}conflicts(e,r){return Ln(" [string|array]",[e,r],arguments.length),Pe(this,Zf,"f").conflicts(e,r),this}config(e="config",r,n){return Ln("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=ize(e,Pe(this,ZY,"f"),this[sK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Pe(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Pe(this,ni,"f").config[o]=n||!0}),this)}completion(e,r,n){return Ln("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,LS,e||Pe(this,LS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Pe(this,LS,"f"),r),n&&Pe(this,NC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Ln(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Pe(this,Kp,"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){Ln(" [object]",[e,r],arguments.length);let n=Pe(this,lze,"f")||Pe(this,Yi,"f").require;return Pe(this,Kp,"f").addDirectory(e,n,Pe(this,Yi,"f").getCallerFile(),r),this}count(e){return Ln("",[e],arguments.length),this[UQ]("count",e),this[cK](e),this}default(e,r,n){return Ln(" [*] [string]",[e,r,n],arguments.length),n&&(x9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]=n),typeof r=="function"&&(x9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]||(Pe(this,ni,"f").defaultDescription[e]=Pe(this,go,"f").functionDescription(r)),r=r.call()),this[Nle](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 Ln("[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),Pe(this,ni,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{B_(n,!0,Pe(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(B_(n,!0,Pe(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{B_(n,!0,Pe(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 Ln(" [string]",[e,r],arguments.length),this[Nle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Ln(" [string|boolean]",[e,r],arguments.length),Pe(this,ni,"f").deprecatedOptions[e]=r,this}describe(e,r){return Ln(" [string]",[e,r],arguments.length),this[F9t](e,!0),Pe(this,go,"f").describe(e,r),this}detectLocale(e){return Ln("",[e],arguments.length),Bn(this,XY,e,"f"),this}env(e){return Ln("[string|boolean]",[e],arguments.length),e===!1?delete Pe(this,ni,"f").envPrefix:Pe(this,ni,"f").envPrefix=e||"",this}epilogue(e){return Ln("",[e],arguments.length),Pe(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Ln(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Pe(this,go,"f").example(e,r),this}exit(e,r){Bn(this,BS,!0,"f"),Bn(this,BQ,r,"f"),Pe(this,Hx,"f")&&Pe(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,Hx,e,"f"),this}fail(e){if(Ln("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Yp("Invalid first argument. Expected function or boolean 'false'");return Pe(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Ln(" [function]",[e,r],arguments.length),r?Pe(this,NC,"f").getCompletion(e,r):new Promise((n,o)=>{Pe(this,NC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Ln([],0),Pe(this,ni,"f").demandedOptions}getDemandedCommands(){return Ln([],0),Pe(this,ni,"f").demandedCommands}getDeprecatedOptions(){return Ln([],0),Pe(this,ni,"f").deprecatedOptions}getDetectLocale(){return Pe(this,XY,"f")}getExitProcess(){return Pe(this,Hx,"f")}getGroups(){return Object.assign({},Pe(this,sO,"f"),Pe(this,rK,"f"))}getHelp(){if(Bn(this,BS,!0,"f"),!Pe(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[DIe](Pe(this,FQ,"f"),void 0,void 0,0,!0);if(Ju(r))return r.then(()=>Pe(this,go,"f").help())}let e=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(e))return e.then(()=>Pe(this,go,"f").help())}return Promise.resolve(Pe(this,go,"f").help())}getOptions(){return Pe(this,ni,"f")}getStrict(){return Pe(this,nK,"f")}getStrictCommands(){return Pe(this,iK,"f")}getStrictOptions(){return Pe(this,oK,"f")}global(e,r){return Ln(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Pe(this,ni,"f").local=Pe(this,ni,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Pe(this,ni,"f").local.includes(n)||Pe(this,ni,"f").local.push(n)}),this}group(e,r){Ln(" ",[e,r],arguments.length);let n=Pe(this,rK,"f")[r]||Pe(this,sO,"f")[r];Pe(this,rK,"f")[r]&&delete Pe(this,rK,"f")[r];let o={};return Pe(this,sO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Ln("",[e],arguments.length),Pe(this,ni,"f").hiddenOptions.push(e),this}implies(e,r){return Ln(" [number|string|array]",[e,r],arguments.length),Pe(this,Zf,"f").implies(e,r),this}locale(e){return Ln("[string]",[e],arguments.length),e===void 0?(this[N9t](),Pe(this,Yi,"f").y18n.getLocale()):(Bn(this,XY,!1,"f"),Pe(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Pe(this,Gx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Ln(" [number]",[e,r],arguments.length),this[Nle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Ln("",[e],arguments.length),this[UQ]("normalize",e),this}number(e){return Ln("",[e],arguments.length),this[UQ]("number",e),this[cK](e),this}option(e,r){if(Ln(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[cK](e),Pe(this,aO,"f")&&(e==="version"||r?.alias==="version")&&this[r0n](['"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"),Pe(this,ni,"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&&(Pe(this,ni,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Pe(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){Ln("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[n0n](),typeof e>"u"&&(e=Pe(this,FQ,"f")),typeof r=="object"&&(Bn(this,tK,r,"f"),r=n),typeof r=="function"&&(Bn(this,FS,r,"f"),r=!1),r||Bn(this,FQ,e,"f"),Pe(this,FS,"f")&&Bn(this,Hx,!1,"f");let o=this[DIe](e,!!r),s=this.parsed;return Pe(this,NC,"f").setParsed(this.parsed),Ju(o)?o.then(c=>(Pe(this,FS,"f")&&Pe(this,FS,"f").call(this,Pe(this,BQ,"f"),c,Pe(this,cg,"f")),c)).catch(c=>{throw Pe(this,FS,"f")&&Pe(this,FS,"f")(c,this.parsed.argv,Pe(this,cg,"f")),c}).finally(()=>{this[U9t](),this.parsed=s}):(Pe(this,FS,"f")&&Pe(this,FS,"f").call(this,Pe(this,BQ,"f"),o,Pe(this,cg,"f")),this[U9t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Ju(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Ju(o))throw new Yp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Ln("",[e],arguments.length),Bn(this,uze,e,"f"),this}pkgConf(e,r){Ln(" [string]",[e,r],arguments.length);let n=null,o=this[M9t](r||Pe(this,ZY,"f"));return o[e]&&typeof o[e]=="object"&&(n=ize(o[e],r||Pe(this,ZY,"f"),this[sK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(n)),this}positional(e,r){Ln(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=OQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Pe(this,PIe,"f").fullCommands[Pe(this,PIe,"f").fullCommands.length-1],s=o?Pe(this,Kp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return kle(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,Pe(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,dze,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 Ln(" [number]",[e],arguments.length),typeof e=="string"&&Pe(this,ni,"f").narg[e]?this:(this[Nle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Ln("[string] [string]",[e,r],arguments.length),e=e||this.$0,Pe(this,eK,"f").log(Pe(this,NC,"f").generateCompletionScript(e,r||Pe(this,LS,"f")||"completion")),this}showHelp(e){if(Ln("[string|function]",[e],arguments.length),Bn(this,BS,!0,"f"),!Pe(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[DIe](Pe(this,FQ,"f"),void 0,void 0,0,!0);if(Ju(n))return n.then(()=>{Pe(this,go,"f").showHelp(e)}),this}let r=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(r))return r.then(()=>{Pe(this,go,"f").showHelp(e)}),this}return Pe(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Ln("[boolean|string] [string]",[e,r],arguments.length),Pe(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return Ln("[string|function]",[e],arguments.length),Pe(this,go,"f").showVersion(e),this}skipValidation(e){return Ln("",[e],arguments.length),this[UQ]("skipValidation",e),this}strict(e){return Ln("[boolean]",[e],arguments.length),Bn(this,nK,e!==!1,"f"),this}strictCommands(e){return Ln("[boolean]",[e],arguments.length),Bn(this,iK,e!==!1,"f"),this}strictOptions(e){return Ln("[boolean]",[e],arguments.length),Bn(this,oK,e!==!1,"f"),this}string(e){return Ln("",[e],arguments.length),this[UQ]("string",e),this[cK](e),this}terminalWidth(){return Ln([],0),Pe(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Ln("",[e],arguments.length),Bn(this,XY,!1,"f"),Pe(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Ln(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(B_(e,null,Pe(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Yp(".usage() description must start with $0 if being used as alias for .command()")}else return Pe(this,go,"f").usage(e),this}usageConfiguration(e){return Ln("",[e],arguments.length),Bn(this,fze,e,"f"),this}version(e,r,n){let o="version";if(Ln("[boolean|string] [string] [string]",[e,r,n],arguments.length),Pe(this,aO,"f")&&(this[D9t](Pe(this,aO,"f")),Pe(this,go,"f").version(void 0),Bn(this,aO,null,"f")),arguments.length===0)n=this[s0n](),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,aO,typeof e=="string"?e:o,"f"),r=r||Pe(this,go,"f").deferY18nLookup("Show version number"),Pe(this,go,"f").version(n||void 0),this.boolean(Pe(this,aO,"f")),this.describe(Pe(this,aO,"f"),r),this}wrap(e){return Ln("",[e],arguments.length),Pe(this,go,"f").wrap(e),this}[(Kp=new WeakMap,ZY=new WeakMap,PIe=new WeakMap,NC=new WeakMap,LS=new WeakMap,oze=new WeakMap,BQ=new WeakMap,XY=new WeakMap,sze=new WeakMap,Hx=new WeakMap,aze=new WeakMap,Gx=new WeakMap,sO=new WeakMap,BS=new WeakMap,$x=new WeakMap,cze=new WeakMap,eK=new WeakMap,cg=new WeakMap,ni=new WeakMap,lze=new WeakMap,uze=new WeakMap,FS=new WeakMap,tK=new WeakMap,Dle=new WeakMap,rK=new WeakMap,FQ=new WeakMap,dze=new WeakMap,Yi=new WeakMap,nK=new WeakMap,iK=new WeakMap,oK=new WeakMap,go=new WeakMap,fze=new WeakMap,aO=new WeakMap,Zf=new WeakMap,e0n)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[t0n](){return{log:a((...e)=>{this[pze]()||console.log(...e),Bn(this,BS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` -`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[pze]()||console.error(...e),Bn(this,BS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` -`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"error")}}[D9t](e){kle(Pe(this,ni,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Pe(this,ni,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Pe(this,go,"f").getDescriptions()[e]}[r0n](e,r,n){Pe(this,sze,"f")[n]||(Pe(this,Yi,"f").process.emitWarning(e,r),Pe(this,sze,"f")[n]=!0)}[n0n](){Pe(this,aze,"f").push({options:Pe(this,ni,"f"),configObjects:Pe(this,ni,"f").configObjects.slice(0),exitProcess:Pe(this,Hx,"f"),groups:Pe(this,sO,"f"),strict:Pe(this,nK,"f"),strictCommands:Pe(this,iK,"f"),strictOptions:Pe(this,oK,"f"),completionCommand:Pe(this,LS,"f"),output:Pe(this,cg,"f"),exitError:Pe(this,BQ,"f"),hasOutput:Pe(this,BS,"f"),parsed:this.parsed,parseFn:Pe(this,FS,"f"),parseContext:Pe(this,tK,"f")}),Pe(this,go,"f").freeze(),Pe(this,Zf,"f").freeze(),Pe(this,Kp,"f").freeze(),Pe(this,Gx,"f").freeze()}[i0n](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Pe(this,Yi,"f").process.argv()[0])?r=Pe(this,Yi,"f").process.argv().slice(1,2):r=Pe(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[A0n](Pe(this,ZY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});B_(s,void 0,Pe(this,Yi,"f")),n=JSON.parse(Pe(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Pe(this,Dle,"f")[r]=n||{},Pe(this,Dle,"f")[r]}[UQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[B9t](n),Pe(this,ni,"f")[e].push(n)})}[Nle](e,r,n,o){this[L9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=l})}[O9t](e,r,n,o){this[L9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=(Pe(this,ni,"f")[s][c]||[]).concat(l)})}[L9t](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 kle(n))e(c,n[c]);else s(r,this[B9t](n),o)}[B9t](e){return e==="__proto__"?"___proto___":e}[F9t](e,r){return this[Nle](this[F9t].bind(this),"key",e,r),this}[U9t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Pe(this,aze,"f").pop();B_(g,void 0,Pe(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,ni,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,Hx,y,"f")}}.value,groups:{set value(y){Bn(n,sO,y,"f")}}.value,output:{set value(y){Bn(o,cg,y,"f")}}.value,exitError:{set value(y){Bn(s,BQ,y,"f")}}.value,hasOutput:{set value(y){Bn(c,BS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,nK,y,"f")}}.value,strictCommands:{set value(y){Bn(u,iK,y,"f")}}.value,strictOptions:{set value(y){Bn(d,oK,y,"f")}}.value,completionCommand:{set value(y){Bn(f,LS,y,"f")}}.value,parseFn:{set value(y){Bn(h,FS,y,"f")}}.value,parseContext:{set value(y){Bn(m,tK,y,"f")}}.value}=g,Pe(this,ni,"f").configObjects=A,Pe(this,go,"f").unfreeze(),Pe(this,Zf,"f").unfreeze(),Pe(this,Kp,"f").unfreeze(),Pe(this,Gx,"f").unfreeze()}[c0n](e,r){return JY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[l0n].bind(this),getContext:this[u0n].bind(this),getHasOutput:this[d0n].bind(this),getLoggerInstance:this[f0n].bind(this),getParseContext:this[p0n].bind(this),getParserConfiguration:this[sK].bind(this),getUsageConfiguration:this[o0n].bind(this),getUsageInstance:this[h0n].bind(this),getValidationInstance:this[m0n].bind(this),hasParseCallback:this[pze].bind(this),isGlobalContext:this[g0n].bind(this),postProcess:this[aK].bind(this),reset:this[Q9t].bind(this),runValidation:this[q9t].bind(this),runYargsParserAndExecuteCommands:this[DIe].bind(this),setHasOutput:this[y0n].bind(this)}}[l0n](){return Pe(this,Kp,"f")}[u0n](){return Pe(this,PIe,"f")}[d0n](){return Pe(this,BS,"f")}[f0n](){return Pe(this,eK,"f")}[p0n](){return Pe(this,tK,"f")||{}}[h0n](){return Pe(this,go,"f")}[m0n](){return Pe(this,Zf,"f")}[pze](){return!!Pe(this,FS,"f")}[g0n](){return Pe(this,cze,"f")}[aK](e,r,n,o){return n||Ju(e)||(r||(e=this[e0n](e)),(this[sK]()["parse-positional-numbers"]||this[sK]()["parse-positional-numbers"]===void 0)&&(e=this[a0n](e)),o&&(e=KY(e,this,Pe(this,Gx,"f").getMiddleware(),!1))),e}[Q9t](e={}){Bn(this,ni,Pe(this,ni,"f")||{},"f");let r={};r.local=Pe(this,ni,"f").local||[],r.configObjects=Pe(this,ni,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Pe(this,rK,"f"),Object.keys(Pe(this,sO,"f")).reduce((c,l)=>{let u=Pe(this,sO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,sO,{},"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]=(Pe(this,ni,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=OQ(Pe(this,ni,"f")[c],l=>!n[l])}),r.envPrefix=Pe(this,ni,"f").envPrefix,Bn(this,ni,r,"f"),Bn(this,go,Pe(this,go,"f")?Pe(this,go,"f").reset(n):Vmn(this,Pe(this,Yi,"f")),"f"),Bn(this,Zf,Pe(this,Zf,"f")?Pe(this,Zf,"f").reset(n):Zmn(this,Pe(this,go,"f"),Pe(this,Yi,"f")),"f"),Bn(this,Kp,Pe(this,Kp,"f")?Pe(this,Kp,"f").reset():Hmn(Pe(this,go,"f"),Pe(this,Zf,"f"),Pe(this,Gx,"f"),Pe(this,Yi,"f")),"f"),Pe(this,NC,"f")||Bn(this,NC,Ymn(this,Pe(this,go,"f"),Pe(this,Kp,"f"),Pe(this,Yi,"f")),"f"),Pe(this,Gx,"f").reset(),Bn(this,LS,null,"f"),Bn(this,cg,"","f"),Bn(this,BQ,null,"f"),Bn(this,BS,!1,"f"),this.parsed=!1,this}[A0n](e,r){return Pe(this,Yi,"f").path.relative(e,r)}[DIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Pe(this,FQ,"f"),Pe(this,ni,"f").__=Pe(this,Yi,"f").y18n.__,Pe(this,ni,"f").configuration=this[sK]();let h=!!Pe(this,ni,"f").configuration["populate--"],m=Object.assign({},Pe(this,ni,"f").configuration,{"populate--":!0}),g=Pe(this,Yi,"f").Parser.detailed(e,Object.assign({},Pe(this,ni,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Pe(this,tK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Pe(this,$x,"f")&&A[b]?_=!0:b===Pe(this,aO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Pe(this,go,"f").clearCachedHelpMessage();try{if(this[N9t](),r)return this[aK](A,h,!!n,!1);Pe(this,$x,"f")&&[Pe(this,$x,"f")].concat(E[Pe(this,$x,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,cze,!1,"f");let b=Pe(this,Kp,"f").getCommands(),T=!((c=Pe(this,NC,"f"))===null||c===void 0)&&c.completionKey?[(l=Pe(this,NC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Pe(this,NC,"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!==Pe(this,LS,"f")){let D=Pe(this,Kp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[aK](D,h,!!n,!1)}else if(!R&&P!==Pe(this,LS,"f")){R=P;break}!Pe(this,Kp,"f").hasDefaultCommand()&&Pe(this,dze,"f")&&R&&!w&&Pe(this,Zf,"f").recommendCommands(R,b)}Pe(this,LS,"f")&&A._.includes(Pe(this,LS,"f"))&&!T&&(Pe(this,Hx,"f")&&LQ(!0),this.showCompletionScript(),this.exit(0))}if(Pe(this,Kp,"f").hasDefaultCommand()&&!w){let R=Pe(this,Kp,"f").runCommand(null,this,g,0,s,_||v||s);return this[aK](R,h,!!n,!1)}if(T){Pe(this,Hx,"f")&&LQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Pe(this,NC,"f").completionKey}`)+1);return Pe(this,NC,"f").getCompletion(R,(x,P)=>{if(x)throw new Yp(x.message);(P||[]).forEach(D=>{Pe(this,eK,"f").log(D)}),this.exit(0)}),this[aK](A,!h,!!n,!1)}if(Pe(this,BS,"f")||(_?(Pe(this,Hx,"f")&&LQ(!0),f=!0,this.showHelp(R=>{Pe(this,eK,"f").log(R),this.exit(0)})):v&&(Pe(this,Hx,"f")&&LQ(!0),f=!0,Pe(this,go,"f").showVersion("log"),this.exit(0))),!f&&Pe(this,ni,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Pe(this,ni,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Yp(g.error.message);if(!T){let R=this[q9t](E,{},g.error);n||(y=KY(A,this,Pe(this,Gx,"f").getMiddleware(),!0)),y=this[c0n](R,y??A),Ju(y)&&!n&&(y=y.then(()=>KY(A,this,Pe(this,Gx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Yp)Pe(this,go,"f").fail(b.message,b);else throw b}return this[aK](y??A,h,!!n,!0)}[q9t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Yp(n.message);Pe(this,Zf,"f").nonOptionCount(c),Pe(this,Zf,"f").requiredArguments(c,s);let l=!1;Pe(this,iK,"f")&&(l=Pe(this,Zf,"f").unknownCommands(c)),Pe(this,nK,"f")&&!l?Pe(this,Zf,"f").unknownArguments(c,e,r,!!o):Pe(this,oK,"f")&&Pe(this,Zf,"f").unknownArguments(c,e,{},!1,!1),Pe(this,Zf,"f").limitedChoices(c),Pe(this,Zf,"f").implications(c),Pe(this,Zf,"f").conflicting(c)}}[y0n](){Bn(this,BS,!0,"f")}[cK](e){if(typeof e=="string")Pe(this,ni,"f").key[e]=!0;else for(let r of e)Pe(this,ni,"f").key[r]=!0}};function Gmn(t){return!!t&&typeof t.getInternalMethods=="function"}a(Gmn,"isYargsInstance");var y8o=E0n(Fmn),_0n=y8o;p();p();var b0n=require("node:child_process"),S0n=require("node:util");var E8o=(0,S0n.promisify)(b0n.execFile),QQ="1.0.60",v0n="COPILOT_CLI_PATH",_8o="GITHUB_COPILOT_ACP_USE_CLI",Mle="@github/copilot",v8o=3e4,C8o=1e4,C0n=6e4,Ole=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function T0n(){return process.env[_8o]!=="0"}a(T0n,"isCLIIntegrationEnabled");var H9t=process.platform==="win32";async function I0n(){if(process.env[v0n]){let l=process.env[v0n],u=await NIe(l,["--version"]);if(u)return S8o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Ole("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await NIe("copilot",["--version"]);if(t&&MIe(t,QQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await NIe(e,["--offline",Mle,"--version"],!1,C8o);if(r&&MIe(r,QQ))return{path:e,args:[Mle],version:r,source:"npx"};let n=`${Mle}@${QQ}`,o=await NIe(e,[n,"--version"],!1,C0n);if(o&&MIe(o,QQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Mle}@latest`,c=await NIe(e,[s,"--version"],!0,C0n);if(c){if(MIe(c,QQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Ole(`Latest published Copilot CLI version ${c} is below the minimum required ${QQ}.`)}throw new Ole(`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 ${Mle}`)}a(I0n,"discoverCLI");function b8o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(b8o,"parseVersion");async function NIe(t,e,r=!1,n=v8o){try{let{stdout:o}=await E8o(t,e,{timeout:n,shell:H9t});return b8o(o)}catch(o){if(r)throw o;return null}}a(NIe,"tryGetVersion");function S8o(t,e){if(!MIe(t,QQ))throw new Ole(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${QQ}. Update with: npm install -g ${Mle}@latest`)}a(S8o,"validateVersion");function MIe(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!==""}},lK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Mt();this._timestamp=Date.now();this.uriSchemeCache=new hze;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 Vx=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();var uK=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(uK||{}),T8o=Object.values(uK);function x3(t){let e=new Set;for(let r of t??[]){let n=r.providers;if(Array.isArray(n))for(let o of n)e.add(o)}return e.size===0?["LOCAL","BACKGROUND"]:T8o.filter(r=>e.has(r))}a(x3,"unionProviders");function cO(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(cO,"providersForListRow");p();p();p();var dK=de(require("child_process")),$9t=de(require("path")),H0n=de(j0n());function G0n(t){return t.replace(/^git version /,"")}a(G0n,"parseVersion");function V9t(t){return new Promise((e,r)=>{let n=[],o=dK.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:G0n(Buffer.concat(n).toString("utf8").trim())}))})}a(V9t,"findSpecificGit");function F8o(){return new Promise((t,e)=>{dK.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){dK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:G0n(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);dK.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(F8o,"findGitDarwin");function mze(t){return t?V9t($9t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(mze,"findSystemGitWin32");async function U8o(){let t=await(0,H0n.default)("git.exe");return V9t(t)}a(U8o,"findGitWin32InPath");function Q8o(){return mze(process.env.ProgramW6432).then(void 0,()=>mze(process.env["ProgramFiles(x86)"])).then(void 0,()=>mze(process.env.ProgramFiles)).then(void 0,()=>mze($9t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>U8o())}a(Q8o,"findGitWin32");async function lO(){try{switch(process.platform){case"darwin":return await F8o();case"win32":return await Q8o();default:return await V9t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(lO,"findGit");var $0n=require("node:child_process"),V0n=require("node:util");var q8o=(0,V0n.promisify)($0n.execFile);async function W0n(t){return W9t(t,["github.com"])}a(W0n,"resolveGitHubNwo");async function W9t(t,e){let r;try{r=(await lO()).path}catch{return}let n;try{n=(await q8o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return j8o(n,e)}a(W9t,"resolveGitHubNwoForHosts");function j8o(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(j8o,"parseGitRemoteUrl");async function z0n(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(z0n,"resolveRepoIds");p();var H8o=3e4,gze=class{constructor(e,r=H8o){this.ctx=e;this.timeoutMs=r;this.logger=new fe("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=`${Y0n(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(tr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...i0(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(`${Y0n(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(tr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...i0(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 Y0n(t){return t.endsWith("/")?t.slice(0,-1):t}a(Y0n,"trimTrailingSlash");p();p();var G8o=Object.create,K0n=Object.defineProperty,$8o=Object.getOwnPropertyDescriptor,V8o=Object.getOwnPropertyNames,W8o=Object.getPrototypeOf,z8o=Object.prototype.hasOwnProperty,Zu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),Y8o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=V8o(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=$8o(e,l))||n.enumerable});return t},"__copyProps"),K8o=a((t,e,r)=>(r=t!=null?G8o(W8o(t)):{},Y8o(e||!t||!t.__esModule?K0n(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),OIe=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})),J8o=Zu(((t,e)=>{var r=OIe();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+` +`)}`:"";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=>{!r0n.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=>{r0n.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){Ln(" [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)):(F_(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){Ln(" [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=t0n(h,_);v<=3&&v!h[m]),u=BQ(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();F_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(n0n,"validation");p();var w8o={};var O9t=[],NIe;function lze(t,e,r,n){NIe=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=x8o(e,t.extends);else try{c=w8o.resolve(t.extends)}catch{return t}I8o(c),O9t.push(c),o=s?JSON.parse(NIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=lze(o,NIe.path.dirname(c),r,NIe)}return O9t=[],r?i0n(o,t):Object.assign({},o,t)}a(lze,"applyExtends");function I8o(t){if(O9t.indexOf(t)>-1)throw new Jp(`Circular extended configurations: '${t}'.`)}a(I8o,"checkForCircularExtends");function x8o(t,e){return NIe.path.resolve(t,e)}a(x8o,"getPathToDefaultConfig");function i0n(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]=i0n(t[o],e[o]):r[o]=e[o];return r}a(i0n,"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},Pe=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)},Zp,rK,MIe,MC,BS,uze,UQ,nK,dze,$x,fze,Vx,lO,FS,Wx,pze,iK,lg,ri,hze,mze,US,oK,Nle,sK,QQ,gze,Yi,aK,cK,lK,Ao,Aze,uO,ep;function S0n(t){return(e=[],r=t.process.cwd(),n)=>{let o=new V9t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(S0n,"YargsFactory");var o0n=Symbol("copyDoubleDash"),s0n=Symbol("copyDoubleDash"),L9t=Symbol("deleteFromParserHintObject"),a0n=Symbol("emitWarning"),c0n=Symbol("freeze"),l0n=Symbol("getDollarZero"),uK=Symbol("getParserConfiguration"),u0n=Symbol("getUsageConfiguration"),B9t=Symbol("guessLocale"),d0n=Symbol("guessVersion"),f0n=Symbol("parsePositionalNumbers"),F9t=Symbol("pkgUp"),qQ=Symbol("populateParserHintArray"),Mle=Symbol("populateParserHintSingleValueDictionary"),U9t=Symbol("populateParserHintArrayDictionary"),Q9t=Symbol("populateParserHintDictionary"),q9t=Symbol("sanitizeKey"),j9t=Symbol("setKey"),H9t=Symbol("unfreeze"),p0n=Symbol("validateAsync"),h0n=Symbol("getCommandInstance"),m0n=Symbol("getContext"),g0n=Symbol("getHasOutput"),A0n=Symbol("getLoggerInstance"),y0n=Symbol("getParseContext"),E0n=Symbol("getUsageInstance"),_0n=Symbol("getValidationInstance"),yze=Symbol("hasParseCallback"),v0n=Symbol("isGlobalContext"),dK=Symbol("postProcess"),C0n=Symbol("rebase"),G9t=Symbol("reset"),OIe=Symbol("runYargsParserAndExecuteCommands"),$9t=Symbol("runValidation"),b0n=Symbol("setHasOutput"),fK=Symbol("kTrackManuallySetKeys"),R8o="en_US",V9t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Zp.set(this,void 0),rK.set(this,void 0),MIe.set(this,{commands:[],fullCommands:[]}),MC.set(this,null),BS.set(this,null),uze.set(this,"show-hidden"),UQ.set(this,null),nK.set(this,!0),dze.set(this,{}),$x.set(this,!0),fze.set(this,[]),Vx.set(this,void 0),lO.set(this,{}),FS.set(this,!1),Wx.set(this,null),pze.set(this,!0),iK.set(this,void 0),lg.set(this,""),ri.set(this,void 0),hze.set(this,void 0),mze.set(this,{}),US.set(this,null),oK.set(this,null),Nle.set(this,{}),sK.set(this,{}),QQ.set(this,void 0),gze.set(this,!1),Yi.set(this,void 0),aK.set(this,!1),cK.set(this,!1),lK.set(this,!1),Ao.set(this,void 0),Aze.set(this,{}),uO.set(this,null),ep.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,QQ,e,"f"),Bn(this,rK,r,"f"),Bn(this,hze,n,"f"),Bn(this,Vx,new sze(this),"f"),this.$0=this[l0n](),this[G9t](),Bn(this,Zp,Pe(this,Zp,"f"),"f"),Bn(this,Ao,Pe(this,Ao,"f"),"f"),Bn(this,ep,Pe(this,ep,"f"),"f"),Bn(this,ri,Pe(this,ri,"f"),"f"),Pe(this,ri,"f").showHiddenOpt=Pe(this,uze,"f"),Bn(this,iK,this[s0n](),"f"),Pe(this,Yi,"f").y18n.setLocale(R8o)}addHelpOpt(e,r){let n="help";return Ln("[string|boolean] [string]",[e,r],arguments.length),Pe(this,Wx,"f")&&(this[L9t](Pe(this,Wx,"f")),Bn(this,Wx,null,"f")),e===!1&&r===void 0?this:(Bn(this,Wx,typeof e=="string"?e:n,"f"),this.boolean(Pe(this,Wx,"f")),this.describe(Pe(this,Wx,"f"),r||Pe(this,Ao,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Ln("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Pe(this,uze,"f");return this.boolean(n),this.describe(n,r||Pe(this,Ao,"f").deferY18nLookup("Show hidden options")),Pe(this,ri,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[U9t](this.alias.bind(this),"alias",e,r),this}array(e){return Ln("",[e],arguments.length),this[qQ]("array",e),this[fK](e),this}boolean(e){return Ln("",[e],arguments.length),this[qQ]("boolean",e),this[fK](e),this}check(e,r){return Ln(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>tK(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Pe(this,Ao,"f").fail(s.toString(),s):Pe(this,Ao,"f").fail(Pe(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Pe(this,Ao,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[U9t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Ln(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Jp("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 Jp("coerce callback must be provided");let n=e;return Pe(this,ri,"f").key[n]=!0,Pe(this,Vx,"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:tK(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Jp(d.message)})},n),this}conflicts(e,r){return Ln(" [string|array]",[e,r],arguments.length),Pe(this,ep,"f").conflicts(e,r),this}config(e="config",r,n){return Ln("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=lze(e,Pe(this,rK,"f"),this[uK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ri,"f").configObjects=(Pe(this,ri,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Pe(this,Ao,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Pe(this,ri,"f").config[o]=n||!0}),this)}completion(e,r,n){return Ln("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,BS,e||Pe(this,BS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Pe(this,BS,"f"),r),n&&Pe(this,MC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Ln(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Pe(this,Zp,"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){Ln(" [object]",[e,r],arguments.length);let n=Pe(this,hze,"f")||Pe(this,Yi,"f").require;return Pe(this,Zp,"f").addDirectory(e,n,Pe(this,Yi,"f").getCallerFile(),r),this}count(e){return Ln("",[e],arguments.length),this[qQ]("count",e),this[fK](e),this}default(e,r,n){return Ln(" [*] [string]",[e,r,n],arguments.length),n&&(P9t(e,Pe(this,Yi,"f")),Pe(this,ri,"f").defaultDescription[e]=n),typeof r=="function"&&(P9t(e,Pe(this,Yi,"f")),Pe(this,ri,"f").defaultDescription[e]||(Pe(this,ri,"f").defaultDescription[e]=Pe(this,Ao,"f").functionDescription(r)),r=r.call()),this[Mle](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 Ln("[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),Pe(this,ri,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{F_(n,!0,Pe(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(F_(n,!0,Pe(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{F_(n,!0,Pe(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 Ln(" [string]",[e,r],arguments.length),this[Mle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Ln(" [string|boolean]",[e,r],arguments.length),Pe(this,ri,"f").deprecatedOptions[e]=r,this}describe(e,r){return Ln(" [string]",[e,r],arguments.length),this[j9t](e,!0),Pe(this,Ao,"f").describe(e,r),this}detectLocale(e){return Ln("",[e],arguments.length),Bn(this,nK,e,"f"),this}env(e){return Ln("[string|boolean]",[e],arguments.length),e===!1?delete Pe(this,ri,"f").envPrefix:Pe(this,ri,"f").envPrefix=e||"",this}epilogue(e){return Ln("",[e],arguments.length),Pe(this,Ao,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Ln(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Pe(this,Ao,"f").example(e,r),this}exit(e,r){Bn(this,FS,!0,"f"),Bn(this,UQ,r,"f"),Pe(this,$x,"f")&&Pe(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,$x,e,"f"),this}fail(e){if(Ln("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Jp("Invalid first argument. Expected function or boolean 'false'");return Pe(this,Ao,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Ln(" [function]",[e,r],arguments.length),r?Pe(this,MC,"f").getCompletion(e,r):new Promise((n,o)=>{Pe(this,MC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Ln([],0),Pe(this,ri,"f").demandedOptions}getDemandedCommands(){return Ln([],0),Pe(this,ri,"f").demandedCommands}getDeprecatedOptions(){return Ln([],0),Pe(this,ri,"f").deprecatedOptions}getDetectLocale(){return Pe(this,nK,"f")}getExitProcess(){return Pe(this,$x,"f")}getGroups(){return Object.assign({},Pe(this,lO,"f"),Pe(this,sK,"f"))}getHelp(){if(Bn(this,FS,!0,"f"),!Pe(this,Ao,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[OIe](Pe(this,QQ,"f"),void 0,void 0,0,!0);if(Zu(r))return r.then(()=>Pe(this,Ao,"f").help())}let e=Pe(this,Zp,"f").runDefaultBuilderOn(this);if(Zu(e))return e.then(()=>Pe(this,Ao,"f").help())}return Promise.resolve(Pe(this,Ao,"f").help())}getOptions(){return Pe(this,ri,"f")}getStrict(){return Pe(this,aK,"f")}getStrictCommands(){return Pe(this,cK,"f")}getStrictOptions(){return Pe(this,lK,"f")}global(e,r){return Ln(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Pe(this,ri,"f").local=Pe(this,ri,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Pe(this,ri,"f").local.includes(n)||Pe(this,ri,"f").local.push(n)}),this}group(e,r){Ln(" ",[e,r],arguments.length);let n=Pe(this,sK,"f")[r]||Pe(this,lO,"f")[r];Pe(this,sK,"f")[r]&&delete Pe(this,sK,"f")[r];let o={};return Pe(this,lO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Ln("",[e],arguments.length),Pe(this,ri,"f").hiddenOptions.push(e),this}implies(e,r){return Ln(" [number|string|array]",[e,r],arguments.length),Pe(this,ep,"f").implies(e,r),this}locale(e){return Ln("[string]",[e],arguments.length),e===void 0?(this[B9t](),Pe(this,Yi,"f").y18n.getLocale()):(Bn(this,nK,!1,"f"),Pe(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Pe(this,Vx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Ln(" [number]",[e,r],arguments.length),this[Mle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Ln("",[e],arguments.length),this[qQ]("normalize",e),this}number(e){return Ln("",[e],arguments.length),this[qQ]("number",e),this[fK](e),this}option(e,r){if(Ln(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[fK](e),Pe(this,uO,"f")&&(e==="version"||r?.alias==="version")&&this[a0n](['"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"),Pe(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&&(Pe(this,ri,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Pe(this,Ao,"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){Ln("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[c0n](),typeof e>"u"&&(e=Pe(this,QQ,"f")),typeof r=="object"&&(Bn(this,oK,r,"f"),r=n),typeof r=="function"&&(Bn(this,US,r,"f"),r=!1),r||Bn(this,QQ,e,"f"),Pe(this,US,"f")&&Bn(this,$x,!1,"f");let o=this[OIe](e,!!r),s=this.parsed;return Pe(this,MC,"f").setParsed(this.parsed),Zu(o)?o.then(c=>(Pe(this,US,"f")&&Pe(this,US,"f").call(this,Pe(this,UQ,"f"),c,Pe(this,lg,"f")),c)).catch(c=>{throw Pe(this,US,"f")&&Pe(this,US,"f")(c,this.parsed.argv,Pe(this,lg,"f")),c}).finally(()=>{this[H9t](),this.parsed=s}):(Pe(this,US,"f")&&Pe(this,US,"f").call(this,Pe(this,UQ,"f"),o,Pe(this,lg,"f")),this[H9t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Zu(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Zu(o))throw new Jp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Ln("",[e],arguments.length),Bn(this,mze,e,"f"),this}pkgConf(e,r){Ln(" [string]",[e,r],arguments.length);let n=null,o=this[F9t](r||Pe(this,rK,"f"));return o[e]&&typeof o[e]=="object"&&(n=lze(o[e],r||Pe(this,rK,"f"),this[uK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ri,"f").configObjects=(Pe(this,ri,"f").configObjects||[]).concat(n)),this}positional(e,r){Ln(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=BQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Pe(this,MIe,"f").fullCommands[Pe(this,MIe,"f").fullCommands.length-1],s=o?Pe(this,Zp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Ple(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,Pe(this,Ao,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,gze,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 Ln(" [number]",[e],arguments.length),typeof e=="string"&&Pe(this,ri,"f").narg[e]?this:(this[Mle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Ln("[string] [string]",[e,r],arguments.length),e=e||this.$0,Pe(this,iK,"f").log(Pe(this,MC,"f").generateCompletionScript(e,r||Pe(this,BS,"f")||"completion")),this}showHelp(e){if(Ln("[string|function]",[e],arguments.length),Bn(this,FS,!0,"f"),!Pe(this,Ao,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[OIe](Pe(this,QQ,"f"),void 0,void 0,0,!0);if(Zu(n))return n.then(()=>{Pe(this,Ao,"f").showHelp(e)}),this}let r=Pe(this,Zp,"f").runDefaultBuilderOn(this);if(Zu(r))return r.then(()=>{Pe(this,Ao,"f").showHelp(e)}),this}return Pe(this,Ao,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Ln("[boolean|string] [string]",[e,r],arguments.length),Pe(this,Ao,"f").showHelpOnFail(e,r),this}showVersion(e){return Ln("[string|function]",[e],arguments.length),Pe(this,Ao,"f").showVersion(e),this}skipValidation(e){return Ln("",[e],arguments.length),this[qQ]("skipValidation",e),this}strict(e){return Ln("[boolean]",[e],arguments.length),Bn(this,aK,e!==!1,"f"),this}strictCommands(e){return Ln("[boolean]",[e],arguments.length),Bn(this,cK,e!==!1,"f"),this}strictOptions(e){return Ln("[boolean]",[e],arguments.length),Bn(this,lK,e!==!1,"f"),this}string(e){return Ln("",[e],arguments.length),this[qQ]("string",e),this[fK](e),this}terminalWidth(){return Ln([],0),Pe(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Ln("",[e],arguments.length),Bn(this,nK,!1,"f"),Pe(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Ln(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(F_(e,null,Pe(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Jp(".usage() description must start with $0 if being used as alias for .command()")}else return Pe(this,Ao,"f").usage(e),this}usageConfiguration(e){return Ln("",[e],arguments.length),Bn(this,Aze,e,"f"),this}version(e,r,n){let o="version";if(Ln("[boolean|string] [string] [string]",[e,r,n],arguments.length),Pe(this,uO,"f")&&(this[L9t](Pe(this,uO,"f")),Pe(this,Ao,"f").version(void 0),Bn(this,uO,null,"f")),arguments.length===0)n=this[d0n](),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,uO,typeof e=="string"?e:o,"f"),r=r||Pe(this,Ao,"f").deferY18nLookup("Show version number"),Pe(this,Ao,"f").version(n||void 0),this.boolean(Pe(this,uO,"f")),this.describe(Pe(this,uO,"f"),r),this}wrap(e){return Ln("",[e],arguments.length),Pe(this,Ao,"f").wrap(e),this}[(Zp=new WeakMap,rK=new WeakMap,MIe=new WeakMap,MC=new WeakMap,BS=new WeakMap,uze=new WeakMap,UQ=new WeakMap,nK=new WeakMap,dze=new WeakMap,$x=new WeakMap,fze=new WeakMap,Vx=new WeakMap,lO=new WeakMap,FS=new WeakMap,Wx=new WeakMap,pze=new WeakMap,iK=new WeakMap,lg=new WeakMap,ri=new WeakMap,hze=new WeakMap,mze=new WeakMap,US=new WeakMap,oK=new WeakMap,Nle=new WeakMap,sK=new WeakMap,QQ=new WeakMap,gze=new WeakMap,Yi=new WeakMap,aK=new WeakMap,cK=new WeakMap,lK=new WeakMap,Ao=new WeakMap,Aze=new WeakMap,uO=new WeakMap,ep=new WeakMap,o0n)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[s0n](){return{log:a((...e)=>{this[yze]()||console.log(...e),Bn(this,FS,!0,"f"),Pe(this,lg,"f").length&&Bn(this,lg,Pe(this,lg,"f")+` +`,"f"),Bn(this,lg,Pe(this,lg,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[yze]()||console.error(...e),Bn(this,FS,!0,"f"),Pe(this,lg,"f").length&&Bn(this,lg,Pe(this,lg,"f")+` +`,"f"),Bn(this,lg,Pe(this,lg,"f")+e.join(" "),"f")},"error")}}[L9t](e){Ple(Pe(this,ri,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Pe(this,ri,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Pe(this,Ao,"f").getDescriptions()[e]}[a0n](e,r,n){Pe(this,dze,"f")[n]||(Pe(this,Yi,"f").process.emitWarning(e,r),Pe(this,dze,"f")[n]=!0)}[c0n](){Pe(this,fze,"f").push({options:Pe(this,ri,"f"),configObjects:Pe(this,ri,"f").configObjects.slice(0),exitProcess:Pe(this,$x,"f"),groups:Pe(this,lO,"f"),strict:Pe(this,aK,"f"),strictCommands:Pe(this,cK,"f"),strictOptions:Pe(this,lK,"f"),completionCommand:Pe(this,BS,"f"),output:Pe(this,lg,"f"),exitError:Pe(this,UQ,"f"),hasOutput:Pe(this,FS,"f"),parsed:this.parsed,parseFn:Pe(this,US,"f"),parseContext:Pe(this,oK,"f")}),Pe(this,Ao,"f").freeze(),Pe(this,ep,"f").freeze(),Pe(this,Zp,"f").freeze(),Pe(this,Vx,"f").freeze()}[l0n](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Pe(this,Yi,"f").process.argv()[0])?r=Pe(this,Yi,"f").process.argv().slice(1,2):r=Pe(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[C0n](Pe(this,rK,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});F_(s,void 0,Pe(this,Yi,"f")),n=JSON.parse(Pe(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Pe(this,Nle,"f")[r]=n||{},Pe(this,Nle,"f")[r]}[qQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[q9t](n),Pe(this,ri,"f")[e].push(n)})}[Mle](e,r,n,o){this[Q9t](e,r,n,o,(s,c,l)=>{Pe(this,ri,"f")[s][c]=l})}[U9t](e,r,n,o){this[Q9t](e,r,n,o,(s,c,l)=>{Pe(this,ri,"f")[s][c]=(Pe(this,ri,"f")[s][c]||[]).concat(l)})}[Q9t](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 Ple(n))e(c,n[c]);else s(r,this[q9t](n),o)}[q9t](e){return e==="__proto__"?"___proto___":e}[j9t](e,r){return this[Mle](this[j9t].bind(this),"key",e,r),this}[H9t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Pe(this,fze,"f").pop();F_(g,void 0,Pe(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,$x,y,"f")}}.value,groups:{set value(y){Bn(n,lO,y,"f")}}.value,output:{set value(y){Bn(o,lg,y,"f")}}.value,exitError:{set value(y){Bn(s,UQ,y,"f")}}.value,hasOutput:{set value(y){Bn(c,FS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,aK,y,"f")}}.value,strictCommands:{set value(y){Bn(u,cK,y,"f")}}.value,strictOptions:{set value(y){Bn(d,lK,y,"f")}}.value,completionCommand:{set value(y){Bn(f,BS,y,"f")}}.value,parseFn:{set value(y){Bn(h,US,y,"f")}}.value,parseContext:{set value(y){Bn(m,oK,y,"f")}}.value}=g,Pe(this,ri,"f").configObjects=A,Pe(this,Ao,"f").unfreeze(),Pe(this,ep,"f").unfreeze(),Pe(this,Zp,"f").unfreeze(),Pe(this,Vx,"f").unfreeze()}[p0n](e,r){return tK(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[h0n].bind(this),getContext:this[m0n].bind(this),getHasOutput:this[g0n].bind(this),getLoggerInstance:this[A0n].bind(this),getParseContext:this[y0n].bind(this),getParserConfiguration:this[uK].bind(this),getUsageConfiguration:this[u0n].bind(this),getUsageInstance:this[E0n].bind(this),getValidationInstance:this[_0n].bind(this),hasParseCallback:this[yze].bind(this),isGlobalContext:this[v0n].bind(this),postProcess:this[dK].bind(this),reset:this[G9t].bind(this),runValidation:this[$9t].bind(this),runYargsParserAndExecuteCommands:this[OIe].bind(this),setHasOutput:this[b0n].bind(this)}}[h0n](){return Pe(this,Zp,"f")}[m0n](){return Pe(this,MIe,"f")}[g0n](){return Pe(this,FS,"f")}[A0n](){return Pe(this,iK,"f")}[y0n](){return Pe(this,oK,"f")||{}}[E0n](){return Pe(this,Ao,"f")}[_0n](){return Pe(this,ep,"f")}[yze](){return!!Pe(this,US,"f")}[v0n](){return Pe(this,pze,"f")}[dK](e,r,n,o){return n||Zu(e)||(r||(e=this[o0n](e)),(this[uK]()["parse-positional-numbers"]||this[uK]()["parse-positional-numbers"]===void 0)&&(e=this[f0n](e)),o&&(e=eK(e,this,Pe(this,Vx,"f").getMiddleware(),!1))),e}[G9t](e={}){Bn(this,ri,Pe(this,ri,"f")||{},"f");let r={};r.local=Pe(this,ri,"f").local||[],r.configObjects=Pe(this,ri,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Pe(this,sK,"f"),Object.keys(Pe(this,lO,"f")).reduce((c,l)=>{let u=Pe(this,lO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,lO,{},"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]=(Pe(this,ri,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=BQ(Pe(this,ri,"f")[c],l=>!n[l])}),r.envPrefix=Pe(this,ri,"f").envPrefix,Bn(this,ri,r,"f"),Bn(this,Ao,Pe(this,Ao,"f")?Pe(this,Ao,"f").reset(n):Jmn(this,Pe(this,Yi,"f")),"f"),Bn(this,ep,Pe(this,ep,"f")?Pe(this,ep,"f").reset(n):n0n(this,Pe(this,Ao,"f"),Pe(this,Yi,"f")),"f"),Bn(this,Zp,Pe(this,Zp,"f")?Pe(this,Zp,"f").reset():zmn(Pe(this,Ao,"f"),Pe(this,ep,"f"),Pe(this,Vx,"f"),Pe(this,Yi,"f")),"f"),Pe(this,MC,"f")||Bn(this,MC,e0n(this,Pe(this,Ao,"f"),Pe(this,Zp,"f"),Pe(this,Yi,"f")),"f"),Pe(this,Vx,"f").reset(),Bn(this,BS,null,"f"),Bn(this,lg,"","f"),Bn(this,UQ,null,"f"),Bn(this,FS,!1,"f"),this.parsed=!1,this}[C0n](e,r){return Pe(this,Yi,"f").path.relative(e,r)}[OIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Pe(this,QQ,"f"),Pe(this,ri,"f").__=Pe(this,Yi,"f").y18n.__,Pe(this,ri,"f").configuration=this[uK]();let h=!!Pe(this,ri,"f").configuration["populate--"],m=Object.assign({},Pe(this,ri,"f").configuration,{"populate--":!0}),g=Pe(this,Yi,"f").Parser.detailed(e,Object.assign({},Pe(this,ri,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Pe(this,oK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Pe(this,Wx,"f")&&A[b]?_=!0:b===Pe(this,uO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Pe(this,Ao,"f").clearCachedHelpMessage();try{if(this[B9t](),r)return this[dK](A,h,!!n,!1);Pe(this,Wx,"f")&&[Pe(this,Wx,"f")].concat(E[Pe(this,Wx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,pze,!1,"f");let b=Pe(this,Zp,"f").getCommands(),T=!((c=Pe(this,MC,"f"))===null||c===void 0)&&c.completionKey?[(l=Pe(this,MC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Pe(this,MC,"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!==Pe(this,BS,"f")){let D=Pe(this,Zp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[dK](D,h,!!n,!1)}else if(!R&&P!==Pe(this,BS,"f")){R=P;break}!Pe(this,Zp,"f").hasDefaultCommand()&&Pe(this,gze,"f")&&R&&!w&&Pe(this,ep,"f").recommendCommands(R,b)}Pe(this,BS,"f")&&A._.includes(Pe(this,BS,"f"))&&!T&&(Pe(this,$x,"f")&&FQ(!0),this.showCompletionScript(),this.exit(0))}if(Pe(this,Zp,"f").hasDefaultCommand()&&!w){let R=Pe(this,Zp,"f").runCommand(null,this,g,0,s,_||v||s);return this[dK](R,h,!!n,!1)}if(T){Pe(this,$x,"f")&&FQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Pe(this,MC,"f").completionKey}`)+1);return Pe(this,MC,"f").getCompletion(R,(x,P)=>{if(x)throw new Jp(x.message);(P||[]).forEach(D=>{Pe(this,iK,"f").log(D)}),this.exit(0)}),this[dK](A,!h,!!n,!1)}if(Pe(this,FS,"f")||(_?(Pe(this,$x,"f")&&FQ(!0),f=!0,this.showHelp(R=>{Pe(this,iK,"f").log(R),this.exit(0)})):v&&(Pe(this,$x,"f")&&FQ(!0),f=!0,Pe(this,Ao,"f").showVersion("log"),this.exit(0))),!f&&Pe(this,ri,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Pe(this,ri,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Jp(g.error.message);if(!T){let R=this[$9t](E,{},g.error);n||(y=eK(A,this,Pe(this,Vx,"f").getMiddleware(),!0)),y=this[p0n](R,y??A),Zu(y)&&!n&&(y=y.then(()=>eK(A,this,Pe(this,Vx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Jp)Pe(this,Ao,"f").fail(b.message,b);else throw b}return this[dK](y??A,h,!!n,!0)}[$9t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Jp(n.message);Pe(this,ep,"f").nonOptionCount(c),Pe(this,ep,"f").requiredArguments(c,s);let l=!1;Pe(this,cK,"f")&&(l=Pe(this,ep,"f").unknownCommands(c)),Pe(this,aK,"f")&&!l?Pe(this,ep,"f").unknownArguments(c,e,r,!!o):Pe(this,lK,"f")&&Pe(this,ep,"f").unknownArguments(c,e,{},!1,!1),Pe(this,ep,"f").limitedChoices(c),Pe(this,ep,"f").implications(c),Pe(this,ep,"f").conflicting(c)}}[b0n](){Bn(this,FS,!0,"f")}[fK](e){if(typeof e=="string")Pe(this,ri,"f").key[e]=!0;else for(let r of e)Pe(this,ri,"f").key[r]=!0}};function Ymn(t){return!!t&&typeof t.getInternalMethods=="function"}a(Ymn,"isYargsInstance");var k8o=S0n(Hmn),T0n=k8o;p();p();var w0n=require("node:child_process"),R0n=require("node:util");var P8o=(0,R0n.promisify)(w0n.execFile),jQ="1.0.60",I0n="COPILOT_CLI_PATH",D8o="GITHUB_COPILOT_ACP_USE_CLI",Ole="@github/copilot",N8o=3e4,M8o=1e4,x0n=6e4,Lle=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function k0n(){return process.env[D8o]!=="0"}a(k0n,"isCLIIntegrationEnabled");var W9t=process.platform==="win32";async function P0n(){if(process.env[I0n]){let l=process.env[I0n],u=await LIe(l,["--version"]);if(u)return L8o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Lle("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await LIe("copilot",["--version"]);if(t&&BIe(t,jQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await LIe(e,["--offline",Ole,"--version"],!1,M8o);if(r&&BIe(r,jQ))return{path:e,args:[Ole],version:r,source:"npx"};let n=`${Ole}@${jQ}`,o=await LIe(e,[n,"--version"],!1,x0n);if(o&&BIe(o,jQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Ole}@latest`,c=await LIe(e,[s,"--version"],!0,x0n);if(c){if(BIe(c,jQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Lle(`Latest published Copilot CLI version ${c} is below the minimum required ${jQ}.`)}throw new Lle(`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 ${Ole}`)}a(P0n,"discoverCLI");function O8o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(O8o,"parseVersion");async function LIe(t,e,r=!1,n=N8o){try{let{stdout:o}=await P8o(t,e,{timeout:n,shell:W9t});return O8o(o)}catch(o){if(r)throw o;return null}}a(LIe,"tryGetVersion");function L8o(t,e){if(!BIe(t,jQ))throw new Lle(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${jQ}. Update with: npm install -g ${Ole}@latest`)}a(L8o,"validateVersion");function BIe(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!==""}},pK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Mt();this._timestamp=Date.now();this.uriSchemeCache=new Eze;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 zx=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();var w3=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(w3||{}),B8o=Object.values(w3);function R3(t){let e=new Set;for(let r of t??[]){let n=r.providers;if(Array.isArray(n))for(let o of n)e.add(o)}return e.size===0?["LOCAL","BACKGROUND"]:B8o.filter(r=>e.has(r))}a(R3,"unionProviders");function QS(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(QS,"providersForListRow");p();p();p();var hK=de(require("child_process")),Y9t=de(require("path")),z0n=de(W0n());function Y0n(t){return t.replace(/^git version /,"")}a(Y0n,"parseVersion");function K9t(t){return new Promise((e,r)=>{let n=[],o=hK.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:Y0n(Buffer.concat(n).toString("utf8").trim())}))})}a(K9t,"findSpecificGit");function K8o(){return new Promise((t,e)=>{hK.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){hK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:Y0n(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);hK.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(K8o,"findGitDarwin");function _ze(t){return t?K9t(Y9t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(_ze,"findSystemGitWin32");async function J8o(){let t=await(0,z0n.default)("git.exe");return K9t(t)}a(J8o,"findGitWin32InPath");function Z8o(){return _ze(process.env.ProgramW6432).then(void 0,()=>_ze(process.env["ProgramFiles(x86)"])).then(void 0,()=>_ze(process.env.ProgramFiles)).then(void 0,()=>_ze(Y9t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>J8o())}a(Z8o,"findGitWin32");async function dO(){try{switch(process.platform){case"darwin":return await K8o();case"win32":return await Z8o();default:return await K9t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(dO,"findGit");var K0n=require("node:child_process"),J0n=require("node:util");var X8o=(0,J0n.promisify)(K0n.execFile);async function Z0n(t){return J9t(t,["github.com"])}a(Z0n,"resolveGitHubNwo");async function J9t(t,e){let r;try{r=(await dO()).path}catch{return}let n;try{n=(await X8o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return e6o(n,e)}a(J9t,"resolveGitHubNwoForHosts");function e6o(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(e6o,"parseGitRemoteUrl");async function X0n(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(X0n,"resolveRepoIds");p();var t6o=3e4,vze=class{constructor(e,r=t6o){this.ctx=e;this.timeoutMs=r;this.logger=new fe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=SB(n).api,c=`${egn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(nr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...s0(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=SB(s).api,u=new URL(`${egn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(nr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...s0(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(Lr).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function egn(t){return t.endsWith("/")?t.slice(0,-1):t}a(egn,"trimTrailingSlash");p();p();var r6o=Object.create,tgn=Object.defineProperty,n6o=Object.getOwnPropertyDescriptor,i6o=Object.getOwnPropertyNames,o6o=Object.getPrototypeOf,s6o=Object.prototype.hasOwnProperty,Xu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),a6o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=i6o(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=n6o(e,l))||n.enumerable});return t},"__copyProps"),c6o=a((t,e,r)=>(r=t!=null?r6o(o6o(t)):{},a6o(e||!t||!t.__esModule?tgn(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),FIe=Xu(((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})),l6o=Xu(((t,e)=>{var r=FIe();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})),U_=Zu(((t,e)=>{var r=LIe(),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})),J0n=Zu(((t,e)=>{var r=LIe(),n=U_();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(U_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),X0n=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),egn=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),tgn=Zu(((t,e)=>{e.exports=new(J0n())({explicit:[Z0n(),X0n(),egn()]})})),rgn=Zu(((t,e)=>{var r=U_();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"})})),ngn=Zu(((t,e)=>{var r=U_();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"})})),ign=Zu(((t,e)=>{var r=OIe(),n=U_();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"]}})})),ogn=Zu(((t,e)=>{var r=OIe(),n=U_(),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"})})),sgn=Zu(((t,e)=>{e.exports=tgn().extend({implicit:[rgn(),ngn(),ign(),ogn()]})})),agn=Zu(((t,e)=>{e.exports=sgn()})),cgn=Zu(((t,e)=>{var r=U_(),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})})),lgn=Zu(((t,e)=>{var r=U_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),ugn=Zu(((t,e)=>{var r=U_(),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=U_(),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=U_(),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=U_(),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})})),z9t=Zu(((t,e)=>{e.exports=agn().extend({implicit:[cgn(),lgn()],explicit:[ugn(),dgn(),fgn(),pgn()]})})),Z8o=Zu(((t,e)=>{var r=OIe(),n=LIe(),o=J8o(),s=z9t(),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 L(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` +`}return g.replace(/\n$/,"")}a(s,"makeSnippet"),e.exports=s})),Q_=Xu(((t,e)=>{var r=UIe(),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})),rgn=Xu(((t,e)=>{var r=UIe(),n=Q_();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(Q_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),ign=Xu(((t,e)=>{e.exports=new(Q_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),ogn=Xu(((t,e)=>{e.exports=new(Q_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),sgn=Xu(((t,e)=>{e.exports=new(rgn())({explicit:[ngn(),ign(),ogn()]})})),agn=Xu(((t,e)=>{var r=Q_();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"})})),cgn=Xu(((t,e)=>{var r=Q_();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"})})),lgn=Xu(((t,e)=>{var r=FIe(),n=Q_();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"]}})})),ugn=Xu(((t,e)=>{var r=FIe(),n=Q_(),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"})})),dgn=Xu(((t,e)=>{e.exports=sgn().extend({implicit:[agn(),cgn(),lgn(),ugn()]})})),fgn=Xu(((t,e)=>{e.exports=dgn()})),pgn=Xu(((t,e)=>{var r=Q_(),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})})),hgn=Xu(((t,e)=>{var r=Q_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),mgn=Xu(((t,e)=>{var r=Q_(),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})})),ggn=Xu(((t,e)=>{var r=Q_(),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=Q_(),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=Q_(),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})})),Z9t=Xu(((t,e)=>{e.exports=fgn().extend({implicit:[pgn(),hgn()],explicit:[mgn(),ggn(),Agn(),ygn()]})})),u6o=Xu(((t,e)=>{var r=FIe(),n=UIe(),o=l6o(),s=Z9t(),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 L(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(L,"simpleEscapeSequence");function B(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(B,"charFromCodepoint");function q(F,be,Qe){be==="__proto__"?Object.defineProperty(F,be,{configurable:!0,enumerable:!0,writable:!0,value:Qe}):F[be]=Qe}a(q,"setProperty");var M=new Array(256),O=new Array(256);for(let F=0;F<256;F++)M[F]=L(F)?1:0,O[F]=L(F);function j(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(j,"State");function Q(F,be){let Qe={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return Qe.snippet=o(Qe),new n(be,Qe)}a(Q,"generateError");function U(F,be){throw Q(F,be)}a(U,"throwError");function Y(F,be){F.onWarning&&F.onWarning.call(null,Q(F,be))}a(Y,"throwWarning");function W(F,be,Qe){let pe=F.anchorMapTransactions;if(pe.length!==0){let Se=pe[pe.length-1];c.call(Se,be)||(Se[be]={existed:c.call(F.anchorMap,be),value:F.anchorMap[be]})}F.anchorMap[be]=Qe}a(W,"storeAnchor");function V(F){F.anchorMapTransactions.push(Object.create(null))}a(V,"beginAnchorTransaction");function z(F){let be=F.anchorMapTransactions.pop(),Qe=F.anchorMapTransactions;if(Qe.length===0)return;let pe=Qe[Qe.length-1],Se=Object.keys(be);for(let Fe=0,te=Se.length;Fe=0;pe-=1){let Se=be[Qe[pe]];Se.existed?F.anchorMap[Qe[pe]]=Se.value:delete F.anchorMap[Qe[pe]]}}a(ie,"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 le={YAML:a(function(be,Qe,pe){be.version!==null&&U(be,"duplication of %YAML directive"),pe.length!==1&&U(be,"YAML directive accepts exactly one argument");let Se=/^([0-9]+)\.([0-9]+)$/.exec(pe[0]);Se===null&&U(be,"ill-formed argument of the YAML directive");let Fe=parseInt(Se[1],10),te=parseInt(Se[2],10);Fe!==1&&U(be,"unacceptable YAML version of the document"),be.version=pe[0],be.checkLineBreaks=te<2,te!==1&&te!==2&&Y(be,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(be,Qe,pe){let Se;pe.length!==2&&U(be,"TAG directive accepts exactly two arguments");let Fe=pe[0];Se=pe[1],_.test(Fe)||U(be,"ill-formed tag handle (first argument) of the TAG directive"),c.call(be.tagMap,Fe)&&U(be,'there is a previously declared suffix for "'+Fe+'" 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[Fe]=Se},"handleTagDirective")};function Le(F,be,Qe,pe){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(Le,"captureSegment");function ge(F,be,Qe,pe){r.isObject(Qe)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Se=Object.keys(Qe);for(let Fe=0,te=Se.length;FeF.maxMergeSeqLength&&U(F,"merge sequence length exceeded maxMergeSeqLength ("+F.maxMergeSeqLength+")");let J=new Set;for(let se=0,me=Fe.length;se1&&(F.result+=r.repeat(` -`,be-1))}a(K,"writeFoldedLines");function he(F,be,Qe){let pe,Se,Fe,te,Te,Ge,J=F.kind,se=F.result,me=F.input.charCodeAt(F.position);if(R(me)||x(me)||me===35||me===38||me===42||me===33||me===124||me===62||me===39||me===34||me===37||me===64||me===96)return!1;if(me===63||me===45){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Qe&&x(Ce))return!1}for(F.kind="scalar",F.result="",pe=Se=F.position,Fe=!1;me!==0;){if(me===58){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Qe&&x(Ce))break}else if(me===35){if(R(F.input.charCodeAt(F.position-1)))break}else{if(F.position===F.lineStart&&ee(F)||Qe&&x(me))break;if(T(me))if(te=F.line,Te=F.lineStart,Ge=F.lineIndent,X(F,!1,-1),F.lineIndent>=be){Fe=!0,me=F.input.charCodeAt(F.position);continue}else{F.position=Se,F.line=te,F.lineStart=Te,F.lineIndent=Ge;break}}Fe&&(Le(F,pe,Se,!1),K(F,F.line-te),pe=Se=F.position,Fe=!1),w(me)||(Se=F.position+1),me=F.input.charCodeAt(++F.position)}return Le(F,pe,Se,!1),F.result?!0:(F.kind=J,F.result=se,!1)}a(he,"readPlainScalar");function Z(F,be){let Qe,pe,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Le(F,Qe,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Qe=F.position,F.position++,pe=F.position;else return!0;else T(Se)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(pe=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(Z,"readSingleQuotedScalar");function ue(F,be){let Qe,pe,Se,Fe=F.input.charCodeAt(F.position);if(Fe!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Fe=F.input.charCodeAt(F.position))!==0;){if(Fe===34)return Le(F,Qe,F.position,!0),F.position++,!0;if(Fe===92){if(Le(F,Qe,F.position,!0),Fe=F.input.charCodeAt(++F.position),T(Fe))X(F,!1,be);else if(Fe<256&&M[Fe])F.result+=O[Fe],F.position++;else if((Se=D(Fe))>0){let te=Se,Te=0;for(;te>0;te--)Fe=F.input.charCodeAt(++F.position),(Se=P(Fe))>=0?Te=(Te<<4)+Se:U(F,"expected hexadecimal character");F.result+=B(Te),F.position++}else U(F,"unknown escape sequence");Qe=pe=F.position}else T(Fe)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Fe)||(pe=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function qe(F,be){let Qe=!0,pe,Se,Fe,te=F.tag,Te,Ge=F.anchor,J,se,me,Ce,He=Object.create(null),$e,et,ct,bt=F.input.charCodeAt(F.position);if(bt===91)J=93,Ce=!1,Te=[];else if(bt===123)J=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(X(F,!0,be),bt=F.input.charCodeAt(F.position),bt===J)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;Qe?bt===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),et=$e=ct=null,se=me=!1,bt===63&&R(F.input.charCodeAt(F.position+1))&&(se=me=!0,F.position++,X(F,!0,be)),pe=F.line,Se=F.lineStart,Fe=F.position,_t(F,be,l,!1,!0),et=F.tag,$e=F.result,X(F,!0,be),bt=F.input.charCodeAt(F.position),(me||F.line===pe)&&bt===58&&(se=!0,bt=F.input.charCodeAt(++F.position),X(F,!0,be),_t(F,be,l,!1,!0),ct=F.result),Ce?Ue(F,Te,He,et,$e,ct,pe,Se,Fe):se?Te.push(Ue(F,null,He,et,$e,ct,pe,Se,Fe)):Te.push($e),X(F,!0,be),bt=F.input.charCodeAt(F.position),bt===44?(Qe=!0,bt=F.input.charCodeAt(++F.position)):Qe=!1}U(F,"unexpected end of the stream within a flow collection")}a(qe,"readFlowCollection");function ne(F,be){let Qe,pe=h,Se=!1,Fe=!1,te=be,Te=0,Ge=!1,J,se=F.input.charCodeAt(F.position);if(se===124)Qe=!1;else if(se===62)Qe=!0;else return!1;for(F.kind="scalar",F.result="";se!==0;)if(se=F.input.charCodeAt(++F.position),se===43||se===45)h===pe?pe=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((J=N(se))>=0)J===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Fe?U(F,"repeat of an indentation width identifier"):(te=be+J-1,Fe=!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(ke(F),F.lineIndent=0,se=F.input.charCodeAt(F.position);(!Fe||F.lineIndentte&&(te=F.lineIndent),T(se)){Te++;continue}if(!Fe&&te===0&&U(F,"missing indentation for block scalar"),F.lineIndent=be){Fe=!0,me=F.input.charCodeAt(F.position);continue}else{F.position=Se,F.line=te,F.lineStart=Te,F.lineIndent=Ge;break}}Fe&&(Le(F,pe,Se,!1),K(F,F.line-te),pe=Se=F.position,Fe=!1),w(me)||(Se=F.position+1),me=F.input.charCodeAt(++F.position)}return Le(F,pe,Se,!1),F.result?!0:(F.kind=J,F.result=se,!1)}a(he,"readPlainScalar");function Z(F,be){let Qe,pe,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Le(F,Qe,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Qe=F.position,F.position++,pe=F.position;else return!0;else T(Se)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(pe=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(Z,"readSingleQuotedScalar");function ue(F,be){let Qe,pe,Se,Fe=F.input.charCodeAt(F.position);if(Fe!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Fe=F.input.charCodeAt(F.position))!==0;){if(Fe===34)return Le(F,Qe,F.position,!0),F.position++,!0;if(Fe===92){if(Le(F,Qe,F.position,!0),Fe=F.input.charCodeAt(++F.position),T(Fe))X(F,!1,be);else if(Fe<256&&M[Fe])F.result+=O[Fe],F.position++;else if((Se=D(Fe))>0){let te=Se,Te=0;for(;te>0;te--)Fe=F.input.charCodeAt(++F.position),(Se=P(Fe))>=0?Te=(Te<<4)+Se:U(F,"expected hexadecimal character");F.result+=B(Te),F.position++}else U(F,"unknown escape sequence");Qe=pe=F.position}else T(Fe)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Fe)||(pe=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function qe(F,be){let Qe=!0,pe,Se,Fe,te=F.tag,Te,Ge=F.anchor,J,se,me,Ce,He=Object.create(null),$e,et,ct,Ct=F.input.charCodeAt(F.position);if(Ct===91)J=93,Ce=!1,Te=[];else if(Ct===123)J=125,Ce=!0,Te={};else return!1;for(F.anchor!==null&&W(F,F.anchor,Te),Ct=F.input.charCodeAt(++F.position);Ct!==0;){if(X(F,!0,be),Ct=F.input.charCodeAt(F.position),Ct===J)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;Qe?Ct===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),et=$e=ct=null,se=me=!1,Ct===63&&R(F.input.charCodeAt(F.position+1))&&(se=me=!0,F.position++,X(F,!0,be)),pe=F.line,Se=F.lineStart,Fe=F.position,Et(F,be,l,!1,!0),et=F.tag,$e=F.result,X(F,!0,be),Ct=F.input.charCodeAt(F.position),(me||F.line===pe)&&Ct===58&&(se=!0,Ct=F.input.charCodeAt(++F.position),X(F,!0,be),Et(F,be,l,!1,!0),ct=F.result),Ce?Ue(F,Te,He,et,$e,ct,pe,Se,Fe):se?Te.push(Ue(F,null,He,et,$e,ct,pe,Se,Fe)):Te.push($e),X(F,!0,be),Ct=F.input.charCodeAt(F.position),Ct===44?(Qe=!0,Ct=F.input.charCodeAt(++F.position)):Qe=!1}U(F,"unexpected end of the stream within a flow collection")}a(qe,"readFlowCollection");function ne(F,be){let Qe,pe=h,Se=!1,Fe=!1,te=be,Te=0,Ge=!1,J,se=F.input.charCodeAt(F.position);if(se===124)Qe=!1;else if(se===62)Qe=!0;else return!1;for(F.kind="scalar",F.result="";se!==0;)if(se=F.input.charCodeAt(++F.position),se===43||se===45)h===pe?pe=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((J=N(se))>=0)J===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Fe?U(F,"repeat of an indentation width identifier"):(te=be+J-1,Fe=!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(ke(F),F.lineIndent=0,se=F.input.charCodeAt(F.position);(!Fe||F.lineIndentte&&(te=F.lineIndent),T(se)){Te++;continue}if(!Fe&&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,Fe=F.lineStart,te=F.position),_t(F,be,f,!0,pe)&&($e?Ce=F.result:He=F.result),$e||(Ue(F,J,se,me,Ce,He,Se,Fe,te),me=Ce=He=null),X(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=Fe=te=f===Qe||d===Qe;if(pe&&X(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 et=0,ct=F.implicitTypes.length;et"),F.result!==null&&me.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+me.kind+'", not "'+F.kind+'"'),me.resolve(F.result,F.tag)?(F.result=me.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||J}a(_t,"composeNode");function Dt(F){let be=F.position,Qe=!1,pe;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(pe=F.input.charCodeAt(F.position))!==0&&(X(F,!0,-1),pe=F.input.charCodeAt(F.position),!(F.lineIndent>0||pe!==37));){Qe=!0,pe=F.input.charCodeAt(++F.position);let Se=F.position;for(;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);let Fe=F.input.slice(Se,F.position),te=[];for(Fe.length<1&&U(F,"directive name must not be less than one character in length");pe!==0;){for(;w(pe);)pe=F.input.charCodeAt(++F.position);if(pe===35){do pe=F.input.charCodeAt(++F.position);while(pe!==0&&!T(pe));break}if(T(pe))break;for(Se=F.position;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}pe!==0&&ke(F),c.call(le,Fe)?le[Fe](F,Fe,te):Y(F,'unknown document directive "'+Fe+'"')}if(X(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,X(F,!0,-1)):Qe&&U(F,"directives end mark is expected"),_t(F,F.lineIndent-1,f,!1,!0),X(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&Y(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,X(F,!0,-1));return}F.position"u"&&(Qe=be,be=null);let pe=$t(F,Qe);if(typeof be!="function")return pe;for(let Se=0,Fe=pe.length;Se{var r=OIe(),n=LIe(),o=z9t(),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,L=93,B=96,q=123,M=124,O=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[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 Y(te,Te){if(Te===null)return{};let Ge={},J=Object.keys(Te);for(let se=0,me=J.length;sebe)&&te!==0)U(F,"bad indentation of a sequence entry");else if(F.lineIndentbe)&&($e&&(Se=F.line,Fe=F.lineStart,te=F.position),Et(F,be,f,!0,pe)&&($e?Ce=F.result:He=F.result),$e||(Ue(F,J,se,me,Ce,He,Se,Fe,te),me=Ce=He=null),X(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=Fe=te=f===Qe||d===Qe;if(pe&&X(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 et=0,ct=F.implicitTypes.length;et"),F.result!==null&&me.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+me.kind+'", not "'+F.kind+'"'),me.resolve(F.result,F.tag)?(F.result=me.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||J}a(Et,"composeNode");function Dt(F){let be=F.position,Qe=!1,pe;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(pe=F.input.charCodeAt(F.position))!==0&&(X(F,!0,-1),pe=F.input.charCodeAt(F.position),!(F.lineIndent>0||pe!==37));){Qe=!0,pe=F.input.charCodeAt(++F.position);let Se=F.position;for(;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);let Fe=F.input.slice(Se,F.position),te=[];for(Fe.length<1&&U(F,"directive name must not be less than one character in length");pe!==0;){for(;w(pe);)pe=F.input.charCodeAt(++F.position);if(pe===35){do pe=F.input.charCodeAt(++F.position);while(pe!==0&&!T(pe));break}if(T(pe))break;for(Se=F.position;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}pe!==0&&ke(F),c.call(le,Fe)?le[Fe](F,Fe,te):Y(F,'unknown document directive "'+Fe+'"')}if(X(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,X(F,!0,-1)):Qe&&U(F,"directives end mark is expected"),Et(F,F.lineIndent-1,f,!1,!0),X(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&Y(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,X(F,!0,-1));return}F.position"u"&&(Qe=be,be=null);let pe=$t(F,Qe);if(typeof be!="function")return pe;for(let Se=0,Fe=pe.length;Se{var r=FIe(),n=UIe(),o=Z9t(),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,L=93,B=96,q=123,M=124,O=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[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 Y(te,Te){if(Te===null)return{};let Ge={},J=Object.keys(Te);for(let se=0,me=J.length;se=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ge,"isPrintable");function Ue(te){return ge(te)&&te!==l&&te!==f&&te!==d}a(Ue,"isNsCharOrWhitespace");function ke(te,Te,Ge){let J=Ue(te),se=J&&!Le(te);return(Ge?J:J&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O)&&te!==A&&!(Te===w&&!se)||Ue(Te)&&!Le(Te)&&te===A||Te===w&&se}a(ke,"isPlainSafe");function X(te){return ge(te)&&te!==l&&!Le(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O&&te!==A&&te!==E&&te!==v&&te!==m&&te!==M&&te!==R&&te!==x&&te!==_&&te!==g&&te!==y&&te!==D&&te!==B}a(X,"isPlainSafeFirst");function ee(te){return!Le(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),J;return Ge>=55296&&Ge<=56319&&Te+1=56320&&J<=57343)?(Ge-55296)*1024+J-56320+65536:Ge}a(K,"codePointAt");function he(te){return/^\n* /.test(te)}a(he,"needIndentIndicator");var Z=1,ue=2,qe=3,ne=4,ce=5;function Ne(te,Te,Ge,J,se,me,Ce,He){let $e,et=0,ct=null,bt=!1,ht=!1,We=J!==-1,ae=-1,Re=X(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}else{for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),et===d)bt=!0,We&&(ht=ht||$e-ae-1>J&&te[ae+1]!==" ",ae=$e);else if(!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}ht=ht||We&&$e-ae-1>J&&te[ae+1]!==" "}return!bt&&!ht?Re&&!Ce&&!se(te)?Z:me===z?ce:ue:Ge>9&&he(te)?ce:Ce?me===z?ce:ue:ht?ne:qe}a(Ne,"chooseScalarStyle");function we(te,Te,Ge,J,se){te.dump=(function(){if(Te.length===0)return te.quotingType===z?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===z?'"'+Te+'"':"'"+Te+"'";let me=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-me),He=J||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(et){return le(te,et)}switch(a($e,"testAmbiguity"),Ne(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!J,se)){case Z:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case qe:return"|"+Be(Te,te.indent)+rt(H(Te,me));case ne:return">"+Be(Te,te.indent)+rt(H(st(Te,Ce),me));case ce:return'"'+Dt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Be(te,Te){let Ge=he(te)?String(Te):"",J=te[te.length-1]===` +`+r.repeat(" ",te.indent*Te)}a(re,"generateNextLine");function le(te,Te){for(let Ge=0,J=te.implicitTypes.length;Ge=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ge,"isPrintable");function Ue(te){return ge(te)&&te!==l&&te!==f&&te!==d}a(Ue,"isNsCharOrWhitespace");function ke(te,Te,Ge){let J=Ue(te),se=J&&!Le(te);return(Ge?J:J&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O)&&te!==A&&!(Te===w&&!se)||Ue(Te)&&!Le(Te)&&te===A||Te===w&&se}a(ke,"isPlainSafe");function X(te){return ge(te)&&te!==l&&!Le(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O&&te!==A&&te!==E&&te!==v&&te!==m&&te!==M&&te!==R&&te!==x&&te!==_&&te!==g&&te!==y&&te!==D&&te!==B}a(X,"isPlainSafeFirst");function ee(te){return!Le(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),J;return Ge>=55296&&Ge<=56319&&Te+1=56320&&J<=57343)?(Ge-55296)*1024+J-56320+65536:Ge}a(K,"codePointAt");function he(te){return/^\n* /.test(te)}a(he,"needIndentIndicator");var Z=1,ue=2,qe=3,ne=4,ce=5;function Me(te,Te,Ge,J,se,me,Ce,He){let $e,et=0,ct=null,Ct=!1,ht=!1,We=J!==-1,ae=-1,Re=X(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}else{for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),et===d)Ct=!0,We&&(ht=ht||$e-ae-1>J&&te[ae+1]!==" ",ae=$e);else if(!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}ht=ht||We&&$e-ae-1>J&&te[ae+1]!==" "}return!Ct&&!ht?Re&&!Ce&&!se(te)?Z:me===z?ce:ue:Ge>9&&he(te)?ce:Ce?me===z?ce:ue:ht?ne:qe}a(Me,"chooseScalarStyle");function we(te,Te,Ge,J,se){te.dump=(function(){if(Te.length===0)return te.quotingType===z?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===z?'"'+Te+'"':"'"+Te+"'";let me=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-me),He=J||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(et){return le(te,et)}switch(a($e,"testAmbiguity"),Me(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!J,se)){case Z:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case qe:return"|"+Be(Te,te.indent)+rt(H(Te,me));case ne:return">"+Be(Te,te.indent)+rt(H(st(Te,Ce),me));case ce:return'"'+Dt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Be(te,Te){let Ge=he(te)?String(Te):"",J=te[te.length-1]===` `;return Ge+(J&&(te[te.length-2]===` `||te===` `)?"+":J?"":"-")+` `}a(Be,"blockHeader");function rt(te){return te[te.length-1]===` `?te.slice(0,-1):te}a(rt,"dropEndingNewline");function st(te,Te){let Ge=/(\n+)([^\n]*)/g,J=(function(){let He=te.indexOf(` -`);return He=He!==-1?He:te.length,Ge.lastIndex=He,_t(te.slice(0,He),Te)})(),se=te[0]===` +`);return He=He!==-1?He:te.length,Ge.lastIndex=He,Et(te.slice(0,He),Te)})(),se=te[0]===` `||te[0]===" ",me,Ce;for(;Ce=Ge.exec(te);){let He=Ce[1],$e=Ce[2];me=$e[0]===" ",J+=He+(!se&&!me&&$e!==""?` -`:"")+_t($e,Te),se=me}return J}a(st,"foldString");function _t(te,Te){if(te===""||te[0]===" ")return te;let Ge=/ [^ ]/g,J,se=0,me,Ce=0,He=0,$e="";for(;J=Ge.exec(te);)He=J.index,He-se>Te&&(me=Ce>se?Ce:He,$e+=` +`:"")+Et($e,Te),se=me}return J}a(st,"foldString");function Et(te,Te){if(te===""||te[0]===" ")return te;let Ge=/ [^ ]/g,J,se=0,me,Ce=0,He=0,$e="";for(;J=Ge.exec(te);)He=J.index,He-se>Te&&(me=Ce>se?Ce:He,$e+=` `+te.slice(se,me),se=me+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(_t,"foldLine");function Dt(te){let Te="",Ge=0;for(let J=0;J=65536?J+=2:J++){Ge=K(te,J);let se=j[Ge];!se&&ge(Ge)?(Te+=te[J],Ge>=65536&&(Te+=te[J+1])):Te+=se||W(Ge)}return Te}a(Dt,"escapeString");function $t(te,Te,Ge){let J="",se=te.tag;for(let me=0,Ce=Ge.length;me"u"&&Qe(te,Te,null,!1,!1))&&(J!==""&&(J+=","+(te.condenseFlow?"":" ")),J+=te.dump)}te.tag=se,te.dump="["+J+"]"}a($t,"writeFlowSequence");function Gt(te,Te,Ge,J){let se="",me=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Qe(te,Te+1,null,!0,!0,!1,!0))&&((!J||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=me,te.dump=se||"[]"}a(Gt,"writeBlockSequence");function Ie(te,Te,Ge){let J="",se=te.tag,me=Object.keys(Ge);for(let Ce=0,He=me.length;Ce1024&&($e+="? "),$e+=te.dump+(te.condenseFlow?'"':"")+":"+(te.condenseFlow?"":" "),Qe(te,Te,ct,!1,!1)&&($e+=te.dump,J+=$e))}te.tag=se,te.dump="{"+J+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,J){let se="",me=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 et="";(!J||se!=="")&&(et+=re(te,Te));let ct=Ce[He],bt=Ge[ct];if(te.replacer&&(bt=te.replacer.call(Ge,ct,bt)),!Qe(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)?et+="?":et+="? "),et+=te.dump,ht&&(et+=re(te,Te)),Qe(te,Te+1,bt,!0,ht)&&(te.dump&&d===te.dump.charCodeAt(0)?et+=":":et+=": ",et+=te.dump,se+=et)}te.tag=me,te.dump=se||"{}"}a(F,"writeBlockMapping");function be(te,Te,Ge){let J=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,me=J.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Qe(te,Te,Ge,J,se,me,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=J;J&&(J=te.flowLevel<0||te.flowLevel>Te);let et=He==="[object Object]"||He==="[object Array]",ct,bt;if(et&&(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(et&&bt&&!te.usedDuplicates[ct]&&(te.usedDuplicates[ct]=!0),He==="[object Object]")J&&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]")J&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?Gt(te,Te-1,te.dump,se):Gt(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):($t(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object String]")te.tag!=="?"&&we(te,te.dump,Te,me,$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(Qe,"writeNode");function pe(te,Te){let Ge=[],J=[];Se(te,Ge,J);let se=J.length;for(let me=0;me{var r=Z8o(),n=X8o();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=U_(),e.exports.Schema=J0n(),e.exports.FAILSAFE_SCHEMA=tgn(),e.exports.JSON_SCHEMA=sgn(),e.exports.CORE_SCHEMA=agn(),e.exports.DEFAULT_SCHEMA=z9t(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=LIe(),e.exports.types={binary:ugn(),float:ogn(),map:egn(),null:rgn(),pairs:fgn(),set:pgn(),timestamp:cgn(),bool:ngn(),int:ign(),merge:lgn(),omap:dgn(),seq:X0n(),str:Z0n()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:U8u,Schema:Q8u,FAILSAFE_SCHEMA:q8u,JSON_SCHEMA:j8u,CORE_SCHEMA:H8u,DEFAULT_SCHEMA:G8u,load:$8u,loadAll:V8u,dump:fK,YAMLException:W8u,types:z8u,safeLoad:Y8u,safeLoadAll:K8u,safeDump:J8u}=hgn.default,Z8u=hgn.default;function ggn(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=fK(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- +`+te.slice(Ce+1):$e+=te.slice(se),$e.slice(1)}a(Et,"foldLine");function Dt(te){let Te="",Ge=0;for(let J=0;J=65536?J+=2:J++){Ge=K(te,J);let se=j[Ge];!se&&ge(Ge)?(Te+=te[J],Ge>=65536&&(Te+=te[J+1])):Te+=se||W(Ge)}return Te}a(Dt,"escapeString");function $t(te,Te,Ge){let J="",se=te.tag;for(let me=0,Ce=Ge.length;me"u"&&Qe(te,Te,null,!1,!1))&&(J!==""&&(J+=","+(te.condenseFlow?"":" ")),J+=te.dump)}te.tag=se,te.dump="["+J+"]"}a($t,"writeFlowSequence");function Gt(te,Te,Ge,J){let se="",me=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Qe(te,Te+1,null,!0,!0,!1,!0))&&((!J||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=me,te.dump=se||"[]"}a(Gt,"writeBlockSequence");function Ie(te,Te,Ge){let J="",se=te.tag,me=Object.keys(Ge);for(let Ce=0,He=me.length;Ce1024&&($e+="? "),$e+=te.dump+(te.condenseFlow?'"':"")+":"+(te.condenseFlow?"":" "),Qe(te,Te,ct,!1,!1)&&($e+=te.dump,J+=$e))}te.tag=se,te.dump="{"+J+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,J){let se="",me=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 et="";(!J||se!=="")&&(et+=re(te,Te));let ct=Ce[He],Ct=Ge[ct];if(te.replacer&&(Ct=te.replacer.call(Ge,ct,Ct)),!Qe(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)?et+="?":et+="? "),et+=te.dump,ht&&(et+=re(te,Te)),Qe(te,Te+1,Ct,!0,ht)&&(te.dump&&d===te.dump.charCodeAt(0)?et+=":":et+=": ",et+=te.dump,se+=et)}te.tag=me,te.dump=se||"{}"}a(F,"writeBlockMapping");function be(te,Te,Ge){let J=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,me=J.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Qe(te,Te,Ge,J,se,me,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=J;J&&(J=te.flowLevel<0||te.flowLevel>Te);let et=He==="[object Object]"||He==="[object Array]",ct,Ct;if(et&&(ct=te.duplicates.indexOf(Ge),Ct=ct!==-1),(te.tag!==null&&te.tag!=="?"||Ct||te.indent!==2&&Te>0)&&(se=!1),Ct&&te.usedDuplicates[ct])te.dump="*ref_"+ct;else{if(et&&Ct&&!te.usedDuplicates[ct]&&(te.usedDuplicates[ct]=!0),He==="[object Object]")J&&Object.keys(te.dump).length!==0?(F(te,Te,te.dump,se),Ct&&(te.dump="&ref_"+ct+te.dump)):(Ie(te,Te,te.dump),Ct&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object Array]")J&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?Gt(te,Te-1,te.dump,se):Gt(te,Te,te.dump,se),Ct&&(te.dump="&ref_"+ct+te.dump)):($t(te,Te,te.dump),Ct&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object String]")te.tag!=="?"&&we(te,te.dump,Te,me,$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(Qe,"writeNode");function pe(te,Te){let Ge=[],J=[];Se(te,Ge,J);let se=J.length;for(let me=0;me{var r=u6o(),n=d6o();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=Q_(),e.exports.Schema=rgn(),e.exports.FAILSAFE_SCHEMA=sgn(),e.exports.JSON_SCHEMA=dgn(),e.exports.CORE_SCHEMA=fgn(),e.exports.DEFAULT_SCHEMA=Z9t(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=UIe(),e.exports.types={binary:mgn(),float:ugn(),map:ogn(),null:agn(),pairs:Agn(),set:ygn(),timestamp:pgn(),bool:cgn(),int:lgn(),merge:hgn(),omap:ggn(),seq:ign(),str:ngn()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:n6u,Schema:i6u,FAILSAFE_SCHEMA:o6u,JSON_SCHEMA:s6u,CORE_SCHEMA:a6u,DEFAULT_SCHEMA:c6u,load:l6u,loadAll:u6u,dump:mK,YAMLException:d6u,types:f6u,safeLoad:p6u,safeLoadAll:h6u,safeDump:m6u}=Egn.default,g6u=Egn.default;function vgn(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=mK(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- ${n} --- ${o} -`}a(ggn,"generateAgentMarkdown");p();p();p();p();p();p();var BIe={isBlocked:!1,reason:"VALID_FILE"},Aze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Agn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},pK={all:"all",repo:"repo"},jQ=new fe("contentExclusion");p();p();var yze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var Y9t=new fe("repository"),hK=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(".")}},NP=class{static{a(this,"GitConfigLoader")}},Eze=class extends NP{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 ygn=require("os");var _ze=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 LU.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=LU.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,ygn.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 vze=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(NP).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 _ze(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 e6o=100,K9t=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])}}},_f=class t{constructor(e){this.ctx=e;this.remoteResolver=new vze;this.cache=new Cn(e6o)}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=uf(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 K9t(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(Qo),o=wa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=wa(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=$W(r,s[1]),l=wa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=wa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=wa(c,"commondir");c=$W(c,(await e.readFileString(d)).trimEnd());let f=wa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var mK=a((t,e)=>{if(XM.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...XM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var Cze=new WeakMap;function bze(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]"&&Cze.has(t))return Cze.get(t);switch(Cze.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(t6o,"n");function vgn(t,e){return function(r,n){return t6o(t,e,r,n)}}a(vgn,"o");p();p();p();var Z9t=a((t,e,r)=>{let n=t instanceof RegExp?Cgn(t,r):t,o=e instanceof RegExp?Cgn(e,r):e,s=n!==null&&o!=null&&r6o(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"),Cgn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),r6o=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 bgn="\0SLASH"+Math.random()+"\0",Sgn="\0OPEN"+Math.random()+"\0",eUt="\0CLOSE"+Math.random()+"\0",Tgn="\0COMMA"+Math.random()+"\0",Ign="\0PERIOD"+Math.random()+"\0",n6o=new RegExp(bgn,"g"),i6o=new RegExp(Sgn,"g"),o6o=new RegExp(eUt,"g"),s6o=new RegExp(Tgn,"g"),a6o=new RegExp(Ign,"g"),c6o=/\\\\/g,l6o=/\\{/g,u6o=/\\}/g,d6o=/\\,/g,f6o=/\\\./g,p6o=1e5;function X9t(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(X9t,"numeric");function h6o(t){return t.replace(c6o,bgn).replace(l6o,Sgn).replace(u6o,eUt).replace(d6o,Tgn).replace(f6o,Ign)}a(h6o,"escapeBraces");function m6o(t){return t.replace(n6o,"\\").replace(i6o,"{").replace(o6o,"}").replace(s6o,",").replace(a6o,".")}a(m6o,"unescapeBraces");function xgn(t){if(!t)return[""];let e=[],r=Z9t("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=xgn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(xgn,"parseCommaParts");function wgn(t,e={}){if(!t)return[];let{max:r=p6o}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),FIe(h6o(t),r,!0).map(m6o)}a(wgn,"expand");function g6o(t){return"{"+t+"}"}a(g6o,"embrace");function A6o(t){return/^-?0\d/.test(t)}a(A6o,"isPadded");function y6o(t,e){return t<=e}a(y6o,"lte");function E6o(t,e){return t>=e}a(E6o,"gte");function FIe(t,e,r){let n=[],o=Z9t("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?FIe(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+eUt+o.post,FIe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=xgn(o.body),h.length===1&&h[0]!==void 0&&(h=FIe(h[0],e,!1).map(g6o),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=X9t(h[0]),A=X9t(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(X9t(h[2])),1):1,_=y6o;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 _6o={"[: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]},QIe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),v6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Rgn=a(t=>t.join(""),"rangesToString"),kgn=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(QIe(h)+"-"+QIe(y)):y===h&&n.push(QIe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(QIe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(QIe(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 MC,C6o=new Set(["!","?","+","*","@"]),tUt=a(t=>C6o.has(t),"isExtglobType"),Pgn=a(t=>tUt(t.type),"isExtglobAST"),b6o=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),S6o=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),T6o=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Dgn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),I6o="(?!(?:^|/)\\.\\.?(?:$|/))",Tze="(?!\\.)",x6o=new Set(["[","."]),w6o=new Set(["..","."]),R6o=new Set("().*{}+?[]^$\\!"),k6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),rUt="[^/]",Ngn=rUt+"*?",Mgn=rUt+"+?",P6o=0,gK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++P6o;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"?MC.#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&&w6o.has(this.#n[0]))){let A=x6o,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?I6o:E?Tze:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,MP(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,MP(this.toString()),!1,!1]}let c=!n||e||r||!Tze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?Tze:"")+Mgn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Tze:"")+Ngn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,MP(s),this.#t=!!this.#t,this.#r]}#S(){if(Pgn(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 vf=a((t,e,r={})=>(UIe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Q_(e,r).match(t)),"minimatch"),D6o=/^\*+([^+@!?*[(]*)$/,N6o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),M6o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),O6o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),L6o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),B6o=/^\*+\.\*+$/,F6o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),U6o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),Q6o=/^\.\*+$/,q6o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),j6o=/^\*+$/,H6o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),G6o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),$6o=/^\?+([^+@!?*[(]*)?$/,V6o=a(([t,e=""])=>{let r=Bgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),W6o=a(([t,e=""])=>{let r=Fgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),z6o=a(([t,e=""])=>{let r=Fgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),Y6o=a(([t,e=""])=>{let r=Bgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),Bgn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Fgn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Ugn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ogn={win32:{sep:"\\"},posix:{sep:"/"}},K6o=Ugn==="win32"?Ogn.win32.sep:Ogn.posix.sep;vf.sep=K6o;var Jp=Symbol("globstar **");vf.GLOBSTAR=Jp;var J6o="[^/]",Z6o=J6o+"*?",X6o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",e9o="(?:(?!(?:\\/|^)\\.).)*?",t9o=a((t,e={})=>r=>vf(r,t,e),"filter");vf.filter=t9o;var Wx=a((t,e={})=>Object.assign({},t,e),"ext"),r9o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return vf;let e=vf;return Object.assign(a((n,o,s={})=>e(n,o,Wx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Wx(t,s))}static defaults(o){return e.defaults(Wx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Wx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Wx(t,s))}},unescape:a((n,o={})=>e.unescape(n,Wx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Wx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Wx(t,o)),"filter"),defaults:a(n=>e.defaults(Wx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Wx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Wx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Wx(t,s)),"match"),sep:e.sep,GLOBSTAR:Jp})},"defaults");vf.defaults=r9o;var Qgn=a((t,e={})=>(UIe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:wgn(t,{max:e.braceExpandMax})),"braceExpand");vf.braceExpand=Qgn;var n9o=a((t,e={})=>new Q_(t,e).makeRe(),"makeRe");vf.makeRe=n9o;var i9o=a((t,e,r={})=>{let n=new Q_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");vf.match=i9o;var Lgn=/[?*]|[+@!]\(.*?\)|\[|\]/,o9o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Q_=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={}){UIe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Ugn,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]==="?"||!Lgn.test(s[2]))&&!Lgn.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"?o9o(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 vf.defaults(e).Minimatch}};vf.AST=gK;vf.Minimatch=Q_;vf.escape=Lle;vf.unescape=MP;var nUt="contentExclusion",Ize=class extends yze{static{a(this,"CopilotContentExclusion")}#e;#t=new Cn(1e4);#r=new Cn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=$W(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??pK.all);if(!o)return Aze;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 jQ.exception(this.#e,n,`${nUt}.evaluate`),Agn}return BIe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=BIe,c,l=BDt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(vf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=iUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return jQ.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 BIe;let c=this.evaluateFileContent(o,s,n);return jQ.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=>qgn(c)).some(c=>c.test(n)))return iUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>qgn(c)).some(c=>c.test(n)))return iUt(o,"FILE_BLOCKED_TEXT_BASED");return BIe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){qa(this.#e,e,`${nUt}.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=vgn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new yi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(pK.all);e.filter(u=>u!==pK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==pK.all).join(",")),n.searchParams.set("scope",o?pK.all:pK.repo);let c=await Gf(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 aM(c)}return this.#s("fetch.success"),mK(l9o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(_f).getRepo(uf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){Et(this.#e,`${nUt}.${e}`,Wt.createAndMarkAsIssued(r,n))}};function qgn(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(qgn,"stringToRegex");function iUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(iUt,"fileBlockedEvaluationResult");var s9o=S.Object({name:S.String(),type:S.String()}),a9o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:s9o}),oUt=S.Array(a9o),c9o=S.Object({rules:oUt,last_updated_at:S.String(),scope:S.String()}),l9o=S.Array(c9o);var nc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new Ize(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($r).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=z0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),bs(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){jQ.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(ps).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ps).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===Aze.reason)return jQ.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 Et(this.ctx,e,Wt.createAndMarkAsIssued(l,u)),Et(this.ctx,e,Wt.createAndMarkAsIssued({...l,path:r},u),1),jQ.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 Ble(t,e,r){let n=await t.get(nc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Ble,"isDocumentValid");var $r=class{constructor(e,r=Ble){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=Fs(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(Qo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Qo).readFileString(e)}getWorkspaceFolder(e){let r=Fs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Fs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Fs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Fs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ji(r)}};p();p();var ot=new fe("chat");p();var xze=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Wi;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 zx=class{constructor(e){this.ctx=e;this.watchers=new Cn(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(z0(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 HQ=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},u9o="workspaceLifecycleManager",sE=new fe(u9o),US=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=bs(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?sE.debug(this.ctx,`listener ${e.constructor.name} is already started`):(sE.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):sE.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);sE.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get($r).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get($r).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){sE.debug(r,"No workspaces to add.");return}sE.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];sE.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)));sE.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));sE.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));sE.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){sE.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(zx).terminateWatching(l);for(let d of this.activeListeners)sE.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;sE.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(zx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){sE.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)sE.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)sE.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(zx).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 wze(t){t.set(US,new US(t))}a(wze,"setupWorkspaceLifecycleListener");var GQ=de(require("fs")),Yx=de(require("path"));var sUt=".agent.md",d9o=300*1e3,f9o="github",Hgn="agents";function qIe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(qIe,"sanitizeSegment");function p9o(t){return t.replace(/\\/g,"/")}a(p9o,"toPosix");var w3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new fe("OrgCustomAgentService");this.fetchSequencer=new Vx;this.activated=!1;this.orgs=new Map;this.client=o.client??new gze(e),this.resolveNwo=o.resolveNwo??(s=>W9t(s,[e.get($m).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??d9o,this.cacheRoot=Yx.join(this.persistenceManager.directory,f9o),this.lifecycleListener=new aUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=p9o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Hgn}/*${sUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:Ggn.githubOrg}),this.tokenSubscription=bs(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=>Fs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(qIe(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=Yx.relative(this.cacheRoot,e);if(r.startsWith("..")||Yx.isAbsolute(r))return;let n=r.indexOf(Yx.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=un(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Fs(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=Fs(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(Ft(this.ctx,Ye.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await GQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${sUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Yx.join(o,l),ggn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Yx.join(this.cacheRoot,qIe(e.owner),qIe(e.repo),Hgn)}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 GQ.promises.stat(e)).size===n.length&&(await GQ.promises.readFile(e)).equals(n))return}catch{}await GQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await GQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(sUt)&&!r.has(o.name))try{await GQ.promises.unlink(Yx.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=Yx.join(this.cacheRoot,qIe(e.owner),qIe(e.repo));try{await GQ.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)}`)}}},aUt=class extends HQ{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 a0=class{static{a(this,"PromptChangeNotifier")}},Rze=class extends a0{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function $gn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a($gn,"createPromptFilesChangedEvent");function Vgn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Vgn,"createBatchPromptFilesChangedEvent");p();var ep=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 Fle(...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(Fle,"anyEvent");var Kgn=require("os"),jIe=de(require("path"));function Ule(t){return t.replace(/\\/g,"/")}a(Ule,"toForwardSlash");function Wgn(...t){return jIe.default.posix.join(...t.map(Ule))}a(Wgn,"globJoin");function m9o(t){let e=Ule(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(m9o,"containsTraversal");function zgn(t,e){let r=Ule(jIe.default.posix.normalize(Ule(t))),n=Ule(jIe.default.posix.normalize(Ule(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(zgn,"isContained");var Ygn=["*","?","{","["],wA=class{constructor(e,r){this.ctx=e;this.logger=new fe("PromptFileLocationRegistry");this._onLocationsChanged=new ep;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Kgn.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(m9o(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=Ygn.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=Wgn(f,d.pattern.slice(2));if(!zgn(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=Wgn(f,d.pattern);zgn(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 Ygn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire($gn(e,"ConfigChanged"))}};p();p();p();p();var cUt=de(require("path"));function Kx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=cUt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!cUt.posix.isAbsolute(s)}a(Kx,"isEqualOrParent");var OC=process.platform==="linux";function $Q(t){return t.replace(/\\/g,"/")}a($Q,"normalizeSlashes");function lg(t){let e=$Q(t);return OC?e:e.toLowerCase()}a(lg,"canonicalKey");function Jgn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>OC?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&&Kx(h,d,OC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Jgn,"coalesceEvents");var kze=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Fle(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Fle(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 k3=de(require("fs"));var AK=new fe("NodeJSWatcherService"),g9o=1e3,Pze=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??k3.watch,this._fsWatchFile=o??{watchFile:k3.watchFile,unwatchFile:k3.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=$Q(e.path),n=lg(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){AK.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){AK.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return k3.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?E9o(e,$Q(o)):e,c=A9o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),AK.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}),AK.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){AK.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=y9o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:g9o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),AK.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){AK.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function A9o(t,e){if(t==="change")return"update";try{return k3.statSync(e),"create"}catch{return"delete"}}a(A9o,"classify");function y9o(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(y9o,"classifyStat");function E9o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(E9o,"joinPosix");p();var PAn=de(kAn()),DAn=require("os"),NAn=de(require("path"));var Oze=new fe("ParcelWatcherService"),lUo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",uUo=process.platform==="darwin"?[NAn.join((0,DAn.homedir)(),"Library","Containers")]:[],Lze=class{constructor(e,r){this.ctx=e;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;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??PAn.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=$Q(e.path),n=lg(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=$Q(e),o=this._findCoveringRoot(n);if(!o)return;let s=lg(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(Kx(r.path,e,OC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Kx(e.path,o.path,OC)){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=lg(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:lUo,ignore:uUo}).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=lg(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=$Q(s.path);n.push({path:c,type:s.type})}let o=Jgn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=lg(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(ts).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 Bze(t){let e=new Lze(t),r=new Pze(t,e);return new kze(t,e,r)}a(Bze,"createUniversalWatcher");var MAn=de(require("fs"));var VQ=de(require("path"));var dUo=100,Fze=/[*?{[]/,EUt=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"||!Kx(e.path,this.request.path,OC)&&!Kx(this.request.path,e.path,OC))return;this._tryActivate();return}e.type==="delete"&&Kx(e.path,this.request.path,OC)&&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=VQ.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=fUo(this.request.path,this.statSync);if(n===void 0||pUo(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 fUo(t,e){let r=VQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=VQ.dirname(r)}}a(fUo,"findExistingAncestor");function pUo(t,e){return VQ.dirname(e)===t?!1:t===VQ.parse(t).root}a(pUo,"isAncestorTooBroad");var Uze=class{constructor(e,r,n=MAn.statSync){this._onPromptFileChanged=new ep;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??Bze(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 Q_(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=Vgn([...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 EUt(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 VQ.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=Kx(r.path,l,OC),d=Kx(l,r.path,OC);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()},dUo)}_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 Jx(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Jx,"localize");function hUo(t,e=[],r={}){let o=new _Ut(t).scan();return new vUt(o,t,e,r).parse()}a(hUo,"parseRaw");function Xp(t,e,r,n){return{type:t,startOffset:e,endOffset:r,rawValue:n?.rawValue??"",value:n?.value??"",format:n?.format??"none",indent:n?.indent??0}}a(Xp,"makeToken");var _Ut=class{constructor(e){this.input=e;this.pos=0;this.tokens=[];this.flowDepth=0;this.seenBlockColon=!1;this.seenDocumentStart=0}static{a(this,"YamlScanner")}scan(e=1){for(;this.pose)););return this.tokens.push(Xp(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` -`){this.tokens.push(Xp(8,this.pos,this.pos+1)),this.pos++;return}if(this.peekChar()==="\r"){let n=this.pos+(this.input[this.pos+1]===` -`?2:1);this.tokens.push(Xp(8,this.pos,n)),this.pos=n;return}let e=this.pos,r=0;for(;this.pos0&&this.tokens.push(Xp(9,e,this.pos,{indent:r})),this.pos>=this.input.length||this.peekChar()===` +`}a(vgn,"generateAgentMarkdown");p();p();p();p();p();p();var QIe={isBlocked:!1,reason:"VALID_FILE"},Cze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Cgn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},gK={all:"all",repo:"repo"},GQ=new fe("contentExclusion");p();p();var bze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var X9t=new fe("repository"),AK=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(".")}},OP=class{static{a(this,"GitConfigLoader")}},Sze=class extends OP{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 bgn=require("os");var Tze=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 FU.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=FU.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,bgn.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 Ize=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(OP).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 Tze(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 f6o=100,eUt=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])}}},Cf=class t{constructor(e){this.ctx=e;this.remoteResolver=new Ize;this.cache=new Cn(f6o)}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=ff(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 eUt(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(qo),o=Ra(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=Ra(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=YW(r,s[1]),l=Ra(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=Ra(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=Ra(c,"commondir");c=YW(c,(await e.readFileString(d)).trimEnd());let f=Ra(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var yK=a((t,e)=>{if(rO.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...rO.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");p();p();p();var xze=new WeakMap;function wze(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]"&&xze.has(t))return xze.get(t);switch(xze.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(p6o,"n");function Ign(t,e){return function(r,n){return p6o(t,e,r,n)}}a(Ign,"o");p();p();p();var rUt=a((t,e,r)=>{let n=t instanceof RegExp?xgn(t,r):t,o=e instanceof RegExp?xgn(e,r):e,s=n!==null&&o!=null&&h6o(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"),xgn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),h6o=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 wgn="\0SLASH"+Math.random()+"\0",Rgn="\0OPEN"+Math.random()+"\0",iUt="\0CLOSE"+Math.random()+"\0",kgn="\0COMMA"+Math.random()+"\0",Pgn="\0PERIOD"+Math.random()+"\0",m6o=new RegExp(wgn,"g"),g6o=new RegExp(Rgn,"g"),A6o=new RegExp(iUt,"g"),y6o=new RegExp(kgn,"g"),E6o=new RegExp(Pgn,"g"),_6o=/\\\\/g,v6o=/\\{/g,C6o=/\\}/g,b6o=/\\,/g,S6o=/\\\./g,T6o=1e5;function nUt(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(nUt,"numeric");function I6o(t){return t.replace(_6o,wgn).replace(v6o,Rgn).replace(C6o,iUt).replace(b6o,kgn).replace(S6o,Pgn)}a(I6o,"escapeBraces");function x6o(t){return t.replace(m6o,"\\").replace(g6o,"{").replace(A6o,"}").replace(y6o,",").replace(E6o,".")}a(x6o,"unescapeBraces");function Dgn(t){if(!t)return[""];let e=[],r=rUt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=Dgn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(Dgn,"parseCommaParts");function Ngn(t,e={}){if(!t)return[];let{max:r=T6o}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),qIe(I6o(t),r,!0).map(x6o)}a(Ngn,"expand");function w6o(t){return"{"+t+"}"}a(w6o,"embrace");function R6o(t){return/^-?0\d/.test(t)}a(R6o,"isPadded");function k6o(t,e){return t<=e}a(k6o,"lte");function P6o(t,e){return t>=e}a(P6o,"gte");function qIe(t,e,r){let n=[],o=rUt("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?qIe(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+iUt+o.post,qIe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=Dgn(o.body),h.length===1&&h[0]!==void 0&&(h=qIe(h[0],e,!1).map(w6o),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=nUt(h[0]),A=nUt(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(nUt(h[2])),1):1,_=k6o;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 D6o={"[: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]},HIe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),N6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Mgn=a(t=>t.join(""),"rangesToString"),Ogn=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(HIe(h)+"-"+HIe(y)):y===h&&n.push(HIe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(HIe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(HIe(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 OC,M6o=new Set(["!","?","+","*","@"]),oUt=a(t=>M6o.has(t),"isExtglobType"),Lgn=a(t=>oUt(t.type),"isExtglobAST"),O6o=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),L6o=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),B6o=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Bgn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),F6o="(?!(?:^|/)\\.\\.?(?:$|/))",kze="(?!\\.)",U6o=new Set(["[","."]),Q6o=new Set(["..","."]),q6o=new Set("().*{}+?[]^$\\!"),j6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),sUt="[^/]",Fgn=sUt+"*?",Ugn=sUt+"+?",H6o=0,EK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++H6o;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"?OC.#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&&Q6o.has(this.#n[0]))){let A=U6o,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?F6o:E?kze:""}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||!kze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?kze:"")+Ugn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?kze:"")+Fgn+")":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(Lgn(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 bf=a((t,e,r={})=>(jIe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new q_(e,r).match(t)),"minimatch"),G6o=/^\*+([^+@!?*[(]*)$/,$6o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),V6o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),W6o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),z6o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),Y6o=/^\*+\.\*+$/,K6o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),J6o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),Z6o=/^\.\*+$/,X6o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),e9o=/^\*+$/,t9o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),r9o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),n9o=/^\?+([^+@!?*[(]*)?$/,i9o=a(([t,e=""])=>{let r=jgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),o9o=a(([t,e=""])=>{let r=Hgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),s9o=a(([t,e=""])=>{let r=Hgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),a9o=a(([t,e=""])=>{let r=jgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),jgn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Hgn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Ggn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Qgn={win32:{sep:"\\"},posix:{sep:"/"}},c9o=Ggn==="win32"?Qgn.win32.sep:Qgn.posix.sep;bf.sep=c9o;var Xp=Symbol("globstar **");bf.GLOBSTAR=Xp;var l9o="[^/]",u9o=l9o+"*?",d9o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",f9o="(?:(?!(?:\\/|^)\\.).)*?",p9o=a((t,e={})=>r=>bf(r,t,e),"filter");bf.filter=p9o;var Yx=a((t,e={})=>Object.assign({},t,e),"ext"),h9o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return bf;let e=bf;return Object.assign(a((n,o,s={})=>e(n,o,Yx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Yx(t,s))}static defaults(o){return e.defaults(Yx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Yx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Yx(t,s))}},unescape:a((n,o={})=>e.unescape(n,Yx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Yx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Yx(t,o)),"filter"),defaults:a(n=>e.defaults(Yx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Yx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Yx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Yx(t,s)),"match"),sep:e.sep,GLOBSTAR:Xp})},"defaults");bf.defaults=h9o;var $gn=a((t,e={})=>(jIe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Ngn(t,{max:e.braceExpandMax})),"braceExpand");bf.braceExpand=$gn;var m9o=a((t,e={})=>new q_(t,e).makeRe(),"makeRe");bf.makeRe=m9o;var g9o=a((t,e,r={})=>{let n=new q_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");bf.match=g9o;var qgn=/[?*]|[+@!]\(.*?\)|\[|\]/,A9o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),q_=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={}){jIe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Ggn,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]==="?"||!qgn.test(s[2]))&&!qgn.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(Xp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Xp,s),l=r.lastIndexOf(Xp),[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"?A9o(h):h===Xp?Xp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Xp||A===Xp||(A===void 0?g!==void 0&&g!==Xp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Xp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Xp))});let f=d.filter(h=>h!==Xp);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 bf.defaults(e).Minimatch}};bf.AST=EK;bf.Minimatch=q_;bf.escape=Ble;bf.unescape=LP;var aUt="contentExclusion",Pze=class extends bze{static{a(this,"CopilotContentExclusion")}#e;#t=new Cn(1e4);#r=new Cn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=YW(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??gK.all);if(!o)return Cze;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 GQ.exception(this.#e,n,`${aUt}.evaluate`),Cgn}return QIe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=QIe,c,l=qDt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(bf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=cUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return GQ.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 QIe;let c=this.evaluateFileContent(o,s,n);return GQ.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=>Vgn(c)).some(c=>c.test(n)))return cUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>Vgn(c)).some(c=>c.test(n)))return cUt(o,"FILE_BLOCKED_TEXT_BASED");return QIe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){ua(this.#e,e,`${aUt}.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=Ign(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new yi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(gK.all);e.filter(u=>u!==gK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==gK.all).join(",")),n.searchParams.set("scope",o?gK.all:gK.repo);let c=await Vf(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 uM(c)}return this.#s("fetch.success"),yK(v9o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(Cf).getRepo(ff(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){At(this.#e,`${aUt}.${e}`,Wt.createAndMarkAsIssued(r,n))}};function Vgn(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(Vgn,"stringToRegex");function cUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(cUt,"fileBlockedEvaluationResult");var y9o=S.Object({name:S.String(),type:S.String()}),E9o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:y9o}),lUt=S.Array(E9o),_9o=S.Object({rules:lUt,last_updated_at:S.String(),scope:S.String()}),v9o=S.Array(_9o);var ic=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new Pze(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($r).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=Y0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),bs(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){GQ.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(ps).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ps).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===Cze.reason)return GQ.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 At(this.ctx,e,Wt.createAndMarkAsIssued(l,u)),At(this.ctx,e,Wt.createAndMarkAsIssued({...l,path:r},u),1),GQ.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 Fle(t,e,r){let n=await t.get(ic).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Fle,"isDocumentValid");var $r=class{constructor(e,r=Fle){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=Fs(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(qo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(qo).readFileString(e)}getWorkspaceFolder(e){let r=Fs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Fs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Fs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Fs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ji(r)}};p();p();var ot=new fe("chat");p();var Dze=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Wi;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 Kx=class{constructor(e){this.ctx=e;this.watchers=new Cn(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(Y0(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 $Q=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},C9o="workspaceLifecycleManager",aE=new fe(C9o),qS=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=bs(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?aE.debug(this.ctx,`listener ${e.constructor.name} is already started`):(aE.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):aE.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);aE.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get($r).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get($r).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){aE.debug(r,"No workspaces to add.");return}aE.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];aE.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)));aE.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));aE.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));aE.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){aE.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(Kx).terminateWatching(l);for(let d of this.activeListeners)aE.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;aE.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(Kx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){aE.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)aE.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)aE.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(Kx).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 Nze(t){t.set(qS,new qS(t))}a(Nze,"setupWorkspaceLifecycleListener");var VQ=de(require("fs")),Jx=de(require("path"));var uUt=".agent.md",b9o=300*1e3,S9o="github",zgn="agents";function GIe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(GIe,"sanitizeSegment");function T9o(t){return t.replace(/\\/g,"/")}a(T9o,"toPosix");var k3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new fe("OrgCustomAgentService");this.fetchSequencer=new zx;this.activated=!1;this.orgs=new Map;this.client=o.client??new vze(e),this.resolveNwo=o.resolveNwo??(s=>J9t(s,[e.get(Wm).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??b9o,this.cacheRoot=Jx.join(this.persistenceManager.directory,S9o),this.lifecycleListener=new dUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=T9o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${zgn}/*${uUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:Ygn.githubOrg}),this.tokenSubscription=bs(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=>Fs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(GIe(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=Jx.relative(this.cacheRoot,e);if(r.startsWith("..")||Jx.isAbsolute(r))return;let n=r.indexOf(Jx.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=un(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Fs(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=Fs(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(Ft(this.ctx,Ye.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await VQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${uUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Jx.join(o,l),vgn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Jx.join(this.cacheRoot,GIe(e.owner),GIe(e.repo),zgn)}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 VQ.promises.stat(e)).size===n.length&&(await VQ.promises.readFile(e)).equals(n))return}catch{}await VQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await VQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(uUt)&&!r.has(o.name))try{await VQ.promises.unlink(Jx.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=Jx.join(this.cacheRoot,GIe(e.owner),GIe(e.repo));try{await VQ.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)}`)}}},dUt=class extends $Q{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 l0=class{static{a(this,"PromptChangeNotifier")}},Mze=class extends l0{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function Kgn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(Kgn,"createPromptFilesChangedEvent");function Jgn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Jgn,"createBatchPromptFilesChangedEvent");p();var rp=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 Ule(...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(Ule,"anyEvent");var tAn=require("os"),$Ie=de(require("path"));function Qle(t){return t.replace(/\\/g,"/")}a(Qle,"toForwardSlash");function Zgn(...t){return $Ie.default.posix.join(...t.map(Qle))}a(Zgn,"globJoin");function x9o(t){let e=Qle(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(x9o,"containsTraversal");function Xgn(t,e){let r=Qle($Ie.default.posix.normalize(Qle(t))),n=Qle($Ie.default.posix.normalize(Qle(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(Xgn,"isContained");var eAn=["*","?","{","["],RA=class{constructor(e,r){this.ctx=e;this.logger=new fe("PromptFileLocationRegistry");this._onLocationsChanged=new rp;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??tAn.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(x9o(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=eAn.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=Zgn(f,d.pattern.slice(2));if(!Xgn(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=Zgn(f,d.pattern);Xgn(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 eAn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(Kgn(e,"ConfigChanged"))}};p();p();p();p();var fUt=de(require("path"));function Zx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=fUt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!fUt.posix.isAbsolute(s)}a(Zx,"isEqualOrParent");var LC=process.platform==="linux";function WQ(t){return t.replace(/\\/g,"/")}a(WQ,"normalizeSlashes");function ug(t){let e=WQ(t);return LC?e:e.toLowerCase()}a(ug,"canonicalKey");function rAn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>LC?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&&Zx(h,d,LC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(rAn,"coalesceEvents");var Oze=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Ule(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Ule(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 D3=de(require("fs"));var _K=new fe("NodeJSWatcherService"),w9o=1e3,Lze=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new rp;this.onDidChange=this._onDidChange.event;this._onDidError=new rp;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??D3.watch,this._fsWatchFile=o??{watchFile:D3.watchFile,unwatchFile:D3.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=WQ(e.path),n=ug(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){_K.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){_K.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return D3.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?P9o(e,WQ(o)):e,c=R9o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),_K.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}),_K.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){_K.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=k9o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:w9o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),_K.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){_K.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function R9o(t,e){if(t==="change")return"update";try{return D3.statSync(e),"create"}catch{return"delete"}}a(R9o,"classify");function k9o(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(k9o,"classifyStat");function P9o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(P9o,"joinPosix");p();var LAn=de(OAn()),BAn=require("os"),FAn=de(require("path"));var Qze=new fe("ParcelWatcherService"),vUo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",CUo=process.platform==="darwin"?[FAn.join((0,BAn.homedir)(),"Library","Containers")]:[],qze=class{constructor(e,r){this.ctx=e;this._onDidChange=new rp;this.onDidChange=this._onDidChange.event;this._onDidError=new rp;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??LAn.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=WQ(e.path),n=ug(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=WQ(e),o=this._findCoveringRoot(n);if(!o)return;let s=ug(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(Zx(r.path,e,LC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Zx(e.path,o.path,LC)){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=ug(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=>{Qze.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:vUo,ignore:CUo}).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=ug(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=WQ(s.path);n.push({path:c,type:s.type})}let o=rAn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=ug(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){Qze.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(Qze.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(ts).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),Qze.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function jze(t){let e=new qze(t),r=new Lze(t,e);return new Oze(t,e,r)}a(jze,"createUniversalWatcher");var UAn=de(require("fs"));var zQ=de(require("path"));var bUo=100,Hze=/[*?{[]/,bUt=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"||!Zx(e.path,this.request.path,LC)&&!Zx(this.request.path,e.path,LC))return;this._tryActivate();return}e.type==="delete"&&Zx(e.path,this.request.path,LC)&&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=zQ.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=SUo(this.request.path,this.statSync);if(n===void 0||TUo(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 SUo(t,e){let r=zQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=zQ.dirname(r)}}a(SUo,"findExistingAncestor");function TUo(t,e){return zQ.dirname(e)===t?!1:t===zQ.parse(t).root}a(TUo,"isAncestorTooBroad");var Gze=class{constructor(e,r,n=UAn.statSync){this._onPromptFileChanged=new rp;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??jze(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=Hze.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new q_(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=Jgn([...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 bUt(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!Hze.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 Hze.test(n)}_extractBaseDir(e){let r=Hze.exec(e);if(!r)return zQ.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=Zx(r.path,l,LC),d=Zx(l,r.path,LC);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()},bUo)}_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 Xx(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Xx,"localize");function IUo(t,e=[],r={}){let o=new SUt(t).scan();return new TUt(o,t,e,r).parse()}a(IUo,"parseRaw");function th(t,e,r,n){return{type:t,startOffset:e,endOffset:r,rawValue:n?.rawValue??"",value:n?.value??"",format:n?.format??"none",indent:n?.indent??0}}a(th,"makeToken");var SUt=class{constructor(e){this.input=e;this.pos=0;this.tokens=[];this.flowDepth=0;this.seenBlockColon=!1;this.seenDocumentStart=0}static{a(this,"YamlScanner")}scan(e=1){for(;this.pose)););return this.tokens.push(th(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` +`){this.tokens.push(th(8,this.pos,this.pos+1)),this.pos++;return}if(this.peekChar()==="\r"){let n=this.pos+(this.input[this.pos+1]===` +`?2:1);this.tokens.push(th(8,this.pos,n)),this.pos=n;return}let e=this.pos,r=0;for(;this.pos0&&this.tokens.push(th(9,e,this.pos,{indent:r})),this.pos>=this.input.length||this.peekChar()===` `||this.peekChar()==="\r"){if(this.pos=3){let n=this.input[this.pos],o=this.input[this.pos+1],s=this.input[this.pos+2],c=this.input[this.pos+3],l=c===void 0||c===" "||c===" "||c===` -`||c==="\r";if(n==="-"&&o==="-"&&s==="-"&&l){this.tokens.push(Xp(11,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline(),this.seenDocumentStart++;return}if(n==="."&&o==="."&&s==="."&&l){this.tokens.push(Xp(12,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline();return}}if(this.peekChar()==="#"){this.scanComment(),this.scanNewline();return}if(this.peekChar()==="%"){for(;this.pos=3){let n=this.input[this.pos],o=this.input[this.pos+1],s=this.input[this.pos+2],c=this.input[this.pos+3],l=c===void 0||c===" "||c===" "||c===` +`||c==="\r";if(n==="-"&&o==="-"&&s==="-"&&l){this.tokens.push(th(11,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline(),this.seenDocumentStart++;return}if(n==="."&&o==="."&&s==="."&&l){this.tokens.push(th(12,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline();return}}if(this.peekChar()==="#"){this.scanComment(),this.scanNewline();return}if(this.peekChar()==="%"){for(;this.pos=this.input.length||this.peekChar()===` -`||this.peekChar()==="\r"));){let e=this.peekChar();if(e==="#"){this.scanComment();break}else if(e==="{")this.flowDepth++,this.tokens.push(Xp(4,this.pos,this.pos+1)),this.pos++;else if(e==="}"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(Xp(5,this.pos,this.pos+1)),this.pos++;else if(e==="[")this.flowDepth++,this.tokens.push(Xp(6,this.pos,this.pos+1)),this.pos++;else if(e==="]"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(Xp(7,this.pos,this.pos+1)),this.pos++;else if(e===","&&this.flowDepth>0)this.tokens.push(Xp(3,this.pos,this.pos+1)),this.pos++;else if(e==="-"&&this.isBlockDash())this.tokens.push(Xp(2,this.pos,this.pos+1)),this.pos++;else if(e===":"&&this.isBlockColon())this.tokens.push(Xp(1,this.pos,this.pos+1)),this.pos++,this.flowDepth===0&&(this.seenBlockColon=!0);else if(e===":"&&this.flowDepth>0&&this.lastTokenIsJsonLike())this.tokens.push(Xp(1,this.pos,this.pos+1)),this.pos++;else if(e==="'"||e==='"')this.scanQuotedScalar(e);else if((e==="|"||e===">")&&this.flowDepth===0&&this.isBlockScalarStart()){this.scanBlockScalar(e);break}else this.scanUnquotedScalar()}}isBlockDash(){let e=this.input[this.pos+1];return e===void 0||e===" "||e===" "||e===` +`||this.peekChar()==="\r"));){let e=this.peekChar();if(e==="#"){this.scanComment();break}else if(e==="{")this.flowDepth++,this.tokens.push(th(4,this.pos,this.pos+1)),this.pos++;else if(e==="}"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(th(5,this.pos,this.pos+1)),this.pos++;else if(e==="[")this.flowDepth++,this.tokens.push(th(6,this.pos,this.pos+1)),this.pos++;else if(e==="]"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(th(7,this.pos,this.pos+1)),this.pos++;else if(e===","&&this.flowDepth>0)this.tokens.push(th(3,this.pos,this.pos+1)),this.pos++;else if(e==="-"&&this.isBlockDash())this.tokens.push(th(2,this.pos,this.pos+1)),this.pos++;else if(e===":"&&this.isBlockColon())this.tokens.push(th(1,this.pos,this.pos+1)),this.pos++,this.flowDepth===0&&(this.seenBlockColon=!0);else if(e===":"&&this.flowDepth>0&&this.lastTokenIsJsonLike())this.tokens.push(th(1,this.pos,this.pos+1)),this.pos++;else if(e==="'"||e==='"')this.scanQuotedScalar(e);else if((e==="|"||e===">")&&this.flowDepth===0&&this.isBlockScalarStart()){this.scanBlockScalar(e);break}else this.scanUnquotedScalar()}}isBlockDash(){let e=this.input[this.pos+1];return e===void 0||e===" "||e===" "||e===` `||e==="\r"}isBlockColon(){if(this.seenBlockColon&&this.flowDepth===0)return!1;let e=this.input[this.pos+1];return e===void 0||e===" "||e===" "||e===` -`||e==="\r"||this.flowDepth>0&&(e===","||e==="}"||e==="]")}lastTokenIsJsonLike(){for(let e=this.tokens.length-1;e>=0;e--){let r=this.tokens[e];if(!(r.type===8||r.type===9||r.type===10))return r.type===0&&r.format!=="none"||r.type===5||r.type===7}return!1}scanQuotedScalar(e){let r=this.pos;this.pos++;let n="",o=0;for(;this.pos0&&(e===","||e==="}"||e==="]")}lastTokenIsJsonLike(){for(let e=this.tokens.length-1;e>=0;e--){let r=this.tokens[e];if(!(r.type===8||r.type===9||r.type===10))return r.type===0&&r.format!=="none"||r.type===5||r.type===7}return!1}scanQuotedScalar(e){let r=this.pos;this.pos++;let n="",o=0;for(;this.pos0&&(n=n.substring(0,n.length-o)),o=0,this.consumeNewline();let l=0;for(;this.pos0?n+=` -`.repeat(l):n+=" ";continue}c===" "||c===" "?o++:o=0,n+=c,this.pos++}let s=this.input.substring(r,this.pos);this.tokens.push(Xp(0,r,this.pos,{rawValue:s,value:n,format:e==="'"?"single":"double"}))}scanUnquotedScalar(){let e=this.pos,r=this.pos;for(;this.pos0&&(o===","||o==="}"||o==="]")||this.flowDepth>0&&(o==="{"||o==="[")||o===":"&&this.isBlockColon()||o==="#"&&this.pos>e&&(this.input[this.pos-1]===" "||this.input[this.pos-1]===" "))break;this.pos++,o!==" "&&o!==" "&&(r=this.pos)}let n=this.input.substring(e,r);this.tokens.push(Xp(0,e,r,{rawValue:n,value:n,format:"none"}))}isBlockScalarStart(){let e=this.pos+1;for(;e="1"&&n<="9"){e++;continue}if(n==="+"||n==="-"){e++;continue}break}for(;e=this.input.length)return!0;let r=this.input[e];return r===` +`.repeat(l):n+=" ";continue}c===" "||c===" "?o++:o=0,n+=c,this.pos++}let s=this.input.substring(r,this.pos);this.tokens.push(th(0,r,this.pos,{rawValue:s,value:n,format:e==="'"?"single":"double"}))}scanUnquotedScalar(){let e=this.pos,r=this.pos;for(;this.pos0&&(o===","||o==="}"||o==="]")||this.flowDepth>0&&(o==="{"||o==="[")||o===":"&&this.isBlockColon()||o==="#"&&this.pos>e&&(this.input[this.pos-1]===" "||this.input[this.pos-1]===" "))break;this.pos++,o!==" "&&o!==" "&&(r=this.pos)}let n=this.input.substring(e,r);this.tokens.push(th(0,e,r,{rawValue:n,value:n,format:"none"}))}isBlockScalarStart(){let e=this.pos+1;for(;e="1"&&n<="9"){e++;continue}if(n==="+"||n==="-"){e++;continue}break}for(;e=this.input.length)return!0;let r=this.input[e];return r===` `||r==="\r"||r==="#"}scanBlockScalar(e){let r=this.pos;this.pos++;let n=0,o="clip";for(let m=0;m<2;m++)if(this.pos="1"&&g<="9"&&n===0?(n=parseInt(g,10),this.pos++):g==="-"&&o==="clip"?(o="strip",this.pos++):g==="+"&&o==="clip"&&(o="keep",this.pos++)}for(;this.pos0?s+n:0,l=[],u=0;for(;this.pos=this.input.length||this.input[this.pos]===` `||this.input[this.pos]==="\r"){if(c>0&&g>=c){let E=this.input.substring(m+c,this.pos);l.push(E),E===""?u++:u=0}else l.push(""),u++;this.consumeNewline();continue}if(g===0&&this.input.length-this.pos>=3){let E=this.input[this.pos],_=this.input[this.pos+1],v=this.input[this.pos+2],b=this.input[this.pos+3],T=b===void 0||b===" "||b===" "||b===` @@ -2401,28 +2401,28 @@ ${[...XM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` `;)m--;d=d.substring(0,m)}let f=l.some(m=>m!=="");switch(o){case"clip":f&&(d+=` `);break;case"keep":f?d+=` `.repeat(u+1):d=` -`.repeat(u);break;case"strip":break}let h=this.input.substring(r,this.pos);this.tokens.push(Xp(0,r,this.pos,{rawValue:h,value:d,format:e==="|"?"literal":"folded"}))}getParentBlockIndent(e){for(let r=this.tokens.length-1;r>=0;r--){let n=this.tokens[r];if(!(n.type===8||n.type===10||n.type===9)){if(n.type===1){for(let o=r-1;o>=0;o--){let s=this.tokens[o];if(!(s.type===8||s.type===10||s.type===9))return this.getColumnAt(s.startOffset)}return 0}if(n.type===2)return this.getColumnAt(n.startOffset);if(n.type===11)return-1;break}}return 0}getColumnAt(e){let r=0,n=e-1;for(;n>=0&&this.input[n]!==` +`.repeat(u);break;case"strip":break}let h=this.input.substring(r,this.pos);this.tokens.push(th(0,r,this.pos,{rawValue:h,value:d,format:e==="|"?"literal":"folded"}))}getParentBlockIndent(e){for(let r=this.tokens.length-1;r>=0;r--){let n=this.tokens[r];if(!(n.type===8||n.type===10||n.type===9)){if(n.type===1){for(let o=r-1;o>=0;o--){let s=this.tokens[o];if(!(s.type===8||s.type===10||s.type===9))return this.getColumnAt(s.startOffset)}return 0}if(n.type===2)return this.getColumnAt(n.startOffset);if(n.type===11)return-1;break}}return 0}getColumnAt(e){let r=0,n=e-1;for(;n>=0&&this.input[n]!==` `&&this.input[n]!=="\r";)r++,n--;return r}scanComment(){let e=this.pos;for(;this.pos=this.input.length?!1:this.input[this.pos]==="\r"&&this.input[this.pos+1]===` +`&&this.input[this.pos]!=="\r";)this.pos++;this.tokens.push(th(10,e,this.pos,{rawValue:this.input.substring(e,this.pos),value:this.input.substring(e,this.pos)}))}scanNewline(){let e=this.pos;this.consumeNewline()&&this.tokens.push(th(8,e,this.pos))}skipInlineWhitespace(){for(;this.pos=this.input.length?!1:this.input[this.pos]==="\r"&&this.input[this.pos+1]===` `?(this.pos+=2,!0):this.input[this.pos]===` -`||this.input[this.pos]==="\r"?(this.pos++,!0):!1}peekChar(){return this.input[this.pos]}},vUt=class{constructor(e,r,n,o){this.tokens=e;this.input=r;this.errors=n;this.options=o;this.pos=0}static{a(this,"YamlParser")}parse(){return this.skipNewlinesAndComments(),this.currentToken().type===11&&(this.advance(),this.skipNewlinesAndComments()),this.currentToken().type===13||this.currentToken().type===12?void 0:this.parseValue(-1)}currentToken(){return this.tokens[this.pos]}peek(e=0){return this.tokens[Math.min(this.pos+e,this.tokens.length-1)]}advance(){let e=this.tokens[this.pos];return e.type!==13&&this.pos++,e}expect(e){let r=this.currentToken();return r.type===e?this.advance():r}emitError(e,r,n,o){this.errors.push({message:e,startOffset:r,endOffset:n,code:o})}skipNewlinesAndComments(){for(;this.currentToken().type===8||this.currentToken().type===10||this.currentToken().type===9&&this.isFollowedByNewlineOrComment();)this.advance()}isFollowedByNewlineOrComment(){let e=this.peek(1);return e.type===8||e.type===10||e.type===13}currentIndent(){return this.currentToken().type===9?this.currentToken().indent:0}parseValue(e){this.skipNewlinesAndComments();let r=this.currentToken(),n=r.type===9?this.peek(1):r;if(n.type===4||n.type===6)return r.type===9&&this.advance(),n.type===4?this.parseFlowMap():this.parseFlowSeq();let o=this.currentIndent();if(this.peekPastIndent().type===2)return this.parseBlockSequence(o);if(this.looksLikeMapping())return this.parseBlockMapping(o);if(r.type===0||r.type===9)return this.parseScalar(e)}peekPastIndent(){return this.currentToken().type===9?this.peek(1):this.currentToken()}looksLikeMapping(){let e=0;return this.peek(e).type===9&&e++,this.peek(e).type===0&&(e++,this.peek(e).type===1)}parseScalar(e=-1){this.currentToken().type===9&&this.advance();let r=this.expect(0);return r.format!=="none"?this.scalarFromToken(r):this.parsePlainMultiline(r,e)}parsePlainMultiline(e,r){let n=e.value,o=e.endOffset;for(;;){let s=this.pos,c=0,l=!1;for(;this.posr){l=!0;break}else break}if(f.type===13||f.type===11||f.type===12)break;if(r<0){l=!0;break}break}if(d.type===9)break;break}if(!l){this.pos=s;break}if(this.currentToken().type===9&&this.advance(),this.currentToken().type!==0){if(this.currentToken().type===2){let d=this.advance(),f="-";if(this.currentToken().type===0){let h=this.advance();f="- "+h.value,o=h.endOffset}else o=d.endOffset;c>0?n+=` +`||this.input[this.pos]==="\r"?(this.pos++,!0):!1}peekChar(){return this.input[this.pos]}},TUt=class{constructor(e,r,n,o){this.tokens=e;this.input=r;this.errors=n;this.options=o;this.pos=0}static{a(this,"YamlParser")}parse(){return this.skipNewlinesAndComments(),this.currentToken().type===11&&(this.advance(),this.skipNewlinesAndComments()),this.currentToken().type===13||this.currentToken().type===12?void 0:this.parseValue(-1)}currentToken(){return this.tokens[this.pos]}peek(e=0){return this.tokens[Math.min(this.pos+e,this.tokens.length-1)]}advance(){let e=this.tokens[this.pos];return e.type!==13&&this.pos++,e}expect(e){let r=this.currentToken();return r.type===e?this.advance():r}emitError(e,r,n,o){this.errors.push({message:e,startOffset:r,endOffset:n,code:o})}skipNewlinesAndComments(){for(;this.currentToken().type===8||this.currentToken().type===10||this.currentToken().type===9&&this.isFollowedByNewlineOrComment();)this.advance()}isFollowedByNewlineOrComment(){let e=this.peek(1);return e.type===8||e.type===10||e.type===13}currentIndent(){return this.currentToken().type===9?this.currentToken().indent:0}parseValue(e){this.skipNewlinesAndComments();let r=this.currentToken(),n=r.type===9?this.peek(1):r;if(n.type===4||n.type===6)return r.type===9&&this.advance(),n.type===4?this.parseFlowMap():this.parseFlowSeq();let o=this.currentIndent();if(this.peekPastIndent().type===2)return this.parseBlockSequence(o);if(this.looksLikeMapping())return this.parseBlockMapping(o);if(r.type===0||r.type===9)return this.parseScalar(e)}peekPastIndent(){return this.currentToken().type===9?this.peek(1):this.currentToken()}looksLikeMapping(){let e=0;return this.peek(e).type===9&&e++,this.peek(e).type===0&&(e++,this.peek(e).type===1)}parseScalar(e=-1){this.currentToken().type===9&&this.advance();let r=this.expect(0);return r.format!=="none"?this.scalarFromToken(r):this.parsePlainMultiline(r,e)}parsePlainMultiline(e,r){let n=e.value,o=e.endOffset;for(;;){let s=this.pos,c=0,l=!1;for(;this.posr){l=!0;break}else break}if(f.type===13||f.type===11||f.type===12)break;if(r<0){l=!0;break}break}if(d.type===9)break;break}if(!l){this.pos=s;break}if(this.currentToken().type===9&&this.advance(),this.currentToken().type!==0){if(this.currentToken().type===2){let d=this.advance(),f="-";if(this.currentToken().type===0){let h=this.advance();f="- "+h.value,o=h.endOffset}else o=d.endOffset;c>0?n+=` `.repeat(c):n+=" ",n+=f;continue}this.pos=s;break}if(this.peek(1).type===1){this.pos=s;break}let u=this.advance();c>0?n+=` -`.repeat(c):n+=" ",n+=u.value,o=u.endOffset}return{type:"scalar",value:n,rawValue:this.input.substring(e.startOffset,o),startOffset:e.startOffset,endOffset:o,format:"none"}}parseBlockMapping(e,r=!1){let n=this.currentToken().startOffset,o=[],s=new Set;if(r){let l=this.parseMappingEntry(e);l&&(s.add(l.key.value),o.push(l))}for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let l=this.currentIndent();if(le)this.emitError(Jx("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,l),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(!this.looksLikeMapping())break;let u=this.parseMappingEntry(e);if(!u)break;!this.options.allowDuplicateKeys&&s.has(u.key.value)&&this.emitError(Jx("duplicateKey",'Duplicate key: "{0}"',u.key.value),u.key.startOffset,u.key.endOffset,"duplicate-key"),s.add(u.key.value),o.push(u)}let c=o.length>0?o[o.length-1].value.endOffset:n;return{type:"map",properties:o,style:"block",startOffset:n,endOffset:c}}parseMappingEntry(e){this.currentToken().type===9&&this.advance();let r=this.expect(0),n=this.scalarFromToken(r),o=this.expect(1);if(o.type!==1){this.emitError(Jx("expectedColon",'Expected ":"'),o.startOffset,o.endOffset,"expected-colon");return}let s=this.parseMappingValue(e,o);return{key:n,value:s}}parseMappingValue(e,r){let n=this.currentToken();if(n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===0){this.currentToken().type===9&&this.advance();let c=this.advance();return c.format!=="none"?this.scalarFromToken(c):this.parsePlainMultiline(c,e)}if(this.skipNewlinesAndComments(),this.currentToken().type===13)return this.emitError(Jx("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset);let s=this.currentIndent();return s===e&&this.peekPastIndent().type===2?this.parseValue(e)??this.makeEmptyScalar(r.endOffset):s<=e?(this.emitError(Jx("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}parseBlockSequence(e){let r=[],n=this.currentToken().startOffset,o=n,s=!0;for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let c;if(s&&this.currentToken().type===2?c=this.currentToken().startOffset-this.getLineStart(this.currentToken().startOffset):c=this.currentIndent(),s=!1,ce)this.emitError(Jx("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,c),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(this.peekPastIndent().type!==2)break;this.currentToken().type===9&&this.advance();let u=this.advance(),d=this.parseSequenceItemValue(e,u);r.push(d),o=d.endOffset}return{type:"sequence",items:r,style:"block",startOffset:n,endOffset:o}}parseSequenceItemValue(e,r){let n=this.currentToken();if(n.type===10&&this.advance(),n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===2){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockSequence(s)}if(n.type===0){if(this.peek(1).type===1){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockMapping(s,!0)}return this.parseScalar(e)}return this.skipNewlinesAndComments(),this.currentToken().type===13?(this.emitError(Jx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(Jx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}getLineStart(e){let r=e-1;for(;r>=0&&this.input[r]!==` -`&&this.input[r]!=="\r";)r--;return r+1}parseFlowMap(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==5&&this.currentToken().type!==13;){let o;if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Jx("expectedMappingKey","Expected mapping key"),this.currentToken().startOffset,this.currentToken().endOffset,"expected-key");break}this.skipFlowWhitespace();let s;this.currentToken().type===1?(this.advance(),this.skipFlowWhitespace(),s=this.parseFlowValue()):s=this.makeEmptyScalar(o.endOffset),r.push({key:o,value:s}),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===5?this.advance():this.emitError(Jx("expectedFlowMapEnd",'Expected "}"'),n.startOffset,n.endOffset,"expected-flow-map-end"),{type:"map",properties:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===5?n.endOffset:n.startOffset}}parseFlowSeq(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==7&&this.currentToken().type!==13;){let o;if(this.currentToken().type===4)o=this.parseFlowMap();else if(this.currentToken().type===6)o=this.parseFlowSeq();else if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Jx("unexpectedTokenInFlowSeq","Unexpected token in flow sequence"),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-token"),this.advance();continue}r.push(o),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===7?this.advance():this.emitError(Jx("expectedFlowSeqEnd",'Expected "]"'),n.startOffset,n.endOffset,"expected-flow-seq-end"),{type:"sequence",items:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===7?n.endOffset:n.startOffset}}parseFlowScalar(){let e=this.advance();if(e.format!=="none")return this.scalarFromToken(e);let r=e.value,n=e.endOffset;for(;;){let o=!1,s=this.pos;for(;s=this.tokens.length)break;let c=this.tokens[s];if(c.type===0&&c.format==="none")this.pos=s+1,r+=" "+c.value,n=c.endOffset;else break}return{type:"scalar",value:r,rawValue:this.input.substring(e.startOffset,n),startOffset:e.startOffset,endOffset:n,format:"none"}}parseFlowValue(){return this.currentToken().type===4?this.parseFlowMap():this.currentToken().type===6?this.parseFlowSeq():this.currentToken().type===0?this.parseFlowScalar():this.makeEmptyScalar(this.currentToken().startOffset)}skipFlowWhitespace(){for(;;){let e=this.currentToken().type;if(e===8||e===9||e===10)this.advance();else break}}scalarFromToken(e){return{type:"scalar",value:e.value,rawValue:e.rawValue,startOffset:e.startOffset,endOffset:e.endOffset,format:e.format}}makeEmptyScalar(e){return{type:"scalar",value:"",rawValue:"",startOffset:e,endOffset:e,format:"none"}}};function OAn(t,e=[],r={}){let n=[],o=hUo(t,n,r),s=mUo(t);for(let c of n)e.push({message:c.message,code:c.code,start:uO(s,c.startOffset),end:uO(s,c.endOffset)});return o===void 0?void 0:CUt(s,o)}a(OAn,"parse");function mUo(t){let e=[0];for(let r=0;re)this.emitError(Xx("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,l),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(!this.looksLikeMapping())break;let u=this.parseMappingEntry(e);if(!u)break;!this.options.allowDuplicateKeys&&s.has(u.key.value)&&this.emitError(Xx("duplicateKey",'Duplicate key: "{0}"',u.key.value),u.key.startOffset,u.key.endOffset,"duplicate-key"),s.add(u.key.value),o.push(u)}let c=o.length>0?o[o.length-1].value.endOffset:n;return{type:"map",properties:o,style:"block",startOffset:n,endOffset:c}}parseMappingEntry(e){this.currentToken().type===9&&this.advance();let r=this.expect(0),n=this.scalarFromToken(r),o=this.expect(1);if(o.type!==1){this.emitError(Xx("expectedColon",'Expected ":"'),o.startOffset,o.endOffset,"expected-colon");return}let s=this.parseMappingValue(e,o);return{key:n,value:s}}parseMappingValue(e,r){let n=this.currentToken();if(n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===0){this.currentToken().type===9&&this.advance();let c=this.advance();return c.format!=="none"?this.scalarFromToken(c):this.parsePlainMultiline(c,e)}if(this.skipNewlinesAndComments(),this.currentToken().type===13)return this.emitError(Xx("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset);let s=this.currentIndent();return s===e&&this.peekPastIndent().type===2?this.parseValue(e)??this.makeEmptyScalar(r.endOffset):s<=e?(this.emitError(Xx("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}parseBlockSequence(e){let r=[],n=this.currentToken().startOffset,o=n,s=!0;for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let c;if(s&&this.currentToken().type===2?c=this.currentToken().startOffset-this.getLineStart(this.currentToken().startOffset):c=this.currentIndent(),s=!1,ce)this.emitError(Xx("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,c),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(this.peekPastIndent().type!==2)break;this.currentToken().type===9&&this.advance();let u=this.advance(),d=this.parseSequenceItemValue(e,u);r.push(d),o=d.endOffset}return{type:"sequence",items:r,style:"block",startOffset:n,endOffset:o}}parseSequenceItemValue(e,r){let n=this.currentToken();if(n.type===10&&this.advance(),n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===2){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockSequence(s)}if(n.type===0){if(this.peek(1).type===1){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockMapping(s,!0)}return this.parseScalar(e)}return this.skipNewlinesAndComments(),this.currentToken().type===13?(this.emitError(Xx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(Xx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}getLineStart(e){let r=e-1;for(;r>=0&&this.input[r]!==` +`&&this.input[r]!=="\r";)r--;return r+1}parseFlowMap(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==5&&this.currentToken().type!==13;){let o;if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Xx("expectedMappingKey","Expected mapping key"),this.currentToken().startOffset,this.currentToken().endOffset,"expected-key");break}this.skipFlowWhitespace();let s;this.currentToken().type===1?(this.advance(),this.skipFlowWhitespace(),s=this.parseFlowValue()):s=this.makeEmptyScalar(o.endOffset),r.push({key:o,value:s}),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===5?this.advance():this.emitError(Xx("expectedFlowMapEnd",'Expected "}"'),n.startOffset,n.endOffset,"expected-flow-map-end"),{type:"map",properties:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===5?n.endOffset:n.startOffset}}parseFlowSeq(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==7&&this.currentToken().type!==13;){let o;if(this.currentToken().type===4)o=this.parseFlowMap();else if(this.currentToken().type===6)o=this.parseFlowSeq();else if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Xx("unexpectedTokenInFlowSeq","Unexpected token in flow sequence"),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-token"),this.advance();continue}r.push(o),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===7?this.advance():this.emitError(Xx("expectedFlowSeqEnd",'Expected "]"'),n.startOffset,n.endOffset,"expected-flow-seq-end"),{type:"sequence",items:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===7?n.endOffset:n.startOffset}}parseFlowScalar(){let e=this.advance();if(e.format!=="none")return this.scalarFromToken(e);let r=e.value,n=e.endOffset;for(;;){let o=!1,s=this.pos;for(;s=this.tokens.length)break;let c=this.tokens[s];if(c.type===0&&c.format==="none")this.pos=s+1,r+=" "+c.value,n=c.endOffset;else break}return{type:"scalar",value:r,rawValue:this.input.substring(e.startOffset,n),startOffset:e.startOffset,endOffset:n,format:"none"}}parseFlowValue(){return this.currentToken().type===4?this.parseFlowMap():this.currentToken().type===6?this.parseFlowSeq():this.currentToken().type===0?this.parseFlowScalar():this.makeEmptyScalar(this.currentToken().startOffset)}skipFlowWhitespace(){for(;;){let e=this.currentToken().type;if(e===8||e===9||e===10)this.advance();else break}}scalarFromToken(e){return{type:"scalar",value:e.value,rawValue:e.rawValue,startOffset:e.startOffset,endOffset:e.endOffset,format:e.format}}makeEmptyScalar(e){return{type:"scalar",value:"",rawValue:"",startOffset:e,endOffset:e,format:"none"}}};function QAn(t,e=[],r={}){let n=[],o=IUo(t,n,r),s=xUo(t);for(let c of n)e.push({message:c.message,code:c.code,start:fO(s,c.startOffset),end:fO(s,c.endOffset)});return o===void 0?void 0:IUt(s,o)}a(QAn,"parse");function xUo(t){let e=[0];for(let r=0;r>1;t[s]<=e?(o=s,r=s+1):n=s-1}return{line:o,character:e-t[o]}}a(uO,"offsetToPosition");function CUt(t,e){switch(e.type){case"scalar":return gUo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>CUt(t,r)),start:uO(t,e.startOffset),end:uO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:AUo(t,r.key),value:CUt(t,r.value)})),start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}}a(CUt,"convertNode");function gUo(t,e){let r=uO(t,e.startOffset),n=uO(t,e.endOffset);if(e.format==="none"){let o=e.value;if(o==="true")return{type:"boolean",value:!0,start:r,end:n};if(o==="false")return{type:"boolean",value:!1,start:r,end:n};if(o==="null"||o==="~")return{type:"null",value:null,start:r,end:n};if(o!==""&&/^-?\d*\.?\d+$/.test(o)){let s=Number(o);if(!isNaN(s)&&isFinite(s))return{type:"number",value:s,start:r,end:n}}}return{type:"string",value:e.value,start:r,end:n}}a(gUo,"convertScalar");function AUo(t,e){return{type:"string",value:e.value,start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}a(AUo,"convertScalarAsString");var LP=de(eh());var dO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new jze(e,void 0,void 0);let o,s,c=0;if(n[0].match(/^---[\s\r\n]*$/)){let l=n.findIndex((d,f)=>f>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new LP.Range(2,1,l+1,1);o=new TUt(u,n),this.#e(o,n)}if(cs>0&&o.match(/^---[\s\r\n]*$/))||e.pushError({message:"Missing closing `---` delimiter for frontmatter",range:e.range,code:"MISSING_CLOSING_DELIMITER"})}#t(e){let r=[],n=e.split(/(\r\n|\r|\n)/);for(let o=0;o({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 LP.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}pushError(e){this._parsedHeader.errors.unshift(e)}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===EUo);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}}},IUt=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;sLP.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 LP.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 LP.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)=>LP.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 _Uo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),vUo="agentHook.event.load",Hze=class{constructor(){this.logger=new fe("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 At(e,vUo,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 _Uo.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")}};p();var BAn=require("os");var CUo=(0,BAn.platform)()==="win32",tp=class{constructor(){this.trustByUri=new Map;this.emitter=new Wi;this.onDidChangeTrust=this.emitter.event;this.capabilityEnabled=!1}static{a(this,"WorkspaceTrustService")}setCapabilityEnabled(e){this.capabilityEnabled=e}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);if(this.trustByUri.set(n,r),o===r)return;let s=`${n}/`,c=[];for(let l of this.trustByUri.keys())l.startsWith(s)&&c.push(l);for(let l of c)this.trustByUri.delete(l);this.emitter.fire({folderUri:n,trusted:r});for(let l of c)this.emitter.fire({folderUri:l,trusted:this.isTrustedInternal(l)})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.capabilityEnabled?this.isTrustedInternal(this.normalizeKey(e)):!0}isTrustedInternal(e){let r=e.indexOf("://"),n=r>=0?r+3:0,o=e;for(;o.length>n;){let s=this.trustByUri.get(o);if(s!==void 0)return s;let c=o.lastIndexOf("/");if(cthis.handleChange(f));for(let f of xUt)this.rewatch(f);this.registrySubscription=o.onLocationsChanged(f=>{for(let h of f.affectedTypes)this.rewatch(h)});let c=a(f=>{this.evictFolder(f),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends HQ{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(US).addListener(this.workspaceListener);let u,d=a(()=>{let f=u;if(u=void 0,!(!f||this.disposed)){for(let h of f)this.evictFolder({uri:h});this.rewatchAll();for(let h of xUt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(tp).onDidChangeTrust(f=>{u===void 0&&(u=new Set,queueMicrotask(d)),u.add(f.folderUri)})}static{a(this,"PromptService")}async collect(e,r,n,o){let s=e.get(tp),c=n.filter(h=>s.isTrusted(h.uri)),l=await this.fileLocator.listFiles(e,c,r),u=o?.includePlugins?l:l.filter(h=>h.classification.storage!=="plugin"),f=(await Promise.all(u.map(h=>this.resolveEntry(e,r,h)))).filter(h=>h!==void 0);return o?.includePlugins?f:f.filter(h=>h.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=FAn(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(Qo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="plugin"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.pluginInfo.name,description:n.pluginInfo.description,pluginUri:n.pluginInfo.pluginUri}: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(),this.trustSubscription.dispose();try{this.ctx.get(US).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(Qo).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(FAn(o,Ks(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(a0).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=bUo(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(wA),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 xUt)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{let o=this.ctx.get(tp);e=this.ctx.get($r).getWorkspaceFolders().filter(s=>o.isTrusted(s.uri)).map(s=>un(s.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=>Kx(s.normalized,o.normalized,OC))||n.push(o);return n.map(o=>o.raw)}};p();var jl=class{constructor(){this.policyChangeEmitter=new ep;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},Gze=class extends jl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var wUt=64;var P3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(P3||{}),dg={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},rp={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},EK=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,wUt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},YQ=class extends EK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Rr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},KQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},_K=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Lr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},JQ=class extends Lr{static{a(this,"ExtendedLanguageModelToolResult")}},UAn=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")]))}),D3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(D3||{}),QAn=S.Object({result:S.Enum(D3)});var RUt=de(require("fs"));var YIe=de(require("path"));var PUt=["user","model"],DUt="source",NUt={githubOrg:"github-org"},Ggn={githubOrg:{[DUt]:NUt.githubOrg}},kUt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri;let o=n.header?.name?.trim()||void 0;this._name=r.name??o??Ji(n.uri).replace(/\.(agent\.)?md$/i,"")}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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??PUt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(NUt));for(let n of e){let o=n[DUt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},qAn="./assets/prompts.contributions.json",HAn="CVE Remediator",SUo="Debugger",jAn=new Map([[HAn,"cveRemediatorAgent"],[SUo,"debuggerAgent"]]),TUo=new Map([[HAn,["LOCAL"]]]),Ld=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new fe("CustomAgentService");this.agentUpdateSequencer=new Vx;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.runtimeSources=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.registerClaudeAgentPatterns(),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"}static{this.CLAUDE_AGENT_PATTERNS=[".claude/agents/**/*.md","~/.claude/agents/**/*.md"]}registerClaudeAgentPatterns(){this.promptFileLocationRegistry.register("agent",[...t.CLAUDE_AGENT_PATTERNS],{metadata:{providers:["CLAUDE"]}})}registerRuntimeAgentSource(e){return this.runtimeSources.push(e),{dispose:a(()=>{let r=this.runtimeSources.indexOf(e);r>=0&&this.runtimeSources.splice(r,1)},"dispose")}}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);this.lastEnableCustomAgents=Ft(this.ctx,Ye.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ft(this.ctx,Ye.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableCustomAgents),n=Ft(this.ctx,Ye.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(jl);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(bn),r=Array.from(new Set(jAn.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(a0).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),{metadata:{providers:["LOCAL","BACKGROUND"]}})}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(YIe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(jl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(ug).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new kUt(m)),c=this.ctx.get(w3),l=Ft(this.ctx,Ye.EnableOrgCustomAgents)!==!1,u=this.ctx.get(bn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let E=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${E.code}: ${E.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let E=m.promptFileEntry?.parsedPromptFile.uri,_=E?rs(E):void 0;if(!_||!c.isCachedAgentVisibleFor(_,e))return!1}let A=jAn.get(m.name);if(A===void 0)return!0;let y=u[A]??!1;return y||this.logger.debug(this.ctx,`Filtering out agent '${m.name}' (capability '${A}' is disabled)`),y});if(!r?.includeRuntimeAgents||this.runtimeSources.length===0)return d;let f=new Set(d.map(m=>m.name.toLowerCase())),h=[];for(let m of this.runtimeSources){let g;try{g=await m.getAgents(e)}catch(A){this.logger.warn(this.ctx,"RuntimeAgentSource.getAgents failed:",A);continue}for(let A of g){let y=A.name.toLowerCase();f.has(y)||(f.add(y),h.push(A))}}return[...d,...h]}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[DUt]===NUt.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",[un(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=YIe.default.extname(__filename)===".ts"?YIe.default.resolve(__dirname,"../../../..",e):YIe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(qAn),n=await RUt.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),u=TUo.get(c.name);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}},...u?{metadata:{providers:[...u]}}:{}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${qAn}:`,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=fK({[A]:y}).trim();m.push(E)}}u=m.join(` +`&&r++,e.push(r+1))}return e}a(xUo,"computeLineStartOffsets");function fO(t,e){let r=0,n=t.length-1,o=0;for(;r<=n;){let s=r+n>>1;t[s]<=e?(o=s,r=s+1):n=s-1}return{line:o,character:e-t[o]}}a(fO,"offsetToPosition");function IUt(t,e){switch(e.type){case"scalar":return wUo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>IUt(t,r)),start:fO(t,e.startOffset),end:fO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:RUo(t,r.key),value:IUt(t,r.value)})),start:fO(t,e.startOffset),end:fO(t,e.endOffset)}}}a(IUt,"convertNode");function wUo(t,e){let r=fO(t,e.startOffset),n=fO(t,e.endOffset);if(e.format==="none"){let o=e.value;if(o==="true")return{type:"boolean",value:!0,start:r,end:n};if(o==="false")return{type:"boolean",value:!1,start:r,end:n};if(o==="null"||o==="~")return{type:"null",value:null,start:r,end:n};if(o!==""&&/^-?\d*\.?\d+$/.test(o)){let s=Number(o);if(!isNaN(s)&&isFinite(s))return{type:"number",value:s,start:r,end:n}}}return{type:"string",value:e.value,start:r,end:n}}a(wUo,"convertScalar");function RUo(t,e){return{type:"string",value:e.value,start:fO(t,e.startOffset),end:fO(t,e.endOffset)}}a(RUo,"convertScalarAsString");var FP=de(rh());var pO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new Wze(e,void 0,void 0);let o,s,c=0;if(n[0].match(/^---[\s\r\n]*$/)){let l=n.findIndex((d,f)=>f>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new FP.Range(2,1,l+1,1);o=new RUt(u,n),this.#e(o,n)}if(cs>0&&o.match(/^---[\s\r\n]*$/))||e.pushError({message:"Missing closing `---` delimiter for frontmatter",range:e.range,code:"MISSING_CLOSING_DELIMITER"})}#t(e){let r=[],n=e.split(/(\r\n|\r|\n)/);for(let o=0;o({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 FP.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}pushError(e){this._parsedHeader.errors.unshift(e)}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===PUo);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}}},kUt=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;sFP.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 FP.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 FP.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)=>FP.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 DUo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),NUo="agentHook.event.load",zze=class{constructor(){this.logger=new fe("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 Rt(e,NUo,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 DUo.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")}};p();var jAn=require("os");var MUo=(0,jAn.platform)()==="win32",np=class{constructor(){this.trustByUri=new Map;this.emitter=new Wi;this.onDidChangeTrust=this.emitter.event;this.capabilityEnabled=!1}static{a(this,"WorkspaceTrustService")}setCapabilityEnabled(e){this.capabilityEnabled=e}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);if(this.trustByUri.set(n,r),o===r)return;let s=`${n}/`,c=[];for(let l of this.trustByUri.keys())l.startsWith(s)&&c.push(l);for(let l of c)this.trustByUri.delete(l);this.emitter.fire({folderUri:n,trusted:r});for(let l of c)this.emitter.fire({folderUri:l,trusted:this.isTrustedInternal(l)})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.capabilityEnabled?this.isTrustedInternal(this.normalizeKey(e)):!0}isTrustedInternal(e){let r=e.indexOf("://"),n=r>=0?r+3:0,o=e;for(;o.length>n;){let s=this.trustByUri.get(o);if(s!==void 0)return s;let c=o.lastIndexOf("/");if(cthis.handleChange(f));for(let f of PUt)this.rewatch(f);this.registrySubscription=o.onLocationsChanged(f=>{for(let h of f.affectedTypes)this.rewatch(h)});let c=a(f=>{this.evictFolder(f),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends $Q{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(qS).addListener(this.workspaceListener);let u,d=a(()=>{let f=u;if(u=void 0,!(!f||this.disposed)){for(let h of f)this.evictFolder({uri:h});this.rewatchAll();for(let h of PUt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(np).onDidChangeTrust(f=>{u===void 0&&(u=new Set,queueMicrotask(d)),u.add(f.folderUri)})}static{a(this,"PromptService")}async collect(e,r,n,o){let s=e.get(np),c=n.filter(h=>s.isTrusted(h.uri)),l=await this.fileLocator.listFiles(e,c,r),u=o?.includePlugins?l:l.filter(h=>h.classification.storage!=="plugin"),f=(await Promise.all(u.map(h=>this.resolveEntry(e,r,h)))).filter(h=>h!==void 0);return o?.includePlugins?f:f.filter(h=>h.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=HAn(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(qo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="plugin"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.pluginInfo.name,description:n.pluginInfo.description,pluginUri:n.pluginInfo.pluginUri}: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(),this.trustSubscription.dispose();try{this.ctx.get(qS).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(qo).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(HAn(o,Ks(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(l0).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=OUo(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(RA),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 PUt)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{let o=this.ctx.get(np);e=this.ctx.get($r).getWorkspaceFolders().filter(s=>o.isTrusted(s.uri)).map(s=>un(s.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=>Zx(s.normalized,o.normalized,LC))||n.push(o);return n.map(o=>o.raw)}};p();var Hl=class{constructor(){this.policyChangeEmitter=new rp;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},Yze=class extends Hl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var DUt=64;var N3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(N3||{}),fg={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},ip={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},CK=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,DUt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},JQ=class extends CK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Rr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},ZQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},bK=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}},XQ=class extends Br{static{a(this,"ExtendedLanguageModelToolResult")}},GAn=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")]))}),M3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(M3||{}),$An=S.Object({result:S.Enum(M3)});var NUt=de(require("fs"));var ZIe=de(require("path"));var OUt=["user","model"],LUt="source",BUt={githubOrg:"github-org"},Ygn={githubOrg:{[LUt]:BUt.githubOrg}},MUt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri;let o=n.header?.name?.trim()||void 0;this._name=r.name??o??Ji(n.uri).replace(/\.(agent\.)?md$/i,"")}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||jle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??OUt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return KQ(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(BUt));for(let n of e){let o=n[LUt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return R3(this.promptFileEntry.promptPath.metadata)}},VAn="./assets/prompts.contributions.json",zAn="CVE Remediator",LUo="Debugger",WAn=new Map([[zAn,"cveRemediatorAgent"],[LUo,"debuggerAgent"]]),BUo=new Map([[zAn,["LOCAL"]]]),Fd=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new fe("CustomAgentService");this.agentUpdateSequencer=new zx;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.runtimeSources=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.registerClaudeAgentPatterns(),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"}static{this.CLAUDE_AGENT_PATTERNS=[".claude/agents/**/*.md","~/.claude/agents/**/*.md"]}registerClaudeAgentPatterns(){this.promptFileLocationRegistry.register("agent",[...t.CLAUDE_AGENT_PATTERNS],{metadata:{providers:["CLAUDE"]}})}registerRuntimeAgentSource(e){return this.runtimeSources.push(e),{dispose:a(()=>{let r=this.runtimeSources.indexOf(e);r>=0&&this.runtimeSources.splice(r,1)},"dispose")}}subscribeToGateChanges(){try{let e=this.ctx.get(Bo);this.lastEnableCustomAgents=Ft(this.ctx,Ye.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ft(this.ctx,Ye.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableCustomAgents),n=Ft(this.ctx,Ye.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(Hl);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(bn),r=Array.from(new Set(WAn.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(l0).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),{metadata:{providers:["LOCAL","BACKGROUND"]}})}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(ZIe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(Hl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(dg).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new MUt(m)),c=this.ctx.get(k3),l=Ft(this.ctx,Ye.EnableOrgCustomAgents)!==!1,u=this.ctx.get(bn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let E=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${E.code}: ${E.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let E=m.promptFileEntry?.parsedPromptFile.uri,_=E?rs(E):void 0;if(!_||!c.isCachedAgentVisibleFor(_,e))return!1}let A=WAn.get(m.name);if(A===void 0)return!0;let y=u[A]??!1;return y||this.logger.debug(this.ctx,`Filtering out agent '${m.name}' (capability '${A}' is disabled)`),y});if(!r?.includeRuntimeAgents||this.runtimeSources.length===0)return d;let f=new Set(d.map(m=>m.name.toLowerCase())),h=[];for(let m of this.runtimeSources){let g;try{g=await m.getAgents(e)}catch(A){this.logger.warn(this.ctx,"RuntimeAgentSource.getAgents failed:",A);continue}for(let A of g){let y=A.name.toLowerCase();f.has(y)||(f.add(y),h.push(A))}}return[...d,...h]}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[LUt]===BUt.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",[un(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=ZIe.default.extname(__filename)===".ts"?ZIe.default.resolve(__dirname,"../../../..",e):ZIe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(VAn),n=await NUt.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),u=BUo.get(c.name);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}},...u?{metadata:{providers:[...u]}}:{}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${VAn}:`,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=mK({[A]:y}).trim();m.push(E)}}u=m.join(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=rs(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await RUt.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 JIe=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}},KIe=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")}},Cl={Ask:new KIe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new KIe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new KIe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function $An(t){return t===Cl.Agent||t.id===Cl.Agent.id}a($An,"isBuiltInAgentMode");function IUo(t){return t===Cl.InlineAgent||t.id===Cl.InlineAgent.id}a(IUo,"isBuiltInInlineAgentMode");function VAn(t){return t===Cl.Ask||t.id===Cl.Ask.id||$An(t)||IUo(t)}a(VAn,"isBuiltInChatMode");function ZIe(t){return $An(t)||!t.isBuiltIn&&t.customTools===void 0}a(ZIe,"shouldApplyGlobalToolsSetting");var j_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[Cl.Ask,Cl.Agent,Cl.InlineAgent],o=await this.ctx.get(Ld).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new JIe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return Cl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??Cl.Agent:Cl.Agent;case"InlineAgent":return Cl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Oc=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 xUo=new fe("conversationProgress"),ZQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Tc=class{constructor(e){this.ctx=e;this.progressEntries=new Cn(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);xUo.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 io={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},wUo=new Set(Object.values(io));function vK(t){return!wUo.has(t)}a(vK,"isCustomEndpointProvider");var XIe="chatCompletions",RUo=128e3,kUo=16e3;function pO(t){return t===io.Azure?1:0}a(pO,"getAuthTypeForProvider");function WAn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(WAn,"customEndpointApiTypeToEndpoint");function Vze(t,e){let r=t.trim();r.endsWith("/")&&(r=r.slice(0,-1));let n=["/v1/messages","/chat/completions","/responses","/messages"];for(let s of n)if(r.endsWith(s)){r=r.slice(0,-s.length);break}let o=/\/v\d+$/;return e==="messages"?r.replace(o,""):o.test(r)?r:`${r}/v1`}a(Vze,"resolveCustomEndpointBaseUrl");function jle(t){return t===io.OpenAI||t===io.Gemini||t===io.Groq||t===io.OpenRouter||t===io.Anthropic}a(jle,"isOpenAICompatible");async function hO(t,e,r){let n=new da(t.get(Yn)),o=await n.getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=vK(e),d=u?RUo:1e5,f=u?kUo:8192,h=c?.maxInputTokens||d,m=c?.maxOutputTokens||f,g=s?.deploymentUrl,A;return u&&(A=(await n.getProviderConfig(e))?.apiType??XIe),{modelId:r,uiName:l,modelFamily:Rn.BYOK,providerName:e,deploymentUrl:g,apiType:A,maxRequestTokens:h,maxResponseTokens:m,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(hO,"resolveModelConfiguration");async function Wze(t,e,r){return await new da(t.get(Yn)).getAPIKey(e,r)}a(Wze,"resolveModelKey");function zAn(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(zAn,"resolveAzureUrl");function XQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(XQ,"isBYOKEnabled");var BC="byok",da=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}modelApiKeyKey(e,r){return`${e}-${r}-api-key`}providerApiKeyKey(e){return`${e}-api-key`}modelsConfigKey(e){return`${e}-models-config`}providerConfigKey(e){return`${e}-provider-config`}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(BC,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(BC,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(BC,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(BC,this.modelApiKeyKey(e,o),r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(BC,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(BC,this.modelApiKeyKey(e,n)))}async getStoredModelConfigs(e){return await this.persistenceManager.read(BC,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(BC,this.providerConfigKey(e))}async saveProviderConfig(e,r){await this.persistenceManager.update(BC,this.providerConfigKey(e),r)}async deleteProviderConfig(e){await this.persistenceManager.delete(BC,this.providerConfigKey(e))}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(BC),r=this.providerConfigKey(""),n=new Set(Object.values(io));return e.filter(o=>o.endsWith(r)).map(o=>o.slice(0,-r.length)).filter(o=>!n.has(o))}async listAllProviderNames(){let e=await this.listCustomProviderNames();return Array.from(new Set([...Object.values(io),...e]))}async getAllModels(e){let r=[];if(!XQ(await e.get(Qt).getToken()))return r;for(let n of await this.listAllProviderNames()){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(BC,this.modelsConfigKey(e),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(BC,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(BC,this.modelsConfigKey(e))}};p();p();p();p();function MUt(t,e){let r=CK(t,e);return r===-1?void 0:t[r]}a(MUt,"findLastMonotonous");function CK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?Kze.isErrorNoTelemetry(e)?new Kze(e.message+` +${d}`:d||"",h=rs(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await NUt.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 exe=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}},XIe=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")}},bl={Ask:new XIe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new XIe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new XIe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function KAn(t){return t===bl.Agent||t.id===bl.Agent.id}a(KAn,"isBuiltInAgentMode");function FUo(t){return t===bl.InlineAgent||t.id===bl.InlineAgent.id}a(FUo,"isBuiltInInlineAgentMode");function JAn(t){return t===bl.Ask||t.id===bl.Ask.id||KAn(t)||FUo(t)}a(JAn,"isBuiltInChatMode");function txe(t){return KAn(t)||!t.isBuiltIn&&t.customTools===void 0}a(txe,"shouldApplyGlobalToolsSetting");var H_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[bl.Ask,bl.Agent,bl.InlineAgent],o=await this.ctx.get(Fd).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new exe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return bl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??bl.Agent:bl.Agent;case"InlineAgent":return bl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Oc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var Kze=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 UUo=new fe("conversationProgress"),eq={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Tc=class{constructor(e){this.ctx=e;this.progressEntries=new Cn(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);UUo.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 io={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},QUo=new Set(Object.values(io));function tq(t){return!QUo.has(t)}a(tq,"isCustomEndpointProvider");var rxe="chatCompletions",qUo=128e3,jUo=16e3,HUo=1e5,GUo=8192;function nxe(t){return tq(t)?{maxInputTokens:qUo,maxOutputTokens:jUo}:{maxInputTokens:HUo,maxOutputTokens:GUo}}a(nxe,"getDefaultTokenLimits");function mO(t){return t===io.Azure?1:0}a(mO,"getAuthTypeForProvider");function ZAn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(ZAn,"customEndpointApiTypeToEndpoint");function Jze(t,e){let r=t.trim();r.endsWith("/")&&(r=r.slice(0,-1));let n=["/v1/messages","/chat/completions","/responses","/messages"];for(let s of n)if(r.endsWith(s)){r=r.slice(0,-s.length);break}let o=/\/v\d+$/;return e==="messages"?r.replace(o,""):o.test(r)?r:`${r}/v1`}a(Jze,"resolveCustomEndpointBaseUrl");function Hle(t){return t===io.OpenAI||t===io.Gemini||t===io.Groq||t===io.OpenRouter||t===io.Anthropic}a(Hle,"isOpenAICompatible");async function gO(t,e,r){let n=new Ga(t.get(ti)),o=await n.getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=tq(e),d=nxe(e),f=c?.maxInputTokens??d.maxInputTokens,h=c?.maxOutputTokens??d.maxOutputTokens,m=s?.deploymentUrl,g;return u&&(g=(await n.getProviderConfig(e))?.apiType??rxe),{modelId:r,uiName:l,modelFamily:Rn.BYOK,providerName:e,deploymentUrl:m,apiType:g,maxRequestTokens:f,maxResponseTokens:h,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,reasoningEfforts:c?.supportsReasoningEffort,originalBillingMultiplier:0}}a(gO,"resolveModelConfiguration");async function Zze(t,e,r){return await new Ga(t.get(ti)).getAPIKey(e,r)}a(Zze,"resolveModelKey");function XAn(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(XAn,"resolveAzureUrl");function rq(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(rq,"isBYOKEnabled");var G_="byok",Ga=class t{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}static{this._writeQueue=Promise.resolve()}static enqueue(e){let r=t._writeQueue.then(e,e);return t._writeQueue=r.then(()=>{},()=>{}),r}modelApiKeyKey(e,r){return`${e}-${r}-api-key`}providerApiKeyKey(e){return`${e}-api-key`}modelsConfigKey(e){return`${e}-models-config`}providerConfigKey(e){return`${e}-provider-config`}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(G_,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(G_,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){return t.enqueue(()=>this.storeAPIKeyUnserialized(e,r,n,o))}async deleteAPIKey(e,r,n){return t.enqueue(async()=>{r!==2&&(r===0?await this.persistenceManager.delete(G_,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(G_,this.modelApiKeyKey(e,n)))})}async getStoredModelConfigs(e){return await this.persistenceManager.read(G_,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(G_,this.providerConfigKey(e))}async saveProviderConfig(e,r){return t.enqueue(async()=>{await this.persistenceManager.update(G_,this.providerConfigKey(e),r)})}async deleteProviderConfig(e){return t.enqueue(async()=>{await this.persistenceManager.delete(G_,this.providerConfigKey(e))})}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(G_),r=this.providerConfigKey(""),n=new Set(Object.values(io));return e.filter(o=>o.endsWith(r)).map(o=>o.slice(0,-r.length)).filter(o=>!n.has(o))}async listAllProviderNames(){let e=await this.listCustomProviderNames();return Array.from(new Set([...Object.values(io),...e]))}async getAllModels(e){let r=[];if(!rq(await e.get(Qt).getToken()))return r;for(let n of await this.listAllProviderNames()){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){return t.enqueue(async()=>{let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(G_,this.modelsConfigKey(e),c),o&&s&&await this.storeAPIKeyUnserialized(e,o,s,r)})}async storeAPIKeyUnserialized(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(G_,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(G_,this.modelApiKeyKey(e,o),r))}async removeModelConfig(e,r){return t.enqueue(async()=>{let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(G_,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.persistenceManager.delete(G_,this.modelApiKeyKey(e,r)))})}async removeAllModelConfigs(e){return t.enqueue(async()=>{await this.persistenceManager.delete(G_,this.modelsConfigKey(e))})}};p();p();p();p();function FUt(t,e){let r=SK(t,e);return r===-1?void 0:t[r]}a(FUt,"findLastMonotonous");function SK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?tYe.isErrorNoTelemetry(e)?new tYe(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)}},PUo=new OUt;function Hle(t){exe(t)||PUo.onUnexpectedError(t)}a(Hle,"onUnexpectedError");var LUt="Canceled";function exe(t){return t instanceof H_?!0:t instanceof Error&&t.name===LUt&&t.message===LUt}a(exe,"isCancellationError");var H_=class extends Error{static{a(this,"CancellationError")}constructor(){super(LUt),this.name=this.message}};var Kze=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"}},Lc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function BUt(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(UUt,"shuffle");var JAn;(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})(JAn||={});function Gle(t,e){return(r,n)=>e(t(r),t(n))}a(Gle,"compareBy");var $le=a((t,e)=>t-e,"numberComparator");var KAn=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||JAn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function txe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(txe,"sumBy");p();function tyn(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(tyn,"groupBy");var XAn,eyn,ZAn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[XAn]="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))}[(eyn=Symbol.iterator,XAn=Symbol.toStringTag,eyn)](){return this.values()}};p();function QUt(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(QUt,"createSingleCallFunction");p();var qUt;(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 jUt(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]}*[(nyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},iyn,ryn=class{constructor(e,r){this[iyn]="ResourceSet";!e||typeof e=="function"?this._map=new Jze(e):(this._map=new Jze(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()}[(iyn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var oyn,HUt=class{constructor(){this[oyn]="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}[(oyn=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)}},GUt=class extends HUt{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))}},Zze=class extends GUt{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 Xze=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 NUo=!1,Vle=null;var syn=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 Xze;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(Gle(u=>u.idx,$le));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)}},$Uo=new UUt;function Gle(t){ixe(t)||$Uo.onUnexpectedError(t)}a(Gle,"onUnexpectedError");var QUt="Canceled";function ixe(t){return t instanceof $_?!0:t instanceof Error&&t.name===QUt&&t.message===QUt}a(ixe,"isCancellationError");var $_=class extends Error{static{a(this,"CancellationError")}constructor(){super(QUt),this.name=this.message}};var tYe=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"}},Lc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function qUt(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(HUt,"shuffle");var ryn;(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})(ryn||={});function $le(t,e){return(r,n)=>e(t(r),t(n))}a($le,"compareBy");var Vle=a((t,e)=>t-e,"numberComparator");var tyn=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||ryn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function oxe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(oxe,"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 iyn,oyn,nyn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[iyn]="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))}[(oyn=Symbol.iterator,iyn=Symbol.toStringTag,oyn)](){return this.values()}};p();function GUt(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(GUt,"createSingleCallFunction");p();var $Ut;(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 VUt(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]}*[(cyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},lyn,ayn=class{constructor(e,r){this[lyn]="ResourceSet";!e||typeof e=="function"?this._map=new rYe(e):(this._map=new rYe(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()}[(lyn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var uyn,WUt=class{constructor(){this[uyn]="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}[(uyn=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)}},zUt=class extends WUt{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))}},nYe=class extends zUt{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 iYe=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 WUo=!1,Wle=null;var dyn=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 iYe;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($le(u=>u.idx,Vle));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} ==================== @@ -2435,7 +2435,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function MUo(t){Vle=t}a(MUo,"setDisposableTracker");if(NUo){let t="__is_disposable_tracked__";MUo(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!==G_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==G_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function VUt(t){return Vle?.trackDisposable(t),t}a(VUt,"trackDisposable");function WUt(t){Vle?.markAsDisposed(t)}a(WUt,"markAsDisposed");function $Ut(t,e){Vle?.setParent(t,e)}a($Ut,"setParentOfDisposable");function OUo(t,e){if(Vle)for(let r of t)Vle.setParent(r,e)}a(OUo,"setParentOfDisposables");function ayn(t){if(qUt.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(ayn,"dispose");function cyn(...t){let e=eYe(()=>ayn(t));return OUo(t,e),e}a(cyn,"combinedDisposable");function eYe(t){let e=VUt({dispose:QUt(()=>{WUt(e),t()})});return e}a(eYe,"toDisposable");var eq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;VUt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(WUt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ayn(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 $Ut(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),$Ut(e,null))}},G_=class{constructor(){this._store=new eq;VUt(this),$Ut(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){WUt(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 Wle(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(Wle,"formatResetDate");var tq=class{static{a(this,"QuotaWarningNotifier")}};var bK=class{static{a(this,"QuotaChangeNotifier")}};var zUt=[50,75,90,95],Au=class extends G_{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(bs(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(bK).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=zUt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(zUt[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(tq).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(tq).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 ${Wle(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function tYe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await cbe(t,e);if(r.ok){let n=await r.json();t.get(Au).processUserInfoQuotaSnapshot(n)}}}a(tYe,"refreshUserQuota");p();p();var rxe=new fe("openAICompatibleLMProvider"),zle={[io.OpenAI]:"https://api.openai.com/v1",[io.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[io.Groq]:"https://api.groq.com/openai/v1",[io.OpenRouter]:"https://openrouter.ai/api/v1",[io.Anthropic]:"https://api.anthropic.com/v1"},Zx=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 da(this.ctx.get(Yn)).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 rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=zle[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(tr).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*nxe(t,e){for await(let r of t)yield e(r)}a(nxe,"asyncIterableMap");async function*lyn(t,e){for await(let r of t)await e(r)&&(yield r)}a(lyn,"asyncIterableFilter");async function*ixe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(ixe,"asyncIterableMapFilter");p();var rYe="interleaved-thinking-2025-05-14",uyn="2023-06-01";p();var BP=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 el=class{static{a(this,"ModelConfigurationProvider")}},nYe=class extends el{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(xs).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(xs).getMetadata(),o=BUo(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===Rn.Gpt35turbo||r===Rn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:KUt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(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===Rn.Gpt4||r===Rn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:KUt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(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===Rn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await LUo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(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:dyn(s),maxLongContextTokens:fyn(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(xs).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:dyn(o),maxLongContextTokens:fyn(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===Tun.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function LUo(t,e){let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),KUt(o,e)}a(LUo,"getExpRequestTokens");function KUt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(KUt,"getRequestTokens");function dyn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(dyn,"getMaxRequestTokens");function fyn(t){return t.billing?.token_prices?.long_context?.context_max}a(fyn,"getMaxLongContextTokens");function YUt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(YUt,"getResponseTokens");function BUo(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(BUo,"filterModelsByCapabilities");function mO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(mO,"pickReasoningEffort");function FUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(FUo,"shouldUseResponsesApi");function UUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(UUo,"shouldUseMessagesApi");var pyn=["completions","responses","v1/messages"];function iYe(t,e){return e?"v1/messages":t&&FUo(t)?"responses":"completions"}a(iYe,"resolveEndpointRoute");function oYe(t,e){if(!UUo(e))return!1;let r=Ft(t,Ye.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(oYe,"willUseMessagesEndpoint");p();function sYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(sYe,"isCodexStyleGptModel");function hyn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(hyn,"isGpt5PlusFamily");function myn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(myn,"isAnthropicModel");p();p();function gyn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===io.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,!r&&"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&!r&&delete t.max_tokens}a(gyn,"adaptRequestForBYOKProvider");p();p();var qS=class{static{a(this,"RateLimitNotifier")}},aYe=class extends qS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var JUt=[50,75,90,95],gO=class extends G_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(bs(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(qS).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=JUt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(JUt[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=Wle(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 fg="https://aka.ms/github-copilot-rate-limit-error";function QUo(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(QUo,"secondsToHumanReadableTime");var $_=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":QUo(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](${fg})`;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](${fg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`;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](${fg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`;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](${fg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${fg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${fg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`}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](${fg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${fg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`}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("additional_spend_limit_reached"))return"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.";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.":r.isTBBEnabled?"Usage limit exceeded. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"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 rq="copilot-edits-session";p();p();p();p();Mo();function cYe(t,e,r,n,o,s,c){return _Kr(t,e,r,o,n,c),{completionText:e,meanLogProb:qUo(t,r),meanAlternativeLogProb:jUo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Mt(),finishReason:r.finish_reason}}a(cYe,"convertToAPIChoice");function qUo(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){Nr.exception(t,r,"Error calculating mean prob")}}a(qUo,"calculateMeanLogProb");function jUo(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){Nr.exception(t,r,"Error calculating mean prob")}}a(jUo,"calculateMeanAlternativeLogProb");function Yle(t,e){return O1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Yle,"getTemperatureForSamples");var HUo={markdown:[` +`),{leaks:n,details:c}}};function zUo(t){Wle=t}a(zUo,"setDisposableTracker");if(WUo){let t="__is_disposable_tracked__";zUo(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!==V_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==V_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function KUt(t){return Wle?.trackDisposable(t),t}a(KUt,"trackDisposable");function JUt(t){Wle?.markAsDisposed(t)}a(JUt,"markAsDisposed");function YUt(t,e){Wle?.setParent(t,e)}a(YUt,"setParentOfDisposable");function YUo(t,e){if(Wle)for(let r of t)Wle.setParent(r,e)}a(YUo,"setParentOfDisposables");function fyn(t){if($Ut.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(fyn,"dispose");function pyn(...t){let e=oYe(()=>fyn(t));return YUo(t,e),e}a(pyn,"combinedDisposable");function oYe(t){let e=KUt({dispose:GUt(()=>{JUt(e),t()})});return e}a(oYe,"toDisposable");var nq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;KUt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(JUt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{fyn(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 YUt(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),YUt(e,null))}},V_=class{constructor(){this._store=new nq;KUt(this),YUt(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){JUt(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 zle(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(zle,"formatResetDate");var iq=class{static{a(this,"QuotaWarningNotifier")}};var TK=class{static{a(this,"QuotaChangeNotifier")}};var ZUt=[50,75,90,95],Au=class extends V_{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(bs(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(TK).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=ZUt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(ZUt[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(iq).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(iq).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 ${zle(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function sYe(t){let e=await t.get(Lr).resolveSession();if(e){let r=await dbe(t,e);if(r.ok){let n=await r.json();t.get(Au).processUserInfoQuotaSnapshot(n)}}}a(sYe,"refreshUserQuota");p();p();var aYe=new fe("openAICompatibleLMProvider"),Yle={[io.OpenAI]:"https://api.openai.com/v1",[io.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[io.Groq]:"https://api.groq.com/openai/v1",[io.OpenRouter]:"https://openrouter.ai/api/v1",[io.Anthropic]:"https://api.anthropic.com/v1"},ew=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 Ga(this.ctx.get(ti)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(nr).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]??this.resolveModelCapabilities(l);u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw aYe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}resolveModelCapabilities(e){}getBaseUrl(){let e=Yle[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();if(!this._knownModels){try{this._knownModels=await this.fetchKnownModelList()}catch(n){aYe.error(this.ctx,`Failed to fetch known models list for ${this.providerName} provider:`,n),this._knownModels=void 0}this._lastFetchTime=e}}async fetchKnownModelList(){let e=await(await this.ctx.get(nr).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*sxe(t,e){for await(let r of t)yield e(r)}a(sxe,"asyncIterableMap");async function*hyn(t,e){for await(let r of t)await e(r)&&(yield r)}a(hyn,"asyncIterableFilter");async function*axe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(axe,"asyncIterableMapFilter");p();var cYe="interleaved-thinking-2025-05-14",myn="2023-06-01";p();var UP=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 el=class{static{a(this,"ModelConfigurationProvider")}},lYe=class extends el{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(xs).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(xs).getMetadata(),o=JUo(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===Rn.Gpt35turbo||r===Rn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:e7t(6144,s),maxLongContextTokens:void 0,maxResponseTokens:XUt(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===Rn.Gpt4||r===Rn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:e7t(10240,s),maxLongContextTokens:void 0,maxResponseTokens:XUt(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===Rn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await KUo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:XUt(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:gyn(s),maxLongContextTokens:Ayn(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(xs).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:gyn(o),maxLongContextTokens:Ayn(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===kun.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function KUo(t,e){let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),e7t(o,e)}a(KUo,"getExpRequestTokens");function e7t(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(e7t,"getRequestTokens");function gyn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(gyn,"getMaxRequestTokens");function Ayn(t){return t.billing?.token_prices?.long_context?.context_max}a(Ayn,"getMaxLongContextTokens");function XUt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(XUt,"getResponseTokens");function JUo(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(JUo,"filterModelsByCapabilities");function AO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(AO,"pickReasoningEffort");function ZUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(ZUo,"shouldUseResponsesApi");function XUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(XUo,"shouldUseMessagesApi");var yyn=["completions","responses","v1/messages"];function uYe(t,e){return e?"v1/messages":t&&ZUo(t)?"responses":"completions"}a(uYe,"resolveEndpointRoute");function dYe(t,e){if(!XUo(e))return!1;let r=Ft(t,Ye.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(dYe,"willUseMessagesEndpoint");p();function fYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(fYe,"isCodexStyleGptModel");function Eyn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(Eyn,"isGpt5PlusFamily");function _yn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(_yn,"isAnthropicModel");p();p();function vyn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===io.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,!r&&"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&!r&&delete t.max_tokens}a(vyn,"adaptRequestForBYOKProvider");p();p();var HS=class{static{a(this,"RateLimitNotifier")}},pYe=class extends HS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var t7t=[50,75,90,95],yO=class extends V_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(bs(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(HS).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=t7t[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(t7t[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=zle(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 pg="https://aka.ms/github-copilot-rate-limit-error";function e7o(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(e7o,"secondsToHumanReadableTime");var W_=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":e7o(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](${pg})`;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](${pg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${pg})`;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](${pg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${pg})`;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](${pg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${pg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${pg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${pg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${pg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${pg})`}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](${pg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${pg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${pg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${pg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${pg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${pg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${pg})`}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("additional_spend_limit_reached"))return"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.";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.":r.isTBBEnabled?"Usage limit exceeded. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"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 oq="copilot-edits-session";p();p();p();p();Oo();function hYe(t,e,r,n,o,s,c){return TKr(t,e,r,o,n,c),{completionText:e,meanLogProb:t7o(t,r),meanAlternativeLogProb:r7o(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Mt(),finishReason:r.finish_reason}}a(hYe,"convertToAPIChoice");function t7o(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){Nr.exception(t,r,"Error calculating mean prob")}}a(t7o,"calculateMeanLogProb");function r7o(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){Nr.exception(t,r,"Error calculating mean prob")}}a(r7o,"calculateMeanAlternativeLogProb");function Kle(t,e){return O1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Kle,"getTemperatureForSamples");var n7o={markdown:[` `],python:[` @@ -2443,23 +2443,23 @@ def `,` class `,` if `,` -#`]};function Ayn(t,e){return HUo[e??""]??[` +#`]};function Cyn(t,e){return n7o[e??""]??[` -`,"\n```"]}a(Ayn,"getStops");function Kle(t){return 1}a(Kle,"getTopP");function lYe(t){return KTe}a(lYe,"getMaxSolutionTokens");p();p();var GUo=1.15,$Uo=1.17,VUo=2;function WUo(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(WUo,"isHighMultiplierModel");function zUo(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(zUo,"getThinkingText");function Jle(t,e){let r=zUo(t);if(r.length>0){let n=ws(),o=WUo(e)?$Uo:GUo;return Math.ceil(n.tokenLength(r)*VUo*o)}return 0}a(Jle,"estimateThinkingTokens");function ZUt(t){let e=t.delta;if(!e)return;let r=KUo(e),n=YUo(e);if(r||n)return{id:r,text:n}}a(ZUt,"extractThinkingDeltaFromChoice");function YUo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(YUo,"getThinkingDeltaText");function KUo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(KUo,"getThinkingDeltaId");p();function Xu(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(Xu,"toString");var jS=new fe("streamChoices"),XUt=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new n7t;this.tool_calls=new t7t;this.function_call=new r7t;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=ZUt(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 JUo(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(JUo,"splitChunk");var e7t=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)}},t7t=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 e7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},r7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},n7t=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]??[]}},SK=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=M3(this.response);this.stats=new i7t;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(),jS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),jS.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();jS.debug(this.ctx,"chunk",u);let[d,f]=JUo(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{jS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&ZUo(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?jS.error(this.ctx,"Error in response:",g.error.message):jS.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=ws(),o=a7o(e)?o7o:i7o;return Math.ceil(n.tokenLength(r)*s7o*o)}return 0}a(Zle,"estimateThinkingTokens");function r7t(t){let e=t.delta;if(!e)return;let r=u7o(e),n=l7o(e);if(r||n)return{id:r,text:n}}a(r7t,"extractThinkingDeltaFromChoice");function l7o(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(l7o,"getThinkingDeltaText");function u7o(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(u7o,"getThinkingDeltaId");p();function ed(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(ed,"toString");var GS=new fe("streamChoices"),n7t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new a7t;this.tool_calls=new o7t;this.function_call=new s7t;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=r7t(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 d7o(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!=""),r]}a(d7o,"splitChunk");var i7t=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)}},o7t=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 i7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},s7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},a7t=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]??[]}},IK=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=L3(this.response);this.stats=new c7t;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(),GS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),GS.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();GS.debug(this.ctx,"chunk",u);let[d,f]=d7o(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{GS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&f7o(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?GS.error(this.ctx,"Error in response:",g.error.message):GS.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?ZUt(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(()=>sxe(_,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(Et(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:mQ(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&&(Et(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&&jS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{jS.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(()=>sxe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),Et(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?(jS.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 s7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(jS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),jS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),jS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=sxe(e.solution,t);return cYe(t,n,s,e.index,e.requestId,o,r)}a(s7t,"prepareSolutionForReturn");function sxe(t,e){let r=t.text.join(""),n=XUo(t,e),o=e7o(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(sxe,"convertToAPIJsonData");function ZUo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(ZUo,"isCopilotConfirmation");function yyn(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}': ${Xu(s)}. Input: '${t}'.${c}`);throw o&&At(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(yyn,"parseCallArguments");function XUo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=yyn(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(XUo,"extractToolCalls");function e7o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=yyn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(e7o,"extractFunctionCall");var i7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new o7t,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(", ")}},o7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function uYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(uYe,"hasKey");function Wh(t,e){return uYe(t,e)?t[e]:void 0}a(Wh,"getKey");var _yn=de(ri());var np=new fe("fetchCompletions");function M3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(M3,"getRequestId");function O3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(O3,"getProcessingTime");function vyn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(vyn,"uiKindToIntent");var AO=class{static{a(this,"OpenAIFetcher")}};function t7o(t,e,r,n){return tx(t,e,"proxy","v1/engines",r,n)}a(t7o,"getProxyEngineUrl");function dYe(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(dYe,"sanitizeRequestOptionTelemetry");async function r7o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ps),m=t7o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},Ese(e));dYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,Et(t,"request.sent",g);let A=yl(),y=vyn(l);return HW(t,m,c.token,y,o,s,d,f).then(E=>{let _=M3(E);g.extendWithRequestId(_);let v=yl()-A;return g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),np.debug(t,"request.response properties",g.properties),np.debug(t,"request.response measurements",g.measurements),np.debug(t,"prompt:",e),Et(t,"request.response",g),E}).catch(E=>{if(Gm(E))throw Et(t,"request.cancel",g),E;h.setWarning("cls",{message:Wh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",_),g.properties.message=String(Wh(E,"name")??""),g.properties.code=String(Wh(E,"code")??""),g.properties.errno=String(Wh(E,"errno")??""),g.properties.type=String(Wh(E,"type")??"");let v=yl()-A;throw g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),np.debug(t,"request.error properties",g.properties),np.debug(t,"request.error measurements",g.measurements),Et(t,"request.error",g),E}).finally(()=>{vKr(t,e,g)})}a(r7o,"fetchWithInstrumentation");async function n7o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});dYe(s,f,["messages"]),f.properties.headerRequestId=o,Et(t,"request.sent",f);let h=yl(),m=vyn(l),g=i0(t);CB()&&(g=await C$e(t,g));try{let A=await HW(t,n,c.token,m,o,s,d,g),y=M3(A);f.extendWithRequestId(y);let E=yl()-h;return f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),np.debug(t,"request.response properties",f.properties),np.debug(t,"request.response measurements",f.measurements),np.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",f),A}catch(A){if(Gm(A))throw Et(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",y),f.properties.message=String(Wh(A,"name")??""),f.properties.code=String(Wh(A,"code")??""),f.properties.errno=String(Wh(A,"errno")??""),f.properties.type=String(Wh(A,"type")??"");let E=yl()-h;throw f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),np.debug(t,"request.error properties",f.properties),np.debug(t,"request.error measurements",f.measurements),Et(t,"request.error",f),A}finally{Zle(t,e,f)}}a(n7o,"fetchChatWithInstrumentation");function Eyn(t){return lyn(t,e=>e.completionText.trim().length>0)}a(Eyn,"postProcessChoices");var i7o="github.copilot.completions.quotaExceeded",oxe=class extends AO{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(ps),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){np.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=SK.create(e,r.count,d,n,[],s).processSSE(o),m=nxe(h,g=>s7t(e,g,n));return{type:"success",choices:Eyn(m),getProcessingTime:a(()=>O3(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(ps),A=await e.get(Qt).getToken(),y=await n7o(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){np.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Wt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=SK.create(e,1,y,m,[],_yn.CancellationToken.None).processSSE(),v=nxe(_,b=>s7t(e,b,n));return{type:"success",choices:Eyn(v),getProcessingTime:a(()=>O3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Zt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:lYe(e),temperature:Yle(e,n.count),top_p:Kle(e),n:n.count,stop:Ayn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=MY(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 bC(0),c?.isCancellationRequested?"not-sent":await r7o(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:i7o,title:"Learn More"});let l=bs(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}),np.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`;np.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?(np.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),Et(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=OU(o);At(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.`,np.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(np.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(np.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Mo();async function axe(t,e,r,n){let o=Wt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(axe,"createTelemetryWithExpWithId");function tl(t,{turn:e,conversation:r}={},n){return axe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(tl,"createTelemetryWithExpWithTurn");function cxe(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(o7o(l))),c=c.extendedBy(d,f),c}a(cxe,"extendUserMessageTelemetryData");function o7o(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(o7o,"mapSkillResolutionsForTelemetry");function Cyn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),fYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(Cyn,"createUserMessageTelemetryData");function byn(t,e,r,n,o,s,c){let l=a7o(r);return fYe(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(byn,"createModelMessageTelemetryData");function Syn(t,e,r,n,o,s,c){fYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Syn,"createOffTopicMessageTelemetryData");function Tyn(t,e,r,n,o,s,c,l,u){let d=fYe(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 s7o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Tyn,"createSuggestionMessageTelemetryData");async function Iyn(t,e,r){let n=await tl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";HS(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(Iyn,"telemetryIndexCodesearch");function fYe(t,e,r,n,o,s,c){let l=c??Wt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Mt();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=aE(r);return Et(t,`${h}.message`,d),Et(t,`${h}.messageText`,f,1),d}a(fYe,"telemetryMessage");function xyn(t,e,r,n){HS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(xyn,"createSuggestionShownTelemetryData");function s7o(t,e,r,n,o,s,c,l){HS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(s7o,"createSuggestionSelectedTelemetryData");function HS(t,e,r,n,o,s){let c=s??Wt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return Et(t,o,l),l}a(HS,"telemetryUserAction");function Zle(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return Et(t,"engine.messages",n,1)}a(Zle,"logEngineMessages");function aE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(aE,"telemetryPrefixForUiKind");function a7o(t){let e=t.split(` -`),r=[],n;for(let o=0;o-1,T=E?r7t(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(()=>lxe(_,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(At(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:AQ(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&&(At(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&&GS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{GS.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(()=>lxe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),At(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?(GS.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 u7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(GS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),GS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),GS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=lxe(e.solution,t);return hYe(t,n,s,e.index,e.requestId,o,r)}a(u7t,"prepareSolutionForReturn");function lxe(t,e){let r=t.text.join(""),n=p7o(t,e),o=h7o(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(lxe,"convertToAPIJsonData");function f7o(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(f7o,"isCopilotConfirmation");function byn(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}': ${ed(s)}. Input: '${t}'.${c}`);throw o&&Rt(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(byn,"parseCallArguments");function p7o(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=byn(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(p7o,"extractToolCalls");function h7o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=byn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(h7o,"extractFunctionCall");var c7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new l7t,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(", ")}},l7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function gYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(gYe,"hasKey");function Yh(t,e){return gYe(t,e)?t[e]:void 0}a(Yh,"getKey");var Tyn=de(ei());var op=new fe("fetchCompletions");function L3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(L3,"getRequestId");function B3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(B3,"getProcessingTime");function Iyn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(Iyn,"uiKindToIntent");var EO=class{static{a(this,"OpenAIFetcher")}};function m7o(t,e,r,n){return ix(t,e,"proxy","v1/engines",r,n)}a(m7o,"getProxyEngineUrl");function AYe(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(AYe,"sanitizeRequestOptionTelemetry");async function g7o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ps),m=m7o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},_se(e));AYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,At(t,"request.sent",g);let A=El(),y=Iyn(l);return WW(t,m,c.token,y,o,s,d,f).then(E=>{let _=L3(E);g.extendWithRequestId(_);let v=El()-A;return g.measurements.totalTimeMs=v,op.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),op.debug(t,"request.response properties",g.properties),op.debug(t,"request.response measurements",g.measurements),op.debug(t,"prompt:",e),At(t,"request.response",g),E}).catch(E=>{if(Vm(E))throw At(t,"request.cancel",g),E;h.setWarning("cls",{message:Yh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});At(t,"request.shownWarning",_),g.properties.message=String(Yh(E,"name")??""),g.properties.code=String(Yh(E,"code")??""),g.properties.errno=String(Yh(E,"errno")??""),g.properties.type=String(Yh(E,"type")??"");let v=El()-A;throw g.measurements.totalTimeMs=v,op.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),op.debug(t,"request.error properties",g.properties),op.debug(t,"request.error measurements",g.measurements),At(t,"request.error",g),E}).finally(()=>{IKr(t,e,g)})}a(g7o,"fetchWithInstrumentation");async function A7o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});AYe(s,f,["messages"]),f.properties.headerRequestId=o,At(t,"request.sent",f);let h=El(),m=Iyn(l),g=s0(t);bB()&&(g=await x$e(t,g));try{let A=await WW(t,n,c.token,m,o,s,d,g),y=L3(A);f.extendWithRequestId(y);let E=El()-h;return f.measurements.totalTimeMs=E,op.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),op.debug(t,"request.response properties",f.properties),op.debug(t,"request.response measurements",f.measurements),op.debug(t,"messages:",JSON.stringify(e)),At(t,"request.response",f),A}catch(A){if(Vm(A))throw At(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});At(t,"request.shownWarning",y),f.properties.message=String(Yh(A,"name")??""),f.properties.code=String(Yh(A,"code")??""),f.properties.errno=String(Yh(A,"errno")??""),f.properties.type=String(Yh(A,"type")??"");let E=El()-h;throw f.measurements.totalTimeMs=E,op.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),op.debug(t,"request.error properties",f.properties),op.debug(t,"request.error measurements",f.measurements),At(t,"request.error",f),A}finally{Xle(t,e,f)}}a(A7o,"fetchChatWithInstrumentation");function Syn(t){return hyn(t,e=>e.completionText.trim().length>0)}a(Syn,"postProcessChoices");var y7o="github.copilot.completions.quotaExceeded",cxe=class extends EO{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(ps),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){op.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=IK.create(e,r.count,d,n,[],s).processSSE(o),m=sxe(h,g=>u7t(e,g,n));return{type:"success",choices:Syn(m),getProcessingTime:a(()=>B3(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(ps),A=await e.get(Qt).getToken(),y=await A7o(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){op.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Wt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=IK.create(e,1,y,m,[],Tyn.CancellationToken.None).processSSE(),v=sxe(_,b=>u7t(e,b,n));return{type:"success",choices:Syn(v),getProcessingTime:a(()=>B3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Zt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:mYe(e),temperature:Kle(e,n.count),top_p:Jle(e),n:n.count,stop:Cyn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=FY(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 SC(0),c?.isCancellationRequested?"not-sent":await g7o(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:y7o,title:"Learn More"});let l=bs(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}),op.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`;op.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?(op.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),At(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=BU(o);Rt(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.`,op.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(op.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(op.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Oo();async function uxe(t,e,r,n){let o=Wt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(uxe,"createTelemetryWithExpWithId");function tl(t,{turn:e,conversation:r}={},n){return uxe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(tl,"createTelemetryWithExpWithTurn");function dxe(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(E7o(l))),c=c.extendedBy(d,f),c}a(dxe,"extendUserMessageTelemetryData");function E7o(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(E7o,"mapSkillResolutionsForTelemetry");function xyn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),yYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(xyn,"createUserMessageTelemetryData");function wyn(t,e,r,n,o,s,c){let l=v7o(r);return yYe(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(wyn,"createModelMessageTelemetryData");function Ryn(t,e,r,n,o,s,c){yYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Ryn,"createOffTopicMessageTelemetryData");function kyn(t,e,r,n,o,s,c,l,u){let d=yYe(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 _7o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(kyn,"createSuggestionMessageTelemetryData");async function Pyn(t,e,r){let n=await tl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";$S(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(Pyn,"telemetryIndexCodesearch");function yYe(t,e,r,n,o,s,c){let l=c??Wt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Mt();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=cE(r);return At(t,`${h}.message`,d),At(t,`${h}.messageText`,f,1),d}a(yYe,"telemetryMessage");function Dyn(t,e,r,n){$S(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(Dyn,"createSuggestionShownTelemetryData");function _7o(t,e,r,n,o,s,c,l){$S(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(_7o,"createSuggestionSelectedTelemetryData");function $S(t,e,r,n,o,s){let c=s??Wt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return At(t,o,l),l}a($S,"telemetryUserAction");function Xle(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return At(t,"engine.messages",n,1)}a(Xle,"logEngineMessages");function cE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(cE,"telemetryPrefixForUiKind");function v7o(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))(ic||{});function Pn(t){return t?(t=GS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Pn,"getTextPart");function Dyn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Dyn,"hasImageContent");function iq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Xle(n))return n.some(o=>o.type==="image_url");if(TK(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(iq,"hasImageContentInTurns");var Nyn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Myn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function B3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(B3,"parseToolCallArguments");function Oyn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Oyn,"toOpenAIToolCall");function Lyn(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),Zle(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Jle(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(Lyn,"convertToChatCompletion");function Xle(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Xle,"isChatCompletionContentPartArray");function TK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(TK,"isChatMessageArray");function GS(t){if(typeof t=="string")return t;if(Xle(t))return t;if(TK(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(GS,"resolveAsChatMessageContent");function oq(t,e){return(typeof t=="string"||Xle(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(oq,"appendChatMessageContent");function yO(t,e){if(t){if(typeof t=="string"||Xle(t))return[{role:"assistant",content:t}];if(TK(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(yO,"resolveResponseAsChatMessages");p();var c7t=new fe("streamMessages");function Byn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(c7t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),c7t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),c7t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=sxe(e.solution,t),u={role:"assistant",content:s};return Lyn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(Byn,"prepareChatCompletionForReturn");Mo();var pYe=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:Yle(e,r.count),top_p:Kle(e),n:r.count,stop:[` +`);return r+n}a(S7o,"truncateContentIfNeeded");var T7o=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function Lyn(t,e,r,n,o,s,c){let l=`${cE(e)}.${c}`,u=s.extendedBy(r,n);At(t,l,u);let d={...r,uiKind:e||""};Rt(t,c,hU(d,T7o),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=S7o(o.currentFileContent));let h=s.extendedBy(f,n);At(t,`${l}.restricted`,h,1)}a(Lyn,"telemetryEditSurvivalTracking");var oc=(s=>(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(oc||{});function Pn(t){return t?(t=VS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Pn,"getTextPart");function Byn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Byn,"hasImageContent");function aq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(eue(n))return n.some(o=>o.type==="image_url");if(xK(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(aq,"hasImageContentInTurns");var Fyn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Uyn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function U3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(U3,"parseToolCallArguments");function Qyn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Qyn,"toOpenAIToolCall");function qyn(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),Xle(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Zle(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(qyn,"convertToChatCompletion");function eue(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(eue,"isChatCompletionContentPartArray");function xK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(xK,"isChatMessageArray");function VS(t){if(typeof t=="string")return t;if(eue(t))return t;if(xK(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(VS,"resolveAsChatMessageContent");function cq(t,e){return(typeof t=="string"||eue(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(cq,"appendChatMessageContent");function _O(t,e){if(t){if(typeof t=="string"||eue(t))return[{role:"assistant",content:t}];if(xK(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(_O,"resolveResponseAsChatMessages");p();var f7t=new fe("streamMessages");function jyn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(f7t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),f7t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),f7t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=lxe(e.solution,t),u={role:"assistant",content:s};return qyn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(jyn,"prepareChatCompletionForReturn");Oo();var EYe=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:Kle(e,r.count),top_p:Jle(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=MY(r.repoInfo);if(s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),r.enableThinking||r.modelConfiguration?.reasoningEfforts?.length){let c=mO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort);c&&(o.reasoning_effort=c)}return 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(rq)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>O3(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")??Mt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Pn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Pn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=SK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:nxe(u,f=>Byn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};p();p();p();var cE=de(Io());var e_n="ephemeral",eQt=4,pQo=2;function t_n(t){let e=eQt-pQo-hQo(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===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===cE.Raw.ChatRole.Tool&&c?.role!==cE.Raw.ChatRole.Tool,d=s.role===cE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===cE.Raw.ChatRole.User)||d)&&(s.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e_n}),e--,e<=0))break;s.role===cE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===cE.Raw.ChatRole.User||o.role===cE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e_n})),o.role!==cE.Raw.ChatRole.User&&o.role!==cE.Raw.ChatRole.System)break}}a(t_n,"addCacheBreakpoints");function hQo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(hQo,"countCacheBreakpoints");function r_n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(r_n,"removeCacheBreakpoints");var i_n=new fe("messagesApi"),mQo="Please continue.";function o_n(t){let e=yQo(t.tools),r=gQo(t.messages,t.ctx);EQo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:mQo}]});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(o_n,"buildMessagesApiRequest");function gQo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=GYe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=GYe(s.content);s.copilot_cache_control&&n_n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=GYe(s.content);if(s.thinking&&AQo(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{i_n.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&&n_n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=GYe(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(gQo,"convertToAnthropicMessages");function GYe(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(GYe,"convertContentToAnthropicBlocks");function AQo(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&&i_n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(AQo,"addThinkingBlocks");function n_n(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(n_n,"applyCacheControlToLastBlock");function yQo(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(yQo,"convertToAnthropicTools");function EQo(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=eQt-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(EQo,"addToolsAndSystemCacheControl");p();p();var iue=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;rB3(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")??Mt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Pn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Pn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=IK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:sxe(u,f=>jyn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>B3(r),"getProcessingTime")}}};p();p();p();var lE=de(xo());var o_n="ephemeral",iQt=4,xQo=2;function s_n(t){let e=iQt-xQo-wQo(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===lE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===lE.Raw.ChatRole.Tool&&c?.role!==lE.Raw.ChatRole.Tool,d=s.role===lE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===lE.Raw.ChatRole.User)||d)&&(s.content.push({type:lE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:o_n}),e--,e<=0))break;s.role===lE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===lE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===lE.Raw.ChatRole.User||o.role===lE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:lE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:o_n})),o.role!==lE.Raw.ChatRole.User&&o.role!==lE.Raw.ChatRole.System)break}}a(s_n,"addCacheBreakpoints");function wQo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===lE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(wQo,"countCacheBreakpoints");function a_n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==lE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(a_n,"removeCacheBreakpoints");var l_n=new fe("messagesApi"),RQo="Please continue.";function u_n(t){let e=DQo(t.tools),r=kQo(t.messages,t.ctx);NQo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:RQo}]});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(u_n,"buildMessagesApiRequest");function kQo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=KYe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=KYe(s.content);s.copilot_cache_control&&c_n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=KYe(s.content);if(s.thinking&&PQo(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{l_n.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&&c_n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=KYe(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(kQo,"convertToAnthropicMessages");function KYe(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(KYe,"convertContentToAnthropicBlocks");function PQo(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&&l_n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(PQo,"addThinkingBlocks");function c_n(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(c_n,"applyCacheControlToLastBlock");function DQo(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(DQo,"convertToAnthropicTools");function NQo(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=iQt-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(NQo,"addToolsAndSystemCacheControl");p();p();var oue=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(_){Cxe.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){Cxe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(s_n,"processMessagesApiStream");var tQt=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}}):Cxe.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 Cxe.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&&Cxe.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=Jle(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 $Ye=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 o_n({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(rq)||void 0;return{type:"success",chatCompletions:s_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};p();p();p();p();var l_n=de(Io());var lr=class extends l_n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?a_n(r):void 0,s=n?c_n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?a_n(n):void 0,c=o?c_n(o):void 0;return this.renderCopilot(e,r,s,c)}};function a_n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(a_n,"adaptProgressCallbackFromVSCode");function c_n(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(c_n,"adaptCancellationTokenFromVSCode");var u_n="phase_data",VYe=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:u_n,phase:e}})}};function WYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===u_n&&typeof r.phase=="string")return r.phase}a(WYe,"rawPartAsPhaseData");p();var d_n="thinking",oue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:d_n,thinking:e},tokenUsage:e.tokens??0})}};function zYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===d_n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(zYe,"rawPartAsThinkingData");var WS=de(Io());function _Qo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=f_n(r);e.push({role:"system",content:n});break}case"user":{let n=f_n(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=CQo(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(_Qo,"convertToResponsesApiInput");function vQo(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=bQo(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=SQo(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(vQo,"convertRawMessagesToResponsesApiInput");function f_n(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(f_n,"convertMessageContentToInputParts");function CQo(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(CQo,"convertMessageContentToOutputParts");function bQo(t){let e=[];for(let r of t)if(r.type===WS.Raw.ChatCompletionContentPartKind.Opaque){let n=zYe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(bQo,"extractReasoningFromRawMessage");function SQo(t){for(let e of t)if(e.type===WS.Raw.ChatCompletionContentPartKind.Opaque){let r=WYe(e);if(r)return r}}a(SQo,"extractPhaseFromRawMessage");function p_n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=vQo(r).input:u=_Qo(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(p_n,"buildResponsesApiRequest");p();var rQt=new fe("responsesApiStream"),TQo=10,YYe=500,OK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function h_n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Xu(n)}. Input: '${t}'`)}}a(h_n,"parseCallArguments");async function*m_n(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 nQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new iue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=TQo)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"),rQt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new OK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new OK(`The server returned an error: ${_}`)}else if(E)throw rQt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new OK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){rQt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(m_n,"processResponsesApiStream");var nQt=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 Txe=new fe("messagesApiStream");async function*d_n(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 oQt(t,n,u,d,o,c),h=[],m;try{let g=new oue(A=>{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){Txe.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){Txe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(d_n,"processMessagesApiStream");var oQt=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}}):Txe.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 Txe.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&&Txe.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=Zle(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 JYe=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 u_n({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(oq)||void 0;return{type:"success",chatCompletions:d_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>B3(r),"getProcessingTime")}}};p();p();p();p();var h_n=de(xo());var lr=class extends h_n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?f_n(r):void 0,s=n?p_n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?f_n(n):void 0,c=o?p_n(o):void 0;return this.renderCopilot(e,r,s,c)}};function f_n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(f_n,"adaptProgressCallbackFromVSCode");function p_n(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(p_n,"adaptCancellationTokenFromVSCode");var m_n="phase_data",ZYe=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:m_n,phase:e}})}};function XYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===m_n&&typeof r.phase=="string")return r.phase}a(XYe,"rawPartAsPhaseData");p();var g_n="thinking",sue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:g_n,thinking:e},tokenUsage:e.tokens??0})}};function eKe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===g_n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(eKe,"rawPartAsThinkingData");var YS=de(xo());function MQo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=A_n(r);e.push({role:"system",content:n});break}case"user":{let n=A_n(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=LQo(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(MQo,"convertToResponsesApiInput");function OQo(t){let e=[];for(let r of t)switch(r.role){case YS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=BQo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===YS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=FQo(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 YS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===YS.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===YS.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 YS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===YS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===YS.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 YS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===YS.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(OQo,"convertRawMessagesToResponsesApiInput");function A_n(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(A_n,"convertMessageContentToInputParts");function LQo(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(LQo,"convertMessageContentToOutputParts");function BQo(t){let e=[];for(let r of t)if(r.type===YS.Raw.ChatCompletionContentPartKind.Opaque){let n=eKe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(BQo,"extractReasoningFromRawMessage");function FQo(t){for(let e of t)if(e.type===YS.Raw.ChatCompletionContentPartKind.Opaque){let r=XYe(e);if(r)return r}}a(FQo,"extractPhaseFromRawMessage");function y_n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=OQo(r).input:u=MQo(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(y_n,"buildResponsesApiRequest");p();var sQt=new fe("responsesApiStream"),UQo=10,tKe=500,BK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function E_n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${ed(n)}. Input: '${t}'`)}}a(E_n,"parseCallArguments");async function*__n(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 aQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new oue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=UQo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>tKe?T.substring(0,tKe):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>tKe&&(_=_.substring(0,tKe)+"\u2026"),sQt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new BK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new BK(`The server returned an error: ${_}`)}else if(E)throw sQt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new BK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){sQt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(__n,"processResponsesApiStream");var aQt=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=h_n(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=h_n(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=Jle(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 KYe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return p_n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Kle(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:mO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return{type:"success",chatCompletions:m_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};BP.register(new KYe);BP.register(new pYe);BP.register(new $Ye);p();var JYe=require("fs"),zS=de(require("path"));function eKe(t){return Zae(()=>!!Ft(t,Ye.PromptPersistBasePath)?.trim(),!1)}a(eKe,"isPromptPersistEnabled");var IQo={mkdir:a((t,e)=>JYe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>JYe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>JYe.promises.appendFile(t,e,r),"appendFile")},jP,ZYe,sQt,iQt=new Map,g_n=0,oQt=new Map,aQt=new Map;function cQt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(cQt,"formatHumanTimestamp");function lQt(t,e){return ZYe||(ZYe=xQo(t,e)),ZYe}a(lQt,"getSharedProcessRoot");async function xQo(t,e){let r=cQt(new Date);jP=zS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(jP,{recursive:!0});let n=new Date().toISOString();sQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:jP};return await e.writeFile(zS.join(jP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await RQo(jP,e).catch(()=>{}),await kQo(jP,e).catch(()=>{}),jP}a(xQo,"initProcessRoot");async function wQo(t){if(jP)try{let e=zS.join(jP,"session.json"),r=new Date().toISOString(),n={createdAt:sQt??r,updatedAt:r,pid:process.pid,processRoot:jP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(wQo,"touchProcessRootSessionJson");function uQt(t){return aQt.get(t)}a(uQt,"getTurnDir");function A_n(){jP=void 0,ZYe=void 0,sQt=void 0,iQt.clear(),g_n=0,oQt.clear(),aQt.clear()}a(A_n,"resetSharedProcessRoot");async function RQo(t,e){await e.writeFile(zS.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=E_n(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=E_n(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=Zle(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 rKe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return y_n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Jle(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:AO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(oq)||void 0;return{type:"success",chatCompletions:__n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>B3(r),"getProcessingTime")}}};UP.register(new rKe);UP.register(new EYe);UP.register(new JYe);p();var nKe=require("fs"),KS=de(require("path"));function sKe(t){return Xae(()=>!!Ft(t,Ye.PromptPersistBasePath)?.trim(),!1)}a(sKe,"isPromptPersistEnabled");var QQo={mkdir:a((t,e)=>nKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>nKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>nKe.promises.appendFile(t,e,r),"appendFile")},GP,iKe,uQt,cQt=new Map,v_n=0,lQt=new Map,dQt=new Map;function fQt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(fQt,"formatHumanTimestamp");function pQt(t,e){return iKe||(iKe=qQo(t,e)),iKe}a(pQt,"getSharedProcessRoot");async function qQo(t,e){let r=fQt(new Date);GP=KS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(GP,{recursive:!0});let n=new Date().toISOString();uQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:GP};return await e.writeFile(KS.join(GP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await HQo(GP,e).catch(()=>{}),await GQo(GP,e).catch(()=>{}),GP}a(qQo,"initProcessRoot");async function jQo(t){if(GP)try{let e=KS.join(GP,"session.json"),r=new Date().toISOString(),n={createdAt:uQt??r,updatedAt:r,pid:process.pid,processRoot:GP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(jQo,"touchProcessRootSessionJson");function hQt(t){return dQt.get(t)}a(hQt,"getTurnDir");function C_n(){GP=void 0,iKe=void 0,uQt=void 0,cQt.clear(),v_n=0,lQt.clear(),dQt.clear()}a(C_n,"resetSharedProcessRoot");async function HQo(t,e){await e.writeFile(KS.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. @@ -2508,7 +2508,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(RQo,"writeReadme");async function kQo(t,e){await e.writeFile(zS.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(HQo,"writeReadme");async function GQo(t,e){await e.writeFile(KS.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2577,37 +2577,37 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(kQo,"writeGenerateHarScript");var XYe=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??IQo}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await lQt(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=(iQt.get(this.conversationId)??0)+1;iQt.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?uQt(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=zS.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=oQt.get(this.conversationId);f||(f=String(++g_n).padStart(6,"0"),oQt.set(this.conversationId,f)),this.sessionDir=zS.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),aQt.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),wQo(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=zS.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=zS.join(r,"fetchLog.jsonl"),l=JSON.stringify(s)+` -`;await this.serializedAppend(c,l)}catch(r){ot.debug(this.ctx,"Failed to persist LLM request",r)}}async appendTrajectoryStep(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=zS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append trajectory step",r)}}async appendSubagentLink(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=zS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append subagent link",r)}}async appendToolInOut(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=zS.join(r,"tool-in-out.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.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 rKe=require("fs"),bO=de(require("path"));var y_n=require("stream");var PQo={mkdir:a((t,e)=>rKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>rKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>rKe.promises.appendFile(t,e,r),"appendFile")},tKe,nKe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??PQo,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(){tKe=void 0,A_n(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return tKe||(tKe=this.initHttpLogDir()),tKe}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 lQt(this.basePath,this.toPersistenceFileOps()),r=bO.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=uQt(e);if(!r)return;let n=bO.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(bO.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(bO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(bO.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(bO.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(bO.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(bO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(bO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},iKe=class extends ex{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 y_n.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 LK=class t extends G_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new fe("AutoModelService"),this._register(bs(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(xs).getMetadata(),c=await this._ctx.get(el).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 b$e(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 oKe="Auto",V_="auto";var xo=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 da(e.get(Yn)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(xs).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(Qt).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(Au);if(!s&&l.quotaExhausted&&!c){let u=await e.get(xs).getFallbackModel();if(u?.id)return e.get(el).getBestChatModelConfig([u.id])}if(r)return e.get(el).getBestChatModelConfig(xS(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===V_)return await e.get(LK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(el).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===V_?V_:(await e.get(xs).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===Rn.O1Ga||r===Rn.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}=dQt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var th=new fe("fetchChat"),DQo=new Set([500,502,504]),NQo=[1e3,1e4,1e4],sKe=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(Gm(f)||!XI(f))throw f;th.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(LQo(l.status)){th.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 xo.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(Au).processQuotaHeaders(l.headers),e.get(gO).processRateLimitHeaders(l.headers);let u=BP.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){th.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 BQo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){th.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}th.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 Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=BP.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,apiType:n.apiType},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 gyn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await MQo(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,n.apiType)}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`;th.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),Et(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 th.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=OU(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return At(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 th.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=$_.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(Qt).getToken();return n.status===402?{type:"failed",reason:$_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:OU(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Au).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(th.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function MQo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:wa(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});dYe(c,b,["messages"]),b.properties.headerRequestId=s,Et(t,"request.sent",b);let T=yl(),w=wyn(u),R={...i0(t),...f.toCapiHeaders()};CB()&&(R=await C$e(t,R)),c.messages?.some(D=>Array.isArray(D.content)?D.content.some(N=>"image_url"in N):!1)&&(R["Copilot-Vision-Request"]="true");let x=_==="messages"&&!!h;h&&(_==="messages"?(R["x-api-key"]=h,R["anthropic-version"]=uyn):R["api-key"]=h),g&&(R[rq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=rYe),c.messages&&c.messages.forEach(D=>{OQo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>Oyn(N)))});let P=Zae(()=>eKe(t)?new nKe(t):void 0,void 0);return HW(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=M3(D);b.extendWithRequestId(N);let L=yl()-T;return b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${L}ms`),th.debug(t,"request.response properties",b.properties),th.debug(t,"request.response measurements",b.measurements),th.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",b),P?new iKe(D,P,s,T):D}).catch(D=>{if(Gm(D))throw D;let N=b.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",N),b.properties.message=String(Wh(D,"name")??""),b.properties.code=String(Wh(D,"code")??""),b.properties.errno=String(Wh(D,"errno")??""),b.properties.type=String(Wh(D,"type")??"");let L=yl()-T;throw b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${L}ms`),th.debug(t,"request.error properties",b.properties),th.debug(t,"request.error measurements",b.measurements),Et(t,"request.error",b),D}).finally(()=>{Zle(t,e,b)})}a(MQo,"fetchWithInstrumentation");function OQo(t){return"tool_calls"in t}a(OQo,"isChatMessageWithToolCalls");function LQo(t){return DQo.has(t)}a(LQo,"shouldRetryStatusCode");async function BQo(t,e,r,n,o=NQo){let s=t.get(tr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(th.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([bC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await bC(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 th.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,th.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,th.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return th.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(BQo,"checkNetworkConnectivity");p();var FQo=[{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 aKe(t){let e=t.slice();return e.reverse(),E_n(e)||E_n(e.filter(r=>r.trim().length>0))}a(aKe,"isRepetitive");function E_n(t){let e=UQo(t);for(let r of FQo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(UQo,"kmp_prefix_function");Mo();var oc=class{constructor(e){this.ctx=e;this.fetcher=new sKe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Mt(),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&&Ft(this.ctx,Ye.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&myn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=mO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ft(this.ctx,Ye.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(!XQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await Wze(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===io.Azure)if(e.modelConfiguration.deploymentUrl)A=zAn(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(jle(e.modelConfiguration?.providerName))A=zle[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!E)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??XIe;A=Vze(e.modelConfiguration.deploymentUrl,D),y=WAn(D),e.authToken=E}}else{if(A=tx(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?oYe(this.ctx,f):!1;y=iYe(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=BP.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:_,apiType:f?.apiType,...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),At(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 P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Jae(()=>{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=ixe(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:Pn(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:Pn(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=>Pn(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 aKe(e.tokens)?(r.extendWithRequestId(e.requestId),Et(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(Gm(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 OK?!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(Au).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),At(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var zh=class{static{a(this,"ConversationInspector")}};p();p();var Yh=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]}},fQt=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}}},pQt=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}}},gg=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 fQt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new pQt(this._processor(e),this.id)}};p();p();var bl=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")}},sue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new bl(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 __n=new fe("EncodingConfigurationService"),SO=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),__n.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),__n.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var v_n=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 QQo=globalThis.performance&&typeof globalThis.performance.now=="function",cKe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=QQo&&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 C_n=!1,qQo=!1,Sxe;(M=>{M.None=a(()=>G_.None,"None");function e(O){if(qQo){let{onDidAddListener:j}=O,Q=bxe.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()),j?.()}}}a(e,"_addLeakageTraceLogic");function r(O,j){return g(O,()=>{},0,void 0,!0,void 0,j)}M.defer=r,a(r,"defer");function n(O){return(j,Q=null,U)=>{let Y=!1,W;return W=O(V=>{if(!Y)return W?W.dispose():Y=!0,j.call(Q,V)},null,U),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,j){return M.once(M.filter(O,j))}M.onceIf=o,a(o,"onceIf");function s(O,j,Q){return h((U,Y=null,W)=>O(V=>U.call(Y,j(V)),null,W),Q)}M.map=s,a(s,"map");function c(O,j,Q){return h((U,Y=null,W)=>O(V=>{j(V),U.call(Y,V)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,j,Q){return h((U,Y=null,W)=>O(V=>j(V)&&U.call(Y,V),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(j,Q=null,U)=>{let Y=cyn(...O.map(W=>W(V=>j.call(Q,V))));return m(Y,U)}}M.any=d,a(d,"any");function f(O,j,Q,U){let Y=Q;return s(O,W=>(Y=j(Y,W),Y),U)}M.reduce=f,a(f,"reduce");function h(O,j){let Q,U={onWillAddFirstListener(){Q=O(Y.fire,Y)},onDidRemoveLastListener(){Q?.dispose()}};j||e(U);let Y=new YS(U);return j?.add(Y),Y.event}a(h,"snapshot");function m(O,j){return j instanceof Array?j.push(O):j&&j.add(O),O}a(m,"addAndReturnDisposable");function g(O,j,Q=100,U=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=O(Ue=>{re++,ie=j(ie,Ue),U&&!H&&(ge.fire(ie),ie=void 0),le=a(()=>{let ke=ie;ie=void 0,H=void 0,(!U||re>1)&&ge.fire(ke),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(le,Q)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let ge=new YS(Le);return V?.add(ge),ge.event}M.debounce=g,a(g,"debounce");function A(O,j=0,Q){return M.debounce(O,(U,Y)=>U?(U.push(Y),U):[Y],j,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,j=(U,Y)=>U===Y,Q){let U=!0,Y;return l(O,W=>{let V=U||!j(W,Y);return U=!1,Y=W,V},Q)}M.latch=y,a(y,"latch");function E(O,j,Q){return[M.filter(O,j,Q),M.filter(O,U=>!j(U),Q)]}M.split=E,a(E,"split");function _(O,j=!1,Q=[],U){let Y=Q.slice(),W=O(ie=>{Y?Y.push(ie):z.fire(ie)});U&&U.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new YS({onWillAddFirstListener(){W||(W=O(ie=>z.fire(ie)),U&&U.add(W))},onDidAddFirstListener(){Y&&(j?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(z),z.event}M.buffer=_,a(_,"buffer");function v(O,j){return a((U,Y,W)=>{let V=j(new T);return O(function(z){let ie=V.evaluate(z);ie!==b&&U.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(Q=>(j(Q),Q)),this}filter(j){return this.steps.push(Q=>j(Q)?Q:b),this}reduce(j,Q){let U=Q;return this.steps.push(Y=>(U=j(U,Y),U)),this}latch(j=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(Y=>{let W=Q||!j(Y,U);return Q=!1,U=Y,W?Y:b}),this}evaluate(j){for(let Q of this.steps)if(j=Q(j),j===b)break;return j}}function w(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.on(j,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(j,U),"onLastListenerRemove"),V=new YS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.addEventListener(j,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(j,U),"onLastListenerRemove"),V=new YS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,j){return new Promise(Q=>n(O)(Q,null,j))}M.toPromise=x,a(x,"toPromise");function P(O){let j=new YS;return O.then(Q=>{j.fire(Q)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}M.fromPromise=P,a(P,"fromPromise");function D(O,j){return O(Q=>j.fire(Q))}M.forward=D,a(D,"forward");function N(O,j,Q){return j(Q),O(U=>j(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(j,Q){this._observable=j;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{j.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{j.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new YS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,Q){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,j){return new L(O,j).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(O){return(j,Q,U)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(O.reportChanges(),W&&(W=!1,j.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver(V),O.reportChanges();let z={dispose(){O.removeObserver(V)}};return U instanceof eq?U.add(z):Array.isArray(U)&&U.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(Sxe||={});var hQt=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 cKe,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}}},b_n=-1;var mQt=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 cKe=require("fs"),TO=de(require("path"));var b_n=require("stream");var $Qo={mkdir:a((t,e)=>cKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>cKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>cKe.promises.appendFile(t,e,r),"appendFile")},aKe,lKe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??$Qo,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(){aKe=void 0,C_n(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return aKe||(aKe=this.initHttpLogDir()),aKe}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 pQt(this.basePath,this.toPersistenceFileOps()),r=TO.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=hQt(e);if(!r)return;let n=TO.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(TO.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(TO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(TO.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(TO.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(TO.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(TO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(TO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},uKe=class extends nx{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 b_n.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 FK=class t extends V_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new fe("AutoModelService"),this._register(bs(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(xs).getMetadata(),c=await this._ctx.get(el).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 w$e(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 dKe="Auto",z_="auto";var wo=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 Ga(e.get(ti)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(xs).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(Qt).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(Au);if(!s&&l.quotaExhausted&&!c){let u=await e.get(xs).getFallbackModel();if(u?.id)return e.get(el).getBestChatModelConfig([u.id])}if(r)return e.get(el).getBestChatModelConfig(wS(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===z_)return await e.get(FK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(el).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===z_?z_:(await e.get(xs).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===Rn.O1Ga||r===Rn.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}=mQt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var nh=new fe("fetchChat"),VQo=new Set([500,502,504]),WQo=[1e3,1e4,1e4],fKe=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(Vm(f)||!rx(f))throw f;nh.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(KQo(l.status)){nh.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 wo.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(Au).processQuotaHeaders(l.headers),e.get(yO).processRateLimitHeaders(l.headers);let u=UP.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){nh.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 JQo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){nh.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}nh.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 Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=UP.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,apiType:n.apiType},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 vyn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await zQo(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,n.apiType)}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`;nh.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),At(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 nh.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=BU(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return Rt(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 nh.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=W_.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(Qt).getToken();return n.status===402?{type:"failed",reason:W_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:BU(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Au).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(nh.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function zQo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:Ra(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});AYe(c,b,["messages"]),b.properties.headerRequestId=s,At(t,"request.sent",b);let T=El(),w=Nyn(u),R={...s0(t),...f.toCapiHeaders()};bB()&&(R=await x$e(t,R)),c.messages?.some(D=>Array.isArray(D.content)?D.content.some(N=>"image_url"in N):!1)&&(R["Copilot-Vision-Request"]="true");let x=_==="messages"&&!!h;h&&(_==="messages"?(R["x-api-key"]=h,R["anthropic-version"]=myn):R["api-key"]=h),g&&(R[oq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=cYe),c.messages&&c.messages.forEach(D=>{YQo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>Qyn(N)))});let P=Xae(()=>sKe(t)?new lKe(t):void 0,void 0);return WW(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=L3(D);b.extendWithRequestId(N);let L=El()-T;return b.measurements.totalTimeMs=L,nh.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${L}ms`),nh.debug(t,"request.response properties",b.properties),nh.debug(t,"request.response measurements",b.measurements),nh.debug(t,"messages:",JSON.stringify(e)),At(t,"request.response",b),P?new uKe(D,P,s,T):D}).catch(D=>{if(Vm(D))throw D;let N=b.extendedBy({error:"Network exception"});At(t,"request.shownWarning",N),b.properties.message=String(Yh(D,"name")??""),b.properties.code=String(Yh(D,"code")??""),b.properties.errno=String(Yh(D,"errno")??""),b.properties.type=String(Yh(D,"type")??"");let L=El()-T;throw b.measurements.totalTimeMs=L,nh.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${L}ms`),nh.debug(t,"request.error properties",b.properties),nh.debug(t,"request.error measurements",b.measurements),At(t,"request.error",b),D}).finally(()=>{Xle(t,e,b)})}a(zQo,"fetchWithInstrumentation");function YQo(t){return"tool_calls"in t}a(YQo,"isChatMessageWithToolCalls");function KQo(t){return VQo.has(t)}a(KQo,"shouldRetryStatusCode");async function JQo(t,e,r,n,o=WQo){let s=t.get(nr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(nh.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([SC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await SC(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 nh.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,nh.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,nh.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return nh.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(JQo,"checkNetworkConnectivity");p();var ZQo=[{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 pKe(t){let e=t.slice();return e.reverse(),S_n(e)||S_n(e.filter(r=>r.trim().length>0))}a(pKe,"isRepetitive");function S_n(t){let e=XQo(t);for(let r of ZQo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(XQo,"kmp_prefix_function");Oo();var sc=class{constructor(e){this.ctx=e;this.fetcher=new fKe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Mt(),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&&Ft(this.ctx,Ye.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&_yn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=AO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ft(this.ctx,Ye.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(!rq(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await Zze(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===io.Azure)if(e.modelConfiguration.deploymentUrl)A=XAn(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(Hle(e.modelConfiguration?.providerName))A=Yle[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!E)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??rxe;A=Jze(e.modelConfiguration.deploymentUrl,D),y=ZAn(D),e.authToken=E}}else{if(A=ix(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?dYe(this.ctx,f):!1;y=uYe(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=UP.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:_,apiType:f?.apiType,...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),Rt(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 P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Zae(()=>{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=axe(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:Pn(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:Pn(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=>Pn(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 pKe(e.tokens)?(r.extendWithRequestId(e.requestId),At(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(Vm(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 BK?!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(Au).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),Rt(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var Kh=class{static{a(this,"ConversationInspector")}};p();p();var Jh=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]}},gQt=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}}},AQt=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}}},Ag=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 gQt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new AQt(this._processor(e),this.id)}};p();p();var Sl=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")}},aue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new Sl(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 T_n=new fe("EncodingConfigurationService"),IO=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),T_n.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),T_n.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var I_n=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 eqo=globalThis.performance&&typeof globalThis.performance.now=="function",hKe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=eqo&&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 x_n=!1,tqo=!1,xxe;(M=>{M.None=a(()=>V_.None,"None");function e(O){if(tqo){let{onDidAddListener:j}=O,Q=Ixe.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()),j?.()}}}a(e,"_addLeakageTraceLogic");function r(O,j){return g(O,()=>{},0,void 0,!0,void 0,j)}M.defer=r,a(r,"defer");function n(O){return(j,Q=null,U)=>{let Y=!1,W;return W=O(V=>{if(!Y)return W?W.dispose():Y=!0,j.call(Q,V)},null,U),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,j){return M.once(M.filter(O,j))}M.onceIf=o,a(o,"onceIf");function s(O,j,Q){return h((U,Y=null,W)=>O(V=>U.call(Y,j(V)),null,W),Q)}M.map=s,a(s,"map");function c(O,j,Q){return h((U,Y=null,W)=>O(V=>{j(V),U.call(Y,V)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,j,Q){return h((U,Y=null,W)=>O(V=>j(V)&&U.call(Y,V),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(j,Q=null,U)=>{let Y=pyn(...O.map(W=>W(V=>j.call(Q,V))));return m(Y,U)}}M.any=d,a(d,"any");function f(O,j,Q,U){let Y=Q;return s(O,W=>(Y=j(Y,W),Y),U)}M.reduce=f,a(f,"reduce");function h(O,j){let Q,U={onWillAddFirstListener(){Q=O(Y.fire,Y)},onDidRemoveLastListener(){Q?.dispose()}};j||e(U);let Y=new JS(U);return j?.add(Y),Y.event}a(h,"snapshot");function m(O,j){return j instanceof Array?j.push(O):j&&j.add(O),O}a(m,"addAndReturnDisposable");function g(O,j,Q=100,U=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=O(Ue=>{re++,ie=j(ie,Ue),U&&!H&&(ge.fire(ie),ie=void 0),le=a(()=>{let ke=ie;ie=void 0,H=void 0,(!U||re>1)&&ge.fire(ke),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(le,Q)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let ge=new JS(Le);return V?.add(ge),ge.event}M.debounce=g,a(g,"debounce");function A(O,j=0,Q){return M.debounce(O,(U,Y)=>U?(U.push(Y),U):[Y],j,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,j=(U,Y)=>U===Y,Q){let U=!0,Y;return l(O,W=>{let V=U||!j(W,Y);return U=!1,Y=W,V},Q)}M.latch=y,a(y,"latch");function E(O,j,Q){return[M.filter(O,j,Q),M.filter(O,U=>!j(U),Q)]}M.split=E,a(E,"split");function _(O,j=!1,Q=[],U){let Y=Q.slice(),W=O(ie=>{Y?Y.push(ie):z.fire(ie)});U&&U.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new JS({onWillAddFirstListener(){W||(W=O(ie=>z.fire(ie)),U&&U.add(W))},onDidAddFirstListener(){Y&&(j?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(z),z.event}M.buffer=_,a(_,"buffer");function v(O,j){return a((U,Y,W)=>{let V=j(new T);return O(function(z){let ie=V.evaluate(z);ie!==b&&U.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(Q=>(j(Q),Q)),this}filter(j){return this.steps.push(Q=>j(Q)?Q:b),this}reduce(j,Q){let U=Q;return this.steps.push(Y=>(U=j(U,Y),U)),this}latch(j=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(Y=>{let W=Q||!j(Y,U);return Q=!1,U=Y,W?Y:b}),this}evaluate(j){for(let Q of this.steps)if(j=Q(j),j===b)break;return j}}function w(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.on(j,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(j,U),"onLastListenerRemove"),V=new JS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.addEventListener(j,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(j,U),"onLastListenerRemove"),V=new JS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,j){return new Promise(Q=>n(O)(Q,null,j))}M.toPromise=x,a(x,"toPromise");function P(O){let j=new JS;return O.then(Q=>{j.fire(Q)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}M.fromPromise=P,a(P,"fromPromise");function D(O,j){return O(Q=>j.fire(Q))}M.forward=D,a(D,"forward");function N(O,j,Q){return j(Q),O(U=>j(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(j,Q){this._observable=j;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{j.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{j.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new JS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,Q){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,j){return new L(O,j).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(O){return(j,Q,U)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(O.reportChanges(),W&&(W=!1,j.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver(V),O.reportChanges();let z={dispose(){O.removeObserver(V)}};return U instanceof nq?U.add(z):Array.isArray(U)&&U.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(xxe||={});var yQt=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 hKe,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}}},w_n=-1;var EQt=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 aue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new mQt(e?.onListenerError??Hle,this._options?.leakWarningThreshold??b_n):void 0,this._perfMon=this._options?._profName?new hQt(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(C_n){let e=this._listeners;queueMicrotask(()=>{GQo(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 AQt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Hle)(f),G_.None}if(this._disposed)return G_.None;r&&(e=e.bind(r));let o=new aue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=bxe.create(),s=this._leakageMon.check(o.stack,this._size+1)),C_n&&(o.stack=c??bxe.create()),this._listeners?this._listeners instanceof aue?(this._deliveryQueue??=new yQt,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=eYe(()=>{s?.(),this._removeListener(o)});return n instanceof eq?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*HQo<=r.length){let s=0;for(let c=0;c0}};var yQt=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 S_n=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),$Qo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof EQt?!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:Sxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:S_n})})($Qo||={});var EQt=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?S_n:(this._emitter||(this._emitter=new YS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function WQo(t){return t}a(WQo,"identity");var lKe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=WQo):(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 Aq=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 _Qt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(_Qt,"escapeRegExpCharacters");function R_n(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(R_n,"ltrim");function uKe(t){return t.split(/\r\n|\r|\n/)}a(uKe,"splitLines");function vQt(t,e){return te?1:0}a(vQt,"compare");function dKe(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(dKe,"compareSubstring");function CQt(t,e){return Ixe(t,e,0,t.length,0,e.length)}a(CQt,"compareIgnoreCase");function Ixe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return dKe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);T_n(u)&&(u-=32),T_n(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Ixe,"compareSubstringIgnoreCase");function T_n(t){return t>=97&&t<=122}a(T_n,"isLowerAsciiLetter");function k_n(t,e){let r=e.length;return e.length>t.length?!1:Ixe(t,e,0,r)===0}a(k_n,"startsWithIgnoreCase");function cue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(zQo,"startsWithUTF8BOM");function P_n(t){return zQo(t)?t.substr(1):t}a(P_n,"stripUTF8BOM");var I_n=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=YQo()}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 YQo(){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(YQo,"getGraphemeBreakRawData");var x_n=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Aq(()=>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 lKe({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 Aq(()=>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;rD_n)return{status:"notfound",message:"File too large"};let c=await Ble(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:NS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=to(e);if(la.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(la),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof bl))throw c}let o=(await this.ctx.get(Qo).stat(e)).size/1024/1024;return o>D_n?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(SO).getEncodingForFile(e)}catch(o){if(!(o instanceof bl))throw o}let n=await this.ctx.get(Qo).readFileString(e,r);return P_n(n)}};p();function wxe(t){for(var e=[],r=1;r{if(t instanceof cue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new EQt(e?.onListenerError??Gle,this._options?.leakWarningThreshold??w_n):void 0,this._perfMon=this._options?._profName?new yQt(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(x_n){let e=this._listeners;queueMicrotask(()=>{iqo(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 vQt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Gle)(f),V_.None}if(this._disposed)return V_.None;r&&(e=e.bind(r));let o=new cue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Ixe.create(),s=this._leakageMon.check(o.stack,this._size+1)),x_n&&(o.stack=c??Ixe.create()),this._listeners?this._listeners instanceof cue?(this._deliveryQueue??=new CQt,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=oYe(()=>{s?.(),this._removeListener(o)});return n instanceof nq?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*nqo<=r.length){let s=0;for(let c=0;c0}};var CQt=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 R_n=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),oqo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof bQt?!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:xxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:R_n})})(oqo||={});var bQt=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?R_n:(this._emitter||(this._emitter=new JS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function aqo(t){return t}a(aqo,"identity");var mKe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=aqo):(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 _q=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 SQt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(SQt,"escapeRegExpCharacters");function M_n(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(M_n,"ltrim");function gKe(t){return t.split(/\r\n|\r|\n/)}a(gKe,"splitLines");function TQt(t,e){return te?1:0}a(TQt,"compare");function AKe(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(AKe,"compareSubstring");function IQt(t,e){return Rxe(t,e,0,t.length,0,e.length)}a(IQt,"compareIgnoreCase");function Rxe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return AKe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);k_n(u)&&(u-=32),k_n(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Rxe,"compareSubstringIgnoreCase");function k_n(t){return t>=97&&t<=122}a(k_n,"isLowerAsciiLetter");function O_n(t,e){let r=e.length;return e.length>t.length?!1:Rxe(t,e,0,r)===0}a(O_n,"startsWithIgnoreCase");function lue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(cqo,"startsWithUTF8BOM");function L_n(t){return cqo(t)?t.substr(1):t}a(L_n,"stripUTF8BOM");var P_n=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=lqo()}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 lqo(){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(lqo,"getGraphemeBreakRawData");var D_n=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new _q(()=>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 mKe({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 _q(()=>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;rB_n)return{status:"notfound",message:"File too large"};let c=await Fle(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:MS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=to(e);if(da.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(da),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof Sl))throw c}let o=(await this.ctx.get(qo).stat(e)).size/1024/1024;return o>B_n?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(IO).getEncodingForFile(e)}catch(o){if(!(o instanceof Sl))throw o}let n=await this.ctx.get(qo).readFileString(e,r);return L_n(n)}};p();function Pxe(t){for(var e=[],r=1;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(N_n,"filterConversationTurns");function SQt(t){return N_n(t).getLastTurn()?.id}a(SQt,"getLastTurnId");async function M_n(t){let e=N_n(t.conversation),r=SQt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(Ag).getDump(r),s=ZQo(o,e.turns);Nr.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(Pxe,"dedent");var is=Pxe;var xQt=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},yg=class{constructor(){this.dump=new Cn(25);this.promptsDump=new Cn(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 xQt,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 F_n(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(F_n,"filterConversationTurns");function wQt(t){return F_n(t).getLastTurn()?.id}a(wQt,"getLastTurnId");async function U_n(t){let e=F_n(t.conversation),r=wQt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(yg).getDump(r),s=fqo(o,e.turns);Nr.debug(t.ctx,`conversation.dump `,` -`+s);let c=await XQo(o,t.ctx);return is` - ${JQo(t.conversation,r)} - ${KQo(t.ctx)} +`+s);let c=await pqo(o,t.ctx);return is` + ${dqo(t.conversation,r)} + ${uqo(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(M_n,"getConversationDump");function KQo(t){let e=t.get(Ir);return is` + `}a(U_n,"getConversationDump");function uqo(t){let e=t.get(Ir);return is` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(KQo,"getEditorInfoDumpMessage");function JQo(t,e){return is` + `}a(uqo,"getEditorInfoDumpMessage");function dqo(t,e){return is` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(JQo,"getInfoDumpMessage");async function O_n(t,e,r){let n=t.ctx.get(Yh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(zo).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+=` + `}a(dqo,"getInfoDumpMessage");async function Q_n(t,e,r){let n=t.ctx.get(Jh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Yo).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&&Pn(t.turn.request.message).trim().length>0&&(o+=` **User message**: ${Pn(t.turn.request.message)}`);for(let c of s){o+=` @@ -2620,7 +2620,7 @@ ${c}`:""} **Resolution** \`\`\`yaml - ${fK(u)} + ${mK(u)} \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=is` \n\n **Processed value** @@ -2629,17 +2629,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(O_n,"getSkillsDump");function ZQo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Pn(n.request.message)};return n.response&&(s.response=Pn(n.response.message)),s})};return fK(r)}a(ZQo,"toSimulationFormat");async function XQo(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(ii).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Nr.debug(e,`conversation.dump.file +**Unresolvable**`}return o}a(Q_n,"getSkillsDump");function fqo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Pn(n.request.message)};return n.response&&(s.response=Pn(n.response.message)),s})};return mK(r)}a(fqo,"toSimulationFormat");async function pqo(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(ni).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Nr.debug(e,`conversation.dump.file `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(XQo,"fileDump");p();function TQt(t,e){let r=ws(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(Pn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(TQt,"countMessagesTokens");p();function L_n(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(pqo,"fileDump");p();function RQt(t,e){let r=ws(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(Pn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(RQt,"countMessagesTokens");p();function q_n(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(L_n,"chatBasePrompt");p();p();async function yq(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(yq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function pKe(t){return!!t&&typeof t.then=="function"}a(pKe,"isThenable");var fKe=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 Lc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Lc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var eqo;(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")})(eqo||={});var B_n=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 YS,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 hKe=!1,mKe=!1,Rxe=!1,tqo=!1,rqo=!1,F_n=!1,nqo=!1,iqo=!1,oqo=!1,sqo=!1;var j3,H3=globalThis,Xx;typeof H3.vscode<"u"&&typeof H3.vscode.process<"u"?Xx=H3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Xx=process);var U_n=typeof Xx?.versions?.electron=="string",aqo=U_n&&Xx?.type==="renderer";typeof Xx=="object"?(hKe=Xx.platform==="win32",mKe=Xx.platform==="darwin",Rxe=Xx.platform==="linux",tqo=Rxe&&!!Xx.env.SNAP&&!!Xx.env.SNAP_REVISION,nqo=U_n,oqo=!!Xx.env.CI||!!Xx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,rqo=!0):typeof navigator=="object"&&!aqo?(j3=navigator.userAgent,hKe=j3.indexOf("Windows")>=0,mKe=j3.indexOf("Macintosh")>=0,iqo=(j3.indexOf("Macintosh")>=0||j3.indexOf("iPad")>=0||j3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Rxe=j3.indexOf("Linux")>=0,sqo=j3?.indexOf("Mobi")>=0,F_n=!0):console.error("Unable to resolve platform.");var IQt=0;mKe?IQt=1:hKe?IQt=3:Rxe&&(IQt=2);var xQt=hKe,Q_n=mKe,q_n=Rxe;var cqo=F_n&&typeof H3.importScripts=="function",YXu=cqo?H3.origin:void 0;var TO=j3;var lqo=typeof H3.postMessage=="function"&&!H3.importScripts,KXu=(()=>{if(lqo){let t=[];H3.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}),H3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var uqo=!!(TO&&TO.indexOf("Chrome")>=0),JXu=!!(TO&&TO.indexOf("Firefox")>=0),ZXu=!!(!uqo&&TO&&TO.indexOf("Safari")>=0),XXu=!!(TO&&TO.indexOf("Edg/")>=0),eed=!!(TO&&TO.indexOf("Android")>=0);var BK,wQt=globalThis.vscode;if(typeof wQt<"u"&&typeof wQt.process<"u"){let t=wQt.process;BK={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"?BK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:BK={get platform(){return xQt?"win32":Q_n?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var kxe=BK.cwd,j_n=BK.env,H_n=BK.platform,sed=BK.arch;var fqo=65,pqo=97,hqo=90,mqo=122,vq=46,yg=47,QC=92,Eq=58,gqo=63,gKe=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 Aqo(t,e){if(t===null||typeof t!="object")throw new gKe(e,"Object",t)}a(Aqo,"validateObject");function op(t,e){if(typeof t!="string")throw new gKe(e,"string",t)}a(op,"validateString");var qC=H_n==="win32";function os(t){return t===yg||t===QC}a(os,"isPathSeparator");function RQt(t){return t===yg}a(RQt,"isPosixPathSeparator");function _q(t){return t>=fqo&&t<=hqo||t>=pqo&&t<=mqo}a(_q,"isWindowsDeviceRoot");function AKe(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===vq&&l!==-1?++l:l=-1}return o}a(AKe,"normalizeString");function yqo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(yqo,"formatExt");function G_n(t,e){Aqo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${yqo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(G_n,"_format");var Kh={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],op(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=kxe():(s=j_n[`=${e}`]||kxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===QC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)os(f)&&(l=1,d=!0);else if(os(f))if(d=!0,os(s.charCodeAt(1))){let h=2,m=h;for(;h2&&os(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=AKe(r,!n,"\\",os),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){op(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return RQt(s)?"\\":t;if(os(s))if(o=!0,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&os(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){op(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return os(r)||e>2&&_q(r)&&t.charCodeAt(1)===Eq&&os(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"&&os(r.charCodeAt(0))){++o;let s=r.length;s>1&&os(r.charCodeAt(1))&&(++o,s>2&&(os(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kh.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e)return"";let r=Kh.resolve(t),n=Kh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===QC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===QC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===QC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===QC?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)===QC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===QC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===QC){if(e.charCodeAt(1)===QC){let r=e.charCodeAt(2);if(r!==gqo&&r!==vq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(_q(e.charCodeAt(0))&&e.charCodeAt(1)===Eq&&e.charCodeAt(2)===QC)return`\\\\?\\${e}`;return t},dirname(t){op(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return os(o)?t:".";if(os(o)){if(r=n=1,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(os(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&&op(e,"suffix"),op(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&_q(t.charCodeAt(0))&&t.charCodeAt(1)===Eq&&(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(os(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(os(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){op(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Eq&&_q(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(os(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===vq?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:G_n.bind(null,"\\"),parse(t){op(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 os(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(os(o)){if(n=1,os(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),os(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===vq?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},Eqo=(()=>{if(qC){let t=/\\/g;return()=>{let e=kxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>kxe()})(),Cf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Eqo();op(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===yg)}return e=AKe(e,!r,"/",RQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=t.charCodeAt(t.length-1)===yg;return t=AKe(t,!e,"/",RQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return op(t,"path"),t.length>0&&t.charCodeAt(0)===yg},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?".":Cf.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e||(t=Cf.resolve(t),e=Cf.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)===yg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===yg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===yg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===yg){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&&op(e,"ext"),op(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===yg){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)===yg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){op(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===yg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===vq?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:G_n.bind(null,"/"),parse(t){op(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===yg,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===yg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===vq?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};Cf.win32=Kh.win32=Kh;Cf.posix=Kh.posix=Cf;var _qo=qC?Kh.normalize:Cf.normalize,vqo=qC?Kh.isAbsolute:Cf.isAbsolute,yKe=qC?Kh.join:Cf.join,ced=qC?Kh.resolve:Cf.resolve,led=qC?Kh.relative:Cf.relative,ued=qC?Kh.dirname:Cf.dirname,$_n=qC?Kh.basename:Cf.basename,V_n=qC?Kh.extname:Cf.extname,ded=qC?Kh.format:Cf.format,fed=qC?Kh.parse:Cf.parse,ped=qC?Kh.toNamespacedPath:Cf.toNamespacedPath,FK=qC?Kh.sep:Cf.sep,hed=qC?Kh.delimiter:Cf.delimiter;p();p();function UK(t,e="unexpected state"){if(!t)throw new Lc(`Assertion Failed: ${e}`)}a(UK,"assert");function kQt(t){if(!t()){debugger;t(),Hle(new Lc("Assertion Failed"))}}a(kQt,"assertFn");function Pxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!k_n(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(W_n,"isEqualOrParent");var EKe="**",z_n="/",_Ke="[/\\\\]",vKe="[^/\\\\]",bqo=/\//g;function Y_n(t,e){switch(t){case 0:return"";case 1:return`${vKe}*?`;default:return`(?:${_Ke}|${vKe}+${_Ke}${e?`|${_Ke}${vKe}+`:""})*?`}}a(Y_n,"starsToRegExp");function Dxe(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(Dxe,"splitGlobAware");function X_n(t){if(!t)return"";let e="",r=Dxe(t,z_n);if(r.every(n=>n===EKe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===EKe){if(n)return;e+=Y_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===z_n?h="":h=_Qt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Dxe(l,",").map(g=>X_n(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=vKe;continue;case"*":e+=Y_n(1);continue;default:e+=_Qt(f)}}sNQt(l,e)).filter(l=>l!==HP),t),n=r.length;if(!n)return HP;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(Dqo,"trivia3");function Z_n(t,e,r){let n=FK===Cf.sep,o=n?t:t.replace(bqo,FK),s=FK+o,c=Cf.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(Z_n,"trivia4and5");function Nqo(t){try{let e=new RegExp(`^${X_n(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return HP}}a(Nqo,"toRegExp");function tvn(t,e,r){return!t||typeof e!="string"?!1:MQt(t)(e,void 0,r)}a(tvn,"match");function MQt(t,e={}){if(!t)return DQt;if(typeof t=="string"||Mqo(t)){let r=NQt(t,e);if(r===HP)return DQt;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 Oqo(t,e)}a(MQt,"parse");function Mqo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(Mqo,"isRelativePattern");function Oqo(t,e){let r=rvn(Object.getOwnPropertyNames(t).map(l=>Lqo(l,t[l],e)).filter(l=>l!==HP)),n=r.length;if(!n)return HP;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(Oqo,"parsedExpression");function Lqo(t,e,r){if(e===!1)return HP;let n=NQt(t,r);if(n===HP)return HP;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 pKe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Lqo,"parseExpressionPattern");function rvn(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(rvn,"aggregateBasenameMatches");function nvn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return Bqo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(nvn,"validate");function ivn(t,e){let r=Dxe(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(tvn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(ivn,"matches");function Bqo(t){try{let e=Dxe(t,",");if(e.length===0)return!1;for(let r of e){let n=MQt(r);if(evn(n))return!1}return!0}catch{return!1}}a(Bqo,"isValidGlob");var svn=de(require("path"));var Jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var LQt=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 providers(){return x3(this.metadata)}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(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}},avn={name:"copilot-instructions",source:Jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},cvn={name:"git-commit-instructions",source:Jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},lvn={name:"agents-md-instructions",source:Jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},Fqo={name:"nested-agents-md-instructions",source:Jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},uvn={name:"claude-md-instructions",source:Jh.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},Uqo={name:"nested-claude-md-instructions",source:Jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},Qqo=[avn,cvn,lvn,Fqo,uvn,Uqo],qqo={name:"instruction-file",source:Jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},OQt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},jqo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function ovn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(ovn,"optionKey");function BQt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=ovn(n);if(!(o in OQt)||(r=!0,!(e[o]??OQt[o])))continue;let c=jqo[n];if(c){let l=ovn(c);if(!(e[l]??OQt[l]))continue}return!0}return r?!1:void 0}a(BQt,"shouldIncludeSource");var FQt=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)BQt([n],e)!==!1&&r.push(...o);return r}},Hqo=new dO;function Gqo(t,e,r,n,o){if(!t)return;let s=`${WQ}${e}`,c=Hqo.parse(s,t),l=c.body?.content??t;if(l.trim())return{matchKind:r,uri:s,name:c.header?.name??e,applyTo:c.header?.applyTo||void 0,description:c.header?.description,content:l,isReadonly:!0,isBuiltIn:!1,source:[n],providers:x3(o?[{providers:o}]:void 0)}}a(Gqo,"resolveContent");var QK=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 g of this.configsByKey.values())o.push(...g);let{name:s,matchKind:c,source:l}=this.descriptor,u=this.descriptor.providers,d=o.filter(g=>g.type==="content").map(g=>{let A=g.content?.trim();return A?Gqo(A,`global-${s}`,c,l,u):void 0}).filter(g=>g!==void 0);this.manager.set(l,d);let f={source:l,matchKind:c,providers:u},h=this.descriptor.globSuffix??"",m=new Set;for(let g of this.descriptor.defaultRegistration??[])m.add(g);for(let g of o)g.type==="location"?m.add(svn.default.posix.join(g.path,h)):g.type==="file"&&m.add(un(g.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(m),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:f})}};function $qo(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($qo,"stripSource");var Vqo="workspace",bf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new FQt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[Jh.copilotInstructions,new QK(avn,this.inMemoryManager,n)],[Jh.gitCommitInstructions,new QK(cvn,this.inMemoryManager,n)],[Jh.agentsMdInstructions,new QK(lvn,this.inMemoryManager,n)],[Jh.claudeMdInstructions,new QK(uvn,this.inMemoryManager,n)],[Jh.customInstructionFiles,new QK(qqo,this.inMemoryManager,n)]]);for(let o of Qqo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind,providers:o.providers}});this.slotsBySource.get(Jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(ug).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new LQt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=Vqo){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{Nr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push($qo(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(q_n,"chatBasePrompt");p();p();async function vq(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(vq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function EKe(t){return!!t&&typeof t.then=="function"}a(EKe,"isThenable");var yKe=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 Lc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Lc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var hqo;(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")})(hqo||={});var j_n=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 JS,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 _Ke=!1,vKe=!1,Dxe=!1,mqo=!1,gqo=!1,H_n=!1,Aqo=!1,yqo=!1,Eqo=!1,_qo=!1;var G3,$3=globalThis,tw;typeof $3.vscode<"u"&&typeof $3.vscode.process<"u"?tw=$3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(tw=process);var G_n=typeof tw?.versions?.electron=="string",vqo=G_n&&tw?.type==="renderer";typeof tw=="object"?(_Ke=tw.platform==="win32",vKe=tw.platform==="darwin",Dxe=tw.platform==="linux",mqo=Dxe&&!!tw.env.SNAP&&!!tw.env.SNAP_REVISION,Aqo=G_n,Eqo=!!tw.env.CI||!!tw.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gqo=!0):typeof navigator=="object"&&!vqo?(G3=navigator.userAgent,_Ke=G3.indexOf("Windows")>=0,vKe=G3.indexOf("Macintosh")>=0,yqo=(G3.indexOf("Macintosh")>=0||G3.indexOf("iPad")>=0||G3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Dxe=G3.indexOf("Linux")>=0,_qo=G3?.indexOf("Mobi")>=0,H_n=!0):console.error("Unable to resolve platform.");var kQt=0;vKe?kQt=1:_Ke?kQt=3:Dxe&&(kQt=2);var PQt=_Ke,$_n=vKe,V_n=Dxe;var Cqo=H_n&&typeof $3.importScripts=="function",hed=Cqo?$3.origin:void 0;var xO=G3;var bqo=typeof $3.postMessage=="function"&&!$3.importScripts,med=(()=>{if(bqo){let t=[];$3.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}),$3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var Sqo=!!(xO&&xO.indexOf("Chrome")>=0),ged=!!(xO&&xO.indexOf("Firefox")>=0),Aed=!!(!Sqo&&xO&&xO.indexOf("Safari")>=0),yed=!!(xO&&xO.indexOf("Edg/")>=0),Eed=!!(xO&&xO.indexOf("Android")>=0);var UK,DQt=globalThis.vscode;if(typeof DQt<"u"&&typeof DQt.process<"u"){let t=DQt.process;UK={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"?UK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:UK={get platform(){return PQt?"win32":$_n?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var Nxe=UK.cwd,W_n=UK.env,z_n=UK.platform,Ted=UK.arch;var Iqo=65,xqo=97,wqo=90,Rqo=122,Sq=46,Eg=47,QC=92,Cq=58,kqo=63,CKe=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 Pqo(t,e){if(t===null||typeof t!="object")throw new CKe(e,"Object",t)}a(Pqo,"validateObject");function ap(t,e){if(typeof t!="string")throw new CKe(e,"string",t)}a(ap,"validateString");var qC=z_n==="win32";function os(t){return t===Eg||t===QC}a(os,"isPathSeparator");function NQt(t){return t===Eg}a(NQt,"isPosixPathSeparator");function bq(t){return t>=Iqo&&t<=wqo||t>=xqo&&t<=Rqo}a(bq,"isWindowsDeviceRoot");function bKe(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===Sq&&l!==-1?++l:l=-1}return o}a(bKe,"normalizeString");function Dqo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Dqo,"formatExt");function Y_n(t,e){Pqo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Dqo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Y_n,"_format");var Zh={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],ap(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Nxe():(s=W_n[`=${e}`]||Nxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===QC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)os(f)&&(l=1,d=!0);else if(os(f))if(d=!0,os(s.charCodeAt(1))){let h=2,m=h;for(;h2&&os(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=bKe(r,!n,"\\",os),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){ap(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return NQt(s)?"\\":t;if(os(s))if(o=!0,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&os(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){ap(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return os(r)||e>2&&bq(r)&&t.charCodeAt(1)===Cq&&os(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"&&os(r.charCodeAt(0))){++o;let s=r.length;s>1&&os(r.charCodeAt(1))&&(++o,s>2&&(os(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Zh.normalize(e)},relative(t,e){if(ap(t,"from"),ap(e,"to"),t===e)return"";let r=Zh.resolve(t),n=Zh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===QC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===QC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===QC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===QC?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)===QC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===QC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Zh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===QC){if(e.charCodeAt(1)===QC){let r=e.charCodeAt(2);if(r!==kqo&&r!==Sq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(bq(e.charCodeAt(0))&&e.charCodeAt(1)===Cq&&e.charCodeAt(2)===QC)return`\\\\?\\${e}`;return t},dirname(t){ap(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return os(o)?t:".";if(os(o)){if(r=n=1,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(os(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&&ap(e,"suffix"),ap(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&bq(t.charCodeAt(0))&&t.charCodeAt(1)===Cq&&(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(os(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(os(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){ap(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Cq&&bq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(os(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Sq?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:Y_n.bind(null,"\\"),parse(t){ap(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 os(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(os(o)){if(n=1,os(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),os(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Sq?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},Nqo=(()=>{if(qC){let t=/\\/g;return()=>{let e=Nxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Nxe()})(),Sf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Nqo();ap(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Eg)}return e=bKe(e,!r,"/",NQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Eg,r=t.charCodeAt(t.length-1)===Eg;return t=bKe(t,!e,"/",NQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ap(t,"path"),t.length>0&&t.charCodeAt(0)===Eg},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?".":Sf.normalize(e)},relative(t,e){if(ap(t,"from"),ap(e,"to"),t===e||(t=Sf.resolve(t),e=Sf.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)===Eg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Eg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Eg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Eg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Eg){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&&ap(e,"ext"),ap(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===Eg){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)===Eg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ap(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===Eg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Sq?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:Y_n.bind(null,"/"),parse(t){ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Eg,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===Eg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Sq?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};Sf.win32=Zh.win32=Zh;Sf.posix=Zh.posix=Sf;var Mqo=qC?Zh.normalize:Sf.normalize,Oqo=qC?Zh.isAbsolute:Sf.isAbsolute,SKe=qC?Zh.join:Sf.join,xed=qC?Zh.resolve:Sf.resolve,wed=qC?Zh.relative:Sf.relative,Red=qC?Zh.dirname:Sf.dirname,K_n=qC?Zh.basename:Sf.basename,J_n=qC?Zh.extname:Sf.extname,ked=qC?Zh.format:Sf.format,Ped=qC?Zh.parse:Sf.parse,Ded=qC?Zh.toNamespacedPath:Sf.toNamespacedPath,QK=qC?Zh.sep:Sf.sep,Ned=qC?Zh.delimiter:Sf.delimiter;p();p();function qK(t,e="unexpected state"){if(!t)throw new Lc(`Assertion Failed: ${e}`)}a(qK,"assert");function MQt(t){if(!t()){debugger;t(),Gle(new Lc("Assertion Failed"))}}a(MQt,"assertFn");function Mxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!O_n(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(Z_n,"isEqualOrParent");var TKe="**",X_n="/",IKe="[/\\\\]",xKe="[^/\\\\]",Bqo=/\//g;function evn(t,e){switch(t){case 0:return"";case 1:return`${xKe}*?`;default:return`(?:${IKe}|${xKe}+${IKe}${e?`|${IKe}${xKe}+`:""})*?`}}a(evn,"starsToRegExp");function Oxe(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(Oxe,"splitGlobAware");function ivn(t){if(!t)return"";let e="",r=Oxe(t,X_n);if(r.every(n=>n===TKe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===TKe){if(n)return;e+=evn(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===X_n?h="":h=SQt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Oxe(l,",").map(g=>ivn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=xKe;continue;case"*":e+=evn(1);continue;default:e+=SQt(f)}}sBQt(l,e)).filter(l=>l!==$P),t),n=r.length;if(!n)return $P;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(Vqo,"trivia3");function nvn(t,e,r){let n=QK===Sf.sep,o=n?t:t.replace(Bqo,QK),s=QK+o,c=Sf.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(nvn,"trivia4and5");function Wqo(t){try{let e=new RegExp(`^${ivn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return $P}}a(Wqo,"toRegExp");function svn(t,e,r){return!t||typeof e!="string"?!1:FQt(t)(e,void 0,r)}a(svn,"match");function FQt(t,e={}){if(!t)return LQt;if(typeof t=="string"||zqo(t)){let r=BQt(t,e);if(r===$P)return LQt;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 Yqo(t,e)}a(FQt,"parse");function zqo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(zqo,"isRelativePattern");function Yqo(t,e){let r=avn(Object.getOwnPropertyNames(t).map(l=>Kqo(l,t[l],e)).filter(l=>l!==$P)),n=r.length;if(!n)return $P;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(Yqo,"parsedExpression");function Kqo(t,e,r){if(e===!1)return $P;let n=BQt(t,r);if(n===$P)return $P;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 EKe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Kqo,"parseExpressionPattern");function avn(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(avn,"aggregateBasenameMatches");function cvn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return Jqo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(cvn,"validate");function lvn(t,e){let r=Oxe(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(svn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(lvn,"matches");function Jqo(t){try{let e=Oxe(t,",");if(e.length===0)return!1;for(let r of e){let n=FQt(r);if(ovn(n))return!1}return!0}catch{return!1}}a(Jqo,"isValidGlob");var dvn=de(require("path"));var Xh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var QQt=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 providers(){return R3(this.metadata)}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(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||jle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return KQ(this.promptFileEntry.promptPath)}},fvn={name:"copilot-instructions",source:Xh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},pvn={name:"git-commit-instructions",source:Xh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},hvn={name:"agents-md-instructions",source:Xh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},Zqo={name:"nested-agents-md-instructions",source:Xh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},mvn={name:"claude-md-instructions",source:Xh.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},Xqo={name:"nested-claude-md-instructions",source:Xh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},ejo=[fvn,pvn,hvn,Zqo,mvn,Xqo],tjo={name:"instruction-file",source:Xh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},UQt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},rjo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function uvn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(uvn,"optionKey");function qQt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=uvn(n);if(!(o in UQt)||(r=!0,!(e[o]??UQt[o])))continue;let c=rjo[n];if(c){let l=uvn(c);if(!(e[l]??UQt[l]))continue}return!0}return r?!1:void 0}a(qQt,"shouldIncludeSource");var jQt=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)qQt([n],e)!==!1&&r.push(...o);return r}},njo=new pO;function ijo(t,e,r,n,o){if(!t)return;let s=`${YQ}${e}`,c=njo.parse(s,t),l=c.body?.content??t;if(l.trim())return{matchKind:r,uri:s,name:c.header?.name??e,applyTo:c.header?.applyTo||void 0,description:c.header?.description,content:l,isReadonly:!0,isBuiltIn:!1,source:[n],providers:R3(o?[{providers:o}]:void 0)}}a(ijo,"resolveContent");var jK=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 g of this.configsByKey.values())o.push(...g);let{name:s,matchKind:c,source:l}=this.descriptor,u=this.descriptor.providers,d=o.filter(g=>g.type==="content").map(g=>{let A=g.content?.trim();return A?ijo(A,`global-${s}`,c,l,u):void 0}).filter(g=>g!==void 0);this.manager.set(l,d);let f={source:l,matchKind:c,providers:u},h=this.descriptor.globSuffix??"",m=new Set;for(let g of this.descriptor.defaultRegistration??[])m.add(g);for(let g of o)g.type==="location"?m.add(dvn.default.posix.join(g.path,h)):g.type==="file"&&m.add(un(g.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(m),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:f})}};function ojo(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(ojo,"stripSource");var sjo="workspace",Tf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new jQt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[Xh.copilotInstructions,new jK(fvn,this.inMemoryManager,n)],[Xh.gitCommitInstructions,new jK(pvn,this.inMemoryManager,n)],[Xh.agentsMdInstructions,new jK(hvn,this.inMemoryManager,n)],[Xh.claudeMdInstructions,new jK(mvn,this.inMemoryManager,n)],[Xh.customInstructionFiles,new jK(tjo,this.inMemoryManager,n)]]);for(let o of ejo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind,providers:o.providers}});this.slotsBySource.get(Xh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(dg).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new QQt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=sjo){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=Xh.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Nr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(ojo(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:Xh.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(Xh.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:Xh.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:Xh.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:Xh.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:Xh.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."} @@ -2647,21 +2647,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=nvn(n);return o.isValid&&!!ivn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=BQt(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&&BQt(o.source,r)!==void 0).length;At(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function Cq(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(Cq,"weighElidableList");p();function dvn(t){let e=t.split(` -`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([PS(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([PS(o.join(` -`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(dvn,"fromMessage");function lue(t){let e=QQt(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=cvn(n);return o.isValid&&!!lvn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=qQt(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&&qQt(o.source,r)!==void 0).length;Rt(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function Tq(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(Tq,"weighElidableList");p();function gvn(t){let e=t.split(` +`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([DS(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([DS(o.join(` +`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(gvn,"fromMessage");function uue(t){let e=GQt(t),r=[];for(let n=0;n1&&n!==e.length-1?` -`:"")),r.push(dvn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[Cq(r,"inverseLinear"),1]]):null}a(lue,"fromHistory");var Wqo=5;function QQt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Pn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,Wqo).reverse()}a(QQt,"filterTurns");function fvn(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=Pn(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Pn(t.message)}`}a(fvn,"formatTurnMessage");p();p();p();var zqo=4,qQt={skillIds:[]},CKe=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 xo.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(kA).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(zh).inspectFetchResult(m),this.handleResult(m,f,Pn(c),s,d.toolConfig)}else return qQt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),qQt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,zqo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),qQt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return Et(this.ctx,`${aE(o)}.metaPrompt`,u,0),Et(this.ctx,`${aE(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});Et(this.ctx,"conversation.promptContextError",n,1)}};p();p();var IO=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([is(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!uue(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:PS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||uue(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(gvn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[Tq(r,"inverseLinear"),1]]):null}a(uue,"fromHistory");var ajo=5;function GQt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Pn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,ajo).reverse()}a(GQt,"filterTurns");function Avn(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=Pn(t.message).startsWith("```")?` +`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Pn(t.message)}`}a(Avn,"formatTurnMessage");p();p();p();var cjo=4,$Qt={skillIds:[]},wKe=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 wo.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(PA).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(Kh).inspectFetchResult(m),this.handleResult(m,f,Pn(c),s,d.toolConfig)}else return $Qt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),$Qt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,cjo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),$Qt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return At(this.ctx,`${cE(o)}.metaPrompt`,u,0),At(this.ctx,`${cE(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});At(this.ctx,"conversation.promptContextError",n,1)}};p();p();var wO=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([is(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!due(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:DS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||due(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(` `),n=this.doc.lineCount.toString().length;return r.map((s,c)=>`${(e.start.line+c+1).toString().padEnd(n," ")}:${s}`).join(` -`)}};function uue(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(uue,"isEmptyRange");p();p();var pvn=de(ri()),hvn=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({}))}),jQt;(r=>(r.method="github/didChangeAuth",r.type=new pvn.ProtocolNotificationType(r.method)))(jQt||={});p();var mvn=de(ri()),HQt;(r=>(r.method="copilot/ipCodeCitation",r.type=new mvn.NotificationType(r.method)))(HQt||={});p();var gvn=de(ri()),bKe;(r=>(r.method="context/update",r.type=new gvn.ProtocolRequestType(r.method)))(bKe||={});p();p();p();var Fn=de(ri()),Nxe=S.String(),jC=S.Object({uri:Nxe}),qK=S.Intersect([jC,S.Object({version:S.Optional(S.Integer())})]),ord=S.Required(qK),c0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),Sf=S.Object({start:c0,end:c0}),GQt=S.Union([S.Integer(),S.String()]),srd=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Avn=de(ri()),$Qt;(r=>(r.method="textDocument/didFocus",r.type=new Avn.ProtocolNotificationType(r.method)))($Qt||={});p();var Yqo=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()}),Kqo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),yvn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Evn=S.Object({editorInfo:S.Optional(yvn),editorPluginInfo:S.Optional(yvn),relatedPluginInfo:S.Optional(S.Array(Kqo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(Yqo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var Mxe=de(ri());var VQt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(VQt||{}),Jqo=S.Enum(VQt),Zqo=S.Object({triggerKind:Jqo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:Sf,tooltipSignature:S.Optional(S.String())}))}),_vn=S.Object({textDocument:qK,position:c0,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:Zqo,data:S.Optional(S.Unknown())}),WQt;(r=>(r.method="textDocument/inlineCompletion",r.type=new Mxe.ProtocolRequestType(r.method)))(WQt||={});var vvn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Cvn=S.Object({item:vvn}),zQt;(r=>(r.method="textDocument/didShowCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(zQt||={});var bvn=S.Object({item:vvn,acceptedLength:S.Integer({minimum:1})}),YQt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(YQt||={});p();var Svn=de(ri()),Xqo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Svn.ProtocolRequestType(r.method)))(Xqo||={});p();var Tvn=de(ri()),ejo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:Sf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),Ivn=S.Object({textDocument:qK,position:c0,diagnostics:S.Optional(S.Array(ejo))}),tjo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),xvn=S.Object({item:tjo}),KQt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new Tvn.ProtocolNotificationType(r.method)))(KQt||={});p();var SKe=de(ri());var wvn=S.Object({textDocument:qK,position:c0,partialResultToken:S.Optional(GQt),workDoneToken:S.Optional(GQt)}),TKe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new SKe.ProtocolRequestType(n.method),n.partialResult=new SKe.ProgressType))(TKe||={});p();var Rvn=de(ri()),JQt;(r=>(r.method="copilot/related",r.type=new Rvn.ProtocolRequestType(r.method)))(JQt||={});p();var ZQt=de(ri()),XQt;(r=>(r.method="statusNotification",r.type=new ZQt.ProtocolNotificationType(r.method)))(XQt||={});var eqt;(r=>(r.method="didChangeStatus/v2",r.type=new ZQt.ProtocolNotificationType(r.method)))(eqt||={});var kvn=de(require("path"));var Pvn=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),selection:S.Optional(Sf)}),tqt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e),o=td(n);if(await this.turnContext.collectFile(lE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new IO(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(uue(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 \`${kvn.basename(e.uri)}\` is content excluded.`])}},lE="current-editor",IKe=class{constructor(e){this._resolver=e;this.id=lE;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 tqt(e)}};p();var Dvn=S.Object({labels:S.Array(S.String())}),rqt=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(GP,n)}),new Ar(r)}},GP="project-labels",xKe=class{constructor(e){this._resolver=e;this.id=GP;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 rqt(e)}};p();p();p();var wKe=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}},RKe=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}},kKe=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}},PKe=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}},DKe=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}},NKe=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}},MKe=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}},OKe=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}},LKe=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}},BKe=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 FKe=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 Mvn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Mvn,"determineProgrammingLanguage");var Nvn=[new wKe,new RKe,new kKe,new PKe,new DKe,new NKe,new MKe,new OKe,new LKe,new BKe];function Ovn(t){let e=Nvn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new FKe(t,Nvn);return new nqt(e)}a(Ovn,"getMetadataLookup");var nqt=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 Lvn=S.Object({name:S.String(),version:S.Optional(S.String())}),Bvn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Lvn),buildTools:S.Array(Lvn)}),iqt=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=Ovn(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=Mvn(e);this.turnContext.collectLabel(xO,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(xO,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` +`)}};function due(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(due,"isEmptyRange");p();p();var yvn=de(ei()),Evn=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({}))}),VQt;(r=>(r.method="github/didChangeAuth",r.type=new yvn.ProtocolNotificationType(r.method)))(VQt||={});p();var _vn=de(ei()),WQt;(r=>(r.method="copilot/ipCodeCitation",r.type=new _vn.NotificationType(r.method)))(WQt||={});p();var vvn=de(ei()),RKe;(r=>(r.method="context/update",r.type=new vvn.ProtocolRequestType(r.method)))(RKe||={});p();p();p();var Fn=de(ei()),Lxe=S.String(),jC=S.Object({uri:Lxe}),HK=S.Intersect([jC,S.Object({version:S.Optional(S.Integer())})]),Srd=S.Required(HK),u0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),If=S.Object({start:u0,end:u0}),zQt=S.Union([S.Integer(),S.String()]),Trd=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Cvn=de(ei()),YQt;(r=>(r.method="textDocument/didFocus",r.type=new Cvn.ProtocolNotificationType(r.method)))(YQt||={});p();var ljo=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()}),ujo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),bvn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Svn=S.Object({editorInfo:S.Optional(bvn),editorPluginInfo:S.Optional(bvn),relatedPluginInfo:S.Optional(S.Array(ujo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(ljo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var Bxe=de(ei());var KQt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(KQt||{}),djo=S.Enum(KQt),fjo=S.Object({triggerKind:djo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:If,tooltipSignature:S.Optional(S.String())}))}),Tvn=S.Object({textDocument:HK,position:u0,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:fjo,data:S.Optional(S.Unknown())}),JQt;(r=>(r.method="textDocument/inlineCompletion",r.type=new Bxe.ProtocolRequestType(r.method)))(JQt||={});var Ivn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),xvn=S.Object({item:Ivn}),ZQt;(r=>(r.method="textDocument/didShowCompletion",r.type=new Bxe.ProtocolNotificationType(r.method)))(ZQt||={});var wvn=S.Object({item:Ivn,acceptedLength:S.Integer({minimum:1})}),XQt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new Bxe.ProtocolNotificationType(r.method)))(XQt||={});p();var Rvn=de(ei()),pjo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Rvn.ProtocolRequestType(r.method)))(pjo||={});p();var kvn=de(ei()),hjo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:If,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),Pvn=S.Object({textDocument:HK,position:u0,diagnostics:S.Optional(S.Array(hjo))}),mjo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Dvn=S.Object({item:mjo}),eqt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new kvn.ProtocolNotificationType(r.method)))(eqt||={});p();var kKe=de(ei());var Nvn=S.Object({textDocument:HK,position:u0,partialResultToken:S.Optional(zQt),workDoneToken:S.Optional(zQt)}),PKe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new kKe.ProtocolRequestType(n.method),n.partialResult=new kKe.ProgressType))(PKe||={});p();var Mvn=de(ei()),tqt;(r=>(r.method="copilot/related",r.type=new Mvn.ProtocolRequestType(r.method)))(tqt||={});p();var rqt=de(ei()),nqt;(r=>(r.method="statusNotification",r.type=new rqt.ProtocolNotificationType(r.method)))(nqt||={});var iqt;(r=>(r.method="didChangeStatus/v2",r.type=new rqt.ProtocolNotificationType(r.method)))(iqt||={});var Ovn=de(require("path"));var Lvn=S.Object({uri:S.String(),visibleRange:S.Optional(If),selection:S.Optional(If)}),oqt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=await r.getOrReadTextDocument(e),o=rd(n);if(await this.turnContext.collectFile(uE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new wO(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(due(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 \`${Ovn.basename(e.uri)}\` is content excluded.`])}},uE="current-editor",DKe=class{constructor(e){this._resolver=e;this.id=uE;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 oqt(e)}};p();var Bvn=S.Object({labels:S.Array(S.String())}),sqt=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(VP,n)}),new Ar(r)}},VP="project-labels",NKe=class{constructor(e){this._resolver=e;this.id=VP;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 sqt(e)}};p();p();p();var MKe=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}},OKe=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}},LKe=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}},BKe=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}},FKe=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}},UKe=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}},QKe=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}},qKe=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}},jKe=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}},HKe=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 GKe=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 Uvn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Uvn,"determineProgrammingLanguage");var Fvn=[new MKe,new OKe,new LKe,new BKe,new FKe,new UKe,new QKe,new qKe,new jKe,new HKe];function Qvn(t){let e=Fvn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new GKe(t,Fvn);return new aqt(e)}a(Qvn,"getMetadataLookup");var aqt=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 qvn=S.Object({name:S.String(),version:S.Optional(S.String())}),jvn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(qvn),buildTools:S.Array(qvn)}),cqt=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=Qvn(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=Uvn(e);this.turnContext.collectLabel(RO,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(RO,`${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])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;this.id=xO;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 iqt(e)}};p();var Fvn=de(require("path"));var oqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),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=td(n);if(await this.turnContext.collectFile(qKe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new IO(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 \`${Fvn.basename(r.uri)}\` is content excluded.`]),1]]}},sqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},qKe="references",QKe=class{constructor(){this.id=qKe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new sqt}processor(e){return new oqt(e)}};var jK=a(()=>[xO,GP,qKe,lE],"mandatorySkills"),due=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new CKe(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=>!jK().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)&&!jK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!jK().includes(d)))}return l.push(...jK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(zo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(zo).getSupportedSkills(r.id),c=e.get(Yh).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 ew(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...jK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function HKe(t,e){let[r,n,o]=await rjo(t,e);return o.push(...ojo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[Cq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(HKe,"fromSkills");async function rjo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await sjo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await njo(t,c.skillId);l&&(jK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(rjo,"handleSkillsInReverse");async function njo(t,e){let n=t.ctx.get(Yh).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 ijo(t,n,l,d,c,f):[void 0,await jKe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await jKe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof Oxe)throw o;return[void 0,await jKe(t,n,"failed")]}}a(njo,"safelyProcessSkill");async function ijo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await jKe(t,e,"resolved",c,o,s)]}a(ijo,"handleProcessedSkill");async function jKe(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 yq(t.ctx),f=await t.ctx.get(el).getBestChatModelConfig(xS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=ws(f.tokenizer).tokenLength(h)}return t.ctx.get(Ag).addResolution(t.turn.id,u),u}a(jKe,"determineResolution");function ojo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(ojo,"handleIgnoredSkills");async function sjo(t,e,r){if(e!==xO&&e!==GP)return!0;let n=t.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===xO:e===GP}a(sjo,"includeSkill");var HK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=lue(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 HKe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(e.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(e.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(e.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(e.ctx,Ye.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(bf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(bf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=GS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +${o}`]),1])}}},RO="project-metadata",$Ke=class{constructor(e){this._resolver=e;this.id=RO;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 cqt(e)}};p();var Hvn=de(require("path"));var lqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ni),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=rd(n);if(await this.turnContext.collectFile(WKe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new wO(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 \`${Hvn.basename(r.uri)}\` is content excluded.`]),1]]}},uqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},WKe="references",VKe=class{constructor(){this.id=WKe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new uqt}processor(e){return new lqt(e)}};var GK=a(()=>[RO,VP,WKe,uE],"mandatorySkills"),fue=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new wKe(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=>!GK().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)&&!GK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!GK().includes(d)))}return l.push(...GK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Yo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Yo).getSupportedSkills(r.id),c=e.get(Jh).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 rw(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...GK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function YKe(t,e){let[r,n,o]=await gjo(t,e);return o.push(...Ejo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[Tq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(YKe,"fromSkills");async function gjo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await _jo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await Ajo(t,c.skillId);l&&(GK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(gjo,"handleSkillsInReverse");async function Ajo(t,e){let n=t.ctx.get(Jh).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 yjo(t,n,l,d,c,f):[void 0,await zKe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await zKe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof Fxe)throw o;return[void 0,await zKe(t,n,"failed")]}}a(Ajo,"safelyProcessSkill");async function yjo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await zKe(t,e,"resolved",c,o,s)]}a(yjo,"handleProcessedSkill");async function zKe(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 vq(t.ctx),f=await t.ctx.get(el).getBestChatModelConfig(wS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=ws(f.tokenizer).tokenLength(h)}return t.ctx.get(yg).addResolution(t.turn.id,u),u}a(zKe,"determineResolution");function Ejo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(Ejo,"handleIgnoredSkills");async function _jo(t,e,r){if(e!==RO&&e!==VP)return!0;let n=t.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===RO:e===VP}a(_jo,"includeSkill");var $K=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=uue(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 YKe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(e.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(e.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(e.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(e.ctx,Ye.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(Tf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(Tf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=VS(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]}},GKe=class extends HK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return is` +`+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]}},KKe=class extends $K{static{a(this,"PanelUserPromptStrategy")}suffix(e){return is` 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. @@ -2679,7 +2679,7 @@ ${o}`]),1])}}},xO="project-metadata",UKe=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 $Ke=class extends HK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return is` + `.trim()}};var JKe=class extends $K{static{a(this,"InlineUserPromptStrategy")}suffix(e){return is` 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. @@ -2734,7 +2734,7 @@ ${o}`]),1])}}},xO="project-metadata",UKe=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 VKe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=lue(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 is` + `.trim()}};p();var ZKe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=uue(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 is` 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. @@ -2743,14 +2743,14 @@ ${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=Nyn(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:B3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.trim()}createFunctionArgumentSchema(e){let r=Fyn(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:U3(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:is` This is the user's question: ${Pn(o).trim()} - `.trim()}],[]]}};p();var WKe=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=B3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return is` + `.trim()}],[]]}};p();var XKe=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=U3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return is` 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. @@ -2766,7 +2766,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=lue(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 ajo=[{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."})}))})}}],zKe=class extends HK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.trim()}elidableContent(e){let r=uue(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 vjo=[{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."})}))})}}],eJe=class extends $K{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. @@ -2789,39 +2789,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=GS(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:ajo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=B3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!uYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!uYe(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 aqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function Lxe(t,e,r){return new aqt(t,e,r)}a(Lxe,"descriptor");var Uvn=[Lxe("user",xS("user"),()=>new GKe),Lxe("inline",xS("inline"),()=>new $Ke),Lxe("meta",xS("meta"),()=>new VKe),Lxe("suggestions",xS("suggestions"),()=>new WKe),Lxe("synonyms",xS("synonyms"),()=>new zKe)],YKe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await yq(e),s=xS(r,o),c=Uvn.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 Uvn}};var qvn=require("console");var kA=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(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(zh).inspectPrompt({type:r.promptType,prompt:Qvn(l),tokens:u}),this.ctx.get(Ag).addPrompt(e.turn.id,Qvn(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,qvn.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:cjo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,TQt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),TQt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=ljo(process.platform);return L_n(this.ctx,n,r?.login,o,e)}};function cjo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(cjo,"processResultOfElidableText");function Qvn(t){return t.map(e=>Pn(e.content)).join(` +`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=VS(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:vjo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=U3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!gYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!gYe(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 dqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function Uxe(t,e,r){return new dqt(t,e,r)}a(Uxe,"descriptor");var Gvn=[Uxe("user",wS("user"),()=>new KKe),Uxe("inline",wS("inline"),()=>new JKe),Uxe("meta",wS("meta"),()=>new ZKe),Uxe("suggestions",wS("suggestions"),()=>new XKe),Uxe("synonyms",wS("synonyms"),()=>new eJe)],tJe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await vq(e),s=wS(r,o),c=Gvn.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 Gvn}};var Vvn=require("console");var PA=class{constructor(e,r=new tJe){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(Lr).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(Kh).inspectPrompt({type:r.promptType,prompt:$vn(l),tokens:u}),this.ctx.get(yg).addPrompt(e.turn.id,$vn(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,Vvn.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:Cjo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,RQt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),RQt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=bjo(process.platform);return q_n(this.ctx,n,r?.login,o,e)}};function Cjo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(Cjo,"processResultOfElidableText");function $vn(t){return t.map(e=>Pn(e.content)).join(` -`)}a(Qvn,"debugChatMessages");function ljo(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(ljo,"mapPlatformToOs");var bq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await xo.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(kA).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 cqt="v1",$P=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},tw=class extends $P{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},l0=class extends $P{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},sp=class extends $P{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Bxe=class extends $P{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var pue=new fe("codingAgentUtils"),fue=29950;function jvn(t,e,r){if(e.length>=fue)return pue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${fue}`),e=e.slice(-fue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=fue){let o=fue-e.length-2;pue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${fue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}a($vn,"debugChatMessages");function bjo(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(bjo,"mapPlatformToOs");var Iq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await wo.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(PA).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 fqt="v1",WP=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},nw=class extends WP{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},d0=class extends WP{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},cp=class extends WP{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Qxe=class extends WP{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var hue=new fe("codingAgentUtils"),pue=29950;function Wvn(t,e,r){if(e.length>=pue)return hue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${pue}`),e=e.slice(-pue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=pue){let o=pue-e.length-2;hue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${pue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` -${r}`:""),isTruncated:n}}a(jvn,"truncatePrompt");function hue(t){return t.length<=20?t:t.substring(0,20)+"..."}a(hue,"generateTitleFromUserPrompt");function Hvn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(Hvn,"formatBodyPlaceholder");function Gvn(t,e,r){let n=t.get(ii),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),pue.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`;pue.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),pue.debug(t,`Added active editor: ${c}`))}catch(c){pue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Gvn,"extractContextPaths");function $vn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${r}`:""),isTruncated:n}}a(Wvn,"truncatePrompt");function mue(t){return t.length<=20?t:t.substring(0,20)+"..."}a(mue,"generateTitleFromUserPrompt");function zvn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(zvn,"formatBodyPlaceholder");function Yvn(t,e,r){let n=t.get(ni),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),hue.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`;hue.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),hue.debug(t,`Added active editor: ${c}`))}catch(c){hue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Yvn,"extractContextPaths");function Kvn(t){return t.length===0?"":`The user has attached the following files from their workspace: ${t.map(r=>`- ${r}`).join(` -`)}`}a($vn,"formatContextFiles");p();p();var KKe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},uE=class extends KKe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Fd=class extends KKe{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 lqt=(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))(lqt||{});p();p();p();function Sq(){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(Sq,"getUserAgent");p();p();function JKe(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)=>JKe.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(JKe,"register");p();function Vvn(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(Vvn,"addHook");p();function Wvn(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(Wvn,"removeHook");var zvn=Function.bind,Yvn=zvn.bind(zvn);function Kvn(t,e,r){let n=Yvn(Wvn,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]=Yvn(Vvn,null).apply(null,s)})}a(Kvn,"bindApi");function ujo(){let t=Symbol("Singular"),e={registry:{}},r=JKe.bind(null,e,t);return Kvn(r,e,t),r}a(ujo,"Singular");function djo(){let t={registry:{}},e=JKe.bind(null,t);return Kvn(e,t),e}a(djo,"Collection");var Jvn={Singular:ujo,Collection:djo};p();p();var fjo="0.0.0-development",pjo=`octokit-endpoint.js/${fjo} ${Sq()}`,hjo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":pjo},mediaType:{format:""}};function mjo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(mjo,"lowercaseKeys");function gjo(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(gjo,"isPlainObject");function eCn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{gjo(e[n])?n in t?r[n]=eCn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(eCn,"mergeDeep");function Zvn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(Zvn,"removeUndefinedProperties");function dqt(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=mjo(r.headers),Zvn(r),Zvn(r.headers);let n=eCn(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(dqt,"merge");function Ajo(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(Ajo,"addQueryParameters");var yjo=/\{[^{}}]+\}/g;function Ejo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(_jo,"extractUrlVariableNames");function Xvn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(Xvn,"omit");function tCn(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(tCn,"encodeReserved");function gue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(gue,"encodeUnreserved");function Fxe(t,e,r){return e=t==="+"||t==="#"?tCn(e):gue(e),r?gue(r)+"="+e:e}a(Fxe,"encodeValue");function mue(t){return t!=null}a(mue,"isDefined");function uqt(t){return t===";"||t==="&"||t==="?"}a(uqt,"isKeyOperator");function vjo(t,e,r,n){var o=t[r],s=[];if(mue(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(Fxe(e,o,uqt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(mue).forEach(function(c){s.push(Fxe(e,c,uqt(e)?r:""))}):Object.keys(o).forEach(function(c){mue(o[c])&&s.push(Fxe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(mue).forEach(function(l){c.push(Fxe(e,l))}):Object.keys(o).forEach(function(l){mue(o[l])&&(c.push(gue(l)),c.push(Fxe(e,o[l].toString())))}),uqt(e)?s.push(gue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?mue(o)&&s.push(gue(r)):o===""&&(e==="&"||e==="?")?s.push(gue(r)+"="):o===""&&s.push("");return s}a(vjo,"getValues");function Cjo(t){return{expand:bjo.bind(null,t)}}a(Cjo,"parseUrl");function bjo(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(vjo(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 tCn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(bjo,"expand");function rCn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=Xvn(t,["method","baseUrl","url","headers","request","mediaType"]),c=_jo(r);r=Cjo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=Xvn(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=Ajo(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(rCn,"parse");function Sjo(t,e,r){return rCn(dqt(t,e,r))}a(Sjo,"endpointWithDefaults");function nCn(t,e){let r=dqt(t,e),n=Sjo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:nCn.bind(null,r),merge:dqt.bind(null,r),parse:rCn})}a(nCn,"withDefaults");var iCn=nCn(null,hjo);var ACn=de(cCn(),1);p();var Tjo=/^-?\d+$/,dCn=/^-?\d+n+$/,fqt=JSON.stringify,lCn=JSON.parse,Ijo=/^-?\d+n$/,xjo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,wjo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,fCn=a((t,e,r)=>"rawJSON"in JSON?fqt(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?fqt(t,(c,l)=>typeof l=="string"&&dCn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(xjo,"$1$2$3").replace(wjo,"$1$2$3"):fqt(t,e,r),"JSONStringify"),tJe=new Map,Rjo=a(()=>{let t=JSON.parse.toString();if(tJe.has(t))return tJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return tJe.set(t,e),e}catch{return tJe.set(t,!1),!1}},"isContextSourceSupported"),kjo=a((t,e,r,n)=>typeof e=="string"&&Ijo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&dCn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),Pjo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return lCn(t,e);if(Rjo())return Pjo(t,e);let r=t.replace(Djo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&Njo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthkjo(n,o,s,e))},"JSONParse");p();var $K=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 gCn(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=Ljo(t.body)||Array.isArray(t.body)?fCn(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 $K(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 $K(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await pqt(c),new $K("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await pqt(c),new $K(Fjo(f.data),l,{response:f,request:t});return f.data=n?await pqt(c):c.body,f}a(gCn,"fetchWrapper");async function pqt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(mCn);let r=(0,ACn.safeParse)(e);if(Bjo(r)){let n="";try{return n=await t.text(),hCn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(mCn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(pqt,"getResponseData");function Bjo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(Bjo,"isJSONResponse");function Fjo(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(Fjo,"toErrorMessage");function hqt(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 gCn(r.parse(c));let l=a((u,d)=>gCn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:hqt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:hqt.bind(null,r)})}a(hqt,"withDefaults");var Qxe=hqt(iCn,Ojo);p();var Ujo="0.0.0-development";function Qjo(t){return`Request failed due to following response errors: +`)}`}a(Kvn,"formatContextFiles");p();p();var rJe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},dE=class extends rJe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Qd=class extends rJe{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 pqt=(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))(pqt||{});p();p();p();function xq(){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(xq,"getUserAgent");p();p();function nJe(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)=>nJe.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(nJe,"register");p();function Jvn(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(Jvn,"addHook");p();function Zvn(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(Zvn,"removeHook");var Xvn=Function.bind,eCn=Xvn.bind(Xvn);function tCn(t,e,r){let n=eCn(Zvn,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]=eCn(Jvn,null).apply(null,s)})}a(tCn,"bindApi");function Sjo(){let t=Symbol("Singular"),e={registry:{}},r=nJe.bind(null,e,t);return tCn(r,e,t),r}a(Sjo,"Singular");function Tjo(){let t={registry:{}},e=nJe.bind(null,t);return tCn(e,t),e}a(Tjo,"Collection");var rCn={Singular:Sjo,Collection:Tjo};p();p();var Ijo="0.0.0-development",xjo=`octokit-endpoint.js/${Ijo} ${xq()}`,wjo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":xjo},mediaType:{format:""}};function Rjo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(Rjo,"lowercaseKeys");function kjo(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(kjo,"isPlainObject");function oCn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{kjo(e[n])?n in t?r[n]=oCn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(oCn,"mergeDeep");function nCn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(nCn,"removeUndefinedProperties");function mqt(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=Rjo(r.headers),nCn(r),nCn(r.headers);let n=oCn(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(mqt,"merge");function Pjo(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(Pjo,"addQueryParameters");var Djo=/\{[^{}}]+\}/g;function Njo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(Mjo,"extractUrlVariableNames");function iCn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(iCn,"omit");function sCn(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(sCn,"encodeReserved");function Aue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(Aue,"encodeUnreserved");function qxe(t,e,r){return e=t==="+"||t==="#"?sCn(e):Aue(e),r?Aue(r)+"="+e:e}a(qxe,"encodeValue");function gue(t){return t!=null}a(gue,"isDefined");function hqt(t){return t===";"||t==="&"||t==="?"}a(hqt,"isKeyOperator");function Ojo(t,e,r,n){var o=t[r],s=[];if(gue(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(qxe(e,o,hqt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(gue).forEach(function(c){s.push(qxe(e,c,hqt(e)?r:""))}):Object.keys(o).forEach(function(c){gue(o[c])&&s.push(qxe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(gue).forEach(function(l){c.push(qxe(e,l))}):Object.keys(o).forEach(function(l){gue(o[l])&&(c.push(Aue(l)),c.push(qxe(e,o[l].toString())))}),hqt(e)?s.push(Aue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?gue(o)&&s.push(Aue(r)):o===""&&(e==="&"||e==="?")?s.push(Aue(r)+"="):o===""&&s.push("");return s}a(Ojo,"getValues");function Ljo(t){return{expand:Bjo.bind(null,t)}}a(Ljo,"parseUrl");function Bjo(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(Ojo(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 sCn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(Bjo,"expand");function aCn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=iCn(t,["method","baseUrl","url","headers","request","mediaType"]),c=Mjo(r);r=Ljo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=iCn(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=Pjo(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(aCn,"parse");function Fjo(t,e,r){return aCn(mqt(t,e,r))}a(Fjo,"endpointWithDefaults");function cCn(t,e){let r=mqt(t,e),n=Fjo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:cCn.bind(null,r),merge:mqt.bind(null,r),parse:aCn})}a(cCn,"withDefaults");var lCn=cCn(null,wjo);var CCn=de(pCn(),1);p();var Ujo=/^-?\d+$/,gCn=/^-?\d+n+$/,gqt=JSON.stringify,hCn=JSON.parse,Qjo=/^-?\d+n$/,qjo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,jjo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,ACn=a((t,e,r)=>"rawJSON"in JSON?gqt(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?gqt(t,(c,l)=>typeof l=="string"&&gCn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(qjo,"$1$2$3").replace(jjo,"$1$2$3"):gqt(t,e,r),"JSONStringify"),aJe=new Map,Hjo=a(()=>{let t=JSON.parse.toString();if(aJe.has(t))return aJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return aJe.set(t,e),e}catch{return aJe.set(t,!1),!1}},"isContextSourceSupported"),Gjo=a((t,e,r,n)=>typeof e=="string"&&Qjo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&gCn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),$jo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return hCn(t,e);if(Hjo())return $jo(t,e);let r=t.replace(Vjo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&Wjo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthGjo(n,o,s,e))},"JSONParse");p();var WK=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 vCn(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=Kjo(t.body)||Array.isArray(t.body)?ACn(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 WK(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 WK(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await Aqt(c),new WK("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await Aqt(c),new WK(Zjo(f.data),l,{response:f,request:t});return f.data=n?await Aqt(c):c.body,f}a(vCn,"fetchWrapper");async function Aqt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(_Cn);let r=(0,CCn.safeParse)(e);if(Jjo(r)){let n="";try{return n=await t.text(),ECn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(_Cn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(Aqt,"getResponseData");function Jjo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(Jjo,"isJSONResponse");function Zjo(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(Zjo,"toErrorMessage");function yqt(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 vCn(r.parse(c));let l=a((u,d)=>vCn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:yqt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:yqt.bind(null,r)})}a(yqt,"withDefaults");var Hxe=yqt(lCn,Yjo);p();var Xjo="0.0.0-development";function eHo(t){return`Request failed due to following response errors: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(Qjo,"_buildMessageForResponseErrors");var qjo=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(Qjo(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},jjo=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Hjo=["query","method","url"],yCn=/\/api\/v3\/?$/;function Gjo(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(Hjo.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)=>jjo.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 yCn.test(s)&&(o.url=s.replace(yCn,"/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 qjo(o,l,c.data)}return c.data.data})}a(Gjo,"graphql");function mqt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>Gjo(r,o,s),"newApi"),{defaults:mqt.bind(null,r),endpoint:r.endpoint})}a(mqt,"withDefaults");var ECn=mqt(Qxe,{headers:{"user-agent":`octokit-graphql.js/${Ujo} ${Sq()}`},method:"POST",url:"/graphql"});function _Cn(t){return mqt(t,{method:"POST",url:"/graphql"})}a(_Cn,"withCustomRequest");p();var gqt="(?:[a-zA-Z0-9_-]+)",vCn="\\.",CCn=new RegExp(`^${gqt}${vCn}${gqt}${vCn}${gqt}$`),$jo=CCn.test.bind(CCn);async function Vjo(t){let e=$jo(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(Vjo,"auth");function Wjo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(Wjo,"withAuthorizationPrefix");async function zjo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=Wjo(t),e(o)}a(zjo,"hook");var bCn=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(Vjo.bind(null,e),{hook:zjo.bind(null,e)})},"createTokenAuth2");p();var Aqt="7.0.6";var SCn=a(()=>{},"noop"),Yjo=console.warn.bind(console),Kjo=console.error.bind(console);function Jjo(t={}){return typeof t.debug!="function"&&(t.debug=SCn),typeof t.info!="function"&&(t.info=SCn),typeof t.warn!="function"&&(t.warn=Yjo),typeof t.error!="function"&&(t.error=Kjo),t}a(Jjo,"createLogger");var TCn=`octokit-core.js/${Aqt} ${Sq()}`,rJe=class{static{a(this,"Octokit")}static VERSION=Aqt;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 Jvn.Collection,n={baseUrl:Qxe.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} ${TCn}`:TCn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=Qxe.defaults(n),this.graphql=_Cn(this.request).defaults(n),this.log=Jjo(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=bCn(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(yqt,"requestLog");yqt.VERSION=ICn;p();var Zjo="0.0.0-development";function Xjo(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(Xjo,"normalizePaginatedListResponse");function Eqt(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=Xjo(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:wCn(t,e,r,n)})}a(wCn,"gather");var aad=Object.assign(xCn,{iterator:Eqt});function _qt(t){return{paginate:Object.assign(xCn.bind(null,t),{iterator:Eqt.bind(null,t)})}}a(_qt,"paginateRest");_qt.VERSION=Zjo;p();p();var vqt="17.0.0";p();p();var eHo={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"]}},RCn=eHo;var VK=new Map;for(let[t,e]of Object.entries(RCn))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);VK.has(t)||VK.set(t,new Map),VK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var tHo={has({scope:t},e){return VK.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[...VK.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=VK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=rHo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function Cqt(t){let e={};for(let r of VK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},tHo);return e}a(Cqt,"endpointsToMethods");function rHo(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(rHo,"decorate");function nHo(t){return{rest:Cqt(t)}}a(nHo,"restEndpointMethods");nHo.VERSION=vqt;function bqt(t){let e=Cqt(t);return{...e,rest:e}}a(bqt,"legacyRestEndpointMethods");bqt.VERSION=vqt;p();var kCn="22.0.1";var PCn=rJe.plugin(yqt,bqt,_qt).defaults({userAgent:`octokit-rest.js/${kCn}`});var oHo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),Ac=new fe("GitHubClient"),Zh=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(tr);return this.octokit=new PCn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!oHo.has(o))return Ac.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(Ac.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 Fd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){Ac.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 Ac.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return Ac.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){Ac.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}),Ac.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(Ac.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 Fd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(Ac.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 Fd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Fd(l.status,l.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(Ac.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var rl=new fe("CodingAgentClient"),HC=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){rl.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/${cqt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:Hvn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...i0(this.ctx)};if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new H_;let g=await this.ctx.get(tr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new H_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new H_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new H_;let E=y.pull_request?.number;if(typeof E!="number")throw new l0("No valid pull request number returned from job");let v=await new Zh(this.ctx).getPullRequest(n,o,E);return rl.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 rl.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new sp("Title is required and cannot be empty");if(!r?.trim())throw rl.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new sp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw rl.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new sp("Owner is required and cannot be empty");if(!o?.trim())throw rl.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new sp("Repository name is required and cannot be empty");rl.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw rl.debug(this.ctx,"Failed to get access token"),new tw("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(tr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){rl.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 rl.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new H_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new H_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw rl.error(this.ctx,f),new l0(f)}let u=await l.json();return rl.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 cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(c)}}async getSessionLogs(e,r){if(rl.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new sp("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new H_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new H_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw rl.error(this.ctx,d),new l0(d)}return await l.text()}catch(s){if(s instanceof $P)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(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 rl.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new l0("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 l0(`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 rl.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new l0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw rl.error(this.ctx,"API response missing job_id or session_id",r),new l0("Invalid response from cloud agent");return r}};p();p();var wO=class{static{a(this,"LSPRequestSender")}};var DCn=de(ri());var nJe=class{constructor(){this.codingAgentMessageRequestType=new DCn.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(wO).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 GC=de(Io());function Sqt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(Sqt,"adaptCancellationToken");function NCn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(NCn,"adaptProgressCallback");function MCn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(MCn,"createEndpointInfo");function OCn(t){let e={role:sHo(t.role),content:aHo(t.content)};if(t.role===GC.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===GC.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===GC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=zYe(n);o&&(e.thinking=o);let s=WYe(n);s&&(e.phase=s)}n.type===GC.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(OCn,"convertToCopilotChatMessage");function sHo(t){switch(t){case GC.Raw.ChatRole.System:return"system";case GC.Raw.ChatRole.User:return"user";case GC.Raw.ChatRole.Assistant:return"assistant";case GC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(sHo,"convertRole");function aHo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text||r.type===GC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===GC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===GC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(aHo,"convertContent");p();var G3=de(Io());var iJe=class extends G3.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===G3.Raw.ChatRole.System&&o?.role===G3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===G3.Raw.ChatCompletionContentPartKind.Text&&l.type===G3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` -`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:G3.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===G3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function LCn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(fHo(e)){case"image/png":return cHo(e);case"image/gif":return lHo(e);case"image/jpeg":case"image/jpg":return uHo(e);case"image/webp":return dHo(e);default:throw new Error("Unsupported image format")}}a(LCn,"getImageDimensions");function cHo(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(cHo,"getPngDimensions");function lHo(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(lHo,"getGifDimensions");function uHo(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(uHo,"getJpegDimensions");function dHo(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 oJe(t){let e=ws(t.tokenizer);return new Tqt(e,t)}a(oJe,"createPromptTsxTokenizer");function mHo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(mHo,"estimateDocumentTokenCost");var ap=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=MCn(n),c=oJe(n);this._internalRenderer=new iJe(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?NCn(e):void 0,s=r?Sqt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?t_n(c.messages):r_n(c.messages),{messages:c.messages.map(OCn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?Sqt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function Iqt(t,e,r,n,o,s){return await ap.create(t,e,r,s).renderPrompt(n,o,s)}a(Iqt,"renderTsxPrompt");p();p();p();var BCn=new fe("toolCallRoundsBuilder");function RO(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(RO,"buildAssistantRounds");p();var W_=de(Io());var qxe=new fe("toolCalling"),rw=class extends lr{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,W_.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 qxe.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(oue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(VYe,{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(W_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(W_.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"}`;qxe.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(W_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(W_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(W_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,W_.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(W_.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"}`;qxe.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(W_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(W_.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.lengthrHo.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 bCn.test(s)&&(o.url=s.replace(bCn,"/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 tHo(o,l,c.data)}return c.data.data})}a(iHo,"graphql");function Eqt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>iHo(r,o,s),"newApi"),{defaults:Eqt.bind(null,r),endpoint:r.endpoint})}a(Eqt,"withDefaults");var SCn=Eqt(Hxe,{headers:{"user-agent":`octokit-graphql.js/${Xjo} ${xq()}`},method:"POST",url:"/graphql"});function TCn(t){return Eqt(t,{method:"POST",url:"/graphql"})}a(TCn,"withCustomRequest");p();var _qt="(?:[a-zA-Z0-9_-]+)",ICn="\\.",xCn=new RegExp(`^${_qt}${ICn}${_qt}${ICn}${_qt}$`),oHo=xCn.test.bind(xCn);async function sHo(t){let e=oHo(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(sHo,"auth");function aHo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(aHo,"withAuthorizationPrefix");async function cHo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=aHo(t),e(o)}a(cHo,"hook");var wCn=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(sHo.bind(null,e),{hook:cHo.bind(null,e)})},"createTokenAuth2");p();var vqt="7.0.6";var RCn=a(()=>{},"noop"),lHo=console.warn.bind(console),uHo=console.error.bind(console);function dHo(t={}){return typeof t.debug!="function"&&(t.debug=RCn),typeof t.info!="function"&&(t.info=RCn),typeof t.warn!="function"&&(t.warn=lHo),typeof t.error!="function"&&(t.error=uHo),t}a(dHo,"createLogger");var kCn=`octokit-core.js/${vqt} ${xq()}`,cJe=class{static{a(this,"Octokit")}static VERSION=vqt;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 rCn.Collection,n={baseUrl:Hxe.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} ${kCn}`:kCn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=Hxe.defaults(n),this.graphql=TCn(this.request).defaults(n),this.log=dHo(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=wCn(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(Cqt,"requestLog");Cqt.VERSION=PCn;p();var fHo="0.0.0-development";function pHo(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(pHo,"normalizePaginatedListResponse");function bqt(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=pHo(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:NCn(t,e,r,n)})}a(NCn,"gather");var Iad=Object.assign(DCn,{iterator:bqt});function Sqt(t){return{paginate:Object.assign(DCn.bind(null,t),{iterator:bqt.bind(null,t)})}}a(Sqt,"paginateRest");Sqt.VERSION=fHo;p();p();var Tqt="17.0.0";p();p();var hHo={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"]}},MCn=hHo;var zK=new Map;for(let[t,e]of Object.entries(MCn))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);zK.has(t)||zK.set(t,new Map),zK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var mHo={has({scope:t},e){return zK.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[...zK.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=zK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=gHo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function Iqt(t){let e={};for(let r of zK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},mHo);return e}a(Iqt,"endpointsToMethods");function gHo(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(gHo,"decorate");function AHo(t){return{rest:Iqt(t)}}a(AHo,"restEndpointMethods");AHo.VERSION=Tqt;function xqt(t){let e=Iqt(t);return{...e,rest:e}}a(xqt,"legacyRestEndpointMethods");xqt.VERSION=Tqt;p();var OCn="22.0.1";var LCn=cJe.plugin(Cqt,xqt,Sqt).defaults({userAgent:`octokit-rest.js/${OCn}`});var EHo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),Ac=new fe("GitHubClient"),em=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(nr);return this.octokit=new LCn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!EHo.has(o))return Ac.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(Ac.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 Qd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){Ac.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 Ac.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return Ac.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){Ac.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}),Ac.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(Ac.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 Qd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(Ac.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 Qd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Qd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Qd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){Ac.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 Ac.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 Ac.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Qd(l.status,l.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){Ac.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;){Ac.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 Ac.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(Ac.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Qd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Lr).resolveSession();if(!e)throw new dE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var rl=new fe("CodingAgentClient"),HC=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){rl.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/${fqt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:zvn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...s0(this.ctx)};if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new $_;let g=await this.ctx.get(nr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new $_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new $_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new $_;let E=y.pull_request?.number;if(typeof E!="number")throw new d0("No valid pull request number returned from job");let v=await new em(this.ctx).getPullRequest(n,o,E);return rl.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 rl.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new cp("Title is required and cannot be empty");if(!r?.trim())throw rl.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new cp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw rl.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new cp("Owner is required and cannot be empty");if(!o?.trim())throw rl.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new cp("Repository name is required and cannot be empty");rl.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Lr).resolveSession();if(!r?.accessToken)throw rl.debug(this.ctx,"Failed to get access token"),new nw("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(nr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){rl.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 rl.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new $_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...s0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new $_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw rl.error(this.ctx,f),new d0(f)}let u=await l.json();return rl.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof WP)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Qxe(c)}}async getSessionLogs(e,r){if(rl.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new cp("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new $_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...s0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new $_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw rl.error(this.ctx,d),new d0(d)}return await l.text()}catch(s){if(s instanceof WP)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Qxe(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 rl.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new d0("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 d0(`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 rl.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new d0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw rl.error(this.ctx,"API response missing job_id or session_id",r),new d0("Invalid response from cloud agent");return r}};p();p();var kO=class{static{a(this,"LSPRequestSender")}};var BCn=de(ei());var lJe=class{constructor(){this.codingAgentMessageRequestType=new BCn.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(kO).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 GC=de(xo());function wqt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(wqt,"adaptCancellationToken");function FCn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(FCn,"adaptProgressCallback");function UCn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(UCn,"createEndpointInfo");function QCn(t){let e={role:_Ho(t.role),content:vHo(t.content)};if(t.role===GC.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===GC.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===GC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=eKe(n);o&&(e.thinking=o);let s=XYe(n);s&&(e.phase=s)}n.type===GC.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(QCn,"convertToCopilotChatMessage");function _Ho(t){switch(t){case GC.Raw.ChatRole.System:return"system";case GC.Raw.ChatRole.User:return"user";case GC.Raw.ChatRole.Assistant:return"assistant";case GC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(_Ho,"convertRole");function vHo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text||r.type===GC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===GC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===GC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(vHo,"convertContent");p();var V3=de(xo());var uJe=class extends V3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c;this._promptTsxRemovedNodeCount=0}static{a(this,"InternalPromptRenderer")}get promptTsxRemovedNodeCount(){return this._promptTsxRemovedNodeCount}async renderWithOptions(r,n,o){this._promptTsxRemovedNodeCount=0,this.tracer={didMaterializeTree:a(l=>{this._promptTsxRemovedNodeCount=l.renderedTree.removed},"didMaterializeTree")};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===V3.Raw.ChatRole.System&&o?.role===V3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===V3.Raw.ChatCompletionContentPartKind.Text&&l.type===V3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` +`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:V3.Raw.ChatCompletionContentPartKind.Text,text:` +`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===V3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function qCn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(IHo(e)){case"image/png":return CHo(e);case"image/gif":return bHo(e);case"image/jpeg":case"image/jpg":return SHo(e);case"image/webp":return THo(e);default:throw new Error("Unsupported image format")}}a(qCn,"getImageDimensions");function CHo(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(CHo,"getPngDimensions");function bHo(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(bHo,"getGifDimensions");function SHo(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(SHo,"getJpegDimensions");function THo(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 dJe(t){let e=ws(t.tokenizer);return new Rqt(e,t)}a(dJe,"createPromptTsxTokenizer");function RHo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(RHo,"estimateDocumentTokenCost");var lp=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=UCn(n),c=dJe(n);this._internalRenderer=new uJe(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?FCn(e):void 0,s=r?wqt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?s_n(c.messages):a_n(c.messages),{messages:c.messages.map(QCn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles,promptTsxRemovedNodeCount:this._internalRenderer.promptTsxRemovedNodeCount}}async countTokens(e){let r=e?wqt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function kqt(t,e,r,n,o,s){return await lp.create(t,e,r,s).renderPrompt(n,o,s)}a(kqt,"renderTsxPrompt");p();p();p();var jCn=new fe("toolCallRoundsBuilder");function PO(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(PO,"buildAssistantRounds");p();var Y_=de(xo());var Gxe=new fe("toolCalling"),iw=class extends lr{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,Y_.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 Gxe.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(sue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(ZYe,{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(Y_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(Y_.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"}`;Gxe.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(Y_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(Y_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(Y_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(Y_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,Y_.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(Y_.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"}`;Gxe.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(Y_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(Y_.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(gHo,"separateTextAndImages");function AHo(t){return t.map(e=>vscpp(Xh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(AHo,"createImageElements");function sJe(t){let{imageUrls:e,textContent:r}=gHo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Xh.TextChunk,null,vscpp(vscppf,null,r)),...AHo(e)]}a(sJe,"renderMixedContent");function xqt(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(xqt,"convertToPromptTsxToolCall");function aJe(t){switch(t.role){case"assistant":return yHo(t);case"tool":return EHo(t);case"user":return _Ho(t);case"system":return vHo(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(aJe,"convertChatMessageToPromptTsx");function yHo(t){let e=t.thinking?vscpp(oue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,sJe(t.content)),e):vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(yHo,"renderAssistantMessage");function EHo(t){return typeof t.content=="string"?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},sJe(t.content)):vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(EHo,"renderToolMessage");function _Ho(t){return typeof t.content=="string"?vscpp(Xh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.UserMessage,null,sJe(t.content)):vscpp(Xh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(_Ho,"renderUserMessage");function vHo(t){return typeof t.content=="string"?vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.SystemMessage,null,sJe(t.content)):vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(vHo,"renderSystemMessage");var CHo=new fe("conversationHistoryPrompt"),Aue=class extends lr{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):CHo.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=RO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(rw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var lJe=de(Io());var cJe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(lJe.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(Aue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(lJe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function FCn(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(FCn,"parseStructuredSummary");var uJe=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 hO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await xo.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),iq(c));xo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await ap.create(cJe,{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 jxe=new fe("repository"),$3=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)}},nw=class{static{a(this,"GitBranchLoader")}},kO=class extends nw{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 UCn=require("child_process");var PO=class extends nw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,UCn.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){jxe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){jxe.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?$3.branch(c):$3.detachedHead()}}extraArgs(){return[]}};p();var DO=class extends nw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Qo),o=wa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;jxe.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 $3.branch(r)}else return this.isCommitSha(e)?$3.detachedHead():$3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var Tq=new fe("codingAgentTurnProcessor"),dJe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new bq(e.ctx,this.chatFetcher),this.codingAgentClient=new HC(e.ctx),this.gitHubClient=new Zh(e.ctx),this.codingAgentMessageHandler=new nJe,this.conversationSummarizer=new uJe(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 tl(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),qa(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:ZQ.Unknown,responseIsIncomplete:!0}})}finally{tYe(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()=>{Tq.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 sp("No workspace folder available for git repository detection");let f=await new _f(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new sp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new sp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new kO([new PO,new DO]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,Tq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),Tq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Fd&&N.status===404){let L=`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:`${L} +`,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 tm=de(xo());function kHo(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(kHo,"separateTextAndImages");function PHo(t){return t.map(e=>vscpp(tm.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(PHo,"createImageElements");function fJe(t){let{imageUrls:e,textContent:r}=kHo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(tm.TextChunk,null,vscpp(vscppf,null,r)),...PHo(e)]}a(fJe,"renderMixedContent");function Pqt(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(Pqt,"convertToPromptTsxToolCall");function pJe(t){switch(t.role){case"assistant":return DHo(t);case"tool":return NHo(t);case"user":return MHo(t);case"system":return OHo(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(pJe,"convertChatMessageToPromptTsx");function DHo(t){let e=t.thinking?vscpp(sue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(tm.AssistantMessage,{toolCalls:Pqt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(tm.AssistantMessage,{toolCalls:Pqt(t.tool_calls)},vscpp(vscppf,null,fJe(t.content)),e):vscpp(tm.AssistantMessage,{toolCalls:Pqt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(DHo,"renderAssistantMessage");function NHo(t){return typeof t.content=="string"?vscpp(tm.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(tm.ToolMessage,{toolCallId:t.tool_call_id||""},fJe(t.content)):vscpp(tm.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(NHo,"renderToolMessage");function MHo(t){return typeof t.content=="string"?vscpp(tm.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(tm.UserMessage,null,fJe(t.content)):vscpp(tm.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(MHo,"renderUserMessage");function OHo(t){return typeof t.content=="string"?vscpp(tm.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(tm.SystemMessage,null,fJe(t.content)):vscpp(tm.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(OHo,"renderSystemMessage");var LHo=new fe("conversationHistoryPrompt"),yue=class extends lr{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):LHo.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=PO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(iw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var mJe=de(xo());var hJe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(mJe.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(yue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(mJe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function HCn(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(HCn,"parseStructuredSummary");var gJe=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 gO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await wo.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),aq(c));wo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await lp.create(hJe,{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 $xe=new fe("repository"),W3=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)}},ow=class{static{a(this,"GitBranchLoader")}},DO=class extends ow{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 GCn=require("child_process");var NO=class extends ow{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,GCn.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){$xe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await dO()).path}catch(c){$xe.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?W3.branch(c):W3.detachedHead()}}extraArgs(){return[]}};p();var MO=class extends ow{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(qo),o=Ra(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;$xe.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 W3.branch(r)}else return this.isCommitSha(e)?W3.detachedHead():W3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var wq=new fe("codingAgentTurnProcessor"),AJe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new sc(e.ctx),this.turnSuggestions=new Iq(e.ctx,this.chatFetcher),this.codingAgentClient=new HC(e.ctx),this.gitHubClient=new em(e.ctx),this.codingAgentMessageHandler=new lJe,this.conversationSummarizer=new gJe(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 tl(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),ua(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:eq.Unknown,responseIsIncomplete:!0}})}finally{sYe(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()=>{wq.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 cp("No workspace folder available for git repository detection");let f=await new Cf(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new cp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new cp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new DO([new NO,new MO]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,wq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),wq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Qd&&N.status===404){let L=`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:`${L} -`}),Tq.error(this.turnContext.ctx,L),new sp(L)}throw N}}else throw new sp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Pn(this.turn.request.message),E=Gvn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=$vn(E);Tq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=hue(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),wq.error(this.turnContext.ctx,L),new cp(L)}throw N}}else throw new cp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Pn(this.turn.request.message),E=Yvn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=Kvn(E);wq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=mue(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... `});let{structuredSummary:N,rawSummary:L}=await this.summarizeConversation(r,o,l);if(r.isCancellationRequested)return;N&&N.title&&(b=N.title),v=L||""}let T=_;v&&(T=_+(_?` -`:"")+v);let{problemStatement:w}=jvn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... +`:"")+v);let{problemStatement:w}=Wvn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... -`});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){Tq.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"});Et(this.turnContext.ctx,"codingAgent",D),ZI(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(n7e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Oc)Tq.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof $P)qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:ZQ.Default,responseIsIncomplete:!0}});else throw Tq.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=FCn(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=oq(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 QCn="```",Hxe=String.raw``,bHo=String.raw`${QCn}[\w]*?\n(?[\s\S]*?)\n${QCn}`,SHo=new RegExp(Hxe+` -`+bHo,"gs"),wqt=["replace","delete"];function Rqt(t,e){let r=t.matchAll(SHo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!wqt.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){wq.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"});At(this.turnContext.ctx,"codingAgent",D),tx(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(c7e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Oc)wq.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),ua(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof WP)ua(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:eq.Default,responseIsIncomplete:!0}});else throw wq.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=HCn(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=cq(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 $Cn="```",Vxe=String.raw``,BHo=String.raw`${$Cn}[\w]*?\n(?[\s\S]*?)\n${$Cn}`,FHo=new RegExp(Vxe+` +`+BHo,"gs"),Dqt=["replace","delete"];function Nqt(t,e){let r=t.matchAll(FHo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!Dqt.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=kqt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(Rqt,"extractEditsFromTaggedCodeblocks");function kqt(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=Mqt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(Nqt,"extractEditsFromTaggedCodeblocks");function Mqt(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(kqt,"applyEditsToDocument");var yue=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 xo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(kA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},fJe=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 yq(e.ctx),u=await e.ctx.get(el).getBestChatModelConfig(xS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(kA).toPrompt(e,d)}async processResponse(e){let r=[],n=Pn(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(lE);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ii).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=Rqt(e,r).filter(c=>wqt.includes(c.mode)),s=kqt(o,r);if(s)return await this.ctx.get(zh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return Rqt(e,r)}};var pJe=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 yue(e.ctx);return new dJe(e,r)}};p();p();p();p();function qCn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(qCn,"filterUnsupportedReferences");function jCn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(jCn,"convertToCopilotReferences");var HCn=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 Iq=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,qCn(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 NO=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(nx).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(tr).fetch(l,{method:"GET",headers:c})}};p();p();var GCn=S.Object({name:S.String(),url:S.String()}),$Cn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(GCn)})),remotes:S.Optional(S.Array(GCn))}),Pqt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(MO,"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)}},MO="git-metadata",hJe=class extends gg{static{a(this,"GitMetadataSkill")}constructor(e){super(MO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new Pqt(r))}};async function VCn(t){let e=await t.skillResolver.resolve(lE);if(e){let c=e.uri,l=gQ(t.ctx,c);if(Sdn(l))return{repoInfo:l,skillUsed:lE}}let r=await t.skillResolver.resolve(MO);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=A8t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:MO}}a(VCn,"extractRepoInfo");async function WCn(t){let e=[];return await THo(t,e),await IHo(t,e),await xHo(t,e),e}a(WCn,"skillsToReference");async function THo(t,e){let r=await wHo(t);r&&e.push(r)}a(THo,"addRepositoryReference");async function IHo(t,e){let r=await RHo(t);r&&e.push(r)}a(IHo,"addSelectionReference");async function xHo(t,e){let r=[],n=await PHo(t);n&&r.push(n),r.push(...await DHo(t)),r.length>0&&e.push(...r)}a(xHo,"addFileReferences");async function wHo(t){let e=await VCn(t);if(e){let r=t.ctx.get(NO),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(wHo,"gitMetadataToReference");async function RHo(t){let e=await t.skillResolver.resolve(lE);if(e&&e.selection){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return kHo(e,n.document)}}a(RHo,"currentEditorToSelectionReference");function kHo(t,e){if(t.selection&&!uue(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(kHo,"extractSelection");async function PHo(t){let e=await t.skillResolver.resolve(lE);if(e){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(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(PHo,"currentEditorToFileReference");async function DHo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ii);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=td(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(DHo,"fileReferenceToPlatformFileReference");p();Mo();var NHo=new fe("ChatFetchResultPostProcessor"),Eue=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(Cyn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(zh).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:Pn(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"},NHo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:$_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===V_,copilotPlan:rx(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}=xo.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},byn(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:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new bq(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:Mt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return xyn(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",Syn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var mJe=S.Union([S.String(),S.Number()]),WK=S.Union([S.String(),S.Number()]),MHo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),gJe=S.Object({uri:S.String(),position:S.Optional(c0)}),OHo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(c0),visibleRange:S.Optional(Sf),selection:S.Optional(Sf),status:S.Optional(MHo),range:S.Optional(Sf)}),LHo=S.Object({type:S.Literal("directory"),uri:S.String()}),BHo=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([OHo,LHo,HCn,BHo]),LO=S.Union([S.Literal("panel"),S.Literal("inline")]),FHo=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")]))})})]),Dqt=S.Union([S.String(),S.Array(FHo)]),zCn=S.Object({request:Dqt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(WK),model:S.Optional(S.String())});function AJe(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(AJe,"convertToMessageContent");function yJe(t,e){if(t=GS(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(yJe,"appendToMessage");var EJe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),UHo=S.Object({type:S.String(),description:S.String()}),YCn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),UHo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Bc=S.Object({uri:S.String(),name:S.String()}),QHo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),_Je=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:QHo});Mo();var Nqt="generate-response",vJe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},Gxe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(r.ctx),this.postProcessor=new Eue(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 vJe?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 tl(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(zh).inspectPrompt(l),await n.steps.start(Nqt,"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:GS(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 Mt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return QQt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:GS(r.request.message)}),r.response&&r.response.type==="model"){let o=jCn(r.response.references);n.push({role:"assistant",content:GS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await WCn(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 Iq((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=yJe(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:Pn(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()),Pn(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 vJe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return cxe(this.conversation,"conversationPanel",Pn(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(Nqt,e.error.message):await r.steps.finish(Nqt)}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 $xe=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 Gxe(this,e)}},CJe=class extends $xe{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 Gxe(this,e)}};p();var qHo="github",WP=class{static{a(this,"RemoteAgentRegistry")}},bJe=class extends WP{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 PY(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Nr.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)||Nr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Nr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==qHo).map(o=>new $xe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var KCn=de(require("fs")),z_=de(require("path"));var Mqt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],Oqt="test_",Vxe={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"}},Wxe=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=z_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Oqt,suffix:Mqt},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=rs(uf(e)),l===void 0)return}else{let d=rs(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=z_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ks(l);if(await this.fileExists(u))return wa(u,s[0])}parseTestFilePath(e){try{return Ks(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ji(e),n=z_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Oqt,suffix:Mqt},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=uf(e):l=this.determineImplFolder(e);for(let u of s){let d=wa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=rs(e);if(r===void 0)return;let n=z_.extname(Ji(e)).replace(".",""),o,s=Vxe[n]?.location??"sameFolder";s==="sameFolder"?o=z_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,Vxe[n]);if(c.length>0)return Ks(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${z_.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 KCn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&rs(this.baseUri))??"",o=z_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(z_.sep)}getRelativeTestFolder(e,r,n,o){let s=z_.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=z_.extname(Ji(e)).replace(".",""),n=uf(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 zxe(t){let e=Ji(t),r=z_.extname(e),n=Vxe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(Mqt.some(s=>e.endsWith(s+r))||e.startsWith(Oqt))}a(zxe,"isTestFile");p();var Lqt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function JCn(t,e){let r=t.ctx,n=await xo.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(kA).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 oc(r),u=await tl(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:"";qa(r,new Lqt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(JCn,"parseUserQuery");p();p();p();p();var Yo=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 Yo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Yo(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 ZCn=250;function PA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/ZCn)),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(PA,"getMaxChunks");var XCn=32e3,ebn=2e4,Yxe=.75;p();p();function DA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(DA,"getFenceForCodeBlock");p();var B1n=de(Sl()),F1n=de(eh());p();var $C=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 JGo=Object.freeze({[$C.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[$C.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function Jqt(t){return JGo[t.id]}a(Jqt,"getWellKnownEmbeddingTypeInfo");function ZGo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:Kxe(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(fbn,"rankEmbeddings");p();p();var nF=de(nl()),L1n=de(eh());var qO=new fe("GitHubCodeSearch"),Hzo=300*1e3,pZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new nF.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()},Hzo)}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),qO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){qO.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(qO.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),qO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){qO.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,nF.raceTimeout)((async()=>{if(!await(0,nF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,nF.raceCancellationError)((0,nF.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 qO.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 Gf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return qO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return qO.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=Pue(this._ctx),c=n.owner+"/"+n.name,l=await Gf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(qO.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=Pue(this._ctx),u=await Gf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:$zo(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 Gzo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Pue(t){let e=t.get(Ir);return{"X-Client-Application":`${M1(e.getEditorInfo())}`,"X-Client-Source":M1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Pue,"editorVersionHeaders");async function Gzo(t,e,r){let o=[],s=new $C(e.embedding_model),c=Fs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=wa(c,l.location.path)}catch(d){qO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:hZe(l.chunk.text),rawText:void 0,range:new L1n.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(Gzo,"parseGithubCodeSearchResponse");function $zo(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($zo,"truncateToMaxUtf8Length");function hZe(t){let e=Vzo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(hZe,"stripChunkTextMetadata");function Vzo(t){return t.split(/\r\n|\r|\n/)}a(Vzo,"splitLines");var XP=de(nl()),U1n=de(vue()),Q1n=de(em());var mwe=new fe("ChunkingEndpointClient"),wHt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new U1n.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 XP.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,XP.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,XP.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,XP.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){mwe.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{mwe.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{mwe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},mZe=class{constructor(e){this.ctx=e;this._requestLimiter=new wHt(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,XP.raceCancellationError)(n.getText(),l);if((0,Q1n.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Pue(this.ctx);return await Gf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:rs(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,XP.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,B1n.coalesce)(h.chunks.map(m=>{let g=new F1n.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:hZe(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 $C(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:hZe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var fE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},f0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Wt.createAndMarkAsIssued(s,o);Et(e,r,c),At(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};qa(e,n,r,o),Vn(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,fE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,fE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,fE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,fE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,fE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,fE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,fE.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=Wt.createAndMarkAsIssued(o,{});Et(e,r,s),At(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,fE.Aggregate,r)}};var q1n=de(Sl()),j1n=de(nl()),RHt=de(FO());var iF=new fe("Remote Search"),gZe=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(_f),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 RHt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(iF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:PA(r)}),s.length===0)throw iF.error(this.ctx,"No GitHub repositories found"),f0.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 iF.error(this.ctx,"No GitHub session found"),f0.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 iF.error(this.ctx,"Remote index not ready for any repositories"),f0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=PA(r),d=Promise.all(l.map(async P=>{Hh(n);let D=await e.resolveQuery(n),N=new RHt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return iF.info(this.ctx,`Search completed for ${P.owner}/${P.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);iF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,j1n.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{iF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{iF.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,q1n.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();iF.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 f0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var FIn=require("node:url"),UIn=require("path");p();var DZe=de(G1n(),1);p();var kHt=new WeakMap;function Nue(...t){let e=new String(t);return kHt.set(e,t),e}a(Nue,"c");function ow(t){return t instanceof String&&kHt.has(t)}a(ow,"r");function Mue(t){return kHt.get(t)??[]}a(Mue,"o");var kZe=de(J1n(),1),xTn=require("child_process");var dIn=de(MHt(),1),CIn=require("node:path");p();function*Z1n(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(Z1n,"U");var EYo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),_Yo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),vYo=new Set(["edit","remove-section","rename-section","set","unset"]),CYo=new Set(["get","get-color","get-colorbool","list"]);function bYo(t,e){for(let{name:n}of Z1n(t,"task")){if(EYo.has(n))return Fue(!0,e);if(_Yo.has(n))return Fue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:vYo.has(r)?Fue(!0,e.slice(1)):CYo.has(r)?Fue(!1,e.slice(1)):e.length===1?Fue(!1,e):Fue(!0,e)}a(bYo,"F");function Fue(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(Fue,"p");function SYo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(SYo,"A");function TYo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(TYo,"M");function IYo(t){for(let{name:e}of Z1n(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(IYo,"N");function xYo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(xYo,"G");function*wYo(t){for(let e of t){let r=xYo(e),n=r&&TYo(e.value);n&&(yield{...n,scope:r})}}a(wYo,"O");function RYo(t,e,r){let n={read:[],write:[...wYo(e)]};return t==="config"&&kYo(n,IYo(e),bYo(e,r)),n}a(RYo,"L");function kYo(t,e,r){if(r===null)return;let n=SYo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(kYo,"$");var X1n={short:new Map([["c",!0]])},PYo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...X1n.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},DYo={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"])}},NYo={short:new Map,long:new Set};function MYo(t){let e=DYo[t??""]??NYo;return{short:new Map([...X1n.short.entries(),...e.short.entries()]),long:e.long}}a(MYo,"I");function eSn(t,e=PYo){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 OYo(t,e.short)}a(eSn,"b");function OYo(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(OYo,"W");function LYo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[nGt(t)[0]])(t=0)),e},"__init"),"__esm"),JYo=a((t,e)=>a(function(){return e||(0,t[nGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),tm=a((t,e)=>{for(var r in e)rGt(t,r,{get:e[r],enumerable:!0})},"__export"),ZYo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nGt(e))!KYo.call(t,o)&&o!==r&&rGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=YYo(e,o))||n.enumerable});return t},"__copyProps"),rh=a(t=>ZYo(rGt({},"__esModule",{value:!0}),t),"__toCommonJS"),oF,Lq=Zr({"src/lib/errors/git-error.ts"(){"use strict";oF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),_we,jue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Lq(),_we=class extends oF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),LSn,BSn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Lq(),LSn=class extends oF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function FSn(t){return typeof t!="function"?sJ:t}a(FSn,"asFunction");function USn(t){return typeof t=="function"&&t!==sJ}a(USn,"isUserFunction");function QSn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(QSn,"splitOn");function qSn(t,e=0){return jSn(t)&&t.length>e?t[e]:void 0}a(qSn,"first");function oJ(t,e=0){if(jSn(t)&&t.length>e)return t[t.length-1-e]}a(oJ,"last");function jSn(t){return LZe(t)}a(jSn,"isArrayLike");function vwe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(vwe,"toLinesWithContent");function iGt(t,e){return vwe(t,!0).map(r=>e(r))}a(iGt,"forEachLineWithContent");function oGt(t){return(0,DZe.exists)(t,DZe.FOLDER)}a(oGt,"folderExists");function cw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(cw,"append");function HSn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(HSn,"including");function NZe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(NZe,"remove");function jO(t){return Array.isArray(t)?t:[t]}a(jO,"asArray");function GSn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(GSn,"asCamelCase");function Hue(t){return jO(t).map(e=>e instanceof String?e:String(e))}a(Hue,"asStringArray");function Eu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Eu,"asNumber");function ywe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a($Sn,"pick");function qHt(t=0){return new Promise(e=>setTimeout(e,t))}a(qHt,"delay");function jHt(t){if(t!==!1)return t}a(jHt,"orVoid");var Que,sJ,Cwe,MZe=Zr({"src/lib/utils/util.ts"(){"use strict";sGt(),Que="\0",sJ=a(()=>{},"NOOP"),Cwe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function pE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(pE,"filterType");function HHt(t,e){let r=ow(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(HHt,"filterPrimitives");function OZe(t){return!!t&&Cwe(t)==="[object Object]"}a(OZe,"filterPlainObject");function VSn(t){return typeof t=="function"}a(VSn,"filterFunction");var bwe,WSn,lp,wZe,LZe,sGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";MZe(),bwe=a(t=>Array.isArray(t),"filterArray"),WSn=a(t=>typeof t=="number","filterNumber"),lp=a(t=>typeof t=="string"||ow(t),"filterString"),wZe=a(t=>lp(t)||Array.isArray(t)&&t.every(lp),"filterStringOrStringArray"),LZe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),GHt,XYo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";GHt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(GHt||{})}}),RZe,eKo=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";RZe=class zSn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new zSn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function tKo(){throw new Error("LineParser:useMatches not implemented")}a(tKo,"useMatchesDefault");var ko,Oq,rKo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";ko=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=tKo,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))}},Oq=class extends ko{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 YSn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...KSn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(YSn,"createInstanceConfig");var KSn,nKo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";KSn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function aGt(t,e=[]){return OZe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(ow(o))r.push(o);else if(HHt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)HHt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(aGt,"appendTaskOptions");function J_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=vwe(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(JC,"parseStringResponse");var sKo=Zr({"src/lib/utils/task-parser.ts"(){"use strict";MZe()}}),JSn={};tm(JSn,{ExitCodes:a(()=>GHt,"ExitCodes"),GitOutputStreams:a(()=>RZe,"GitOutputStreams"),LineParser:a(()=>ko,"LineParser"),NOOP:a(()=>sJ,"NOOP"),NULL:a(()=>Que,"NULL"),RemoteLineParser:a(()=>Oq,"RemoteLineParser"),append:a(()=>cw,"append"),appendTaskOptions:a(()=>aGt,"appendTaskOptions"),asArray:a(()=>jO,"asArray"),asCamelCase:a(()=>GSn,"asCamelCase"),asFunction:a(()=>FSn,"asFunction"),asNumber:a(()=>Eu,"asNumber"),asStringArray:a(()=>Hue,"asStringArray"),bufferToString:a(()=>Ewe,"bufferToString"),callTaskParser:a(()=>$Ht,"callTaskParser"),createInstanceConfig:a(()=>YSn,"createInstanceConfig"),delay:a(()=>qHt,"delay"),filterArray:a(()=>bwe,"filterArray"),filterFunction:a(()=>VSn,"filterFunction"),filterHasLength:a(()=>LZe,"filterHasLength"),filterNumber:a(()=>WSn,"filterNumber"),filterPlainObject:a(()=>OZe,"filterPlainObject"),filterPrimitives:a(()=>HHt,"filterPrimitives"),filterString:a(()=>lp,"filterString"),filterStringOrStringArray:a(()=>wZe,"filterStringOrStringArray"),filterType:a(()=>pE,"filterType"),first:a(()=>qSn,"first"),folderExists:a(()=>oGt,"folderExists"),forEachLineWithContent:a(()=>iGt,"forEachLineWithContent"),getTrailingOptions:a(()=>J_,"getTrailingOptions"),including:a(()=>HSn,"including"),isUserFunction:a(()=>USn,"isUserFunction"),last:a(()=>oJ,"last"),objectToString:a(()=>Cwe,"objectToString"),orVoid:a(()=>jHt,"orVoid"),parseStringResponse:a(()=>JC,"parseStringResponse"),pick:a(()=>$Sn,"pick"),prefixedArray:a(()=>ywe,"prefixedArray"),remove:a(()=>NZe,"remove"),splitOn:a(()=>QSn,"splitOn"),toLinesWithContent:a(()=>vwe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Qd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>cGt,"trailingOptionsArgument")});var oo=Zr({"src/lib/utils/index.ts"(){"use strict";sGt(),XYo(),eKo(),rKo(),nKo(),oKo(),sKo(),MZe()}}),ZSn={};tm(ZSn,{CheckRepoActions:a(()=>VHt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>eTn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>XSn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>aKo,"checkIsRepoTask")});function aKo(t){switch(t){case"bare":return eTn();case"root":return XSn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:BZe,parser:lGt}}a(aKo,"checkIsRepoTask");function XSn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:BZe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(XSn,"checkIsRepoRootTask");function eTn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:BZe,parser:lGt}}a(eTn,"checkIsBareRepoTask");function cKo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(cKo,"isNotRepoMessage");var VHt,BZe,lGt,tTn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),VHt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(VHt||{}),BZe=a(({exitCode:t},e,r,n)=>{if(t===128&&cKo(e))return r(Buffer.from("false"));n(e)},"onError"),lGt=a(t=>t.trim()==="true","parser")}});function lKo(t,e){let r=new rTn(t),n=t?iTn:nTn;return vwe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(oTn.test(s)?r.folders:r.files).push(s)}),r}a(lKo,"cleanSummaryParser");var rTn,nTn,iTn,oTn,uKo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),rTn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},nTn=/^[a-z]+\s*/i,iTn=/^[a-z]+\s+[a-z]+\s*/i,oTn=/\/$/}}),WHt={};tm(WHt,{EMPTY_COMMANDS:a(()=>FZe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>sTn,"adhocExecTask"),configurationErrorTask:a(()=>KC,"configurationErrorTask"),isBufferTask:a(()=>cTn,"isBufferTask"),isEmptyTask:a(()=>lTn,"isEmptyTask"),straightThroughBufferTask:a(()=>aTn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>Z_,"straightThroughStringTask")});function sTn(t){return{commands:FZe,format:"empty",parser:t}}a(sTn,"adhocExecTask");function KC(t){return{commands:FZe,format:"empty",parser(){throw typeof t=="string"?new LSn(t):t}}}a(KC,"configurationErrorTask");function Z_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(Z_,"straightThroughStringTask");function aTn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(aTn,"straightThroughBufferTask");function cTn(t){return t.format==="buffer"}a(cTn,"isBufferTask");function lTn(t){return t.format==="empty"||!t.commands.length}a(lTn,"isEmptyTask");var FZe,nh=Zr({"src/lib/tasks/task.ts"(){"use strict";BSn(),FZe=[]}}),uTn={};tm(uTn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>uGt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>dGt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>fGt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>SZe,"CleanOptions"),cleanTask:a(()=>dTn,"cleanTask"),cleanWithOptionsTask:a(()=>dKo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>fKo,"isCleanOptionsArray")});function dKo(t,e){let{cleanMode:r,options:n,valid:o}=pKo(t);return r?o.options?(n.push(...e),n.some(gKo)?KC(uGt):dTn(r,n)):KC(fGt+JSON.stringify(t)):KC(dGt)}a(dKo,"cleanWithOptionsTask");function dTn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return lKo(t==="n",n)}}}a(dTn,"cleanTask");function fKo(t){return Array.isArray(t)&&t.every(e=>pGt.has(e))}a(fKo,"isCleanOptionsArray");function pKo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{hKo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&mKo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(pKo,"getCleanOptions");function hKo(t){return t==="f"||t==="n"}a(hKo,"isCleanMode");function mKo(t){return/^-[a-z]$/i.test(t)&&pGt.has(t.charAt(1))}a(mKo,"isKnownOption");function gKo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(gKo,"isInteractiveMode");var uGt,dGt,fGt,SZe,pGt,fTn=Zr({"src/lib/tasks/clean.ts"(){"use strict";uKo(),oo(),nh(),uGt="Git clean interactive mode is not supported",dGt='Git clean mode parameter ("n" or "f") is required',fGt="Git clean unknown option found in: ",SZe=(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))(SZe||{}),pGt=new Set(["i",...Hue(Object.values(SZe))])}});function AKo(t){let e=new hTn;for(let r of pTn(t))e.addValue(r.file,String(r.key),r.value);return e}a(AKo,"configListParser");function yKo(t,e){let r=null,n=[],o=new Map;for(let s of pTn(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(yKo,"configGetParser");function EKo(t){return t.replace(/^(file):/,"")}a(EKo,"configFilePath");function*pTn(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=oJ(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 OHt(t,e){return typeof t=="string"&&Object.hasOwn(zHt,t)?t:e}a(OHt,"asConfigScope");function vKo(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(vKo,"addConfigTask");function CKo(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 yKo(n,t)}}}a(CKo,"getConfigTask");function bKo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return AKo(r)}}}a(bKo,"listConfigTask");function SKo(){return{addConfig(t,e,...r){return this._runTask(vKo(t,e,r[0]===!0,OHt(r[1],"local")),Qd(arguments))},getConfig(t,e){return this._runTask(CKo(t,OHt(e,void 0)),Qd(arguments))},listConfig(...t){return this._runTask(bKo(OHt(t[0],void 0)),Qd(arguments))}}}a(SKo,"config_default");var zHt,mTn=Zr({"src/lib/tasks/config.ts"(){"use strict";_Ko(),oo(),zHt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(zHt||{})}});function TKo(t){return gTn.has(t)}a(TKo,"isDiffNameStatus");var LHt,gTn,ATn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";LHt=(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))(LHt||{}),gTn=new Set(Object.values(LHt))}});function IKo(...t){return new ETn().param(...t)}a(IKo,"grepQueryBuilder");function xKo(t){let e=new Set,r={};return iGt(t,n=>{let[o,s,c]=n.split(Que);e.add(o),(r[o]=r[o]||[]).push({line:Eu(s),path:o,preview:c})}),{paths:e,results:r}}a(xKo,"parseGrep");function wKo(){return{grep(t){let e=Qd(arguments),r=J_(arguments);for(let o of yTn)if(r.includes(o))return this._runTask(KC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=IKo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return xKo(o)}},e)}}}a(wKo,"grep_default");var yTn,Awe,oSn,ETn,_Tn=Zr({"src/lib/tasks/grep.ts"(){"use strict";oo(),nh(),yTn=["-h"],Awe=Symbol("grepQuery"),ETn=class{static{a(this,"GrepQuery")}constructor(){this[oSn]=[]}*[(oSn=Awe,Symbol.iterator)](){for(let t of this[Awe])yield t}and(...t){return t.length&&this[Awe].push("--and","(",...ywe(t,"-e"),")"),this}param(...t){return this[Awe].push(...ywe(t,"-e")),this}}}}),vTn={};tm(vTn,{ResetMode:a(()=>TZe,"ResetMode"),getResetMode:a(()=>kKo,"getResetMode"),resetTask:a(()=>RKo,"resetTask")});function RKo(t,e){let r=["reset"];return CTn(t)&&r.push(`--${t}`),r.push(...e),Z_(r)}a(RKo,"resetTask");function kKo(t){if(CTn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(kKo,"getResetMode");function CTn(t){return typeof t=="string"&&bTn.includes(t)}a(CTn,"isValidResetMode");var TZe,bTn,STn=Zr({"src/lib/tasks/reset.ts"(){"use strict";oo(),nh(),TZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(TZe||{}),bTn=Hue(Object.values(TZe))}});function PKo(){return(0,kZe.default)("simple-git")}a(PKo,"createLog");function sSn(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(sSn,"prefixedLogger");function DKo(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(DKo,"childLoggerName");function hGt(t,e,r,n=PKo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=DKo(pE(e,lp),c,n);return d(r);function u(f,h){return cw(s,hGt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&sSn(c,h)||sJ,g=sSn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(hGt,"createLogger");var TTn=Zr({"src/lib/git-logger.ts"(){"use strict";oo(),kZe.default.formatters.L=t=>String(LZe(t)?t.length:"-"),kZe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Cwe(t)}}),ITn,NKo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Lq(),TTn(),ITn=class YHt{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=YHt.getName(e.commands[0]),n=hGt(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 oF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++YHt.counter}`}static{this.counter=0}}}});function iJ(t,e){return{method:qSn(t.commands)||"",commands:e}}a(iJ,"pluginContext");function MKo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(MKo,"onErrorReceived");function aSn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(aSn,"onDataReceived");var KHt,OKo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Lq(),nh(),oo(),NKo(),KHt=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 ITn}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(lTn(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 oF?Object.assign(e,{task:t}):new oF(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","",iJ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...iJ(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),cTn(t)?$Ht(t.parser,s):$Ht(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},{...iJ(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",Cwe(h)),u(new RZe(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 RZe(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},iJ(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,{...iJ(t,r),kill(m){f=m||f}});let h=(0,xTn.spawn)(e,r,c);h.stdout.on("data",aSn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",aSn(d,"stdErr",o,s.step("stdErr"))),h.on("error",MKo(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,{...iJ(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,{...iJ(t,e),kill(n){r=n||r}}),r}}}}),wTn={};tm(wTn,{GitExecutor:a(()=>RTn,"GitExecutor")});var RTn,LKo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";OKo(),RTn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new KHt(this,this._scheduler,this._plugins)}chain(){return new KHt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function BKo(t,e,r=sJ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof _we?FKo(s):s,void 0)},"onError2");e.then(n,o)}a(BKo,"taskCallback");function FKo(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=sJ},"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(FKo,"addDeprecationNoticeToError");var UKo=Zr({"src/lib/task-callback.ts"(){"use strict";jue(),oo()}});function cSn(t,e){return sTn(r=>{if(!oGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(cSn,"changeWorkingDirectoryTask");var QKo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),nh()}});function BHt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=NZe(e,"-B")),Z_(e)}a(BHt,"checkoutTask");function qKo(){return{checkout(){return this._runTask(BHt(J_(arguments,1)),Qd(arguments))},checkoutBranch(t,e){return this._runTask(BHt(["-b",t,e,...J_(arguments)]),Qd(arguments))},checkoutLocalBranch(t){return this._runTask(BHt(["-b",t,...J_(arguments)]),Qd(arguments))}}}a(qKo,"checkout_default");var jKo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),nh()}});function HKo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(HKo,"countObjectsResponse");function GKo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return JC(HKo(),[kTn],t)}})}}}a(GKo,"count_objects_default");var kTn,$Ko=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),kTn=new ko(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=GSn(e);Object.hasOwn(t,n)&&(t[n]=Eu(r))})}});function VKo(t){return JC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},PTn,t)}a(VKo,"parseCommitResult");var PTn,WKo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),PTn=[new ko(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new ko(/\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 ko(/(\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 ko(/^(\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 zKo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...ywe(t,"-m"),...e,...r],format:"utf-8",parser:VKo}}a(zKo,"commitTask");function YKo(){return{commit(e,...r){let n=Qd(arguments),o=t(e)||zKo(jO(e),jO(pE(r[0],wZe,[])),[...Hue(pE(r[1],bwe,[])),...J_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!wZe(e)&&KC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(YKo,"commit_default");var KKo=Zr({"src/lib/tasks/commit.ts"(){"use strict";WKo(),oo(),nh()}});function JKo(){return{firstCommit(){return this._runTask(Z_(["rev-list","--max-parents=0","HEAD"],!0),Qd(arguments))}}}a(JKo,"first_commit_default");var ZKo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),nh()}});function XKo(t,e){let r=["hash-object",t];return e&&r.push("-w"),Z_(r,!0)}a(XKo,"hashObjectTask");var eJo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";nh()}});function tJo(t,e,r){let n=String(r).trim(),o;if(o=DTn.exec(n))return new IZe(t,e,!1,o[1]);if(o=NTn.exec(n))return new IZe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new IZe(t,e,/^re/i.test(n),s)}a(tJo,"parseInit");var IZe,DTn,NTn,rJo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";IZe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},DTn=/^Init.+ repository in (.+)$/,NTn=/^Rein.+ in (.+)$/}});function nJo(t){return t.includes(mGt)}a(nJo,"hasBareCommand");function iJo(t=!1,e,r){let n=["init",...r];return t&&!nJo(n)&&n.splice(1,0,mGt),{commands:n,format:"utf-8",parser(o){return tJo(n.includes("--bare"),e,o)}}}a(iJo,"initTask");var mGt,oJo=Zr({"src/lib/tasks/init.ts"(){"use strict";rJo(),mGt="--bare"}});function gGt(t){for(let e=0;eJC(new MTn,e,r,!1)}a(OTn,"getDiffParser");var FHt,lSn,uSn,dSn,LTn,BTn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Swe(),aJo(),ATn(),oo(),FHt=[new ko(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Eu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new ko(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:Eu(r),after:Eu(n),binary:!0})}),new ko(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=Eu(e),t.insertions=Eu(n?.[1]),t.deletions=Eu(o?.[1])})],lSn=[new ko(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Eu(e),s=Eu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new ko(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],uSn=[new ko(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],dSn=[new ko(/([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:jHt(TKo(e)&&e),from:jHt(!!s&&n!==s&&n),similarity:Eu(r)})})],LTn={"":FHt,"--stat":FHt,"--numstat":lSn,"--name-status":dSn,"--name-only":uSn}}});function cJo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(cJo,"lineBuilder");function FTn(t=_Gt,e=UTn,r=""){let n=OTn(r);return function(o){let s=vwe(o.trim(),!1,yGt).map(function(c){let l=c.split(EGt),u=cJo(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(FTn,"createListLogSummaryParser");var yGt,EGt,_Gt,UTn,QTn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),BTn(),Swe(),yGt="\xF2\xF2\xF2\xF2\xF2\xF2 ",EGt=" \xF2\xF2",_Gt=" \xF2 ",UTn=["hash","date","message","refs","author_name","author_email"]}}),qTn={};tm(qTn,{diffSummaryTask:a(()=>lJo,"diffSummaryTask"),validateLogFormatConfig:a(()=>UZe,"validateLogFormatConfig")});function lJo(t){let e=gGt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),UZe(r)||{commands:r,format:"utf-8",parser:OTn(e)}}a(lJo,"diffSummaryTask");function UZe(t){let e=t.filter(sJo);if(e.length>1)return KC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return KC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(UZe,"validateLogFormatConfig");var vGt=Zr({"src/lib/tasks/diff.ts"(){"use strict";Swe(),BTn(),nh()}});function uJo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(uJo,"prettyFormat");function dJo(t){return Object.keys(t).reduce((e,r)=>(r in JHt||(e[r]=t[r]),e),{})}a(dJo,"userOptions");function jTn(t={},e=[]){let r=pE(t.splitter,lp,_Gt),n=OZe(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]=uJo(n,r),c=[],l=[`--pretty=format:${yGt}${s}${EGt}`,...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 lp(t.file)&&l.push("--follow",Nue(t.file)),aGt(dJo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(jTn,"parseLogOptions");function fJo(t,e,r){let n=FTn(t,e,gGt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(fJo,"logTask");function pJo(){return{log(...r){let n=Qd(arguments),o=jTn(cGt(arguments),Hue(pE(arguments[0],bwe,[]))),s=e(...r)||UZe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return fJo(r.splitter,r.fields,r.commands)}function e(r,n){return lp(r)&&lp(n)&&KC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(pJo,"log_default");var JHt,HTn=Zr({"src/lib/tasks/log.ts"(){"use strict";Swe(),QTn(),oo(),nh(),vGt(),JHt=(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))(JHt||{})}}),xZe,GTn,hJo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";xZe=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}`}},GTn=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"}}}}),ZHt,$Tn,mJo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";ZHt=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}}},$Tn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function UHt(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(UHt,"objectEnumerationResult");function fSn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Eu(e&&e[1]||"0"),delta:Eu(r&&r[1]||"0")}}a(fSn,"asObjectCount");var VTn,gJo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),VTn=[new Oq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=UHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Oq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=UHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Oq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=UHt(t.remoteMessages);o.total=fSn(e),o.reused=fSn(r),o.packReused=Eu(n)})]}});function WTn(t,e){return JC({remoteMessages:new YTn},zTn,e)}a(WTn,"parseRemoteMessages");var zTn,YTn,KTn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),gJo(),zTn=[new Oq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...VTn,new Oq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Oq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Eu(e),summary:r,url:n}})],YTn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function AJo(t,e){let r=JC(new $Tn,JTn,[t,e]);return r.message&&r}a(AJo,"parsePullErrorResult");var pSn,hSn,mSn,gSn,JTn,ASn,CGt,ZTn=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";mJo(),oo(),KTn(),pSn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,hSn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,mSn=/^(create|delete) mode \d+ (.+)/,gSn=[new ko(pSn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new ko(hSn,(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 ko(mSn,(t,[e,r])=>{cw(t.files,r),cw(e==="create"?t.created:t.deleted,r)})],JTn=[new ko(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new ko(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new ko(/([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})],ASn=a((t,e)=>JC(new ZHt,gSn,[t,e]),"parsePullDetail"),CGt=a((t,e)=>Object.assign(new ZHt,ASn(t,e),WTn(t,e)),"parsePullResult")}}),ySn,XTn,ESn,yJo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";hJo(),oo(),ZTn(),ySn=[new ko(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new ko(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new xZe(e,r))}),new ko(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new xZe(e,r,{deleteRef:n}))}),new ko(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new xZe(e,null))}),new ko(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],XTn=a((t,e)=>Object.assign(ESn(t,e),CGt(t,e)),"parseMergeResult"),ESn=a(t=>JC(new GTn,ySn,t),"parseMergeDetail")}});function _Sn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=XTn(e,r);if(n.failed)throw new _we(n);return n}}:KC("Git.merge requires at least one option")}a(_Sn,"mergeTask");var EJo=Zr({"src/lib/tasks/merge.ts"(){"use strict";jue(),yJo(),nh()}});function _Jo(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(_Jo,"pushResultPushedItem");var vSn,eIn,CSn,vJo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),KTn(),vSn=[new ko(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new ko(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new ko(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(_Jo(e,r,n))}),new ko(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new ko(/^([^:]+):(\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}}})],eIn=a((t,e)=>{let r=CSn(t,e),n=WTn(t,e);return{...r,...n}},"parsePushResult"),CSn=a((t,e)=>JC({pushed:[]},vSn,[t,e]),"parsePushDetail")}}),tIn={};tm(tIn,{pushTagsTask:a(()=>CJo,"pushTagsTask"),pushTask:a(()=>bGt,"pushTask")});function CJo(t={},e){return cw(e,"--tags"),bGt(t,e)}a(CJo,"pushTagsTask");function bGt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),NZe(r,"-v"),cw(r,"--verbose"),cw(r,"--porcelain"),{commands:r,format:"utf-8",parser:eIn}}a(bGt,"pushTask");var rIn=Zr({"src/lib/tasks/push.ts"(){"use strict";vJo(),oo()}});function bJo(){return{showBuffer(){let t=["show",...J_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(aTn(t),Qd(arguments))},show(){let t=["show",...J_(arguments,1)];return this._runTask(Z_(t),Qd(arguments))}}}a(bJo,"show_default");var SJo=Zr({"src/lib/tasks/show.ts"(){"use strict";oo(),nh()}}),bSn,nIn,TJo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";bSn=/^(.+)\0(.+)$/,nIn=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=bSn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function SSn(t){let[e,r]=t.split(Que);return{from:r||e,to:e}}a(SSn,"renamedFile");function XS(t,e,r){return[`${t}${e}`,r]}a(XS,"parser3");function QHt(t,...e){return e.map(r=>XS(t,r,(n,o)=>n.conflicted.push(o)))}a(QHt,"conflicts");function IJo(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=iIn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new nIn(c,o,s))}a(n,"data")}a(IJo,"splitLine");var TSn,iIn,oIn,xJo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),TJo(),TSn=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}},iIn=new Map([XS(" ","A",(t,e)=>t.created.push(e)),XS(" ","D",(t,e)=>t.deleted.push(e)),XS(" ","M",(t,e)=>t.modified.push(e)),XS("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),XS("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),XS("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),XS("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),XS("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),XS("R"," ",(t,e)=>{t.renamed.push(SSn(e))}),XS("R","M",(t,e)=>{let r=SSn(e);t.renamed.push(r),t.modified.push(r.to)}),XS("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),XS("?","?",(t,e)=>t.not_added.push(e)),...QHt("A","A","U"),...QHt("D","D","U"),...QHt("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=pE(l?.[1],lp,null),l=s.exec(e),t.tracking=pE(l?.[1],lp,null),l=c.exec(e),l&&(t.current=pE(l?.[1],lp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),oIn=a(function(t){let e=t.split(Que),r=new TSn;for(let n=0,o=e.length;n!sIn.includes(r))],parser(r){return oIn(r)}}}a(wJo,"statusTask");var sIn,RJo=Zr({"src/lib/tasks/status.ts"(){"use strict";xJo(),sIn=["--null","-z"]}});function PZe(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(PZe,"versionResponse");function kJo(){return PZe(0,0,0,"",!1)}a(kJo,"notInstalledResponse");function PJo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:DJo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(SGt));n(e)}})}}}a(PJo,"version_default");function DJo(t){return t===SGt?kJo():JC(PZe(0,0,0,t),aIn,t)}a(DJo,"versionParser");var SGt,aIn,NJo=Zr({"src/lib/tasks/version.ts"(){"use strict";oo(),SGt="installed=false",aIn=[new ko(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,PZe(Eu(e),Eu(r),Eu(n),o))}),new ko(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,PZe(Eu(e),Eu(r),n,o))})]}});function ISn(t,e,r,...n){return lp(r)?e(r,pE(n[0],lp),J_(arguments)):KC(`git.${t}() requires a string 'repoPath'`)}a(ISn,"createCloneTask");function MJo(){return{clone(t,...e){return this._runTask(ISn("clone",XHt,pE(t,lp),...e),Qd(arguments))},mirror(t,...e){return this._runTask(ISn("mirror",cIn,pE(t,lp),...e),Qd(arguments))}}}a(MJo,"clone_default");var XHt,cIn,OJo=Zr({"src/lib/tasks/clone.ts"(){"use strict";nh(),oo(),XHt=a((t,e,r)=>{let n=["clone",...r];return lp(t)&&n.push(Nue(t)),lp(e)&&n.push(Nue(e)),Z_(n)},"cloneTask"),cIn=a((t,e,r)=>(cw(r,"--mirror"),XHt(t,e,r)),"cloneMirrorTask")}}),lIn={};tm(lIn,{SimpleGitApi:a(()=>eGt,"SimpleGitApi")});var eGt,LJo=Zr({"src/lib/simple-git-api.ts"(){"use strict";UKo(),QKo(),jKo(),$Ko(),KKo(),mTn(),ZKo(),_Tn(),eJo(),oJo(),HTn(),EJo(),rIn(),SJo(),RJo(),nh(),NJo(),oo(),OJo(),eGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&BKo(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(Z_(["add",...jO(t)]),Qd(arguments))}cwd(t){let e=Qd(arguments);return typeof t=="string"?this._runTask(cSn(t,this._executor),e):typeof t?.path=="string"?this._runTask(cSn(t.path,t.root&&this._executor||void 0),e):this._runTask(KC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(XKo(t,e===!0),Qd(arguments))}init(t){return this._runTask(iJo(t===!0,this._executor.cwd,J_(arguments)),Qd(arguments))}merge(){return this._runTask(_Sn(J_(arguments)),Qd(arguments))}mergeFromTo(t,e){return lp(t)&&lp(e)?this._runTask(_Sn([t,e,...J_(arguments)]),Qd(arguments,!1)):this._runTask(KC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=bGt({remote:pE(arguments[0],lp),branch:pE(arguments[1],lp)},J_(arguments));return this._runTask(t,Qd(arguments))}stash(){return this._runTask(Z_(["stash",...J_(arguments)]),Qd(arguments))}status(){return this._runTask(wJo(J_(arguments)),Qd(arguments))}},Object.assign(eGt.prototype,qKo(),MJo(),YKo(),SKo(),GKo(),JKo(),wKo(),pJo(),bJo(),PJo())}}),uIn={};tm(uIn,{Scheduler:a(()=>fIn,"Scheduler")});var xSn,fIn,BJo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),TTn(),xSn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,dIn.createDeferred)();return{promise:e,done:r,id:t}}})(),fIn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=hGt("","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=cw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),NZe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=cw(this.pending,xSn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),pIn={};tm(pIn,{applyPatchTask:a(()=>FJo,"applyPatchTask")});function FJo(t,e){return Z_(["apply",...e,...t])}a(FJo,"applyPatchTask");var UJo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";nh()}});function QJo(t,e){return{branch:t,hash:e,success:!0}}a(QJo,"branchDeletionSuccess");function qJo(t){return{branch:t,hash:null,success:!1}}a(qJo,"branchDeletionFailure");var hIn,jJo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";hIn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function mIn(t,e){return e===1&&tGt.test(t)}a(mIn,"hasBranchDeletionError");var wSn,tGt,RSn,QZe,HJo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";jJo(),oo(),wSn=/(\S+)\s+\(\S+\s([^)]+)\)/,tGt=/^error[^']+'([^']+)'/m,RSn=[new ko(wSn,(t,[e,r])=>{let n=QJo(e,r);t.all.push(n),t.branches[e]=n}),new ko(tGt,(t,[e])=>{let r=qJo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],QZe=a((t,e)=>JC(new hIn,RSn,[t,e]),"parseBranchDeletions")}}),gIn,GJo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";gIn=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 kSn(t){return t?t.charAt(0):""}a(kSn,"branchStatus");function AIn(t,e=!1){return JC(new gIn,e?[EIn]:yIn,t)}a(AIn,"parseBranchSummary");var yIn,EIn,$Jo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";GJo(),oo(),yIn=[new ko(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(kSn(e),!0,r,n,o)}),new ko(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(kSn(e),!1,r,n,o)})],EIn=new ko(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),_In={};tm(_In,{branchLocalTask:a(()=>WJo,"branchLocalTask"),branchTask:a(()=>VJo,"branchTask"),containsDeleteBranchCommand:a(()=>vIn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>YJo,"deleteBranchTask"),deleteBranchesTask:a(()=>zJo,"deleteBranchesTask")});function vIn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(vIn,"containsDeleteBranchCommand");function VJo(t){let e=vIn(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?QZe(o,s).all[0]:AIn(o,r)}}}a(VJo,"branchTask");function WJo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return AIn(t)}}}a(WJo,"branchLocalTask");function zJo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return QZe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!mIn(String(o),r))return c(o);s(n)}}}a(zJo,"deleteBranchesTask");function YJo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return QZe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!mIn(String(c),n))return u(c);throw new _we(r.parser(Ewe(s),Ewe(o)),String(c))}};return r}a(YJo,"deleteBranchTask");var KJo=Zr({"src/lib/tasks/branch.ts"(){"use strict";jue(),HJo(),$Jo(),oo()}});function JJo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,CIn.normalize)(e)}a(JJo,"toPath");var bIn,ZJo=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";bIn=a(t=>t.split(/\n/g).map(JJo).filter(Boolean),"parseCheckIgnore")}}),SIn={};tm(SIn,{checkIgnoreTask:a(()=>XJo,"checkIgnoreTask")});function XJo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:bIn}}a(XJo,"checkIgnoreTask");var eZo=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";ZJo()}});function tZo(t,e){return JC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},TIn,[t,e])}a(tZo,"parseFetchResult");var TIn,rZo=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),TIn=[new ko(/From (.+)$/,(t,[e])=>{t.remote=e}),new ko(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new ko(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new ko(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new ko(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),IIn={};tm(IIn,{fetchTask:a(()=>iZo,"fetchTask")});function nZo(t){return/^--upload-pack(=|$)/.test(t)}a(nZo,"disallowedCommand");function iZo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(nZo)?KC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:tZo}}a(iZo,"fetchTask");var oZo=Zr({"src/lib/tasks/fetch.ts"(){"use strict";rZo(),nh()}});function sZo(t){return JC({moves:[]},xIn,t)}a(sZo,"parseMoveResult");var xIn,aZo=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),xIn=[new ko(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),wIn={};tm(wIn,{moveTask:a(()=>cZo,"moveTask")});function cZo(t,e){return{commands:["mv","-v",...jO(t),e],format:"utf-8",parser:sZo}}a(cZo,"moveTask");var lZo=Zr({"src/lib/tasks/move.ts"(){"use strict";aZo(),oo()}}),RIn={};tm(RIn,{pullTask:a(()=>uZo,"pullTask")});function uZo(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 CGt(o,s)},onError(o,s,c,l){let u=AJo(Ewe(o.stdOut),Ewe(o.stdErr));if(u)return l(new _we(u));l(s)}}}a(uZo,"pullTask");var dZo=Zr({"src/lib/tasks/pull.ts"(){"use strict";jue(),ZTn(),oo()}});function fZo(t){let e={};return kIn(t,([r])=>e[r]={name:r}),Object.values(e)}a(fZo,"parseGetRemotes");function pZo(t){let e={};return kIn(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(pZo,"parseGetRemotesVerbose");function kIn(t,e){iGt(t,r=>e(r.split(/\s+/)))}a(kIn,"forEach");var hZo=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),PIn={};tm(PIn,{addRemoteTask:a(()=>mZo,"addRemoteTask"),getRemotesTask:a(()=>gZo,"getRemotesTask"),listRemotesTask:a(()=>AZo,"listRemotesTask"),remoteTask:a(()=>yZo,"remoteTask"),removeRemoteTask:a(()=>EZo,"removeRemoteTask")});function mZo(t,e,r){return Z_(["remote","add",...r,t,e])}a(mZo,"addRemoteTask");function gZo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?pZo:fZo}}a(gZo,"getRemotesTask");function AZo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Z_(e)}a(AZo,"listRemotesTask");function yZo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Z_(e)}a(yZo,"remoteTask");function EZo(t){return Z_(["remote","remove",t])}a(EZo,"removeRemoteTask");var _Zo=Zr({"src/lib/tasks/remote.ts"(){"use strict";hZo(),nh()}}),DIn={};tm(DIn,{stashListTask:a(()=>vZo,"stashListTask")});function vZo(t={},e){let r=jTn(t),n=["stash","list",...r.commands,...e],o=FTn(r.splitter,r.fields,gGt(n));return UZe(n)||{commands:n,format:"utf-8",parser:o}}a(vZo,"stashListTask");var CZo=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";Swe(),QTn(),vGt(),HTn()}}),NIn={};tm(NIn,{addSubModuleTask:a(()=>bZo,"addSubModuleTask"),initSubModuleTask:a(()=>SZo,"initSubModuleTask"),subModuleTask:a(()=>qZe,"subModuleTask"),updateSubModuleTask:a(()=>TZo,"updateSubModuleTask")});function bZo(t,e){return qZe(["add",t,e])}a(bZo,"addSubModuleTask");function SZo(t){return qZe(["init",...t])}a(SZo,"initSubModuleTask");function qZe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Z_(e)}a(qZe,"subModuleTask");function TZo(t){return qZe(["update",...t])}a(TZo,"updateSubModuleTask");var IZo=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";nh()}});function xZo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?MIn(t,e):0}a(xZo,"singleSorted");function MIn(t,e){return t===e?0:t>e?1:-1}a(MIn,"sorted");function wZo(t){return t.trim()}a(wZo,"trimmed");function bZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(bZe,"toNumber");var PSn,OIn,RZo=Zr({"src/lib/responses/TagList.ts"(){"use strict";PSn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},OIn=a(function(t,e=!1){let r=t.split(` -`).map(wZo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return xZo(bZe(c[0]),bZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new PSn(r,n)},"parseTagList")}}),LIn={};tm(LIn,{addAnnotatedTagTask:a(()=>DZo,"addAnnotatedTagTask"),addTagTask:a(()=>PZo,"addTagTask"),tagListTask:a(()=>kZo,"tagListTask")});function kZo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return OIn(r,e)}}}a(kZo,"tagListTask");function PZo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(PZo,"addTagTask");function DZo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(DZo,"addAnnotatedTagTask");var NZo=Zr({"src/lib/tasks/tag.ts"(){"use strict";RZo()}}),MZo=JYo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(LKo(),rh(wTn)),{SimpleGitApi:n}=(LJo(),rh(lIn)),{Scheduler:o}=(BJo(),rh(uIn)),{adhocExecTask:s,configurationErrorTask:c}=(nh(),rh(WHt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),rh(JSn)),{applyPatchTask:E}=(UJo(),rh(pIn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(KJo(),rh(_In)),{checkIgnoreTask:w}=(eZo(),rh(SIn)),{checkIsRepoTask:R}=(tTn(),rh(ZSn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(fTn(),rh(uTn)),{diffSummaryTask:D}=(vGt(),rh(qTn)),{fetchTask:N}=(oZo(),rh(IIn)),{moveTask:L}=(lZo(),rh(wIn)),{pullTask:B}=(dZo(),rh(RIn)),{pushTagsTask:q}=(rIn(),rh(tIn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:j,remoteTask:Q,removeRemoteTask:U}=(_Zo(),rh(PIn)),{getResetMode:Y,resetTask:W}=(STn(),rh(vTn)),{stashListTask:V}=(CZo(),rh(DIn)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(IZo(),rh(NIn)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:ge}=(NZo(),rh(LIn)),{straightThroughBufferTask:Ue,straightThroughStringTask:ke}=(nh(),rh(WHt));function X(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(X,"Git2"),(X.prototype=Object.create(n.prototype)).constructor=X,X.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},X.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},X.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},X.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},X.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,Z){K.checkout(Z.latest,ee)})})},X.prototype.pull=function(ee,K,he,Z){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.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.")))},X.prototype.tags=function(ee,K){return this._runTask(ge(g(arguments)),A(arguments))},X.prototype.rebase=function(){return this._runTask(ke(["rebase",...g(arguments)]),A(arguments))},X.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},X.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(ke(["revert",...g(arguments,0,!0),ee]),K)},X.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},X.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},X.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},X.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},X.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].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.")))},X.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},X.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=X}});Lq();var OZo=class extends oF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Lq();Lq();var que=class extends oF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};jue();BSn();tTn();fTn();mTn();ATn();_Tn();STn();function LZo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new que(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new que(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(LZo,"abortPlugin");function BZo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of iSn(e,r))if(t[n.category]!==!0)throw new que(void 0,"unsafe",n.message);return e}}}a(BZo,"blockUnsafeOperationsPlugin");oo();function FZo(t){let e=ywe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(FZo,"commandConfigPrefixingPlugin");oo();var DSn=(0,Uue.deferred)().promise;function UZo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Uue.deferred)(),closeTimeout:(0,Uue.deferred)(),exit:(0,Uue.deferred)(),exitTimeout:(0,Uue.deferred)()},c=Promise.race([t===!1?DSn:s.closeTimeout.promise,e===!1?DSn: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(()=>qHt(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 qHt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(UZo,"completionDetectionPlugin");oo();var QZo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",NSn="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 MSn(t,e){if(t.length<1||t.length>2)throw new que(void 0,"binary",QZo);if(t.some(qZo))if(e)console.warn(NSn);else throw new que(void 0,"binary",NSn);let[n,o]=t;return{binary:n,prefix:o}}a(MSn,"toBinaryConfig");function jZo(t,e=["git"],r=!1){let n=MSn(jO(e),r);t.on("binary",o=>{n=MSn(jO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(jZo,"customBinaryPlugin");Lq();function HZo(t){return!!(t.exitCode&&t.stdErr.length)}a(HZo,"isTaskError");function GZo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(GZo,"getErrorMessage");function $Zo(t=!1,e=HZo,r=GZo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a($Zo,"errorDetectionHandler");function OSn(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 oF(void 0,n.toString("utf-8"))}:{error:n}}}}a(OSn,"errorDetectionPlugin");oo();var VZo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new BIn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=cw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return jO(t).forEach(r=>r&&this.plugins.add(cw(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 WZo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?HSn(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:zZo(u[1]),progress:Eu(u[2]),processed:Eu(u[3]),total:Eu(u[4])})})}}]}a(WZo,"progressMonitorPlugin");function zZo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(zZo,"progressEventStage");oo();function YZo(t){let e=$Sn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(YZo,"spawnOptionsPlugin");function KZo({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 que(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(KZo,"timeoutPlugin");function JZo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oow(c)&&Mue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(JZo,"suffixPathsPlugin");oo();var ZZo=MZo();function XZo(t,e){let r=new VZo,n=YSn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!oGt(n.baseDir))throw new OZo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(FZo(n.config)),r.add(BZo(n.unsafe)),r.add(UZo(n.completion)),n.abort&&r.add(LZo(n.abort)),n.progress&&r.add(WZo(n.progress)),n.timeout&&r.add(KZo(n.timeout)),n.spawnOptions&&r.add(YZo(n.spawnOptions)),r.add(JZo()),r.add(OSn($Zo(!0))),n.errors&&r.add(OSn(n.errors)),jZo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new ZZo(n,r)}a(XZo,"gitInstanceFactory");jue();var Gue=XZo;var lw=new fe("Git Service");var jZe=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 lO()).path;n=Gue({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,UIn.join)(n,r);return Ks(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){lw.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){lw.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){lw.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){lw.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){lw.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 lw.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};lw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){lw.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){lw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,FIn.fileURLToPath)(e)}catch(r){lw.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 lw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var QIn=de(nl());var e2=new fe("Local Diff Tracker");var HZe=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 jZe(e),this._repositoryManager=e.get(_f),this._diffRefreshTimer=new QIn.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{e2.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):e2.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){e2.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){e2.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)&&e2.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?e2.warn(this.ctx,n,o):e2.warn(this.ctx,n):o!==void 0?e2.debug(this.ctx,n,o):e2.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Bq;(n=>{function t(o){return new TGt(o)}n.ok=t,a(t,"ok");function e(o){return new IGt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Bq||={});var TGt=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}},IGt=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 xGt=new fe("GithubAvailableEmbeddingTypes"),GZe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Bq.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):Bq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Pue(this._ctx);r=await Gf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return xGt.error(this._ctx,"Error fetching available embedding types",c),Bq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Bq.error({type:"unauthorized",status:r.status}):Bq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new $C(c.id);c.active===!1?s.push(l):o.push(l)}return Bq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){xGt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return xGt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var eXo=new fe("GithubEmbeddingComputer"),$ue=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){eXo.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 Gf(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 $C(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 Twe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var qIn=de(NA()),jIn=de(dU()),HIn=require("os"),wGt=de(require("path")),Vue=require("process");function $Ze(t){let e=un(t.workspaceFolder.uri),r=(0,qIn.basename)(e),o=(0,jIn.SHA256)(e).toString().substring(0,8);return wGt.default.join(tXo(),"project-index",`${r}.${o}`)}a($Ze,"getWorkspaceCachePath");function tXo(){return Vue.env.XDG_CACHE_HOME&&wGt.default.isAbsolute(Vue.env.XDG_CACHE_HOME)?Vue.env.XDG_CACHE_HOME+"/github-copilot":(0,HIn.platform)()==="win32"?Vue.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Vue.env.HOME+"/.cache/github-copilot"}a(tXo,"getXdgCachePath");p();p();function GIn(t){if(Jqt(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(RGt,"unpackEmbedding");p();var $In=de(nl()),VIn=de(zP()),PGt=de(eh()),WIn=de(require("fs")),DGt=de(require("node:sqlite")),NGt=de(require("path"));var kGt=new fe("WorkspaceChunkAndEmbeddingCache");async function zIn(t,e,r,n){return await MGt.create(t,e,r??":memory:",n)}a(zIn,"createWorkspaceChunkAndEmbeddingCache");var MGt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new VIn.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=NGt.default.join(n,"workspace-chunks.db");try{await WIn.default.promises.mkdir(NGt.default.dirname(d),{recursive:!0}),c=new DGt.default.DatabaseSync(d,s),kGt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){kGt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new DGt.default.DatabaseSync(":memory:",s),kGt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}a(Mqt,"applyEditsToDocument");var Eue=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 wo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(PA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},yJe=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 vq(e.ctx),u=await e.ctx.get(el).getBestChatModelConfig(wS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(PA).toPrompt(e,d)}async processResponse(e){let r=[],n=Pn(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(uE);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ni).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=Nqt(e,r).filter(c=>Dqt.includes(c.mode)),s=Mqt(o,r);if(s)return await this.ctx.get(Kh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return Nqt(e,r)}};var EJe=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 Eue(e.ctx);return new AJe(e,r)}};p();p();p();p();function VCn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(VCn,"filterUnsupportedReferences");function WCn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(WCn,"convertToCopilotReferences");var zCn=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 Rq=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,VCn(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 OO=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(Lr).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(sx).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(nr).fetch(l,{method:"GET",headers:c})}};p();p();var YCn=S.Object({name:S.String(),url:S.String()}),KCn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(YCn)})),remotes:S.Optional(S.Array(YCn))}),Oqt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(LO,"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)}},LO="git-metadata",_Je=class extends Ag{static{a(this,"GitMetadataSkill")}constructor(e){super(LO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new Oqt(r))}};async function JCn(t){let e=await t.skillResolver.resolve(uE);if(e){let c=e.uri,l=yQ(t.ctx,c);if(Rdn(l))return{repoInfo:l,skillUsed:uE}}let r=await t.skillResolver.resolve(LO);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=v8t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:LO}}a(JCn,"extractRepoInfo");async function ZCn(t){let e=[];return await UHo(t,e),await QHo(t,e),await qHo(t,e),e}a(ZCn,"skillsToReference");async function UHo(t,e){let r=await jHo(t);r&&e.push(r)}a(UHo,"addRepositoryReference");async function QHo(t,e){let r=await HHo(t);r&&e.push(r)}a(QHo,"addSelectionReference");async function qHo(t,e){let r=[],n=await $Ho(t);n&&r.push(n),r.push(...await VHo(t)),r.length>0&&e.push(...r)}a(qHo,"addFileReferences");async function jHo(t){let e=await JCn(t);if(e){let r=t.ctx.get(OO),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(jHo,"gitMetadataToReference");async function HHo(t){let e=await t.skillResolver.resolve(uE);if(e&&e.selection){let n=await t.ctx.get(ni).getOrReadTextDocument(e),o=rd(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return GHo(e,n.document)}}a(HHo,"currentEditorToSelectionReference");function GHo(t,e){if(t.selection&&!due(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(GHo,"extractSelection");async function $Ho(t){let e=await t.skillResolver.resolve(uE);if(e){let n=await t.ctx.get(ni).getOrReadTextDocument(e),o=rd(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($Ho,"currentEditorToFileReference");async function VHo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ni);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=rd(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(VHo,"fileReferenceToPlatformFileReference");p();Oo();var WHo=new fe("ChatFetchResultPostProcessor"),_ue=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(xyn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(Kh).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:Pn(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"},WHo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:W_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===z_,copilotPlan:ox(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}=wo.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},wyn(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:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new Iq(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:Mt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return Dyn(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",Ryn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var vJe=S.Union([S.String(),S.Number()]),YK=S.Union([S.String(),S.Number()]),zHo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),CJe=S.Object({uri:S.String(),position:S.Optional(u0)}),YHo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(u0),visibleRange:S.Optional(If),selection:S.Optional(If),status:S.Optional(zHo),range:S.Optional(If)}),KHo=S.Object({type:S.Literal("directory"),uri:S.String()}),JHo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),BO=S.Union([YHo,KHo,zCn,JHo]),FO=S.Union([S.Literal("panel"),S.Literal("inline")]),ZHo=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")]))})})]),Lqt=S.Union([S.String(),S.Array(ZHo)]),XCn=S.Object({request:Lqt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(YK),model:S.Optional(S.String())});function bJe(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(bJe,"convertToMessageContent");function SJe(t,e){if(t=VS(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(SJe,"appendToMessage");var TJe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),XHo=S.Object({type:S.String(),description:S.String()}),ebn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),XHo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Bc=S.Object({uri:S.String(),name:S.String()}),eGo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),IJe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:eGo});Oo();var Bqt="generate-response",xJe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},Wxe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new sc(r.ctx),this.postProcessor=new _ue(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 xJe?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 tl(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(Kh).inspectPrompt(l),await n.steps.start(Bqt,"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:VS(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 Mt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return GQt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:VS(r.request.message)}),r.response&&r.response.type==="model"){let o=WCn(r.response.references);n.push({role:"assistant",content:VS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await ZCn(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 Rq((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=SJe(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:Pn(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()),Pn(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 xJe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return dxe(this.conversation,"conversationPanel",Pn(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(Bqt,e.error.message):await r.steps.finish(Bqt)}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 zxe=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 Wxe(this,e)}},wJe=class extends zxe{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 Wxe(this,e)}};p();var tGo="github",YP=class{static{a(this,"RemoteAgentRegistry")}},RJe=class extends YP{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 OY(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Nr.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)||Nr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Nr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==tGo).map(o=>new zxe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var tbn=de(require("fs")),K_=de(require("path"));var Fqt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],Uqt="test_",Yxe={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"}},Kxe=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=K_.extname(r).replace(".",""),o=Yxe[n]??{location:"sameFolder",prefix:Uqt,suffix:Fqt},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=rs(ff(e)),l===void 0)return}else{let d=rs(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=K_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ks(l);if(await this.fileExists(u))return Ra(u,s[0])}parseTestFilePath(e){try{return Ks(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ji(e),n=K_.extname(r).replace(".",""),o=Yxe[n]??{location:"sameFolder",prefix:Uqt,suffix:Fqt},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=ff(e):l=this.determineImplFolder(e);for(let u of s){let d=Ra(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=rs(e);if(r===void 0)return;let n=K_.extname(Ji(e)).replace(".",""),o,s=Yxe[n]?.location??"sameFolder";s==="sameFolder"?o=K_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,Yxe[n]);if(c.length>0)return Ks(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${K_.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 tbn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&rs(this.baseUri))??"",o=K_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(K_.sep)}getRelativeTestFolder(e,r,n,o){let s=K_.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=K_.extname(Ji(e)).replace(".",""),n=ff(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 Jxe(t){let e=Ji(t),r=K_.extname(e),n=Yxe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(Fqt.some(s=>e.endsWith(s+r))||e.startsWith(Uqt))}a(Jxe,"isTestFile");p();var Qqt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function rbn(t,e){let r=t.ctx,n=await wo.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(PA).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 sc(r),u=await tl(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:"";ua(r,new Qqt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(rbn,"parseUserQuery");p();p();p();p();var Ko=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 Ko(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Ko(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 nbn=250;function DA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/nbn)),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(DA,"getMaxChunks");var ibn=32e3,obn=2e4,Zxe=.75;p();p();function NA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(NA,"getFenceForCodeBlock");p();var j1n=de(Tl()),H1n=de(rh());p();var $C=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 d$o=Object.freeze({[$C.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[$C.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function tjt(t){return d$o[t.id]}a(tjt,"getWellKnownEmbeddingTypeInfo");function f$o(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:Xxe(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(Abn,"rankEmbeddings");p();p();var oF=de(nl()),q1n=de(rh());var HO=new fe("GitHubCodeSearch"),nYo=300*1e3,EZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new oF.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()},nYo)}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),HO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){HO.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(HO.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),HO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){HO.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,oF.raceTimeout)((async()=>{if(!await(0,oF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,oF.raceCancellationError)((0,oF.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 HO.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 Vf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return HO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return HO.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=Due(this._ctx),c=n.owner+"/"+n.name,l=await Vf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(HO.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=Due(this._ctx),u=await Vf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:oYo(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 iYo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Due(t){let e=t.get(Ir);return{"X-Client-Application":`${M1(e.getEditorInfo())}`,"X-Client-Source":M1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Due,"editorVersionHeaders");async function iYo(t,e,r){let o=[],s=new $C(e.embedding_model),c=Fs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=Ra(c,l.location.path)}catch(d){HO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:_Ze(l.chunk.text),rawText:void 0,range:new q1n.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(iYo,"parseGithubCodeSearchResponse");function oYo(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(oYo,"truncateToMaxUtf8Length");function _Ze(t){let e=sYo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` +`):t}a(_Ze,"stripChunkTextMetadata");function sYo(t){return t.split(/\r\n|\r|\n/)}a(sYo,"splitLines");var t2=de(nl()),G1n=de(Cue()),$1n=de(rm());var ywe=new fe("ChunkingEndpointClient"),DHt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new G1n.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 t2.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,t2.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,t2.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,t2.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){ywe.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{ywe.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{ywe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},vZe=class{constructor(e){this.ctx=e;this._requestLimiter=new DHt(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,t2.raceCancellationError)(n.getText(),l);if((0,$1n.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Due(this.ctx);return await Vf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:rs(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,t2.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){ywe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,j1n.coalesce)(h.chunks.map(m=>{let g=new H1n.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:_Ze(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 $C(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:_Ze(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){ywe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var pE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},h0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Wt.createAndMarkAsIssued(s,o);At(e,r,c),Rt(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};ua(e,n,r,o),ai(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,pE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,pE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,pE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,pE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,pE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,pE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,pE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,pE.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=Wt.createAndMarkAsIssued(o,{});At(e,r,s),Rt(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,pE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,pE.Aggregate,r)}};var V1n=de(Tl()),W1n=de(nl()),NHt=de(QO());var sF=new fe("Remote Search"),CZe=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(Cf),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 NHt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(sF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:DA(r)}),s.length===0)throw sF.error(this.ctx,"No GitHub repositories found"),h0.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 sF.error(this.ctx,"No GitHub session found"),h0.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 sF.error(this.ctx,"Remote index not ready for any repositories"),h0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=DA(r),d=Promise.all(l.map(async P=>{$h(n);let D=await e.resolveQuery(n),N=new NHt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return sF.info(this.ctx,`Search completed for ${P.owner}/${P.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);sF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,W1n.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{sF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{sF.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,V1n.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();sF.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 h0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var HIn=require("node:url"),GIn=require("path");p();var FZe=de(Y1n(),1);p();var MHt=new WeakMap;function Mue(...t){let e=new String(t);return MHt.set(e,t),e}a(Mue,"c");function aw(t){return t instanceof String&&MHt.has(t)}a(aw,"r");function Oue(t){return MHt.get(t)??[]}a(Oue,"o");var LZe=de(rSn(),1),DTn=require("child_process");var gIn=de(FHt(),1),xIn=require("node:path");p();function*nSn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(nSn,"U");var NYo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),MYo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),OYo=new Set(["edit","remove-section","rename-section","set","unset"]),LYo=new Set(["get","get-color","get-colorbool","list"]);function BYo(t,e){for(let{name:n}of nSn(t,"task")){if(NYo.has(n))return Uue(!0,e);if(MYo.has(n))return Uue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:OYo.has(r)?Uue(!0,e.slice(1)):LYo.has(r)?Uue(!1,e.slice(1)):e.length===1?Uue(!1,e):Uue(!0,e)}a(BYo,"F");function Uue(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(Uue,"p");function FYo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(FYo,"A");function UYo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(UYo,"M");function QYo(t){for(let{name:e}of nSn(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(QYo,"N");function qYo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(qYo,"G");function*jYo(t){for(let e of t){let r=qYo(e),n=r&&UYo(e.value);n&&(yield{...n,scope:r})}}a(jYo,"O");function HYo(t,e,r){let n={read:[],write:[...jYo(e)]};return t==="config"&&GYo(n,QYo(e),BYo(e,r)),n}a(HYo,"L");function GYo(t,e,r){if(r===null)return;let n=FYo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(GYo,"$");var iSn={short:new Map([["c",!0]])},$Yo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...iSn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},VYo={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"])}},WYo={short:new Map,long:new Set};function zYo(t){let e=VYo[t??""]??WYo;return{short:new Map([...iSn.short.entries(),...e.short.entries()]),long:e.long}}a(zYo,"I");function oSn(t,e=$Yo){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 YYo(t,e.short)}a(oSn,"b");function YYo(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(YYo,"W");function KYo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[aGt(t)[0]])(t=0)),e},"__init"),"__esm"),dKo=a((t,e)=>a(function(){return e||(0,t[aGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),nm=a((t,e)=>{for(var r in e)sGt(t,r,{get:e[r],enumerable:!0})},"__export"),fKo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of aGt(e))!uKo.call(t,o)&&o!==r&&sGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=lKo(e,o))||n.enumerable});return t},"__copyProps"),ih=a(t=>fKo(sGt({},"__esModule",{value:!0}),t),"__toCommonJS"),aF,Uq=Zr({"src/lib/errors/git-error.ts"(){"use strict";aF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),bwe,Hue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Uq(),bwe=class extends aF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),qSn,jSn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Uq(),qSn=class extends aF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function HSn(t){return typeof t!="function"?cJ:t}a(HSn,"asFunction");function GSn(t){return typeof t=="function"&&t!==cJ}a(GSn,"isUserFunction");function $Sn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a($Sn,"splitOn");function VSn(t,e=0){return WSn(t)&&t.length>e?t[e]:void 0}a(VSn,"first");function aJ(t,e=0){if(WSn(t)&&t.length>e)return t[t.length-1-e]}a(aJ,"last");function WSn(t){return jZe(t)}a(WSn,"isArrayLike");function Swe(t="",e=!0,r=` +`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(Swe,"toLinesWithContent");function cGt(t,e){return Swe(t,!0).map(r=>e(r))}a(cGt,"forEachLineWithContent");function lGt(t){return(0,FZe.exists)(t,FZe.FOLDER)}a(lGt,"folderExists");function uw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(uw,"append");function zSn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(zSn,"including");function UZe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(UZe,"remove");function GO(t){return Array.isArray(t)?t:[t]}a(GO,"asArray");function YSn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(YSn,"asCamelCase");function Gue(t){return GO(t).map(e=>e instanceof String?e:String(e))}a(Gue,"asStringArray");function Eu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Eu,"asNumber");function vwe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(KSn,"pick");function $Ht(t=0){return new Promise(e=>setTimeout(e,t))}a($Ht,"delay");function VHt(t){if(t!==!1)return t}a(VHt,"orVoid");var que,cJ,Twe,QZe=Zr({"src/lib/utils/util.ts"(){"use strict";uGt(),que="\0",cJ=a(()=>{},"NOOP"),Twe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function hE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(hE,"filterType");function WHt(t,e){let r=aw(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(WHt,"filterPrimitives");function qZe(t){return!!t&&Twe(t)==="[object Object]"}a(qZe,"filterPlainObject");function JSn(t){return typeof t=="function"}a(JSn,"filterFunction");var Iwe,ZSn,dp,MZe,jZe,uGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";QZe(),Iwe=a(t=>Array.isArray(t),"filterArray"),ZSn=a(t=>typeof t=="number","filterNumber"),dp=a(t=>typeof t=="string"||aw(t),"filterString"),MZe=a(t=>dp(t)||Array.isArray(t)&&t.every(dp),"filterStringOrStringArray"),jZe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),zHt,pKo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";zHt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(zHt||{})}}),OZe,hKo=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";OZe=class XSn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new XSn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function mKo(){throw new Error("LineParser:useMatches not implemented")}a(mKo,"useMatchesDefault");var Po,Fq,gKo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";Po=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=mKo,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))}},Fq=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 eTn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...tTn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(eTn,"createInstanceConfig");var tTn,AKo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";tTn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function dGt(t,e=[]){return qZe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(aw(o))r.push(o);else if(WHt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)WHt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(dGt,"appendTaskOptions");function X_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=Swe(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(JC,"parseStringResponse");var _Ko=Zr({"src/lib/utils/task-parser.ts"(){"use strict";QZe()}}),rTn={};nm(rTn,{ExitCodes:a(()=>zHt,"ExitCodes"),GitOutputStreams:a(()=>OZe,"GitOutputStreams"),LineParser:a(()=>Po,"LineParser"),NOOP:a(()=>cJ,"NOOP"),NULL:a(()=>que,"NULL"),RemoteLineParser:a(()=>Fq,"RemoteLineParser"),append:a(()=>uw,"append"),appendTaskOptions:a(()=>dGt,"appendTaskOptions"),asArray:a(()=>GO,"asArray"),asCamelCase:a(()=>YSn,"asCamelCase"),asFunction:a(()=>HSn,"asFunction"),asNumber:a(()=>Eu,"asNumber"),asStringArray:a(()=>Gue,"asStringArray"),bufferToString:a(()=>Cwe,"bufferToString"),callTaskParser:a(()=>YHt,"callTaskParser"),createInstanceConfig:a(()=>eTn,"createInstanceConfig"),delay:a(()=>$Ht,"delay"),filterArray:a(()=>Iwe,"filterArray"),filterFunction:a(()=>JSn,"filterFunction"),filterHasLength:a(()=>jZe,"filterHasLength"),filterNumber:a(()=>ZSn,"filterNumber"),filterPlainObject:a(()=>qZe,"filterPlainObject"),filterPrimitives:a(()=>WHt,"filterPrimitives"),filterString:a(()=>dp,"filterString"),filterStringOrStringArray:a(()=>MZe,"filterStringOrStringArray"),filterType:a(()=>hE,"filterType"),first:a(()=>VSn,"first"),folderExists:a(()=>lGt,"folderExists"),forEachLineWithContent:a(()=>cGt,"forEachLineWithContent"),getTrailingOptions:a(()=>X_,"getTrailingOptions"),including:a(()=>zSn,"including"),isUserFunction:a(()=>GSn,"isUserFunction"),last:a(()=>aJ,"last"),objectToString:a(()=>Twe,"objectToString"),orVoid:a(()=>VHt,"orVoid"),parseStringResponse:a(()=>JC,"parseStringResponse"),pick:a(()=>KSn,"pick"),prefixedArray:a(()=>vwe,"prefixedArray"),remove:a(()=>UZe,"remove"),splitOn:a(()=>$Sn,"splitOn"),toLinesWithContent:a(()=>Swe,"toLinesWithContent"),trailingFunctionArgument:a(()=>jd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>fGt,"trailingOptionsArgument")});var oo=Zr({"src/lib/utils/index.ts"(){"use strict";uGt(),pKo(),hKo(),gKo(),AKo(),EKo(),_Ko(),QZe()}}),nTn={};nm(nTn,{CheckRepoActions:a(()=>KHt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>oTn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>iTn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>vKo,"checkIsRepoTask")});function vKo(t){switch(t){case"bare":return oTn();case"root":return iTn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:HZe,parser:pGt}}a(vKo,"checkIsRepoTask");function iTn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:HZe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(iTn,"checkIsRepoRootTask");function oTn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:HZe,parser:pGt}}a(oTn,"checkIsBareRepoTask");function CKo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(CKo,"isNotRepoMessage");var KHt,HZe,pGt,sTn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),KHt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(KHt||{}),HZe=a(({exitCode:t},e,r,n)=>{if(t===128&&CKo(e))return r(Buffer.from("false"));n(e)},"onError"),pGt=a(t=>t.trim()==="true","parser")}});function bKo(t,e){let r=new aTn(t),n=t?lTn:cTn;return Swe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(uTn.test(s)?r.folders:r.files).push(s)}),r}a(bKo,"cleanSummaryParser");var aTn,cTn,lTn,uTn,SKo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),aTn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},cTn=/^[a-z]+\s*/i,lTn=/^[a-z]+\s+[a-z]+\s*/i,uTn=/\/$/}}),JHt={};nm(JHt,{EMPTY_COMMANDS:a(()=>GZe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>dTn,"adhocExecTask"),configurationErrorTask:a(()=>KC,"configurationErrorTask"),isBufferTask:a(()=>pTn,"isBufferTask"),isEmptyTask:a(()=>hTn,"isEmptyTask"),straightThroughBufferTask:a(()=>fTn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>ev,"straightThroughStringTask")});function dTn(t){return{commands:GZe,format:"empty",parser:t}}a(dTn,"adhocExecTask");function KC(t){return{commands:GZe,format:"empty",parser(){throw typeof t=="string"?new qSn(t):t}}}a(KC,"configurationErrorTask");function ev(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(ev,"straightThroughStringTask");function fTn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(fTn,"straightThroughBufferTask");function pTn(t){return t.format==="buffer"}a(pTn,"isBufferTask");function hTn(t){return t.format==="empty"||!t.commands.length}a(hTn,"isEmptyTask");var GZe,oh=Zr({"src/lib/tasks/task.ts"(){"use strict";jSn(),GZe=[]}}),mTn={};nm(mTn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>hGt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>mGt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>gGt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>kZe,"CleanOptions"),cleanTask:a(()=>gTn,"cleanTask"),cleanWithOptionsTask:a(()=>TKo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>IKo,"isCleanOptionsArray")});function TKo(t,e){let{cleanMode:r,options:n,valid:o}=xKo(t);return r?o.options?(n.push(...e),n.some(kKo)?KC(hGt):gTn(r,n)):KC(gGt+JSON.stringify(t)):KC(mGt)}a(TKo,"cleanWithOptionsTask");function gTn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return bKo(t==="n",n)}}}a(gTn,"cleanTask");function IKo(t){return Array.isArray(t)&&t.every(e=>AGt.has(e))}a(IKo,"isCleanOptionsArray");function xKo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{wKo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&RKo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(xKo,"getCleanOptions");function wKo(t){return t==="f"||t==="n"}a(wKo,"isCleanMode");function RKo(t){return/^-[a-z]$/i.test(t)&&AGt.has(t.charAt(1))}a(RKo,"isKnownOption");function kKo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(kKo,"isInteractiveMode");var hGt,mGt,gGt,kZe,AGt,ATn=Zr({"src/lib/tasks/clean.ts"(){"use strict";SKo(),oo(),oh(),hGt="Git clean interactive mode is not supported",mGt='Git clean mode parameter ("n" or "f") is required',gGt="Git clean unknown option found in: ",kZe=(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))(kZe||{}),AGt=new Set(["i",...Gue(Object.values(kZe))])}});function PKo(t){let e=new ETn;for(let r of yTn(t))e.addValue(r.file,String(r.key),r.value);return e}a(PKo,"configListParser");function DKo(t,e){let r=null,n=[],o=new Map;for(let s of yTn(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(DKo,"configGetParser");function NKo(t){return t.replace(/^(file):/,"")}a(NKo,"configFilePath");function*yTn(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=aJ(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 UHt(t,e){return typeof t=="string"&&Object.hasOwn(ZHt,t)?t:e}a(UHt,"asConfigScope");function OKo(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(OKo,"addConfigTask");function LKo(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 DKo(n,t)}}}a(LKo,"getConfigTask");function BKo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return PKo(r)}}}a(BKo,"listConfigTask");function FKo(){return{addConfig(t,e,...r){return this._runTask(OKo(t,e,r[0]===!0,UHt(r[1],"local")),jd(arguments))},getConfig(t,e){return this._runTask(LKo(t,UHt(e,void 0)),jd(arguments))},listConfig(...t){return this._runTask(BKo(UHt(t[0],void 0)),jd(arguments))}}}a(FKo,"config_default");var ZHt,_Tn=Zr({"src/lib/tasks/config.ts"(){"use strict";MKo(),oo(),ZHt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(ZHt||{})}});function UKo(t){return vTn.has(t)}a(UKo,"isDiffNameStatus");var QHt,vTn,CTn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";QHt=(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))(QHt||{}),vTn=new Set(Object.values(QHt))}});function QKo(...t){return new STn().param(...t)}a(QKo,"grepQueryBuilder");function qKo(t){let e=new Set,r={};return cGt(t,n=>{let[o,s,c]=n.split(que);e.add(o),(r[o]=r[o]||[]).push({line:Eu(s),path:o,preview:c})}),{paths:e,results:r}}a(qKo,"parseGrep");function jKo(){return{grep(t){let e=jd(arguments),r=X_(arguments);for(let o of bTn)if(r.includes(o))return this._runTask(KC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=QKo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return qKo(o)}},e)}}}a(jKo,"grep_default");var bTn,_we,uSn,STn,TTn=Zr({"src/lib/tasks/grep.ts"(){"use strict";oo(),oh(),bTn=["-h"],_we=Symbol("grepQuery"),STn=class{static{a(this,"GrepQuery")}constructor(){this[uSn]=[]}*[(uSn=_we,Symbol.iterator)](){for(let t of this[_we])yield t}and(...t){return t.length&&this[_we].push("--and","(",...vwe(t,"-e"),")"),this}param(...t){return this[_we].push(...vwe(t,"-e")),this}}}}),ITn={};nm(ITn,{ResetMode:a(()=>PZe,"ResetMode"),getResetMode:a(()=>GKo,"getResetMode"),resetTask:a(()=>HKo,"resetTask")});function HKo(t,e){let r=["reset"];return xTn(t)&&r.push(`--${t}`),r.push(...e),ev(r)}a(HKo,"resetTask");function GKo(t){if(xTn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(GKo,"getResetMode");function xTn(t){return typeof t=="string"&&wTn.includes(t)}a(xTn,"isValidResetMode");var PZe,wTn,RTn=Zr({"src/lib/tasks/reset.ts"(){"use strict";oo(),oh(),PZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(PZe||{}),wTn=Gue(Object.values(PZe))}});function $Ko(){return(0,LZe.default)("simple-git")}a($Ko,"createLog");function dSn(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(dSn,"prefixedLogger");function VKo(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(VKo,"childLoggerName");function yGt(t,e,r,n=$Ko()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=VKo(hE(e,dp),c,n);return d(r);function u(f,h){return uw(s,yGt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&dSn(c,h)||cJ,g=dSn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(yGt,"createLogger");var kTn=Zr({"src/lib/git-logger.ts"(){"use strict";oo(),LZe.default.formatters.L=t=>String(jZe(t)?t.length:"-"),LZe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Twe(t)}}),PTn,WKo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Uq(),kTn(),PTn=class XHt{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=XHt.getName(e.commands[0]),n=yGt(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 aF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++XHt.counter}`}static{this.counter=0}}}});function sJ(t,e){return{method:VSn(t.commands)||"",commands:e}}a(sJ,"pluginContext");function zKo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(zKo,"onErrorReceived");function fSn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(fSn,"onDataReceived");var eGt,YKo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Uq(),oh(),oo(),WKo(),eGt=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 PTn}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(hTn(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 aF?Object.assign(e,{task:t}):new aF(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","",sJ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...sJ(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),pTn(t)?YHt(t.parser,s):YHt(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},{...sJ(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",Twe(h)),u(new OZe(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 OZe(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},sJ(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,{...sJ(t,r),kill(m){f=m||f}});let h=(0,DTn.spawn)(e,r,c);h.stdout.on("data",fSn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",fSn(d,"stdErr",o,s.step("stdErr"))),h.on("error",zKo(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,{...sJ(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,{...sJ(t,e),kill(n){r=n||r}}),r}}}}),NTn={};nm(NTn,{GitExecutor:a(()=>MTn,"GitExecutor")});var MTn,KKo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";YKo(),MTn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new eGt(this,this._scheduler,this._plugins)}chain(){return new eGt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function JKo(t,e,r=cJ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof bwe?ZKo(s):s,void 0)},"onError2");e.then(n,o)}a(JKo,"taskCallback");function ZKo(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=cJ},"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(ZKo,"addDeprecationNoticeToError");var XKo=Zr({"src/lib/task-callback.ts"(){"use strict";Hue(),oo()}});function pSn(t,e){return dTn(r=>{if(!lGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(pSn,"changeWorkingDirectoryTask");var eJo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),oh()}});function qHt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=UZe(e,"-B")),ev(e)}a(qHt,"checkoutTask");function tJo(){return{checkout(){return this._runTask(qHt(X_(arguments,1)),jd(arguments))},checkoutBranch(t,e){return this._runTask(qHt(["-b",t,e,...X_(arguments)]),jd(arguments))},checkoutLocalBranch(t){return this._runTask(qHt(["-b",t,...X_(arguments)]),jd(arguments))}}}a(tJo,"checkout_default");var rJo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),oh()}});function nJo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(nJo,"countObjectsResponse");function iJo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return JC(nJo(),[OTn],t)}})}}}a(iJo,"count_objects_default");var OTn,oJo=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),OTn=new Po(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=YSn(e);Object.hasOwn(t,n)&&(t[n]=Eu(r))})}});function sJo(t){return JC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},LTn,t)}a(sJo,"parseCommitResult");var LTn,aJo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),LTn=[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 cJo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...vwe(t,"-m"),...e,...r],format:"utf-8",parser:sJo}}a(cJo,"commitTask");function lJo(){return{commit(e,...r){let n=jd(arguments),o=t(e)||cJo(GO(e),GO(hE(r[0],MZe,[])),[...Gue(hE(r[1],Iwe,[])),...X_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!MZe(e)&&KC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(lJo,"commit_default");var uJo=Zr({"src/lib/tasks/commit.ts"(){"use strict";aJo(),oo(),oh()}});function dJo(){return{firstCommit(){return this._runTask(ev(["rev-list","--max-parents=0","HEAD"],!0),jd(arguments))}}}a(dJo,"first_commit_default");var fJo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),oh()}});function pJo(t,e){let r=["hash-object",t];return e&&r.push("-w"),ev(r,!0)}a(pJo,"hashObjectTask");var hJo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";oh()}});function mJo(t,e,r){let n=String(r).trim(),o;if(o=BTn.exec(n))return new DZe(t,e,!1,o[1]);if(o=FTn.exec(n))return new DZe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new DZe(t,e,/^re/i.test(n),s)}a(mJo,"parseInit");var DZe,BTn,FTn,gJo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";DZe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},BTn=/^Init.+ repository in (.+)$/,FTn=/^Rein.+ in (.+)$/}});function AJo(t){return t.includes(EGt)}a(AJo,"hasBareCommand");function yJo(t=!1,e,r){let n=["init",...r];return t&&!AJo(n)&&n.splice(1,0,EGt),{commands:n,format:"utf-8",parser(o){return mJo(n.includes("--bare"),e,o)}}}a(yJo,"initTask");var EGt,EJo=Zr({"src/lib/tasks/init.ts"(){"use strict";gJo(),EGt="--bare"}});function _Gt(t){for(let e=0;eJC(new UTn,e,r,!1)}a(QTn,"getDiffParser");var jHt,hSn,mSn,gSn,qTn,jTn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";xwe(),vJo(),CTn(),oo(),jHt=[new Po(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Eu(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:Eu(r),after:Eu(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=Eu(e),t.insertions=Eu(n?.[1]),t.deletions=Eu(o?.[1])})],hSn=[new Po(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Eu(e),s=Eu(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})})],mSn=[new Po(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],gSn=[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:VHt(UKo(e)&&e),from:VHt(!!s&&n!==s&&n),similarity:Eu(r)})})],qTn={"":jHt,"--stat":jHt,"--numstat":hSn,"--name-status":gSn,"--name-only":mSn}}});function CJo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(CJo,"lineBuilder");function HTn(t=SGt,e=GTn,r=""){let n=QTn(r);return function(o){let s=Swe(o.trim(),!1,CGt).map(function(c){let l=c.split(bGt),u=CJo(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(HTn,"createListLogSummaryParser");var CGt,bGt,SGt,GTn,$Tn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),jTn(),xwe(),CGt="\xF2\xF2\xF2\xF2\xF2\xF2 ",bGt=" \xF2\xF2",SGt=" \xF2 ",GTn=["hash","date","message","refs","author_name","author_email"]}}),VTn={};nm(VTn,{diffSummaryTask:a(()=>bJo,"diffSummaryTask"),validateLogFormatConfig:a(()=>$Ze,"validateLogFormatConfig")});function bJo(t){let e=_Gt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),$Ze(r)||{commands:r,format:"utf-8",parser:QTn(e)}}a(bJo,"diffSummaryTask");function $Ze(t){let e=t.filter(_Jo);if(e.length>1)return KC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return KC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a($Ze,"validateLogFormatConfig");var TGt=Zr({"src/lib/tasks/diff.ts"(){"use strict";xwe(),jTn(),oh()}});function SJo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(SJo,"prettyFormat");function TJo(t){return Object.keys(t).reduce((e,r)=>(r in tGt||(e[r]=t[r]),e),{})}a(TJo,"userOptions");function WTn(t={},e=[]){let r=hE(t.splitter,dp,SGt),n=qZe(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]=SJo(n,r),c=[],l=[`--pretty=format:${CGt}${s}${bGt}`,...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 dp(t.file)&&l.push("--follow",Mue(t.file)),dGt(TJo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(WTn,"parseLogOptions");function IJo(t,e,r){let n=HTn(t,e,_Gt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(IJo,"logTask");function xJo(){return{log(...r){let n=jd(arguments),o=WTn(fGt(arguments),Gue(hE(arguments[0],Iwe,[]))),s=e(...r)||$Ze(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return IJo(r.splitter,r.fields,r.commands)}function e(r,n){return dp(r)&&dp(n)&&KC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(xJo,"log_default");var tGt,zTn=Zr({"src/lib/tasks/log.ts"(){"use strict";xwe(),$Tn(),oo(),oh(),TGt(),tGt=(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))(tGt||{})}}),NZe,YTn,wJo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";NZe=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}`}},YTn=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"}}}}),rGt,KTn,RJo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";rGt=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}}},KTn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function HHt(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(HHt,"objectEnumerationResult");function ASn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Eu(e&&e[1]||"0"),delta:Eu(r&&r[1]||"0")}}a(ASn,"asObjectCount");var JTn,kJo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),JTn=[new Fq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=HHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Fq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=HHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Fq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=HHt(t.remoteMessages);o.total=ASn(e),o.reused=ASn(r),o.packReused=Eu(n)})]}});function ZTn(t,e){return JC({remoteMessages:new eIn},XTn,e)}a(ZTn,"parseRemoteMessages");var XTn,eIn,tIn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),kJo(),XTn=[new Fq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...JTn,new Fq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Fq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Eu(e),summary:r,url:n}})],eIn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function PJo(t,e){let r=JC(new KTn,rIn,[t,e]);return r.message&&r}a(PJo,"parsePullErrorResult");var ySn,ESn,_Sn,vSn,rIn,CSn,IGt,nIn=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";RJo(),oo(),tIn(),ySn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,ESn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,_Sn=/^(create|delete) mode \d+ (.+)/,vSn=[new Po(ySn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Po(ESn,(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(_Sn,(t,[e,r])=>{uw(t.files,r),uw(e==="create"?t.created:t.deleted,r)})],rIn=[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})],CSn=a((t,e)=>JC(new rGt,vSn,[t,e]),"parsePullDetail"),IGt=a((t,e)=>Object.assign(new rGt,CSn(t,e),ZTn(t,e)),"parsePullResult")}}),bSn,iIn,SSn,DJo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";wJo(),oo(),nIn(),bSn=[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 NZe(e,r))}),new Po(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new NZe(e,r,{deleteRef:n}))}),new Po(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new NZe(e,null))}),new Po(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],iIn=a((t,e)=>Object.assign(SSn(t,e),IGt(t,e)),"parseMergeResult"),SSn=a(t=>JC(new YTn,bSn,t),"parseMergeDetail")}});function TSn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=iIn(e,r);if(n.failed)throw new bwe(n);return n}}:KC("Git.merge requires at least one option")}a(TSn,"mergeTask");var NJo=Zr({"src/lib/tasks/merge.ts"(){"use strict";Hue(),DJo(),oh()}});function MJo(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(MJo,"pushResultPushedItem");var ISn,oIn,xSn,OJo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),tIn(),ISn=[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(MJo(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}}})],oIn=a((t,e)=>{let r=xSn(t,e),n=ZTn(t,e);return{...r,...n}},"parsePushResult"),xSn=a((t,e)=>JC({pushed:[]},ISn,[t,e]),"parsePushDetail")}}),sIn={};nm(sIn,{pushTagsTask:a(()=>LJo,"pushTagsTask"),pushTask:a(()=>xGt,"pushTask")});function LJo(t={},e){return uw(e,"--tags"),xGt(t,e)}a(LJo,"pushTagsTask");function xGt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),UZe(r,"-v"),uw(r,"--verbose"),uw(r,"--porcelain"),{commands:r,format:"utf-8",parser:oIn}}a(xGt,"pushTask");var aIn=Zr({"src/lib/tasks/push.ts"(){"use strict";OJo(),oo()}});function BJo(){return{showBuffer(){let t=["show",...X_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(fTn(t),jd(arguments))},show(){let t=["show",...X_(arguments,1)];return this._runTask(ev(t),jd(arguments))}}}a(BJo,"show_default");var FJo=Zr({"src/lib/tasks/show.ts"(){"use strict";oo(),oh()}}),wSn,cIn,UJo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";wSn=/^(.+)\0(.+)$/,cIn=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=wSn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function RSn(t){let[e,r]=t.split(que);return{from:r||e,to:e}}a(RSn,"renamedFile");function tT(t,e,r){return[`${t}${e}`,r]}a(tT,"parser3");function GHt(t,...e){return e.map(r=>tT(t,r,(n,o)=>n.conflicted.push(o)))}a(GHt,"conflicts");function QJo(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=lIn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new cIn(c,o,s))}a(n,"data")}a(QJo,"splitLine");var kSn,lIn,uIn,qJo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),UJo(),kSn=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}},lIn=new Map([tT(" ","A",(t,e)=>t.created.push(e)),tT(" ","D",(t,e)=>t.deleted.push(e)),tT(" ","M",(t,e)=>t.modified.push(e)),tT("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),tT("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),tT("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),tT("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),tT("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),tT("R"," ",(t,e)=>{t.renamed.push(RSn(e))}),tT("R","M",(t,e)=>{let r=RSn(e);t.renamed.push(r),t.modified.push(r.to)}),tT("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),tT("?","?",(t,e)=>t.not_added.push(e)),...GHt("A","A","U"),...GHt("D","D","U"),...GHt("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=hE(l?.[1],dp,null),l=s.exec(e),t.tracking=hE(l?.[1],dp,null),l=c.exec(e),l&&(t.current=hE(l?.[1],dp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),uIn=a(function(t){let e=t.split(que),r=new kSn;for(let n=0,o=e.length;n!dIn.includes(r))],parser(r){return uIn(r)}}}a(jJo,"statusTask");var dIn,HJo=Zr({"src/lib/tasks/status.ts"(){"use strict";qJo(),dIn=["--null","-z"]}});function BZe(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(BZe,"versionResponse");function GJo(){return BZe(0,0,0,"",!1)}a(GJo,"notInstalledResponse");function $Jo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:VJo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(wGt));n(e)}})}}}a($Jo,"version_default");function VJo(t){return t===wGt?GJo():JC(BZe(0,0,0,t),fIn,t)}a(VJo,"versionParser");var wGt,fIn,WJo=Zr({"src/lib/tasks/version.ts"(){"use strict";oo(),wGt="installed=false",fIn=[new Po(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,BZe(Eu(e),Eu(r),Eu(n),o))}),new Po(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,BZe(Eu(e),Eu(r),n,o))})]}});function PSn(t,e,r,...n){return dp(r)?e(r,hE(n[0],dp),X_(arguments)):KC(`git.${t}() requires a string 'repoPath'`)}a(PSn,"createCloneTask");function zJo(){return{clone(t,...e){return this._runTask(PSn("clone",nGt,hE(t,dp),...e),jd(arguments))},mirror(t,...e){return this._runTask(PSn("mirror",pIn,hE(t,dp),...e),jd(arguments))}}}a(zJo,"clone_default");var nGt,pIn,YJo=Zr({"src/lib/tasks/clone.ts"(){"use strict";oh(),oo(),nGt=a((t,e,r)=>{let n=["clone",...r];return dp(t)&&n.push(Mue(t)),dp(e)&&n.push(Mue(e)),ev(n)},"cloneTask"),pIn=a((t,e,r)=>(uw(r,"--mirror"),nGt(t,e,r)),"cloneMirrorTask")}}),hIn={};nm(hIn,{SimpleGitApi:a(()=>iGt,"SimpleGitApi")});var iGt,KJo=Zr({"src/lib/simple-git-api.ts"(){"use strict";XKo(),eJo(),rJo(),oJo(),uJo(),_Tn(),fJo(),TTn(),hJo(),EJo(),zTn(),NJo(),aIn(),FJo(),HJo(),oh(),WJo(),oo(),YJo(),iGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&JKo(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(ev(["add",...GO(t)]),jd(arguments))}cwd(t){let e=jd(arguments);return typeof t=="string"?this._runTask(pSn(t,this._executor),e):typeof t?.path=="string"?this._runTask(pSn(t.path,t.root&&this._executor||void 0),e):this._runTask(KC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(pJo(t,e===!0),jd(arguments))}init(t){return this._runTask(yJo(t===!0,this._executor.cwd,X_(arguments)),jd(arguments))}merge(){return this._runTask(TSn(X_(arguments)),jd(arguments))}mergeFromTo(t,e){return dp(t)&&dp(e)?this._runTask(TSn([t,e,...X_(arguments)]),jd(arguments,!1)):this._runTask(KC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=xGt({remote:hE(arguments[0],dp),branch:hE(arguments[1],dp)},X_(arguments));return this._runTask(t,jd(arguments))}stash(){return this._runTask(ev(["stash",...X_(arguments)]),jd(arguments))}status(){return this._runTask(jJo(X_(arguments)),jd(arguments))}},Object.assign(iGt.prototype,tJo(),zJo(),lJo(),FKo(),iJo(),dJo(),jKo(),xJo(),BJo(),$Jo())}}),mIn={};nm(mIn,{Scheduler:a(()=>AIn,"Scheduler")});var DSn,AIn,JJo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),kTn(),DSn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,gIn.createDeferred)();return{promise:e,done:r,id:t}}})(),AIn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=yGt("","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=uw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),UZe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=uw(this.pending,DSn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),yIn={};nm(yIn,{applyPatchTask:a(()=>ZJo,"applyPatchTask")});function ZJo(t,e){return ev(["apply",...e,...t])}a(ZJo,"applyPatchTask");var XJo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";oh()}});function eZo(t,e){return{branch:t,hash:e,success:!0}}a(eZo,"branchDeletionSuccess");function tZo(t){return{branch:t,hash:null,success:!1}}a(tZo,"branchDeletionFailure");var EIn,rZo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";EIn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function _In(t,e){return e===1&&oGt.test(t)}a(_In,"hasBranchDeletionError");var NSn,oGt,MSn,VZe,nZo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";rZo(),oo(),NSn=/(\S+)\s+\(\S+\s([^)]+)\)/,oGt=/^error[^']+'([^']+)'/m,MSn=[new Po(NSn,(t,[e,r])=>{let n=eZo(e,r);t.all.push(n),t.branches[e]=n}),new Po(oGt,(t,[e])=>{let r=tZo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],VZe=a((t,e)=>JC(new EIn,MSn,[t,e]),"parseBranchDeletions")}}),vIn,iZo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";vIn=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 OSn(t){return t?t.charAt(0):""}a(OSn,"branchStatus");function CIn(t,e=!1){return JC(new vIn,e?[SIn]:bIn,t)}a(CIn,"parseBranchSummary");var bIn,SIn,oZo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";iZo(),oo(),bIn=[new Po(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(OSn(e),!0,r,n,o)}),new Po(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(OSn(e),!1,r,n,o)})],SIn=new Po(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),TIn={};nm(TIn,{branchLocalTask:a(()=>aZo,"branchLocalTask"),branchTask:a(()=>sZo,"branchTask"),containsDeleteBranchCommand:a(()=>IIn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>lZo,"deleteBranchTask"),deleteBranchesTask:a(()=>cZo,"deleteBranchesTask")});function IIn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(IIn,"containsDeleteBranchCommand");function sZo(t){let e=IIn(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?VZe(o,s).all[0]:CIn(o,r)}}}a(sZo,"branchTask");function aZo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return CIn(t)}}}a(aZo,"branchLocalTask");function cZo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return VZe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!_In(String(o),r))return c(o);s(n)}}}a(cZo,"deleteBranchesTask");function lZo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return VZe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!_In(String(c),n))return u(c);throw new bwe(r.parser(Cwe(s),Cwe(o)),String(c))}};return r}a(lZo,"deleteBranchTask");var uZo=Zr({"src/lib/tasks/branch.ts"(){"use strict";Hue(),nZo(),oZo(),oo()}});function dZo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,xIn.normalize)(e)}a(dZo,"toPath");var wIn,fZo=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";wIn=a(t=>t.split(/\n/g).map(dZo).filter(Boolean),"parseCheckIgnore")}}),RIn={};nm(RIn,{checkIgnoreTask:a(()=>pZo,"checkIgnoreTask")});function pZo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:wIn}}a(pZo,"checkIgnoreTask");var hZo=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";fZo()}});function mZo(t,e){return JC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},kIn,[t,e])}a(mZo,"parseFetchResult");var kIn,gZo=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),kIn=[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})})]}}),PIn={};nm(PIn,{fetchTask:a(()=>yZo,"fetchTask")});function AZo(t){return/^--upload-pack(=|$)/.test(t)}a(AZo,"disallowedCommand");function yZo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(AZo)?KC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:mZo}}a(yZo,"fetchTask");var EZo=Zr({"src/lib/tasks/fetch.ts"(){"use strict";gZo(),oh()}});function _Zo(t){return JC({moves:[]},DIn,t)}a(_Zo,"parseMoveResult");var DIn,vZo=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),DIn=[new Po(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),NIn={};nm(NIn,{moveTask:a(()=>CZo,"moveTask")});function CZo(t,e){return{commands:["mv","-v",...GO(t),e],format:"utf-8",parser:_Zo}}a(CZo,"moveTask");var bZo=Zr({"src/lib/tasks/move.ts"(){"use strict";vZo(),oo()}}),MIn={};nm(MIn,{pullTask:a(()=>SZo,"pullTask")});function SZo(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 IGt(o,s)},onError(o,s,c,l){let u=PJo(Cwe(o.stdOut),Cwe(o.stdErr));if(u)return l(new bwe(u));l(s)}}}a(SZo,"pullTask");var TZo=Zr({"src/lib/tasks/pull.ts"(){"use strict";Hue(),nIn(),oo()}});function IZo(t){let e={};return OIn(t,([r])=>e[r]={name:r}),Object.values(e)}a(IZo,"parseGetRemotes");function xZo(t){let e={};return OIn(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(xZo,"parseGetRemotesVerbose");function OIn(t,e){cGt(t,r=>e(r.split(/\s+/)))}a(OIn,"forEach");var wZo=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),LIn={};nm(LIn,{addRemoteTask:a(()=>RZo,"addRemoteTask"),getRemotesTask:a(()=>kZo,"getRemotesTask"),listRemotesTask:a(()=>PZo,"listRemotesTask"),remoteTask:a(()=>DZo,"remoteTask"),removeRemoteTask:a(()=>NZo,"removeRemoteTask")});function RZo(t,e,r){return ev(["remote","add",...r,t,e])}a(RZo,"addRemoteTask");function kZo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?xZo:IZo}}a(kZo,"getRemotesTask");function PZo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),ev(e)}a(PZo,"listRemotesTask");function DZo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),ev(e)}a(DZo,"remoteTask");function NZo(t){return ev(["remote","remove",t])}a(NZo,"removeRemoteTask");var MZo=Zr({"src/lib/tasks/remote.ts"(){"use strict";wZo(),oh()}}),BIn={};nm(BIn,{stashListTask:a(()=>OZo,"stashListTask")});function OZo(t={},e){let r=WTn(t),n=["stash","list",...r.commands,...e],o=HTn(r.splitter,r.fields,_Gt(n));return $Ze(n)||{commands:n,format:"utf-8",parser:o}}a(OZo,"stashListTask");var LZo=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";xwe(),$Tn(),TGt(),zTn()}}),FIn={};nm(FIn,{addSubModuleTask:a(()=>BZo,"addSubModuleTask"),initSubModuleTask:a(()=>FZo,"initSubModuleTask"),subModuleTask:a(()=>WZe,"subModuleTask"),updateSubModuleTask:a(()=>UZo,"updateSubModuleTask")});function BZo(t,e){return WZe(["add",t,e])}a(BZo,"addSubModuleTask");function FZo(t){return WZe(["init",...t])}a(FZo,"initSubModuleTask");function WZe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),ev(e)}a(WZe,"subModuleTask");function UZo(t){return WZe(["update",...t])}a(UZo,"updateSubModuleTask");var QZo=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";oh()}});function qZo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?UIn(t,e):0}a(qZo,"singleSorted");function UIn(t,e){return t===e?0:t>e?1:-1}a(UIn,"sorted");function jZo(t){return t.trim()}a(jZo,"trimmed");function RZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(RZe,"toNumber");var LSn,QIn,HZo=Zr({"src/lib/responses/TagList.ts"(){"use strict";LSn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},QIn=a(function(t,e=!1){let r=t.split(` +`).map(jZo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return qZo(RZe(c[0]),RZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new LSn(r,n)},"parseTagList")}}),qIn={};nm(qIn,{addAnnotatedTagTask:a(()=>VZo,"addAnnotatedTagTask"),addTagTask:a(()=>$Zo,"addTagTask"),tagListTask:a(()=>GZo,"tagListTask")});function GZo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return QIn(r,e)}}}a(GZo,"tagListTask");function $Zo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a($Zo,"addTagTask");function VZo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(VZo,"addAnnotatedTagTask");var WZo=Zr({"src/lib/tasks/tag.ts"(){"use strict";HZo()}}),zZo=dKo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(KKo(),ih(NTn)),{SimpleGitApi:n}=(KJo(),ih(hIn)),{Scheduler:o}=(JJo(),ih(mIn)),{adhocExecTask:s,configurationErrorTask:c}=(oh(),ih(JHt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),ih(rTn)),{applyPatchTask:E}=(XJo(),ih(yIn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(uZo(),ih(TIn)),{checkIgnoreTask:w}=(hZo(),ih(RIn)),{checkIsRepoTask:R}=(sTn(),ih(nTn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(ATn(),ih(mTn)),{diffSummaryTask:D}=(TGt(),ih(VTn)),{fetchTask:N}=(EZo(),ih(PIn)),{moveTask:L}=(bZo(),ih(NIn)),{pullTask:B}=(TZo(),ih(MIn)),{pushTagsTask:q}=(aIn(),ih(sIn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:j,remoteTask:Q,removeRemoteTask:U}=(MZo(),ih(LIn)),{getResetMode:Y,resetTask:W}=(RTn(),ih(ITn)),{stashListTask:V}=(LZo(),ih(BIn)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(QZo(),ih(FIn)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:ge}=(WZo(),ih(qIn)),{straightThroughBufferTask:Ue,straightThroughStringTask:ke}=(oh(),ih(JHt));function X(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(X,"Git2"),(X.prototype=Object.create(n.prototype)).constructor=X,X.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},X.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},X.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},X.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},X.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,Z){K.checkout(Z.latest,ee)})})},X.prototype.pull=function(ee,K,he,Z){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.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.")))},X.prototype.tags=function(ee,K){return this._runTask(ge(g(arguments)),A(arguments))},X.prototype.rebase=function(){return this._runTask(ke(["rebase",...g(arguments)]),A(arguments))},X.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},X.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(ke(["revert",...g(arguments,0,!0),ee]),K)},X.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},X.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},X.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},X.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},X.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].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.")))},X.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},X.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=X}});Uq();var YZo=class extends aF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Uq();Uq();var jue=class extends aF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Hue();jSn();sTn();ATn();_Tn();CTn();TTn();RTn();function KZo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new jue(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new jue(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(KZo,"abortPlugin");function JZo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of lSn(e,r))if(t[n.category]!==!0)throw new jue(void 0,"unsafe",n.message);return e}}}a(JZo,"blockUnsafeOperationsPlugin");oo();function ZZo(t){let e=vwe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(ZZo,"commandConfigPrefixingPlugin");oo();var BSn=(0,Que.deferred)().promise;function XZo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Que.deferred)(),closeTimeout:(0,Que.deferred)(),exit:(0,Que.deferred)(),exitTimeout:(0,Que.deferred)()},c=Promise.race([t===!1?BSn:s.closeTimeout.promise,e===!1?BSn: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(()=>$Ht(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 $Ht(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(XZo,"completionDetectionPlugin");oo();var eXo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",FSn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function tXo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(tXo,"isBadArgument");function USn(t,e){if(t.length<1||t.length>2)throw new jue(void 0,"binary",eXo);if(t.some(tXo))if(e)console.warn(FSn);else throw new jue(void 0,"binary",FSn);let[n,o]=t;return{binary:n,prefix:o}}a(USn,"toBinaryConfig");function rXo(t,e=["git"],r=!1){let n=USn(GO(e),r);t.on("binary",o=>{n=USn(GO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(rXo,"customBinaryPlugin");Uq();function nXo(t){return!!(t.exitCode&&t.stdErr.length)}a(nXo,"isTaskError");function iXo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(iXo,"getErrorMessage");function oXo(t=!1,e=nXo,r=iXo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(oXo,"errorDetectionHandler");function QSn(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 aF(void 0,n.toString("utf-8"))}:{error:n}}}}a(QSn,"errorDetectionPlugin");oo();var sXo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new jIn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=uw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return GO(t).forEach(r=>r&&this.plugins.add(uw(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 aXo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?zSn(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:cXo(u[1]),progress:Eu(u[2]),processed:Eu(u[3]),total:Eu(u[4])})})}}]}a(aXo,"progressMonitorPlugin");function cXo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(cXo,"progressEventStage");oo();function lXo(t){let e=KSn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(lXo,"spawnOptionsPlugin");function uXo({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 jue(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(uXo,"timeoutPlugin");function dXo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oaw(c)&&Oue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(dXo,"suffixPathsPlugin");oo();var fXo=zZo();function pXo(t,e){let r=new sXo,n=eTn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!lGt(n.baseDir))throw new YZo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(ZZo(n.config)),r.add(JZo(n.unsafe)),r.add(XZo(n.completion)),n.abort&&r.add(KZo(n.abort)),n.progress&&r.add(aXo(n.progress)),n.timeout&&r.add(uXo(n.timeout)),n.spawnOptions&&r.add(lXo(n.spawnOptions)),r.add(dXo()),r.add(QSn(oXo(!0))),n.errors&&r.add(QSn(n.errors)),rXo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new fXo(n,r)}a(pXo,"gitInstanceFactory");Hue();var $ue=pXo;var dw=new fe("Git Service");var zZe=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 dO()).path;n=$ue({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,GIn.join)(n,r);return Ks(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){dw.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){dw.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){dw.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){dw.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){dw.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 dw.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};dw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){dw.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){dw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,HIn.fileURLToPath)(e)}catch(r){dw.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 dw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var $In=de(nl());var r2=new fe("Local Diff Tracker");var YZe=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 zZe(e),this._repositoryManager=e.get(Cf),this._diffRefreshTimer=new $In.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{r2.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):r2.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){r2.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){r2.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)&&r2.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?r2.warn(this.ctx,n,o):r2.warn(this.ctx,n):o!==void 0?r2.debug(this.ctx,n,o):r2.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Qq;(n=>{function t(o){return new RGt(o)}n.ok=t,a(t,"ok");function e(o){return new kGt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Qq||={});var RGt=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}},kGt=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 PGt=new fe("GithubAvailableEmbeddingTypes"),KZe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Qq.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):Qq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Due(this._ctx);r=await Vf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return PGt.error(this._ctx,"Error fetching available embedding types",c),Qq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Qq.error({type:"unauthorized",status:r.status}):Qq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new $C(c.id);c.active===!1?s.push(l):o.push(l)}return Qq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){PGt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return PGt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var hXo=new fe("GithubEmbeddingComputer"),Vue=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){hXo.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 Vf(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 $C(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 wwe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var VIn=de(MA()),WIn=de(pU()),zIn=require("os"),DGt=de(require("path")),Wue=require("process");function JZe(t){let e=un(t.workspaceFolder.uri),r=(0,VIn.basename)(e),o=(0,WIn.SHA256)(e).toString().substring(0,8);return DGt.default.join(mXo(),"project-index",`${r}.${o}`)}a(JZe,"getWorkspaceCachePath");function mXo(){return Wue.env.XDG_CACHE_HOME&&DGt.default.isAbsolute(Wue.env.XDG_CACHE_HOME)?Wue.env.XDG_CACHE_HOME+"/github-copilot":(0,zIn.platform)()==="win32"?Wue.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Wue.env.HOME+"/.cache/github-copilot"}a(mXo,"getXdgCachePath");p();p();function YIn(t){if(tjt(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(NGt,"unpackEmbedding");p();var KIn=de(nl()),JIn=de(KP()),OGt=de(rh()),ZIn=de(require("fs")),LGt=de(require("node:sqlite")),BGt=de(require("path"));var MGt=new fe("WorkspaceChunkAndEmbeddingCache");async function XIn(t,e,r,n){return await FGt.create(t,e,r??":memory:",n)}a(XIn,"createWorkspaceChunkAndEmbeddingCache");var FGt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new JIn.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=BGt.default.join(n,"workspace-chunks.db");try{await ZIn.default.promises.mkdir(BGt.default.dirname(d),{recursive:!0}),c=new LGt.default.DatabaseSync(d,s),MGt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){MGt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new LGt.default.DatabaseSync(":memory:",s),MGt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-32768}; @@ -2854,20 +2854,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=RGt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new PGt.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 PGt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:RGt(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,$In.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,GIn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var YIn=de(Sl()),Iwe=de(nl()),KIn=de(eF());var VZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new KIn.Lazy(async()=>(this._cacheRoot=$Ze(this._workspaceFileIndex),await zIn(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 Twe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,Iwe.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,Iwe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return fbn(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 Twe,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,YIn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,Iwe.raceCancellationError)(this._cache.value,s),l=await(0,Iwe.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 JIn=de(nl()),ZIn=de(zP()),Wue=de(FO());var MA=new fe("Embeddings Search"),WZe=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 Fn.CancellationTokenSource;this._reindexRequests=new ZIn.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 Wue.StopWatch;MA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:PA(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(),Hh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Wue.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,PA(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}),f0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,fE.Aggregate),{chunks:d}}else{MA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),f0.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 Wue.StopWatch;MA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:PA(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}Hh(o);let d=new Wue.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,PA(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}),f0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,fE.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 VZe(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 Wue.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 Fn.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 JIn.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 wwe=de(uw());async function JZe(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 wwe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&xP(r.reason)))return wwe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!xP(r.reason))return wwe.Result.error({errorDiagMessage:r.reason+""});return wwe.Result.error({errorDiagMessage:"unknown error"})}a(JZe,"raceSearchOperations");var Rwe=de(uw()),kwe=de(nl());var fXo=2e3,pXo=.7,ixn=8e3,hXo=300,ZZe=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>fXo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>pXo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return Rwe.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 Rwe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,kwe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return Rwe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>hXo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return Rwe.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,kwe.raceTimeout)(u,ixn),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 JZe([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,kwe.raceTimeout)(u,ixn);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:Kxe(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 oxn=de(require("path")),sxn=require("worker_threads");var QGt=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 mXo(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(mXo,"createRpcProxy");var eXe=class{constructor(e,r,n){this.responseHandler=new QGt;this.worker=new sxn.Worker(e,r),CIe(this.worker,oxn.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=mXo((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 nXe=de(nl()),axn=de(eF()),cxn=de(Ro()),zue=de(FO()),lxn=require("fs"),tXe=de(require("path"));var rm=new fe("Tfidf Search"),gXo=100,rXe=class extends cxn.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 XZe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new axn.Lazy(()=>{let s=this.firstExistingPath([tXe.join(__dirname,"tfidfWorker.js"),tXe.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(ii).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)=>(rm.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(rm.error(r,u,...d),Promise.resolve()),"logError")};return new eXe(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(){rm.info(this.ctx,"Starting initialization...");let r=new zue.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return rm.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 zue.StopWatch;rm.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:PA(n)});try{if(await this.initialize(),this._isDisposed)throw f0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:PA(n),maxSpread:Yxe},l=await r.resolveQuery(o),u=new zue.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();rm.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Hh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,PA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return rm.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,fE.Aggregate),{chunks:h.chunks}}catch(c){throw rm.error(this.ctx,"TF-IDF search failed",c),f0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new zue.StopWatch;if(rm.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return rm.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:PA(n),maxSpread:Yxe},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));rm.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,PA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return rm.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,fE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new zue.StopWatch,l=[];if(rm.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new Fn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,nXe.raceTimeout)(h,f,()=>{rm.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,rm.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(rm.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){rm.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 rm.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),rm.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),rm.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new nXe.Limiter(gXo),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(Qo).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=$Ze(this._workspaceFileIndex);return tXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,lxn.existsSync)(n))return n}};p();p();p();var qGt=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 HGt(e,r))}static forPaths(e=!1){return new t(new iXe(void 0,!e))}static forStrings(){return new t(new qGt)}static forConfigKeys(){return new t(new jGt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);UUt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);UUt(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 Yue,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 Yue,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Yue,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Yue,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=sF.unwrap(o.value);o.value=sF.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 sF.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:UK(!1);case 1:UK(!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=sF.unwrap(n.value)||o,n=n.mid;else break}return n&&sF.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?sF.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,sF.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 uxn=de(nl()),dxn=de(require("fs")),fxn=de(ri());var AXo=1.5*1024*1024,GGt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new fxn.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}`}},sXe=class extends GGt{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(Qo).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(nc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=un(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,uxn.raceCancellationError)(yXo(r,AXo),this._disposedCts.token)}))}catch{return}}};async function yXo(t,e){return new Promise((r,n)=>{let o=dxn.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(yXo,"readLocalTextFileUsingReadStream");var aXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new $Gt;this._onDidCreateFiles=new Wi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Wi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Wi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=rs(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 sXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(zx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(nc);(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=rs(o.uri);s&&this._fsFileTree.addFile(s,new sXe(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(Qo).stat(e)).type}catch{return}}},$Gt=class{constructor(){this._tree=oXe.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 pxn=de(nl());var cXe=class extends HQ{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Wi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Wi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(US).addListener(this),this._fileReadLimiter=new pxn.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 aXe(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 Pwe=de(uw()),hxn=de(Sl()),dw=de(nl()),Uq=de(FO());var il=new fe("Semantic Search"),t2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new GZe(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 VGt(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)}},VGt=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 cXe(this._ctx),o=new mZe(this._ctx);this._localDiffSearch=new ZZe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new pZe(this._ctx),this._codeSearchChunkSearch=new gZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new WZe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new rXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new HZe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!IP(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);il.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:PA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw il.error(this._ctx,"Semantic search failed",l.err),f0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);il.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,dw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);il.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,PA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return il.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),f0.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){Hh(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(xP(n))throw n;return il.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new $ue(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){il.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,dw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new Uq.StopWatch;il.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,dw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,dw.raceCancellationError)((0,dw.raceTimeout)(u,n),c);if(d?.isOk())return il.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;il.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 JZe([u,f]);return il.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){il.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){il.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,dw.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),il.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){il.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),il.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){il.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),il.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 il.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return il.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),Pwe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new Uq.StopWatch;il.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,dw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(il.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),Pwe.Result.ok({strategy:e.id,result:c})):(il.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),Pwe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(xP(c))throw il.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return il.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),Pwe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,hxn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(nc).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){il.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,dw.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*Yxe,d=s.filter(f=>f.distance.value>=u);return il.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return xP(s)||il.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,dw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:Kxe(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,rs(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=DA(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=NGt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new OGt.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 OGt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:NGt(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,KIn.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,YIn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var exn=de(Tl()),Rwe=de(nl()),txn=de(rF());var ZZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new txn.Lazy(async()=>(this._cacheRoot=JZe(this._workspaceFileIndex),await XIn(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 wwe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,Rwe.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,Rwe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return Abn(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 wwe,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,exn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,Rwe.raceCancellationError)(this._cache.value,s),l=await(0,Rwe.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 rxn=de(nl()),nxn=de(KP()),zue=de(QO());var OA=new fe("Embeddings Search"),XZe=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 Fn.CancellationTokenSource;this._reindexRequests=new nxn.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(OA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){OA.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 zue.StopWatch;OA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:DA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw OA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),$h(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new zue.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,DA(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 OA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),h0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,pE.Aggregate),{chunks:d}}else{OA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),h0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return OA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new zue.StopWatch;OA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:DA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw OA.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){OA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}$h(o);let d=new zue.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,DA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return OA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),h0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,pE.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){OA.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?(OA.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 ZZe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),OA.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 zue.StopWatch;OA.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 Fn.CancellationTokenSource().token),this.setState("ready"),OA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){OA.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 rxn.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 Pwe=de(fw());async function nXe(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 Pwe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&RP(r.reason)))return Pwe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!RP(r.reason))return Pwe.Result.error({errorDiagMessage:r.reason+""});return Pwe.Result.error({errorDiagMessage:"unknown error"})}a(nXe,"raceSearchOperations");var Dwe=de(fw()),Nwe=de(nl());var IXo=2e3,xXo=.7,lxn=8e3,wXo=300,iXe=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>IXo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>xXo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return Dwe.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 Dwe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,Nwe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return Dwe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>wXo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return Dwe.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,Nwe.raceTimeout)(u,lxn),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 nXe([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,Nwe.raceTimeout)(u,lxn);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:Xxe(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 uxn=de(require("path")),dxn=require("worker_threads");var GGt=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 RXo(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(RXo,"createRpcProxy");var sXe=class{constructor(e,r,n){this.responseHandler=new GGt;this.worker=new dxn.Worker(e,r),TIe(this.worker,uxn.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=RXo((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 lXe=de(nl()),fxn=de(rF()),pxn=de(ko()),Yue=de(QO()),hxn=require("fs"),aXe=de(require("path"));var im=new fe("Tfidf Search"),kXo=100,cXe=class extends pxn.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 oXe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new fxn.Lazy(()=>{let s=this.firstExistingPath([aXe.join(__dirname,"tfidfWorker.js"),aXe.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(ni).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)=>(im.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(im.error(r,u,...d),Promise.resolve()),"logError")};return new sXe(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(){im.info(this.ctx,"Starting initialization...");let r=new Yue.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return im.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 Yue.StopWatch;im.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:DA(n)});try{if(await this.initialize(),this._isDisposed)throw h0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:DA(n),maxSpread:Zxe},l=await r.resolveQuery(o),u=new Yue.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();im.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),$h(o);let h=await this.applyEmbeddingReranking(l,d.chunks,DA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return im.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),h0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,pE.Aggregate),{chunks:h.chunks}}catch(c){throw im.error(this.ctx,"TF-IDF search failed",c),h0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new Yue.StopWatch;if(im.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return im.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:DA(n),maxSpread:Zxe},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));im.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,DA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return im.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),h0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,pE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new Yue.StopWatch,l=[];if(im.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new Fn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,lXe.raceTimeout)(h,f,()=>{im.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,im.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(im.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){im.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 im.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),im.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),im.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new lXe.Limiter(kXo),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(qo).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=JZe(this._workspaceFileIndex);return aXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,hxn.existsSync)(n))return n}};p();p();p();var $Gt=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 WGt(e,r))}static forPaths(e=!1){return new t(new uXe(void 0,!e))}static forStrings(){return new t(new $Gt)}static forConfigKeys(){return new t(new VGt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);HUt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);HUt(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 Kue,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 Kue,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Kue,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Kue,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=cF.unwrap(o.value);o.value=cF.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 cF.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:qK(!1);case 1:qK(!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=cF.unwrap(n.value)||o,n=n.mid;else break}return n&&cF.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?cF.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,cF.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 mxn=de(nl()),gxn=de(require("fs")),Axn=de(ei());var PXo=1.5*1024*1024,zGt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new Axn.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}`}},fXe=class extends zGt{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(qo).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(ic).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=un(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,mxn.raceCancellationError)(DXo(r,PXo),this._disposedCts.token)}))}catch{return}}};async function DXo(t,e){return new Promise((r,n)=>{let o=gxn.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(DXo,"readLocalTextFileUsingReadStream");var pXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new YGt;this._onDidCreateFiles=new Wi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Wi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Wi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=rs(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 fXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(Kx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(ic);(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=rs(o.uri);s&&this._fsFileTree.addFile(s,new fXe(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(qo).stat(e)).type}catch{return}}},YGt=class{constructor(){this._tree=dXe.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 yxn=de(nl());var hXe=class extends $Q{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Wi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Wi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(qS).addListener(this),this._fileReadLimiter=new yxn.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 pXe(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 Mwe=de(fw()),Exn=de(Tl()),pw=de(nl()),jq=de(QO());var il=new fe("Semantic Search"),n2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new KZe(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 KGt(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)}},KGt=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 hXe(this._ctx),o=new vZe(this._ctx);this._localDiffSearch=new iXe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new EZe(this._ctx),this._codeSearchChunkSearch=new CZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new XZe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new cXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new YZe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!wP(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 jq.StopWatch,s=await this.resolveQueryText(e,n);il.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:DA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw il.error(this._ctx,"Semantic search failed",l.err),h0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);il.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,pw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);il.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,DA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return il.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),h0.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){$h(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(RP(n))throw n;return il.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new Vue(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){il.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,pw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new jq.StopWatch;il.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,pw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,pw.raceCancellationError)((0,pw.raceTimeout)(u,n),c);if(d?.isOk())return il.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;il.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 jq.StopWatch,m=await nXe([u,f]);return il.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){il.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){il.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new jq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,pw.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),il.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){il.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new jq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),il.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){il.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new jq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),il.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 il.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return il.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),Mwe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new jq.StopWatch;il.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,pw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(il.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),Mwe.Result.ok({strategy:e.id,result:c})):(il.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),Mwe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(RP(c))throw il.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return il.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),Mwe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,Exn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(ic).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){il.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,pw.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*Zxe,d=s.filter(f=>f.distance.value>=u);return il.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return RP(s)||il.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,pw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:Xxe(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,rs(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=NA(e.text);return`File: \`${r}\` ${n} ${e.text} -${n}`}};var mxn=new fe("ProjectContextSkill"),q_d=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()})})}),EXo=47,WGt=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(aF);return}let r=[],n=this.turnContext.ctx.get(ii),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 IO(d.document,u,u),h=new Ar([l]),g=zxe(c)?.5:.8;r.push([`Code excerpt from file \`${rs(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Kue,c,td(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)}},aF="collect-project-context",lXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(mxn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(aF,"Collecting relevant project context"),IP(e.ctx)){await e.steps.error(aF,"Workspace indexing is disabled by configuration");return}await e.info(is`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(t2);if(!r){await e.steps.error(aF,"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(aF,"No workspace folders available for search");return}let o=Pn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??JCn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(aF,"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:XCn,maxResults:Math.min(10*c.length,EXo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??Iyn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(aF,"No project context found");return}return await e.steps.finish(aF),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(aF,"Project context search failed"),mxn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Kue="project-context",uXe=class extends gg{static{a(this,"ProjectContextSkill")}constructor(e){super(Kue,"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 WGt(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=>!IP(r))}};var zGt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Kue]}};async function ew(t){let e=[];return e.push(new CJe),e.push(...await t.get(WP).agents()),e.push(new zGt),e.push(new pJe),e}a(ew,"getAgents");p();p();var fw=require("fs"),aJ=de(require("path"));Mo();var p0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ft(this.ctx,Ye.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=aJ.dirname(o);await fw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` -`;await fw.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:Mt(),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 aJ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return aJ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await fw.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 fw.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 fw.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=aJ.dirname(o);await fw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${n}`}};var _xn=new fe("ProjectContextSkill"),svd=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()})})}),NXo=47,JGt=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(lF);return}let r=[],n=this.turnContext.ctx.get(ni),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 wO(d.document,u,u),h=new Ar([l]),g=Jxe(c)?.5:.8;r.push([`Code excerpt from file \`${rs(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Jue,c,rd(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)}},lF="collect-project-context",mXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(_xn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(lF,"Collecting relevant project context"),wP(e.ctx)){await e.steps.error(lF,"Workspace indexing is disabled by configuration");return}await e.info(is`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(n2);if(!r){await e.steps.error(lF,"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(lF,"No workspace folders available for search");return}let o=Pn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??rbn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(lF,"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:ibn,maxResults:Math.min(10*c.length,NXo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??Pyn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(lF,"No project context found");return}return await e.steps.finish(lF),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(lF,"Project context search failed"),_xn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Jue="project-context",gXe=class extends Ag{static{a(this,"ProjectContextSkill")}constructor(e){super(Jue,"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 JGt(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=>!wP(r))}};var ZGt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Jue]}};async function rw(t){let e=[];return e.push(new wJe),e.push(...await t.get(YP).agents()),e.push(new ZGt),e.push(new EJe),e}a(rw,"getAgents");p();p();var hw=require("fs"),lJ=de(require("path"));Oo();var m0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ft(this.ctx,Ye.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=lJ.dirname(o);await hw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` +`;await hw.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:Mt(),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 lJ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return lJ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await hw.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 hw.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 hw.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=lJ.dirname(o);await hw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` `)+` -`;await fw.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 aJ.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 fw.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 Xf({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=gxn(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 Xf({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 fw.promises.access(s)}catch{continue}await fw.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 Xf({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=gxn(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 Xf({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 fw.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 Axn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Axn,"createUserMessageEvent");function yxn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(yxn,"createUserMessageRenderedEvent");function dXe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(dXe,"createAssistantMessageEvent");function Exn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(Exn,"createToolExecutionStartEvent");function _xn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(_xn,"createToolExecutionCompleteEvent");function fXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Mt(),timestamp:new Date().toISOString(),parentId:e}}a(fXe,"createAssistantTurnStartEvent");function Jue(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Jue,"createAssistantTurnEndEvent");function gxn(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(gxn,"parseAssistantMessageContent");var cF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},HO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new p0(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 cF(`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 cF(`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 cF(`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 cF("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 cF(`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 cF(`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 cF||(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 Xf)return e;let r=e,n=new Xf(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=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});Et(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});Et(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});Et(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var vxn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +`;await hw.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 lJ.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 hw.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 tp({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=vxn(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 tp({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 hw.promises.access(s)}catch{continue}await hw.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 tp({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=vxn(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 tp({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 hw.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 Cxn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Cxn,"createUserMessageEvent");function bxn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(bxn,"createUserMessageRenderedEvent");function AXe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(AXe,"createAssistantMessageEvent");function Sxn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(Sxn,"createToolExecutionStartEvent");function Txn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(Txn,"createToolExecutionCompleteEvent");function yXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Mt(),timestamp:new Date().toISOString(),parentId:e}}a(yXe,"createAssistantTurnStartEvent");function Zue(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Zue,"createAssistantTurnEndEvent");function vxn(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(vxn,"parseAssistantMessageContent");var uF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},$O=class{constructor(e){this.ctx=e;this.transcriptPersistence=new m0(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 uF(`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 uF(`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 uF(`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 uF("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 uF(`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 uF(`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 uF||(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 tp)return e;let r=e,n=new tp(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=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});At(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});At(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});At(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var Ixn={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"}},Cxn="Alright, This response contains a code citation.";p();var bxn=` +<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},xxn="Alright, This response contains a code citation.";p();var wxn=` # Should render ## Links @@ -3077,16 +3077,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 Sxn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",_Xo=95,vXo={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 Txn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(Txn,"parseFirstNumber");function CXo(t){return Math.min(100,Math.max(0,t))}a(CXo,"clampPercentage");function bXo(t){return t.includes("session")?"session":"weekly"}a(bXo,"getRateLimitNotificationKind");function SXo(t,e,r){let n=Wle(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(SXo,"getRateLimitNotificationMessage");function TXo(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(TXo,"getRateLimitErrorVariant");var YGt=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 ih(Sxn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},ZGt=new YGt,KGt=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=bXo(n),s=CXo(Txn(n)??_Xo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=SXo(o,s,c);return await e.ctx.get(qS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new ih("Alright, I'm producing a rate limit notification")}},XGt=new KGt,JGt=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=TXo(n),s=Txn(n),c=$_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:vXo[o],isAuto:n.includes("auto")});return new ih(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},e$t=new JGt;p();function IXo(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(IXo,"createVulnerability");var xxn=wxe` +`;p();var Rxn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",MXo=95,OXo={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 kxn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(kxn,"parseFirstNumber");function LXo(t){return Math.min(100,Math.max(0,t))}a(LXo,"clampPercentage");function BXo(t){return t.includes("session")?"session":"weekly"}a(BXo,"getRateLimitNotificationKind");function FXo(t,e,r){let n=zle(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(FXo,"getRateLimitNotificationMessage");function UXo(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(UXo,"getRateLimitErrorVariant");var XGt=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 sh(Rxn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},r$t=new XGt,e$t=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=BXo(n),s=LXo(kxn(n)??MXo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=FXo(o,s,c);return await e.ctx.get(HS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new sh("Alright, I'm producing a rate limit notification")}},n$t=new e$t,t$t=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=UXo(n),s=kxn(n),c=W_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:OXo[o],isAuto:n.includes("auto")});return new sh(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},i$t=new t$t;p();function QXo(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(QXo,"createVulnerability");var Dxn=Pxe` 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. -`,pXe=wxe` +`,EXe=Pxe` \`\`\`kotlin fun main() { println("Hello, World!") } \`\`\` -`,xXo=wxe` +`,qXo=Pxe` ### Inputs \`p\` - paragraph message @@ -3102,20 +3102,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 -`,t$t=` +`,o$t=` -`,Ixn=xxn+t$t+pXe;function wxn(t){let e=1,r="",n=[];if(t.length===0)r=Ixn;else if(t==="0")r=Ixn,e=0;else{if(t==="help")return{reply:xXo,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+=xxn+t$t:s==="c"&&(r+=pXe+t$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(pXe,o);if(c===-1)break;let l=c+pXe.length;for(let u=0;u0?r:"Debug Fail")}},RXo=new r$t,n$t=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 ih("Alright, I'm producing a notification",void 0,[],s)}},kXo=new n$t,i$t=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 ih(wXo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},PXo=new i$t,o$t=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 ih(await M_n(e))}},DXo=new o$t,s$t=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[GP,lE]}instructions(e,r){return"Create a function that prints a christmas tree"}},NXo=new s$t,a$t=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 ih(Pn(e.turn.request.message))}},MXo=new a$t,c$t=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(Ag).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+=is` +`,Pxn=Dxn+o$t+EXe;function Nxn(t){let e=1,r="",n=[];if(t.length===0)r=Pxn;else if(t==="0")r=Pxn,e=0;else{if(t==="help")return{reply:qXo,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+=Dxn+o$t:s==="c"&&(r+=EXe+o$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(EXe,o);if(c===-1)break;let l=c+EXe.length;for(let u=0;u0?r:"Debug Fail")}},HXo=new s$t,a$t=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 sh("Alright, I'm producing a notification",void 0,[],s)}},GXo=new a$t,c$t=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 sh(jXo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},$Xo=new c$t,l$t=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 sh(await U_n(e))}},VXo=new l$t,u$t=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[VP,uE]}instructions(e,r){return"Create a function that prints a christmas tree"}},WXo=new u$t,d$t=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 sh(Pn(e.turn.request.message))}},zXo=new d$t,f$t=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(yg).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+=is` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new ih(o)}return new ih("No prompt available")}},OXo=new c$t,l$t=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 ih(await O_n(e,n,o))}},LXo=new l$t,u$t=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}=wxn(r);return e.turn.annotations.push(...o),new ih(n,void 0,e.turn.annotations)}},BXo=new u$t,d$t=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(vxn),new ih(Cxn,void 0,e.turn.annotations)}},FXo=new d$t,f$t=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 ih(bxn)}},UXo=new f$t,p$t=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"}},QXo=new p$t,h$t=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[Kue]}},qXo=new h$t,m$t=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 ih("Alright, I'm producing a notification",void 0,[],[],[],e)}},jXo=new m$t;function Rxn(){return[RXo,ZGt,XGt,e$t,kXo,PXo,NXo,DXo,MXo,OXo,LXo,BXo,FXo,jXo,UXo,QXo,qXo]}a(Rxn,"getDebugTemplates");p();var kxn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:Sf}))}),g$t=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Qq,e.uri,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Qq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Qq,"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)),Cq(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],[PS(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 xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},Qq="problems-in-active-document",hXe=class extends gg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Qq,"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 g$t(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 mXe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get($r).getWorkspaceFolder(e),n=this.fileExistFn(),o=new Wxe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=zxe(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(!zxe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new Wxe(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([[`${HXo} \`${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([[`${GXo} \`${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([[`${$Xo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(r2,e,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[PS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Qo).stat(e),!0}catch{return!1}}}},HXo="Code excerpt from the implementation source file",GXo="Code excerpt from the test file",$Xo="Code excerpt from an example test file";var Pxn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),A$t=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=new mXe(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(r2,e.testFileUri,td(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(r2,e.sourceFileUri,td(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(r2,e.sourceFileUri,td(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(r2,e.testFileUri,td(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},r2="test-context",gXe=class extends gg{static{a(this,"TestContextSkill")}constructor(e){super(r2,"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 A$t(r))}};p();var Dxn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:Sf}))}),y$t=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(cJ,"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(ii),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(cJ,s,td(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(` + `}),new sh(o)}return new sh("No prompt available")}},YXo=new f$t,p$t=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 sh(await Q_n(e,n,o))}},KXo=new p$t,h$t=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}=Nxn(r);return e.turn.annotations.push(...o),new sh(n,void 0,e.turn.annotations)}},JXo=new h$t,m$t=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(Ixn),new sh(xxn,void 0,e.turn.annotations)}},ZXo=new m$t,g$t=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 sh(wxn)}},XXo=new g$t,A$t=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"}},ees=new A$t,y$t=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[Jue]}},tes=new y$t,E$t=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 sh("Alright, I'm producing a notification",void 0,[],[],[],e)}},res=new E$t;function Mxn(){return[HXo,r$t,n$t,i$t,GXo,$Xo,WXo,VXo,zXo,YXo,KXo,JXo,ZXo,res,XXo,ees,tes]}a(Mxn,"getDebugTemplates");p();var Oxn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:If}))}),_$t=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Hq,e.uri,rd(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Hq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Hq,"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)),Tq(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],[DS(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 wo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},Hq="problems-in-active-document",_Xe=class extends Ag{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Hq,"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 _$t(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 vXe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get($r).getWorkspaceFolder(e),n=this.fileExistFn(),o=new Kxe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=Jxe(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(!Jxe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new Kxe(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([[`${nes} \`${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([[`${ies} \`${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([[`${oes} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ni),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(i2,e,rd(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[DS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(qo).stat(e),!0}catch{return!1}}}},nes="Code excerpt from the implementation source file",ies="Code excerpt from the test file",oes="Code excerpt from an example test file";var Lxn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),v$t=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=new vXe(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(i2,e.testFileUri,rd(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(i2,e.sourceFileUri,rd(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(i2,e.sourceFileUri,rd(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(i2,e.testFileUri,rd(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},i2="test-context",CXe=class extends Ag{static{a(this,"TestContextSkill")}constructor(e){super(i2,"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 v$t(r))}};p();var Bxn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:If}))}),C$t=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(uJ,"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(ni),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(uJ,s,rd(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([is`\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([` The code of file \`${r}\` is: -`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[PS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},cJ="test-failures",AXe=class extends gg{static{a(this,"TestFailuresSkill")}constructor(e){super(cJ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new y$t(r))}};var ih=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")}},pw=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}},VXo=new pw("tests","Generate unit tests","Generate Tests",is` +`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[DS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},uJ="test-failures",bXe=class extends Ag{static{a(this,"TestFailuresSkill")}constructor(e){super(uJ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new C$t(r))}};var sh=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")}},mw=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}},ses=new mw("tests","Generate unit tests","Generate Tests",is` 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. @@ -3126,7 +3126,7 @@ 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. - `,[r2,cJ],["chat-panel","agent-panel","editor"]),WXo=new pw("simplify","Simplify the code","Simplify This",is` + `,[i2,uJ],["chat-panel","agent-panel","editor"]),aes=new mw("simplify","Simplify the code","Simplify This",is` 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. @@ -3137,7 +3137,7 @@ The code of file \`${r}\` is: 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),zXo=new pw("fix","Fix problems and compile errors","Fix This",is` + Do not reply with the original code but only a simplified version.`,!0),ces=new mw("fix","Fix problems and compile errors","Fix This",is` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3148,13 +3148,13 @@ 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.`,[Qq],["editor","chat-panel","agent-panel","inline","inline-agent"],is` + At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[Hq],["editor","chat-panel","agent-panel","inline","inline-agent"],is` 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),YXo=new pw("explain","Explain how the code works","Explain This",is` + Briefly explain the problems without repeating the detailed error message.`,!0),les=new mw("explain","Explain how the code works","Explain This",is` 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. @@ -3162,14 +3162,14 @@ The code of file \`${r}\` is: 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),KXo=new pw("doc","Document the current selection or file","Generate Docs",is` + 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),ues=new mw("doc","Document the current selection or file","Generate Docs",is` 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"],is` 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),Nxn=new pw("create-agent","Create a new custom agent","Create Agent",is` + Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),Fxn=new mw("create-agent","Create a new custom agent","Create Agent",is` Help the user create a new custom agent file (a Markdown file with a \`.agent.md\` extension). A custom agent defines a specialized persona with its own description and allowed tools. @@ -3188,7 +3188,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),Mxn=new pw("create-skill","Create a new custom skill","Create Skill",is` + After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),Uxn=new mw("create-skill","Create a new custom skill","Create Skill",is` Help the user create a new custom skill. A skill is a folder containing a \`SKILL.md\` file that provides domain-specific knowledge or a reusable workflow the agent can load on demand. @@ -3206,7 +3206,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Oxn=new pw("create-instruction","Create a new instruction file","Create Instruction",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Qxn=new mw("create-instruction","Create a new instruction file","Create Instruction",is` Help the user create a new instructions file (a Markdown file with an \`.instructions.md\` extension). Instructions provide always-on guidance that Copilot applies when working on matching files. @@ -3224,7 +3224,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Lxn=new pw("create-prompt","Create a new prompt file","Create Prompt",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),qxn=new mw("create-prompt","Create a new prompt file","Create Prompt",is` Help the user create a new prompt file (a Markdown file with a \`.prompt.md\` extension). A prompt file is a reusable task the user can run later. @@ -3242,7 +3242,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Bxn=new pw("create-hook","Create a new hook configuration","Create Hook",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),jxn=new mw("create-hook","Create a new hook configuration","Create Hook",is` Help the user create a new hook configuration file (a JSON file under \`.github/hooks/\` with a \`.json\` extension). Hooks run shell scripts at specific agent lifecycle events — common uses include blocking dangerous @@ -3295,15 +3295,15 @@ The code of file \`${r}\` is: After the file is created, open it and briefly summarize what the hook does, which event it fires on, and how to test it (e.g. submitting a prompt for \`userPromptSubmitted\`, or running a tool that matches a - \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),E$t=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=SQt(e.conversation),n=is` + \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),b$t=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=wQt(e.conversation),n=is` 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 ih(n+` + `;return r?new sh(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 ih(n)}},JXo=new E$t,_$t=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=v$t(e.ctx).filter(o=>o!=this),n=is` +\`\`\``):new sh(n)}},des=new b$t,S$t=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=T$t(e.ctx).filter(o=>o!=this),n=is` 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(` @@ -3315,39 +3315,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 ih(n)}},ZXo=new _$t,Fxn=new Set([Nxn.id,Mxn.id,Oxn.id,Lxn.id,Bxn.id]);function n2(){return[VXo,WXo,zXo,YXo,KXo,Nxn,Mxn,Oxn,Lxn,Bxn,JXo,ZXo,...Rxn()]}a(n2,"getPromptTemplates");function v$t(t){let e=n2();return!kCe(t)&&!O1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(v$t,"getUserFacingPromptTemplates");var Uxn=de(require("path"));var C$t=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||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},Cg=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 dO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(un(o.uri));else if(o.type==="location")r.add(Uxn.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(`${WQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${WQ}${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()}async getPromptTemplate(e,r){let n=this.promptTemplatesCache?.get(e);return n?n.pluginUri!==void 0&&!r?.includePlugins?void 0:Promise.resolve(n):Promise.resolve(this.collectBufferedPrompts().find(o=>o.name===e))}async listCustomPrompts(e,r){let s=(await this.ctx.get(ug).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new C$t(u));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let c=[...s],l=new Set(s.map(u=>u.name));for(let u of this.collectBufferedPrompts())l.has(u.name)||(l.add(u.name),c.push(u));for(let u of c)this.promptTemplatesCache.set(u.name,u);return c}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r,n){return(await this.listCustomPrompts(e,n)).find(s=>s.name===r)}async applyPromptTemplateToRequest(e,r,n,o){let s=e.message.trim();if(!s.startsWith("/"))return!1;let[c,...l]=s.split(" "),u=c.replace("/",""),d=l.join(" ");if(!u)return!1;let f=r?.length?await this.getCustomPromptByName(r,u,o):await this.getPromptTemplate(u,o);if(f){if(f.uri.startsWith(WQ))return e.message=`Follow instructions: ${f.content} + `;return new sh(n)}},fes=new S$t,Hxn=new Set([Fxn.id,Uxn.id,Qxn.id,qxn.id,jxn.id]);function o2(){return[ses,aes,ces,les,ues,Fxn,Uxn,Qxn,qxn,jxn,des,fes,...Mxn()]}a(o2,"getPromptTemplates");function T$t(t){let e=o2();return!NCe(t)&&!O1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(T$t,"getUserFacingPromptTemplates");var Gxn=de(require("path"));var I$t=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||jle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return KQ(this.promptFileEntry.promptPath)}get providers(){return R3(this.promptFileEntry.promptPath.metadata)}},bg=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 pO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(un(o.uri));else if(o.type==="location")r.add(Gxn.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(`${YQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${YQ}${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()}async getPromptTemplate(e,r){let n=this.promptTemplatesCache?.get(e);return n?n.pluginUri!==void 0&&!r?.includePlugins?void 0:Promise.resolve(n):Promise.resolve(this.collectBufferedPrompts().find(o=>o.name===e))}async listCustomPrompts(e,r){let s=(await this.ctx.get(dg).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new I$t(u));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let c=[...s],l=new Set(s.map(u=>u.name));for(let u of this.collectBufferedPrompts())l.has(u.name)||(l.add(u.name),c.push(u));for(let u of c)this.promptTemplatesCache.set(u.name,u);return c}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r,n){return(await this.listCustomPrompts(e,n)).find(s=>s.name===r)}async applyPromptTemplateToRequest(e,r,n,o){let s=e.message.trim();if(!s.startsWith("/"))return!1;let[c,...l]=s.split(" "),u=c.replace("/",""),d=l.join(" ");if(!u)return!1;let f=r?.length?await this.getCustomPromptByName(r,u,o):await this.getPromptTemplate(u,o);if(f){if(f.uri.startsWith(YQ))return e.message=`Follow instructions: ${f.content} -${d}`,!0;e.message=`Follow instructions in [${f.name}](${f.uri}). ${d}`;let g=e.references??[];return g.some(A=>A.type==="file"&&A.uri===f.uri)||g.push({type:"file",uri:f.uri}),e.references=g,!0}if(!n)return!1;let h="inline",m=n2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var yXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},zo=class{constructor(e){this.ctx=e;this.conversations=new Cn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new lK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Yh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new yXe(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(HO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new lK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Yh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new yXe(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}`),At(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new p0(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"&&!GW.has(to(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!GW.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 p0(this.ctx);if(!n.isEnabled())return;let o=Axn(Pn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new p0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Pn(r.response.message),s=String(r.id),c=dXe(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=Jue(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Pn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"@");(await ew(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Pn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"/"),s=n2().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(Pn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Pn(n.request.message),"/"),l=await e.get(Cg).getPromptTemplate(o);l&&(l.uri.startsWith(WQ)?n.request.message=`Follow instructions: ${l.content} +${d}`,!0;e.message=`Follow instructions in [${f.name}](${f.uri}). ${d}`;let g=e.references??[];return g.some(A=>A.type==="file"&&A.uri===f.uri)||g.push({type:"file",uri:f.uri}),e.references=g,!0}if(!n)return!1;let h="inline",m=o2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var SXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Yo=class{constructor(e){this.ctx=e;this.conversations=new Cn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new pK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Jh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new SXe(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($O).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new pK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Jh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new SXe(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}`),Rt(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new m0(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"&&!zW.has(to(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!zW.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 m0(this.ctx);if(!n.isEnabled())return;let o=Cxn(Pn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new m0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Pn(r.response.message),s=String(r.id),c=AXe(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=Zue(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Pn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"@");(await rw(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Pn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"/"),s=o2().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(Pn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Pn(n.request.message),"/"),l=await e.get(bg).getPromptTemplate(o);l&&(l.uri.startsWith(YQ)?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(Yh).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 p0(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 EXe=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 _Xe=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 XXo="X-Initiator",ees="X-Interaction-ID",tes="X-Interaction-Type";var vXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},b$t=class extends vXe{static{a(this,"User")}static id(){return"user"}},S$t=class extends vXe{static{a(this,"Agent")}static id(){return"agent"}},T$t=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[XXo]:this.initiator,[ees]:this.interactionId,[tes]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return OA.agent(e??this.interactionType,this.interactionId)}},OA=class t extends T$t{static{a(this,"LlmInteraction")}static user(e,r){return new t(b$t,e,r)}static agent(e,r){return new t(S$t,e,r)}};function Qxn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(Qxn,"interactionTypeForChatMode");var hw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new I$t(this),this.steps=new _Xe(e,r,n,e.get(Tc)),this.collector=new x$t(r,n,e.get(Tc)),this.agentToolCalls=new EXe(e,r,n,e.get(Tc))}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 OA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?OA.agent(e,this.turn.telemetryId):OA.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(Tc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},CXe=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")}},Oxe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},I$t=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(zo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(Ag).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 CXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Yh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(Ag).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof CXe||o instanceof Oxe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},x$t=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 res={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function qxn(t){let e=Ft(t,Ye.AutoCompress);return{...res,enabled:e}}a(qxn,"getAutomaticCompressionConfig");p();var qq=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(gs).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=Pn(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=Pn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),TK(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 ZC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new qq}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=qxn(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=Wt.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});Et(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Wt.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});Et(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Wt.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});Et(this.ctx,"automaticCompression.triggered",l,0)}};p();var LA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var qd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var bXe=de(ale());var jxn=new Map;function hE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(hE,"createNumberRange");function w$t(t){return[...t].sort((e,r)=>r.length-e.length)}a(w$t,"sortByStringLengthDesc");async function nes(t){let e=jxn.get(t);if(e)return e;let r=(async()=>{try{let n=await k$e(`tree-sitter-${t}.wasm`);return await bXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return jxn.set(t,r),r}a(nes,"loadShellLanguage");function Hxn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(Hxn,"isPowerShell");var ies=new Map([["sh",w$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",w$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",w$t([...hE(1,6).concat("*","").flatMap(t=>hE(1,6).map(e=>`${t}>&${e}`)),...hE(1,6).concat("*","").map(t=>`${t}>>`),...hE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function oes(t,e){let r,n=e.replace(/\.exe$/,"");Hxn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=ies.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(oes,"splitCommandLineIntoSubCommands");async function SXe(t,e){try{let r;Hxn(e)?r="powershell":r="bash",await bXe.default.init();let n,o;try{n=new bXe.default;let s=await nes(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 oes(t,e)}}a(SXe,"extractSubCommandsWithTreeSitter");var ses=new Set(["sudo","env"]),aes=/^[A-Za-z_][A-Za-z0-9_]*=/;function R$t(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(aes.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||ses.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(R$t,"extractCommandNameFromSubCommand");var Zue=new fe("CommandLineAutoApprover"),Gxn=/(?!.*)/,ces=/^[A-Z_][A-Z0-9_]*=/i,tT=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(ces.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 SXe(e,r);Zue.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 Zue.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 Zue.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Zue.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await SXe(e,r),o=[...new Set(n.map(R$t).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await SXe(e,r),o=n.map(s=>R$t(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})}}}),Zue.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Zue.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)?Gxn:c}catch{return Gxn}}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 TXe=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 IXe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ii).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var xXe=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=les(this.stdout)}static{a(this,"CommandHookResult")}};function les(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(les,"parseOutput");var D$t=require("child_process");var wXe=new fe("HookExecutor"),RXe=class{constructor(){this.handlers=[new k$t,new P$t]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(tp).isTrusted(r.source)){wXe.warn(e,`Refusing to execute hook from untrusted workspace folder: ${r.source}`);return}for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){wXe.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}wXe.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},kXe=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"&&wXe.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 xXe(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"]}}},k$t=class extends kXe{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,D$t.spawn)(e.bash,[],n)}},P$t=class extends kXe{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,D$t.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var ues=new RXe,XC=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 ues.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var lF=class extends XC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var i2=class extends XC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var Xue={allow:"allow",deny:"deny",ask:"ask"},o2=class extends XC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var lJ=class extends XC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var uJ=class extends XC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var s2=class extends XC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var dJ=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();p();function fJ(t){try{return!(!Ft(t,Ye.EnableHooks)||t.get(jl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(fJ,"hooksEnabled");var des=".github/hooks/**/*.json",fes="agentHook.execution",pes={sessionStart:uJ,sessionEnd:lJ,userPromptSubmitted:s2,preToolUse:o2,postToolUse:i2,errorOccurred:lF},mE=class{constructor(e){this.logger=new fe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(wA).register("hook",[des]),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&&At(e,fes,{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(ug).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=fJ(this.ctx);return e||this.logger.debug(this.ctx,"Hooks are disabled by configuration or customHook.enabled policy."),e}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);this.lastEnableHooks=Ft(this.ctx,Ye.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(jl);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(a0).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(pes).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(ug).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 BA(t){return`[${Ji(t)}](${t})`}a(BA,"formatUriForFileWidget");function id(t,e){let r=hes(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(id,"resolvePathInput");function hes(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 GW.has(s)||la.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(la.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||$xn()&&ges(t)||$xn()&&t.startsWith("\\\\"))return Ks(t)}a(hes,"resolveFsUri");function $xn(){return process.platform==="win32"}a($xn,"isWindows");function mes(t){return t>=65&&t<=90||t>=97&&t<=122}a(mes,"isWindowsDriveLetter");function ges(t){return mes(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(ges,"hasDriveLetter");function GO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Rr?r.value:r instanceof _K?"":r instanceof KQ?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(GO,"parseToolResultToString");function PXe(t){let{content:e}=t;return{message:GO(e)}}a(PXe,"formatToolErrorResult");function Vxn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Rr?{type:"text",value:n.value}:n instanceof _K?{type:"text",value:""}:n instanceof KQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof JQ&&(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(Vxn,"formatToolSuccessResult");function pJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(pJ,"extractShellFromToolDescription");var DXe=new fe("HookTrigger"),ede=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(mE),c=o?new dJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,o2,{timestamp:Date.now(),cwd:un(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 DXe.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(mE),l=s?new dJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,i2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:GO(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){DXe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(mE),o=this.extractPromptFromMessage(e),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,s2,{timestamp:Date.now(),cwd:un(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){DXe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(mE),o=Ft(this.ctx,Ye.HookErrorOccurredStackTrace),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,lF,{timestamp:Date.now(),cwd:un(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){DXe.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===Xue.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 N$t=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Nwe=class extends N$t{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var hJ=de(Io());var Hn=class t extends hJ.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(hJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,hJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(M$t,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},M$t=class extends hJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function Wxn(){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(Wxn,"renderAskModeInstructionBody");p();p();var jq=class extends lr{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 NXe=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var zxn=require("path");var MXe=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,zxn.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(gs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=pJ(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 lr{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` - ${la.isRegisteredScheme(l.scheme)?c.uri:rs(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 Yxn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(Yxn,"partsLength");async function Jxn(t,e=1/0,r){let n=Kxn(0,t,e),o=e-Yxn(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 Aes();let d=Kxn(l.level+1,u,o-1);d.length&&(s=!0,o-=Yxn(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(Jxn,"visualFileTree");function Kxn(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(Kxn,"toParts");var Aes=a(()=>({tree:"",files:[]}),"emptyTree");p();async function OXe(t,e){let r=to(e);return la.isRegisteredScheme(r.scheme)?(await t.get(la).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Qo).readDirectory(e)}a(OXe,"readDirectory");var yes=new fe("fileReferencesPrompt");async function Zxn(t,e,r,n){let o=await Xxn(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=la.isRegisteredScheme(f.scheme)?u:un(u);s+=`${l} (Absolute Path: ${h})/ +${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(Jh).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 m0(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 TXe=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 IXe=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 pes="X-Initiator",hes="X-Interaction-ID",mes="X-Interaction-Type";var xXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},x$t=class extends xXe{static{a(this,"User")}static id(){return"user"}},w$t=class extends xXe{static{a(this,"Agent")}static id(){return"agent"}},R$t=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[pes]:this.initiator,[hes]:this.interactionId,[mes]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return LA.agent(e??this.interactionType,this.interactionId)}},LA=class t extends R$t{static{a(this,"LlmInteraction")}static user(e,r){return new t(x$t,e,r)}static agent(e,r){return new t(w$t,e,r)}};function $xn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a($xn,"interactionTypeForChatMode");var gw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new k$t(this),this.steps=new IXe(e,r,n,e.get(Tc)),this.collector=new P$t(r,n,e.get(Tc)),this.agentToolCalls=new TXe(e,r,n,e.get(Tc))}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 LA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?LA.agent(e,this.turn.telemetryId):LA.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(Tc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},wXe=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")}},Fxe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},k$t=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Yo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(yg).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 wXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Jh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(yg).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof wXe||o instanceof Fxe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},P$t=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 ges={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function Vxn(t){let e=Ft(t,Ye.AutoCompress);return{...ges,enabled:e}}a(Vxn,"getAutomaticCompressionConfig");p();var Gq=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(gs).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=Pn(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=Pn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),xK(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 ZC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new Gq}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=Vxn(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=Wt.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});At(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Wt.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});At(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Wt.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});At(this.ctx,"automaticCompression.triggered",l,0)}};p();var BA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Hd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var RXe=de(cle());var Wxn=new Map;function mE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(mE,"createNumberRange");function D$t(t){return[...t].sort((e,r)=>r.length-e.length)}a(D$t,"sortByStringLengthDesc");async function Aes(t){let e=Wxn.get(t);if(e)return e;let r=(async()=>{try{let n=await O$e(`tree-sitter-${t}.wasm`);return await RXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return Wxn.set(t,r),r}a(Aes,"loadShellLanguage");function zxn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(zxn,"isPowerShell");var yes=new Map([["sh",D$t([...mE(1,9).concat("").map(t=>`${t}<<<`),...mE(1,9).concat("").flatMap(t=>mE(1,9).map(e=>`${t}>&${e}`)),...mE(1,9).concat("").map(t=>`${t}<>`),...mE(1,9).concat("&","").map(t=>`${t}>>`),...mE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",D$t([...mE(1,9).concat("").map(t=>`${t}<<<`),...mE(1,9).concat("").flatMap(t=>mE(1,9).map(e=>`${t}>&${e}`)),...mE(1,9).concat("").map(t=>`${t}<>`),...mE(1,9).concat("&","").map(t=>`${t}>>`),...mE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",D$t([...mE(1,6).concat("*","").flatMap(t=>mE(1,6).map(e=>`${t}>&${e}`)),...mE(1,6).concat("*","").map(t=>`${t}>>`),...mE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function Ees(t,e){let r,n=e.replace(/\.exe$/,"");zxn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=yes.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(Ees,"splitCommandLineIntoSubCommands");async function kXe(t,e){try{let r;zxn(e)?r="powershell":r="bash",await RXe.default.init();let n,o;try{n=new RXe.default;let s=await Aes(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 Ees(t,e)}}a(kXe,"extractSubCommandsWithTreeSitter");var _es=new Set(["sudo","env"]),ves=/^[A-Za-z_][A-Za-z0-9_]*=/;function N$t(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(ves.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||_es.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(N$t,"extractCommandNameFromSubCommand");var Xue=new fe("CommandLineAutoApprover"),Yxn=/(?!.*)/,Ces=/^[A-Z_][A-Z0-9_]*=/i,nT=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(Ces.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 kXe(e,r);Xue.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 Xue.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 Xue.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Xue.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await kXe(e,r),o=[...new Set(n.map(N$t).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await kXe(e,r),o=n.map(s=>N$t(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})}}}),Xue.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Xue.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)?Yxn:c}catch{return Yxn}}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 PXe=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 DXe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ni).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var NXe=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=bes(this.stdout)}static{a(this,"CommandHookResult")}};function bes(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(bes,"parseOutput");var L$t=require("child_process");var MXe=new fe("HookExecutor"),OXe=class{constructor(){this.handlers=[new M$t,new O$t]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(np).isTrusted(r.source)){MXe.warn(e,`Refusing to execute hook from untrusted workspace folder: ${r.source}`);return}for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){MXe.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}MXe.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},LXe=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"&&MXe.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 NXe(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"]}}},M$t=class extends LXe{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,L$t.spawn)(e.bash,[],n)}},O$t=class extends LXe{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,L$t.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var Ses=new OXe,XC=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 Ses.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var dF=class extends XC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var s2=class extends XC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var ede={allow:"allow",deny:"deny",ask:"ask"},a2=class extends XC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var dJ=class extends XC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var fJ=class extends XC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var c2=class extends XC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var pJ=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();p();function hJ(t){try{return!(!Ft(t,Ye.EnableHooks)||t.get(Hl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(hJ,"hooksEnabled");var Tes=".github/hooks/**/*.json",Ies="agentHook.execution",xes={sessionStart:fJ,sessionEnd:dJ,userPromptSubmitted:c2,preToolUse:a2,postToolUse:s2,errorOccurred:dF},gE=class{constructor(e){this.logger=new fe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(RA).register("hook",[Tes]),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&&Rt(e,Ies,{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(dg).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=hJ(this.ctx);return e||this.logger.debug(this.ctx,"Hooks are disabled by configuration or customHook.enabled policy."),e}subscribeToGateChanges(){try{let e=this.ctx.get(Bo);this.lastEnableHooks=Ft(this.ctx,Ye.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(Hl);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(l0).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(xes).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(dg).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 FA(t){return`[${Ji(t)}](${t})`}a(FA,"formatUriForFileWidget");function od(t,e){let r=wes(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(od,"resolvePathInput");function wes(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 zW.has(s)||da.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(da.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||Kxn()&&kes(t)||Kxn()&&t.startsWith("\\\\"))return Ks(t)}a(wes,"resolveFsUri");function Kxn(){return process.platform==="win32"}a(Kxn,"isWindows");function Res(t){return t>=65&&t<=90||t>=97&&t<=122}a(Res,"isWindowsDriveLetter");function kes(t){return Res(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(kes,"hasDriveLetter");function VO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Rr?r.value:r instanceof bK?"":r instanceof ZQ?JSON.stringify(r.value):"").join(` +`)),e===""?"(empty)":e}a(VO,"parseToolResultToString");function BXe(t){let{content:e}=t;return{message:VO(e)}}a(BXe,"formatToolErrorResult");function Jxn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Rr?{type:"text",value:n.value}:n instanceof bK?{type:"text",value:""}:n instanceof ZQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof XQ&&(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(Jxn,"formatToolSuccessResult");function mJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(mJ,"extractShellFromToolDescription");var FXe=new fe("HookTrigger"),tde=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(gE),c=o?new pJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,a2,{timestamp:Date.now(),cwd:un(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 FXe.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(gE),l=s?new pJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,s2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:VO(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){FXe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(gE),o=this.extractPromptFromMessage(e),s=r?new pJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,c2,{timestamp:Date.now(),cwd:un(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){FXe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(gE),o=Ft(this.ctx,Ye.HookErrorOccurredStackTrace),s=r?new pJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,dF,{timestamp:Date.now(),cwd:un(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){FXe.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===ede.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 B$t=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Lwe=class extends B$t{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var gJ=de(xo());var Hn=class t extends gJ.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(gJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,gJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> +`)),vscpp(F$t,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},F$t=class extends gJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function Zxn(){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(Zxn,"renderAskModeInstructionBody");p();p();var $q=class extends lr{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 UXe=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var Xxn=require("path");var QXe=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,Xxn.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(gs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=mJ(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 Vq=class extends lr{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` - ${da.isRegisteredScheme(l.scheme)?c.uri:rs(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 ewn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(ewn,"partsLength");async function rwn(t,e=1/0,r){let n=twn(0,t,e),o=e-ewn(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 Pes();let d=twn(l.level+1,u,o-1);d.length&&(s=!0,o-=ewn(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(rwn,"visualFileTree");function twn(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(twn,"toParts");var Pes=a(()=>({tree:"",files:[]}),"emptyTree");p();async function qXe(t,e){let r=to(e);return da.isRegisteredScheme(r.scheme)?(await t.get(da).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(qo).readDirectory(e)}a(qXe,"readDirectory");var Des=new fe("fileReferencesPrompt");async function nwn(t,e,r,n){let o=await iwn(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=da.isRegisteredScheme(f.scheme)?u:un(u);s+=`${l} (Absolute Path: ${h})/ `;for(let m of d.tree.split(` `))s+=` ${m} -`}let c=DA(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(Zxn,"generateWorkspaceStructurePrompt");async function Xxn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await Jxn(await ewn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(Xxn,"generateWorkspaceStructure");async function ewn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await OXe(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=wa(e,s);return!la.isRegisteredScheme(to(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||ves(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>ewn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(ewn,"buildFileList");var Ees=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],_es=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function ves(t){return!!(_es.includes(Ji(t).toLowerCase())||rs(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>Ees.includes(r)))}a(ves,"shouldAlwaysIgnoreFile");async function LXe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ji(c.uri)})),o=await Xxn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${un(l)})`),s.push(u.tree),s.push("");return s}catch(n){return yes.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(LXe,"processDirectoryReferences");var tde=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await Zxn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||Fn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var twn=de(Io());var Mwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(twn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:this.props.ctx}),vscpp(MXe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(tde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(NXe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var BXe=de(require("path"));function L$t(t){let e=Ft(t,Ye.EnableSkills),r=t.get(jl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(L$t,"isSkillsEnabled");var O$t=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(uf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},h0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new fe("CustomSkillService");this._onDidChangeSkillsEnabled=new ep;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.WORKSPACE_AGENTS_SKILLS=".agents/skills/**/SKILL.md"}static{this.WORKSPACE_GITHUB_SKILLS=".github/skills/**/SKILL.md"}static{this.GLOBAL_AGENTS_SKILLS="~/.agents/skills/**/SKILL.md"}static{this.GLOBAL_COPILOT_SKILLS="~/.copilot/skills/**/SKILL.md"}static{this.CLAUDE_SKILL_PATTERNS=[".claude/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_PATTERNS_BY_PROVIDER={LOCAL:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],BACKGROUND:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],CLAUDE:t.CLAUDE_SKILL_PATTERNS}}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(jl);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(a0).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.disposeSkillPatterns(),this._onDidChangeSkillsEnabled.dispose()}disposeSkillPatterns(){for(let e of this.registrySkillPatterns)try{e.dispose()}catch{}this.registrySkillPatterns=[]}skipIfSkillsEnabledUnchanged(e){let r=Ft(this.ctx,Ye.EnableSkills);return()=>{let n=Ft(this.ctx,Ye.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return L$t(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Ft(this.ctx,Ye.EnableSkills))return;let e=new Map;for(let r of Object.keys(t.SKILL_PATTERNS_BY_PROVIDER))for(let n of t.SKILL_PATTERNS_BY_PROVIDER[r]){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(r)}for(let[r,n]of e)this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[r],{metadata:{providers:[...n]}}));this.skillFileLocationsPatterns.length>0&&this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[...this.skillFileLocationsPatterns],{metadata:{providers:["LOCAL","BACKGROUND"]}}))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(BXe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e,r){return this.isSkillsEnabled()?(await this.ctx.get(ug).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new O$t(s)):[]}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=BXe.default.dirname(r)),!!r)return BXe.default.normalize(r)}};var FXe=class extends lr{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(h0).listSkills(e);if(At(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=NA(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(nwn,"generateWorkspaceStructurePrompt");async function iwn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await rwn(await own(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(iwn,"generateWorkspaceStructure");async function own(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await qXe(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=Ra(e,s);return!da.isRegisteredScheme(to(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||Oes(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>own(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(own,"buildFileList");var Nes=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],Mes=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function Oes(t){return!!(Mes.includes(Ji(t).toLowerCase())||rs(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>Nes.includes(r)))}a(Oes,"shouldAlwaysIgnoreFile");async function jXe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ji(c.uri)})),o=await iwn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${un(l)})`),s.push(u.tree),s.push("");return s}catch(n){return Des.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(jXe,"processDirectoryReferences");var rde=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await nwn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||Fn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var swn=de(xo());var Bwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(swn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp($q,{ctx:this.props.ctx}),vscpp(QXe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Vq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(rde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(UXe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var HXe=de(require("path"));function Q$t(t){let e=Ft(t,Ye.EnableSkills),r=t.get(Hl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(Q$t,"isSkillsEnabled");var U$t=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(ff(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return KQ(this.promptFileEntry.promptPath)}get providers(){return R3(this.promptFileEntry.promptPath.metadata)}},g0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new fe("CustomSkillService");this._onDidChangeSkillsEnabled=new rp;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.WORKSPACE_AGENTS_SKILLS=".agents/skills/**/SKILL.md"}static{this.WORKSPACE_GITHUB_SKILLS=".github/skills/**/SKILL.md"}static{this.GLOBAL_AGENTS_SKILLS="~/.agents/skills/**/SKILL.md"}static{this.GLOBAL_COPILOT_SKILLS="~/.copilot/skills/**/SKILL.md"}static{this.CLAUDE_SKILL_PATTERNS=[".claude/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_PATTERNS_BY_PROVIDER={LOCAL:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],BACKGROUND:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],CLAUDE:t.CLAUDE_SKILL_PATTERNS}}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(Hl);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(l0).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.disposeSkillPatterns(),this._onDidChangeSkillsEnabled.dispose()}disposeSkillPatterns(){for(let e of this.registrySkillPatterns)try{e.dispose()}catch{}this.registrySkillPatterns=[]}skipIfSkillsEnabledUnchanged(e){let r=Ft(this.ctx,Ye.EnableSkills);return()=>{let n=Ft(this.ctx,Ye.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return Q$t(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Ft(this.ctx,Ye.EnableSkills))return;let e=new Map;for(let r of Object.keys(t.SKILL_PATTERNS_BY_PROVIDER))for(let n of t.SKILL_PATTERNS_BY_PROVIDER[r]){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(r)}for(let[r,n]of e)this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[r],{metadata:{providers:[...n]}}));this.skillFileLocationsPatterns.length>0&&this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[...this.skillFileLocationsPatterns],{metadata:{providers:["LOCAL","BACKGROUND"]}}))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(HXe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e,r){return this.isSkillsEnabled()?(await this.ctx.get(dg).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new U$t(s)):[]}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=HXe.default.dirname(r)),!!r)return HXe.default.normalize(r)}};var GXe=class extends lr{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(g0).listSkills(e);if(Rt(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(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 rwn={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},rde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await K$e(e.ctx)&&r.set(rwn.name,rwn);let o=await e.ctx.get(Ld).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&At(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 Ces=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 nwn(t){return Ces.get(t)??"unknown"}a(nwn,"getToolFunctionalType");var bes=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"]]),Ses=new Map;for(let[t,e]of bes)Ses.set(e,t);var iwn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),own=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var UXe=class extends lr{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 rde().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 nde=class extends lr{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 Tes=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],$O=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Tes.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var swn=de(Io());var QXe=class extends lr{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(swn.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(nde,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($O,{languageOverride:this.props.languageOverride}))}};p();var awn=de(Io());var qXe=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(awn.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($O,{languageOverride:this.props.languageOverride}))}};p();p();var cwn="filepath:",FA="...existing code...";p();var jXe=class extends lr{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 Gq=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!sYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Rn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Rn.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 lwn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(lwn,"modelSupportsReplaceString");function uwn(t){return t?t.startsWith("gpt-5"):!1}a(uwn,"isGpt5PlusFamily");function Ies(t){return t?t==="gpt-5.2-codex":!1}a(Ies,"isGpt52CodexFamily");function xes(t){return t?t==="gpt-5.2":!1}a(xes,"isGpt52Family");function dwn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||Ies(e)||xes(e))}a(dwn,"modelSupportsApplyPatch");var fwn=de(Io());var HXe=class extends lr{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=uwn(this.props.modelConfiguration.modelFamily);return vscpp(fwn.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(Gq,{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(jXe,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),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,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 {",` // ${FA}`," age: number;",` // ${FA}`," 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($O,{languageOverride:this.props.languageOverride}))}};p();var GXe=class extends lr{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.")}},$Xe=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var ide=class extends lr{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))}},VXe=class extends lr{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))}},WXe=class extends lr{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 pwn=de(Io());var zXe=class extends lr{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(pwn.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(Gq,{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 `",FA,"` 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($O,{languageOverride:this.props.languageOverride}))}},YXe=class extends lr{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 KXe=de(Io());var JXe=class extends lr{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=Ft(this.props.turnContext.ctx,Ye.UseAgentsMd);return sYe(n.modelFamily)?vscpp(qXe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(QXe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(zXe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(HXe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Ir).getEditorInfo().name,n=e.get(bn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(KXe.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(Rn.Gpt5)?vscpp(vscppf,null,vscpp($Xe,null),vscpp(VXe,null)):vscpp(vscppf,null,vscpp(GXe,null),vscpp(ide,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(KXe.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(KXe.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 hwn=de(Io());var ZXe=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=yO(this.props.currentTurn.response?.message,!0),r=RO(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,hwn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(rw,{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 XXe=class extends lr{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 eet=class extends lr{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&&wes(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 ",un(e.uri),". ",n)}};function wes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(wes,"notEmptySelection");p();var tet=class extends lr{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 `",FA,"` to represent regions of unchanged code.")}};p();var ret=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Rn.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 VO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=DA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${cwn} ${un(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 awn={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},nde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await tVe(e.ctx)&&r.set(awn.name,awn);let o=await e.ctx.get(Fd).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&Rt(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 Les=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 cwn(t){return Les.get(t)??"unknown"}a(cwn,"getToolFunctionalType");var Bes=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"]]),Fes=new Map;for(let[t,e]of Bes)Fes.set(e,t);var lwn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),uwn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var $Xe=class extends lr{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 nde().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 ide=class extends lr{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 Ues=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],WO=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Ues.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var dwn=de(xo());var VXe=class extends lr{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(dwn.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(ide,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(WO,{languageOverride:this.props.languageOverride}))}};p();var fwn=de(xo());var WXe=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(fwn.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(WO,{languageOverride:this.props.languageOverride}))}};p();p();var pwn="filepath:",UA="...existing code...";p();var zXe=class extends lr{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 Wq=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!fYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Rn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Rn.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 hwn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(hwn,"modelSupportsReplaceString");function mwn(t){return t?t.startsWith("gpt-5"):!1}a(mwn,"isGpt5PlusFamily");function Qes(t){return t?t==="gpt-5.2-codex":!1}a(Qes,"isGpt52CodexFamily");function qes(t){return t?t==="gpt-5.2":!1}a(qes,"isGpt52Family");function gwn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||Qes(e)||qes(e))}a(gwn,"modelSupportsApplyPatch");var Awn=de(xo());var YXe=class extends lr{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=mwn(this.props.modelConfiguration.modelFamily);return vscpp(Awn.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(Wq,{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(zXe,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),"// ",UA,vscpp("br",null),"changed code",vscpp("br",null),"// ",UA,vscpp("br",null),"changed code",vscpp("br",null),"// ",UA,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 {",` // ${UA}`," age: number;",` // ${UA}`," 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(WO,{languageOverride:this.props.languageOverride}))}};p();var KXe=class extends lr{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.")}},JXe=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var ode=class extends lr{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))}},ZXe=class extends lr{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))}},XXe=class extends lr{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 ywn=de(xo());var eet=class extends lr{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(ywn.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(Wq,{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 `",UA,"` 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(WO,{languageOverride:this.props.languageOverride}))}},tet=class extends lr{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 ret=de(xo());var net=class extends lr{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=Ft(this.props.turnContext.ctx,Ye.UseAgentsMd);return fYe(n.modelFamily)?vscpp(WXe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(VXe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(eet,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(YXe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Ir).getEditorInfo().name,n=e.get(bn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(ret.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(Rn.Gpt5)?vscpp(vscppf,null,vscpp(JXe,null),vscpp(ZXe,null)):vscpp(vscppf,null,vscpp(KXe,null),vscpp(ode,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(ret.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(ret.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 Ewn=de(xo());var iet=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=_O(this.props.currentTurn.response?.message,!0),r=PO(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,Ewn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(iw,{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 oet=class extends lr{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 set=class extends lr{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&&jes(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 ",un(e.uri),". ",n)}};function jes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(jes,"notEmptySelection");p();var aet=class extends lr{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 `",UA,"` to represent regions of unchanged code.")}};p();var cet=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Rn.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 zO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=NA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${pwn} ${un(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 a2=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 VO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=rs(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 Res=new fe("activeEditorPrompt");async function mwn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Oc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&kes(n.selection)){let s=new a2(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 a2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new a2(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 a2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Res.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(mwn,"processActiveEditor");function kes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(kes,"notEmptySelection");p();var Pes=["png","jpg","jpeg","bmp","gif","webp"];function Des(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Pes.some(n=>r.endsWith(`.${n}`))})}a(Des,"filterOutImageFiles");function net(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:Des(e)}}a(net,"getFileAndDirectoryReferences");var Nes=new fe("fileReferencesPrompt");async function gwn(t,e){let{validFileReferences:r,directoryReferences:n}=net(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([Mes({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),mwn(t,e),LXe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(gwn,"processFileReferences");async function Mes(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 Oc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new a2(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 a2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new a2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Nes.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(Mes,"processValidFileReferences");var Awn=de(Io());var Oes=new fe("fileReferences"),iet=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new Fn.CancellationTokenSource().token,c=[];try{c=await gwn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Oes.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(B$t,{fileReferencesParts:c})}},B$t=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(Awn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var ywn=de(Io());var oet=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=net(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(ii);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(ywn.TextChunk,null,[n.join(` -`)])}};p();var Ewn=new fe("SkillContextPrompt"),Les=5e4,set=class extends lr{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 HKe(s);if(!c)return;Ewn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(Les).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(", ");Ewn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var vu=class extends YQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:dg,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;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(qd).invokeClientToolConfirmation(e,o)}};p();var m0=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 Bes(){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(Bes,"createManageTodoListInputSchema");var WO=class t extends vu{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:Bes()}),this.ctx=e}get service(){return this.ctx.get(m0)}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 Lr([new Rr("Error: Unknown operation")],"error")):Promise.resolve(new Lr([new Rr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Lr([new Rr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Lr([new Rr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Lr([new Rr(`# Todo List +`){return this.renderAsArray().join(e)}};var l2=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 zO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=rs(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 Hes=new fe("activeEditorPrompt");async function _wn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Oc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&Ges(n.selection)){let s=new l2(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 l2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new l2(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 l2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Hes.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(_wn,"processActiveEditor");function Ges(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Ges,"notEmptySelection");p();var $es=["png","jpg","jpeg","bmp","gif","webp"];function Ves(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!$es.some(n=>r.endsWith(`.${n}`))})}a(Ves,"filterOutImageFiles");function uet(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:Ves(e)}}a(uet,"getFileAndDirectoryReferences");var Wes=new fe("fileReferencesPrompt");async function vwn(t,e){let{validFileReferences:r,directoryReferences:n}=uet(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([zes({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),_wn(t,e),jXe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(vwn,"processFileReferences");async function zes(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 Oc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new l2(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 l2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new l2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Wes.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(zes,"processValidFileReferences");var Cwn=de(xo());var Yes=new fe("fileReferences"),det=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new Fn.CancellationTokenSource().token,c=[];try{c=await vwn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Yes.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(q$t,{fileReferencesParts:c})}},q$t=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(Cwn.TextChunk,null,[this.props.fileReferencesParts.join(` +`)])}};p();var bwn=de(xo());var fet=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=uet(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(ni);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(bwn.TextChunk,null,[n.join(` +`)])}};p();var Swn=new fe("SkillContextPrompt"),Kes=5e4,pet=class extends lr{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 YKe(s);if(!c)return;Swn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(Kes).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(", ");Swn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var vu=class extends JQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:fg,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;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(Hd).invokeClientToolConfirmation(e,o)}};p();var A0=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 Jes(){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(Jes,"createManageTodoListInputSchema");var YO=class t extends vu{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:Jes()}),this.ctx=e}get service(){return this.ctx.get(A0)}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 Lr([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?` +${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 JQ([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(` +`):""}`,d=new XQ([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(m0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return hyn(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(A0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return Eyn(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. @@ -3377,73 +3377,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 aet=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(bn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??WO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=WO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var Fes=new fe("fileReferencesPrompt");function _wn(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 Fes.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(_wn,"processMcpToolsReferences");var Ues=new fe("ToolContext"),cet=class extends lr{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 Oc;let n=_wn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){Ues.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var ode=de(Io());var uet=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Pn(this.props.userRawMessage),c=Xle(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(ode.UserMessage,null,vscpp(ode.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(iet,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(ode.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(oet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(cet,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(set,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(XXe,null),vscpp(aet,{turnContext:this.props.turnContext})),vscpp(eet,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(nde,null):vscpp(Gq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(tet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(YXe,null),vscpp(ret,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var mJ=de(Io());var F$t=new fe("agentPrompt"),det=class extends lr{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(bn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(JXe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(mJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(mJ.UserMessage,null,vscpp(UXe,{turnContext:this.turnContext})),vscpp(mJ.UserMessage,null,vscpp(FXe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(Aue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(uet,{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(ZXe,{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?Qes(e):[vscpp(Mwe,{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(Nwe);if(s?.renderedGlobalContext)return F$t.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}F$t.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await Iqt(Mwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Nwe(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(bf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(this.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(this.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(this.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(this.ctx,Ye.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(Wxn());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(mJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){F$t.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function Qes(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(mJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(Qes,"renderedMessageToTsxChildren");p();var fet="uncategorized_tools",vwn="Tools that could not be automatically categorized into existing groups.";p();var $q=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var uF=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 sde=new fe("roundMetricsTracker"),pet=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=qes(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:U$t(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:U$t(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:U$t(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;sde.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){sde.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 sde.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;sde.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(sde.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}}),Ft(this.ctx,Ye.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else sde.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 het=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(bn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??YO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=YO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var Zes=new fe("fileReferencesPrompt");function Twn(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 Zes.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(Twn,"processMcpToolsReferences");var Xes=new fe("ToolContext"),met=class extends lr{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 Oc;let n=Twn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` +`)))}catch(r){Xes.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var sde=de(xo());var get=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Pn(this.props.userRawMessage),c=eue(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(sde.UserMessage,null,vscpp(sde.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(det,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(sde.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(fet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(met,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(pet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(oet,null),vscpp(het,{turnContext:this.props.turnContext})),vscpp(set,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(ide,null):vscpp(Wq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(aet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(tet,null),vscpp(cet,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var AJ=de(xo());var j$t=new fe("agentPrompt"),Aet=class extends lr{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(bn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(net,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(AJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(AJ.UserMessage,null,vscpp($Xe,{turnContext:this.turnContext})),vscpp(AJ.UserMessage,null,vscpp(GXe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(yue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(get,{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(iet,{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?ets(e):[vscpp(Bwe,{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(Lwe);if(s?.renderedGlobalContext)return j$t.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}j$t.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await kqt(Bwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Lwe(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(Tf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(this.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(this.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(this.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(this.ctx,Ye.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(Zxn());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(AJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){j$t.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function ets(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(AJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(ets,"renderedMessageToTsxChildren");p();var yet="uncategorized_tools",Iwn="Tools that could not be automatically categorized into existing groups.";p();var zq=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var fF=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 ade=new fe("roundMetricsTracker");function tts(t,e){let r=e>0;return t&&r?"both":t?"compacted":r?"prompt_tsx_pruned":"none"}a(tts,"deriveContextManagementAction");var Eet=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=rts(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:H$t(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:H$t(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:H$t(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}computeContextManagement(e,r){let n=this.previousRenderPartitionId!==void 0&&e!==this.previousRenderPartitionId;return this.previousRenderPartitionId=e,{partitionId:e,promptTsxRemovedNodeCount:r,action:tts(n,r)}}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;ade.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){ade.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 ade.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;ade.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(ade.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}}),Ft(this.ctx,Ye.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else ade.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 U$t(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(qes,"stripDriftingFields");p();p();var het=new fe("agentModePolicy");function Cwn(t){try{let e=rx(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(het.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(jl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(het.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(het.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return het.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(Cwn,"isAutoApprovalEnabled");p();var met=new fe("McpAutoApproveService"),dF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){met.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return met.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||met.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})),met.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 gJ=de(require("path"));var mw=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 fe("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&&la.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ks(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=un(e);return r.some(o=>{try{let s=un(o),c=gJ.normalize(s),l=gJ.normalize(n),u=gJ.relative(c,l);return!u.startsWith("..")&&!gJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return vf(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 Twn=`*** Begin Patch -`,ade=` -*** End Patch`,cde="*** Add File: ",Vq="*** Delete File: ",lde="*** Update File: ",jes="*** Move to: ",Q$t="*** End of File";var Hes=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var nm=class extends Error{static{a(this,"DiffError")}},ude=class extends nm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},zO=class extends nm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function bwn(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(bwn,"guessIndentation");function Swn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(Swn,"computeIndentLevel");function Ges(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(Ges,"getIndentationChar");function $es(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($es,"transformIndentation");function Ves(t){return!t||!t.trim()}a(Ves,"isFalsyOrWhitespace");function Wes(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(Wes,"countOccurrences");function zes(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(zes,"computeLevenshteinDistance");function Owe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(Owe,"replaceExplicitTabs");function get(t){return Owe(t.replaceAll("\\n",` -`))}a(get,"replaceExplicitNl");var q$t=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]=bwn(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 nm(`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([ade]);){let e=this.readStr(lde);if(e){if(this.patch.actions[e])throw new nm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(jes);if(!(e in this.currentFiles))throw new nm(`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(Vq),e){if(this.patch.actions[e])throw new nm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new nm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(cde),e){if(this.patch.actions[e])throw new nm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new nm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new nm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(ade.trim()))throw new zO("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=!Hes.test(e.trimEnd()),l=0;for(;!this.isDone([ade,lde,Vq,cde,Q$t]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new nm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +`}}return s+="```\n",s}};function H$t(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(rts,"stripDriftingFields");p();p();var _et=new fe("agentModePolicy");function xwn(t){try{let e=ox(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(_et.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(Hl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(_et.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(_et.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return _et.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(xwn,"isAutoApprovalEnabled");p();var vet=new fe("McpAutoApproveService"),pF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){vet.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return vet.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||vet.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})),vet.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 yJ=de(require("path"));var Aw=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 fe("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&&da.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ks(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=un(e);return r.some(o=>{try{let s=un(o),c=yJ.normalize(s),l=yJ.normalize(n),u=yJ.relative(c,l);return!u.startsWith("..")&&!yJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return bf(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 kwn=`*** Begin Patch +`,cde=` +*** End Patch`,lde="*** Add File: ",Yq="*** Delete File: ",ude="*** Update File: ",nts="*** Move to: ",G$t="*** End of File";var its=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var om=class extends Error{static{a(this,"DiffError")}},dde=class extends om{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},KO=class extends om{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function wwn(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(wwn,"guessIndentation");function Rwn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(Rwn,"computeIndentLevel");function ots(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(ots,"getIndentationChar");function sts(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(sts,"transformIndentation");function ats(t){return!t||!t.trim()}a(ats,"isFalsyOrWhitespace");function cts(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(cts,"countOccurrences");function lts(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(lts,"computeLevenshteinDistance");function Fwe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(Fwe,"replaceExplicitTabs");function Cet(t){return Fwe(t.replaceAll("\\n",` +`))}a(Cet,"replaceExplicitNl");var $$t=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]=wwn(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 om(`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([cde]);){let e=this.readStr(ude);if(e){if(this.patch.actions[e])throw new om(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(nts);if(!(e in this.currentFiles))throw new om(`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(Yq),e){if(this.patch.actions[e])throw new om(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new om(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(lde),e){if(this.patch.actions[e])throw new om(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new om(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new om(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(cde.trim()))throw new KO("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=!its.test(e.trimEnd()),l=0;for(;!this.isDone([cde,ude,Yq,lde,G$t]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new om(`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 ude(`Invalid EOF context at character ${l}: -${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new ude(`Invalid context at character ${l}: -${_}`,r,v)}}this.fuzz+=h.fuzz;let m=bwn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=Swn(s[h.line]??"",n.tabSize),A=h.fuzz&4?Owe(f.nextChunkContext[0]??""):h.fuzz&128?get(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?Swn(A,m.tabSize):0,E=Ges(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(get),_.delLines=_.delLines.map(get)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(Owe)),_.insLines=_.insLines.map(v=>Ves(v)?v:E+$es(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(Owe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([ade,lde,Vq,cde]);){let r=this.readStr();if(!r.startsWith("+"))throw new zO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` +`);if(f.eof)throw new dde(`Invalid EOF context at character ${l}: +${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new dde(`Invalid context at character ${l}: +${_}`,r,v)}}this.fuzz+=h.fuzz;let m=wwn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=Rwn(s[h.line]??"",n.tabSize),A=h.fuzz&4?Fwe(f.nextChunkContext[0]??""):h.fuzz&128?Cet(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?Rwn(A,m.tabSize):0,E=ots(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(Cet),_.delLines=_.delLines.map(Cet)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(Fwe)),_.insLines=_.insLines.map(v=>ats(v)?v:E+sts(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(Fwe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([cde,ude,Yq,lde]);){let r=this.readStr();if(!r.startsWith("+"))throw new KO(`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 zO(`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 nm(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new nm(`${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(Kes,"getUpdatedFile");function Jes(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=Kes(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(Jes,"patchToCommit");async function Zes(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new nm(`File not found: ${n}`)}return r}a(Zes,"loadFiles");async function xwn(t,e){if(!t.startsWith(Twn))throw new zO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=AJ(t),n=await Zes(r,e),[o]=Yes(t,n);return Jes(o,n)}a(xwn,"processPatch");var YO=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=AJ(s),l=dde(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(mw),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(mw),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 KO(`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 om(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new om(`${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(dts,"getUpdatedFile");function fts(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=dts(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(fts,"patchToCommit");async function pts(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new om(`File not found: ${n}`)}return r}a(pts,"loadFiles");async function Dwn(t,e){if(!t.startsWith(kwn))throw new KO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=EJ(t),n=await pts(r,e),[o]=uts(t,n);return fts(o,n)}a(Dwn,"processPatch");var JO=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=EJ(s),l=fde(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(Aw),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(Aw),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 fde=new fe("AutoApproveService"),yJ=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(CB()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(Ft(e.ctx,Ye.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return fde.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!Cwn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return fde.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return fde.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(Ft(e.ctx,Ye.AutoApproveYoloMode)===!0)return fde.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=Ft(e.ctx,Ye.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=Ft(e.ctx,Ye.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=Ft(e.ctx,Ye.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return fde.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":YO.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(dF).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(Ft(this.ctx,Ye.TrustToolAnnotations)){let o=this.ctx.get(gs).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(tT),c=pJ(e.description)||"sh";fde.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=YO.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function Lwe(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(ets,"isUndefined");function j$t(t){return Buffer.from(t,"base64").toString("utf-8")}a(j$t,"decodeBase64");function kwn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(kwn,"isObject");p();var Wq="activate_",ev=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(Wq))throw new Error(`Virtual tool name must start with '${Wq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Wq+e+this.name.slice(Wq.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))}},H$t=class extends lr{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))}},Aet=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.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(zq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{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)))}},yet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.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(zq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{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)))}},Eet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.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(zq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(H$t,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(Bwe,{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 Z$t={};ki(Z$t,{arrayReplaceAt:()=>J$t,asciiTrim:()=>bJ,assign:()=>gde,escapeHtml:()=>pF,escapeRE:()=>Lts,fromCodePoint:()=>Ade,has:()=>Tts,isMdAsciiPunct:()=>vJ,isPunctChar:()=>Jwn,isPunctCharCode:()=>_J,isSpace:()=>Zs,isString:()=>Det,isValidEntityCode:()=>Net,isWhiteSpace:()=>EJ,lib:()=>Bts,normalizeReference:()=>CJ,unescapeAll:()=>fF,unescapeMd:()=>kts});p();var Tet={};ki(Tet,{decode:()=>Fwe,encode:()=>Cet,format:()=>pde,parse:()=>Uwe});p();p();var Pwn={};function tts(t){let e=Pwn[t];if(e)return e;e=Pwn[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(_et,"decode");_et.defaultChars=";/?:@&=+$,#";_et.componentChars="";var Fwe=_et;p();var Dwn={};function rts(t){let e=Dwn[t];if(e)return e;e=Dwn[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=rts(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(vet,"encode");vet.defaultChars=";/?:@&=+$,-_.!~*'()#";vet.componentChars="-_.!~*'()";var Cet=vet;p();function pde(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(pde,"format");p();function bet(){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(bet,"Url");var nts=/^([a-z0-9.+-]+:)/i,its=/:[0-9]*$/,ots=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sts=["<",">",'"',"`"," ","\r",` -`," "],ats=["{","}","|","\\","^","`"].concat(sts),cts=["'"].concat(ats),Nwn=["%","/","?",";","#"].concat(cts),Mwn=["/","?","#"],lts=255,Own=/^[+a-z0-9A-Z_-]{0,63}$/,uts=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Lwn={javascript:!0,"javascript:":!0},Bwn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dts(t,e){if(t&&t instanceof bet)return t;let r=new bet;return r.parse(t,e),r}a(dts,"urlParse");bet.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=ots.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=nts.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&&Lwn[c])&&(s=s.substr(2),this.slashes=!0)),!Lwn[c]&&(o||c&&!Bwn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(Own)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(uts);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>lts&&(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),Bwn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};bet.prototype.parseHost=function(t){let e=its.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 Uwe=dts;var G$t={};ki(G$t,{Any:()=>Iet,Cc:()=>xet,Cf:()=>Fwn,P:()=>hde,S:()=>wet,Z:()=>Ret});p();p();var Iet=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var xet=/[\0-\x1F\x7F-\x9F]/;p();var Fwn=/[\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 hde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 wet=/[\$\+<->\^`\|~\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 Ret=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var Uwn=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 Qwn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var $$t,fts=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]]),V$t=($$t=String.fromCodePoint)!==null&&$$t!==void 0?$$t: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 W$t(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=fts.get(t))!==null&&e!==void 0?e:t}a(W$t,"replaceCodePoint");var Tg;(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"})(Tg||(Tg={}));var pts=32,Yq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Yq||(Yq={}));function z$t(t){return t>=Tg.ZERO&&t<=Tg.NINE}a(z$t,"isNumber");function hts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_F||t>=Tg.LOWER_A&&t<=Tg.LOWER_F}a(hts,"isHexadecimalCharacter");function mts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_Z||t>=Tg.LOWER_A&&t<=Tg.LOWER_Z||z$t(t)}a(mts,"isAsciiAlphaNumeric");function gts(t){return t===Tg.EQUALS||mts(t)}a(gts,"isEntityInAttributeInvalidEnd");var Sg;(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"})(Sg||(Sg={}));var c2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(c2||(c2={}));var ket=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Sg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=c2.Strict}startEntity(e){this.decodeMode=e,this.state=Sg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Sg.EntityStart:return e.charCodeAt(r)===Tg.NUM?(this.state=Sg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Sg.NamedEntity,this.stateNamedEntity(e,r));case Sg.NumericStart:return this.stateNumericStart(e,r);case Sg.NumericDecimal:return this.stateNumericDecimal(e,r);case Sg.NumericHex:return this.stateNumericHex(e,r);case Sg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|pts)===Tg.LOWER_X?(this.state=Sg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Sg.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===Tg.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==c2.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]&Yq.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]&~Yq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Sg.NamedEntity:return this.result!==0&&(this.decodeMode!==c2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Sg.NumericDecimal:return this.emitNumericEntity(0,2);case Sg.NumericHex:return this.emitNumericEntity(0,3);case Sg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Sg.EntityStart:return 0}}};function qwn(t){let e="",r=new ket(t,n=>e+=V$t(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(qwn,"getDecoder");function Ats(t,e,r,n){let o=(e&Yq.BRANCH_LENGTH)>>7,s=e&Yq.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(Ats,"determineBranch");var jwn=qwn(Uwn),vMd=qwn(Qwn);function mde(t,e=c2.Legacy){return jwn(t,e)}a(mde,"decodeHTML");function Qwe(t){return jwn(t,c2.Strict)}a(Qwe,"decodeHTMLStrict");p();p();function Pet(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 Y$t(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(Y$t,"getEscaper");var Hwn=Y$t(/[&<>'"]/g,Ets),Gwn=Y$t(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),$wn=Y$t(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var Vwn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Vwn||(Vwn={}));var Wwn;(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"})(Wwn||(Wwn={}));function bts(t){return Object.prototype.toString.call(t)}a(bts,"_class");function Det(t){return bts(t)==="[object String]"}a(Det,"isString");var Sts=Object.prototype.hasOwnProperty;function Tts(t,e){return Sts.call(t,e)}a(Tts,"has");function gde(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(gde,"assign");function J$t(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(J$t,"arrayReplaceAt");function Net(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(Net,"isValidEntityCode");function Ade(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(Ade,"fromCodePoint");var Kwn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Its=/&([a-z#][a-z0-9]{1,31});/gi,xts=new RegExp(Kwn.source+"|"+Its.source,"gi"),wts=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Rts(t,e){if(e.charCodeAt(0)===35&&wts.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Net(n)?Ade(n):t}let r=mde(t);return r!==t?r:t}a(Rts,"replaceEntityPattern");function kts(t){return t.indexOf("\\")<0?t:t.replace(Kwn,"$1")}a(kts,"unescapeMd");function fF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(xts,function(e,r,n){return r||Rts(e,n)})}a(fF,"unescapeAll");var Pts=/[&<>"]/,Dts=/[&<>"]/g,Nts={"&":"&","<":"<",">":">",'"':"""};function Mts(t){return Nts[t]}a(Mts,"replaceUnsafeChar");function pF(t){return Pts.test(t)?t.replace(Dts,Mts):t}a(pF,"escapeHtml");var Ots=/[.?*+^$[\]\\(){}|-]/g;function Lts(t){return t.replace(Ots,"\\$&")}a(Lts,"escapeRE");function Zs(t){switch(t){case 9:case 32:return!0}return!1}a(Zs,"isSpace");function EJ(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(EJ,"isWhiteSpace");function Jwn(t){return hde.test(t)||wet.test(t)}a(Jwn,"isPunctChar");function _J(t){return Jwn(Ade(t))}a(_J,"isPunctCharCode");function vJ(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(vJ,"isMdAsciiPunct");function CJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(CJ,"normalizeReference");function Ywn(t){return t===32||t===9||t===10||t===13}a(Ywn,"isAsciiTrimmable");function bJ(t){let e=0;for(;e=e&&Ywn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(bJ,"asciiTrim");var Bts={mdurl:Tet,ucmicro:G$t};var rVt={};ki(rVt,{parseLinkDestination:()=>eVt,parseLinkLabel:()=>X$t,parseLinkTitle:()=>tVt});p();p();function X$t(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=fF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(eVt,"parseLinkDestination");p();function tVt(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"+pF(s.content)+""};KO.code_block=function(t,e,r,n,o){let s=t[e];return""+pF(t[e].content)+` -`};KO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?fF(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)||pF(s.content):d=pF(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(mts,"isUndefined");function V$t(t){return Buffer.from(t,"base64").toString("utf-8")}a(V$t,"decodeBase64");function Own(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Own,"isObject");p();var Kq="activate_",rv=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(Kq))throw new Error(`Virtual tool name must start with '${Kq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Kq+e+this.name.slice(Kq.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))}},W$t=class extends lr{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))}},bet=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Jq.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(Jq.UserMessage,null,this.props.tools.map(e=>vscpp(Qwe,{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)))}},Tet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Jq.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(Jq.UserMessage,null,this.props.tools.map(e=>vscpp(Qwe,{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)))}},Iet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Jq.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(Jq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(W$t,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(Qwe,{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 rVt={};ki(rVt,{arrayReplaceAt:()=>tVt,asciiTrim:()=>TJ,assign:()=>Ade,escapeHtml:()=>mF,escapeRE:()=>Jts,fromCodePoint:()=>yde,has:()=>Qts,isMdAsciiPunct:()=>bJ,isPunctChar:()=>rRn,isPunctCharCode:()=>CJ,isSpace:()=>Zs,isString:()=>Fet,isValidEntityCode:()=>Uet,isWhiteSpace:()=>vJ,lib:()=>Zts,normalizeReference:()=>SJ,unescapeAll:()=>hF,unescapeMd:()=>$ts});p();var Pet={};ki(Pet,{decode:()=>qwe,encode:()=>Ret,format:()=>hde,parse:()=>jwe});p();p();var Lwn={};function gts(t){let e=Lwn[t];if(e)return e;e=Lwn[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(xet,"decode");xet.defaultChars=";/?:@&=+$,#";xet.componentChars="";var qwe=xet;p();var Bwn={};function Ats(t){let e=Bwn[t];if(e)return e;e=Bwn[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=Ats(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(wet,"encode");wet.defaultChars=";/?:@&=+$,-_.!~*'()#";wet.componentChars="-_.!~*'()";var Ret=wet;p();function hde(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(hde,"format");p();function ket(){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(ket,"Url");var yts=/^([a-z0-9.+-]+:)/i,Ets=/:[0-9]*$/,_ts=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,vts=["<",">",'"',"`"," ","\r",` +`," "],Cts=["{","}","|","\\","^","`"].concat(vts),bts=["'"].concat(Cts),Fwn=["%","/","?",";","#"].concat(bts),Uwn=["/","?","#"],Sts=255,Qwn=/^[+a-z0-9A-Z_-]{0,63}$/,Tts=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qwn={javascript:!0,"javascript:":!0},jwn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Its(t,e){if(t&&t instanceof ket)return t;let r=new ket;return r.parse(t,e),r}a(Its,"urlParse");ket.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=_ts.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=yts.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&&qwn[c])&&(s=s.substr(2),this.slashes=!0)),!qwn[c]&&(o||c&&!jwn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(Qwn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(Tts);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>Sts&&(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),jwn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ket.prototype.parseHost=function(t){let e=Ets.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 jwe=Its;var z$t={};ki(z$t,{Any:()=>Det,Cc:()=>Net,Cf:()=>Hwn,P:()=>mde,S:()=>Met,Z:()=>Oet});p();p();var Det=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var Net=/[\0-\x1F\x7F-\x9F]/;p();var Hwn=/[\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 mde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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 Met=/[\$\+<->\^`\|~\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 Oet=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var Gwn=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 $wn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var Y$t,xts=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]]),K$t=(Y$t=String.fromCodePoint)!==null&&Y$t!==void 0?Y$t: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 J$t(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=xts.get(t))!==null&&e!==void 0?e:t}a(J$t,"replaceCodePoint");var Ig;(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"})(Ig||(Ig={}));var wts=32,Zq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Zq||(Zq={}));function Z$t(t){return t>=Ig.ZERO&&t<=Ig.NINE}a(Z$t,"isNumber");function Rts(t){return t>=Ig.UPPER_A&&t<=Ig.UPPER_F||t>=Ig.LOWER_A&&t<=Ig.LOWER_F}a(Rts,"isHexadecimalCharacter");function kts(t){return t>=Ig.UPPER_A&&t<=Ig.UPPER_Z||t>=Ig.LOWER_A&&t<=Ig.LOWER_Z||Z$t(t)}a(kts,"isAsciiAlphaNumeric");function Pts(t){return t===Ig.EQUALS||kts(t)}a(Pts,"isEntityInAttributeInvalidEnd");var Tg;(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"})(Tg||(Tg={}));var u2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(u2||(u2={}));var Let=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Tg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=u2.Strict}startEntity(e){this.decodeMode=e,this.state=Tg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Tg.EntityStart:return e.charCodeAt(r)===Ig.NUM?(this.state=Tg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Tg.NamedEntity,this.stateNamedEntity(e,r));case Tg.NumericStart:return this.stateNumericStart(e,r);case Tg.NumericDecimal:return this.stateNumericDecimal(e,r);case Tg.NumericHex:return this.stateNumericHex(e,r);case Tg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|wts)===Ig.LOWER_X?(this.state=Tg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Tg.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===Ig.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==u2.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]&Zq.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]&~Zq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Tg.NamedEntity:return this.result!==0&&(this.decodeMode!==u2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Tg.NumericDecimal:return this.emitNumericEntity(0,2);case Tg.NumericHex:return this.emitNumericEntity(0,3);case Tg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Tg.EntityStart:return 0}}};function Vwn(t){let e="",r=new Let(t,n=>e+=K$t(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(Vwn,"getDecoder");function Dts(t,e,r,n){let o=(e&Zq.BRANCH_LENGTH)>>7,s=e&Zq.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(Dts,"determineBranch");var Wwn=Vwn(Gwn),QMd=Vwn($wn);function gde(t,e=u2.Legacy){return Wwn(t,e)}a(gde,"decodeHTML");function Hwe(t){return Wwn(t,u2.Strict)}a(Hwe,"decodeHTMLStrict");p();p();function Bet(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 X$t(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(X$t,"getEscaper");var zwn=X$t(/[&<>'"]/g,Mts),Ywn=X$t(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),Kwn=X$t(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var Jwn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Jwn||(Jwn={}));var Zwn;(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"})(Zwn||(Zwn={}));function Fts(t){return Object.prototype.toString.call(t)}a(Fts,"_class");function Fet(t){return Fts(t)==="[object String]"}a(Fet,"isString");var Uts=Object.prototype.hasOwnProperty;function Qts(t,e){return Uts.call(t,e)}a(Qts,"has");function Ade(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(Ade,"assign");function tVt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(tVt,"arrayReplaceAt");function Uet(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(Uet,"isValidEntityCode");function yde(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(yde,"fromCodePoint");var tRn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,qts=/&([a-z#][a-z0-9]{1,31});/gi,jts=new RegExp(tRn.source+"|"+qts.source,"gi"),Hts=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Gts(t,e){if(e.charCodeAt(0)===35&&Hts.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Uet(n)?yde(n):t}let r=gde(t);return r!==t?r:t}a(Gts,"replaceEntityPattern");function $ts(t){return t.indexOf("\\")<0?t:t.replace(tRn,"$1")}a($ts,"unescapeMd");function hF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(jts,function(e,r,n){return r||Gts(e,n)})}a(hF,"unescapeAll");var Vts=/[&<>"]/,Wts=/[&<>"]/g,zts={"&":"&","<":"<",">":">",'"':"""};function Yts(t){return zts[t]}a(Yts,"replaceUnsafeChar");function mF(t){return Vts.test(t)?t.replace(Wts,Yts):t}a(mF,"escapeHtml");var Kts=/[.?*+^$[\]\\(){}|-]/g;function Jts(t){return t.replace(Kts,"\\$&")}a(Jts,"escapeRE");function Zs(t){switch(t){case 9:case 32:return!0}return!1}a(Zs,"isSpace");function vJ(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(vJ,"isWhiteSpace");function rRn(t){return mde.test(t)||Met.test(t)}a(rRn,"isPunctChar");function CJ(t){return rRn(yde(t))}a(CJ,"isPunctCharCode");function bJ(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(bJ,"isMdAsciiPunct");function SJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(SJ,"normalizeReference");function eRn(t){return t===32||t===9||t===10||t===13}a(eRn,"isAsciiTrimmable");function TJ(t){let e=0;for(;e=e&&eRn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(TJ,"asciiTrim");var Zts={mdurl:Pet,ucmicro:z$t};var sVt={};ki(sVt,{parseLinkDestination:()=>iVt,parseLinkLabel:()=>nVt,parseLinkTitle:()=>oVt});p();p();function nVt(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=hF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(iVt,"parseLinkDestination");p();function oVt(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"+mF(s.content)+""};ZO.code_block=function(t,e,r,n,o){let s=t[e];return""+mF(t[e].content)+` +`};ZO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?hF(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)||mF(s.content):d=mF(s.content),d.indexOf("${d} `}return`
${d}
-`};KO.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)};KO.hardbreak=function(t,e,r){return r.xhtmlOut?`
+`};ZO.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)};ZO.hardbreak=function(t,e,r){return r.xhtmlOut?`
`:`
-`};KO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
+`};ZO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};KO.text=function(t,e){return pF(t[e].content)};KO.html_block=function(t,e){return t[e].content};KO.html_inline=function(t,e){return t[e].content};function yde(){this.rules=gde({},KO)}a(yde,"Renderer");yde.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r -`:">",s},"renderToken");yde.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");Ede.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 hF=Ede;function Xwn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(Xwn,"StateCore");Xwn.prototype.Token=hF;var eRn=Xwn;p();var Fts=/\r\n?|\n/g,Uts=/\0/g;function nVt(t){let e;e=t.src.replace(Fts,` -`),e=e.replace(Uts,"\uFFFD"),t.src=e}a(nVt,"normalize");p();function iVt(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(iVt,"block");p();function oVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(Qts,"isLinkOpen");function qts(t){return/^<\/a\s*>/i.test(t)}a(qts,"isLinkClose");function sVt(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"&&(Qts(l.content)&&s>0&&s--,qts(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(Hts,$ts)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Vts,"replace_scoped");function Wts(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&tRn.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(Wts,"replace_rare");function aVt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(jts.test(t.tokens[e].content)&&Vts(t.tokens[e].children),tRn.test(t.tokens[e].content)&&Wts(t.tokens[e].children))}a(aVt,"replace");p();var zts=/['"]/,rRn=/['"]/g,nRn="\u2019";function Met(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Met,"addReplacement");function Yts(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&&Met(o,s,h.index,nRn);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"||!zts.test(t.tokens[e].content)||Kts(t.tokens[e].children,t)}a(cVt,"smartquotes");p();function lVt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};JO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");JO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");JO.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");JO.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");JO.prototype.Token=hF;var oRn=JO;p();var Jts=65536;function fVt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(fVt,"getLine");function sRn(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=sRn(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=sRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>Jts))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(hVt,"code");p();function mVt(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=cRn(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=aRn(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,L=t.tShift[u],B=t.sCount[u],q=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=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,j=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,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(EVt,"reference");p();p();var lRn=["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 Xts="[a-zA-Z_:][a-zA-Z0-9:._-]*",ers="[^\"'=<>`\\x00-\\x20]+",trs="'[^']*'",rrs='"[^"]*"',nrs="(?:"+ers+"|"+trs+"|"+rrs+")",irs="(?:\\s+"+Xts+"(?:\\s*=\\s*"+nrs+")?)",uRn="<[A-Za-z][A-Za-z0-9\\-]*"+irs+"*\\s*\\/?>",dRn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ors="",srs="<[?][\\s\\S]*?[?]>",ars="]*>",crs="",fRn=new RegExp("^(?:"+uRn+"|"+dRn+"|"+ors+"|"+srs+"|"+ars+"|"+crs+")"),pRn=new RegExp("^(?:"+uRn+"|"+dRn+")");var TJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(pRn.source+"\\s*$"),/^$/,!1]];function _Vt(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=bJ(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(vVt,"heading");p();function CVt(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};qwe.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(urs);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(TVt,"linkify");p();function IVt(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){xVt[t.charCodeAt(0)]=1});function wVt(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&&xVt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(wVt,"escape");p();function RVt(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(ARn,"postProcess");function hrs(t){let e=t.tokens_meta,r=t.tokens_meta.length;ARn(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[CJ(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(DVt,"link");p();function NVt(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[CJ(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(NVt,"image");p();var mrs=/^([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])?)*)$/,grs=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function MVt(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(grs.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(mrs.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(MVt,"autolink");p();function Ars(t){return/^\s]/i.test(t)}a(Ars,"isLinkOpen");function yrs(t){return/^<\/a\s*>/i.test(t)}a(yrs,"isLinkClose");function Ers(t){let e=t|32;return e>=97&&e<=122}a(Ers,"isLetter");function OVt(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&&!Ers(o))return!1;let s=t.src.slice(n).match(fRn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Ars(c.content)&&t.linkLevel++,yrs(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(OVt,"html_inline");p();var _rs=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vrs=/^&([a-z][a-z0-9]{1,31});/i;function LVt(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(_rs);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=Net(c)?Ade(c):Ade(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(vrs);if(s){let c=Qwe(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(LVt,"entity");p();function yRn(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(yRn,"processDelimiters");function BVt(t){let e=t.tokens_meta,r=t.tokens_meta.length;yRn(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};jwe.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()};jwe.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(qVt,"default");function jVt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(jVt,"assign");function Fet(t){return Object.prototype.toString.call(t)}a(Fet,"_class");function Crs(t){return Fet(t)==="[object String]"}a(Crs,"isString");function brs(t){return Fet(t)==="[object Object]"}a(brs,"isObject");function Srs(t){return Fet(t)==="[object RegExp]"}a(Srs,"isRegExp");function _Rn(t){return Fet(t)==="[object Function]"}a(_Rn,"isFunction");function Trs(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(Trs,"escapeRE");var CRn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Irs(t){return Object.keys(t||{}).reduce(function(e,r){return e||CRn.hasOwnProperty(r)},!1)}a(Irs,"isOptionsObj");var xrs={"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")}},wrs="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]",Rrs="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function krs(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(krs,"createValidator");function vRn(){return function(t,e){e.normalize(t)}}a(vRn,"createNormalizer");function Bet(t){let e=t.re=qVt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(wrs),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,brs(u)){Srs(u.validate)?d.validate=krs(u.validate):_Rn(u.validate)?d.validate=u.validate:s(l,u),_Rn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=vRn();return}if(Crs(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:vRn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(Trs).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(Bet,"compile");function bRn(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(bRn,"Match");function rT(t,e){if(!(this instanceof rT))return new rT(t,e);e||Irs(t)&&(e=t,t={}),this.__opts__=jVt({},CRn,e),this.__schemas__=jVt({},xrs,t),this.__compiled__={},this.__tlds__=Rrs,this.__tlds_replaced__=!1,this.re={},Bet(this)}a(rT,"LinkifyIt");rT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Bet(this),this},"add");rT.prototype.set=a(function(e){return this.__opts__=jVt(this.__opts__,e),this},"set");rT.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");rT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");rT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");rT.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"},HVt=35,ZO=Math.floor,GVt=String.fromCharCode;function Kq(t){throw new RangeError(Mrs[t])}a(Kq,"error");function Ors(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Ors,"map");function IRn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(Nrs,".");let o=t.split("."),s=Ors(o,e).join(".");return n+s}a(IRn,"mapDomain");function xRn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),Brs=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"),TRn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),wRn=a(function(t,e,r){let n=0;for(t=r?ZO(t/700):t>>1,t+=ZO(t/e);t>HVt*26>>1;n+=36)t=ZO(t/HVt);return ZO(n+(HVt+1)*t/(t+38))},"adapt"),RRn=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&&Kq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Kq("invalid-input");let m=Brs(t.charCodeAt(l++));m>=36&&Kq("invalid-input"),m>ZO((2147483647-n)/f)&&Kq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mZO(2147483647/A)&&Kq("overflow"),f*=A}let d=e.length+1;s=wRn(n-u,d,u==0),ZO(n/d)>2147483647-o&&Kq("overflow"),o+=ZO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),kRn=a(function(t){let e=[];t=xRn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(GVt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fZO((2147483647-o)/d)&&Kq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Kq("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=$Vt.toASCII(e.hostname)}catch{}return Cet(pde(e))}a($rs,"normalizeLink");function Vrs(t){let e=Uwe(t,!0);if(e.hostname&&(!e.protocol||MRn.indexOf(e.protocol)>=0))try{e.hostname=$Vt.toUnicode(e.hostname)}catch{}return Fwe(pde(e),Fwe.defaultChars+"%")}a(Vrs,"normalizeLinkText");function gw(t,e){if(!(this instanceof gw))return new gw(t,e);e||Det(t)||(e=t||{},t="default"),this.inline=new ERn,this.block=new hRn,this.core=new iRn,this.renderer=new Zwn,this.linkify=new SRn,this.validateLink=Grs,this.normalizeLink=$rs,this.normalizeLinkText=Vrs,this.utils=Z$t,this.helpers=gde({},rVt),this.options={},this.configure(t),e&&this.set(e)}a(gw,"MarkdownIt");gw.prototype.set=function(t){return gde(this.options,t),this};gw.prototype.configure=function(t){let e=this;if(Det(t)){let r=t;if(t=qrs[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};gw.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};gw.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};gw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};gw.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};gw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};gw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};gw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var VVt=gw;function WVt(t){return Array.isArray(t)}a(WVt,"isArray");function Wrs(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||WVt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(Wrs,"isFenceToken");function*ORn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;WVt(r.children)&&(yield*ORn(r.children))}}a(ORn,"flattenTokensLists");function zrs(){return new VVt}a(zrs,"createMarkdownIt");function LRn(t){let e=[],n=zrs().parse(t,{});if(!WVt(n))return e;for(let o of ORn(n)){if(!o||typeof o!="object")continue;let s=o;if(Wrs(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(LRn,"extractCodeBlocks");function zVt(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(zVt,"escapeProblematicHtmlTags");var KVt=Rn.Gpt4oMini,BRn=new fe("virtualToolSummarizer"),Hwe=class extends Error{static{a(this,"SummarizerError")}};function FRn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(FRn,"isValidCategoryItem");function URn(t,e){if(!Array.isArray(t))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(FRn))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(URn,"validateCategoriesWithoutToolsResponse");function Yrs(t){return FRn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(Yrs,"isValidCategorizationItem");function QRn(t,e){if(URn(t,e),!t.every(Yrs))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(QRn,"validateCategorizationResponse");function qRn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(qRn,"deduplicateTools");function Krs(t){let e=new Map;for(let r of t){let n=HRn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`:">",s},"renderToken");Ede.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");_de.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 gF=_de;function iRn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(iRn,"StateCore");iRn.prototype.Token=gF;var oRn=iRn;p();var Xts=/\r\n?|\n/g,ers=/\0/g;function aVt(t){let e;e=t.src.replace(Xts,` +`),e=e.replace(ers,"\uFFFD"),t.src=e}a(aVt,"normalize");p();function cVt(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(cVt,"block");p();function lVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(trs,"isLinkOpen");function rrs(t){return/^<\/a\s*>/i.test(t)}a(rrs,"isLinkClose");function uVt(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"&&(trs(l.content)&&s>0&&s--,rrs(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(irs,srs)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(ars,"replace_scoped");function crs(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&sRn.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(crs,"replace_rare");function dVt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(nrs.test(t.tokens[e].content)&&ars(t.tokens[e].children),sRn.test(t.tokens[e].content)&&crs(t.tokens[e].children))}a(dVt,"replace");p();var lrs=/['"]/,aRn=/['"]/g,cRn="\u2019";function Qet(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Qet,"addReplacement");function urs(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&&Qet(o,s,h.index,cRn);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"||!lrs.test(t.tokens[e].content)||drs(t.tokens[e].children,t)}a(fVt,"smartquotes");p();function pVt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};XO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");XO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");XO.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");XO.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");XO.prototype.Token=gF;var uRn=XO;p();var frs=65536;function gVt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(gVt,"getLine");function dRn(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=dRn(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=dRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>frs))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(yVt,"code");p();function EVt(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=pRn(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=fRn(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,L=t.tShift[u],B=t.sCount[u],q=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=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,j=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,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(bVt,"reference");p();p();var hRn=["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 hrs="[a-zA-Z_:][a-zA-Z0-9:._-]*",mrs="[^\"'=<>`\\x00-\\x20]+",grs="'[^']*'",Ars='"[^"]*"',yrs="(?:"+mrs+"|"+grs+"|"+Ars+")",Ers="(?:\\s+"+hrs+"(?:\\s*=\\s*"+yrs+")?)",mRn="<[A-Za-z][A-Za-z0-9\\-]*"+Ers+"*\\s*\\/?>",gRn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",_rs="",vrs="<[?][\\s\\S]*?[?]>",Crs="]*>",brs="",ARn=new RegExp("^(?:"+mRn+"|"+gRn+"|"+_rs+"|"+vrs+"|"+Crs+"|"+brs+")"),yRn=new RegExp("^(?:"+mRn+"|"+gRn+")");var xJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(yRn.source+"\\s*$"),/^$/,!1]];function SVt(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=TJ(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(TVt,"heading");p();function IVt(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};Gwe.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(Trs);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(RVt,"linkify");p();function kVt(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){PVt[t.charCodeAt(0)]=1});function DVt(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&&PVt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(DVt,"escape");p();function NVt(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(CRn,"postProcess");function Rrs(t){let e=t.tokens_meta,r=t.tokens_meta.length;CRn(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[SJ(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(LVt,"link");p();function BVt(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[SJ(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(BVt,"image");p();var krs=/^([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])?)*)$/,Prs=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function FVt(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(Prs.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(krs.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(FVt,"autolink");p();function Drs(t){return/^\s]/i.test(t)}a(Drs,"isLinkOpen");function Nrs(t){return/^<\/a\s*>/i.test(t)}a(Nrs,"isLinkClose");function Mrs(t){let e=t|32;return e>=97&&e<=122}a(Mrs,"isLetter");function UVt(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&&!Mrs(o))return!1;let s=t.src.slice(n).match(ARn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Drs(c.content)&&t.linkLevel++,Nrs(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(UVt,"html_inline");p();var Ors=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Lrs=/^&([a-z][a-z0-9]{1,31});/i;function QVt(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(Ors);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=Uet(c)?yde(c):yde(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(Lrs);if(s){let c=Hwe(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(QVt,"entity");p();function bRn(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(bRn,"processDelimiters");function qVt(t){let e=t.tokens_meta,r=t.tokens_meta.length;bRn(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};$we.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()};$we.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($Vt,"default");function VVt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(VVt,"assign");function Get(t){return Object.prototype.toString.call(t)}a(Get,"_class");function Brs(t){return Get(t)==="[object String]"}a(Brs,"isString");function Frs(t){return Get(t)==="[object Object]"}a(Frs,"isObject");function Urs(t){return Get(t)==="[object RegExp]"}a(Urs,"isRegExp");function TRn(t){return Get(t)==="[object Function]"}a(TRn,"isFunction");function Qrs(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(Qrs,"escapeRE");var xRn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function qrs(t){return Object.keys(t||{}).reduce(function(e,r){return e||xRn.hasOwnProperty(r)},!1)}a(qrs,"isOptionsObj");var jrs={"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")}},Hrs="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]",Grs="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function $rs(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a($rs,"createValidator");function IRn(){return function(t,e){e.normalize(t)}}a(IRn,"createNormalizer");function Het(t){let e=t.re=$Vt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(Hrs),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,Frs(u)){Urs(u.validate)?d.validate=$rs(u.validate):TRn(u.validate)?d.validate=u.validate:s(l,u),TRn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=IRn();return}if(Brs(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:IRn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(Qrs).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(Het,"compile");function wRn(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(wRn,"Match");function iT(t,e){if(!(this instanceof iT))return new iT(t,e);e||qrs(t)&&(e=t,t={}),this.__opts__=VVt({},xRn,e),this.__schemas__=VVt({},jrs,t),this.__compiled__={},this.__tlds__=Grs,this.__tlds_replaced__=!1,this.re={},Het(this)}a(iT,"LinkifyIt");iT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Het(this),this},"add");iT.prototype.set=a(function(e){return this.__opts__=VVt(this.__opts__,e),this},"set");iT.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");iT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");iT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");iT.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"},WVt=35,e5=Math.floor,zVt=String.fromCharCode;function Xq(t){throw new RangeError(Yrs[t])}a(Xq,"error");function Krs(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Krs,"map");function PRn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(zrs,".");let o=t.split("."),s=Krs(o,e).join(".");return n+s}a(PRn,"mapDomain");function DRn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),Zrs=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"),kRn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),NRn=a(function(t,e,r){let n=0;for(t=r?e5(t/700):t>>1,t+=e5(t/e);t>WVt*26>>1;n+=36)t=e5(t/WVt);return e5(n+(WVt+1)*t/(t+38))},"adapt"),MRn=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&&Xq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Xq("invalid-input");let m=Zrs(t.charCodeAt(l++));m>=36&&Xq("invalid-input"),m>e5((2147483647-n)/f)&&Xq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(me5(2147483647/A)&&Xq("overflow"),f*=A}let d=e.length+1;s=NRn(n-u,d,u==0),e5(n/d)>2147483647-o&&Xq("overflow"),o+=e5(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),ORn=a(function(t){let e=[];t=DRn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(zVt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fe5((2147483647-o)/d)&&Xq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Xq("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=YVt.toASCII(e.hostname)}catch{}return Ret(hde(e))}a(sns,"normalizeLink");function ans(t){let e=jwe(t,!0);if(e.hostname&&(!e.protocol||URn.indexOf(e.protocol)>=0))try{e.hostname=YVt.toUnicode(e.hostname)}catch{}return qwe(hde(e),qwe.defaultChars+"%")}a(ans,"normalizeLinkText");function yw(t,e){if(!(this instanceof yw))return new yw(t,e);e||Fet(t)||(e=t||{},t="default"),this.inline=new SRn,this.block=new ERn,this.core=new lRn,this.renderer=new nRn,this.linkify=new RRn,this.validateLink=ons,this.normalizeLink=sns,this.normalizeLinkText=ans,this.utils=rVt,this.helpers=Ade({},sVt),this.options={},this.configure(t),e&&this.set(e)}a(yw,"MarkdownIt");yw.prototype.set=function(t){return Ade(this.options,t),this};yw.prototype.configure=function(t){let e=this;if(Fet(t)){let r=t;if(t=rns[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};yw.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};yw.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};yw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};yw.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};yw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};yw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};yw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var KVt=yw;function JVt(t){return Array.isArray(t)}a(JVt,"isArray");function cns(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||JVt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(cns,"isFenceToken");function*QRn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;JVt(r.children)&&(yield*QRn(r.children))}}a(QRn,"flattenTokensLists");function lns(){return new KVt}a(lns,"createMarkdownIt");function qRn(t){let e=[],n=lns().parse(t,{});if(!JVt(n))return e;for(let o of QRn(n)){if(!o||typeof o!="object")continue;let s=o;if(cns(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(qRn,"extractCodeBlocks");function ZVt(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(ZVt,"escapeProblematicHtmlTags");var eWt=Rn.Gpt4oMini,jRn=new fe("virtualToolSummarizer"),Vwe=class extends Error{static{a(this,"SummarizerError")}};function HRn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(HRn,"isValidCategoryItem");function GRn(t,e){if(!Array.isArray(t))throw new Vwe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(HRn))throw new Vwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(GRn,"validateCategoriesWithoutToolsResponse");function uns(t){return HRn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(uns,"isValidCategorizationItem");function $Rn(t,e){if(GRn(t,e),!t.every(uns))throw new Vwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a($Rn,"validateCategorizationResponse");function VRn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(VRn,"deduplicateTools");function dns(t){let e=new Map;for(let r of t){let n=zRn(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=qRn(r.tools);return[...e.values()]}a(Krs,"validateAndCleanupCategories");function jRn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(Rwn)}));return Krs(r)}a(jRn,"processCategorizationResponse");function HRn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(HRn,"normalizeGroupName");function YVt(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:fet,summary:vwn,tools:[...r.values()]}),t}a(YVt,"addUncategorizedToolsIfNeeded");async function JVt(t,e,r,n){if(n.isCancellationRequested)return BRn.debug(t.ctx,"Summarization cancelled"),null;let o=OA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await tl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new oc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return BRn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of LRn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(JVt,"getResponse");async function GRn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([KVt]),s=await ap.create(Aet,{tools:e},n).renderPrompt(void 0,r),c=await JVt(t,s,n,r);if(!c)return;let l=[c];return URn(l,"categorizer"),{...l[0],tools:qRn(e),name:HRn(l[0].name)}}a(GRn,"summarizeToolGroup");async function $Rn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([KVt]),s=await ap.create(yet,{tools:e},n).renderPrompt(void 0,r),c=await JVt(t,s,n,r);if(!c)return;QRn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=jRn(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 ZVt(t,u,f,r);h&&(u=h),u=YVt(u,l)}return u}a($Rn,"divideToolsIntoGroups");async function ZVt(t,e,r,n){let o=await t.ctx.get(el).getBestChatModelConfig([KVt]),c=await ap.create(Eet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await JVt(t,c,o,n);if(!l)return;QRn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=jRn(l,d);return YVt(f,d)}a(ZVt,"divideToolsIntoExistingGroups");var zRn=de(require("crypto"));var XVt=new fe("virtualToolGrouper"),WRn="builtin",ens=`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=VRn(r.tools);return[...e.values()]}a(dns,"validateAndCleanupCategories");function WRn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(Mwn)}));return dns(r)}a(WRn,"processCategorizationResponse");function zRn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(zRn,"normalizeGroupName");function XVt(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:yet,summary:Iwn,tools:[...r.values()]}),t}a(XVt,"addUncategorizedToolsIfNeeded");async function tWt(t,e,r,n){if(n.isCancellationRequested)return jRn.debug(t.ctx,"Summarization cancelled"),null;let o=LA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await tl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new sc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return jRn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of qRn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(tWt,"getResponse");async function YRn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([eWt]),s=await lp.create(bet,{tools:e},n).renderPrompt(void 0,r),c=await tWt(t,s,n,r);if(!c)return;let l=[c];return GRn(l,"categorizer"),{...l[0],tools:VRn(e),name:zRn(l[0].name)}}a(YRn,"summarizeToolGroup");async function KRn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([eWt]),s=await lp.create(Tet,{tools:e},n).renderPrompt(void 0,r),c=await tWt(t,s,n,r);if(!c)return;$Rn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=WRn(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 rWt(t,u,f,r);h&&(u=h),u=XVt(u,l)}return u}a(KRn,"divideToolsIntoGroups");async function rWt(t,e,r,n){let o=await t.ctx.get(el).getBestChatModelConfig([eWt]),c=await lp.create(Iet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await tWt(t,c,o,n);if(!l)return;$Rn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=WRn(l,d);return XVt(f,d)}a(rWt,"divideToolsIntoExistingGroups");var XRn=de(require("crypto"));var nWt=new fe("virtualToolGrouper"),ZRn="builtin",mns=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: -`,tns=` +`,gns=` -Be sure to call this tool if you need a capability related to the above.`,Uet=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"?WRn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof ev&&(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===WRn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof EK);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 ev){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){XVt.error(this.turnContext.ctx,`Failed to categorize tools: ${Xu(d)}`)}}XVt.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===fet);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 ev(Wq+d.name,ens+d.summary+tns,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 ev&&!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 GRn(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 ZVt(this.turnContext,r,e,n):await $Rn(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 ev&&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 ev&&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 zRn.createHash("sha256").update(r).digest("hex")}};var Qet=class{constructor(e){this._root=new ev(Wq,"",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){Lwe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new Uet(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 ev)return o.isExpanded=!0,new Lr([new Rr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var XO=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===Cl.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 Qet(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 YRn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(YRn,"calculateReducedMaxRequestTokens");Mo();var ons=500,qet=3,Ig=new fe("toolCallingLoop"),sns="internal.tool_calling_loop_continue_confirmation",_de=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(Tc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(gs),this.transcriptPersistence=new p0(e.ctx),this.llmRequestPersistence=Zae(()=>{if(!eKe(e.ctx))return;let d=e.subagentInfo;return new XYe(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 ede(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new pet(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=YRn(c),u=c-l;Ig.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Mt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(ons,Ft(e.ctx,Ye.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new TXe(new IXe(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(m0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=oYe(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 K$e(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(Ryn(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.`,$et=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"?ZRn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof rv&&(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===ZRn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof CK);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 rv){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){nWt.error(this.turnContext.ctx,`Failed to categorize tools: ${ed(d)}`)}}nWt.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===yet);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 rv(Kq+d.name,mns+d.summary+gns,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 rv&&!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 YRn(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 rWt(this.turnContext,r,e,n):await KRn(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 rv&&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 rv&&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 XRn.createHash("sha256").update(r).digest("hex")}};var Vet=class{constructor(e){this._root=new rv(Kq,"",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){Uwe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new $et(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 rv)return o.isExpanded=!0,new Br([new Rr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var t5=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===bl.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 Vet(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 ekn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(ekn,"calculateReducedMaxRequestTokens");Oo();var _ns=500,Wet=3,xg=new fe("toolCallingLoop"),vns="internal.tool_calling_loop_continue_confirmation",vde=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(Tc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(gs),this.transcriptPersistence=new m0(e.ctx),this.llmRequestPersistence=Xae(()=>{if(!sKe(e.ctx))return;let d=e.subagentInfo;return new oKe(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 tde(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new Eet(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=ekn(c),u=c-l;xg.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Mt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(_ns,Ft(e.ctx,Ye.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new PXe(new DXe(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(A0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=dYe(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 tVe(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(Myn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry,c.contextManagement),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 uF?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 fF?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=ap.create(det,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=iYe(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 Iq((R,x,P,D,N,L)=>{let B=R.trim(),M=B.match(Hxe)!==null&&B.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: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),Ig.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&&(Ig.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 LA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Oc;case"failed":throw this.turn.status="error",Ig.error(this.turnContext.ctx,"Fetch failed:",r),new LA({message:$_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===V_,copilotPlan:rx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new LA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new LA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new LA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new LA({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 LA({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}=xo.parseModelNotSupportedReason(r.reason);throw new LA({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 LA({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 LA({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 ev)this.handleVirtualToolCall(c,e,n);else if(c instanceof EK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;Ig.error(this.turnContext.ctx,l);let u=new Lr([new Rr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=PXe(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(XO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Lr([new Rr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;a7t(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=B3(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){Ig.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Lr([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=Vxn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=PXe(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 $q||u instanceof Oc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Lr([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{Ig.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Xu(u)}`,u),l="error";let d=new Lr([new Rr(Xu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=PXe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),a7t(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=B3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){Ig.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Xu(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(XO);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 Ig.error(this.turnContext.ctx,`Error while computing tool grouping: ${Xu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof ev?{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"?lwn(this.modelConfiguration):e.name==="apply_patch"?dwn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?WO.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=oq(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+GO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(TK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){Ig.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=oq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(XO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(yJ).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(tT),c=pJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!YO.isPotentiallySensitiveTool(e))return;let n=YO.getMatchingRuleForToolCall(e,r,this.turnContext),o=YO.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 Oc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){Ig.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=YO.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=nwn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?pJ(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 $q("Cancelled by user");case"accept":return Promise.resolve();default:throw new $q(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(Ig.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,Ig.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new uF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(qd)}catch(s){return Ig.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Xu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:sns,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 Ig.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Xu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new LA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new LA({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(ZC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){Ig.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Xu(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=dXe(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=yxn(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=Exn(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=_xn(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}));Jae(()=>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||Jae(()=>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=GO(n.content),c=Math.round(performance.now()-o);Jae(()=>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 eWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},tWt=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 dQt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(dQt,"parseModelString");var jet=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 Xf({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 JIe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new lK([c],e.conversation.source,e.conversation.userLanguage),f=new hw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=dQt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(xs).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await xo.getModelConfigurationById(e.ctx,P.id);else if(T===oKe.toLowerCase())m=!0,h=await xo.getModelConfigurationById(e.ctx,V_,d.id.toString(),iq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new da(f.ctx.get(Yn)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await hO(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 ans(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 oc(e.ctx),A=await tl(e.ctx,f,{languageId:""}),y=n||new eWt,E=new tWt(y,e.turn.id);await e.ctx.get(Tc).begin(d,c,E),await new _de(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Au).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Pn(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 ans(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 xo.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await xo.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(ans,"resolvePreferredSubagentModel");p();p();p();var Jq=de(Io());var Het=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Pn(r.request.message),c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Jq.useKeepWith)();return vscpp(vscppf,null,vscpp(Jq.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(Jq.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(tde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Jq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(Jq.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 rWt=10,cns=new Set(["file_search","grep_search","read_file"]),Get=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Rn.ClaudeHaiku45,Rn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:rWt,isLastTurn:o.oneBasedIterationNum>rWt};return ap.create(Het,s,n)}filterTools(e){return e.filter(r=>cns.has(r.name))}getMaxRounds(){return rWt+1}};p();var xJ=de(Io());var $et=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,xJ.useKeepWith)(),d=Pn(r.request.message);return vscpp(vscppf,null,vscpp(xJ.SystemMessage,{priority:1e3},vscpp(ide,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(xJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(xJ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var nWt=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 ap.create($et,s,n)}};function KRn(t){return t.isBuiltIn&&t.name==="Search"?new Get:new nWt(t)}a(KRn,"resolveSubagentConfig");var vde=class extends vu{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 D=this.subagentConfig.filterTools?.(o);D!==void 0&&(o=D),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let D=this.createAgentPromptProps(o);s=lp.create(Aet,D,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=uYe(this.modelConfiguration,c),u=await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c}),d=u.messages,f=u.promptTsxRemovedNodeCount??0;if(e===1&&!this.turn.renderedUserMessage)for(let D=d.length-1;D>=0;D--){let N=d[D];if(N.role==="user"&&N.content){this.turn.renderedUserMessage=N.content,this.recordRenderedUserMessageTranscript(N.content);break}}let h="",m=new Rq((D,N,L,B,q,M)=>{let O=D.trim(),Q=O.match(Vxe)!==null&&O.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:N,references:L,hideText:Q,notifications:B.map(U=>({severity:"warning",message:U.message})),thinking:M,editAgentRounds:[{roundId:e,reply:Q?"":D}]}),this.turn.annotations.push(...N??[]),h+=D});this.abortIfCanceled(r);let g=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let A=this.metricsTracker.computePromptPrefixMetrics(d,g),y=this.metricsTracker.computeContextManagement(this.conversation.currentPartitionId,f),E={messages:d,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:g,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(E),xg.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(E,null,2)}`);let _,v=this.metricsTracker.getTimeSinceLastLLMCall(),b=performance.now(),T=30,w={shouldRetry:a(D=>D.type==="failed"&&D.code===429&&D.retryAfter!==void 0&&D.retryAfter>=0&&D.retryAfter<=T,"shouldRetry"),onRetry:a(async D=>{let N=D.type==="failed"?D.retryAfter:void 0;N!==void 0&&(xg.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${N}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},R=await this.chatFetcher.fetchResponse(E,r,this.baseTelemetryWithExp,(D,N)=>(N.phase&&(_=N.phase),m.isFinishedAfter(D,N)),this.llmRequestPersistence,w),x=performance.now()-b;if(this.metricsTracker.recordLlmFetchComplete(),R.type==="length"){if(this.addToolCallModelResponseToTurn(h,[],R.thinking,_),this.recordAssistantRoundTranscript(h,e,R.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 BA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Oc;case"failed":throw this.turn.status="error",xg.error(this.turnContext.ctx,"Fetch failed:",r),new BA({message:W_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===z_,copilotPlan:ox(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new BA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new BA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new BA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new BA({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 BA({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}=wo.parseModelNotSupportedReason(r.reason);throw new BA({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 BA({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 BA({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 rv)this.handleVirtualToolCall(c,e,n);else if(c instanceof CK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;xg.error(this.turnContext.ctx,l);let u=new Br([new Rr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=BXe(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(t5).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;d7t(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=U3(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){xg.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=Jxn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=BXe(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 zq||u instanceof Oc)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{xg.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${ed(u)}`,u),l="error";let d=new Br([new Rr(ed(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=BXe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),d7t(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=U3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){xg.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${ed(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(t5);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 xg.error(this.turnContext.ctx,`Error while computing tool grouping: ${ed(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof rv?{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"?hwn(this.modelConfiguration):e.name==="apply_patch"?gwn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?YO.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=cq(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+VO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(xK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){xg.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=cq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(t5).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(_J).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(nT),c=mJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!JO.isPotentiallySensitiveTool(e))return;let n=JO.getMatchingRuleForToolCall(e,r,this.turnContext),o=JO.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 Oc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){xg.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=JO.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=cwn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?mJ(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 zq("Cancelled by user");case"accept":return Promise.resolve();default:throw new zq(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(xg.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,xg.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new fF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Hd)}catch(s){return xg.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${ed(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:vns,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 xg.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${ed(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new BA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new BA({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(ZC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){xg.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${ed(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=AXe(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=bxn(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=Sxn(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=Txn(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}));Zae(()=>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||Zae(()=>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=VO(n.content),c=Math.round(performance.now()-o);Zae(()=>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 iWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},oWt=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 mQt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(mQt,"parseModelString");var zet=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 tp({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 exe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new pK([c],e.conversation.source,e.conversation.userLanguage),f=new gw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=mQt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(xs).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await wo.getModelConfigurationById(e.ctx,P.id);else if(T===dKe.toLowerCase())m=!0,h=await wo.getModelConfigurationById(e.ctx,z_,d.id.toString(),aq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new Ga(f.ctx.get(ti)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await gO(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 Cns(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 sc(e.ctx),A=await tl(e.ctx,f,{languageId:""}),y=n||new iWt,E=new oWt(y,e.turn.id);await e.ctx.get(Tc).begin(d,c,E),await new vde(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Au).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Pn(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 Cns(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 wo.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await wo.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(Cns,"resolvePreferredSubagentModel");p();p();p();var ej=de(xo());var Yet=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Pn(r.request.message),c=_O(r.response?.message,!0),l=PO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,ej.useKeepWith)();return vscpp(vscppf,null,vscpp(ej.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(ej.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp($q,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Vq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(rde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(ej.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(iw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(ej.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 sWt=10,bns=new Set(["file_search","grep_search","read_file"]),Ket=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Rn.ClaudeHaiku45,Rn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:sWt,isLastTurn:o.oneBasedIterationNum>sWt};return lp.create(Yet,s,n)}filterTools(e){return e.filter(r=>bns.has(r.name))}getMaxRounds(){return sWt+1}};p();var RJ=de(xo());var Jet=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=_O(r.response?.message,!0),l=PO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,RJ.useKeepWith)(),d=Pn(r.request.message);return vscpp(vscppf,null,vscpp(RJ.SystemMessage,{priority:1e3},vscpp(ode,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(RJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp($q,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Vq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(RJ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(iw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var aWt=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 lp.create(Jet,s,n)}};function tkn(t){return t.isBuiltIn&&t.name==="Search"?new Ket:new aWt(t)}a(tkn,"resolveSubagentConfig");var Cde=class extends vu{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. @@ -3460,9 +3460,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 rde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await tl(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",eg(r.ctx,"runSubagentTool.error",l),ZI(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",eg(r.ctx,"runSubagentTool.error",l),ZI(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Agent '${c}' is not available for model invocation`)],"error");u=KRn(d);let f=new jet(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Tc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});Et(r.ctx,"runSubagentTool.success",y),ZI(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 nde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await tl(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",tg(r.ctx,"runSubagentTool.error",l),tx(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",tg(r.ctx,"runSubagentTool.error",l),tx(r.ctx,"runSubagentTool.error",l),new Br([new Rr(`Agent '${c}' is not available for model invocation`)],"error");u=tkn(d);let f=new zet(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Tc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});At(r.ctx,"runSubagentTool.success",y),tx(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": -${A.response}`,_=new Lr([new Rr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof uF?(l.properties.message="Tool call round exceed",eg(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",n7e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Lr([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 wJ=new fe("applyPatchTool"),lns=`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 fF?(l.properties.message="Tool call round exceed",tg(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",c7e(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 kJ=new fe("applyPatchTool"),Sns=`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 @@ -3531,7 +3531,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.`,Vet=class extends vu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:lns,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 Lr([new Rr("Missing patch text")],"error");let c=Iwn(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 wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let l=AJ(o),u=dde(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 wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let f={};try{wJ.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 ude)return wJ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof zO)return wJ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof nm)return wJ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return wJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Lr([new Rr(m)],"error")}}async buildCommit(e,r,n,o){return xwn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=id(c,n.uriSchemeCache),d=await n.ctx.get(ii).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new nm(`File not found: ${c}`);if(d.status==="invalid")throw new nm(`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.`,Zet=class extends vu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:Sns,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=Pwn(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 kJ.warn(e.ctx,h),new Br([new Rr(h)],"error")}let l=EJ(o),u=fde(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 kJ.warn(e.ctx,h),new Br([new Rr(h)],"error")}let f={};try{kJ.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 dde)return kJ.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 KO)return kJ.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 om)return kJ.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 kJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Br([new Rr(m)],"error")}}async buildCommit(e,r,n,o){return Dwn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=od(c,n.uriSchemeCache),d=await n.ctx.get(ni).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new om(`File not found: ${c}`);if(d.status==="invalid")throw new om(`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(` @@ -3539,7 +3539,7 @@ ${c.map(f=>` - ${f}`).join(` ${l.map(f=>` - ${f}`).join(` `)}`);let d=u.length>0?u.join(` -`):"No changes were applied.";return new Lr([new Rr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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(gs).getToolByNameAndProvider("create_file",rp);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(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=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(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 JRn=require("path");var uns=16,Gwe=class extends vu{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(gs).getToolByNameAndProvider("insert_edit_into_file",ip);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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(gs).getToolByNameAndProvider("create_file",ip);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=EJ(n.input),s=fde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=od(u,e.uriSchemeCache);return FA(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=EJ(n.input),s=fde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=od(u,e.uriSchemeCache);return FA(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 rkn=require("path");var Tns=16,Wwe=class extends vu{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 @@ -3558,37 +3558,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(t2),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:ebn,maxResults:r.input.maxResults??uns,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Lr([new Rr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=un(f.chunk.file),m=DA(f.chunk.text);return new Rr(`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(n2),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:obn,maxResults:r.input.maxResults??Tns,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=un(f.chunk.file),m=NA(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 JQ(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,JRn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(IP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(bn).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 Wet=class extends vu{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 Lr([new Rr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(gs).getToolByNameAndProvider("create_file",rp);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=nO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=GO(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 VO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Lr([new Rr(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${BA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${BA(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();Mo();function RJ(){return Mt()}a(RJ,"uuidV4");p();var oh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function ekn(t){let e=[],r=[],n=[],o,s;for(let c of dns(t))switch(c.marker){case void 0:r=c.content;break;case oh.FILEPATH:o=c.content.join(` -`).trim();break;case oh.FIND:s=ZRn(c.content);break;case oh.REPLACE:if(o&&s){let l=ZRn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case oh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(ekn,"parsePatchResponse");function ZRn(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(ZRn,"extractCodeBlock");function*dns(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(oh.FILEPATH)?s=oh.FILEPATH:o.startsWith(oh.FIND)?s=oh.FIND:o.startsWith(oh.REPLACE)?s=oh.REPLACE:o.startsWith(oh.COMPLETE)?s=oh.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(dns,"iterateSections");function fns(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=pns(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=$we(_);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=$we(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=mns(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` -`)}a(fns,"applyPatch");function pns(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&&tkn(t.charCodeAt(n));)n--;return n<0}a(XRn,"endsWith");function hns(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}=rkn(u,n),h=f;if(hs&&zet(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(mns,"adjustIndentation");function nkn(t,e){let r=t;for(let n of e){let o=fns(r,n);o!==void 0&&(r=o)}return r}a(nkn,"applyPatches");p();var gns="InstantApplyChat";function Ans(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(Ans,"isProxyModel");function yns(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Ans):[]}a(yns,"parseProxyModels");var Zq=class{constructor(e){this.ctx=e;this.logger=new fe("ProxyModelService");this.models=[];bs(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===gns)}async fetchModels(e){try{let r=tx(this.ctx,e,"proxy","models"),n=await this.ctx.get(tr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...Gy(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=yns(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 Yet=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var gE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var kJ=de(Io());var Cde=class extends lr{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=DA(d),g=DA(o);return vscpp(vscppf,null,vscpp(kJ.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 ",FA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(kJ.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(kJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(kJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var Jet=de(Io());var iWt=class extends lr{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 `",oh.FILEPATH,"`, `",oh.FIND,"` and `",oh.REPLACE,"`.",vscpp("br",null),"After ",oh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",oh.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 ",oh.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 ",oh.COMPLETE,".",vscpp("br",null))}},Ket=class extends lr{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=DA(u),h=DA(o),m=rs(this.props.uri);return vscpp(vscppf,null,vscpp(Jet.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 `",FA,"` 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(iWt,null),vscpp("br",null),vscpp(WXe,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(Jet.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${oh.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 yc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Lc(`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 Lc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Lc(`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,$le)}static subtract(e,r){return r?e.startLineNumberr)throw new Lc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=CK(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=MUt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=MUt(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 $l(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=Yze(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=CK(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 $l(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var e5=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 Ui(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Ui(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Ui(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return $l.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Yo(e.lineNumber,e.column+this.columnCount):new Yo(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Ui.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Vwe=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 yc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=CK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Yo(n,o)}getRange(e){return Ui.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return e5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new e5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var oWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Yo(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Vwe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return uKe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var mF=class extends oWt{constructor(r){super();this.value=r;this._t=new Vwe(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 Wwe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Lc(`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(yc.emptyAt(h),new yc(0,m));s.push(E)}if(!f)throw new Lc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(yc.ofStartAndLength(f.replaceRange.endExclusive,0),new yc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new yc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new yc(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 yc(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(yc.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 txe(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 yc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},ikn=class t extends Wwe{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 ett=class extends Wwe{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(UA.replace(yc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new tv(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 tv(r)}normalizeEOL(e){return new tv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=UA.replace(yc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?tv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new mF(this.apply(e.value))}mapData(e){return new sWt(this.replacements.map(r=>new bde(r.replaceRange,r.newText,e(r))))}},ttt=class extends Xet{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=cue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,xxe(n,this.newText)),c=new yc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new UA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new UA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=cue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new yc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=xxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new yc(0,this.newText.length-o))}toEdit(){return new tv([this])}},tv=class t extends ett{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 UA(e,r)])}static insert(e,r){return new t([new UA(yc.emptyAt(e),r)])}static delete(e){return new t([new UA(e,"")])}static fromJson(e){return new t(e.map(UA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew UA(e.replaceRange,e.newText)))}},bde=class t extends ttt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(yc.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 zwe=class t{constructor(e){this.replacements=e;kQt(()=>Pxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>AE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new AE(e,r)])}static insert(e,r){return new t([new AE(Ui.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 AE(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=e5.ofText(s.text);if(e.isBefore(l)){let d=new Yo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return rtt(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 Yo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Yo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Yo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return rtt(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 Yo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=rtt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=rtt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new mF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new AE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=e5.ofText(s.text),l=Yo.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 Lc;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 mF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Ui.fromPositions(new Yo(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=Ui.fromPositions(r.range.getEndPosition(),new Yo(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(` -`)}},AE=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 Lc;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,rkn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(wP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(bn).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 Xet=class extends vu{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(gs).getToolByNameAndProvider("create_file",ip);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).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=sO({uri:od(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=VO(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 zO({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=od(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${FA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Hd),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=od(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${FA(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();Oo();function PJ(){return Mt()}a(PJ,"uuidV4");p();var ah={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function okn(t){let e=[],r=[],n=[],o,s;for(let c of Ins(t))switch(c.marker){case void 0:r=c.content;break;case ah.FILEPATH:o=c.content.join(` +`).trim();break;case ah.FIND:s=nkn(c.content);break;case ah.REPLACE:if(o&&s){let l=nkn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case ah.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(okn,"parsePatchResponse");function nkn(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(nkn,"extractCodeBlock");function*Ins(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(ah.FILEPATH)?s=ah.FILEPATH:o.startsWith(ah.FIND)?s=ah.FIND:o.startsWith(ah.REPLACE)?s=ah.REPLACE:o.startsWith(ah.COMPLETE)?s=ah.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(Ins,"iterateSections");function xns(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=wns(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=zwe(_);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=zwe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=kns(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` +`)}a(xns,"applyPatch");function wns(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&&skn(t.charCodeAt(n));)n--;return n<0}a(ikn,"endsWith");function Rns(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}=akn(u,n),h=f;if(hs&&ett(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(kns,"adjustIndentation");function ckn(t,e){let r=t;for(let n of e){let o=xns(r,n);o!==void 0&&(r=o)}return r}a(ckn,"applyPatches");p();var Pns="InstantApplyChat";function Dns(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(Dns,"isProxyModel");function Nns(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Dns):[]}a(Nns,"parseProxyModels");var tj=class{constructor(e){this.ctx=e;this.logger=new fe("ProxyModelService");this.models=[];bs(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===Pns)}async fetchModels(e){try{let r=ix(this.ctx,e,"proxy","models"),n=await this.ctx.get(nr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...$y(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=Nns(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 ttt=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var AE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var DJ=de(xo());var bde=class extends lr{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=NA(d),g=NA(o);return vscpp(vscppf,null,vscpp(DJ.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 ",UA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(DJ.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(DJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(DJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var ntt=de(xo());var cWt=class extends lr{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 `",ah.FILEPATH,"`, `",ah.FIND,"` and `",ah.REPLACE,"`.",vscpp("br",null),"After ",ah.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",ah.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 ",ah.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 ",ah.COMPLETE,".",vscpp("br",null))}},rtt=class extends lr{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=NA(u),h=NA(o),m=rs(this.props.uri);return vscpp(vscppf,null,vscpp(ntt.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 `",UA,"` 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(cWt,null),vscpp("br",null),vscpp(XXe,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(ntt.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${ah.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 yc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Lc(`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 Lc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Lc(`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,Vle)}static subtract(e,r){return r?e.startLineNumberr)throw new Lc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=SK(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=FUt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=FUt(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 Vl(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=eYe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=SK(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 Vl(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var r5=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 Ui(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Ui(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Ui(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Vl.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Ko(e.lineNumber,e.column+this.columnCount):new Ko(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Ui.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Ywe=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 yc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=SK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Ko(n,o)}getRange(e){return Ui.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return r5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new r5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var lWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Ko(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Ywe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return gKe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var AF=class extends lWt{constructor(r){super();this.value=r;this._t=new Ywe(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 Kwe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Lc(`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(yc.emptyAt(h),new yc(0,m));s.push(E)}if(!f)throw new Lc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(yc.ofStartAndLength(f.replaceRange.endExclusive,0),new yc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new yc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new yc(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 yc(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(yc.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 oxe(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 yc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},lkn=class t extends Kwe{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 stt=class extends Kwe{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(QA.replace(yc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new nv(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 nv(r)}normalizeEOL(e){return new nv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=QA.replace(yc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?nv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new AF(this.apply(e.value))}mapData(e){return new uWt(this.replacements.map(r=>new Sde(r.replaceRange,r.newText,e(r))))}},att=class extends ott{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=lue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,kxe(n,this.newText)),c=new yc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new QA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new QA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=lue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new yc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=kxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new yc(0,this.newText.length-o))}toEdit(){return new nv([this])}},nv=class t extends stt{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 QA(e,r)])}static insert(e,r){return new t([new QA(yc.emptyAt(e),r)])}static delete(e){return new t([new QA(e,"")])}static fromJson(e){return new t(e.map(QA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew QA(e.replaceRange,e.newText)))}},Sde=class t extends att{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(yc.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 Jwe=class t{constructor(e){this.replacements=e;MQt(()=>Mxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>yE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new yE(e,r)])}static insert(e,r){return new t([new yE(Ui.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 yE(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=r5.ofText(s.text);if(e.isBefore(l)){let d=new Ko(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return ctt(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 Ko(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Ko?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Ko?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return ctt(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 Ko(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=ctt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=ctt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new AF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new yE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=r5.ofText(s.text),l=Ko.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 Lc;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 AF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Ui.fromPositions(new Ko(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=Ui.fromPositions(r.range.getEndPosition(),new Ko(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(` +`)}},yE=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 Lc;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=>Sde.deserialize(r)))}static fromEdit(e,r){let n=zwe.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,$le)),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 tv(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($l.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 $l(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 Sde(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 FUt(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 Sde(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Sde=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t($l.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=uKe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Ui.fromPositions(new Yo(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(Ui.fromPositions(e.range.getEndPosition(),new Yo(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 Yo(s,c)}else n=new Yo(1,1);let o=r.addToPosition(new Yo(1,1));return new AE(Ui.fromPositions(n,o),"")}else return new AE(new Ui(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=lue(r,n);r=r.substring(o),n=n.substring(o);let s=kxe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function ctt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Ui.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Lc("start must be before end");return new Ui(t.lineNumber,t.column,e.lineNumber,e.column)}a(ctt,"rangeFromPositions");var Zwe=class t{constructor(e){this.replacements=e;qK(Mxe(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=>Tde.deserialize(r)))}static fromEdit(e,r){let n=Jwe.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,Vle)),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 nv(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(Vl.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 Vl(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 Tde(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 jUt(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 Tde(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Tde=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Vl.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=gKe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Ui.fromPositions(new Ko(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(Ui.fromPositions(e.range.getEndPosition(),new Ko(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 Ko(s,c)}else n=new Ko(1,1);let o=r.addToPosition(new Ko(1,1));return new yE(Ui.fromPositions(n,o),"")}else return new yE(new Ui(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 AE(Ui.fromPositions(new Yo(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Ui(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new AE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new UA(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")})(Ens||={});var Tde=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new ntt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new ntt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return okn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return okn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Ywe.fromEdit(e,new mF(this.originalText)),n=txe(r.replacements,s=>s.lineRange.length),o=txe(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}))}}},ntt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function okn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(okn,"sum");p();var Ide=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=tv.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=_ns(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 aWt(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(aWt,"compute4GramTextSimilarity");function _ns(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(_ns,"applyEditsToRanges");p();p();var Kwe=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 Yo(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 itt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Kwe(t),c=new Kwe(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 yc(g,A);l.push(new UA(y,m))}return new tv(l)}a(itt,"stringEditFromDiff");p();p();var skn=de(require("path")),akn=require("worker_threads");var cWt=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 vns(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(vns,"createRpcProxy");var ott=class{constructor(e,r,n){this.responseHandler=new cWt;this.worker=new akn.Worker(e,r),CIe(this.worker,skn.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=vns((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 stt=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 Jwe=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 $l(s,u.original.startLineNumber),new $l(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new $l(s,r+1),new $l(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 t5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Lc("not a valid diff");return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new t5(new Ui(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Ui(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(ckn(this.original.endLineNumberExclusive,e)&&ckn(this.modified.endLineNumberExclusive,r))return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new t5(Ui.fromPositions(new Yo(this.original.startLineNumber,1),xde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(new Yo(this.modified.startLineNumber,1),xde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new t5(Ui.fromPositions(xde(new Yo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),xde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(xde(new Yo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),xde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Lc}};function xde(t,e){if(t.lineNumber<1)return new Yo(1,1);if(t.lineNumber>e.length)return new Yo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Yo(t.lineNumber,r.length+1):t}a(xde,"normalizePosition");function ckn(t,e){return t>=1&&t<=e.length}a(ckn,"isValidLineNumber");var att=class t extends Jwe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=$l.join(e.map(o=>$l.fromRangeInclusive(o.originalRange))),n=$l.join(e.map(o=>$l.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()])}},t5=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 Lc("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 AE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var ukn=require("fs");var Aw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new Aq(()=>{let e=Cns([yKe(__dirname,"diffWorker.js"),yKe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ott(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:lkn(o.changes),moves:o.moves.map(c=>new stt(new Jwe(new $l(c[0],c[1]),new $l(c[2],c[3])),lkn(c[4])))}}};function lkn(t){return t.map(e=>new att(new $l(e[0],e[1]),new $l(e[2],e[3]),e[4]?.map(r=>new t5(new Ui(r[0],r[1],r[2],r[3]),new Ui(r[4],r[5],r[6],r[7])))))}a(lkn,"toLineRangeMappings");function Cns(t){for(let e of t)if((0,ukn.existsSync)(e))return e}a(Cns,"firstExistingPath");var ctt=new fe("editSurvivalReporter"),lWt=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 eq;this._editSurvivalTracker=new Ide(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=uf(this._document.uri),r=this.ctx.get(nw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){ctt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=uf(this._document.uri),n=await this.ctx.get(nw).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 ctt.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(ii).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Lc(`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 itt(r,n,e.get(Aw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var ltt=class extends lWt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new fKe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{ctt.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 Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw ctt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var dkn=new fe("editSurvivalTrackerService"),bns=[0,30*1e3,120*1e3,300*1e3,600*1e3],nT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){dkn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??bns,c;return{startReporter:a(l=>{(async()=>{try{let u=await itt(r,n,this.ctx.get(Aw));c=new ltt(this.ctx,e,r,n,u,l,s)}catch(u){dkn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Xu(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Sns=1e3,fkn=256e3,pkn=64e3;function Tns(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(Tns,"makeProxyInstantApplyModelConfiguration");var Ins=8e3,hkn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},xns={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},utt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new fe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new gE("No uri found in code block");if(o.isCancellationRequested)throw new Yet;e.code.includes(FA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ii).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 gE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(FA))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(Zt).updateExPValuesAndAssignments(f),m=this.ctx.get(Zt).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: ${Xu(g)}`),Vn(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Zq).instantApplyModels[0]?.name??"unknown":"default"}),Ft(this.ctx,Ye.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=ws("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 gE("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(nT),E=RJ(),_=[],v=0,b=0,T=f.length+e.code.length+Sns;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(oc).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 gE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await ap.create(Cde,{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:Ji(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:DA(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 gE(D)}}else{if(x.type==="canceled")throw new Oc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new gE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Cde,e,r,n,o,s,c,l,u,d=>wns(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",Ket,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=ekn(d);if(h.patches.length===0)throw new gE(`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=nkn(f,h.patches);if(m===void 0)throw new gE(`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 gE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await xo.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 ap.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(nT),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Zt).updateExPValuesAndAssignments(b),w=RJ(),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(oc).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 gE(`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:DA(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:P.requestId}}}else{if(P.type==="canceled")throw new Oc;{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 gE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>fkn)throw new gE(`Document too large: ${l} characters (limit: ${fkn})`);let u=this.ctx.get(Zq).instantApplyModels[0],d=u?Tns(u.name):void 0,h=await ap.create(Cde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??hkn).renderPrompt(void 0,n),m=h.tokenCount;if(m>pkn)throw new gE(`Prompt too large: ${m} tokens (limit: ${pkn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` -`),A=this.ctx.get(Zt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Pn(n.content);return n.role==="system"?`${r} +`).join("")),new yE(Ui.fromPositions(new Ko(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Ui(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new yE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new QA(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")})(Mns||={});var Ide=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new ltt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new ltt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return ukn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return ukn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Zwe.fromEdit(e,new AF(this.originalText)),n=oxe(r.replacements,s=>s.lineRange.length),o=oxe(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}))}}},ltt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function ukn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(ukn,"sum");p();var xde=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=nv.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=Ons(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 dWt(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(dWt,"compute4GramTextSimilarity");function Ons(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(Ons,"applyEditsToRanges");p();p();var Xwe=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 Ko(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 utt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Xwe(t),c=new Xwe(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 yc(g,A);l.push(new QA(y,m))}return new nv(l)}a(utt,"stringEditFromDiff");p();p();var dkn=de(require("path")),fkn=require("worker_threads");var fWt=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 Lns(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(Lns,"createRpcProxy");var dtt=class{constructor(e,r,n){this.responseHandler=new fWt;this.worker=new fkn.Worker(e,r),TIe(this.worker,dkn.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=Lns((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 ftt=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 eRe=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 Vl(s,u.original.startLineNumber),new Vl(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Vl(s,r+1),new Vl(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 n5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Lc("not a valid diff");return new n5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new n5(new Ui(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Ui(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(pkn(this.original.endLineNumberExclusive,e)&&pkn(this.modified.endLineNumberExclusive,r))return new n5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new n5(Ui.fromPositions(new Ko(this.original.startLineNumber,1),wde(new Ko(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(new Ko(this.modified.startLineNumber,1),wde(new Ko(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new n5(Ui.fromPositions(wde(new Ko(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),wde(new Ko(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(wde(new Ko(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),wde(new Ko(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Lc}};function wde(t,e){if(t.lineNumber<1)return new Ko(1,1);if(t.lineNumber>e.length)return new Ko(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Ko(t.lineNumber,r.length+1):t}a(wde,"normalizePosition");function pkn(t,e){return t>=1&&t<=e.length}a(pkn,"isValidLineNumber");var ptt=class t extends eRe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Vl.join(e.map(o=>Vl.fromRangeInclusive(o.originalRange))),n=Vl.join(e.map(o=>Vl.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()])}},n5=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 Lc("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 yE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var mkn=require("fs");var Ew=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new _q(()=>{let e=Bns([SKe(__dirname,"diffWorker.js"),SKe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new dtt(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:hkn(o.changes),moves:o.moves.map(c=>new ftt(new eRe(new Vl(c[0],c[1]),new Vl(c[2],c[3])),hkn(c[4])))}}};function hkn(t){return t.map(e=>new ptt(new Vl(e[0],e[1]),new Vl(e[2],e[3]),e[4]?.map(r=>new n5(new Ui(r[0],r[1],r[2],r[3]),new Ui(r[4],r[5],r[6],r[7])))))}a(hkn,"toLineRangeMappings");function Bns(t){for(let e of t)if((0,mkn.existsSync)(e))return e}a(Bns,"firstExistingPath");var htt=new fe("editSurvivalReporter"),pWt=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 nq;this._editSurvivalTracker=new xde(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=ff(this._document.uri),r=this.ctx.get(ow);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){htt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=ff(this._document.uri),n=await this.ctx.get(ow).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 htt.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(ni).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Lc(`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 utt(r,n,e.get(Ew)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var mtt=class extends pWt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new yKe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{htt.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 xde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new xde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw htt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var gkn=new fe("editSurvivalTrackerService"),Fns=[0,30*1e3,120*1e3,300*1e3,600*1e3],oT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){gkn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??Fns,c;return{startReporter:a(l=>{(async()=>{try{let u=await utt(r,n,this.ctx.get(Ew));c=new mtt(this.ctx,e,r,n,u,l,s)}catch(u){gkn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${ed(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Uns=1e3,Akn=256e3,ykn=64e3;function Qns(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(Qns,"makeProxyInstantApplyModelConfiguration");var qns=8e3,Ekn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},jns={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},gtt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new fe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new AE("No uri found in code block");if(o.isCancellationRequested)throw new ttt;e.code.includes(UA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ni).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 AE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(UA))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(Zt).updateExPValuesAndAssignments(f),m=this.ctx.get(Zt).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: ${ed(g)}`),ai(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(tj).instantApplyModels[0]?.name??"unknown":"default"}),Ft(this.ctx,Ye.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=ws("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 AE("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(oT),E=PJ(),_=[],v=0,b=0,T=f.length+e.code.length+Uns;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(sc).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 AE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await lp.create(bde,{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:Ji(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:NA(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 AE(D)}}else{if(x.type==="canceled")throw new Oc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new AE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",bde,e,r,n,o,s,c,l,u,d=>Hns(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",rtt,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=okn(d);if(h.patches.length===0)throw new AE(`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=ckn(f,h.patches);if(m===void 0)throw new AE(`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 AE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await wo.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 lp.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(oT),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Zt).updateExPValuesAndAssignments(b),w=PJ(),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(sc).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 AE(`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:NA(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:P.requestId}}}else{if(P.type==="canceled")throw new Oc;{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 AE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>Akn)throw new AE(`Document too large: ${l} characters (limit: ${Akn})`);let u=this.ctx.get(tj).instantApplyModels[0],d=u?Qns(u.name):void 0,h=await lp.create(bde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??Ekn).renderPrompt(void 0,n),m=h.tokenCount;if(m>ykn)throw new AE(`Prompt too large: ${m} tokens (limit: ${ykn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` +`),A=this.ctx.get(Zt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Pn(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 wns(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(wns,"extractCodeBlock");var dtt=class extends vu{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:Ji(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:Ji(e.resource)})}};function Hns(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(Hns,"extractCodeBlock");var Att=class extends vu{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... @@ -3622,9 +3622,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 Lr([new Rr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=id(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new utt(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(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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=nO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await tl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=GO(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 VO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Lr([new Rr(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Pyn(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=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(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 mkn=require("crypto"),n5=de(require("fs/promises")),gkn=require("os"),r5=de(require("path"));var gF=class{constructor(e){this.ctx=e;this.logger=new fe("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=r5.extname(__filename)===".ts"?r5.resolve(__dirname,"../../../packages/ripgrep/bin"):r5.resolve(__dirname,"./bin"),c=r5.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 n5.readFile(c),u=(0,mkn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||r5.join((0,gkn.homedir)(),".cache"),f=r5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await n5.mkdir(f,{recursive:!0});let h=Ji(Ks(c)),m=r5.join(f,h);try{await n5.stat(m)}catch{await n5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await n5.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 Akn=require("child_process"),uWt=require("perf_hooks");var AF=new fe("ripgrepProcessManager"),yF=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,AF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){AF.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){AF.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){AF.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){AF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}AF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:RJ(),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(` -`);AF.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=uWt.performance.now();AF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Akn.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=uWt.performance.now()-r;AF.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 ftt(t){return t.some(e=>!la.isRegisteredScheme(to(e.uri).scheme))}a(ftt,"hasRipgrepWorkspaceFolder");async function ptt(t,e){try{return{rgPath:await t.ctx.get(gF).resolvePath(),ripgrepManager:t.ctx.get(yF)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(ptt,"resolveRipgrepResources");var ykn=new fe("findFilesTool"),htt=class t extends vu{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=od(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new gtt(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(gs).getToolByNameAndProvider("insert_edit_into_file",ip);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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=sO({uri:od(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await tl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=VO(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 zO({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){Lyn(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=od(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${FA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Hd),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=od(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${FA(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 _kn=require("crypto"),s5=de(require("fs/promises")),vkn=require("os"),i5=de(require("path"));var yF=class{constructor(e){this.ctx=e;this.logger=new fe("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=i5.extname(__filename)===".ts"?i5.resolve(__dirname,"../../../packages/ripgrep/bin"):i5.resolve(__dirname,"./bin"),c=i5.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 s5.readFile(c),u=(0,_kn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||i5.join((0,vkn.homedir)(),".cache"),f=i5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await s5.mkdir(f,{recursive:!0});let h=Ji(Ks(c)),m=i5.join(f,h);try{await s5.stat(m)}catch{await s5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await s5.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 Ckn=require("child_process"),hWt=require("perf_hooks");var EF=new fe("ripgrepProcessManager"),_F=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,EF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){EF.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){EF.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){EF.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){EF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}EF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:PJ(),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(` +`);EF.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=hWt.performance.now();EF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Ckn.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=hWt.performance.now()-r;EF.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 ytt(t){return t.some(e=>!da.isRegisteredScheme(to(e.uri).scheme))}a(ytt,"hasRipgrepWorkspaceFolder");async function Ett(t,e){try{return{rgPath:await t.ctx.get(yF).resolvePath(),ripgrepManager:t.ctx.get(_F)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(Ett,"resolveRipgrepResources");var bkn=new fe("findFilesTool"),_tt=class t extends vu{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 @@ -3640,12 +3640,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 Lr([new Rr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(ftt(c)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await ptt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{ykn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),la.isRegisteredScheme(to(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),ykn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` -`)}`)}catch(E){if(E instanceof bl){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 Lr([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} +- **/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(ytt(c)){if(n.isCancellationRequested)return new Br([new Rr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await Ett(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{bkn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),da.isRegisteredScheme(to(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),bkn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` +`)}`)}catch(E){if(E instanceof Sl){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 Lr([new Rr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(la).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:un(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${un(wa(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 Ekn=new fe("findTextInFilesTool"),mtt=class t extends vu{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(da).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:un(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${un(Ra(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 Skn=new fe("findTextInFilesTool"),vtt=class t extends vu{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) @@ -3658,13 +3658,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 Lr([new Rr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(ftt(u)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await ptt(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{Ekn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),la.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),Ekn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` -`)}`)}catch(v){if(v instanceof bl){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 Lr([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 +- 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(ytt(u)){if(n.isCancellationRequested)return new Br([new Rr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await Ett(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{Skn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),da.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),Skn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` +`)}`)}catch(v){if(v instanceof Sl){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 Lr([new Rr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(la).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",un(n.uri)];return(await e.execute(r,u,l,{cwd:un(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 Att=de(require("path"));var gtt=class extends vu{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=id(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Lr([new Rr("Error: Path is outside of workspace folders")],"error");let u=await OXe(e.ctx,l.toString());return u.length===0?new Lr([new Rr("Folder is empty")],"success"):new Lr([new Rr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` -`))],"success")}prepareInvocation(e,r){let n=id(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${BA(n)}`}}prepareCompletion(e,r){let n=id(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${BA(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=rs(e),o=rs(r);if(!n||!o)return!1;let s=Att.relative(o,n);return s===""?!0:!s.startsWith("..")&&!Att.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var ytt=2e3,Ett=class t extends vu{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(da).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",un(n.uri)];return(await e.execute(r,u,l,{cwd:un(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 btt=de(require("path"));var Ctt=class extends vu{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=od(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 qXe(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=od(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${FA(n)}`}}prepareCompletion(e,r){let n=od(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${FA(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=rs(e),o=rs(r);if(!n||!o)return!1;let s=btt.relative(o,n);return s===""?!0:!s.startsWith("..")&&!btt.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var Stt=2e3,Ttt=class t extends vu{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 @@ -3675,33 +3675,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??ytt),ytt),u=Math.max(1,s??1),d=u+l-1,f=id(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(ii).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Lr([new Rr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Lr([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 Zwe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},_tt=class extends Zwe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},vtt=class extends Zwe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},Ctt=class extends Zwe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Rns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Rns,"escapeRegex");function kns(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(kns,"calculateSimilarity");function dWt(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=Pns(t,e,o);if(s.type!=="none")return s;let c=Dns(t,e,o,n);if(c.type!=="none")return c;let l=Nns(t,e,o,n);if(l.type!=="none")return l;let u=Mns(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(dWt,"findAndReplaceOne");function Pns(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(Pns,"tryExactMatch");function Dns(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(Dns,"tryWhitespaceFlexibleMatch");function Nns(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??Stt),Stt),u=Math.max(1,s??1),d=u+l-1,f=od(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(ni).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 tRe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},Itt=class extends tRe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},xtt=class extends tRe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},wtt=class extends tRe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Gns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Gns,"escapeRegex");function $ns(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($ns,"calculateSimilarity");function mWt(t,e,r,n){let o=r.replace(/\r\n/g,` +`).replace(/\n/g,n),s=Vns(t,e,o);if(s.type!=="none")return s;let c=Wns(t,e,o,n);if(c.type!=="none")return c;let l=zns(t,e,o,n);if(l.type!=="none")return l;let u=Yns(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(mWt,"findAndReplaceOne");function Vns(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(Vns,"tryExactMatch");function Wns(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(Wns,"tryWhitespaceFlexibleMatch");function zns(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=Rns(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(Nns,"tryFuzzyMatch");function Mns(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(Mns,"trySimilarityMatch");var _kn=new fe("replaceStringTool"),btt=class extends vu{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{_kn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=id(o,e.uriSchemeCache);if(s===c)throw new Ctt("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=Gns(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(zns,"tryFuzzyMatch");function Yns(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(Yns,"trySimilarityMatch");var Tkn=new fe("replaceStringTool"),Rtt=class extends vu{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{Tkn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=od(o,e.uriSchemeCache);if(s===c)throw new wtt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r `)?`\r `:` -`,f=dWt(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=mWt(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)&&(_kn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=dWt(u,g,c,d))}if(f.type==="none")throw new _tt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new vtt(`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 Lr([new Rr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(ii).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(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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 Lr([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=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),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=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(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 Ttt=de(AP());var up=new fe("validateCvesTool"),Stt=class t extends vu{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(lqt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled at start"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return up.debug(e.ctx,"No dependencies provided to validate"),new Lr([new Rr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(up.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(up.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");up.debug(e.ctx,`CVE summary: ${u}`)}return new Lr([new Rr(l)],"success")}catch(c){if(xP(c))return up.debug(e.ctx,"CVE validation cancelled"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return up.exception(e.ctx,c,".invoke"),new Lr([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){up.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 up.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw up.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){up.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),up.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=Ttt.coerce(m);if(!g){f.push(h.id),up.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}up.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||Ttt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return up.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}): ${zVt(f.summary)} +`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(Tkn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=mWt(u,g,c,d))}if(f.type==="none")throw new Itt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new xtt(`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(ni).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(gs).getToolByNameAndProvider("insert_edit_into_file",ip);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).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=od(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${FA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Hd),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=od(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${FA(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 Ptt=de(EP());var fp=new fe("validateCvesTool"),ktt=class t extends vu{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(pqt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return fp.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 fp.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(fp.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return fp.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(fp.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");fp.debug(e.ctx,`CVE summary: ${u}`)}return new Br([new Rr(l)],"success")}catch(c){if(RP(c))return fp.debug(e.ctx,"CVE validation cancelled"),new Br([new Rr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return fp.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){fp.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 fp.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw fp.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){fp.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),fp.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=Ptt.coerce(m);if(!g){f.push(h.id),fp.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}fp.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||Ptt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return fp.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}): ${ZVt(f.summary)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${zVt(f.description)}`,h}).join(` +`,h+=` - **Details**: ${ZVt(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 Ons(t){return[new gtt,new Ett,new dtt,new btt,new Vet,new Wet,new htt,new mtt,new Stt]}a(Ons,"getAllClsTools");function vkn(t,e){Ons(t).forEach(e.registerTool.bind(e)),t.get(bn).onDidSetCapabilities(r=>{t.get(jl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new vde):r.subAgent?e.registerTool(new vde):e.unregisterTool(new vde),r.manageTodoListTool?e.registerTool(new WO(t)):e.unregisterTool(new WO(t)),r.watchedFiles?e.registerTool(new Gwe):e.unregisterTool(new Gwe)})}a(vkn,"registerAllClsTools");var gs=class{constructor(e){this.ctx=e;this._toolRegistry=new $ze;vkn(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 Oc;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 Lr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Oc;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=>iwn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>own.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(dg.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(dg.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(dg.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(dg.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(rp.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(rp.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(dg.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(dg.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(rp.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(rp.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(dg.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(dg.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(rp.id)??[],f=e.get(dg.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==dg.id&&m!==rp.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(Ld);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(!ZIe(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===dg.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===rp.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===dg.id||o.toolProvider.id===rp.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===dg.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===rp.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(ZIe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===rp.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===dg.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dg.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 Xq=class extends YQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:rp,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(F_).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 Oc;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(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};ki(k,{$brand:()=>fWt,$input:()=>cKt,$output:()=>aKt,NEVER:()=>eRe,TimePrecision:()=>dKt,ZodAny:()=>Xkn,ZodArray:()=>nPn,ZodBase64:()=>vJt,ZodBase64URL:()=>CJt,ZodBigInt:()=>QRe,ZodBigIntFormat:()=>TJt,ZodBoolean:()=>URe,ZodCIDRv4:()=>EJt,ZodCIDRv6:()=>_Jt,ZodCUID:()=>fJt,ZodCUID2:()=>pJt,ZodCatch:()=>yPn,ZodCustom:()=>_rt,ZodCustomStringFormat:()=>Ykn,ZodDate:()=>Art,ZodDefault:()=>fPn,ZodDiscriminatedUnion:()=>iPn,ZodE164:()=>bJt,ZodEmail:()=>aJt,ZodEmoji:()=>uJt,ZodEnum:()=>LRe,ZodError:()=>_os,ZodFile:()=>uPn,ZodGUID:()=>frt,ZodIPv4:()=>AJt,ZodIPv6:()=>yJt,ZodISODate:()=>lrt,ZodISODateTime:()=>crt,ZodISODuration:()=>drt,ZodISOTime:()=>urt,ZodIntersection:()=>oPn,ZodIssueCode:()=>OJt,ZodJWT:()=>SJt,ZodKSUID:()=>gJt,ZodLazy:()=>SPn,ZodLiteral:()=>lPn,ZodMap:()=>aPn,ZodNaN:()=>_Pn,ZodNanoID:()=>dJt,ZodNever:()=>tPn,ZodNonOptional:()=>DJt,ZodNull:()=>Zkn,ZodNullable:()=>dPn,ZodNumber:()=>FRe,ZodNumberFormat:()=>qde,ZodObject:()=>yrt,ZodOptional:()=>PJt,ZodPipe:()=>NJt,ZodPrefault:()=>hPn,ZodPromise:()=>IPn,ZodReadonly:()=>vPn,ZodRealError:()=>Qde,ZodRecord:()=>wJt,ZodSet:()=>cPn,ZodString:()=>BRe,ZodStringFormat:()=>Cu,ZodSuccess:()=>APn,ZodSymbol:()=>Kkn,ZodTemplateLiteral:()=>bPn,ZodTransform:()=>RJt,ZodTuple:()=>sPn,ZodType:()=>ks,ZodULID:()=>hJt,ZodURL:()=>cJt,ZodUUID:()=>SF,ZodUndefined:()=>Jkn,ZodUnion:()=>xJt,ZodUnknown:()=>ePn,ZodVoid:()=>rPn,ZodXID:()=>mJt,_ZodString:()=>sJt,_default:()=>pPn,any:()=>IJt,array:()=>Fr,base64:()=>Uos,base64url:()=>Qos,bigint:()=>zos,boolean:()=>ol,catch:()=>EPn,check:()=>xPn,cidrv4:()=>Bos,cidrv6:()=>Fos,clone:()=>iT,coerce:()=>jRe,config:()=>im,core:()=>bF,cuid:()=>kos,cuid2:()=>Pos,custom:()=>MJt,date:()=>ess,discriminatedUnion:()=>Ert,e164:()=>qos,email:()=>Cos,emoji:()=>wos,endsWith:()=>wRe,enum:()=>rv,file:()=>css,flattenError:()=>lRe,float32:()=>Gos,float64:()=>$os,formatError:()=>uRe,function:()=>YKt,getErrorMap:()=>yss,globalRegistry:()=>s5,gt:()=>vF,gte:()=>tb,guid:()=>bos,includes:()=>IRe,instanceof:()=>hss,int:()=>oJt,int32:()=>Vos,int64:()=>Yos,intersection:()=>qRe,ipv4:()=>Oos,ipv6:()=>Los,iso:()=>Ude,json:()=>gss,jwt:()=>jos,keyof:()=>tss,ksuid:()=>Mos,lazy:()=>TPn,length:()=>Fde,literal:()=>Gn,locales:()=>_Re,looseObject:()=>om,lowercase:()=>SRe,lt:()=>_F,lte:()=>yw,map:()=>oss,maxLength:()=>Bde,maxSize:()=>Lde,mime:()=>RRe,minLength:()=>tj,minSize:()=>FJ,multipleOf:()=>BJ,nan:()=>dss,nanoid:()=>Ros,nativeEnum:()=>ass,negative:()=>UKt,never:()=>grt,nonnegative:()=>qKt,nonoptional:()=>gPn,nonpositive:()=>QKt,normalize:()=>kRe,null:()=>mrt,nullable:()=>prt,nullish:()=>lss,number:()=>ka,object:()=>zr,optional:()=>bu,overwrite:()=>CF,parse:()=>tJt,parseAsync:()=>rJt,partialRecord:()=>iss,pipe:()=>hrt,positive:()=>FKt,prefault:()=>mPn,preprocess:()=>vrt,prettifyError:()=>TWt,promise:()=>pss,property:()=>jKt,readonly:()=>CPn,record:()=>xl,refine:()=>wPn,regex:()=>bRe,regexes:()=>MJ,registry:()=>Utt,safeParse:()=>nJt,safeParseAsync:()=>iJt,set:()=>sss,setErrorMap:()=>Ass,size:()=>CRe,startsWith:()=>xRe,strictObject:()=>rss,string:()=>Je,stringFormat:()=>Hos,stringbool:()=>mss,success:()=>uss,superRefine:()=>RPn,symbol:()=>Jos,templateLiteral:()=>fss,toJSONSchema:()=>KKt,toLowerCase:()=>DRe,toUpperCase:()=>NRe,transform:()=>kJt,treeifyError:()=>SWt,trim:()=>PRe,tuple:()=>nss,uint32:()=>Wos,uint64:()=>Kos,ulid:()=>Dos,undefined:()=>Zos,union:()=>Il,unknown:()=>od,uppercase:()=>TRe,url:()=>lJt,uuid:()=>Sos,uuidv4:()=>Tos,uuidv6:()=>Ios,uuidv7:()=>xos,void:()=>Xos,xid:()=>Nos});p();var bF={};ki(bF,{$ZodAny:()=>Jzt,$ZodArray:()=>gRe,$ZodAsyncError:()=>i5,$ZodBase64:()=>qzt,$ZodBase64URL:()=>jzt,$ZodBigInt:()=>Btt,$ZodBigIntFormat:()=>Wzt,$ZodBoolean:()=>mRe,$ZodCIDRv4:()=>Fzt,$ZodCIDRv6:()=>Uzt,$ZodCUID:()=>xzt,$ZodCUID2:()=>wzt,$ZodCatch:()=>gYt,$ZodCheck:()=>Tf,$ZodCheckBigIntFormat:()=>nzt,$ZodCheckEndsWith:()=>mzt,$ZodCheckGreaterThan:()=>Ntt,$ZodCheckIncludes:()=>pzt,$ZodCheckLengthEquals:()=>lzt,$ZodCheckLessThan:()=>Dtt,$ZodCheckLowerCase:()=>dzt,$ZodCheckMaxLength:()=>azt,$ZodCheckMaxSize:()=>izt,$ZodCheckMimeType:()=>Azt,$ZodCheckMinLength:()=>czt,$ZodCheckMinSize:()=>ozt,$ZodCheckMultipleOf:()=>tzt,$ZodCheckNumberFormat:()=>rzt,$ZodCheckOverwrite:()=>yzt,$ZodCheckProperty:()=>gzt,$ZodCheckRegex:()=>uzt,$ZodCheckSizeEquals:()=>szt,$ZodCheckStartsWith:()=>hzt,$ZodCheckStringFormat:()=>Dde,$ZodCheckUpperCase:()=>fzt,$ZodCustom:()=>CYt,$ZodCustomStringFormat:()=>$zt,$ZodDate:()=>eYt,$ZodDefault:()=>fYt,$ZodDiscriminatedUnion:()=>rYt,$ZodE164:()=>Hzt,$ZodEmail:()=>bzt,$ZodEmoji:()=>Tzt,$ZodEnum:()=>aYt,$ZodError:()=>cRe,$ZodFile:()=>lYt,$ZodFunction:()=>art,$ZodGUID:()=>vzt,$ZodIPv4:()=>Lzt,$ZodIPv6:()=>Bzt,$ZodISODate:()=>Nzt,$ZodISODateTime:()=>Dzt,$ZodISODuration:()=>Ozt,$ZodISOTime:()=>Mzt,$ZodIntersection:()=>nYt,$ZodJWT:()=>Gzt,$ZodKSUID:()=>Pzt,$ZodLazy:()=>vYt,$ZodLiteral:()=>cYt,$ZodMap:()=>oYt,$ZodNaN:()=>AYt,$ZodNanoID:()=>Izt,$ZodNever:()=>Zzt,$ZodNonOptional:()=>hYt,$ZodNull:()=>Kzt,$ZodNullable:()=>dYt,$ZodNumber:()=>Ltt,$ZodNumberFormat:()=>Vzt,$ZodObject:()=>tYt,$ZodOptional:()=>uYt,$ZodPipe:()=>yRe,$ZodPrefault:()=>pYt,$ZodPromise:()=>_Yt,$ZodReadonly:()=>yYt,$ZodRealError:()=>kde,$ZodRecord:()=>iYt,$ZodRegistry:()=>Mde,$ZodSet:()=>sYt,$ZodString:()=>OJ,$ZodStringFormat:()=>Vl,$ZodSuccess:()=>mYt,$ZodSymbol:()=>zzt,$ZodTemplateLiteral:()=>EYt,$ZodTransform:()=>ARe,$ZodTuple:()=>LJ,$ZodType:()=>uo,$ZodULID:()=>Rzt,$ZodURL:()=>Szt,$ZodUUID:()=>Czt,$ZodUndefined:()=>Yzt,$ZodUnion:()=>Ftt,$ZodUnknown:()=>Nde,$ZodVoid:()=>Xzt,$ZodXID:()=>kzt,$brand:()=>fWt,$constructor:()=>dt,$input:()=>cKt,$output:()=>aKt,Doc:()=>hRe,JSONSchema:()=>Vkn,JSONSchemaGenerator:()=>ORe,NEVER:()=>eRe,TimePrecision:()=>dKt,_any:()=>DKt,_array:()=>MRe,_base64:()=>nrt,_base64url:()=>irt,_bigint:()=>TKt,_boolean:()=>bKt,_catch:()=>pos,_cidrv4:()=>trt,_cidrv6:()=>rrt,_coercedBigint:()=>IKt,_coercedBoolean:()=>SKt,_coercedDate:()=>LKt,_coercedNumber:()=>AKt,_coercedString:()=>uKt,_cuid:()=>ztt,_cuid2:()=>Ytt,_custom:()=>$Kt,_date:()=>OKt,_default:()=>uos,_discriminatedUnion:()=>Xis,_e164:()=>ort,_email:()=>Qtt,_emoji:()=>Vtt,_endsWith:()=>wRe,_enum:()=>ios,_file:()=>GKt,_float32:()=>EKt,_float64:()=>_Kt,_gt:()=>vF,_gte:()=>tb,_guid:()=>vRe,_includes:()=>IRe,_int:()=>yKt,_int32:()=>vKt,_int64:()=>xKt,_intersection:()=>eos,_ipv4:()=>Xtt,_ipv6:()=>ert,_isoDate:()=>pKt,_isoDateTime:()=>fKt,_isoDuration:()=>mKt,_isoTime:()=>hKt,_jwt:()=>srt,_ksuid:()=>Ztt,_lazy:()=>Aos,_length:()=>Fde,_literal:()=>sos,_lowercase:()=>SRe,_lt:()=>_F,_lte:()=>yw,_map:()=>ros,_max:()=>yw,_maxLength:()=>Bde,_maxSize:()=>Lde,_mime:()=>RRe,_min:()=>tb,_minLength:()=>tj,_minSize:()=>FJ,_multipleOf:()=>BJ,_nan:()=>BKt,_nanoid:()=>Wtt,_nativeEnum:()=>oos,_negative:()=>UKt,_never:()=>NKt,_nonnegative:()=>qKt,_nonoptional:()=>dos,_nonpositive:()=>QKt,_normalize:()=>kRe,_null:()=>PKt,_nullable:()=>los,_number:()=>gKt,_optional:()=>cos,_overwrite:()=>CF,_parse:()=>xtt,_parseAsync:()=>wtt,_pipe:()=>hos,_positive:()=>FKt,_promise:()=>yos,_property:()=>jKt,_readonly:()=>mos,_record:()=>tos,_refine:()=>VKt,_regex:()=>bRe,_safeParse:()=>Rtt,_safeParseAsync:()=>ktt,_set:()=>nos,_size:()=>CRe,_startsWith:()=>xRe,_string:()=>lKt,_stringFormat:()=>zKt,_stringbool:()=>WKt,_success:()=>fos,_symbol:()=>RKt,_templateLiteral:()=>gos,_toLowerCase:()=>DRe,_toUpperCase:()=>NRe,_transform:()=>aos,_trim:()=>PRe,_tuple:()=>HKt,_uint32:()=>CKt,_uint64:()=>wKt,_ulid:()=>Ktt,_undefined:()=>kKt,_union:()=>Zis,_unknown:()=>Ode,_uppercase:()=>TRe,_url:()=>$tt,_uuid:()=>qtt,_uuidv4:()=>jtt,_uuidv6:()=>Htt,_uuidv7:()=>Gtt,_void:()=>MKt,_xid:()=>Jtt,clone:()=>iT,config:()=>im,flattenError:()=>lRe,formatError:()=>uRe,function:()=>YKt,globalConfig:()=>Xwe,globalRegistry:()=>s5,isValidBase64:()=>Qzt,isValidBase64URL:()=>qkn,isValidJWT:()=>jkn,locales:()=>_Re,parse:()=>dRe,parseAsync:()=>fRe,prettifyError:()=>TWt,regexes:()=>MJ,registry:()=>Utt,safeParse:()=>Pde,safeParseAsync:()=>pRe,toDotPath:()=>bkn,toJSONSchema:()=>KKt,treeifyError:()=>SWt,util:()=>qr,version:()=>Ezt});p();p();var eRe=Object.freeze({status:"aborted"});function dt(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(dt,"$constructor");var fWt=Symbol("zod_brand"),i5=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Xwe={};function im(t){return t&&Object.assign(Xwe,t),Xwe}a(im,"config");p();p();var qr={};ki(qr,{BIGINT_FORMAT_RANGES:()=>CWt,Class:()=>hWt,NUMBER_FORMAT_RANGES:()=>vWt,aborted:()=>DJ,allowsEval:()=>yWt,assert:()=>Qns,assertEqual:()=>Lns,assertIs:()=>Fns,assertNever:()=>Uns,assertNotEqual:()=>Bns,assignProp:()=>AWt,cached:()=>nRe,captureStackTrace:()=>Itt,cleanEnum:()=>Xns,cleanRegex:()=>iRe,clone:()=>iT,createTransparentProxy:()=>Vns,defineLazy:()=>xc,esc:()=>PJ,escapeRegex:()=>EF,extend:()=>Yns,finalizeIssue:()=>oT,floatSafeRemainder:()=>gWt,getElementAtPath:()=>qns,getEnumValues:()=>rRe,getLengthableOrigin:()=>aRe,getParsedType:()=>$ns,getSizableOrigin:()=>sRe,isObject:()=>wde,isPlainObject:()=>Rde,issue:()=>bWt,joinValues:()=>jt,jsonStringifyReplacer:()=>mWt,merge:()=>Kns,normalizeParams:()=>Tr,nullish:()=>ej,numKeys:()=>Gns,omit:()=>zns,optionalKeys:()=>_Wt,partial:()=>Jns,pick:()=>Wns,prefixIssues:()=>eb,primitiveTypes:()=>EWt,promiseAllObject:()=>jns,propertyKeyTypes:()=>oRe,randomString:()=>Hns,required:()=>Zns,stringifyPrimitive:()=>Qr,unwrapMessage:()=>tRe});p();function Lns(t){return t}a(Lns,"assertEqual");function Bns(t){return t}a(Bns,"assertNotEqual");function Fns(t){}a(Fns,"assertIs");function Uns(t){throw new Error}a(Uns,"assertNever");function Qns(t){}a(Qns,"assert");function rRe(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(rRe,"getEnumValues");function jt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(jt,"joinValues");function mWt(t,e){return typeof e=="bigint"?e.toString():e}a(mWt,"jsonStringifyReplacer");function nRe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(nRe,"cached");function ej(t){return t==null}a(ej,"nullish");function iRe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(iRe,"cleanRegex");function gWt(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(gWt,"floatSafeRemainder");function xc(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(xc,"defineLazy");function AWt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(AWt,"assignProp");function qns(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(qns,"getElementAtPath");function jns(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 wde(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(wde,"isObject");var yWt=nRe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Rde(t){if(wde(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(wde(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Rde,"isPlainObject");function Gns(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Gns,"numKeys");var $ns=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"),oRe=new Set(["string","number","symbol"]),EWt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function EF(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(EF,"escapeRegex");function iT(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(iT,"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 Vns(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(Vns,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function _Wt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(_Wt,"optionalKeys");var vWt={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]},CWt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Wns(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 iT(t,{...t._zod.def,shape:r,checks:[]})}a(Wns,"pick");function zns(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 iT(t,{...t._zod.def,shape:r,checks:[]})}a(zns,"omit");function Yns(t,e){if(!Rde(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 AWt(this,"shape",n),n},checks:[]};return iT(t,r)}a(Yns,"extend");function Kns(t,e){return iT(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return AWt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(Kns,"merge");function Jns(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 iT(e,{...e._zod.def,shape:o,checks:[]})}a(Jns,"partial");function Zns(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 iT(e,{...e._zod.def,shape:o,checks:[]})}a(Zns,"required");function DJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(eb,"prefixIssues");function tRe(t){return typeof t=="string"?t:t?.message}a(tRe,"unwrapMessage");function oT(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=tRe(t.inst?._zod.def?.error?.(t))??tRe(e?.error?.(t))??tRe(r.customError?.(t))??tRe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(oT,"finalizeIssue");function sRe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(sRe,"getSizableOrigin");function aRe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(aRe,"getLengthableOrigin");function bWt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(bWt,"issue");function Xns(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Xns,"cleanEnum");var hWt=class{static{a(this,"Class")}constructor(...e){}};var Ckn=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,mWt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),cRe=dt("$ZodError",Ckn),kde=dt("$ZodError",Ckn,{Parent:Error});function lRe(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(lRe,"flattenError");function uRe(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 ${bkn(n.path)}`);return e.join(` -`)}a(TWt,"prettifyError");var xtt=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 i5;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>oT(u,s,im())));throw Itt(l,o?.callee),l}return c.value},"_parse"),dRe=xtt(kde),wtt=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=>oT(u,s,im())));throw Itt(l,o?.callee),l}return c.value},"_parseAsync"),fRe=wtt(kde),Rtt=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 i5;return s.issues.length?{success:!1,error:new(t??cRe)(s.issues.map(c=>oT(c,o,im())))}:{success:!0,data:s.value}},"_safeParse"),Pde=Rtt(kde),ktt=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=>oT(c,o,im())))}:{success:!0,data:s.value}},"_safeParseAsync"),pRe=ktt(kde);p();p();var MJ={};ki(MJ,{_emoji:()=>Skn,base64:()=>QWt,base64url:()=>Ptt,bigint:()=>WWt,boolean:()=>KWt,browserEmail:()=>cis,cidrv4:()=>FWt,cidrv6:()=>UWt,cuid:()=>IWt,cuid2:()=>xWt,date:()=>HWt,datetime:()=>$Wt,domain:()=>lis,duration:()=>DWt,e164:()=>jWt,email:()=>MWt,emoji:()=>OWt,extendedDuration:()=>tis,guid:()=>NWt,hostname:()=>qWt,html5Email:()=>ois,integer:()=>zWt,ipv4:()=>LWt,ipv6:()=>BWt,ksuid:()=>kWt,lowercase:()=>XWt,nanoid:()=>PWt,null:()=>JWt,number:()=>YWt,rfc5322Email:()=>sis,string:()=>VWt,time:()=>GWt,ulid:()=>wWt,undefined:()=>ZWt,unicodeEmail:()=>ais,uppercase:()=>ezt,uuid:()=>NJ,uuid4:()=>ris,uuid6:()=>nis,uuid7:()=>iis,xid:()=>RWt});p();var IWt=/^[cC][^\s-]{8,}$/,xWt=/^[0-9a-z]+$/,wWt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RWt=/^[0-9a-vA-V]{20}$/,kWt=/^[A-Za-z0-9]{27}$/,PWt=/^[a-zA-Z0-9_-]{21}$/,DWt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tis=/^[-+]?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)?)??$/,NWt=/^([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})$/,NJ=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"),ris=NJ(4),nis=NJ(6),iis=NJ(7),MWt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ois=/^[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])?)*$/,sis=/^(([^<>()\[\]\\.,;:\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,}))$/,ais=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cis=/^[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])?)*$/,Skn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OWt(){return new RegExp(Skn,"u")}a(OWt,"emoji");var LWt=/^(?:(?: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])$/,BWt=/^(([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})$/,FWt=/^((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])$/,UWt=/^(([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])$/,QWt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ptt=/^[A-Za-z0-9_-]*$/,qWt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,lis=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,jWt=/^\+(?:[0-9]){6,14}[0-9]$/,Tkn="(?:(?:\\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])))",HWt=new RegExp(`^${Tkn}$`);function Ikn(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(Ikn,"timeSource");function GWt(t){return new RegExp(`^${Ikn(t)}$`)}a(GWt,"time");function $Wt(t){let e=Ikn({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(`^${Tkn}T(?:${n})$`)}a($Wt,"datetime");var VWt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),WWt=/^\d+n?$/,zWt=/^\d+$/,YWt=/^-?\d+(?:\.\d+)?/i,KWt=/true|false/i,JWt=/null/i;var ZWt=/undefined/i;var XWt=/^[^A-Z]*$/,ezt=/^[^a-z]*$/;var Tf=dt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),wkn={number:"number",bigint:"bigint",object:"date"},Dtt=dt("$ZodCheckLessThan",(t,e)=>{Tf.init(t,e);let r=wkn[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{Tf.init(t,e);let r=wkn[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})}}),tzt=dt("$ZodCheckMultipleOf",(t,e)=>{Tf.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):gWt(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})}}),rzt=dt("$ZodCheckNumberFormat",(t,e)=>{Tf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=vWt[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=zWt)}),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})}}),nzt=dt("$ZodCheckBigIntFormat",(t,e)=>{Tf.init(t,e);let[r,n]=CWt[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})}}),izt=dt("$ZodCheckMaxSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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:sRe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),ozt=dt("$ZodCheckMinSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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:sRe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),szt=dt("$ZodCheckSizeEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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:sRe(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})}}),azt=dt("$ZodCheckMaxLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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=aRe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),czt=dt("$ZodCheckMinLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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=aRe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),lzt=dt("$ZodCheckLengthEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(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=aRe(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})}}),Dde=dt("$ZodCheckStringFormat",(t,e)=>{var r,n;Tf.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=()=>{})}),uzt=dt("$ZodCheckRegex",(t,e)=>{Dde.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})}}),dzt=dt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=XWt),Dde.init(t,e)}),fzt=dt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ezt),Dde.init(t,e)}),pzt=dt("$ZodCheckIncludes",(t,e)=>{Tf.init(t,e);let r=EF(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})}}),hzt=dt("$ZodCheckStartsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`^${EF(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})}}),mzt=dt("$ZodCheckEndsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`.*${EF(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 xkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues))}a(xkn,"handleCheckPropertyResult");var gzt=dt("$ZodCheckProperty",(t,e)=>{Tf.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=>xkn(o,r,e.property));xkn(n,r,e.property)}}),Azt=dt("$ZodCheckMimeType",(t,e)=>{Tf.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})}}),yzt=dt("$ZodCheckOverwrite",(t,e)=>{Tf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var hRe=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 Kns(t){return[new Ctt,new Ttt,new Att,new Rtt,new Zet,new Xet,new _tt,new vtt,new ktt]}a(Kns,"getAllClsTools");function Ikn(t,e){Kns(t).forEach(e.registerTool.bind(e)),t.get(bn).onDidSetCapabilities(r=>{t.get(Hl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new Cde):r.subAgent?e.registerTool(new Cde):e.unregisterTool(new Cde),r.manageTodoListTool?e.registerTool(new YO(t)):e.unregisterTool(new YO(t)),r.watchedFiles?e.registerTool(new Wwe):e.unregisterTool(new Wwe)})}a(Ikn,"registerAllClsTools");var gs=class{constructor(e){this.ctx=e;this._toolRegistry=new Kze;Ikn(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 Oc;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 Oc;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=>lwn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>uwn.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(fg.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(fg.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(fg.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(fg.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(ip.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(ip.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(fg.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(fg.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(ip.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(ip.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(fg.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(fg.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(ip.id)??[],f=e.get(fg.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==fg.id&&m!==ip.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(Fd);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(!txe(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===fg.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===ip.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===fg.id||o.toolProvider.id===ip.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===fg.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===ip.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(txe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===ip.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===fg.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===fg.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 rj=class extends JQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:ip,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(U_).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 Oc;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(Hd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};ki(k,{$brand:()=>gWt,$input:()=>fKt,$output:()=>dKt,NEVER:()=>nRe,TimePrecision:()=>mKt,ZodAny:()=>iPn,ZodArray:()=>cPn,ZodBase64:()=>TJt,ZodBase64URL:()=>IJt,ZodBigInt:()=>HRe,ZodBigIntFormat:()=>RJt,ZodBoolean:()=>jRe,ZodCIDRv4:()=>bJt,ZodCIDRv6:()=>SJt,ZodCUID:()=>gJt,ZodCUID2:()=>AJt,ZodCatch:()=>bPn,ZodCustom:()=>Irt,ZodCustomStringFormat:()=>ePn,ZodDate:()=>brt,ZodDefault:()=>APn,ZodDiscriminatedUnion:()=>lPn,ZodE164:()=>xJt,ZodEmail:()=>dJt,ZodEmoji:()=>hJt,ZodEnum:()=>URe,ZodError:()=>Oos,ZodFile:()=>mPn,ZodGUID:()=>yrt,ZodIPv4:()=>vJt,ZodIPv6:()=>CJt,ZodISODate:()=>mrt,ZodISODateTime:()=>hrt,ZodISODuration:()=>Art,ZodISOTime:()=>grt,ZodIntersection:()=>uPn,ZodIssueCode:()=>UJt,ZodJWT:()=>wJt,ZodKSUID:()=>_Jt,ZodLazy:()=>RPn,ZodLiteral:()=>hPn,ZodMap:()=>fPn,ZodNaN:()=>TPn,ZodNanoID:()=>mJt,ZodNever:()=>sPn,ZodNonOptional:()=>LJt,ZodNull:()=>nPn,ZodNullable:()=>gPn,ZodNumber:()=>qRe,ZodNumberFormat:()=>jde,ZodObject:()=>Srt,ZodOptional:()=>OJt,ZodPipe:()=>BJt,ZodPrefault:()=>EPn,ZodPromise:()=>PPn,ZodReadonly:()=>IPn,ZodRealError:()=>qde,ZodRecord:()=>DJt,ZodSet:()=>pPn,ZodString:()=>QRe,ZodStringFormat:()=>Cu,ZodSuccess:()=>CPn,ZodSymbol:()=>tPn,ZodTemplateLiteral:()=>wPn,ZodTransform:()=>NJt,ZodTuple:()=>dPn,ZodType:()=>ks,ZodULID:()=>yJt,ZodURL:()=>fJt,ZodUUID:()=>IF,ZodUndefined:()=>rPn,ZodUnion:()=>PJt,ZodUnknown:()=>oPn,ZodVoid:()=>aPn,ZodXID:()=>EJt,_ZodString:()=>uJt,_default:()=>yPn,any:()=>kJt,array:()=>Ur,base64:()=>ess,base64url:()=>tss,bigint:()=>lss,boolean:()=>ol,catch:()=>SPn,check:()=>DPn,cidrv4:()=>Zos,cidrv6:()=>Xos,clone:()=>sT,coerce:()=>$Re,config:()=>sm,core:()=>TF,cuid:()=>$os,cuid2:()=>Vos,custom:()=>FJt,date:()=>mss,discriminatedUnion:()=>Trt,e164:()=>rss,email:()=>Bos,emoji:()=>Hos,endsWith:()=>PRe,enum:()=>iv,file:()=>bss,flattenError:()=>fRe,float32:()=>oss,float64:()=>sss,formatError:()=>pRe,function:()=>XKt,getErrorMap:()=>Nss,globalRegistry:()=>l5,gt:()=>bF,gte:()=>tb,guid:()=>Fos,includes:()=>RRe,instanceof:()=>Rss,int:()=>lJt,int32:()=>ass,int64:()=>uss,intersection:()=>GRe,ipv4:()=>Kos,ipv6:()=>Jos,iso:()=>Qde,json:()=>Pss,jwt:()=>nss,keyof:()=>gss,ksuid:()=>Yos,lazy:()=>kPn,length:()=>Ude,literal:()=>Gn,locales:()=>bRe,looseObject:()=>am,lowercase:()=>xRe,lt:()=>CF,lte:()=>_w,map:()=>_ss,maxLength:()=>Fde,maxSize:()=>Bde,mime:()=>DRe,minLength:()=>ij,minSize:()=>QJ,multipleOf:()=>UJ,nan:()=>Iss,nanoid:()=>Gos,nativeEnum:()=>Css,negative:()=>HKt,never:()=>Crt,nonnegative:()=>$Kt,nonoptional:()=>vPn,nonpositive:()=>GKt,normalize:()=>NRe,null:()=>vrt,nullable:()=>Ert,nullish:()=>Sss,number:()=>Pa,object:()=>zr,optional:()=>bu,overwrite:()=>SF,parse:()=>oJt,parseAsync:()=>sJt,partialRecord:()=>Ess,pipe:()=>_rt,positive:()=>jKt,prefault:()=>_Pn,preprocess:()=>xrt,prettifyError:()=>RWt,promise:()=>wss,property:()=>VKt,readonly:()=>xPn,record:()=>wl,refine:()=>NPn,regex:()=>IRe,regexes:()=>LJ,registry:()=>$tt,safeParse:()=>aJt,safeParseAsync:()=>cJt,set:()=>vss,setErrorMap:()=>Dss,size:()=>TRe,startsWith:()=>kRe,strictObject:()=>Ass,string:()=>Je,stringFormat:()=>iss,stringbool:()=>kss,success:()=>Tss,superRefine:()=>MPn,symbol:()=>fss,templateLiteral:()=>xss,toJSONSchema:()=>eJt,toLowerCase:()=>ORe,toUpperCase:()=>LRe,transform:()=>MJt,treeifyError:()=>wWt,trim:()=>MRe,tuple:()=>yss,uint32:()=>css,uint64:()=>dss,ulid:()=>Wos,undefined:()=>pss,union:()=>xl,unknown:()=>sd,uppercase:()=>wRe,url:()=>pJt,uuid:()=>Uos,uuidv4:()=>Qos,uuidv6:()=>qos,uuidv7:()=>jos,void:()=>hss,xid:()=>zos});p();var TF={};ki(TF,{$ZodAny:()=>tYt,$ZodArray:()=>ERe,$ZodAsyncError:()=>c5,$ZodBase64:()=>$zt,$ZodBase64URL:()=>Vzt,$ZodBigInt:()=>Htt,$ZodBigIntFormat:()=>Jzt,$ZodBoolean:()=>yRe,$ZodCIDRv4:()=>jzt,$ZodCIDRv6:()=>Hzt,$ZodCUID:()=>Pzt,$ZodCUID2:()=>Dzt,$ZodCatch:()=>_Yt,$ZodCheck:()=>xf,$ZodCheckBigIntFormat:()=>azt,$ZodCheckEndsWith:()=>Ezt,$ZodCheckGreaterThan:()=>Utt,$ZodCheckIncludes:()=>Azt,$ZodCheckLengthEquals:()=>pzt,$ZodCheckLessThan:()=>Ftt,$ZodCheckLowerCase:()=>mzt,$ZodCheckMaxLength:()=>dzt,$ZodCheckMaxSize:()=>czt,$ZodCheckMimeType:()=>vzt,$ZodCheckMinLength:()=>fzt,$ZodCheckMinSize:()=>lzt,$ZodCheckMultipleOf:()=>ozt,$ZodCheckNumberFormat:()=>szt,$ZodCheckOverwrite:()=>Czt,$ZodCheckProperty:()=>_zt,$ZodCheckRegex:()=>hzt,$ZodCheckSizeEquals:()=>uzt,$ZodCheckStartsWith:()=>yzt,$ZodCheckStringFormat:()=>Nde,$ZodCheckUpperCase:()=>gzt,$ZodCustom:()=>IYt,$ZodCustomStringFormat:()=>Yzt,$ZodDate:()=>iYt,$ZodDefault:()=>gYt,$ZodDiscriminatedUnion:()=>sYt,$ZodE164:()=>Wzt,$ZodEmail:()=>xzt,$ZodEmoji:()=>Rzt,$ZodEnum:()=>dYt,$ZodError:()=>dRe,$ZodFile:()=>pYt,$ZodFunction:()=>prt,$ZodGUID:()=>Tzt,$ZodIPv4:()=>Qzt,$ZodIPv6:()=>qzt,$ZodISODate:()=>Bzt,$ZodISODateTime:()=>Lzt,$ZodISODuration:()=>Uzt,$ZodISOTime:()=>Fzt,$ZodIntersection:()=>aYt,$ZodJWT:()=>zzt,$ZodKSUID:()=>Ozt,$ZodLazy:()=>TYt,$ZodLiteral:()=>fYt,$ZodMap:()=>lYt,$ZodNaN:()=>vYt,$ZodNanoID:()=>kzt,$ZodNever:()=>rYt,$ZodNonOptional:()=>yYt,$ZodNull:()=>eYt,$ZodNullable:()=>mYt,$ZodNumber:()=>jtt,$ZodNumberFormat:()=>Kzt,$ZodObject:()=>oYt,$ZodOptional:()=>hYt,$ZodPipe:()=>vRe,$ZodPrefault:()=>AYt,$ZodPromise:()=>SYt,$ZodReadonly:()=>CYt,$ZodRealError:()=>Pde,$ZodRecord:()=>cYt,$ZodRegistry:()=>Ode,$ZodSet:()=>uYt,$ZodString:()=>BJ,$ZodStringFormat:()=>Wl,$ZodSuccess:()=>EYt,$ZodSymbol:()=>Zzt,$ZodTemplateLiteral:()=>bYt,$ZodTransform:()=>_Re,$ZodTuple:()=>FJ,$ZodType:()=>uo,$ZodULID:()=>Nzt,$ZodURL:()=>wzt,$ZodUUID:()=>Izt,$ZodUndefined:()=>Xzt,$ZodUnion:()=>Gtt,$ZodUnknown:()=>Mde,$ZodVoid:()=>nYt,$ZodXID:()=>Mzt,$brand:()=>gWt,$constructor:()=>dt,$input:()=>fKt,$output:()=>dKt,Doc:()=>ARe,JSONSchema:()=>Jkn,JSONSchemaGenerator:()=>FRe,NEVER:()=>nRe,TimePrecision:()=>mKt,_any:()=>LKt,_array:()=>BRe,_base64:()=>lrt,_base64url:()=>urt,_bigint:()=>RKt,_boolean:()=>xKt,_catch:()=>wos,_cidrv4:()=>art,_cidrv6:()=>crt,_coercedBigint:()=>kKt,_coercedBoolean:()=>wKt,_coercedDate:()=>QKt,_coercedNumber:()=>vKt,_coercedString:()=>hKt,_cuid:()=>ert,_cuid2:()=>trt,_custom:()=>YKt,_date:()=>UKt,_default:()=>Tos,_discriminatedUnion:()=>hos,_e164:()=>drt,_email:()=>Vtt,_emoji:()=>Ztt,_endsWith:()=>PRe,_enum:()=>Eos,_file:()=>zKt,_float32:()=>bKt,_float64:()=>SKt,_gt:()=>bF,_gte:()=>tb,_guid:()=>SRe,_includes:()=>RRe,_int:()=>CKt,_int32:()=>TKt,_int64:()=>PKt,_intersection:()=>mos,_ipv4:()=>ort,_ipv6:()=>srt,_isoDate:()=>AKt,_isoDateTime:()=>gKt,_isoDuration:()=>EKt,_isoTime:()=>yKt,_jwt:()=>frt,_ksuid:()=>irt,_lazy:()=>Dos,_length:()=>Ude,_literal:()=>vos,_lowercase:()=>xRe,_lt:()=>CF,_lte:()=>_w,_map:()=>Aos,_max:()=>_w,_maxLength:()=>Fde,_maxSize:()=>Bde,_mime:()=>DRe,_min:()=>tb,_minLength:()=>ij,_minSize:()=>QJ,_multipleOf:()=>UJ,_nan:()=>qKt,_nanoid:()=>Xtt,_nativeEnum:()=>_os,_negative:()=>HKt,_never:()=>BKt,_nonnegative:()=>$Kt,_nonoptional:()=>Ios,_nonpositive:()=>GKt,_normalize:()=>NRe,_null:()=>OKt,_nullable:()=>Sos,_number:()=>_Kt,_optional:()=>bos,_overwrite:()=>SF,_parse:()=>Ntt,_parseAsync:()=>Mtt,_pipe:()=>Ros,_positive:()=>jKt,_promise:()=>Nos,_property:()=>VKt,_readonly:()=>kos,_record:()=>gos,_refine:()=>KKt,_regex:()=>IRe,_safeParse:()=>Ott,_safeParseAsync:()=>Ltt,_set:()=>yos,_size:()=>TRe,_startsWith:()=>kRe,_string:()=>pKt,_stringFormat:()=>ZKt,_stringbool:()=>JKt,_success:()=>xos,_symbol:()=>NKt,_templateLiteral:()=>Pos,_toLowerCase:()=>ORe,_toUpperCase:()=>LRe,_transform:()=>Cos,_trim:()=>MRe,_tuple:()=>WKt,_uint32:()=>IKt,_uint64:()=>DKt,_ulid:()=>rrt,_undefined:()=>MKt,_union:()=>pos,_unknown:()=>Lde,_uppercase:()=>wRe,_url:()=>Jtt,_uuid:()=>Wtt,_uuidv4:()=>ztt,_uuidv6:()=>Ytt,_uuidv7:()=>Ktt,_void:()=>FKt,_xid:()=>nrt,clone:()=>sT,config:()=>sm,flattenError:()=>fRe,formatError:()=>pRe,function:()=>XKt,globalConfig:()=>rRe,globalRegistry:()=>l5,isValidBase64:()=>Gzt,isValidBase64URL:()=>Vkn,isValidJWT:()=>Wkn,locales:()=>bRe,parse:()=>hRe,parseAsync:()=>mRe,prettifyError:()=>RWt,regexes:()=>LJ,registry:()=>$tt,safeParse:()=>Dde,safeParseAsync:()=>gRe,toDotPath:()=>wkn,toJSONSchema:()=>eJt,treeifyError:()=>wWt,util:()=>qr,version:()=>bzt});p();p();var nRe=Object.freeze({status:"aborted"});function dt(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(dt,"$constructor");var gWt=Symbol("zod_brand"),c5=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},rRe={};function sm(t){return t&&Object.assign(rRe,t),rRe}a(sm,"config");p();p();var qr={};ki(qr,{BIGINT_FORMAT_RANGES:()=>IWt,Class:()=>yWt,NUMBER_FORMAT_RANGES:()=>TWt,aborted:()=>MJ,allowsEval:()=>CWt,assert:()=>tis,assertEqual:()=>Jns,assertIs:()=>Xns,assertNever:()=>eis,assertNotEqual:()=>Zns,assignProp:()=>vWt,cached:()=>sRe,captureStackTrace:()=>Dtt,cleanEnum:()=>his,cleanRegex:()=>aRe,clone:()=>sT,createTransparentProxy:()=>ais,defineLazy:()=>xc,esc:()=>NJ,escapeRegex:()=>vF,extend:()=>uis,finalizeIssue:()=>aT,floatSafeRemainder:()=>_Wt,getElementAtPath:()=>ris,getEnumValues:()=>oRe,getLengthableOrigin:()=>uRe,getParsedType:()=>sis,getSizableOrigin:()=>lRe,isObject:()=>Rde,isPlainObject:()=>kde,issue:()=>xWt,joinValues:()=>jt,jsonStringifyReplacer:()=>EWt,merge:()=>dis,normalizeParams:()=>Tr,nullish:()=>nj,numKeys:()=>ois,omit:()=>lis,optionalKeys:()=>SWt,partial:()=>fis,pick:()=>cis,prefixIssues:()=>eb,primitiveTypes:()=>bWt,promiseAllObject:()=>nis,propertyKeyTypes:()=>cRe,randomString:()=>iis,required:()=>pis,stringifyPrimitive:()=>Qr,unwrapMessage:()=>iRe});p();function Jns(t){return t}a(Jns,"assertEqual");function Zns(t){return t}a(Zns,"assertNotEqual");function Xns(t){}a(Xns,"assertIs");function eis(t){throw new Error}a(eis,"assertNever");function tis(t){}a(tis,"assert");function oRe(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(oRe,"getEnumValues");function jt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(jt,"joinValues");function EWt(t,e){return typeof e=="bigint"?e.toString():e}a(EWt,"jsonStringifyReplacer");function sRe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(sRe,"cached");function nj(t){return t==null}a(nj,"nullish");function aRe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(aRe,"cleanRegex");function _Wt(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(_Wt,"floatSafeRemainder");function xc(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(xc,"defineLazy");function vWt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(vWt,"assignProp");function ris(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(ris,"getElementAtPath");function nis(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 Rde(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Rde,"isObject");var CWt=sRe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function kde(t){if(Rde(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(Rde(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(kde,"isPlainObject");function ois(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(ois,"numKeys");var sis=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"),cRe=new Set(["string","number","symbol"]),bWt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function vF(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(vF,"escapeRegex");function sT(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(sT,"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 ais(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(ais,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function SWt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(SWt,"optionalKeys");var TWt={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]},IWt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function cis(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 sT(t,{...t._zod.def,shape:r,checks:[]})}a(cis,"pick");function lis(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 sT(t,{...t._zod.def,shape:r,checks:[]})}a(lis,"omit");function uis(t,e){if(!kde(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 vWt(this,"shape",n),n},checks:[]};return sT(t,r)}a(uis,"extend");function dis(t,e){return sT(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return vWt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(dis,"merge");function fis(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 sT(e,{...e._zod.def,shape:o,checks:[]})}a(fis,"partial");function pis(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 sT(e,{...e._zod.def,shape:o,checks:[]})}a(pis,"required");function MJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(eb,"prefixIssues");function iRe(t){return typeof t=="string"?t:t?.message}a(iRe,"unwrapMessage");function aT(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=iRe(t.inst?._zod.def?.error?.(t))??iRe(e?.error?.(t))??iRe(r.customError?.(t))??iRe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(aT,"finalizeIssue");function lRe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(lRe,"getSizableOrigin");function uRe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(uRe,"getLengthableOrigin");function xWt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(xWt,"issue");function his(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(his,"cleanEnum");var yWt=class{static{a(this,"Class")}constructor(...e){}};var xkn=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,EWt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),dRe=dt("$ZodError",xkn),Pde=dt("$ZodError",xkn,{Parent:Error});function fRe(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(fRe,"flattenError");function pRe(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 ${wkn(n.path)}`);return e.join(` +`)}a(RWt,"prettifyError");var Ntt=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 c5;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>aT(u,s,sm())));throw Dtt(l,o?.callee),l}return c.value},"_parse"),hRe=Ntt(Pde),Mtt=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=>aT(u,s,sm())));throw Dtt(l,o?.callee),l}return c.value},"_parseAsync"),mRe=Mtt(Pde),Ott=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 c5;return s.issues.length?{success:!1,error:new(t??dRe)(s.issues.map(c=>aT(c,o,sm())))}:{success:!0,data:s.value}},"_safeParse"),Dde=Ott(Pde),Ltt=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=>aT(c,o,sm())))}:{success:!0,data:s.value}},"_safeParseAsync"),gRe=Ltt(Pde);p();p();var LJ={};ki(LJ,{_emoji:()=>Rkn,base64:()=>GWt,base64url:()=>Btt,bigint:()=>JWt,boolean:()=>ezt,browserEmail:()=>bis,cidrv4:()=>jWt,cidrv6:()=>HWt,cuid:()=>kWt,cuid2:()=>PWt,date:()=>WWt,datetime:()=>YWt,domain:()=>Sis,duration:()=>LWt,e164:()=>VWt,email:()=>FWt,emoji:()=>UWt,extendedDuration:()=>gis,guid:()=>BWt,hostname:()=>$Wt,html5Email:()=>_is,integer:()=>ZWt,ipv4:()=>QWt,ipv6:()=>qWt,ksuid:()=>MWt,lowercase:()=>nzt,nanoid:()=>OWt,null:()=>tzt,number:()=>XWt,rfc5322Email:()=>vis,string:()=>KWt,time:()=>zWt,ulid:()=>DWt,undefined:()=>rzt,unicodeEmail:()=>Cis,uppercase:()=>izt,uuid:()=>OJ,uuid4:()=>Ais,uuid6:()=>yis,uuid7:()=>Eis,xid:()=>NWt});p();var kWt=/^[cC][^\s-]{8,}$/,PWt=/^[0-9a-z]+$/,DWt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,NWt=/^[0-9a-vA-V]{20}$/,MWt=/^[A-Za-z0-9]{27}$/,OWt=/^[a-zA-Z0-9_-]{21}$/,LWt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gis=/^[-+]?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)?)??$/,BWt=/^([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})$/,OJ=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"),Ais=OJ(4),yis=OJ(6),Eis=OJ(7),FWt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_is=/^[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])?)*$/,vis=/^(([^<>()\[\]\\.,;:\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,}))$/,Cis=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,bis=/^[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])?)*$/,Rkn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function UWt(){return new RegExp(Rkn,"u")}a(UWt,"emoji");var QWt=/^(?:(?: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])$/,qWt=/^(([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})$/,jWt=/^((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])$/,HWt=/^(([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])$/,GWt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Btt=/^[A-Za-z0-9_-]*$/,$Wt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Sis=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,VWt=/^\+(?:[0-9]){6,14}[0-9]$/,kkn="(?:(?:\\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])))",WWt=new RegExp(`^${kkn}$`);function Pkn(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(Pkn,"timeSource");function zWt(t){return new RegExp(`^${Pkn(t)}$`)}a(zWt,"time");function YWt(t){let e=Pkn({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(`^${kkn}T(?:${n})$`)}a(YWt,"datetime");var KWt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),JWt=/^\d+n?$/,ZWt=/^\d+$/,XWt=/^-?\d+(?:\.\d+)?/i,ezt=/true|false/i,tzt=/null/i;var rzt=/undefined/i;var nzt=/^[^A-Z]*$/,izt=/^[^a-z]*$/;var xf=dt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Nkn={number:"number",bigint:"bigint",object:"date"},Ftt=dt("$ZodCheckLessThan",(t,e)=>{xf.init(t,e);let r=Nkn[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{xf.init(t,e);let r=Nkn[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})}}),ozt=dt("$ZodCheckMultipleOf",(t,e)=>{xf.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):_Wt(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})}}),szt=dt("$ZodCheckNumberFormat",(t,e)=>{xf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=TWt[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=ZWt)}),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})}}),azt=dt("$ZodCheckBigIntFormat",(t,e)=>{xf.init(t,e);let[r,n]=IWt[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})}}),czt=dt("$ZodCheckMaxSize",(t,e)=>{var r;xf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!nj(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:lRe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),lzt=dt("$ZodCheckMinSize",(t,e)=>{var r;xf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!nj(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:lRe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),uzt=dt("$ZodCheckSizeEquals",(t,e)=>{var r;xf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!nj(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:lRe(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})}}),dzt=dt("$ZodCheckMaxLength",(t,e)=>{var r;xf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!nj(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=uRe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),fzt=dt("$ZodCheckMinLength",(t,e)=>{var r;xf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!nj(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=uRe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),pzt=dt("$ZodCheckLengthEquals",(t,e)=>{var r;xf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!nj(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=uRe(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})}}),Nde=dt("$ZodCheckStringFormat",(t,e)=>{var r,n;xf.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=()=>{})}),hzt=dt("$ZodCheckRegex",(t,e)=>{Nde.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})}}),mzt=dt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=nzt),Nde.init(t,e)}),gzt=dt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=izt),Nde.init(t,e)}),Azt=dt("$ZodCheckIncludes",(t,e)=>{xf.init(t,e);let r=vF(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})}}),yzt=dt("$ZodCheckStartsWith",(t,e)=>{xf.init(t,e);let r=new RegExp(`^${vF(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})}}),Ezt=dt("$ZodCheckEndsWith",(t,e)=>{xf.init(t,e);let r=new RegExp(`.*${vF(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 Dkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues))}a(Dkn,"handleCheckPropertyResult");var _zt=dt("$ZodCheckProperty",(t,e)=>{xf.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=>Dkn(o,r,e.property));Dkn(n,r,e.property)}}),vzt=dt("$ZodCheckMimeType",(t,e)=>{xf.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})}}),Czt=dt("$ZodCheckOverwrite",(t,e)=>{xf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var ARe=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 Ezt={major:4,minor:0,patch:0};var uo=dt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ezt;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=DJ(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 i5;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=DJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=DJ(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 i5;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Pde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return pRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),OJ=dt("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??VWt(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}}),Vl=dt("$ZodStringFormat",(t,e)=>{Dde.init(t,e),OJ.init(t,e)}),vzt=dt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=NWt),Vl.init(t,e)}),Czt=dt("$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=NJ(n))}else e.pattern??(e.pattern=NJ());Vl.init(t,e)}),bzt=dt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=MWt),Vl.init(t,e)}),Szt=dt("$ZodURL",(t,e)=>{Vl.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:qWt.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})}}}),Tzt=dt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=OWt()),Vl.init(t,e)}),Izt=dt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=PWt),Vl.init(t,e)}),xzt=dt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=IWt),Vl.init(t,e)}),wzt=dt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=xWt),Vl.init(t,e)}),Rzt=dt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=wWt),Vl.init(t,e)}),kzt=dt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=RWt),Vl.init(t,e)}),Pzt=dt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=kWt),Vl.init(t,e)}),Dzt=dt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=$Wt(e)),Vl.init(t,e)}),Nzt=dt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=HWt),Vl.init(t,e)}),Mzt=dt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=GWt(e)),Vl.init(t,e)}),Ozt=dt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=DWt),Vl.init(t,e)}),Lzt=dt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=LWt),Vl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Bzt=dt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=BWt),Vl.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})}}}),Fzt=dt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=FWt),Vl.init(t,e)}),Uzt=dt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=UWt),Vl.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 Qzt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Qzt,"isValidBase64");var qzt=dt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=QWt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Qzt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function qkn(t){if(!Ptt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Qzt(r)}a(qkn,"isValidBase64URL");var jzt=dt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ptt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{qkn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Hzt=dt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=jWt),Vl.init(t,e)});function jkn(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(jkn,"isValidJWT");var Gzt=dt("$ZodJWT",(t,e)=>{Vl.init(t,e),t._zod.check=r=>{jkn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),$zt=dt("$ZodCustomStringFormat",(t,e)=>{Vl.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})}}),Ltt=dt("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??YWt,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}}),Vzt=dt("$ZodNumber",(t,e)=>{rzt.init(t,e),Ltt.init(t,e)}),mRe=dt("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=KWt,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}}),Btt=dt("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=WWt,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}}),Wzt=dt("$ZodBigInt",(t,e)=>{nzt.init(t,e),Btt.init(t,e)}),zzt=dt("$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}}),Yzt=dt("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=ZWt,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}}),Kzt=dt("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=JWt,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}}),Jzt=dt("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Nde=dt("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Zzt=dt("$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)}),Xzt=dt("$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}}),eYt=dt("$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 kkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(kkn,"handleArrayResult");var gRe=dt("$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;ckkn(d,r,c))):kkn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Mtt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Mtt,"handleObjectResult");function Pkn(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(...eb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Pkn,"handleOptionalObjectResult");var tYt=dt("$ZodObject",(t,e)=>{uo.init(t,e);let r=nRe(()=>{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=_Wt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});xc(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 hRe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=PJ(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=PJ(v);m.write(` +`))}};p();var bzt={major:4,minor:0,patch:0};var uo=dt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=bzt;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=MJ(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 c5;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=MJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=MJ(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 c5;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Dde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return gRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),BJ=dt("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??KWt(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}}),Wl=dt("$ZodStringFormat",(t,e)=>{Nde.init(t,e),BJ.init(t,e)}),Tzt=dt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=BWt),Wl.init(t,e)}),Izt=dt("$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=OJ(n))}else e.pattern??(e.pattern=OJ());Wl.init(t,e)}),xzt=dt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=FWt),Wl.init(t,e)}),wzt=dt("$ZodURL",(t,e)=>{Wl.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:$Wt.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})}}}),Rzt=dt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=UWt()),Wl.init(t,e)}),kzt=dt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=OWt),Wl.init(t,e)}),Pzt=dt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=kWt),Wl.init(t,e)}),Dzt=dt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=PWt),Wl.init(t,e)}),Nzt=dt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=DWt),Wl.init(t,e)}),Mzt=dt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=NWt),Wl.init(t,e)}),Ozt=dt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=MWt),Wl.init(t,e)}),Lzt=dt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=YWt(e)),Wl.init(t,e)}),Bzt=dt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=WWt),Wl.init(t,e)}),Fzt=dt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=zWt(e)),Wl.init(t,e)}),Uzt=dt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=LWt),Wl.init(t,e)}),Qzt=dt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=QWt),Wl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),qzt=dt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=qWt),Wl.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})}}}),jzt=dt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=jWt),Wl.init(t,e)}),Hzt=dt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=HWt),Wl.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 Gzt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Gzt,"isValidBase64");var $zt=dt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=GWt),Wl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Gzt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Vkn(t){if(!Btt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Gzt(r)}a(Vkn,"isValidBase64URL");var Vzt=dt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Btt),Wl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Vkn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Wzt=dt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=VWt),Wl.init(t,e)});function Wkn(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(Wkn,"isValidJWT");var zzt=dt("$ZodJWT",(t,e)=>{Wl.init(t,e),t._zod.check=r=>{Wkn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Yzt=dt("$ZodCustomStringFormat",(t,e)=>{Wl.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})}}),jtt=dt("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??XWt,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}}),Kzt=dt("$ZodNumber",(t,e)=>{szt.init(t,e),jtt.init(t,e)}),yRe=dt("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=ezt,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}}),Htt=dt("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=JWt,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}}),Jzt=dt("$ZodBigInt",(t,e)=>{azt.init(t,e),Htt.init(t,e)}),Zzt=dt("$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}}),Xzt=dt("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=rzt,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}}),eYt=dt("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=tzt,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}}),tYt=dt("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Mde=dt("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),rYt=dt("$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)}),nYt=dt("$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}}),iYt=dt("$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 Okn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Okn,"handleArrayResult");var ERe=dt("$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;cOkn(d,r,c))):Okn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Qtt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Qtt,"handleObjectResult");function Lkn(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(...eb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Lkn,"handleOptionalObjectResult");var oYt=dt("$ZodObject",(t,e)=>{uo.init(t,e);let r=sRe(()=>{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=SWt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});xc(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 ARe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=NJ(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=NJ(v);m.write(` if (${b}.issues.length) { if (input[${T}] === undefined) { if (${T} in input) { @@ -3723,162 +3723,162 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${zVt(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 ? [${PJ(v)}, ...iss.path] : [${PJ(v)}] - })));`),m.write(`newResult[${PJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=wde,c=!Xwe.jitless,u=c&&yWt.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?Pkn(P,h,T,g):Mtt(P,h,T))):x?Pkn(R,h,T,g):Mtt(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=>Mtt(w,h,b))):Mtt(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 Dkn(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=>oT(s,n,im())))}),e}a(Dkn,"handleUnionResults");var Ftt=dt("$ZodUnion",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),xc(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=>iRe(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=>Dkn(c,r,t,n)):Dkn(s,r,t,n)}}),rYt=dt("$ZodDiscriminatedUnion",(t,e)=>{Ftt.init(t,e);let r=t._zod.parse;xc(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=nRe(()=>{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(!wde(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)}}),nYt=dt("$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])=>Nkn(r,u,d)):Nkn(r,s,c)}});function _zt(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(Rde(t)&&Rde(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=_zt(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=>Ott(h,o,u))):Ott(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=>Ott(m,o,u))):Ott(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Ott(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Ott,"handleTupleResult");var iYt=dt("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Rde(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(...eb(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...eb(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=>oT(d,n,im())),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(...eb(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...eb(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),oYt=dt("$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])=>{Mkn(f,h,r,c,o,t,n)})):Mkn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Mkn(t,e,r,n,o,s,c){t.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>oT(l,c,im()))})),e.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>oT(l,c,im()))})),r.value.set(t.value,e.value)}a(Mkn,"handleMapResult");var sYt=dt("$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=>Okn(u,r))):Okn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Okn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Okn,"handleSetResult");var aYt=dt("$ZodEnum",(t,e)=>{uo.init(t,e);let r=rRe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>oRe.has(typeof n)).map(n=>typeof n=="string"?EF(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}}),cYt=dt("$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"?EF(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}}),lYt=dt("$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}}),ARe=dt("$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 i5;return r.value=o,r}}),uYt=dt("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",xc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(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)}),dYt=dt("$ZodNullable",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(r.source)}|null)$`):void 0}),xc(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)}),fYt=dt("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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=>Lkn(s,e)):Lkn(o,e)}});function Lkn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(Lkn,"handleDefaultResult");var pYt=dt("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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))}),hYt=dt("$ZodNonOptional",(t,e)=>{uo.init(t,e),xc(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=>Bkn(s,t)):Bkn(o,t)}});function Bkn(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(Bkn,"handleNonOptionalResult");var mYt=dt("$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)}}),gYt=dt("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(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=>oT(c,n,im()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>oT(s,n,im()))},input:r.value}),r.issues=[]),r)}}),AYt=dt("$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)}),yRe=dt("$ZodPipe",(t,e)=>{uo.init(t,e),xc(t._zod,"values",()=>e.in._zod.values),xc(t._zod,"optin",()=>e.in._zod.optin),xc(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=>Fkn(s,e,n)):Fkn(o,e,n)}});function Fkn(t,e,r){return DJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Fkn,"handlePipeResult");var yYt=dt("$ZodReadonly",(t,e)=>{uo.init(t,e),xc(t._zod,"propValues",()=>e.innerType._zod.propValues),xc(t._zod,"values",()=>e.innerType._zod.values),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(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(Ukn):Ukn(o)}});function Ukn(t){return t.value=Object.freeze(t.value),t}a(Ukn,"handleReadonlyResult");var EYt=dt("$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||EWt.has(typeof n))r.push(EF(`${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)}),_Yt=dt("$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))}),vYt=dt("$ZodLazy",(t,e)=>{uo.init(t,e),xc(t._zod,"innerType",()=>e.getter()),xc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),xc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),xc(t._zod,"optin",()=>t._zod.innerType._zod.optin),xc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),CYt=dt("$ZodCustom",(t,e)=>{Tf.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=>Qkn(s,r,n,t));Qkn(o,r,n,t)}});function Qkn(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(bWt(o))}}a(Qkn,"handleRefineResult");var _Re={};ki(_Re,{ar:()=>bYt,az:()=>SYt,be:()=>TYt,ca:()=>IYt,cs:()=>xYt,de:()=>wYt,en:()=>ERe,eo:()=>RYt,es:()=>kYt,fa:()=>PYt,fi:()=>DYt,fr:()=>NYt,frCA:()=>MYt,he:()=>OYt,hu:()=>LYt,id:()=>BYt,it:()=>FYt,ja:()=>UYt,kh:()=>QYt,ko:()=>qYt,mk:()=>jYt,ms:()=>HYt,nl:()=>GYt,no:()=>$Yt,ota:()=>VYt,pl:()=>zYt,ps:()=>WYt,pt:()=>YYt,ru:()=>KYt,sl:()=>JYt,sv:()=>ZYt,ta:()=>XYt,th:()=>eKt,tr:()=>tKt,ua:()=>rKt,ur:()=>nKt,vi:()=>iKt,zhCN:()=>oKt,zhTW:()=>sKt});p();p();var uis=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: ${jt(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":""}: ${jt(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 bYt(){return{localeError:uis()}}a(bYt,"default");p();var dis=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: ${jt(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":""}: ${jt(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 SYt(){return{localeError:dis()}}a(SYt,"default");p();function Gkn(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(Gkn,"getBelarusianPlural");var fis=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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Gkn(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=Gkn(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"}: ${jt(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 TYt(){return{localeError:fis()}}a(TYt,"default");p();var pis=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 ${jt(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":""}: ${jt(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 IYt(){return{localeError:pis()}}a(IYt,"default");p();var his=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 ${jt(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: ${jt(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 xYt(){return{localeError:his()}}a(xYt,"default");p();var mis=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 ${jt(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"}: ${jt(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 wYt(){return{localeError:mis()}}a(wYt,"default");p();var gis=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"),Ais=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 ${gis(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${jt(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":""}: ${jt(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 ERe(){return{localeError:Ais()}}a(ERe,"default");p();var yis=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"),Eis=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 ${yis(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${jt(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":""}: ${jt(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 RYt(){return{localeError:Eis()}}a(RYt,"default");p();var _is=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 ${jt(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":""}: ${jt(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 kYt(){return{localeError:_is()}}a(kYt,"default");p();var vis=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 ${jt(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: ${jt(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 PYt(){return{localeError:vis()}}a(PYt,"default");p();var Cis=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: ${jt(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"}: ${jt(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 DYt(){return{localeError:Cis()}}a(DYt,"default");p();var bis=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 ${jt(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":""} : ${jt(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 NYt(){return{localeError:bis()}}a(NYt,"default");p();var Sis=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 ${jt(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":""} : ${jt(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 MYt(){return{localeError:Sis()}}a(MYt,"default");p();var Tis=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 ${jt(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"}: ${jt(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 OYt(){return{localeError:Tis()}}a(OYt,"default");p();var Iis=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 ${jt(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":""}: ${jt(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 LYt(){return{localeError:Iis()}}a(LYt,"default");p();var xis=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 ${jt(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":""}: ${jt(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 BYt(){return{localeError:xis()}}a(BYt,"default");p();var wis=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 ${jt(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"}: ${jt(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 FYt(){return{localeError:wis()}}a(FYt,"default");p();var Ris=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: ${jt(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":""}: ${jt(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 UYt(){return{localeError:Ris()}}a(UYt,"default");p();var kis=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 ${jt(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 ${jt(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 QYt(){return{localeError:kis()}}a(QYt,"default");p();var Pis=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: ${jt(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: ${jt(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 qYt(){return{localeError:Pis()}}a(qYt,"default");p();var Dis=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 ${jt(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"}: ${jt(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 jYt(){return{localeError:Dis()}}a(jYt,"default");p();var Nis=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 ${jt(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: ${jt(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 HYt(){return{localeError:Nis()}}a(HYt,"default");p();var Mis=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 ${jt(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":""}: ${jt(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 GYt(){return{localeError:Mis()}}a(GYt,"default");p();var Ois=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 ${jt(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"}: ${jt(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 $Yt(){return{localeError:Ois()}}a($Yt,"default");p();var Lis=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 ${jt(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":""}: ${jt(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 VYt(){return{localeError:Lis()}}a(VYt,"default");p();var Bis=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 ${jt(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"}: ${jt(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 WYt(){return{localeError:Bis()}}a(WYt,"default");p();var Fis=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 ${jt(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":""}: ${jt(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 zYt(){return{localeError:Fis()}}a(zYt,"default");p();var Uis=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 ${jt(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":""}: ${jt(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 YYt(){return{localeError:Uis()}}a(YYt,"default");p();function $kn(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($kn,"getRussianPlural");var Qis=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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$kn(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=$kn(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":""}: ${jt(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 KYt(){return{localeError:Qis()}}a(KYt,"default");p();var qis=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 ${jt(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"}: ${jt(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 JYt(){return{localeError:qis()}}a(JYt,"default");p();var jis=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 ${jt(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"}: ${jt(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 ZYt(){return{localeError:jis()}}a(ZYt,"default");p();var His=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 ${jt(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":""}: ${jt(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 XYt(){return{localeError:His()}}a(XYt,"default");p();var Gis=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 ${jt(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: ${jt(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 eKt(){return{localeError:Gis()}}a(eKt,"default");p();var $is=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"),Vis=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 ${$is(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: ${jt(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":""}: ${jt(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 tKt(){return{localeError:Vis()}}a(tKt,"default");p();var Wis=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 ${jt(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":""}: ${jt(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 rKt(){return{localeError:Wis()}}a(rKt,"default");p();var zis=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: ${jt(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":""}: ${jt(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 nKt(){return{localeError:zis()}}a(nKt,"default");p();var Yis=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 ${jt(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: ${jt(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 iKt(){return{localeError:Yis()}}a(iKt,"default");p();var Kis=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 ${jt(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): ${jt(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 oKt(){return{localeError:Kis()}}a(oKt,"default");p();var Jis=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 ${jt(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${jt(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 sKt(){return{localeError:Jis()}}a(sKt,"default");p();var aKt=Symbol("ZodOutput"),cKt=Symbol("ZodInput"),Mde=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 Utt(){return new Mde}a(Utt,"registry");var s5=Utt();p();p();function lKt(t,e){return new t({type:"string",...Tr(e)})}a(lKt,"_string");function uKt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(uKt,"_coercedString");function Qtt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(Qtt,"_email");function vRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(vRe,"_guid");function qtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(qtt,"_uuid");function jtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(jtt,"_uuidv4");function Htt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Htt,"_uuidv6");function Gtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Gtt,"_uuidv7");function $tt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a($tt,"_url");function Vtt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Vtt,"_emoji");function Wtt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Wtt,"_nanoid");function ztt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(ztt,"_cuid");function Ytt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Ytt,"_cuid2");function Ktt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Ktt,"_ulid");function Jtt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Jtt,"_xid");function Ztt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Ztt,"_ksuid");function Xtt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Xtt,"_ipv4");function ert(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(ert,"_ipv6");function trt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(trt,"_cidrv4");function rrt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(rrt,"_cidrv6");function nrt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(nrt,"_base64");function irt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(irt,"_base64url");function ort(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(ort,"_e164");function srt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(srt,"_jwt");var dKt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fKt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(fKt,"_isoDateTime");function pKt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(pKt,"_isoDate");function hKt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(hKt,"_isoTime");function mKt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(mKt,"_isoDuration");function gKt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(gKt,"_number");function AKt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(AKt,"_coercedNumber");function yKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(yKt,"_int");function EKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(EKt,"_float32");function _Kt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(_Kt,"_float64");function vKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(vKt,"_int32");function CKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(CKt,"_uint32");function bKt(t,e){return new t({type:"boolean",...Tr(e)})}a(bKt,"_boolean");function SKt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(SKt,"_coercedBoolean");function TKt(t,e){return new t({type:"bigint",...Tr(e)})}a(TKt,"_bigint");function IKt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(IKt,"_coercedBigint");function xKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(xKt,"_int64");function wKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(wKt,"_uint64");function RKt(t,e){return new t({type:"symbol",...Tr(e)})}a(RKt,"_symbol");function kKt(t,e){return new t({type:"undefined",...Tr(e)})}a(kKt,"_undefined");function PKt(t,e){return new t({type:"null",...Tr(e)})}a(PKt,"_null");function DKt(t){return new t({type:"any"})}a(DKt,"_any");function Ode(t){return new t({type:"unknown"})}a(Ode,"_unknown");function NKt(t,e){return new t({type:"never",...Tr(e)})}a(NKt,"_never");function MKt(t,e){return new t({type:"void",...Tr(e)})}a(MKt,"_void");function OKt(t,e){return new t({type:"date",...Tr(e)})}a(OKt,"_date");function LKt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(LKt,"_coercedDate");function BKt(t,e){return new t({type:"nan",...Tr(e)})}a(BKt,"_nan");function _F(t,e){return new Dtt({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(_F,"_lt");function yw(t,e){return new Dtt({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(yw,"_lte");function vF(t,e){return new Ntt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(vF,"_gt");function tb(t,e){return new Ntt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(tb,"_gte");function FKt(t){return vF(0,t)}a(FKt,"_positive");function UKt(t){return _F(0,t)}a(UKt,"_negative");function QKt(t){return yw(0,t)}a(QKt,"_nonpositive");function qKt(t){return tb(0,t)}a(qKt,"_nonnegative");function BJ(t,e){return new tzt({check:"multiple_of",...Tr(e),value:t})}a(BJ,"_multipleOf");function Lde(t,e){return new izt({check:"max_size",...Tr(e),maximum:t})}a(Lde,"_maxSize");function FJ(t,e){return new ozt({check:"min_size",...Tr(e),minimum:t})}a(FJ,"_minSize");function CRe(t,e){return new szt({check:"size_equals",...Tr(e),size:t})}a(CRe,"_size");function Bde(t,e){return new azt({check:"max_length",...Tr(e),maximum:t})}a(Bde,"_maxLength");function tj(t,e){return new czt({check:"min_length",...Tr(e),minimum:t})}a(tj,"_minLength");function Fde(t,e){return new lzt({check:"length_equals",...Tr(e),length:t})}a(Fde,"_length");function bRe(t,e){return new uzt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(bRe,"_regex");function SRe(t){return new dzt({check:"string_format",format:"lowercase",...Tr(t)})}a(SRe,"_lowercase");function TRe(t){return new fzt({check:"string_format",format:"uppercase",...Tr(t)})}a(TRe,"_uppercase");function IRe(t,e){return new pzt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(IRe,"_includes");function xRe(t,e){return new hzt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(xRe,"_startsWith");function wRe(t,e){return new mzt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(wRe,"_endsWith");function jKt(t,e,r){return new gzt({check:"property",property:t,schema:e,...Tr(r)})}a(jKt,"_property");function RRe(t,e){return new Azt({check:"mime_type",mime:t,...Tr(e)})}a(RRe,"_mime");function CF(t){return new yzt({check:"overwrite",tx:t})}a(CF,"_overwrite");function kRe(t){return CF(e=>e.normalize(t))}a(kRe,"_normalize");function PRe(){return CF(t=>t.trim())}a(PRe,"_trim");function DRe(){return CF(t=>t.toLowerCase())}a(DRe,"_toLowerCase");function NRe(){return CF(t=>t.toUpperCase())}a(NRe,"_toUpperCase");function MRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(MRe,"_array");function Zis(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Zis,"_union");function Xis(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(Xis,"_discriminatedUnion");function eos(t,e,r){return new t({type:"intersection",left:e,right:r})}a(eos,"_intersection");function HKt(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(HKt,"_tuple");function tos(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(tos,"_record");function ros(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(ros,"_map");function nos(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(nos,"_set");function ios(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(ios,"_enum");function oos(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(oos,"_nativeEnum");function sos(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(sos,"_literal");function GKt(t,e){return new t({type:"file",...Tr(e)})}a(GKt,"_file");function aos(t,e){return new t({type:"transform",transform:e})}a(aos,"_transform");function cos(t,e){return new t({type:"optional",innerType:e})}a(cos,"_optional");function los(t,e){return new t({type:"nullable",innerType:e})}a(los,"_nullable");function uos(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(uos,"_default");function dos(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(dos,"_nonoptional");function fos(t,e){return new t({type:"success",innerType:e})}a(fos,"_success");function pos(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(pos,"_catch");function hos(t,e,r){return new t({type:"pipe",in:e,out:r})}a(hos,"_pipe");function mos(t,e){return new t({type:"readonly",innerType:e})}a(mos,"_readonly");function gos(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(gos,"_templateLiteral");function Aos(t,e){return new t({type:"lazy",getter:e})}a(Aos,"_lazy");function yos(t,e){return new t({type:"promise",innerType:e})}a(yos,"_promise");function $Kt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a($Kt,"_custom");function VKt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(VKt,"_refine");function WKt(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??yRe,u=t.Boolean??mRe,d=t.String??OJ,f=t.Transform??ARe,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(WKt,"_stringbool");function zKt(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(zKt,"_stringFormat");var art=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?dRe(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?dRe(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 fRe(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?fRe(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 LJ({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 YKt(t){return new art({type:"function",input:Array.isArray(t?.input)?HKt(LJ,t?.input):t?.input??MRe(gRe,Ode(Nde)),output:t?.output??Ode(Nde)})}a(YKt,"_function");p();var ORe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??s5,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=rRe(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"&&g0(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 ? [${NJ(v)}, ...iss.path] : [${NJ(v)}] + })));`),m.write(`newResult[${NJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=Rde,c=!rRe.jitless,u=c&&CWt.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?Lkn(P,h,T,g):Qtt(P,h,T))):x?Lkn(R,h,T,g):Qtt(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=>Qtt(w,h,b))):Qtt(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 Bkn(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=>aT(s,n,sm())))}),e}a(Bkn,"handleUnionResults");var Gtt=dt("$ZodUnion",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),xc(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=>aRe(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=>Bkn(c,r,t,n)):Bkn(s,r,t,n)}}),sYt=dt("$ZodDiscriminatedUnion",(t,e)=>{Gtt.init(t,e);let r=t._zod.parse;xc(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=sRe(()=>{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(!Rde(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)}}),aYt=dt("$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])=>Fkn(r,u,d)):Fkn(r,s,c)}});function Szt(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(kde(t)&&kde(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=Szt(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=>qtt(h,o,u))):qtt(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=>qtt(m,o,u))):qtt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function qtt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(qtt,"handleTupleResult");var cYt=dt("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!kde(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(...eb(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...eb(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=>aT(d,n,sm())),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(...eb(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...eb(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),lYt=dt("$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])=>{Ukn(f,h,r,c,o,t,n)})):Ukn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Ukn(t,e,r,n,o,s,c){t.issues.length&&(cRe.has(typeof n)?r.issues.push(...eb(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>aT(l,c,sm()))})),e.issues.length&&(cRe.has(typeof n)?r.issues.push(...eb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>aT(l,c,sm()))})),r.value.set(t.value,e.value)}a(Ukn,"handleMapResult");var uYt=dt("$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=>Qkn(u,r))):Qkn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Qkn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Qkn,"handleSetResult");var dYt=dt("$ZodEnum",(t,e)=>{uo.init(t,e);let r=oRe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>cRe.has(typeof n)).map(n=>typeof n=="string"?vF(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}}),fYt=dt("$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"?vF(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}}),pYt=dt("$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}}),_Re=dt("$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 c5;return r.value=o,r}}),hYt=dt("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",xc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${aRe(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)}),mYt=dt("$ZodNullable",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${aRe(r.source)}|null)$`):void 0}),xc(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)}),gYt=dt("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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=>qkn(s,e)):qkn(o,e)}});function qkn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(qkn,"handleDefaultResult");var AYt=dt("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(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))}),yYt=dt("$ZodNonOptional",(t,e)=>{uo.init(t,e),xc(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=>jkn(s,t)):jkn(o,t)}});function jkn(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(jkn,"handleNonOptionalResult");var EYt=dt("$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)}}),_Yt=dt("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(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=>aT(c,n,sm()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>aT(s,n,sm()))},input:r.value}),r.issues=[]),r)}}),vYt=dt("$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)}),vRe=dt("$ZodPipe",(t,e)=>{uo.init(t,e),xc(t._zod,"values",()=>e.in._zod.values),xc(t._zod,"optin",()=>e.in._zod.optin),xc(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=>Hkn(s,e,n)):Hkn(o,e,n)}});function Hkn(t,e,r){return MJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Hkn,"handlePipeResult");var CYt=dt("$ZodReadonly",(t,e)=>{uo.init(t,e),xc(t._zod,"propValues",()=>e.innerType._zod.propValues),xc(t._zod,"values",()=>e.innerType._zod.values),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(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(Gkn):Gkn(o)}});function Gkn(t){return t.value=Object.freeze(t.value),t}a(Gkn,"handleReadonlyResult");var bYt=dt("$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||bWt.has(typeof n))r.push(vF(`${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)}),SYt=dt("$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))}),TYt=dt("$ZodLazy",(t,e)=>{uo.init(t,e),xc(t._zod,"innerType",()=>e.getter()),xc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),xc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),xc(t._zod,"optin",()=>t._zod.innerType._zod.optin),xc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),IYt=dt("$ZodCustom",(t,e)=>{xf.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=>$kn(s,r,n,t));$kn(o,r,n,t)}});function $kn(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(xWt(o))}}a($kn,"handleRefineResult");var bRe={};ki(bRe,{ar:()=>xYt,az:()=>wYt,be:()=>RYt,ca:()=>kYt,cs:()=>PYt,de:()=>DYt,en:()=>CRe,eo:()=>NYt,es:()=>MYt,fa:()=>OYt,fi:()=>LYt,fr:()=>BYt,frCA:()=>FYt,he:()=>UYt,hu:()=>QYt,id:()=>qYt,it:()=>jYt,ja:()=>HYt,kh:()=>GYt,ko:()=>$Yt,mk:()=>VYt,ms:()=>WYt,nl:()=>zYt,no:()=>YYt,ota:()=>KYt,pl:()=>ZYt,ps:()=>JYt,pt:()=>XYt,ru:()=>eKt,sl:()=>tKt,sv:()=>rKt,ta:()=>nKt,th:()=>iKt,tr:()=>oKt,ua:()=>sKt,ur:()=>aKt,vi:()=>cKt,zhCN:()=>lKt,zhTW:()=>uKt});p();p();var Tis=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: ${jt(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":""}: ${jt(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 xYt(){return{localeError:Tis()}}a(xYt,"default");p();var Iis=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: ${jt(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":""}: ${jt(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 wYt(){return{localeError:Iis()}}a(wYt,"default");p();function Ykn(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(Ykn,"getBelarusianPlural");var xis=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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Ykn(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=Ykn(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"}: ${jt(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 RYt(){return{localeError:xis()}}a(RYt,"default");p();var wis=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 ${jt(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":""}: ${jt(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 kYt(){return{localeError:wis()}}a(kYt,"default");p();var Ris=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 ${jt(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: ${jt(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 PYt(){return{localeError:Ris()}}a(PYt,"default");p();var kis=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 ${jt(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"}: ${jt(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 DYt(){return{localeError:kis()}}a(DYt,"default");p();var Pis=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"),Dis=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 ${Pis(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${jt(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":""}: ${jt(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 CRe(){return{localeError:Dis()}}a(CRe,"default");p();var Nis=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"),Mis=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 ${Nis(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${jt(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":""}: ${jt(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 NYt(){return{localeError:Mis()}}a(NYt,"default");p();var Ois=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 ${jt(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":""}: ${jt(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 MYt(){return{localeError:Ois()}}a(MYt,"default");p();var Lis=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 ${jt(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: ${jt(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 OYt(){return{localeError:Lis()}}a(OYt,"default");p();var Bis=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: ${jt(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"}: ${jt(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 LYt(){return{localeError:Bis()}}a(LYt,"default");p();var Fis=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 ${jt(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":""} : ${jt(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 BYt(){return{localeError:Fis()}}a(BYt,"default");p();var Uis=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 ${jt(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":""} : ${jt(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 FYt(){return{localeError:Uis()}}a(FYt,"default");p();var Qis=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 ${jt(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"}: ${jt(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 UYt(){return{localeError:Qis()}}a(UYt,"default");p();var qis=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 ${jt(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":""}: ${jt(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 QYt(){return{localeError:qis()}}a(QYt,"default");p();var jis=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 ${jt(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":""}: ${jt(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 qYt(){return{localeError:jis()}}a(qYt,"default");p();var His=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 ${jt(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"}: ${jt(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 jYt(){return{localeError:His()}}a(jYt,"default");p();var Gis=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: ${jt(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":""}: ${jt(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 HYt(){return{localeError:Gis()}}a(HYt,"default");p();var $is=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 ${jt(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 ${jt(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 GYt(){return{localeError:$is()}}a(GYt,"default");p();var Vis=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: ${jt(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: ${jt(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 $Yt(){return{localeError:Vis()}}a($Yt,"default");p();var Wis=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 ${jt(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"}: ${jt(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 VYt(){return{localeError:Wis()}}a(VYt,"default");p();var zis=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 ${jt(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: ${jt(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 WYt(){return{localeError:zis()}}a(WYt,"default");p();var Yis=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 ${jt(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":""}: ${jt(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 zYt(){return{localeError:Yis()}}a(zYt,"default");p();var Kis=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 ${jt(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"}: ${jt(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 YYt(){return{localeError:Kis()}}a(YYt,"default");p();var Jis=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 ${jt(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":""}: ${jt(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 KYt(){return{localeError:Jis()}}a(KYt,"default");p();var Zis=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 ${jt(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"}: ${jt(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 JYt(){return{localeError:Zis()}}a(JYt,"default");p();var Xis=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 ${jt(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":""}: ${jt(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 ZYt(){return{localeError:Xis()}}a(ZYt,"default");p();var eos=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 ${jt(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":""}: ${jt(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 XYt(){return{localeError:eos()}}a(XYt,"default");p();function Kkn(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(Kkn,"getRussianPlural");var tos=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 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Kkn(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=Kkn(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":""}: ${jt(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 eKt(){return{localeError:tos()}}a(eKt,"default");p();var ros=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 ${jt(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"}: ${jt(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 tKt(){return{localeError:ros()}}a(tKt,"default");p();var nos=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 ${jt(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"}: ${jt(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 rKt(){return{localeError:nos()}}a(rKt,"default");p();var ios=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 ${jt(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":""}: ${jt(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 nKt(){return{localeError:ios()}}a(nKt,"default");p();var oos=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 ${jt(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: ${jt(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 iKt(){return{localeError:oos()}}a(iKt,"default");p();var sos=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"),aos=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 ${sos(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: ${jt(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":""}: ${jt(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 oKt(){return{localeError:aos()}}a(oKt,"default");p();var cos=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 ${jt(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":""}: ${jt(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 sKt(){return{localeError:cos()}}a(sKt,"default");p();var los=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: ${jt(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":""}: ${jt(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 aKt(){return{localeError:los()}}a(aKt,"default");p();var uos=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 ${jt(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: ${jt(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 cKt(){return{localeError:uos()}}a(cKt,"default");p();var dos=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 ${jt(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): ${jt(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 lKt(){return{localeError:dos()}}a(lKt,"default");p();var fos=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 ${jt(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${jt(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 uKt(){return{localeError:fos()}}a(uKt,"default");p();var dKt=Symbol("ZodOutput"),fKt=Symbol("ZodInput"),Ode=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 $tt(){return new Ode}a($tt,"registry");var l5=$tt();p();p();function pKt(t,e){return new t({type:"string",...Tr(e)})}a(pKt,"_string");function hKt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(hKt,"_coercedString");function Vtt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(Vtt,"_email");function SRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(SRe,"_guid");function Wtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(Wtt,"_uuid");function ztt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(ztt,"_uuidv4");function Ytt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Ytt,"_uuidv6");function Ktt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Ktt,"_uuidv7");function Jtt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(Jtt,"_url");function Ztt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Ztt,"_emoji");function Xtt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Xtt,"_nanoid");function ert(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(ert,"_cuid");function trt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(trt,"_cuid2");function rrt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(rrt,"_ulid");function nrt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(nrt,"_xid");function irt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(irt,"_ksuid");function ort(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(ort,"_ipv4");function srt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(srt,"_ipv6");function art(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(art,"_cidrv4");function crt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(crt,"_cidrv6");function lrt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(lrt,"_base64");function urt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(urt,"_base64url");function drt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(drt,"_e164");function frt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(frt,"_jwt");var mKt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function gKt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(gKt,"_isoDateTime");function AKt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(AKt,"_isoDate");function yKt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(yKt,"_isoTime");function EKt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(EKt,"_isoDuration");function _Kt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(_Kt,"_number");function vKt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(vKt,"_coercedNumber");function CKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(CKt,"_int");function bKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(bKt,"_float32");function SKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(SKt,"_float64");function TKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(TKt,"_int32");function IKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(IKt,"_uint32");function xKt(t,e){return new t({type:"boolean",...Tr(e)})}a(xKt,"_boolean");function wKt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(wKt,"_coercedBoolean");function RKt(t,e){return new t({type:"bigint",...Tr(e)})}a(RKt,"_bigint");function kKt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(kKt,"_coercedBigint");function PKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(PKt,"_int64");function DKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(DKt,"_uint64");function NKt(t,e){return new t({type:"symbol",...Tr(e)})}a(NKt,"_symbol");function MKt(t,e){return new t({type:"undefined",...Tr(e)})}a(MKt,"_undefined");function OKt(t,e){return new t({type:"null",...Tr(e)})}a(OKt,"_null");function LKt(t){return new t({type:"any"})}a(LKt,"_any");function Lde(t){return new t({type:"unknown"})}a(Lde,"_unknown");function BKt(t,e){return new t({type:"never",...Tr(e)})}a(BKt,"_never");function FKt(t,e){return new t({type:"void",...Tr(e)})}a(FKt,"_void");function UKt(t,e){return new t({type:"date",...Tr(e)})}a(UKt,"_date");function QKt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(QKt,"_coercedDate");function qKt(t,e){return new t({type:"nan",...Tr(e)})}a(qKt,"_nan");function CF(t,e){return new Ftt({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(CF,"_lt");function _w(t,e){return new Ftt({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(_w,"_lte");function bF(t,e){return new Utt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(bF,"_gt");function tb(t,e){return new Utt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(tb,"_gte");function jKt(t){return bF(0,t)}a(jKt,"_positive");function HKt(t){return CF(0,t)}a(HKt,"_negative");function GKt(t){return _w(0,t)}a(GKt,"_nonpositive");function $Kt(t){return tb(0,t)}a($Kt,"_nonnegative");function UJ(t,e){return new ozt({check:"multiple_of",...Tr(e),value:t})}a(UJ,"_multipleOf");function Bde(t,e){return new czt({check:"max_size",...Tr(e),maximum:t})}a(Bde,"_maxSize");function QJ(t,e){return new lzt({check:"min_size",...Tr(e),minimum:t})}a(QJ,"_minSize");function TRe(t,e){return new uzt({check:"size_equals",...Tr(e),size:t})}a(TRe,"_size");function Fde(t,e){return new dzt({check:"max_length",...Tr(e),maximum:t})}a(Fde,"_maxLength");function ij(t,e){return new fzt({check:"min_length",...Tr(e),minimum:t})}a(ij,"_minLength");function Ude(t,e){return new pzt({check:"length_equals",...Tr(e),length:t})}a(Ude,"_length");function IRe(t,e){return new hzt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(IRe,"_regex");function xRe(t){return new mzt({check:"string_format",format:"lowercase",...Tr(t)})}a(xRe,"_lowercase");function wRe(t){return new gzt({check:"string_format",format:"uppercase",...Tr(t)})}a(wRe,"_uppercase");function RRe(t,e){return new Azt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(RRe,"_includes");function kRe(t,e){return new yzt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(kRe,"_startsWith");function PRe(t,e){return new Ezt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(PRe,"_endsWith");function VKt(t,e,r){return new _zt({check:"property",property:t,schema:e,...Tr(r)})}a(VKt,"_property");function DRe(t,e){return new vzt({check:"mime_type",mime:t,...Tr(e)})}a(DRe,"_mime");function SF(t){return new Czt({check:"overwrite",tx:t})}a(SF,"_overwrite");function NRe(t){return SF(e=>e.normalize(t))}a(NRe,"_normalize");function MRe(){return SF(t=>t.trim())}a(MRe,"_trim");function ORe(){return SF(t=>t.toLowerCase())}a(ORe,"_toLowerCase");function LRe(){return SF(t=>t.toUpperCase())}a(LRe,"_toUpperCase");function BRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(BRe,"_array");function pos(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(pos,"_union");function hos(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(hos,"_discriminatedUnion");function mos(t,e,r){return new t({type:"intersection",left:e,right:r})}a(mos,"_intersection");function WKt(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(WKt,"_tuple");function gos(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(gos,"_record");function Aos(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(Aos,"_map");function yos(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(yos,"_set");function Eos(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(Eos,"_enum");function _os(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(_os,"_nativeEnum");function vos(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(vos,"_literal");function zKt(t,e){return new t({type:"file",...Tr(e)})}a(zKt,"_file");function Cos(t,e){return new t({type:"transform",transform:e})}a(Cos,"_transform");function bos(t,e){return new t({type:"optional",innerType:e})}a(bos,"_optional");function Sos(t,e){return new t({type:"nullable",innerType:e})}a(Sos,"_nullable");function Tos(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(Tos,"_default");function Ios(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(Ios,"_nonoptional");function xos(t,e){return new t({type:"success",innerType:e})}a(xos,"_success");function wos(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(wos,"_catch");function Ros(t,e,r){return new t({type:"pipe",in:e,out:r})}a(Ros,"_pipe");function kos(t,e){return new t({type:"readonly",innerType:e})}a(kos,"_readonly");function Pos(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(Pos,"_templateLiteral");function Dos(t,e){return new t({type:"lazy",getter:e})}a(Dos,"_lazy");function Nos(t,e){return new t({type:"promise",innerType:e})}a(Nos,"_promise");function YKt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(YKt,"_custom");function KKt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(KKt,"_refine");function JKt(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??vRe,u=t.Boolean??yRe,d=t.String??BJ,f=t.Transform??_Re,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(JKt,"_stringbool");function ZKt(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(ZKt,"_stringFormat");var prt=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?hRe(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?hRe(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 mRe(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?mRe(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 FJ({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 XKt(t){return new prt({type:"function",input:Array.isArray(t?.input)?WKt(FJ,t?.input):t?.input??BRe(ERe,Lde(Mde)),output:t?.output??Lde(Mde)})}a(XKt,"_function");p();var FRe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??l5,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=oRe(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"&&y0(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 KKt(t,e){if(t instanceof Mde){let n=new ORe(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 ORe(e);return r.process(t),r.emit(t,e)}a(KKt,"toJSONSchema");function g0(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 g0(o.element,r);case"object":{for(let s in o.shape)if(g0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(g0(s,r))return!0;return!1}case"intersection":return g0(o.left,r)||g0(o.right,r);case"tuple":{for(let s of o.items)if(g0(s,r))return!0;return!!(o.rest&&g0(o.rest,r))}case"record":return g0(o.keyType,r)||g0(o.valueType,r);case"map":return g0(o.keyType,r)||g0(o.valueType,r);case"set":return g0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return g0(o.innerType,r);case"lazy":return g0(o.getter(),r);case"default":return g0(o.innerType,r);case"prefault":return g0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return g0(o.in,r)||g0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(g0,"isTransforming");var Vkn={};p();p();p();var Ude={};ki(Ude,{ZodISODate:()=>lrt,ZodISODateTime:()=>crt,ZodISODuration:()=>drt,ZodISOTime:()=>urt,date:()=>ZKt,datetime:()=>JKt,duration:()=>eJt,time:()=>XKt});p();var crt=dt("ZodISODateTime",(t,e)=>{Dzt.init(t,e),Cu.init(t,e)});function JKt(t){return fKt(crt,t)}a(JKt,"datetime");var lrt=dt("ZodISODate",(t,e)=>{Nzt.init(t,e),Cu.init(t,e)});function ZKt(t){return pKt(lrt,t)}a(ZKt,"date");var urt=dt("ZodISOTime",(t,e)=>{Mzt.init(t,e),Cu.init(t,e)});function XKt(t){return hKt(urt,t)}a(XKt,"time");var drt=dt("ZodISODuration",(t,e)=>{Ozt.init(t,e),Cu.init(t,e)});function eJt(t){return mKt(drt,t)}a(eJt,"duration");p();p();var zkn=a((t,e)=>{cRe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>uRe(t,r),"value")},flatten:{value:a(r=>lRe(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"),_os=dt("ZodError",zkn),Qde=dt("ZodError",zkn,{Parent:Error});var tJt=xtt(Qde),rJt=wtt(Qde),nJt=Rtt(Qde),iJt=ktt(Qde);var ks=dt("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)=>iT(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>tJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>nJt(t,r,n),t.parseAsync=async(r,n)=>rJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>iJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(wPn(r,n)),t.superRefine=r=>t.check(RPn(r)),t.overwrite=r=>t.check(CF(r)),t.optional=()=>bu(t),t.nullable=()=>prt(t),t.nullish=()=>bu(prt(t)),t.nonoptional=r=>gPn(t,r),t.array=()=>Fr(t),t.or=r=>Il([t,r]),t.and=r=>qRe(t,r),t.transform=r=>hrt(t,kJt(r)),t.default=r=>pPn(t,r),t.prefault=r=>mPn(t,r),t.catch=r=>EPn(t,r),t.pipe=r=>hrt(t,r),t.readonly=()=>CPn(t),t.describe=r=>{let n=t.clone();return s5.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return s5.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return s5.get(t);let n=t.clone();return s5.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),sJt=dt("_ZodString",(t,e)=>{OJ.init(t,e),ks.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(bRe(...n)),t.includes=(...n)=>t.check(IRe(...n)),t.startsWith=(...n)=>t.check(xRe(...n)),t.endsWith=(...n)=>t.check(wRe(...n)),t.min=(...n)=>t.check(tj(...n)),t.max=(...n)=>t.check(Bde(...n)),t.length=(...n)=>t.check(Fde(...n)),t.nonempty=(...n)=>t.check(tj(1,...n)),t.lowercase=n=>t.check(SRe(n)),t.uppercase=n=>t.check(TRe(n)),t.trim=()=>t.check(PRe()),t.normalize=(...n)=>t.check(kRe(...n)),t.toLowerCase=()=>t.check(DRe()),t.toUpperCase=()=>t.check(NRe())}),BRe=dt("ZodString",(t,e)=>{OJ.init(t,e),sJt.init(t,e),t.email=r=>t.check(Qtt(aJt,r)),t.url=r=>t.check($tt(cJt,r)),t.jwt=r=>t.check(srt(SJt,r)),t.emoji=r=>t.check(Vtt(uJt,r)),t.guid=r=>t.check(vRe(frt,r)),t.uuid=r=>t.check(qtt(SF,r)),t.uuidv4=r=>t.check(jtt(SF,r)),t.uuidv6=r=>t.check(Htt(SF,r)),t.uuidv7=r=>t.check(Gtt(SF,r)),t.nanoid=r=>t.check(Wtt(dJt,r)),t.guid=r=>t.check(vRe(frt,r)),t.cuid=r=>t.check(ztt(fJt,r)),t.cuid2=r=>t.check(Ytt(pJt,r)),t.ulid=r=>t.check(Ktt(hJt,r)),t.base64=r=>t.check(nrt(vJt,r)),t.base64url=r=>t.check(irt(CJt,r)),t.xid=r=>t.check(Jtt(mJt,r)),t.ksuid=r=>t.check(Ztt(gJt,r)),t.ipv4=r=>t.check(Xtt(AJt,r)),t.ipv6=r=>t.check(ert(yJt,r)),t.cidrv4=r=>t.check(trt(EJt,r)),t.cidrv6=r=>t.check(rrt(_Jt,r)),t.e164=r=>t.check(ort(bJt,r)),t.datetime=r=>t.check(JKt(r)),t.date=r=>t.check(ZKt(r)),t.time=r=>t.check(XKt(r)),t.duration=r=>t.check(eJt(r))});function Je(t){return lKt(BRe,t)}a(Je,"string");var Cu=dt("ZodStringFormat",(t,e)=>{Vl.init(t,e),sJt.init(t,e)}),aJt=dt("ZodEmail",(t,e)=>{bzt.init(t,e),Cu.init(t,e)});function Cos(t){return Qtt(aJt,t)}a(Cos,"email");var frt=dt("ZodGUID",(t,e)=>{vzt.init(t,e),Cu.init(t,e)});function bos(t){return vRe(frt,t)}a(bos,"guid");var SF=dt("ZodUUID",(t,e)=>{Czt.init(t,e),Cu.init(t,e)});function Sos(t){return qtt(SF,t)}a(Sos,"uuid");function Tos(t){return jtt(SF,t)}a(Tos,"uuidv4");function Ios(t){return Htt(SF,t)}a(Ios,"uuidv6");function xos(t){return Gtt(SF,t)}a(xos,"uuidv7");var cJt=dt("ZodURL",(t,e)=>{Szt.init(t,e),Cu.init(t,e)});function lJt(t){return $tt(cJt,t)}a(lJt,"url");var uJt=dt("ZodEmoji",(t,e)=>{Tzt.init(t,e),Cu.init(t,e)});function wos(t){return Vtt(uJt,t)}a(wos,"emoji");var dJt=dt("ZodNanoID",(t,e)=>{Izt.init(t,e),Cu.init(t,e)});function Ros(t){return Wtt(dJt,t)}a(Ros,"nanoid");var fJt=dt("ZodCUID",(t,e)=>{xzt.init(t,e),Cu.init(t,e)});function kos(t){return ztt(fJt,t)}a(kos,"cuid");var pJt=dt("ZodCUID2",(t,e)=>{wzt.init(t,e),Cu.init(t,e)});function Pos(t){return Ytt(pJt,t)}a(Pos,"cuid2");var hJt=dt("ZodULID",(t,e)=>{Rzt.init(t,e),Cu.init(t,e)});function Dos(t){return Ktt(hJt,t)}a(Dos,"ulid");var mJt=dt("ZodXID",(t,e)=>{kzt.init(t,e),Cu.init(t,e)});function Nos(t){return Jtt(mJt,t)}a(Nos,"xid");var gJt=dt("ZodKSUID",(t,e)=>{Pzt.init(t,e),Cu.init(t,e)});function Mos(t){return Ztt(gJt,t)}a(Mos,"ksuid");var AJt=dt("ZodIPv4",(t,e)=>{Lzt.init(t,e),Cu.init(t,e)});function Oos(t){return Xtt(AJt,t)}a(Oos,"ipv4");var yJt=dt("ZodIPv6",(t,e)=>{Bzt.init(t,e),Cu.init(t,e)});function Los(t){return ert(yJt,t)}a(Los,"ipv6");var EJt=dt("ZodCIDRv4",(t,e)=>{Fzt.init(t,e),Cu.init(t,e)});function Bos(t){return trt(EJt,t)}a(Bos,"cidrv4");var _Jt=dt("ZodCIDRv6",(t,e)=>{Uzt.init(t,e),Cu.init(t,e)});function Fos(t){return rrt(_Jt,t)}a(Fos,"cidrv6");var vJt=dt("ZodBase64",(t,e)=>{qzt.init(t,e),Cu.init(t,e)});function Uos(t){return nrt(vJt,t)}a(Uos,"base64");var CJt=dt("ZodBase64URL",(t,e)=>{jzt.init(t,e),Cu.init(t,e)});function Qos(t){return irt(CJt,t)}a(Qos,"base64url");var bJt=dt("ZodE164",(t,e)=>{Hzt.init(t,e),Cu.init(t,e)});function qos(t){return ort(bJt,t)}a(qos,"e164");var SJt=dt("ZodJWT",(t,e)=>{Gzt.init(t,e),Cu.init(t,e)});function jos(t){return srt(SJt,t)}a(jos,"jwt");var Ykn=dt("ZodCustomStringFormat",(t,e)=>{$zt.init(t,e),Cu.init(t,e)});function Hos(t,e,r={}){return zKt(Ykn,t,e,r)}a(Hos,"stringFormat");var FRe=dt("ZodNumber",(t,e)=>{Ltt.init(t,e),ks.init(t,e),t.gt=(n,o)=>t.check(vF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(_F(n,o)),t.lte=(n,o)=>t.check(yw(n,o)),t.max=(n,o)=>t.check(yw(n,o)),t.int=n=>t.check(oJt(n)),t.safe=n=>t.check(oJt(n)),t.positive=n=>t.check(vF(0,n)),t.nonnegative=n=>t.check(tb(0,n)),t.negative=n=>t.check(_F(0,n)),t.nonpositive=n=>t.check(yw(0,n)),t.multipleOf=(n,o)=>t.check(BJ(n,o)),t.step=(n,o)=>t.check(BJ(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 ka(t){return gKt(FRe,t)}a(ka,"number");var qde=dt("ZodNumberFormat",(t,e)=>{Vzt.init(t,e),FRe.init(t,e)});function oJt(t){return yKt(qde,t)}a(oJt,"int");function Gos(t){return EKt(qde,t)}a(Gos,"float32");function $os(t){return _Kt(qde,t)}a($os,"float64");function Vos(t){return vKt(qde,t)}a(Vos,"int32");function Wos(t){return CKt(qde,t)}a(Wos,"uint32");var URe=dt("ZodBoolean",(t,e)=>{mRe.init(t,e),ks.init(t,e)});function ol(t){return bKt(URe,t)}a(ol,"boolean");var QRe=dt("ZodBigInt",(t,e)=>{Btt.init(t,e),ks.init(t,e),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.gt=(n,o)=>t.check(vF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(_F(n,o)),t.lte=(n,o)=>t.check(yw(n,o)),t.max=(n,o)=>t.check(yw(n,o)),t.positive=n=>t.check(vF(BigInt(0),n)),t.negative=n=>t.check(_F(BigInt(0),n)),t.nonpositive=n=>t.check(yw(BigInt(0),n)),t.nonnegative=n=>t.check(tb(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(BJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function zos(t){return TKt(QRe,t)}a(zos,"bigint");var TJt=dt("ZodBigIntFormat",(t,e)=>{Wzt.init(t,e),QRe.init(t,e)});function Yos(t){return xKt(TJt,t)}a(Yos,"int64");function Kos(t){return wKt(TJt,t)}a(Kos,"uint64");var Kkn=dt("ZodSymbol",(t,e)=>{zzt.init(t,e),ks.init(t,e)});function Jos(t){return RKt(Kkn,t)}a(Jos,"symbol");var Jkn=dt("ZodUndefined",(t,e)=>{Yzt.init(t,e),ks.init(t,e)});function Zos(t){return kKt(Jkn,t)}a(Zos,"_undefined");var Zkn=dt("ZodNull",(t,e)=>{Kzt.init(t,e),ks.init(t,e)});function mrt(t){return PKt(Zkn,t)}a(mrt,"_null");var Xkn=dt("ZodAny",(t,e)=>{Jzt.init(t,e),ks.init(t,e)});function IJt(){return DKt(Xkn)}a(IJt,"any");var ePn=dt("ZodUnknown",(t,e)=>{Nde.init(t,e),ks.init(t,e)});function od(){return Ode(ePn)}a(od,"unknown");var tPn=dt("ZodNever",(t,e)=>{Zzt.init(t,e),ks.init(t,e)});function grt(t){return NKt(tPn,t)}a(grt,"never");var rPn=dt("ZodVoid",(t,e)=>{Xzt.init(t,e),ks.init(t,e)});function Xos(t){return MKt(rPn,t)}a(Xos,"_void");var Art=dt("ZodDate",(t,e)=>{eYt.init(t,e),ks.init(t,e),t.min=(n,o)=>t.check(tb(n,o)),t.max=(n,o)=>t.check(yw(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 ess(t){return OKt(Art,t)}a(ess,"date");var nPn=dt("ZodArray",(t,e)=>{gRe.init(t,e),ks.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(tj(r,n)),t.nonempty=r=>t.check(tj(1,r)),t.max=(r,n)=>t.check(Bde(r,n)),t.length=(r,n)=>t.check(Fde(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return MRe(nPn,t,e)}a(Fr,"array");function tss(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(tss,"keyof");var yrt=dt("ZodObject",(t,e)=>{tYt.init(t,e),ks.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>rv(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:od()}),t.loose=()=>t.clone({...t._zod.def,catchall:od()}),t.strict=()=>t.clone({...t._zod.def,catchall:grt()}),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(PJt,t,r[0]),t.required=(...r)=>qr.required(DJt,t,r[0])});function zr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new yrt(r)}a(zr,"object");function rss(t,e){return new yrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:grt(),...qr.normalizeParams(e)})}a(rss,"strictObject");function om(t,e){return new yrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:od(),...qr.normalizeParams(e)})}a(om,"looseObject");var xJt=dt("ZodUnion",(t,e)=>{Ftt.init(t,e),ks.init(t,e),t.options=e.options});function Il(t,e){return new xJt({type:"union",options:t,...qr.normalizeParams(e)})}a(Il,"union");var iPn=dt("ZodDiscriminatedUnion",(t,e)=>{xJt.init(t,e),rYt.init(t,e)});function Ert(t,e,r){return new iPn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(Ert,"discriminatedUnion");var oPn=dt("ZodIntersection",(t,e)=>{nYt.init(t,e),ks.init(t,e)});function qRe(t,e){return new oPn({type:"intersection",left:t,right:e})}a(qRe,"intersection");var sPn=dt("ZodTuple",(t,e)=>{LJ.init(t,e),ks.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function nss(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new sPn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(nss,"tuple");var wJt=dt("ZodRecord",(t,e)=>{iYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function xl(t,e,r){return new wJt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(xl,"record");function iss(t,e,r){return new wJt({type:"record",keyType:Il([t,grt()]),valueType:e,...qr.normalizeParams(r)})}a(iss,"partialRecord");var aPn=dt("ZodMap",(t,e)=>{oYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function oss(t,e,r){return new aPn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(oss,"map");var cPn=dt("ZodSet",(t,e)=>{sYt.init(t,e),ks.init(t,e),t.min=(...r)=>t.check(FJ(...r)),t.nonempty=r=>t.check(FJ(1,r)),t.max=(...r)=>t.check(Lde(...r)),t.size=(...r)=>t.check(CRe(...r))});function sss(t,e){return new cPn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(sss,"set");var LRe=dt("ZodEnum",(t,e)=>{aYt.init(t,e),ks.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 LRe({...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 LRe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function rv(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new LRe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(rv,"_enum");function ass(t,e){return new LRe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(ass,"nativeEnum");var lPn=dt("ZodLiteral",(t,e)=>{cYt.init(t,e),ks.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 lPn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var uPn=dt("ZodFile",(t,e)=>{lYt.init(t,e),ks.init(t,e),t.min=(r,n)=>t.check(FJ(r,n)),t.max=(r,n)=>t.check(Lde(r,n)),t.mime=(r,n)=>t.check(RRe(Array.isArray(r)?r:[r],n))});function css(t){return GKt(uPn,t)}a(css,"file");var RJt=dt("ZodTransform",(t,e)=>{ARe.init(t,e),ks.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 kJt(t){return new RJt({type:"transform",transform:t})}a(kJt,"transform");var PJt=dt("ZodOptional",(t,e)=>{uYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function bu(t){return new PJt({type:"optional",innerType:t})}a(bu,"optional");var dPn=dt("ZodNullable",(t,e)=>{dYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function prt(t){return new dPn({type:"nullable",innerType:t})}a(prt,"nullable");function lss(t){return bu(prt(t))}a(lss,"nullish");var fPn=dt("ZodDefault",(t,e)=>{fYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function pPn(t,e){return new fPn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(pPn,"_default");var hPn=dt("ZodPrefault",(t,e)=>{pYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mPn(t,e){return new hPn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(mPn,"prefault");var DJt=dt("ZodNonOptional",(t,e)=>{hYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function gPn(t,e){return new DJt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(gPn,"nonoptional");var APn=dt("ZodSuccess",(t,e)=>{mYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function uss(t){return new APn({type:"success",innerType:t})}a(uss,"success");var yPn=dt("ZodCatch",(t,e)=>{gYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function EPn(t,e){return new yPn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(EPn,"_catch");var _Pn=dt("ZodNaN",(t,e)=>{AYt.init(t,e),ks.init(t,e)});function dss(t){return BKt(_Pn,t)}a(dss,"nan");var NJt=dt("ZodPipe",(t,e)=>{yRe.init(t,e),ks.init(t,e),t.in=e.in,t.out=e.out});function hrt(t,e){return new NJt({type:"pipe",in:t,out:e})}a(hrt,"pipe");var vPn=dt("ZodReadonly",(t,e)=>{yYt.init(t,e),ks.init(t,e)});function CPn(t){return new vPn({type:"readonly",innerType:t})}a(CPn,"readonly");var bPn=dt("ZodTemplateLiteral",(t,e)=>{EYt.init(t,e),ks.init(t,e)});function fss(t,e){return new bPn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(fss,"templateLiteral");var SPn=dt("ZodLazy",(t,e)=>{vYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.getter()});function TPn(t){return new SPn({type:"lazy",getter:t})}a(TPn,"lazy");var IPn=dt("ZodPromise",(t,e)=>{_Yt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function pss(t){return new IPn({type:"promise",innerType:t})}a(pss,"promise");var _rt=dt("ZodCustom",(t,e)=>{CYt.init(t,e),ks.init(t,e)});function xPn(t){let e=new Tf({check:"custom"});return e._zod.check=t,e}a(xPn,"check");function MJt(t,e){return $Kt(_rt,t??(()=>!0),e)}a(MJt,"custom");function wPn(t,e={}){return VKt(_rt,t,e)}a(wPn,"refine");function RPn(t){let e=xPn(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(RPn,"superRefine");function hss(t,e={error:`Input not instance of ${t.name}`}){let r=new _rt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(hss,"_instanceof");var mss=a((...t)=>WKt({Pipe:NJt,Boolean:URe,String:BRe,Transform:RJt},...t),"stringbool");function gss(t){let e=TPn(()=>Il([Je(t),ka(),ol(),mrt(),Fr(e),xl(Je(),e)]));return e}a(gss,"json");function vrt(t,e){return hrt(kJt(t),e)}a(vrt,"preprocess");p();var OJt={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 Ass(t){im({customError:t})}a(Ass,"setErrorMap");function yss(){return im().customError}a(yss,"getErrorMap");var jRe={};ki(jRe,{bigint:()=>Css,boolean:()=>vss,date:()=>bss,number:()=>_ss,string:()=>Ess});p();function Ess(t){return uKt(BRe,t)}a(Ess,"string");function _ss(t){return AKt(FRe,t)}a(_ss,"number");function vss(t){return SKt(URe,t)}a(vss,"boolean");function Css(t){return IKt(QRe,t)}a(Css,"bigint");function bss(t){return LKt(Art,t)}a(bss,"date");im(ERe());p();var ci={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"},If={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"},Crt=1;p();var Tss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),Iss=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)}),xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),wss=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(Iss)}),Rss=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()}),kss=k.union([wss.and(k.object({type:k.literal("env_var")})),Rss.and(k.object({type:k.literal("terminal")})),xss]),BJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Pss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Dss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Nss=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Mss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Oss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Lss=k.object({amount:k.number(),currency:k.string()}),Bss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Fss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Uss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),FJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),Qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jss=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),Hss=k.object({content:k.record(k.string(),jss).nullish()}),Gss=k.intersection(k.union([Hss.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()})),$ss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kPn=k.string(),UJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:kPn}),Vss=k.literal("object"),Wss=k.literal("string"),zss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Yss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:$ss.nullish(),url:zss.nullish()}),PPn=k.object({const:k.string(),title:k.string()}),DPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),Kss=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"})]),NPn=k.object({code:Kss,data:k.unknown().optional(),message:k.string()}),MPn=k.unknown(),OPn=k.unknown(),LPn=k.unknown(),Jss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),BPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),FPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),Zss=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),Xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),QJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),jJt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:eas.nullish()}),HJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nas=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)}),brt=k.string(),ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt}),oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt}),UPn=k.string(),sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:UPn}),aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:UPn,name:k.string()}),cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(BPn),name:k.string(),url:k.string()}),las=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(BPn),name:k.string(),url:k.string()}),uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(DPn),name:k.string()}),Srt=k.union([cas.and(k.object({type:k.literal("http")})),las.and(k.object({type:k.literal("sse")})),aas.and(k.object({type:k.literal("acp")})),uas]),QPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),qPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),jPn=k.unknown(),GJt=k.string(),das=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:GJt,name:k.string()}),fas=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),has=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),yas=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()}),Eas=k.object({diff:k.string(),uri:k.string()}),_as=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()}),vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bas=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),Sas=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()}),Tas=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),Ias=k.object({excerpts:k.array(_as),uri:k.string()}),xas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),was=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ras=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:vas.nullish(),rename:was.nullish(),searchAndReplace:kas.nullish()}),Das=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Nas=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Mas=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()}),Oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:pas.nullish(),editHistory:yas.nullish(),openFiles:Cas.nullish(),recentFiles:Sas.nullish(),relatedSnippets:xas.nullish(),userActions:Mas.nullish()}),$Jt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt)}),Las=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),HPn=k.string(),Bas=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Fas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:Bas,name:k.string(),optionId:HPn}),Uas=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),Qas=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),qas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Uas,status:Qas}),jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(qas)}),rj=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"})}),Has=k.object({id:k.string(),position:rj,uri:k.string()}),Gas=k.object({id:k.string(),newName:k.string(),position:rj,uri:k.string()}),$as=k.object({action:k.string(),position:rj,timestampMs:k.number(),uri:k.string()}),GPn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Tss.optional().default({terminal:!1}),elicitation:Yss.nullish(),fs:Jss.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Pas.nullish(),positionEncodings:k.array(GPn).optional(),terminal:k.boolean().optional().default(!1)}),Was=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)}),$Pn=k.number().int().gte(0).lte(65535),VJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Vas.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:FPn.nullish(),protocolVersion:$Pn}),zas=k.object({apiType:jJt,baseUrl:k.string()}),Yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:zas.nullish(),id:k.string(),required:k.boolean(),supported:k.array(jJt)}),Kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(Yas)}),Jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jde=k.object({end:rj,start:rj}),Zas=k.object({message:k.string(),range:jde,severity:fas,uri:k.string()}),Xas=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:jde.nullish()}),ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(Zas).nullish(),editHistory:k.array(Eas).nullish(),openFiles:k.array(Xas).nullish(),recentFiles:k.array(bas).nullish(),relatedSnippets:k.array(Ias).nullish(),userActions:k.array($as).nullish()}),tcs=k.object({newText:k.string(),range:jde}),rcs=k.object({cursorPosition:rj.nullish(),edits:k.array(tcs),id:k.string(),uri:k.string()}),ncs=k.union([rcs.and(k.object({kind:k.literal("edit")})),Has.and(k.object({kind:k.literal("jump")})),Gas.and(k.object({kind:k.literal("rename")})),Das.and(k.object({kind:k.literal("searchAndReplace")}))]),ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nj=k.union([k.number(),k.string()]).nullable(),zYd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:nj}),VPn=k.object({requestId:nj}),scs=k.enum(["assistant","user"]),HRe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(scs).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),acs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string()}),ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:HPn}),dcs=k.union([k.object({outcome:k.literal("cancelled")}),ucs.and(k.object({outcome:k.literal("selected")}))]),fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:dcs}),pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mcs=k.object({currentValue:k.boolean()}),gcs=k.string(),WPn=k.string(),Acs=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),WJt=k.string(),zPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:WJt}),ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:gcs,name:k.string(),options:k.array(zPn)}),Ecs=k.union([k.array(zPn),k.array(ycs)]),_cs=k.object({currentValue:WJt,options:Ecs}),Hde=k.intersection(k.union([_cs.and(k.object({type:k.literal("select")})),mcs.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:Acs.nullish(),description:k.string().nullish(),id:WPn,name:k.string()})),vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),Ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sc=k.string(),zJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:sc}),YJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),KJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),JJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),ZJt=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(DPn).optional(),outputByteLimit:k.number().nullish(),sessionId:sc}),XJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),eZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),tZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:rj,sessionId:sc,uri:k.string(),version:k.number(),visibleRange:jde}),rZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:sc,text:k.string(),uri:k.string(),version:k.number()}),nZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),iZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt).optional(),sessionId:sc}),oZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),sZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt),sessionId:sc}),aZt=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:sc}),cZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:Tas.nullish(),sessionId:sc}),lZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),uZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt).optional(),sessionId:sc}),Scs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:sc,title:k.string().nullish(),updatedAt:k.string().nullish()}),Tcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(Scs)}),Ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Trt=k.string(),wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Trt}),Rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Trt,name:k.string()}),Irt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Rcs),currentModeId:Trt}),xrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(das),currentModelId:GJt}),kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish(),sessionId:sc}),Pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish()}),Dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish(),sessionId:sc}),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish()}),Mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:pcs.nullish(),close:hcs.nullish(),delete:Ccs.nullish(),fork:bcs.nullish(),list:xcs.nullish(),resume:Mcs.nullish()}),dZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:jJt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),fZt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:WJt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:WPn,sessionId:sc})),Bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),pZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Trt,sessionId:sc}),Fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:GJt,sessionId:sc}),Ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),qcs=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),jcs=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),Hcs=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:jcs.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(PPn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),mZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:ecs.nullish(),position:rj,selection:jde.nullish(),sessionId:sc,triggerKind:Nas,uri:k.string(),version:k.number()}),Gcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(ncs)}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Vcs=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()}),gZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Vcs.nullish(),output:k.string(),truncated:k.boolean()}),zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),text:k.string()}),Ycs=k.object({range:jde.nullish(),text:k.string()}),AZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(Ycs),sessionId:sc,uri:k.string(),version:k.number()}),YYd=k.object({method:k.string(),params:k.union([YJt,rZt,AZt,eZt,nZt,tZt,zJt,cZt,QPn,MPn]).nullish()}),Kcs=k.union([k.literal("full"),k.literal("incremental")]),Jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:Kcs}),Zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:Jcs.nullish(),didClose:has.nullish(),didFocus:mas.nullish(),didOpen:gas.nullish(),didSave:Aas.nullish()}),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:Zcs.nullish()}),els=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Oas.nullish(),events:Xcs.nullish()}),tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:tas.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:nas.optional().default({acp:!1,http:!1,sse:!1}),nes:els.nullish(),positionEncoding:GPn.nullish(),promptCapabilities:Was.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:Jas.nullish(),sessionCapabilities:Ocs.optional().default({})}),rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:tls.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:FPn.nullish(),authMethods:k.array(kss).optional().default([]),protocolVersion:$Pn}),nls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),ils=k.union([nls,Dss]),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),resource:ils}),yZt=k.union([zcs.and(k.object({type:k.literal("text")})),ccs.and(k.object({type:k.literal("image")})),acs.and(k.object({type:k.literal("audio")})),lcs.and(k.object({type:k.literal("resource_link")})),ols.and(k.object({type:k.literal("resource")}))]),sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:yZt}),LJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:yZt,messageId:k.string().nullish()}),EZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(yZt),sessionId:sc}),als=k.object({anyOf:k.array(PPn)}),YPn=k.union([sls.and(k.object({type:k.literal("content")})),Uss.and(k.object({type:k.literal("diff")})),$cs.and(k.object({type:k.literal("terminal")}))]),_Zt=k.string(),KPn=k.object({sessionId:sc,toolCallId:_Zt.nullish()}),cls=k.intersection(k.union([KPn,VPn]),k.object({elicitationId:kPn,url:k.string().url()})),JPn=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()}),ZPn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),XPn=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")]),lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(YPn).optional(),kind:XPn.optional(),locations:k.array(JPn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ZPn.optional(),title:k.string(),toolCallId:_Zt}),e2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(YPn).nullish(),kind:XPn.nullish(),locations:k.array(JPn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ZPn.nullish(),title:k.string().nullish(),toolCallId:_Zt}),vZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Fas),sessionId:sc,toolCall:e2n}),uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),dls=uls,fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:dls.nullish(),name:k.string()}),pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(fls)}),hls=k.object({enum:k.array(k.string()),type:Wss}),mls=k.union([hls,als]),gls=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:mls,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),Als=k.union([Hcs.and(k.object({type:k.literal("string")})),Las.and(k.object({type:k.literal("number")})),Zss.and(k.object({type:k.literal("integer")})),Nss.and(k.object({type:k.literal("boolean")})),gls.and(k.object({type:k.literal("array")}))]),yls=k.object({description:k.string().nullish(),properties:k.record(k.string(),Als).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Vss.optional().default("object")}),Els=k.intersection(k.union([KPn,VPn]),k.object({requestedSchema:yls})),CZt=k.intersection(k.union([Els.and(k.object({mode:k.literal("form")})),cls.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),_ls=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:qcs,usage:_ls.nullish(),userMessageId:k.string().nullish()}),KYd=k.union([k.object({id:nj,result:k.union([rls,Pss,Kas,Lcs,Qss,ras,Dcs,Pcs,Tcs,Fss,kcs,Ncs,Oss,Fcs,Bcs,vls,Ucs,Qcs,Gcs,Mss,LPn,jPn])}),k.object({error:NPn,id:nj})]),Cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:Lss.nullish(),size:k.number(),used:k.number()}),bls=k.union([LJt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),LJt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),LJt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),lls.and(k.object({sessionUpdate:k.literal("tool_call")})),e2n.and(k.object({sessionUpdate:k.literal("tool_call_update")})),jas.and(k.object({sessionUpdate:k.literal("plan")})),pls.and(k.object({sessionUpdate:k.literal("available_commands_update")})),wcs.and(k.object({sessionUpdate:k.literal("current_mode_update")})),vcs.and(k.object({sessionUpdate:k.literal("config_option_update")})),Ics.and(k.object({sessionUpdate:k.literal("session_info_update")})),Cls.and(k.object({sessionUpdate:k.literal("usage_update")}))]),bZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,update:bls}),JYd=k.object({method:k.string(),params:k.union([bZt,UJt,QPn,MPn]).nullish()}),SZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Sls=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()}),Tls=k.object({name:k.string(),uri:k.string()}),TZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Ras.nullish(),workspaceFolders:k.array(Tls).nullish(),workspaceUri:k.string().nullish()}),ZYd=k.object({id:nj,method:k.string(),params:k.union([VJt,BJt,QJt,dZt,FJt,HJt,$Jt,sZt,qJt,XJt,iZt,uZt,JJt,pZt,fZt,EZt,hZt,TZt,mZt,KJt,qPn,OPn]).nullish()}),IZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:sc}),XYd=k.object({id:nj,method:k.string(),params:k.union([IZt,aZt,vZt,ZJt,gZt,lZt,SZt,oZt,CZt,sas,qPn,oas,OPn]).nullish()}),Ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),eKd=k.union([k.object({id:nj,result:k.union([Ils,ics,fcs,Bss,Wcs,ocs,Sls,Xss,Gss,ias,qss,LPn,jPn])}),k.object({error:NPn,id:nj})]);p();function GRe(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 eJt(t,e){if(t instanceof Ode){let n=new FRe(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 FRe(e);return r.process(t),r.emit(t,e)}a(eJt,"toJSONSchema");function y0(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 y0(o.element,r);case"object":{for(let s in o.shape)if(y0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(y0(s,r))return!0;return!1}case"intersection":return y0(o.left,r)||y0(o.right,r);case"tuple":{for(let s of o.items)if(y0(s,r))return!0;return!!(o.rest&&y0(o.rest,r))}case"record":return y0(o.keyType,r)||y0(o.valueType,r);case"map":return y0(o.keyType,r)||y0(o.valueType,r);case"set":return y0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return y0(o.innerType,r);case"lazy":return y0(o.getter(),r);case"default":return y0(o.innerType,r);case"prefault":return y0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return y0(o.in,r)||y0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(y0,"isTransforming");var Jkn={};p();p();p();var Qde={};ki(Qde,{ZodISODate:()=>mrt,ZodISODateTime:()=>hrt,ZodISODuration:()=>Art,ZodISOTime:()=>grt,date:()=>rJt,datetime:()=>tJt,duration:()=>iJt,time:()=>nJt});p();var hrt=dt("ZodISODateTime",(t,e)=>{Lzt.init(t,e),Cu.init(t,e)});function tJt(t){return gKt(hrt,t)}a(tJt,"datetime");var mrt=dt("ZodISODate",(t,e)=>{Bzt.init(t,e),Cu.init(t,e)});function rJt(t){return AKt(mrt,t)}a(rJt,"date");var grt=dt("ZodISOTime",(t,e)=>{Fzt.init(t,e),Cu.init(t,e)});function nJt(t){return yKt(grt,t)}a(nJt,"time");var Art=dt("ZodISODuration",(t,e)=>{Uzt.init(t,e),Cu.init(t,e)});function iJt(t){return EKt(Art,t)}a(iJt,"duration");p();p();var Xkn=a((t,e)=>{dRe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>pRe(t,r),"value")},flatten:{value:a(r=>fRe(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"),Oos=dt("ZodError",Xkn),qde=dt("ZodError",Xkn,{Parent:Error});var oJt=Ntt(qde),sJt=Mtt(qde),aJt=Ott(qde),cJt=Ltt(qde);var ks=dt("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)=>sT(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>oJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>aJt(t,r,n),t.parseAsync=async(r,n)=>sJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>cJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(NPn(r,n)),t.superRefine=r=>t.check(MPn(r)),t.overwrite=r=>t.check(SF(r)),t.optional=()=>bu(t),t.nullable=()=>Ert(t),t.nullish=()=>bu(Ert(t)),t.nonoptional=r=>vPn(t,r),t.array=()=>Ur(t),t.or=r=>xl([t,r]),t.and=r=>GRe(t,r),t.transform=r=>_rt(t,MJt(r)),t.default=r=>yPn(t,r),t.prefault=r=>_Pn(t,r),t.catch=r=>SPn(t,r),t.pipe=r=>_rt(t,r),t.readonly=()=>xPn(t),t.describe=r=>{let n=t.clone();return l5.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return l5.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return l5.get(t);let n=t.clone();return l5.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),uJt=dt("_ZodString",(t,e)=>{BJ.init(t,e),ks.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(IRe(...n)),t.includes=(...n)=>t.check(RRe(...n)),t.startsWith=(...n)=>t.check(kRe(...n)),t.endsWith=(...n)=>t.check(PRe(...n)),t.min=(...n)=>t.check(ij(...n)),t.max=(...n)=>t.check(Fde(...n)),t.length=(...n)=>t.check(Ude(...n)),t.nonempty=(...n)=>t.check(ij(1,...n)),t.lowercase=n=>t.check(xRe(n)),t.uppercase=n=>t.check(wRe(n)),t.trim=()=>t.check(MRe()),t.normalize=(...n)=>t.check(NRe(...n)),t.toLowerCase=()=>t.check(ORe()),t.toUpperCase=()=>t.check(LRe())}),QRe=dt("ZodString",(t,e)=>{BJ.init(t,e),uJt.init(t,e),t.email=r=>t.check(Vtt(dJt,r)),t.url=r=>t.check(Jtt(fJt,r)),t.jwt=r=>t.check(frt(wJt,r)),t.emoji=r=>t.check(Ztt(hJt,r)),t.guid=r=>t.check(SRe(yrt,r)),t.uuid=r=>t.check(Wtt(IF,r)),t.uuidv4=r=>t.check(ztt(IF,r)),t.uuidv6=r=>t.check(Ytt(IF,r)),t.uuidv7=r=>t.check(Ktt(IF,r)),t.nanoid=r=>t.check(Xtt(mJt,r)),t.guid=r=>t.check(SRe(yrt,r)),t.cuid=r=>t.check(ert(gJt,r)),t.cuid2=r=>t.check(trt(AJt,r)),t.ulid=r=>t.check(rrt(yJt,r)),t.base64=r=>t.check(lrt(TJt,r)),t.base64url=r=>t.check(urt(IJt,r)),t.xid=r=>t.check(nrt(EJt,r)),t.ksuid=r=>t.check(irt(_Jt,r)),t.ipv4=r=>t.check(ort(vJt,r)),t.ipv6=r=>t.check(srt(CJt,r)),t.cidrv4=r=>t.check(art(bJt,r)),t.cidrv6=r=>t.check(crt(SJt,r)),t.e164=r=>t.check(drt(xJt,r)),t.datetime=r=>t.check(tJt(r)),t.date=r=>t.check(rJt(r)),t.time=r=>t.check(nJt(r)),t.duration=r=>t.check(iJt(r))});function Je(t){return pKt(QRe,t)}a(Je,"string");var Cu=dt("ZodStringFormat",(t,e)=>{Wl.init(t,e),uJt.init(t,e)}),dJt=dt("ZodEmail",(t,e)=>{xzt.init(t,e),Cu.init(t,e)});function Bos(t){return Vtt(dJt,t)}a(Bos,"email");var yrt=dt("ZodGUID",(t,e)=>{Tzt.init(t,e),Cu.init(t,e)});function Fos(t){return SRe(yrt,t)}a(Fos,"guid");var IF=dt("ZodUUID",(t,e)=>{Izt.init(t,e),Cu.init(t,e)});function Uos(t){return Wtt(IF,t)}a(Uos,"uuid");function Qos(t){return ztt(IF,t)}a(Qos,"uuidv4");function qos(t){return Ytt(IF,t)}a(qos,"uuidv6");function jos(t){return Ktt(IF,t)}a(jos,"uuidv7");var fJt=dt("ZodURL",(t,e)=>{wzt.init(t,e),Cu.init(t,e)});function pJt(t){return Jtt(fJt,t)}a(pJt,"url");var hJt=dt("ZodEmoji",(t,e)=>{Rzt.init(t,e),Cu.init(t,e)});function Hos(t){return Ztt(hJt,t)}a(Hos,"emoji");var mJt=dt("ZodNanoID",(t,e)=>{kzt.init(t,e),Cu.init(t,e)});function Gos(t){return Xtt(mJt,t)}a(Gos,"nanoid");var gJt=dt("ZodCUID",(t,e)=>{Pzt.init(t,e),Cu.init(t,e)});function $os(t){return ert(gJt,t)}a($os,"cuid");var AJt=dt("ZodCUID2",(t,e)=>{Dzt.init(t,e),Cu.init(t,e)});function Vos(t){return trt(AJt,t)}a(Vos,"cuid2");var yJt=dt("ZodULID",(t,e)=>{Nzt.init(t,e),Cu.init(t,e)});function Wos(t){return rrt(yJt,t)}a(Wos,"ulid");var EJt=dt("ZodXID",(t,e)=>{Mzt.init(t,e),Cu.init(t,e)});function zos(t){return nrt(EJt,t)}a(zos,"xid");var _Jt=dt("ZodKSUID",(t,e)=>{Ozt.init(t,e),Cu.init(t,e)});function Yos(t){return irt(_Jt,t)}a(Yos,"ksuid");var vJt=dt("ZodIPv4",(t,e)=>{Qzt.init(t,e),Cu.init(t,e)});function Kos(t){return ort(vJt,t)}a(Kos,"ipv4");var CJt=dt("ZodIPv6",(t,e)=>{qzt.init(t,e),Cu.init(t,e)});function Jos(t){return srt(CJt,t)}a(Jos,"ipv6");var bJt=dt("ZodCIDRv4",(t,e)=>{jzt.init(t,e),Cu.init(t,e)});function Zos(t){return art(bJt,t)}a(Zos,"cidrv4");var SJt=dt("ZodCIDRv6",(t,e)=>{Hzt.init(t,e),Cu.init(t,e)});function Xos(t){return crt(SJt,t)}a(Xos,"cidrv6");var TJt=dt("ZodBase64",(t,e)=>{$zt.init(t,e),Cu.init(t,e)});function ess(t){return lrt(TJt,t)}a(ess,"base64");var IJt=dt("ZodBase64URL",(t,e)=>{Vzt.init(t,e),Cu.init(t,e)});function tss(t){return urt(IJt,t)}a(tss,"base64url");var xJt=dt("ZodE164",(t,e)=>{Wzt.init(t,e),Cu.init(t,e)});function rss(t){return drt(xJt,t)}a(rss,"e164");var wJt=dt("ZodJWT",(t,e)=>{zzt.init(t,e),Cu.init(t,e)});function nss(t){return frt(wJt,t)}a(nss,"jwt");var ePn=dt("ZodCustomStringFormat",(t,e)=>{Yzt.init(t,e),Cu.init(t,e)});function iss(t,e,r={}){return ZKt(ePn,t,e,r)}a(iss,"stringFormat");var qRe=dt("ZodNumber",(t,e)=>{jtt.init(t,e),ks.init(t,e),t.gt=(n,o)=>t.check(bF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(CF(n,o)),t.lte=(n,o)=>t.check(_w(n,o)),t.max=(n,o)=>t.check(_w(n,o)),t.int=n=>t.check(lJt(n)),t.safe=n=>t.check(lJt(n)),t.positive=n=>t.check(bF(0,n)),t.nonnegative=n=>t.check(tb(0,n)),t.negative=n=>t.check(CF(0,n)),t.nonpositive=n=>t.check(_w(0,n)),t.multipleOf=(n,o)=>t.check(UJ(n,o)),t.step=(n,o)=>t.check(UJ(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 Pa(t){return _Kt(qRe,t)}a(Pa,"number");var jde=dt("ZodNumberFormat",(t,e)=>{Kzt.init(t,e),qRe.init(t,e)});function lJt(t){return CKt(jde,t)}a(lJt,"int");function oss(t){return bKt(jde,t)}a(oss,"float32");function sss(t){return SKt(jde,t)}a(sss,"float64");function ass(t){return TKt(jde,t)}a(ass,"int32");function css(t){return IKt(jde,t)}a(css,"uint32");var jRe=dt("ZodBoolean",(t,e)=>{yRe.init(t,e),ks.init(t,e)});function ol(t){return xKt(jRe,t)}a(ol,"boolean");var HRe=dt("ZodBigInt",(t,e)=>{Htt.init(t,e),ks.init(t,e),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.gt=(n,o)=>t.check(bF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(CF(n,o)),t.lte=(n,o)=>t.check(_w(n,o)),t.max=(n,o)=>t.check(_w(n,o)),t.positive=n=>t.check(bF(BigInt(0),n)),t.negative=n=>t.check(CF(BigInt(0),n)),t.nonpositive=n=>t.check(_w(BigInt(0),n)),t.nonnegative=n=>t.check(tb(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(UJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function lss(t){return RKt(HRe,t)}a(lss,"bigint");var RJt=dt("ZodBigIntFormat",(t,e)=>{Jzt.init(t,e),HRe.init(t,e)});function uss(t){return PKt(RJt,t)}a(uss,"int64");function dss(t){return DKt(RJt,t)}a(dss,"uint64");var tPn=dt("ZodSymbol",(t,e)=>{Zzt.init(t,e),ks.init(t,e)});function fss(t){return NKt(tPn,t)}a(fss,"symbol");var rPn=dt("ZodUndefined",(t,e)=>{Xzt.init(t,e),ks.init(t,e)});function pss(t){return MKt(rPn,t)}a(pss,"_undefined");var nPn=dt("ZodNull",(t,e)=>{eYt.init(t,e),ks.init(t,e)});function vrt(t){return OKt(nPn,t)}a(vrt,"_null");var iPn=dt("ZodAny",(t,e)=>{tYt.init(t,e),ks.init(t,e)});function kJt(){return LKt(iPn)}a(kJt,"any");var oPn=dt("ZodUnknown",(t,e)=>{Mde.init(t,e),ks.init(t,e)});function sd(){return Lde(oPn)}a(sd,"unknown");var sPn=dt("ZodNever",(t,e)=>{rYt.init(t,e),ks.init(t,e)});function Crt(t){return BKt(sPn,t)}a(Crt,"never");var aPn=dt("ZodVoid",(t,e)=>{nYt.init(t,e),ks.init(t,e)});function hss(t){return FKt(aPn,t)}a(hss,"_void");var brt=dt("ZodDate",(t,e)=>{iYt.init(t,e),ks.init(t,e),t.min=(n,o)=>t.check(tb(n,o)),t.max=(n,o)=>t.check(_w(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 mss(t){return UKt(brt,t)}a(mss,"date");var cPn=dt("ZodArray",(t,e)=>{ERe.init(t,e),ks.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(ij(r,n)),t.nonempty=r=>t.check(ij(1,r)),t.max=(r,n)=>t.check(Fde(r,n)),t.length=(r,n)=>t.check(Ude(r,n)),t.unwrap=()=>t.element});function Ur(t,e){return BRe(cPn,t,e)}a(Ur,"array");function gss(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(gss,"keyof");var Srt=dt("ZodObject",(t,e)=>{oYt.init(t,e),ks.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>iv(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:sd()}),t.loose=()=>t.clone({...t._zod.def,catchall:sd()}),t.strict=()=>t.clone({...t._zod.def,catchall:Crt()}),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(OJt,t,r[0]),t.required=(...r)=>qr.required(LJt,t,r[0])});function zr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new Srt(r)}a(zr,"object");function Ass(t,e){return new Srt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Crt(),...qr.normalizeParams(e)})}a(Ass,"strictObject");function am(t,e){return new Srt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:sd(),...qr.normalizeParams(e)})}a(am,"looseObject");var PJt=dt("ZodUnion",(t,e)=>{Gtt.init(t,e),ks.init(t,e),t.options=e.options});function xl(t,e){return new PJt({type:"union",options:t,...qr.normalizeParams(e)})}a(xl,"union");var lPn=dt("ZodDiscriminatedUnion",(t,e)=>{PJt.init(t,e),sYt.init(t,e)});function Trt(t,e,r){return new lPn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(Trt,"discriminatedUnion");var uPn=dt("ZodIntersection",(t,e)=>{aYt.init(t,e),ks.init(t,e)});function GRe(t,e){return new uPn({type:"intersection",left:t,right:e})}a(GRe,"intersection");var dPn=dt("ZodTuple",(t,e)=>{FJ.init(t,e),ks.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function yss(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new dPn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(yss,"tuple");var DJt=dt("ZodRecord",(t,e)=>{cYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function wl(t,e,r){return new DJt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(wl,"record");function Ess(t,e,r){return new DJt({type:"record",keyType:xl([t,Crt()]),valueType:e,...qr.normalizeParams(r)})}a(Ess,"partialRecord");var fPn=dt("ZodMap",(t,e)=>{lYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function _ss(t,e,r){return new fPn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(_ss,"map");var pPn=dt("ZodSet",(t,e)=>{uYt.init(t,e),ks.init(t,e),t.min=(...r)=>t.check(QJ(...r)),t.nonempty=r=>t.check(QJ(1,r)),t.max=(...r)=>t.check(Bde(...r)),t.size=(...r)=>t.check(TRe(...r))});function vss(t,e){return new pPn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(vss,"set");var URe=dt("ZodEnum",(t,e)=>{dYt.init(t,e),ks.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 URe({...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 URe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function iv(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new URe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(iv,"_enum");function Css(t,e){return new URe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(Css,"nativeEnum");var hPn=dt("ZodLiteral",(t,e)=>{fYt.init(t,e),ks.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 hPn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var mPn=dt("ZodFile",(t,e)=>{pYt.init(t,e),ks.init(t,e),t.min=(r,n)=>t.check(QJ(r,n)),t.max=(r,n)=>t.check(Bde(r,n)),t.mime=(r,n)=>t.check(DRe(Array.isArray(r)?r:[r],n))});function bss(t){return zKt(mPn,t)}a(bss,"file");var NJt=dt("ZodTransform",(t,e)=>{_Re.init(t,e),ks.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 MJt(t){return new NJt({type:"transform",transform:t})}a(MJt,"transform");var OJt=dt("ZodOptional",(t,e)=>{hYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function bu(t){return new OJt({type:"optional",innerType:t})}a(bu,"optional");var gPn=dt("ZodNullable",(t,e)=>{mYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ert(t){return new gPn({type:"nullable",innerType:t})}a(Ert,"nullable");function Sss(t){return bu(Ert(t))}a(Sss,"nullish");var APn=dt("ZodDefault",(t,e)=>{gYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function yPn(t,e){return new APn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(yPn,"_default");var EPn=dt("ZodPrefault",(t,e)=>{AYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function _Pn(t,e){return new EPn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(_Pn,"prefault");var LJt=dt("ZodNonOptional",(t,e)=>{yYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function vPn(t,e){return new LJt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(vPn,"nonoptional");var CPn=dt("ZodSuccess",(t,e)=>{EYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Tss(t){return new CPn({type:"success",innerType:t})}a(Tss,"success");var bPn=dt("ZodCatch",(t,e)=>{_Yt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function SPn(t,e){return new bPn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(SPn,"_catch");var TPn=dt("ZodNaN",(t,e)=>{vYt.init(t,e),ks.init(t,e)});function Iss(t){return qKt(TPn,t)}a(Iss,"nan");var BJt=dt("ZodPipe",(t,e)=>{vRe.init(t,e),ks.init(t,e),t.in=e.in,t.out=e.out});function _rt(t,e){return new BJt({type:"pipe",in:t,out:e})}a(_rt,"pipe");var IPn=dt("ZodReadonly",(t,e)=>{CYt.init(t,e),ks.init(t,e)});function xPn(t){return new IPn({type:"readonly",innerType:t})}a(xPn,"readonly");var wPn=dt("ZodTemplateLiteral",(t,e)=>{bYt.init(t,e),ks.init(t,e)});function xss(t,e){return new wPn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(xss,"templateLiteral");var RPn=dt("ZodLazy",(t,e)=>{TYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.getter()});function kPn(t){return new RPn({type:"lazy",getter:t})}a(kPn,"lazy");var PPn=dt("ZodPromise",(t,e)=>{SYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function wss(t){return new PPn({type:"promise",innerType:t})}a(wss,"promise");var Irt=dt("ZodCustom",(t,e)=>{IYt.init(t,e),ks.init(t,e)});function DPn(t){let e=new xf({check:"custom"});return e._zod.check=t,e}a(DPn,"check");function FJt(t,e){return YKt(Irt,t??(()=>!0),e)}a(FJt,"custom");function NPn(t,e={}){return KKt(Irt,t,e)}a(NPn,"refine");function MPn(t){let e=DPn(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(MPn,"superRefine");function Rss(t,e={error:`Input not instance of ${t.name}`}){let r=new Irt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(Rss,"_instanceof");var kss=a((...t)=>JKt({Pipe:BJt,Boolean:jRe,String:QRe,Transform:NJt},...t),"stringbool");function Pss(t){let e=kPn(()=>xl([Je(t),Pa(),ol(),vrt(),Ur(e),wl(Je(),e)]));return e}a(Pss,"json");function xrt(t,e){return _rt(MJt(t),e)}a(xrt,"preprocess");p();var UJt={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 Dss(t){sm({customError:t})}a(Dss,"setErrorMap");function Nss(){return sm().customError}a(Nss,"getErrorMap");var $Re={};ki($Re,{bigint:()=>Bss,boolean:()=>Lss,date:()=>Fss,number:()=>Oss,string:()=>Mss});p();function Mss(t){return hKt(QRe,t)}a(Mss,"string");function Oss(t){return vKt(qRe,t)}a(Oss,"number");function Lss(t){return wKt(jRe,t)}a(Lss,"boolean");function Bss(t){return kKt(HRe,t)}a(Bss,"bigint");function Fss(t){return QKt(brt,t)}a(Fss,"date");sm(CRe());p();var ci={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"},wf={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"},wrt=1;p();var Qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),qss=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)}),jss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),Hss=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(qss)}),Gss=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()}),$ss=k.union([Hss.and(k.object({type:k.literal("env_var")})),Gss.and(k.object({type:k.literal("terminal")})),jss]),qJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Vss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Wss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),zss=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Yss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Kss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Jss=k.object({amount:k.number(),currency:k.string()}),Zss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),jJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),tas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nas=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),ias=k.object({content:k.record(k.string(),nas).nullish()}),oas=k.intersection(k.union([ias.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()})),sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),OPn=k.string(),HJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:OPn}),aas=k.literal("object"),cas=k.literal("string"),las=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:sas.nullish(),url:las.nullish()}),LPn=k.object({const:k.string(),title:k.string()}),BPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),das=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"})]),FPn=k.object({code:das,data:k.unknown().optional(),message:k.string()}),UPn=k.unknown(),QPn=k.unknown(),qPn=k.unknown(),fas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),jPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),HPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),pas=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),has=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),GJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),$Jt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),VJt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:mas.nullish()}),WJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),yas=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)}),Rrt=k.string(),Eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Rrt}),_as=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Rrt}),GPn=k.string(),vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:GPn}),Cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:GPn,name:k.string()}),bas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(jPn),name:k.string(),url:k.string()}),Sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(jPn),name:k.string(),url:k.string()}),Tas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(BPn),name:k.string()}),krt=k.union([bas.and(k.object({type:k.literal("http")})),Sas.and(k.object({type:k.literal("sse")})),Cas.and(k.object({type:k.literal("acp")})),Tas]),$Pn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Rrt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),VPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Rrt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),WPn=k.unknown(),zJt=k.string(),Ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:zJt,name:k.string()}),xas=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),was=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Das=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Nas=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()}),Mas=k.object({diff:k.string(),uri:k.string()}),Oas=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()}),Las=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Bas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Fas=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),Uas=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()}),Qas=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),qas=k.object({excerpts:k.array(Oas),uri:k.string()}),jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Has=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Gas=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),$as=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:Las.nullish(),rename:Has.nullish(),searchAndReplace:$as.nullish()}),Was=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),zas=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Yas=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()}),Kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:was.nullish(),editHistory:Nas.nullish(),openFiles:Bas.nullish(),recentFiles:Uas.nullish(),relatedSnippets:jas.nullish(),userActions:Yas.nullish()}),YJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(krt)}),Jas=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),zPn=k.string(),Zas=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Xas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:Zas,name:k.string(),optionId:zPn}),ecs=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),tcs=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:ecs,status:tcs}),ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(rcs)}),oj=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"})}),ics=k.object({id:k.string(),position:oj,uri:k.string()}),ocs=k.object({id:k.string(),newName:k.string(),position:oj,uri:k.string()}),scs=k.object({action:k.string(),position:oj,timestampMs:k.number(),uri:k.string()}),YPn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),acs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Qss.optional().default({terminal:!1}),elicitation:uas.nullish(),fs:fas.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Vas.nullish(),positionEncodings:k.array(YPn).optional(),terminal:k.boolean().optional().default(!1)}),ccs=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)}),KPn=k.number().int().gte(0).lte(65535),KJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:acs.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:HPn.nullish(),protocolVersion:KPn}),lcs=k.object({apiType:VJt,baseUrl:k.string()}),ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:lcs.nullish(),id:k.string(),required:k.boolean(),supported:k.array(VJt)}),dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(ucs)}),fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Hde=k.object({end:oj,start:oj}),pcs=k.object({message:k.string(),range:Hde,severity:xas,uri:k.string()}),hcs=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:Hde.nullish()}),mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(pcs).nullish(),editHistory:k.array(Mas).nullish(),openFiles:k.array(hcs).nullish(),recentFiles:k.array(Fas).nullish(),relatedSnippets:k.array(qas).nullish(),userActions:k.array(scs).nullish()}),gcs=k.object({newText:k.string(),range:Hde}),Acs=k.object({cursorPosition:oj.nullish(),edits:k.array(gcs),id:k.string(),uri:k.string()}),ycs=k.union([Acs.and(k.object({kind:k.literal("edit")})),ics.and(k.object({kind:k.literal("jump")})),ocs.and(k.object({kind:k.literal("rename")})),Was.and(k.object({kind:k.literal("searchAndReplace")}))]),Ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),_cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sj=k.union([k.number(),k.string()]).nullable(),hKd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:sj}),JPn=k.object({requestId:sj}),vcs=k.enum(["assistant","user"]),VRe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(vcs).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),Ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:VRe.nullish(),data:k.string(),mimeType:k.string()}),bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:VRe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),Scs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:VRe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),Tcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:zPn}),Ics=k.union([k.object({outcome:k.literal("cancelled")}),Tcs.and(k.object({outcome:k.literal("selected")}))]),xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:Ics}),wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kcs=k.object({currentValue:k.boolean()}),Pcs=k.string(),ZPn=k.string(),Dcs=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),JJt=k.string(),XPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:JJt}),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:Pcs,name:k.string(),options:k.array(XPn)}),Mcs=k.union([k.array(XPn),k.array(Ncs)]),Ocs=k.object({currentValue:JJt,options:Mcs}),Gde=k.intersection(k.union([Ocs.and(k.object({type:k.literal("select")})),kcs.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:Dcs.nullish(),description:k.string().nullish(),id:ZPn,name:k.string()})),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Gde)}),Bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ac=k.string(),ZJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:ac}),XJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac}),eZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac}),tZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac}),rZt=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(BPn).optional(),outputByteLimit:k.number().nullish(),sessionId:ac}),nZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac}),iZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,uri:k.string()}),oZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:oj,sessionId:ac,uri:k.string(),version:k.number(),visibleRange:Hde}),sZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:ac,text:k.string(),uri:k.string(),version:k.number()}),aZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,uri:k.string()}),cZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(krt).optional(),sessionId:ac}),lZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,terminalId:k.string()}),uZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(krt),sessionId:ac}),dZt=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:ac}),fZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:Qas.nullish(),sessionId:ac}),pZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,terminalId:k.string()}),hZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(krt).optional(),sessionId:ac}),Ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:ac,title:k.string().nullish(),updatedAt:k.string().nullish()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(Ucs)}),qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Prt=k.string(),Hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Prt}),Gcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Prt,name:k.string()}),Drt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Gcs),currentModeId:Prt}),Nrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(Ias),currentModelId:zJt}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Gde).nullish(),models:Nrt.nullish(),modes:Drt.nullish(),sessionId:ac}),Vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Gde).nullish(),models:Nrt.nullish(),modes:Drt.nullish()}),Wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Gde).nullish(),models:Nrt.nullish(),modes:Drt.nullish(),sessionId:ac}),zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Gde).nullish(),models:Nrt.nullish(),modes:Drt.nullish()}),Ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:wcs.nullish(),close:Rcs.nullish(),delete:Bcs.nullish(),fork:Fcs.nullish(),list:jcs.nullish(),resume:Ycs.nullish()}),mZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:VJt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),Jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),gZt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:JJt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:ZPn,sessionId:ac})),Zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Gde)}),AZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Prt,sessionId:ac}),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),yZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:zJt,sessionId:ac}),els=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac}),rls=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),nls=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),ils=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:nls.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(LPn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),EZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:mcs.nullish(),position:oj,selection:Hde.nullish(),sessionId:ac,triggerKind:zas,uri:k.string(),version:k.number()}),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(ycs)}),sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),als=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()}),_Zt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,terminalId:k.string()}),cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:als.nullish(),output:k.string(),truncated:k.boolean()}),lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:VRe.nullish(),text:k.string()}),uls=k.object({range:Hde.nullish(),text:k.string()}),vZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(uls),sessionId:ac,uri:k.string(),version:k.number()}),mKd=k.object({method:k.string(),params:k.union([XJt,sZt,vZt,iZt,aZt,oZt,ZJt,fZt,$Pn,UPn]).nullish()}),dls=k.union([k.literal("full"),k.literal("incremental")]),fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:dls}),pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:fls.nullish(),didClose:Ras.nullish(),didFocus:kas.nullish(),didOpen:Pas.nullish(),didSave:Das.nullish()}),hls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:pls.nullish()}),mls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Kas.nullish(),events:hls.nullish()}),gls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:gas.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:yas.optional().default({acp:!1,http:!1,sse:!1}),nes:mls.nullish(),positionEncoding:YPn.nullish(),promptCapabilities:ccs.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:fcs.nullish(),sessionCapabilities:Kcs.optional().default({})}),Als=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:gls.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:HPn.nullish(),authMethods:k.array($ss).optional().default([]),protocolVersion:KPn}),yls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),Els=k.union([yls,Wss]),_ls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:VRe.nullish(),resource:Els}),CZt=k.union([lls.and(k.object({type:k.literal("text")})),bcs.and(k.object({type:k.literal("image")})),Ccs.and(k.object({type:k.literal("audio")})),Scs.and(k.object({type:k.literal("resource_link")})),_ls.and(k.object({type:k.literal("resource")}))]),vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:CZt}),QJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:CZt,messageId:k.string().nullish()}),bZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(CZt),sessionId:ac}),Cls=k.object({anyOf:k.array(LPn)}),e2n=k.union([vls.and(k.object({type:k.literal("content")})),eas.and(k.object({type:k.literal("diff")})),sls.and(k.object({type:k.literal("terminal")}))]),SZt=k.string(),t2n=k.object({sessionId:ac,toolCallId:SZt.nullish()}),bls=k.intersection(k.union([t2n,JPn]),k.object({elicitationId:OPn,url:k.string().url()})),r2n=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()}),n2n=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),i2n=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")]),Sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(e2n).optional(),kind:i2n.optional(),locations:k.array(r2n).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:n2n.optional(),title:k.string(),toolCallId:SZt}),o2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(e2n).nullish(),kind:i2n.nullish(),locations:k.array(r2n).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:n2n.nullish(),title:k.string().nullish(),toolCallId:SZt}),TZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Xas),sessionId:ac,toolCall:o2n}),Tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),Ils=Tls,xls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:Ils.nullish(),name:k.string()}),wls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(xls)}),Rls=k.object({enum:k.array(k.string()),type:cas}),kls=k.union([Rls,Cls]),Pls=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:kls,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),Dls=k.union([ils.and(k.object({type:k.literal("string")})),Jas.and(k.object({type:k.literal("number")})),pas.and(k.object({type:k.literal("integer")})),zss.and(k.object({type:k.literal("boolean")})),Pls.and(k.object({type:k.literal("array")}))]),Nls=k.object({description:k.string().nullish(),properties:k.record(k.string(),Dls).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:aas.optional().default("object")}),Mls=k.intersection(k.union([t2n,JPn]),k.object({requestedSchema:Nls})),IZt=k.intersection(k.union([Mls.and(k.object({mode:k.literal("form")})),bls.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),Ols=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),Lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:rls,usage:Ols.nullish(),userMessageId:k.string().nullish()}),gKd=k.union([k.object({id:sj,result:k.union([Als,Vss,dcs,Jcs,tas,Aas,Wcs,Vcs,Qcs,Xss,$cs,zcs,Kss,Xcs,Zcs,Lls,els,tls,ols,Yss,qPn,WPn])}),k.object({error:FPn,id:sj})]),Bls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:Jss.nullish(),size:k.number(),used:k.number()}),Fls=k.union([QJt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),QJt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),QJt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),Sls.and(k.object({sessionUpdate:k.literal("tool_call")})),o2n.and(k.object({sessionUpdate:k.literal("tool_call_update")})),ncs.and(k.object({sessionUpdate:k.literal("plan")})),wls.and(k.object({sessionUpdate:k.literal("available_commands_update")})),Hcs.and(k.object({sessionUpdate:k.literal("current_mode_update")})),Lcs.and(k.object({sessionUpdate:k.literal("config_option_update")})),qcs.and(k.object({sessionUpdate:k.literal("session_info_update")})),Bls.and(k.object({sessionUpdate:k.literal("usage_update")}))]),xZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,update:Fls}),AKd=k.object({method:k.string(),params:k.union([xZt,HJt,$Pn,UPn]).nullish()}),wZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:ac,terminalId:k.string()}),Uls=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()}),Qls=k.object({name:k.string(),uri:k.string()}),RZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Gas.nullish(),workspaceFolders:k.array(Qls).nullish(),workspaceUri:k.string().nullish()}),yKd=k.object({id:sj,method:k.string(),params:k.union([KJt,qJt,GJt,mZt,jJt,WJt,YJt,uZt,$Jt,nZt,cZt,hZt,tZt,AZt,gZt,bZt,yZt,RZt,EZt,eZt,VPn,QPn]).nullish()}),kZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:ac}),EKd=k.object({id:sj,method:k.string(),params:k.union([kZt,dZt,TZt,rZt,_Zt,pZt,wZt,lZt,IZt,vas,VPn,_as,QPn]).nullish()}),qls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_Kd=k.union([k.object({id:sj,result:k.union([qls,Ecs,xcs,Zss,cls,_cs,Uls,has,oas,Eas,ras,qPn,WPn])}),k.object({error:FPn,id:sj})]);p();function WRe(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(GRe,"ndJsonStream");function Ew(t){return t??{}}a(Ew,"emptyObjectResponse");function t2n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(t2n,"rejectedPromise");var $Re=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ci.initialize:{let u=VJt.parse(l);return n.initialize(u)}case ci.session_new:{let u=$Jt.parse(l);return n.newSession(u)}case ci.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=sZt.parse(l);return n.loadSession(u)}case ci.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=qJt.parse(l);return n.listSessions(u)}case ci.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=XJt.parse(l);return await n.unstable_deleteSession(u)??{}}case ci.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=iZt.parse(l);return n.unstable_forkSession(u)}case ci.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=uZt.parse(l);return n.resumeSession(u)}case ci.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=JJt.parse(l);return await n.closeSession(u)??{}}case ci.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=pZt.parse(l);return await n.setSessionMode(u)??{}}case ci.authenticate:{let u=BJt.parse(l);return await n.authenticate(u)??{}}case ci.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=QJt.parse(l);return n.unstable_listProviders(u)}case ci.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=dZt.parse(l);return await n.unstable_setProvider(u)??{}}case ci.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=FJt.parse(l);return await n.unstable_disableProvider(u)??{}}case ci.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=HJt.parse(l);return await n.unstable_logout(u)??{}}case ci.session_prompt:{let u=EZt.parse(l);return n.prompt(u)}case ci.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=hZt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ci.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=fZt.parse(l);return n.setSessionConfigOption(u)}case ci.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=TZt.parse(l);return n.unstable_startNes(u)}case ci.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=mZt.parse(l);return n.unstable_suggestNes(u)}case ci.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=KJt.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 ci.session_cancel:{let u=YJt.parse(l);return n.cancel(u)}case ci.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=rZt.parse(l);return n.unstable_didOpenDocument(u)}case ci.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=AZt.parse(l);return n.unstable_didChangeDocument(u)}case ci.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=eZt.parse(l);return n.unstable_didCloseDocument(u)}case ci.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=nZt.parse(l);return n.unstable_didSaveDocument(u)}case ci.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=tZt.parse(l);return n.unstable_didFocusDocument(u)}case ci.nes_accept:{if(!n.unstable_acceptNes)return;let u=zJt.parse(l);return n.unstable_acceptNes(u)}case ci.nes_reject:{if(!n.unstable_rejectNes)return;let u=cZt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Rrt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(If.session_update,e)}requestPermission(e){return this.connection.sendRequest(If.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(If.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(If.fs_write_text_file,e,Ew)}createTerminal(e){return this.connection.sendRequest(If.terminal_create,e,r=>new xZt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(If.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(If.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}},xZt=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(If.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(If.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(If.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Ew)}release(){return this.connection.sendRequest(If.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Ew)}async[Symbol.asyncDispose](){await this.release()}},wrt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case If.fs_write_text_file:{let u=IZt.parse(l);return await n.writeTextFile?.(u)??{}}case If.fs_read_text_file:{let u=aZt.parse(l);return n.readTextFile?.(u)}case If.session_request_permission:{let u=vZt.parse(l);return n.requestPermission(u)}case If.terminal_create:{let u=ZJt.parse(l);return n.createTerminal?.(u)}case If.terminal_output:{let u=gZt.parse(l);return n.terminalOutput?.(u)}case If.terminal_release:{let u=lZt.parse(l);return await n.releaseTerminal?.(u)??{}}case If.terminal_wait_for_exit:{let u=SZt.parse(l);return n.waitForTerminalExit?.(u)}case If.terminal_kill:{let u=oZt.parse(l);return await n.killTerminal?.(u)??{}}case If.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=CZt.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 If.session_update:{let u=bZt.parse(l);return n.sessionUpdate(u)}case If.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=UJt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Rrt(o,s,r)}initialize(e){return this.connection.sendRequest(ci.initialize,e)}newSession(e){return this.connection.sendRequest(ci.session_new,e)}loadSession(e){return this.connection.sendRequest(ci.session_load,e,Ew)}unstable_forkSession(e){return this.connection.sendRequest(ci.session_fork,e)}listSessions(e){return this.connection.sendRequest(ci.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ci.session_delete,e,Ew)}resumeSession(e){return this.connection.sendRequest(ci.session_resume,e)}closeSession(e){return this.connection.sendRequest(ci.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ci.session_set_mode,e,Ew)}unstable_setSessionModel(e){return this.connection.sendRequest(ci.session_set_model,e,Ew)}setSessionConfigOption(e){return this.connection.sendRequest(ci.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ci.authenticate,e,Ew)}unstable_listProviders(e){return this.connection.sendRequest(ci.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ci.providers_set,e,Ew)}unstable_disableProvider(e){return this.connection.sendRequest(ci.providers_disable,e,Ew)}unstable_logout(e){return this.connection.sendRequest(ci.logout,e,Ew)}prompt(e){return this.connection.sendRequest(ci.session_prompt,e)}cancel(e){return this.connection.sendNotification(ci.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ci.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ci.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ci.nes_close,e,Ew)}unstable_didOpenDocument(e){return this.connection.sendNotification(ci.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ci.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ci.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ci.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ci.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ci.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ci.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}},Rrt=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 t2n(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?t2n(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 aCe=require("node:stream");p();Mo();p();var rb=class extends OY{constructor(r){super(new fle,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}${wls(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Ye[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 wls(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(wls,"camelCaseToSnakeCaseAllCaps");var Rls="unknown-editor",r2n="unknown-editor-plugin",ij=class extends Ir{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:Rls,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:r2n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==r2n}};p();p();var krt=new fe("agenticTurnProcessor"),WRe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new bq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(e.ctx),this.hookTrigger=new ede(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:ZQ.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 tl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!VAn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"customAgent.turn",h),ZI(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{krt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=n2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await ew(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 hO(this.turnContext.ctx,m,h):await xo.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),iq(this.conversation.turns));xo.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(ZC).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 _de(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 $q)krt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Oc)krt.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 uF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:ZQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof LA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw krt.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 due(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=oq(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=fXe(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=Jue(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 wZt="collect-context",RZt="generate-response",Prt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.postProcessor=new Eue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(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:ZQ.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 tl(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=n2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await ew(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(wZt,"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 xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),iq(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(wZt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(wZt),await n.steps.start(RZt,"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 due(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 Iq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(Hxe)!==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=yJe(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 hO(this.turnContext.ctx,h,f):await xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Dyn(e));xo.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=xo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(ZC).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:Pn(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,Pn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Tyn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Pn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=cxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=cxe(this.conversation,this.strategy.uiKind,Pn(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(RZt,e.error.message):await r.steps.finish(RZt)}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=fXe(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=Jue(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();Mo();p();var RYi=de(Xc()),kYi=de(PP());p();p();var Ze={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 QA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(n2n(e))}};function Oe(t,e){let r=qu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=n2n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(Oe,"addMethodHandlerValidation");function n2n(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(WRe,"ndJsonStream");function vw(t){return t??{}}a(vw,"emptyObjectResponse");function s2n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(s2n,"rejectedPromise");var zRe=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ci.initialize:{let u=KJt.parse(l);return n.initialize(u)}case ci.session_new:{let u=YJt.parse(l);return n.newSession(u)}case ci.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=uZt.parse(l);return n.loadSession(u)}case ci.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=$Jt.parse(l);return n.listSessions(u)}case ci.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=nZt.parse(l);return await n.unstable_deleteSession(u)??{}}case ci.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=cZt.parse(l);return n.unstable_forkSession(u)}case ci.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=hZt.parse(l);return n.resumeSession(u)}case ci.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=tZt.parse(l);return await n.closeSession(u)??{}}case ci.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=AZt.parse(l);return await n.setSessionMode(u)??{}}case ci.authenticate:{let u=qJt.parse(l);return await n.authenticate(u)??{}}case ci.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=GJt.parse(l);return n.unstable_listProviders(u)}case ci.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=mZt.parse(l);return await n.unstable_setProvider(u)??{}}case ci.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=jJt.parse(l);return await n.unstable_disableProvider(u)??{}}case ci.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=WJt.parse(l);return await n.unstable_logout(u)??{}}case ci.session_prompt:{let u=bZt.parse(l);return n.prompt(u)}case ci.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=yZt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ci.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=gZt.parse(l);return n.setSessionConfigOption(u)}case ci.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=RZt.parse(l);return n.unstable_startNes(u)}case ci.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=EZt.parse(l);return n.unstable_suggestNes(u)}case ci.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=eZt.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 ci.session_cancel:{let u=XJt.parse(l);return n.cancel(u)}case ci.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=sZt.parse(l);return n.unstable_didOpenDocument(u)}case ci.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=vZt.parse(l);return n.unstable_didChangeDocument(u)}case ci.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=iZt.parse(l);return n.unstable_didCloseDocument(u)}case ci.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=aZt.parse(l);return n.unstable_didSaveDocument(u)}case ci.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=oZt.parse(l);return n.unstable_didFocusDocument(u)}case ci.nes_accept:{if(!n.unstable_acceptNes)return;let u=ZJt.parse(l);return n.unstable_acceptNes(u)}case ci.nes_reject:{if(!n.unstable_rejectNes)return;let u=fZt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Ort(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(wf.session_update,e)}requestPermission(e){return this.connection.sendRequest(wf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(wf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(wf.fs_write_text_file,e,vw)}createTerminal(e){return this.connection.sendRequest(wf.terminal_create,e,r=>new PZt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(wf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(wf.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}},PZt=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(wf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(wf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(wf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},vw)}release(){return this.connection.sendRequest(wf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},vw)}async[Symbol.asyncDispose](){await this.release()}},Mrt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case wf.fs_write_text_file:{let u=kZt.parse(l);return await n.writeTextFile?.(u)??{}}case wf.fs_read_text_file:{let u=dZt.parse(l);return n.readTextFile?.(u)}case wf.session_request_permission:{let u=TZt.parse(l);return n.requestPermission(u)}case wf.terminal_create:{let u=rZt.parse(l);return n.createTerminal?.(u)}case wf.terminal_output:{let u=_Zt.parse(l);return n.terminalOutput?.(u)}case wf.terminal_release:{let u=pZt.parse(l);return await n.releaseTerminal?.(u)??{}}case wf.terminal_wait_for_exit:{let u=wZt.parse(l);return n.waitForTerminalExit?.(u)}case wf.terminal_kill:{let u=lZt.parse(l);return await n.killTerminal?.(u)??{}}case wf.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=IZt.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 wf.session_update:{let u=xZt.parse(l);return n.sessionUpdate(u)}case wf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=HJt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Ort(o,s,r)}initialize(e){return this.connection.sendRequest(ci.initialize,e)}newSession(e){return this.connection.sendRequest(ci.session_new,e)}loadSession(e){return this.connection.sendRequest(ci.session_load,e,vw)}unstable_forkSession(e){return this.connection.sendRequest(ci.session_fork,e)}listSessions(e){return this.connection.sendRequest(ci.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ci.session_delete,e,vw)}resumeSession(e){return this.connection.sendRequest(ci.session_resume,e)}closeSession(e){return this.connection.sendRequest(ci.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ci.session_set_mode,e,vw)}unstable_setSessionModel(e){return this.connection.sendRequest(ci.session_set_model,e,vw)}setSessionConfigOption(e){return this.connection.sendRequest(ci.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ci.authenticate,e,vw)}unstable_listProviders(e){return this.connection.sendRequest(ci.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ci.providers_set,e,vw)}unstable_disableProvider(e){return this.connection.sendRequest(ci.providers_disable,e,vw)}unstable_logout(e){return this.connection.sendRequest(ci.logout,e,vw)}prompt(e){return this.connection.sendRequest(ci.session_prompt,e)}cancel(e){return this.connection.sendNotification(ci.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ci.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ci.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ci.nes_close,e,vw)}unstable_didOpenDocument(e){return this.connection.sendNotification(ci.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ci.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ci.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ci.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ci.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ci.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ci.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}},Ort=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 s2n(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?s2n(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 uCe=require("node:stream");p();Oo();p();var rb=class extends UY{constructor(r){super(new ple,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}${Hls(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Ye[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 Hls(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(Hls,"camelCaseToSnakeCaseAllCaps");var Gls="unknown-editor",a2n="unknown-editor-plugin",aj=class extends Ir{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:Gls,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:a2n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==a2n}};p();p();var Lrt=new fe("agenticTurnProcessor"),KRe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new sc(e.ctx),this.turnSuggestions=new Iq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new m0(e.ctx),this.hookTrigger=new tde(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:eq.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 tl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!JAn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});At(this.turnContext.ctx,"customAgent.turn",h),tx(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{Lrt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=o2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await rw(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 gO(this.turnContext.ctx,m,h):await wo.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),aq(this.conversation.turns));wo.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(ZC).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 vde(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 zq)Lrt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Oc)Lrt.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 fF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:eq.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof BA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw Lrt.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 fue(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=cq(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=yXe(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=Zue(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 DZt="collect-context",NZt="generate-response",Brt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new sc(e.ctx),this.postProcessor=new _ue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new m0(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:eq.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 tl(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=o2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await rw(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(DZt,"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 wo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),aq(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(DZt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(DZt),await n.steps.start(NZt,"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 fue(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 Rq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(Vxe)!==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=SJe(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 gO(this.turnContext.ctx,h,f):await wo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Byn(e));wo.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=wo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(ZC).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:Pn(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,Pn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",kyn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Pn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=dxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=dxe(this.conversation,this.strategy.uiKind,Pn(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(NZt,e.error.message):await r.steps.finish(NZt)}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=yXe(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=Zue(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();Oo();p();var UYi=de(Xc()),QYi=de(NP());p();p();var Ze={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 qA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(c2n(e))}};function Ne(t,e){let r=ju.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=c2n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(Ne,"addMethodHandlerValidation");function c2n(t){return`Schema validation failed with the following errors: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(n2n,"createErrorMessage");p();p();p();p();function Drt(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.custom_model!==void 0?{custom_model:t.custom_model}:{},...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:mO(e)}:{}}}a(Drt,"toAgentModelInfo");p();var i2n=new fe("BackgroundAgent.AuthBinding"),Nrt=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}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){i2n.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(Ur).resolveSession())?.accessToken}catch(o){return i2n.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 kls=new fe("BackgroundAgent.Attachments");function o2n(t,e){let r=[];for(let n of t){let o=Pls(n);o?r.push(o):kls.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(o2n,"convertReferencesToAttachments");function Pls(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(Pls,"convertReferenceToAttachment");p();var UJ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function kZt(t,e=100){if(!(t instanceof Error))return;let r=[],n=new Set,o=t.cause,s=0;for(;o instanceof Error&&!n.has(o)&&s0?r.join(": "):void 0}a(kZt,"describeCauseChain");function Mrt(t){let e=t instanceof Error?t.message:String(t),r=kZt(t);return r?`${e} (cause: ${r})`:e}a(Mrt,"formatErrorWithCause");var zRe=class extends UJ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},YRe=class extends UJ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();function s2n(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(s2n,"routeInteraction");p();var a2n=new fe("BackgroundAgent.OTelEnv"),PZt=new Map,DZt=new Set;function Ort(t,e){process.env[t]||(PZt.has(t)||PZt.set(t,process.env[t]),process.env[t]=e,DZt.add(t))}a(Ort,"setEnvIfAbsent");function c2n(){for(let t of DZt){let e=PZt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}DZt.clear()}a(c2n,"restoreOTelEnvironment");function l2n(t){if(!t.get(bn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&a2n.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),Ort("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&&(Ort("COPILOT_OTEL_EXPORTER_TYPE","file"),Ort("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),Ort("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),a2n.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(l2n,"applyOTelEnvironment");p();p();var i8n=de(require("crypto")),o8n=de(require("fs")),dot=de(r8n()),s8n=require("tls"),a8n=de(n8n());var epe=new fe("certificates"),pp=class{static{a(this,"RootCertificateReader")}};function fot(t,e=process.platform){return new onr(t,[new snr,new anr,kSs(t,e)])}a(fot,"getRootCertificateReader");function kSs(t,e){switch(e){case"linux":return new cnr(t);case"darwin":return new lnr(t);case"win32":return new unr(t);default:return new dnr}}a(kSs,"createPlatformReader");var inr=class extends pp{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 epe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},onr=class extends pp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new inr(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 i8n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return epe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&epe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},snr=class extends pp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return s8n.rootCertificates}},anr=class extends pp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await c8n(e):[]}},cnr=class extends pp{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 c8n(n);epe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},lnr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=dot.get({excludeBundled:!1,format:dot.Format.pem});return epe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},unr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=a8n.all();return epe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},dnr=class extends pp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function c8n(t){let e;try{e=await o8n.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(c8n,"readCertsFromFile");var oH=de($ar());var War=new fe("BackgroundAgent.ProxyEnv"),zar=new Map,Yar=new Set,A2e;function Kar(){for(let t of Yar){let e=zar.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Yar.clear(),A2e&&((0,oH.setGlobalDispatcher)(A2e),A2e=void 0)}a(Kar,"restoreProxyEnvironment");function Var(t,e,r){process.env[t]||process.env[e]||(zar.has(t)||zar.set(t,process.env[t]),process.env[t]=r,Yar.add(t))}a(Var,"setEnvIfAbsent");function QBs(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(QBs,"buildProxyUrl");async function qBs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(pp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{War.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(qBs,"buildTlsOptions");async function uat(t){try{Kar();let e=t.get(Lo).getHttpSettings();if(!e.proxy)return;let r=QBs(e.proxy,e.proxyAuthorization);Var("HTTPS_PROXY","https_proxy",r),Var("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Var("NO_PROXY","no_proxy",n),A2e||(A2e=(0,oH.getGlobalDispatcher)());let o=await qBs(t,e.proxyStrictSSL);(0,oH.setGlobalDispatcher)(new oH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),War.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,oH.getGlobalDispatcher)().constructor.name})}catch(e){War.warn(t,"Failed to apply proxy settings to environment:",e)}}a(uat,"applyProxyToEnvironment");p();var jBs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],dat=["get_errors"],Jar=[...dat,"edit","str_replace_editor","apply_patch"],HBs=["ask","inline-ask","inline"];function fat(t){return t!==void 0&&HBs.includes(t)}a(fat,"isClampedChatMode");var GBs={ask:jBs,inline:Jar,"inline-ask":dat};async function MGn(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=[...GBs[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(MGn,"applyChatMode");p();var wT=de(require("node:path"));var BGn="copilot-language-server:inline-chat",$Bs=["file","path","filePath","file_path"],VBs=new Set(["edit","create","str_replace_editor","write"]),WBs=new Set(["git_apply_patch"]),OGn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function zBs(t){let e=wT.dirname(t);return{confinedFsPath:t,confinedName:wT.basename(t),baseDir:e,confinedComparable:Zar(t,e)}}a(zBs,"buildContext");function YBs(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(YBs,"parseToolArgs");function KBs(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(KBs,"extractApplyPatchBody");function JBs(t){if(!t.includes("*** Begin Patch"))return;let e=[];OGn.lastIndex=0;for(let r of t.matchAll(OGn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(JBs,"extractApplyPatchPaths");function ZBs(t){for(let e of $Bs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(ZBs,"extractTargetPath");function Zar(t,e){let r=t.startsWith("file:")?un(t):t,n=wT.isAbsolute(r)?wT.normalize(r):wT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Zar,"toComparablePath");function LGn(t,e){return wT.isAbsolute(t)?wT.normalize(t):wT.resolve(e,t)}a(LGn,"resolveTargetPath");function XBs(t,e,r){if(WBs.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=KBs(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=JBs(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(Zar(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${LGn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!VBs.has(t))return{allowed:!0};let n=ZBs(YBs(e));return n?Zar(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${LGn(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(XBs,"evaluateWithContext");function FGn(t){let e=0;return{hook:{source:BGn,handler: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(),"handler")},onTurnStart(){e++},reset(){e=0}}}a(FGn,"createInlineTurnLimitHook");function UGn(t){let e=t.startsWith("file:")?un(t):t,r=zBs(e);return{source:BGn,handler:a(n=>{let o=XBs(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."})},"handler")}}a(UGn,"createInlineEditConfinementHook");p();var Xar=de(require("fs"));var jpe=new fe("BackgroundAgent.InlineFileContext"),e3s=50*1024,pat=100,t3s=.4,QGn=25;async function qGn(t,e,r){let n;try{n=to(t).fsPath}catch{return jpe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Xar.promises.stat(n)}catch{return jpe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>e3s,c;try{c=await Xar.promises.readFile(n,"utf-8")}catch{return jpe.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=` +`)}`}a(c2n,"createErrorMessage");p();p();p();p();function Frt(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.custom_model!==void 0?{custom_model:t.custom_model}:{},...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:AO(e)}:{}}}a(Frt,"toAgentModelInfo");p();var l2n=new fe("BackgroundAgent.AuthBinding"),Urt=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Lr).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){l2n.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(Lr).resolveSession())?.accessToken}catch(o){return l2n.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 $ls=new fe("BackgroundAgent.Attachments");function u2n(t,e){let r=[];for(let n of t){let o=Vls(n);o?r.push(o):$ls.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(u2n,"convertReferencesToAttachments");function Vls(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(Vls,"convertReferenceToAttachment");p();var qJ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function MZt(t,e=100){if(!(t instanceof Error))return;let r=[],n=new Set,o=t.cause,s=0;for(;o instanceof Error&&!n.has(o)&&s0?r.join(": "):void 0}a(MZt,"describeCauseChain");function Qrt(t){let e=t instanceof Error?t.message:String(t),r=MZt(t);return r?`${e} (cause: ${r})`:e}a(Qrt,"formatErrorWithCause");var JRe=class extends qJ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},ZRe=class extends qJ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();function d2n(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(d2n,"routeInteraction");p();var f2n=new fe("BackgroundAgent.OTelEnv"),OZt=new Map,LZt=new Set;function qrt(t,e){process.env[t]||(OZt.has(t)||OZt.set(t,process.env[t]),process.env[t]=e,LZt.add(t))}a(qrt,"setEnvIfAbsent");function p2n(){for(let t of LZt){let e=OZt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}LZt.clear()}a(p2n,"restoreOTelEnvironment");function h2n(t){if(!t.get(bn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&f2n.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),qrt("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&&(qrt("COPILOT_OTEL_EXPORTER_TYPE","file"),qrt("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),qrt("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),f2n.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(h2n,"applyOTelEnvironment");p();p();var l8n=de(require("crypto")),u8n=de(require("fs")),Aot=de(a8n()),d8n=require("tls"),f8n=de(c8n());var tpe=new fe("certificates"),mp=class{static{a(this,"RootCertificateReader")}};function yot(t,e=process.platform){return new lnr(t,[new unr,new dnr,$Ss(t,e)])}a(yot,"getRootCertificateReader");function $Ss(t,e){switch(e){case"linux":return new fnr(t);case"darwin":return new pnr(t);case"win32":return new hnr(t);default:return new mnr}}a($Ss,"createPlatformReader");var cnr=class extends mp{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 tpe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},lnr=class extends mp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new cnr(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 l8n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return tpe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&tpe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},unr=class extends mp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return d8n.rootCertificates}},dnr=class extends mp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await p8n(e):[]}},fnr=class extends mp{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 p8n(n);tpe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},pnr=class extends mp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=Aot.get({excludeBundled:!1,format:Aot.Format.pem});return tpe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},hnr=class extends mp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=f8n.all();return tpe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},mnr=class extends mp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function p8n(t){let e;try{e=await u8n.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(p8n,"readCertsFromFile");var cH=de(Yar());var Jar=new fe("BackgroundAgent.ProxyEnv"),Zar=new Map,Xar=new Set,_2e;function ecr(){for(let t of Xar){let e=Zar.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Xar.clear(),_2e&&((0,cH.setGlobalDispatcher)(_2e),_2e=void 0)}a(ecr,"restoreProxyEnvironment");function Kar(t,e,r){process.env[t]||process.env[e]||(Zar.has(t)||Zar.set(t,process.env[t]),process.env[t]=r,Xar.add(t))}a(Kar,"setEnvIfAbsent");function t3s(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(t3s,"buildProxyUrl");async function r3s(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(mp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{Jar.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(r3s,"buildTlsOptions");async function gat(t){try{ecr();let e=t.get(Bo).getHttpSettings();if(!e.proxy)return;let r=t3s(e.proxy,e.proxyAuthorization);Kar("HTTPS_PROXY","https_proxy",r),Kar("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Kar("NO_PROXY","no_proxy",n),_2e||(_2e=(0,cH.getGlobalDispatcher)());let o=await r3s(t,e.proxyStrictSSL);(0,cH.setGlobalDispatcher)(new cH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),Jar.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,cH.getGlobalDispatcher)().constructor.name})}catch(e){Jar.warn(t,"Failed to apply proxy settings to environment:",e)}}a(gat,"applyProxyToEnvironment");p();var n3s=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],Aat=["get_errors"],tcr=[...Aat,"edit","str_replace_editor","apply_patch"],i3s=["ask","inline-ask","inline"];function yat(t){return t!==void 0&&i3s.includes(t)}a(yat,"isClampedChatMode");var o3s={ask:n3s,inline:tcr,"inline-ask":Aat};async function UGn(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=[...o3s[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(UGn,"applyChatMode");p();var kT=de(require("node:path"));var jGn="copilot-language-server:inline-chat",s3s=["file","path","filePath","file_path"],a3s=new Set(["edit","create","str_replace_editor","write"]),c3s=new Set(["git_apply_patch"]),QGn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function l3s(t){let e=kT.dirname(t);return{confinedFsPath:t,confinedName:kT.basename(t),baseDir:e,confinedComparable:rcr(t,e)}}a(l3s,"buildContext");function u3s(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(u3s,"parseToolArgs");function d3s(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(d3s,"extractApplyPatchBody");function f3s(t){if(!t.includes("*** Begin Patch"))return;let e=[];QGn.lastIndex=0;for(let r of t.matchAll(QGn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(f3s,"extractApplyPatchPaths");function p3s(t){for(let e of s3s){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(p3s,"extractTargetPath");function rcr(t,e){let r=t.startsWith("file:")?un(t):t,n=kT.isAbsolute(r)?kT.normalize(r):kT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(rcr,"toComparablePath");function qGn(t,e){return kT.isAbsolute(t)?kT.normalize(t):kT.resolve(e,t)}a(qGn,"resolveTargetPath");function h3s(t,e,r){if(c3s.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=d3s(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=f3s(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(rcr(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${qGn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!a3s.has(t))return{allowed:!0};let n=p3s(u3s(e));return n?rcr(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${qGn(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(h3s,"evaluateWithContext");function HGn(t){let e=0;return{hook:{source:jGn,handler: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(),"handler")},onTurnStart(){e++},reset(){e=0}}}a(HGn,"createInlineTurnLimitHook");function GGn(t){let e=t.startsWith("file:")?un(t):t,r=l3s(e);return{source:jGn,handler:a(n=>{let o=h3s(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."})},"handler")}}a(GGn,"createInlineEditConfinementHook");p();var ncr=de(require("fs"));var Hpe=new fe("BackgroundAgent.InlineFileContext"),m3s=50*1024,Eat=100,g3s=.4,$Gn=25;async function VGn(t,e,r){let n;try{n=to(t).fsPath}catch{return Hpe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await ncr.promises.stat(n)}catch{return Hpe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>m3s,c;try{c=await ncr.promises.readFile(n,"utf-8")}catch{return Hpe.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=n3s(c,n,l),jpe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=i3s(c,n,u),jpe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return jpe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=r3s(c,n,l);else if(u){let h=Math.min(u.line,c.split(` +\`\`\``,f=!0;else if(l)d=y3s(c,n,l),Hpe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=E3s(c,n,u),Hpe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return Hpe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=A3s(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(qGn,"buildInlineFileContext");function r3s(t,e,r){let n=t.split(` +The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(VGn,"buildInlineFileContext");function A3s(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(r3s,"buildSelectionFragment");function n3s(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-QGn),u=Math.min(o-1,c+QGn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` +\`\`\``}a(A3s,"buildSelectionFragment");function y3s(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-$Gn),u=Math.min(o-1,c+$Gn),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(n3s,"buildCropAroundSelectionFragment");function i3s(t,e,r){let n=t.split(` -`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(pat*t3s),l=pat-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,pat):d>=o&&(u=Math.max(0,o-pat));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` +\`\`\``}a(y3s,"buildCropAroundSelectionFragment");function E3s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(Eat*g3s),l=Eat-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,Eat):d>=o&&(u=Math.max(0,o-Eat));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` `);return` Here is a portion of \`${e}\` (1-based lines ${u+1}-${d} of ${o}, cursor at line ${s+1}): \`\`\` ${h} -\`\`\``}a(i3s,"buildCursorCropFragment");p();p();var jGn=require("node:crypto"),hat=de(require("node:fs")),Hw=de(require("node:fs/promises")),HGn=require("node:os"),H5=de(require("node:path"));var nX=new fe("BackgroundAgent.SandboxBinaryResolver");async function GGn(t){if(!process.env.MXC_BIN_DIR)try{let e=H5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!hat.existsSync(e)){nX.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,nX.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await s3s(t,e);r&&(process.env.MXC_BIN_DIR=r,nX.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){nX.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(GGn,"ensureSandboxBinDirEnv");function o3s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(o3s,"sandboxMainBinaryName");async function s3s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){nX.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=H5.join(e,r),o=o3s(),s=H5.join(n,o);if(!hat.existsSync(s)){nX.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,jGn.createHash)("sha256").update(await Hw.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||H5.join((0,HGn.homedir)(),".cache"),u=H5.join(l,"pkg",`mxc-bin-${c}`),d=H5.join(u,r),f=H5.join(d,".extraction-complete");if(hat.existsSync(f))return u;await Hw.mkdir(d,{recursive:!0});let h=await Hw.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=H5.join(d,m.name);await Hw.copyFile(H5.join(n,m.name),g),process.platform!=="win32"&&await Hw.chmod(g,493).catch(A=>nX.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await Hw.writeFile(f,""),u}a(s3s,"extractSandboxBinDirFromPkg");p();function $Gn(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($Gn,"setPermissionsRequired");function VGn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(VGn,"setRemoteDelegate");function ecr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(ecr,"emitSessionEvent");function tcr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(tcr,"getRemoteHandle");function WGn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(WGn,"createAutoModeSessionManager");function zGn(t){if(t)try{t.clear()}catch{}}a(zGn,"clearAutoModeManager");p();p();p();var mat=require("fs"),gat=de(require("path"));var rcr=new fe("OtelSpanFilePersistence"),a3s="debug.jsonl",pv=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ft(this.ctx,Ye.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=c3s(n);if(!o){rcr.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 mat.promises.mkdir(gat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +\`\`\``}a(E3s,"buildCursorCropFragment");p();p();var WGn=require("node:crypto"),_at=de(require("node:fs")),$w=de(require("node:fs/promises")),zGn=require("node:os"),$5=de(require("node:path"));var oX=new fe("BackgroundAgent.SandboxBinaryResolver");async function YGn(t){if(!process.env.MXC_BIN_DIR)try{let e=$5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!_at.existsSync(e)){oX.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,oX.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await v3s(t,e);r&&(process.env.MXC_BIN_DIR=r,oX.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){oX.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(YGn,"ensureSandboxBinDirEnv");function _3s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(_3s,"sandboxMainBinaryName");async function v3s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){oX.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=$5.join(e,r),o=_3s(),s=$5.join(n,o);if(!_at.existsSync(s)){oX.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,WGn.createHash)("sha256").update(await $w.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||$5.join((0,zGn.homedir)(),".cache"),u=$5.join(l,"pkg",`mxc-bin-${c}`),d=$5.join(u,r),f=$5.join(d,".extraction-complete");if(_at.existsSync(f))return u;await $w.mkdir(d,{recursive:!0});let h=await $w.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=$5.join(d,m.name);await $w.copyFile($5.join(n,m.name),g),process.platform!=="win32"&&await $w.chmod(g,493).catch(A=>oX.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await $w.writeFile(f,""),u}a(v3s,"extractSandboxBinDirFromPkg");p();function KGn(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(KGn,"setPermissionsRequired");function JGn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(JGn,"setRemoteDelegate");function icr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(icr,"emitSessionEvent");function ocr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(ocr,"getRemoteHandle");function ZGn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(ZGn,"createAutoModeSessionManager");function XGn(t){if(t)try{t.clear()}catch{}}a(XGn,"clearAutoModeManager");p();p();p();var vat=require("fs"),Cat=de(require("path"));var scr=new fe("OtelSpanFilePersistence"),C3s="debug.jsonl",mv=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ft(this.ctx,Ye.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=b3s(n);if(!o){scr.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 vat.promises.mkdir(Cat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` `)+` -`;await mat.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){rcr.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 mat.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"?[]:(rcr.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 gat.join(r,l3s(e),a3s)}};function c3s(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(c3s,"conversationIdOf");function l3s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(l3s,"sanitizeForPath");p();var u3s={0:1,1:2,2:3,3:4,4:5};function ncr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(ncr,"hrTimeToNano");function YGn(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=>YGn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(YGn,"encodeAnyValue");function k2(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=YGn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(k2,"encodeAttributes");function KGn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:u3s[t.kind]??1,startTimeUnixNano:ncr(t.startTime),endTimeUnixNano:ncr(t.endTime),attributes:k2(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:ncr(n.time),attributes:k2(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(KGn,"encodeSpan");function d3s(t,e){return{resourceSpans:[{resource:{attributes:Object.entries(e).map(([r,n])=>({key:r,value:{stringValue:n}}))},scopeSpans:[{scope:{name:"copilot-chat"},spans:t}]}]}}a(d3s,"wrapInResourceSpans");function JGn(t,e){let r=d3s(t,{"service.name":"copilot-chat","session.id":e.conversationId});return r.copilotChat={exportedAt:new Date().toISOString(),exporterVersion:"",sessionId:e.conversationId,...e.sessionTitle?{sessionTitle:e.sessionTitle}:{}},r}a(JGn,"buildChatDebugLogExport");var x2e=new fe("OtelBridge"),nFs=1e3,w2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(pv)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),ba(V5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return x2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),x2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return x2e.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()},nFs)))}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(KGn)}catch(n){x2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){x2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var oVn=require("node:module");var iVn=new fe("BackgroundAgent.ManagerLifecycle");async function iFs(){return"pkg"in process?(0,oVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(iFs,"importSdk");var kat=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(bn).getCapabilities().agentDebugLog)return;let e=w2e.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){zGn(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(){iVn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),l2n(this.ctx);let e=performance.now();try{this.sdk=await iFs(),At(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw Vn(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await GGn(this.ctx),await uat(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService};typeof this.sdk.createLocalFeatureFlagServiceCreator=="function"&&(r.createFeatureFlagService=this.sdk.createLocalFeatureFlagServiceCreator()),typeof this.sdk.createLocalFeatureFlagService=="function"&&(r.featureFlagService=this.sdk.createLocalFeatureFlagService());let n=WGn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),iVn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();p();function W5(t){try{return Ft(t,Ye.EnablePlugins)===!0}catch{return!1}}a(W5,"pluginsEnabled");var PT=class{static{a(this,"McpGatewayHost")}constructor(e,r,n){this._ctx=e,this._service=r,this._manager=n}get service(){return this._service}buildMcpServers(e){let r=this._manager.listReadyEntries(),n=W5(this._ctx),o=new Map,s=new Map,c=new Map;for(let u of r){if(u.url===null)continue;let d=u.key.source;d.kind==="user"?o.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="project"&&e!==void 0&&d.workspaceFolder===e?s.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="plugin"&&n&&c.set(u.key.name,{type:"http",url:u.url,tools:["*"]})}let l={};for(let[u,d]of c)l[u]=d;for(let[u,d]of o)l[u]=d;for(let[u,d]of s)l[u]=d;return l}async dispose(){}};p();p();var zl={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();p();var Icr;Icr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function oFs(t){return(await Icr).getRandomValues(new Uint8Array(t))}a(oFs,"getRandomValues");async function sFs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await oFs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await aFs(t),r=await cFs(e);return{code_verifier:e,code_challenge:r}}a(xcr,"pkceChallenge");p();var Gw="2025-11-25";var Dat=[Gw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],cH="io.modelcontextprotocol/related-task",Nat="2.0",y0=MJt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),sVn=Il([Je(),ka().int()]),aVn=Je(),L0f=om({ttl:ka().optional(),pollInterval:ka().optional()}),uFs=zr({ttl:ka().optional()}),dFs=zr({taskId:Je()}),Rcr=om({progressToken:sVn.optional(),[cH]:dFs.optional()}),DT=zr({_meta:Rcr.optional()}),R2e=DT.extend({task:uFs.optional()}),cVn=a(t=>R2e.safeParse(t).success,"isTaskAugmentedRequestParams"),WA=zr({method:Je(),params:DT.loose().optional()}),$w=zr({_meta:Rcr.optional()}),Vw=zr({method:Je(),params:$w.loose().optional()}),zA=om({_meta:Rcr.optional()}),Mat=Il([Je(),ka().int()]),lVn=zr({jsonrpc:Gn(Nat),id:Mat,...WA.shape}).strict(),k2e=a(t=>lVn.safeParse(t).success,"isJSONRPCRequest"),uVn=zr({jsonrpc:Gn(Nat),...Vw.shape}).strict(),dVn=a(t=>uVn.safeParse(t).success,"isJSONRPCNotification"),kcr=zr({jsonrpc:Gn(Nat),id:Mat,result:zA}).strict(),lX=a(t=>kcr.safeParse(t).success,"isJSONRPCResultResponse");var ei;(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"})(ei||(ei={}));var Pcr=zr({jsonrpc:Gn(Nat),id:Mat.optional(),error:zr({code:ka().int(),message:Je(),data:od().optional()})}).strict();var fVn=a(t=>Pcr.safeParse(t).success,"isJSONRPCErrorResponse");var lH=Il([lVn,uVn,kcr,Pcr]),B0f=Il([kcr,Pcr]),uX=zA.strict(),fFs=$w.extend({requestId:Mat.optional(),reason:Je().optional()}),Oat=Vw.extend({method:Gn("notifications/cancelled"),params:fFs}),pFs=zr({src:Je(),mimeType:Je().optional(),sizes:Fr(Je()).optional(),theme:rv(["light","dark"]).optional()}),P2e=zr({icons:Fr(pFs).optional()}),Wpe=zr({name:Je(),title:Je().optional()}),pVn=Wpe.extend({...Wpe.shape,...P2e.shape,version:Je(),websiteUrl:Je().optional(),description:Je().optional()}),hFs=qRe(zr({applyDefaults:ol().optional()}),xl(Je(),od())),mFs=vrt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,qRe(zr({form:hFs.optional(),url:y0.optional()}),xl(Je(),od()).optional())),gFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({sampling:om({createMessage:y0.optional()}).optional(),elicitation:om({create:y0.optional()}).optional()}).optional()}),AFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({tools:om({call:y0.optional()}).optional()}).optional()}),yFs=zr({experimental:xl(Je(),y0).optional(),sampling:zr({context:y0.optional(),tools:y0.optional()}).optional(),elicitation:mFs.optional(),roots:zr({listChanged:ol().optional()}).optional(),tasks:gFs.optional(),extensions:xl(Je(),y0).optional()}),EFs=DT.extend({protocolVersion:Je(),capabilities:yFs,clientInfo:pVn}),_Fs=WA.extend({method:Gn("initialize"),params:EFs});var vFs=zr({experimental:xl(Je(),y0).optional(),logging:y0.optional(),completions:y0.optional(),prompts:zr({listChanged:ol().optional()}).optional(),resources:zr({subscribe:ol().optional(),listChanged:ol().optional()}).optional(),tools:zr({listChanged:ol().optional()}).optional(),tasks:AFs.optional(),extensions:xl(Je(),y0).optional()}),Dcr=zA.extend({protocolVersion:Je(),capabilities:vFs,serverInfo:pVn,instructions:Je().optional()}),hVn=Vw.extend({method:Gn("notifications/initialized"),params:$w.optional()}),mVn=a(t=>hVn.safeParse(t).success,"isInitializedNotification"),Lat=WA.extend({method:Gn("ping"),params:DT.optional()}),CFs=zr({progress:ka(),total:bu(ka()),message:bu(Je())}),bFs=zr({...$w.shape,...CFs.shape,progressToken:sVn}),Bat=Vw.extend({method:Gn("notifications/progress"),params:bFs}),SFs=DT.extend({cursor:aVn.optional()}),D2e=WA.extend({params:SFs.optional()}),N2e=zA.extend({nextCursor:aVn.optional()}),TFs=rv(["working","input_required","completed","failed","cancelled"]),M2e=zr({taskId:Je(),status:TFs,ttl:Il([ka(),mrt()]),createdAt:Je(),lastUpdatedAt:Je(),pollInterval:bu(ka()),statusMessage:bu(Je())}),dX=zA.extend({task:M2e}),IFs=$w.merge(M2e),O2e=Vw.extend({method:Gn("notifications/tasks/status"),params:IFs}),Fat=WA.extend({method:Gn("tasks/get"),params:DT.extend({taskId:Je()})}),Uat=zA.merge(M2e),Qat=WA.extend({method:Gn("tasks/result"),params:DT.extend({taskId:Je()})}),F0f=zA.loose(),qat=D2e.extend({method:Gn("tasks/list")}),jat=N2e.extend({tasks:Fr(M2e)}),Hat=WA.extend({method:Gn("tasks/cancel"),params:DT.extend({taskId:Je()})}),gVn=zA.merge(M2e),AVn=zr({uri:Je(),mimeType:bu(Je()),_meta:xl(Je(),od()).optional()}),yVn=AVn.extend({text:Je()}),Ncr=Je().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),EVn=AVn.extend({blob:Ncr}),L2e=rv(["user","assistant"]),zpe=zr({audience:Fr(L2e).optional(),priority:ka().min(0).max(1).optional(),lastModified:Ude.datetime({offset:!0}).optional()}),_Vn=zr({...Wpe.shape,...P2e.shape,uri:Je(),description:bu(Je()),mimeType:bu(Je()),size:bu(ka()),annotations:zpe.optional(),_meta:bu(om({}))}),xFs=zr({...Wpe.shape,...P2e.shape,uriTemplate:Je(),description:bu(Je()),mimeType:bu(Je()),annotations:zpe.optional(),_meta:bu(om({}))}),wFs=D2e.extend({method:Gn("resources/list")}),Mcr=N2e.extend({resources:Fr(_Vn)}),RFs=D2e.extend({method:Gn("resources/templates/list")}),Ocr=N2e.extend({resourceTemplates:Fr(xFs)}),Lcr=DT.extend({uri:Je()}),kFs=Lcr,PFs=WA.extend({method:Gn("resources/read"),params:kFs}),Bcr=zA.extend({contents:Fr(Il([yVn,EVn]))}),o8=Vw.extend({method:Gn("notifications/resources/list_changed"),params:$w.optional()}),DFs=Lcr,NFs=WA.extend({method:Gn("resources/subscribe"),params:DFs}),MFs=Lcr,OFs=WA.extend({method:Gn("resources/unsubscribe"),params:MFs}),LFs=$w.extend({uri:Je()}),Fcr=Vw.extend({method:Gn("notifications/resources/updated"),params:LFs}),BFs=zr({name:Je(),description:bu(Je()),required:bu(ol())}),FFs=zr({...Wpe.shape,...P2e.shape,description:bu(Je()),arguments:bu(Fr(BFs)),_meta:bu(om({}))}),UFs=D2e.extend({method:Gn("prompts/list")}),Ucr=N2e.extend({prompts:Fr(FFs)}),QFs=DT.extend({name:Je(),arguments:xl(Je(),Je()).optional()}),qFs=WA.extend({method:Gn("prompts/get"),params:QFs}),Qcr=zr({type:Gn("text"),text:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),qcr=zr({type:Gn("image"),data:Ncr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jcr=zr({type:Gn("audio"),data:Ncr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jFs=zr({type:Gn("tool_use"),name:Je(),id:Je(),input:xl(Je(),od()),_meta:xl(Je(),od()).optional()}),HFs=zr({type:Gn("resource"),resource:Il([yVn,EVn]),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),GFs=_Vn.extend({type:Gn("resource_link")}),Hcr=Il([Qcr,qcr,jcr,GFs,HFs]),$Fs=zr({role:L2e,content:Hcr}),Gcr=zA.extend({description:Je().optional(),messages:Fr($Fs)}),s8=Vw.extend({method:Gn("notifications/prompts/list_changed"),params:$w.optional()}),VFs=zr({title:Je().optional(),readOnlyHint:ol().optional(),destructiveHint:ol().optional(),idempotentHint:ol().optional(),openWorldHint:ol().optional()}),WFs=zr({taskSupport:rv(["required","optional","forbidden"]).optional()}),vVn=zr({...Wpe.shape,...P2e.shape,description:Je().optional(),inputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()),outputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()).optional(),annotations:VFs.optional(),execution:WFs.optional(),_meta:xl(Je(),od()).optional()}),zFs=D2e.extend({method:Gn("tools/list")}),$cr=N2e.extend({tools:Fr(vVn)}),uH=zA.extend({content:Fr(Hcr).default([]),structuredContent:xl(Je(),od()).optional(),isError:ol().optional()}),U0f=uH.or(zA.extend({toolResult:od()})),YFs=R2e.extend({name:Je(),arguments:xl(Je(),od()).optional()}),KFs=WA.extend({method:Gn("tools/call"),params:YFs}),a8=Vw.extend({method:Gn("notifications/tools/list_changed"),params:$w.optional()}),CVn=zr({autoRefresh:ol().default(!0),debounceMs:ka().int().nonnegative().default(300)}),bVn=rv(["debug","info","notice","warning","error","critical","alert","emergency"]),JFs=DT.extend({level:bVn}),ZFs=WA.extend({method:Gn("logging/setLevel"),params:JFs}),XFs=$w.extend({level:bVn,logger:Je().optional(),data:od()}),fX=Vw.extend({method:Gn("notifications/message"),params:XFs}),e8s=zr({name:Je().optional()}),t8s=zr({hints:Fr(e8s).optional(),costPriority:ka().min(0).max(1).optional(),speedPriority:ka().min(0).max(1).optional(),intelligencePriority:ka().min(0).max(1).optional()}),r8s=zr({mode:rv(["auto","required","none"]).optional()}),n8s=zr({type:Gn("tool_result"),toolUseId:Je().describe("The unique identifier for the corresponding tool call."),content:Fr(Hcr).default([]),structuredContent:zr({}).loose().optional(),isError:ol().optional(),_meta:xl(Je(),od()).optional()}),i8s=Ert("type",[Qcr,qcr,jcr]),Pat=Ert("type",[Qcr,qcr,jcr,jFs,n8s]),o8s=zr({role:L2e,content:Il([Pat,Fr(Pat)]),_meta:xl(Je(),od()).optional()}),s8s=R2e.extend({messages:Fr(o8s),modelPreferences:t8s.optional(),systemPrompt:Je().optional(),includeContext:rv(["none","thisServer","allServers"]).optional(),temperature:ka().optional(),maxTokens:ka().int(),stopSequences:Fr(Je()).optional(),metadata:y0.optional(),tools:Fr(vVn).optional(),toolChoice:r8s.optional()}),B2e=WA.extend({method:Gn("sampling/createMessage"),params:s8s}),Vcr=zA.extend({model:Je(),stopReason:bu(rv(["endTurn","stopSequence","maxTokens"]).or(Je())),role:L2e,content:i8s}),Wcr=zA.extend({model:Je(),stopReason:bu(rv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Je())),role:L2e,content:Il([Pat,Fr(Pat)])}),a8s=zr({type:Gn("boolean"),title:Je().optional(),description:Je().optional(),default:ol().optional()}),c8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),minLength:ka().optional(),maxLength:ka().optional(),format:rv(["email","uri","date","date-time"]).optional(),default:Je().optional()}),l8s=zr({type:rv(["number","integer"]),title:Je().optional(),description:Je().optional(),minimum:ka().optional(),maximum:ka().optional(),default:ka().optional()}),u8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),default:Je().optional()}),d8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),oneOf:Fr(zr({const:Je(),title:Je()})),default:Je().optional()}),f8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),enumNames:Fr(Je()).optional(),default:Je().optional()}),p8s=Il([u8s,d8s]),h8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({type:Gn("string"),enum:Fr(Je())}),default:Fr(Je()).optional()}),m8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({anyOf:Fr(zr({const:Je(),title:Je()}))}),default:Fr(Je()).optional()}),g8s=Il([h8s,m8s]),A8s=Il([f8s,p8s,g8s]),y8s=Il([A8s,a8s,c8s,l8s]),E8s=R2e.extend({mode:Gn("form").optional(),message:Je(),requestedSchema:zr({type:Gn("object"),properties:xl(Je(),y8s),required:Fr(Je()).optional()})}),_8s=R2e.extend({mode:Gn("url"),message:Je(),elicitationId:Je(),url:Je().url()}),v8s=Il([E8s,_8s]),F2e=WA.extend({method:Gn("elicitation/create"),params:v8s}),C8s=$w.extend({elicitationId:Je()}),b8s=Vw.extend({method:Gn("notifications/elicitation/complete"),params:C8s}),zcr=zA.extend({action:rv(["accept","decline","cancel"]),content:vrt(t=>t===null?void 0:t,xl(Je(),Il([Je(),ka(),ol(),Fr(Je())])).optional())}),S8s=zr({type:Gn("ref/resource"),uri:Je()});var T8s=zr({type:Gn("ref/prompt"),name:Je()}),I8s=DT.extend({ref:Il([T8s,S8s]),argument:zr({name:Je(),value:Je()}),context:zr({arguments:xl(Je(),Je()).optional()}).optional()}),x8s=WA.extend({method:Gn("completion/complete"),params:I8s});var Ycr=zA.extend({completion:om({values:Fr(Je()).max(100),total:bu(ka().int()),hasMore:bu(ol())})}),w8s=zr({uri:Je().startsWith("file://"),name:Je().optional(),_meta:xl(Je(),od()).optional()}),Kcr=WA.extend({method:Gn("roots/list"),params:DT.optional()}),R8s=zA.extend({roots:Fr(w8s)}),k8s=Vw.extend({method:Gn("notifications/roots/list_changed"),params:$w.optional()}),Q0f=Il([Lat,_Fs,x8s,ZFs,qFs,UFs,wFs,RFs,PFs,NFs,OFs,KFs,zFs,Fat,Qat,qat,Hat]),q0f=Il([Oat,Bat,hVn,k8s,O2e]),j0f=Il([uX,Vcr,Wcr,zcr,R8s,Uat,jat,dX]),H0f=Il([Lat,B2e,F2e,Kcr,Fat,Qat,qat,Hat]),G0f=Il([Oat,Bat,fX,Fcr,o8,a8,s8,O2e,b8s]),$0f=Il([uX,Dcr,Ycr,Gcr,Ucr,Mcr,Ocr,Bcr,uH,$cr,Uat,jat,dX]),Un=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===ei.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new wcr(o.elicitations,r)}return new t(e,r,n)}},wcr=class extends Un{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ei.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var YA=lJt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:OJt.custom,message:"URL must be parseable",fatal:!0}),eRe}).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"}),TVn=om({resource:Je().url(),authorization_servers:Fr(YA).optional(),jwks_uri:Je().url().optional(),scopes_supported:Fr(Je()).optional(),bearer_methods_supported:Fr(Je()).optional(),resource_signing_alg_values_supported:Fr(Je()).optional(),resource_name:Je().optional(),resource_documentation:Je().optional(),resource_policy_uri:Je().url().optional(),resource_tos_uri:Je().url().optional(),tls_client_certificate_bound_access_tokens:ol().optional(),authorization_details_types_supported:Fr(Je()).optional(),dpop_signing_alg_values_supported:Fr(Je()).optional(),dpop_bound_access_tokens_required:ol().optional()}),Jcr=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),service_documentation:YA.optional(),revocation_endpoint:YA.optional(),revocation_endpoint_auth_methods_supported:Fr(Je()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),introspection_endpoint:Je().optional(),introspection_endpoint_auth_methods_supported:Fr(Je()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),code_challenge_methods_supported:Fr(Je()).optional(),client_id_metadata_document_supported:ol().optional()}),P8s=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,userinfo_endpoint:YA.optional(),jwks_uri:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),acr_values_supported:Fr(Je()).optional(),subject_types_supported:Fr(Je()),id_token_signing_alg_values_supported:Fr(Je()),id_token_encryption_alg_values_supported:Fr(Je()).optional(),id_token_encryption_enc_values_supported:Fr(Je()).optional(),userinfo_signing_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_enc_values_supported:Fr(Je()).optional(),request_object_signing_alg_values_supported:Fr(Je()).optional(),request_object_encryption_alg_values_supported:Fr(Je()).optional(),request_object_encryption_enc_values_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),display_values_supported:Fr(Je()).optional(),claim_types_supported:Fr(Je()).optional(),claims_supported:Fr(Je()).optional(),service_documentation:Je().optional(),claims_locales_supported:Fr(Je()).optional(),ui_locales_supported:Fr(Je()).optional(),claims_parameter_supported:ol().optional(),request_parameter_supported:ol().optional(),request_uri_parameter_supported:ol().optional(),require_request_uri_registration:ol().optional(),op_policy_uri:YA.optional(),op_tos_uri:YA.optional(),client_id_metadata_document_supported:ol().optional()}),IVn=zr({...P8s.shape,...Jcr.pick({code_challenge_methods_supported:!0}).shape}),xVn=zr({access_token:Je(),id_token:Je().optional(),token_type:Je(),expires_in:jRe.number().optional(),scope:Je().optional(),refresh_token:Je().optional()}).strip(),wVn=zr({error:Je(),error_description:Je().optional(),error_uri:Je().optional()}),SVn=YA.optional().or(Gn("").transform(()=>{})),D8s=zr({redirect_uris:Fr(YA),token_endpoint_auth_method:Je().optional(),grant_types:Fr(Je()).optional(),response_types:Fr(Je()).optional(),client_name:Je().optional(),client_uri:YA.optional(),logo_uri:SVn,scope:Je().optional(),contacts:Fr(Je()).optional(),tos_uri:SVn,policy_uri:Je().optional(),jwks_uri:YA.optional(),jwks:IJt().optional(),software_id:Je().optional(),software_version:Je().optional(),software_statement:Je().optional()}).strip(),N8s=zr({client_id:Je(),client_secret:Je().optional(),client_id_issued_at:ka().optional(),client_secret_expires_at:ka().optional()}).strip(),RVn=D8s.merge(N8s),Y0f=zr({error:Je(),error_description:Je().optional()}).strip(),K0f=zr({token:Je(),token_type_hint:Je().optional()}).strip();p();function kVn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(kVn,"resourceUrlFromServerUrl");function PVn({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(H8s,"shouldAttemptFallback");async function G8s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Gw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=j8s(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await NVn(c,s,r);if(!n?.metadataUrl&&H8s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await NVn(u,s,r)}return l}a(G8s,"discoverMetadataWithFallback");function $8s(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($8s,"buildDiscoveryUrls");async function LVn(t,{fetchFn:e=fetch,protocolVersion:r=Gw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=$8s(t);for(let{url:s,type:c}of o){let l=await rlr(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"?Jcr.parse(await l.json()):IVn.parse(await l.json())}}}a(LVn,"discoverAuthorizationServerMetadata");async function V8s(t,e){let r,n;try{r=await OVn(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 LVn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(V8s,"discoverOAuthServerInfo");async function W8s(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(Zcr))throw new Error(`Incompatible auth server: does not support response type ${Zcr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Xcr))throw new Error(`Incompatible auth server: does not support code challenge method ${Xcr}`)}else l=new URL("/authorize",t);let u=await xcr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",Zcr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",Xcr),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(W8s,"startAuthorization");function z8s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(z8s,"prepareAuthorizationCodeRequest");async function BVn(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=O8s(n,f);L8s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await MVn(d);return xVn.parse(await d.json())}a(BVn,"executeTokenRequest");async function Y8s(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 BVn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(Y8s,"refreshAuthorization");async function K8s(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=z8s(o,d,t.redirectUrl)}let u=await t.clientInformation();return BVn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(K8s,"fetchToken");async function J8s(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 MVn(c);return RVn.parse(await c.json())}a(J8s,"registerClient");p();p();p();p();function Kpe(t){return!!t._zod}a(Kpe,"isZ4Schema");function P2(t,e){return Kpe(t)?Pde(t,e):t.safeParse(e)}a(P2,"safeParse");function Gat(t){if(!t)return;let e;if(Kpe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Gat,"getObjectShape");function FVn(t){if(Kpe(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(FVn,"getLiteralValue");p();function dH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(dH,"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 NAf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function nlr(t){let r=Gat(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=FVn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(nlr,"getMethodLiteral");function ilr(t,e){let r=P2(t,e);if(!r.success)throw r.error;return r.data}a(ilr,"parseWithCompat");var n6s=6e4,$at=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(Oat,r=>{this._oncancel(r)}),this.setNotificationHandler(Bat,r=>{this._onprogress(r)}),this.setRequestHandler(Lat,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fat,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(ei.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Qat,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 Un(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 Un(ei.InvalidParams,`Task not found: ${s}`);if(!dH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(dH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[cH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(qat,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 Un(ei.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Hat,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(ei.InvalidParams,`Task not found: ${r.params.taskId}`);if(dH(o.status))throw new Un(ei.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 Un(ei.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Un?o:new Un(ei.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),Un.fromError(ei.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),lX(s)||fVn(s)?this._onresponse(s):k2e(s)?this._onrequest(s,c):dVn(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=Un.fromError(ei.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?.[cH]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:ei.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=cVn(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 Un(ei.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:ei.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),lX(e))n(e);else{let c=new Un(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(lX(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),lX(e))o(e);else{let c=Un.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 Un?c:new Un(ei.InternalError,String(c))}}return}let s;try{let c=await this.request(e,dX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Un(ei.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},dH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Un(ei.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Un(ei.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 Un?c:new Un(ei.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||{},[cH]: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 Un?v:new Un(ei.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=P2(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??n6s,E=a(()=>A(Un.fromError(ei.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},Uat,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},jat,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},gVn,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||{},[cH]: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||{},[cH]: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||{},[cH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=nlr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=ilr(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=nlr(e);this._notificationHandlers.set(n,o=>{let s=ilr(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"&&k2e(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Un(ei.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 Un(ei.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Un(ei.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 Un(ei.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=O2e.parse({method:"notifications/tasks/status",params:l});await this.notification(u),dH(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 Un(ei.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(dH(l.status))throw new Un(ei.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=O2e.parse({method:"notifications/tasks/status",params:u});await this.notification(d),dH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function UVn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(UVn,"isPlainObject");function QVn(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];UVn(c)&&UVn(s)?r[o]={...c,...s}:r[o]=s}return r}a(QVn,"mergeCapabilities");p();var PYn=de(Gur(),1),DYn=de(kYn(),1);function sjs(){let t=new PYn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,DYn.default)(t),t}a(sjs,"createDefaultAjvInstance");var Ict=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??sjs()}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 xct=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=uH,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 Un(ei.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 Un(ei.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Un){yield{type:"error",error:f};return}yield{type:"error",error:new Un(ei.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 NYn(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(NYn,"assertToolsCallTaskCapability");function MYn(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(MYn,"assertClientRequestTaskCapability");function wct(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&&wct(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&wct(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&wct(r,e)}}a(wct,"applyElicitationDefaults");function ajs(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(ajs,"getSupportedElicitationModes");var _H=class extends $at{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 Ict,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",a8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",s8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",o8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new xct(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=QVn(this._capabilities,e)}setRequestHandler(e,r){let o=Gat(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Kpe(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=P2(F2e,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Un(ei.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=ajs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Un(ei.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Un(ei.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=P2(dX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Un(ei.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=P2(zcr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Un(ei.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{wct(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=P2(B2e,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Un(ei.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=P2(dX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Un(ei.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?Wcr:Vcr,y=P2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Un(ei.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:Gw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Dcr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Dat.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){NYn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&MYn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},uX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Ycr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},uX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},Gcr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Ucr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Mcr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Ocr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Bcr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},uX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},uX,r)}async callTool(e,r=uH,n){if(this.isToolTaskRequired(e.name))throw new Un(ei.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 Un(ei.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 Un(ei.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Un?c:new Un(ei.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},$cr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=CVn.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 Rct=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 Zur(t){}a(Zur,"noop");function kct(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=Zur,onError:r=Zur,onRetry:n=Zur,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=cjs(`${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 Rct(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Rct(`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(kct,"createParser");function cjs(t){let e=[],r="",n=0;for(;n0)return r}}a(b3s,"conversationIdOf");function S3s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(S3s,"sanitizeForPath");p();var T3s={0:1,1:2,2:3,3:4,4:5};function acr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(acr,"hrTimeToNano");function e$n(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=>e$n(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(e$n,"encodeAnyValue");function D2(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=e$n(n);o!==void 0&&e.push({key:r,value:o})}return e}a(D2,"encodeAttributes");function t$n(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:T3s[t.kind]??1,startTimeUnixNano:acr(t.startTime),endTimeUnixNano:acr(t.endTime),attributes:D2(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:acr(n.time),attributes:D2(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(t$n,"encodeSpan");function I3s(t,e){return{resourceSpans:[{resource:{attributes:Object.entries(e).map(([r,n])=>({key:r,value:{stringValue:n}}))},scopeSpans:[{scope:{name:"copilot-chat"},spans:t}]}]}}a(I3s,"wrapInResourceSpans");function r$n(t,e){let r=I3s(t,{"service.name":"copilot-chat","session.id":e.conversationId});return r.copilotChat={exportedAt:new Date().toISOString(),exporterVersion:"",sessionId:e.conversationId,...e.sessionTitle?{sessionTitle:e.sessionTitle}:{}},r}a(r$n,"buildChatDebugLogExport");var k2e=new fe("OtelBridge"),yFs=1e3,P2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(mv)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),Sa(z5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return k2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),k2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return k2e.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()},yFs)))}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(t$n)}catch(n){k2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){k2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var uVn=require("node:module");var lVn=new fe("BackgroundAgent.ManagerLifecycle");async function EFs(){return"pkg"in process?(0,uVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(EFs,"importSdk");var Lat=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(bn).getCapabilities().agentDebugLog)return;let e=P2e.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){XGn(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(){lVn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),h2n(this.ctx);let e=performance.now();try{this.sdk=await EFs(),Rt(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw ai(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await YGn(this.ctx),await gat(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService};typeof this.sdk.createLocalFeatureFlagServiceCreator=="function"&&(r.createFeatureFlagService=this.sdk.createLocalFeatureFlagServiceCreator()),typeof this.sdk.createLocalFeatureFlagService=="function"&&(r.featureFlagService=this.sdk.createLocalFeatureFlagService());let n=ZGn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),lVn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();var NT=class{static{a(this,"McpGatewayHost")}constructor(e,r){this._service=e,this._manager=r}get service(){return this._service}buildMcpServers(e){let r=this._manager.listReadyEntries(),n=new Map,o=new Map,s=new Map;for(let l of r){if(l.url===null)continue;let u=l.key.source;u.kind==="user"?n.set(l.key.name,{type:"http",url:l.url,tools:["*"]}):u.kind==="project"&&e!==void 0&&u.workspaceFolder===e?o.set(l.key.name,{type:"http",url:l.url,tools:["*"]}):u.kind==="plugin"&&s.set(l.key.name,{type:"http",url:l.url,tools:["*"]})}let c={};for(let[l,u]of s)c[l]=u;for(let[l,u]of n)c[l]=u;for(let[l,u]of o)c[l]=u;return c}async dispose(){}};p();p();var ul={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();p();var kcr;kcr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function _Fs(t){return(await kcr).getRandomValues(new Uint8Array(t))}a(_Fs,"getRandomValues");async function vFs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await _Fs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await CFs(t),r=await bFs(e);return{code_verifier:e,code_challenge:r}}a(Pcr,"pkceChallenge");p();var Vw="2025-11-25";var Fat=[Vw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],dH="io.modelcontextprotocol/related-task",Uat="2.0",_0=FJt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),dVn=xl([Je(),Pa().int()]),fVn=Je(),J0f=am({ttl:Pa().optional(),pollInterval:Pa().optional()}),TFs=zr({ttl:Pa().optional()}),IFs=zr({taskId:Je()}),Ncr=am({progressToken:dVn.optional(),[dH]:IFs.optional()}),MT=zr({_meta:Ncr.optional()}),D2e=MT.extend({task:TFs.optional()}),pVn=a(t=>D2e.safeParse(t).success,"isTaskAugmentedRequestParams"),zA=zr({method:Je(),params:MT.loose().optional()}),Ww=zr({_meta:Ncr.optional()}),zw=zr({method:Je(),params:Ww.loose().optional()}),YA=am({_meta:Ncr.optional()}),Qat=xl([Je(),Pa().int()]),hVn=zr({jsonrpc:Gn(Uat),id:Qat,...zA.shape}).strict(),N2e=a(t=>hVn.safeParse(t).success,"isJSONRPCRequest"),mVn=zr({jsonrpc:Gn(Uat),...zw.shape}).strict(),gVn=a(t=>mVn.safeParse(t).success,"isJSONRPCNotification"),Mcr=zr({jsonrpc:Gn(Uat),id:Qat,result:YA}).strict(),dX=a(t=>Mcr.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 Ocr=zr({jsonrpc:Gn(Uat),id:Qat.optional(),error:zr({code:Pa().int(),message:Je(),data:sd().optional()})}).strict();var AVn=a(t=>Ocr.safeParse(t).success,"isJSONRPCErrorResponse");var fH=xl([hVn,mVn,Mcr,Ocr]),Z0f=xl([Mcr,Ocr]),fX=YA.strict(),xFs=Ww.extend({requestId:Qat.optional(),reason:Je().optional()}),qat=zw.extend({method:Gn("notifications/cancelled"),params:xFs}),wFs=zr({src:Je(),mimeType:Je().optional(),sizes:Ur(Je()).optional(),theme:iv(["light","dark"]).optional()}),M2e=zr({icons:Ur(wFs).optional()}),zpe=zr({name:Je(),title:Je().optional()}),yVn=zpe.extend({...zpe.shape,...M2e.shape,version:Je(),websiteUrl:Je().optional(),description:Je().optional()}),RFs=GRe(zr({applyDefaults:ol().optional()}),wl(Je(),sd())),kFs=xrt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,GRe(zr({form:RFs.optional(),url:_0.optional()}),wl(Je(),sd()).optional())),PFs=am({list:_0.optional(),cancel:_0.optional(),requests:am({sampling:am({createMessage:_0.optional()}).optional(),elicitation:am({create:_0.optional()}).optional()}).optional()}),DFs=am({list:_0.optional(),cancel:_0.optional(),requests:am({tools:am({call:_0.optional()}).optional()}).optional()}),NFs=zr({experimental:wl(Je(),_0).optional(),sampling:zr({context:_0.optional(),tools:_0.optional()}).optional(),elicitation:kFs.optional(),roots:zr({listChanged:ol().optional()}).optional(),tasks:PFs.optional(),extensions:wl(Je(),_0).optional()}),MFs=MT.extend({protocolVersion:Je(),capabilities:NFs,clientInfo:yVn}),OFs=zA.extend({method:Gn("initialize"),params:MFs});var LFs=zr({experimental:wl(Je(),_0).optional(),logging:_0.optional(),completions:_0.optional(),prompts:zr({listChanged:ol().optional()}).optional(),resources:zr({subscribe:ol().optional(),listChanged:ol().optional()}).optional(),tools:zr({listChanged:ol().optional()}).optional(),tasks:DFs.optional(),extensions:wl(Je(),_0).optional()}),Lcr=YA.extend({protocolVersion:Je(),capabilities:LFs,serverInfo:yVn,instructions:Je().optional()}),EVn=zw.extend({method:Gn("notifications/initialized"),params:Ww.optional()}),_Vn=a(t=>EVn.safeParse(t).success,"isInitializedNotification"),jat=zA.extend({method:Gn("ping"),params:MT.optional()}),BFs=zr({progress:Pa(),total:bu(Pa()),message:bu(Je())}),FFs=zr({...Ww.shape,...BFs.shape,progressToken:dVn}),Hat=zw.extend({method:Gn("notifications/progress"),params:FFs}),UFs=MT.extend({cursor:fVn.optional()}),O2e=zA.extend({params:UFs.optional()}),L2e=YA.extend({nextCursor:fVn.optional()}),QFs=iv(["working","input_required","completed","failed","cancelled"]),B2e=zr({taskId:Je(),status:QFs,ttl:xl([Pa(),vrt()]),createdAt:Je(),lastUpdatedAt:Je(),pollInterval:bu(Pa()),statusMessage:bu(Je())}),pX=YA.extend({task:B2e}),qFs=Ww.merge(B2e),F2e=zw.extend({method:Gn("notifications/tasks/status"),params:qFs}),Gat=zA.extend({method:Gn("tasks/get"),params:MT.extend({taskId:Je()})}),$at=YA.merge(B2e),Vat=zA.extend({method:Gn("tasks/result"),params:MT.extend({taskId:Je()})}),X0f=YA.loose(),Wat=O2e.extend({method:Gn("tasks/list")}),zat=L2e.extend({tasks:Ur(B2e)}),Yat=zA.extend({method:Gn("tasks/cancel"),params:MT.extend({taskId:Je()})}),vVn=YA.merge(B2e),CVn=zr({uri:Je(),mimeType:bu(Je()),_meta:wl(Je(),sd()).optional()}),bVn=CVn.extend({text:Je()}),Bcr=Je().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),SVn=CVn.extend({blob:Bcr}),U2e=iv(["user","assistant"]),Ype=zr({audience:Ur(U2e).optional(),priority:Pa().min(0).max(1).optional(),lastModified:Qde.datetime({offset:!0}).optional()}),TVn=zr({...zpe.shape,...M2e.shape,uri:Je(),description:bu(Je()),mimeType:bu(Je()),size:bu(Pa()),annotations:Ype.optional(),_meta:bu(am({}))}),jFs=zr({...zpe.shape,...M2e.shape,uriTemplate:Je(),description:bu(Je()),mimeType:bu(Je()),annotations:Ype.optional(),_meta:bu(am({}))}),HFs=O2e.extend({method:Gn("resources/list")}),Fcr=L2e.extend({resources:Ur(TVn)}),GFs=O2e.extend({method:Gn("resources/templates/list")}),Ucr=L2e.extend({resourceTemplates:Ur(jFs)}),Qcr=MT.extend({uri:Je()}),$Fs=Qcr,VFs=zA.extend({method:Gn("resources/read"),params:$Fs}),qcr=YA.extend({contents:Ur(xl([bVn,SVn]))}),a8=zw.extend({method:Gn("notifications/resources/list_changed"),params:Ww.optional()}),WFs=Qcr,zFs=zA.extend({method:Gn("resources/subscribe"),params:WFs}),YFs=Qcr,KFs=zA.extend({method:Gn("resources/unsubscribe"),params:YFs}),JFs=Ww.extend({uri:Je()}),jcr=zw.extend({method:Gn("notifications/resources/updated"),params:JFs}),ZFs=zr({name:Je(),description:bu(Je()),required:bu(ol())}),XFs=zr({...zpe.shape,...M2e.shape,description:bu(Je()),arguments:bu(Ur(ZFs)),_meta:bu(am({}))}),e8s=O2e.extend({method:Gn("prompts/list")}),Hcr=L2e.extend({prompts:Ur(XFs)}),t8s=MT.extend({name:Je(),arguments:wl(Je(),Je()).optional()}),r8s=zA.extend({method:Gn("prompts/get"),params:t8s}),Gcr=zr({type:Gn("text"),text:Je(),annotations:Ype.optional(),_meta:wl(Je(),sd()).optional()}),$cr=zr({type:Gn("image"),data:Bcr,mimeType:Je(),annotations:Ype.optional(),_meta:wl(Je(),sd()).optional()}),Vcr=zr({type:Gn("audio"),data:Bcr,mimeType:Je(),annotations:Ype.optional(),_meta:wl(Je(),sd()).optional()}),n8s=zr({type:Gn("tool_use"),name:Je(),id:Je(),input:wl(Je(),sd()),_meta:wl(Je(),sd()).optional()}),i8s=zr({type:Gn("resource"),resource:xl([bVn,SVn]),annotations:Ype.optional(),_meta:wl(Je(),sd()).optional()}),o8s=TVn.extend({type:Gn("resource_link")}),Wcr=xl([Gcr,$cr,Vcr,o8s,i8s]),s8s=zr({role:U2e,content:Wcr}),zcr=YA.extend({description:Je().optional(),messages:Ur(s8s)}),c8=zw.extend({method:Gn("notifications/prompts/list_changed"),params:Ww.optional()}),a8s=zr({title:Je().optional(),readOnlyHint:ol().optional(),destructiveHint:ol().optional(),idempotentHint:ol().optional(),openWorldHint:ol().optional()}),c8s=zr({taskSupport:iv(["required","optional","forbidden"]).optional()}),IVn=zr({...zpe.shape,...M2e.shape,description:Je().optional(),inputSchema:zr({type:Gn("object"),properties:wl(Je(),_0).optional(),required:Ur(Je()).optional()}).catchall(sd()),outputSchema:zr({type:Gn("object"),properties:wl(Je(),_0).optional(),required:Ur(Je()).optional()}).catchall(sd()).optional(),annotations:a8s.optional(),execution:c8s.optional(),_meta:wl(Je(),sd()).optional()}),l8s=O2e.extend({method:Gn("tools/list")}),Ycr=L2e.extend({tools:Ur(IVn)}),pH=YA.extend({content:Ur(Wcr).default([]),structuredContent:wl(Je(),sd()).optional(),isError:ol().optional()}),egf=pH.or(YA.extend({toolResult:sd()})),u8s=D2e.extend({name:Je(),arguments:wl(Je(),sd()).optional()}),d8s=zA.extend({method:Gn("tools/call"),params:u8s}),l8=zw.extend({method:Gn("notifications/tools/list_changed"),params:Ww.optional()}),xVn=zr({autoRefresh:ol().default(!0),debounceMs:Pa().int().nonnegative().default(300)}),wVn=iv(["debug","info","notice","warning","error","critical","alert","emergency"]),f8s=MT.extend({level:wVn}),p8s=zA.extend({method:Gn("logging/setLevel"),params:f8s}),h8s=Ww.extend({level:wVn,logger:Je().optional(),data:sd()}),hX=zw.extend({method:Gn("notifications/message"),params:h8s}),m8s=zr({name:Je().optional()}),g8s=zr({hints:Ur(m8s).optional(),costPriority:Pa().min(0).max(1).optional(),speedPriority:Pa().min(0).max(1).optional(),intelligencePriority:Pa().min(0).max(1).optional()}),A8s=zr({mode:iv(["auto","required","none"]).optional()}),y8s=zr({type:Gn("tool_result"),toolUseId:Je().describe("The unique identifier for the corresponding tool call."),content:Ur(Wcr).default([]),structuredContent:zr({}).loose().optional(),isError:ol().optional(),_meta:wl(Je(),sd()).optional()}),E8s=Trt("type",[Gcr,$cr,Vcr]),Bat=Trt("type",[Gcr,$cr,Vcr,n8s,y8s]),_8s=zr({role:U2e,content:xl([Bat,Ur(Bat)]),_meta:wl(Je(),sd()).optional()}),v8s=D2e.extend({messages:Ur(_8s),modelPreferences:g8s.optional(),systemPrompt:Je().optional(),includeContext:iv(["none","thisServer","allServers"]).optional(),temperature:Pa().optional(),maxTokens:Pa().int(),stopSequences:Ur(Je()).optional(),metadata:_0.optional(),tools:Ur(IVn).optional(),toolChoice:A8s.optional()}),Q2e=zA.extend({method:Gn("sampling/createMessage"),params:v8s}),Kcr=YA.extend({model:Je(),stopReason:bu(iv(["endTurn","stopSequence","maxTokens"]).or(Je())),role:U2e,content:E8s}),Jcr=YA.extend({model:Je(),stopReason:bu(iv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Je())),role:U2e,content:xl([Bat,Ur(Bat)])}),C8s=zr({type:Gn("boolean"),title:Je().optional(),description:Je().optional(),default:ol().optional()}),b8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),minLength:Pa().optional(),maxLength:Pa().optional(),format:iv(["email","uri","date","date-time"]).optional(),default:Je().optional()}),S8s=zr({type:iv(["number","integer"]),title:Je().optional(),description:Je().optional(),minimum:Pa().optional(),maximum:Pa().optional(),default:Pa().optional()}),T8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Ur(Je()),default:Je().optional()}),I8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),oneOf:Ur(zr({const:Je(),title:Je()})),default:Je().optional()}),x8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Ur(Je()),enumNames:Ur(Je()).optional(),default:Je().optional()}),w8s=xl([T8s,I8s]),R8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:Pa().optional(),maxItems:Pa().optional(),items:zr({type:Gn("string"),enum:Ur(Je())}),default:Ur(Je()).optional()}),k8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:Pa().optional(),maxItems:Pa().optional(),items:zr({anyOf:Ur(zr({const:Je(),title:Je()}))}),default:Ur(Je()).optional()}),P8s=xl([R8s,k8s]),D8s=xl([x8s,w8s,P8s]),N8s=xl([D8s,C8s,b8s,S8s]),M8s=D2e.extend({mode:Gn("form").optional(),message:Je(),requestedSchema:zr({type:Gn("object"),properties:wl(Je(),N8s),required:Ur(Je()).optional()})}),O8s=D2e.extend({mode:Gn("url"),message:Je(),elicitationId:Je(),url:Je().url()}),L8s=xl([M8s,O8s]),q2e=zA.extend({method:Gn("elicitation/create"),params:L8s}),B8s=Ww.extend({elicitationId:Je()}),F8s=zw.extend({method:Gn("notifications/elicitation/complete"),params:B8s}),Zcr=YA.extend({action:iv(["accept","decline","cancel"]),content:xrt(t=>t===null?void 0:t,wl(Je(),xl([Je(),Pa(),ol(),Ur(Je())])).optional())}),U8s=zr({type:Gn("ref/resource"),uri:Je()});var Q8s=zr({type:Gn("ref/prompt"),name:Je()}),q8s=MT.extend({ref:xl([Q8s,U8s]),argument:zr({name:Je(),value:Je()}),context:zr({arguments:wl(Je(),Je()).optional()}).optional()}),j8s=zA.extend({method:Gn("completion/complete"),params:q8s});var Xcr=YA.extend({completion:am({values:Ur(Je()).max(100),total:bu(Pa().int()),hasMore:bu(ol())})}),H8s=zr({uri:Je().startsWith("file://"),name:Je().optional(),_meta:wl(Je(),sd()).optional()}),elr=zA.extend({method:Gn("roots/list"),params:MT.optional()}),G8s=YA.extend({roots:Ur(H8s)}),$8s=zw.extend({method:Gn("notifications/roots/list_changed"),params:Ww.optional()}),tgf=xl([jat,OFs,j8s,p8s,r8s,e8s,HFs,GFs,VFs,zFs,KFs,d8s,l8s,Gat,Vat,Wat,Yat]),rgf=xl([qat,Hat,EVn,$8s,F2e]),ngf=xl([fX,Kcr,Jcr,Zcr,G8s,$at,zat,pX]),igf=xl([jat,Q2e,q2e,elr,Gat,Vat,Wat,Yat]),ogf=xl([qat,Hat,hX,jcr,a8,l8,c8,F2e,F8s]),sgf=xl([fX,Lcr,Xcr,zcr,Hcr,Fcr,Ucr,qcr,pH,Ycr,$at,zat,pX]),Un=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 Dcr(o.elicitations,r)}return new t(e,r,n)}},Dcr=class extends Un{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??[]}};p();var KA=pJt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:UJt.custom,message:"URL must be parseable",fatal:!0}),nRe}).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"}),kVn=am({resource:Je().url(),authorization_servers:Ur(KA).optional(),jwks_uri:Je().url().optional(),scopes_supported:Ur(Je()).optional(),bearer_methods_supported:Ur(Je()).optional(),resource_signing_alg_values_supported:Ur(Je()).optional(),resource_name:Je().optional(),resource_documentation:Je().optional(),resource_policy_uri:Je().url().optional(),resource_tos_uri:Je().url().optional(),tls_client_certificate_bound_access_tokens:ol().optional(),authorization_details_types_supported:Ur(Je()).optional(),dpop_signing_alg_values_supported:Ur(Je()).optional(),dpop_bound_access_tokens_required:ol().optional()}),tlr=am({issuer:Je(),authorization_endpoint:KA,token_endpoint:KA,registration_endpoint:KA.optional(),scopes_supported:Ur(Je()).optional(),response_types_supported:Ur(Je()),response_modes_supported:Ur(Je()).optional(),grant_types_supported:Ur(Je()).optional(),token_endpoint_auth_methods_supported:Ur(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Je()).optional(),service_documentation:KA.optional(),revocation_endpoint:KA.optional(),revocation_endpoint_auth_methods_supported:Ur(Je()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ur(Je()).optional(),introspection_endpoint:Je().optional(),introspection_endpoint_auth_methods_supported:Ur(Je()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ur(Je()).optional(),code_challenge_methods_supported:Ur(Je()).optional(),client_id_metadata_document_supported:ol().optional()}),V8s=am({issuer:Je(),authorization_endpoint:KA,token_endpoint:KA,userinfo_endpoint:KA.optional(),jwks_uri:KA,registration_endpoint:KA.optional(),scopes_supported:Ur(Je()).optional(),response_types_supported:Ur(Je()),response_modes_supported:Ur(Je()).optional(),grant_types_supported:Ur(Je()).optional(),acr_values_supported:Ur(Je()).optional(),subject_types_supported:Ur(Je()),id_token_signing_alg_values_supported:Ur(Je()),id_token_encryption_alg_values_supported:Ur(Je()).optional(),id_token_encryption_enc_values_supported:Ur(Je()).optional(),userinfo_signing_alg_values_supported:Ur(Je()).optional(),userinfo_encryption_alg_values_supported:Ur(Je()).optional(),userinfo_encryption_enc_values_supported:Ur(Je()).optional(),request_object_signing_alg_values_supported:Ur(Je()).optional(),request_object_encryption_alg_values_supported:Ur(Je()).optional(),request_object_encryption_enc_values_supported:Ur(Je()).optional(),token_endpoint_auth_methods_supported:Ur(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Je()).optional(),display_values_supported:Ur(Je()).optional(),claim_types_supported:Ur(Je()).optional(),claims_supported:Ur(Je()).optional(),service_documentation:Je().optional(),claims_locales_supported:Ur(Je()).optional(),ui_locales_supported:Ur(Je()).optional(),claims_parameter_supported:ol().optional(),request_parameter_supported:ol().optional(),request_uri_parameter_supported:ol().optional(),require_request_uri_registration:ol().optional(),op_policy_uri:KA.optional(),op_tos_uri:KA.optional(),client_id_metadata_document_supported:ol().optional()}),PVn=zr({...V8s.shape,...tlr.pick({code_challenge_methods_supported:!0}).shape}),DVn=zr({access_token:Je(),id_token:Je().optional(),token_type:Je(),expires_in:$Re.number().optional(),scope:Je().optional(),refresh_token:Je().optional()}).strip(),NVn=zr({error:Je(),error_description:Je().optional(),error_uri:Je().optional()}),RVn=KA.optional().or(Gn("").transform(()=>{})),W8s=zr({redirect_uris:Ur(KA),token_endpoint_auth_method:Je().optional(),grant_types:Ur(Je()).optional(),response_types:Ur(Je()).optional(),client_name:Je().optional(),client_uri:KA.optional(),logo_uri:RVn,scope:Je().optional(),contacts:Ur(Je()).optional(),tos_uri:RVn,policy_uri:Je().optional(),jwks_uri:KA.optional(),jwks:kJt().optional(),software_id:Je().optional(),software_version:Je().optional(),software_statement:Je().optional()}).strip(),z8s=zr({client_id:Je(),client_secret:Je().optional(),client_id_issued_at:Pa().optional(),client_secret_expires_at:Pa().optional()}).strip(),MVn=W8s.merge(z8s),ugf=zr({error:Je(),error_description:Je().optional()}).strip(),dgf=zr({token:Je(),token_type_hint:Je().optional()}).strip();p();function OVn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(OVn,"resourceUrlFromServerUrl");function LVn({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(i6s,"shouldAttemptFallback");async function o6s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Vw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=n6s(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await FVn(c,s,r);if(!n?.metadataUrl&&i6s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await FVn(u,s,r)}return l}a(o6s,"discoverMetadataWithFallback");function s6s(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(s6s,"buildDiscoveryUrls");async function qVn(t,{fetchFn:e=fetch,protocolVersion:r=Vw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=s6s(t);for(let{url:s,type:c}of o){let l=await slr(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"?tlr.parse(await l.json()):PVn.parse(await l.json())}}}a(qVn,"discoverAuthorizationServerMetadata");async function a6s(t,e){let r,n;try{r=await QVn(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 qVn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(a6s,"discoverOAuthServerInfo");async function c6s(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(rlr))throw new Error(`Incompatible auth server: does not support response type ${rlr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(nlr))throw new Error(`Incompatible auth server: does not support code challenge method ${nlr}`)}else l=new URL("/authorize",t);let u=await Pcr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",rlr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",nlr),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(c6s,"startAuthorization");function l6s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(l6s,"prepareAuthorizationCodeRequest");async function jVn(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=K8s(n,f);J8s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await UVn(d);return DVn.parse(await d.json())}a(jVn,"executeTokenRequest");async function u6s(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 jVn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(u6s,"refreshAuthorization");async function d6s(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=l6s(o,d,t.redirectUrl)}let u=await t.clientInformation();return jVn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(d6s,"fetchToken");async function f6s(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 UVn(c);return MVn.parse(await c.json())}a(f6s,"registerClient");p();p();p();p();function Jpe(t){return!!t._zod}a(Jpe,"isZ4Schema");function N2(t,e){return Jpe(t)?Dde(t,e):t.safeParse(e)}a(N2,"safeParse");function Kat(t){if(!t)return;let e;if(Jpe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Kat,"getObjectShape");function HVn(t){if(Jpe(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(HVn,"getLiteralValue");p();function hH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(hH,"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 zAf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function alr(t){let r=Kat(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=HVn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(alr,"getMethodLiteral");function clr(t,e){let r=N2(t,e);if(!r.success)throw r.error;return r.data}a(clr,"parseWithCompat");var y6s=6e4,Jat=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(qat,r=>{this._oncancel(r)}),this.setNotificationHandler(Hat,r=>{this._onprogress(r)}),this.setRequestHandler(jat,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Gat,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(Zn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Vat,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 Un(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 Un(Zn.InvalidParams,`Task not found: ${s}`);if(!hH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(hH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[dH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Wat,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 Un(Zn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Yat,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(Zn.InvalidParams,`Task not found: ${r.params.taskId}`);if(hH(o.status))throw new Un(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 Un(Zn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Un?o:new Un(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),Un.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),dX(s)||AVn(s)?this._onresponse(s):N2e(s)?this._onrequest(s,c):gVn(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=Un.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?.[dH]?.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=pVn(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 Un(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),dX(e))n(e);else{let c=new Un(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(dX(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),dX(e))o(e);else{let c=Un.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 Un?c:new Un(Zn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,pX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Un(Zn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},hH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Un(Zn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Un(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 Un?c:new Un(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||{},[dH]: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 Un?v:new Un(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=N2(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??y6s,E=a(()=>A(Un.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},$at,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},zat,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},vVn,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||{},[dH]: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||{},[dH]: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||{},[dH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=alr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=clr(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=alr(e);this._notificationHandlers.set(n,o=>{let s=clr(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"&&N2e(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Un(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 Un(Zn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Un(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 Un(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=F2e.parse({method:"notifications/tasks/status",params:l});await this.notification(u),hH(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 Un(Zn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(hH(l.status))throw new Un(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=F2e.parse({method:"notifications/tasks/status",params:u});await this.notification(d),hH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function GVn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(GVn,"isPlainObject");function $Vn(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];GVn(c)&&GVn(s)?r[o]={...c,...s}:r[o]=s}return r}a($Vn,"mergeCapabilities");p();var LYn=de(zur(),1),BYn=de(OYn(),1);function vjs(){let t=new LYn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,BYn.default)(t),t}a(vjs,"createDefaultAjvInstance");var Dct=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??vjs()}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 Nct=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=pH,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 Un(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 Un(Zn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Un){yield{type:"error",error:f};return}yield{type:"error",error:new Un(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 FYn(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(FYn,"assertToolsCallTaskCapability");function UYn(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(UYn,"assertClientRequestTaskCapability");function Mct(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&&Mct(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&Mct(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&Mct(r,e)}}a(Mct,"applyElicitationDefaults");function Cjs(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(Cjs,"getSupportedElicitationModes");var bH=class extends Jat{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 Dct,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",l8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",c8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",a8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Nct(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=$Vn(this._capabilities,e)}setRequestHandler(e,r){let o=Kat(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Jpe(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=N2(q2e,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Un(Zn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=Cjs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Un(Zn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Un(Zn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=N2(pX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Un(Zn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=N2(Zcr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Un(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{Mct(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=N2(Q2e,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Un(Zn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=N2(pX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Un(Zn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?Jcr:Kcr,y=N2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Un(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:Vw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Lcr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Fat.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){FYn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&UYn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},fX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Xcr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},fX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},zcr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Hcr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Fcr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Ucr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},qcr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},fX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},fX,r)}async callTool(e,r=pH,n){if(this.isToolTaskRequired(e.name))throw new Un(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 Un(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 Un(Zn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Un?c:new Un(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},Ycr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=xVn.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 Oct=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 rdr(t){}a(rdr,"noop");function Lct(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=rdr,onError:r=rdr,onRetry:n=rdr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=bjs(`${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 Oct(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Oct(`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(Lct,"createParser");function bjs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),adr=a((t,e,r)=>e.has(t)||BYn("Cannot "+r),"__accessCheck"),na=a((t,e,r)=>(adr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),E0=a((t,e,r)=>e.has(t)?BYn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Vd=a((t,e,r,n)=>(adr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),m8=a((t,e,r)=>(adr(t,e,"access private method"),r),"__privateMethod"),xb,wX,mhe,Pct,Nct,RDe,yhe,kDe,vH,ghe,Ehe,Ahe,xDe,B2,edr,tdr,rdr,LYn,ndr,idr,wDe,odr,sdr,RX=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),E0(this,B2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,E0(this,xb),E0(this,wX),E0(this,mhe),E0(this,Pct),E0(this,Nct),E0(this,RDe),E0(this,yhe),E0(this,kDe,null),E0(this,vH),E0(this,ghe),E0(this,Ehe,null),E0(this,Ahe,null),E0(this,xDe,null),E0(this,tdr,async s=>{var c;na(this,ghe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){m8(this,B2,wDe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Vd(this,mhe,new URL(s.url)):Vd(this,mhe,void 0),d!==200){m8(this,B2,wDe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){m8(this,B2,wDe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.OPEN);let h=new Event("open");if((c=na(this,xDe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){m8(this,B2,wDe).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&&na(this,ghe).feed(m.decode(E,{stream:!y})),y&&(A=!1,na(this,ghe).reset(),m8(this,B2,odr).call(this))}while(A)}),E0(this,rdr,s=>{Vd(this,vH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&m8(this,B2,odr).call(this,Xur(s))}),E0(this,ndr,s=>{typeof s.id=="string"&&Vd(this,kDe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:na(this,mhe)?na(this,mhe).origin:na(this,wX).origin,lastEventId:s.id||""});na(this,Ahe)&&(!s.event||s.event==="message")&&na(this,Ahe).call(this,c),this.dispatchEvent(c)}),E0(this,idr,s=>{Vd(this,RDe,s)}),E0(this,sdr,()=>{Vd(this,yhe,void 0),na(this,xb)===this.CONNECTING&&m8(this,B2,edr).call(this)});try{if(e instanceof URL)Vd(this,wX,e);else if(typeof e=="string")Vd(this,wX,new URL(e,ujs()));else throw new Error("Invalid URL")}catch{throw ljs("An invalid or illegal string was specified")}Vd(this,ghe,kct({onEvent:na(this,ndr),onRetry:na(this,idr)})),Vd(this,xb,this.CONNECTING),Vd(this,RDe,3e3),Vd(this,Nct,(n=r?.fetch)!=null?n:globalThis.fetch),Vd(this,Pct,(o=r?.withCredentials)!=null?o:!1),m8(this,B2,edr).call(this)}get readyState(){return na(this,xb)}get url(){return na(this,wX).href}get withCredentials(){return na(this,Pct)}get onerror(){return na(this,Ehe)}set onerror(e){Vd(this,Ehe,e)}get onmessage(){return na(this,Ahe)}set onmessage(e){Vd(this,Ahe,e)}get onopen(){return na(this,xDe)}set onopen(e){Vd(this,xDe,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(){na(this,yhe)&&clearTimeout(na(this,yhe)),na(this,xb)!==this.CLOSED&&(na(this,vH)&&na(this,vH).abort(),Vd(this,xb,this.CLOSED),Vd(this,vH,void 0))}};xb=new WeakMap,wX=new WeakMap,mhe=new WeakMap,Pct=new WeakMap,Nct=new WeakMap,RDe=new WeakMap,yhe=new WeakMap,kDe=new WeakMap,vH=new WeakMap,ghe=new WeakMap,Ehe=new WeakMap,Ahe=new WeakMap,xDe=new WeakMap,B2=new WeakSet,edr=a(function(){Vd(this,xb,this.CONNECTING),Vd(this,vH,new AbortController),na(this,Nct)(na(this,wX),m8(this,B2,LYn).call(this)).then(na(this,tdr)).catch(na(this,rdr))},"connect_fn"),tdr=new WeakMap,rdr=new WeakMap,LYn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...na(this,kDe)?{"Last-Event-ID":na(this,kDe)}:void 0},cache:"no-store",signal:(t=na(this,vH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),ndr=new WeakMap,idr=new WeakMap,wDe=a(function(t,e){var r;na(this,xb)!==this.CLOSED&&Vd(this,xb,this.CLOSED);let n=new Dct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),odr=a(function(t,e){var r;if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.CONNECTING);let n=new Dct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n),Vd(this,yhe,setTimeout(na(this,sdr),na(this,RDe)))},"scheduleReconnect_fn"),sdr=new WeakMap,RX.CONNECTING=0,RX.OPEN=1,RX.CLOSED=2;function ujs(){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(ujs,"getBaseURL");p();function _he(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(_he,"normalizeHeaders");function Mct(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{..._he(e.headers),..._he(n.headers)}:e.headers};return t(r,o)}:t}a(Mct,"createFetchWithInit");var PDe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},vhe=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=Mct(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await l8(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 KA;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=_he(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 RX(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}=Ype(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 PDe(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=lH.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 KA("No auth provider");if(await l8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("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}=Ype(o);if(this._resourceMetadataUrl=c,this._scope=l,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;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 Oct=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=kct({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 djs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Jw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},Che=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=Mct(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??djs}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await l8(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 KA;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=_he(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 Jw(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 Oct({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=lH.parse(JSON.parse(g.data));lX(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 KA("No auth provider");if(await l8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("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:k2e(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 Jw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=Ype(l);if(this._resourceMetadataUrl=g,this._scope=A,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=Ype(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Jw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new KA;return this.send(e)}}throw new Jw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),mVn(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=>lH.parse(A)):[lH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Jw(-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 Jw(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 QYn=require("events");var bhe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},DDe=class{constructor(e){this._transport=null;this._emitter=new QYn.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 _H({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=fjs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!FYn(l))throw l}}throw FYn(n)?new bhe: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 vhe(r,UYn(this._options.sseOptions,e)):new Che(r,UYn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(a8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(o8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,o=>{this._emitter.emit(zl.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 FYn(t){if(t instanceof KA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(FYn,"isUnauthorized");function fjs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Jw||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(fjs,"httpFallbackCode");function UYn(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(UYn,"withBearer");p();function Lct(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(Lct,"isJsonRpcRequest");function qYn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(qYn,"isJsonRpcNotification");var Xw={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Zw=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();p();p();p();var F2=class{static{a(this,"McpRuntimeNotifier")}},Bct=class extends F2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new fe("CopilotMCP");async function cdr(t,e){await t.get(F2).notifyLog(e)}a(cdr,"notifyMCPRuntimeLog");async function _0(t,e){await cdr(t,{...e,level:"error"})}a(_0,"notifyMCPRuntimeError");async function kX(t,e){await cdr(t,{...e,level:"warning"})}a(kX,"notifyMCPRuntimeWarning");async function lc(t,e){await cdr(t,{...e,level:"info"})}a(lc,"notifyMCPRuntimeInfo");p();async function PX(t,e,r,n,o){return await t.get(tr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(PX,"fetchOauthServer");async function ldr(t){try{return await t.text()}catch{return t.statusText}}a(ldr,"getErrText");p();var jYn="/.well-known",udr=`${jYn}/oauth-protected-resource`,HYn=`${jYn}/oauth-authorization-server`,GYn=" ";function $Yn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a($Yn,"isAuthorizationProtectedResourceMetadata");function VYn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(VYn,"isAuthorizationServerMetadata");function Fct(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(Fct,"parseWWWAuthenticateHeader");function WYn(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(WYn,"getMetadataWithDefaultValues");function zYn(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(zYn,"getDefaultMetadataForUrl");function YYn(t){let e=new URL(t);if(!e.pathname.startsWith(udr))throw new Error(`Invalid discovery URL: expected path to start with ${udr}`);let r=e.pathname.substring(udr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(YYn,"getResourceServerBaseUrlFromDiscoveryUrl");function KYn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(KYn,"isAuthorizationDynamicClientRegistrationResponse");function Uct(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Uct,"isAuthorizationTokenResponse");function ddr(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(j$t(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(j$t(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(ddr,"getClaimsFromJWT");var fdr=class{static{a(this,"AuthMetadata")}},She=class extends fdr{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=WYn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},sr.info(this.ctx,"authMetadata",f),f}catch(m){sr.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=zYn(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 PX(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}=Fct(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 PX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Gw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await ldr(c)}`);let l=await c.json();if($Yn(l)){let u=YYn(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(HYn,e).toString()+o,c=await PX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Gw});if(c.status!==200&&(c=await PX(this.ctx,wa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Gw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await ldr(c)}`);let l=await c.json();if(VYn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var wb=class{static{a(this,"McpAuthService")}};var X5=new fe("mcpGateway");async function JYn(t,e,r){X5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new She(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return X5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),At(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){X5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Vn(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(JYn,"discoverAuthMetadata");async function Qct(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=XYn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return At(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return At(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Qct,"acquireSilent");async function ZYn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=pjs(t),d=XYn(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"){X5.warn(t,`mount '${o}': user cancelled the account selection`),At(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){X5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),At(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}At(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){X5.error(t,`mount '${o}': failed during account selection`,h),Vn(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"){X5.warn(t,`mount '${o}': user declined OAuth confirmation`),At(t,"mcpGateway.oauth.interactive",{result:"declined"});return}At(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){X5.error(t,`mount '${o}': failed to show auth confirmation`,f),Vn(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||X5.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}.`),At(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){X5.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)}`),Vn(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(ZYn,"acquireInteractive");function pjs(t){try{return t.get(ts)}catch{return}}a(pjs,"tryGetNotificationSender");function XYn(t){try{return t.get(wb)}catch{return}}a(XYn,"tryGetMcpAuthService");p();var U2=new fe("mcpGateway"),MDe="Copilot MCP Gateway",ODe="0.1.0",NDe=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(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(zl.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 +`&&n++}}return[e,r]}a(bjs,"splitLines");var Fct=class extends Event{static{a(this,"ErrorEvent")}constructor(e,r){var n,o;super(e),this.code=(n=r?.code)!=null?n:void 0,this.message=(o=r?.message)!=null?o:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,n){return n(QYn(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(QYn(this),r)}};function Sjs(t){let e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}a(Sjs,"syntaxError");function ndr(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(ndr).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${ndr(t.cause)}`:t.message:`${t}`}a(ndr,"flattenError");function QYn(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}a(QYn,"inspectableError");var jYn=a(t=>{throw TypeError(t)},"__typeError"),ddr=a((t,e,r)=>e.has(t)||jYn("Cannot "+r),"__accessCheck"),na=a((t,e,r)=>(ddr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),v0=a((t,e,r)=>e.has(t)?jYn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),zd=a((t,e,r,n)=>(ddr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),A8=a((t,e,r)=>(ddr(t,e,"access private method"),r),"__privateMethod"),xb,kX,ghe,Bct,Uct,DDe,Ehe,NDe,SH,Ahe,_he,yhe,kDe,U2,idr,odr,sdr,qYn,adr,cdr,PDe,ldr,udr,PX=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),v0(this,U2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,v0(this,xb),v0(this,kX),v0(this,ghe),v0(this,Bct),v0(this,Uct),v0(this,DDe),v0(this,Ehe),v0(this,NDe,null),v0(this,SH),v0(this,Ahe),v0(this,_he,null),v0(this,yhe,null),v0(this,kDe,null),v0(this,odr,async s=>{var c;na(this,Ahe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){A8(this,U2,PDe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?zd(this,ghe,new URL(s.url)):zd(this,ghe,void 0),d!==200){A8(this,U2,PDe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){A8(this,U2,PDe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(na(this,xb)===this.CLOSED)return;zd(this,xb,this.OPEN);let h=new Event("open");if((c=na(this,kDe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){A8(this,U2,PDe).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&&na(this,Ahe).feed(m.decode(E,{stream:!y})),y&&(A=!1,na(this,Ahe).reset(),A8(this,U2,ldr).call(this))}while(A)}),v0(this,sdr,s=>{zd(this,SH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&A8(this,U2,ldr).call(this,ndr(s))}),v0(this,adr,s=>{typeof s.id=="string"&&zd(this,NDe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:na(this,ghe)?na(this,ghe).origin:na(this,kX).origin,lastEventId:s.id||""});na(this,yhe)&&(!s.event||s.event==="message")&&na(this,yhe).call(this,c),this.dispatchEvent(c)}),v0(this,cdr,s=>{zd(this,DDe,s)}),v0(this,udr,()=>{zd(this,Ehe,void 0),na(this,xb)===this.CONNECTING&&A8(this,U2,idr).call(this)});try{if(e instanceof URL)zd(this,kX,e);else if(typeof e=="string")zd(this,kX,new URL(e,Tjs()));else throw new Error("Invalid URL")}catch{throw Sjs("An invalid or illegal string was specified")}zd(this,Ahe,Lct({onEvent:na(this,adr),onRetry:na(this,cdr)})),zd(this,xb,this.CONNECTING),zd(this,DDe,3e3),zd(this,Uct,(n=r?.fetch)!=null?n:globalThis.fetch),zd(this,Bct,(o=r?.withCredentials)!=null?o:!1),A8(this,U2,idr).call(this)}get readyState(){return na(this,xb)}get url(){return na(this,kX).href}get withCredentials(){return na(this,Bct)}get onerror(){return na(this,_he)}set onerror(e){zd(this,_he,e)}get onmessage(){return na(this,yhe)}set onmessage(e){zd(this,yhe,e)}get onopen(){return na(this,kDe)}set onopen(e){zd(this,kDe,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(){na(this,Ehe)&&clearTimeout(na(this,Ehe)),na(this,xb)!==this.CLOSED&&(na(this,SH)&&na(this,SH).abort(),zd(this,xb,this.CLOSED),zd(this,SH,void 0))}};xb=new WeakMap,kX=new WeakMap,ghe=new WeakMap,Bct=new WeakMap,Uct=new WeakMap,DDe=new WeakMap,Ehe=new WeakMap,NDe=new WeakMap,SH=new WeakMap,Ahe=new WeakMap,_he=new WeakMap,yhe=new WeakMap,kDe=new WeakMap,U2=new WeakSet,idr=a(function(){zd(this,xb,this.CONNECTING),zd(this,SH,new AbortController),na(this,Uct)(na(this,kX),A8(this,U2,qYn).call(this)).then(na(this,odr)).catch(na(this,sdr))},"connect_fn"),odr=new WeakMap,sdr=new WeakMap,qYn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...na(this,NDe)?{"Last-Event-ID":na(this,NDe)}:void 0},cache:"no-store",signal:(t=na(this,SH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),adr=new WeakMap,cdr=new WeakMap,PDe=a(function(t,e){var r;na(this,xb)!==this.CLOSED&&zd(this,xb,this.CLOSED);let n=new Fct("error",{code:e,message:t});(r=na(this,_he))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),ldr=a(function(t,e){var r;if(na(this,xb)===this.CLOSED)return;zd(this,xb,this.CONNECTING);let n=new Fct("error",{code:e,message:t});(r=na(this,_he))==null||r.call(this,n),this.dispatchEvent(n),zd(this,Ehe,setTimeout(na(this,udr),na(this,DDe)))},"scheduleReconnect_fn"),udr=new WeakMap,PX.CONNECTING=0,PX.OPEN=1,PX.CLOSED=2;function Tjs(){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(Tjs,"getBaseURL");p();function vhe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(vhe,"normalizeHeaders");function Qct(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...vhe(e.headers),...vhe(n.headers)}:e.headers};return t(r,o)}:t}a(Qct,"createFetchWithInit");var MDe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},Che=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=Qct(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new JA("No auth provider");let e;try{e=await d8(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 JA;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=vhe(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 PX(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}=Kpe(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 MDe(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=fH.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 JA("No auth provider");if(await d8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new JA("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}=Kpe(o);if(this._resourceMetadataUrl=c,this._scope=l,await d8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new JA;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 qct=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=Lct({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 Ijs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Xw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},bhe=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=Qct(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??Ijs}async _authThenStart(){if(!this._authProvider)throw new JA("No auth provider");let e;try{e=await d8(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 JA;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=vhe(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 Xw(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 qct({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=fH.parse(JSON.parse(g.data));dX(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 JA("No auth provider");if(await d8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new JA("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:N2e(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 Xw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=Kpe(l);if(this._resourceMetadataUrl=g,this._scope=A,await d8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new JA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=Kpe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Xw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await d8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new JA;return this.send(e)}}throw new Xw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),_Vn(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=>fH.parse(A)):[fH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Xw(-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 Xw(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 $Yn=require("events");var She=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},ODe=class{constructor(e){this._transport=null;this._emitter=new $Yn.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 bH({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=xjs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!HYn(l))throw l}}throw HYn(n)?new She: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 Che(r,GYn(this._options.sseOptions,e)):new bhe(r,GYn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(l8,()=>{this._emitter.emit(ul.ToolsListChanged)}),this._client.setNotificationHandler(a8,()=>{this._emitter.emit(ul.ResourcesListChanged)}),this._client.setNotificationHandler(c8,()=>{this._emitter.emit(ul.PromptsListChanged)}),this._client.setNotificationHandler(hX,o=>{this._emitter.emit(ul.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 HYn(t){if(t instanceof JA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(HYn,"isUnauthorized");function xjs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Xw||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(xjs,"httpFallbackCode");function GYn(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(GYn,"withBearer");p();function jct(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(jct,"isJsonRpcRequest");function VYn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(VYn,"isJsonRpcNotification");var tR={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},eR=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();p();var Q2=class{static{a(this,"McpRuntimeNotifier")}},Hct=class extends Q2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new fe("CopilotMCP");async function fdr(t,e){await t.get(Q2).notifyLog(e)}a(fdr,"notifyMCPRuntimeLog");async function md(t,e){await fdr(t,{...e,level:"error"})}a(md,"notifyMCPRuntimeError");async function q2(t,e){await fdr(t,{...e,level:"warning"})}a(q2,"notifyMCPRuntimeWarning");async function ia(t,e){await fdr(t,{...e,level:"info"})}a(ia,"notifyMCPRuntimeInfo");p();p();p();async function DX(t,e,r,n,o){return await t.get(nr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(DX,"fetchOauthServer");async function pdr(t){try{return await t.text()}catch{return t.statusText}}a(pdr,"getErrText");p();var WYn="/.well-known",hdr=`${WYn}/oauth-protected-resource`,zYn=`${WYn}/oauth-authorization-server`,YYn=" ";function KYn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(KYn,"isAuthorizationProtectedResourceMetadata");function JYn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(JYn,"isAuthorizationServerMetadata");function Gct(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(Gct,"parseWWWAuthenticateHeader");function ZYn(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(ZYn,"getMetadataWithDefaultValues");function XYn(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(XYn,"getDefaultMetadataForUrl");function eKn(t){let e=new URL(t);if(!e.pathname.startsWith(hdr))throw new Error(`Invalid discovery URL: expected path to start with ${hdr}`);let r=e.pathname.substring(hdr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(eKn,"getResourceServerBaseUrlFromDiscoveryUrl");function tKn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(tKn,"isAuthorizationDynamicClientRegistrationResponse");function $ct(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a($ct,"isAuthorizationTokenResponse");function mdr(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(V$t(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(V$t(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(mdr,"getClaimsFromJWT");var gdr=class{static{a(this,"AuthMetadata")}},The=class extends gdr{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=ZYn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},sr.info(this.ctx,"authMetadata",f),f}catch(m){sr.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=XYn(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 DX(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}=Gct(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 DX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Vw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await pdr(c)}`);let l=await c.json();if(KYn(l)){let u=eKn(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(zYn,e).toString()+o,c=await DX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Vw});if(c.status!==200&&(c=await DX(this.ctx,Ra(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Vw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await pdr(c)}`);let l=await c.json();if(JYn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var wb=class{static{a(this,"McpAuthService")}};var e4=new fe("mcpGateway");async function rKn(t,e,r){e4.info(t,`OAuth discovery: probing ${e}`);try{let n=await new The(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return e4.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),Rt(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){e4.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),ai(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(rKn,"discoverAuthMetadata");async function Vct(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=iKn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return Rt(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return Rt(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Vct,"acquireSilent");async function nKn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=wjs(t),d=iKn(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"){e4.warn(t,`mount '${o}': user cancelled the account selection`),Rt(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){e4.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),Rt(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}Rt(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){e4.error(t,`mount '${o}': failed during account selection`,h),ai(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"){e4.warn(t,`mount '${o}': user declined OAuth confirmation`),Rt(t,"mcpGateway.oauth.interactive",{result:"declined"});return}Rt(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){e4.error(t,`mount '${o}': failed to show auth confirmation`,f),ai(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||e4.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}.`),Rt(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){e4.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)}`),ai(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(nKn,"acquireInteractive");function wjs(t){try{return t.get(ts)}catch{return}}a(wjs,"tryGetNotificationSender");function iKn(t){try{return t.get(wb)}catch{return}}a(iKn,"tryGetMcpAuthService");p();var j2=new fe("mcpGateway"),BDe="Copilot MCP Gateway",FDe="0.1.0",LDe=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(ul.ToolsListChanged,this._onToolsListChanged),this._invoker.on(ul.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(ul.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(ul.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),U2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),U2.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)Lct(o)?n.push(await this._dispatchRequest(o)):qYn(o)?this._dispatchNotification(o):U2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,U2.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(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(zl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){U2.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 Zw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(U2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Xw.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 Zw(Xw.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 Zw(Xw.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&&Dat.includes(n)?n:Gw;return U2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&U2.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:MDe,version:ODe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Zw(Xw.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 Zw(Xw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Zw(Xw.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 Zw(Xw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Zw(Xw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){U2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,U2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){U2.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 eKn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(eKn,"isInitializeMessage");p();p();var GKn=de(jKn(),1),Hct=de(require("node:process"),1),$Kn=require("node:stream");p();var jct=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),Qjs(r)}clear(){this._buffer=void 0}};function Qjs(t){return lH.parse(JSON.parse(t))}a(Qjs,"deserializeMessage");function HKn(t){return JSON.stringify(t)+` -`}a(HKn,"serializeMessage");var qjs=Hct.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jjs(){let t={};for(let e of qjs){let r=Hct.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jjs,"getDefaultEnvironment");var xhe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new jct,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new $Kn.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,GKn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...jjs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Hct.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=HKn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var VKn=require("child_process"),WKn=require("events"),zKn=require("util");var Cdr=1e4,Hjs=(0,zKn.promisify)(VKn.exec),LDe=class{constructor(e){this._transport=null;this._emitter=new WKn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new _H({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 xhe(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(a8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(o8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,n=>{this._emitter.emit(zl.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),Cdr))]),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 Hjs(`taskkill /pid ${o} /t /f`,{timeout:Cdr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Cdr));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 dm=class{static{a(this,"AuthenticationService")}};var NT=new fe("mcpGateway.manager"),bH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},Gjs={tools:[],resources:[],resourceTemplates:[],prompts:[]},ey=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(e){let r=[];for(let n of this._entries.values())Wjs(n.key.source,e)&&r.push({name:n.key.name,source:n.key.source,status:n.status,error:n.error,authInfo:n.authInfo,registryInfo:n.registryInfo});return r}getServerDetails(e){let r=this._entries.get(CH(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}listReadyEntries(){let e=[];for(let r of this._entries.values()){if(r.status!=="running")continue;let n=CH(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null})}return e}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 removeProject(e){if(this._disposed)return;let r=this._applyChain.then(()=>this._removeProjectLocked(e));return this._applyChain=r.catch(()=>{}),r}async applyPluginServers(e,r){if(this._disposed)throw new Error("McpServerManager is disposed");let n=this._applyChain.then(()=>this._applyScope({kind:"plugin",pluginId:e},r));return this._applyChain=n.catch(()=>{}),n}async removePluginServers(e){return this.applyPluginServers(e,{})}async _applyConfigLocked(e){let{workspaceFolder:r,user:n,project:o}=e,s=$js(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),At(this._ctx,"mcpGateway.applyConfig",{userChanged:String(c),hasProject:String(Object.keys(o).length>0)},{userServerCount:Object.keys(n).length,projectServerCount:Object.keys(o).length})}async _applyScope(e,r){let n=new Map,o=[];for(let[l,u]of Object.entries(r)){let d=Yjs(l,u);if(!d){o.push(l);continue}n.set(CH({source:e,name:l}),{classified:d,hash:YKn(u)})}o.length>0&&NT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${zjs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)Vjs(u.key.source,e)&&!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:e,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged(e4(e))}async _removeProjectLocked(e){let r=[];for(let[n,o]of this._entries)o.key.source.kind==="project"&&o.key.source.workspaceFolder===e&&r.push(n);if(r.length!==0)for(let n of r)await this._removeEntry(n)}serverAction(e,r){let n=CH(e),o=this._entries.get(n);if(!o)throw new bH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new bH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new bH("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(e4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(e4(n.key.source)),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:{...Gjs},listeners:null};return this._entries.set(CH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=e4(r.key.source);await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged(n)}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(e4(r.key.source)));let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(n,r.key.name)}catch(o){throw NT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(CH(r.key)),await n.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(o=>{NT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(e4(r.key.source)),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof bhe?(r.status="unauthorized",r.error=void 0,NT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),NT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(e4(r.key.source))}}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(CH(e.key)),this._sender.serversChanged(e4(e.key.source)),n&&await n.stop().catch(o=>{NT.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(zl.ToolsListChanged,n.toolsChanged),r.on(zl.ResourcesListChanged,n.resourcesChanged),r.on(zl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(zl.ToolsListChanged,n.toolsChanged),r.off(zl.ResourcesListChanged,n.resourcesChanged),r.off(zl.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){NT.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=CH(e.key),o=e.key.name;return r.kind==="stdio"?new LDe({id:n,label:o,params:r.params,clientInfo:{name:MDe,version:ODe}}):new DDe({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:MDe,version:ODe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{NT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),At(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(dm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await JYn(this._ctx,r,n);if(!s){NT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Qct(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){NT.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 Qct(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 Qct(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 ZYn(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(e4(e.key.source)))}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=>NT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){NT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){NT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(e4(e.key.source))}};function CH(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(CH,"serializeKey");function YKn(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(YKn,"canonicalEntryHash");function $js(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=YKn(t[n]);return JSON.stringify(r)}a($js,"canonicalConfigHash");function e4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(e4,"notificationScopeFor");function Vjs(t,e){return t.kind!==e.kind?!1:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:t.kind==="plugin"&&e.kind==="plugin"?t.pluginId===e.pluginId:t.kind==="user"&&e.kind==="user"}a(Vjs,"sameScope");function Wjs(t,e){return e===void 0||t.kind==="user"||t.kind==="plugin"?!0:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:!1}a(Wjs,"entryInScope");function zjs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(zjs,"describeScope");function Yjs(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(Yjs,"classifyEntry");p();var bdr=require("crypto"),KKn=require("events"),JKn=de(require("http"));var SH=new fe("mcpGateway"),Kjs="mcp-session-id",Jjs=1024*1024,Zjs=5e3,ZKn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},DX={MountsChanged:"mountsChanged"},TH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new KKn.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,SH.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),At(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(DX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=ZKn.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,bdr.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 SH.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),At(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(DX.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),SH.info(this._ctx,`unregistered mount '${n.label}' (${e})`),At(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(DX.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=JKn.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")),Zjs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),SH.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){SH.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:Xw.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){SH.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(!eKn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,bdr.randomUUID)(),c=new NDe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&SH.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),SH.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(Lct)}_getSessionId(e){let r=e.headers[Kjs];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>Jjs)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 Sdr=new fe("BackgroundAgent.McpSync"),Gct=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(DX.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(DX.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(){if(this.registry.size()===0)return;let e;try{e=this.ctx.get(PT)}catch(r){r instanceof bl||Sdr.warn(this.ctx,"Failed to read MCP gateway host for active-session sync",{error:r instanceof Error?r.message:String(r)});return}Sdr.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size()}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{let o=this.registry.getMcpDirectory(r)??this.registry.getWorkspaceFolderUri(r),s=e.buildMcpServers(o);try{await n.reloadMcpServers({mcpServers:s})}catch(c){Sdr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}}))}};p();p();var $ct="/agents/sessions",Vct=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($ct),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 XKn(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(`${$ct}/${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 XKn(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(`${$ct}/${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(`${$ct}/${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 XKn(t){try{return await t.text()}catch{return""}}a(XKn,"safeReadText");p();p();var Wct=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 Xjs=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 eJn(t){return!(!t.type||Xjs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(eJn,"shouldForwardMissionControlEvent");function Tdr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Tdr,"getMissionControlEventData");function tJn(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(tJn,"maybeAcknowledgeMissionControlCommandFromEvent");var iJn=require("node:crypto");var eHs=500,tHs=3e3,rHs=1e4,nHs=500,BDe=2e3,iHs=256,rJn=80,zct=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Wct({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 W0n(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await z0n(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=sHs(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: ${NX(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: ${NX(A)}`)}try{ecr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${NX(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}`))},eHs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},tHs),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{ecr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${NX(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,iJn.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(!eJn(r))return;tJn(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:Tdr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Tdr(r))),e.eventBuffer.length>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe)}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=oHs(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>=iHs){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>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=rHs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,nHs);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<=BDe&&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: ${NX(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=nJn(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}): ${NX(c)}`)}return}case"ask_user_response":{let n=nJn(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}): ${NX(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 nJn(t){try{return JSON.parse(t)}catch{return}}a(nJn,"safeJsonParse");function NX(t){return t instanceof Error?t.message:String(t)}a(NX,"errMsg");function oHs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>rJn?e.slice(0,rJn-1).trimEnd()+"\u2026":e:""}a(oHs,"deriveTitleFromMessage");function sHs(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(sHs,"toVscodeUriShape");var Idr=new fe("BackgroundAgent.RemoteController"),Yct=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 Vct(this.ctx,Idr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new zct(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Idr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!VGn(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=tcr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=tcr(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){Idr.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(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"}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 xdr=new fe("BackgroundAgent.CustomAgents");async function Kct(t,e){try{if(Ft(t,Ye.EnableCustomAgents)===!1)return xdr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Ld).listCustomAgents([e],{includePlugins:!0});return o.length>0&&xdr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>aHs(s))}catch(r){return xdr.warn(t,"Failed to load custom agents:",r),[]}}a(Kct,"loadCustomAgents");function aHs(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(aHs,"toSweCustomAgent");p();var wdr=new fe("BackgroundAgent.Hooks"),Rdr="copilot-language-server";function oJn(t,e){return{preToolUse:[cHs(t,e)],postToolUse:[lHs(t,e)],userPromptSubmitted:[uHs(t,e)]}}a(oJn,"buildSessionHooks");function cHs(t,e){return{source:Rdr,handler:a(async r=>{try{let o=await t.get(mE).hook(t,o2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){wdr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(cHs,"createPreToolUseHandler");function lHs(t,e){return{source:Rdr,handler:a(async r=>{try{await t.get(mE).hook(t,i2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs),toolResult:{resultType:kdr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){wdr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(lHs,"createPostToolUseHandler");function uHs(t,e){return{source:Rdr,handler:a(async r=>{try{await t.get(mE).hook(t,s2,{timestamp:r.timestamp,cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){wdr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(uHs,"createUserPromptSubmittedHandler");function FDe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(FDe,"safeStringifyToolArgs");function kdr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(kdr,"toClsToolResultType");p();var dHs=["model-agents-md","cwd-model-agents-md"],fHs=["model-claude-md","cwd-model-claude-md"],pHs="nested-agents";function sJn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of dHs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of fHs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(pHs),e}a(sJn,"computeDisabledInstructionSources");var hHs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),mHs=2,gHs="CLAUDE.md",AHs="AGENTS.md";function yHs(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(yHs,"joinPath");async function EHs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(yHs(e,s))}catch{return}for(let[u,d]of l){let f=(d&1)!==0,h=(d&2)!==0;f&&u===r&&s.length>0?n.push([...s,r].join("/")):h&&co.content.trim().length>0);if(r.length===0)return;let n=r.map(o=>[`<${e}-instructions path="${o.relativePath}">`,o.content.trim(),``].join(` +`),this._sseClients.add(e),j2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),j2.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)jct(o)?n.push(await this._dispatchRequest(o)):VYn(o)?this._dispatchNotification(o):j2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,j2.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(ul.ToolsListChanged,this._onToolsListChanged),this._invoker.off(ul.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(ul.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(ul.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){j2.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 eR?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(j2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:tR.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 eR(tR.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 eR(tR.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&&Fat.includes(n)?n:Vw;return j2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&j2.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:BDe,version:FDe}}}async _handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new eR(tR.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};try{return await this._invoker.callTool(r.name,n)}catch(o){throw md(this._ctx,{message:`Error calling tool ${r.name}: ${o instanceof Error?o.message:String(o)}`,server:this._invoker.label}),o}}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new eR(tR.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new eR(tR.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 eR(tR.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new eR(tR.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){j2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,j2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){j2.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 oKn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(oKn,"isInitializeMessage");p();p();var YKn=de(WKn(),1),Yct=de(require("node:process"),1),KKn=require("node:stream");p();var zct=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),tHs(r)}clear(){this._buffer=void 0}};function tHs(t){return fH.parse(JSON.parse(t))}a(tHs,"deserializeMessage");function zKn(t){return JSON.stringify(t)+` +`}a(zKn,"serializeMessage");var rHs=Yct.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function nHs(){let t={};for(let e of rHs){let r=Yct.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(nHs,"getDefaultEnvironment");var whe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new zct,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new KKn.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,YKn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...nHs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Yct.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=zKn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var JKn=require("child_process"),ZKn=require("events"),XKn=require("util");var Idr=1e4,iHs=(0,XKn.promisify)(JKn.exec),UDe=class{constructor(e){this._transport=null;this._emitter=new ZKn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new bH({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 whe(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(l8,()=>{this._emitter.emit(ul.ToolsListChanged)}),this._client.setNotificationHandler(a8,()=>{this._emitter.emit(ul.ResourcesListChanged)}),this._client.setNotificationHandler(c8,()=>{this._emitter.emit(ul.PromptsListChanged)}),this._client.setNotificationHandler(hX,n=>{this._emitter.emit(ul.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),Idr))]),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 iHs(`taskkill /pid ${o} /t /f`,{timeout:Idr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Idr));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 pm=class{static{a(this,"AuthenticationService")}};var OT=new fe("mcpGateway.manager"),IH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},oHs={tools:[],resources:[],resourceTemplates:[],prompts:[]},ty=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(e){let r=[];for(let n of this._entries.values())cHs(n.key.source,e)&&r.push({name:n.key.name,source:n.key.source,status:n.status,error:n.error,authInfo:n.authInfo,registryInfo:n.registryInfo});return r}getServerDetails(e){let r=this._entries.get(TH(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}listReadyEntries(){let e=[];for(let r of this._entries.values()){if(r.status!=="running")continue;let n=TH(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null})}return e}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 removeProject(e){if(this._disposed)return;let r=this._applyChain.then(()=>this._removeProjectLocked(e));return this._applyChain=r.catch(()=>{}),r}async applyPluginServers(e,r){if(this._disposed)throw new Error("McpServerManager is disposed");let n=this._applyChain.then(()=>this._applyScope({kind:"plugin",pluginId:e},r));return this._applyChain=n.catch(()=>{}),n}async removePluginServers(e){return this.applyPluginServers(e,{})}async _applyConfigLocked(e){let{workspaceFolder:r,user:n,project:o}=e,s=sHs(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),Rt(this._ctx,"mcpGateway.applyConfig",{userChanged:String(c),hasProject:String(Object.keys(o).length>0)},{userServerCount:Object.keys(n).length,projectServerCount:Object.keys(o).length})}async _applyScope(e,r){let n=new Map,o=[];for(let[l,u]of Object.entries(r)){let d=uHs(l,u);if(!d){o.push(l);continue}n.set(TH({source:e,name:l}),{classified:d,hash:eJn(u)})}o.length>0&&OT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${lHs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)aHs(u.key.source,e)&&!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:e,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged(t4(e))}async _removeProjectLocked(e){let r=[];for(let[n,o]of this._entries)o.key.source.kind==="project"&&o.key.source.workspaceFolder===e&&r.push(n);if(r.length!==0)for(let n of r)await this._removeEntry(n)}serverAction(e,r){let n=TH(e),o=this._entries.get(n);if(!o)throw new IH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new IH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new IH("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(t4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(t4(n.key.source)),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:{...oHs},listeners:null};return this._entries.set(TH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=t4(r.key.source);await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged(n)}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(t4(r.key.source)));let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(n,r.key.name)}catch(o){throw OT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(TH(r.key)),await n.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(o=>{OT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(t4(r.key.source)),this._sender.serverDetailsChanged(r.key),ia(this._ctx,{message:"Connection state: Running",server:r.key.name})}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof She?(r.status="unauthorized",r.error=void 0,OT.warn(this._ctx,`server '${r.key.name}' requires authorization`),q2(this._ctx,{message:"Connection state: Unauthorized (authorization required)",server:r.key.name})):(r.status="error",r.error=o instanceof Error?o.message:String(o),OT.error(this._ctx,`server '${r.key.name}' failed to start`,o),md(this._ctx,{message:`Connection state: Error: ${r.error}`,server:r.key.name})),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(t4(r.key.source))}}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(TH(e.key)),this._sender.serversChanged(t4(e.key.source)),n&&(r==="stopped"&&ia(this._ctx,{message:"Connection state: Stopped",server:e.key.name}),await n.stop().catch(o=>{OT.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"),loggingMessage:a(o=>this._onUpstreamLog(e,o),"loggingMessage")};r.on(ul.ToolsListChanged,n.toolsChanged),r.on(ul.ResourcesListChanged,n.resourcesChanged),r.on(ul.PromptsListChanged,n.promptsChanged),r.on(ul.LoggingMessage,n.loggingMessage),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(ul.ToolsListChanged,n.toolsChanged),r.off(ul.ResourcesListChanged,n.resourcesChanged),r.off(ul.PromptsListChanged,n.promptsChanged),r.off(ul.LoggingMessage,n.loggingMessage)),e.listeners=null}_onUpstreamLog(e,r){let n=r.params.data,o=typeof n=="string"?n:JSON.stringify(n),s=r.params.logger?`${r.params.logger}: ${o}`:o,c=e.key.name;switch(r.params.level){case"warning":q2(this._ctx,{message:s,server:c});break;case"error":case"critical":case"alert":case"emergency":md(this._ctx,{message:s,server:c});break;default:ia(this._ctx,{message:s,server:c})}}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){OT.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=TH(e.key),o=e.key.name,s=a(c=>{md(this._ctx,{message:`Connection state: Error: ${c.message}`,server:o})},"onError");return r.kind==="stdio"?new UDe({id:n,label:o,params:r.params,clientInfo:{name:BDe,version:FDe},onStderr:a(c=>{q2(this._ctx,{message:`[server stderr] ${c.trimEnd()}`,server:o})},"onStderr"),onError:s}):new ODe({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:BDe,version:FDe},onError:s,authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:c})=>{OT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${c}, falling back to legacy SSE`),Rt(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(c)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(pm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await rKn(this._ctx,r,n);if(!s){OT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Vct(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){OT.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 Vct(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 Vct(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 nKn(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(t4(e.key.source)))}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=>OT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){OT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){OT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(t4(e.key.source))}};function TH(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(TH,"serializeKey");function eJn(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(eJn,"canonicalEntryHash");function sHs(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=eJn(t[n]);return JSON.stringify(r)}a(sHs,"canonicalConfigHash");function t4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(t4,"notificationScopeFor");function aHs(t,e){return t.kind!==e.kind?!1:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:t.kind==="plugin"&&e.kind==="plugin"?t.pluginId===e.pluginId:t.kind==="user"&&e.kind==="user"}a(aHs,"sameScope");function cHs(t,e){return e===void 0||t.kind==="user"||t.kind==="plugin"?!0:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:!1}a(cHs,"entryInScope");function lHs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(lHs,"describeScope");function uHs(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(uHs,"classifyEntry");p();var xdr=require("crypto"),tJn=require("events"),rJn=de(require("http"));var xH=new fe("mcpGateway"),dHs="mcp-session-id",fHs=1024*1024,pHs=5e3,nJn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},NX={MountsChanged:"mountsChanged"},wH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new tJn.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,xH.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),Rt(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(NX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=nJn.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,xdr.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 xH.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),Rt(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(NX.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),xH.info(this._ctx,`unregistered mount '${n.label}' (${e})`),Rt(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(NX.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")),pHs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),xH.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){xH.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:tR.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){xH.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(!oKn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,xdr.randomUUID)(),c=new LDe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&xH.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),xH.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(jct)}_getSessionId(e){let r=e.headers[dHs];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>fHs)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 wdr=new fe("BackgroundAgent.McpSync"),Kct=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(NT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(NX.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof Sl))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(NX.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(){if(this.registry.size()===0)return;let e;try{e=this.ctx.get(NT)}catch(r){r instanceof Sl||wdr.warn(this.ctx,"Failed to read MCP gateway host for active-session sync",{error:r instanceof Error?r.message:String(r)});return}wdr.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size()}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{let o=this.registry.getMcpDirectory(r)??this.registry.getWorkspaceFolderUri(r),s=e.buildMcpServers(o);try{await n.reloadMcpServers({mcpServers:s})}catch(c){wdr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}}))}};p();p();var Jct="/agents/sessions",Zct=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(Jct),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 iJn(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(`${Jct}/${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 iJn(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(`${Jct}/${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(`${Jct}/${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 iJn(t){try{return await t.text()}catch{return""}}a(iJn,"safeReadText");p();p();var Xct=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 hHs=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 oJn(t){return!(!t.type||hHs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(oJn,"shouldForwardMissionControlEvent");function Rdr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Rdr,"getMissionControlEventData");function sJn(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(sJn,"maybeAcknowledgeMissionControlCommandFromEvent");var lJn=require("node:crypto");var mHs=500,gHs=3e3,AHs=1e4,yHs=500,QDe=2e3,EHs=256,aJn=80,elt=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Xct({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 Z0n(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await X0n(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=vHs(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: ${MX(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: ${MX(A)}`)}try{icr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${MX(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}`))},mHs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},gHs),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{icr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${MX(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,lJn.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(!oJn(r))return;sJn(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:Rdr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Rdr(r))),e.eventBuffer.length>QDe&&e.eventBuffer.splice(0,e.eventBuffer.length-QDe)}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=_Hs(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>=EHs){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>QDe&&e.eventBuffer.splice(0,e.eventBuffer.length-QDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=AHs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,yHs);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<=QDe&&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: ${MX(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=cJn(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}): ${MX(c)}`)}return}case"ask_user_response":{let n=cJn(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}): ${MX(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 cJn(t){try{return JSON.parse(t)}catch{return}}a(cJn,"safeJsonParse");function MX(t){return t instanceof Error?t.message:String(t)}a(MX,"errMsg");function _Hs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>aJn?e.slice(0,aJn-1).trimEnd()+"\u2026":e:""}a(_Hs,"deriveTitleFromMessage");function vHs(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(vHs,"toVscodeUriShape");var kdr=new fe("BackgroundAgent.RemoteController"),tlt=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 Zct(this.ctx,kdr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new elt(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:kdr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!JGn(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=ocr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=ocr(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){kdr.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(Qt).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Lr).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 Pdr=new fe("BackgroundAgent.CustomAgents");async function rlt(t,e){try{if(Ft(t,Ye.EnableCustomAgents)===!1)return Pdr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Fd).listCustomAgents([e],{includePlugins:!0});return o.length>0&&Pdr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>CHs(s))}catch(r){return Pdr.warn(t,"Failed to load custom agents:",r),[]}}a(rlt,"loadCustomAgents");function CHs(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(CHs,"toSweCustomAgent");p();var Ddr=new fe("BackgroundAgent.Hooks"),Ndr="copilot-language-server";function uJn(t,e){return{preToolUse:[bHs(t,e)],postToolUse:[SHs(t,e)],userPromptSubmitted:[THs(t,e)]}}a(uJn,"buildSessionHooks");function bHs(t,e){return{source:Ndr,handler:a(async r=>{try{let o=await t.get(gE).hook(t,a2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:qDe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===ede.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){Ddr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(bHs,"createPreToolUseHandler");function SHs(t,e){return{source:Ndr,handler:a(async r=>{try{await t.get(gE).hook(t,s2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:qDe(r.toolArgs),toolResult:{resultType:Mdr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){Ddr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(SHs,"createPostToolUseHandler");function THs(t,e){return{source:Ndr,handler:a(async r=>{try{await t.get(gE).hook(t,c2,{timestamp:r.timestamp,cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){Ddr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(THs,"createUserPromptSubmittedHandler");function qDe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(qDe,"safeStringifyToolArgs");function Mdr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(Mdr,"toClsToolResultType");p();var IHs=["model-agents-md","cwd-model-agents-md"],xHs=["model-claude-md","cwd-model-claude-md"],wHs="nested-agents";function dJn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of IHs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of xHs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(wHs),e}a(dJn,"computeDisabledInstructionSources");var RHs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),kHs=2,PHs="CLAUDE.md",DHs="AGENTS.md";function NHs(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(NHs,"joinPath");async function MHs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(NHs(e,s))}catch{return}for(let[u,d]of l){let f=(d&1)!==0,h=(d&2)!==0;f&&u===r&&s.length>0?n.push([...s,r].join("/")):h&&co.content.trim().length>0);if(r.length===0)return;let n=r.map(o=>[`<${e}-instructions path="${o.relativePath}">`,o.content.trim(),``].join(` `));return[`Here are nested ${e} files that contain additional agent instructions.`,...n].join(` -`)}a(_Hs,"buildNestedInstructionsSection");async function aJn(t,e,r,n){let o=await EHs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return _Hs(s,n)}a(aJn,"scanNestedInstructionsSection");function cJn(t,e,r){return aJn(t,e,r,gHs)}a(cJn,"scanNestedClaudeInstructions");function lJn(t,e,r){return aJn(t,e,r,AHs)}a(lJn,"scanNestedAgentsInstructions");function uJn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.nestedAgentsInstructions&&e.push(t.nestedAgentsInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` +`)}a(OHs,"buildNestedInstructionsSection");async function fJn(t,e,r,n){let o=await MHs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return OHs(s,n)}a(fJn,"scanNestedInstructionsSection");function pJn(t,e,r){return fJn(t,e,r,PHs)}a(pJn,"scanNestedClaudeInstructions");function hJn(t,e,r){return fJn(t,e,r,DHs)}a(hJn,"scanNestedAgentsInstructions");function mJn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.nestedAgentsInstructions&&e.push(t.nestedAgentsInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` -`)}a(uJn,"composeBackgroundAgentSystemMessage");p();p();p();p();var UDe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(UDe||{});var MX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(MX||{});p();p();var OX=require("fs"),whe=de(require("path"));var vHs=32,CHs=5e3,bHs=5*1024*1024,SHs=32,THs=xtn(SHs);async function MT(t,e){return THs.run(()=>o3(t(),CHs,e))}a(MT,"boundedFsOp");async function Pdr(t){let e=await MT(()=>OX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(Pdr,"statEntry");async function QDe(t){let e=await MT(()=>OX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?vx(e,vHs,async r=>{let n=whe.join(t,r.name);if(r.isSymbolicLink()){let o=await Pdr(n);return{path:n,isFile:o?.isFile??!1,isDirectory:o?.isDirectory??!1,isSymlink:!0}}return{path:n,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:!1}}):[]}a(QDe,"readChildren");var dJn=process.platform==="linux";function wE(t,e){let r=dJn?t:t.toLowerCase(),n=dJn?e:e.toLowerCase(),o=whe.relative(r,n);return o===""||!o.startsWith("..")&&!whe.isAbsolute(o)}a(wE,"isAtOrUnder");async function eR(t,e){if(t===void 0)return!0;let r=await MT(()=>OX.promises.realpath(e),void 0);return r!==void 0&&wE(t,r)}a(eR,"withinRealBoundary");async function LX(t){if(t!==void 0)return MT(()=>OX.promises.realpath(t),t)}a(LX,"resolveRealBoundary");async function Jct(t){let e=await MT(()=>OX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>bHs))return MT(()=>OX.promises.readFile(t,"utf8"),void 0)}a(Jct,"readTextFileCapped");var fJn=require("fs"),Ddr=de(require("path"));function OT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(OT,"sanitizeCacheSegment");function Rhe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(Rhe,"refCacheSegment");function Zct(t,e){return e?[`sha_${encodeURIComponent(e)}`]:Rhe(t)}a(Zct,"gitRevisionCacheSuffix");function pJn(t,e,r){try{let n=new URL(t),o=OT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(OT):[];return[o,...c,...Zct(e,r)]}catch{return["git",OT(t),...Zct(e,r)]}}a(pJn,"gitUrlToCacheSegments");async function Wd(t){return MT(()=>fJn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Wd,"exists");function qDe(t,e){let r=Ddr.join(t,...e);if(!wE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(qDe,"joinCacheSegments");function jDe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Ddr.join(t,r);return wE(t,n)?n:t}a(jDe,"joinContained");var Xct=require("node:url");function hJn(t){let e=new Map;for(let r of t){let n=LT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(hJn,"parseMarketplaceReferences");function LT(t){let e=t.trim();if(e)return xHs(e)??wHs(e)??IHs(e)}a(LT,"parseMarketplaceReference");function IHs(t){let e=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:#(.+))?$/.exec(t);if(!e)return;let[,r,n,o]=e;return{rawValue:t,displayLabel:t,cloneUrl:`https://github.com/${r}/${n}.git`,canonicalId:gJn(r,n,o),cacheSegments:["github.com",OT(r),OT(n),...Rhe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(IHs,"parseShorthandMarketplaceReference");function xHs(t){let e;try{e=new URL(t)}catch{return}let r=e.protocol.replace(/:$/,"").toLowerCase();if(r==="file"&&/^file:\/\//i.test(t)){if(e.hash)return;let y;try{y=(0,Xct.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,Xct.pathToFileURL)(y).toString().toLowerCase()}`,cacheSegments:[],kind:"localFileUri",localRepositoryUri:y}}if(r!=="http"&&r!=="https"&&r!=="ssh"||!e.host)return;let n=e.hash?e.hash.slice(1):void 0,o=RHs(e),s=e.host.toLowerCase(),c=OT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Ndr(`git:${s}/`,n),cacheSegments:[c,...Rhe(n)],kind:"gitUri",ref:n};let u=".git",d=l.toLowerCase().endsWith(u),f=d?l.slice(0,-u.length):l,h=f.split("/").map(OT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=mJn(s,f),A=AJn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...Rhe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(xHs,"parseUriMarketplaceReference");function wHs(t){let e=/^([^@\s]+)@([^:\s]+):(.+?\.git)(?:#(.+))?$/i.exec(t);if(!e)return;let r=".git",[,n,o,s,c]=e,l=s.replace(/^\/+/,"");if(!l.toLowerCase().endsWith(r))return;let u=l.slice(0,-r.length),d=u.split("/").map(OT),f=mJn(o,u),h=AJn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[OT(o.toLowerCase()),...d,...Rhe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(wHs,"parseScpMarketplaceReference");function RHs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(RHs,"refStrippedUrl");function mJn(t,e){if(t.toLowerCase()!=="github.com")return;let r=e.split("/");if(r.length>=2&&r[0]&&r[1])return`${r[0]}/${r[1]}`}a(mJn,"extractGitHubRepo");function gJn(t,e,r){return Ndr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(gJn,"getGitHubCanonicalId");function AJn(t,e,r){if(t){let[n,o]=t.split("/");return gJn(n,o,e)}return Ndr(r,e)}a(AJn,"gitCanonicalId");function Ndr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Ndr,"appendRefSuffix");p();p();p();p();function yJn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(yJn,"untildify");var kHs=200;function elt(t,e){return Mdr(t,e,new Set,0)}a(elt,"cloneAndChange");function Mdr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=kHs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>Mdr(s,e,r,n+1));if(typeof t=="object"){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let s={};for(let c of Object.keys(t))s[c]=Mdr(t[c],e,r,n+1);return r.delete(t),s}return t}a(Mdr,"cloneAndChangeInner");function HDe(t,e=!1){if(!t||typeof t!="object")return;let r={};for(let[n,o]of Object.entries(t))typeof o=="string"?r[n]=o:e&&typeof o=="number"&&(r[n]=String(o));return Object.keys(r).length>0?r:void 0}a(HDe,"toStringRecord");var tlt=de(require("path"));var DHs=/[\s&|<>()^;!`"'$]/;function NHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(NHs,"escapeWindowsDoubleQuoted");function MHs(t,e,r){if(!t.includes(r))return t;if(!DHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Toe(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?NHs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(MHs,"shellQuotePluginRootInCommand");var OHs={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"};function LHs(t){if(t.type!==void 0&&t.type!=="command")return;let e=a(f=>typeof f=="string"&&f.length>0?f:void 0,"str"),r=e(t.command),n=e(t.bash),o=e(t.powershell),s=e(t.windows)??o,c=e(t.linux)??n,l=e(t.osx)??n;if(!r&&!s&&!c&&!l)return;let u=typeof t.timeout=="number"?t.timeout:typeof t.timeoutSec=="number"?t.timeoutSec:void 0,d=HDe(t.env,!0);return{...r&&{command:r},...s&&{windows:s},...c&&{linux:c},...l&&{osx:l},...d&&{env:d},...u!==void 0&&{timeout:u}}}a(LHs,"normalizeHookCommand");function EJn(t,e){let r=LHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=yJn(o,e);n=tlt.isAbsolute(s)?tlt.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(EJn,"resolveHookCommand");function BHs(t,e){if(!t||typeof t!="object")return[];let r=t,n=[],o=r.hooks;if(Array.isArray(o)){for(let s of o)if(s&&typeof s=="object"){let c=EJn(s,e);c&&n.push(c)}}else{let s=EJn(r,e);s&&n.push(s)}return n}a(BHs,"extractHookCommands");function Ldr(t,e,r){if(!e||typeof e!="object")return[];let n=e;if(n.disableAllHooks===!0)return[];let o=n.hooks;if(!o||typeof o!="object")return[];let s=o,c=[];for(let l of Object.keys(s)){let u=OHs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...BHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Ldr,"parseHooksJson");function Odr(t,e,r){if(Array.isArray(t)){let n=t;for(let o=0;o{for(let d of["command","windows","linux","osx"]){let f=u[d];typeof f=="string"&&(u[d]=MHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=elt(e,()=>{});for(let d of Object.values(u.hooks??{}))if(Array.isArray(d))for(let f of d){if(!f||typeof f!="object")continue;let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)m&&typeof m=="object"&&l(m);else l(h)}return Odr(u,o,c),Ldr(t,u,n)}catch{return[]}}a(Bdr,"interpolateHookPluginRoot");p();var Ydr=require("fs");zdr();function YDe(t){try{return Wdr(t)}catch{return}}a(YDe,"parseJsonc");async function Nhe(t,e){let r=await MT(()=>Ydr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await MT(()=>Ydr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return YDe(n)}a(Nhe,"readJsoncFile");var IH=de(require("path"));var iGs={format:0,manifestPath:"plugin.json",altManifestPaths:[".github/plugin/plugin.json"],hookConfigPath:"hooks.json",altHookConfigPaths:["hooks/hooks.json"],pluginRootToken:void 0,pluginRootEnvVar:void 0,parseHooks(t,e,r,n){return Ldr(t,e,n)}},oGs={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${CLAUDE_PLUGIN_ROOT}",pluginRootEnvVar:"CLAUDE_PLUGIN_ROOT",parseHooks(t,e,r,n){return Bdr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},sGs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return Bdr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function PJn(t){return await Wd(IH.join(t,".plugin","plugin.json"))?sGs:t.split(/[/\\]/).includes(".claude")||await Wd(IH.join(t,".claude-plugin","plugin.json"))?oGs:iGs}a(PJn,"detectPluginFormat");async function DJn(t,e,r){let n=await LX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=IH.join(t,o);if(!await eR(n,s))continue;let c=await Jct(s),l=c===void 0?void 0:YDe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(DJn,"readPluginManifest");function NJn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(NJn,"defaultHookConfigPaths");var Kdr={paths:[],exclusive:!1};function Mhe(t){if(t==null)return Kdr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:Kdr}if(Array.isArray(t))return{paths:kJn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:kJn(e.paths),exclusive:e.exclusive===!0}}return Kdr}a(Mhe,"parseComponentPathConfig");function kJn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(kJn,"cleanPaths");function alt(t,e,r,n){let o=n&&wE(n,t)?n:t,s=[];r.exclusive||s.push(IH.join(t,e));for(let c of r.paths){let l=IH.normalize(IH.join(t,c));wE(o,l)&&s.push(l)}return s}a(alt,"resolveComponentDirs");p();p();var FT=de(require("path"));var aGs=new dO,clt=16,MJn=".md",cGs=[".instructions.md",".mdc",".md"];async function lGs(t){let e=FT.basename(t).replace(/(\.agent)?\.md$/i,"");return OJn(t,e)}a(lGs,"parseAgentFile");async function uGs(t){return OJn(t,FT.basename(FT.dirname(t)))}a(uGs,"parseSkillFile");async function OJn(t,e){let r=await Jct(t);if(r===void 0)return{name:e};try{let n=aGs.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(OJn,"readNameDescription");async function LJn(t,e,r){let n=await LX(r),s=(await vx(e,clt,async d=>{if(!await eR(n,d))return[];let f=FT.join(d,"SKILL.md");if(await Wd(f)&&await eR(n,f))return[f];let h=(await QDe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await vx(h,clt,async g=>{if(g.isSymlink&&!await eR(n,g.path))return;let A=FT.join(g.path,"SKILL.md");if(!(!await Wd(A)||!await eR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=FT.join(t,"SKILL.md");await Wd(d)&&await eR(n,d)&&s.push(d)}let c=await vx(s,clt,async d=>({uri:d,...await uGs(d)})),l=new Set,u=[];for(let{uri:d,name:f,description:h}of c)l.has(d)||(l.add(d),u.push({uri:d,name:f,...h&&{description:h}}));return u.sort((d,f)=>d.name.localeCompare(f.name)),u}a(LJn,"readSkills");async function BJn(t,e,r){let n=await LX(r),o=new Set,s=[],c=a(l=>{let u=e(l);u&&!o.has(u)&&(o.add(u),s.push({uri:l,name:u}))},"addItem");for(let l of t){if(!await eR(n,l))continue;let u=await Pdr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await QDe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await eR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(BJn,"scanComponentFiles");function dGs(t){return FT.extname(t).toLowerCase()===MJn?FT.basename(t).slice(0,-MJn.length):void 0}a(dGs,"getMarkdownComponentName");function Jdr(t,e){return BJn(t,dGs,e)}a(Jdr,"readMarkdownComponents");async function FJn(t,e){let r=await Jdr(t,e);if(r.length===0)return r;let n=await vx(r,clt,async c=>{let{name:l,description:u}=await lGs(c.uri);return{uri:c.uri,name:l||c.name,...u&&{description:u}}}),o=new Set,s=n.filter(c=>o.has(c.name)?!1:(o.add(c.name),!0));return s.sort((c,l)=>c.name.localeCompare(l.name)),s}a(FJn,"readAgentComponents");function fGs(t){let e=FT.basename(t),r=e.toLowerCase(),n=cGs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(fGs,"getInstructionFileName");function UJn(t,e){return BJn(t,fGs,e)}a(UJn,"readInstructionComponents");p();function pGs(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Object.hasOwn(e,"mcpServers")){let r=e.mcpServers;return!r||typeof r!="object"||Array.isArray(r)?void 0:r}return e}a(pGs,"resolveMcpServersMap");function hGs(t){if(!t||typeof t!="object")return;let e=t,r=a(h=>typeof h=="string"&&h.trim()?h.trim():void 0,"str"),n=r(e.type),o=r(e.command),s=r(e.url),c=Array.isArray(e.args)?e.args.filter(h=>typeof h=="string"):void 0,l=HDe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=HDe(e.headers);if(n!=="ws"){if(n==="stdio"||!n&&o)return o?{type:"stdio",command:o,...c&&{args:c},...l&&{env:l},...d!==void 0&&{cwd:d},...u!==void 0&&{envFile:u}}:void 0;if(n==="http"||n==="sse"||!n&&s)return s?{type:"http",url:s,...f&&{headers:f}}:void 0}}a(hGs,"normalizeMcpServerConfiguration");function mGs(t,e,r,n){let o=a(l=>l.replaceAll(r,()=>e),"replace"),s=t.configuration,c;if(s.type==="stdio"){let l={};for(let[u,d]of Object.entries(s.env??{}))l[u]=o(d);l[n]=e,c={type:"stdio",command:o(s.command),...s.args&&{args:s.args.map(o)},env:l,...s.cwd!==void 0&&{cwd:o(s.cwd)},...s.envFile!==void 0&&{envFile:o(s.envFile)}}}else c={type:"http",url:o(s.url),...s.headers&&{headers:Object.fromEntries(Object.entries(s.headers).map(([l,u])=>[l,o(u)]))}};return{name:t.name,configuration:c,uri:t.uri}}a(mGs,"interpolateMcpPluginRoot");var gGs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function AGs(t){return elt(t,e=>{if(typeof e=="string"){let r=e.replace(gGs,"${env:$1}");return r!==e?r:void 0}})}a(AGs,"convertBareEnvVarsToVsCodeSyntax");function Zdr(t,e,r,n){let o=pGs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=hGs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=mGs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=AGs(d),s.push(d)}return s}a(Zdr,"parseMcpServerDefinitionMap");p();var UX=require("fs"),Rb=de(require("path"));var efr=".copilot",tfr="installed-plugins",Mkf=Rb.join(efr,tfr),QJn="config.json",llt=5e3,ult=16,rfr=5*1024*1024;async function Ohe(t){return MT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(Ohe,"boundedFsResult");function Xdr(t){return t==="ENOENT"||t==="ENOTDIR"}a(Xdr,"isAbsentCode");async function qJn(t){let e=await Ohe(()=>UX.promises.stat(Rb.dirname(t)));return e.ok&&e.value.isDirectory()}a(qJn,"parentDirSurvives");async function nfr(t){let e=await Ohe(()=>UX.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:qJn(t)}a(nfr,"isDefinitivelyGone");var yGs={name:"marketplace",discover:_Gs},EGs={name:"copilotCli",discover:vGs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([QJn]),createDir:!1,listing:a(t=>CGs(t.copilotHome),"listing")}},Lhe=[yGs,EGs];async function jJn(t){let e=await Promise.all(Lhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=lg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(jJn,"discoverPlugins");async function _Gs(t){return(await vx(t.installed,ult,async r=>{let n;if(Rb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=Rb.resolve(t.sharedContentDir,r.pluginUri);if(!wE(t.sharedContentDir,u))return;n=u}let o=await Ohe(()=>UX.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await qJn(n))return;let s=LT(r.marketplace),c;if(s)try{c=t.getRepositoryUri(s)}catch{c=void 0}let l=await t.resolveMarketplace(r);return{uri:r.pluginUri,fsPath:n,displayName:r.name,readOnly:ifr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(_Gs,"discoverMarketplace");async function vGs(t){return(await HJn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(vGs,"discoverCopilotCli");async function HJn(t){return o3(bGs(t),llt,void 0)}a(HJn,"listCopilotCliInstalls");async function CGs(t){return(await HJn(t))?.map(e=>e.fsPath)}a(CGs,"listCopilotCliPluginDirs");async function bGs(t){let e=Rb.join(t,tfr),[r,n]=await Promise.all([SGs(t),TGs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&Rb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?Rb.join(e,u.marketplace,u.name):void 0);f!==void 0&&o.push({fsPath:f,...u.name!==void 0&&{displayName:u.name}})}let s=await vx(o,ult,async u=>await nfr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=lg(u.fsPath);l.has(d)||(l.add(d),c.push({fsPath:u.fsPath,...u.displayName!==void 0&&{displayName:u.displayName}}))}for(let u of n??[]){let d=lg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(bGs,"collectCopilotCliInstalls");async function SGs(t){let e=Rb.join(t,QJn),r=await Ohe(()=>UX.promises.stat(e));if(!r.ok)return Xdr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>rfr)return;let n=await Ohe(()=>UX.promises.readFile(e,"utf8"));if(!n.ok)return Xdr(n.code)?[]:void 0;let o=n.value,s;try{s=JSON.parse(o)}catch{return}let c=s?.installedPlugins;if(!Array.isArray(c))return[];let l=[];for(let u of c){if(u===null||typeof u!="object")continue;let d=u;l.push({name:typeof d.name=="string"?d.name:void 0,marketplace:typeof d.marketplace=="string"?d.marketplace:void 0,cachePath:typeof d.cache_path=="string"?d.cache_path:void 0})}return l}a(SGs,"readCliInstalledPlugins");async function TGs(t){let e=await Ohe(()=>UX.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return Xdr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await QDe(Rb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(TGs,"scanCopilotCliPluginDirs");function ifr(t,e){return wE(Rb.join(e,tfr),t)}a(ifr,"isCopilotCliPath");var ofr=de(require("path"));var IGs="commands",xGs="skills",wGs="agents",RGs="rules",kGs=".mcp.json";async function $Jn(t,e,r){let n=r.repositoryBoundary,o=n&&wE(n,t)?n:t,s=await LX(o),c=await DJn(t,e,s),l=c?.manifest,u=c?.manifestUri??ofr.join(t,e.manifestPath),d=a((v,b)=>alt(t,b,Mhe(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([Jdr(d("commands",IGs),s),LJn(t,d("skills",xGs),s),FJn(d("agents",wGs),s),UJn(d("rules",RGs),s),PGs(t,l,u,e,n,s,r),NGs(t,l,u,e,n,s)]),E=l?.name,_=typeof E=="string"&&E.trim()?E.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,..._&&{manifestName:_}}}a($Jn,"readPluginContributions");function dlt(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(dlt,"isEmbeddedSection");async function VJn(t,e){if(await eR(e,t))return Nhe(t,rfr)}a(VJn,"readJsoncWithinBoundary");async function PGs(t,e,r,n,o,s,c){let l=e?.hooks;if(dlt(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=GJn(n,r,h,t,c);if(m.length>0)return m}let u=dlt(l)?Mhe(void 0):Mhe(l),d=DGs(t,n,u,o);for(let f of d){let h=await VJn(f,s);if(h)return GJn(n,f,h,t,c)}return[]}a(PGs,"readHooks");function GJn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(GJn,"parseHooksSafely");function DGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of NJn(e))o.push(ofr.join(t,s));for(let s of alt(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(DGs,"resolveHookConfigPaths");async function NGs(t,e,r,n,o,s){let c=new Map,l=a(d=>{for(let f of d)c.has(f.name)||c.set(f.name,f)},"add"),u=e?.mcpServers;if(dlt(u)&&l(Zdr(r,{mcpServers:u},t,n)),c.size===0){let d=dlt(u)?Mhe(void 0):Mhe(u),f=alt(t,kGs,d,o);for(let h of f){let m=await VJn(h,s);m&&l(Zdr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(NGs,"readMcpServers");p();function KDe(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(KDe,"redactUrlCredentials");var xH=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},flt=class extends xH{static{a(this,"PluginSourceNotSupportedError")}constructor(e){let r={kind:"pluginSourceNotSupported",sourceKind:e};super(`Plugin source kind '${e}' is not supported in this environment`,r),this.name="PluginSourceNotSupportedError"}},Bhe=class extends xH{static{a(this,"PluginCloneError")}constructor(e,r){let n=KDe(e),o=KDe(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(`Failed to clone plugin source '${n}': ${o}`,s),this.name="PluginCloneError"}},Fhe=class extends xH{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},Uhe=class extends xH{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=KDe(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};p();var WJn=require("fs"),sfr=de(require("path"));var MGs=new Set(["installed.json","enablement.json"]);function afr(t){return(e,r)=>{let n=lg(e.path);return sfr.posix.dirname(n)===r&&t.has(sfr.posix.basename(n))}}a(afr,"matchNamedFiles");var zJn=afr(MGs),JDe=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new fe("PluginFileWatcher");this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=lg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??Bze(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await WJn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Wd(this.dir))return;if(this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:this._recursive})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin dir",{dir:this.dir,err:String(e)})}}onEvents(e){this._disposed||e.some(r=>this._matches(r,this._dirKey))&&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();var YJn=require("fs"),KJn=de(require("path"));var OGs=new fe("plugins.git"),LGs=12e4,plt=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=KJn.dirname(r);await YJn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw OGs.warn(this.ctx,`clone failed for ${KDe(e)}`,o),new Bhe(e,o)}}async checkout(e,r,n){await(await this.instanceFor(e)).checkout(n?["--detach",r]:[r])}async pull(e){if(!await this.isOnBranch(e))return!1;let r=await this.instanceFor(e),n=await this.revParse(e,"HEAD").catch(()=>{});await r.pull();let o=await this.revParse(e,"HEAD").catch(()=>{});return n!==o}async isOnBranch(e){let n=(await(await this.instanceFor(e)).raw(["rev-parse","--abbrev-ref","HEAD"])).trim();return n!==""&&n!=="HEAD"}async revParse(e,r){return(await(await this.instanceFor(e)).revparse([r])).trim()}async fetch(e){await(await this.instanceFor(e)).fetch()}async revListCount(e,r,n){let s=(await(await this.instanceFor(e)).raw(["rev-list","--count",`${r}..${n}`])).trim(),c=Number.parseInt(s,10);return Number.isFinite(c)?c:0}async instanceFor(e){let r=this.gitInstances.get(e);return r||(this._binary===void 0&&(this._binary=(await lO()).path),r=Gue({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:LGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var hlt=class{constructor(e,r){this.repository=e;this.marketplace=r}static{a(this,"PluginInstallService")}async acquirePlugin(e){let r=await this.repository.ensurePluginSource(e);if(!await Wd(r))throw new Bhe(e.marketplaceReference.cloneUrl,"plugin content not found after acquisition");return r}async resolveFromSource(e){let r=await this.repository.ensureRepository(e),n=await this.marketplace.readPluginsFromDirectory(r,e);if(n.length>0)return{reference:e,plugins:n,isSinglePluginRepo:!1};let o=await this.marketplace.readSinglePluginManifest(r,e);return o?{reference:e,plugins:[o],isSinglePluginRepo:!0}:{reference:e,plugins:[],isSinglePluginRepo:!1}}async resolveInstalled(e){let r=LT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Wd(n)){let s=(await this.marketplace.readPluginsFromDirectory(n,r)).find(l=>l.name===e.name);if(s)return s;let c=await this.marketplace.readSinglePluginManifest(n,r);if(c)return c}if(r.kind==="githubShorthand"&&r.githubRepo)return JJn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return JJn({kind:"url",url:r.cloneUrl},r,e.name)}};function JJn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(JJn,"synthesizePlugin");p();p();var BGs=new fe("plugins.catalog");function cfr(t,e,r,n){return Array.isArray(t.plugins)?t.plugins.filter(s=>s!=null&&typeof s.name=="string"&&s.name.length>0).flatMap(s=>{let c=s.name,l=FGs(s.source,t.metadata?.pluginRoot,c,n);return l?[{name:c,description:typeof s.description=="string"?s.description:"",version:typeof s.version=="string"?s.version:"",sourceDescriptor:l,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:r}]:[]}):[]}a(cfr,"parseMarketplaceCatalog");function FGs(t,e,r,n){let o=a(s=>{n&&BGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=UGs(typeof e=="string"?e:void 0,t??"");return c===void 0?o("could not resolve relative source path"):{kind:"relativePath",path:c}}if(typeof t!="object"||typeof t.source!="string")return o("source object is missing a 'source' discriminant");switch(t.source){case"github":return typeof t.repo!="string"||!t.repo?o("github source is missing required 'repo' field"):qGs(t.repo)?!Qhe(t.ref)||!Qhe(t.path)?o("github source 'ref'/'path' must be strings when provided"):XJn(t.sha)?{kind:"github",repo:t.repo,ref:t.ref,sha:t.sha,path:t.path}:o("github source 'sha' must be a 40-character commit hash when provided"):o("github source 'repo' must be in 'owner/repo' format");case"url":case"git-subdir":return typeof t.url!="string"||!t.url?o(`${t.source} source is missing required 'url' field`):t.source==="url"&&!t.url.toLowerCase().endsWith(".git")?o("url source must end with '.git'"):Qhe(t.ref)?XJn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!Qhe(t.path)?o("url source 'path' must be a string when provided"):{kind:"url",url:t.url,ref:t.ref,sha:t.sha,path:t.path}:o(`${t.source} source 'sha' must be a 40-character commit hash when provided`):o(`${t.source} source 'ref' must be a string when provided`);case"npm":case"pip":return typeof t.package!="string"||!t.package?o(`${t.source} source is missing required 'package' field`):!Qhe(t.version)||!Qhe(t.registry)?o(`${t.source} source 'version'/'registry' must be strings when provided`):{kind:t.source==="npm"?"npm":"pip",package:t.package,version:t.version,registry:t.registry};default:return o(`unknown source kind '${t.source}'`)}}a(FGs,"parsePluginSource");function UGs(t,e){let r=ZJn(t??""),n=ZJn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:QGs(`/${r}/${n}`).replace(/^\/+/,"")}a(UGs,"resolvePluginSource");function ZJn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(ZJn,"normalizeMarketplacePath");function QGs(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(QGs,"posixNormalize");function Qhe(t){return t===void 0||typeof t=="string"}a(Qhe,"isOptionalString");function XJn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(XJn,"isOptionalGitSha");function qGs(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(qGs,"isValidGitHubRepo");var XDe=de(require("path"));var qhe=new fe("plugins.marketplace"),jGs=480*60*1e3,HGs=3e4,GGs=15e4,eZn=[{type:"openPlugin",path:"marketplace.json"},{type:"openPlugin",path:".plugin/marketplace.json"},{type:"copilot",path:".github/plugin/marketplace.json"},{type:"claude",path:".claude-plugin/marketplace.json"}],$Gs=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],mlt=class{constructor(e,r){this.ctx=e;this.repository=r;this.githubCatalogCache=new Map}static{a(this,"PluginMarketplaceService")}async fetchMarketplacePlugins(e,r){let n=await Promise.all(e.map(o=>this.fetchOneBounded(o,r)));return{plugins:n.flatMap(o=>o.plugins),errors:n.flatMap(o=>o.error?[o.error]:[])}}fetchOneBounded(e,r){let n=e.kind==="githubShorthand"&&e.githubRepo?this.fetchFromGitHubRepo(e,e.githubRepo,r):this.fetchFromClonedRepo(e,r);return this.withReferenceDeadline(n,e,r)}withReferenceDeadline(e,r,n){return new Promise(o=>{let s=!1,c=a(d=>{s||(s=!0,clearTimeout(l),u?.dispose(),o(d))},"finish"),l=setTimeout(()=>{qhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:WGs(r)})},GGs);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:tZn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return Nhe(XDe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of eZn){if(n?.isCancellationRequested)return[];let c=await Nhe(XDe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of cfr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,rZn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of $Gs){let o=await Nhe(XDe.join(e,n.path));if(!o||typeof o!="object"||Array.isArray(o))continue;let s=r.kind==="githubShorthand"?{kind:"github",repo:r.githubRepo}:{kind:"url",url:r.cloneUrl};return{name:typeof o.name=="string"&&o.name?o.name:r.displayLabel,description:typeof o.description=="string"?o.description:"",version:typeof o.version=="string"?o.version:"",sourceDescriptor:s,marketplace:r.displayLabel,marketplaceReference:r,marketplaceType:n.type,readmeUri:r.githubRepo?oZn(r.githubRepo,""):iZn(e,"")}}qhe.debug(this.ctx,"no single-plugin manifest found",{reference:r.rawValue})}}clearCache(){this.githubCatalogCache.clear()}async fetchFromGitHubRepo(e,r,n){let o=this.getCachedCatalog(e.canonicalId);if(o)return{plugins:o.map(d=>zGs(d,e))};let s=!0,c,l=encodeURIComponent(e.ref??"main"),u=await this.readPluginsFromDefinitions(e,async d=>{if(n?.isCancellationRequested)return;let f=`https://raw.githubusercontent.com/${r}/${l}/${d}`,h=VGs(n);try{let m=await this.ctx.get(tr).fetch(f,{method:"GET",timeout:HGs,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return YDe(await m.text())}catch(m){qhe.debug(this.ctx,"raw marketplace fetch failed",{url:f,err:String(m)});return}finally{h.dispose()}});return u.length>0?(this.setCachedCatalog(e.canonicalId,u),{plugins:u}):s?(qhe.debug(this.ctx,"repo may be private; falling back to clone",{repo:r}),this.fetchFromClonedRepo(e,n)):c!==void 0?{plugins:[],error:{reference:e.displayLabel,canonicalId:e.canonicalId,kind:"unavailable",status:c,message:`Marketplace '${e.displayLabel}' is temporarily unavailable (HTTP ${c})`}}:{plugins:[]}}async fetchFromClonedRepo(e,r){if(r?.isCancellationRequested)return{plugins:[]};let n;try{n=await this.repository.ensureRepository(e)}catch(o){return qhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:tZn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of eZn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return cfr(s,e,o.type,this.ctx).map(c=>rZn(c,n))}return qhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(Cx).now().getTime()}getCachedCatalog(e){let r=this.githubCatalogCache.get(e);if(r){if(r.expiresAt<=this.now()){this.githubCatalogCache.delete(e);return}return r.plugins}}setCachedCatalog(e,r){this.githubCatalogCache.set(e,{plugins:r,expiresAt:this.now()+jGs})}};function VGs(t){let e={dispose(){}};if(!t)return e;let r=new AbortController;if(t.isCancellationRequested)return r.abort(),{signal:r.signal,...e};let n=t.onCancellationRequested(()=>r.abort());return{signal:r.signal,dispose:a(()=>n.dispose(),"dispose")}}a(VGs,"abortSignalFor");function WGs(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(WGs,"deadlineError");function tZn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof Fhe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(tZn,"toFetchError");function zGs(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(zGs,"restamp");function rZn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?iZn(e,r):oZn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(rZn,"withReadme");function nZn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(nZn,"readmeRelPath");function iZn(t,e){return XDe.join(t,nZn(e))}a(iZn,"fileReadmeUri");function oZn(t,e){return`https://github.com/${t}/blob/main/${nZn(e)}`}a(oZn,"githubBlobReadmeUri");p();p();var jhe=require("fs"),sZn=de(require("path"));var YGs=1e4,KGs=3e4,JGs=25;async function Hhe(t,e){await jhe.promises.mkdir(sZn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+KGs;for(;;)try{await jhe.promises.writeFile(t,`${process.pid} -`,{flag:"wx",mode:384});break}catch(n){if(n.code!=="EEXIST")throw n;if(Date.now()>r)throw new Error(`withFileLock: timed out acquiring lock ${JSON.stringify(t)}`);await ZGs(t)>YGs&&await jhe.promises.rm(t,{force:!0}).catch(()=>{}),await bC(JGs)}try{return await e()}finally{await jhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(Hhe,"withFileLock");async function ZGs(t){try{let e=await jhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(ZGs,"lockAgeMs");p();var Ghe=require("fs"),QX=de(require("path"));var XGs=new fe("plugins.source"),e$s=0,aZn=".clone-tmp";function t$s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(t$s,"isProcessAlive");async function r$s(t){let e=QX.dirname(t),r=`${QX.basename(t)}.`,n;try{n=await Ghe.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(aZn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||t$s(s)||await Ghe.promises.rm(QX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(r$s,"sweepOrphanedCloneTemps");async function lfr(t,e,r,n,o){if(await Wd(r))return;await r$s(r);let s=`${r}.${process.pid}.${e$s++}${aZn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await Hhe(`${r}.lock`,async()=>{await Wd(r)||(await Ghe.promises.mkdir(QX.dirname(r),{recursive:!0,mode:448}),await Ghe.promises.rename(s,r))})}finally{t.git.forget(s),await Ghe.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(lfr,"cloneIntoPlace");var glt=class{constructor(){this.kind="relativePath"}static{a(this,"RelativePathPluginSource")}getInstallUri(){throw new Error("Use PluginRepositoryService.getPluginInstallUri() for relative-path sources")}ensure(){throw new Error("Use PluginRepositoryService.ensureRepository() for relative-path sources")}update(){throw new Error("Use PluginRepositoryService.pullRepository() for relative-path sources")}getCleanupTarget(){}getLabel(e){return e.path||"."}},Alt=class{constructor(e){this.deps=e}static{a(this,"AbstractGitPluginSource")}getCleanupTarget(e,r){return this.getRepoDir(e,r)}async ensure(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);return await Wd(o)?await this.checkoutRevision(o,n):await lfr(this.deps,this.cloneUrl(n),o,n.ref,n.sha),this.getInstallUri(e,n)}async update(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);if(!await Wd(o))return XGs.warn(this.deps.ctx,`cannot update '${r.name}': source repository not cloned`,{repoDir:o}),!1;if(!n.sha&&await this.deps.git.isOnBranch(o)){let l=await this.deps.git.pull(o);return await this.checkoutRevision(o,n),l}let s=await this.deps.git.revParse(o,"HEAD").catch(()=>{});await this.deps.git.fetch(o),await this.checkoutRevision(o,n);let c=await this.deps.git.revParse(o,"HEAD").catch(()=>{});return s!==c}async checkoutRevision(e,r){r.sha?await this.deps.git.checkout(e,r.sha,!0):r.ref&&await this.deps.git.checkout(e,r.ref)}},ylt=class extends Alt{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return jDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return qDe(r,["github.com",OT(s),OT(c),...Zct(o.ref,o.sha)])}getLabel(r){let n=r;return n.path?`${n.repo}/${n.path}`:n.repo}cloneUrl(r){return`https://github.com/${r.repo}.git`}},Elt=class extends Alt{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return jDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return qDe(r,pJn(o.url,o.ref,o.sha))}getLabel(r){let n=r;return n.path?`${n.url}/${n.path}`:n.url}cloneUrl(r){return r.url}};var eNe=require("fs"),qX=de(require("path"));var n$s=0,_lt=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new fe("plugins.repository");this.cloneSequencer=new Vx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new glt],["github",new ylt(o)],["url",new Elt(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new flt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:qDe(this.cacheRoot,e.cacheSegments)}getPluginInstallUri(e){let r=e.sourceDescriptor;if(r.kind!=="relativePath")return this.getPluginSourceInstallUri(r);let n=this.getRepositoryUri(e.marketplaceReference);return jDe(n,r.path)}getPluginSourceInstallUri(e){return this.getPluginSource(e.kind).getInstallUri(this.cacheRoot,e)}async ensureRepository(e){let r=this.getRepositoryUri(e);return this.cloneSequencer.queue(r,async()=>{if(await Wd(r))return r;if(e.kind==="localFileUri")throw new Fhe(r);return await lfr({ctx:this.ctx,git:this.git},e.cloneUrl,r,e.ref),r})}async ensurePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?(await this.ensureRepository(e.marketplaceReference),this.getPluginInstallUri(e)):this.getPluginSource(e.sourceDescriptor.kind).ensure(this.cacheRoot,e)}async updatePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?this.pullRepository(e.marketplaceReference):this.getPluginSource(e.sourceDescriptor.kind).update(this.cacheRoot,e)}async pullRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);return await Wd(r)?this.git.pull(r):(this.logger.warn(this.ctx,"cannot pull: repository not cloned",{repoDir:r}),!1)}async fetchRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);if(!await Wd(r))return!1;try{return await this.git.fetch(r),await this.git.revListCount(r,"HEAD","@{u}")>0}catch(n){return this.logger.debug(this.ctx,"silent fetch failed",{repoDir:r,err:String(n)}),!1}}async cleanupPluginSource(e){let r=this.sources.get(e.sourceDescriptor.kind);if(!r)return;let n=r.getCleanupTarget(this.cacheRoot,e.sourceDescriptor);if(!n||!wE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${n$s++}`;if(await Hhe(`${n}.lock`,async()=>{if(await this.isCloneReferenced(n)){this.logger.info(this.ctx,"skipping cleanup: clone still referenced by another editor",{cleanupDir:n});return}try{await Wd(n)&&await eNe.promises.rename(n,s),o=!0}catch(c){this.logger.warn(this.ctx,"failed to vacate plugin clone",{cleanupDir:n,err:String(c)})}}),!!o){try{await eNe.promises.rm(s,{recursive:!0,force:!0}),this.logger.info(this.ctx,"removed plugin clone",{cleanupDir:n})}catch(c){this.logger.warn(this.ctx,"failed to remove vacated plugin clone",{tombstone:s,err:String(c)})}await this.pruneEmptyParents(n).catch(c=>this.logger.warn(this.ctx,"failed to prune empty parents",{cleanupDir:n,err:String(c)}))}}async isCloneReferenced(e){return(await this.store.readInstalledForAllEditors()).some(n=>{let o=qX.isAbsolute(n.pluginUri)?n.pluginUri:qX.resolve(this.cacheRoot,n.pluginUri);return wE(e,o)})}async pruneEmptyParents(e){let r=qX.dirname(e);for(;wE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await eNe.promises.readdir(r)).length>0)break;await eNe.promises.rmdir(r)}catch{break}r=qX.dirname(r)}}};p();p();function cZn(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(cZn,"isInstalledEntry");var wH=require("fs"),Q2=de(require("path"));var lZn="plugins",a$s="plugins",c$s="installed.json",l$s="enablement.json",u$s="marketplaces.json",d$s=".lock",f$s=0,uZn=a(t=>typeof t=="string","isString"),tNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return Q2.join(this.rootDir,lZn)}editorPluginsDir(e){return Q2.join(this.rootDir,this.safeEditorSegment(e),a$s)}installedJsonPath(e){return Q2.join(this.editorPluginsDir(e),c$s)}enablementJsonPath(e){return Q2.join(this.editorPluginsDir(e),l$s)}marketplacesJsonPath(e){return Q2.join(this.editorPluginsDir(e),u$s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,cZn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,uZn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,uZn);return{version:r,marketplaces: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 writeMarketplaces(e,r){await this.writeJsonAtomic(this.marketplacesJsonPath(e),r)}async withLock(e,r){let n=Q2.join(this.editorPluginsDir(e),d$s);return Hhe(n,r)}async listEditorIds(){let e;try{e=await wH.promises.readdir(this.rootDir,{withFileTypes:!0})}catch{return[]}let r=e.filter(o=>(o.isDirectory()||o.isSymbolicLink())&&t.isSafeEditorId(o.name)),n=await Promise.all(r.map(o=>wH.promises.stat(this.installedJsonPath(o.name)).then(s=>s.isFile(),()=>!1)));return r.filter((o,s)=>n[s]).map(o=>o.name)}async readInstalledForAllEditors(){let e=await this.listEditorIds();return(await Promise.all(e.map(n=>this.readInstalled(n)))).flatMap(n=>n.installed)}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===lZn||e!==Q2.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 wH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=Q2.dirname(e);await wH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${f$s++}.tmp`,s=JSON.stringify(r,null,2)+` -`;try{await wH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await wH.promises.rename(o,e)}catch(c){throw await wH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var pZn=require("os"),$he=de(require("path"));var dZn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},fZn=new Set,p$s=new Set(Lhe.filter(t=>t.changeSignal).map(t=>t.name)),uc=class{constructor(e,r,n=50,o=(0,pZn.homedir)(),s=process.env.COPILOT_HOME||$he.join(o,efr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new fe("AgentPluginService");this._onDidChangePlugins=new ep;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new Vx;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new tNe(this.ctx.get(Yn).directory)),this._store}get repository(){return this._repository||(this._git??=new plt(this.ctx),this._repository=new _lt(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new mlt(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new hlt(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(tNe.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),s=await jJn(this.discoveryDeps(r)),c=await vx(s,ult,l=>this.toPlugin(l,o));return c.sort((l,u)=>l.uri.localeCompare(u.uri)),c}async toPlugin(e,r){let n=await this.readContributionsSafely(e),o=e.fromMarketplace?.name||n.manifestName||e.displayName||$he.basename(e.fsPath);return{uri:e.uri,label:o,enabled:!r.has(e.uri),hooks:n.hooks,commands:n.commands,skills:n.skills,agents:n.agents,instructions:n.instructions,mcpServerDefinitions:n.mcpServerDefinitions,...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await PJn(e.fsPath);return $Jn(e.fsPath,n,{userHome:this.userHome,...e.repositoryBoundary!==void 0&&{repositoryBoundary:e.repositoryBoundary}})})().catch(n=>(this.logger.debug(this.ctx,"listPlugins: reading contributions failed",{uri:e.uri,err:String(n)}),dZn));return o3(r,llt,dZn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return ifr(e,this.copilotHome)}discoveryDeps(e){let r=new Map;return{...this.discoveryRoots(),installed:e,getRepositoryUri:a(n=>this.repository.getRepositoryUri(n),"getRepositoryUri"),resolveMarketplace:a(n=>this.resolveMarketplaceForList(n,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=LT(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n),c=await this.readMarketplacePluginFromDir(s,n,e.name,r);if(c)return c;if(e.pluginUri&&e.pluginUri!==s)return await this.readMarketplacePluginFromDir(e.pluginUri,n,e.name)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return o3(o,llt,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Wd(e))return;let s=o?.get(e);s||(s=this.marketplace.readAllPluginsFromDirectory(e,r),o?.set(e,s));let l=(await s).find(u=>u.name===n);return l||(await this.marketplace.readSinglePluginManifest(e,r)??void 0)}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(fZn)}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){return $he.isAbsolute(e.pluginUri)?nfr(e.pluginUri):!1}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Ir).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 JDe(this.ctx,r,{matches:zJn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(fZn)});let n=this.discoveryRoots();for(let o of Lhe){let s=o.changeSignal;if(!s)continue;let c=new JDe(this.ctx,s.dir(n),{createDir:s.createDir,matches:afr(s.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(c.onDidChange(()=>{this.refreshAndMaybeFire(new Set([o.name]))})),this._sourceWatchers.push(c)}this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(p$s)}catch{}}),!this._disposed&&await Promise.all([this._fileWatcher?.start(),...this._sourceWatchers.map(e=>e.start())])}refreshAndMaybeFire(e){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let r;try{r=await this.stateKey(e)}catch(n){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(n)});return}r!==this._lastStateKey&&(this._lastStateKey=r,this._onDidChangePlugins.fire())})}async stateKey(e){let r=this.editorId,[{installed:n},{disabled:o}]=await Promise.all([this.store.readInstalled(r),this.store.readEnablement(r)]),s=this.discoveryRoots();for(let l of Lhe){let u=l.changeSignal;if(!u||!e.has(l.name)&&this._lastSourceListings.has(l.name))continue;let d=await u.listing(s);d!==void 0&&this._lastSourceListings.set(l.name,d)}let c={};for(let l of Lhe)l.changeSignal&&(c[l.name]=[...this._lastSourceListings.get(l.name)??[]].sort());return JSON.stringify({installed:n.map(l=>[l.pluginUri,l.name]).sort((l,u)=>l[0].localeCompare(u[0])||l[1].localeCompare(u[1])),disabled:[...o].sort(),sources:c})}async installPlugin(e){let r=await this.install.acquirePlugin(e);return await this.mutate(async n=>{let o=await this.store.readInstalled(n),s={pluginUri:r,marketplace:e.marketplaceReference.rawValue,name:e.name},c=o.installed.find(u=>u.pluginUri===r);if(c&&c.name===s.name&&c.marketplace===s.marketplace)return!1;let l=c?o.installed.map(u=>u.pluginUri===r?s:u):[...o.installed,s];return await this.store.writeInstalled(n,{...o,installed:l}),this.logger.info(this.ctx,"installed plugin",{pluginUri:r,name:s.name}),!0}),r}async uninstallPlugin(e){let r;if(await this.mutate(async o=>{let s=await this.store.readInstalled(o),c=s.installed.findIndex(u=>u.pluginUri===e);if(c<0)return!1;r=s.installed[c];let l=s.installed.filter((u,d)=>d!==c);return await this.store.writeInstalled(o,{...s,installed:l}),await this.pruneEnablement(o,[e]),this.logger.info(this.ctx,"uninstalled plugin",{pluginUri:e,name:r.name}),!0}),!r)return;let n;try{n=await this.install.resolveInstalled(r)}catch(o){this.logger.warn(this.ctx,"skip clone GC: resolving installed plugin source failed",{pluginUri:e,err:String(o)});return}if(!n){this.logger.debug(this.ctx,"skip clone GC: could not resolve installed plugin source",{pluginUri:e});return}await this.repository.cleanupPluginSource(n).catch(o=>this.logger.warn(this.ctx,"plugin clone cleanup failed",{pluginUri:e,err:String(o)}))}async installPluginFromSource(e,r){let n=LT(e);if(!n)throw new Uhe(e);let o=await this.install.resolveFromSource(n);if(o.plugins.length===0)return{installed:!1,candidates:[]};let s;if(r!==void 0){if(s=o.plugins.find(l=>l.name===r),!s)return{installed:!1,candidates:o.plugins}}else if(o.plugins.length===1)s=o.plugins[0];else return{installed:!1,candidates:o.plugins};return o.isSinglePluginRepo||await this.addMarketplaceReference(n),{installed:!0,pluginUri:await this.installPlugin(s),plugin:s}}async updatePlugin(e){let r=this.guardEditorId("updatePlugin");if(r===void 0)return!1;let{installed:n}=await this.store.readInstalled(r),o=n.find(l=>l.pluginUri===e);if(!o)return this.logger.warn(this.ctx,"updatePlugin: not installed for this editor",{pluginUri:e}),!1;let s;try{s=await this.install.resolveInstalled(o)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: resolving plugin source failed",{pluginUri:e,err:String(l)}),!1}if(!s)return this.logger.warn(this.ctx,"updatePlugin: could not resolve plugin source",{pluginUri:e}),!1;let c=!1;try{c=await this.repository.updatePluginSource(s)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: pulling latest content failed",{pluginUri:e,err:String(l)}),!1}return c&&this.logger.info(this.ctx,"updated plugin",{pluginUri:e,name:o.name}),c}async addMarketplaceReference(e){await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>LT(s)?.canonicalId===e.canonicalId)?!1:(await this.store.writeMarketplaces(r,{...n,marketplaces:[...n.marketplaces,e.rawValue]}),this.logger.info(this.ctx,"registered marketplace",{reference:e.rawValue}),!0)})}async listMarketplaces(){let e=this.guardEditorId("listMarketplaces");if(e===void 0)return[];let{marketplaces:r}=await this.store.readMarketplaces(e);return hJn(r)}async addMarketplace(e){let r=LT(e);if(!r)throw new Uhe(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=LT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?LT(c)?.canonicalId!==r.canonicalId:!0);return s.length===o.marketplaces.length?!1:(await this.store.writeMarketplaces(n,{...o,marketplaces:s}),this.logger.info(this.ctx,"removed marketplace",{source:e}),!0)})}async browseMarketplace(e){let r;if(e!==void 0){let n=LT(e);if(!n)throw new Uhe(e,"marketplace source");r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose(),this._onDidChangePlugins.dispose()}}};var vlt=de(require("path"));var jX=new fe("BackgroundAgent.PluginHooks"),Vhe="copilot-plugin",ufr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function h$s(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=ufr[s.type];if(c!==void 0)for(let l of s.hooks){let u=dfr(l,e);if(!u)continue;let d=r[c]??=new Map,f=d.get(s.uri);f?f.push(u):d.set(s.uri,[u])}}let n={};for(let[o,s]of Object.entries(r))n[o]=[...s].map(([c,l])=>({source:c,hooks:l}));return n}a(h$s,"groupPluginHooksBySource");async function hZn(t,e){if(!W5(t)||!fJ(t))return{};let r;try{r=(await t.get(uc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof bl?{}:(jX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=h$s(r,n),s={};return o.preToolUse&&(s.preToolUse=[g$s(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[A$s(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[y$s(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[E$s(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[_$s(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[v$s(t,n,o.errorOccurred)]),s}a(hZn,"buildPluginHookHandlers");function mZn(t,e){let r={...t};return e.preToolUse?.length&&(r.preToolUse=[...t.preToolUse??[],...e.preToolUse]),e.postToolUse?.length&&(r.postToolUse=[...t.postToolUse??[],...e.postToolUse]),e.userPromptSubmitted?.length&&(r.userPromptSubmitted=[...t.userPromptSubmitted??[],...e.userPromptSubmitted]),e.sessionStart?.length&&(r.sessionStart=[...t.sessionStart??[],...e.sessionStart]),e.sessionEnd?.length&&(r.sessionEnd=[...t.sessionEnd??[],...e.sessionEnd]),e.errorOccurred?.length&&(r.errorOccurred=[...t.errorOccurred??[],...e.errorOccurred]),r}a(mZn,"mergePluginHooks");function dfr(t,e){let r=process.platform==="darwin"?t.osx:process.platform==="linux"?t.linux:void 0,n=t.command??r??t.linux??t.osx,o=t.windows??t.command;if(n===void 0&&o===void 0)return;let s=m$s(t.cwd,e);return{type:"command",...n!==void 0&&{bash:n},...o!==void 0&&{powershell:o},...s!==void 0&&{cwd:s},...t.env&&{env:t.env},...t.timeout!==void 0&&{timeoutSec:t.timeout}}}a(dfr,"toCommandHook");function m$s(t,e){if(t!==void 0)return vlt.isAbsolute(t)?t:vlt.join(e,t)}a(m$s,"resolveHookCwd");function Whe(t,e){return async r=>{if(fJ(t))return e(r)}}a(Whe,"gated");function g$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs)};for(let s of r){let c=await new o2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){jX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(g$s,"pluginPreToolUseHandler");function A$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs),toolResult:{resultType:kdr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new i2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(A$s,"pluginPostToolUseHandler");function y$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new s2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(y$s,"pluginUserPromptSubmittedHandler");function E$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new uJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(E$s,"pluginSessionStartHandler");function _$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new lJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(_$s,"pluginSessionEndHandler");function v$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,error:{message:n.error.message,name:n.error.name,...n.error.stack!==void 0&&{stack:n.error.stack}}};for(let s of r)await new lF(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(v$s,"pluginErrorOccurredHandler");p();var gZn=de(require("node:path"));function AZn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(AZn,"sanitizeForPrompt");function C$s(t){let e=t.startsWith("file:")?un(t):t;return AZn(gZn.basename(e))}a(C$s,"confinedBasename");function b$s(t){let e=t.startsWith("file:")?un(t):t;return AZn(e)}a(b$s,"confinedAbsolutePath");function yZn(t){let e=C$s(t),r=b$s(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(mJn,"composeBackgroundAgentSystemMessage");p();p();p();p();var jDe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(jDe||{});var OX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(OX||{});p();p();var LX=require("fs"),Rhe=de(require("path"));var LHs=32,BHs=5e3,FHs=5*1024*1024,UHs=32,QHs=Dtn(UHs);async function LT(t,e){return QHs.run(()=>s3(t(),BHs,e))}a(LT,"boundedFsOp");async function Odr(t){let e=await LT(()=>LX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(Odr,"statEntry");async function HDe(t){let e=await LT(()=>LX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?hS(e,LHs,async r=>{let n=Rhe.join(t,r.name);if(r.isSymbolicLink()){let o=await Odr(n);return{path:n,isFile:o?.isFile??!1,isDirectory:o?.isDirectory??!1,isSymlink:!0}}return{path:n,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:!1}}):[]}a(HDe,"readChildren");var gJn=process.platform==="linux";function RE(t,e){let r=gJn?t:t.toLowerCase(),n=gJn?e:e.toLowerCase(),o=Rhe.relative(r,n);return o===""||!o.startsWith("..")&&!Rhe.isAbsolute(o)}a(RE,"isAtOrUnder");async function rR(t,e){if(t===void 0)return!0;let r=await LT(()=>LX.promises.realpath(e),void 0);return r!==void 0&&RE(t,r)}a(rR,"withinRealBoundary");async function BX(t){if(t!==void 0)return LT(()=>LX.promises.realpath(t),t)}a(BX,"resolveRealBoundary");async function GDe(t){let e=await LT(()=>LX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>FHs))return LT(()=>LX.promises.readFile(t,"utf8"),void 0)}a(GDe,"readTextFileCapped");var AJn=require("fs"),Ldr=de(require("path"));function BT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(BT,"sanitizeCacheSegment");function khe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(khe,"refCacheSegment");function nlt(t,e){return e?[`sha_${encodeURIComponent(e)}`]:khe(t)}a(nlt,"gitRevisionCacheSuffix");function yJn(t,e,r){try{let n=new URL(t),o=BT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(BT):[];return[o,...c,...nlt(e,r)]}catch{return["git",BT(t),...nlt(e,r)]}}a(yJn,"gitUrlToCacheSegments");async function Yd(t){return LT(()=>AJn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Yd,"exists");function $De(t,e){let r=Ldr.join(t,...e);if(!RE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a($De,"joinCacheSegments");function VDe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Ldr.join(t,r);return RE(t,n)?n:t}a(VDe,"joinContained");var ilt=require("node:url");function EJn(t){let e=new Map;for(let r of t){let n=FT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(EJn,"parseMarketplaceReferences");function FT(t){let e=t.trim();if(e)return jHs(e)??HHs(e)??qHs(e)}a(FT,"parseMarketplaceReference");function qHs(t){let e=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:#(.+))?$/.exec(t);if(!e)return;let[,r,n,o]=e;return{rawValue:t,displayLabel:t,cloneUrl:`https://github.com/${r}/${n}.git`,canonicalId:vJn(r,n,o),cacheSegments:["github.com",BT(r),BT(n),...khe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(qHs,"parseShorthandMarketplaceReference");function jHs(t){let e;try{e=new URL(t)}catch{return}let r=e.protocol.replace(/:$/,"").toLowerCase();if(r==="file"&&/^file:\/\//i.test(t)){if(e.hash)return;let y;try{y=(0,ilt.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,ilt.pathToFileURL)(y).toString().toLowerCase()}`,cacheSegments:[],kind:"localFileUri",localRepositoryUri:y}}if(r!=="http"&&r!=="https"&&r!=="ssh"||!e.host)return;let n=e.hash?e.hash.slice(1):void 0,o=GHs(e),s=e.host.toLowerCase(),c=BT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Bdr(`git:${s}/`,n),cacheSegments:[c,...khe(n)],kind:"gitUri",ref:n};let u=".git",d=l.toLowerCase().endsWith(u),f=d?l.slice(0,-u.length):l,h=f.split("/").map(BT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=_Jn(s,f),A=CJn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...khe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(jHs,"parseUriMarketplaceReference");function HHs(t){let e=/^([^@\s]+)@([^:\s]+):(.+?\.git)(?:#(.+))?$/i.exec(t);if(!e)return;let r=".git",[,n,o,s,c]=e,l=s.replace(/^\/+/,"");if(!l.toLowerCase().endsWith(r))return;let u=l.slice(0,-r.length),d=u.split("/").map(BT),f=_Jn(o,u),h=CJn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[BT(o.toLowerCase()),...d,...khe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(HHs,"parseScpMarketplaceReference");function GHs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(GHs,"refStrippedUrl");function _Jn(t,e){if(t.toLowerCase()!=="github.com")return;let r=e.split("/");if(r.length>=2&&r[0]&&r[1])return`${r[0]}/${r[1]}`}a(_Jn,"extractGitHubRepo");function vJn(t,e,r){return Bdr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(vJn,"getGitHubCanonicalId");function CJn(t,e,r){if(t){let[n,o]=t.split("/");return vJn(n,o,e)}return Bdr(r,e)}a(CJn,"gitCanonicalId");function Bdr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Bdr,"appendRefSuffix");p();p();p();p();function bJn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(bJn,"untildify");var $Hs=200;function olt(t,e){return Fdr(t,e,new Set,0)}a(olt,"cloneAndChange");function Fdr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=$Hs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>Fdr(s,e,r,n+1));if(typeof t=="object"){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let s={};for(let c of Object.keys(t))s[c]=Fdr(t[c],e,r,n+1);return r.delete(t),s}return t}a(Fdr,"cloneAndChangeInner");function WDe(t,e=!1){if(!t||typeof t!="object")return;let r={};for(let[n,o]of Object.entries(t))typeof o=="string"?r[n]=o:e&&typeof o=="number"&&(r[n]=String(o));return Object.keys(r).length>0?r:void 0}a(WDe,"toStringRecord");var slt=de(require("path"));var WHs=/[\s&|<>()^;!`"'$]/;function zHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(zHs,"escapeWindowsDoubleQuoted");function YHs(t,e,r){if(!t.includes(r))return t;if(!WHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Ioe(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?zHs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(YHs,"shellQuotePluginRootInCommand");var KHs={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"};function JHs(t){if(t.type!==void 0&&t.type!=="command")return;let e=a(f=>typeof f=="string"&&f.length>0?f:void 0,"str"),r=e(t.command),n=e(t.bash),o=e(t.powershell),s=e(t.windows)??o,c=e(t.linux)??n,l=e(t.osx)??n;if(!r&&!s&&!c&&!l)return;let u=typeof t.timeout=="number"?t.timeout:typeof t.timeoutSec=="number"?t.timeoutSec:void 0,d=WDe(t.env,!0);return{...r&&{command:r},...s&&{windows:s},...c&&{linux:c},...l&&{osx:l},...d&&{env:d},...u!==void 0&&{timeout:u}}}a(JHs,"normalizeHookCommand");function SJn(t,e){let r=JHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=bJn(o,e);n=slt.isAbsolute(s)?slt.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(SJn,"resolveHookCommand");function ZHs(t,e){if(!t||typeof t!="object")return[];let r=t,n=[],o=r.hooks;if(Array.isArray(o)){for(let s of o)if(s&&typeof s=="object"){let c=SJn(s,e);c&&n.push(c)}}else{let s=SJn(r,e);s&&n.push(s)}return n}a(ZHs,"extractHookCommands");function Qdr(t,e,r){if(!e||typeof e!="object")return[];let n=e;if(n.disableAllHooks===!0)return[];let o=n.hooks;if(!o||typeof o!="object")return[];let s=o,c=[];for(let l of Object.keys(s)){let u=KHs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...ZHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Qdr,"parseHooksJson");function Udr(t,e,r){if(Array.isArray(t)){let n=t;for(let o=0;o{for(let d of["command","windows","linux","osx"]){let f=u[d];typeof f=="string"&&(u[d]=YHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=olt(e,()=>{});for(let d of Object.values(u.hooks??{}))if(Array.isArray(d))for(let f of d){if(!f||typeof f!="object")continue;let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)m&&typeof m=="object"&&l(m);else l(h)}return Udr(u,o,c),Qdr(t,u,n)}catch{return[]}}a(qdr,"interpolateHookPluginRoot");p();var Xdr=require("fs");Zdr();function XDe(t){try{return Jdr(t)}catch{return}}a(XDe,"parseJsonc");async function Mhe(t,e){let r=await LT(()=>Xdr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await LT(()=>Xdr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return XDe(n)}a(Mhe,"readJsoncFile");var RH=de(require("path"));var EGs={format:0,manifestPath:"plugin.json",altManifestPaths:[".github/plugin/plugin.json"],hookConfigPath:"hooks.json",altHookConfigPaths:["hooks/hooks.json"],pluginRootToken:void 0,pluginRootEnvVar:void 0,parseHooks(t,e,r,n){return Qdr(t,e,n)}},_Gs={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${CLAUDE_PLUGIN_ROOT}",pluginRootEnvVar:"CLAUDE_PLUGIN_ROOT",parseHooks(t,e,r,n){return qdr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},vGs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return qdr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function LJn(t){return await Yd(RH.join(t,".plugin","plugin.json"))?vGs:t.split(/[/\\]/).includes(".claude")||await Yd(RH.join(t,".claude-plugin","plugin.json"))?_Gs:EGs}a(LJn,"detectPluginFormat");async function BJn(t,e,r){let n=await BX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=RH.join(t,o);if(!await rR(n,s))continue;let c=await GDe(s),l=c===void 0?void 0:XDe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(BJn,"readPluginManifest");function FJn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(FJn,"defaultHookConfigPaths");var efr={paths:[],exclusive:!1};function Ohe(t){if(t==null)return efr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:efr}if(Array.isArray(t))return{paths:OJn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:OJn(e.paths),exclusive:e.exclusive===!0}}return efr}a(Ohe,"parseComponentPathConfig");function OJn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(OJn,"cleanPaths");function flt(t,e,r,n){let o=n&&RE(n,t)?n:t,s=[];r.exclusive||s.push(RH.join(t,e));for(let c of r.paths){let l=RH.normalize(RH.join(t,c));RE(o,l)&&s.push(l)}return s}a(flt,"resolveComponentDirs");p();p();var QT=de(require("path"));var QJn=new pO,eNe=16,UJn=".md",CGs=[".instructions.md",".mdc",".md"];async function bGs(t){let e=QT.basename(t).replace(/(\.agent)?\.md$/i,"");return qJn(t,e)}a(bGs,"parseAgentFile");async function SGs(t){return qJn(t,QT.basename(QT.dirname(t)))}a(SGs,"parseSkillFile");async function qJn(t,e){let r=await GDe(t);if(r===void 0)return{name:e};try{let n=QJn.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(qJn,"readNameDescription");async function TGs(t){let e=await GDe(t);if(e!==void 0)try{return QJn.parse(t,e).header?.description?.trim()||void 0}catch{return}}a(TGs,"parseCommandDescription");async function jJn(t,e,r){let n=await BX(r),s=(await hS(e,eNe,async d=>{if(!await rR(n,d))return[];let f=QT.join(d,"SKILL.md");if(await Yd(f)&&await rR(n,f))return[f];let h=(await HDe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await hS(h,eNe,async g=>{if(g.isSymlink&&!await rR(n,g.path))return;let A=QT.join(g.path,"SKILL.md");if(!(!await Yd(A)||!await rR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=QT.join(t,"SKILL.md");await Yd(d)&&await rR(n,d)&&s.push(d)}let c=await hS(s,eNe,async d=>({uri:d,...await SGs(d)})),l=new Set,u=[];for(let{uri:d,name:f,description:h}of c)l.has(d)||(l.add(d),u.push({uri:d,name:f,...h&&{description:h}}));return u.sort((d,f)=>d.name.localeCompare(f.name)),u}a(jJn,"readSkills");async function HJn(t,e,r){let n=await BX(r),o=new Set,s=[],c=a(l=>{let u=e(l);u&&!o.has(u)&&(o.add(u),s.push({uri:l,name:u}))},"addItem");for(let l of t){if(!await rR(n,l))continue;let u=await Odr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await HDe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await rR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(HJn,"scanComponentFiles");function IGs(t){return QT.extname(t).toLowerCase()===UJn?QT.basename(t).slice(0,-UJn.length):void 0}a(IGs,"getMarkdownComponentName");function GJn(t,e){return HJn(t,IGs,e)}a(GJn,"readMarkdownComponents");async function $Jn(t,e){let r=await GJn(t,e);return hS(r,eNe,async n=>{let o=await TGs(n.uri);return{...n,...o&&{description:o}}})}a($Jn,"readCommandComponents");async function VJn(t,e){let r=await GJn(t,e);if(r.length===0)return r;let n=await hS(r,eNe,async c=>{let{name:l,description:u}=await bGs(c.uri);return{uri:c.uri,name:l||c.name,...u&&{description:u}}}),o=new Set,s=n.filter(c=>o.has(c.name)?!1:(o.add(c.name),!0));return s.sort((c,l)=>c.name.localeCompare(l.name)),s}a(VJn,"readAgentComponents");function xGs(t){let e=QT.basename(t),r=e.toLowerCase(),n=CGs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(xGs,"getInstructionFileName");function WJn(t,e){return HJn(t,xGs,e)}a(WJn,"readInstructionComponents");p();function wGs(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Object.hasOwn(e,"mcpServers")){let r=e.mcpServers;return!r||typeof r!="object"||Array.isArray(r)?void 0:r}return e}a(wGs,"resolveMcpServersMap");function RGs(t){if(!t||typeof t!="object")return;let e=t,r=a(h=>typeof h=="string"&&h.trim()?h.trim():void 0,"str"),n=r(e.type),o=r(e.command),s=r(e.url),c=Array.isArray(e.args)?e.args.filter(h=>typeof h=="string"):void 0,l=WDe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=WDe(e.headers);if(n!=="ws"){if(n==="stdio"||!n&&o)return o?{type:"stdio",command:o,...c&&{args:c},...l&&{env:l},...d!==void 0&&{cwd:d},...u!==void 0&&{envFile:u}}:void 0;if(n==="http"||n==="sse"||!n&&s)return s?{type:"http",url:s,...f&&{headers:f}}:void 0}}a(RGs,"normalizeMcpServerConfiguration");function kGs(t,e,r,n){let o=a(l=>l.replaceAll(r,()=>e),"replace"),s=t.configuration,c;if(s.type==="stdio"){let l={};for(let[u,d]of Object.entries(s.env??{}))l[u]=o(d);l[n]=e,c={type:"stdio",command:o(s.command),...s.args&&{args:s.args.map(o)},env:l,...s.cwd!==void 0&&{cwd:o(s.cwd)},...s.envFile!==void 0&&{envFile:o(s.envFile)}}}else c={type:"http",url:o(s.url),...s.headers&&{headers:Object.fromEntries(Object.entries(s.headers).map(([l,u])=>[l,o(u)]))}};return{name:t.name,configuration:c,uri:t.uri}}a(kGs,"interpolateMcpPluginRoot");var PGs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function DGs(t){return olt(t,e=>{if(typeof e=="string"){let r=e.replace(PGs,"${env:$1}");return r!==e?r:void 0}})}a(DGs,"convertBareEnvVarsToVsCodeSyntax");function tfr(t,e,r,n){let o=wGs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=RGs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=kGs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=DGs(d),s.push(d)}return s}a(tfr,"parseMcpServerDefinitionMap");p();var QX=require("fs"),Rb=de(require("path"));var nfr=".copilot",ifr="installed-plugins",Jkf=Rb.join(nfr,ifr),zJn="config.json",plt=5e3,hlt=16,ofr=5*1024*1024;async function Lhe(t){return LT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(Lhe,"boundedFsResult");function rfr(t){return t==="ENOENT"||t==="ENOTDIR"}a(rfr,"isAbsentCode");async function YJn(t){let e=await Lhe(()=>QX.promises.stat(Rb.dirname(t)));return e.ok&&e.value.isDirectory()}a(YJn,"parentDirSurvives");async function sfr(t){let e=await Lhe(()=>QX.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:YJn(t)}a(sfr,"isDefinitivelyGone");var NGs={name:"marketplace",discover:OGs},MGs={name:"copilotCli",discover:LGs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([zJn]),createDir:!1,listing:a(t=>BGs(t.copilotHome),"listing")}},Bhe=[NGs,MGs];async function KJn(t){let e=await Promise.all(Bhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=ug(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(KJn,"discoverPlugins");async function OGs(t){return(await hS(t.installed,hlt,async r=>{let n;if(Rb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=Rb.resolve(t.sharedContentDir,r.pluginUri);if(!RE(t.sharedContentDir,u))return;n=u}let o=await Lhe(()=>QX.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await YJn(n))return;let s=FT(r.marketplace),c;if(s)try{c=t.getRepositoryUri(s)}catch{c=void 0}let l=await t.resolveMarketplace(r);return{uri:r.pluginUri,fsPath:n,displayName:r.name,readOnly:afr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(OGs,"discoverMarketplace");async function LGs(t){return(await JJn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(LGs,"discoverCopilotCli");async function JJn(t){return s3(FGs(t),plt,void 0)}a(JJn,"listCopilotCliInstalls");async function BGs(t){return(await JJn(t))?.map(e=>e.fsPath)}a(BGs,"listCopilotCliPluginDirs");async function FGs(t){let e=Rb.join(t,ifr),[r,n]=await Promise.all([UGs(t),QGs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&Rb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?Rb.join(e,u.marketplace,u.name):void 0);f!==void 0&&o.push({fsPath:f,...u.name!==void 0&&{displayName:u.name}})}let s=await hS(o,hlt,async u=>await sfr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=ug(u.fsPath);l.has(d)||(l.add(d),c.push({fsPath:u.fsPath,...u.displayName!==void 0&&{displayName:u.displayName}}))}for(let u of n??[]){let d=ug(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(FGs,"collectCopilotCliInstalls");async function UGs(t){let e=Rb.join(t,zJn),r=await Lhe(()=>QX.promises.stat(e));if(!r.ok)return rfr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>ofr)return;let n=await Lhe(()=>QX.promises.readFile(e,"utf8"));if(!n.ok)return rfr(n.code)?[]:void 0;let o=n.value,s;try{s=JSON.parse(o)}catch{return}let c=s?.installedPlugins;if(!Array.isArray(c))return[];let l=[];for(let u of c){if(u===null||typeof u!="object")continue;let d=u;l.push({name:typeof d.name=="string"?d.name:void 0,marketplace:typeof d.marketplace=="string"?d.marketplace:void 0,cachePath:typeof d.cache_path=="string"?d.cache_path:void 0})}return l}a(UGs,"readCliInstalledPlugins");async function QGs(t){let e=await Lhe(()=>QX.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return rfr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await HDe(Rb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(QGs,"scanCopilotCliPluginDirs");function afr(t,e){return RE(Rb.join(e,ifr),t)}a(afr,"isCopilotCliPath");var cfr=de(require("path"));var qGs="commands",jGs="skills",HGs="agents",GGs="rules",$Gs=".mcp.json";async function XJn(t,e,r){let n=r.repositoryBoundary,o=n&&RE(n,t)?n:t,s=await BX(o),c=await BJn(t,e,s),l=c?.manifest,u=c?.manifestUri??cfr.join(t,e.manifestPath),d=a((v,b)=>flt(t,b,Ohe(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([$Jn(d("commands",qGs),s),jJn(t,d("skills",jGs),s),VJn(d("agents",HGs),s),WJn(d("rules",GGs),s),VGs(t,l,u,e,n,s,r),zGs(t,l,u,e,n,s)]),E=l?.name,_=typeof E=="string"&&E.trim()?E.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,..._&&{manifestName:_}}}a(XJn,"readPluginContributions");function mlt(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(mlt,"isEmbeddedSection");async function eZn(t,e){if(await rR(e,t))return Mhe(t,ofr)}a(eZn,"readJsoncWithinBoundary");async function VGs(t,e,r,n,o,s,c){let l=e?.hooks;if(mlt(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=ZJn(n,r,h,t,c);if(m.length>0)return m}let u=mlt(l)?Ohe(void 0):Ohe(l),d=WGs(t,n,u,o);for(let f of d){let h=await eZn(f,s);if(h)return ZJn(n,f,h,t,c)}return[]}a(VGs,"readHooks");function ZJn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(ZJn,"parseHooksSafely");function WGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of FJn(e))o.push(cfr.join(t,s));for(let s of flt(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(WGs,"resolveHookConfigPaths");async function zGs(t,e,r,n,o,s){let c=new Map,l=a(d=>{for(let f of d)c.has(f.name)||c.set(f.name,f)},"add"),u=e?.mcpServers;if(mlt(u)&&l(tfr(r,{mcpServers:u},t,n)),c.size===0){let d=mlt(u)?Ohe(void 0):Ohe(u),f=flt(t,$Gs,d,o);for(let h of f){let m=await eZn(h,s);m&&l(tfr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(zGs,"readMcpServers");p();function tNe(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(tNe,"redactUrlCredentials");var kH=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},glt=class extends kH{static{a(this,"PluginSourceNotSupportedError")}constructor(e){let r={kind:"pluginSourceNotSupported",sourceKind:e};super(`Plugin source kind '${e}' is not supported in this environment`,r),this.name="PluginSourceNotSupportedError"}},Fhe=class extends kH{static{a(this,"PluginCloneError")}constructor(e,r){let n=tNe(e),o=tNe(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(`Failed to clone plugin source '${n}': ${o}`,s),this.name="PluginCloneError"}},Uhe=class extends kH{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},Qhe=class extends kH{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=tNe(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};p();var tZn=require("fs"),lfr=de(require("path"));var YGs=new Set(["installed.json","enablement.json"]);function ufr(t){return(e,r)=>{let n=ug(e.path);return lfr.posix.dirname(n)===r&&t.has(lfr.posix.basename(n))}}a(ufr,"matchNamedFiles");var rZn=ufr(YGs),rNe=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new fe("PluginFileWatcher");this._onDidChange=new rp;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=ug(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??jze(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await tZn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Yd(this.dir))return;if(this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:this._recursive})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin dir",{dir:this.dir,err:String(e)})}}onEvents(e){this._disposed||e.some(r=>this._matches(r,this._dirKey))&&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();var nZn=require("fs"),iZn=de(require("path"));var KGs=new fe("plugins.git"),JGs=12e4,Alt=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=iZn.dirname(r);await nZn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw KGs.warn(this.ctx,`clone failed for ${tNe(e)}`,o),new Fhe(e,o)}}async checkout(e,r,n){await(await this.instanceFor(e)).checkout(n?["--detach",r]:[r])}async pull(e){if(!await this.isOnBranch(e))return!1;let r=await this.instanceFor(e),n=await this.revParse(e,"HEAD").catch(()=>{});await r.pull();let o=await this.revParse(e,"HEAD").catch(()=>{});return n!==o}async isOnBranch(e){let n=(await(await this.instanceFor(e)).raw(["rev-parse","--abbrev-ref","HEAD"])).trim();return n!==""&&n!=="HEAD"}async revParse(e,r){return(await(await this.instanceFor(e)).revparse([r])).trim()}async fetch(e){await(await this.instanceFor(e)).fetch()}async revListCount(e,r,n){let s=(await(await this.instanceFor(e)).raw(["rev-list","--count",`${r}..${n}`])).trim(),c=Number.parseInt(s,10);return Number.isFinite(c)?c:0}async instanceFor(e){let r=this.gitInstances.get(e);return r||(this._binary===void 0&&(this._binary=(await dO()).path),r=$ue({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:JGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var ylt=class{constructor(e,r){this.repository=e;this.marketplace=r}static{a(this,"PluginInstallService")}async acquirePlugin(e){let r=await this.repository.ensurePluginSource(e);if(!await Yd(r))throw new Fhe(e.marketplaceReference.cloneUrl,"plugin content not found after acquisition");return r}async resolveFromSource(e){let r=await this.repository.ensureRepository(e),n=await this.marketplace.readPluginsFromDirectory(r,e);if(n.length>0)return{reference:e,plugins:n,isSinglePluginRepo:!1};let o=await this.marketplace.readSinglePluginManifest(r,e);return o?{reference:e,plugins:[o],isSinglePluginRepo:!0}:{reference:e,plugins:[],isSinglePluginRepo:!1}}async resolveInstalled(e){let r=FT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Yd(n)){let s=(await this.marketplace.readPluginsFromDirectory(n,r)).find(l=>l.name===e.name);if(s)return s;let c=await this.marketplace.readSinglePluginManifest(n,r);if(c)return c}if(r.kind==="githubShorthand"&&r.githubRepo)return oZn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return oZn({kind:"url",url:r.cloneUrl},r,e.name)}};function oZn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(oZn,"synthesizePlugin");p();p();var ZGs=new fe("plugins.catalog");function dfr(t,e,r,n){return Array.isArray(t.plugins)?t.plugins.filter(s=>s!=null&&typeof s.name=="string"&&s.name.length>0).flatMap(s=>{let c=s.name,l=XGs(s.source,t.metadata?.pluginRoot,c,n);return l?[{name:c,description:typeof s.description=="string"?s.description:"",version:typeof s.version=="string"?s.version:"",sourceDescriptor:l,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:r}]:[]}):[]}a(dfr,"parseMarketplaceCatalog");function XGs(t,e,r,n){let o=a(s=>{n&&ZGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=e$s(typeof e=="string"?e:void 0,t??"");return c===void 0?o("could not resolve relative source path"):{kind:"relativePath",path:c}}if(typeof t!="object"||typeof t.source!="string")return o("source object is missing a 'source' discriminant");switch(t.source){case"github":return typeof t.repo!="string"||!t.repo?o("github source is missing required 'repo' field"):r$s(t.repo)?!qhe(t.ref)||!qhe(t.path)?o("github source 'ref'/'path' must be strings when provided"):aZn(t.sha)?{kind:"github",repo:t.repo,ref:t.ref,sha:t.sha,path:t.path}:o("github source 'sha' must be a 40-character commit hash when provided"):o("github source 'repo' must be in 'owner/repo' format");case"url":case"git-subdir":return typeof t.url!="string"||!t.url?o(`${t.source} source is missing required 'url' field`):t.source==="url"&&!t.url.toLowerCase().endsWith(".git")?o("url source must end with '.git'"):qhe(t.ref)?aZn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!qhe(t.path)?o("url source 'path' must be a string when provided"):{kind:"url",url:t.url,ref:t.ref,sha:t.sha,path:t.path}:o(`${t.source} source 'sha' must be a 40-character commit hash when provided`):o(`${t.source} source 'ref' must be a string when provided`);case"npm":case"pip":return typeof t.package!="string"||!t.package?o(`${t.source} source is missing required 'package' field`):!qhe(t.version)||!qhe(t.registry)?o(`${t.source} source 'version'/'registry' must be strings when provided`):{kind:t.source==="npm"?"npm":"pip",package:t.package,version:t.version,registry:t.registry};default:return o(`unknown source kind '${t.source}'`)}}a(XGs,"parsePluginSource");function e$s(t,e){let r=sZn(t??""),n=sZn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:t$s(`/${r}/${n}`).replace(/^\/+/,"")}a(e$s,"resolvePluginSource");function sZn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(sZn,"normalizeMarketplacePath");function t$s(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(t$s,"posixNormalize");function qhe(t){return t===void 0||typeof t=="string"}a(qhe,"isOptionalString");function aZn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(aZn,"isOptionalGitSha");function r$s(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(r$s,"isValidGitHubRepo");var iNe=de(require("path"));var jhe=new fe("plugins.marketplace"),n$s=480*60*1e3,i$s=3e4,o$s=15e4,cZn=[{type:"openPlugin",path:"marketplace.json"},{type:"openPlugin",path:".plugin/marketplace.json"},{type:"copilot",path:".github/plugin/marketplace.json"},{type:"claude",path:".claude-plugin/marketplace.json"}],s$s=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],Elt=class{constructor(e,r){this.ctx=e;this.repository=r;this.githubCatalogCache=new Map}static{a(this,"PluginMarketplaceService")}async fetchMarketplacePlugins(e,r){let n=await Promise.all(e.map(o=>this.fetchOneBounded(o,r)));return{plugins:n.flatMap(o=>o.plugins),errors:n.flatMap(o=>o.error?[o.error]:[])}}fetchOneBounded(e,r){let n=e.kind==="githubShorthand"&&e.githubRepo?this.fetchFromGitHubRepo(e,e.githubRepo,r):this.fetchFromClonedRepo(e,r);return this.withReferenceDeadline(n,e,r)}withReferenceDeadline(e,r,n){return new Promise(o=>{let s=!1,c=a(d=>{s||(s=!0,clearTimeout(l),u?.dispose(),o(d))},"finish"),l=setTimeout(()=>{jhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:c$s(r)})},o$s);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:lZn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return Mhe(iNe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of cZn){if(n?.isCancellationRequested)return[];let c=await Mhe(iNe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of dfr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,uZn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of s$s){let o=await Mhe(iNe.join(e,n.path));if(!o||typeof o!="object"||Array.isArray(o))continue;let s=r.kind==="githubShorthand"?{kind:"github",repo:r.githubRepo}:{kind:"url",url:r.cloneUrl};return{name:typeof o.name=="string"&&o.name?o.name:r.displayLabel,description:typeof o.description=="string"?o.description:"",version:typeof o.version=="string"?o.version:"",sourceDescriptor:s,marketplace:r.displayLabel,marketplaceReference:r,marketplaceType:n.type,readmeUri:r.githubRepo?pZn(r.githubRepo,""):fZn(e,"")}}jhe.debug(this.ctx,"no single-plugin manifest found",{reference:r.rawValue})}}clearCache(){this.githubCatalogCache.clear()}async fetchFromGitHubRepo(e,r,n){let o=this.getCachedCatalog(e.canonicalId);if(o)return{plugins:o.map(d=>l$s(d,e))};let s=!0,c,l=encodeURIComponent(e.ref??"main"),u=await this.readPluginsFromDefinitions(e,async d=>{if(n?.isCancellationRequested)return;let f=`https://raw.githubusercontent.com/${r}/${l}/${d}`,h=a$s(n);try{let m=await this.ctx.get(nr).fetch(f,{method:"GET",timeout:i$s,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return XDe(await m.text())}catch(m){jhe.debug(this.ctx,"raw marketplace fetch failed",{url:f,err:String(m)});return}finally{h.dispose()}});return u.length>0?(this.setCachedCatalog(e.canonicalId,u),{plugins:u}):s?(jhe.debug(this.ctx,"repo may be private; falling back to clone",{repo:r}),this.fetchFromClonedRepo(e,n)):c!==void 0?{plugins:[],error:{reference:e.displayLabel,canonicalId:e.canonicalId,kind:"unavailable",status:c,message:`Marketplace '${e.displayLabel}' is temporarily unavailable (HTTP ${c})`}}:{plugins:[]}}async fetchFromClonedRepo(e,r){if(r?.isCancellationRequested)return{plugins:[]};let n;try{n=await this.repository.ensureRepository(e)}catch(o){return jhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:lZn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of cZn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return dfr(s,e,o.type,this.ctx).map(c=>uZn(c,n))}return jhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(Sx).now().getTime()}getCachedCatalog(e){let r=this.githubCatalogCache.get(e);if(r){if(r.expiresAt<=this.now()){this.githubCatalogCache.delete(e);return}return r.plugins}}setCachedCatalog(e,r){this.githubCatalogCache.set(e,{plugins:r,expiresAt:this.now()+n$s})}};function a$s(t){let e={dispose(){}};if(!t)return e;let r=new AbortController;if(t.isCancellationRequested)return r.abort(),{signal:r.signal,...e};let n=t.onCancellationRequested(()=>r.abort());return{signal:r.signal,dispose:a(()=>n.dispose(),"dispose")}}a(a$s,"abortSignalFor");function c$s(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(c$s,"deadlineError");function lZn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof Uhe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(lZn,"toFetchError");function l$s(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(l$s,"restamp");function uZn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?fZn(e,r):pZn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(uZn,"withReadme");function dZn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(dZn,"readmeRelPath");function fZn(t,e){return iNe.join(t,dZn(e))}a(fZn,"fileReadmeUri");function pZn(t,e){return`https://github.com/${t}/blob/main/${dZn(e)}`}a(pZn,"githubBlobReadmeUri");p();p();var Hhe=require("fs"),hZn=de(require("path"));var u$s=1e4,d$s=3e4,f$s=25;async function Ghe(t,e){await Hhe.promises.mkdir(hZn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+d$s;for(;;)try{await Hhe.promises.writeFile(t,`${process.pid} +`,{flag:"wx",mode:384});break}catch(n){if(n.code!=="EEXIST")throw n;if(Date.now()>r)throw new Error(`withFileLock: timed out acquiring lock ${JSON.stringify(t)}`);await p$s(t)>u$s&&await Hhe.promises.rm(t,{force:!0}).catch(()=>{}),await SC(f$s)}try{return await e()}finally{await Hhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(Ghe,"withFileLock");async function p$s(t){try{let e=await Hhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(p$s,"lockAgeMs");p();var $he=require("fs"),qX=de(require("path"));var h$s=new fe("plugins.source"),m$s=0,mZn=".clone-tmp";function g$s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(g$s,"isProcessAlive");async function A$s(t){let e=qX.dirname(t),r=`${qX.basename(t)}.`,n;try{n=await $he.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(mZn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||g$s(s)||await $he.promises.rm(qX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(A$s,"sweepOrphanedCloneTemps");async function ffr(t,e,r,n,o){if(await Yd(r))return;await A$s(r);let s=`${r}.${process.pid}.${m$s++}${mZn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await Ghe(`${r}.lock`,async()=>{await Yd(r)||(await $he.promises.mkdir(qX.dirname(r),{recursive:!0,mode:448}),await $he.promises.rename(s,r))})}finally{t.git.forget(s),await $he.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(ffr,"cloneIntoPlace");var _lt=class{constructor(){this.kind="relativePath"}static{a(this,"RelativePathPluginSource")}getInstallUri(){throw new Error("Use PluginRepositoryService.getPluginInstallUri() for relative-path sources")}ensure(){throw new Error("Use PluginRepositoryService.ensureRepository() for relative-path sources")}update(){throw new Error("Use PluginRepositoryService.pullRepository() for relative-path sources")}getCleanupTarget(){}getLabel(e){return e.path||"."}},vlt=class{constructor(e){this.deps=e}static{a(this,"AbstractGitPluginSource")}getCleanupTarget(e,r){return this.getRepoDir(e,r)}async ensure(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);return await Yd(o)?await this.checkoutRevision(o,n):await ffr(this.deps,this.cloneUrl(n),o,n.ref,n.sha),this.getInstallUri(e,n)}async update(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);if(!await Yd(o))return h$s.warn(this.deps.ctx,`cannot update '${r.name}': source repository not cloned`,{repoDir:o}),!1;if(!n.sha&&await this.deps.git.isOnBranch(o)){let l=await this.deps.git.pull(o);return await this.checkoutRevision(o,n),l}let s=await this.deps.git.revParse(o,"HEAD").catch(()=>{});await this.deps.git.fetch(o),await this.checkoutRevision(o,n);let c=await this.deps.git.revParse(o,"HEAD").catch(()=>{});return s!==c}async checkoutRevision(e,r){r.sha?await this.deps.git.checkout(e,r.sha,!0):r.ref&&await this.deps.git.checkout(e,r.ref)}},Clt=class extends vlt{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return VDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return $De(r,["github.com",BT(s),BT(c),...nlt(o.ref,o.sha)])}getLabel(r){let n=r;return n.path?`${n.repo}/${n.path}`:n.repo}cloneUrl(r){return`https://github.com/${r.repo}.git`}},blt=class extends vlt{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return VDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return $De(r,yJn(o.url,o.ref,o.sha))}getLabel(r){let n=r;return n.path?`${n.url}/${n.path}`:n.url}cloneUrl(r){return r.url}};var oNe=require("fs"),jX=de(require("path"));var y$s=0,Slt=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new fe("plugins.repository");this.cloneSequencer=new zx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new _lt],["github",new Clt(o)],["url",new blt(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new glt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:$De(this.cacheRoot,e.cacheSegments)}getPluginInstallUri(e){let r=e.sourceDescriptor;if(r.kind!=="relativePath")return this.getPluginSourceInstallUri(r);let n=this.getRepositoryUri(e.marketplaceReference);return VDe(n,r.path)}getPluginSourceInstallUri(e){return this.getPluginSource(e.kind).getInstallUri(this.cacheRoot,e)}async ensureRepository(e){let r=this.getRepositoryUri(e);return this.cloneSequencer.queue(r,async()=>{if(await Yd(r))return r;if(e.kind==="localFileUri")throw new Uhe(r);return await ffr({ctx:this.ctx,git:this.git},e.cloneUrl,r,e.ref),r})}async ensurePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?(await this.ensureRepository(e.marketplaceReference),this.getPluginInstallUri(e)):this.getPluginSource(e.sourceDescriptor.kind).ensure(this.cacheRoot,e)}async updatePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?this.pullRepository(e.marketplaceReference):this.getPluginSource(e.sourceDescriptor.kind).update(this.cacheRoot,e)}async pullRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);return await Yd(r)?this.git.pull(r):(this.logger.warn(this.ctx,"cannot pull: repository not cloned",{repoDir:r}),!1)}async fetchRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);if(!await Yd(r))return!1;try{return await this.git.fetch(r),await this.git.revListCount(r,"HEAD","@{u}")>0}catch(n){return this.logger.debug(this.ctx,"silent fetch failed",{repoDir:r,err:String(n)}),!1}}async cleanupPluginSource(e){let r=this.sources.get(e.sourceDescriptor.kind);if(!r)return;let n=r.getCleanupTarget(this.cacheRoot,e.sourceDescriptor);if(!n||!RE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${y$s++}`;if(await Ghe(`${n}.lock`,async()=>{if(await this.isCloneReferenced(n)){this.logger.info(this.ctx,"skipping cleanup: clone still referenced by another editor",{cleanupDir:n});return}try{await Yd(n)&&await oNe.promises.rename(n,s),o=!0}catch(c){this.logger.warn(this.ctx,"failed to vacate plugin clone",{cleanupDir:n,err:String(c)})}}),!!o){try{await oNe.promises.rm(s,{recursive:!0,force:!0}),this.logger.info(this.ctx,"removed plugin clone",{cleanupDir:n})}catch(c){this.logger.warn(this.ctx,"failed to remove vacated plugin clone",{tombstone:s,err:String(c)})}await this.pruneEmptyParents(n).catch(c=>this.logger.warn(this.ctx,"failed to prune empty parents",{cleanupDir:n,err:String(c)}))}}async isCloneReferenced(e){return(await this.store.readInstalledForAllEditors()).some(n=>{let o=jX.isAbsolute(n.pluginUri)?n.pluginUri:jX.resolve(this.cacheRoot,n.pluginUri);return RE(e,o)})}async pruneEmptyParents(e){let r=jX.dirname(e);for(;RE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await oNe.promises.readdir(r)).length>0)break;await oNe.promises.rmdir(r)}catch{break}r=jX.dirname(r)}}};p();p();function gZn(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(gZn,"isInstalledEntry");var PH=require("fs"),H2=de(require("path"));var AZn="plugins",C$s="plugins",b$s="installed.json",S$s="enablement.json",T$s="marketplaces.json",I$s=".lock",x$s=0,yZn=a(t=>typeof t=="string","isString"),sNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return H2.join(this.rootDir,AZn)}editorPluginsDir(e){return H2.join(this.rootDir,this.safeEditorSegment(e),C$s)}installedJsonPath(e){return H2.join(this.editorPluginsDir(e),b$s)}enablementJsonPath(e){return H2.join(this.editorPluginsDir(e),S$s)}marketplacesJsonPath(e){return H2.join(this.editorPluginsDir(e),T$s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,gZn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,yZn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,yZn);return{version:r,marketplaces: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 writeMarketplaces(e,r){await this.writeJsonAtomic(this.marketplacesJsonPath(e),r)}async withLock(e,r){let n=H2.join(this.editorPluginsDir(e),I$s);return Ghe(n,r)}async listEditorIds(){let e;try{e=await PH.promises.readdir(this.rootDir,{withFileTypes:!0})}catch{return[]}let r=e.filter(o=>(o.isDirectory()||o.isSymbolicLink())&&t.isSafeEditorId(o.name)),n=await Promise.all(r.map(o=>PH.promises.stat(this.installedJsonPath(o.name)).then(s=>s.isFile(),()=>!1)));return r.filter((o,s)=>n[s]).map(o=>o.name)}async readInstalledForAllEditors(){let e=await this.listEditorIds();return(await Promise.all(e.map(n=>this.readInstalled(n)))).flatMap(n=>n.installed)}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===AZn||e!==H2.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 PH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=H2.dirname(e);await PH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${x$s++}.tmp`,s=JSON.stringify(r,null,2)+` +`;try{await PH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await PH.promises.rename(o,e)}catch(c){throw await PH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var vZn=require("os"),Vhe=de(require("path"));var EZn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},_Zn=new Set,w$s=new Set(Bhe.filter(t=>t.changeSignal).map(t=>t.name)),uc=class{constructor(e,r,n=50,o=(0,vZn.homedir)(),s=process.env.COPILOT_HOME||Vhe.join(o,nfr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new fe("AgentPluginService");this._onDidChangePlugins=new rp;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new zx;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new sNe(this.ctx.get(ti).directory)),this._store}get repository(){return this._repository||(this._git??=new Alt(this.ctx),this._repository=new Slt(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new Elt(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new ylt(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(sNe.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),s=await KJn(this.discoveryDeps(r)),c=await hS(s,hlt,l=>this.toPlugin(l,o));return c.sort((l,u)=>l.uri.localeCompare(u.uri)),c}async toPlugin(e,r){let n=await this.readContributionsSafely(e),o=e.fromMarketplace?.name||n.manifestName||e.displayName||Vhe.basename(e.fsPath);return{uri:e.uri,label:o,enabled:!r.has(e.uri),hooks:n.hooks,commands:n.commands,skills:n.skills,agents:n.agents,instructions:n.instructions,mcpServerDefinitions:n.mcpServerDefinitions,...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await LJn(e.fsPath);return XJn(e.fsPath,n,{userHome:this.userHome,...e.repositoryBoundary!==void 0&&{repositoryBoundary:e.repositoryBoundary}})})().catch(n=>(this.logger.debug(this.ctx,"listPlugins: reading contributions failed",{uri:e.uri,err:String(n)}),EZn));return s3(r,plt,EZn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return afr(e,this.copilotHome)}discoveryDeps(e){let r=new Map;return{...this.discoveryRoots(),installed:e,getRepositoryUri:a(n=>this.repository.getRepositoryUri(n),"getRepositoryUri"),resolveMarketplace:a(n=>this.resolveMarketplaceForList(n,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=FT(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n),c=await this.readMarketplacePluginFromDir(s,n,e.name,r);if(c)return c;if(e.pluginUri&&e.pluginUri!==s)return await this.readMarketplacePluginFromDir(e.pluginUri,n,e.name)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return s3(o,plt,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Yd(e))return;let s=o?.get(e);s||(s=this.marketplace.readAllPluginsFromDirectory(e,r),o?.set(e,s));let l=(await s).find(u=>u.name===n);return l||(await this.marketplace.readSinglePluginManifest(e,r)??void 0)}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(_Zn)}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){return Vhe.isAbsolute(e.pluginUri)?sfr(e.pluginUri):!1}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Ir).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 rNe(this.ctx,r,{matches:rZn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(_Zn)});let n=this.discoveryRoots();for(let o of Bhe){let s=o.changeSignal;if(!s)continue;let c=new rNe(this.ctx,s.dir(n),{createDir:s.createDir,matches:ufr(s.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(c.onDidChange(()=>{this.refreshAndMaybeFire(new Set([o.name]))})),this._sourceWatchers.push(c)}this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(w$s)}catch{}}),!this._disposed&&await Promise.all([this._fileWatcher?.start(),...this._sourceWatchers.map(e=>e.start())])}refreshAndMaybeFire(e){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let r;try{r=await this.stateKey(e)}catch(n){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(n)});return}r!==this._lastStateKey&&(this._lastStateKey=r,this._onDidChangePlugins.fire())})}async stateKey(e){let r=this.editorId,[{installed:n},{disabled:o}]=await Promise.all([this.store.readInstalled(r),this.store.readEnablement(r)]),s=this.discoveryRoots();for(let l of Bhe){let u=l.changeSignal;if(!u||!e.has(l.name)&&this._lastSourceListings.has(l.name))continue;let d=await u.listing(s);d!==void 0&&this._lastSourceListings.set(l.name,d)}let c={};for(let l of Bhe)l.changeSignal&&(c[l.name]=[...this._lastSourceListings.get(l.name)??[]].sort());return JSON.stringify({installed:n.map(l=>[l.pluginUri,l.name]).sort((l,u)=>l[0].localeCompare(u[0])||l[1].localeCompare(u[1])),disabled:[...o].sort(),sources:c})}async installPlugin(e){let r=await this.install.acquirePlugin(e);return await this.mutate(async n=>{let o=await this.store.readInstalled(n),s={pluginUri:r,marketplace:e.marketplaceReference.rawValue,name:e.name},c=o.installed.find(u=>u.pluginUri===r);if(c&&c.name===s.name&&c.marketplace===s.marketplace)return!1;let l=c?o.installed.map(u=>u.pluginUri===r?s:u):[...o.installed,s];return await this.store.writeInstalled(n,{...o,installed:l}),this.logger.info(this.ctx,"installed plugin",{pluginUri:r,name:s.name}),!0}),r}async uninstallPlugin(e){let r;if(await this.mutate(async o=>{let s=await this.store.readInstalled(o),c=s.installed.findIndex(u=>u.pluginUri===e);if(c<0)return!1;r=s.installed[c];let l=s.installed.filter((u,d)=>d!==c);return await this.store.writeInstalled(o,{...s,installed:l}),await this.pruneEnablement(o,[e]),this.logger.info(this.ctx,"uninstalled plugin",{pluginUri:e,name:r.name}),!0}),!r)return;let n;try{n=await this.install.resolveInstalled(r)}catch(o){this.logger.warn(this.ctx,"skip clone GC: resolving installed plugin source failed",{pluginUri:e,err:String(o)});return}if(!n){this.logger.debug(this.ctx,"skip clone GC: could not resolve installed plugin source",{pluginUri:e});return}await this.repository.cleanupPluginSource(n).catch(o=>this.logger.warn(this.ctx,"plugin clone cleanup failed",{pluginUri:e,err:String(o)}))}async installPluginFromSource(e,r){let n=FT(e);if(!n)throw new Qhe(e);let o=await this.install.resolveFromSource(n);if(o.plugins.length===0)return{installed:!1,candidates:[]};let s;if(r!==void 0){if(s=o.plugins.find(l=>l.name===r),!s)return{installed:!1,candidates:o.plugins}}else if(o.plugins.length===1)s=o.plugins[0];else return{installed:!1,candidates:o.plugins};return o.isSinglePluginRepo||await this.addMarketplaceReference(n),{installed:!0,pluginUri:await this.installPlugin(s),plugin:s}}async updatePlugin(e){let r=this.guardEditorId("updatePlugin");if(r===void 0)return!1;let{installed:n}=await this.store.readInstalled(r),o=n.find(l=>l.pluginUri===e);if(!o)return this.logger.warn(this.ctx,"updatePlugin: not installed for this editor",{pluginUri:e}),!1;let s;try{s=await this.install.resolveInstalled(o)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: resolving plugin source failed",{pluginUri:e,err:String(l)}),!1}if(!s)return this.logger.warn(this.ctx,"updatePlugin: could not resolve plugin source",{pluginUri:e}),!1;let c=!1;try{c=await this.repository.updatePluginSource(s)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: pulling latest content failed",{pluginUri:e,err:String(l)}),!1}return c&&this.logger.info(this.ctx,"updated plugin",{pluginUri:e,name:o.name}),c}async addMarketplaceReference(e){await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>FT(s)?.canonicalId===e.canonicalId)?!1:(await this.store.writeMarketplaces(r,{...n,marketplaces:[...n.marketplaces,e.rawValue]}),this.logger.info(this.ctx,"registered marketplace",{reference:e.rawValue}),!0)})}async listMarketplaces(){let e=this.guardEditorId("listMarketplaces");if(e===void 0)return[];let{marketplaces:r}=await this.store.readMarketplaces(e);return EJn(r)}async addMarketplace(e){let r=FT(e);if(!r)throw new Qhe(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=FT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?FT(c)?.canonicalId!==r.canonicalId:!0);return s.length===o.marketplaces.length?!1:(await this.store.writeMarketplaces(n,{...o,marketplaces:s}),this.logger.info(this.ctx,"removed marketplace",{source:e}),!0)})}async browseMarketplace(e){let r;if(e!==void 0){let n=FT(e);if(!n)throw new Qhe(e,"marketplace source");r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose(),this._onDidChangePlugins.dispose()}}};p();function DH(t){try{return Ft(t,Ye.EnablePlugins)===!0}catch{return!1}}a(DH,"pluginsEnabled");var Tlt=de(require("path"));var HX=new fe("BackgroundAgent.PluginHooks"),Whe="copilot-plugin",pfr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function R$s(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=pfr[s.type];if(c!==void 0)for(let l of s.hooks){let u=hfr(l,e);if(!u)continue;let d=r[c]??=new Map,f=d.get(s.uri);f?f.push(u):d.set(s.uri,[u])}}let n={};for(let[o,s]of Object.entries(r))n[o]=[...s].map(([c,l])=>({source:c,hooks:l}));return n}a(R$s,"groupPluginHooksBySource");async function CZn(t,e){if(!DH(t)||!hJ(t))return{};let r;try{r=(await t.get(uc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof Sl?{}:(HX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=R$s(r,n),s={};return o.preToolUse&&(s.preToolUse=[P$s(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[D$s(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[N$s(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[M$s(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[O$s(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[L$s(t,n,o.errorOccurred)]),s}a(CZn,"buildPluginHookHandlers");function bZn(t,e){let r={...t};return e.preToolUse?.length&&(r.preToolUse=[...t.preToolUse??[],...e.preToolUse]),e.postToolUse?.length&&(r.postToolUse=[...t.postToolUse??[],...e.postToolUse]),e.userPromptSubmitted?.length&&(r.userPromptSubmitted=[...t.userPromptSubmitted??[],...e.userPromptSubmitted]),e.sessionStart?.length&&(r.sessionStart=[...t.sessionStart??[],...e.sessionStart]),e.sessionEnd?.length&&(r.sessionEnd=[...t.sessionEnd??[],...e.sessionEnd]),e.errorOccurred?.length&&(r.errorOccurred=[...t.errorOccurred??[],...e.errorOccurred]),r}a(bZn,"mergePluginHooks");function hfr(t,e){let r=process.platform==="darwin"?t.osx:process.platform==="linux"?t.linux:void 0,n=t.command??r??t.linux??t.osx,o=t.windows??t.command;if(n===void 0&&o===void 0)return;let s=k$s(t.cwd,e);return{type:"command",...n!==void 0&&{bash:n},...o!==void 0&&{powershell:o},...s!==void 0&&{cwd:s},...t.env&&{env:t.env},...t.timeout!==void 0&&{timeoutSec:t.timeout}}}a(hfr,"toCommandHook");function k$s(t,e){if(t!==void 0)return Tlt.isAbsolute(t)?t:Tlt.join(e,t)}a(k$s,"resolveHookCwd");function zhe(t,e){return async r=>{if(hJ(t))return e(r)}}a(zhe,"gated");function P$s(t,e,r){return{source:Whe,handler:zhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:qDe(n.toolArgs)};for(let s of r){let c=await new a2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===ede.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){HX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(P$s,"pluginPreToolUseHandler");function D$s(t,e,r){return{source:Whe,handler:zhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:qDe(n.toolArgs),toolResult:{resultType:Mdr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new s2(s.source,s.hooks).fire(t,o)}catch(o){HX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(D$s,"pluginPostToolUseHandler");function N$s(t,e,r){return{source:Whe,handler:zhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new c2(s.source,s.hooks).fire(t,o)}catch(o){HX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(N$s,"pluginUserPromptSubmittedHandler");function M$s(t,e,r){return{source:Whe,handler:zhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new fJ(s.source,s.hooks).fire(t,o)}catch(o){HX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(M$s,"pluginSessionStartHandler");function O$s(t,e,r){return{source:Whe,handler:zhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new dJ(s.source,s.hooks).fire(t,o)}catch(o){HX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(O$s,"pluginSessionEndHandler");function L$s(t,e,r){return{source:Whe,handler:zhe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,error:{message:n.error.message,name:n.error.name,...n.error.stack!==void 0&&{stack:n.error.stack}}};for(let s of r)await new dF(s.source,s.hooks).fire(t,o)}catch(o){HX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(L$s,"pluginErrorOccurredHandler");p();var SZn=de(require("node:path"));function TZn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(TZn,"sanitizeForPrompt");function B$s(t){let e=t.startsWith("file:")?un(t):t;return TZn(SZn.basename(e))}a(B$s,"confinedBasename");function F$s(t){let e=t.startsWith("file:")?un(t):t;return TZn(e)}a(F$s,"confinedAbsolutePath");function IZn(t){let e=B$s(t),r=F$s(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(yZn,"buildInlineSystemPrompt");p();function S$s(t){return Ft(t,Ye.EnableSandbox)===!0}a(S$s,"isSandboxEnabled");function Clt(t){if(!S$s(t))return;let e={enabled:!0},r=Ft(t,Ye.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=Ft(t,Ye.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Clt,"getSandboxConfig");p();Mo();var T$s={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 ffr(t,e){return t.get(bf).getInstructions(t,e,T$s)}a(ffr,"getGitCommitInstructions");var HX=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(` +`)}a(IZn,"buildInlineSystemPrompt");p();function U$s(t){return Ft(t,Ye.EnableSandbox)===!0}a(U$s,"isSandboxEnabled");function Ilt(t){if(!U$s(t))return;let e={enabled:!0},r=Ft(t,Ye.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=Ft(t,Ye.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Ilt,"getSandboxConfig");p();Oo();var Q$s={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 mfr(t,e){return t.get(Tf).getInstructions(t,e,Q$s)}a(mfr,"getGitCommitInstructions");var GX=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.skills,"pick")},{type:"agent",pick:a(t=>t.agents,"pick")},{type:"instructions",pick:a(t=>t.instructions,"pick")},{type:"prompt",pick:a(t=>t.commands,"pick")}],g8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new fe("PluginContributionInjector");this.registered=new Map;this.disposed=!1;this.syncChain=Promise.resolve();this.changeSubscription=this.service.onDidChangePlugins(()=>this.scheduleSync()),this.gateSubscription=this.subscribeToGateChanges()}static{a(this,"PluginContributionInjector")}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);return this.lastPluginsEnabled=W5(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=W5(this.ctx);r!==this.lastPluginsEnabled&&(this.lastPluginsEnabled=r,this.initialSyncPromise=void 0,this.scheduleSync())})}catch{return}}async ensureInitialSync(){if(this.disposed)return;if(this.initialSyncPromise)return this.initialSyncPromise;if(!this.isEditorIdentityKnown())return;let e,r=new Promise(n=>e=n);return this.initialSyncPromise=r,this.syncChain=this.syncChain.then(()=>this.sync()).then(n=>{n||(this.initialSyncPromise=void 0)}).catch(n=>{this.initialSyncPromise=void 0,this.logger.warn(this.ctx,"plugin contribution initial sync failed",{err:String(n)})}).finally(()=>e()),r}isEditorIdentityKnown(){try{return this.ctx.get(Ir).isEditorPluginInfoKnown()}catch{return!0}}scheduleSync(){this.syncChain=this.syncChain.then(()=>this.sync()).then(()=>{}).catch(e=>{this.logger.warn(this.ctx,"plugin contribution sync failed",{err:String(e)})})}syncedForTesting(){return this.syncChain}async sync(){if(this.disposed)return!0;if(!W5(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(n=>n.enabled)}catch(n){return this.logger.warn(this.ctx,"listPlugins failed during sync",{err:String(n)}),!1}if(this.disposed)return!0;let r=new Map(e.map(n=>[n.uri,n]));for(let n of[...this.registered.keys()])r.has(n)||this.teardownPlugin(n);for(let[n,o]of r)if(await this.reconcilePlugin(n,o),this.disposed)return!0;return!0}async reconcilePlugin(e,r){let n=this.registered.get(e),o=I$s(r),s=x$s(r),c=n?.disposables??[];if(!n||n.fileHash!==o){for(let u of c)u.dispose();c=this.registerFiles(e,r)}let l=n?.mcpApplied??!1;if((!n||n.mcpHash!==s||!n.mcpApplied)&&(l=await this.applyMcp(e,r,n)),this.disposed){for(let u of c)u.dispose();l&&this.tryManager()?.removePluginServers(e).catch(d=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(d)}));return}this.registered.set(e,{fileHash:o,mcpHash:s,mcpApplied:l,disposables:c})}registerFiles(e,r){let n=this.tryRegistry();if(!n)return[];let o=[];for(let{type:s,pick:c}of EZn)for(let l of c(r))o.push(n.register(s,[w$s(l.uri)],{watchable:!1,classification:{storage:"plugin",pluginInfo:{name:l.name,description:l.description??"",pluginUri:e}}}));return o}async applyMcp(e,r,n){let o=this.tryManager();if(!o)return!0;let s=R$s(r.mcpServerDefinitions);if(Object.keys(s).length===0&&!n?.mcpApplied)return!0;try{return await o.applyPluginServers(e,s),!0}catch(c){return this.logger.warn(this.ctx,"applyPluginServers failed",{uri:e,err:String(c)}),!1}}teardownPlugin(e){let r=this.registered.get(e);if(!r)return;for(let o of r.disposables)o.dispose();let n=this.tryManager();n&&n.removePluginServers(e).catch(o=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(o)})),this.registered.delete(e)}teardownAll(){for(let e of[...this.registered.keys()])this.teardownPlugin(e)}tryRegistry(){return this.tryGet(wA)}tryManager(){return this.tryGet(ey)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof bl)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function I$s(t){let e=EZn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(I$s,"fileContentHash");function x$s(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(x$s,"mcpContentHash");function w$s(t){return t.includes("://")?un(t):t}a(w$s,"toPathPattern");function R$s(t){let e={};for(let{name:r,configuration:n}of t)n.type==="stdio"?e[r]={command:n.command,...n.args&&{args:[...n.args]},...n.env&&{env:{...n.env}},...n.cwd&&{cwd:n.cwd}}:e[r]={url:n.url,...n.headers&&{headers:{...n.headers}}};return e}a(R$s,"toMcpServersConfig");var _Zn=de(require("node:path"));var blt=new fe("BackgroundAgent.SessionOptionsBuilder"),k$s=5e3;async function vZn(t,e,r,n){let o=o3((async()=>{try{await t.get(g8).ensureInitialSync()}catch(A){if(!(A instanceof bl))throw A}})(),k$s,void 0),s=await n.buildAuthInfo(),c=to(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(h0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:S$e(t.get(Ir))??"jetbrains-chat",sessionId:e,authInfo:s,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:l,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:c};try{await t.get(w3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await Kct(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(PT).buildMcpServers(f);blt.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:A}),Object.keys(A).length>0&&(u.mcpServers=A)}catch(A){if(!(A instanceof bl))throw A}u.hooks=oJn(t,r.workspaceFolder);let h=await hZn(t,r.workspaceFolder);if(u.hooks=mZn(u.hooks,h),r.inlineConfinedFile){let A=[...u.hooks.preToolUse??[]];r.inlineConfinementHook&&A.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&A.unshift(r.inlineTurnLimiter.hook),u.hooks={...u.hooks,preToolUse:A},u.systemMessage={mode:"append",content:yZn(r.inlineConfinedFile)}}else{let A=await ffr(t,[r.workspaceFolder]).catch(v=>{blt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await D$s(t,c):void 0,E=r.useNestedClaudeMdFiles===!0?await P$s(t,c):void 0,_=uJn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:E});_!==void 0&&(u.systemMessage={mode:"append",content:_})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=sJn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Clt(t);return g&&(u.sandboxConfig=g),u}a(vZn,"buildSessionOptions");async function P$s(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await cJn(async n=>r.readDirectory(Ks(n)),async n=>CZn(r,e,n),e)}catch(n){blt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(P$s,"scanNestedClaudeSection");async function D$s(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await lJn(async n=>r.readDirectory(Ks(n)),async n=>CZn(r,e,n),e)}catch(n){blt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(D$s,"scanNestedAgentsSection");async function CZn(t,e,r){try{return await t.readFileString(Ks(_Zn.join(e,r)))}catch{return}}a(CZn,"readNestedFile");p();var N$s=20,Slt=new fe("BackgroundAgent.SessionRegistry"),Tlt=class{constructor(e){this.ctx=e;this.sessions=new Map;this.workingDirs=new Map;this.workspaceFolderUris=new Map;this.mcpDirectories=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.appliedSandboxConfig=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>N$s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(Slt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>Slt.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}setWorkspaceFolderUri(e,r){this.workspaceFolderUris.set(e,r)}getWorkspaceFolderUri(e){return this.workspaceFolderUris.get(e)}setMcpDirectory(e,r){this.mcpDirectories.set(e,r)}getMcpDirectory(e){return this.mcpDirectories.get(e)}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)}setAppliedSandboxConfig(e,r){this.appliedSandboxConfig.set(e,r)}getAppliedSandboxConfig(e){return this.appliedSandboxConfig.get(e)}deleteAppliedSandboxConfig(e){this.appliedSandboxConfig.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){Slt.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){Slt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.workingDirs.delete(e),this.workspaceFolderUris.delete(e),this.mcpDirectories.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.appliedSandboxConfig.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.workspaceFolderUris.clear(),this.mcpDirectories.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.appliedSandboxConfig.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var pfr=require("node:fs"),GX=de(require("node:path"));function bZn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(bZn,"sanitizePathSegment");function xlt(t){return typeof t=="string"?t:void 0}a(xlt,"asString");function Ilt(t){return typeof t=="number"?t:void 0}a(Ilt,"asNumber");function M$s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:xlt(r.toolCallId),tool:xlt(r.name)}}):[]}a(M$s,"asToolCallArray");function O$s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(O$s,"toToolResultText");function L$s(t){try{return JSON.stringify(t)}catch{return}}a(L$s,"safeStringify");var hfr=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=cQt(new Date),s=bZn(r);this.sessionDir=GX.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?GX.join(this.sessionDir,"runSubAgent",bZn(e)):this.sessionDir}appendJsonl(e,r){let n=L$s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await pfr.promises.mkdir(GX.dirname(e),{recursive:!0}),await pfr.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Ilt(e.data.inputTokens),outputTokens:Ilt(e.data.outputTokens),cacheReadTokens:Ilt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=M$s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(GX.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Ilt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=xlt(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=xlt(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(GX.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:O$s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function SZn(t,e,r){let n=Ft(t,Ye.PromptPersistBasePath)?.trim()||void 0;if(n)return new hfr(n,e,r)}a(SZn,"createBackgroundAgentPersistence");p();var wlt=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();p();var Jo={OPERATION_NAME:"gen_ai.operation.name",AGENT_NAME:"gen_ai.agent.name",SYSTEM:"gen_ai.system",REQUEST_MODEL:"gen_ai.request.model",RESPONSE_MODEL:"gen_ai.response.model",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",CONVERSATION_ID:"gen_ai.conversation.id",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",TURN_COUNT:"gen_ai.turn_count",TOTAL_COST_USD:"gen_ai.total_cost_usd",TOOL_NAME:"gen_ai.tool.name",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result"};var xZn=require("crypto");var mfr=new fe("BackgroundAgent.CliOTelTracker"),B$s={USER_REQUEST:"copilot_chat.user_request"},gfr="main";function zhe(t){return(0,xZn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(zhe,"generateHexId");function wZn(){return BigInt(Date.now())*1000000n}a(wZn,"nowNano");function Yhe(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return wZn()}a(Yhe,"isoToNano");function TZn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(TZn,"toAttributeString");function IZn(t){return JSON.stringify([{role:"assistant",parts:[{type:"text",content:t}]}])}a(IZn,"outputMessagesJson");function RZn(t,e,r){if(!t.get(bn).getCapabilities().agentDebugLog)return;let n=t.get(pv);if(n.isEnabled())return new Afr(t,e,r,n)}a(RZn,"createCliOTelTracker");var Afr=class{constructor(e,r,n,o){this._ctx=e;this._sessionId=r;this._session=n;this._persistence=o;this._pendingTools=new Map}static{a(this,"CliOTelTracker")}onEvent(e){switch(e.type){case"user.message":this._pendingUserRequest=e.data.content;break;case"assistant.turn_start":this._ensureRequest(Yhe(e.timestamp));break;case"assistant.usage":this._onUsage(e);break;case"assistant.message":this._onAssistantMessage(e);break;case"tool.execution_start":this._onToolStart(e);break;case"tool.execution_complete":this._onToolComplete(e);break;case"session.idle":case"session.error":this._flushRequest().catch(r=>{mfr.warn(this._ctx,`Failed to flush debug spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)});break;default:break}}_ensureRequest(e){return this._request||(this._request={traceId:zhe(16),invokeAgentSpanId:zhe(8),startNano:e,userRequest:this._pendingUserRequest,usages:[],responseByAgent:new Map,toolSpanIds:new Map,pendingReads:[]},this._pendingUserRequest=void 0),this._request}_onUsage(e){let r=this._ensureRequest(Yhe(e.timestamp)),n={data:e.data,endNano:Yhe(e.timestamp),agentKey:e.data.parentToolCallId??gfr,parentToolCallId:e.data.parentToolCallId};r.usages.push(n),r.pendingReads.push(this._readAssembled().then(({inputMessagesJson:o,systemInstructions:s})=>{n.inputMessagesJson=o,n.systemInstructions=s}))}_onAssistantMessage(e){let r=this._request;if(!r)return;let n=e.data.content;if(!n)return;let o=e.data.parentToolCallId??gfr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(Yhe(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=zhe(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:Yhe(e.timestamp)}),n.toolSpanIds.set(r,c)}_onToolComplete(e){let r=e.data.toolCallId;if(!r)return;let n=this._pendingTools.get(r);if(!n)return;this._pendingTools.delete(r);let o=Yhe(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[Jo.OPERATION_NAME]:"execute_tool",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.TOOL_NAME]:n.toolName,[Jo.TOOL_CALL_ID]:r},u=TZn(n.arguments);u!==void 0&&(l[Jo.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=TZn(d);f!==void 0&&(l[Jo.TOOL_CALL_RESULT]=f),this._appendSpans([{traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,name:`execute_tool ${n.toolName}`,kind:1,startTimeUnixNano:n.startNano.toString(),endTimeUnixNano:o.toString(),attributes:k2(l),events:[],status:s?{code:2,message:c??"Tool execution error"}:{code:1}}])}async _flushRequest(){let e=this._request;if(!e)return;this._request=void 0,await Promise.allSettled(e.pendingReads);let r=wZn(),n=[this._buildInvokeAgentSpan(e,r)],o=this._buildUserMessageSpan(e);o&&n.push(o);let s=new Map;e.usages.forEach((c,l)=>{c.data.model&&s.set(c.agentKey,l)}),e.usages.forEach((c,l)=>{let u=s.get(c.agentKey)===l,d=this._buildChatSpan(e,c,u);d&&n.push(d)}),n.push(...this._buildAgentResponseSpans(e)),this._appendSpans(n)}_buildInvokeAgentSpan(e,r){return{traceId:e.traceId,spanId:e.invokeAgentSpanId,name:"invoke_agent copilotcli",kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:k2({[Jo.OPERATION_NAME]:"invoke_agent",[Jo.AGENT_NAME]:"copilotcli",[Jo.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:zhe(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:k2({[Jo.OPERATION_NAME]:"user_message",[Jo.CONVERSATION_ID]:this._sessionId,[B$s.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:k2({content:e.userRequest})}],status:{code:1}}}_buildAgentResponseSpans(e){let r=new Map;for(let o of e.usages)o.data.model&&r.set(o.agentKey,o.endNano);let n=[];for(let[o,s]of e.responseByAgent){if(!s)continue;let c=o===gfr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:zhe(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:k2({[Jo.OPERATION_NAME]:"agent_response",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.OUTPUT_MESSAGES]:IZn(s)}),events:[],status:{code:1}})}return n}_buildChatSpan(e,r,n){let o=r.data.model;if(!o)return;let s=(r.parentToolCallId?e.toolSpanIds.get(r.parentToolCallId):void 0)??e.invokeAgentSpanId,c={[Jo.OPERATION_NAME]:"chat",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[Jo.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[Jo.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[Jo.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[Jo.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[Jo.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[Jo.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[Jo.OUTPUT_MESSAGES]=IZn(h));let m=r.endNano,g=r.data.duration,A=typeof g=="number"&&g>=0?m-BigInt(Math.round(g))*1000000n:m;return{traceId:e.traceId,spanId:zhe(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:k2(c),events:[],status:{code:1}}}async _readAssembled(){try{let e=await this._session.getChatContextMessages();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:this._session.getCurrentSystemMessage()}}catch(e){return mfr.warn(this._ctx,`Failed to read assembled messages for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`),{}}}_appendSpans(e){if(e.length!==0)try{this._persistence.appendSpans(e).catch(r=>this._warnPersistFailure(r))}catch(r){this._warnPersistFailure(r)}}_warnPersistFailure(e){mfr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Mo();var A8=new fe("BackgroundAgent.TurnDriver"),yfr="backgroundAgent",Rlt=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set;this.lastNanoAiu=new Map}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=SZn(this.ctx,e,`bg-turn-${Mt()}`),d=RZn(this.ctx,e,r);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.lastNanoAiu.delete(e),this.forget(e)},"dispose")}));let f=a(()=>{},"noop"),h=r.on("user_input.requested",f),m=r.on("permission.requested",f),g=r.on("exit_plan_mode.requested",f);$Gn(r,!0);let A=new wlt,y=r.on("*",w=>{if(w.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(w)}catch(R){A8.warn(this.ctx,"Failed to persist background-agent event",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}if(A.trackEvent(w),d)try{d.onEvent(w)}catch(R){A8.warn(this.ctx,"Failed to synthesize debug span",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}this.handleSessionEvent(e,w,o)}),E=!1,_=a(()=>{E||(E=!0,this.emitTurnCompleteTelemetry(e,r,l,A.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),T?.dispose(),h(),m(),g(),y(),v(),b(),this.forget(e)},"cleanup"),v=r.on("session.idle",()=>{_()}),b=r.on("session.error",()=>{_()}),T;s&&(T=s.onCancellationRequested(()=>{A8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(w=>{_();let R=Mrt(w);s?.isCancellationRequested?A8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(A8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:R,stack:w instanceof Error?w.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let x={type:"session.error",id:Mt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:R}};this.sendSessionUpdateNotification(e,x,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.lastNanoAiu.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){A8.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){A8.error(this.ctx,"Failed to send session update notification:",o)}}async emitTurnCompleteTelemetry(e,r,n,o,s){try{let c=performance.now()-n,l=this.registry.getChatMode(e)??"agent",d=(await r.usage.getMetrics()).totalNanoAiu,f=this.lastNanoAiu.get(e)??0,h=typeof d=="number"&&Number.isFinite(d),m=h?Math.min(f,d):f;h&&this.lastNanoAiu.set(e,d);let g=h?(d-m)/1e9:0;At(this.ctx,"backgroundAgent.turn.complete",{requestSource:yfr,sessionId:e,chatMode:l,agentProvider:"BACKGROUND",turnIndex:s!=null?String(s):""},{totalDurationMs:c,totalUserWaitMs:o?o.permission.totalMs+o.user_input.totalMs+o.exit_plan_mode.totalMs:0,permissionWaitMs:o?.permission.totalMs??0,permissionWaitCount:o?.permission.count??0,userInputWaitMs:o?.user_input.totalMs??0,userInputWaitCount:o?.user_input.count??0,exitPlanModeWaitMs:o?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:o?.exit_plan_mode.count??0,credits:g})}catch(c){A8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){At(this.ctx,"backgroundAgent.turn.failed",{requestSource:yfr,sessionId:e,agentProvider:"BACKGROUND",errorType:n,turnIndex:r!=null?String(r):""})}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);At(this.ctx,"backgroundAgent.session.metrics",{requestSource:yfr,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){A8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function kZn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(kZn,"applyAgentModeOverride");p();async function PZn(t,e,r,n,o){let s=n.chatMode??"agent",c=fat(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:Ks(u)};o.deleteChatMode(e),await MGn(r,c,{loadCustomAgents:a(()=>Kct(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(h0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let f=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(PT).buildMcpServers(f))}catch(h){if(h instanceof bl)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(PZn,"applyChatModeOverride");p();var DZn=new fe("BackgroundAgent.applyChatModeSelection");async function NZn(t,e,r){if(r.chatMode===void 0||fat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),DZn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),DZn.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(NZn,"applyChatModeSelection");p();var MZn=require("node:util");function OZn(t,e,r,n){let o=Clt(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,MZn.isDeepStrictEqual)(s,o)||(r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(OZn,"applySandboxOverride");p();p();var $X=new fe("BackgroundAgent.ProviderConfig");async function LZn(t,e,r){if(!e)return;let n=await Wze(t,e,r);if(!n){$X.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new da(t.get(Yn)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){$X.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===io.Anthropic)return{type:"anthropic",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===io.Azure){if(!o){$X.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return U$s(t,o,n,r,l)}if(jle(e))return{type:"openai",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(vK(e))return F$s(t,e,n,r,o,l);$X.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(LZn,"buildProviderConfig");async function F$s(t,e,r,n,o,s){if(!o){$X.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new da(t.get(Yn)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:XIe,f=Vze(o,d);return d==="messages"?{type:"anthropic",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}:{type:"openai",wireApi:d==="responses"?"responses":"completions",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}}a(F$s,"buildCustomEndpointProviderConfig");function U$s(t,e,r,n,o){let s;try{s=new URL(e)}catch{$X.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};$X.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(U$s,"buildAzureProviderConfig");var Efr=new fe("BackgroundAgent.applyTurnOverrides");async function BZn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!XQ(await t.get(Qt).getToken()))throw new YRe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await LZn(t,o,r.model);if(o!==void 0&&s===void 0)throw new zRe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===io.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){Efr.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)));Efr.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}),Efr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(BZn,"applyTurnOverrides");p();async function FZn(t,e,r,n,o){let s=q$s(e,n),c=o==="inline"||o==="inline-ask";await t.get(Cg).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||Q$s(t,r)}a(FZn,"expandPromptTemplate");function Q$s(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!Fxn.has(s))return!1;let c=n2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(Q$s,"applyBuiltinCreateTemplate");function q$s(t,e){let r=e.getWorkingDir(t);return r?{uri:Ks(r)}:void 0}a(q$s,"getWorkspaceFolderForSession");Mo();var ty=new fe("BackgroundAgent"),RH="backgroundAgent",j$s="backgroundAgent.remote",H$s=new Set(["system.message","hook.start","hook.end"]),Hs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ts),this.managerLifecycle=new kat(e),this.authBinding=new Nrt(e),this.registry=new Tlt(e),this.mcpSync=new Gct(e,this.registry),this.remoteController=new Yct(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Rlt(e,this.registry,this.notificationSender),e.get(Lo).onDidChangeHttpSettings(()=>{uat(this.ctx)}),bs(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(h0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(ty.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=s2n(n,e);return At(this.ctx,"backgroundAgent.interaction",{requestSource:RH,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 BZn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return NZn(this.ctx,e,r)}buildSessionOptions(e,r){return vZn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();ty.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Mt(),s=e.inlineConfinedFile?FGn(2):void 0,c=e.inlineConfinedFile?UGn(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),ty.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),At(this.ctx,"backgroundAgent.create",{requestSource:RH,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,to(e.workspaceFolder.uri).fsPath),this.registry.setWorkspaceFolderUri(o,e.workspaceFolder.uri),e.mcpDirectory&&this.registry.setMcpDirectory(o,e.mcpDirectory),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),ty.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}),ty.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:Ks(m)},ty.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.registry.deleteAppliedSandboxConfig(e),this.installBridgeSpanProcessor();let f=s?.uri?to(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),s?.uri&&this.registry.setWorkspaceFolderUri(e,s.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),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),this.applySandboxOverride(e.sessionId,o);let s=e.message;await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,...e.message!==s?{displayPrompt:s}:{},...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,c);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=o2n(e.references,this.ctx);m.length>0&&(c.attachments=m)}if(l){let m=this.registry.getConfinedFile(e.sessionId);if(m){let g=e.references?.find(y=>y.type==="file"&&y.uri===m),A=await qGn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?dat:Jar;o.updateOptions({availableTools:[...y,"view"]},{emitToolDefinitionsChanged:!0})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let u=performance.now(),d=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,c,d,r,!!e.providerName);let f={requestSource:RH,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:G$s(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(d)},h={totalTimeMs:performance.now()-u,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return At(this.ctx,"backgroundAgent.send",f,h),Et(this.ctx,"backgroundAgent.send",Wt.createAndMarkAsIssued(f,h)),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return At(this.ctx,"backgroundAgent.truncateHistory",{requestSource:RH,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}applyChatModeOverride(e,r,n){return PZn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){OZn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){kZn(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,...s.message!==r?{displayPrompt:r}:{},source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),At(this.ctx,"backgroundAgent.send",{requestSource:j$s,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 ty.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&ty.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),At(this.ctx,"backgroundAgent.stop",{requestSource:RH,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return At(this.ctx,"backgroundAgent.compactHistory",{requestSource:RH,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);ty.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return At(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:RH,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();ty.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());At(this.ctx,"backgroundAgent.resume",{requestSource:RH,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!H$s.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){ty.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let n=await this.ctx.get(xs).getMetadata(e),o=this.sdk?.EXCLUDED_MODELS,s=n.filter(u=>u.model_picker_enabled===!0).filter(u=>u.capabilities.type==="chat").filter(u=>!o?.has(u.id)).map(Drt);s.length===0?ty.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):ty.info(this.ctx,`Successfully retrieved ${s.length} models`);let c=[];this.ctx.get(jl).getPolicyValue("autoModel.enabled")!==!1&&c.push(this.buildAutoModelEntry());let l=[...c,...s];return ty.debug(this.ctx,"Models retrieved:",l.map(u=>u.id)),At(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:l.length}),{models:l}}catch(n){let o=n instanceof Error?n.message:String(n),s=kZt(n);throw ty.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),Vn(this.ctx,"backgroundAgent.listModels",n,{status_text:"failure",...s?{errorCause:s}:{}},{duration_ms:performance.now()-r}),new Error("Failed to retrieve models",{cause:n})}}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(),Kar(),c2n(),await this.managerLifecycle.dispose()}};function G$s(t,e){return e?"byok models":t??""}a(G$s,"safeModelId");p();p();var Ap=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ap||{});p();async function kb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return UZn(t,e,n,o),s}catch(s){throw o.error??=s,UZn(t,e,n,o),s}}a(kb,"runWithTelemetry");function UZn(t,e,r,n){let s={success:n.error?"false":n.ok??!0?"true":"false",...n.properties},c={totalTimeMs:performance.now()-r,...n.measurements};n.error!==void 0?Vn(t,`${e}.failure`,n.error,s,c):At(t,e,s,c)}a(UZn,"flushTelemetry");p();var QZn=de(require("path"));p();var _fr=["default","acceptEdits","bypassPermissions","plan","auto"];function VX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(VX,"assertClaudeProvider");function Khe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Khe,"assertNonEmptyString");function $$s(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($$s,"assertFsUri");function V$s(t,e,r){if(!QZn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(V$s,"assertAbsolutePath");function W$s(t,e){if(e!==void 0&&!_fr.includes(e))throw new Error(`${t}: agentMode must be one of ${_fr.join(", ")}, got '${e}'`)}a(W$s,"assertAllowedAgentMode");async function rNe(t,e){if(e===void 0)return;let n=(await t.get(xs).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!w$e(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(rNe,"validateClaudeModel");async function qZn(t,e){VX("createSession",e.agentProvider),$$s("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await rNe(t,e.model)}a(qZn,"validateAgentCreate");async function jZn(t,e){VX("resumeSession",e.agentProvider),Khe("resumeSession","sessionId",e.sessionId),await rNe(t,e.model)}a(jZn,"validateAgentResume");async function HZn(t,e){VX("sendMessage",e.agentProvider),Khe("sendMessage","sessionId",e.sessionId),Khe("sendMessage","message",e.message),W$s("sendMessage",e.agentMode),await rNe(t,e.model)}a(HZn,"validateAgentSend");function GZn(t,e){VX("stopSession",e.agentProvider),Khe("stopSession","sessionId",e.sessionId)}a(GZn,"validateAgentStop");function $Zn(t,e){VX("destroySession",e.agentProvider),Khe("destroySession","sessionId",e.sessionId)}a($Zn,"validateAgentDestroy");function VZn(t,e){VX("listSessions",e.agentProvider),Khe("listSessions","cwd",e.cwd),V$s("listSessions","cwd",e.cwd)}a(VZn,"validateAgentListSessions");function WZn(t,e){VX("listModels",e.agentProvider)}a(WZn,"validateAgentListModels");p();p();p();var JZn=require("child_process"),Jhe=de(require("path")),ZZn=de(AP()),XZn=require("util");var zZn=5e3,YZn=200,Zhe=class{constructor(e){this.execFile=(0,XZn.promisify)(JZn.execFile);this.cache=new Map;this.config=e}static{a(this,"BaseCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:this.config.notConfiguredMessage});let r=Jhe.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(Jhe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=this.validateBasename(e);if(r)return{severity:"error",message:r};let n;try{n=(await this.execFile(e,["--version"],{timeout:zZn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=ZZn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from "${e}" --version output: "${KZn(n)}". Cannot verify compatibility.`};let s=this.config.validateVersion(o,e);return s||{severity:"ok"}}validateBasename(e){let r=this.config.allowedBasenames;if(!r||r.length===0)return;let n=Jhe.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} path "${e}" must point at the "${r[0]}" executable, but the basename is "${Jhe.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at "${e}". Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at "${e}" did not respond to --version within ${zZn/1e3}s.`;let o=typeof n?.stderr=="string"?KZn(n.stderr):"",s=n?.code!==void 0?` (exit code ${String(n.code)})`:"",c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "${e} --version"${s}${l}${c}`}};function KZn(t){let e=t.trim();return e.length<=YZn?e:`${e.slice(0,YZn)}\u2026`}a(KZn,"truncate");var klt=de(AP());function z$s(){let t=oIe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(z$s,"getExpectedVersionRaw");var vfr=class extends Zhe{static{a(this,"ClaudeCliVersionChecker")}constructor(){super({displayName:"Claude Code CLI",allowedBasenames:process.platform==="win32"?["claude.exe"]:["claude"],notConfiguredMessage:"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.",validateVersion(e,r){let n=z$s(),o=klt.coerce(n);if(!o)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${n}" from packaged metadata. This is an internal error; please report it.`};if(!klt.satisfies(e,`~${o.major}.${o.minor}.0`))return{severity:"warning",message:`Claude Code CLI at "${r}" reports version ${e.version}, but this language server was built against ${o.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${o.version}\` to align versions.`}}})}},Xhe=new vfr;p();var eme=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 eXn(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(eXn,"buildPermissionRequest");function tXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:Y$s(t)}}a(tXn,"translatePermissionResult");function Y$s(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(Y$s,"formatDenyMessage");function rXn(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(rXn,"buildPreparedQuestions");function nXn(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(nXn,"buildUserInputRequest");p();var iXn=require("crypto");var K$s=new fe("ClaudeOTelTracker");function Cfr(t){return(0,iXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Cfr,"generateHexId");function Plt(){return BigInt(Date.now())*1000000n}a(Plt,"nowNano");var Dlt=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let r=Cfr(16),n=Cfr(8);this._rootSpan={traceId:r,spanId:n,name:"invoke_agent claude",startNano:Plt(),attributes:{[Jo.OPERATION_NAME]:"invoke_agent",[Jo.AGENT_NAME]:"claude",[Jo.SYSTEM]:"anthropic",[Jo.CONVERSATION_ID]:this._sessionId,...e?{[Jo.REQUEST_MODEL]:e}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,this._toolSpans.clear()}onMessage(e){if(this._rootSpan)switch(e.type){case"assistant":this._onAssistantMessage(e);break;case"user":this._onUserMessage(e);break;case"result":this._onResultMessage(e);break}}endRequest(){this._endRootSpan(1)}endRequestWithError(e){this._endRootSpan(2,e)}_onAssistantMessage(e){if(e.parent_tool_use_id!=null)return;let r=e.message?.content;if(Array.isArray(r))for(let n of r)n.type==="tool_use"&&this._startToolSpan(n.id,n.name)}_onUserMessage(e){let r=e.message?.content;if(Array.isArray(r)){for(let n of r)if(n.type==="tool_result"&&typeof n.tool_use_id=="string"){let o=n.is_error===!0;this._endToolSpan(n.tool_use_id,o)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;if(r&&(this._inputTokens=r.input_tokens??0,this._outputTokens=r.output_tokens??0,this._cacheReadTokens=r.cache_read_input_tokens??0,this._cacheCreationTokens=r.cache_creation_input_tokens??0),e.modelUsage){let n=Object.keys(e.modelUsage);n.length>0&&(this._rootSpan.attributes[Jo.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[Jo.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[Jo.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r){!this._rootSpan||this._toolSpans.has(e)||this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:Cfr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Plt(),attributes:{[Jo.OPERATION_NAME]:"execute_tool",[Jo.TOOL_NAME]:r,[Jo.TOOL_CALL_ID]:e,[Jo.CONVERSATION_ID]:this._sessionId}})}_endToolSpan(e,r){let n=this._toolSpans.get(e);if(!n)return;this._toolSpans.delete(e);let o=Plt(),s=this._buildOtlpSpan(n,o,r?2:1,r?"Tool execution error":void 0);this._flush([s])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[Jo.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[Jo.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[Jo.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[Jo.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Plt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear();let c=this._buildOtlpSpan(n,o,e,r);this._flush([...s,c])}_buildOtlpSpan(e,r,n,o){let s={traceId:e.traceId,spanId:e.spanId,name:e.name,kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:k2(e.attributes),events:[],status:o?{code:n,message:o}:{code:n}};return e.parentSpanId&&(s.parentSpanId=e.parentSpanId),s}_flush(e){e.length!==0&&this._persistence.appendSpans(e).catch(r=>{K$s.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var bfr=require("fs"),sXn=de(require("path"));var nNe=new fe("ClaudeCode.ReferenceFormatter"),J$s={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},oXn=5*1024*1024;async function aXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=rs(s.uri);if(!c){nNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=X$s(c);if(l){let u=await Z$s(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=rs(s.uri);if(!c){nNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:nNe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:eVs(n)}),o}a(aXn,"buildReferences");async function Z$s(t,e,r){try{let n=await bfr.promises.stat(t);if(n.size>oXn){nNe.debug(r,`Skipping oversize image reference (${n.size} > ${oXn} bytes): ${t}`);return}let o=(await bfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){nNe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(Z$s,"tryReadImageBlock");function X$s(t){return J$s[sXn.extname(t).toLowerCase()]}a(X$s,"imageMediaTypeForPath");function eVs(t){return` +`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt.skills,"pick")},{type:"agent",pick:a(t=>t.agents,"pick")},{type:"instructions",pick:a(t=>t.instructions,"pick")},{type:"prompt",pick:a(t=>t.commands,"pick")}],y8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new fe("PluginContributionInjector");this.registered=new Map;this.disposed=!1;this.syncChain=Promise.resolve();this.changeSubscription=this.service.onDidChangePlugins(()=>this.scheduleSync()),this.gateSubscription=this.subscribeToGateChanges()}static{a(this,"PluginContributionInjector")}subscribeToGateChanges(){try{let e=this.ctx.get(Bo);return this.lastPluginsEnabled=DH(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=DH(this.ctx);r!==this.lastPluginsEnabled&&(this.lastPluginsEnabled=r,this.initialSyncPromise=void 0,this.scheduleSync())})}catch{return}}async ensureInitialSync(){if(this.disposed)return;if(this.initialSyncPromise)return this.initialSyncPromise;if(!this.isEditorIdentityKnown())return;let e,r=new Promise(n=>e=n);return this.initialSyncPromise=r,this.syncChain=this.syncChain.then(()=>this.sync()).then(n=>{n||(this.initialSyncPromise=void 0)}).catch(n=>{this.initialSyncPromise=void 0,this.logger.warn(this.ctx,"plugin contribution initial sync failed",{err:String(n)})}).finally(()=>e()),r}isEditorIdentityKnown(){try{return this.ctx.get(Ir).isEditorPluginInfoKnown()}catch{return!0}}scheduleSync(){this.syncChain=this.syncChain.then(()=>this.sync()).then(()=>{}).catch(e=>{this.logger.warn(this.ctx,"plugin contribution sync failed",{err:String(e)})})}syncedForTesting(){return this.syncChain}async sync(){if(this.disposed)return!0;if(!DH(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(n=>n.enabled)}catch(n){return this.logger.warn(this.ctx,"listPlugins failed during sync",{err:String(n)}),!1}if(this.disposed)return!0;let r=new Map(e.map(n=>[n.uri,n]));for(let n of[...this.registered.keys()])r.has(n)||this.teardownPlugin(n);for(let[n,o]of r)if(await this.reconcilePlugin(n,o),this.disposed)return!0;return!0}async reconcilePlugin(e,r){let n=this.registered.get(e),o=q$s(r),s=j$s(r),c=n?.disposables??[];if(!n||n.fileHash!==o){for(let u of c)u.dispose();c=this.registerFiles(e,r)}let l=n?.mcpApplied??!1;if((!n||n.mcpHash!==s||!n.mcpApplied)&&(l=await this.applyMcp(e,r,n)),this.disposed){for(let u of c)u.dispose();l&&this.tryManager()?.removePluginServers(e).catch(d=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(d)}));return}this.registered.set(e,{fileHash:o,mcpHash:s,mcpApplied:l,disposables:c})}registerFiles(e,r){let n=this.tryRegistry();if(!n)return[];let o=[];for(let{type:s,pick:c}of xZn)for(let l of c(r))o.push(n.register(s,[H$s(l.uri)],{watchable:!1,classification:{storage:"plugin",pluginInfo:{name:l.name,description:l.description??"",pluginUri:e}}}));return o}async applyMcp(e,r,n){let o=this.tryManager();if(!o)return!0;let s=G$s(r.mcpServerDefinitions);if(Object.keys(s).length===0&&!n?.mcpApplied)return!0;try{return await o.applyPluginServers(e,s),!0}catch(c){return this.logger.warn(this.ctx,"applyPluginServers failed",{uri:e,err:String(c)}),!1}}teardownPlugin(e){let r=this.registered.get(e);if(!r)return;for(let o of r.disposables)o.dispose();let n=this.tryManager();n&&n.removePluginServers(e).catch(o=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(o)})),this.registered.delete(e)}teardownAll(){for(let e of[...this.registered.keys()])this.teardownPlugin(e)}tryRegistry(){return this.tryGet(RA)}tryManager(){return this.tryGet(ty)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof Sl)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function q$s(t){let e=xZn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(q$s,"fileContentHash");function j$s(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(j$s,"mcpContentHash");function H$s(t){return t.includes("://")?un(t):t}a(H$s,"toPathPattern");function G$s(t){let e={};for(let{name:r,configuration:n}of t)n.type==="stdio"?e[r]={command:n.command,...n.args&&{args:[...n.args]},...n.env&&{env:{...n.env}},...n.cwd&&{cwd:n.cwd}}:e[r]={url:n.url,...n.headers&&{headers:{...n.headers}}};return e}a(G$s,"toMcpServersConfig");var wZn=de(require("node:path"));var xlt=new fe("BackgroundAgent.SessionOptionsBuilder"),$$s=5e3;async function RZn(t,e,r,n){let o=s3((async()=>{try{await t.get(y8).ensureInitialSync()}catch(A){if(!(A instanceof Sl))throw A}})(),$$s,void 0),s=await n.buildAuthInfo(),c=to(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(g0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:R$e(t.get(Ir))??"jetbrains-chat",sessionId:e,authInfo:s,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:l,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:c};try{await t.get(k3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await rlt(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(NT).buildMcpServers(f);xlt.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:A}),Object.keys(A).length>0&&(u.mcpServers=A)}catch(A){if(!(A instanceof Sl))throw A}u.hooks=uJn(t,r.workspaceFolder);let h=await CZn(t,r.workspaceFolder);if(u.hooks=bZn(u.hooks,h),r.inlineConfinedFile){let A=[...u.hooks.preToolUse??[]];r.inlineConfinementHook&&A.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&A.unshift(r.inlineTurnLimiter.hook),u.hooks={...u.hooks,preToolUse:A},u.systemMessage={mode:"append",content:IZn(r.inlineConfinedFile)}}else{let A=await mfr(t,[r.workspaceFolder]).catch(v=>{xlt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await W$s(t,c):void 0,E=r.useNestedClaudeMdFiles===!0?await V$s(t,c):void 0,_=mJn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:E});_!==void 0&&(u.systemMessage={mode:"append",content:_})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=dJn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Ilt(t);return g&&(u.sandboxConfig=g),u}a(RZn,"buildSessionOptions");async function V$s(t,e){let r;try{r=t.get(qo)}catch{return}try{return await pJn(async n=>r.readDirectory(Ks(n)),async n=>kZn(r,e,n),e)}catch(n){xlt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(V$s,"scanNestedClaudeSection");async function W$s(t,e){let r;try{r=t.get(qo)}catch{return}try{return await hJn(async n=>r.readDirectory(Ks(n)),async n=>kZn(r,e,n),e)}catch(n){xlt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(W$s,"scanNestedAgentsSection");async function kZn(t,e,r){try{return await t.readFileString(Ks(wZn.join(e,r)))}catch{return}}a(kZn,"readNestedFile");p();var z$s=20,wlt=new fe("BackgroundAgent.SessionRegistry"),Rlt=class{constructor(e){this.ctx=e;this.sessions=new Map;this.workingDirs=new Map;this.workspaceFolderUris=new Map;this.mcpDirectories=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.appliedSandboxConfig=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>z$s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(wlt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>wlt.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}setWorkspaceFolderUri(e,r){this.workspaceFolderUris.set(e,r)}getWorkspaceFolderUri(e){return this.workspaceFolderUris.get(e)}setMcpDirectory(e,r){this.mcpDirectories.set(e,r)}getMcpDirectory(e){return this.mcpDirectories.get(e)}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)}setAppliedSandboxConfig(e,r){this.appliedSandboxConfig.set(e,r)}getAppliedSandboxConfig(e){return this.appliedSandboxConfig.get(e)}deleteAppliedSandboxConfig(e){this.appliedSandboxConfig.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){wlt.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){wlt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.workingDirs.delete(e),this.workspaceFolderUris.delete(e),this.mcpDirectories.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.appliedSandboxConfig.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.workspaceFolderUris.clear(),this.mcpDirectories.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.appliedSandboxConfig.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var gfr=require("node:fs"),$X=de(require("node:path"));function PZn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(PZn,"sanitizePathSegment");function Plt(t){return typeof t=="string"?t:void 0}a(Plt,"asString");function klt(t){return typeof t=="number"?t:void 0}a(klt,"asNumber");function Y$s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Plt(r.toolCallId),tool:Plt(r.name)}}):[]}a(Y$s,"asToolCallArray");function K$s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(K$s,"toToolResultText");function J$s(t){try{return JSON.stringify(t)}catch{return}}a(J$s,"safeStringify");var Afr=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=fQt(new Date),s=PZn(r);this.sessionDir=$X.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?$X.join(this.sessionDir,"runSubAgent",PZn(e)):this.sessionDir}appendJsonl(e,r){let n=J$s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await gfr.promises.mkdir($X.dirname(e),{recursive:!0}),await gfr.promises.appendFile(e,`${n} +`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:klt(e.data.inputTokens),outputTokens:klt(e.data.outputTokens),cacheReadTokens:klt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=Y$s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl($X.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:klt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Plt(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=Plt(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($X.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:K$s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function DZn(t,e,r){let n=Ft(t,Ye.PromptPersistBasePath)?.trim()||void 0;if(n)return new Afr(n,e,r)}a(DZn,"createBackgroundAgentPersistence");p();var Dlt=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();p();var yfr={INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool"},ho={OPERATION_NAME:"gen_ai.operation.name",AGENT_NAME:"gen_ai.agent.name",SYSTEM:"gen_ai.system",REQUEST_MODEL:"gen_ai.request.model",RESPONSE_MODEL:"gen_ai.response.model",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",CONVERSATION_ID:"gen_ai.conversation.id",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",TURN_COUNT:"gen_ai.turn_count",TOTAL_COST_USD:"gen_ai.total_cost_usd",TOOL_NAME:"gen_ai.tool.name",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result"};function Yhe(t,e){return JSON.stringify([{role:t,parts:[{type:"text",content:e}]}])}a(Yhe,"genAiMessagesJson");var MZn=require("crypto");var Efr=new fe("BackgroundAgent.CliOTelTracker"),Z$s={USER_REQUEST:"copilot_chat.user_request"},_fr="main";function Khe(t){return(0,MZn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Khe,"generateHexId");function OZn(){return BigInt(Date.now())*1000000n}a(OZn,"nowNano");function Jhe(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return OZn()}a(Jhe,"isoToNano");function NZn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(NZn,"toAttributeString");function LZn(t,e,r){if(!t.get(bn).getCapabilities().agentDebugLog)return;let n=t.get(mv);if(n.isEnabled())return new vfr(t,e,r,n)}a(LZn,"createCliOTelTracker");var vfr=class{constructor(e,r,n,o){this._ctx=e;this._sessionId=r;this._session=n;this._persistence=o;this._pendingTools=new Map}static{a(this,"CliOTelTracker")}onEvent(e){switch(e.type){case"user.message":this._pendingUserRequest=e.data.content;break;case"assistant.turn_start":this._ensureRequest(Jhe(e.timestamp));break;case"assistant.usage":this._onUsage(e);break;case"assistant.message":this._onAssistantMessage(e);break;case"tool.execution_start":this._onToolStart(e);break;case"tool.execution_complete":this._onToolComplete(e);break;case"session.idle":case"session.error":this._flushRequest().catch(r=>{Efr.warn(this._ctx,`Failed to flush debug spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)});break;default:break}}_ensureRequest(e){return this._request||(this._request={traceId:Khe(16),invokeAgentSpanId:Khe(8),startNano:e,userRequest:this._pendingUserRequest,usages:[],responseByAgent:new Map,toolSpanIds:new Map,pendingReads:[]},this._pendingUserRequest=void 0),this._request}_onUsage(e){let r=this._ensureRequest(Jhe(e.timestamp)),n={data:e.data,endNano:Jhe(e.timestamp),agentKey:e.data.parentToolCallId??_fr,parentToolCallId:e.data.parentToolCallId};r.usages.push(n),r.pendingReads.push(this._readAssembled().then(({inputMessagesJson:o,systemInstructions:s})=>{n.inputMessagesJson=o,n.systemInstructions=s}))}_onAssistantMessage(e){let r=this._request;if(!r)return;let n=e.data.content;if(!n)return;let o=e.data.parentToolCallId??_fr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(Jhe(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=Khe(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:Jhe(e.timestamp)}),n.toolSpanIds.set(r,c)}_onToolComplete(e){let r=e.data.toolCallId;if(!r)return;let n=this._pendingTools.get(r);if(!n)return;this._pendingTools.delete(r);let o=Jhe(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[ho.OPERATION_NAME]:"execute_tool",[ho.CONVERSATION_ID]:this._sessionId,[ho.TOOL_NAME]:n.toolName,[ho.TOOL_CALL_ID]:r},u=NZn(n.arguments);u!==void 0&&(l[ho.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=NZn(d);f!==void 0&&(l[ho.TOOL_CALL_RESULT]=f),this._appendSpans([{traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,name:`execute_tool ${n.toolName}`,kind:1,startTimeUnixNano:n.startNano.toString(),endTimeUnixNano:o.toString(),attributes:D2(l),events:[],status:s?{code:2,message:c??"Tool execution error"}:{code:1}}])}async _flushRequest(){let e=this._request;if(!e)return;this._request=void 0,await Promise.allSettled(e.pendingReads);let r=OZn(),n=[this._buildInvokeAgentSpan(e,r)],o=this._buildUserMessageSpan(e);o&&n.push(o);let s=new Map;e.usages.forEach((c,l)=>{c.data.model&&s.set(c.agentKey,l)}),e.usages.forEach((c,l)=>{let u=s.get(c.agentKey)===l,d=this._buildChatSpan(e,c,u);d&&n.push(d)}),n.push(...this._buildAgentResponseSpans(e)),this._appendSpans(n)}_buildInvokeAgentSpan(e,r){return{traceId:e.traceId,spanId:e.invokeAgentSpanId,name:"invoke_agent copilotcli",kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:D2({[ho.OPERATION_NAME]:"invoke_agent",[ho.AGENT_NAME]:"copilotcli",[ho.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:Khe(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:D2({[ho.OPERATION_NAME]:"user_message",[ho.CONVERSATION_ID]:this._sessionId,[Z$s.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:D2({content:e.userRequest})}],status:{code:1}}}_buildAgentResponseSpans(e){let r=new Map;for(let o of e.usages)o.data.model&&r.set(o.agentKey,o.endNano);let n=[];for(let[o,s]of e.responseByAgent){if(!s)continue;let c=o===_fr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:Khe(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:D2({[ho.OPERATION_NAME]:"agent_response",[ho.CONVERSATION_ID]:this._sessionId,[ho.OUTPUT_MESSAGES]:Yhe("assistant",s)}),events:[],status:{code:1}})}return n}_buildChatSpan(e,r,n){let o=r.data.model;if(!o)return;let s=(r.parentToolCallId?e.toolSpanIds.get(r.parentToolCallId):void 0)??e.invokeAgentSpanId,c={[ho.OPERATION_NAME]:"chat",[ho.CONVERSATION_ID]:this._sessionId,[ho.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[ho.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[ho.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[ho.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[ho.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[ho.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[ho.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[ho.OUTPUT_MESSAGES]=Yhe("assistant",h));let m=r.endNano,g=r.data.duration,A=typeof g=="number"&&g>=0?m-BigInt(Math.round(g))*1000000n:m;return{traceId:e.traceId,spanId:Khe(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:D2(c),events:[],status:{code:1}}}async _readAssembled(){try{let e=await this._session.getChatContextMessages();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:this._session.getCurrentSystemMessage()}}catch(e){return Efr.warn(this._ctx,`Failed to read assembled messages for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`),{}}}_appendSpans(e){if(e.length!==0)try{this._persistence.appendSpans(e).catch(r=>this._warnPersistFailure(r))}catch(r){this._warnPersistFailure(r)}}_warnPersistFailure(e){Efr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Oo();var E8=new fe("BackgroundAgent.TurnDriver"),Cfr="backgroundAgent",Nlt=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set;this.lastNanoAiu=new Map}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=DZn(this.ctx,e,`bg-turn-${Mt()}`),d=LZn(this.ctx,e,r);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.lastNanoAiu.delete(e),this.forget(e)},"dispose")}));let f=a(()=>{},"noop"),h=r.on("user_input.requested",f),m=r.on("permission.requested",f),g=r.on("exit_plan_mode.requested",f);KGn(r,!0);let A=new Dlt,y=r.on("*",w=>{if(w.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(w)}catch(R){E8.warn(this.ctx,"Failed to persist background-agent event",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}if(A.trackEvent(w),d)try{d.onEvent(w)}catch(R){E8.warn(this.ctx,"Failed to synthesize debug span",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}this.handleSessionEvent(e,w,o)}),E=!1,_=a(()=>{E||(E=!0,this.emitTurnCompleteTelemetry(e,r,l,A.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),T?.dispose(),h(),m(),g(),y(),v(),b(),this.forget(e)},"cleanup"),v=r.on("session.idle",()=>{_()}),b=r.on("session.error",()=>{_()}),T;s&&(T=s.onCancellationRequested(()=>{E8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(w=>{_();let R=Qrt(w);s?.isCancellationRequested?E8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(E8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:R,stack:w instanceof Error?w.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let x={type:"session.error",id:Mt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:R}};this.sendSessionUpdateNotification(e,x,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.lastNanoAiu.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){E8.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){E8.error(this.ctx,"Failed to send session update notification:",o)}}async emitTurnCompleteTelemetry(e,r,n,o,s){try{let c=performance.now()-n,l=this.registry.getChatMode(e)??"agent",d=(await r.usage.getMetrics()).totalNanoAiu,f=this.lastNanoAiu.get(e)??0,h=typeof d=="number"&&Number.isFinite(d),m=h?Math.min(f,d):f;h&&this.lastNanoAiu.set(e,d);let g=h?(d-m)/1e9:0;Rt(this.ctx,"backgroundAgent.turn.complete",{requestSource:Cfr,sessionId:e,chatMode:l,agentProvider:"BACKGROUND",turnIndex:s!=null?String(s):""},{totalDurationMs:c,totalUserWaitMs:o?o.permission.totalMs+o.user_input.totalMs+o.exit_plan_mode.totalMs:0,permissionWaitMs:o?.permission.totalMs??0,permissionWaitCount:o?.permission.count??0,userInputWaitMs:o?.user_input.totalMs??0,userInputWaitCount:o?.user_input.count??0,exitPlanModeWaitMs:o?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:o?.exit_plan_mode.count??0,credits:g})}catch(c){E8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){Rt(this.ctx,"backgroundAgent.turn.failed",{requestSource:Cfr,sessionId:e,agentProvider:"BACKGROUND",errorType:n,turnIndex:r!=null?String(r):""})}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);Rt(this.ctx,"backgroundAgent.session.metrics",{requestSource:Cfr,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){E8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function BZn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(BZn,"applyAgentModeOverride");p();async function FZn(t,e,r,n,o){let s=n.chatMode??"agent",c=yat(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:Ks(u)};o.deleteChatMode(e),await UGn(r,c,{loadCustomAgents:a(()=>rlt(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(g0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let f=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(NT).buildMcpServers(f))}catch(h){if(h instanceof Sl)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(FZn,"applyChatModeOverride");p();var UZn=new fe("BackgroundAgent.applyChatModeSelection");async function QZn(t,e,r){if(r.chatMode===void 0||yat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),UZn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),UZn.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(QZn,"applyChatModeSelection");p();var qZn=require("node:util");function jZn(t,e,r,n){let o=Ilt(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,qZn.isDeepStrictEqual)(s,o)||(r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(jZn,"applySandboxOverride");p();p();var VX=new fe("BackgroundAgent.ProviderConfig");async function HZn(t,e,r){if(!e)return;let n=await Zze(t,e,r);if(!n){VX.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let f=await new Ga(t.get(ti)).getStoredModelConfigs(e),h=r?f[r]:void 0;o=h?.deploymentUrl,s=h?.modelCapabilities?.maxInputTokens,c=h?.modelCapabilities?.maxOutputTokens}catch(d){VX.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:d instanceof Error?d.message:String(d)})}let l=nxe(e),u={maxPromptTokens:s??l.maxInputTokens,maxOutputTokens:c??l.maxOutputTokens};if(e===io.Anthropic)return{type:"anthropic",baseUrl:o??Yle[e],apiKey:n,modelId:r,wireModel:r,...u};if(e===io.Azure){if(!o){VX.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return eVs(t,o,n,r,u)}if(Hle(e))return{type:"openai",baseUrl:o??Yle[e],apiKey:n,modelId:r,wireModel:r,...u};if(tq(e))return X$s(t,e,n,r,o,u);VX.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(HZn,"buildProviderConfig");async function X$s(t,e,r,n,o,s){if(!o){VX.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new Ga(t.get(ti)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:rxe,f=Jze(o,d);return d==="messages"?{type:"anthropic",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}:{type:"openai",wireApi:d==="responses"?"responses":"completions",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}}a(X$s,"buildCustomEndpointProviderConfig");function eVs(t,e,r,n,o){let s;try{s=new URL(e)}catch{VX.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};VX.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(eVs,"buildAzureProviderConfig");var bfr=new fe("BackgroundAgent.applyTurnOverrides");async function GZn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!rq(await t.get(Qt).getToken()))throw new ZRe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await HZn(t,o,r.model);if(o!==void 0&&s===void 0)throw new JRe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===io.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){bfr.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)));bfr.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}),bfr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(GZn,"applyTurnOverrides");p();async function $Zn(t,e,r,n,o){let s=rVs(e,n),c=o==="inline"||o==="inline-ask";await t.get(bg).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||tVs(t,r)}a($Zn,"expandPromptTemplate");function tVs(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!Hxn.has(s))return!1;let c=o2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(tVs,"applyBuiltinCreateTemplate");function rVs(t,e){let r=e.getWorkingDir(t);return r?{uri:Ks(r)}:void 0}a(rVs,"getWorkspaceFolderForSession");Oo();var ry=new fe("BackgroundAgent"),NH="backgroundAgent",nVs="backgroundAgent.remote",iVs=new Set(["system.message","hook.start","hook.end"]),Hs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ts),this.managerLifecycle=new Lat(e),this.authBinding=new Urt(e),this.registry=new Rlt(e),this.mcpSync=new Kct(e,this.registry),this.remoteController=new tlt(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Nlt(e,this.registry,this.notificationSender),e.get(Bo).onDidChangeHttpSettings(()=>{gat(this.ctx)}),bs(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(g0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof Sl))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(ry.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=d2n(n,e);return Rt(this.ctx,"backgroundAgent.interaction",{requestSource:NH,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 GZn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return QZn(this.ctx,e,r)}buildSessionOptions(e,r){return RZn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();ry.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Mt(),s=e.inlineConfinedFile?HGn(2):void 0,c=e.inlineConfinedFile?GGn(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),ry.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),Rt(this.ctx,"backgroundAgent.create",{requestSource:NH,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,to(e.workspaceFolder.uri).fsPath),this.registry.setWorkspaceFolderUri(o,e.workspaceFolder.uri),e.mcpDirectory&&this.registry.setMcpDirectory(o,e.mcpDirectory),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),ry.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}),ry.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:Ks(m)},ry.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.registry.deleteAppliedSandboxConfig(e),this.installBridgeSpanProcessor();let f=s?.uri?to(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),s?.uri&&this.registry.setWorkspaceFolderUri(e,s.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),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),this.applySandboxOverride(e.sessionId,o);let s=e.message;await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,...e.message!==s?{displayPrompt:s}:{},...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,c);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=u2n(e.references,this.ctx);m.length>0&&(c.attachments=m)}if(l){let m=this.registry.getConfinedFile(e.sessionId);if(m){let g=e.references?.find(y=>y.type==="file"&&y.uri===m),A=await VGn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?Aat:tcr;o.updateOptions({availableTools:[...y,"view"]},{emitToolDefinitionsChanged:!0})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let u=performance.now(),d=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,c,d,r,!!e.providerName);let f={requestSource:NH,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:oVs(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(d)},h={totalTimeMs:performance.now()-u,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return Rt(this.ctx,"backgroundAgent.send",f,h),At(this.ctx,"backgroundAgent.send",Wt.createAndMarkAsIssued(f,h)),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return Rt(this.ctx,"backgroundAgent.truncateHistory",{requestSource:NH,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}applyChatModeOverride(e,r,n){return FZn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){jZn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){BZn(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,...s.message!==r?{displayPrompt:r}:{},source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),Rt(this.ctx,"backgroundAgent.send",{requestSource:nVs,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 $Zn(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 ry.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);ry.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&ry.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),Rt(this.ctx,"backgroundAgent.stop",{requestSource:NH,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);ry.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return Rt(this.ctx,"backgroundAgent.compactHistory",{requestSource:NH,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);ry.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return Rt(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:NH,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();ry.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());Rt(this.ctx,"backgroundAgent.resume",{requestSource:NH,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!iVs.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){ry.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let n=await this.ctx.get(xs).getMetadata(e),o=this.sdk?.EXCLUDED_MODELS,s=n.filter(u=>u.model_picker_enabled===!0).filter(u=>u.capabilities.type==="chat").filter(u=>!o?.has(u.id)).map(Frt);s.length===0?ry.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):ry.info(this.ctx,`Successfully retrieved ${s.length} models`);let c=[];this.ctx.get(Hl).getPolicyValue("autoModel.enabled")!==!1&&c.push(this.buildAutoModelEntry());let l=[...c,...s];return ry.debug(this.ctx,"Models retrieved:",l.map(u=>u.id)),Rt(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:l.length}),{models:l}}catch(n){let o=n instanceof Error?n.message:String(n),s=MZt(n);throw ry.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),ai(this.ctx,"backgroundAgent.listModels",n,{status_text:"failure",...s?{errorCause:s}:{}},{duration_ms:performance.now()-r}),new Error("Failed to retrieve models",{cause:n})}}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(),ecr(),p2n(),await this.managerLifecycle.dispose()}};function oVs(t,e){return e?"byok models":t??""}a(oVs,"safeModelId");p();p();var Ep=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ep||{});p();async function kb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return VZn(t,e,n,o),s}catch(s){throw o.error??=s,VZn(t,e,n,o),s}}a(kb,"runWithTelemetry");function VZn(t,e,r,n){let s={success:n.error?"false":n.ok??!0?"true":"false",...n.properties},c={totalTimeMs:performance.now()-r,...n.measurements};n.error!==void 0?ai(t,`${e}.failure`,n.error,s,c):Rt(t,e,s,c)}a(VZn,"flushTelemetry");p();var WZn=de(require("path"));p();var Sfr=["default","acceptEdits","bypassPermissions","plan","auto"];function WX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(WX,"assertClaudeProvider");function Zhe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Zhe,"assertNonEmptyString");function sVs(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(sVs,"assertFsUri");function aVs(t,e,r){if(!WZn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(aVs,"assertAbsolutePath");function cVs(t,e){if(e!==void 0&&!Sfr.includes(e))throw new Error(`${t}: agentMode must be one of ${Sfr.join(", ")}, got '${e}'`)}a(cVs,"assertAllowedAgentMode");async function aNe(t,e){if(e===void 0)return;let n=(await t.get(xs).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!N$e(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(aNe,"validateClaudeModel");async function zZn(t,e){WX("createSession",e.agentProvider),sVs("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await aNe(t,e.model)}a(zZn,"validateAgentCreate");async function YZn(t,e){WX("resumeSession",e.agentProvider),Zhe("resumeSession","sessionId",e.sessionId),await aNe(t,e.model)}a(YZn,"validateAgentResume");async function KZn(t,e){WX("sendMessage",e.agentProvider),Zhe("sendMessage","sessionId",e.sessionId),Zhe("sendMessage","message",e.message),cVs("sendMessage",e.agentMode),await aNe(t,e.model)}a(KZn,"validateAgentSend");function JZn(t,e){WX("stopSession",e.agentProvider),Zhe("stopSession","sessionId",e.sessionId)}a(JZn,"validateAgentStop");function ZZn(t,e){WX("destroySession",e.agentProvider),Zhe("destroySession","sessionId",e.sessionId)}a(ZZn,"validateAgentDestroy");function XZn(t,e){WX("listSessions",e.agentProvider),Zhe("listSessions","cwd",e.cwd),aVs("listSessions","cwd",e.cwd)}a(XZn,"validateAgentListSessions");function eXn(t,e){WX("listModels",e.agentProvider)}a(eXn,"validateAgentListModels");p();p();p();var iXn=require("child_process"),Xhe=de(require("path")),oXn=de(EP()),sXn=require("util");var tXn=5e3,rXn=200,eme=class{constructor(e){this.execFile=(0,sXn.promisify)(iXn.execFile);this.cache=new Map;this.config=e}static{a(this,"BaseCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:this.config.notConfiguredMessage});let r=Xhe.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(Xhe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=this.validateBasename(e);if(r)return{severity:"error",message:r};let n;try{n=(await this.execFile(e,["--version"],{timeout:tXn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=oXn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from "${e}" --version output: "${nXn(n)}". Cannot verify compatibility.`};let s=this.config.validateVersion(o,e);return s||{severity:"ok"}}validateBasename(e){let r=this.config.allowedBasenames;if(!r||r.length===0)return;let n=Xhe.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} path "${e}" must point at the "${r[0]}" executable, but the basename is "${Xhe.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at "${e}". Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at "${e}" did not respond to --version within ${tXn/1e3}s.`;let o=typeof n?.stderr=="string"?nXn(n.stderr):"",s=n?.code!==void 0?` (exit code ${String(n.code)})`:"",c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "${e} --version"${s}${l}${c}`}};function nXn(t){let e=t.trim();return e.length<=rXn?e:`${e.slice(0,rXn)}\u2026`}a(nXn,"truncate");var Mlt=de(EP());function lVs(){let t=cIe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(lVs,"getExpectedVersionRaw");var Tfr=class extends eme{static{a(this,"ClaudeCliVersionChecker")}constructor(){super({displayName:"Claude Code CLI",allowedBasenames:process.platform==="win32"?["claude.exe"]:["claude"],notConfiguredMessage:"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.",validateVersion(e,r){let n=lVs(),o=Mlt.coerce(n);if(!o)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${n}" from packaged metadata. This is an internal error; please report it.`};if(!Mlt.satisfies(e,`~${o.major}.${o.minor}.0`))return{severity:"warning",message:`Claude Code CLI at "${r}" reports version ${e.version}, but this language server was built against ${o.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${o.version}\` to align versions.`}}})}},tme=new Tfr;p();var rme=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 aXn(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(aXn,"buildPermissionRequest");function cXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:uVs(t)}}a(cXn,"translatePermissionResult");function uVs(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(uVs,"formatDenyMessage");function lXn(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(lXn,"buildPreparedQuestions");function uXn(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(uXn,"buildUserInputRequest");p();var dXn=require("crypto");var dVs=new fe("ClaudeOTelTracker");function fXn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(fXn,"toAttributeString");function fVs(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>{if(typeof r!="object"||r===null)return!1;let n=r;return n.type==="text"&&typeof n.text=="string"}).map(r=>r.text);if(e.length===t.length&&e.length>0)return e.join("")}return fXn(t)}a(fVs,"stringifyToolResult");function Ifr(t){return(0,dXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Ifr,"generateHexId");function Olt(){return BigInt(Date.now())*1000000n}a(Olt,"nowNano");var Llt=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._responseText="";this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e,r){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let n=Ifr(16),o=Ifr(8);this._rootSpan={traceId:n,spanId:o,name:"invoke_agent claude",startNano:Olt(),attributes:{[ho.OPERATION_NAME]:yfr.INVOKE_AGENT,[ho.AGENT_NAME]:"claude",[ho.SYSTEM]:"anthropic",[ho.CONVERSATION_ID]:this._sessionId,...e?{[ho.REQUEST_MODEL]:e}:{},...r?{[ho.INPUT_MESSAGES]:Yhe("user",r)}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,this._responseText="",this._toolSpans.clear()}onMessage(e){if(this._rootSpan)switch(e.type){case"assistant":this._onAssistantMessage(e);break;case"user":this._onUserMessage(e);break;case"result":this._onResultMessage(e);break}}endRequest(){this._endRootSpan(1)}endRequestWithError(e){this._endRootSpan(2,e)}_onAssistantMessage(e){if(e.parent_tool_use_id!=null)return;let r=e.message?.content;if(Array.isArray(r))for(let n of r)n.type==="tool_use"?this._startToolSpan(n.id,n.name,n.input):n.type==="text"&&typeof n.text=="string"&&(this._responseText+=n.text)}_onUserMessage(e){let r=e.message?.content;if(Array.isArray(r)){for(let n of r)if(n.type==="tool_result"&&typeof n.tool_use_id=="string"){let o=n.is_error===!0;this._endToolSpan(n.tool_use_id,o,n.content)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;if(r&&(this._inputTokens=r.input_tokens??0,this._outputTokens=r.output_tokens??0,this._cacheReadTokens=r.cache_read_input_tokens??0,this._cacheCreationTokens=r.cache_creation_input_tokens??0),e.modelUsage){let n=Object.keys(e.modelUsage);n.length>0&&(this._rootSpan.attributes[ho.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[ho.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[ho.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r,n){if(!this._rootSpan||this._toolSpans.has(e))return;let o={[ho.OPERATION_NAME]:yfr.EXECUTE_TOOL,[ho.TOOL_NAME]:r,[ho.TOOL_CALL_ID]:e,[ho.CONVERSATION_ID]:this._sessionId},s=fXn(n);s!==void 0&&(o[ho.TOOL_CALL_ARGUMENTS]=s),this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:Ifr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Olt(),attributes:o})}_endToolSpan(e,r,n){let o=this._toolSpans.get(e);if(!o)return;this._toolSpans.delete(e);let s=fVs(n);s!==void 0&&(o.attributes[ho.TOOL_CALL_RESULT]=s);let c=Olt(),l=this._buildOtlpSpan(o,c,r?2:1,r?"Tool execution error":void 0);this._flush([l])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[ho.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[ho.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[ho.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[ho.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Olt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear(),this._responseText&&(n.attributes[ho.OUTPUT_MESSAGES]=Yhe("assistant",this._responseText)),this._responseText="";let c=this._buildOtlpSpan(n,o,e,r);this._flush([...s,c])}_buildOtlpSpan(e,r,n,o){let s={traceId:e.traceId,spanId:e.spanId,name:e.name,kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:D2(e.attributes),events:[],status:o?{code:n,message:o}:{code:n}};return e.parentSpanId&&(s.parentSpanId=e.parentSpanId),s}_flush(e){e.length!==0&&this._persistence.appendSpans(e).catch(r=>{dVs.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var xfr=require("fs"),hXn=de(require("path"));var cNe=new fe("ClaudeCode.ReferenceFormatter"),pVs={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},pXn=5*1024*1024;async function mXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=rs(s.uri);if(!c){cNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=mVs(c);if(l){let u=await hVs(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=rs(s.uri);if(!c){cNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:cNe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:gVs(n)}),o}a(mXn,"buildReferences");async function hVs(t,e,r){try{let n=await xfr.promises.stat(t);if(n.size>pXn){cNe.debug(r,`Skipping oversize image reference (${n.size} > ${pXn} bytes): ${t}`);return}let o=(await xfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){cNe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(hVs,"tryReadImageBlock");function mVs(t){return pVs[hXn.extname(t).toLowerCase()]}a(mVs,"imageMediaTypeForPath");function gVs(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(eVs,"wrapInSystemReminder");p();var uXn=require("crypto");var tVs=new Set(["ExitPlanMode"]);function Sfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[pXn(r,"synthetic",t.error)];switch(t.type){case"system":return rVs(t,r);case"assistant":return cXn(nVs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return cXn(e.includeUserText===!0?oVs(t,r):iVs(t,r),e.suppressedToolUseIds);case"result":return cVs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Sfr,"translate");function cXn(t,e){return e?t.filter(r=>{if(r.type==="tool.execution_start"){let{toolName:n,toolCallId:o}=r.data;if(typeof o=="string"&&n!==void 0&&tVs.has(n))return e.add(o),!1}if(r.type==="tool.execution_complete"){let{toolCallId:n}=r.data;if(typeof n=="string"&&e.has(n))return e.delete(n),!1}return!0}):t}a(cXn,"dropDedicatedChannelToolEvents");function dXn(t,e,r){if(t.parent_tool_use_id!==null)return[];let n=t.event,o=new Date().toISOString();switch(n.type){case"message_start":return[{id:e,timestamp:o,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:r??e}}];case"content_block_delta":{let s=n.delta;switch(s.type){case"text_delta":return[{id:Lg(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Lg(),timestamp:o,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${n.index}`,deltaContent:s.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(dXn,"translatePartial");function rVs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Lg(),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:Lg(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Lg(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(rVs,"translateSystem");function nVs(t,e,r,n,o,s){let c=t.message?.id??Lg(),l=[],u=t.message?.model,d=u;if(typeof u=="string"&&s)try{d=s(u)}catch{d=u}r||l.push({id:c,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:c,interactionId:o??c}});let f=t.message?.content??[],h=n??new Map,m=h.get(c)??0;return f.forEach(g=>{let A=m++;switch(g.type){case"text":{let y=g.text;typeof y=="string"&&y.length>0&&l.push({id:Lg(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${c}:${A}`,content:y,model:d}});break}case"thinking":{let y=g.thinking;typeof y=="string"&&y.length>0&&l.push({id:Lg(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Lg(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Lg(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a(nVs,"translateAssistant");function iVs(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(fXn(o,e));return n}a(iVs,"translateUserLive");function oVs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Nlt(n);return o.length>0&&r.push(lXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(fXn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Nlt(s);c.length>0&&r.push(lXn(e,c))}}}return r}a(oVs,"translateUserHistory");function fXn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=lVs(t.content);return{id:Lg(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Lg(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(fXn,"buildToolExecutionComplete");function lXn(t,e){return{id:Lg(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(lXn,"buildUserMessage");function sVs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(sVs,"stripSystemReminders");var aVs=/^\[Request interrupted by user[^\]]*\]$/;function Nlt(t){let e=sVs(t);return aVs.test(e)?"":e}a(Nlt,"sanitizeUserText");function cVs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Lg(),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(pXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Lg(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(cVs,"translateResult");function pXn(t,e,r){return{id:Lg(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(pXn,"buildSessionError");function lVs(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(lVs,"flattenToolResultContent");function Lg(){return(0,uXn.randomUUID)()}a(Lg,"newId");function hXn(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=dVs(c);if(!l)continue;(l.type==="user"&&uVs(l)||l.type==="assistant"&&s===void 0)&&(s=Lg());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Sfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(hXn,"translateHistory");function uVs(t){let e=(t.message??{}).content;if(typeof e=="string")return Nlt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&Nlt(r.text).length>0)return!0;return!1}a(uVs,"userMessageStartsInteraction");function dVs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&fVs(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(dVs,"adaptHistoryMessage");function fVs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(fVs,"isSyntheticReplayUserMessage");p();var fm=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 Mlt=de(require("path"));Mo();var qc=new fe("ClaudeCodeAgent.session"),jc="ClaudeCodeSession",iNe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._suppressedToolUseIds=new Set;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new eme;this._userInputRegistry=new eme;this._exitPlanModeRegistry=new eme;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ExitPlanMode"?this._handleExitPlanMode(r,n):e==="ToolSearch"?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(fm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(bn).getCapabilities().agentDebugLog){let c=new pv(this.ctx);c.isEnabled()&&(this._otelTracker=new Dlt(this.ctx,this.sessionId,c))}}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(fm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){qc.warn(this.ctx,`${jc}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async supportedAgents(){if(!this._query)return[];try{return await this._query.supportedAgents()}catch(e){return qc.warn(this.ctx,`${jc}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}_notifyAgentListChanged(){try{this.ctx.get(a0).notify("agent").catch(e=>{qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){qc.info(this.ctx,`${jc}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(fm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),qc.info(this.ctx,`${jc}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){qc.warn(this.ctx,`${jc}: 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){qc.warn(this.ctx,`${jc}: 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(fm).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=>{qc.warn(this.ctx,`${jc}: 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&&await this.setPermissionMode(e.permissionMode),this.ctx.get(fm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(fm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new vA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Mt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{qc.info(this.ctx,`${jc}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),qc.info(this.ctx,`${jc}.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 aXn(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??Mt()};this._otelTracker?.startRequest(this._model),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=Ft(this.ctx,Ye.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await Xhe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(qc.warn(this.ctx,`${jc}: ${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"],...L$t(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!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,this._notifyAgentListChanged(),qc.info(this.ctx,`${jc}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{qc.error(this.ctx,`${jc}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(gF).resolvePath();return`${Mlt.dirname(e)}${Mlt.delimiter}${process.env.PATH??""}`}catch(e){return qc.warn(this.ctx,`${jc}: 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 vA;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)){n.type==="result"?this._otelTracker?.endRequest():this._otelTracker?.endRequestWithError(n.error??"Turn ended with error"),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let s=this._currentInvokeDone;this._currentInvokeDone=void 0,s?.resolve()}}this._otelTracker?.endRequestWithError("SDK Query ended unexpectedly"),this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){qc.error(this.ctx,`${jc}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),this._otelTracker?.endRequestWithError(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(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;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&&qc.error(this.ctx,`${jc}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{this._otelTracker?.onMessage(e);let n=e?.type==="result"?this.ctx.get(fm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Sfr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor,suppressedToolUseIds:this._suppressedToolUseIds,interactionId:this._currentTurnInteractionId});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){qc.error(this.ctx,`${jc}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=dXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){qc.error(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;switch(e.type){case"permission":return this._respondFromRegistry(this._permissionRegistry,e.type,e.requestId,e.result);case"user_input":return this._respondFromRegistry(this._userInputRegistry,e.type,e.requestId,e.response);case"exit_plan_mode":return this._respondFromRegistry(this._exitPlanModeRegistry,e.type,e.requestId,e.response);default:return qc.warn(this.ctx,`${jc}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}}_respondFromRegistry(e,r,n,o){let s=e.respond(n,o);return s||qc.warn(this.ctx,`${jc}: respondToInteraction for unknown ${r} requestId`,{sessionId:this.sessionId,requestId:n}),s}_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}`)),this._exitPlanModeRegistry.respondAll({approved:!1,feedback:`Session ${this.sessionId} ${e} before exit_plan_mode resolved${n}`})}_handlePermissionRequest(e,r,n){let o=n.toolUseID??Mt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=eXn(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=rXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Mt(),u=await this._requestUserInputFromIde(l,nXn(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)}`}}}_handleExitPlanMode(e,r){let n=r.toolUseID??Mt();return r.signal.aborted?Promise.resolve({behavior:"deny",message:"ExitPlanMode request aborted"}):this._requestExitPlanModeFromIde(n,e,r)}async _requestExitPlanModeFromIde(e,r,n){let{promise:o,isSettled:s}=this._exitPlanModeRegistry.register(e),c=a(()=>{this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"ExitPlanMode request aborted"})},"onAbort"),l=a(()=>n.signal.removeEventListener("abort",c),"cleanupAbort");n.signal.addEventListener("abort",c,{once:!0});let u=typeof r.plan=="string"?r.plan:"",d=this._emitExitPlanModeRequested(e,{planContent:u,summary:u,actions:["exit_only","interactive"],recommendedAction:"interactive",toolCallId:n.toolUseID});d.catch(m=>{s()||(qc.error(this.ctx,`${jc}: failed to emit exit_plan_mode.requested, denying`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"Failed to deliver exit_plan_mode request to client"}))});let f;try{f=await o}finally{l()}let h=this._translateExitPlanModeResponse(f,r);return qc.info(this.ctx,`${jc}: exit_plan_mode resolved`,{sessionId:this.sessionId,requestId:e,behavior:h.behavior,selectedAction:f.selectedAction,autoApproveEdits:f.autoApproveEdits}),d.catch(()=>{}).then(()=>this._emitExitPlanModeCompleted(e,f)).catch(m=>{qc.warn(this.ctx,`${jc}: failed to emit exit_plan_mode.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),h}_translateExitPlanModeResponse(e,r){if(!e.approved){let c=e.feedback?.trim();return{behavior:"deny",message:c?`Plan not approved: ${c}`:"Plan not approved by user"}}if(e.selectedAction==="exit_only")return{behavior:"deny",message:"The user approved the plan but will implement it themselves. Do not make any code changes or take any further action. Stop and wait for the user."};let o=e.autoApproveEdits===!0?"acceptEdits":"default";return this._permissionMode=o,this.ctx.get(fm).setPermissionModeForSession(this.sessionId,o),{behavior:"allow",updatedInput:r,updatedPermissions:[{type:"setMode",mode:o,destination:"session"}]}}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()||(qc.error(this.ctx,`${jc}: 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=tXn(h,n);qc.info(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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()||(qc.error(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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:Mt(),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:Mt(),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:Mt(),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:Mt(),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")}async _emitExitPlanModeRequested(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.requested",data:{requestId:e,planContent:r.planContent,summary:r.summary,actions:r.actions,recommendedAction:r.recommendedAction,...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeCompleted(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.completed",data:{requestId:e,approved:r.approved,...r.selectedAction!==void 0?{selectedAction:r.selectedAction}:{},...r.autoApproveEdits!==void 0?{autoApproveEdits:r.autoApproveEdits}:{},...r.feedback!==void 0?{feedback:r.feedback}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var AXn=de(require("http")),yXn=require("node:stream"),Ifr=require("node:stream/promises"),EXn=require("node:string_decoder");Mo();var Bg=new fe("ClaudeMessagesProxyServer"),pVs=["interleaved-thinking","context-management","advanced-tool-use"],Tfr="cls_claude_agent",Fg={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"},hVs=new Map([[400,Fg.InvalidRequest],[401,Fg.Authentication],[402,Fg.Permission],[403,Fg.Permission],[404,Fg.NotFound],[413,Fg.RequestTooLarge],[424,Fg.InvalidRequest],[429,Fg.RateLimit],[466,Fg.InvalidRequest],[529,Fg.Overloaded]]),mXn=1024,mVs=32e3,WX=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-${Mt()}`,r=AXn.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},Bg.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(Bg.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,Fg.NotFound,"Not found")}catch(o){Bg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Fg.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=gVs(e.headers,n);if(!o.valid){Bg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Fg.Authentication,"Invalid authentication");return}o.sessionId&&Bg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await IVs(e),c;try{c=JSON.parse(s)}catch(l){Bg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Fg.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(tr),u;try{u=await c.getToken()}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Fg.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=ile(this.ctx,u,"v1/messages"),g=yVs(this.ctx,n,d),A;try{({headers:A}=await nle(this.ctx,g,u.token))}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Fg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(Bg.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(ole(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";Bg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,xVs(_.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(fm),R=wVs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Ifr.pipeline)(b,R,o)}else await(0,Ifr.pipeline)(b,o)}catch(_){if(y.signal.aborted){Bg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(Bg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Fg.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(xs).getMetadata()).find(s=>s.id===r)}catch(n){Bg.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 xfr(e)?(Bg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(fm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&Bg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return vVs(e,n,s)?(Bg.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 _Vs(e)?(Bg.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:RVs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return $_.translateErrorMessage(o,s,void 0,OU(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Au).overageEnabled;return $_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:OU(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return Bg.exception(this.ctx,s,"._buildReasonForStatus/402"),gXn(r)??"Quota Exceeded."}if(o===400){let s=$_.translate400Reason(r);if(s!==void 0)return s}return gXn(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 gVs(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(gVs,"extractSessionId");function AVs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&pVs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(AVs,"filterSupportedBetas");function yVs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...i0(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?AVs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=EVs(u,d?rYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Tfr}/${h}`:`${Tfr}${h.substring(m)}`}else s["User-Agent"]=Tfr;return s}a(yVs,"buildUpstreamHeaders");function EVs(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(EVs,"mergeBetas");function _Vs(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(_Vs,"sanitizeCacheControl");function vVs(t,e,r){if(!e)return!1;let n=t.thinking,o=n&&typeof n=="object"?n.type:void 0;return o==="adaptive"||o==="enabled"?e.capabilities?.supports?.adaptive_thinking?CVs(t,n,e,r):TVs(t,n):bVs(t,e)}a(vVs,"normalizeThinkingForModel");function CVs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=!!o&&o.length>0,c=e.type==="adaptive"&&Object.keys(e).length===1,l=t.output_config;if(!s){let h=!!l&&typeof l=="object"&&"effort"in l;return c&&!h?!1:(t.thinking={type:"adaptive"},xfr(t),!0)}let u=SVs(n,o),d=mO(o,u)??"medium",f=typeof l?.effort=="string"&&l.effort===d;return c&&f?!1:(t.thinking={type:"adaptive"},t.output_config={...l??{},effort:d},!0)}a(CVs,"_writeAdaptiveShape");function xfr(t){let e=t.output_config;if(!e||typeof e!="object")return!1;let r=e;return"effort"in r?(delete r.effort,Object.keys(r).length===0&&delete t.output_config,!0):!1}a(xfr,"_deleteEffortKey");function bVs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:xfr(t)}a(bVs,"_stripUnsupportedThinkingEffort");function SVs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(SVs,"_normaliseUserEffortForCapi");function TVs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:mXn,o=Math.min(mVs,Math.max(mXn,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(TVs,"_writeLegacyShape");function IVs(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(IVs,"readRequestBody");function xVs(t){return hVs.get(t)??Fg.Api}a(xVs,"mapStatusToAnthropicErrorType");function wVs(t){let e=new EXn.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 yXn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` +`}a(gVs,"wrapInSystemReminder");p();var yXn=require("crypto");var AVs=new Set(["ExitPlanMode"]);function wfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[vXn(r,"synthetic",t.error)];switch(t.type){case"system":return yVs(t,r);case"assistant":return gXn(EVs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return gXn(e.includeUserText===!0?vVs(t,r):_Vs(t,r),e.suppressedToolUseIds);case"result":return SVs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(wfr,"translate");function gXn(t,e){return e?t.filter(r=>{if(r.type==="tool.execution_start"){let{toolName:n,toolCallId:o}=r.data;if(typeof o=="string"&&n!==void 0&&AVs.has(n))return e.add(o),!1}if(r.type==="tool.execution_complete"){let{toolCallId:n}=r.data;if(typeof n=="string"&&e.has(n))return e.delete(n),!1}return!0}):t}a(gXn,"dropDedicatedChannelToolEvents");function EXn(t,e,r){if(t.parent_tool_use_id!==null)return[];let n=t.event,o=new Date().toISOString();switch(n.type){case"message_start":return[{id:e,timestamp:o,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:r??e}}];case"content_block_delta":{let s=n.delta;switch(s.type){case"text_delta":return[{id:Bg(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Bg(),timestamp:o,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${n.index}`,deltaContent:s.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(EXn,"translatePartial");function yVs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Bg(),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:Bg(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Bg(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(yVs,"translateSystem");function EVs(t,e,r,n,o,s){let c=t.message?.id??Bg(),l=[],u=t.message?.model,d=u;if(typeof u=="string"&&s)try{d=s(u)}catch{d=u}r||l.push({id:c,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:c,interactionId:o??c}});let f=t.message?.content??[],h=n??new Map,m=h.get(c)??0;return f.forEach(g=>{let A=m++;switch(g.type){case"text":{let y=g.text;typeof y=="string"&&y.length>0&&l.push({id:Bg(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${c}:${A}`,content:y,model:d}});break}case"thinking":{let y=g.thinking;typeof y=="string"&&y.length>0&&l.push({id:Bg(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Bg(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Bg(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a(EVs,"translateAssistant");function _Vs(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(_Xn(o,e));return n}a(_Vs,"translateUserLive");function vVs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Blt(n);return o.length>0&&r.push(AXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(_Xn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Blt(s);c.length>0&&r.push(AXn(e,c))}}}return r}a(vVs,"translateUserHistory");function _Xn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=TVs(t.content);return{id:Bg(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Bg(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(_Xn,"buildToolExecutionComplete");function AXn(t,e){return{id:Bg(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(AXn,"buildUserMessage");function CVs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(CVs,"stripSystemReminders");var bVs=/^\[Request interrupted by user[^\]]*\]$/;function Blt(t){let e=CVs(t);return bVs.test(e)?"":e}a(Blt,"sanitizeUserText");function SVs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Bg(),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(vXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Bg(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(SVs,"translateResult");function vXn(t,e,r){return{id:Bg(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(vXn,"buildSessionError");function TVs(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(TVs,"flattenToolResultContent");function Bg(){return(0,yXn.randomUUID)()}a(Bg,"newId");function CXn(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=xVs(c);if(!l)continue;(l.type==="user"&&IVs(l)||l.type==="assistant"&&s===void 0)&&(s=Bg());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...wfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(CXn,"translateHistory");function IVs(t){let e=(t.message??{}).content;if(typeof e=="string")return Blt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&Blt(r.text).length>0)return!0;return!1}a(IVs,"userMessageStartsInteraction");function xVs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&wVs(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(xVs,"adaptHistoryMessage");function wVs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(wVs,"isSyntheticReplayUserMessage");p();var hm=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 Flt=de(require("path"));Oo();var qc=new fe("ClaudeCodeAgent.session"),jc="ClaudeCodeSession",lNe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._suppressedToolUseIds=new Set;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new rme;this._userInputRegistry=new rme;this._exitPlanModeRegistry=new rme;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ExitPlanMode"?this._handleExitPlanMode(r,n):e==="ToolSearch"?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(hm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(bn).getCapabilities().agentDebugLog){let c=new mv(this.ctx);c.isEnabled()&&(this._otelTracker=new Llt(this.ctx,this.sessionId,c))}}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(hm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){qc.warn(this.ctx,`${jc}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async supportedAgents(){if(!this._query)return[];try{return await this._query.supportedAgents()}catch(e){return qc.warn(this.ctx,`${jc}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}_notifyAgentListChanged(){try{this.ctx.get(l0).notify("agent").catch(e=>{qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){qc.info(this.ctx,`${jc}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(hm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),qc.info(this.ctx,`${jc}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){qc.warn(this.ctx,`${jc}: 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){qc.warn(this.ctx,`${jc}: 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(hm).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=>{qc.warn(this.ctx,`${jc}: 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&&await this.setPermissionMode(e.permissionMode),this.ctx.get(hm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(hm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new CA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Mt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{qc.info(this.ctx,`${jc}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),qc.info(this.ctx,`${jc}.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 mXn(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??Mt()};this._otelTracker?.startRequest(this._model,e.message),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=Ft(this.ctx,Ye.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await tme.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(qc.warn(this.ctx,`${jc}: ${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"],...Q$t(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!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,this._notifyAgentListChanged(),qc.info(this.ctx,`${jc}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{qc.error(this.ctx,`${jc}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(yF).resolvePath();return`${Flt.dirname(e)}${Flt.delimiter}${process.env.PATH??""}`}catch(e){return qc.warn(this.ctx,`${jc}: 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 CA;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)){n.type==="result"?this._otelTracker?.endRequest():this._otelTracker?.endRequestWithError(n.error??"Turn ended with error"),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let s=this._currentInvokeDone;this._currentInvokeDone=void 0,s?.resolve()}}this._otelTracker?.endRequestWithError("SDK Query ended unexpectedly"),this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){qc.error(this.ctx,`${jc}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),this._otelTracker?.endRequestWithError(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(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;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&&qc.error(this.ctx,`${jc}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{this._otelTracker?.onMessage(e);let n=e?.type==="result"?this.ctx.get(hm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=wfr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor,suppressedToolUseIds:this._suppressedToolUseIds,interactionId:this._currentTurnInteractionId});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){qc.error(this.ctx,`${jc}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=EXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){qc.error(this.ctx,`${jc}: 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 qc.warn(this.ctx,`${jc}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;switch(e.type){case"permission":return this._respondFromRegistry(this._permissionRegistry,e.type,e.requestId,e.result);case"user_input":return this._respondFromRegistry(this._userInputRegistry,e.type,e.requestId,e.response);case"exit_plan_mode":return this._respondFromRegistry(this._exitPlanModeRegistry,e.type,e.requestId,e.response);default:return qc.warn(this.ctx,`${jc}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}}_respondFromRegistry(e,r,n,o){let s=e.respond(n,o);return s||qc.warn(this.ctx,`${jc}: respondToInteraction for unknown ${r} requestId`,{sessionId:this.sessionId,requestId:n}),s}_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}`)),this._exitPlanModeRegistry.respondAll({approved:!1,feedback:`Session ${this.sessionId} ${e} before exit_plan_mode resolved${n}`})}_handlePermissionRequest(e,r,n){let o=n.toolUseID??Mt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=aXn(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=lXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Mt(),u=await this._requestUserInputFromIde(l,uXn(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)}`}}}_handleExitPlanMode(e,r){let n=r.toolUseID??Mt();return r.signal.aborted?Promise.resolve({behavior:"deny",message:"ExitPlanMode request aborted"}):this._requestExitPlanModeFromIde(n,e,r)}async _requestExitPlanModeFromIde(e,r,n){let{promise:o,isSettled:s}=this._exitPlanModeRegistry.register(e),c=a(()=>{this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"ExitPlanMode request aborted"})},"onAbort"),l=a(()=>n.signal.removeEventListener("abort",c),"cleanupAbort");n.signal.addEventListener("abort",c,{once:!0});let u=typeof r.plan=="string"?r.plan:"",d=this._emitExitPlanModeRequested(e,{planContent:u,summary:u,actions:["exit_only","interactive"],recommendedAction:"interactive",toolCallId:n.toolUseID});d.catch(m=>{s()||(qc.error(this.ctx,`${jc}: failed to emit exit_plan_mode.requested, denying`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"Failed to deliver exit_plan_mode request to client"}))});let f;try{f=await o}finally{l()}let h=this._translateExitPlanModeResponse(f,r);return qc.info(this.ctx,`${jc}: exit_plan_mode resolved`,{sessionId:this.sessionId,requestId:e,behavior:h.behavior,selectedAction:f.selectedAction,autoApproveEdits:f.autoApproveEdits}),d.catch(()=>{}).then(()=>this._emitExitPlanModeCompleted(e,f)).catch(m=>{qc.warn(this.ctx,`${jc}: failed to emit exit_plan_mode.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),h}_translateExitPlanModeResponse(e,r){if(!e.approved){let c=e.feedback?.trim();return{behavior:"deny",message:c?`Plan not approved: ${c}`:"Plan not approved by user"}}if(e.selectedAction==="exit_only")return{behavior:"deny",message:"The user approved the plan but will implement it themselves. Do not make any code changes or take any further action. Stop and wait for the user."};let o=e.autoApproveEdits===!0?"acceptEdits":"default";return this._permissionMode=o,this.ctx.get(hm).setPermissionModeForSession(this.sessionId,o),{behavior:"allow",updatedInput:r,updatedPermissions:[{type:"setMode",mode:o,destination:"session"}]}}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()||(qc.error(this.ctx,`${jc}: 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=cXn(h,n);qc.info(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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()||(qc.error(this.ctx,`${jc}: 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=>{qc.warn(this.ctx,`${jc}: 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:Mt(),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:Mt(),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:Mt(),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:Mt(),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")}async _emitExitPlanModeRequested(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.requested",data:{requestId:e,planContent:r.planContent,summary:r.summary,actions:r.actions,recommendedAction:r.recommendedAction,...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeCompleted(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.completed",data:{requestId:e,approved:r.approved,...r.selectedAction!==void 0?{selectedAction:r.selectedAction}:{},...r.autoApproveEdits!==void 0?{autoApproveEdits:r.autoApproveEdits}:{},...r.feedback!==void 0?{feedback:r.feedback}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var TXn=de(require("http")),IXn=require("node:stream"),kfr=require("node:stream/promises"),xXn=require("node:string_decoder");Oo();var Fg=new fe("ClaudeMessagesProxyServer"),RVs=["interleaved-thinking","context-management","advanced-tool-use"],Rfr="cls_claude_agent",Ug={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"},kVs=new Map([[400,Ug.InvalidRequest],[401,Ug.Authentication],[402,Ug.Permission],[403,Ug.Permission],[404,Ug.NotFound],[413,Ug.RequestTooLarge],[424,Ug.InvalidRequest],[429,Ug.RateLimit],[466,Ug.InvalidRequest],[529,Ug.Overloaded]]),bXn=1024,PVs=32e3,zX=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-${Mt()}`,r=TXn.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},Fg.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(Fg.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,Ug.NotFound,"Not found")}catch(o){Fg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Ug.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=DVs(e.headers,n);if(!o.valid){Fg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Ug.Authentication,"Invalid authentication");return}o.sessionId&&Fg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await jVs(e),c;try{c=JSON.parse(s)}catch(l){Fg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Ug.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(nr),u;try{u=await c.getToken()}catch(_){Fg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Ug.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=ole(this.ctx,u,"v1/messages"),g=MVs(this.ctx,n,d),A;try{({headers:A}=await ile(this.ctx,g,u.token))}catch(_){Fg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Ug.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(Fg.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(sle(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";Fg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,HVs(_.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(hm),R=GVs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,kfr.pipeline)(b,R,o)}else await(0,kfr.pipeline)(b,o)}catch(_){if(y.signal.aborted){Fg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(Fg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Ug.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(xs).getMetadata()).find(s=>s.id===r)}catch(n){Fg.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 Pfr(e)?(Fg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(hm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&Fg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return BVs(e,n,s)?(Fg.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 LVs(e)?(Fg.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:$Vs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return W_.translateErrorMessage(o,s,void 0,BU(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Au).overageEnabled;return W_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:BU(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return Fg.exception(this.ctx,s,"._buildReasonForStatus/402"),SXn(r)??"Quota Exceeded."}if(o===400){let s=W_.translate400Reason(r);if(s!==void 0)return s}return SXn(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 DVs(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(DVs,"extractSessionId");function NVs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&RVs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(NVs,"filterSupportedBetas");function MVs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...s0(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?NVs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=OVs(u,d?cYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Rfr}/${h}`:`${Rfr}${h.substring(m)}`}else s["User-Agent"]=Rfr;return s}a(MVs,"buildUpstreamHeaders");function OVs(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(OVs,"mergeBetas");function LVs(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(LVs,"sanitizeCacheControl");function BVs(t,e,r){if(!e)return!1;let n=t.thinking,o=n&&typeof n=="object"?n.type:void 0;return o==="adaptive"||o==="enabled"?e.capabilities?.supports?.adaptive_thinking?FVs(t,n,e,r):qVs(t,n):UVs(t,e)}a(BVs,"normalizeThinkingForModel");function FVs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=!!o&&o.length>0,c=e.type==="adaptive"&&Object.keys(e).length===1,l=t.output_config;if(!s){let h=!!l&&typeof l=="object"&&"effort"in l;return c&&!h?!1:(t.thinking={type:"adaptive"},Pfr(t),!0)}let u=QVs(n,o),d=AO(o,u)??"medium",f=typeof l?.effort=="string"&&l.effort===d;return c&&f?!1:(t.thinking={type:"adaptive"},t.output_config={...l??{},effort:d},!0)}a(FVs,"_writeAdaptiveShape");function Pfr(t){let e=t.output_config;if(!e||typeof e!="object")return!1;let r=e;return"effort"in r?(delete r.effort,Object.keys(r).length===0&&delete t.output_config,!0):!1}a(Pfr,"_deleteEffortKey");function UVs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:Pfr(t)}a(UVs,"_stripUnsupportedThinkingEffort");function QVs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(QVs,"_normaliseUserEffortForCapi");function qVs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:bXn,o=Math.min(PVs,Math.max(bXn,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(qVs,"_writeLegacyShape");function jVs(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(jVs,"readRequestBody");function HVs(t){return kVs.get(t)??Ug.Api}a(HVs,"mapStatusToAnthropicErrorType");function GVs(t){let e=new xXn.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 IXn.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(wVs,"createCopilotUsageSniffer");function gXn(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(gXn,"extractErrorMessage");function RVs(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(RVs,"extractErrorCode");p();function _Xn(t){return t.replace(/[-.]/g,"").toLowerCase()}a(_Xn,"normalizeModelId");function vXn(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=_Xn(r);return e.find(s=>_Xn(s.id)===n)?.id??t}a(vXn,"mapCapiModelIdToPickerId");Mo();var Ug=new fe("ClaudeCodeAgent"),Qg="ClaudeCodeAgentService";function kVs(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:PUt,isReadonly:!0,isBuiltIn:!0}}a(kVs,"toRuntimeClaudeAgent");var y8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(ts);try{this.runtimeSourceRegistration=e.get(Ld).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async n=>(await this.getSupportedAgentsForWorkspace(n)).map(kVs),"getAgents")})}catch(n){if(!(n instanceof bl&&n.ctor===Ld))throw n}}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>lg(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(lg(c.cwd)));if(n.length===0)return[];let o=await Promise.all(n.map(c=>c.supportedAgents())),s=new Map;for(let c of o)for(let l of c){let u=l.name.toLowerCase();s.has(u)||s.set(u,l)}return[...s.values()]}async createSession(e){return kb(this.ctx,"claudeCodeAgent.createSession",async r=>{await qZn(this.ctx,e);let n=e.sessionId??Mt(),o=this._sessions.get(n);if(o)return Ug.info(this.ctx,`${Qg}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=un(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new iNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),Ug.info(this.ctx,`${Qg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return kb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await jZn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)Ug.info(this.ctx,`${Qg}.resumeSession: returning existing in-memory session`,{sessionId:n}),o=c.cwd,s="memory";else{let u=await this.sdkWrapper.getSessionInfo(n);if(!u?.cwd)throw new Error(`Session not found: ${n}`);let d=u.cwd,f=await this._ensureProxyConfig(),h=new iNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),Ug.info(this.ctx,`${Qg}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:d}),o=d,s="disk"}let l;try{let u=this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0}),d=this.ctx.get(xs).getMetadata().catch(m=>(Ug.debug(this.ctx,`${Qg}.resumeSession: model metadata unavailable for id mapping`,{sessionId:n,error:m instanceof Error?m.message:String(m)}),[])),[f,h]=await Promise.all([u,d]);l=hXn(f,m=>vXn(m,h)),r.properties.transcriptOk="true"}catch(u){Ug.warn(this.ctx,`${Qg}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:u instanceof Error?u.message:String(u)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=u instanceof Error?u.name:"Unknown"}return r.properties.reason=s,r.properties.modelId=e.model??"",r.measurements.eventCount=l?.length??0,{sessionId:n,workspacePath:o,events:l}})}async sendMessage(e,r){return kb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await HZn(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:Ks(s.cwd)};await this.ctx.get(Cg).applyPromptTemplateToRequest(e,[c]);let l=Mt(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:e.agentMode,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{Ug.warn(this.ctx,`${Qg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),Vn(this.ctx,"claudeCodeAgent.sendMessage.failure",d,{success:"false",reason:"invoke"},{totalTimeMs:performance.now()-u})}),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}})}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}async listSessions(e){return kb(this.ctx,"claudeCodeAgent.listSessions",async r=>{VZn(this.ctx,e),Ug.info(this.ctx,`${Qg}.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 Ug.info(this.ctx,`${Qg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return kb(this.ctx,"claudeCodeAgent.listModels",async r=>{WZn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),Ug.info(this.ctx,`${Qg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(xs).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>w$e(c.capabilities.family)).map(Drt);return Ug.info(this.ctx,`${Qg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await kb(this.ctx,"claudeCodeAgent.stopSession",async r=>{GZn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){Ug.info(this.ctx,`${Qg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return kb(this.ctx,"claudeCodeAgent.destroySession",r=>{$Zn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),Ug.info(this.ctx,`${Qg}.destroySession`,{sessionId:n}),{success:!0}):(Ug.info(this.ctx,`${Qg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return Ug.error(this.ctx,`${Qg}.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 kb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await rNe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await kb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.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}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return Ug.warn(this.ctx,`${Qg}.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(){this.runtimeSourceRegistration?.dispose(),this.runtimeSourceRegistration=void 0;for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(WX).start()}};p();var wfr=new Cn;function CXn(t){return[...t].sort((e,r)=>{let n=wfr.get(e.uri)??0;return(wfr.get(r.uri)??0)-n})}a(CXn,"sortByAccessTimes");var bXn=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&wfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var SXn=de(require("events"));var Olt="CompletionRequested",t4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new SXn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Olt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=z0(this.ctx,e,`event.${Olt}`);return this.#e.on(Olt,r),Fn.Disposable.create(()=>this.#e.off(Olt,r))}};p();p();var Rfr=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?.()}},Llt=class extends Rfr{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 Pb=class{constructor(e){this.ctx=e;this.#e=new fe("AsyncCompletionManager");this.requests=new Cn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(kfr(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 Llt;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(Zt).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 vA,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(kfr(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)kfr(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 kfr(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(kfr,"isCandidate");p();p();var sNe=class{constructor(e){this.maxSize=e;this.root=new oNe;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 oNe;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 oNe;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 sNe(100)}};p();var Db=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&&TXn(this.choices[0].completionText,n))return PVs(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 PVs(t,e){return t.filter(r=>TXn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(PVs,"adjustChoicesStart");function TXn(t,e){return t.startsWith(e)&&t.length>e.length}a(TXn,"startsWithAndExceeds");p();p();var E8={" ":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 IXn(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 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 j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.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 Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.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 V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.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 le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.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 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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.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 rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.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 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 Qe;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?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.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 Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.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 J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.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?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.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 me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.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 et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.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 ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.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 Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.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 cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.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 Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.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 $0=DVs(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+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(IXn,"multilineModelPredict");function DVs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(DVs,"sigmoid");var NVs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},xXn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function wXn(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(NVs[r]??[]).some(l=>s.includes(l))}a(wXn,"hasComment");var Blt=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=wXn(e,-2,r),this.rstripSecondToLastLineHasComment=wXn(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(GVs,"createCopilotUsageSniffer");function SXn(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(SXn,"extractErrorMessage");function $Vs(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($Vs,"extractErrorCode");p();function wXn(t){return t.replace(/[-.]/g,"").toLowerCase()}a(wXn,"normalizeModelId");function RXn(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=wXn(r);return e.find(s=>wXn(s.id)===n)?.id??t}a(RXn,"mapCapiModelIdToPickerId");Oo();var Qg=new fe("ClaudeCodeAgent"),qg="ClaudeCodeAgentService";function VVs(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:OUt,isReadonly:!0,isBuiltIn:!0}}a(VVs,"toRuntimeClaudeAgent");var _8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(ts);try{this.runtimeSourceRegistration=e.get(Fd).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async n=>(await this.getSupportedAgentsForWorkspace(n)).map(VVs),"getAgents")})}catch(n){if(!(n instanceof Sl&&n.ctor===Fd))throw n}}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>ug(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(ug(c.cwd)));if(n.length===0)return[];let o=await Promise.all(n.map(c=>c.supportedAgents())),s=new Map;for(let c of o)for(let l of c){let u=l.name.toLowerCase();s.has(u)||s.set(u,l)}return[...s.values()]}async createSession(e){return kb(this.ctx,"claudeCodeAgent.createSession",async r=>{await zZn(this.ctx,e);let n=e.sessionId??Mt(),o=this._sessions.get(n);if(o)return Qg.info(this.ctx,`${qg}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=un(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new lNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),Qg.info(this.ctx,`${qg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return kb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await YZn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)Qg.info(this.ctx,`${qg}.resumeSession: returning existing in-memory session`,{sessionId:n}),o=c.cwd,s="memory";else{let u=await this.sdkWrapper.getSessionInfo(n);if(!u?.cwd)throw new Error(`Session not found: ${n}`);let d=u.cwd,f=await this._ensureProxyConfig(),h=new lNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),Qg.info(this.ctx,`${qg}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:d}),o=d,s="disk"}let l;try{let u=this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0}),d=this.ctx.get(xs).getMetadata().catch(m=>(Qg.debug(this.ctx,`${qg}.resumeSession: model metadata unavailable for id mapping`,{sessionId:n,error:m instanceof Error?m.message:String(m)}),[])),[f,h]=await Promise.all([u,d]);l=CXn(f,m=>RXn(m,h)),r.properties.transcriptOk="true"}catch(u){Qg.warn(this.ctx,`${qg}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:u instanceof Error?u.message:String(u)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=u instanceof Error?u.name:"Unknown"}return r.properties.reason=s,r.properties.modelId=e.model??"",r.measurements.eventCount=l?.length??0,{sessionId:n,workspacePath:o,events:l}})}async sendMessage(e,r){return kb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await KZn(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:Ks(s.cwd)};await this.ctx.get(bg).applyPromptTemplateToRequest(e,[c]);let l=Mt(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:e.agentMode,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{Qg.warn(this.ctx,`${qg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),ai(this.ctx,"claudeCodeAgent.sendMessage.failure",d,{success:"false",reason:"invoke"},{totalTimeMs:performance.now()-u})}),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}})}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}async listSessions(e){return kb(this.ctx,"claudeCodeAgent.listSessions",async r=>{XZn(this.ctx,e),Qg.info(this.ctx,`${qg}.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 Qg.info(this.ctx,`${qg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return kb(this.ctx,"claudeCodeAgent.listModels",async r=>{eXn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),Qg.info(this.ctx,`${qg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(xs).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>N$e(c.capabilities.family)).map(Frt);return Qg.info(this.ctx,`${qg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await kb(this.ctx,"claudeCodeAgent.stopSession",async r=>{JZn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){Qg.info(this.ctx,`${qg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return kb(this.ctx,"claudeCodeAgent.destroySession",r=>{ZZn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),Qg.info(this.ctx,`${qg}.destroySession`,{sessionId:n}),{success:!0}):(Qg.info(this.ctx,`${qg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return Qg.error(this.ctx,`${qg}.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 kb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){Qg.info(this.ctx,`${qg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await aNe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await kb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){Qg.info(this.ctx,`${qg}.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}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return Qg.warn(this.ctx,`${qg}.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(){this.runtimeSourceRegistration?.dispose(),this.runtimeSourceRegistration=void 0;for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(zX).start()}};p();var Dfr=new Cn;function kXn(t){return[...t].sort((e,r)=>{let n=Dfr.get(e.uri)??0;return(Dfr.get(r.uri)??0)-n})}a(kXn,"sortByAccessTimes");var PXn=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&Dfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var DXn=de(require("events"));var Ult="CompletionRequested",r4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new DXn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Ult,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=Y0(this.ctx,e,`event.${Ult}`);return this.#e.on(Ult,r),Fn.Disposable.create(()=>this.#e.off(Ult,r))}};p();p();var Nfr=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?.()}},Qlt=class extends Nfr{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 Pb=class{constructor(e){this.ctx=e;this.#e=new fe("AsyncCompletionManager");this.requests=new Cn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Mfr(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 Qlt;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(Zt).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 CA,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(Mfr(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)Mfr(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 Mfr(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(Mfr,"isCandidate");p();p();var dNe=class{constructor(e){this.maxSize=e;this.root=new uNe;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 uNe;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 uNe;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 dNe(100)}};p();var Db=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&&NXn(this.choices[0].completionText,n))return WVs(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 WVs(t,e){return t.filter(r=>NXn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(WVs,"adjustChoicesStart");function NXn(t,e){return t.startsWith(e)&&t.length>e.length}a(NXn,"startsWithAndExceeds");p();p();var v8={" ":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 MXn(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 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 j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.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 Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.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 V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.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 le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.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 he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.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 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 ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.0012774367867215346;let Me;t[120]>1e-35?Me=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Me=-.042799574885345304:Me=.07412430171193245:Me=-.11248270469336048:t[193]>1e-35?Me=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Me=.028911612178122104:Me=.12326369727728437:t[0]>4091.5000000000005?Me=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Me=.1159839898100149:Me=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Me=-.0216343737351583:Me=-.1220272260878369:t[2]>18.500000000000004?Me=.09152924475072398:t[8]>55.50000000000001?Me=.039508716651005665:Me=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Me=.06793009902674053:Me=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Me=-.04391068849624096:Me=.04009967593394672:t[8]>1085.5000000000002?Me=-.024773826356034825:Me=-.13919707884246582:Me=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Me=-.11567917501901476:Me=-.006813640337684114:t[3]>7.500000000000001?Me=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Me=-.001754586408351048:Me=-.055422422450722056:Me=-.06090032532532226:t[0]>5269.500000000001?Me=.11787981735983527:Me=-.00198119768540783:Me=.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 rt;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?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.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 Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.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 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 Qe;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?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.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 Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.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 J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.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?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.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 me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.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 et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.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?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.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 Ct;t[187]>1e-35?t[243]>1e-35?Ct=-.08392792551692502:t[10]>68.50000000000001?Ct=.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?Ct=-.0825306209711224:Ct=.049559996084532945:Ct=-.1064938580886302:Ct=.03353240732240275:Ct=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?Ct=.16966001471529374:t[1]>57.50000000000001?Ct=-.005772777673676247:Ct=.09383677041525058:t[8]>747.5000000000001?Ct=.054068175469351235:Ct=-.049968216310277036:t[8]>753.5000000000001?Ct=-.0679383555784074:t[4]>8.500000000000002?Ct=-.059757341189735386:Ct=.05701083682780414:Ct=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?Ct=.05820296128730006:Ct=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?Ct=.15340611616954566:Ct=.04385036188666874:t[0]>4449.500000000001?Ct=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?Ct=.004840354641006495:Ct=.09967827580276283:Ct=.11605363537391578:t[9]>19.500000000000004?Ct=-.0735831692725717:Ct=.019973331823355176:t[306]>1e-35?t[149]>1e-35?Ct=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?Ct=-.02442182361342386:Ct=.10334853004243093:Ct=-.030431948680167104:Ct=-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 ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.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?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.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 Oe;t[304]>1e-35?Oe=-.04717777269217453:t[76]>1e-35?Oe=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Oe=-.09648224457374217:t[132]>1e-35?Oe=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Oe=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Oe=.10838431695638147:t[230]>1e-35?Oe=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Oe=.050071316251979:Oe=-.006356941111525215:t[6]>8.500000000000002?Oe=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Oe=.10217402850540398:Oe=-.048840949025349197:Oe=-.03668313197909846:t[7]>39.50000000000001?Oe=-.0562642841496003:t[10]>2.5000000000000004?Oe=.09749777369987417:Oe=-.04848223121417616:t[0]>5453.500000000001?Oe=.08316648226133942:Oe=-.0261979698267618:t[212]>1e-35?Oe=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Oe=.04837009746506856:Oe=-.09184360565631328:Oe=.0032411047845613606:t[0]>4733.500000000001?Oe=.0977378556864798:Oe=.010776545559325588:Oe=-.012483310473120218:Oe=-.049284121449103935:Oe=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Oe=-.08380361910948711:Oe=.07375088778585813:Oe=-.1084864186071348:Oe=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.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 Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.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 cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.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 Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.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 V0=zVs(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+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Me+we+Be+rt+st+Et+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+Ct+ht+We+ae+Re+Oe+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-V0,V0]}a(MXn,"multilineModelPredict");function zVs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(zVs,"sigmoid");var YVs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},OXn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function LXn(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(YVs[r]??[]).some(l=>s.includes(l))}a(LXn,"hasComment");var qlt=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=LXn(e,-2,r),this.rstripSecondToLastLineHasComment=LXn(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]}},Pfr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Blt(e,n),this.suffixFeatures=new Blt(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(xXn).length+1).fill(0);r[xXn[this.language]??0]=1;let n=new Array(Object.keys(E8).length+1).fill(0);n[E8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(E8).length+1).fill(0);o[E8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(E8).length+1).fill(0);s[E8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(E8).length+1).fill(0);return c[E8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function MVs(t,e){return new Pfr(t.prefix,t.suffix,e)}a(MVs,"constructMultilineFeatures");function RXn(t,e){let r=MVs(t,e).constructFeatures();return IXn(r)[1]}a(RXn,"requestMultilineScore");p();var Dfr=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}},Flt=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 Dfr(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 eVe(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=cYe(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 ry=class{static{a(this,"InlineCompletionManager")}};var Ult=new fe("getCompletions"),aNe="legacy",cNe=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","opportunityId","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 Qlt(t,e,r){t.get(ry).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=rme(r.resultType),n.properties.completionsImplementation??=aNe,Et(t,o,n),At(t,o,fU(n.properties,cNe),n.measurements)}a(Qlt,"telemetryShown");function kXn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=aNe,Et(t,n,r),At(t,n,fU(r.properties,cNe),r.measurements)}a(kXn,"telemetryAccepted");function PXn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=aNe,Et(t,n,r),At(t,n,fU(r.properties,cNe),r.measurements)}a(PXn,"telemetryRejected");function kH(t,e={}){return t.properties.completionsImplementation??=aNe,{...e,telemetryBlob:t}}a(kH,"mkCanceledResultTelemetry");function yp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??aNe};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(kk).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(yp,"mkBasicResultTelemetry");function DXn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=yl()-e.telemetryBlob.issuedTime,n=rme(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 Ult.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),vse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Ult.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){Et(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}vse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(DXn,"handleGhostTextResultTelemetry");function rme(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(rme,"resultTypeToString");p();p();p();var OVs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},LVs="ms-vscode.cpptools",BVs="CppCompletionContextProvider";function NXn(t,e,r,n){(e.includes(BVs)||e.length===1&&e[0]==="*")&&OXn(t,r,n)}a(NXn,"fillInCppVSActiveExperiments");function MXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(LVs))&&OXn(t,r,n)}a(MXn,"fillInCppVSCodeActiveExperiments");function OXn(t,e,r){try{let n=OVs,o=t.get(Zt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Nr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Nr.exception(t,n,"fillInCppActiveExperiments")}}a(OXn,"addActiveExperiments");p();function qlt(t,e,r){try{let n=t.get(Zt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(qlt,"fillInCSharpActiveExperiments");p();var Nfr="fallbackContextProvider",Mfr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function LXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Nfr))&&FVs(t,r,n)}a(LXn,"fillInMultiLanguageActiveExperiments");function FVs(t,e,r){try{let n=UVs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(FVs,"addActiveExperiments");function UVs(t,e){let r=Mfr,n=t.get(Zt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Nr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(UVs,"getMultiLanguageContextProviderParamsFromExp");p();var QVs="typescript-ai-context-provider";function BXn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(QVs)))return!1;try{let o=t.get(Zt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Nr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(BXn,"fillInTsActiveExperiments");p();Mo();var FXn=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")]))}),UXn=S.Intersect([S.Object({name:S.String(),value:S.String()}),FXn]),QXn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),FXn]),qVs=[UXn,QXn],jVs=S.Union(qVs),HVs=new Map([["Trait",qu.Compile(UXn)],["CodeSnippet",qu.Compile(QXn)]]),GVs=a(t=>t,"ensureTypesAreEqual");GVs(!0);var $Vs=S.Object({contextItems:S.Array(jVs)}),VVs=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())})]))}),Ofr=S.Object({id:S.String()}),WVs=S.Intersect([Ofr,VVs]),zVs=S.Intersect([Ofr,$Vs]),qXn=S.Object({providers:S.Array(WVs)}),jXn=S.Object({providers:S.Array(Ofr)}),Lfr=S.Object({providers:S.Array(zVs),updating:S.Optional(S.Array(S.String()))}),HXn=S.Intersect([_vn,S.Object({contextItems:S.Optional(Lfr)})]);function jlt(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(jlt,"filterContextItemsByType");function GXn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of HVs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(GXn,"filterSupportedContextItems");function YVs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(YVs,"validateContextItemId");function $Xn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Mt();if(!YVs(s)){let c=Mt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Mt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a($Xn,"addOrValidateContextItemsIDs");p();var pm=class{constructor(e=()=>new Bfr){this.createStatistics=e;this.statistics=new Cn(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)}}},Bfr=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 Hlt(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(Hlt,"componentStatisticsToPromptMatcher");var VXn=de(ri());var hm=class{static{a(this,"ContextProviderRegistry")}},r4=class{static{a(this,"DefaultContextProviders")}},nme=class extends r4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Ffr=class extends hm{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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;qlt(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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];MXn(this.ctx,h.map(T=>T[0].id),u,s),LXn(this.ctx,h.map(T=>T[0].id),u,s),BXn(this.ctx,h.map(T=>T[0].id),u,s);let g=new VXn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=kCe(this.ctx)&&!Q9e(this.ctx)?0:KVs(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(pm).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Rfn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")xP(R.reason)||Nr.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")&&(Nr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);l6t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=GXn(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=$Xn(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(pm).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Nr.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=WXn(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}},Ufr=class extends hm{constructor(r){super();this.delegate=r;this._cachedContextItems=new Cn(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 Glt(t,e){return new Ufr(new Ffr(t,e))}a(Glt,"getContextProviderRegistry");function $lt(t,e,r){let n=t.get(pm).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($lt,"telemetrizeContextItems");function Vlt(t){return t.matchScore>0&&t.resolution!=="error"}a(Vlt,"matchContextItems");function WXn(t,e){let r=Qfr(t,e),n=Ft(t,Ye.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(r4).getIds();return Array.from(new Set([...o,...r,...n]))}a(WXn,"getActiveContextProviders");function Qfr(t,e){return kCe(t)?["*"]:t.get(Zt).contextProviders(e)}a(Qfr,"getExpContextProviders");function ime(t,e){return WXn(t,e).length>0}a(ime,"useContextProviderAPI");function KVs(t,e){let r=Ft(t,Ye.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Zt).contextProviderTimeBudget(e)}a(KVs,"getContextProviderTimeBudget");var Nb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Cn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(hm),{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 Wlt=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 AQ(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)}},zlt=class extends Wlt{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]}},Ofr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new qlt(e,n),this.suffixFeatures=new qlt(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(OXn).length+1).fill(0);r[OXn[this.language]??0]=1;let n=new Array(Object.keys(v8).length+1).fill(0);n[v8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(v8).length+1).fill(0);o[v8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(v8).length+1).fill(0);s[v8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(v8).length+1).fill(0);return c[v8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function KVs(t,e){return new Ofr(t.prefix,t.suffix,e)}a(KVs,"constructMultilineFeatures");function BXn(t,e){let r=KVs(t,e).constructFeatures();return MXn(r)[1]}a(BXn,"requestMultilineScore");p();var Lfr=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}},jlt=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 Lfr(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 oVe(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=hYe(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 ny=class{static{a(this,"InlineCompletionManager")}};var Hlt=new fe("getCompletions"),fNe="legacy",pNe=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","opportunityId","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 Glt(t,e,r){t.get(ny).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=ime(r.resultType),n.properties.completionsImplementation??=fNe,At(t,o,n),Rt(t,o,hU(n.properties,pNe),n.measurements)}a(Glt,"telemetryShown");function FXn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=fNe,At(t,n,r),Rt(t,n,hU(r.properties,pNe),r.measurements)}a(FXn,"telemetryAccepted");function UXn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=fNe,At(t,n,r),Rt(t,n,hU(r.properties,pNe),r.measurements)}a(UXn,"telemetryRejected");function MH(t,e={}){return t.properties.completionsImplementation??=fNe,{...e,telemetryBlob:t}}a(MH,"mkCanceledResultTelemetry");function _p(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??fNe};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(Dk).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(_p,"mkBasicResultTelemetry");function QXn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=El()-e.telemetryBlob.issuedTime,n=ime(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 Hlt.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),Cse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Hlt.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){At(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}Cse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(QXn,"handleGhostTextResultTelemetry");function ime(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(ime,"resultTypeToString");p();p();p();var JVs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},ZVs="ms-vscode.cpptools",XVs="CppCompletionContextProvider";function qXn(t,e,r,n){(e.includes(XVs)||e.length===1&&e[0]==="*")&&HXn(t,r,n)}a(qXn,"fillInCppVSActiveExperiments");function jXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(ZVs))&&HXn(t,r,n)}a(jXn,"fillInCppVSCodeActiveExperiments");function HXn(t,e,r){try{let n=JVs,o=t.get(Zt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Nr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Nr.exception(t,n,"fillInCppActiveExperiments")}}a(HXn,"addActiveExperiments");p();function $lt(t,e,r){try{let n=t.get(Zt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a($lt,"fillInCSharpActiveExperiments");p();var Bfr="fallbackContextProvider",Ffr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function GXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Bfr))&&eWs(t,r,n)}a(GXn,"fillInMultiLanguageActiveExperiments");function eWs(t,e,r){try{let n=tWs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(eWs,"addActiveExperiments");function tWs(t,e){let r=Ffr,n=t.get(Zt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Nr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(tWs,"getMultiLanguageContextProviderParamsFromExp");p();var rWs="typescript-ai-context-provider";function $Xn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(rWs)))return!1;try{let o=t.get(Zt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Nr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a($Xn,"fillInTsActiveExperiments");p();Oo();var VXn=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")]))}),WXn=S.Intersect([S.Object({name:S.String(),value:S.String()}),VXn]),zXn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),VXn]),nWs=[WXn,zXn],iWs=S.Union(nWs),oWs=new Map([["Trait",ju.Compile(WXn)],["CodeSnippet",ju.Compile(zXn)]]),sWs=a(t=>t,"ensureTypesAreEqual");sWs(!0);var aWs=S.Object({contextItems:S.Array(iWs)}),cWs=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())})]))}),Ufr=S.Object({id:S.String()}),lWs=S.Intersect([Ufr,cWs]),uWs=S.Intersect([Ufr,aWs]),YXn=S.Object({providers:S.Array(lWs)}),KXn=S.Object({providers:S.Array(Ufr)}),Qfr=S.Object({providers:S.Array(uWs),updating:S.Optional(S.Array(S.String()))}),JXn=S.Intersect([Tvn,S.Object({contextItems:S.Optional(Qfr)})]);function Vlt(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(Vlt,"filterContextItemsByType");function ZXn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of oWs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(ZXn,"filterSupportedContextItems");function dWs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(dWs,"validateContextItemId");function XXn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Mt();if(!dWs(s)){let c=Mt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Mt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(XXn,"addOrValidateContextItemsIDs");p();var mm=class{constructor(e=()=>new qfr){this.createStatistics=e;this.statistics=new Cn(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)}}},qfr=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 Wlt(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(Wlt,"componentStatisticsToPromptMatcher");var eei=de(ei());var gm=class{static{a(this,"ContextProviderRegistry")}},n4=class{static{a(this,"DefaultContextProviders")}},ome=class extends n4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},jfr=class extends gm{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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;$lt(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 Nr.debug(this.ctx,"Resolving context providers cancelled"),[];jXn(this.ctx,h.map(T=>T[0].id),u,s),GXn(this.ctx,h.map(T=>T[0].id),u,s),$Xn(this.ctx,h.map(T=>T[0].id),u,s);let g=new eei.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=NCe(this.ctx)&&!$9e(this.ctx)?0:fWs(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(mm).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Mfn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")RP(R.reason)||Nr.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")&&(Nr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);p6t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=ZXn(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=XXn(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(mm).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Nr.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=tei(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}},Hfr=class extends gm{constructor(r){super();this.delegate=r;this._cachedContextItems=new Cn(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 zlt(t,e){return new Hfr(new jfr(t,e))}a(zlt,"getContextProviderRegistry");function Ylt(t,e,r){let n=t.get(mm).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(Ylt,"telemetrizeContextItems");function Klt(t){return t.matchScore>0&&t.resolution!=="error"}a(Klt,"matchContextItems");function tei(t,e){let r=Gfr(t,e),n=Ft(t,Ye.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(n4).getIds();return Array.from(new Set([...o,...r,...n]))}a(tei,"getActiveContextProviders");function Gfr(t,e){return NCe(t)?["*"]:t.get(Zt).contextProviders(e)}a(Gfr,"getExpContextProviders");function sme(t,e){return tei(t,e).length>0}a(sme,"useContextProviderAPI");function fWs(t,e){let r=Ft(t,Ye.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Zt).contextProviderTimeBudget(e)}a(fWs,"getContextProviderTimeBudget");var Nb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Cn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(gm),{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 Jlt=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 EQ(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)}},Zlt=class extends Jlt{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(YXn,"rewindToNearestNonWs");function zXn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(zXn,"indent");function ZVs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=zXn(t,r),o=zXn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(ZVs,"outdented");var n4=class extends Wlt{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&&Ddn(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()}}},XVs={python:new n4("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 n4("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 n4("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 n4("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 zlt("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 zlt("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 n4("csharp",{},new Map([]),[],"block",null,!0),java:new n4("java",{},new Map([]),[],"block",null,!0),php:new n4("php",{},new Map([]),[],"block",null,!0),cpp:new n4("cpp",{},new Map([]),[],"block",null,!0)};function qfr(t){if(!kS(t))throw new Error(`Language ${t} is not supported`);return XVs[Z$e(t)]}a(qfr,"getBlockParser");async function KXn(t,e,r){return kS(t)?qfr(t).isEmptyBlockStart(e,r):!1}a(KXn,"isEmptyBlockStart");async function JXn(t,e,r,n){if(kS(t))return qfr(t).isBlockBodyFinished(e,r,n)}a(JXn,"isBlockBodyFinished");async function ZXn(t,e,r){if(kS(t))return qfr(t).getNodeStart(e,r)}a(ZXn,"getNodeStart");var T3f=new fe("parseBlock");function lNe(t,e,r){let n=e.getText(gu.range(gu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>JXn(s,n,c,o)}a(lNe,"parsingBlockFinished");function Klt(t,e){return KXn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(Klt,"isEmptyBlockStartUtil");async function XXn(t,e,r,n){let s=e.getText(gu.range(gu.position(0,0),r))+n,c=await ZXn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(XXn,"getNodeStartUtil");var eWs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),tWs=new RegExp(`^(${eWs.join("|")})`);function rWs(t){return tWs.test(t.trimLeft().toLowerCase())}a(rWs,"isContinuationLine");function Ylt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Ylt,"indentationOfLine");function Jlt(t,e){let r=t.getText(),n=t.offsetAt(e);return jfr(r,n,t.detectedLanguageId)}a(Jlt,"contextIndentation");function jfr(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(pWs,"getLineAtOffset");function nei(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(nei,"rewindToNearestNonWs");function rei(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(rei,"indent");function hWs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=rei(t,r),o=rei(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(hWs,"outdented");var i4=class extends Jlt{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&&Bdn(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()}}},mWs={python:new i4("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 i4("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 i4("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 i4("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 Zlt("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 Zlt("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 i4("csharp",{},new Map([]),[],"block",null,!0),java:new i4("java",{},new Map([]),[],"block",null,!0),php:new i4("php",{},new Map([]),[],"block",null,!0),cpp:new i4("cpp",{},new Map([]),[],"block",null,!0)};function $fr(t){if(!PS(t))throw new Error(`Language ${t} is not supported`);return mWs[nVe(t)]}a($fr,"getBlockParser");async function iei(t,e,r){return PS(t)?$fr(t).isEmptyBlockStart(e,r):!1}a(iei,"isEmptyBlockStart");async function oei(t,e,r,n){if(PS(t))return $fr(t).isBlockBodyFinished(e,r,n)}a(oei,"isBlockBodyFinished");async function sei(t,e,r){if(PS(t))return $fr(t).getNodeStart(e,r)}a(sei,"getNodeStart");var W3f=new fe("parseBlock");function hNe(t,e,r){let n=e.getText(gu.range(gu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>oei(s,n,c,o)}a(hNe,"parsingBlockFinished");function eut(t,e){return iei(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(eut,"isEmptyBlockStartUtil");async function aei(t,e,r,n){let s=e.getText(gu.range(gu.position(0,0),r))+n,c=await sei(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(aei,"getNodeStartUtil");var gWs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),AWs=new RegExp(`^(${gWs.join("|")})`);function yWs(t){return AWs.test(t.trimLeft().toLowerCase())}a(yWs,"isContinuationLine");function Xlt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Xlt,"indentationOfLine");function tut(t,e){let r=t.getText(),n=t.offsetAt(e);return Vfr(r,n,t.detectedLanguageId)}a(tut,"contextIndentation");function Vfr(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=Ylt(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=Ylt(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=Xlt(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=Xlt(n[f]);if(h!==void 0&&h{let n=iWs(r,t,e);return n==="continue"?void 0:n}}a(eei,"indentationBlockFinished");p();p();p();p();p();p();var oWs={tokenizerName:"o200k_base"};function sWs(t){return{...oWs,...t}}a(sWs,"cursorContextOptions");function uNe(t,e={}){let r=sWs(e),n=ws(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&&EWs&&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=_Ws(r,t,e);return n==="continue"?void 0:n}}a(cei,"indentationBlockFinished");p();p();p();p();p();p();var vWs={tokenizerName:"o200k_base"};function CWs(t){return{...vWs,...t}}a(CWs,"cursorContextOptions");function mNe(t,e={}){let r=CWs(e),n=ws(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(uNe,"getCursorContext");p();p();var aWs={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 tei(t){let e=aWs[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(tei,"announceSnippet");var Hfr=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 Gfr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=dWs.get(e.languageId)??uWs}tokenize(e){return new Set(cWs(e).filter(r=>!this.stopsForLanguage.has(r)))}},rei=new Hfr(20),ome=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new Gfr(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=rei.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 zfr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=xWs.get(e.languageId)??IWs}tokenize(e){return new Set(SWs(e).filter(r=>!this.stopsForLanguage.has(r)))}},uei=new Wfr(20),ame=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new zfr(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=uei.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(cWs,"splitIntoWords");var lWs=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"]),uWs=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",...lWs]),dWs=new Map([]);p();function Zlt(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 Zlt(this.windowLength,e)}_getCursorContextInfo(e){return uNe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return fWs(e,r)}};function fWs(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(fWs,"computeScore");p();var eut=class t extends ome{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 Zlt(this.windowLength,e)}_getCursorContextInfo(e){return uNe(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):uNe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return pWs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await AQ(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 pWs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(pWs,"computeScore");var hWs=0,mWs=60,gWs=4,AWs=1,yWs=20,EWs=1e4,nei={snippetLength:mWs,threshold:hWs,maxTopSnippets:gWs,maxCharPerFile:EWs,maxNumberOfFiles:yWs,maxSnippetsPerFile:AWs,useSubsetMatching:!1};var $fr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function _Ws(t,e){return(e.useSubsetMatching?eut.FACTORY(e.snippetLength):Xlt.FACTORY(e.snippetLength)).to(t)}a(_Ws,"getMatcher");async function iei(t,e,r){let n=_Ws(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(iei,"getSimilarSnippets");function oei(t,e){return{...$fr,useSubsetMatching:Vfr(t,e)}}a(oei,"getCppSimilarFilesOptions");function sei(t){return $fr.maxTopSnippets}a(sei,"getCppNumberOfSnippets");var vWs=new Map([["cpp",oei]]);function tut(t,e,r){let n=vWs.get(r);return n?n(t,e):{...nei,useSubsetMatching:Vfr(t,e)}}a(tut,"getSimilarFilesOptions");var CWs=new Map([["cpp",sei]]);function aei(t,e){let r=CWs.get(e);return r?r(t):xdn}a(aei,"getNumberOfSnippets");function Vfr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ft(t,Ye.UseSubsetMatching))??!1}a(Vfr,"useSubsetMatching");p();p();p();p();var bWs="content_excluded";async function rut(t,e,r,n){let o=jlt(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($r),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(pm).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,bWs]]),m}).map(f=>f.data)}a(rut,"getCodeSnippetsFromContextItems");function cei(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(cei,"addRelativePathToCodeSnippets");p();function Ep(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(Ep,"Text");function PH(t){return t.children}a(PH,"Chunk");p();function Kn(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(Kn,"functionComponentFunction");function j2(t){return{type:"f",children:t}}a(j2,"fragmentFunction");j2.isFragmentFunction=!0;var nut=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=cei(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(Kn(Ep,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Kn(Ep,{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=Kfr(c);return Kn(j2,{children:[Kn(zX,{document:r,position:o,maxCharacters:m}),Kn(aut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(fNe,"CurrentFile");function zX(t){if(t.document===void 0||t.position===void 0)return Kn(Ep,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Kn(Ep,{children:e})}a(zX,"BeforeCursor");function aut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Kn(Ep,{});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 Kn(Ep,{});if(r===s)return Kn(Ep,{children:r});let c=s;if(r!==""){let l=ws(t.tokenizer),u=l.takeFirstTokens(s,dNe);u.tokens.length>0&&100*sut(u.tokens,l.takeFirstTokens(r,dNe).tokens)?.score<(t.suffixMatchThreshold??z$e)*u.tokens.length&&(c=r)}return c!==r&&n(c),Kn(Ep,{children:c})}a(aut,"AfterCursor");function lei(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=Kfr(c);return Kn(zX,{document:r,position:o,maxCharacters:u})}a(lei,"DocumentPrefix");function uei(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=Kfr(c);return Kn(aut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(uei,"DocumentSuffix");p();var cut=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 dei(t){return t.map(e=>e.elidedValue).join("")}a(dei,"makePrompt");function fei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(fei,"makePrefixPrompt");function pei(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(pei,"makeContextPrompt");p();var sme=class{constructor(e,r=Jfr()){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 Jfr(){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===PH.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(Jfr,"defaultTransformers");p();var Zfr={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"]}},hei={};for(let[t,e]of Object.entries(Zfr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)hei[r]=t;else hei[t]=t;var SWs={start:"//",end:""},TWs=["php","plaintext"],Xfr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function mei(t){return Object.values(Xfr).includes(t.trim())}a(mei,"isShebangLine");function IWs({source:t}){return t.startsWith("#!")||t.startsWith("e.length>0)}a(SWs,"splitIntoWords");var TWs=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"]),IWs=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",...TWs]),xWs=new Map([]);p();function rut(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 rut(this.windowLength,e)}_getCursorContextInfo(e){return mNe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return wWs(e,r)}};function wWs(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(wWs,"computeScore");p();var iut=class t extends ame{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 rut(this.windowLength,e)}_getCursorContextInfo(e){return mNe(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):mNe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return RWs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await EQ(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 RWs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(RWs,"computeScore");var kWs=0,PWs=60,DWs=4,NWs=1,MWs=20,OWs=1e4,dei={snippetLength:PWs,threshold:kWs,maxTopSnippets:DWs,maxCharPerFile:OWs,maxNumberOfFiles:MWs,maxSnippetsPerFile:NWs,useSubsetMatching:!1};var Yfr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function LWs(t,e){return(e.useSubsetMatching?iut.FACTORY(e.snippetLength):nut.FACTORY(e.snippetLength)).to(t)}a(LWs,"getMatcher");async function fei(t,e,r){let n=LWs(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(fei,"getSimilarSnippets");function pei(t,e){return{...Yfr,useSubsetMatching:Kfr(t,e)}}a(pei,"getCppSimilarFilesOptions");function hei(t){return Yfr.maxTopSnippets}a(hei,"getCppNumberOfSnippets");var BWs=new Map([["cpp",pei]]);function sut(t,e,r){let n=BWs.get(r);return n?n(t,e):{...dei,useSubsetMatching:Kfr(t,e)}}a(sut,"getSimilarFilesOptions");var FWs=new Map([["cpp",hei]]);function mei(t,e){let r=FWs.get(e);return r?r(t):Ddn}a(mei,"getNumberOfSnippets");function Kfr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ft(t,Ye.UseSubsetMatching))??!1}a(Kfr,"useSubsetMatching");p();p();p();p();var UWs="content_excluded";async function aut(t,e,r,n){let o=Vlt(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($r),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(mm).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,UWs]]),m}).map(f=>f.data)}a(aut,"getCodeSnippetsFromContextItems");function gei(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(gei,"addRelativePathToCodeSnippets");p();function vp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(vp,"Text");function OH(t){return t.children}a(OH,"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 $2(t){return{type:"f",children:t}}a($2,"fragmentFunction");$2.isFragmentFunction=!0;var cut=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=gei(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(vp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(zn(vp,{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=epr(c);return zn($2,{children:[zn(YX,{document:r,position:o,maxCharacters:m}),zn(dut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(ANe,"CurrentFile");function YX(t){if(t.document===void 0||t.position===void 0)return zn(vp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),zn(vp,{children:e})}a(YX,"BeforeCursor");function dut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return zn(vp,{});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(vp,{});if(r===s)return zn(vp,{children:r});let c=s;if(r!==""){let l=ws(t.tokenizer),u=l.takeFirstTokens(s,gNe);u.tokens.length>0&&100*uut(u.tokens,l.takeFirstTokens(r,gNe).tokens)?.score<(t.suffixMatchThreshold??X$e)*u.tokens.length&&(c=r)}return c!==r&&n(c),zn(vp,{children:c})}a(dut,"AfterCursor");function Aei(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=epr(c);return zn(YX,{document:r,position:o,maxCharacters:u})}a(Aei,"DocumentPrefix");function yei(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=epr(c);return zn(dut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(yei,"DocumentSuffix");p();var fut=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 Eei(t){return t.map(e=>e.elidedValue).join("")}a(Eei,"makePrompt");function _ei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(_ei,"makePrefixPrompt");function vei(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(vei,"makeContextPrompt");p();var cme=class{constructor(e,r=tpr()){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 tpr(){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===OH.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(tpr,"defaultTransformers");p();var rpr={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"]}},Cei={};for(let[t,e]of Object.entries(rpr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)Cei[r]=t;else Cei[t]=t;var QWs={start:"//",end:""},qWs=["php","plaintext"],npr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function bei(t){return Object.values(npr).includes(t.trim())}a(bei,"isShebangLine");function jWs({source:t}){return t.startsWith("#!")||t.startsWith("xWs(s,e)).join(` +`).map(s=>HWs(s,e)).join(` `);return r?o+` -`:o}a(i4,"commentBlockAsSingles");function lut(t){let{languageId:e}=t;return TWs.indexOf(e)===-1&&!IWs(t)?e in Xfr?Xfr[e]:`Language: ${e}`:""}a(lut,"getLanguageMarker");function uut(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(uut,"getPathMarker");function pNe(t){return t===""||t.endsWith(` +`:o}a(o4,"commentBlockAsSingles");function put(t){let{languageId:e}=t;return qWs.indexOf(e)===-1&&!jWs(t)?e in npr?npr[e]:`Language: ${e}`:""}a(put,"getLanguageMarker");function hut(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(hut,"getPathMarker");function yNe(t){return t===""||t.endsWith(` `)?t:t+` -`}a(pNe,"newLineEnded");var wWs=5,ame=class{constructor(){this.renderId=0;this.formatPrefix=dei}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 cut,{blocks:[y,...E]}=A.elide(u,h,d,m,ws(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(...RWs([...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-wWs: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 sme(e,epr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===fNe.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:hNe(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:mei(f.value)?y=A:y=i4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:hNe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${fNe.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}}},epr=[...Jfr(),(t,e,r)=>iut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===zX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===aut.name?{...r,type:"suffix"}:r];function RWs(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(RWs,"computeComponentStatistics");function hNe(t){return t.replace(/\r\n?/g,` -`)}a(hNe,"normalizeLineEndings");p();var dut=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($r),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?Kn(kWs,{docInfo:c}):Kn(PWs,{docInfo:c})}},"DocumentMarker"),kWs=a(t=>Kn(Ep,{children:uut(t.docInfo)}),"PathMarker"),PWs=a(t=>Kn(Ep,{children:lut(t.docInfo)}),"LanguageMarker");p();p();p();var PKs=de(cee()),DKs=de(h4()),sri=de(Ro()),NKs=de(Dut());var m4=class extends sri.Disposable{static{a(this,"RecentEditsProvider")}};function MKs(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(MKs,"editIsTooCloseToCursor");var odt=a((t,e)=>{let[r,n]=e.useState();return e.useData(Mb,async o=>{if(!o.document)return;let s=t.ctx.get(m4);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get($r),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(MKs(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(pNe(`File: ${T}`)+pNe(b))}}if(f.length===0){n(void 0);return}let h=pNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+pNe("End of recent edits");n(h)}),r?Kn(PH,{children:Kn(Ep,{children:r})}):void 0},"RecentEdits");p();p();p();var sdt=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>uee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&adt(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(CXn(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 ari(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(ari,"shortCircuit");p();function LKs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(LKs,"defaultHash");function nhr(t,e={}){let{hash:r=LKs,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(nhr,"memoize");var cri={entries:[],traits:[]},cdt={entries:new Map,traits:[]},ihr=class extends Cn{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=FKs?c=cdt:c=void 0);let l=performance.now()-s;if(v0.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 ldt;return c}a(uri,"getRelatedFiles");var ohr=nhr(uri,{cache:lri,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});ohr=ari(ohr,200,cdt);async function udt(t,e,r,n,o,s=!1){let c=t.get(dee),l=cdt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await uri(t,u,r,n,c):await ohr(t,u,r,n,c)}catch(u){l=cdt,u instanceof ldt&&Et(t,"getRelatedFilesList",r)}return v0.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(udt,"getRelatedFilesAndTraits");function adt(t,e){return JTe(t)===JTe(e)}a(adt,"considerNeighborFile");var uee=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($r);t.instance===void 0&&(t.instance=new sdt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(UKs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return v0.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 v0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await udt(e,f,o,s,c,l);return m.entries.size===0?(v0.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 UKs(t,e){return t.get(Zt).excludeRelatedFiles(e)||Ft(t,Ye.ExcludeRelatedFiles)}a(UKs,"isExcludeRelatedFilesActive");function dri(t,e){return t.get(Zt).includeNeighboringFiles(e)||Ft(t,Ye.IncludeNeighboringFiles)}a(dri,"isIncludeNeighborFilesActive");var ddt=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=uee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await uee.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=xme(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=>({...tei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||tut(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await iei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Kn(j2,{children:[...o.map((u,d)=>Kn(QKs,{snippet:u}))]})},"SimilarFiles"),QKs=a((t,e)=>Kn(PH,{children:[Kn(Ep,{children:t.snippet.headline}),Kn(Ep,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var fdt=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=JTe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Kn(j2,{children:[Kn(Ep,{children:`Consider this related information: -`}),...r.map(c=>Kn(Ep,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function fri(t,e){return Ft(t,Ye.UseSplitContextPrompt)??t.get(Zt).enablePromptContextProxyField(e)}a(fri,"shouldUseSplitContextPrompt");function pri(t){return Kn(j2,{children:[Kn(zfr,{children:[Kn(dut,{ctx:t,weight:.7}),Kn(fdt,{weight:.6}),Kn(nut,{ctx:t,weight:.9}),Kn(ddt,{ctx:t,weight:.8})]}),Kn(uei,{weight:1}),Kn(Yfr,{children:Kn(odt,{ctx:t,weight:.99})}),Kn(lei,{weight:1})]})}a(pri,"splitContextCompletionsPrompt");p();var hri=0;function qKs(){hri=0}a(qKs,"resetContextIndex");function jKs(){return hri++}a(jKs,"getNextContextIndex");var pdt=class extends ame{constructor(){super(...arguments);this.formatPrefix=fei;this.formatContext=pei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(qKs(),new sme(r,HKs).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===zX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:hNe(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:hNe(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 ${zX.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}}},HKs=[...epr,(t,e,r)=>iut(t)?{...r,index:jKs()}:r];p();function hdt(t,e,r){let n=jlt(r,"Trait");for(let s of n)GKs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(hdt,"getTraitsFromContextItems");function GKs(t,e,r,n){let o=t.get(pm).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(GKs,"setupExpectationsForTraits");var $Ks=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function mdt(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=$Ks.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return Et(e,t,l)}}a(mdt,"ReportTraitsTelemetry");p();p();p();var gdt=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}},Adt=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 ydt=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(VKs(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 ahr(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 shr([])),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)}},shr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},ahr=class{constructor(e){this.lifecycleData=e;this.stateHook=new gdt(e.state),this.dataHook=new Adt(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 VKs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(VKs,"isFragmentFunction");var NNe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new ydt(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 chr={default:{promptFunction:mri,renderer:ame},splitContext:{promptFunction:pri,renderer:pdt}};function mri(t){return Kn(j2,{children:[Kn(Wfr,{children:[Kn(dut,{ctx:t,weight:.7}),Kn(fdt,{weight:.6}),Kn(nut,{ctx:t,weight:.9}),Kn(ddt,{ctx:t,weight:.8}),Kn(odt,{ctx:t,weight:.99})]}),Kn(fNe,{weight:1})]})}a(mri,"defaultCompletionsPrompt");var Edt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new NNe(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}=xme(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 S8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return S8;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 S8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=FH(v.prefix),w={...v,prefix:b},R;if(ime(this.ctx,n)){let P=Hlt(v.metadata.componentStatistics);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(P),R=$lt(this.ctx,e,y),Nr.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(ime(this.ctx,n)){c=await this.ctx.get(Nb).resolution(e);let{textDocument:f}=r,h=c.filter(Vlt);zKs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=hdt(this.ctx,e,h),mdt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await rut(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 S8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Cdt;if((n>0?e.getText().length:e.offsetAt(r))<_dt)return vdt}createRequestData(e,r,n,o,s,c,l,u,d,f,h){return{document:e,position:r,telemetryData:n,cancellationToken:o,data:s.data,traits:l,codeSnippets:u,turnOffSimilarFiles:d,suffixMatchThreshold:f,maxPromptTokens:c,tokenizer:h}}resetIfEmpty(e){e.prefix.length===0&&e.suffix.length===0&&this.reset()}successPrompt(e,r,n,o,s){return{type:"prompt",prompt:{prefix:e.prefix,prefixTokens:e.prefixTokens,suffix:e.suffix,suffixTokens:e.suffixTokens,context:e.context,isFimEnabled:e.suffix.length>0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return qa(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),wme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new NNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(chr[this.promptOrdering]?.promptFunction??mri)(this.ctx)}getRenderer(){let e=chr[this.promptOrdering]??chr.default;return new e.renderer}};function zKs(t,e,r,n){let o=["cpp","c"];return dri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(zKs,"similarFilesEnabled");p();p();p();var Eri=2e4,gri=0,Ari=new Cn;function _ri(t,e,r,n){gri++;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=Ari?.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=ws(o);m=Nfn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),Ari.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:gri,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(_ri,"renderWithMetadata");function vri(t,e){return r=>{let n=r.text.join("")+` -`;return o0(e,n,()=>t.tokenLength(n)+1)}}a(vri,"cachedLineCostFunction");function Cri(t,e,r){let o=t.split(` -`).map(f=>({id:Ef(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:Ef(),text:s,children:o,canMerge:!0},u=EIe(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(Cri,"getLinewiseNode");var bdt=class{constructor(){this.name="basicPrefix";this.costCache=new Cn(Eri)}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=ws(n?.tokenizer),c=vri(s,this.costCache);return{root:Cri(o,c,!1)}}},yri={root:xQ,text:"",cost:0},Sdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Cn(5);this.costCache=new Cn(Eri)}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 yri;let l=this.cache.get(r.textDocument.uri)||yri;if(l.text===c)return l;let u=this.ctx.get(Zt).suffixMatchThreshold(n);if(l.text!==""){let g=new pQ,A=g.takeFirstTokens(c,dNe);if(A.tokens.length>0&&100*sut(A.tokens,g.takeFirstTokens(l.text,dNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Tdt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.traits.length===0)return{root:xQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=Ef(),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(yNe,"newLineEnded");var GWs=5,lme=class{constructor(){this.renderId=0;this.formatPrefix=Eei}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 fut,{blocks:[y,...E]}=A.elide(u,h,d,m,ws(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(...$Ws([...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-GWs: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 cme(e,ipr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===ANe.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:ENe(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:bei(f.value)?y=A:y=o4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:ENe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${ANe.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}}},ipr=[...tpr(),(t,e,r)=>lut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===YX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===dut.name?{...r,type:"suffix"}:r];function $Ws(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($Ws,"computeComponentStatistics");function ENe(t){return t.replace(/\r\n?/g,` +`)}a(ENe,"normalizeLineEndings");p();var mut=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($r),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(VWs,{docInfo:c}):zn(WWs,{docInfo:c})}},"DocumentMarker"),VWs=a(t=>zn(vp,{children:hut(t.docInfo)}),"PathMarker"),WWs=a(t=>zn(vp,{children:put(t.docInfo)}),"LanguageMarker");p();p();p();var WKs=de(lee()),zKs=de(m4()),hri=de(ko()),YKs=de(Lut());var g4=class extends hri.Disposable{static{a(this,"RecentEditsProvider")}};function KKs(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(KKs,"editIsTooCloseToCursor");var ldt=a((t,e)=>{let[r,n]=e.useState();return e.useData(Mb,async o=>{if(!o.document)return;let s=t.ctx.get(g4);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get($r),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(KKs(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(yNe(`File: ${T}`)+yNe(b))}}if(f.length===0){n(void 0);return}let h=yNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+yNe("End of recent edits");n(h)}),r?zn(OH,{children:zn(vp,{children:r})}):void 0},"RecentEdits");p();p();p();var udt=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>dee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&ddt(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(kXn(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 mri(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(mri,"shortCircuit");p();function ZKs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(ZKs,"defaultHash");function ahr(t,e={}){let{hash:r=ZKs,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(ahr,"memoize");var gri={entries:[],traits:[]},fdt={entries:new Map,traits:[]},chr=class extends Cn{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=eJs?c=fdt:c=void 0);let l=performance.now()-s;if(C0.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 pdt;return c}a(yri,"getRelatedFiles");var lhr=ahr(yri,{cache:Ari,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});lhr=mri(lhr,200,fdt);async function hdt(t,e,r,n,o,s=!1){let c=t.get(fee),l=fdt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await yri(t,u,r,n,c):await lhr(t,u,r,n,c)}catch(u){l=fdt,u instanceof pdt&&At(t,"getRelatedFilesList",r)}return C0.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(hdt,"getRelatedFilesAndTraits");function ddt(t,e){return eIe(t)===eIe(e)}a(ddt,"considerNeighborFile");var dee=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($r);t.instance===void 0&&(t.instance=new udt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(tJs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return C0.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 C0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await hdt(e,f,o,s,c,l);return m.entries.size===0?(C0.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 tJs(t,e){return t.get(Zt).excludeRelatedFiles(e)||Ft(t,Ye.ExcludeRelatedFiles)}a(tJs,"isExcludeRelatedFilesActive");function Eri(t,e){return t.get(Zt).includeNeighboringFiles(e)||Ft(t,Ye.IncludeNeighboringFiles)}a(Eri,"isIncludeNeighborFilesActive");var mdt=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=dee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await dee.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=Rme(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=>({...lei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||sut(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await fei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),zn($2,{children:[...o.map((u,d)=>zn(rJs,{snippet:u}))]})},"SimilarFiles"),rJs=a((t,e)=>zn(OH,{children:[zn(vp,{children:t.snippet.headline}),zn(vp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var gdt=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=eIe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return zn($2,{children:[zn(vp,{children:`Consider this related information: +`}),...r.map(c=>zn(vp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function _ri(t,e){return Ft(t,Ye.UseSplitContextPrompt)??t.get(Zt).enablePromptContextProxyField(e)}a(_ri,"shouldUseSplitContextPrompt");function vri(t){return zn($2,{children:[zn(Zfr,{children:[zn(mut,{ctx:t,weight:.7}),zn(gdt,{weight:.6}),zn(cut,{ctx:t,weight:.9}),zn(mdt,{ctx:t,weight:.8})]}),zn(yei,{weight:1}),zn(Xfr,{children:zn(ldt,{ctx:t,weight:.99})}),zn(Aei,{weight:1})]})}a(vri,"splitContextCompletionsPrompt");p();var Cri=0;function nJs(){Cri=0}a(nJs,"resetContextIndex");function iJs(){return Cri++}a(iJs,"getNextContextIndex");var Adt=class extends lme{constructor(){super(...arguments);this.formatPrefix=_ei;this.formatContext=vei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(nJs(),new cme(r,oJs).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===YX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:ENe(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:ENe(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 ${YX.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}}},oJs=[...ipr,(t,e,r)=>lut(t)?{...r,index:iJs()}:r];p();function ydt(t,e,r){let n=Vlt(r,"Trait");for(let s of n)sJs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(ydt,"getTraitsFromContextItems");function sJs(t,e,r,n){let o=t.get(mm).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(sJs,"setupExpectationsForTraits");var aJs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Edt(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=aJs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return At(e,t,l)}}a(Edt,"ReportTraitsTelemetry");p();p();p();var _dt=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}},vdt=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 Cdt=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(cJs(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 dhr(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 uhr([])),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)}},uhr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},dhr=class{constructor(e){this.lifecycleData=e;this.stateHook=new _dt(e.state),this.dataHook=new vdt(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 cJs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(cJs,"isFragmentFunction");var FNe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Cdt(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 fhr={default:{promptFunction:bri,renderer:lme},splitContext:{promptFunction:vri,renderer:Adt}};function bri(t){return zn($2,{children:[zn(Jfr,{children:[zn(mut,{ctx:t,weight:.7}),zn(gdt,{weight:.6}),zn(cut,{ctx:t,weight:.9}),zn(mdt,{ctx:t,weight:.8}),zn(ldt,{ctx:t,weight:.99})]}),zn(ANe,{weight:1})]})}a(bri,"defaultCompletionsPrompt");var bdt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new FNe(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}=Rme(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 I8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return I8;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 I8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=jH(v.prefix),w={...v,prefix:b},R;if(sme(this.ctx,n)){let P=Wlt(v.metadata.componentStatistics);this.ctx.get(mm).getStatisticsForCompletion(e).computeMatch(P),R=Ylt(this.ctx,e,y),Nr.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(sme(this.ctx,n)){c=await this.ctx.get(Nb).resolution(e);let{textDocument:f}=r,h=c.filter(Klt);uJs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=ydt(this.ctx,e,h),Edt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await aut(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 I8;if((await this.ctx.get(ic).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Idt;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 ua(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),kme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new FNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(fhr[this.promptOrdering]?.promptFunction??bri)(this.ctx)}getRenderer(){let e=fhr[this.promptOrdering]??fhr.default;return new e.renderer}};function uJs(t,e,r,n){let o=["cpp","c"];return Eri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(uJs,"similarFilesEnabled");p();p();p();var xri=2e4,Sri=0,Tri=new Cn;function wri(t,e,r,n){Sri++;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=Tri?.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=ws(o);m=Ffn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),Tri.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:Sri,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(wri,"renderWithMetadata");function Rri(t,e){return r=>{let n=r.text.join("")+` +`;return a0(e,n,()=>t.tokenLength(n)+1)}}a(Rri,"cachedLineCostFunction");function kri(t,e,r){let o=t.split(` +`).map(f=>({id:vf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` +`),"");let c={id:vf(),text:s,children:o,canMerge:!0},u=CIe(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(kri,"getLinewiseNode");var xdt=class{constructor(){this.name="basicPrefix";this.costCache=new Cn(xri)}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=ws(n?.tokenizer),c=Rri(s,this.costCache);return{root:kri(o,c,!1)}}},Iri={root:RQ,text:"",cost:0},wdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Cn(5);this.costCache=new Cn(xri)}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 Iri;let l=this.cache.get(r.textDocument.uri)||Iri;if(l.text===c)return l;let u=this.ctx.get(Zt).suffixMatchThreshold(n);if(l.text!==""){let g=new mQ,A=g.takeFirstTokens(c,gNe);if(A.tokens.length>0&&100*uut(A.tokens,g.takeFirstTokens(l.text,gNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Rdt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.traits.length===0)return{root:RQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=vf(),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:Ef(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return yIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},Idt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:xQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;o0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get($r);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:vf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return vIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},kdt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:RQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;a0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get($r);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=Ef();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:Ef(),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:Ef(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return yIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},xdt=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!==xQ.id);if(o.length===0)return{root:xQ};let s=["",...Array(o.length-1).fill(` -`),""],c={id:Ef(),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 YKs=.8,wdt=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(Zt).suffixPercent(e),n=this.ctx.get(Zt).stableContextPercent(e),o=this.ctx.get(Zt).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;ime(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}=xme(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>YKs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=_ri(this.components[N],L,e,d);b=L-B.cost,h[N]=B,KKs(m,B.metadata)}let[T,w]=FH(h.prefix.text),R=performance.now(),x=ime(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:i4(P.join(` +`)],v=[];for(let b of A){let T=vf();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:vf(),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:vf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return vIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Pdt=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!==RQ.id);if(o.length===0)return{root:RQ};let s=["",...Array(o.length-1).fill(` +`),""],c={id:vf(),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 dJs=.8,Ddt=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(Zt).suffixPercent(e),n=this.ctx.get(Zt).stableContextPercent(e),o=this.ctx.get(Zt).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;sme(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}=Rme(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>dJs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=wri(this.components[N],L,e,d);b=L-B.cost,h[N]=B,fJs(m,B.metadata)}let[T,w]=jH(h.prefix.text),R=performance.now(),x=sme(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:o4(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?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(Nb).resolution(e),{textDocument:c}=r,l=s.filter(Vlt),u=hdt(this.ctx,e,l);mdt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await rut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Hlt(r);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(o);let s=$lt(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return S8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Cdt;if(e.getText().length<_dt)return vdt}errorPrompt(e){return qa(this.ctx,e,"WorkspaceContextPromptFactory"),wme}};function KKs(t,e){t.elisionTimeMs+=e.elisionTimeMs,t.renderTimeMs+=e.renderTimeMs,t.updateDataTimeMs+=e.updateDataTimeMs,t.componentStatistics.push(...e.componentStatistics)}a(KKs,"aggregateMetadata");p();p();var bri=de(require("events"));var JKs={UpdateInterval:1e3,InvalidCacheTime:1e3*60*10,StaleWeightHalflife:1e3*10,MinNodeSize:100,Laziness:.5,MaxActiveFiles:8,MaxActiveNodes:2e3},ZKs=5,z2=class t{constructor(e){this.ctx=e;this.didDispose=!1;this.deferredStart=new vA;this.config=JKs;this.emitter=new bri.default;this.client=void 0;this.nextRequest={};this.lastEvent=void 0;this.emitter.setMaxListeners(27)}static{a(this,"WorkspaceContextFeature")}static{this.UpdateEventName="WorkspaceContextUpdate"}static{this.DisposeEventName="WorkspaceContextDispose"}get didStart(){return this.client!==void 0}async maybeStart(e,r){if(this.didStart||this.didDispose)return;let n=Ft(this.ctx,Ye.UseWorkspaceContextCoordinator);if(n===void 0&&r){let o=await this.ctx.get(Zt).updateExPValuesAndAssignments(r);n=this.isEnabled(o)}n&&this.start(e)}isActive(){return this.didStart&&!this.didDispose&&this.client!==void 0&&this.client.isActive()}get activation(){return this.deferredStart.promise}isEnabled(e){return Ft(this.ctx,Ye.UseWorkspaceContextCoordinator)??this.ctx.get(Zt).workspaceContextCoordinator(e)}start(e){!this.didStart&&!this.didDispose&&(this.client=e,this.fileChangeDisposable=this.ctx.get($r).onDidChangeTextDocument(r=>{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),Fn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),Fn.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(LY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=ZKs){this.dispose();break}}await bC(this.config.UpdateInterval)}}};function Sri(t,e){let r=z0(t,e,"event.WorkspaceContextUpdate");return t.get(z2).onUpdate(r)}a(Sri,"onWorkspaceContextUpdate");p();var Rdt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=xQ;this.disposables=[];this.rootWithPathCache=new Cn;this.disposables.push(Sri(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(Zt).workspaceContextCacheTime(n):performance.now();let o=o0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:Ef(),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($r),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?i4(uut(s),s.languageId):i4(lut(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:Ef(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=nO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:Ef(),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(Nb).resolution(e),{textDocument:c}=r,l=s.filter(Klt),u=ydt(this.ctx,e,l);Edt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await aut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Wlt(r);this.ctx.get(mm).getStatisticsForCompletion(e).computeMatch(o);let s=Ylt(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return I8;if((await this.ctx.get(ic).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Idt;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),Fn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),Fn.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(QY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=hJs){this.dispose();break}}await SC(this.config.UpdateInterval)}}};function Dri(t,e){let r=Y0(t,e,"event.WorkspaceContextUpdate");return t.get(J2).onUpdate(r)}a(Dri,"onWorkspaceContextUpdate");p();var Ndt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=RQ;this.disposables=[];this.rootWithPathCache=new Cn;this.disposables.push(Dri(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(Zt).workspaceContextCacheTime(n):performance.now();let o=a0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:vf(),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($r),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?o4(hut(s),s.languageId):o4(put(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:vf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=sO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:vf(),text:[o,` -`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get($r).getRelativePath({uri:e});return i4(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var kdt=class extends wdt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Rdt(e),prefix:new bdt,suffix:new Sdt(e),volatileContext:new xdt("volatileContext",[new Tdt,new Idt(e)])};super(e,r)}};var Tri=de(ri());var T8=class{static{a(this,"CompletionsPromptFactory")}};function Pdt(t,e,r){return new lhr(new uhr(new dhr(t,new Edt(t,e,r),new kdt(t),eJs)))}a(Pdt,"createCompletionsPromptFactory");var lhr=class extends T8{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 S8;try{return await this.delegate.prompt(r,n)}catch{return wme}}},XKs=1200,uhr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Tri.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Iri)},XKs)})])}},dhr=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 eJs(t,e){let r=t.get(z2);return r.isEnabled(e)&&r.isActive()}a(eJs,"workspaceContextEnabledAndActive");var _dt=10,vdt={type:"contextTooShort"},Cdt={type:"copilotContentExclusion"},wme={type:"promptError"},S8={type:"promptCancelled"},Iri={type:"promptTimeout"};function FH(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(FH,"trimLastLine");function Rme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=rJs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=fri(t,n);return t.get(T8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Rme,"extractPrompt");function tJs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:i4(n,e)}a(tJs,"addNeighboringCellsToPrompt");function rJs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>tJs(l,r.document.detectedLanguageId)).join(` +`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get($r).getRelativePath({uri:e});return o4(`Related portions of ${o??e}: +`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Mdt=class extends Ddt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Ndt(e),prefix:new xdt,suffix:new wdt(e),volatileContext:new Pdt("volatileContext",[new Rdt,new kdt(e)])};super(e,r)}};var Nri=de(ei());var x8=class{static{a(this,"CompletionsPromptFactory")}};function Odt(t,e,r){return new phr(new hhr(new mhr(t,new bdt(t,e,r),new Mdt(t),gJs)))}a(Odt,"createCompletionsPromptFactory");var phr=class extends x8{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 I8;try{return await this.delegate.prompt(r,n)}catch{return kme}}},mJs=1200,hhr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Nri.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Mri)},mJs)})])}},mhr=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 gJs(t,e){let r=t.get(J2);return r.isEnabled(e)&&r.isActive()}a(gJs,"workspaceContextEnabledAndActive");var Sdt=10,Tdt={type:"contextTooShort"},Idt={type:"copilotContentExclusion"},kme={type:"promptError"},I8={type:"promptCancelled"},Mri={type:"promptTimeout"};function jH(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(jH,"trimLastLine");function Pme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=yJs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=_ri(t,n);return t.get(x8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Pme,"extractPrompt");function AJs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:o4(n,e)}a(AJs,"addNeighboringCellsToPrompt");function yJs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>AJs(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(rJs,"applyEditsForNotebook");function xme(t,e,r){let o=t.get(Zt).maxPromptCompletionTokens(e)-lYe(t),s=aei(e,r),c=tut(t,e,r),l=t.get(Zt).suffixPercent(e),u=t.get(Zt).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(xme,"getPromptOptions");p();p();var xri=2.98410452738298,wri=-.838732736843507,Rri=1.50314646255716,kri=-.237798634012662,Ddt={python:.314368072478742},Pri={"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 nJs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function iJs(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)}},fhr=class{constructor(e,r,n){this.link=nJs;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 iJs(n,this.logitsToQuantiles)}},Dri=new fhr(xri,[new kme("compCharLen",wri,t=>Math.log(1+t)),new kme("meanLogProb",Rri),new kme("meanAlternativeLogProb",kri)].concat(Object.entries(Ddt).map(t=>new kme(t[0],t[1]))),Pri);function Nri(t,e){let r={...e.measurements};return Object.keys(Ddt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Dri.predict(t,r)}a(Nri,"ghostTextScoreConfidence");function Mri(t,e){let r={...e.measurements};return Object.keys(Ddt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Dri.quantile(t,r)}a(Mri,"ghostTextScoreQuantile");p();function oJs(t,e,r,n){let o="}";try{o=Pdn(e.detectedLanguageId)??"}"}catch{}return sJs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(oJs,"maybeSnipCompletion");function sJs(t,e,r,n){let o=aJs(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(sJs,"maybeSnipCompletionImpl");function aJs(t){let e=t.includes(`\r +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(yJs,"applyEditsForNotebook");function Rme(t,e,r){let o=t.get(Zt).maxPromptCompletionTokens(e)-mYe(t),s=mei(e,r),c=sut(t,e,r),l=t.get(Zt).suffixPercent(e),u=t.get(Zt).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(Rme,"getPromptOptions");p();p();var Ori=2.98410452738298,Lri=-.838732736843507,Bri=1.50314646255716,Fri=-.237798634012662,Ldt={python:.314368072478742},Uri={"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 EJs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function _Js(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)}},ghr=class{constructor(e,r,n){this.link=EJs;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 _Js(n,this.logitsToQuantiles)}},Qri=new ghr(Ori,[new Dme("compCharLen",Lri,t=>Math.log(1+t)),new Dme("meanLogProb",Bri),new Dme("meanAlternativeLogProb",Fri)].concat(Object.entries(Ldt).map(t=>new Dme(t[0],t[1]))),Uri);function qri(t,e){let r={...e.measurements};return Object.keys(Ldt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Qri.predict(t,r)}a(qri,"ghostTextScoreConfidence");function jri(t,e){let r={...e.measurements};return Object.keys(Ldt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Qri.quantile(t,r)}a(jri,"ghostTextScoreQuantile");p();function vJs(t,e,r,n){let o="}";try{o=Ldn(e.detectedLanguageId)??"}"}catch{}return CJs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(vJs,"maybeSnipCompletion");function CJs(t,e,r,n){let o=bJs(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(CJs,"maybeSnipCompletionImpl");function bJs(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(aJs,"splitByNewLine");function cJs(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(Ori,"checkSuffix");var Uri=de(dU());Mo();var ul=new fe("ghostText");var Lri=20;async function Qri(t,e,r,n,o,s,c){ul.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Yle(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Ldn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Ft(t,Ye.ModelAlwaysTerminatesSingleline)??t.get(Zt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&tO.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(AO).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:yp(r,t)}:E.type==="canceled"?(ul.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:kH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Gm(y))return{type:"canceled",reason:"network request aborted",telemetryData:kH(r,{cancelledNetworkRequest:!0})};if(ul.exception(t,y,"Error on ghost text request"),t.get(CC).notifyUser(t,y),RCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:yp(r,t)}}}a(Qri,"genericGetCompletionsFromNetwork");function phr(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(phr,"postProcessChoices");async function uJs(t,e,r,n,o){return Qri(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return ul.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:yp(r,t)};if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:kH(r)};let f=d.value;if(f===void 0)return ul.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:yp(r,t)};jri(t,"performance",f,s,c),ul.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=phr(f,e);h&&(Ndt(t,e,h),ul.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;ul.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=phr(A,e,g);y&&(g.push(y),Ndt(t,e,y))}})();return O1(t)&&await m,h?{type:"success",value:[hhr(h,{forceSingleLine:!1}),m],telemetryData:yp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:yp(r,t)}})}a(uJs,"getCompletionsFromNetwork");async function dJs(t,e,r,n,o){return Qri(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:kH(r)};let f=phr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Ndt(t,e,d);jri(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:yp(r,t),telemetryBlob:r,resultType:3}})}a(dJs,"getAllCompletionsFromNetwork");function hhr(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(bJs,"splitByNewLine");function SJs(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(Hri,"checkSuffix");var Wri=de(pU());Oo();var dl=new fe("ghostText");var Gri=20;async function zri(t,e,r,n,o,s,c){dl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Kle(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:qdn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Ft(t,Ye.ModelAlwaysTerminatesSingleline)??t.get(Zt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&iO.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(EO).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:_p(r,t)}:E.type==="canceled"?(dl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:MH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Vm(y))return{type:"canceled",reason:"network request aborted",telemetryData:MH(r,{cancelledNetworkRequest:!0})};if(dl.exception(t,y,"Error on ghost text request"),t.get(bC).notifyUser(t,y),DCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:_p(r,t)}}}a(zri,"genericGetCompletionsFromNetwork");function Ahr(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(Ahr,"postProcessChoices");async function IJs(t,e,r,n,o){return zri(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return dl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:_p(r,t)};if(n?.isCancellationRequested)return dl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:MH(r)};let f=d.value;if(f===void 0)return dl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:_p(r,t)};Kri(t,"performance",f,s,c),dl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=Ahr(f,e);h&&(Bdt(t,e,h),dl.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;dl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=Ahr(A,e,g);y&&(g.push(y),Bdt(t,e,y))}})();return O1(t)&&await m,h?{type:"success",value:[yhr(h,{forceSingleLine:!1}),m],telemetryData:_p(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:_p(r,t)}})}a(IJs,"getCompletionsFromNetwork");async function xJs(t,e,r,n,o){return zri(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return dl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:MH(r)};let f=Ahr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Bdt(t,e,d);Kri(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:_p(r,t),telemetryBlob:r,resultType:3}})}a(xJs,"getAllCompletionsFromNetwork");function yhr(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(hhr,"makeGhostAPIChoice");function Bri(t){return e=>{let r=e?.split(` +`)[0]}return r}a(yhr,"makeGhostAPIChoice");function $ri(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(Bri,"takeNLines");async function fJs(t,e,r,n,o,s,c,l){let u=t.get(Zt).multilineAfterAcceptLines(l),d=t.get(TP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:Bri(u),stop:[` +`).length}}a($ri,"takeNLines");async function wJs(t,e,r,n,o,s,c,l){let u=t.get(Zt).multilineAfterAcceptLines(l),d=t.get(xP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:$ri(u),stop:[` -`],maxTokens:Lri*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await vJs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Zt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=gu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...Fri(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:Bri(u),stop:[` +`],maxTokens:Gri*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await BJs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Zt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=gu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...Vri(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:$ri(u),stop:[` -`],maxTokens:Lri*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...Fri(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(fJs,"getGhostTextStrategy");function Fri(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&tO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Zt).longLookaheadSize(u):t.get(Zt).shortLookaheadSize(u);return{finishedCb:new Flt(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Ndt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Zt).maxMultilineTokens(u)}}return{finishedCb:c?lNe(t,r,n):d=>{}}}a(Fri,"buildFinishedCallback");var pJs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function hJs(t,e,r){let n=Ft(t,Ye.CompletionsDebounce)??t.get(Zt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=yl()-r.issuedTime;return Math.max(0,n-o)}a(hJs,"getRemainingDebounceMs");function ONe(t,e,r){return r?.isCancellationRequested||e!==t.get(Db).currentRequestId}a(ONe,"inlineCompletionRequestCancelled");async function mJs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=yl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Zt);if(ONe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:yp(n,t)};let f=AJs(e.textDocument,e.position);if(f===void 0)return ul.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:yp(n,t)};let h=mQ(t,n),m={...pJs,...s,tokenizer:h.tokenizer},g=await Rme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return ul.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:yp(n,t)};if(g.type==="contextTooShort")return ul.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:yp(n,t)};if(g.type==="promptError")return ul.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:yp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return ul.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:yp(n,t)};if(g.type==="promptTimeout")return ul.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:yp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return ul.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:yp(n,t)};let A=hJs(t,m,n);return A>0&&(ul.debug(t,`Debouncing ghost text request for ${A}ms`),await bC(A),ONe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:yp(n,t)}:t.get(ps).trackCompletionJob(async()=>{let[E]=FH(e.textDocument.getText(gu.range(gu.position(0,0),e.position))),_=t.get(Db).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await fJs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=gJs(t,E,v,b.requestMultiline);u("cache");let w=gQ(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:Jlt(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=IJs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Pb).shouldWaitForAsyncCompletions(E,g.prompt)){let j=await t.get(Pb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),j){let Q=!b.requestMultiline;T=[[hhr(j[0],{forceSingleLine:Q})],4]}if(ONe(t,r,o))return ul.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:yp(x,t)}}let P=b.blockMode==="moremultiline"&&tO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(j=>MNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0)),T!==void 0&&T[0].length===0)return ul.debug(t,`Found empty inline suggestions locally via ${rme(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:yp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))ul.debug(t,`Found inline suggestions locally via ${rme(T[1])}`);else{if(m.isCycling){let j=await dJs(t,R,x,o,b.finishedCb);if(j.type==="success"){let Q=T?.[0]??[];j.value[0].forEach(U=>{Q.findIndex(Y=>Y.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return j}else{let j=a((W,V)=>(t.get(Pb).updateCompletion(r,W),b.finishedCb(W,V)),"finishedCb"),Q=new Fn.CancellationTokenSource,U=uJs(t,R,x,Q.token,j);t.get(Pb).queueCompletionRequest(r,E,g.prompt,Q,U);let Y=await t.get(Pb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:yp(x,t)};T=[[Y[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:yp(x,t)};let[D,N]=T,L=D.map(j=>MNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0),B=Ft(t,Ye.CompletionsDelay)??d.completionsDelay(n),q=yl()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(ul.debug(t,`Waiting ${M}ms before returning completion`),await bC(M),ONe(t,r,o)))return ul.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:kH(x)};let O=[];for(let j of L){let Q=TJs(t,e.textDocument,R,j,x),U=f?Ori(e.textDocument,e.position,j):0,W={completion:CJs(j.choiceIndex,j.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:j.copilotAnnotations,clientCompletionId:j.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,ul.debug(t,`Produced ${O.length} results from ${rme(N)} at ${x.measurements.foundOffset} offset`),ONe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:kH(x)}:(m.isSpeculative||t.get(Db).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:yp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(mJs,"getGhostTextWithoutAbortHandling");async function mhr(t,e,r,n){let o=Mt();t.get(Db).currentRequestId=o;let s=await SJs(t,e.textDocument,o,n);await hQ().catch(()=>{});try{return t.get(Nb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(t4).notifyRequest(e,o,s,r,n),await mJs(t,e,o,s,r,n)}catch(c){if(Gm(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:kH(s,{cancelledNetworkRequest:!0})};throw c}}a(mhr,"getGhostText");function gJs(t,e,r,n){let o=t.get(Db).getCompletionsForUserTyping(e,r.suffix),s=bJs(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(gJs,"getLocalInlineSuggestion");function AJs(t,e){let r=yJs(e,t),n=EJs(e,t);return r&&!n?void 0:r&&n}a(AJs,"isInlineSuggestion");function yJs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(yJs,"isMiddleOfTheLine");function EJs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(EJs,"isValidMiddleOfTheLinePosition");function _Js(t,e){return e.lineAt(t).text.trim().length===0}a(_Js,"isNewLine");var I8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function vJs(t,e,r,n,o,s,c){if(t.get(I8).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)Et(t,"ghostText.longFileMultilineSkip",Wt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&tO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Ndn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&_Js(n,r))return{requestMultiline:!0};let u=!1;return!o&&kS(r.detectedLanguageId)?u=await Klt(r,n):o&&kS(r.detectedLanguageId)&&(u=await Klt(r,n)||await Klt(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=RXn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(vJs,"shouldRequestMultiline");function Ndt(t,e,r){t.get(q2).append(e.prefix,e.prompt.suffix,r)}a(Ndt,"appendToCache");function CJs(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(CJs,"adjustLeadingWhitespace");function bJs(t,e,r,n){let o=t.get(q2).findAll(e,r);return o.length===0?(ul.debug(t,"Found no completions in cache"),[]):(ul.debug(t,`Found ${o.length} completions in cache`),o.map(s=>hhr(s,{forceSingleLine:!n})))}a(bJs,"getCompletionsFromCache");async function SJs(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=Wt.createAndMarkAsIssued(o);return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(SJs,"createTelemetryWithExp");function TJs(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,qri(u,e),u.extendWithRequestId(s),u.measurements.confidence=Nri(t,u),u.measurements.quantile=Mri(t,u),ul.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(TJs,"telemetryWithAddData");function IJs(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);qri(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(gu.range(h.range.start,n)),g=e.getText(gu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Uri.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...Ese(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 Et(t,"ghostText.issued",_),d}a(IJs,"telemetryIssued");function qri(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(qri,"addDocumentTelemetry");function jri(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),Et(t,`ghostText.${e}`,l)}a(jri,"telemetryPerformance");p();p();var fee=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get($r);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 jT=class{static{a(this,"CitationManager")}},Mdt=class extends jT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var ghr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??Fn.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=Ldt.indexOf(_);v!==-1&&Ldt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Ldt)_()}a(e,"afterUpdateConnection");function r(_){Y2.connection!==_&&(Y2.connection=_,e())}a(r,"updateConnection");function n(){return Y2.connection==="connected"}a(n,"isConnected");function o(){return Y2.connection==="disconnected"}a(o,"isDisconnected");function s(){return Y2.connection==="retry"}a(s,"isRetrying");function c(){return Y2.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(_){Y2.initialWait!==_&&(Y2.initialWait=_)}a(h,"setInitialWait");function m(_,v=xJs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return Y2.initialWait}a(g,"isInitialWait");async function A(_,v){Ob.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(tr);function T(w,R){if(w>Gri){Ob.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{Y2.retryAttempts=Math.min(Y2.retryAttempts+1,$ri);try{Ob.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{Ob.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Ob.info(_,"Attempting to reconnect."),T(Ahr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Odt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Odt}a(wJs,"registerConnectionState");var hee=wJs();p();var qg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},LNe={[qg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[qg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[qg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function yhr(t){return t===401?qg.Unauthorized:t===400?qg.BadArguments:t===404?qg.NotFound:t===429?qg.RateLimit:t>=500&&t<600?qg.InternalError:t>=600?qg.ConnectionError:qg.Unknown}a(yhr,"getErrorType");function g4(t,e,r={}){return{kind:"failure",reason:yhr(Number(t)),code:Number(t),msg:e,meta:r}}a(g4,"createErrorResponse");p();var RJs=/^[1-6][0-9][0-9]$/,kJs=/([A-Z][a-z]+)/,PJs="code_referencing",BNe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[PJs,this.baseKey,...e].join(".")}},Ehr=class extends BNe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Wt.createAndMarkAsIssued();Et(e,r,n)}handleFocus({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("focus","count");Et(e,n,r)}handleWrite({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("write","count");Et(e,n,r)}},v$f=new Ehr,_hr=class extends BNe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");Et(e,o,n)}handleDismiss({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");Et(e,o,n)}},C$f=new _hr,vhr=class extends BNe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(RJs)){Ob.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(kJs).filter(l=>!!l).join("_").toLowerCase(),c=Wt.createAndMarkAsIssued({message:o});eg(e,this.buildKey(s,r),c)}},Bdt=new vhr;var DJs="twirp/github.snippy.v1.SnippyAPI";async function Chr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return hee.setDisconnected(),g4(401,LNe[qg.Unauthorized])}if(Ob.info(t,`Calling ${e}`),hee.isRetrying())return g4(600,"Attempting to reconnect to the public code matching service.");if(hee.isDisconnected())return g4(601,"The public code matching service is offline.");let s;try{s=await t.get(tr).fetch(tx(t,o,"origin-tracker",`${DJs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...Gy(t)},signal:n})}catch{return hee.enableRetry(t),g4(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 Bdt.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=yhr(h),g=d||"unknown error";switch(m){case qg.Unauthorized:return g4(u,LNe[qg.Unauthorized],f);case qg.BadArguments:return g4(u,g,f);case qg.RateLimit:return hee.enableRetry(t,60*1e3),g4(u,LNe.RateLimitError,f);case qg.InternalError:return hee.enableRetry(t),g4(u,LNe[qg.InternalError],f);default:return g4(u,g,f)}}a(Chr,"call");p();var Fdt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),MJs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),Vri=S.Object({source:S.String()}),OJs=S.Object({snippets:S.Array(MJs)}),Wri=S.Union([OJs,Fdt]),zri=S.Object({cursor:S.String()}),LJs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),BJs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),FJs=S.Object({count:S.Record(S.String(),S.String())}),UJs=S.Object({file_matches:S.Array(LJs),page_info:BJs,license_stats:FJs}),Yri=S.Union([UJs,Fdt]);async function Kri(t,e,r){let n=await Chr(t,"Match",{method:"POST",body:mK(Vri,{source:e})},r);return mK(Wri,n)}a(Kri,"Match");async function Jri(t,{cursor:e},r){let n=await Chr(t,"FilesForMatch",{method:"POST",body:mK(zri,{cursor:e})},r);return mK(Yri,n)}a(Jri,"FilesForMatch");p();var FNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Udt=65;function jJs(t){let e=0,r;FNe.lastIndex=0;do if(r=FNe.exec(t),r&&(e+=1),e>=Udt)break;while(r);return e}a(jJs,"lexemeLength");function HJs(t,e){let r=0,n;FNe.lastIndex=0;do if(n=FNe.exec(t),n&&(r+=1,r>=e))return FNe.lastIndex;while(n);return t.length}a(HJs,"offsetFirstLexemes");function Zri(t,e){let r=t.split("").reverse().join(""),n=HJs(r,e);return r.length-n}a(Zri,"offsetLastLexemes");function UNe(t){return jJs(t)>=Udt}a(UNe,"hasMinLexemeLength");function $Js(t){return XM.Check(Fdt,t)}a($Js,"isError");async function Xri(t,e){let r=await e();if($Js(r)){Bdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(Xri,"snippyRequest");function eni(t){return"kind"in t&&t.kind==="failure"}a(eni,"isMatchError");async function tni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Ob.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!UNe(c)||!UNe(c))return;let l=r;if(!UNe(r)){let g=c.slice(0,n),A=Zri(g,Udt);l=c.slice(A,n+r.length)}if(!UNe(l))return;let u=await Xri(t,()=>Kri(t,l));if(!u||eni(u)||!u.snippets.length){Ob.info(t,"No match found");return}Ob.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await Xri(t,()=>Jri(t,{cursor:g.cursor}));if(!A||eni(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(jT).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(tni,"fetchCitations");p();function bhr(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(zJs,"lexGeneratorWords");function rni(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(rni,"lexicalAnalyzer");function nni(t){return t!==" "}a(nni,"notSingleSpace");function ini(t,e,r=zJs){let[n,o]=rni(t,VJs(),r,nni),[s,c]=rni(e,o,r,nni);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=WJs(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=bhr(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(ini,"lexEditDistance");p();function UH(t){return t.length===0?0:t.split(` -`).length}a(UH,"countLines");function oni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(oni,"computeCompletionText");var QH=new fe("postInsertion"),sni=[{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}],ani=50,YJs=1500,KJs=.5,JJs=500,Shr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function cni(t,e,r,n,o){let s=await t.get(ii).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return QH.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 Rme(t,r.properties.headerRequestId,pee(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=jfr(u,n,c.detectedLanguageId),y=eei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:JJs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(cni,"captureCode");function Qdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{QH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),PXn(t,e,d)});let s=new fee(t,n,r-1),c=new fee(t,n,r),l=a(async u=>{QH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await cni(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});QH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),Et(t,e+".capturedAfterRejected",A,1)},"checkInCode");sni.filter(u=>u.captureRejection).map(u=>s.push(z0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Qdt,"postRejectionTasks");function QNe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});QH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),kXn(t,e,u);let d=r;r=oni(r,c);let f=r.trim(),h=new fee(t,o,n),m=new fee(t,o,n+r.length),g=a(async A=>{await tZs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Shr.triggerPostInsertionSynchroneously&&O1(t)){let A=g({seconds:0,captureCode:Shr.captureCode,captureRejection:Shr.captureRejection});t.get(xd).register(A)}else sni.map(A=>h.push(z0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));z0(t,ZJs,"post insertion citation check")(t,o,d,r,n,l)}a(QNe,"postInsertionTasks");async function ZJs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(rx(t)?.getTokenValue("sn")==="1")return;await tni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Thr(c.getText(),n,ani,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=XJs(r.length,n.length,l.start_offset);if(u===void 0){QH.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+eZs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(jT).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(ZJs,"citationCheck");function XJs(t,e,r){if(!(ee))return r}a(XJs,"computeCitationStart");function eZs(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(iZs,"computeRejectedCompletions");function Ihr(t,e){let r=t.get(iy);if(!r.position||!r.uri)return;let n=iZs(r);n.length>0&&Qdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Ihr,"rejectLastShown");function lni(t,e,r,n){let o=t.get(iy);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Ihr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(lni,"setLastShown");function uni(t,e){let r=t.get(iy);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;nZs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Qlt(t,"ghostText",e)}}a(uni,"handleGhostTextShown");function oZs(t,e,r){let n=t.get(iy);n.linesLeft===void 0&&(n.linesAccepted=UH(e.insertText.substring(0,r)),n.linesLeft=UH(e.displayText));let o=UH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(oZs,"handleLineAcceptance");function Pme(t,e,r="ghostText"){let n=t.get(iy),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:UH(e.displayText)},n.resetState(),QNe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Pme,"handleGhostTextPostInsert");function qdt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(iy),l;return s==="cumulative"?(sZs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(oZs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),QNe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(qdt,"handlePartialGhostTextPostInsert");function sZs(t,e,r){let n=t.get(iy);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=UH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(sZs,"handleCumulativeAcceptance");p();var A4=new Map;A4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});A4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});A4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});A4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});A4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});A4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var aZs=new fe("sdk");function jdt(t,e){A4.has(t.get(Ir).getEditorPluginInfo().name)||aZs.warn(t,...e)}a(jdt,"deprecationWarning");var wYi=de(AP()),TI=de(PP());p();p();p();p();var Hdt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Dme(t,e){let r=Wt.createAndMarkAsIssued({authType:e});Et(t,Hdt.NewGitHubLogin,r),At(t,Hdt.NewGitHubLogin,{authType:e})}a(Dme,"telemetryNewGitHubLogin");function K2(t,e,r,n,o){Vn(t,Hdt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(K2,"telemetryGitHubLoginResult");function qNe(t,e,r){Vn(t,Hdt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(qNe,"telemetryCodeFlowError");var dni=["repo","workflow"],xhr=class extends yi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function cZs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:dni.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(tr).fetch(s,n)}catch(c){throw c instanceof Error&&XI(c)?new yi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(cZs,"requestDeviceFlowStage1");async function lZs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(tr).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 xhr(c):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(lZs,"requestDeviceFlowStage2");async function uZs(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(uZs,"requestUserInfo");var HT=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(zp).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(zp).githubAppId=n;let d=await this.save(u);return K2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{K2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw K2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(CC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Dme(n,"deviceFlow");let o=await cZs(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 lZs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await uZs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):dni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new yi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var whr=de(ri());p();var cR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var Gdt="github.copilot.finishDeviceFlow",Rhr=class extends cR{constructor(){super(...arguments);this.name=Gdt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(HT),s=o.pendingSignIn;if(!s)throw new whr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(Vm).open(s.verificationUri)}catch(c){b_.warn(this.ctx,"Failed to open",s.verificationUri),b_.exception(this.ctx,c,Gdt)}try{return await s.status}catch(c){throw new whr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},fni=[Rhr];p();p();var Ru=class extends Cn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var jNe="github.copilot.didAcceptCompletionItem",khr=class extends cR{constructor(){super(...arguments);this.name=jNe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Ru).get(n);return s?(Pme(this.ctx,s),!0):!1}},pni=[khr];p();p();p();var d1t=de(u1t()),mQi=de(K$());function Zwc(t){switch(t){case d1t.TokenizerName.cl100k:return"cl100k_base";case d1t.TokenizerName.o200k:return"o200k_base";case d1t.TokenizerName.mock:return"mock"}}a(Zwc,"toClsTokenizerName");var gQi={getTokenizer:a(t=>ws(Zwc(t)),"getTokenizer"),ensureLoaded:a(()=>Lun(),"ensureLoaded")},Xwc=new pQ,eRc={encode:a(t=>Xwc.tokenize(t),"encode")},f1t=class extends mQi.TokenizerProvider{constructor(){super(!1,void 0);this.rewired=new WeakSet}static{a(this,"ApproximateNesTokenizerProvider")}acquireTokenizer(r){let n=super.acquireTokenizer(r);return this.useApproximateEncoder(n),n}useApproximateEncoder(r){if(this.rewired.has(r))return;this.rewired.add(r);let n=r;n.doInitTokenizer=()=>Promise.resolve(eRc)}};p();p();p();p();function AQi(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],maxTokens:Gri*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...Vri(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(wJs,"getGhostTextStrategy");function Vri(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&iO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Zt).longLookaheadSize(u):t.get(Zt).shortLookaheadSize(u);return{finishedCb:new jlt(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Bdt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Zt).maxMultilineTokens(u)}}return{finishedCb:c?hNe(t,r,n):d=>{}}}a(Vri,"buildFinishedCallback");var RJs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function kJs(t,e,r){let n=Ft(t,Ye.CompletionsDebounce)??t.get(Zt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=El()-r.issuedTime;return Math.max(0,n-o)}a(kJs,"getRemainingDebounceMs");function QNe(t,e,r){return r?.isCancellationRequested||e!==t.get(Db).currentRequestId}a(QNe,"inlineCompletionRequestCancelled");async function PJs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=El();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Zt);if(QNe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:_p(n,t)};let f=NJs(e.textDocument,e.position);if(f===void 0)return dl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:_p(n,t)};let h=AQ(t,n),m={...RJs,...s,tokenizer:h.tokenizer},g=await Pme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return dl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:_p(n,t)};if(g.type==="contextTooShort")return dl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:_p(n,t)};if(g.type==="promptError")return dl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:_p(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return dl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:_p(n,t)};if(g.type==="promptTimeout")return dl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:_p(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return dl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:_p(n,t)};let A=kJs(t,m,n);return A>0&&(dl.debug(t,`Debouncing ghost text request for ${A}ms`),await SC(A),QNe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:_p(n,t)}:t.get(ps).trackCompletionJob(async()=>{let[E]=jH(e.textDocument.getText(gu.range(gu.position(0,0),e.position))),_=t.get(Db).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await wJs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=DJs(t,E,v,b.requestMultiline);u("cache");let w=yQ(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:tut(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=jJs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Pb).shouldWaitForAsyncCompletions(E,g.prompt)){let j=await t.get(Pb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),j){let Q=!b.requestMultiline;T=[[yhr(j[0],{forceSingleLine:Q})],4]}if(QNe(t,r,o))return dl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:_p(x,t)}}let P=b.blockMode==="moremultiline"&&iO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(j=>UNe(t,e.textDocument,e.position,j,P,dl)).filter(j=>j!==void 0)),T!==void 0&&T[0].length===0)return dl.debug(t,`Found empty inline suggestions locally via ${ime(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:_p(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))dl.debug(t,`Found inline suggestions locally via ${ime(T[1])}`);else{if(m.isCycling){let j=await xJs(t,R,x,o,b.finishedCb);if(j.type==="success"){let Q=T?.[0]??[];j.value[0].forEach(U=>{Q.findIndex(Y=>Y.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return j}else{let j=a((W,V)=>(t.get(Pb).updateCompletion(r,W),b.finishedCb(W,V)),"finishedCb"),Q=new Fn.CancellationTokenSource,U=IJs(t,R,x,Q.token,j);t.get(Pb).queueCompletionRequest(r,E,g.prompt,Q,U);let Y=await t.get(Pb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:_p(x,t)};T=[[Y[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:_p(x,t)};let[D,N]=T,L=D.map(j=>UNe(t,e.textDocument,e.position,j,P,dl)).filter(j=>j!==void 0),B=Ft(t,Ye.CompletionsDelay)??d.completionsDelay(n),q=El()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(dl.debug(t,`Waiting ${M}ms before returning completion`),await SC(M),QNe(t,r,o)))return dl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:MH(x)};let O=[];for(let j of L){let Q=qJs(t,e.textDocument,R,j,x),U=f?Hri(e.textDocument,e.position,j):0,W={completion:FJs(j.choiceIndex,j.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:j.copilotAnnotations,clientCompletionId:j.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,dl.debug(t,`Produced ${O.length} results from ${ime(N)} at ${x.measurements.foundOffset} offset`),QNe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:MH(x)}:(m.isSpeculative||t.get(Db).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:_p(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(PJs,"getGhostTextWithoutAbortHandling");async function Ehr(t,e,r,n){let o=Mt();t.get(Db).currentRequestId=o;let s=await QJs(t,e.textDocument,o,n);await gQ().catch(()=>{});try{return t.get(Nb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(r4).notifyRequest(e,o,s,r,n),await PJs(t,e,o,s,r,n)}catch(c){if(Vm(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:MH(s,{cancelledNetworkRequest:!0})};throw c}}a(Ehr,"getGhostText");function DJs(t,e,r,n){let o=t.get(Db).getCompletionsForUserTyping(e,r.suffix),s=UJs(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(DJs,"getLocalInlineSuggestion");function NJs(t,e){let r=MJs(e,t),n=OJs(e,t);return r&&!n?void 0:r&&n}a(NJs,"isInlineSuggestion");function MJs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(MJs,"isMiddleOfTheLine");function OJs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(OJs,"isValidMiddleOfTheLinePosition");function LJs(t,e){return e.lineAt(t).text.trim().length===0}a(LJs,"isNewLine");var w8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function BJs(t,e,r,n,o,s,c){if(t.get(w8).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)At(t,"ghostText.longFileMultilineSkip",Wt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&iO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Fdn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&LJs(n,r))return{requestMultiline:!0};let u=!1;return!o&&PS(r.detectedLanguageId)?u=await eut(r,n):o&&PS(r.detectedLanguageId)&&(u=await eut(r,n)||await eut(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=BXn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(BJs,"shouldRequestMultiline");function Bdt(t,e,r){t.get(G2).append(e.prefix,e.prompt.suffix,r)}a(Bdt,"appendToCache");function FJs(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(FJs,"adjustLeadingWhitespace");function UJs(t,e,r,n){let o=t.get(G2).findAll(e,r);return o.length===0?(dl.debug(t,"Found no completions in cache"),[]):(dl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>yhr(s,{forceSingleLine:!n})))}a(UJs,"getCompletionsFromCache");async function QJs(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=Wt.createAndMarkAsIssued(o);return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(QJs,"createTelemetryWithExp");function qJs(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,Yri(u,e),u.extendWithRequestId(s),u.measurements.confidence=qri(t,u),u.measurements.quantile=jri(t,u),dl.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(qJs,"telemetryWithAddData");function jJs(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);Yri(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(gu.range(h.range.start,n)),g=e.getText(gu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Wri.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={..._se(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 At(t,"ghostText.issued",_),d}a(jJs,"telemetryIssued");function Yri(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(Yri,"addDocumentTelemetry");function Kri(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),At(t,`ghostText.${e}`,l)}a(Kri,"telemetryPerformance");p();p();var pee=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get($r);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 GT=class{static{a(this,"CitationManager")}},Fdt=class extends GT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var _hr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??Fn.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=Qdt.indexOf(_);v!==-1&&Qdt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Qdt)_()}a(e,"afterUpdateConnection");function r(_){Z2.connection!==_&&(Z2.connection=_,e())}a(r,"updateConnection");function n(){return Z2.connection==="connected"}a(n,"isConnected");function o(){return Z2.connection==="disconnected"}a(o,"isDisconnected");function s(){return Z2.connection==="retry"}a(s,"isRetrying");function c(){return Z2.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(_){Z2.initialWait!==_&&(Z2.initialWait=_)}a(h,"setInitialWait");function m(_,v=HJs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return Z2.initialWait}a(g,"isInitialWait");async function A(_,v){Ob.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(nr);function T(w,R){if(w>Zri){Ob.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{Z2.retryAttempts=Math.min(Z2.retryAttempts+1,Xri);try{Ob.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",SB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{Ob.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Ob.info(_,"Attempting to reconnect."),T(vhr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Udt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Udt}a(GJs,"registerConnectionState");var mee=GJs();p();var jg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},qNe={[jg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[jg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[jg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function Chr(t){return t===401?jg.Unauthorized:t===400?jg.BadArguments:t===404?jg.NotFound:t===429?jg.RateLimit:t>=500&&t<600?jg.InternalError:t>=600?jg.ConnectionError:jg.Unknown}a(Chr,"getErrorType");function A4(t,e,r={}){return{kind:"failure",reason:Chr(Number(t)),code:Number(t),msg:e,meta:r}}a(A4,"createErrorResponse");p();var $Js=/^[1-6][0-9][0-9]$/,VJs=/([A-Z][a-z]+)/,WJs="code_referencing",jNe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[WJs,this.baseKey,...e].join(".")}},bhr=class extends jNe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Wt.createAndMarkAsIssued();At(e,r,n)}handleFocus({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("focus","count");At(e,n,r)}handleWrite({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("write","count");At(e,n,r)}},H$f=new bhr,Shr=class extends jNe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");At(e,o,n)}handleDismiss({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");At(e,o,n)}},G$f=new Shr,Thr=class extends jNe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});tg(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});tg(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match($Js)){Ob.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(VJs).filter(l=>!!l).join("_").toLowerCase(),c=Wt.createAndMarkAsIssued({message:o});tg(e,this.buildKey(s,r),c)}},qdt=new Thr;var zJs="twirp/github.snippy.v1.SnippyAPI";async function Ihr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return mee.setDisconnected(),A4(401,qNe[jg.Unauthorized])}if(Ob.info(t,`Calling ${e}`),mee.isRetrying())return A4(600,"Attempting to reconnect to the public code matching service.");if(mee.isDisconnected())return A4(601,"The public code matching service is offline.");let s;try{s=await t.get(nr).fetch(ix(t,o,"origin-tracker",`${zJs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...$y(t)},signal:n})}catch{return mee.enableRetry(t),A4(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 qdt.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=Chr(h),g=d||"unknown error";switch(m){case jg.Unauthorized:return A4(u,qNe[jg.Unauthorized],f);case jg.BadArguments:return A4(u,g,f);case jg.RateLimit:return mee.enableRetry(t,60*1e3),A4(u,qNe.RateLimitError,f);case jg.InternalError:return mee.enableRetry(t),A4(u,qNe[jg.InternalError],f);default:return A4(u,g,f)}}a(Ihr,"call");p();var jdt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),KJs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),eni=S.Object({source:S.String()}),JJs=S.Object({snippets:S.Array(KJs)}),tni=S.Union([JJs,jdt]),rni=S.Object({cursor:S.String()}),ZJs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),XJs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),eZs=S.Object({count:S.Record(S.String(),S.String())}),tZs=S.Object({file_matches:S.Array(ZJs),page_info:XJs,license_stats:eZs}),nni=S.Union([tZs,jdt]);async function ini(t,e,r){let n=await Ihr(t,"Match",{method:"POST",body:yK(eni,{source:e})},r);return yK(tni,n)}a(ini,"Match");async function oni(t,{cursor:e},r){let n=await Ihr(t,"FilesForMatch",{method:"POST",body:yK(rni,{cursor:e})},r);return yK(nni,n)}a(oni,"FilesForMatch");p();var HNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Hdt=65;function iZs(t){let e=0,r;HNe.lastIndex=0;do if(r=HNe.exec(t),r&&(e+=1),e>=Hdt)break;while(r);return e}a(iZs,"lexemeLength");function oZs(t,e){let r=0,n;HNe.lastIndex=0;do if(n=HNe.exec(t),n&&(r+=1,r>=e))return HNe.lastIndex;while(n);return t.length}a(oZs,"offsetFirstLexemes");function sni(t,e){let r=t.split("").reverse().join(""),n=oZs(r,e);return r.length-n}a(sni,"offsetLastLexemes");function GNe(t){return iZs(t)>=Hdt}a(GNe,"hasMinLexemeLength");function aZs(t){return rO.Check(jdt,t)}a(aZs,"isError");async function ani(t,e){let r=await e();if(aZs(r)){qdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(ani,"snippyRequest");function cni(t){return"kind"in t&&t.kind==="failure"}a(cni,"isMatchError");async function lni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Ob.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!GNe(c)||!GNe(c))return;let l=r;if(!GNe(r)){let g=c.slice(0,n),A=sni(g,Hdt);l=c.slice(A,n+r.length)}if(!GNe(l))return;let u=await ani(t,()=>ini(t,l));if(!u||cni(u)||!u.snippets.length){Ob.info(t,"No match found");return}Ob.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await ani(t,()=>oni(t,{cursor:g.cursor}));if(!A||cni(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(GT).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(lni,"fetchCitations");p();function xhr(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(uZs,"lexGeneratorWords");function uni(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(uni,"lexicalAnalyzer");function dni(t){return t!==" "}a(dni,"notSingleSpace");function fni(t,e,r=uZs){let[n,o]=uni(t,cZs(),r,dni),[s,c]=uni(e,o,r,dni);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=lZs(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=xhr(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(fni,"lexEditDistance");p();function HH(t){return t.length===0?0:t.split(` +`).length}a(HH,"countLines");function pni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(pni,"computeCompletionText");var GH=new fe("postInsertion"),hni=[{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}],mni=50,dZs=1500,fZs=.5,pZs=500,whr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function gni(t,e,r,n,o){let s=await t.get(ni).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return GH.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 Pme(t,r.properties.headerRequestId,hee(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=Vfr(u,n,c.detectedLanguageId),y=cei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:pZs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(gni,"captureCode");function Gdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{GH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),UXn(t,e,d)});let s=new pee(t,n,r-1),c=new pee(t,n,r),l=a(async u=>{GH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await gni(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});GH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),At(t,e+".capturedAfterRejected",A,1)},"checkInCode");hni.filter(u=>u.captureRejection).map(u=>s.push(Y0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Gdt,"postRejectionTasks");function $Ne(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});GH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),FXn(t,e,u);let d=r;r=pni(r,c);let f=r.trim(),h=new pee(t,o,n),m=new pee(t,o,n+r.length),g=a(async A=>{await AZs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(whr.triggerPostInsertionSynchroneously&&O1(t)){let A=g({seconds:0,captureCode:whr.captureCode,captureRejection:whr.captureRejection});t.get(Rd).register(A)}else hni.map(A=>h.push(Y0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));Y0(t,hZs,"post insertion citation check")(t,o,d,r,n,l)}a($Ne,"postInsertionTasks");async function hZs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(ox(t)?.getTokenValue("sn")==="1")return;await lni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Rhr(c.getText(),n,mni,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=mZs(r.length,n.length,l.start_offset);if(u===void 0){GH.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+gZs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(GT).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(hZs,"citationCheck");function mZs(t,e,r){if(!(ee))return r}a(mZs,"computeCitationStart");function gZs(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(_Zs,"computeRejectedCompletions");function khr(t,e){let r=t.get(oy);if(!r.position||!r.uri)return;let n=_Zs(r);n.length>0&&Gdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(khr,"rejectLastShown");function Ani(t,e,r,n){let o=t.get(oy);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&khr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Ani,"setLastShown");function yni(t,e){let r=t.get(oy);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;EZs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Glt(t,"ghostText",e)}}a(yni,"handleGhostTextShown");function vZs(t,e,r){let n=t.get(oy);n.linesLeft===void 0&&(n.linesAccepted=HH(e.insertText.substring(0,r)),n.linesLeft=HH(e.displayText));let o=HH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(vZs,"handleLineAcceptance");function Nme(t,e,r="ghostText"){let n=t.get(oy),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:HH(e.displayText)},n.resetState(),$Ne(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Nme,"handleGhostTextPostInsert");function $dt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(oy),l;return s==="cumulative"?(CZs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(vZs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),$Ne(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a($dt,"handlePartialGhostTextPostInsert");function CZs(t,e,r){let n=t.get(oy);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=HH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(CZs,"handleCumulativeAcceptance");p();var y4=new Map;y4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});y4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});y4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});y4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});y4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});y4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var bZs=new fe("sdk");function Vdt(t,e){y4.has(t.get(Ir).getEditorPluginInfo().name)||bZs.warn(t,...e)}a(Vdt,"deprecationWarning");var FYi=de(EP()),xI=de(NP());p();p();p();p();var Wdt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Mme(t,e){let r=Wt.createAndMarkAsIssued({authType:e});At(t,Wdt.NewGitHubLogin,r),Rt(t,Wdt.NewGitHubLogin,{authType:e})}a(Mme,"telemetryNewGitHubLogin");function X2(t,e,r,n,o){ai(t,Wdt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(X2,"telemetryGitHubLoginResult");function VNe(t,e,r){ai(t,Wdt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(VNe,"telemetryCodeFlowError");var Eni=["repo","workflow"],Phr=class extends yi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function SZs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...$y(t)},json:{client_id:e,scope:Eni.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(nr).fetch(s,n)}catch(c){throw c instanceof Error&&rx(c)?new yi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(SZs,"requestDeviceFlowStage1");async function TZs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...$y(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(nr).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 Phr(c):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(TZs,"requestDeviceFlowStage2");async function IZs(t,e){let n=await(await Vf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(IZs,"requestUserInfo");var $T=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Lr)}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(Kp).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(Kp).githubAppId=n;let d=await this.save(u);return X2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{X2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw X2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(bC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Mme(n,"deviceFlow");let o=await SZs(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 TZs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await IZs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):Eni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new yi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var Dhr=de(ei());p();var uR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var zdt="github.copilot.finishDeviceFlow",Nhr=class extends uR{constructor(){super(...arguments);this.name=zdt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get($T),s=o.pendingSignIn;if(!s)throw new Dhr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(zm).open(s.verificationUri)}catch(c){S_.warn(this.ctx,"Failed to open",s.verificationUri),S_.exception(this.ctx,c,zdt)}try{return await s.status}catch(c){throw new Dhr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},_ni=[Nhr];p();p();var Ru=class extends Cn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var WNe="github.copilot.didAcceptCompletionItem",Mhr=class extends uR{constructor(){super(...arguments);this.name=WNe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Ru).get(n);return s?(Nme(this.ctx,s),!0):!1}},vni=[Mhr];p();p();p();var m1t=de(h1t()),bQi=de(eV());function hRc(t){switch(t){case m1t.TokenizerName.cl100k:return"cl100k_base";case m1t.TokenizerName.o200k:return"o200k_base";case m1t.TokenizerName.mock:return"mock"}}a(hRc,"toClsTokenizerName");var SQi={getTokenizer:a(t=>ws(hRc(t)),"getTokenizer"),ensureLoaded:a(()=>jun(),"ensureLoaded")},mRc=new mQ,gRc={encode:a(t=>mRc.tokenize(t),"encode")},g1t=class extends bQi.TokenizerProvider{constructor(){super(!1,void 0);this.rewired=new WeakSet}static{a(this,"ApproximateNesTokenizerProvider")}acquireTokenizer(r){let n=super.acquireTokenizer(r);return this.useApproximateEncoder(n),n}useApproximateEncoder(r){if(this.rewired.has(r))return;this.rewired.add(r);let n=r;n.doInitTokenizer=()=>Promise.resolve(gRc)}};p();p();p();p();function TQi(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(AQi,"normalizeIndentCharacter");Mo();function yQi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=gu.range(gu.position(o.line,0),gu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=AQi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=gu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Mt(),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(yQi,"completionsFromGhostTextResults");p();var CN=class{constructor(){this.cache=new Cn(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 dEe=class extends ry{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 mhr(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=lni(s,r.textDocument,r.position,d),h=yQi(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(()=>mhr(s,r,void 0,g),"fn");s.get(CN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=Fn.Range.create(A,Fn.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(pee(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(pee(r,n),o,s);return DXn(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}});Ult.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(CN).request(r.clientCompletionId)}};p();var fEe=de(Vne()),EQi=de(iN()),p4r=de(rdt()),m1t=de(cee()),_Qi=de(Rs()),vQi=de(W2()),n3e=de(kE()),h1t=de(q_()),h4r=de(hd()),CQi=de(qT()),bQi=de(ri());p();var p1t=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Wi;this._onDidChangeTextDocument=new Wi;this._onDidCloseTextDocument=new Wi;this._onDidSelectTextDocument=new Wi;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($r)}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 bV=class extends m1t.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,vQi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new p1t(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get($r);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=fEe.DocumentId.create(Fs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=fEe.DocumentId.create(Fs(Fs(r)));return this.addDocument({id:s,initialValue:o,languageId:p4r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=fEe.DocumentId.create(Fs(Fs(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=fEe.DocumentId.create(Fs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=fEe.DocumentId.create(Fs(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 m4r(r.id,new CQi.StringText(r.initialValue??""),[],r.languageId??p4r.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()}},m4r=class extends m1t.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 h1t.Position(e.lineNumber+1,e.column+1));this.updateSelection([new h4r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new EQi.Edits(n3e.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(bQi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new h1t.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new h1t.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 _Qi.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 n3e.StringEdit.single(new n3e.StringReplacement(new h4r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var SQi=de(u1t()),TQi=de(hgt()),g4r=de(cee()),pEe=de(Ic()),C4r=de(Ro());var A4r=class extends C4r.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 pEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new pEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new pEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new pEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(bs(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidCopilotTokenChange.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(),g1t(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 g1t(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function g1t(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new TQi.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(pf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(g1t,"asChatLibCopilotToken");var y4r=class extends C4r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new pEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(bs(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(Ox),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){qa(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.")}},E4r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(nc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get($r).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},_4r=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}}}},v4r=class extends ry{constructor(r){super();this.ctx=r;this._telemetrySender=new i3e(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(hm).matchFunction,o=new s3e(this.ctx.get(tr)),s=ple(r),c={fetcher:o,authService:new A4r(r),telemetrySender:this._telemetrySender,logTarget:new o3e(r),isRunningInTest:O1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new _4r(r.get(ps)),documentManager:r.get($r),workspace:r.get(g4r.ObservableWorkspace),urlOpener:r.get(Vm),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(Ua),notificationSender:r.get(ts),ignoreService:new E4r(r),waitForTreatmentVariables:!1,endpointProvider:new y4r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:gQi},l=(0,SQi.createInlineCompletionsProvider)(c);return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let u=ple(this.ctx);l.setConfigs(u).catch(d=>{qa(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(g4r.ObservableWorkspace);l instanceof bV&&await l.syncSafeDocuments();let u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(u.filtersAndExp.exp),c.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.asLocalResult(await c.getInlineCompletions(r,n,o,s),u)}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 JI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new iB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new nC(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)}},A1t=class extends ry{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new dEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new v4r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return Ft(this.ctx,Ye.UseChatLibCompletions)??this.ctx.get(Zt).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)}},i3e=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),vse(this.ctx,e,o.properties,o.measurements,0),At(this.ctx,e,fU(o.properties,cNe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),vse(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",Wt.createAndMarkAsIssued(n,o)}};p();var IQi=de(T$()),xQi=de(Ic()),a3e=de(BIr()),wQi=de(nL());var tRc=16,h9=class extends IQi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Cn(tRc);this._onDidChangeDiagnostics=new xQi.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(rRc);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 rRc(t){let e=new wQi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?a3e.DiagnosticSeverity.Error:a3e.DiagnosticSeverity.Warning,n=new a3e.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(rRc,"toVscodeDiagnostic");p();var nRc="nes.reportInlineEditArc";function RQi(t,e){if(e.originalCharCount===void 0||e.originalCharCount===0)return;let r={opportunityId:e.opportunityId,languageId:e.languageId??""},n={arc:e.arc??0,originalCharCount:e.originalCharCount,originalLineCount:e.originalLineCount??0,originalDeletedLineCount:e.originalDeletedLineCount??0,currentLineCount:e.currentLineCount??0,currentDeletedLineCount:e.currentDeletedLineCount??0,didBranchChange:e.didBranchChange,timeDelayMs:e.timeDelayMs};At(t,nRc,r,n)}a(RQi,"emitNESArcTelemetry");var m9=de(u1t()),PQi=de(Vne()),S4r=de(cee()),DQi=de(_y()),NQi=de(abt()),MQi=de(Ic()),T4r=require("node:stream");Mo();var kQi=10,iRc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],b4r=new fe("nextEditSuggestions"),oRc={[m9.LogLevel.Off]:4,[m9.LogLevel.Trace]:4,[m9.LogLevel.Debug]:4,[m9.LogLevel.Info]:3,[m9.LogLevel.Warning]:2,[m9.LogLevel.Error]:1},o3e=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(qf).logIt(this.ctx,oRc[e],r,...n)}},Vv=class{constructor(e){this.lastResultsById=new Cn(kQi);this.lastResultsByUri=new Cn(kQi);this.ctx=e,this.telemetrySender=new i3e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(S4r.ObservableWorkspace);if(s instanceof bV&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let A=this.lastResultsByUri.get(e);A&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(A.resultId),A.isShown&&o.handleRejection(A.nextEditResult))}let c=Fs(e),l=PQi.DocumentId.create(c),u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp);let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await aRc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&b4r.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=sRc(d)??Mt(),m={resultId:h,nextEditResult:d,documentId:l,targetUri:f.document.uri,isShown:!1,originalText:f.document.getText(),languageId:f.document.detectedLanguageId};return this.lastResultsById.set(h,m),this.lastResultsByUri.set(e,m),[{edit:{text:d.result.newText,range:f.range,textDocument:f.textDocument},id:h}]}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),this.startNESArcTelemetry(n),await r.handleAcceptance(n.nextEditResult))}startNESArcTelemetry(e){try{let r=e.nextEditResult.result;if(!r)return;let n=e.originalText.slice(0,r.range.start)+r.newText+e.originalText.slice(r.range.endExclusive);this.ctx.get($r).getTextDocument({uri:e.targetUri}).then(o=>{if(!o)return;this.ctx.get(nT).initialize(o,e.originalText,n,{timeouts:iRc}).startReporter(c=>{RQi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{b4r.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){b4r.warn(this.ctx,"Failed to start NES ARC telemetry",r)}}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&&cRc(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(S4r.ObservableWorkspace),r=new s3e(this.ctx.get(tr)),n=new I4r(this.ctx),o=ple(this.ctx),s=await(0,m9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:NQi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new o3e(this.ctx),languageDiagnosticsService:this.ctx.get(h9),tokenizerProvider:new f1t});return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let c=ple(this.ctx);s.setConfigs(c).catch(l=>{qa(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ft(this.ctx,Ye.NESUseExplicitRejection)}};function sRc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(sRc,"readOpportunityId");async function aRc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Fs(o)!==n,c=s?o:n,l=await t.textDocumentManager.getTextDocument({uri:c});if(!l)return;let u=l.positionAt(e.range.start),d=l.positionAt(e.range.endExclusive);return{textDocument:{uri:l.uri,version:s?l.version:r.version},range:{start:u,end:d},document:l,isCrossFile:s}}a(aRc,"resolveNextEditTarget");function cRc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){qa(t,o,"nesProvider.setDisposalReason")}}a(cRc,"trySetChatLibDisposalReason");var I4r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new MQi.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 g1t(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},s3e=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 T4r.Readable?c=T4r.Readable.toWeb(s):c=s),new DQi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Mt(),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 XI(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 lRc="github.copilot.didAcceptNextEditSuggestionItem",x4r=class extends cR{constructor(){super(...arguments);this.name=lRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleAcceptance(n),!0}},uRc="github.copilot.didRejectNextEditSuggestionItem",w4r=class extends cR{constructor(){super(...arguments);this.name=uRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleRejection(n),!0}},dRc="github.copilot.didIgnoreNextEditSuggestionItem",R4r=class extends cR{constructor(){super(...arguments);this.name=dRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleIgnored(n),!0}},OQi=[x4r,w4r,R4r];p();var P4r="github.copilot.didAcceptPanelCompletionItem",k4r=class extends cR{constructor(){super(...arguments);this.name=P4r;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Ru).get(o);return c?(QNe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:UH(c.displayText)},c.copilotAnnotations),!0):!1}},LQi=[k4r];var fRc=[...fni,...pni,...OQi,...LQi];function BQi(t,e){let r=new Map;for(let n of fRc){let o=new n(t),s=qu.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=g9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(Yn).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Ir).getEditorPluginInfo(),n=await e.get(Yn).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,c3e.gt)((0,c3e.coerce)(r.version),(0,c3e.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Ir).getEditorPluginInfo();await e.get(Yn).delete("versions",r.name),(await e.get(Yn).listKeys("versions")).length===0&&await e.get(Yn).deleteSetting("versions")}};p();var jQi=de(nl()),HQi=require("crypto"),C1t=de(require("path")),mEe=de(Xc());var mRc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},gRc=new mEe.ProgressType,bN=class t{constructor(e){this.ctx=e;this.#e=new Wi;this._changeHandlerLimiter=new jQi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new mEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ar).connection}init(){this.ctx.get(bn).getCapabilities().watchedFiles&&this.connection.onNotification(mEe.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(bn).getCapabilities().watchedFiles)return mRc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(bn).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=C1t.extname(l).toLowerCase();_Q.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=C1t.extname(s.uri).toLowerCase();if(!_Q.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(nc).enabled?this.getValidDocument(e):NS.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ii).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,HQi.randomUUID)(),n=[],o=this.connection.onProgress(gRc,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=C1t.extname(l).toLowerCase();if(!_Q.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();var ARc=new fe("mcpGateway.projectCleanup"),iie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function GQi(t){let e=t.get($r),r=t.get(ey),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{ARc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new iie(()=>n.dispose())}a(GQi,"installMcpProjectCleanup");p();p();p();p();p();var WQi=require("crypto");var yRc=new fe("CloudAgentLogParser"),ERc=new Set(["run_setup","run_custom_setup_step"]),b1t=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function SN(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(SN,"asString");function _Rc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(_Rc,"chunkTimestamp");function gEe(t,e,r){return{id:(0,WQi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(gEe,"event");function S1t(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return bRc(t,e,o=>{let s=_Rc(o.created),c=o.choices;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.delta;!d||typeof d!="object"||SN(d.role)==="assistant"&&vRc(d,u,n,r,s)}}),n}a(S1t,"parseCloudAgentLogs");function vRc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=SN(t.content),u=SN(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=SN(g?.name);if(A&&ERc.has(A)){if(l&&l.trim().length>0){let y=VQi(SN(g?.arguments)),E=SN(y?.name)??l,_=SN(m.id)??`setup-${E}`;zQi(r,_,A,{name:E},E,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){h.length>0&&r.push($Qi(h,n,o));for(let m of c){let g=m,A=g.function,y=SN(A?.name);if(!y)continue;let E=VQi(SN(A?.arguments));CRc(r,g,y,l,E,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(gEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(gEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push($Qi(h,n,o)):r.push(YQi(h,n,o)))}a(vRc,"processAssistantDelta");function CRc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=SN(e.id);if(!l)return;if(r==="think"){let d=SN(o?.thought)??n;d&&d.trim().length>0&&t.push(YQi(d,s,c));return}let u=n?.trim();zQi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(CRc,"appendToolPart");function zQi(t,e,r,n,o,s){t.push(gEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(gEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(zQi,"pushToolCall");function $Qi(t,e,r){return gEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a($Qi,"textEvent");function YQi(t,e,r){return gEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(YQi,"reasoningEvent");function VQi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(VQi,"parseArguments");function bRc(t,e,r){for(let n of e.split(/\r?\n/)){let o=n.trimStart();if(!o.startsWith("data:"))continue;let s=o.slice(5).trim();if(s.length===0)continue;let c;try{c=JSON.parse(s)}catch{yRc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(bRc,"forEachDataChunk");p();var T1t=require("crypto");var oie=new fe("CloudAgentSession"),sie="CloudAgentSession",KQi="cloud:",SRc="cloud.pull_request_card";function N4r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,T1t.randomUUID)(),timestamp:n,parentId:null,type:SRc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url??null}}}a(N4r,"buildCloudPullRequestCardEvent");function ZQi(t){if(!t.startsWith(KQi))return;let e=t.slice(KQi.length),r=Number(e);return e.length>0&&Number.isInteger(r)&&r>0?r:void 0}a(ZQi,"parseCloudPullRequestNumber");var DL={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},D4r=3e3,TRc=120*1e3,IRc=300*1e3,JQi=10,I1t=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new b1t;this.localSessionId=o.localSessionId,this.workspaceFolder=o.workspaceFolder,this._cwd=un(o.workspaceFolder.uri),this._pullRequest=o.pullRequest}static{a(this,"CloudAgentSession")}get cwd(){return this._cwd}get pullRequest(){return this._pullRequest}get idSource(){return this._ids}get hasPullRequest(){return this._pullRequest!==void 0}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=hue(e),u=await this.client.createCodingTask(l,e,o,s,c,n);if(n.isCancellationRequested)return{stream:Promise.resolve()};let d=u.pullRequest;return this._pullRequest=d,this.emit(N4r(d)),oie.info(this.ctx,`${sie}.startInitialJob: job created`,{localSessionId:this.localSessionId,pullRequestNumber:d.number,cloudSessionId:u.sessionId}),{stream:this.streamSessionSafe(u.sessionId,0,void 0,n)}}catch(o){if(n.isCancellationRequested||exe(o))return{stream:Promise.resolve()};throw o}}async submitFollowUp(e){let r=this._pullRequest;if(!r)throw new Error("submitFollowUp called before a pull request was created");let o=this.resetCancellation().token,s=await this.snapshotSessionIds(r.id,o);if(o.isCancellationRequested)return{stream:Promise.resolve()};await new Zh(this.ctx).addPullRequestComment(r.repository.owner.login,r.repository.name,r.number,`@copilot ${e}`);let l=await this.waitForNewSession(r.id,s,o);return o.isCancellationRequested?{stream:Promise.resolve()}:l?{stream:this.streamSessionSafe(l,0,void 0,o)}:(this.emitError("Timed out waiting for the cloud agent to start a new session."),{stream:Promise.resolve()})}resumeStreaming(e){let r=this.resetCancellation();return{stream:this.streamSessionSafe(e.cloudSessionId,e.initialLogLength,e.state,r.token)}}async streamSessionSafe(e,r,n,o){try{await this.streamSession(e,r,n,o)}catch(s){if(o.isCancellationRequested)return;this.emitError(this.errorMessage(s)||"Cloud agent session stream failed")}}stop(){this._cts?.cancel(),this._cts?.dispose(),this._cts=void 0}stopByUser(){this.stop(),this.emitIdle()}async streamSession(e,r,n,o){if(this.emit(this.event("assistant.turn_start",{turnId:(0,T1t.randomUUID)(),interactionId:this.localSessionId})),n!==DL.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case DL.InProgress:break;case DL.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case DL.Completed:this.emitIdle();return;default:this.emitError("The cloud agent session did not start in time.");return}}await this.streamSessionLogs(e,r,o)}async waitForInProgress(e,r){let n=Date.now()+TRc;for(;!r.isCancellationRequested&&Date.now()=JQi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){oie.warn(this.ctx,`${sie}.streamSessionLogs: session no longer in list; stopping`,{cloudSessionId:e}),this.emitIdle();return}let l;try{l=await this.client.getSessionLogs(e,n)}catch(f){if(oie.warn(this.ctx,`${sie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=JQi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==DL.InProgress&&u!==DL.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=S1t(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===DL.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+IRc;for(;!n.isCancellationRequested&&Date.now()!r.has(l.id)).sort((l,u)=>new Date(u.created_at).getTime()-new Date(l.created_at).getTime())[0];if(c)return c.id}await this.delay(D4r,n)}}async snapshotSessionIds(e,r){let n=await this.client.getAllSessions(e,r);return new Set((n??[]).map(o=>o.id))}async getSessionInfo(e,r){let n=this._pullRequest;return n?(await this.client.getAllSessions(n.id,r)??[]).find(s=>s.id===e):void 0}async resolveRepo(e){let r={uri:this.workspaceFolder.uri},o=await new _f(this.ctx).getRepo(r);if(!o||!o.isGitHub())throw new Error("No GitHub repository found in the workspace folder.");if(!o.owner||!o.name)throw new Error("Could not determine repository owner and name.");let c=await new kO([new PO,new DO]).getBranchInfo(this.ctx,r);if(!c?.currentBranch||c.isDetachedHead)throw new Error("No current branch found or detached HEAD state \u2014 cannot create a cloud agent job.");if(e.isCancellationRequested)throw new Error("Request was cancelled");return{owner:o.owner,name:o.name,baseRef:c.currentBranch}}emit(e){this.notificationSender.sendBackgroundAgentSessionUpdate(this.localSessionId,e,"CLOUD").catch(r=>{oie.warn(this.ctx,`${sie}.emit: failed to send session update`,{localSessionId:this.localSessionId,error:this.errorMessage(r)})})}emitIdle(){this.emit(this.event("session.idle",{}))}emitError(e){this.emit(this.event("session.error",{errorType:"cloudAgent",message:e})),this.emitIdle()}event(e,r){return{id:(0,T1t.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new Fn.CancellationTokenSource;return this._cts=e,e}delay(e,r){return new Promise(n=>{let o=setTimeout(()=>{s?.dispose(),n()},e),s=r.onCancellationRequested(()=>{clearTimeout(o),s?.dispose(),n()})})}errorMessage(e){return e instanceof Error?e.message:String(e)}};var XQi=require("crypto");Mo();var y9=new fe("CloudAgent"),E9="CloudAgentService";function xRc(){return{id:"auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(xRc,"buildCloudAutoModel");var aie=class{constructor(e){this.ctx=e;this._sessions=new Map;this.notificationSender=e.get(ts),this.client=new HC(e)}static{a(this,"CloudAgentService")}async createSession(e){let r=e.sessionId??Mt(),n=await this.getOrCreateSession(r,e.workspaceFolder);return{sessionId:r,workspacePath:n.cwd}}async resumeSession(e){let{sessionId:r}=e,n=await this.getOrCreateSession(r,e.workspaceFolder);if(!n.pullRequest)return{sessionId:r,workspacePath:n.cwd,events:[]};let{events:o,streamStatus:s}=await this.loadSessionHistory(n.pullRequest,n.idSource);if(s&&(s.state==="in_progress"||s.state==="queued")){let{stream:c}=n.resumeStreaming(s);c.catch(l=>{y9.warn(this.ctx,`${E9}.resumeSession: stream failed`,{sessionId:r,error:l instanceof Error?l.message:String(l)})})}return y9.info(this.ctx,`${E9}.resumeSession`,{sessionId:r,pullRequestNumber:n.pullRequest.number,events:o.length}),{sessionId:r,workspacePath:n.cwd,events:o}}async sendMessage(e,r){let n=this._sessions.get(e.sessionId);if(!n)return Promise.reject(new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`));let o=Mt(),s=n.hasPullRequest,{stream:c}=s?await n.submitFollowUp(e.message):await n.startInitialJob(e.message);return c.catch(l=>{y9.warn(this.ctx,`${E9}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:s,error:l instanceof Error?l.message:String(l)})}),{messageId:o}}stopSession(e){let r=this._sessions.get(e);return r?(r.stopByUser(),y9.info(this.ctx,`${E9}.stopSession`,{sessionId:e}),Promise.resolve()):(y9.warn(this.ctx,`${E9}.stopSession: unknown session`,{sessionId:e}),Promise.resolve())}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}listSessions(e){return Promise.reject(this.unsupported("listSessions"))}listModels(e){return Promise.resolve({models:[xRc()]})}createCloudSession(e,r,n){return new I1t(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}async getOrCreateSession(e,r){let n=this._sessions.get(e);if(n)return n;let o=await this.resolvePullRequest(e,r),s=this.createCloudSession(e,r,o);return this._sessions.set(e,s),s}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):y9.warn(this.ctx,`${E9}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(N4r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){y9.warn(this.ctx,`${E9}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...S1t(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,XQi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}async resolvePullRequest(e,r){let n=ZQi(e);if(n!==void 0)try{let o=await this.ctx.get(_f).getRepo({uri:r.uri});if(!o||!o.isGitHub()||!o.owner||!o.name){y9.warn(this.ctx,`${E9}.resolvePullRequest: workspace is not a GitHub repo`,{sessionId:e});return}return await new Zh(this.ctx).getPullRequest(o.owner,o.name,n)}catch(o){y9.warn(this.ctx,`${E9}.resolvePullRequest: failed`,{sessionId:e,error:o instanceof Error?o.message:String(o)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var eqi=require("node:child_process"),tqi=require("node:events"),M4r=de(require("node:readline"));var SV=new fe("CodexProcessManager"),x1t=class extends tqi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]'];SV.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,eqi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),SV.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw SV.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{SV.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{SV.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=M4r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&M4r.default.createInterface({input:this.process.stderr}).on("line",s=>{SV.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+` +`)[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(TQi,"normalizeIndentCharacter");Oo();function IQi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=gu.range(gu.position(o.line,0),gu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=TQi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=gu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Mt(),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(IQi,"completionsFromGhostTextResults");p();var TN=class{constructor(){this.cache=new Cn(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 pEe=class extends ny{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 Ehr(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=Ani(s,r.textDocument,r.position,d),h=IQi(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(()=>Ehr(s,r,void 0,g),"fn");s.get(TN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=Fn.Range.create(A,Fn.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(hee(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(hee(r,n),o,s);return QXn(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}});Hlt.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(TN).request(r.clientCompletionId)}};p();var hEe=de(Wne()),xQi=de(aN()),A4r=de(sdt()),E1t=de(lee()),wQi=de(Rs()),RQi=de(K2()),c3e=de(PE()),y1t=de(j_()),y4r=de(gd()),kQi=de(HT()),PQi=de(ei());p();var A1t=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Wi;this._onDidChangeTextDocument=new Wi;this._onDidCloseTextDocument=new Wi;this._onDidSelectTextDocument=new Wi;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($r)}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 xV=class extends E1t.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,RQi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new A1t(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get($r);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=hEe.DocumentId.create(Fs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=hEe.DocumentId.create(Fs(Fs(r)));return this.addDocument({id:s,initialValue:o,languageId:A4r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=hEe.DocumentId.create(Fs(Fs(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=hEe.DocumentId.create(Fs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=hEe.DocumentId.create(Fs(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 E4r(r.id,new kQi.StringText(r.initialValue??""),[],r.languageId??A4r.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()}},E4r=class extends E1t.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 y1t.Position(e.lineNumber+1,e.column+1));this.updateSelection([new y4r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new xQi.Edits(c3e.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(PQi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new y1t.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new y1t.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 wQi.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 c3e.StringEdit.single(new c3e.StringReplacement(new y4r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var DQi=de(h1t()),NQi=de(ygt()),_4r=de(lee()),mEe=de(Ic()),I4r=de(ko());var v4r=class extends I4r.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 mEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new mEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new mEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new mEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(bs(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidCopilotTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Lr).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(),_1t(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(Lr).resolveSession();return _1t(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function _1t(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new NQi.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(mf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(_1t,"asChatLibCopilotToken");var C4r=class extends I4r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new mEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(bs(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(Bx),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){ua(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.")}},b4r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(ic).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get($r).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},S4r=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}}}},T4r=class extends ny{constructor(r){super();this.ctx=r;this._telemetrySender=new l3e(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(gm).matchFunction,o=new d3e(this.ctx.get(nr)),s=hle(r),c={fetcher:o,authService:new v4r(r),telemetrySender:this._telemetrySender,logTarget:new u3e(r),isRunningInTest:O1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new S4r(r.get(ps)),documentManager:r.get($r),workspace:r.get(_4r.ObservableWorkspace),urlOpener:r.get(zm),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(Qa),notificationSender:r.get(ts),ignoreService:new b4r(r),waitForTreatmentVariables:!1,endpointProvider:new C4r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:SQi},l=(0,DQi.createInlineCompletionsProvider)(c);return this.ctx.get(Bo).onDidChangeCopilotSettings(()=>{let u=hle(this.ctx);l.setConfigs(u).catch(d=>{ua(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(_4r.ObservableWorkspace);l instanceof xV&&await l.syncSafeDocuments();let u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(u.filtersAndExp.exp),c.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.asLocalResult(await c.getInlineCompletions(r,n,o,s),u)}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 ex({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new oB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new jI(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)}},v1t=class extends ny{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new pEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new T4r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return Ft(this.ctx,Ye.UseChatLibCompletions)??this.ctx.get(Zt).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)}},l3e=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),Cse(this.ctx,e,o.properties,o.measurements,0),Rt(this.ctx,e,hU(o.properties,pNe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),Cse(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",Wt.createAndMarkAsIssued(n,o)}};p();var MQi=de(R$()),OQi=de(Ic()),f3e=de(qIr()),LQi=de(iL());var ARc=16,g9=class extends MQi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Cn(ARc);this._onDidChangeDiagnostics=new OQi.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(yRc);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 yRc(t){let e=new LQi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?f3e.DiagnosticSeverity.Error:f3e.DiagnosticSeverity.Warning,n=new f3e.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(yRc,"toVscodeDiagnostic");p();var ERc="nes.reportInlineEditArc";function BQi(t,e){if(e.originalCharCount===void 0||e.originalCharCount===0)return;let r={opportunityId:e.opportunityId,languageId:e.languageId??""},n={arc:e.arc??0,originalCharCount:e.originalCharCount,originalLineCount:e.originalLineCount??0,originalDeletedLineCount:e.originalDeletedLineCount??0,currentLineCount:e.currentLineCount??0,currentDeletedLineCount:e.currentDeletedLineCount??0,didBranchChange:e.didBranchChange,timeDelayMs:e.timeDelayMs};Rt(t,ERc,r,n)}a(BQi,"emitNESArcTelemetry");var A9=de(h1t()),UQi=de(Wne()),w4r=de(lee()),QQi=de(vy()),qQi=de(dbt()),jQi=de(Ic()),R4r=require("node:stream");Oo();var FQi=10,_Rc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],x4r=new fe("nextEditSuggestions"),vRc={[A9.LogLevel.Off]:4,[A9.LogLevel.Trace]:4,[A9.LogLevel.Debug]:4,[A9.LogLevel.Info]:3,[A9.LogLevel.Warning]:2,[A9.LogLevel.Error]:1},u3e=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Hf).logIt(this.ctx,vRc[e],r,...n)}},zv=class{constructor(e){this.lastResultsById=new Cn(FQi);this.lastResultsByUri=new Cn(FQi);this.ctx=e,this.telemetrySender=new l3e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(w4r.ObservableWorkspace);if(s instanceof xV&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let A=this.lastResultsByUri.get(e);A&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(A.resultId),A.isShown&&o.handleRejection(A.nextEditResult))}let c=Fs(e),l=UQi.DocumentId.create(c),u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp);let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await bRc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&x4r.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=CRc(d)??Mt(),m={resultId:h,nextEditResult:d,documentId:l,targetUri:f.document.uri,isShown:!1,originalText:f.document.getText(),languageId:f.document.detectedLanguageId};return this.lastResultsById.set(h,m),this.lastResultsByUri.set(e,m),[{edit:{text:d.result.newText,range:f.range,textDocument:f.textDocument},id:h}]}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),this.startNESArcTelemetry(n),await r.handleAcceptance(n.nextEditResult))}startNESArcTelemetry(e){try{let r=e.nextEditResult.result;if(!r)return;let n=e.originalText.slice(0,r.range.start)+r.newText+e.originalText.slice(r.range.endExclusive);this.ctx.get($r).getTextDocument({uri:e.targetUri}).then(o=>{if(!o)return;this.ctx.get(oT).initialize(o,e.originalText,n,{timeouts:_Rc}).startReporter(c=>{BQi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{x4r.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){x4r.warn(this.ctx,"Failed to start NES ARC telemetry",r)}}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&&SRc(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(w4r.ObservableWorkspace),r=new d3e(this.ctx.get(nr)),n=new k4r(this.ctx),o=hle(this.ctx),s=await(0,A9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:qQi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new u3e(this.ctx),languageDiagnosticsService:this.ctx.get(g9),tokenizerProvider:new g1t});return this.ctx.get(Bo).onDidChangeCopilotSettings(()=>{let c=hle(this.ctx);s.setConfigs(c).catch(l=>{ua(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ft(this.ctx,Ye.NESUseExplicitRejection)}};function CRc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(CRc,"readOpportunityId");async function bRc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Fs(o)!==n,c=s?o:n,l=await t.textDocumentManager.getTextDocument({uri:c});if(!l)return;let u=l.positionAt(e.range.start),d=l.positionAt(e.range.endExclusive);return{textDocument:{uri:l.uri,version:s?l.version:r.version},range:{start:u,end:d},document:l,isCrossFile:s}}a(bRc,"resolveNextEditTarget");function SRc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){ua(t,o,"nesProvider.setDisposalReason")}}a(SRc,"trySetChatLibDisposalReason");var k4r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new jQi.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(Lr).resolveSession();return _1t(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},d3e=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 R4r.Readable?c=R4r.Readable.toWeb(s):c=s),new QQi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Mt(),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 rx(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 TRc="github.copilot.didAcceptNextEditSuggestionItem",P4r=class extends uR{constructor(){super(...arguments);this.name=TRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(zv).handleAcceptance(n),!0}},IRc="github.copilot.didRejectNextEditSuggestionItem",D4r=class extends uR{constructor(){super(...arguments);this.name=IRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(zv).handleRejection(n),!0}},xRc="github.copilot.didIgnoreNextEditSuggestionItem",N4r=class extends uR{constructor(){super(...arguments);this.name=xRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(zv).handleIgnored(n),!0}},HQi=[P4r,D4r,N4r];p();var O4r="github.copilot.didAcceptPanelCompletionItem",M4r=class extends uR{constructor(){super(...arguments);this.name=O4r;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Ru).get(o);return c?($Ne(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:HH(c.displayText)},c.copilotAnnotations),!0):!1}},GQi=[M4r];var wRc=[..._ni,...vni,...HQi,...GQi];function $Qi(t,e){let r=new Map;for(let n of wRc){let o=new n(t),s=ju.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=y9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(ti).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Ir).getEditorPluginInfo(),n=await e.get(ti).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,p3e.gt)((0,p3e.coerce)(r.version),(0,p3e.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Ir).getEditorPluginInfo();await e.get(ti).delete("versions",r.name),(await e.get(ti).listKeys("versions")).length===0&&await e.get(ti).deleteSetting("versions")}};p();var KQi=de(nl()),JQi=require("crypto"),I1t=de(require("path")),AEe=de(Xc());var PRc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},DRc=new AEe.ProgressType,IN=class t{constructor(e){this.ctx=e;this.#e=new Wi;this._changeHandlerLimiter=new KQi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new AEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ar).connection}init(){this.ctx.get(bn).getCapabilities().watchedFiles&&this.connection.onNotification(AEe.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(bn).getCapabilities().watchedFiles)return PRc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(bn).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=I1t.extname(l).toLowerCase();CQ.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=I1t.extname(s.uri).toLowerCase();if(!CQ.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(ic).enabled?this.getValidDocument(e):MS.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ni).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,JQi.randomUUID)(),n=[],o=this.connection.onProgress(DRc,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=I1t.extname(l).toLowerCase();if(!CQ.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();var NRc=new fe("mcpGateway.projectCleanup"),oie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function ZQi(t){let e=t.get($r),r=t.get(ty),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{NRc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new oie(()=>n.dispose())}a(ZQi,"installMcpProjectCleanup");p();p();p();p();p();var tqi=require("crypto");var MRc=new fe("CloudAgentLogParser"),ORc=new Set(["run_setup","run_custom_setup_step"]),x1t=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function xN(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(xN,"asString");function LRc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(LRc,"chunkTimestamp");function yEe(t,e,r){return{id:(0,tqi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(yEe,"event");function w1t(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return URc(t,e,o=>{let s=LRc(o.created),c=o.choices;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.delta;!d||typeof d!="object"||xN(d.role)==="assistant"&&BRc(d,u,n,r,s)}}),n}a(w1t,"parseCloudAgentLogs");function BRc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=xN(t.content),u=xN(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=xN(g?.name);if(A&&ORc.has(A)){if(l&&l.trim().length>0){let y=eqi(xN(g?.arguments)),E=xN(y?.name)??l,_=xN(m.id)??`setup-${E}`;rqi(r,_,A,{name:E},E,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){h.length>0&&r.push(XQi(h,n,o));for(let m of c){let g=m,A=g.function,y=xN(A?.name);if(!y)continue;let E=eqi(xN(A?.arguments));FRc(r,g,y,l,E,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(yEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(yEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push(XQi(h,n,o)):r.push(nqi(h,n,o)))}a(BRc,"processAssistantDelta");function FRc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=xN(e.id);if(!l)return;if(r==="think"){let d=xN(o?.thought)??n;d&&d.trim().length>0&&t.push(nqi(d,s,c));return}let u=n?.trim();rqi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(FRc,"appendToolPart");function rqi(t,e,r,n,o,s){t.push(yEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(yEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(rqi,"pushToolCall");function XQi(t,e,r){return yEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a(XQi,"textEvent");function nqi(t,e,r){return yEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(nqi,"reasoningEvent");function eqi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(eqi,"parseArguments");function URc(t,e,r){for(let n of e.split(/\r?\n/)){let o=n.trimStart();if(!o.startsWith("data:"))continue;let s=o.slice(5).trim();if(s.length===0)continue;let c;try{c=JSON.parse(s)}catch{MRc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(URc,"forEachDataChunk");p();var R1t=require("crypto");var sie=new fe("CloudAgentSession"),aie="CloudAgentSession",iqi="cloud:",QRc="cloud.pull_request_card";function B4r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,R1t.randomUUID)(),timestamp:n,parentId:null,type:QRc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url??null}}}a(B4r,"buildCloudPullRequestCardEvent");function sqi(t){if(!t.startsWith(iqi))return;let e=t.slice(iqi.length),r=Number(e);return e.length>0&&Number.isInteger(r)&&r>0?r:void 0}a(sqi,"parseCloudPullRequestNumber");var NL={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},L4r=3e3,qRc=120*1e3,jRc=300*1e3,oqi=10,k1t=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new x1t;this.localSessionId=o.localSessionId,this.workspaceFolder=o.workspaceFolder,this._cwd=un(o.workspaceFolder.uri),this._pullRequest=o.pullRequest}static{a(this,"CloudAgentSession")}get cwd(){return this._cwd}get pullRequest(){return this._pullRequest}get idSource(){return this._ids}get hasPullRequest(){return this._pullRequest!==void 0}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=mue(e),u=await this.client.createCodingTask(l,e,o,s,c,n);if(n.isCancellationRequested)return{stream:Promise.resolve()};let d=u.pullRequest;return this._pullRequest=d,this.emit(B4r(d)),sie.info(this.ctx,`${aie}.startInitialJob: job created`,{localSessionId:this.localSessionId,pullRequestNumber:d.number,cloudSessionId:u.sessionId}),{stream:this.streamSessionSafe(u.sessionId,0,void 0,n)}}catch(o){if(n.isCancellationRequested||ixe(o))return{stream:Promise.resolve()};throw o}}async submitFollowUp(e){let r=this._pullRequest;if(!r)throw new Error("submitFollowUp called before a pull request was created");let o=this.resetCancellation().token,s=await this.snapshotSessionIds(r.id,o);if(o.isCancellationRequested)return{stream:Promise.resolve()};await new em(this.ctx).addPullRequestComment(r.repository.owner.login,r.repository.name,r.number,`@copilot ${e}`);let l=await this.waitForNewSession(r.id,s,o);return o.isCancellationRequested?{stream:Promise.resolve()}:l?{stream:this.streamSessionSafe(l,0,void 0,o)}:(this.emitError("Timed out waiting for the cloud agent to start a new session."),{stream:Promise.resolve()})}resumeStreaming(e){let r=this.resetCancellation();return{stream:this.streamSessionSafe(e.cloudSessionId,e.initialLogLength,e.state,r.token)}}async streamSessionSafe(e,r,n,o){try{await this.streamSession(e,r,n,o)}catch(s){if(o.isCancellationRequested)return;this.emitError(this.errorMessage(s)||"Cloud agent session stream failed")}}stop(){this._cts?.cancel(),this._cts?.dispose(),this._cts=void 0}stopByUser(){this.stop(),this.emitIdle()}async streamSession(e,r,n,o){if(this.emit(this.event("assistant.turn_start",{turnId:(0,R1t.randomUUID)(),interactionId:this.localSessionId})),n!==NL.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case NL.InProgress:break;case NL.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case NL.Completed:this.emitIdle();return;default:this.emitError("The cloud agent session did not start in time.");return}}await this.streamSessionLogs(e,r,o)}async waitForInProgress(e,r){let n=Date.now()+qRc;for(;!r.isCancellationRequested&&Date.now()=oqi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){sie.warn(this.ctx,`${aie}.streamSessionLogs: session no longer in list; stopping`,{cloudSessionId:e}),this.emitIdle();return}let l;try{l=await this.client.getSessionLogs(e,n)}catch(f){if(sie.warn(this.ctx,`${aie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=oqi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==NL.InProgress&&u!==NL.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=w1t(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===NL.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+jRc;for(;!n.isCancellationRequested&&Date.now()!r.has(l.id)).sort((l,u)=>new Date(u.created_at).getTime()-new Date(l.created_at).getTime())[0];if(c)return c.id}await this.delay(L4r,n)}}async snapshotSessionIds(e,r){let n=await this.client.getAllSessions(e,r);return new Set((n??[]).map(o=>o.id))}async getSessionInfo(e,r){let n=this._pullRequest;return n?(await this.client.getAllSessions(n.id,r)??[]).find(s=>s.id===e):void 0}async resolveRepo(e){let r={uri:this.workspaceFolder.uri},o=await new Cf(this.ctx).getRepo(r);if(!o||!o.isGitHub())throw new Error("No GitHub repository found in the workspace folder.");if(!o.owner||!o.name)throw new Error("Could not determine repository owner and name.");let c=await new DO([new NO,new MO]).getBranchInfo(this.ctx,r);if(!c?.currentBranch||c.isDetachedHead)throw new Error("No current branch found or detached HEAD state \u2014 cannot create a cloud agent job.");if(e.isCancellationRequested)throw new Error("Request was cancelled");return{owner:o.owner,name:o.name,baseRef:c.currentBranch}}emit(e){this.notificationSender.sendBackgroundAgentSessionUpdate(this.localSessionId,e,"CLOUD").catch(r=>{sie.warn(this.ctx,`${aie}.emit: failed to send session update`,{localSessionId:this.localSessionId,error:this.errorMessage(r)})})}emitIdle(){this.emit(this.event("session.idle",{}))}emitError(e){this.emit(this.event("session.error",{errorType:"cloudAgent",message:e})),this.emitIdle()}event(e,r){return{id:(0,R1t.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new Fn.CancellationTokenSource;return this._cts=e,e}delay(e,r){return new Promise(n=>{let o=setTimeout(()=>{s?.dispose(),n()},e),s=r.onCancellationRequested(()=>{clearTimeout(o),s?.dispose(),n()})})}errorMessage(e){return e instanceof Error?e.message:String(e)}};var aqi=require("crypto");Oo();var _9=new fe("CloudAgent"),v9="CloudAgentService";function HRc(){return{id:"auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(HRc,"buildCloudAutoModel");var cie=class{constructor(e){this.ctx=e;this._sessions=new Map;this.notificationSender=e.get(ts),this.client=new HC(e)}static{a(this,"CloudAgentService")}async createSession(e){let r=e.sessionId??Mt(),n=await this.getOrCreateSession(r,e.workspaceFolder);return{sessionId:r,workspacePath:n.cwd}}async resumeSession(e){let{sessionId:r}=e,n=await this.getOrCreateSession(r,e.workspaceFolder);if(!n.pullRequest)return{sessionId:r,workspacePath:n.cwd,events:[]};let{events:o,streamStatus:s}=await this.loadSessionHistory(n.pullRequest,n.idSource);if(s&&(s.state==="in_progress"||s.state==="queued")){let{stream:c}=n.resumeStreaming(s);c.catch(l=>{_9.warn(this.ctx,`${v9}.resumeSession: stream failed`,{sessionId:r,error:l instanceof Error?l.message:String(l)})})}return _9.info(this.ctx,`${v9}.resumeSession`,{sessionId:r,pullRequestNumber:n.pullRequest.number,events:o.length}),{sessionId:r,workspacePath:n.cwd,events:o}}async sendMessage(e,r){let n=this._sessions.get(e.sessionId);if(!n)return Promise.reject(new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`));let o=Mt(),s=n.hasPullRequest,{stream:c}=s?await n.submitFollowUp(e.message):await n.startInitialJob(e.message);return c.catch(l=>{_9.warn(this.ctx,`${v9}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:s,error:l instanceof Error?l.message:String(l)})}),{messageId:o}}stopSession(e){let r=this._sessions.get(e);return r?(r.stopByUser(),_9.info(this.ctx,`${v9}.stopSession`,{sessionId:e}),Promise.resolve()):(_9.warn(this.ctx,`${v9}.stopSession: unknown session`,{sessionId:e}),Promise.resolve())}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}listSessions(e){return Promise.reject(this.unsupported("listSessions"))}listModels(e){return Promise.resolve({models:[HRc()]})}createCloudSession(e,r,n){return new k1t(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}async getOrCreateSession(e,r){let n=this._sessions.get(e);if(n)return n;let o=await this.resolvePullRequest(e,r),s=this.createCloudSession(e,r,o);return this._sessions.set(e,s),s}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):_9.warn(this.ctx,`${v9}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(B4r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){_9.warn(this.ctx,`${v9}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...w1t(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,aqi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}async resolvePullRequest(e,r){let n=sqi(e);if(n!==void 0)try{let o=await this.ctx.get(Cf).getRepo({uri:r.uri});if(!o||!o.isGitHub()||!o.owner||!o.name){_9.warn(this.ctx,`${v9}.resolvePullRequest: workspace is not a GitHub repo`,{sessionId:e});return}return await new em(this.ctx).getPullRequest(o.owner,o.name,n)}catch(o){_9.warn(this.ctx,`${v9}.resolvePullRequest: failed`,{sessionId:e,error:o instanceof Error?o.message:String(o)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var cqi=require("node:child_process"),lqi=require("node:events"),F4r=de(require("node:readline"));var wV=new fe("CodexProcessManager"),P1t=class extends lqi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]'];wV.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,cqi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),wV.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw wV.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{wV.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{wV.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=F4r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&F4r.default.createInterface({input:this.process.stderr}).on("line",s=>{wV.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+` `),new Promise((c,l)=>{let u=setTimeout(()=>{this.pendingRequests.delete(o),l(new Error(`Timeout waiting for response to ${r} (id=${o})`))},3e4);this.pendingRequests.set(o,{resolve:c,reject:l,timer:u})})}sendNotification(r,n){if(!this.process?.stdin)return;let o=JSON.stringify({jsonrpc:"2.0",method:r,params:n??{}});this.process.stdin.write(o+` -`)}onNotification(r){this.notificationHandlers.push(r)}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r);if(n.id!==void 0&&this.pendingRequests.has(n.id)){let o=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(o.timer),n.error?o.reject(new Error(JSON.stringify(n.error))):o.resolve(n.result)}else if(n.id!==void 0&&n.method)SV.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${n.id}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let o of this.notificationHandlers)o(n.method,n.params)}catch{}}handleServerRequest(r,n,o){SV.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${r})`);let s;n.includes("applyPatch")?s={decision:"approved"}:s={decision:"accept"};let c=JSON.stringify({jsonrpc:"2.0",id:r,result:s});this.process?.stdin?.write(c+` -`);for(let l of this.notificationHandlers)l(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();var rqi=de(require("node:http")),nqi=require("node:stream/promises");var _9=new fe("CodexResponsesProxyServer"),wRc=16*1024*1024,w1t=class{constructor(e){this.ctx=e;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=rqi.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,_9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(_9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);_9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),_9.info(this.ctx,"proxyToCapiResponses: completed")}else _9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){_9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Qt),o=this.ctx.get(tr),s;try{s=await n.getToken()}catch(h){_9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=ile(this.ctx,s,"v1/responses"),l={...i0(this.ctx),"Content-Type":"application/json"},{headers:u}=await nle(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});ole(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();g?await(0,nqi.pipeline)(g,r):r.end()}catch(h){if(d.signal.aborted){_9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(_9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>wRc){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var O4r=require("node:fs"),iqi=de(require("node:os")),R1t=de(require("node:path"));Mo();function RRc(){let t=process.env.CODEX_HOME;return t||R1t.join(iqi.homedir(),".codex")}a(RRc,"codexHome");async function oqi(t){let e=R1t.join(RRc(),"sessions");try{return await sqi(e,t)}catch{return null}}a(oqi,"findRolloutFile");async function sqi(t,e){let r;try{r=await O4r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=R1t.join(t,n.name);if(n.isDirectory()){let s=await sqi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(sqi,"searchForRollout");async function aqi(t){let e;try{e=await O4r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` -`).filter(c=>c.trim().length>0),n=[];for(let c of r)try{n.push(JSON.parse(c))}catch{}let o=[],s={sessionStarted:!1,currentTurnId:void 0,eventMsgCompletionCallIds:kRc(n),sealedCallIds:new Set};for(let c of n){let l=PRc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(aqi,"readAndTranslateRollout");function kRc(t){let e=new Set;for(let r of t){if(r.type!=="event_msg")continue;let n=r.payload.type;if(n!=="patch_apply_end"&&n!=="web_search_end")continue;let o=r.payload.call_id;typeof o=="string"&&o.length>0&&e.add(o)}return e}a(kRc,"collectEventMsgCompletionCallIds");function PRc(t,e){switch(t.type){case"event_msg":return DRc(t.timestamp,t.payload,e);case"response_item":return NRc(t.timestamp,t.payload,e);case"turn_context":return null;default:return null}}a(PRc,"translateRolloutLine");function DRc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Mt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=jRc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Mt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Mt(),c=r.currentTurnId||s;return[{id:Mt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Mt(),timestamp:t,type:"assistant.usage",data:{inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheReadTokens:s.cached_input_tokens}}:null}case"task_complete":return r.currentTurnId=void 0,{id:Mt(),timestamp:t,type:"session.idle"};case"patch_apply_end":{let o=e.call_id||"";if(!o||r.sealedCallIds.has(o))return null;r.sealedCallIds.add(o);let s=e.success===!0,c=e.changes,l=typeof e.stderr=="string"?e.stderr:"",u=typeof e.status=="string"?e.status:"failed";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:s,result:s?{changes:c}:void 0,error:s?void 0:{message:l||`Patch apply ${u}`}}}}case"web_search_end":{let o=e.call_id||"";return!o||r.sealedCallIds.has(o)?null:(r.sealedCallIds.add(o),[{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(DRc,"translateEventMsg");function NRc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return MRc(t,e);case"function_call":return LRc(t,e,r);case"function_call_output":return BRc(t,e,r);case"custom_tool_call":return FRc(t,e,r);case"custom_tool_call_output":return URc(t,e,r);case"web_search_call":return null;default:return null}}a(NRc,"translateResponseItem");function MRc(t,e){let r=ORc(e);if(!r)return null;let n=e.id||Mt();return{id:Mt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(MRc,"translateReasoningItem");function ORc(t){let e=[];for(let r of["summary","content"]){let n=t[r];if(Array.isArray(n)){for(let o of n)if(typeof o=="string")o.length>0&&e.push(o);else if(o&&typeof o=="object"){let s=o.text;typeof s=="string"&&s.length>0&&e.push(s)}}}return e.join(` -`).trim()}a(ORc,"extractReasoningText");function LRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="shell_command"?"shell":o,c=QRc(e.arguments);return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(LRc,"translateFunctionCall");function BRc(t,e,r){let n=e.call_id||"";if(!n||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(BRc,"translateFunctionCallOutput");function FRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="apply_patch"?"file_change":o;return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(FRc,"translateCustomToolCall");function URc(t,e,r){let n=e.call_id||"";if(!n||r.eventMsgCompletionCallIds.has(n)||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(URc,"translateCustomToolCallOutput");function QRc(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}a(QRc,"parseJsonSafe");var qRc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function jRc(t){let e=qRc.exec(t);if(!e)return{content:t,attachments:[]};let r=e[1].split(",").map(n=>n.trim()).filter(n=>n.length>0).map(n=>({type:"file",path:n,displayName:HRc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(jRc,"extractReferencedFiles");function HRc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(HRc,"basename");p();Mo();function Fm(t,e,r){return{id:Mt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Fm,"envelope");function AEe(){return{turnStreamCtx:new Map}}a(AEe,"createCodexTranslatorState");function cqi(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[]},t.turnStreamCtx.set(e,r)),r}a(cqi,"ctxFor");function lqi(t,e,r){switch(t){case"turn/started":return GRc(e);case"turn/completed":return $Rc(e,r);case"item/started":return VRc(e,r);case"item/completed":return WRc(e,r);case"thread/tokenUsage/updated":return zRc(e);case"item/agentMessage/delta":return KRc(e);case"item/reasoning/summaryTextDelta":return hkc(e,r);case"item/commandExecution/outputDelta":return tkc(e);default:return null}}a(lqi,"translateCodexNotification");function GRc(t){return null}a(GRc,"translateTurnStarted");function $Rc(t,e){let r=[];return r.push(Fm("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0},!0)),r.push(Fm("session.idle",{},!0)),t.turn?.id&&e.turnStreamCtx.delete(t.turn.id),r}a($Rc,"translateTurnCompleted");function VRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return YRc(e,t.turnId,r);case"commandExecution":return XRc(r);case"fileChange":return rkc(r);case"mcpToolCall":return ikc(r);case"webSearch":return akc(r);case"imageView":return lkc(r);case"dynamicToolCall":return dkc(r);case"reasoning":return pkc(e,t.turnId,r);default:return null}}a(VRc,"translateItemStarted");function WRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return JRc(e,t.turnId,r);case"commandExecution":return ekc(r);case"fileChange":return nkc(r);case"mcpToolCall":return okc(r);case"webSearch":return ckc(r);case"imageView":return ukc(r);case"dynamicToolCall":return fkc(r);case"reasoning":return mkc(e,t.turnId,r);default:return null}}a(WRc,"translateItemCompleted");function zRc(t){let e=t.tokenUsage.last;return Fm("assistant.usage",{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cachedInputTokens})}a(zRc,"translateTokenUsageUpdated");function YRc(t,e,r){return cqi(t,e).agentMessageIds.push(r.id),Fm("assistant.turn_start",{turnId:r.id,interactionId:e})}a(YRc,"translateAgentMessageItemStarted");function KRc(t){return Fm("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(KRc,"translateAgentMessageDelta");function JRc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Fm("assistant.message",{messageId:o,content:n})}a(JRc,"translateAgentMessageItemCompleted");function yEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(yEe,"isFailedStatus");var L4r=4096;function ZRc(t){return t.length<=L4r?t:`${t.slice(0,L4r)} -\u2026 [truncated ${t.length-L4r} chars]`}a(ZRc,"truncateForError");function XRc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(XRc,"translateCommandExecutionItemStarted");function ekc(t){let e=!yEe(t.status),r=t.aggregatedOutput??"";return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?ZRc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(ekc,"translateCommandExecutionItemCompleted");function tkc(t){return null}a(tkc,"translateCommandExecutionOutputDelta");function rkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"file_change",arguments:{changes:t.changes}})}a(rkc,"translateFileChangeItemStarted");function nkc(t){let e=!yEe(t.status);return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{changes:t.changes}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(nkc,"translateFileChangeItemCompleted");function ikc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(ikc,"translateMcpToolCallItemStarted");function okc(t){let e=!yEe(t.status)&&!t.error;return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?skc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(okc,"translateMcpToolCallItemCompleted");function skc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(skc,"wrapMcpResult");function akc(t){return null}a(akc,"translateWebSearchItemStarted");function ckc(t){let e=!yEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Fm("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e&&n?{content:t.results}:void 0,error:e?void 0:{message:`Web search ${t.status??"failed"}`},durationMs:t.durationMs??void 0})]}a(ckc,"translateWebSearchItemCompleted");function lkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(lkc,"translateImageViewItemStarted");function ukc(t){let e=!yEe(t.status);return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{path:t.path}:void 0,error:e?void 0:{message:`Image view ${t.status??"failed"}`}})}a(ukc,"translateImageViewItemCompleted");function dkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(dkc,"translateDynamicToolCallItemStarted");function fkc(t){let e=t.success!==void 0?t.success:!yEe(t.status)&&!t.error;return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:t.contentItems}:void 0,error:e?void 0:{message:t.error??`Tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(fkc,"translateDynamicToolCallItemCompleted");function pkc(t,e,r){return cqi(t,e).reasoningIds.push(r.id),null}a(pkc,"translateReasoningItemStarted");function hkc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Fm("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(hkc,"translateReasoningDelta");function mkc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=gkc(r);return o?Fm("assistant.reasoning",{reasoningId:n,content:o}):null}a(mkc,"translateReasoningItemCompleted");function gkc(t){let e=[];for(let r of[t.summary,t.content])if(Array.isArray(r))for(let n of r)typeof n=="string"?n.length>0&&e.push(n):n&&typeof n.text=="string"&&n.text.length>0&&e.push(n.text);return e.join(` -`).trim()}a(gkc,"extractReasoningText");Mo();var nA=new fe("CodexAgentService"),cie=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.proxyServer=new w1t(e),this.notificationSender=e.get(ts),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Ft(this.ctx,Ye.CodexCliPath);if(e)return e;let r=process.env.CODEX_CLI_PATH;return r||(process.platform==="win32"?"codex.exe":"codex")}async ensureRunning(){if(this.processManager?.isRunning())return;if(this.codexPath=this.resolveCodexPath(),this.initialized=!1,!this.workspaceCwd)try{let r=this.ctx.get($r).getWorkspaceFolders();if(r.length>0){let n=new URL(r[0].uri);this.workspaceCwd=n.pathname.replace(/^\/([A-Za-z]:)/,"$1")}}catch{}let e=await this.proxyServer.start();this.processManager=new x1t(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.on("error",r=>{nA.error(this.ctx,"Codex process died",{error:r.message}),this.emitErrorToAllSessions(r.message)}),this.processManager.start(),await new Promise(r=>setTimeout(r,1e3))}async ensureInitialized(){if(await this.ensureRunning(),!this.initialized)try{await this.processManager.sendRequest("initialize",{clientInfo:{name:"copilot-jetbrains",title:"GitHub Copilot for JetBrains",version:"1.0.0"},capabilities:{}}),this.processManager.sendNotification("initialized",{}),this.initialized=!0,await new Promise(e=>setTimeout(e,300))}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to initialize Codex process: ${r}`)}}async createSession(e){return kb(this.ctx,"codexAgent.createSession",async r=>{if(nA.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model}),!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();let n=await this.processManager.sendRequest("thread/start"),o=n.thread.id,s=new Date().toISOString();return this.sessions.set(o,{sessionId:o,threadId:n.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:s,modifiedTime:s,translatorState:AEe()}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return kb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;nA.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o){r.properties.reason="inMemory";let c=await this.loadHistoricalEvents(n,r,e.model??o.model);return r.measurements.eventCount=c?.length??0,{sessionId:n,workspacePath:o.workspacePath,events:c}}if(!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();try{let c=await this.processManager.sendRequest("thread/resume",{threadId:n}),l=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:c.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:l,modifiedTime:l,summary:"(resumed)",translatorState:AEe()})}catch(c){let l=c instanceof Error?c.message:String(c);nA.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:l});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:u.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:d,modifiedTime:d,summary:"(resumed - fresh)",translatorState:AEe()}),r.properties.freshThread="true"}let s=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async loadHistoricalEvents(e,r,n){try{let o=await oqi(e);if(!o){r.properties.rolloutMissing="true",nA.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await aqi(o);if(!s){r.properties.rolloutReadFailed="true",nA.warn(this.ctx,"loadHistoricalEvents: rollout translation returned null",{threadId:e,rolloutPath:o});return}if(n)for(let c of s)c.type==="assistant.usage"&&c.data&&(c.data.model=n);return s}catch(o){let s=o instanceof Error?o.message:String(o);r.properties.rolloutReadFailed="true",nA.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return kb(this.ctx,"codexAgent.sendMessage",async n=>{nA.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"",await this.ensureInitialized();let o=this.sessions.get(e.sessionId);if(!o){nA.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let l=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),u=new Date().toISOString();o={sessionId:e.sessionId,threadId:l.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:u,modifiedTime:u,translatorState:AEe()},this.sessions.set(e.sessionId,o)}catch(l){nA.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(l)});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();o={sessionId:e.sessionId,threadId:u.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:d,modifiedTime:d,translatorState:AEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let l=e.references.filter(u=>u.type==="file").map(u=>{try{return new URL(u.uri).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{return u.uri}});l.length>0&&s.push({type:"text",text:`[Referenced files: ${l.join(", ")}] +`)}onNotification(r){this.notificationHandlers.push(r)}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r);if(n.id!==void 0&&this.pendingRequests.has(n.id)){let o=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(o.timer),n.error?o.reject(new Error(JSON.stringify(n.error))):o.resolve(n.result)}else if(n.id!==void 0&&n.method)wV.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${n.id}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let o of this.notificationHandlers)o(n.method,n.params)}catch{}}handleServerRequest(r,n,o){wV.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${r})`);let s;n.includes("applyPatch")?s={decision:"approved"}:s={decision:"accept"};let c=JSON.stringify({jsonrpc:"2.0",id:r,result:s});this.process?.stdin?.write(c+` +`);for(let l of this.notificationHandlers)l(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();var uqi=de(require("node:http")),dqi=require("node:stream/promises");var C9=new fe("CodexResponsesProxyServer"),GRc=16*1024*1024,D1t=class{constructor(e){this.ctx=e;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=uqi.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,C9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(C9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);C9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),C9.info(this.ctx,"proxyToCapiResponses: completed")}else C9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){C9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Qt),o=this.ctx.get(nr),s;try{s=await n.getToken()}catch(h){C9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=ole(this.ctx,s,"v1/responses"),l={...s0(this.ctx),"Content-Type":"application/json"},{headers:u}=await ile(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});sle(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();g?await(0,dqi.pipeline)(g,r):r.end()}catch(h){if(d.signal.aborted){C9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(C9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>GRc){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var U4r=require("node:fs"),fqi=de(require("node:os")),N1t=de(require("node:path"));Oo();function $Rc(){let t=process.env.CODEX_HOME;return t||N1t.join(fqi.homedir(),".codex")}a($Rc,"codexHome");async function pqi(t){let e=N1t.join($Rc(),"sessions");try{return await hqi(e,t)}catch{return null}}a(pqi,"findRolloutFile");async function hqi(t,e){let r;try{r=await U4r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=N1t.join(t,n.name);if(n.isDirectory()){let s=await hqi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(hqi,"searchForRollout");async function mqi(t){let e;try{e=await U4r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` +`).filter(c=>c.trim().length>0),n=[];for(let c of r)try{n.push(JSON.parse(c))}catch{}let o=[],s={sessionStarted:!1,currentTurnId:void 0,eventMsgCompletionCallIds:VRc(n),sealedCallIds:new Set};for(let c of n){let l=WRc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(mqi,"readAndTranslateRollout");function VRc(t){let e=new Set;for(let r of t){if(r.type!=="event_msg")continue;let n=r.payload.type;if(n!=="patch_apply_end"&&n!=="web_search_end")continue;let o=r.payload.call_id;typeof o=="string"&&o.length>0&&e.add(o)}return e}a(VRc,"collectEventMsgCompletionCallIds");function WRc(t,e){switch(t.type){case"event_msg":return zRc(t.timestamp,t.payload,e);case"response_item":return YRc(t.timestamp,t.payload,e);case"turn_context":return null;default:return null}}a(WRc,"translateRolloutLine");function zRc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Mt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=ikc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Mt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Mt(),c=r.currentTurnId||s;return[{id:Mt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Mt(),timestamp:t,type:"assistant.usage",data:{inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheReadTokens:s.cached_input_tokens}}:null}case"task_complete":return r.currentTurnId=void 0,{id:Mt(),timestamp:t,type:"session.idle"};case"patch_apply_end":{let o=e.call_id||"";if(!o||r.sealedCallIds.has(o))return null;r.sealedCallIds.add(o);let s=e.success===!0,c=e.changes,l=typeof e.stderr=="string"?e.stderr:"",u=typeof e.status=="string"?e.status:"failed";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:s,result:s?{changes:c}:void 0,error:s?void 0:{message:l||`Patch apply ${u}`}}}}case"web_search_end":{let o=e.call_id||"";return!o||r.sealedCallIds.has(o)?null:(r.sealedCallIds.add(o),[{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(zRc,"translateEventMsg");function YRc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return KRc(t,e);case"function_call":return ZRc(t,e,r);case"function_call_output":return XRc(t,e,r);case"custom_tool_call":return ekc(t,e,r);case"custom_tool_call_output":return tkc(t,e,r);case"web_search_call":return null;default:return null}}a(YRc,"translateResponseItem");function KRc(t,e){let r=JRc(e);if(!r)return null;let n=e.id||Mt();return{id:Mt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(KRc,"translateReasoningItem");function JRc(t){let e=[];for(let r of["summary","content"]){let n=t[r];if(Array.isArray(n)){for(let o of n)if(typeof o=="string")o.length>0&&e.push(o);else if(o&&typeof o=="object"){let s=o.text;typeof s=="string"&&s.length>0&&e.push(s)}}}return e.join(` +`).trim()}a(JRc,"extractReasoningText");function ZRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="shell_command"?"shell":o,c=rkc(e.arguments);return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(ZRc,"translateFunctionCall");function XRc(t,e,r){let n=e.call_id||"";if(!n||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(XRc,"translateFunctionCallOutput");function ekc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let s=e.name||"unknown";return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(ekc,"translateCustomToolCall");function tkc(t,e,r){let n=e.call_id||"";if(!n||r.eventMsgCompletionCallIds.has(n)||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(tkc,"translateCustomToolCallOutput");function rkc(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}a(rkc,"parseJsonSafe");var nkc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function ikc(t){let e=nkc.exec(t);if(!e)return{content:t,attachments:[]};let r=e[1].split(",").map(n=>n.trim()).filter(n=>n.length>0).map(n=>({type:"file",path:n,displayName:okc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(ikc,"extractReferencedFiles");function okc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(okc,"basename");p();Oo();function Qm(t,e,r){return{id:Mt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Qm,"envelope");function EEe(){return{turnStreamCtx:new Map}}a(EEe,"createCodexTranslatorState");function gqi(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[]},t.turnStreamCtx.set(e,r)),r}a(gqi,"ctxFor");function Aqi(t,e,r){switch(t){case"turn/started":return skc(e);case"turn/completed":return akc(e,r);case"item/started":return ckc(e,r);case"item/completed":return lkc(e,r);case"thread/tokenUsage/updated":return ukc(e);case"item/agentMessage/delta":return fkc(e);case"item/reasoning/summaryTextDelta":return kkc(e,r);case"item/commandExecution/outputDelta":return Akc(e);default:return null}}a(Aqi,"translateCodexNotification");function skc(t){return null}a(skc,"translateTurnStarted");function akc(t,e){let r=[];return r.push(Qm("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0},!0)),r.push(Qm("session.idle",{},!0)),t.turn?.id&&e.turnStreamCtx.delete(t.turn.id),r}a(akc,"translateTurnCompleted");function ckc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return dkc(e,t.turnId,r);case"commandExecution":return mkc(r);case"fileChange":return ykc(r);case"mcpToolCall":return _kc(r);case"webSearch":return bkc(r);case"imageView":return Tkc(r);case"dynamicToolCall":return xkc(r);case"reasoning":return Rkc(e,t.turnId,r);default:return null}}a(ckc,"translateItemStarted");function lkc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return pkc(e,t.turnId,r);case"commandExecution":return gkc(r);case"fileChange":return Ekc(r);case"mcpToolCall":return vkc(r);case"webSearch":return Skc(r);case"imageView":return Ikc(r);case"dynamicToolCall":return wkc(r);case"reasoning":return Pkc(e,t.turnId,r);default:return null}}a(lkc,"translateItemCompleted");function ukc(t){let e=t.tokenUsage.last;return Qm("assistant.usage",{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cachedInputTokens})}a(ukc,"translateTokenUsageUpdated");function dkc(t,e,r){return gqi(t,e).agentMessageIds.push(r.id),Qm("assistant.turn_start",{turnId:r.id,interactionId:e})}a(dkc,"translateAgentMessageItemStarted");function fkc(t){return Qm("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(fkc,"translateAgentMessageDelta");function pkc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Qm("assistant.message",{messageId:o,content:n})}a(pkc,"translateAgentMessageItemCompleted");function _Ee(t){return t==="failed"||t==="cancelled"||t==="declined"}a(_Ee,"isFailedStatus");var Q4r=4096;function hkc(t){return t.length<=Q4r?t:`${t.slice(0,Q4r)} +\u2026 [truncated ${t.length-Q4r} chars]`}a(hkc,"truncateForError");function mkc(t){return Qm("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(mkc,"translateCommandExecutionItemStarted");function gkc(t){let e=!_Ee(t.status),r=t.aggregatedOutput??"";return Qm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?hkc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(gkc,"translateCommandExecutionItemCompleted");function Akc(t){return null}a(Akc,"translateCommandExecutionOutputDelta");function ykc(t){return t.changes.map(e=>Qm("tool.execution_start",{toolCallId:yqi(t.id,e),toolName:"file_change",arguments:{...e}}))}a(ykc,"translateFileChangeItemStarted");function Ekc(t){let e=!_Ee(t.status);return t.changes.map(r=>Qm("tool.execution_complete",{toolCallId:yqi(t.id,r),success:e,result:e?{...r}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0}))}a(Ekc,"translateFileChangeItemCompleted");function yqi(t,e){return`${t}:${e.kind}:${encodeURIComponent(e.path)}`}a(yqi,"fileChangeToolCallId");function _kc(t){return Qm("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(_kc,"translateMcpToolCallItemStarted");function vkc(t){let e=!_Ee(t.status)&&!t.error;return Qm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?Ckc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(vkc,"translateMcpToolCallItemCompleted");function Ckc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(Ckc,"wrapMcpResult");function bkc(t){return null}a(bkc,"translateWebSearchItemStarted");function Skc(t){let e=!_Ee(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Qm("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Qm("tool.execution_complete",{toolCallId:t.id,success:e,result:e&&n?{content:t.results}:void 0,error:e?void 0:{message:`Web search ${t.status??"failed"}`},durationMs:t.durationMs??void 0})]}a(Skc,"translateWebSearchItemCompleted");function Tkc(t){return Qm("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(Tkc,"translateImageViewItemStarted");function Ikc(t){let e=!_Ee(t.status);return Qm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{path:t.path}:void 0,error:e?void 0:{message:`Image view ${t.status??"failed"}`}})}a(Ikc,"translateImageViewItemCompleted");function xkc(t){return Qm("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(xkc,"translateDynamicToolCallItemStarted");function wkc(t){let e=t.success!==void 0?t.success:!_Ee(t.status)&&!t.error;return Qm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:t.contentItems}:void 0,error:e?void 0:{message:t.error??`Tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(wkc,"translateDynamicToolCallItemCompleted");function Rkc(t,e,r){return gqi(t,e).reasoningIds.push(r.id),null}a(Rkc,"translateReasoningItemStarted");function kkc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Qm("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(kkc,"translateReasoningDelta");function Pkc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=Dkc(r);return o?Qm("assistant.reasoning",{reasoningId:n,content:o}):null}a(Pkc,"translateReasoningItemCompleted");function Dkc(t){let e=[];for(let r of[t.summary,t.content])if(Array.isArray(r))for(let n of r)typeof n=="string"?n.length>0&&e.push(n):n&&typeof n.text=="string"&&n.text.length>0&&e.push(n.text);return e.join(` +`).trim()}a(Dkc,"extractReasoningText");Oo();var iA=new fe("CodexAgentService"),lie=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.proxyServer=new D1t(e),this.notificationSender=e.get(ts),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Ft(this.ctx,Ye.CodexCliPath);if(e)return e;let r=process.env.CODEX_CLI_PATH;return r||(process.platform==="win32"?"codex.exe":"codex")}async ensureRunning(){if(this.processManager?.isRunning())return;if(this.codexPath=this.resolveCodexPath(),this.initialized=!1,!this.workspaceCwd)try{let r=this.ctx.get($r).getWorkspaceFolders();if(r.length>0){let n=new URL(r[0].uri);this.workspaceCwd=n.pathname.replace(/^\/([A-Za-z]:)/,"$1")}}catch{}let e=await this.proxyServer.start();this.processManager=new P1t(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.on("error",r=>{iA.error(this.ctx,"Codex process died",{error:r.message}),this.emitErrorToAllSessions(r.message)}),this.processManager.start(),await new Promise(r=>setTimeout(r,1e3))}async ensureInitialized(){if(await this.ensureRunning(),!this.initialized)try{await this.processManager.sendRequest("initialize",{clientInfo:{name:"copilot-jetbrains",title:"GitHub Copilot for JetBrains",version:"1.0.0"},capabilities:{}}),this.processManager.sendNotification("initialized",{}),this.initialized=!0,await new Promise(e=>setTimeout(e,300))}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to initialize Codex process: ${r}`)}}async createSession(e){return kb(this.ctx,"codexAgent.createSession",async r=>{if(iA.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model}),!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();let n=await this.processManager.sendRequest("thread/start"),o=n.thread.id,s=new Date().toISOString();return this.sessions.set(o,{sessionId:o,threadId:n.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:s,modifiedTime:s,translatorState:EEe()}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return kb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;iA.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o){r.properties.reason="inMemory";let c=await this.loadHistoricalEvents(n,r,e.model??o.model);return r.measurements.eventCount=c?.length??0,{sessionId:n,workspacePath:o.workspacePath,events:c}}if(!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();try{let c=await this.processManager.sendRequest("thread/resume",{threadId:n}),l=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:c.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:l,modifiedTime:l,summary:"(resumed)",translatorState:EEe()})}catch(c){let l=c instanceof Error?c.message:String(c);iA.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:l});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:u.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:d,modifiedTime:d,summary:"(resumed - fresh)",translatorState:EEe()}),r.properties.freshThread="true"}let s=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async loadHistoricalEvents(e,r,n){try{let o=await pqi(e);if(!o){r.properties.rolloutMissing="true",iA.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await mqi(o);if(!s){r.properties.rolloutReadFailed="true",iA.warn(this.ctx,"loadHistoricalEvents: rollout translation returned null",{threadId:e,rolloutPath:o});return}if(n)for(let c of s)c.type==="assistant.usage"&&c.data&&(c.data.model=n);return s}catch(o){let s=o instanceof Error?o.message:String(o);r.properties.rolloutReadFailed="true",iA.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return kb(this.ctx,"codexAgent.sendMessage",async n=>{iA.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"",await this.ensureInitialized();let o=this.sessions.get(e.sessionId);if(!o){iA.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let u=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),d=new Date().toISOString();o={sessionId:e.sessionId,threadId:u.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:d,modifiedTime:d,translatorState:EEe()},this.sessions.set(e.sessionId,o)}catch(u){iA.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(u)});let d=await this.processManager.sendRequest("thread/start",{}),f=new Date().toISOString();o={sessionId:e.sessionId,threadId:d.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:f,modifiedTime:f,translatorState:EEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let u=e.references.filter(d=>d.type==="file").map(d=>{try{return new URL(d.uri).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{return d.uri}});u.length>0&&s.push({type:"text",text:`[Referenced files: ${u.join(", ")}] -`})}s.push({type:"text",text:e.message});let c=await this.processManager.sendRequest("turn/start",{threadId:o.threadId,input:s});return o.turnId=c.turnId,e.model&&(o.model=e.model),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:c.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);!r||!r.turnId||(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),nA.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e}))}destroySession(e){return this.sessions.delete(e.sessionId),nA.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>{let o;if(n.workspacePath)try{o=new URL(n.workspacePath).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{o=n.workspacePath}return{sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:o?{cwd:o}:void 0}});return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),nA.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(xs).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(x$e.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map((c,l)=>({id:c.id,name:c.name,vendor:c.vendor,preview:c.preview??!1,isDefault:c.is_chat_default??l===0,modelPickerEnabled:c.model_picker_enabled,modelPickerCategory:c.model_picker_category,modelPickerPriceCategory:c.model_picker_price_category,capabilities:{family:c.capabilities.family,supports:{vision:c.capabilities.supports?.vision??!1,reasoningEfforts:c.capabilities.supports?.reasoning_effort},limits:c.capabilities.limits?{max_context_window_tokens:c.capabilities.limits.max_context_window_tokens,max_output_tokens:c.capabilities.limits.max_output_tokens}:{max_context_window_tokens:128e3}},billing:c.billing?{isPremium:c.billing.is_premium??!0,multiplier:c.billing.multiplier??0}:void 0,policy:c.policy}));return nA.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}nA.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);nA.warn(this.ctx,`CodexAgentService.listModels: CAPI query failed: ${n}, using fallback`)}return{models:[{id:"codex-default",name:"Codex (Default)",preview:!1,capabilities:{family:"codex",supports:{vision:!1},limits:{max_context_window_tokens:128e3}}}]}}handleInteraction(e){return Promise.reject(new Error("Codex interaction handling not yet implemented"))}getPlanPath(e){return Promise.resolve(null)}async enableRemote(e){await this.ensureInitialized();try{return await this.processManager.sendRequest("remoteControl/enable",{}),{remoteSteerable:!0}}catch{throw new Error("Codex remote control not available")}}async disableRemote(e){await this.ensureInitialized(),await this.processManager.sendRequest("remoteControl/disable",{})}getRemoteStatus(e){return{remoteSteerable:!1}}async compactHistory(e){await this.ensureInitialized();let r=this.sessions.get(e);return r?(await this.processManager.sendRequest("thread/compact/start",{threadId:r.threadId}),{success:!0,tokensRemoved:0,messagesRemoved:0,summaryContent:""}):{success:!1,tokensRemoved:0,messagesRemoved:0,summaryContent:""}}async stopCompactHistory(e){let r=this.sessions.get(e);return!r||!r.turnId?{aborted:!1}:(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),{aborted:!0})}handleNotification(e,r){nA.info(this.ctx,`handleNotification: method=${e}`,{params:JSON.stringify(r).slice(0,500)});let o=r?.threadId;if(!o){nA.warn(this.ctx,`handleNotification: no threadId in params for method=${e}`);return}let s=this.findSessionByThreadId(o);if(!s)return;if(e==="turn/started"){let u=r;u.turn?.id&&(s.turnId=u.turn.id)}let c=lqi(e,r,s.translatorState);if(!c)return;let l=Array.isArray(c)?c:[c];for(let u of l)u.type==="assistant.usage"&&u.data&&s.model&&(u.data.model=s.model),this.notificationSender.sendBackgroundAgentSessionUpdate(s.sessionId,u,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitErrorToAllSessions(e){for(let r of this.sessions.values()){let n={id:Mt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:"process_crash",message:`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`}};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,n,"CODEX");let o={id:Mt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,o,"CODEX")}}async dispose(){await this.processManager?.stop(),await this.proxyServer.stop()}};var uqi=new fe("AgentRouter"),dqi="AgentRouter";function AI(t){return t.agentProvider??"BACKGROUND"}a(AI,"resolveProvider");var fc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Hs);case"CLAUDE":return this.ctx.get(y8);case"CODEX":return this.ctx.get(cie);case"CLOUD":return this.ctx.get(aie)}}logDispatch(e,r){uqi.debug(this.ctx,`${dqi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=AI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=AI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=AI(e);return this.serviceFor(n).sendMessage(e,r)}truncateHistory(e){this.logDispatch("truncateHistory",e);let r=e.providerName;return this.serviceFor(r).truncateHistory({sessionId:e.sessionId,eventId:e.eventId,providerName:e.providerName})}stop(e){this.logDispatch("stop",e);let r=AI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=AI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=AI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=AI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=AI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=AI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=AI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=AI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=AI(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=AI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{uqi.info(this.ctx,`${dqi}.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 Akc=S.Union([S.String(),S.Number()]),wi=S.String(),EEe=S.Optional(S.String()),ykc=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())}),B4r=S.Array(ykc),l3e=S.Union([S.Literal("default"),S.Literal("long_context")]),_Ee=S.Object({model:S.Optional(S.String()),reasoningEffort:EEe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(B4r),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()),mcpDirectory:S.Optional(S.String())});async function _i(t){try{return[await t(),null]}catch(e){let r=Mrt(e),n=e instanceof UJ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(_i,"withServiceErrorHandling");var fqi=new fe("BackgroundAgent.compactHistory"),Ekc=S.Object({sessionId:wi});async function F4r(t,e,r){fqi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Hs),o=e.onCancellationRequested(()=>{fqi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await _i(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(F4r,"handleBackgroundAgentCompactHistoryChecked");var Eth=Oe(Ekc,F4r);p();var U4r=S.Union(Object.values(Ap).map(t=>S.Literal(t))),Fl=S.Optional(U4r),k1t=S.Intersect([_Ee,S.Object({agentProvider:Fl})]);var pqi=new fe("BackgroundAgent.compactHistory"),_kc=S.Object({sessionId:wi,agentProvider:Fl});async function vkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return F4r(t,e,r);pqi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.compactHistory(s,e);return pqi.info(t,"compactHistory succeeded"),c})}a(vkc,"handleAgentCompactHistoryChecked");var hqi=Oe(_kc,vkc);p();p();var mqi=new fe("BackgroundAgent.create"),Ckc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),_Ee]);async function Q4r(t,e,r){mqi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Hs),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,mcpDirectory:r.mcpDirectory};return _i(async()=>{let s=await n.createSession(o);return mqi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(Q4r,"handleBackgroundAgentCreateChecked");var Wth=Oe(Ckc,Q4r);var gqi=new fe("BackgroundAgent.create"),bkc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),k1t]);async function Skc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Q4r(t,e,r);gqi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.create(s);return gqi.info(t,"create succeeded:",c.sessionId),c})}a(Skc,"handleAgentCreateChecked");var Aqi=Oe(bkc,Skc);p();p();var Tkc=S.Object({sessionId:wi});async function q4r(t,e,r){let n=t.get(Hs);return _i(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(q4r,"handleBackgroundAgentDestroyChecked");var prh=Oe(Tkc,q4r);var Ikc=new fe("BackgroundAgent.destroy"),xkc=S.Object({sessionId:wi,agentProvider:Fl});async function wkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return q4r(t,e,r);Ikc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.destroy(s))}a(wkc,"handleAgentDestroyChecked");var yqi=Oe(xkc,wkc);p();p();var Rkc=new fe("BackgroundAgent.disableRemote"),kkc=S.Object({sessionId:wi});async function j4r(t,e,r){Rkc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(j4r,"handleBackgroundAgentDisableRemoteChecked");var Mrh=Oe(kkc,j4r);var Eqi=new fe("BackgroundAgent.disableRemote"),Pkc=S.Object({sessionId:wi,agentProvider:Fl});async function Dkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j4r(t,e,r);Eqi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.disableRemote(s);return Eqi.info(t,"disableRemote succeeded"),c})}a(Dkc,"handleAgentDisableRemoteChecked");var _qi=Oe(Pkc,Dkc);p();p();var Nkc=new fe("BackgroundAgent.enableRemote"),Mkc=S.Object({sessionId:wi});async function H4r(t,e,r){Nkc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>n.enableRemote(r.sessionId))}a(H4r,"handleBackgroundAgentEnableRemoteChecked");var tnh=Oe(Mkc,H4r);var vqi=new fe("BackgroundAgent.enableRemote"),Okc=S.Object({sessionId:wi,agentProvider:Fl});async function Lkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return H4r(t,e,r);vqi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.enableRemote(s);return vqi.info(t,"enableRemote succeeded"),c})}a(Lkc,"handleAgentEnableRemoteChecked");var Cqi=Oe(Okc,Lkc);p();p();var Bkc=S.Object({sessionId:wi});async function G4r(t,e,r){let n=t.get(Hs);return _i(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(G4r,"handleBackgroundAgentGetPlanPathChecked");var vnh=Oe(Bkc,G4r);var Fkc=new fe("BackgroundAgent.getPlanPath"),Ukc=S.Object({sessionId:wi,agentProvider:Fl});async function Qkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G4r(t,e,r);Fkc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getPlanPath(s))}a(Qkc,"handleAgentGetPlanPathChecked");var bqi=Oe(Ukc,Qkc);p();p();var qkc=new fe("BackgroundAgent.getRemoteStatus"),jkc=S.Object({sessionId:wi});async function $4r(t,e,r){qkc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a($4r,"handleBackgroundAgentGetRemoteStatusChecked");var jnh=Oe(jkc,$4r);var Hkc=new fe("BackgroundAgent.getRemoteStatus"),Gkc=S.Object({sessionId:wi,agentProvider:Fl});async function $kc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $4r(t,e,r);Hkc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getRemoteStatus(s))}a($kc,"handleAgentGetRemoteStatusChecked");var Sqi=Oe(Gkc,$kc);p();p();var Vkc=new fe("BackgroundAgent.interaction"),Wkc=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()})]),zkc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Ykc=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())])))}),Kkc=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())}),Jkc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),Zkc=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())})]),Xkc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:Wkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:zkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:Ykc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:Kkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:Jkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:Zkc})]);async function V4r(t,e,r){Vkc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Hs);return _i(async()=>await n.handleInteraction(r))}a(V4r,"handleBackgroundAgentInteractionChecked");var lih=Oe(Xkc,V4r);var Tqi=new fe("BackgroundAgent.interaction"),ePc=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()})]),tPc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),rPc=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())])))}),nPc=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())}),iPc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),oPc=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())})]),sPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:ePc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:tPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:rPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:nPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:iPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:oPc,agentProvider:Fl})]);async function aPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return V4r(t,e,r);Tqi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.interaction(s);return Tqi.info(t,"interaction succeeded"),c})}a(aPc,"handleAgentInteractionChecked");var Iqi=Oe(sPc,aPc);p();p();var xqi=new fe("BackgroundAgent.listSessions"),cPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function W4r(t,e,r){xqi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Hs);return _i(async()=>{let o=await n.listSessions(r);return xqi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(W4r,"handleBackgroundAgentSessionsListChecked");var Pih=Oe(cPc,W4r);var wqi=new fe("BackgroundAgent.listSessions"),lPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Fl});async function uPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return W4r(t,e,r);wqi.info(t,"handleAgentSessionsList called",r);let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listSessions(s);return wqi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(uPc,"handleAgentSessionsListChecked");var Rqi=Oe(lPc,uPc);p();p();var kqi=new fe("BackgroundAgent.listModels"),dPc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function z4r(t,e,r){kqi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Hs);return _i(async()=>{let o=await n.listModels(r.forceRefresh);return kqi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(z4r,"handleBackgroundAgentListModelsChecked");var Xih=Oe(dPc,z4r);var Pqi=new fe("BackgroundAgent.listModels"),fPc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Fl});async function pPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return z4r(t,e,r);Pqi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listModels(s);return Pqi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(pPc,"handleAgentListModelsChecked");var Dqi=Oe(fPc,pPc);p();p();var Nqi=new fe("BackgroundAgent.resume"),hPc=S.Intersect([S.Object({sessionId:wi}),_Ee]);async function Y4r(t,e,r){Nqi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Hs),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,mcpDirectory:r.mcpDirectory};return _i(async()=>{let s=await n.resumeSession(o);return Nqi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(Y4r,"handleBackgroundAgentResumeChecked");var _oh=Oe(hPc,Y4r);var Mqi=new fe("BackgroundAgent.resume"),mPc=S.Intersect([S.Object({sessionId:wi}),k1t]);async function gPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Y4r(t,e,r);Mqi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.resume(s);return Mqi.info(t,"resume succeeded:",c.sessionId),c})}a(gPc,"handleAgentResumeChecked");var Oqi=Oe(mPc,gPc);p();p();var APc=S.String(),P1t=["interactive","plan","autopilot"],yPc=S.Union(P1t.map(t=>S.Literal(t))),EPc=S.String({minLength:1}),_Pc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(APc),reasoningEffort:EEe,references:S.Optional(S.Array(OO)),agentMode:S.Optional(yPc),chatMode:S.Optional(EPc),contextTier:S.Optional(l3e),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function K4r(t,e,r){let n=t.get(Hs),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 _i(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(K4r,"handleBackgroundAgentSendChecked");var joh=Oe(_Pc,K4r);var Lqi=new fe("BackgroundAgent.send"),vPc=S.String(),CPc=S.String(),bPc=S.String({minLength:1}),SPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(vPc),reasoningEffort:EEe,references:S.Optional(S.Array(OO)),agentMode:S.Optional(CPc),chatMode:S.Optional(bPc),contextTier:S.Optional(l3e),agentProvider:Fl});async function TPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!P1t.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${P1t.join(", ")}.`}]:K4r(t,e,{...r,agentMode:r.agentMode});Lqi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.send(s,e);return Lqi.info(t,"resume succeeded:",c.messageId),c})}a(TPc,"handleAgentSendChecked");var Bqi=Oe(SPc,TPc);p();p();var IPc=new fe("BackgroundAgent.stop"),xPc=S.Object({sessionId:wi});async function J4r(t,e,r){IPc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(J4r,"handleBackgroundAgentStopChecked");var dsh=Oe(xPc,J4r);var wPc=new fe("BackgroundAgent.stop"),RPc=S.Object({sessionId:wi,agentProvider:Fl});async function kPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await J4r(t,e,r);return c?[null,c]:[void 0,null]}wPc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.stop(s))}a(kPc,"handleAgentStopChecked");var Fqi=Oe(RPc,kPc);p();var PPc=S.Object({sessionId:wi,eventId:S.String(),agentProvider:U4r});async function DPc(t,e,r){let n=t.get(fc),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return _i(async()=>n.truncateHistory(o))}a(DPc,"handleAgentTruncateHistoryChecked");var Uqi=Oe(PPc,DPc);p();var NPc=S.Object({});async function MPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(MPc,"handleListAvailableTokensChecked");var Qqi=Oe(NPc,MPc);p();var OPc=S.Object({tokenId:S.Number()});async function LPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(LPc,"handleUseExistingTokenChecked");var qqi=Oe(OPc,LPc);p();var BPc=S.Object({providerName:S.String()});async function FPc(t,e,r){try{let{providerName:n}=r,o=pO(n);if(o!==0)return[null,{code:Ze.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new da(t.get(Yn));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),await s.deleteProviderConfig(n),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(FPc,"handleBYOKDeleteApiKeyChecked");var jqi=Oe(BPc,FPc);p();var UPc=S.Object({providerName:S.String(),modelId:S.String()});async function QPc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,modelId:s}=r,c=pO(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:Ze.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(QPc,"handleBYOKDeleteModelChecked");var Hqi=Oe(UPc,QPc);p();var qPc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),Gqi="-api-key";async function jPc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(io.Azure))),s=new Set(Object.values(io).filter(u=>u!==io.Azure)),c=`${io.Azure}-`,l=[];for(let u of r){if(!u.endsWith(Gqi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-Gqi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:io.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(jPc,"listAllApiKeys");async function HPc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await jPc(n,t.get(Yn))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(HPc,"handleBYOKListApiKeysChecked");var $qi=Oe(qPc,HPc);p();var GPc=S.Object({providerName:S.Optional(S.String())});async function $Pc(t,e,r){try{let n=new da(t.get(Yn)),o=r.providerName?[r.providerName]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,groupName:l?.groupName,apiType:l?.apiType})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a($Pc,"handleBYOKListCustomProviderConfigsChecked");var Vqi=Oe(GPc,$Pc);p();p();p();qLr();var USt=class extends Zx{static{a(this,"AnthropicProvider")}constructor(e){super(io.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new BL({apiKey:e,fetch:zDc(this.ctx.get(tr))});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 rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function zDc(t){return async(e,r)=>{let n=YDc(e,r),o=JDc(r),s=await t.fetch(n,o);return XDc(s)}}a(zDc,"createAnthropicFetchAdapter");function YDc(t,e){return t instanceof Request?(KDc(t,e),t.url):t instanceof URL?t.toString():t}a(YDc,"convertInputToString");function KDc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(KDc,"mergeRequestInit");function JDc(t){let e;return t?.headers&&(e=ZDc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(JDc,"convertToFetchOptions");function ZDc(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(ZDc,"convertHeaders");async function XDc(t){let e=t.body(),r=null;if(e)r=eNc(e);else{let n=await t.text();r=rNc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(XDc,"convertToWebResponse");function eNc(t){return new ReadableStream({start(e){let r=tNc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(eNc,"createReadableStreamFromNodeStream");function tNc(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(tNc,"setupStreamHandlers");function rNc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(rNc,"createReadableStreamFromText");p();var QSt=class extends Zx{static{a(this,"GeminiProvider")}constructor(e){super(io.Gemini,e)}};p();var qSt=class extends Zx{static{a(this,"GroqProvider")}constructor(e){super(io.Groq,e)}};p();var jSt=class extends Zx{static{a(this,"OpenAIProvider")}constructor(e){super(io.OpenAI,e)}};p();var hGi=16e3,HSt=class extends Zx{static{a(this,"OpenRouterProvider")}constructor(e){super(io.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(tr).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-hGi),maxOutputTokens:hGi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var wie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[io.OpenAI,new jSt(e)],[io.Gemini,new QSt(e)],[io.Groq,new qSt(e)],[io.OpenRouter,new HSt(e)],[io.Anthropic,new USt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var nNc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function iNc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new da(t.get(Yn)),c=[];if(n)if(o){if(!jle(n))return[null,{code:Ze.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ze.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(wie).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=await s.listAllProviderNames();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:Ze.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(iNc,"handleBYOKListModelsChecked");var mGi=Oe(nNc,iNc);p();var oNc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function sNc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,apiKey:s,modelId:c}=r,l=pO(o);if(l===1&&!c)return[null,{code:Ze.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:Ze.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(sNc,"handleBYOKSaveApiKeyChecked");var gGi=Oe(oNc,sNc);p();var aNc=S.Object({providerName:S.String(),apiKey:S.String(),groupName:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function cNc(t,e,r){try{let n=r.providerName,{apiKey:o,groupName:s,apiType:c}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!o)return[null,{code:Ze.InvalidRequest,message:"API key must not be empty."}];if(!vK(n))return[null,{code:Ze.InvalidRequest,message:`Provider '${n}' is a built-in provider; custom provider config is only supported for user-named providers.`}];let l=new da(t.get(Yn));return await l.storeAPIKey(n,o,pO(n)),await l.saveProviderConfig(n,{groupName:s,apiType:c}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(cNc,"handleBYOKSaveCustomProviderConfigChecked");var AGi=Oe(aNc,cNc);p();var lNc=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 uNc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new da(t.get(Yn)),h=pO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(vK(n)){if(!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for custom endpoint provider '${n}'`}];if(!await f.getProviderConfig(n))return[null,{code:Ze.InvalidRequest,message:`Custom endpoint provider '${n}' must be configured via saveCustomProviderConfig before registering models.`}]}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:Ze.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(uNc,"handleBYOKSaveModelChecked");var yGi=Oe(lNc,uNc);p();var dNc=S.Object({cliPath:S.String()});async function fNc(t,e,r){return[await Xhe.check(r.cliPath),null]}a(fNc,"handleCheckClaudeCliCompatibilityChecked");var EGi=Oe(dNc,fNc);p();p();var vGi=de(AP()),_Gi="0.135.0",GSt=new Zhe({displayName:"Codex CLI",notConfiguredMessage:"Codex CLI path is not configured. Install the Codex CLI (e.g. `npm install -g @openai/codex`), then set the Codex CLI Path in your editor's Copilot settings to the absolute path of the `codex` binary.",validateVersion(t,e){if(vGi.lt(t,_Gi))return{severity:"error",message:`Codex CLI at "${e}" reports version ${t.version}, but version ${_Gi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var pNc=S.Object({cliPath:S.String()});async function hNc(t,e,r){return[await GSt.check(r.cliPath),null]}a(hNc,"handleCheckCodexCliCompatibilityChecked");var CGi=Oe(pNc,hNc);p();var mNc=S.Object({uri:S.String({minLength:1})});async function gNc(t,e,r){let n=await t.get(ii).getOrReadTextDocument(r);return[{status:td(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(gNc,"handleCheckFileStatusChecked");var bGi=Oe(mNc,gNc);p();var ANc=S.Object({});function SGi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(SGi,"calculatePercentRemaining");function GBr(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(GBr,"buildQuotaSnapshot");async function yNc(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await cbe(t,n);if(o.ok){let s=await o.json();return t.get(Au).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:GBr(s.quota_snapshots?.chat),completions:GBr(s.quota_snapshots?.completions),premiumInteractions:GBr(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:SGi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:SGi(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:Ze.InternalError,message:"Failed to fetch quota info"}]}a(yNc,"handleCheckQuotaChecked");var TGi=Oe(ANc,yNc);p();var ENc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function _Nc(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(_Nc,"handleCheckStatusChecked");var IGi=Oe(ENc,_Nc);p();var vNc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function CNc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new Zh(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return At(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(Vn(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(CNc,"handleCloudAgentAddPullRequestCommentChecked");var xGi=Oe(vNc,CNc);p();var bNc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function SNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ze.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new Zh(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(qa(t,n,"githubApi.cancelCodingAgent"),Vn(t,"githubApi.cancelCodingAgent",n),n instanceof tw)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(SNc,"handleCancelCodingAgentChecked");var wGi=Oe(bNc,SNc);p();var TNc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Bc))});function INc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(INc,"pickWorkspaceFolder");async function xNc(t,e,r){try{let n=INc(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new _f(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ze.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ze.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new kO([new PO,new DO]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ze.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=hue(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new HC(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return At(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(Vn(t,"cloudAgent.createJob",n,{result:"error"}),exe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(xNc,"handleCloudAgentCreateJobChecked");var RGi=Oe(TNc,xNc);p();var wNc=S.Object({sessionId:S.String({minLength:1})});async function RNc(t,e,r){try{let o=await new HC(t).getSessionLogs(r.sessionId,e);return At(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(Vn(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(RNc,"handleCloudAgentGetSessionLogsChecked");var kGi=Oe(wNc,RNc);p();var kNc=S.Object({pullRequestId:S.Integer()});async function PNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);return At(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(Vn(t,"cloudAgent.listSessions",n),n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(PNc,"handleCloudAgentListSessionsChecked");var PGi=Oe(kNc,PNc);p();var DNc=S.Object({});async function NNc(t,e,r){return[(await ew(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(NNc,"handleConversationAgentsChecked");var DGi=Oe(DNc,NNc);p();p();var Y3e=de(Xc());function MNc(t,e,r){let n=Wt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return Et(t,"getCompletions.docVersionMismatch",n)}a(MNc,"telemetryVersionMismatch");async function P9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new Y3e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Ble(t,e,o.getText());if(s.status==="invalid")throw t.get(ps).setClsInactive(s.reason),new Y3e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(MNc(t,o,e.version),$o.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new Y3e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(P9,"getTextDocument");async function FL(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await P9(t,n,r)}catch(o){if(o instanceof Y3e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){$o.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(FL,"getTextDocumentIfAvailable");var ONc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),LNc=S.Object({turnId:WK,codeBlockIndex:S.Number(),source:ONc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(gJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function BNc(t,e,r){let n=await FL(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=nq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return HS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${aE(c)}.acceptedCopy`,u),["OK",null]}a(BNc,"handleConversationCodeCopyChecked");var NGi=Oe(LNc,BNc);p();var FNc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),UNc=S.Object({turnId:WK,source:FNc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(gJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function QNc(t,e,r){let n=await FL(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=nq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return HS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` +`})}s.push({type:"text",text:e.message});let c=e.model||o.model,l=await this.processManager.sendRequest("turn/start",{...c?{model:c}:{},threadId:o.threadId,input:s});return o.turnId=l.turnId,e.model&&(o.model=e.model),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:l.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);!r||!r.turnId||(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),iA.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e}))}destroySession(e){return this.sessions.delete(e.sessionId),iA.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>{let o;if(n.workspacePath)try{o=new URL(n.workspacePath).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{o=n.workspacePath}return{sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:o?{cwd:o}:void 0}});return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),iA.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(xs).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(D$e.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map((c,l)=>({id:c.id,name:c.name,vendor:c.vendor,preview:c.preview??!1,isDefault:c.is_chat_default??l===0,modelPickerEnabled:c.model_picker_enabled,modelPickerCategory:c.model_picker_category,modelPickerPriceCategory:c.model_picker_price_category,capabilities:{family:c.capabilities.family,supports:{vision:c.capabilities.supports?.vision??!1,reasoningEfforts:c.capabilities.supports?.reasoning_effort},limits:c.capabilities.limits?{max_context_window_tokens:c.capabilities.limits.max_context_window_tokens,max_output_tokens:c.capabilities.limits.max_output_tokens}:{max_context_window_tokens:128e3}},billing:c.billing?{isPremium:c.billing.is_premium??!0,multiplier:c.billing.multiplier??0}:void 0,policy:c.policy}));return iA.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}iA.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);iA.warn(this.ctx,`CodexAgentService.listModels: CAPI query failed: ${n}, using fallback`)}return{models:[{id:"codex-default",name:"Codex (Default)",preview:!1,capabilities:{family:"codex",supports:{vision:!1},limits:{max_context_window_tokens:128e3}}}]}}handleInteraction(e){return Promise.reject(new Error("Codex interaction handling not yet implemented"))}getPlanPath(e){return Promise.resolve(null)}async enableRemote(e){await this.ensureInitialized();try{return await this.processManager.sendRequest("remoteControl/enable",{}),{remoteSteerable:!0}}catch{throw new Error("Codex remote control not available")}}async disableRemote(e){await this.ensureInitialized(),await this.processManager.sendRequest("remoteControl/disable",{})}getRemoteStatus(e){return{remoteSteerable:!1}}async compactHistory(e){await this.ensureInitialized();let r=this.sessions.get(e);return r?(await this.processManager.sendRequest("thread/compact/start",{threadId:r.threadId}),{success:!0,tokensRemoved:0,messagesRemoved:0,summaryContent:""}):{success:!1,tokensRemoved:0,messagesRemoved:0,summaryContent:""}}async stopCompactHistory(e){let r=this.sessions.get(e);return!r||!r.turnId?{aborted:!1}:(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),{aborted:!0})}handleNotification(e,r){iA.info(this.ctx,`handleNotification: method=${e}`,{params:JSON.stringify(r).slice(0,500)});let o=r?.threadId;if(!o){iA.warn(this.ctx,`handleNotification: no threadId in params for method=${e}`);return}let s=this.findSessionByThreadId(o);if(!s)return;if(e==="turn/started"){let u=r;u.turn?.id&&(s.turnId=u.turn.id)}let c=Aqi(e,r,s.translatorState);if(!c)return;let l=Array.isArray(c)?c:[c];for(let u of l)u.type==="assistant.usage"&&u.data&&s.model&&(u.data.model=s.model),this.notificationSender.sendBackgroundAgentSessionUpdate(s.sessionId,u,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitErrorToAllSessions(e){for(let r of this.sessions.values()){let n={id:Mt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:"process_crash",message:`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`}};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,n,"CODEX");let o={id:Mt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,o,"CODEX")}}async dispose(){await this.processManager?.stop(),await this.proxyServer.stop()}};var Eqi=new fe("AgentRouter"),_qi="AgentRouter";function EI(t){return t.agentProvider??"BACKGROUND"}a(EI,"resolveProvider");var fc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Hs);case"CLAUDE":return this.ctx.get(_8);case"CODEX":return this.ctx.get(lie);case"CLOUD":return this.ctx.get(cie)}}logDispatch(e,r){Eqi.debug(this.ctx,`${_qi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=EI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=EI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=EI(e);return this.serviceFor(n).sendMessage(e,r)}truncateHistory(e){this.logDispatch("truncateHistory",e);let r=e.providerName;return this.serviceFor(r).truncateHistory({sessionId:e.sessionId,eventId:e.eventId,providerName:e.providerName})}stop(e){this.logDispatch("stop",e);let r=EI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=EI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=EI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=EI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=EI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=EI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=EI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=EI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=EI(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=EI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{Eqi.info(this.ctx,`${_qi}.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 Nkc=S.Union([S.String(),S.Number()]),wi=S.String(),vEe=S.Optional(S.String()),Mkc=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())}),q4r=S.Array(Mkc),h3e=S.Union([S.Literal("default"),S.Literal("long_context")]),CEe=S.Object({model:S.Optional(S.String()),reasoningEffort:vEe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(q4r),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()),mcpDirectory:S.Optional(S.String())});async function _i(t){try{return[await t(),null]}catch(e){let r=Qrt(e),n=e instanceof qJ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(_i,"withServiceErrorHandling");var vqi=new fe("BackgroundAgent.compactHistory"),Okc=S.Object({sessionId:wi});async function j4r(t,e,r){vqi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Hs),o=e.onCancellationRequested(()=>{vqi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await _i(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(j4r,"handleBackgroundAgentCompactHistoryChecked");var qth=Ne(Okc,j4r);p();var H4r=S.Union(Object.values(Ep).map(t=>S.Literal(t))),Ul=S.Optional(H4r),M1t=S.Intersect([CEe,S.Object({agentProvider:Ul})]);var Cqi=new fe("BackgroundAgent.compactHistory"),Lkc=S.Object({sessionId:wi,agentProvider:Ul});async function Bkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j4r(t,e,r);Cqi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.compactHistory(s,e);return Cqi.info(t,"compactHistory succeeded"),c})}a(Bkc,"handleAgentCompactHistoryChecked");var bqi=Ne(Lkc,Bkc);p();p();var Sqi=new fe("BackgroundAgent.create"),Fkc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),CEe]);async function G4r(t,e,r){Sqi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Hs),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,mcpDirectory:r.mcpDirectory};return _i(async()=>{let s=await n.createSession(o);return Sqi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(G4r,"handleBackgroundAgentCreateChecked");var mrh=Ne(Fkc,G4r);var Tqi=new fe("BackgroundAgent.create"),Ukc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),M1t]);async function Qkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G4r(t,e,r);Tqi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.create(s);return Tqi.info(t,"create succeeded:",c.sessionId),c})}a(Qkc,"handleAgentCreateChecked");var Iqi=Ne(Ukc,Qkc);p();p();var qkc=S.Object({sessionId:wi});async function $4r(t,e,r){let n=t.get(Hs);return _i(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a($4r,"handleBackgroundAgentDestroyChecked");var Orh=Ne(qkc,$4r);var jkc=new fe("BackgroundAgent.destroy"),Hkc=S.Object({sessionId:wi,agentProvider:Ul});async function Gkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $4r(t,e,r);jkc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.destroy(s))}a(Gkc,"handleAgentDestroyChecked");var xqi=Ne(Hkc,Gkc);p();p();var $kc=new fe("BackgroundAgent.disableRemote"),Vkc=S.Object({sessionId:wi});async function V4r(t,e,r){$kc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(V4r,"handleBackgroundAgentDisableRemoteChecked");var rnh=Ne(Vkc,V4r);var wqi=new fe("BackgroundAgent.disableRemote"),Wkc=S.Object({sessionId:wi,agentProvider:Ul});async function zkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return V4r(t,e,r);wqi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.disableRemote(s);return wqi.info(t,"disableRemote succeeded"),c})}a(zkc,"handleAgentDisableRemoteChecked");var Rqi=Ne(Wkc,zkc);p();p();var Ykc=new fe("BackgroundAgent.enableRemote"),Kkc=S.Object({sessionId:wi});async function W4r(t,e,r){Ykc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>n.enableRemote(r.sessionId))}a(W4r,"handleBackgroundAgentEnableRemoteChecked");var bnh=Ne(Kkc,W4r);var kqi=new fe("BackgroundAgent.enableRemote"),Jkc=S.Object({sessionId:wi,agentProvider:Ul});async function Zkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return W4r(t,e,r);kqi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.enableRemote(s);return kqi.info(t,"enableRemote succeeded"),c})}a(Zkc,"handleAgentEnableRemoteChecked");var Pqi=Ne(Jkc,Zkc);p();p();var Xkc=S.Object({sessionId:wi});async function z4r(t,e,r){let n=t.get(Hs);return _i(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(z4r,"handleBackgroundAgentGetPlanPathChecked");var Hnh=Ne(Xkc,z4r);var ePc=new fe("BackgroundAgent.getPlanPath"),tPc=S.Object({sessionId:wi,agentProvider:Ul});async function rPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return z4r(t,e,r);ePc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getPlanPath(s))}a(rPc,"handleAgentGetPlanPathChecked");var Dqi=Ne(tPc,rPc);p();p();var nPc=new fe("BackgroundAgent.getRemoteStatus"),iPc=S.Object({sessionId:wi});async function Y4r(t,e,r){nPc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(Y4r,"handleBackgroundAgentGetRemoteStatusChecked");var uih=Ne(iPc,Y4r);var oPc=new fe("BackgroundAgent.getRemoteStatus"),sPc=S.Object({sessionId:wi,agentProvider:Ul});async function aPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Y4r(t,e,r);oPc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getRemoteStatus(s))}a(aPc,"handleAgentGetRemoteStatusChecked");var Nqi=Ne(sPc,aPc);p();p();var cPc=new fe("BackgroundAgent.interaction"),lPc=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()})]),uPc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),dPc=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())])))}),fPc=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())}),pPc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),hPc=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())})]),mPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:lPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:uPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:dPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:fPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:pPc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:hPc})]);async function K4r(t,e,r){cPc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Hs);return _i(async()=>await n.handleInteraction(r))}a(K4r,"handleBackgroundAgentInteractionChecked");var Pih=Ne(mPc,K4r);var Mqi=new fe("BackgroundAgent.interaction"),gPc=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()})]),APc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),yPc=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())])))}),EPc=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())}),_Pc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),vPc=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())})]),CPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:gPc,agentProvider:Ul}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:APc,agentProvider:Ul}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:yPc,agentProvider:Ul}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:EPc,agentProvider:Ul}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:_Pc,agentProvider:Ul}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:vPc,agentProvider:Ul})]);async function bPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return K4r(t,e,r);Mqi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.interaction(s);return Mqi.info(t,"interaction succeeded"),c})}a(bPc,"handleAgentInteractionChecked");var Oqi=Ne(CPc,bPc);p();p();var Lqi=new fe("BackgroundAgent.listSessions"),SPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function J4r(t,e,r){Lqi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Hs);return _i(async()=>{let o=await n.listSessions(r);return Lqi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(J4r,"handleBackgroundAgentSessionsListChecked");var Xih=Ne(SPc,J4r);var Bqi=new fe("BackgroundAgent.listSessions"),TPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Ul});async function IPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return J4r(t,e,r);Bqi.info(t,"handleAgentSessionsList called",r);let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listSessions(s);return Bqi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(IPc,"handleAgentSessionsListChecked");var Fqi=Ne(TPc,IPc);p();p();var Uqi=new fe("BackgroundAgent.listModels"),xPc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function Z4r(t,e,r){Uqi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Hs);return _i(async()=>{let o=await n.listModels(r.forceRefresh);return Uqi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(Z4r,"handleBackgroundAgentListModelsChecked");var voh=Ne(xPc,Z4r);var Qqi=new fe("BackgroundAgent.listModels"),wPc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Ul});async function RPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Z4r(t,e,r);Qqi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listModels(s);return Qqi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(RPc,"handleAgentListModelsChecked");var qqi=Ne(wPc,RPc);p();p();var jqi=new fe("BackgroundAgent.resume"),kPc=S.Intersect([S.Object({sessionId:wi}),CEe]);async function X4r(t,e,r){jqi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Hs),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,mcpDirectory:r.mcpDirectory};return _i(async()=>{let s=await n.resumeSession(o);return jqi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(X4r,"handleBackgroundAgentResumeChecked");var joh=Ne(kPc,X4r);var Hqi=new fe("BackgroundAgent.resume"),PPc=S.Intersect([S.Object({sessionId:wi}),M1t]);async function DPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return X4r(t,e,r);Hqi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.resume(s);return Hqi.info(t,"resume succeeded:",c.sessionId),c})}a(DPc,"handleAgentResumeChecked");var Gqi=Ne(PPc,DPc);p();p();var NPc=S.String(),O1t=["interactive","plan","autopilot"],MPc=S.Union(O1t.map(t=>S.Literal(t))),OPc=S.String({minLength:1}),LPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(NPc),reasoningEffort:vEe,references:S.Optional(S.Array(BO)),agentMode:S.Optional(MPc),chatMode:S.Optional(OPc),contextTier:S.Optional(h3e),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function eLr(t,e,r){let n=t.get(Hs),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 _i(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(eLr,"handleBackgroundAgentSendChecked");var ush=Ne(LPc,eLr);var $qi=new fe("BackgroundAgent.send"),BPc=S.String(),FPc=S.String(),UPc=S.String({minLength:1}),QPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(BPc),reasoningEffort:vEe,references:S.Optional(S.Array(BO)),agentMode:S.Optional(FPc),chatMode:S.Optional(UPc),contextTier:S.Optional(h3e),agentProvider:Ul});async function qPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!O1t.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${O1t.join(", ")}.`}]:eLr(t,e,{...r,agentMode:r.agentMode});$qi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.send(s,e);return $qi.info(t,"resume succeeded:",c.messageId),c})}a(qPc,"handleAgentSendChecked");var Vqi=Ne(QPc,qPc);p();p();var jPc=new fe("BackgroundAgent.stop"),HPc=S.Object({sessionId:wi});async function tLr(t,e,r){jPc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(tLr,"handleBackgroundAgentStopChecked");var Nsh=Ne(HPc,tLr);var GPc=new fe("BackgroundAgent.stop"),$Pc=S.Object({sessionId:wi,agentProvider:Ul});async function VPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await tLr(t,e,r);return c?[null,c]:[void 0,null]}GPc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.stop(s))}a(VPc,"handleAgentStopChecked");var Wqi=Ne($Pc,VPc);p();var WPc=S.Object({sessionId:wi,eventId:S.String(),agentProvider:H4r});async function zPc(t,e,r){let n=t.get(fc),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return _i(async()=>n.truncateHistory(o))}a(zPc,"handleAgentTruncateHistoryChecked");var zqi=Ne(WPc,zPc);p();var YPc=S.Object({});async function KPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Lr).listAvailableTokens()},null]}a(KPc,"handleListAvailableTokensChecked");var Yqi=Ne(YPc,KPc);p();var JPc=S.Object({tokenId:S.Number()});async function ZPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:(await t.get(Lr).revokeTokenById(r.tokenId,"user_action"),[null,null])}a(ZPc,"handleRemoveTokenChecked");var Kqi=Ne(JPc,ZPc);p();var XPc=S.Object({tokenId:S.Number()});async function e2c(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Lr).useExistingToken(r.tokenId),null]}a(e2c,"handleUseExistingTokenChecked");var Jqi=Ne(XPc,e2c);p();var t2c=S.Object({providerName:S.String()});async function r2c(t,e,r){try{let{providerName:n}=r,o=mO(n);if(o!==0)return[null,{code:Ze.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new Ga(t.get(ti));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),await s.deleteProviderConfig(n),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(r2c,"handleBYOKDeleteApiKeyChecked");var Zqi=Ne(t2c,r2c);p();var n2c=S.Object({providerName:S.String(),modelId:S.String()});async function i2c(t,e,r){try{let n=new Ga(t.get(ti)),{providerName:o,modelId:s}=r,c=mO(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:Ze.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(i2c,"handleBYOKDeleteModelChecked");var Xqi=Ne(n2c,i2c);p();var o2c=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),eji="-api-key";async function s2c(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(io.Azure))),s=new Set(Object.values(io).filter(u=>u!==io.Azure)),c=`${io.Azure}-`,l=[];for(let u of r){if(!u.endsWith(eji))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-eji.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:io.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(s2c,"listAllApiKeys");async function a2c(t,e,r){try{let n=new Ga(t.get(ti)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await s2c(n,t.get(ti))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(a2c,"handleBYOKListApiKeysChecked");var tji=Ne(o2c,a2c);p();var c2c=S.Object({providerName:S.Optional(S.String())});async function l2c(t,e,r){try{let n=new Ga(t.get(ti)),o=r.providerName?[r.providerName]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,groupName:l?.groupName,apiType:l?.apiType})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a(l2c,"handleBYOKListCustomProviderConfigsChecked");var rji=Ne(c2c,l2c);p();p();p();$Lr();var HSt=class extends ew{static{a(this,"AnthropicProvider")}constructor(e){super(io.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new Ga(this.ctx.get(ti)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new FL({apiKey:e,fetch:fNc(this.ctx.get(nr))});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 aYe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function fNc(t){return async(e,r)=>{let n=pNc(e,r),o=mNc(r),s=await t.fetch(n,o);return ANc(s)}}a(fNc,"createAnthropicFetchAdapter");function pNc(t,e){return t instanceof Request?(hNc(t,e),t.url):t instanceof URL?t.toString():t}a(pNc,"convertInputToString");function hNc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(hNc,"mergeRequestInit");function mNc(t){let e;return t?.headers&&(e=gNc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(mNc,"convertToFetchOptions");function gNc(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(gNc,"convertHeaders");async function ANc(t){let e=t.body(),r=null;if(e)r=yNc(e);else{let n=await t.text();r=_Nc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(ANc,"convertToWebResponse");function yNc(t){return new ReadableStream({start(e){let r=ENc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(yNc,"createReadableStreamFromNodeStream");function ENc(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(ENc,"setupStreamHandlers");function _Nc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(_Nc,"createReadableStreamFromText");p();var GSt=class extends ew{static{a(this,"GeminiProvider")}constructor(e){super(io.Gemini,e)}};p();var $St=class extends ew{static{a(this,"GroqProvider")}constructor(e){super(io.Groq,e)}};p();var VSt=class extends ew{static{a(this,"OpenAIProvider")}constructor(e){super(io.OpenAI,e)}};p();var SGi=16e3,WSt=class extends ew{static{a(this,"OpenRouterProvider")}constructor(e){super(io.OpenRouter,e)}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}resolveModelCapabilities(e){let r=e,n=r.top_provider?.context_length;if(typeof r.name!="string"||typeof n!="number")return;let o=r.supported_parameters??[],s=o.includes("reasoning")||o.includes("reasoning_effort")?["low","medium","high"]:void 0;return{name:r.name,maxInputTokens:Math.max(0,n-SGi),maxOutputTokens:SGi,toolCalling:o.includes("tools"),vision:r.architecture?.input_modalities?.includes("image")??!1,supportsReasoningEffort:s}}};var Rie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[io.OpenAI,new VSt(e)],[io.Gemini,new GSt(e)],[io.Groq,new $St(e)],[io.OpenRouter,new WSt(e)],[io.Anthropic,new HSt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var vNc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});function zBr(t,e){if(!e)return e;let r=nxe(t);return{...e,maxInputTokens:e.maxInputTokens??r.maxInputTokens,maxOutputTokens:e.maxOutputTokens??r.maxOutputTokens}}a(zBr,"withDefaultTokenLimits");async function CNc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new Ga(t.get(ti)),c=[];if(n)if(o){if(!Hle(n))return[null,{code:Ze.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ze.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(Rie).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:zBr(n,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:zBr(n,d.modelCapabilities)})})}else{let l=await s.listAllProviderNames();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:zBr(u,h.modelCapabilities)})})}}return[{models:c},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(CNc,"handleBYOKListModelsChecked");var TGi=Ne(vNc,CNc);p();var bNc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function SNc(t,e,r){try{let n=new Ga(t.get(ti)),{providerName:o,apiKey:s,modelId:c}=r,l=mO(o);if(l===1&&!c)return[null,{code:Ze.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:Ze.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(SNc,"handleBYOKSaveApiKeyChecked");var IGi=Ne(bNc,SNc);p();var TNc=S.Object({providerName:S.String(),apiKey:S.String(),groupName:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function INc(t,e,r){try{let n=r.providerName,{apiKey:o,groupName:s,apiType:c}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!o)return[null,{code:Ze.InvalidRequest,message:"API key must not be empty."}];if(!tq(n))return[null,{code:Ze.InvalidRequest,message:`Provider '${n}' is a built-in provider; custom provider config is only supported for user-named providers.`}];let l=new Ga(t.get(ti));return await l.storeAPIKey(n,o,mO(n)),await l.saveProviderConfig(n,{groupName:s,apiType:c}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(INc,"handleBYOKSaveCustomProviderConfigChecked");var xGi=Ne(TNc,INc);p();var xNc=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 wNc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new Ga(t.get(ti)),h=mO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(tq(n)){if(!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for custom endpoint provider '${n}'`}];if(!await f.getProviderConfig(n))return[null,{code:Ze.InvalidRequest,message:`Custom endpoint provider '${n}' must be configured via saveCustomProviderConfig before registering models.`}]}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:Ze.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(wNc,"handleBYOKSaveModelChecked");var wGi=Ne(xNc,wNc);p();var RNc=S.Object({cliPath:S.String()});async function kNc(t,e,r){return[await tme.check(r.cliPath),null]}a(kNc,"handleCheckClaudeCliCompatibilityChecked");var RGi=Ne(RNc,kNc);p();p();var PGi=de(EP()),kGi="0.135.0",zSt=new eme({displayName:"Codex CLI",notConfiguredMessage:"Codex CLI path is not configured. Install the Codex CLI (e.g. `npm install -g @openai/codex`), then set the Codex CLI Path in your editor's Copilot settings to the absolute path of the `codex` binary.",validateVersion(t,e){if(PGi.lt(t,kGi))return{severity:"error",message:`Codex CLI at "${e}" reports version ${t.version}, but version ${kGi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var PNc=S.Object({cliPath:S.String()});async function DNc(t,e,r){return[await zSt.check(r.cliPath),null]}a(DNc,"handleCheckCodexCliCompatibilityChecked");var DGi=Ne(PNc,DNc);p();var NNc=S.Object({uri:S.String({minLength:1})});async function MNc(t,e,r){let n=await t.get(ni).getOrReadTextDocument(r);return[{status:rd(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(MNc,"handleCheckFileStatusChecked");var NGi=Ne(NNc,MNc);p();var ONc=S.Object({});function MGi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(MGi,"calculatePercentRemaining");function YBr(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(YBr,"buildQuotaSnapshot");async function LNc(t,e,r){let n=await t.get(Lr).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await dbe(t,n);if(o.ok){let s=await o.json();return t.get(Au).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:YBr(s.quota_snapshots?.chat),completions:YBr(s.quota_snapshots?.completions),premiumInteractions:YBr(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:MGi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:MGi(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:Ze.InternalError,message:"Failed to fetch quota info"}]}a(LNc,"handleCheckQuotaChecked");var OGi=Ne(ONc,LNc);p();var BNc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function FNc(t,e,r){return[await t.get(Lr).checkAndUpdateStatus(r.options),null]}a(FNc,"handleCheckStatusChecked");var LGi=Ne(BNc,FNc);p();var UNc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function QNc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new em(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return Rt(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(ai(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof dE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Qd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(QNc,"handleCloudAgentAddPullRequestCommentChecked");var BGi=Ne(UNc,QNc);p();var qNc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function jNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ze.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(At(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),Rt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new em(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),At(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),Rt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(ua(t,n,"githubApi.cancelCodingAgent"),ai(t,"githubApi.cancelCodingAgent",n),n instanceof nw)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof cp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof d0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof dE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Qd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(jNc,"handleCancelCodingAgentChecked");var FGi=Ne(qNc,jNc);p();var HNc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Bc))});function GNc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(GNc,"pickWorkspaceFolder");async function $Nc(t,e,r){try{let n=GNc(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new Cf(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ze.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ze.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new DO([new NO,new MO]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ze.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=mue(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new HC(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return Rt(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(ai(t,"cloudAgent.createJob",n,{result:"error"}),ixe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof nw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof cp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof d0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof dE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Qd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a($Nc,"handleCloudAgentCreateJobChecked");var UGi=Ne(HNc,$Nc);p();var VNc=S.Object({sessionId:S.String({minLength:1})});async function WNc(t,e,r){try{let o=await new HC(t).getSessionLogs(r.sessionId,e);return Rt(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(ai(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof nw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof cp||n instanceof d0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(WNc,"handleCloudAgentGetSessionLogsChecked");var QGi=Ne(VNc,WNc);p();var zNc=S.Object({pullRequestId:S.Integer()});async function YNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);return Rt(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(ai(t,"cloudAgent.listSessions",n),n instanceof nw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof cp||n instanceof d0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(YNc,"handleCloudAgentListSessionsChecked");var qGi=Ne(zNc,YNc);p();var KNc=S.Object({});async function JNc(t,e,r){return[(await rw(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(JNc,"handleConversationAgentsChecked");var jGi=Ne(KNc,JNc);p();p();var eFe=de(Xc());function ZNc(t,e,r){let n=Wt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return At(t,"getCompletions.docVersionMismatch",n)}a(ZNc,"telemetryVersionMismatch");async function N9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new eFe.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Fle(t,e,o.getText());if(s.status==="invalid")throw t.get(ps).setClsInactive(s.reason),new eFe.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(ZNc(t,o,e.version),Vo.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new eFe.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(N9,"getTextDocument");async function UL(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await N9(t,n,r)}catch(o){if(o instanceof eFe.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){Vo.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(UL,"getTextDocumentIfAvailable");var XNc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),eMc=S.Object({turnId:YK,codeBlockIndex:S.Number(),source:XNc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(CJe),textDocument:S.Optional(jC),position:S.Optional(u0),conversationSource:S.Optional(FO)});async function tMc(t,e,r){let n=await UL(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=sq(r.conversationSource),l=t.get(Yo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return $S(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${cE(c)}.acceptedCopy`,u),["OK",null]}a(tMc,"handleConversationCodeCopyChecked");var HGi=Ne(eMc,tMc);p();var rMc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),nMc=S.Object({turnId:YK,source:rMc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(CJe),textDocument:S.Optional(jC),position:S.Optional(u0),conversationSource:S.Optional(FO)});async function iMc(t,e,r){let n=await UL(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=sq(r.conversationSource),l=t.get(Yo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return $S(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=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});Et(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});Et(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});Et(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});Et(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});Et(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});Et(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 WSt=de(Io());var VSt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(WSt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(WSt.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=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});At(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});At(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});At(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});At(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});At(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});At(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 JSt=de(xo());var KSt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(JSt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(JSt.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. @@ -3987,7 +3987,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(aJe({role:"user",content:GS(o.request.message)})),o.response){let s=yO(o.response.message,!0),c=RO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(rw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new p0(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(pJe({role:"user",content:VS(o.request.message)})),o.response){let s=_O(o.response.message,!0),c=PO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(iw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new m0(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. @@ -4005,7 +4005,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}};Mo();var xN=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 ap.create(VSt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=OA.user(o,Mt()),f=JI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(oc)}catch{h=new oc(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=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});Et(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});Et(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});Et(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});Et(this.ctx,"partition.summary.cancelled",s,0)}};var qNc=S.Object({conversationId:S.String()});async function jNc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(bI);HNc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[K3e(n,"Compression cancelled"),null];let c=t.get(zo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),J3e(t,n,0,"Conversation not found",Date.now()-o),[K3e(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}`),J3e(t,n,0,"No turns to compress",Date.now()-o),[K3e(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}`),J3e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[K3e(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(el).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(xN),y=new sk(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 qq().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}),GNc(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}`),J3e(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}`),J3e(t,n,0,l,u),[K3e(n,`Compression failed: ${l}`),null]}}a(jNc,"handleConversationCompressChecked");function K3e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(K3e,"createErrorResult");function HNc(t,e,r,n){let o=Wt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});Et(t,"conversationPartition.manualCompression.started",o,0)}a(HNc,"sendStartedTelemetry");function GNc(t,e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});Et(t,"conversationPartition.manualCompression.completed",u,0)}a(GNc,"sendCompletedTelemetry");function J3e(t,e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});Et(t,"conversationPartition.manualCompression.failed",c,0)}a(J3e,"sendFailedTelemetry");var OGi=Oe(qNc,jNc);p();p();var zSt=S.Array(Sf);function YSt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(YSt,"resolveAsActiveEditor");p();var LGi=de(Xc());var KSt=new LGi.ProgressType,$Br=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new qq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,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(ar).connection.sendProgress(KSt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,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 m_e(t){return new $Br(t.workDoneToken)}a(m_e,"createProgressHandler");p();var BGi=de(Xc());var g_e=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 BGi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function JSt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ji(t.uri)}]}a(JSt,"resolveAsWorkspaceFolders");p();p();var $Nc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),i_=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?$Nc(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 wN=class{constructor(){this.tokens=new Cn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new Fn.CancellationTokenSource,o=new i_([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 FGi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(FGi,"calculateBillingMultiplier");async function ZSt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await xo.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(ZSt,"resolveTurnModelInfo");function XSt(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:FGi(r)}}a(XSt,"buildTurnSummary");p();function eTt(t,e,r,n,o,s){let{properties:c,measurements:l}=WNc(e,r,n,o,s),u=VNc(e,r,n,o,s);Et(t,"conversation.turnCompleted",Wt.createAndMarkAsIssued(u)),At(t,"conversation.turnCompleted",c,l)}a(eTt,"sendTurnTelemetry");function VNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};return ak(s,"chatMode",n.chatMode),ak(s,"conversationSource",o?.conversationSource),s}a(VNc,"buildGithubTurnTelemetryProperties");function WNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};ak(s,"modelName",n.modelName),ak(s,"modelProviderName",n.modelProviderName),ak(s,"userRequestedModel",n.userRequestedModel),ak(s,"reasoningEffort",n.reasoningEffort),ak(s,"chatMode",n.chatMode),ak(s,"agentSlug",n.agentSlug),ak(s,"conversationSource",o?.conversationSource);let c={};return ak(c,"billingMultiplier",n.billingMultiplier),ak(c,"credits",o?.credits),ak(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(WNc,"buildTurnTelemetryData");function tTt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(tTt,"formatCredits");function ak(t,e,r){r!==void 0&&(t[e]=r)}a(ak,"assignDefined");var zNc=S.Object({conversationId:S.Optional(mJe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(zCn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(zSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),source:S.Optional(LO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),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(EJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(_Je)),restoreToTurnId:S.Optional(S.String())});async function YNc(t,e,r){g_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=await t.get(zo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(m0).setTodos(o,r.todoList);let s=await ZSt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await KNc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=m_e(r),d=t.get(wN).add(u.progressToken,e),f=new hw(t,o,l,d),h=await t.get(RN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Au),g=String(l.id);m.resetTurnCredits(g);let A,y=performance.now();try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let E=Math.round(performance.now()-y),_=XSt(l,s);return eTt(t,"conversation/create",o,l,_,{totalTimeMs:E,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:_.agentSlug,modelName:_.modelName,modelProviderName:_.modelProviderName,billingMultiplier:_.billingMultiplier,modelInfo:r.modelInfo,credits:tTt(A),preciseCredits:A},null]}a(YNc,"handleConversationCreateChecked");async function KNc(t,e,r,n,o){for(let s of r.turns){let c=AJe(s.request),l=new Xf({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:JSt(u),f=t.get(j_),h=qQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=YSt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(zo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(KNc,"addTurns");var UGi=Oe(zNc,YNc);p();var JNc=S.Object({conversationId:S.String()});function ZNc(t,e,r){return t.get(zo).destroy(r.conversationId),["OK",null]}a(ZNc,"handleConversationDestroyChecked");var QGi=Oe(JNc,ZNc);p();var XNc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function eMc(t,e,r){return[(await t.get(j_).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(eMc,"handleConversationModesChecked");var qGi=Oe(XNc,eMc);p();var tMc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),rMc=new fe("conversationNotifyCodeAcceptance");async function nMc(t,e,r){let n=t.get(zo).findByTurnId(r.turnId);if(!n)return rMc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await tl(t,n,{languageId:""});return HS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${aE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(nMc,"handleConversationNotifyCodeAcceptanceChecked");var jGi=Oe(tMc,nMc);p();var iMc=S.Object({});function oMc(t,e,r){return[{path:t.get(Yn).directory},null]}a(oMc,"handleConversationPersistenceChecked");var HGi=Oe(iMc,oMc);p();p();var VBr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},WBr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},sMc=[new VBr,new WBr],ck=class{constructor(e,r=sMc){this.ctx=e;this.checks=r;this.emitter=new Wi;this.onChange=this.emitter.event;bs(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 aMc=S.Object({forceCheck:S.Optional(S.Boolean())});async function cMc(t,e,r){let n=r.forceCheck??!1;return[await t.get(ck).check(n),null]}a(cMc,"handleConversationPreconditionsChecked");var GGi=Oe(aMc,cMc);p();var lMc=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional(jC),textDocument:S.Optional(jC),source:S.Optional(LO)});async function uMc(t,e,r){let n=await FL(t,r,e),o=nq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await tl(t,r.turnId?t.get(zo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${aE(o)}.messageRating`,u=HS(t,n,{rating:s,uiKind:o},{},l,c);return ZI(t,l,u),["OK",null]}a(uMc,"handleConversationRatingChecked");var $Gi=Oe(lMc,uMc);p();var dMc=S.Object({tools:S.Array(YCn)});function fMc(t,e,r){let n=t.get(gs);return r.tools.forEach(s=>{n.registerTool(new Xq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(fMc,"conversationRegisterToolsChecked");var VGi=Oe(dMc,fMc);p();var pMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function hMc(t,e,r){let n=v$t(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(Cg),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).map(u=>({id:u.uri,name:u.name,description:u.description||"",shortDescription:"",scopes:mMc(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(h0).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${Ji(uf(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(hMc,"handleConversationTemplatesChecked");function mMc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(mMc,"getCustomPromptScopes");var WGi=Oe(pMc,hMc);p();var gMc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:mJe,turnId:S.Optional(WK),message:Dqt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(zSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Myn,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(EJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(_Je))});async function AMc(t,e,r){g_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=t.get(zo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(m0).setTodos(s,r.todoList);let c=AJe(r.message),l=new Xf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:JSt(u),f=await ZSt(t,r),h=t.get(j_),m=qQ(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=YSt({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=m_e(r),y=t.get(wN).add(A.progressToken,e),E=new hw(t,s,l,y),_=await t.get(RN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(Au),b=String(l.id);v.resetTurnCredits(b);let T,w=performance.now();try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let R=Math.round(performance.now()-w),x=XSt(l,f);return eTt(t,"conversation/turn",s,l,x,{totalTimeMs:R,credits:T,conversationSource:s.source}),[{conversationId:s.id,turnId:l.id,agentSlug:x.agentSlug,modelName:x.modelName,modelProviderName:x.modelProviderName,billingMultiplier:x.billingMultiplier,modelInfo:r.modelInfo,credits:tTt(T),preciseCredits:T},null]}a(AMc,"handleConversationTurnChecked");var zGi=Oe(gMc,AMc);p();var yMc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(LO)});async function EMc(t,e,r){t.get(zo).deleteTurn(r.conversationId,r.turnId);let o=nq(r.source),s=await tl(t,t.get(zo).findByTurnId(r.turnId),{languageId:""});return HS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${aE(o)}.messageDelete`,s),["OK",null]}a(EMc,"handleConversationTurnDeleteChecked");var YGi=Oe(yMc,EMc);p();var _Mc=S.Object({toolIds:S.Array(S.String())});function vMc(t,e,r){let n=t.get(gs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(vMc,"conversationUnregisterToolsChecked");var KGi=Oe(_Mc,vMc);p();var CMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(P3)}))});async function bMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?qQ(n):"Agent",o,s),l=t.get(gs),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(bMc,"conversationUpdateToolsStatusChecked");var JGi=Oe(CMc,bMc);p();p();Mo();var SMc=5e3,Rie=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}};Oo();var kN=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 lp.create(KSt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=LA.user(o,Mt()),f=ex.createEmptyConfigForTesting(),h;try{h=this.ctx.get(sc)}catch{h=new sc(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=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});At(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});At(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});At(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});At(this.ctx,"partition.summary.cancelled",s,0)}};var oMc=S.Object({conversationId:S.String()});async function sMc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(TI);aMc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[tFe(n,"Compression cancelled"),null];let c=t.get(Yo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),rFe(t,n,0,"Conversation not found",Date.now()-o),[tFe(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}`),rFe(t,n,0,"No turns to compress",Date.now()-o),[tFe(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}`),rFe(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[tFe(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(el).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(kN),y=new ck(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 Gq().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}),cMc(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}`),rFe(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}`),rFe(t,n,0,l,u),[tFe(n,`Compression failed: ${l}`),null]}}a(sMc,"handleConversationCompressChecked");function tFe(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(tFe,"createErrorResult");function aMc(t,e,r,n){let o=Wt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});At(t,"conversationPartition.manualCompression.started",o,0)}a(aMc,"sendStartedTelemetry");function cMc(t,e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});At(t,"conversationPartition.manualCompression.completed",u,0)}a(cMc,"sendCompletedTelemetry");function rFe(t,e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});At(t,"conversationPartition.manualCompression.failed",c,0)}a(rFe,"sendFailedTelemetry");var $Gi=Ne(oMc,sMc);p();p();var ZSt=S.Array(If);function XSt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(XSt,"resolveAsActiveEditor");p();var VGi=de(Xc());var eTt=new VGi.ProgressType,KBr=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new Gq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ar).connection.sendProgress(eTt,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(ar).connection.sendProgress(eTt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ar).connection.sendProgress(eTt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ar).connection.sendProgress(eTt,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 A_e(t){return new KBr(t.workDoneToken)}a(A_e,"createProgressHandler");p();var WGi=de(Xc());var y_e=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 WGi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function tTt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ji(t.uri)}]}a(tTt,"resolveAsWorkspaceFolders");p();p();var lMc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),o_=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?lMc(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 PN=class{constructor(){this.tokens=new Cn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new Fn.CancellationTokenSource,o=new o_([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 zGi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(zGi,"calculateBillingMultiplier");async function rTt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await wo.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(rTt,"resolveTurnModelInfo");function nTt(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:zGi(r)}}a(nTt,"buildTurnSummary");p();function iTt(t,e,r,n,o,s){let{properties:c,measurements:l}=dMc(e,r,n,o,s),u=uMc(e,r,n,o,s);At(t,"conversation.turnCompleted",Wt.createAndMarkAsIssued(u)),Rt(t,"conversation.turnCompleted",c,l)}a(iTt,"sendTurnTelemetry");function uMc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};return lk(s,"chatMode",n.chatMode),lk(s,"conversationSource",o?.conversationSource),s}a(uMc,"buildGithubTurnTelemetryProperties");function dMc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};lk(s,"modelName",n.modelName),lk(s,"modelProviderName",n.modelProviderName),lk(s,"userRequestedModel",n.userRequestedModel),lk(s,"reasoningEffort",n.reasoningEffort),lk(s,"chatMode",n.chatMode),lk(s,"agentSlug",n.agentSlug),lk(s,"conversationSource",o?.conversationSource);let c={};return lk(c,"billingMultiplier",n.billingMultiplier),lk(c,"credits",o?.credits),lk(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(dMc,"buildTurnTelemetryData");function oTt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(oTt,"formatCredits");function lk(t,e,r){r!==void 0&&(t[e]=r)}a(lk,"assignDefined");var fMc=S.Object({conversationId:S.Optional(vJe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(XCn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(If),visibleRanges:S.Optional(ZSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(BO)),source:S.Optional(FO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),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(TJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(IJe)),restoreToTurnId:S.Optional(S.String())});async function pMc(t,e,r){y_e.validate(r.workspaceFolders);let n=await UL(t,r,e),o=await t.get(Yo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(A0).setTodos(o,r.todoList);let s=await rTt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await hMc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=A_e(r),d=t.get(PN).add(u.progressToken,e),f=new gw(t,o,l,d),h=await t.get(DN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Au),g=String(l.id);m.resetTurnCredits(g);let A,y=performance.now();try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let E=Math.round(performance.now()-y),_=nTt(l,s);return iTt(t,"conversation/create",o,l,_,{totalTimeMs:E,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:_.agentSlug,modelName:_.modelName,modelProviderName:_.modelProviderName,billingMultiplier:_.billingMultiplier,modelInfo:r.modelInfo,credits:oTt(A),preciseCredits:A},null]}a(pMc,"handleConversationCreateChecked");async function hMc(t,e,r,n,o){for(let s of r.turns){let c=bJe(s.request),l=new tp({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:tTt(u),f=t.get(H_),h=HQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=XSt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Yo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(hMc,"addTurns");var YGi=Ne(fMc,pMc);p();var mMc=S.Object({conversationId:S.String()});function gMc(t,e,r){return t.get(Yo).destroy(r.conversationId),["OK",null]}a(gMc,"handleConversationDestroyChecked");var KGi=Ne(mMc,gMc);p();var AMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function yMc(t,e,r){return[(await t.get(H_).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(yMc,"handleConversationModesChecked");var JGi=Ne(AMc,yMc);p();var EMc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),_Mc=new fe("conversationNotifyCodeAcceptance");async function vMc(t,e,r){let n=t.get(Yo).findByTurnId(r.turnId);if(!n)return _Mc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await tl(t,n,{languageId:""});return $S(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${cE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(vMc,"handleConversationNotifyCodeAcceptanceChecked");var ZGi=Ne(EMc,vMc);p();var CMc=S.Object({});function bMc(t,e,r){return[{path:t.get(ti).directory},null]}a(bMc,"handleConversationPersistenceChecked");var XGi=Ne(CMc,bMc);p();p();var JBr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Lr).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},ZBr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},SMc=[new JBr,new ZBr],uk=class{constructor(e,r=SMc){this.ctx=e;this.checks=r;this.emitter=new Wi;this.onChange=this.emitter.event;bs(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 TMc=S.Object({forceCheck:S.Optional(S.Boolean())});async function IMc(t,e,r){let n=r.forceCheck??!1;return[await t.get(uk).check(n),null]}a(IMc,"handleConversationPreconditionsChecked");var e$i=Ne(TMc,IMc);p();var xMc=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional(jC),textDocument:S.Optional(jC),source:S.Optional(FO)});async function wMc(t,e,r){let n=await UL(t,r,e),o=sq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await tl(t,r.turnId?t.get(Yo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${cE(o)}.messageRating`,u=$S(t,n,{rating:s,uiKind:o},{},l,c);return tx(t,l,u),["OK",null]}a(wMc,"handleConversationRatingChecked");var t$i=Ne(xMc,wMc);p();var RMc=S.Object({tools:S.Array(ebn)});function kMc(t,e,r){let n=t.get(gs);return r.tools.forEach(s=>{n.registerTool(new rj({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(kMc,"conversationRegisterToolsChecked");var r$i=Ne(RMc,kMc);p();var PMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc)),providers:S.Optional(S.Array(S.Enum(w3)))});async function DMc(t,e,r){let n=r.providers?.length?r.providers:void 0,o=n?.includes("BACKGROUND")===!0,s=a(h=>n===void 0||h.providers.some(m=>n.includes(m)),"appliesToRequest"),c=T$t(t).map(h=>({id:h.id,description:h.description,shortDescription:h.shortDescription,scopes:h.scopes,source:"builtin",providers:["LOCAL"]})).filter(s),l=t.get(bg),u=r.workspaceFolders??[],f=(await l.listCustomPrompts(u,{includePlugins:o})).map(h=>{let m=h.pluginUri!==void 0;return{id:h.uri,name:h.name,description:h.description||"",shortDescription:"",scopes:m?["agent-panel"]:NMc(h.mode),source:"prompt",mode:h.mode,model:h.model,providers:QS(m,h.providers)}}).filter(s);if(c.push(...f),r.workspaceFolders&&r.workspaceFolders.length>0){let g=(await t.get(g0).listSkills(r.workspaceFolders,{includePlugins:o})).map(A=>({id:`skill:${Ji(ff(A.uri))}`,description:A.description||"",shortDescription:A.name,scopes:["agent-panel"],source:"skill",providers:QS(A.pluginUri!==void 0,A.providers)})).filter(s).filter(A=>!c.some(y=>y.id===A.id));c.push(...g)}return[c,null]}a(DMc,"handleConversationTemplatesChecked");function NMc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(NMc,"getCustomPromptScopes");var n$i=Ne(PMc,DMc);p();var MMc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:vJe,turnId:S.Optional(YK),message:Lqt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(If),visibleRanges:S.Optional(ZSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(BO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Uyn,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(TJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(IJe))});async function OMc(t,e,r){y_e.validate(r.workspaceFolders);let n=await UL(t,r,e),o=t.get(Yo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(A0).setTodos(s,r.todoList);let c=bJe(r.message),l=new tp({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:tTt(u),f=await rTt(t,r),h=t.get(H_),m=HQ(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=XSt({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=A_e(r),y=t.get(PN).add(A.progressToken,e),E=new gw(t,s,l,y),_=await t.get(DN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(Au),b=String(l.id);v.resetTurnCredits(b);let T,w=performance.now();try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let R=Math.round(performance.now()-w),x=nTt(l,f);return iTt(t,"conversation/turn",s,l,x,{totalTimeMs:R,credits:T,conversationSource:s.source}),[{conversationId:s.id,turnId:l.id,agentSlug:x.agentSlug,modelName:x.modelName,modelProviderName:x.modelProviderName,billingMultiplier:x.billingMultiplier,modelInfo:r.modelInfo,credits:oTt(T),preciseCredits:T},null]}a(OMc,"handleConversationTurnChecked");var i$i=Ne(MMc,OMc);p();var LMc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(FO)});async function BMc(t,e,r){t.get(Yo).deleteTurn(r.conversationId,r.turnId);let o=sq(r.source),s=await tl(t,t.get(Yo).findByTurnId(r.turnId),{languageId:""});return $S(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${cE(o)}.messageDelete`,s),["OK",null]}a(BMc,"handleConversationTurnDeleteChecked");var o$i=Ne(LMc,BMc);p();var FMc=S.Object({toolIds:S.Array(S.String())});function UMc(t,e,r){let n=t.get(gs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(UMc,"conversationUnregisterToolsChecked");var s$i=Ne(FMc,UMc);p();var QMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(N3)}))});async function qMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(H_).getChatMode(n?HQ(n):"Agent",o,s),l=t.get(gs),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(qMc,"conversationUpdateToolsStatusChecked");var a$i=Ne(QMc,qMc);p();p();Oo();var jMc=5e3,kie=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 @@ -4047,16 +4047,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 Fn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),SMc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new oc(e),u=await xo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Zt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:OA.user("conversation-panel",Mt())},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}`),At(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var TMc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function IMc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ze.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Rie).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ze.InternalError,message:"Failed to generate thinking title"}]}a(IMc,"handleThinkingTitleGenerateChecked");var ZGi=Oe(TMc,IMc);p();p();p();var rTt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var A_e=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(rTt,"")}static extractSuggestionAndText(e){rTt.lastIndex=0;let n=rTt.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 Fn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),jMc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new sc(e),u=await wo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Zt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:LA.user("conversation-panel",Mt())},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}`),Rt(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var HMc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function GMc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ze.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(kie).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ze.InternalError,message:"Failed to generate thinking title"}]}a(GMc,"handleThinkingTitleGenerateChecked");var c$i=Ne(HMc,GMc);p();p();p();var sTt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var E_e=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(sTt,"")}static extractSuggestionAndText(e){sTt.lastIndex=0;let n=sTt.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 nTt=require("path");var y_e=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=tx(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=i0(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=yl();try{return await HW(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=M3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=yl()-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(Gm(d))throw d;let f=yl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{tYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,nTt.basename)(e,(0,nTt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(bf).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();Mo();var E_e=class t{constructor(e,r={}){this.ctx=e;this.id=Mt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Wt.createAndMarkAsIssued(r)}telemetrySent(){Et(this.ctx,"request.sent",this.telemetryData),At(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){Et(this.ctx,"request.response",this.telemetryData),At(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Wh(e,"name")??""),this.telemetryData.properties.code=String(Wh(e,"code")??""),this.telemetryData.properties.errno=String(Wh(e,"errno")??""),this.telemetryData.properties.type=String(Wh(e,"type")??""),Et(this.ctx,"request.error",this.telemetryData),At(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var iTt=class t extends y_e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new E_e(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(nc),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 xMc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),wMc=S.Object({changes:S.Array(xMc),workspaceFolders:S.Optional(S.Array(Bc))}),Z3e;async function RMc(t,e,r){Z3e&&(Z3e.cancel(),Z3e.dispose()),Z3e=new Fn.CancellationTokenSource;let n=new i_([e,Z3e.token]),o=new iTt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.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."}]:(Nr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ze.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:A_e.parseReviewResponse(u,d)},null]}a(RMc,"handleCopilotCodeReviewReviewChangesChecked");var XGi=Oe(wMc,RMc);p();p();var oTt=class t extends y_e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new E_e(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(nc),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 kMc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),PMc=S.Object({snippets:S.Array(kMc),workspaceFolders:S.Optional(S.Array(Bc))}),X3e;async function DMc(t,e,r){X3e&&(X3e.cancel(),X3e.dispose()),X3e=new Fn.CancellationTokenSource;let n=new i_([e,X3e.token]),o=new oTt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.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:Ze.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:A_e.parseReviewResponse(u,d)},null]}a(DMc,"handleCopilotCodeReviewReviewSnippetsChecked");var e$i=Oe(PMc,DMc);p();p();var sTt=Symbol("onMCPToolsListChanged"),aTt=Symbol("onMCPResourcesListChanged"),cTt=Symbol("onMCPPromptsListChanged"),t$i=Symbol("onMCPResourceUpdated"),FV=Symbol("onMCPCacheUpdated");function eFe(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(eFe,"normalizeMcpHeaders");var o_=class{static{a(this,"McpManager")}};var NMc=S.Object({}),MMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(P3)}))}))}),OMc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),LMc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),BMc=S.Object({serverName:S.String(),uri:S.String()}),FMc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function UMc(t,e,r){return[t.get(o_).getAllContents(),null]}a(UMc,"handleGetMCPContentsChecked");async function QMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?qQ(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(o_).updateMCPToolsStatus(c,l),[t.get(o_).getAllContents(c),null]}a(QMc,"handleUpdateMCPToolsStatusChecked");async function qMc(t,e,r){return[await t.get(o_).readResource(r.serverName,r.uri),null]}a(qMc,"handleReadResourceChecked");async function jMc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(o_).getPrompt(n,o,s),null]}a(jMc,"handleGetPromptChecked");async function HMc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(o_).completePrompt(n,o,s,c,l),null]}a(HMc,"handleCompletePromptChecked");async function GMc(t,e,r){let n=t.get(o_),{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(GMc,"handleMCPServerActionChecked");var r$i=Oe(NMc,UMc),n$i=Oe(MMc,QMc),i$i=Oe(BMc,qMc),o$i=Oe(OMc,jMc),s$i=Oe(LMc,HMc),a$i=Oe(FMc,GMc);p();var $Mc=S.Object({});async function VMc(t,e,r){let n=await t.get(Qt).getToken();return[KMc(t,await t.get(xs).getMetadata(),n),null]}a(VMc,"handleCopilotModelsChecked");function WMc(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(x$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(WMc,"supportReasoningEffortLevel");function zMc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!sle.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(zMc,"getModelScopes");function YMc(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(YMc,"shouldExposeModel");function KMc(t,e,r){let n=[];return e.forEach(o=>{YMc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:zMc(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:WMc(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,customModel:o.custom_model?{keyName:o.custom_model.key_name,ownerName:o.custom_model.owner_name,ownerType:o.custom_model.owner_type,provider:o.custom_model.provider}:void 0,degradationReason:xun(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(jl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:V_,modelName:oKe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:V_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(KMc,"filterModels");var c$i=Oe($Mc,VMc);p();var JMc=S.Object({});async function ZMc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(xs).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(ZMc,"handleCopilotModelsGetModelMetadataListChecked");var l$i=Oe(JMc,ZMc);p();var XMc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function eOc(t,e,r){return r.model&&r.status==="enabled"?await t.get(xs).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ze.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ze.InvalidRequest,message:"Invalid model or status"}]}a(eOc,"handleCopilotModelsPolicyChecked");var u$i=Oe(XMc,eOc);p();p();p();p();Mo();function tOc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(tOc,"panelPositionForDocument");async function*d$i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(d$i,"trimChoices");var __e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=tOc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function zBr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await zBr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(zBr,"reportSolutions");async function YBr(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:YBr(t,e)}}a(YBr,"generateSolutionsStream");function lTt(t){return t.replace(/\s+/g,"")}a(lTt,"normalizeCompletionText");async function f$i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=gQ(t,l.uri),d=Mt(),f=Wt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Zt).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 Rme(t,d,pee(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=gu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...Ese(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),Et(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(f$i,"setupPromptAndTelemetry");function p$i(t,e,r,n,o,s){let c=t.get(TP).forLanguage(t,e.detectedLanguageId,s),l=kS(e.detectedLanguageId),u=Jlt(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 aTt=require("path");var __e=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=ix(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=s0(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=El();try{return await WW(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=L3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=El()-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(Vm(d))throw d;let f=El()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{sYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,aTt.basename)(e,(0,aTt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(Tf).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();Oo();var v_e=class t{constructor(e,r={}){this.ctx=e;this.id=Mt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Wt.createAndMarkAsIssued(r)}telemetrySent(){At(this.ctx,"request.sent",this.telemetryData),Rt(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){At(this.ctx,"request.response",this.telemetryData),Rt(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Yh(e,"name")??""),this.telemetryData.properties.code=String(Yh(e,"code")??""),this.telemetryData.properties.errno=String(Yh(e,"errno")??""),this.telemetryData.properties.type=String(Yh(e,"type")??""),At(this.ctx,"request.error",this.telemetryData),Rt(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var cTt=class t extends __e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new v_e(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(ic),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 $Mc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),VMc=S.Object({changes:S.Array($Mc),workspaceFolders:S.Optional(S.Array(Bc))}),nFe;async function WMc(t,e,r){nFe&&(nFe.cancel(),nFe.dispose()),nFe=new Fn.CancellationTokenSource;let n=new o_([e,nFe.token]),o=new cTt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.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."}]:(Nr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ze.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:E_e.parseReviewResponse(u,d)},null]}a(WMc,"handleCopilotCodeReviewReviewChangesChecked");var l$i=Ne(VMc,WMc);p();p();var lTt=class t extends __e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new v_e(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(ic),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 zMc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),YMc=S.Object({snippets:S.Array(zMc),workspaceFolders:S.Optional(S.Array(Bc))}),iFe;async function KMc(t,e,r){iFe&&(iFe.cancel(),iFe.dispose()),iFe=new Fn.CancellationTokenSource;let n=new o_([e,iFe.token]),o=new lTt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.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:Ze.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:E_e.parseReviewResponse(u,d)},null]}a(KMc,"handleCopilotCodeReviewReviewSnippetsChecked");var u$i=Ne(YMc,KMc);p();p();var uTt=Symbol("onMCPToolsListChanged"),dTt=Symbol("onMCPResourcesListChanged"),fTt=Symbol("onMCPPromptsListChanged"),d$i=Symbol("onMCPResourceUpdated"),jV=Symbol("onMCPCacheUpdated");function oFe(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(oFe,"normalizeMcpHeaders");var s_=class{static{a(this,"McpManager")}};var JMc=S.Object({}),ZMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(N3)}))}))}),XMc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),eOc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),tOc=S.Object({serverName:S.String(),uri:S.String()}),rOc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function nOc(t,e,r){return[t.get(s_).getAllContents(),null]}a(nOc,"handleGetMCPContentsChecked");async function iOc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(H_).getChatMode(n?HQ(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(s_).updateMCPToolsStatus(c,l),[t.get(s_).getAllContents(c),null]}a(iOc,"handleUpdateMCPToolsStatusChecked");async function oOc(t,e,r){return[await t.get(s_).readResource(r.serverName,r.uri),null]}a(oOc,"handleReadResourceChecked");async function sOc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(s_).getPrompt(n,o,s),null]}a(sOc,"handleGetPromptChecked");async function aOc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(s_).completePrompt(n,o,s,c,l),null]}a(aOc,"handleCompletePromptChecked");async function cOc(t,e,r){let n=t.get(s_),{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(cOc,"handleMCPServerActionChecked");var f$i=Ne(JMc,nOc),p$i=Ne(ZMc,iOc),h$i=Ne(tOc,oOc),m$i=Ne(XMc,sOc),g$i=Ne(eOc,aOc),A$i=Ne(rOc,cOc);p();var lOc=S.Object({});async function uOc(t,e,r){let n=await t.get(Qt).getToken();return[hOc(t,await t.get(xs).getMetadata(),n),null]}a(uOc,"handleCopilotModelsChecked");function dOc(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(D$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(dOc,"supportReasoningEffortLevel");function fOc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!ale.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(fOc,"getModelScopes");function pOc(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(pOc,"shouldExposeModel");function hOc(t,e,r){let n=[];return e.forEach(o=>{pOc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:fOc(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:dOc(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,customModel:o.custom_model?{keyName:o.custom_model.key_name,ownerName:o.custom_model.owner_name,ownerType:o.custom_model.owner_type,provider:o.custom_model.provider}:void 0,degradationReason:Dun(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(Hl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:z_,modelName:dKe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:z_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(hOc,"filterModels");var y$i=Ne(lOc,uOc);p();var mOc=S.Object({});async function gOc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(xs).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(gOc,"handleCopilotModelsGetModelMetadataListChecked");var E$i=Ne(mOc,gOc);p();var AOc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function yOc(t,e,r){return r.model&&r.status==="enabled"?await t.get(xs).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ze.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ze.InvalidRequest,message:"Invalid model or status"}]}a(yOc,"handleCopilotModelsPolicyChecked");var _$i=Ne(AOc,yOc);p();p();p();p();Oo();function EOc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(EOc,"panelPositionForDocument");async function*v$i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(v$i,"trimChoices");var C_e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=EOc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function XBr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await XBr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(XBr,"reportSolutions");async function e3r(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:e3r(t,e)}}a(e3r,"generateSolutionsStream");function pTt(t){return t.replace(/\s+/g,"")}a(pTt,"normalizeCompletionText");async function C$i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=yQ(t,l.uri),d=Mt(),f=Wt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Zt).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 Pme(t,d,hee(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=gu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{..._se(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),At(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(C$i,"setupPromptAndTelemetry");function b$i(t,e,r,n,o,s){let c=t.get(xP).forLanguage(t,e.detectedLanguageId,s),l=PS(e.detectedLanguageId),u=tut(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=mQ(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?lNe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?lNe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(p$i,"setupCompletionParams");var KBr=new fe("solutions");async function rOc(t,e){let r=e.targetPosition,n=e.textDocument,o=await f$i(t,e,"open copilot",KBr);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}=p$i(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(AO).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;_=d$i(_),_=ixe(_,T=>MNe(t,n,r,T,!1,KBr));let v=ixe(_,async T=>{let w=T.completionText;KBr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await XXn(t,n,r,T.completionText)??gu.position(r.line,0),[x]=FH(n.getText(gu.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,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:gu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return YBr(A,v[Symbol.asyncIterator]())}a(rOc,"launchSolutions");async function uTt(t,e,r){return t.get(ps).trackCompletionJob(async()=>{let o=rOc(t,e);return await zBr(o,r)})}a(uTt,"runSolutions");var m$i=de(dU()),rFe=de(Xc());p();Mo();p();function dTt(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(dTt,"parseChallengeDoc");var nOc=S.Object({text:S.String(),score:S.Number()}),iOc=S.Object({documents:S.Array(nOc),options:S.Optional(S.Object({}))});async function fTt(t,e,r){let n=Mt();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:JI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(fTt,"runTestSolutions");var kN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function oOc(t,e,r){return t.forceSet(kN,new kN(r.documents)),["OK",null]}a(oOc,"handleTestingSetPanelCompletionDocumentsChecked");var h$i=Oe(iOc,oOc);var g$i=TKe.type;function sOc(t,e,r,n,o){let s=lTt(n.completionText),c=(0,m$i.SHA256)(s).toString();return t.get(Ru).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:P4r,title:`Accept completion ${o}`,arguments:[c]}}}a(sOc,"makeCompletion");function ZBr(t,e){return`${t}/${e}`}a(ZBr,"progressMessage");var JBr=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(ar)}async onSolution(e){this.count+=1;let r=sOc(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(rFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:ZBr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return aOc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(rFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function aOc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(rFe.WorkDoneProgress.type,t,{kind:"end",message:ZBr(r,10)})}a(aOc,"reportDone");var tFe;async function cOc(t,e,r){let n=await P9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ar).connection.sendProgress(rFe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:ZBr(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(ar).connection.sendProgress(TKe.partialResult,l,{items:[f]})},"onCompletion"));let u=new JBr(t,r,c),d=t.get(kN);if(d.documents){let f=d.documents;await fTt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new __e(n,o,e,10);await uTt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(cOc,"handleChecked");async function lOc(t,e,r){tFe&&(tFe.cancel(),tFe.dispose()),tFe=new Fn.CancellationTokenSource;let n=tFe.token,o=new i_([e,n]);try{return await cOc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(lOc,"handleCheckedWithAbort");var A$i=Oe(wvn,lOc);p();var dOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function fOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ld).listCustomAgents(n,{includePlugins:!0,includeRuntimeAgents:!0})).map(c=>{let l=c.promptFileEntry?.promptPath?.storage;return{id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,pluginUri:c.pluginUri,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri??c.id,storage:l,providers:cO(c.pluginUri!==void 0,c.providers)}}),null]}a(fOc,"listCustomAgents");var y$i=Oe(dOc,fOc);p();var pOc=new fe("customAgent/registerExtensionAgents"),hOc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),mOc=S.Object({extensionId:S.String(),agents:S.Array(hOc)});function gOc(t,e,r){try{t.get(Ld).registerExtensionAgent(r.extensionId,r.agents)}catch(n){pOc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(gOc,"registerExtensionAgents");var E$i=Oe(mOc,gOc);p();var AOc=S.Object({extensionId:S.String()});function yOc(t,e,r){return t.get(Ld).unregisterExtensionAgents(r.extensionId),[null,null]}a(yOc,"unregisterExtensionAgents");var _$i=Oe(AOc,yOc);p();var EOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function _Oc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(bf).listCustomInstructions(n,{includePlugins:!0})).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,pluginUri:c.pluginUri,providers:cO(c.pluginUri!==void 0,c.providers)})),null]}a(_Oc,"listCustomInstructions");var v$i=Oe(EOc,_Oc);p();var vOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function COc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Cg).listCustomPrompts(n,{includePlugins:!0})).map(c=>{let l=c.promptFileEntry?.promptPath.storage;return{uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:l,pluginUri:c.pluginUri,providers:cO(c.pluginUri!==void 0,c.providers)}}),null]}a(COc,"listCustomPrompts");var C$i=Oe(vOc,COc);p();var bOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function SOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(h0).listSkills(n,{includePlugins:!0})).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage,pluginUri:c.pluginUri,providers:cO(c.pluginUri!==void 0,c.providers)})),null]}a(SOc,"listCustomSkills");var b$i=Oe(bOc,SOc);p();p();p();function TOc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get($m).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(TOc,"urlsToCheck");async function S$i(t,e,r=bB(t),n,o){let s=TOc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await IOc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(S$i,"checkReachability");async function IOc(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(IOc,"determineReachability");var SI=de(require("os")),v_e=de(require("tls"));async function I$i(t,e){let r=await t.get(tr).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[wOc(t),xOc(t,n),ROc(t,r),await kOc(t,r,o?.endpoints,n,e)]}}a(I$i,"collectDiagnostics");function x$i(t){return t.sections.map(POc).join(SI.EOL+SI.EOL)+SI.EOL}a(x$i,"formatDiagnosticsAsMarkdown");function xOc(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:V1(t),"GitHub Account":n,"Session ID":t.get(Ua).sessionId,"Send Restricted Telemetry":_se(t)?"enabled":"disabled","Content Exclusion":t.get(nc).enabled?"enabled":"unavailable"}}}a(xOc,"collectCopilotSection");function wOc(t){let e={Plugin:NOc(t),Editor:DOc(t),"Operating System":`${SI.type()} ${SI.release()} (${SI.arch()})`};return UL(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(wOc,"collectEnvironmentSection");function ROc(t,e){let r=t.get(Lo).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":v_e.rootCertificates.length,"TLS Default Min Version":v_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":v_e.DEFAULT_MAX_VERSION};return UL(n,"http_proxy"),UL(n,"https_proxy"),UL(n,"no_proxy"),UL(n,"SSL_CERT_FILE"),UL(n,"SSL_CERT_DIR"),UL(n,"OPENSSL_CONF"),UL(n,"NODE_EXTRA_CA_CERTS"),UL(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(ROc,"collectNetworkConfigSection");async function kOc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await S$i(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(kOc,"collectReachabilitySection");function T$i(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(T$i,"quoteCode");function UL(t,e){let r=process.env[e];r&&(t[T$i(e)]=T$i(r)),r!==process.env[e.toUpperCase()]&&UL(t,e.toUpperCase())}a(UL,"addEnvironmentVariable");function POc(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(POc,"formatSectionAsMarkdown");function DOc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(DOc,"getEditorDisplayVersion");function NOc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(NOc,"getPluginDisplayVersion");var MOc=S.Object({});async function OOc(t,e){return[{report:x$i(await I$i(t,e))},null]}a(OOc,"handleDiagnosticsChecked");var w$i=Oe(MOc,OOc);p();var LOc=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function BOc(t,e,r){let o=await t.get(pv).readSpans(r.conversationId),s=JGn(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(BOc,"handleExportAgentDebugLogChecked");var R$i=Oe(LOc,BOc);p();var FOc=S.Object({conversationId:S.String()});async function UOc(t,e,r){return[{spans:await t.get(pv).readSpans(r.conversationId)},null]}a(UOc,"handleGetAgentDebugLogChecked");var k$i=Oe(FOc,UOc);p();Mo();var L$i=de(Xc());p();var P$i=require("crypto");var C_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new e3r(e,this.id)}},e3r=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(ar),s=(0,P$i.randomUUID)(),c=o.connection.onProgress(bKe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(bKe.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 pTt(t,e,r){try{let n=t.get(hm),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 C_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof C_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(pTt,"setContextItems");var XBr={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function D$i(t,e,r){return e.map(o=>{try{if(typeof o=="string")return vf(r.uri,o,XBr);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=vf(r.uri,o.scheme||"",XBr)),"pattern"in o&&(s&&=vf(r.uri,o.pattern||"",XBr)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(D$i,"match");p();var QOc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),QV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function qOc(t,e,r){return t.forceSet(QV,new QV(r.documents,r.basename||"")),["OK",null]}a(qOc,"handleTestingSetCompletionDocumentsChecked");var N$i=new fe("setCompletionDocuments"),O$i=Oe(QOc,qOc);function hTt(t,e,r,n){let o=t.get(QV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){N$i.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=jOc(o,r);return c&&c.length>0?M$i(c,s,e):void 0}else return N$i.debug(t,"Returning completions for all pre-set documents"),M$i(o.documents,s,e)}}a(hTt,"getTestCompletions");function M$i(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=dTt(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(M$i,"sliceAndMapCompletions");function jOc(t,e){return t.basename===Ji(e)?t.documents||[]:[]}a(jOc,"getFilteredDocs");var B$i=S.Object({doc:S.Object({position:c0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Nxe,version:S.Number()}),contextItems:S.Optional(Lfr)}),nFe;async function F$i(t,e,r,n){nFe&&(nFe.cancel(),nFe.dispose()),nFe=new Fn.CancellationTokenSource;let o=new i_([e,nFe.token]);r.contextItems&&pTt(t,r.contextItems);let s=hTt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Mt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await P9(t,r.doc,o)}catch(h){if(!(h instanceof L$i.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(ry).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Ru);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(F$i,"handleGetCompletionsHelper");var U$i=Oe(B$i,(t,e,r)=>F$i(t,e,r,!1)),Q$i=Oe(B$i,(t,e,r)=>F$i(t,e,r,!0));p();var HOc=S.Object({});function GOc(t,e,r){return[{defaultRules:t.get(mw).getDefaultRules()},null]}a(GOc,"handleGetDefaultFileSafetyRulesChecked");var q$i=Oe(HOc,GOc);p();var j$i=de(dU()),b_e=de(Xc());var $Oc=S.Object({doc:S.Object({position:c0,uri:Nxe,version:S.Number()}),panelId:S.String()});function VOc(t,e,r,n,o){let s=lTt(o.completionText),c=(0,j$i.SHA256)(s).toString();return t.get(Ru).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(VOc,"makeSolution");var t3r=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(ar)}onSolution(e){return this.service.connection.sendNotification(new b_e.NotificationType("PanelSolution"),VOc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return H$i(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new b_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function H$i(t,e){return e.connection.sendNotification(new b_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(H$i,"reportDone");var iFe;async function WOc(t,e,r){iFe&&(iFe.cancel(),iFe.dispose()),iFe=new Fn.CancellationTokenSource;let n=new i_([e,iFe.token]),o=r.doc.position,s=gu.range(o,o),c=new t3r(t,r,s),l=t.get(kN);if(l.documents){let u=l.documents;fTt(o,u,c)}else{let u;try{u=await P9(t,r.doc,n)}catch(f){if(!(f instanceof b_e.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return zOc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new __e(u,o,n,10);uTt(t,d,c)}return[{solutionCountTarget:10},null]}a(WOc,"handleGetPanelCompletionsChecked");async function zOc(t,e){return await H$i(e.panelId,t.get(ar)),[{solutionCountTarget:0},null]}a(zOc,"produceEmptySolutions");var G$i=Oe($Oc,WOc);p();var YOc=S.Object({});async function KOc(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(KOc,"handleGetUserInfoChecked");var $$i=Oe(YOc,KOc);p();var JOc=S.Object({});function ZOc(t,e,r){return[{version:t.get(ds).getDisplayVersion(),buildType:MU(t),runtimeVersion:`node/${process.versions.node}`},null]}a(ZOc,"handleGetVersionChecked");var V$i=Oe(JOc,ZOc);p();Mo();var XOc=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 e5c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(zo),o=n.create({capabilities:{skills:[MO]}}),s=new Xf({message:"",type:"user"});await n.addTurn(o.id,s);let c=m_e({workDoneToken:Mt()});await t.get(Tc).begin(o,s,c);let d=(await new hw(t,o,s,e).skillResolver.resolve(MO))?.head?.name,h=await t.get(HX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(e5c,"handleGitCommitGenerateChecked");var W$i=Oe(XOc,e5c);p();var t5c=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function r5c(t,e,r){try{let o=await new Zh(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return Et(t,"githubApi.listPullRequestChangedFiles",Wt.createAndMarkAsIssued()),At(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(qa(t,n,"githubApi.listPullRequestChangedFiles"),Vn(t,"githubApi.listPullRequestChangedFiles",n),n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(r5c,"handleListPullRequestChangedFilesChecked");var z$i=Oe(t5c,r5c);p();p();var mTt=new fe("GitHubGraphQLClient"),gTt=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(tr);return this.graphqlClient=ECn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){mTt.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++,mTt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` +`]);let h=AQ(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?hNe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?hNe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(b$i,"setupCompletionParams");var t3r=new fe("solutions");async function _Oc(t,e){let r=e.targetPosition,n=e.textDocument,o=await C$i(t,e,"open copilot",t3r);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}=b$i(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(EO).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;_=v$i(_),_=axe(_,T=>UNe(t,n,r,T,!1,t3r));let v=axe(_,async T=>{let w=T.completionText;t3r.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await aei(t,n,r,T.completionText)??gu.position(r.line,0),[x]=jH(n.getText(gu.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,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:gu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return e3r(A,v[Symbol.asyncIterator]())}a(_Oc,"launchSolutions");async function hTt(t,e,r){return t.get(ps).trackCompletionJob(async()=>{let o=_Oc(t,e);return await XBr(o,r)})}a(hTt,"runSolutions");var T$i=de(pU()),aFe=de(Xc());p();Oo();p();function mTt(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(mTt,"parseChallengeDoc");var vOc=S.Object({text:S.String(),score:S.Number()}),COc=S.Object({documents:S.Array(vOc),options:S.Optional(S.Object({}))});async function gTt(t,e,r){let n=Mt();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:ex.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(gTt,"runTestSolutions");var NN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function bOc(t,e,r){return t.forceSet(NN,new NN(r.documents)),["OK",null]}a(bOc,"handleTestingSetPanelCompletionDocumentsChecked");var S$i=Ne(COc,bOc);var I$i=PKe.type;function SOc(t,e,r,n,o){let s=pTt(n.completionText),c=(0,T$i.SHA256)(s).toString();return t.get(Ru).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:O4r,title:`Accept completion ${o}`,arguments:[c]}}}a(SOc,"makeCompletion");function n3r(t,e){return`${t}/${e}`}a(n3r,"progressMessage");var r3r=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(ar)}async onSolution(e){this.count+=1;let r=SOc(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(aFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:n3r(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return TOc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(aFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function TOc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(aFe.WorkDoneProgress.type,t,{kind:"end",message:n3r(r,10)})}a(TOc,"reportDone");var sFe;async function IOc(t,e,r){let n=await N9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ar).connection.sendProgress(aFe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:n3r(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(ar).connection.sendProgress(PKe.partialResult,l,{items:[f]})},"onCompletion"));let u=new r3r(t,r,c),d=t.get(NN);if(d.documents){let f=d.documents;await gTt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new C_e(n,o,e,10);await hTt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(IOc,"handleChecked");async function xOc(t,e,r){sFe&&(sFe.cancel(),sFe.dispose()),sFe=new Fn.CancellationTokenSource;let n=sFe.token,o=new o_([e,n]);try{return await IOc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(xOc,"handleCheckedWithAbort");var x$i=Ne(Nvn,xOc);p();var ROc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function kOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Fd).listCustomAgents(n,{includePlugins:!0,includeRuntimeAgents:!0})).map(c=>{let l=c.promptFileEntry?.promptPath?.storage;return{id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,pluginUri:c.pluginUri,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri??c.id,storage:l,providers:QS(c.pluginUri!==void 0,c.providers)}}),null]}a(kOc,"listCustomAgents");var w$i=Ne(ROc,kOc);p();var POc=new fe("customAgent/registerExtensionAgents"),DOc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),NOc=S.Object({extensionId:S.String(),agents:S.Array(DOc)});function MOc(t,e,r){try{t.get(Fd).registerExtensionAgent(r.extensionId,r.agents)}catch(n){POc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(MOc,"registerExtensionAgents");var R$i=Ne(NOc,MOc);p();var OOc=S.Object({extensionId:S.String()});function LOc(t,e,r){return t.get(Fd).unregisterExtensionAgents(r.extensionId),[null,null]}a(LOc,"unregisterExtensionAgents");var k$i=Ne(OOc,LOc);p();var BOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function FOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Tf).listCustomInstructions(n,{includePlugins:!0})).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,pluginUri:c.pluginUri,providers:QS(c.pluginUri!==void 0,c.providers)})),null]}a(FOc,"listCustomInstructions");var P$i=Ne(BOc,FOc);p();var UOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function QOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(bg).listCustomPrompts(n,{includePlugins:!0})).map(c=>{let l=c.promptFileEntry?.promptPath.storage;return{uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:l,pluginUri:c.pluginUri,providers:QS(c.pluginUri!==void 0,c.providers)}}),null]}a(QOc,"listCustomPrompts");var D$i=Ne(UOc,QOc);p();var qOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function jOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(g0).listSkills(n,{includePlugins:!0})).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage,pluginUri:c.pluginUri,providers:QS(c.pluginUri!==void 0,c.providers)})),null]}a(jOc,"listCustomSkills");var N$i=Ne(qOc,jOc);p();p();p();function HOc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(Wm).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(HOc,"urlsToCheck");async function M$i(t,e,r=SB(t),n,o){let s=HOc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await GOc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(M$i,"checkReachability");async function GOc(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(GOc,"determineReachability");var II=de(require("os")),b_e=de(require("tls"));async function L$i(t,e){let r=await t.get(nr).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[VOc(t),$Oc(t,n),WOc(t,r),await zOc(t,r,o?.endpoints,n,e)]}}a(L$i,"collectDiagnostics");function B$i(t){return t.sections.map(YOc).join(II.EOL+II.EOL)+II.EOL}a(B$i,"formatDiagnosticsAsMarkdown");function $Oc(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:V1(t),"GitHub Account":n,"Session ID":t.get(Qa).sessionId,"Send Restricted Telemetry":vse(t)?"enabled":"disabled","Content Exclusion":t.get(ic).enabled?"enabled":"unavailable"}}}a($Oc,"collectCopilotSection");function VOc(t){let e={Plugin:JOc(t),Editor:KOc(t),"Operating System":`${II.type()} ${II.release()} (${II.arch()})`};return QL(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(VOc,"collectEnvironmentSection");function WOc(t,e){let r=t.get(Bo).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":b_e.rootCertificates.length,"TLS Default Min Version":b_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":b_e.DEFAULT_MAX_VERSION};return QL(n,"http_proxy"),QL(n,"https_proxy"),QL(n,"no_proxy"),QL(n,"SSL_CERT_FILE"),QL(n,"SSL_CERT_DIR"),QL(n,"OPENSSL_CONF"),QL(n,"NODE_EXTRA_CA_CERTS"),QL(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(WOc,"collectNetworkConfigSection");async function zOc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await M$i(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(zOc,"collectReachabilitySection");function O$i(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(O$i,"quoteCode");function QL(t,e){let r=process.env[e];r&&(t[O$i(e)]=O$i(r)),r!==process.env[e.toUpperCase()]&&QL(t,e.toUpperCase())}a(QL,"addEnvironmentVariable");function YOc(t){return`## ${t.name}`+II.EOL+II.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(II.EOL)}a(YOc,"formatSectionAsMarkdown");function KOc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(KOc,"getEditorDisplayVersion");function JOc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(JOc,"getPluginDisplayVersion");var ZOc=S.Object({});async function XOc(t,e){return[{report:B$i(await L$i(t,e))},null]}a(XOc,"handleDiagnosticsChecked");var F$i=Ne(ZOc,XOc);p();var e5c=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function t5c(t,e,r){let o=await t.get(mv).readSpans(r.conversationId),s=r$n(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(t5c,"handleExportAgentDebugLogChecked");var U$i=Ne(e5c,t5c);p();var r5c=S.Object({conversationId:S.String()});async function n5c(t,e,r){return[{spans:await t.get(mv).readSpans(r.conversationId)},null]}a(n5c,"handleGetAgentDebugLogChecked");var Q$i=Ne(r5c,n5c);p();Oo();var V$i=de(Xc());p();var q$i=require("crypto");var S_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new o3r(e,this.id)}},o3r=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(ar),s=(0,q$i.randomUUID)(),c=o.connection.onProgress(RKe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(RKe.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 ATt(t,e,r){try{let n=t.get(gm),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 S_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof S_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(ATt,"setContextItems");var i3r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function j$i(t,e,r){return e.map(o=>{try{if(typeof o=="string")return bf(r.uri,o,i3r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=bf(r.uri,o.scheme||"",i3r)),"pattern"in o&&(s&&=bf(r.uri,o.pattern||"",i3r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(j$i,"match");p();var i5c=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),GV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function o5c(t,e,r){return t.forceSet(GV,new GV(r.documents,r.basename||"")),["OK",null]}a(o5c,"handleTestingSetCompletionDocumentsChecked");var H$i=new fe("setCompletionDocuments"),$$i=Ne(i5c,o5c);function yTt(t,e,r,n){let o=t.get(GV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){H$i.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=s5c(o,r);return c&&c.length>0?G$i(c,s,e):void 0}else return H$i.debug(t,"Returning completions for all pre-set documents"),G$i(o.documents,s,e)}}a(yTt,"getTestCompletions");function G$i(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=mTt(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(G$i,"sliceAndMapCompletions");function s5c(t,e){return t.basename===Ji(e)?t.documents||[]:[]}a(s5c,"getFilteredDocs");var W$i=S.Object({doc:S.Object({position:u0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Lxe,version:S.Number()}),contextItems:S.Optional(Qfr)}),cFe;async function z$i(t,e,r,n){cFe&&(cFe.cancel(),cFe.dispose()),cFe=new Fn.CancellationTokenSource;let o=new o_([e,cFe.token]);r.contextItems&&ATt(t,r.contextItems);let s=yTt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Mt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await N9(t,r.doc,o)}catch(h){if(!(h instanceof V$i.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(ny).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Ru);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(z$i,"handleGetCompletionsHelper");var Y$i=Ne(W$i,(t,e,r)=>z$i(t,e,r,!1)),K$i=Ne(W$i,(t,e,r)=>z$i(t,e,r,!0));p();var a5c=S.Object({});function c5c(t,e,r){return[{defaultRules:t.get(Aw).getDefaultRules()},null]}a(c5c,"handleGetDefaultFileSafetyRulesChecked");var J$i=Ne(a5c,c5c);p();var Z$i=de(pU()),T_e=de(Xc());var l5c=S.Object({doc:S.Object({position:u0,uri:Lxe,version:S.Number()}),panelId:S.String()});function u5c(t,e,r,n,o){let s=pTt(o.completionText),c=(0,Z$i.SHA256)(s).toString();return t.get(Ru).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(u5c,"makeSolution");var s3r=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(ar)}onSolution(e){return this.service.connection.sendNotification(new T_e.NotificationType("PanelSolution"),u5c(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return X$i(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new T_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function X$i(t,e){return e.connection.sendNotification(new T_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(X$i,"reportDone");var lFe;async function d5c(t,e,r){lFe&&(lFe.cancel(),lFe.dispose()),lFe=new Fn.CancellationTokenSource;let n=new o_([e,lFe.token]),o=r.doc.position,s=gu.range(o,o),c=new s3r(t,r,s),l=t.get(NN);if(l.documents){let u=l.documents;gTt(o,u,c)}else{let u;try{u=await N9(t,r.doc,n)}catch(f){if(!(f instanceof T_e.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return f5c(t,r)}throw f}c.offset=u.offsetAt(o);let d=new C_e(u,o,n,10);hTt(t,d,c)}return[{solutionCountTarget:10},null]}a(d5c,"handleGetPanelCompletionsChecked");async function f5c(t,e){return await X$i(e.panelId,t.get(ar)),[{solutionCountTarget:0},null]}a(f5c,"produceEmptySolutions");var eVi=Ne(l5c,d5c);p();var p5c=S.Object({});async function h5c(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Lr).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(h5c,"handleGetUserInfoChecked");var tVi=Ne(p5c,h5c);p();var m5c=S.Object({});function g5c(t,e,r){return[{version:t.get(ds).getDisplayVersion(),buildType:LU(t),runtimeVersion:`node/${process.versions.node}`},null]}a(g5c,"handleGetVersionChecked");var rVi=Ne(m5c,g5c);p();Oo();var A5c=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 y5c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(Yo),o=n.create({capabilities:{skills:[LO]}}),s=new tp({message:"",type:"user"});await n.addTurn(o.id,s);let c=A_e({workDoneToken:Mt()});await t.get(Tc).begin(o,s,c);let d=(await new gw(t,o,s,e).skillResolver.resolve(LO))?.head?.name,h=await t.get(GX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(y5c,"handleGitCommitGenerateChecked");var nVi=Ne(A5c,y5c);p();var E5c=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function _5c(t,e,r){try{let o=await new em(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return At(t,"githubApi.listPullRequestChangedFiles",Wt.createAndMarkAsIssued()),Rt(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(ua(t,n,"githubApi.listPullRequestChangedFiles"),ai(t,"githubApi.listPullRequestChangedFiles",n),n instanceof dE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Qd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(_5c,"handleListPullRequestChangedFilesChecked");var iVi=Ne(E5c,_5c);p();p();var ETt=new fe("GitHubGraphQLClient"),_Tt=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(nr);return this.graphqlClient=SCn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){ETt.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++,ETt.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 { @@ -4085,7 +4085,7 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.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 mTt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(mTt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Fd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var n5c=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc))}),Y$i=4,S_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function i5c(t,e,r){try{let n=new gTt(t),o=await s5c(t,r),s=await n.searchPullRequests(o);await o5c(t,s);let c=a5c(s);return Et(t,"githubApi.searchPR",Wt.createAndMarkAsIssued()),At(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof S_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(qa(t,n,"githubApi.searchPR"),Vn(t,"githubApi.searchPR",n),n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(i5c,"handleSearchPRChecked");async function o5c(t,e){let r=new Zh(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(o5c,"appendCopilotWorkStatus");async function s5c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new S_e("The user is not logged in.",Ze.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 S_e("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(_f).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 S_e(l,Ze.NoGitHubRepository)}}return r}a(s5c,"replaceTemplateVariables");function a5c(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(a5c,"buildCopilotWorkStatusMeasurements");var K$i=Oe(n5c,i5c);p();var c5c=new fe("hook.list"),l5c=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});function u5c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=ufr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>dfr(u,"")).filter(u=>u!==void 0);if(c.length===0)continue;let l=n.get(o.uri);l===void 0&&(l={},n.set(o.uri,l)),(l[s]??=[]).push(...c)}for(let[o,s]of n)e.push({uri:o,source:"plugin",pluginUri:r.uri,providers:["BACKGROUND"],hooks:s})}return e}a(u5c,"pluginHookRows");async function d5c(t,e,r){let n=r.workspaceFolders??[],o=W5(t)&&fJ(t)?(async()=>{try{let l=(await t.get(uc).listPlugins()).filter(u=>u.enabled);return u5c(l)}catch(l){return l instanceof bl||c5c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(mE).listHooks(n)).map(l=>{let u={};for(let[d,f]of Object.entries(l.parsedPromptFile.hooks))f!==void 0&&(u[d]=[...f]);return{uri:l.promptPath.uri,storage:l.promptPath.storage,providers:["LOCAL","BACKGROUND"],hooks:u}});return o&&c.push(...await o),[c,null]}a(d5c,"listHooks");var J$i=Oe(l5c,d5c);p();Mo();var X$i=WQt.type,oFe;function Z$i(t){return{title:"Completion Accepted",command:jNe,arguments:[t]}}a(Z$i,"makeCommand");async function f5c(t,e,r){oFe&&(oFe.cancel(),oFe.dispose());let n=r.context.triggerKind===1;oFe=new Fn.CancellationTokenSource;let o=oFe.token,s=new i_([e,o]);r.contextItems&&pTt(t,r.contextItems,r.data);let c=hTt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:Z$i(Mt()),...g}))},null];let l=await P9(t,r.textDocument,s),u=r.position,d=await t.get(ry).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(Ru);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:Z$i(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(f5c,"handleChecked");var eVi=Oe(HXn,(t,e,r)=>f5c(t,e,r));p();p();function r3r(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 T_e(o)}a(r3r,"asReadableCert");function T_e(t){return t.replace(/\s/g,"")}a(T_e,"normalizeNewlines");var h5c=S.Object({});async function m5c(t){return[{certificates:(await t.get(pp).getAllRootCAs()).map(T_e)},null]}a(m5c,"handleListCertificatesChecked");var tVi=Oe(h5c,m5c);p();var nVi="mcpGateway/serversChanged",iVi="mcpGateway/serverDetailsChanged",oVi=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()})]),g5c=S.Object({source:oVi,name:S.String()}),A5c=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),rVi=S.Record(S.String(),S.Unknown()),y5c=S.Object({workspaceFolder:S.String(),user:rVi,project:rVi});async function E5c(t,e,r){let n=eFe(r.user),o=eFe(r.project);return await t.get(ey).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(E5c,"handleApplyConfigChecked");var sVi=Oe(y5c,E5c),_5c=S.Object({scope:A5c});function v5c(t,e,r){return[{servers:t.get(ey).listServers(r.scope).map(s=>({...s,providers:cO(s.source.kind==="plugin",void 0)}))},null]}a(v5c,"handleListServersChecked");var aVi=Oe(_5c,v5c),C5c=g5c;function b5c(t,e,r){return[{details:t.get(ey).getServerDetails(r)},null]}a(b5c,"handleGetServerDetailsChecked");var cVi=Oe(C5c,b5c),S5c=S.Object({source:oVi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function T5c(t,e,r){try{return await t.get(ey).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof bH)return[null,{code:Ze.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:o}]}}a(T5c,"handleServerActionChecked");var lVi=Oe(S5c,T5c);p();p();p();var uVi=de(Xc());var n3r=class extends uVi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},kie=class extends n3r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},ATt=class extends kie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},yTt=class extends kie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var ETt=class extends kie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function dVi(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(dVi,"getRegistryMetadataFromConfig");function fVi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?I5c(t,r):!1}catch{return!1}}a(fVi,"validateServerConfigurationMatch");function I5c(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(I5c,"validateRemoteURL");var pVi=300*1e3,PN=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 ETt(u)]:[null,new kie(`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:Ze.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:Ze.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ze.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:Ze.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=dVi(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?fVi(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(tr).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ze.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ze.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:Ze.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var x5c=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),hVi=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()))}),i3r=S.Intersect([hVi,S.Object({variables:S.Optional(S.Record(S.String(),hVi))})]),w5c=S.Intersect([i3r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),R5c=S.Intersect([i3r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),mVi=S.Union([w5c,R5c]),sFe=S.Intersect([i3r,S.Object({name:S.String()})]),k5c=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(sFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(sFe))})])),runtimeArguments:S.Optional(S.Array(mVi)),packageArguments:S.Optional(S.Array(mVi)),environmentVariables:S.Optional(S.Array(sFe))}),P5c=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(sFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(sFe))})]),D5c=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")]))}),N5c=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}),M5c=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}),O5c=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(N5c)},{additionalProperties:!0}),L5c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(x5c),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(D5c)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(k5c)),remotes:S.Optional(S.Array(P5c)),_meta:S.Optional(M5c)}),B5c=S.Object({server:L5c,_meta:O5c}),INh=S.Object({servers:S.Array(B5c),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),gVi=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())}),AVi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var aFe="mcp.registry.listServers",I_e="mcp.registry.getServer";async function F5c(t,e,r,n){return await t.get(PN).fetchServer(e,r,n)}a(F5c,"fetchServer");async function U5c(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(tr),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 eg(t,aFe,Wt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return Et(t,aFe,Wt.createAndMarkAsIssued()),At(t,aFe),[u,null]}catch(c){Vn(t,aFe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return eg(t,aFe,Wt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(U5c,"handleListServersChecked");async function Q5c(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ze.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ze.InvalidParams,message:"Version is required"}];let[n,o]=await F5c(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return eg(t,I_e,Wt.createAndMarkAsIssued(s)),At(t,I_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return eg(t,I_e,Wt.createAndMarkAsIssued(c)),At(t,I_e,c),[null,{code:Ze.InternalError,message:s}]}return Et(t,I_e,Wt.createAndMarkAsIssued()),At(t,I_e),[n,null]}a(Q5c,"handleGetServerChecked");var yVi=Oe(gVi,U5c),EVi=Oe(AVi,Q5c);p();p();var _Vi=S.Object({}),q5c=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()])}),j5c=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:q5c}),HNh=S.Object({mcp_registries:S.Array(j5c)});async function H5c(t){return await t.get(PN).fetchMcpRegistryAllowlist()}a(H5c,"fetchMcpRegistryAllowlist");async function G5c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await H5c(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ze.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ze.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(G5c,"handleGetMcpRegistryAllowlistChecked");var vVi=Oe(_Vi,G5c);p();var SVi=de(cee()),TVi=de(nd()),IVi=de(q_());p();Mo();var $5c=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()})}))}),qV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},o3r=new fe("setNextEditDocument");function V5c(t,e,r){return o3r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(qV,new qV(r.edits)),["OK",null]}a(V5c,"handleTestingSetNextEditDocumentChecked");var CVi=Oe($5c,V5c);function bVi(t,e,r,n){let o=t.get(qV);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?(o3r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(o3r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>W5c(c,r,n)))}}a(bVi,"getTestNextEditSuggestions");function W5c(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:[Mt()]}}}a(W5c,"createNextEditSuggestion");async function z5c(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Fs(r.textDocument.uri);t.get(h9).setForRequest(TVi.URI.parse(n),r.diagnostics??[]);let o=bVi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Vv);t.get(SVi.ObservableWorkspace).onUserPositionChange(n,new IVi.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:jNe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(z5c,"handleChecked");var xVi=Oe(Ivn,z5c);p();var K5c=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function J5c(t,e,r){let n=t.get(Ru),o=n.get(r.uuid);return o&&(Z5c(r,o)==="full"?(n.delete(r.uuid),Pme(t,o,o.triggerCategory)):qdt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(J5c,"notifyAcceptedChecked");function Z5c(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}));Qdt(t,"ghostText",s.offset,s.uri,c),t.get(iy).resetState()}return["OK",null]}a(r4c,"notifyRejectedChecked");var kVi=Oe(t4c,r4c);p();var n4c=S.Object({uuid:S.String({minLength:1})});function i4c(t,e,r){let o=t.get(Ru).get(r.uuid);return o&&Qlt(t,o.triggerCategory,o),["OK",null]}a(i4c,"notifyShownChecked");var PVi=Oe(n4c,i4c);p();var o4c=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function s4c(t,e,r){let n=t.get(tT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(s4c,"handleParseTerminalCommandChecked");var DVi=Oe(o4c,s4c);p();p();function NVi(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(NVi,"enumSchema");var a4c=S.Union([S.Object({kind:S.Literal("relativePath"),path:S.String()}),S.Object({kind:S.Literal("github"),repo:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("url"),url:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("npm"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())}),S.Object({kind:S.Literal("pip"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())})]),c4c=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:NVi(MX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),MVi=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:a4c,marketplace:S.String(),marketplaceReference:c4c,marketplaceType:NVi(UDe),readmeUri:S.Optional(S.String())}),jV=S.Object({pluginUri:S.String()}),_Tt=S.Object({source:S.String()});p();var l4c="_direct";function OVi(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??l4c;return{qualifiedId:`${n}@${o}`,name:n,label:t.label,pluginUri:t.uri,...r?.marketplace!==void 0&&{marketplace:r.marketplace},enabled:t.enabled,disabledByPolicy:t.policyBlocked===!0,readOnly:e(t.uri),...r?.description!==void 0&&{description:r.description},...r?.version!==void 0&&{version:r.version},...r?.readmeUri!==void 0&&{readmeUri:r.readmeUri},...r?.marketplaceType!==void 0&&{marketplaceType:r.marketplaceType},...r?.sourceDescriptor!==void 0&&{sourceDescriptor:r.sourceDescriptor},hooks:t.hooks,commands:t.commands,skills:t.skills,agents:t.agents,instructions:t.instructions,mcpServerDefinitions:t.mcpServerDefinitions}}a(OVi,"toPluginListRow");async function Dp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof xH?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Dp,"withPluginErrorHandling");async function u4c(t,e,r){return Dp(()=>t.get(uc).disablePlugin(r.pluginUri))}a(u4c,"handlePluginsDisableChecked");var LVi=Oe(jV,u4c);p();async function d4c(t,e,r){return Dp(()=>t.get(uc).enablePlugin(r.pluginUri))}a(d4c,"handlePluginsEnableChecked");var BVi=Oe(jV,d4c);p();var f4c=S.Object({plugin:MVi});async function p4c(t,e,r){return Dp(async()=>({pluginUri:await t.get(uc).installPlugin(r.plugin)}))}a(p4c,"handlePluginsInstallChecked");var FVi=Oe(f4c,p4c);p();var h4c=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function m4c(t,e,r){return Dp(()=>t.get(uc).installPluginFromSource(r.source,r.pluginName))}a(m4c,"handlePluginsInstallFromSourceChecked");var UVi=Oe(h4c,m4c);p();var g4c=S.Object({});async function A4c(t,e,r){return Dp(async()=>{let n=t.get(uc);return(await n.listPlugins()).map(s=>OVi(s,c=>n.isReadOnlyPlugin(c)))})}a(A4c,"handlePluginsListChecked");var QVi=Oe(g4c,A4c);p();async function y4c(t,e,r){return Dp(()=>t.get(uc).addMarketplace(r.source))}a(y4c,"handleMarketplaceAddChecked");var qVi=Oe(_Tt,y4c);p();var E4c=S.Object({source:S.Optional(S.String())});async function _4c(t,e,r){return Dp(()=>t.get(uc).browseMarketplace(r.source))}a(_4c,"handleMarketplaceBrowseChecked");var jVi=Oe(E4c,_4c);p();var v4c=S.Object({});async function C4c(t,e,r){return Dp(async()=>[...await t.get(uc).listMarketplaces()])}a(C4c,"handleMarketplaceListChecked");var HVi=Oe(v4c,C4c);p();async function b4c(t,e,r){return Dp(()=>t.get(uc).removeMarketplace(r.source))}a(b4c,"handleMarketplaceRemoveChecked");var GVi=Oe(_Tt,b4c);p();async function S4c(t,e,r){return Dp(()=>t.get(uc).uninstallPlugin(r.pluginUri))}a(S4c,"handlePluginsUninstallChecked");var $Vi=Oe(jV,S4c);p();async function T4c(t,e,r){return Dp(async()=>({updated:await t.get(uc).updatePlugin(r.pluginUri)}))}a(T4c,"handlePluginsUpdateChecked");var VVi=Oe(jV,T4c);p();var I4c=qXn;function x4c(t,e,r){let n=t.get(hm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new C_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(x4c,"registerContextProviders");var WVi=Oe(I4c,x4c);p();p();var w4c=S.Object({uri:S.Optional(S.String())}),R4c=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),YVi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[gQr]:S.Optional(w4c),http:S.Optional(Mdn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),cFe=Object.keys(YVi.properties).filter(t=>t!=="github"),k4c=S.Intersect([YVi,R4c]),P4c=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),zVi=qu.Compile(P4c),s3r=qu.Compile(k4c);function QL(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(QL,"normalizePromptSetting");async function CTt(t,e){if(!zVi.Check(e))throw vTt(t),new QA(zVi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&D4c(t,r),vTt(t,r),Promise.resolve()}a(CTt,"notifyChangeConfiguration");function D4c(t,e){for(let n of s3r.Errors(e)){let o=n.path.split("/")?.[1];$o.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!s3r.Check(e))throw new QA(s3r.Errors(e));e.http&&a3r(t,e.http);let r=e["github-enterprise"];r&&l7e(t,r.uri),e.github?.copilot&&N4c(t,e.github.copilot)}a(D4c,"applySettingsToConfiguration");function N4c(t,e){let r=t.get(rb),n={};for(let o of Object.values(Ye)){let s=Bdn(e,o);n[o]=s}r.setCopilotSettings(n),Xhe.clearCache(),GSt.clearCache(),typeof e.mcp=="string"&&W4c(t,e.mcp),e.agent&&typeof e.agent=="object"&&(z4c(t,e.agent),Y4c(t,e.agent),K4c(t,e.agent)),M4c(t,e.globalCopilotInstructions),O4c(t,e.globalGitCommitInstructions),L4c(t,e.globalAgentsMdInstructions),B4c(t,e.globalClaudeMdInstructions),F4c(t,e.globalInstructionFiles),U4c(t,e.globalPromptFiles),H4c(t,e.instructionFileLocations),G4c(t,e.promptFileLocations),$4c(t,e.agentFileLocations),V4c(t,e.skillFileLocations)}a(N4c,"applyCopilotConfiguration");function M4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalCopilotInstructions(n)}catch(r){$o.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(M4c,"applyGlobalCopilotInstructionsConfiguration");function O4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalGitCommitInstructions(n)}catch(r){$o.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(O4c,"applyGlobalGitCommitInstructionsConfiguration");function L4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalAgentsMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(L4c,"applyGlobalAgentsMdInstructionsConfiguration");function B4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalClaudeMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(B4c,"applyGlobalClaudeMdInstructionsConfiguration");function F4c(t,e){try{let r=t.get(bf),n=(e||[]).map(QL);r.setGlobalInstructionFiles(n)}catch(r){$o.error(t,"Failed to apply global instruction files configuration",r)}}a(F4c,"applyGlobalInstructionFilesConfiguration");function U4c(t,e){try{let r=t.get(Cg),n=(e||[]).map(QL);r.setGlobalPromptFiles(n)}catch(r){$o.error(t,"Failed to apply global prompt files configuration",r)}}a(U4c,"applyGlobalPromptFilesConfiguration");function Q4c(t){return t?Array.isArray(t)?t.map(QL):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(Q4c,"normalizeFileLocations");function q4c(t){let e=QL(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(q4c,"normalizeInstructionPromptSetting");function j4c(t){return t?Array.isArray(t)?t.map(q4c):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(j4c,"normalizeInstructionFileLocations");function H4c(t,e){try{let r=t.get(bf);if(e===void 0)return;r.setInstructionFileLocations(j4c(e))}catch(r){$o.error(t,"Failed to apply instruction file locations configuration",r)}}a(H4c,"applyInstructionFileLocationsConfiguration");function G4c(t,e){try{let r=t.get(Cg);if(e===void 0)return;r.setPromptFileLocations(Q4c(e))}catch(r){$o.error(t,"Failed to apply prompt file locations configuration",r)}}a(G4c,"applyPromptFileLocationsConfiguration");function $4c(t,e){try{let r=t.get(Ld);if(e===void 0)return;let n=e.map(QL);r.setAgentFileLocations(n)}catch(r){$o.error(t,"Failed to apply agent file locations configuration",r)}}a($4c,"applyAgentFileLocationsConfiguration");function V4c(t,e){try{let r=t.get(h0);if(e===void 0)return;let n=e.map(QL);r.setSkillFileLocations(n)}catch(r){$o.error(t,"Failed to apply skill file locations configuration",r)}}a(V4c,"applySkillFileLocationsConfiguration");function a3r(t,e){let r=t.get(rb);e.proxy===void 0&&(e=Odn(r.env));try{r.setHttpSettings(iIe(e))}catch(n){if(!(n instanceof TypeError))throw n;$o.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(a3r,"applyHttpConfiguration");async function W4c(t,e){let r;try{r=eFe(JSON.parse(e||"{}"))}catch(n){$o.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(o_).updateMCPServers(r)}catch(n){$o.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(W4c,"applyMCPConfiguration");function z4c(t,e){try{let r=e;t.get(tT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){$o.error(t,"Failed to apply settings configuration",r)}}a(z4c,"applyTerminalAutoApproveConfiguration");function Y4c(t,e){try{let r=e;t.get(mw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){$o.error(t,"Failed to apply edit auto approve configuration",r)}}a(Y4c,"applyEditAutoApproveConfiguration");function K4c(t,e){try{let r=e;t.get(dF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){$o.error(t,"Failed to apply MCP auto approve configuration",r)}}a(K4c,"applyMCPAutoApproveConfiguration");function vTt(t,e){if(t.get(rb).markReady(),!t.get(bn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(pf).initialize(r)}}a(vTt,"initializePostConfigurationDependencies");var KVi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),J4c=S.Object({editorInfo:KVi,editorPluginInfo:KVi,editorConfiguration:S.Optional(S.Object({}))});async function Z4c(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),jdt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await CTt(t,{settings:r.editorConfiguration}),Et(t,"setEditorInfo");for(let n of["github",...cFe])r.editorConfiguration&&n in r.editorConfiguration&&Et(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(Z4c,"handleSetEditorInfoChecked");var JVi=Oe(J4c,Z4c);p();var X4c=S.Object({options:S.Optional(S.Object({}))});async function eLc(t,e,r){let n=t.get(HT),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ze.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ze.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(eLc,"handleSignInConfirmChecked");var ZVi=Oe(X4c,eLc);p();var tLc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function rLc(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(HT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:Gdt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof yi))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(rLc,"handleSignInInitiateChecked");var c3r=Oe(tLc,rLc);p();p();p();var XVi=["google","apple"],bTt=S.Optional(S.Union(XVi.map(t=>S.Literal(t))));function eWi(t){return typeof t=="string"&&XVi.includes(t)}a(eWi,"isGitHubSocialProvider");function l3r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(l3r,"isGitHubSocialProviderApplicableHostname");function tWi(t,e){if(!e)return t;try{let r=new URL(t);return l3r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(tWi,"addGitHubSocialProviderToVerificationUri");p();function rWi(){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(rWi,"isBrowserAvailable");function nLc(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(nLc,"getGitHubOAuthServerMetadata");async function STt(t,e,r={},n){let o=performance.now();Dme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!rWi())throw new FU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=UU(t,r.authAuthority),u=nLc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=l3r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h,loginHint:r.loginHint}),g=m.scopes||f,A=t.get(zp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new yi("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}),K2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw K2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(STt,"performGitHubOAuthCodeFlow");p();p();p();p$e();var x_e=class extends Vm{constructor(r,n=new u3r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ar);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)}},u3r=class extends Vm{static{a(this,"SpawnUrlOpener")}async open(e){await PTe(e)}};p();var nWi=require("crypto"),iWi=de(require("http"));p();var TTt=new fe("OAuth Code Flow");function d3r(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 ETt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(ETt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Qd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Lr).resolveSession();if(!e)throw new dE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var v5c=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc))}),oVi=4,I_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function C5c(t,e,r){try{let n=new _Tt(t),o=await S5c(t,r),s=await n.searchPullRequests(o);await b5c(t,s);let c=T5c(s);return At(t,"githubApi.searchPR",Wt.createAndMarkAsIssued()),Rt(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof I_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof dE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(ua(t,n,"githubApi.searchPR"),ai(t,"githubApi.searchPR",n),n instanceof Qd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(C5c,"handleSearchPRChecked");async function b5c(t,e){let r=new em(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(b5c,"appendCopilotWorkStatus");async function S5c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Lr).resolveSession();if(!n)throw new I_e("The user is not logged in.",Ze.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 I_e("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(Cf).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 I_e(l,Ze.NoGitHubRepository)}}return r}a(S5c,"replaceTemplateVariables");function T5c(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(T5c,"buildCopilotWorkStatusMeasurements");var sVi=Ne(v5c,C5c);p();var I5c=new fe("hook.list"),x5c=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});function w5c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=pfr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>hfr(u,"")).filter(u=>u!==void 0);if(c.length===0)continue;let l=n.get(o.uri);l===void 0&&(l={},n.set(o.uri,l)),(l[s]??=[]).push(...c)}for(let[o,s]of n)e.push({uri:o,source:"plugin",pluginUri:r.uri,providers:["BACKGROUND"],hooks:s})}return e}a(w5c,"pluginHookRows");async function R5c(t,e,r){let n=r.workspaceFolders??[],o=DH(t)&&hJ(t)?(async()=>{try{let l=(await t.get(uc).listPlugins()).filter(u=>u.enabled);return w5c(l)}catch(l){return l instanceof Sl||I5c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(gE).listHooks(n)).map(l=>{let u={};for(let[d,f]of Object.entries(l.parsedPromptFile.hooks))f!==void 0&&(u[d]=[...f]);return{uri:l.promptPath.uri,storage:l.promptPath.storage,providers:["LOCAL","BACKGROUND"],hooks:u}});return o&&c.push(...await o),[c,null]}a(R5c,"listHooks");var aVi=Ne(x5c,R5c);p();Oo();var lVi=JQt.type,uFe;function cVi(t){return{title:"Completion Accepted",command:WNe,arguments:[t]}}a(cVi,"makeCommand");async function k5c(t,e,r){uFe&&(uFe.cancel(),uFe.dispose());let n=r.context.triggerKind===1;uFe=new Fn.CancellationTokenSource;let o=uFe.token,s=new o_([e,o]);r.contextItems&&ATt(t,r.contextItems,r.data);let c=yTt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:cVi(Mt()),...g}))},null];let l=await N9(t,r.textDocument,s),u=r.position,d=await t.get(ny).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(Ru);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:cVi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(k5c,"handleChecked");var uVi=Ne(JXn,(t,e,r)=>k5c(t,e,r));p();p();function a3r(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 x_e(o)}a(a3r,"asReadableCert");function x_e(t){return t.replace(/\s/g,"")}a(x_e,"normalizeNewlines");var D5c=S.Object({});async function N5c(t){return[{certificates:(await t.get(mp).getAllRootCAs()).map(x_e)},null]}a(N5c,"handleListCertificatesChecked");var dVi=Ne(D5c,N5c);p();var pVi="mcpGateway/serversChanged",hVi="mcpGateway/serverDetailsChanged",mVi=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()})]),M5c=S.Object({source:mVi,name:S.String()}),O5c=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),fVi=S.Record(S.String(),S.Unknown()),L5c=S.Object({workspaceFolder:S.String(),user:fVi,project:fVi});async function B5c(t,e,r){let n=oFe(r.user),o=oFe(r.project);return await t.get(ty).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(B5c,"handleApplyConfigChecked");var gVi=Ne(L5c,B5c),F5c=S.Object({scope:O5c});function U5c(t,e,r){return[{servers:t.get(ty).listServers(r.scope).map(s=>({...s,providers:QS(s.source.kind==="plugin",void 0)}))},null]}a(U5c,"handleListServersChecked");var AVi=Ne(F5c,U5c),Q5c=M5c;function q5c(t,e,r){return[{details:t.get(ty).getServerDetails(r)},null]}a(q5c,"handleGetServerDetailsChecked");var yVi=Ne(Q5c,q5c),j5c=S.Object({source:mVi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function H5c(t,e,r){try{return await t.get(ty).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof IH)return[null,{code:Ze.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:o}]}}a(H5c,"handleServerActionChecked");var EVi=Ne(j5c,H5c);p();p();p();var _Vi=de(Xc());var c3r=class extends _Vi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},Pie=class extends c3r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},vTt=class extends Pie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},CTt=class extends Pie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var bTt=class extends Pie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function vVi(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(vVi,"getRegistryMetadataFromConfig");function CVi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?G5c(t,r):!1}catch{return!1}}a(CVi,"validateServerConfigurationMatch");function G5c(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(G5c,"validateRemoteURL");var bVi=300*1e3,MN=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 bTt(u)]:[null,new Pie(`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:Ze.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:Ze.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ze.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:Ze.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=vVi(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?CVi(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(nr).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ze.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ze.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:Ze.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var $5c=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),SVi=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()))}),l3r=S.Intersect([SVi,S.Object({variables:S.Optional(S.Record(S.String(),SVi))})]),V5c=S.Intersect([l3r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),W5c=S.Intersect([l3r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),TVi=S.Union([V5c,W5c]),dFe=S.Intersect([l3r,S.Object({name:S.String()})]),z5c=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(dFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(dFe))})])),runtimeArguments:S.Optional(S.Array(TVi)),packageArguments:S.Optional(S.Array(TVi)),environmentVariables:S.Optional(S.Array(dFe))}),Y5c=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(dFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(dFe))})]),K5c=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")]))}),J5c=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}),Z5c=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}),X5c=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(J5c)},{additionalProperties:!0}),e4c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional($5c),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(K5c)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(z5c)),remotes:S.Optional(S.Array(Y5c)),_meta:S.Optional(Z5c)}),t4c=S.Object({server:e4c,_meta:X5c}),eMh=S.Object({servers:S.Array(t4c),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),IVi=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())}),xVi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var fFe="mcp.registry.listServers",w_e="mcp.registry.getServer";async function r4c(t,e,r,n){return await t.get(MN).fetchServer(e,r,n)}a(r4c,"fetchServer");async function n4c(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(nr),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 tg(t,fFe,Wt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return At(t,fFe,Wt.createAndMarkAsIssued()),Rt(t,fFe),[u,null]}catch(c){ai(t,fFe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return tg(t,fFe,Wt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(n4c,"handleListServersChecked");async function i4c(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ze.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ze.InvalidParams,message:"Version is required"}];let[n,o]=await r4c(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return tg(t,w_e,Wt.createAndMarkAsIssued(s)),Rt(t,w_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return tg(t,w_e,Wt.createAndMarkAsIssued(c)),Rt(t,w_e,c),[null,{code:Ze.InternalError,message:s}]}return At(t,w_e,Wt.createAndMarkAsIssued()),Rt(t,w_e),[n,null]}a(i4c,"handleGetServerChecked");var wVi=Ne(IVi,n4c),RVi=Ne(xVi,i4c);p();p();var kVi=S.Object({}),o4c=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()])}),s4c=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:o4c}),AMh=S.Object({mcp_registries:S.Array(s4c)});async function a4c(t){return await t.get(MN).fetchMcpRegistryAllowlist()}a(a4c,"fetchMcpRegistryAllowlist");async function c4c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await a4c(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ze.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ze.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(c4c,"handleGetMcpRegistryAllowlistChecked");var PVi=Ne(kVi,c4c);p();var MVi=de(lee()),OVi=de(id()),LVi=de(j_());p();Oo();var l4c=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()})}))}),$V=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},u3r=new fe("setNextEditDocument");function u4c(t,e,r){return u3r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet($V,new $V(r.edits)),["OK",null]}a(u4c,"handleTestingSetNextEditDocumentChecked");var DVi=Ne(l4c,u4c);function NVi(t,e,r,n){let o=t.get($V);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?(u3r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(u3r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>d4c(c,r,n)))}}a(NVi,"getTestNextEditSuggestions");function d4c(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:[Mt()]}}}a(d4c,"createNextEditSuggestion");async function f4c(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Fs(r.textDocument.uri);t.get(g9).setForRequest(OVi.URI.parse(n),r.diagnostics??[]);let o=NVi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(zv);t.get(MVi.ObservableWorkspace).onUserPositionChange(n,new LVi.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:WNe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(f4c,"handleChecked");var BVi=Ne(Pvn,f4c);p();var h4c=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function m4c(t,e,r){let n=t.get(Ru),o=n.get(r.uuid);return o&&(g4c(r,o)==="full"?(n.delete(r.uuid),Nme(t,o,o.triggerCategory)):$dt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(m4c,"notifyAcceptedChecked");function g4c(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}));Gdt(t,"ghostText",s.offset,s.uri,c),t.get(oy).resetState()}return["OK",null]}a(_4c,"notifyRejectedChecked");var QVi=Ne(E4c,_4c);p();var v4c=S.Object({uuid:S.String({minLength:1})});function C4c(t,e,r){let o=t.get(Ru).get(r.uuid);return o&&Glt(t,o.triggerCategory,o),["OK",null]}a(C4c,"notifyShownChecked");var qVi=Ne(v4c,C4c);p();var b4c=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function S4c(t,e,r){let n=t.get(nT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(S4c,"handleParseTerminalCommandChecked");var jVi=Ne(b4c,S4c);p();p();function HVi(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(HVi,"enumSchema");var T4c=S.Union([S.Object({kind:S.Literal("relativePath"),path:S.String()}),S.Object({kind:S.Literal("github"),repo:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("url"),url:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("npm"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())}),S.Object({kind:S.Literal("pip"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())})]),I4c=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:HVi(OX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),GVi=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:T4c,marketplace:S.String(),marketplaceReference:I4c,marketplaceType:HVi(jDe),readmeUri:S.Optional(S.String())}),VV=S.Object({pluginUri:S.String()}),STt=S.Object({source:S.String()});p();var x4c="_direct";function $Vi(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??x4c;return{qualifiedId:`${n}@${o}`,name:n,label:t.label,pluginUri:t.uri,...r?.marketplace!==void 0&&{marketplace:r.marketplace},enabled:t.enabled,disabledByPolicy:t.policyBlocked===!0,readOnly:e(t.uri),...r?.description!==void 0&&{description:r.description},...r?.version!==void 0&&{version:r.version},...r?.readmeUri!==void 0&&{readmeUri:r.readmeUri},...r?.marketplaceType!==void 0&&{marketplaceType:r.marketplaceType},...r?.sourceDescriptor!==void 0&&{sourceDescriptor:r.sourceDescriptor},hooks:t.hooks,commands:t.commands,skills:t.skills,agents:t.agents,instructions:t.instructions,mcpServerDefinitions:t.mcpServerDefinitions}}a($Vi,"toPluginListRow");async function Mp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof kH?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Mp,"withPluginErrorHandling");async function w4c(t,e,r){return Mp(()=>t.get(uc).disablePlugin(r.pluginUri))}a(w4c,"handlePluginsDisableChecked");var VVi=Ne(VV,w4c);p();async function R4c(t,e,r){return Mp(()=>t.get(uc).enablePlugin(r.pluginUri))}a(R4c,"handlePluginsEnableChecked");var WVi=Ne(VV,R4c);p();var k4c=S.Object({plugin:GVi});async function P4c(t,e,r){return Mp(async()=>({pluginUri:await t.get(uc).installPlugin(r.plugin)}))}a(P4c,"handlePluginsInstallChecked");var zVi=Ne(k4c,P4c);p();var D4c=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function N4c(t,e,r){return Mp(()=>t.get(uc).installPluginFromSource(r.source,r.pluginName))}a(N4c,"handlePluginsInstallFromSourceChecked");var YVi=Ne(D4c,N4c);p();var M4c=S.Object({});async function O4c(t,e,r){return Mp(async()=>{let n=t.get(uc);return(await n.listPlugins()).map(s=>$Vi(s,c=>n.isReadOnlyPlugin(c)))})}a(O4c,"handlePluginsListChecked");var KVi=Ne(M4c,O4c);p();async function L4c(t,e,r){return Mp(()=>t.get(uc).addMarketplace(r.source))}a(L4c,"handleMarketplaceAddChecked");var JVi=Ne(STt,L4c);p();var B4c=S.Object({source:S.Optional(S.String())});async function F4c(t,e,r){return Mp(()=>t.get(uc).browseMarketplace(r.source))}a(F4c,"handleMarketplaceBrowseChecked");var ZVi=Ne(B4c,F4c);p();var U4c=S.Object({});async function Q4c(t,e,r){return Mp(async()=>[...await t.get(uc).listMarketplaces()])}a(Q4c,"handleMarketplaceListChecked");var XVi=Ne(U4c,Q4c);p();async function q4c(t,e,r){return Mp(()=>t.get(uc).removeMarketplace(r.source))}a(q4c,"handleMarketplaceRemoveChecked");var eWi=Ne(STt,q4c);p();async function j4c(t,e,r){return Mp(()=>t.get(uc).uninstallPlugin(r.pluginUri))}a(j4c,"handlePluginsUninstallChecked");var tWi=Ne(VV,j4c);p();async function H4c(t,e,r){return Mp(async()=>({updated:await t.get(uc).updatePlugin(r.pluginUri)}))}a(H4c,"handlePluginsUpdateChecked");var rWi=Ne(VV,H4c);p();var G4c=YXn;function $4c(t,e,r){let n=t.get(gm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new S_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a($4c,"registerContextProviders");var nWi=Ne(G4c,$4c);p();p();var V4c=S.Object({uri:S.Optional(S.String())}),W4c=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),oWi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[vQr]:S.Optional(V4c),http:S.Optional(Udn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),pFe=Object.keys(oWi.properties).filter(t=>t!=="github"),z4c=S.Intersect([oWi,W4c]),Y4c=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),iWi=ju.Compile(Y4c),d3r=ju.Compile(z4c);function qL(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(qL,"normalizePromptSetting");async function ITt(t,e){if(!iWi.Check(e))throw TTt(t),new qA(iWi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&K4c(t,r),TTt(t,r),Promise.resolve()}a(ITt,"notifyChangeConfiguration");function K4c(t,e){for(let n of d3r.Errors(e)){let o=n.path.split("/")?.[1];Vo.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!d3r.Check(e))throw new qA(d3r.Errors(e));e.http&&f3r(t,e.http);let r=e["github-enterprise"];r&&h7e(t,r.uri),e.github?.copilot&&J4c(t,e.github.copilot)}a(K4c,"applySettingsToConfiguration");function J4c(t,e){let r=t.get(rb),n={};for(let o of Object.values(Ye)){let s=jdn(e,o);n[o]=s}r.setCopilotSettings(n),tme.clearCache(),zSt.clearCache(),typeof e.mcp=="string"&&dLc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(fLc(t,e.agent),pLc(t,e.agent),hLc(t,e.agent)),Z4c(t,e.globalCopilotInstructions),X4c(t,e.globalGitCommitInstructions),eLc(t,e.globalAgentsMdInstructions),tLc(t,e.globalClaudeMdInstructions),rLc(t,e.globalInstructionFiles),nLc(t,e.globalPromptFiles),aLc(t,e.instructionFileLocations),cLc(t,e.promptFileLocations),lLc(t,e.agentFileLocations),uLc(t,e.skillFileLocations)}a(J4c,"applyCopilotConfiguration");function Z4c(t,e){try{let r=t.get(Tf),n=qL(e);r.setGlobalCopilotInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(Z4c,"applyGlobalCopilotInstructionsConfiguration");function X4c(t,e){try{let r=t.get(Tf),n=qL(e);r.setGlobalGitCommitInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(X4c,"applyGlobalGitCommitInstructionsConfiguration");function eLc(t,e){try{let r=t.get(Tf),n=qL(e);r.setGlobalAgentsMdInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(eLc,"applyGlobalAgentsMdInstructionsConfiguration");function tLc(t,e){try{let r=t.get(Tf),n=qL(e);r.setGlobalClaudeMdInstructions(n)}catch(r){Vo.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(tLc,"applyGlobalClaudeMdInstructionsConfiguration");function rLc(t,e){try{let r=t.get(Tf),n=(e||[]).map(qL);r.setGlobalInstructionFiles(n)}catch(r){Vo.error(t,"Failed to apply global instruction files configuration",r)}}a(rLc,"applyGlobalInstructionFilesConfiguration");function nLc(t,e){try{let r=t.get(bg),n=(e||[]).map(qL);r.setGlobalPromptFiles(n)}catch(r){Vo.error(t,"Failed to apply global prompt files configuration",r)}}a(nLc,"applyGlobalPromptFilesConfiguration");function iLc(t){return t?Array.isArray(t)?t.map(qL):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(iLc,"normalizeFileLocations");function oLc(t){let e=qL(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(oLc,"normalizeInstructionPromptSetting");function sLc(t){return t?Array.isArray(t)?t.map(oLc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(sLc,"normalizeInstructionFileLocations");function aLc(t,e){try{let r=t.get(Tf);if(e===void 0)return;r.setInstructionFileLocations(sLc(e))}catch(r){Vo.error(t,"Failed to apply instruction file locations configuration",r)}}a(aLc,"applyInstructionFileLocationsConfiguration");function cLc(t,e){try{let r=t.get(bg);if(e===void 0)return;r.setPromptFileLocations(iLc(e))}catch(r){Vo.error(t,"Failed to apply prompt file locations configuration",r)}}a(cLc,"applyPromptFileLocationsConfiguration");function lLc(t,e){try{let r=t.get(Fd);if(e===void 0)return;let n=e.map(qL);r.setAgentFileLocations(n)}catch(r){Vo.error(t,"Failed to apply agent file locations configuration",r)}}a(lLc,"applyAgentFileLocationsConfiguration");function uLc(t,e){try{let r=t.get(g0);if(e===void 0)return;let n=e.map(qL);r.setSkillFileLocations(n)}catch(r){Vo.error(t,"Failed to apply skill file locations configuration",r)}}a(uLc,"applySkillFileLocationsConfiguration");function f3r(t,e){let r=t.get(rb);e.proxy===void 0&&(e=Qdn(r.env));try{r.setHttpSettings(aIe(e))}catch(n){if(!(n instanceof TypeError))throw n;Vo.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(f3r,"applyHttpConfiguration");async function dLc(t,e){let r;try{r=oFe(JSON.parse(e||"{}"))}catch(n){Vo.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(s_).updateMCPServers(r)}catch(n){Vo.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(dLc,"applyMCPConfiguration");function fLc(t,e){try{let r=e;t.get(nT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){Vo.error(t,"Failed to apply settings configuration",r)}}a(fLc,"applyTerminalAutoApproveConfiguration");function pLc(t,e){try{let r=e;t.get(Aw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){Vo.error(t,"Failed to apply edit auto approve configuration",r)}}a(pLc,"applyEditAutoApproveConfiguration");function hLc(t,e){try{let r=e;t.get(pF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){Vo.error(t,"Failed to apply MCP auto approve configuration",r)}}a(hLc,"applyMCPAutoApproveConfiguration");function TTt(t,e){if(t.get(rb).markReady(),!t.get(bn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(mf).initialize(r)}}a(TTt,"initializePostConfigurationDependencies");var sWi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),mLc=S.Object({editorInfo:sWi,editorPluginInfo:sWi,editorConfiguration:S.Optional(S.Object({}))});async function gLc(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),Vdt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await ITt(t,{settings:r.editorConfiguration}),At(t,"setEditorInfo");for(let n of["github",...pFe])r.editorConfiguration&&n in r.editorConfiguration&&At(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(gLc,"handleSetEditorInfoChecked");var aWi=Ne(mLc,gLc);p();var ALc=S.Object({options:S.Optional(S.Object({}))});async function yLc(t,e,r){let n=t.get($T),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ze.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ze.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(yLc,"handleSignInConfirmChecked");var cWi=Ne(ALc,yLc);p();var ELc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function _Lc(t,e,r){try{let o=await t.get(Lr).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get($T).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:zdt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof yi))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(_Lc,"handleSignInInitiateChecked");var p3r=Ne(ELc,_Lc);p();p();p();var lWi=["google","apple"],xTt=S.Optional(S.Union(lWi.map(t=>S.Literal(t))));function uWi(t){return typeof t=="string"&&lWi.includes(t)}a(uWi,"isGitHubSocialProvider");function h3r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(h3r,"isGitHubSocialProviderApplicableHostname");function dWi(t,e){if(!e)return t;try{let r=new URL(t);return h3r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(dWi,"addGitHubSocialProviderToVerificationUri");p();function fWi(){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(fWi,"isBrowserAvailable");function vLc(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(vLc,"getGitHubOAuthServerMetadata");async function wTt(t,e,r={},n){let o=performance.now();Mme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!fWi())throw new QU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=qU(t,r.authAuthority),u=vLc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=h3r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h,loginHint:r.loginHint}),g=m.scopes||f,A=t.get(Kp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new yi("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Lr).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),X2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw X2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(wTt,"performGitHubOAuthCodeFlow");p();p();p();y$e();var R_e=class extends zm{constructor(r,n=new m3r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ar);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)}},m3r=class extends zm{static{a(this,"SpawnUrlOpener")}async open(e){await MTe(e)}};p();var pWi=require("crypto"),hWi=de(require("http"));p();var RTt=new fe("OAuth Code Flow");function g3r(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 @@ -4159,49 +4159,49 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.CancellationTokenSource,s } -`;var p3r=["authorization_code","refresh_token"],w_e=33428,ITt=class{constructor(e,r){this._logger=new fe("LoopbackAuthServer");this.nonce=(0,nWi.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=iWi.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 yi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),qNe(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 yi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),qNe(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 yi("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}),qNe(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 yi("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}),qNe(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(f3r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(f3r)}})}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 ${w_e} 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(w_e,"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 xTt=require("crypto");var lFe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,xTt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,xTt.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 iLc="Timed out",oWi="Sign-in request was cancelled",h3r=class{static{a(this,"CodeFlow")}},R_e=class extends h3r{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=lFe.isServerSupported(n.code_challenge_methods_supported),h=f?lFe.createPKCEParameters():void 0;f?Nr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Nr.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 ITt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Nr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new x_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(iLc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Nr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(oWi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(oWi))});b.push(N)}))}v=(await Promise.race(w)).code,Nr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Nr.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=>{Nr.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);Nr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await PX(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 Nr.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 DN=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=>d3r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Yn).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(zp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=eWi(r.provider)?r.provider:void 0,d=typeof r.loginHint=="string"?r.loginHint:void 0,f=d?{login:d,provider:u}:{prompt:"select_account",provider:u},h=await new R_e(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,f,r.cancellationToken),m=await this.tokenToSession(h.access_token,e);this.afterSessionLoad(m);let g=o.findIndex(y=>y.account.id===m.account.id&&d3r([...y.scopes].sort(),n)),A=new Array;return g>-1?A.push(...o.splice(g,1,m)):o.push(m),await this.storeSessions(o),m}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(Yn).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(tr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return TTt.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 TTt.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 TTt.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 oLc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:bTt,loginHint:S.Optional(S.String({minLength:1}))});async function sLc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.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:Ze.AuthEnvVarConflict,message:d7e(c)}];let l=await STt(t,(u,d)=>new DN(u,DN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(l.status))throw new yi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof FU)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof yi))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(sLc,"handleSignInWithCodeFlowChecked");var sWi=Oe(oLc,sLc);p();p();p();var D9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},uFe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function aWi(t,e,r){return e.isCancellationRequested?Promise.reject(new D9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new D9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new uFe))},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(aWi,"raceWithCancellationAndTimeout");var aLc=["repo","workflow"];async function cLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(tr).fetch(s,o)}catch(l){throw l instanceof Error&&XI(l)?new yi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(cLc,"requestDeviceCode");async function lLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(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(tr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&XI(l)?new yi(`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 yi(c.error_description):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(lLc,"requestAccessToken");async function uLc(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(uLc,"requestUserInfo");async function dLc(t,e,r){let n=r?.githubAppId??t.get(zp).findAppIdToAuthenticate(),o=r?.scopes??aLc,{serverUrl:s,apiUrl:c,authAuthority:l}=UU(t,r?.authAuthority),u=await cLc(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 D9("Sign-in request was cancelled");m=await lLc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await uLc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new D9("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:Ze.AuthEnvVarConflict,message:d7e(u)}];Dme(t,"deviceFlow");let d=t.get(Pie),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ar).connection.sendNotification(hLc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await aWi(f.waitForAuth,e,mLc),m=await d.save(h);return K2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof D9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof uFe)return K2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(K2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof yi))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(gLc,"handleSignInWithDeviceFlowChecked");var lWi=Oe(pLc,gLc);p();var ALc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function yLc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get(HT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(yLc,"handleSignInWithGithubTokenChecked");var uWi=Oe(ALc,yLc);p();var ELc=S.Object({options:S.Optional(S.Object({}))});async function _Lc(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(_Lc,"handleSignOutChecked");var dWi=Oe(ELc,_Lc);p();var vLc=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())})))})))}),m3r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function CLc(t,e,r){let n=t.get(ds),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&A4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:cPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},A4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new m3r(r.stacktrace??"N/A",o.name);return l.stack=void 0,qa(t,l,r.transaction??"",s,c),["OK",null]}a(CLc,"handleTelemetryExceptionChecked");var fWi=Oe(vLc,CLc);p();p();p();Mo();function g3r(t,e){let r=Date.now()+((t?.refresh_in??0)+QDt)*1e3;return new WW({token:`test token ${Mt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(g3r,"createTestCopilotToken");var k_e=class extends Rh{constructor(){super(...arguments);this.defaultToken=g3r({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:g3r({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 wTt=class extends Rh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:g3r(await this.envelopeFn())}}};var bLc=S.Object({options:S.Optional(S.Object({}))});async function SLc(t,e,r){let n=new k_e;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Rh,n),t.get(ps).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(SLc,"handleTestingAlwaysAuthChecked");var A3r=Oe(bLc,SLc);p();Mo();var TLc=S.Object({messages:S.Array(S.Object({role:S.Enum(ic),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Rn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function ILc(t,e,r){let n=new oc(t),s=await yq(t)?Rn.Gpt35turbo:Rn.CopilotBase,c=await t.get(el).getBestChatModelConfig([r.modelFamily??s]),l=await axe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:OA.user("test",Mt())},e,l),null]}a(ILc,"handleChatMLChecked");var pWi=Oe(TLc,ILc);p();p();p();var O_e=de(Azi(),1),v8h={ALPN_HTTP2:O_e.default.ALPN_HTTP2,ALPN_HTTP2C:O_e.default.ALPN_HTTP2C,ALPN_HTTP1_1:O_e.default.ALPN_HTTP1_1,ALPN_HTTP1_0:O_e.default.ALPN_HTTP1_0},{fetch:C8h,context:yzi,reset:b8h,noCache:S8h,h1:T8h,keepAlive:I8h,h1NoCache:x8h,keepAliveNoCache:w8h,cacheStats:R8h,clearCache:k8h,offPush:P8h,onPush:D8h,createUrl:N8h,timeoutSignal:M8h,Body:O8h,Headers:Ezi,Request:L8h,Response:B8h,AbortController:F8h,AbortError:$Tt,AbortSignal:U8h,FetchBaseError:Q8h,FetchError:q8h,ALPN_HTTP2:j8h,ALPN_HTTP2C:H8h,ALPN_HTTP1_1:G8h,ALPN_HTTP1_0:$8h}=O_e.default;var vzi=require("crypto"),Czi=require("http"),bzi=require("stream"),Szi=require("util"),B_e=de(PP());var z3c=6e5,Y3c=new B_e.ProtocolRequestType("copilot/fetch"),K3c=new B_e.ProtocolRequestType("copilot/fetchCancel"),J3c=new B_e.ProgressType,Z3c=new B_e.ProtocolRequestType("copilot/fetchDisconnectAll"),qL=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},L_e=class extends tr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ar).connection.sendRequest(Z3c,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ar).connection,c=(0,vzi.randomUUID)(),l=new Fn.CancellationTokenSource,u=new bzi.PassThrough,d=a(()=>{s.sendRequest(K3c,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new $Tt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new qL("EditorFetcher received unexpected abort signal");if(o.aborted)throw new $Tt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(J3c,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new qL(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??z3c,y=setTimeout(()=>{At(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new qL("Request timed out from lsp server"))},A),E=a(()=>{g(new $Tt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(Y3c,eFc(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,Szi.inspect)(_.data)}`),g(new qL(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new qL("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new ex(h.status,Czi.STATUS_CODES[h.status]??"",new Ezi(h.headers),()=>X3c(u),()=>u)}};function X3c(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(X3c,"consumeStream");function eFc(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(eFc,"convertOptionsToParams");var tFc=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 rFc(t,e,r){let n=new L_e(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 qL?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 qL?y.message:String(y)}`},null]}}a(rFc,"handleTestingFetchChecked");var Tzi=Oe(tFc,rFc);p();var nFc=S.Object({});async function iFc(t,e,r){return await t.get(xd).flush(),["OK",null]}a(iFc,"handleTestingFlushPromiseQueueChecked");var Izi=Oe(nFc,iFc);p();p();p();var $V=class{static{a(this,"FileSearch")}};p();p();p();var VTt=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 xzi=de(ri());var WTt="main.js",zTt=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=shn(WTt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new VTt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new jVe(this.id++),xzi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new UVe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new QVe(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 FVe(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 LVe(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(WTt+"'")&&(r=new Error(`Failed to load ${WTt}`),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(`${WTt} 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 yFe=de(ri());var B9=new fe(Nfr),YTt=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){B9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,yFe.CancellationToken.None);return}B9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new zTt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{B9.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 oFc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,yFe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{B9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){B9.debug(this.ctx,`indexing workspace ${e}`);let r=Y8t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${Y8t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get($V),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,yFe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));B9.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)})),B9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{B9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,yFe.CancellationToken.None)}catch(n){B9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return cfn(e)}};async function oFc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(oFc,"createIndexableWorkspaceFolder");var sFc=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 aFc(t,e,r){try{await t.get(US).start();let n=t.get(YTt),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,Mfr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(dFc,"handleTestingNeverAuthChecked");var V3r=Oe(uFc,dFc);p();p();p();var W3r=class extends pp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},kzi=a(t=>new W3r(t),"createTestCertificateReader");function Y3r(t,e,r){let n=new z3r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new ex(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(Y3r,"createFakeResponse");function Pzi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),Y3r(t,n,Object.assign({"content-type":"application/json"},r))}a(Pzi,"createFakeJsonResponse");var EFe=class extends tr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var KTt=class extends EFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var z3r=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 K3r=class extends EFe{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(Pzi(200,this.fullConfig)):Promise.resolve(Y3r(404,""))}},JTt=class extends K3r{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 fFc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function pFc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(tr,new JTt(n,t.get(tr)))}return["OK",null]}a(pFc,"handleTestingOverrideExpFlagsChecked");var Dzi=Oe(fFc,pFc);p();var hFc=S.Object({rules:oUt});function mFc(t,e,r){return t.get(nc).setTestingRules(r.rules),["OK",null]}a(mFc,"handleTestingSetContentExclusionRulesChecked");var Nzi=Oe(hFc,mFc);p();var gFc=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 AFc(t,e,r){return t.get(F9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(AFc,"handleTestingSetSyntheticTurnsChecked");var Mzi=Oe(gFc,AFc);p();var yFc=S.Object({});async function EFc(t,e,r){let n=t.get(ts),o=t.get(qf);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(EFc,"handleTriggerShowMessageChecked");var Ozi=Oe(yFc,EFc);p();p();p();p();var Lzi=de(require("tls"));var F_e=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(pp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Lzi.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 zzi=de(require("http"));var GFc=407,wy=new fe("proxySocketFactory"),uk=class{static{a(this,"ProxySocketFactory")}},Lie=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 ZTt(t){return new X3r(t,new eFr(t))}a(ZTt,"getProxySocketFactory");var X3r=class extends uk{constructor(r,n,o=new vFe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Cn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(wy.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 Lie&&o.code===`ProxyStatusCode${GFc}`){wy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return wy.debug(this.ctx,"Proxy authorization successful, caching result"),Et(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&&(wy.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(wy.debug(this.ctx,"Proxy authorization successful, received token"),o)return wy.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){wy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);wy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);wy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return wy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return wy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return wy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},eFr=class extends uk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ds).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{wy.debug(this.ctx,"Attempting to establish connection to proxy");let l=zzi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{wy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Lie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Lie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(wy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{wy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Lie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{wy.debug(this.ctx,"Proxy socket connection timeout"),c(new Lie(`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"])}},vFe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>de(Wzi()))}};var Bie=class extends tr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new F_e(r),this.proxySocketFactory=r.get(uk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Lo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Lo).getHttpSettings()),this.updateNoProxy(r.get(Lo).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(ds),s=this.proxySocketTimeoutForTesting;return yzi({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 jW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new ex(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var q_e=class extends $m{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(pf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=$y({serverUrl:c7e(r,n.serverUrl),apiUrl:c7e(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 j_e=class extends ZL{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){qa(e,r,n)}};p();var H_e=class extends m4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var XTt=class extends WP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var eIt=class extends zh{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 tIt=class extends $V{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 Yzi(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(Yzi,"fakeChatModelConfiguration");function $Fc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a($Fc,"fakeEmbeddingModelConfiguration");var rIt=class extends el{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(Yzi(r))}getModelConfigurationById(e){return Promise.resolve({...Yzi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve($Fc(e))}};p();var nIt=class extends Vm{constructor(){super(...arguments);this.openedUrls=[];this.opened=new vA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},iIt=class extends ts{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 Kzi(t,e,r,n){return NS.create(a7e(t),e,r,n,e)}a(Kzi,"createTextDocument");var tFr=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Wi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Wi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Wi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Wi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Wi;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=Kzi(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]=Kzi(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}},oIt=class extends tFr{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 rFr=class extends qf{static{a(this,"NullLog")}logIt(...e){}},nFr=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 VFc(t){let e=new sue;e.set(Lo,t),e.set(OY,t);let r=new nFr(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(ds,new ds),e.set(tp,new tp),e.set(QI,new QI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(pp,kzi([])),e.set(uk,ZTt(e)),e.set(Cx,new Cx),e.set(dP,new gje);let n=new k_e;e.set(Rh,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Op(e);return s.updateFromToken(n.defaultToken),e.set(Op,s),e.set(X0,new X0),e.set(XN,new XN),e.set(ts,new iIt),e.set(Vm,new nIt),e.set(ZL,new j_e),e.set(qf,new rFr),e.set(CC,new CC),e.set(Ua,new Ua("test-session","test-machine","test-device")),e.set(UI,new UI(()=>Promise.resolve("test-device"))),e.set($m,new q_e(e)),e.set(kk,new boe),e.set(pf,new pf(e,"copilot-test")),e.set(Zt,new Zt(e)),e.set(rO,new rO(e,o)),e.set(q2,new q2),e.set(TP,new dle),e.set(ps,new pje),e.set(xd,new xd),e.set(t4,new t4(e)),e.set($V,new tIt),e.set(z2,new z2(e)),e.set(T8,Pdt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(I8,I8.default),e.set(Ox,new Ox(e,!1)),e.set(zp,new zp),e.set(ii,new ii(e)),e.set(jT,new Mdt),e.set(pm,new pm),e.set(hm,Glt(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Nb,new Nb(e)),WFc(e),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(m4,new H_e),e.set(CN,new CN),e.set(Aw,new Aw),e.set(nT,new nT(e)),e}a(VFc,"_createBaselineContext");function WFc(t){t.set(zo,new zo(t)),t.set(Tc,new Tc(t)),t.set(kA,new kA(t)),t.set(Yh,new Yh),t.set(Ag,new Ag),t.set(zh,new eIt),t.set(ck,new ck(t,[])),t.set(el,new rIt),t.set(WP,new XTt),t.set(NO,new NO(t));let e=new xN(t);t.set(xN,e),t.set(sk,new sk(e,t)),t.set(HO,new HO(t)),t.set(bI,new $St),t.set(ZC,new ZC(t.get(sk),t.get(bI),t)),t.set(m0,new m0)}a(WFc,"registerConversation");function Jzi(){let t=VFc(new OY(new fle,new Map));return t.set(tr,new KTt),t.set(Ir,new iFr),t.set($r,new oIt(t)),t.set(Qo,new SQ),t.set(nc,new nc(t)),t.set(Au,new Au(t)),t.set(qS,new aYe),t.set(gO,new gO(t)),t.set(r4,new nme),t.set(F2,new Bct),t.set(jl,new Gze),t.set(wA,new wA(t)),t.set(a0,new Rze),t.set(fm,new fm),wze(t),t.set(ry,new dEe(t)),t}a(Jzi,"createLibTestingContext");var iFr=class extends Ir{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 Xzi=de(require("fs"));var Zzi=`${process.env.HOME}/.copilot-testing-gh-token`,sIt,aIt;function eYi(t){let e=tYi(),r=new wTt(zFc);return t.forceSet(Rh,r),t.get(Ur).setTransientSession(e),r}a(eYi,"setIntegrationTokenManager");var zFc=a(async()=>{if(aIt)return aIt;let t=await tYi(),e=Jzi(),r=new Bie(e);return e.forceSet(tr,r),aIt=qDt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new yi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),aIt},"getEnvelope");async function tYi(){let{session:t}=R5t(process.env);if(t)return t;try{sIt??=(await Xzi.promises.readFile(Zzi)).toString().trim()}catch{sIt??=process.env.GITHUB_TOKEN??""}if(!sIt)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 ${Zzi}. Run "npm run get_token" to get one.`);return{...$y({}),accessToken:sIt,login:"copilot-client tests"}}a(tYi,"getTestingGitHubSession");var YFc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function KFc(t,e,r){return eYi(t),await t.get(Qt).primeToken(),["OK",null]}a(KFc,"handleTestingUseTestingTokenChecked");var rYi=Oe(YFc,KFc);p();var JFc=S.Object({});async function ZFc(t,e,r){return await new hEe().uninstall(t),["OK",null]}a(ZFc,"handleUninstallChecked");var nYi=Oe(JFc,ZFc);p();var XFc=jXn;function e8c(t,e,r){let n=t.get(hm),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(e8c,"unregisterContextProviders");var iYi=Oe(XFc,e8c);p();var oFr=de(require("os"));var t8c=S.Object({expectedCertificate:S.String()});async function r8c(t,e,r){let o=(await fot(t).getAllRootCAs()).map(T_e),s=T_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${r3r(s)}. Only found those installed on the system:${oFr.EOL}${o.map(c=>"- "+r3r(c)).join(oFr.EOL)}`},null]}a(r8c,"handleVerifyCertificateChecked");var oYi=Oe(t8c,r8c);p();var n8c=S.Object({});async function i8c(){return[{status:!!await new vFe().load()},null]}a(i8c,"handleVerifyKerberosChecked");var sYi=Oe(n8c,i8c);p();var o8c=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function s8c(t,e,r){let o=await t.get($r).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(s8c,"handleVerifyStateChecked");var aYi=Oe(o8c,s8c);p();var a8c=S.Object({});function c8c(t,e,r){return[t.get($r).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(c8c,"handleVerifyWorkspaceStateChecked");var cYi=Oe(a8c,c8c);p();p();var $_e=de(require("fs/promises")),lYi=de(require("os")),Xd=de(require("path"));var Np=new fe("GitWorktreeService"),l8c=20,G_e=class{constructor(e){this.ctx=e;this.gitInstances=new Cn(l8c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Xd.resolve(e),n=this.gitInstances.get(r);return n||(n=Gue(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=Xd.resolve(e);Np.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Np.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Np.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?(Np.info(this.ctx,`Skipping checkpoint commit for ${Xd.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)),Np.info(this.ctx,`Created ${n} commit for ${Xd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Np.info(this.ctx,`Snapshotting copied changes in ${Xd.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 Np.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await $_e.mkdtemp(Xd.join(lYi.tmpdir(),"copilot-worktree-")),o=Xd.join(n,"changes.patch");try{Np.info(this.ctx,`Writing temporary patch for ${Xd.resolve(e)} to ${o} (${r.length} chars)`),await $_e.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 $_e.rm(n,{recursive:!0,force:!0}),Np.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=Xd.basename(r),h=Xd.join(Xd.dirname(r),`${f}.worktrees`),m=Xd.join(h,d);return Np.info(this.ctx,`Preparing worktree creation for ${Xd.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])),Np.info(this.ctx,`Created worktree ${m} from ${Xd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Np.info(this.ctx,`Preparing to remove worktree ${e} from ${Xd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Np.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Np.info(this.ctx,`Skipping status lookup for ${Xd.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){Np.info(this.ctx,`Applying worktree changes from ${Xd.resolve(e)} to ${Xd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Np.info(this.ctx,o?`Committed pending worktree changes in ${Xd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Xd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Np.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 Np.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 Np.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"])),Np.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Np.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Np.info(this.ctx,`Popped stash in ${e}`)}};p();var uYi=de(ri());var x1=new fe("WorktreeService");var u8c=new uYi.ProtocolRequestType("worktree/requestUserDecision"),CFe=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 x1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";x1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ar).connection.sendRequest(u8c,{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?(x1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(x1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){x1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(x1.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&&(x1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(x1.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},x1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);x1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw x1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return x1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){x1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return x1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var d8c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",f8c=["already exists in working directory","patch does not apply","patch failed"];function p8c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&f8c.some(n=>e.includes(n))?d8c:`Failed to apply worktree changes: ${e}`}a(p8c,"getWorktreeCompleteErrorMessage");var h8c=S.Object({repositoryPath:S.String()});async function m8c(t,e,r){try{let n=new G_e(t),o=new CFe(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:Ze.InternalError,message:`Failed to create worktree: ${o}`}]}}a(m8c,"handleWorktreeCreateChecked");var dYi=Oe(h8c,m8c),g8c=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function A8c(t,e,r){try{let n=new G_e(t);return[{success:!0,baseCommit:(await new CFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:p8c(n)}]}}a(A8c,"handleWorktreeCompleteChecked");var fYi=Oe(g8c,A8c),y8c=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function E8c(t,e,r){try{return await new G_e(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(E8c,"handleWorktreeDeleteChecked");var pYi=Oe(y8c,E8c);var Fie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function hYi(){let t=new Map;return t.set(X$i.method,eVi),t.set("getCompletions",U$i),t.set("getCompletionsCycling",Q$i),t.set("getDefaultFileSafetyRules",q$i),t.set("copilot/parseTerminalCommand",DVi),t.set("getPanelCompletions",G$i),t.set(g$i.method,A$i),t.set("getVersion",V$i),t.set("getUserInfo",$$i),t.set("setEditorInfo",JVi),t.set("checkStatus",IGi),t.set("checkQuota",TGi),t.set("checkFileStatus",bGi),t.set("claude/checkCliCompatibility",EGi),t.set("codex/checkCliCompatibility",CGi),t.set("signInInitiate",c3r),t.set("signIn",c3r),t.set("signInWithCodeFlow",sWi),t.set("signInWithDeviceFlow",lWi),t.set("signInConfirm",ZVi),t.set("signInWithGithubToken",uWi),t.set("signOut",dWi),t.set("auth/listAvailableTokens",Qqi),t.set("auth/useExistingToken",qqi),t.set("notifyShown",PVi),t.set("notifyAccepted",wVi),t.set("notifyRejected",kVi),t.set("notifyNextEditRejected",RVi),t.set("telemetry/exception",fWi),t.set("textDocument/copilotInlineEdit",xVi),t.set("testing/overrideExpFlags",Dzi),t.set("testing/alwaysAuth",A3r),t.set("testing/setAlwaysAuthed",A3r),t.set("testing/neverAuth",V3r),t.set("testing/setNeverAuthed",V3r),t.set("testing/useTestingToken",rYi),t.set("testing/setCompletionDocuments",O$i),t.set("testing/setPanelCompletionDocuments",h$i),t.set("testing/setNextEditDocument",CVi),t.set("testing/triggerShowMessageRequest",Ozi),t.set("testing/flushPromiseQueue",Izi),t.set("testing/getDocument",Rzi),t.set("testing/chatml",pWi),t.set("testing/setSyntheticTurns",Mzi),t.set("testing/fetch",Tzi),t.set("testing/setContentExclusionRules",Nzi),t.set("testing/getContext",wzi),t.set("uninstall",nYi),t.set("debug/diagnostics",w$i),t.set("debug/listCertificates",tVi),t.set("debug/verifyState",aYi),t.set("debug/verifyCertificate",oYi),t.set("debug/verifyKerberos",sYi),t.set("debug/verifyWorkspaceState",cYi),t.set("debug/getAgentDebugLog",k$i),t.set("debug/exportAgentDebugLog",R$i),t.set("context/registerProviders",WVi),t.set("context/unregisterProviders",iYi),t.set("conversation/preconditions",GGi),t.set("conversation/persistence",HGi),t.set("conversation/create",UGi),t.set("conversation/turn",zGi),t.set("conversation/turnDelete",YGi),t.set("conversation/destroy",QGi),t.set("conversation/compress",OGi),t.set("conversation/rating",$Gi),t.set("conversation/copyCode",NGi),t.set("conversation/insertCode",MGi),t.set("conversation/templates",WGi),t.set("conversation/modes",qGi),t.set("conversation/agents",DGi),t.set("conversation/registerTools",VGi),t.set("conversation/unregisterTools",KGi),t.set("conversation/updateToolsStatus",JGi),t.set("conversation/notifyCodeAcceptance",jGi),t.set("customAgent/registerExtensionAgents",E$i),t.set("customAgent/unregisterExtensionAgents",_$i),t.set("copilot/customAgent/list",y$i),t.set("copilot/customSkill/list",b$i),t.set("copilot/customPrompt/list",C$i),t.set("copilot/customInstruction/list",v$i),t.set("copilot/hook/list",J$i),t.set("copilot/models",c$i),t.set("copilot/models/getModelMetadataList",l$i),t.set("copilot/byok/saveModel",yGi),t.set("copilot/byok/deleteModel",Hqi),t.set("copilot/byok/listModels",mGi),t.set("copilot/byok/saveApiKey",gGi),t.set("copilot/byok/deleteApiKey",jqi),t.set("copilot/byok/listApiKeys",$qi),t.set("copilot/byok/saveCustomProviderConfig",AGi),t.set("copilot/byok/listCustomProviderConfigs",Vqi),t.set("copilot/setModelPolicy",u$i),t.set("copilot/codeReview/reviewChanges",XGi),t.set("copilot/codeReview/reviewSnippets",e$i),t.set("git/commitGenerate",W$i),t.set("thinking/generateTitle",ZGi),t.set("mcp/getTools",r$i),t.set("mcp/updateToolsStatus",n$i),t.set("mcp/readResource",i$i),t.set("mcp/registry/listServers",yVi),t.set("mcp/registry/getServer",EVi),t.set("mcp/registry/getAllowlist",vVi),t.set("mcp/getPrompt",o$i),t.set("mcp/completePrompt",s$i),t.set("mcp/serverAction",a$i),t.set("mcpGateway/listServers",aVi),t.set("mcpGateway/getServerDetails",cVi),t.set("mcpGateway/serverAction",lVi),t.set("mcpGateway/applyConfig",sVi),t.set("plugins/list",QVi),t.set("plugins/install",FVi),t.set("plugins/installFromSource",UVi),t.set("plugins/uninstall",$Vi),t.set("plugins/enable",BVi),t.set("plugins/disable",LVi),t.set("plugins/update",VVi),t.set("plugins/marketplace/add",qVi),t.set("plugins/marketplace/remove",GVi),t.set("plugins/marketplace/list",HVi),t.set("plugins/marketplace/browse",jVi),t.set("githubApi/searchPR",K$i),t.set("githubApi/cancelCodingAgent",wGi),t.set("cloudAgent/listSessions",PGi),t.set("cloudAgent/getSessionLogs",kGi),t.set("cloudAgent/createJob",RGi),t.set("cloudAgent/addPullRequestComment",xGi),t.set("githubApi/listPullRequestChangedFiles",z$i),t.set("worktree/create",dYi),t.set("worktree/complete",fYi),t.set("worktree/delete",pYi),t.set("backgroundAgent/create",Aqi),t.set("backgroundAgent/send",Bqi),t.set("backgroundAgent/truncateHistory",Uqi),t.set("backgroundAgent/destroy",yqi),t.set("backgroundAgent/listModels",Dqi),t.set("backgroundAgent/listSessions",Rqi),t.set("backgroundAgent/resume",Oqi),t.set("backgroundAgent/stop",Fqi),t.set("backgroundAgent/interaction",Iqi),t.set("backgroundAgent/enableRemote",Cqi),t.set("backgroundAgent/disableRemote",_qi),t.set("backgroundAgent/getRemoteStatus",Sqi),t.set("backgroundAgent/getPlanPath",bqi),t.set("backgroundAgent/compactHistory",hqi),new Fie(t)}a(hYi,"getAllMethods");p();p();p();var mYi=de(PP());var Ry=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new mYi.NotificationType(this.name)}};var _8c=new fe("BackgroundAgent.notifications"),sFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},aFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:B4r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){_8c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Hs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},gYi=[sFr,aFr];p();var cFr=class extends Ry{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")}},AYi=[cFr];p();var v8c=new fe("agentCopilotTokenManager");function uFr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(uFr,"tokenEndpointToApiUrl");function C8c(t,e){if(!e.tokenEndpoint)return $y(e);let r=uFr(e.tokenEndpoint);return r||v8c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),$y({apiUrl:r})}a(C8c,"getUrlsFromParams");var lFr=class extends Ry{constructor(){super(...arguments);this.name=jQt.method;this.params=hvn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=C8c(this.ctx,r);this.ctx.get($m).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})}},yYi=[lFr];p();var dFr=class extends Ry{constructor(){super(...arguments);this.name=zQt.method;this.params=Cvn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Ru).get(n);s&&uni(this.ctx,s)}},fFr=class extends Ry{constructor(){super(...arguments);this.name=KQt.method;this.params=xvn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Vv).handleShown(n)}},pFr=class extends Ry{constructor(){super(...arguments);this.name=YQt.method;this.params=bvn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Ru),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Pme(this.ctx,c)):qdt(this.ctx,c,o,void 0,void 0,"cumulative"))}},EYi=[dFr,fFr,pFr];p();var cIt=class extends Ry{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(wN).cancel(r.token)}};p();var hFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=S.Object({items:S.Array(S.Object({folderUri:S.String(),trusted:S.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(tp);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},_Yi=[hFr];var b8c=[...gYi,...AYi,...yYi,...EYi,..._Yi,cIt];function vYi(t,e){for(let r of b8c){let n=new r(t),o=qu.Compile(n.params);e.onNotification(n.type,z0(t,async s=>{g9(s),o.Check(s)?await n.handle(s):$o.error(t,`Notification ${n.name}:`,new QA(o.Errors(s)))},`Notification ${n.name}`))}}a(vYi,"registerNotifications");p();var CYi=de(Xc());p();var V_e=de(Xc());var S8c=new V_e.ProtocolNotificationType("copilot/customAgent/didChange"),T8c=new V_e.ProtocolNotificationType("copilot/customSkill/didChange"),I8c=new V_e.ProtocolNotificationType("copilot/customPrompt/didChange"),x8c=new V_e.ProtocolNotificationType("copilot/customInstruction/didChange"),mFr=new V_e.ProtocolNotificationType("copilot/hook/didChange");function w8c(t){switch(t){case"agent":return S8c;case"skill":return T8c;case"prompt":return I8c;case"instructions":return x8c;case"hook":return mFr;default:return}}a(w8c,"notificationTypeFor");var lIt=class extends a0{constructor(r){super();this.ctx=r;this.logger=new fe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=w8c(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ar).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var R8c=new CYi.ProtocolNotificationType("copilot/plugins/didChange"),Uie=class{constructor(e,r){this.ctx=e;this.logger=new fe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(ar).connection}catch(n){this.logger.debug(this.ctx,"Failed to resolve connection for copilot/plugins/didChange:",n);return}let r=await Promise.allSettled([e.sendNotification(R8c,{}),e.sendNotification(mFr,{})]);for(let n of r)n.status==="rejected"&&this.logger.debug(this.ctx,"Failed to send a plugin change notification:",n.reason)}dispose(){this.subscription.dispose()}};p();p();var bYi=de(require("crypto")),SYi=require("os");Mo();var k8c=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function P8c(t){let e=t.replace(/-/g,":").toLowerCase();return!k8c.has(e)}a(P8c,"validateMacAddress");function D8c(){let t=(0,SYi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(P8c(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(D8c,"getMac");var gFr;function N8c(){try{let t=D8c();return bYi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(N8c,"getMacMachineId");function AFr(){return gFr||(gFr=N8c()||Mt()),gFr}a(AFr,"getMachineId");Mo();function yFr(t){let e=t??Mt()+Date.now();return new Ua(e,AFr(),AFr())}a(yFr,"createEditorSession");var TYi=yFr();p();var uIt=de(Xc());var EFr=new fe("AgentTextDocumentConfiguration"),_Fr=class{constructor(e){this.ctx=e;this.#e=new Wi;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return NS.create(e,r,n,o)}catch(s){throw EFr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=NS.withChanges(e,r,n);for(let l of r)if(uIt.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])}.`;EFr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Wt.createAndMarkAsIssued({message:`Received ${g}`});Et(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}])}else{let u=e.getText().length,f={range:{start:e.positionAt(0),end:e.positionAt(u)},rangeOffset:0,rangeLength:u,text:l.text};o.push(f),e=e.applyEdits([{range:f.range,newText:f.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw EFr.exception(this.ctx,o,".update"),o}}},WV=class extends $r{constructor(){super(...arguments);this.#e=new Wi;this.onDidOpenTextDocument=this.#e.event;this.#t=new Wi;this.onDidCloseTextDocument=this.#t.event;this.#r=new Wi;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new _Fr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new uIt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Wi;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ar).connection}init(r){this.connection.onDidOpenTextDocument(o=>{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Fs(s.uri),c),this.#e.fire({document:{...s,uri:c.uri}})}),this.connection.onDidChangeTextDocument(o=>{let s=o.textDocument,c=o.contentChanges,{version:l}=s;if(l==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let u=Fs(s.uri),d=this._documents.get(u);d!==void 0&&(d=this._textDocumentConfiguration.update(d,c,l),this._documents.set(u,d))}),this.connection.onDidCloseTextDocument(o=>{let s=Fs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification($Qt.type,o=>{let s=("textDocument"in o?o.textDocument:o)??{};this.#r.fire("uri"in s?{document:s}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0;let n=this.ctx.get(tp);for(let o of r){let s=o.trusted;typeof s=="boolean"&&n.setTrust(o.uri,s)}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),this.ctx.get(tp).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(tp).setTrust(r.uri,n),!this.workspaceFolders.find(o=>o.uri===r.uri)&&this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(Fs(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 IYi=qu.Compile(Evn);function g9(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(xYi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of cFe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(SO).handleConfigurationChange(e.settings)}catch(n){$o.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return CTt(this.ctx,g9(e))}catch(r){$o.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(qf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}isWorkspaceTrustGateEnabled(){return this.#r?.experimental?.workspaceTrustGate===!0}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),vYi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ds).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(WV).didChangeWorkspaceFolders(c)}catch(l){$o.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,e.get(tp).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=g9(c.initializationOptions);if(u){if(!IYi.Check(u))throw new QA(IYi.Errors(u));let m=u,g=e.get(Ir);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):$o.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(zp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Ua,yFr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(WV).init(c.workspaceFolders??[]),bXn(this.ctx),l&&(e.get(bn).setCapabilities(l),l.contentProvider&&la.registerSchemes(l.contentProvider),"openURL"in l&&jdt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,$o.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ps).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(TI.DidChangeConfigurationNotification.type,{section:xYi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(rb).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||vTt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ps).sendInitNonAuthStatus(),new hEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(z0(e,h,"onInitialized")),e.get(bN).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&qQi(e),wYi.lt(process.versions.node,"22.0.0")&&$o.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:TI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:BQi(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 E1t;this.ctx.forceSet(qf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");Vn(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Fie).handlers.get(e);if(!o)return new TI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new TI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new TI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new TI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),g9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new TI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new TI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof yi)return this.telemetryMethodFailure(e,s),new TI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof TI.ResponseError||$o.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(GY).stop()}catch(e){$o.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(yF).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(g8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Uie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(iie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(ey).dispose().catch(e=>{$o.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(TH).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(t2).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(y8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(uc).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Hs).shutdown().catch(e=>{$o.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(ug).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(qf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(rb).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Ihr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(xd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(X0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},$o=new fe("lsp");var zv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new RYi.ProtocolRequestType("conversation/context");this.typeCheck=qu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ar).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 kYi.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 QA(this.typeCheck.Errors(o));return o}}};var vFr=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")}},F9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new vFr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},dIt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Tc)}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(zo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new zv(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 bC(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:Mt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var RN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(F9).get(r);if(o)return new dIt(e,o);let c=(await ew(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 fJe(e.ctx):l=new yue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new WRe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new WRe(e,l):new Prt(e,l)}};p();var zV=class extends F_{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 Lr([new Rr(r)],"success")}errorResult(r){return new Lr([new Rr(r)],"error")}};p();function M8c(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(M8c,"mapToolNameToKind");function O8c(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(O8c,"extractLocationsFromInput");function L8c(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(L8c,"mapToolCallStatus");var fIt=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=L8c(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=O8c(c.name,c.input);await this.reportToolCallStart(c.id,c.name,M8c(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 y3r=["authorization_code","refresh_token"],k_e=33428,kTt=class{constructor(e,r){this._logger=new fe("LoopbackAuthServer");this.nonce=(0,pWi.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=hWi.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 yi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),VNe(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 yi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),VNe(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 yi("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}),VNe(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 yi("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}),VNe(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(A3r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(A3r)}})}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 ${k_e} 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(k_e,"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 PTt=require("crypto");var hFe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,PTt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,PTt.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 CLc="Timed out",mWi="Sign-in request was cancelled",E3r=class{static{a(this,"CodeFlow")}},P_e=class extends E3r{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=hFe.isServerSupported(n.code_challenge_methods_supported),h=f?hFe.createPKCEParameters():void 0;f?Nr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Nr.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 kTt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Nr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new R_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(CLc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Nr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(mWi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(mWi))});b.push(N)}))}v=(await Promise.race(w)).code,Nr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Nr.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=>{Nr.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);Nr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await DX(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 Nr.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 ON=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=>g3r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(ti).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Kp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=uWi(r.provider)?r.provider:void 0,d=typeof r.loginHint=="string"?r.loginHint:void 0,f=d?{login:d,provider:u}:{prompt:"select_account",provider:u},h=await new P_e(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,f,r.cancellationToken),m=await this.tokenToSession(h.access_token,e);this.afterSessionLoad(m);let g=o.findIndex(y=>y.account.id===m.account.id&&g3r([...y.scopes].sort(),n)),A=new Array;return g>-1?A.push(...o.splice(g,1,m)):o.push(m),await this.storeSessions(o),m}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(ti).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(nr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return RTt.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 RTt.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 RTt.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 bLc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:xTt,loginHint:S.Optional(S.String({minLength:1}))});async function SLc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Lr),{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:Ze.AuthEnvVarConflict,message:g7e(c)}];let l=await wTt(t,(u,d)=>new ON(u,ON.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(l.status))throw new yi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof QU)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof yi))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(SLc,"handleSignInWithCodeFlowChecked");var gWi=Ne(bLc,SLc);p();p();p();var M9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},mFe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function AWi(t,e,r){return e.isCancellationRequested?Promise.reject(new M9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new M9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new mFe))},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(AWi,"raceWithCancellationAndTimeout");var TLc=["repo","workflow"];async function ILc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...$y(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(nr).fetch(s,o)}catch(l){throw l instanceof Error&&rx(l)?new yi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(ILc,"requestDeviceCode");async function xLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...$y(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(nr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&rx(l)?new yi(`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 yi(c.error_description):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(xLc,"requestAccessToken");async function wLc(t,e){let n=await(await Vf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(wLc,"requestUserInfo");async function RLc(t,e,r){let n=r?.githubAppId??t.get(Kp).findAppIdToAuthenticate(),o=r?.scopes??TLc,{serverUrl:s,apiUrl:c,authAuthority:l}=qU(t,r?.authAuthority),u=await ILc(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 M9("Sign-in request was cancelled");m=await xLc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await wLc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new M9("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(Lr),{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:Ze.AuthEnvVarConflict,message:g7e(u)}];Mme(t,"deviceFlow");let d=t.get(Die),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ar).connection.sendNotification(DLc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await AWi(f.waitForAuth,e,NLc),m=await d.save(h);return X2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof M9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof mFe)return X2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(X2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof yi))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(MLc,"handleSignInWithDeviceFlowChecked");var EWi=Ne(PLc,MLc);p();var OLc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function LLc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Lr);return[await t.get($T).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(LLc,"handleSignInWithGithubTokenChecked");var _Wi=Ne(OLc,LLc);p();var BLc=S.Object({options:S.Optional(S.Object({}))});async function FLc(t,e,r){return[await t.get(Lr).signOutEditor(),null]}a(FLc,"handleSignOutChecked");var vWi=Ne(BLc,FLc);p();var ULc=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())})))})))}),_3r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function QLc(t,e,r){let n=t.get(ds),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&y4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:fPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},y4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new _3r(r.stacktrace??"N/A",o.name);return l.stack=void 0,ua(t,l,r.transaction??"",s,c),["OK",null]}a(QLc,"handleTelemetryExceptionChecked");var CWi=Ne(ULc,QLc);p();p();p();Oo();function v3r(t,e){let r=Date.now()+((t?.refresh_in??0)+GDt)*1e3;return new JW({token:`test token ${Mt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(v3r,"createTestCopilotToken");var D_e=class extends Ph{constructor(){super(...arguments);this.defaultToken=v3r({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:v3r({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 DTt=class extends Ph{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:v3r(await this.envelopeFn())}}};var qLc=S.Object({options:S.Optional(S.Object({}))});async function jLc(t,e,r){let n=new D_e;return t.get(Lr).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Ph,n),t.get(ps).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(jLc,"handleTestingAlwaysAuthChecked");var C3r=Ne(qLc,jLc);p();Oo();var HLc=S.Object({messages:S.Array(S.Object({role:S.Enum(oc),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Rn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function GLc(t,e,r){let n=new sc(t),s=await vq(t)?Rn.Gpt35turbo:Rn.CopilotBase,c=await t.get(el).getBestChatModelConfig([r.modelFamily??s]),l=await uxe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:LA.user("test",Mt())},e,l),null]}a(GLc,"handleChatMLChecked");var bWi=Ne(HLc,GLc);p();p();p();var B_e=de(xzi(),1),Y8h={ALPN_HTTP2:B_e.default.ALPN_HTTP2,ALPN_HTTP2C:B_e.default.ALPN_HTTP2C,ALPN_HTTP1_1:B_e.default.ALPN_HTTP1_1,ALPN_HTTP1_0:B_e.default.ALPN_HTTP1_0},{fetch:K8h,context:wzi,reset:J8h,noCache:Z8h,h1:X8h,keepAlive:e6h,h1NoCache:t6h,keepAliveNoCache:r6h,cacheStats:n6h,clearCache:i6h,offPush:o6h,onPush:s6h,createUrl:a6h,timeoutSignal:c6h,Body:l6h,Headers:Rzi,Request:u6h,Response:d6h,AbortController:f6h,AbortError:YTt,AbortSignal:p6h,FetchBaseError:h6h,FetchError:m6h,ALPN_HTTP2:g6h,ALPN_HTTP2C:A6h,ALPN_HTTP1_1:y6h,ALPN_HTTP1_0:E6h}=B_e.default;var Pzi=require("crypto"),Dzi=require("http"),Nzi=require("stream"),Mzi=require("util"),U_e=de(NP());var fFc=6e5,pFc=new U_e.ProtocolRequestType("copilot/fetch"),hFc=new U_e.ProtocolRequestType("copilot/fetchCancel"),mFc=new U_e.ProgressType,gFc=new U_e.ProtocolRequestType("copilot/fetchDisconnectAll"),jL=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},F_e=class extends nr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ar).connection.sendRequest(gFc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ar).connection,c=(0,Pzi.randomUUID)(),l=new Fn.CancellationTokenSource,u=new Nzi.PassThrough,d=a(()=>{s.sendRequest(hFc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new YTt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new jL("EditorFetcher received unexpected abort signal");if(o.aborted)throw new YTt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(mFc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new jL(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??fFc,y=setTimeout(()=>{Rt(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new jL("Request timed out from lsp server"))},A),E=a(()=>{g(new YTt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(pFc,yFc(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,Mzi.inspect)(_.data)}`),g(new jL(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new jL("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new nx(h.status,Dzi.STATUS_CODES[h.status]??"",new Rzi(h.headers),()=>AFc(u),()=>u)}};function AFc(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(AFc,"consumeStream");function yFc(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(yFc,"convertOptionsToParams");var EFc=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 _Fc(t,e,r){let n=new F_e(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 jL?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 jL?y.message:String(y)}`},null]}}a(_Fc,"handleTestingFetchChecked");var Ozi=Ne(EFc,_Fc);p();var vFc=S.Object({});async function CFc(t,e,r){return await t.get(Rd).flush(),["OK",null]}a(CFc,"handleTestingFlushPromiseQueueChecked");var Lzi=Ne(vFc,CFc);p();p();p();var YV=class{static{a(this,"FileSearch")}};p();p();p();var KTt=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 Bzi=de(ei());var JTt="main.js",ZTt=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=dhn(JTt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new KTt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new WVe(this.id++),Bzi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new GVe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new $Ve(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new VVe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new jVe(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 HVe(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 qVe(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(JTt+"'")&&(r=new Error(`Failed to load ${JTt}`),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(`${JTt} 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 bFe=de(ei());var U9=new fe(Bfr),XTt=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){U9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,bFe.CancellationToken.None);return}U9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new ZTt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{U9.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 bFc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,bFe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{U9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){U9.debug(this.ctx,`indexing workspace ${e}`);let r=X8t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${X8t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(YV),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,bFe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));U9.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)})),U9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{U9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,bFe.CancellationToken.None)}catch(n){U9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return pfn(e)}};async function bFc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(bFc,"createIndexableWorkspaceFolder");var SFc=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 TFc(t,e,r){try{await t.get(qS).start();let n=t.get(XTt),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,Ffr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(RFc,"handleTestingNeverAuthChecked");var J3r=Ne(wFc,RFc);p();p();p();var Z3r=class extends mp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},Qzi=a(t=>new Z3r(t),"createTestCertificateReader");function eFr(t,e,r){let n=new X3r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new nx(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(eFr,"createFakeResponse");function qzi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),eFr(t,n,Object.assign({"content-type":"application/json"},r))}a(qzi,"createFakeJsonResponse");var SFe=class extends nr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var eIt=class extends SFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var X3r=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 tFr=class extends SFe{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(qzi(200,this.fullConfig)):Promise.resolve(eFr(404,""))}},tIt=class extends tFr{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 kFc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function PFc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(nr,new tIt(n,t.get(nr)))}return["OK",null]}a(PFc,"handleTestingOverrideExpFlagsChecked");var jzi=Ne(kFc,PFc);p();var DFc=S.Object({rules:lUt});function NFc(t,e,r){return t.get(ic).setTestingRules(r.rules),["OK",null]}a(NFc,"handleTestingSetContentExclusionRulesChecked");var Hzi=Ne(DFc,NFc);p();var MFc=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(BO)),options:S.Optional(S.Object({}))});function OFc(t,e,r){return t.get(Q9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(OFc,"handleTestingSetSyntheticTurnsChecked");var Gzi=Ne(MFc,OFc);p();var LFc=S.Object({});async function BFc(t,e,r){let n=t.get(ts),o=t.get(Hf);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(BFc,"handleTriggerShowMessageChecked");var $zi=Ne(LFc,BFc);p();p();p();p();var Vzi=de(require("tls"));var Q_e=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(mp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Vzi.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 iYi=de(require("http"));var c8c=407,Ry=new fe("proxySocketFactory"),fk=class{static{a(this,"ProxySocketFactory")}},Bie=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 rIt(t){return new iFr(t,new oFr(t))}a(rIt,"getProxySocketFactory");var iFr=class extends fk{constructor(r,n,o=new IFe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Cn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(Ry.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 Bie&&o.code===`ProxyStatusCode${c8c}`){Ry.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return Ry.debug(this.ctx,"Proxy authorization successful, caching result"),At(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&&(Ry.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(Ry.debug(this.ctx,"Proxy authorization successful, received token"),o)return Ry.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){Ry.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);Ry.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);Ry.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return Ry.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return Ry.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return Ry.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},oFr=class extends fk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ds).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{Ry.debug(this.ctx,"Attempting to establish connection to proxy");let l=iYi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{Ry.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Bie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Bie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(Ry.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{Ry.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Bie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{Ry.debug(this.ctx,"Proxy socket connection timeout"),c(new Bie(`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"])}},IFe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>de(nYi()))}};var Fie=class extends nr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new Q_e(r),this.proxySocketFactory=r.get(fk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Bo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Bo).getHttpSettings()),this.updateNoProxy(r.get(Bo).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(ds),s=this.proxySocketTimeoutForTesting;return wzi({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 VW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new nx(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var H_e=class extends Wm{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(mf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=Vy({serverUrl:p7e(r,n.serverUrl),apiUrl:p7e(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 G_e=class extends XL{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){ua(e,r,n)}};p();var $_e=class extends g4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var nIt=class extends YP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var iIt=class extends Kh{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 oIt=class extends YV{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 oYi(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(oYi,"fakeChatModelConfiguration");function l8c(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(l8c,"fakeEmbeddingModelConfiguration");var sIt=class extends el{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(oYi(r))}getModelConfigurationById(e){return Promise.resolve({...oYi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(l8c(e))}};p();var aIt=class extends zm{constructor(){super(...arguments);this.openedUrls=[];this.opened=new CA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},cIt=class extends ts{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 sYi(t,e,r,n){return MS.create(f7e(t),e,r,n,e)}a(sYi,"createTextDocument");var sFr=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Wi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Wi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Wi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Wi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Wi;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=sYi(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]=sYi(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}},lIt=class extends sFr{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 aFr=class extends Hf{static{a(this,"NullLog")}logIt(...e){}},cFr=class extends Lr{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 u8c(t){let e=new aue;e.set(Bo,t),e.set(UY,t);let r=new cFr(e,{accessToken:"",login:"user"});e.set(Lr,r),e.set(ds,new ds),e.set(np,new np),e.set(HI,new HI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(mp,Qzi([])),e.set(fk,rIt(e)),e.set(Sx,new Sx),e.set(pP,new vje);let n=new D_e;e.set(Ph,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Bp(e);return s.updateFromToken(n.defaultToken),e.set(Bp,s),e.set(eg,new eg),e.set(rM,new rM),e.set(ts,new cIt),e.set(zm,new aIt),e.set(XL,new G_e),e.set(Hf,new aFr),e.set(bC,new bC),e.set(Qa,new Qa("test-session","test-machine","test-device")),e.set(qI,new qI(()=>Promise.resolve("test-device"))),e.set(Wm,new H_e(e)),e.set(Dk,new Soe),e.set(mf,new mf(e,"copilot-test")),e.set(Zt,new Zt(e)),e.set(oO,new oO(e,o)),e.set(G2,new G2),e.set(xP,new fle),e.set(ps,new yje),e.set(Rd,new Rd),e.set(r4,new r4(e)),e.set(YV,new oIt),e.set(J2,new J2(e)),e.set(x8,Odt(e)),e.set(oy,new oy),e.set(Db,new Db),e.set(w8,w8.default),e.set(Bx,new Bx(e,!1)),e.set(Kp,new Kp),e.set(ni,new ni(e)),e.set(GT,new Fdt),e.set(mm,new mm),e.set(gm,zlt(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Nb,new Nb(e)),d8c(e),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(g4,new $_e),e.set(TN,new TN),e.set(Ew,new Ew),e.set(oT,new oT(e)),e}a(u8c,"_createBaselineContext");function d8c(t){t.set(Yo,new Yo(t)),t.set(Tc,new Tc(t)),t.set(PA,new PA(t)),t.set(Jh,new Jh),t.set(yg,new yg),t.set(Kh,new iIt),t.set(uk,new uk(t,[])),t.set(el,new sIt),t.set(YP,new nIt),t.set(OO,new OO(t));let e=new kN(t);t.set(kN,e),t.set(ck,new ck(e,t)),t.set($O,new $O(t)),t.set(TI,new YSt),t.set(ZC,new ZC(t.get(ck),t.get(TI),t)),t.set(A0,new A0)}a(d8c,"registerConversation");function aYi(){let t=u8c(new UY(new ple,new Map));return t.set(nr,new eIt),t.set(Ir,new lFr),t.set($r,new lIt(t)),t.set(qo,new IQ),t.set(ic,new ic(t)),t.set(Au,new Au(t)),t.set(HS,new pYe),t.set(yO,new yO(t)),t.set(n4,new ome),t.set(Q2,new Hct),t.set(Hl,new Yze),t.set(RA,new RA(t)),t.set(l0,new Mze),t.set(hm,new hm),Nze(t),t.set(ny,new pEe(t)),t}a(aYi,"createLibTestingContext");var lFr=class extends Ir{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 lYi=de(require("fs"));var cYi=`${process.env.HOME}/.copilot-testing-gh-token`,uIt,dIt;function uYi(t){let e=dYi(),r=new DTt(f8c);return t.forceSet(Ph,r),t.get(Lr).setTransientSession(e),r}a(uYi,"setIntegrationTokenManager");var f8c=a(async()=>{if(dIt)return dIt;let t=await dYi(),e=aYi(),r=new Fie(e);return e.forceSet(nr,r),dIt=$Dt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new yi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),dIt},"getEnvelope");async function dYi(){let{session:t}=N5t(process.env);if(t)return t;try{uIt??=(await lYi.promises.readFile(cYi)).toString().trim()}catch{uIt??=process.env.GITHUB_TOKEN??""}if(!uIt)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 ${cYi}. Run "npm run get_token" to get one.`);return{...Vy({}),accessToken:uIt,login:"copilot-client tests"}}a(dYi,"getTestingGitHubSession");var p8c=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function h8c(t,e,r){return uYi(t),await t.get(Qt).primeToken(),["OK",null]}a(h8c,"handleTestingUseTestingTokenChecked");var fYi=Ne(p8c,h8c);p();var m8c=S.Object({});async function g8c(t,e,r){return await new gEe().uninstall(t),["OK",null]}a(g8c,"handleUninstallChecked");var pYi=Ne(m8c,g8c);p();var A8c=KXn;function y8c(t,e,r){let n=t.get(gm),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(y8c,"unregisterContextProviders");var hYi=Ne(A8c,y8c);p();var uFr=de(require("os"));var E8c=S.Object({expectedCertificate:S.String()});async function _8c(t,e,r){let o=(await yot(t).getAllRootCAs()).map(x_e),s=x_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${a3r(s)}. Only found those installed on the system:${uFr.EOL}${o.map(c=>"- "+a3r(c)).join(uFr.EOL)}`},null]}a(_8c,"handleVerifyCertificateChecked");var mYi=Ne(E8c,_8c);p();var v8c=S.Object({});async function C8c(){return[{status:!!await new IFe().load()},null]}a(C8c,"handleVerifyKerberosChecked");var gYi=Ne(v8c,C8c);p();var b8c=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function S8c(t,e,r){let o=await t.get($r).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(S8c,"handleVerifyStateChecked");var AYi=Ne(b8c,S8c);p();var T8c=S.Object({});function I8c(t,e,r){return[t.get($r).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(I8c,"handleVerifyWorkspaceStateChecked");var yYi=Ne(T8c,I8c);p();p();var W_e=de(require("fs/promises")),EYi=de(require("os")),tf=de(require("path"));var Op=new fe("GitWorktreeService"),x8c=20,V_e=class{constructor(e){this.ctx=e;this.gitInstances=new Cn(x8c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=tf.resolve(e),n=this.gitInstances.get(r);return n||(n=$ue(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=tf.resolve(e);Op.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Op.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Op.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?(Op.info(this.ctx,`Skipping checkpoint commit for ${tf.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)),Op.info(this.ctx,`Created ${n} commit for ${tf.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Op.info(this.ctx,`Snapshotting copied changes in ${tf.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 Op.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await W_e.mkdtemp(tf.join(EYi.tmpdir(),"copilot-worktree-")),o=tf.join(n,"changes.patch");try{Op.info(this.ctx,`Writing temporary patch for ${tf.resolve(e)} to ${o} (${r.length} chars)`),await W_e.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 W_e.rm(n,{recursive:!0,force:!0}),Op.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=tf.basename(r),h=tf.join(tf.dirname(r),`${f}.worktrees`),m=tf.join(h,d);return Op.info(this.ctx,`Preparing worktree creation for ${tf.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])),Op.info(this.ctx,`Created worktree ${m} from ${tf.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Op.info(this.ctx,`Preparing to remove worktree ${e} from ${tf.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Op.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Op.info(this.ctx,`Skipping status lookup for ${tf.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){Op.info(this.ctx,`Applying worktree changes from ${tf.resolve(e)} to ${tf.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Op.info(this.ctx,o?`Committed pending worktree changes in ${tf.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${tf.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Op.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 Op.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 Op.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"])),Op.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Op.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Op.info(this.ctx,`Popped stash in ${e}`)}};p();var _Yi=de(ei());var x1=new fe("WorktreeService");var w8c=new _Yi.ProtocolRequestType("worktree/requestUserDecision"),xFe=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 x1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";x1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ar).connection.sendRequest(w8c,{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?(x1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(x1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){x1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(x1.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&&(x1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(x1.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},x1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);x1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw x1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return x1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){x1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return x1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var R8c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",k8c=["already exists in working directory","patch does not apply","patch failed"];function P8c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&k8c.some(n=>e.includes(n))?R8c:`Failed to apply worktree changes: ${e}`}a(P8c,"getWorktreeCompleteErrorMessage");var D8c=S.Object({repositoryPath:S.String()});async function N8c(t,e,r){try{let n=new V_e(t),o=new xFe(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:Ze.InternalError,message:`Failed to create worktree: ${o}`}]}}a(N8c,"handleWorktreeCreateChecked");var vYi=Ne(D8c,N8c),M8c=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function O8c(t,e,r){try{let n=new V_e(t);return[{success:!0,baseCommit:(await new xFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:P8c(n)}]}}a(O8c,"handleWorktreeCompleteChecked");var CYi=Ne(M8c,O8c),L8c=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function B8c(t,e,r){try{return await new V_e(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(B8c,"handleWorktreeDeleteChecked");var bYi=Ne(L8c,B8c);var Uie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function SYi(){let t=new Map;return t.set(lVi.method,uVi),t.set("getCompletions",Y$i),t.set("getCompletionsCycling",K$i),t.set("getDefaultFileSafetyRules",J$i),t.set("copilot/parseTerminalCommand",jVi),t.set("getPanelCompletions",eVi),t.set(I$i.method,x$i),t.set("getVersion",rVi),t.set("getUserInfo",tVi),t.set("setEditorInfo",aWi),t.set("checkStatus",LGi),t.set("checkQuota",OGi),t.set("checkFileStatus",NGi),t.set("claude/checkCliCompatibility",RGi),t.set("codex/checkCliCompatibility",DGi),t.set("signInInitiate",p3r),t.set("signIn",p3r),t.set("signInWithCodeFlow",gWi),t.set("signInWithDeviceFlow",EWi),t.set("signInConfirm",cWi),t.set("signInWithGithubToken",_Wi),t.set("signOut",vWi),t.set("auth/listAvailableTokens",Yqi),t.set("auth/removeToken",Kqi),t.set("auth/useExistingToken",Jqi),t.set("notifyShown",qVi),t.set("notifyAccepted",FVi),t.set("notifyRejected",QVi),t.set("notifyNextEditRejected",UVi),t.set("telemetry/exception",CWi),t.set("textDocument/copilotInlineEdit",BVi),t.set("testing/overrideExpFlags",jzi),t.set("testing/alwaysAuth",C3r),t.set("testing/setAlwaysAuthed",C3r),t.set("testing/neverAuth",J3r),t.set("testing/setNeverAuthed",J3r),t.set("testing/useTestingToken",fYi),t.set("testing/setCompletionDocuments",$$i),t.set("testing/setPanelCompletionDocuments",S$i),t.set("testing/setNextEditDocument",DVi),t.set("testing/triggerShowMessageRequest",$zi),t.set("testing/flushPromiseQueue",Lzi),t.set("testing/getDocument",Uzi),t.set("testing/chatml",bWi),t.set("testing/setSyntheticTurns",Gzi),t.set("testing/fetch",Ozi),t.set("testing/setContentExclusionRules",Hzi),t.set("testing/getContext",Fzi),t.set("uninstall",pYi),t.set("debug/diagnostics",F$i),t.set("debug/listCertificates",dVi),t.set("debug/verifyState",AYi),t.set("debug/verifyCertificate",mYi),t.set("debug/verifyKerberos",gYi),t.set("debug/verifyWorkspaceState",yYi),t.set("debug/getAgentDebugLog",Q$i),t.set("debug/exportAgentDebugLog",U$i),t.set("context/registerProviders",nWi),t.set("context/unregisterProviders",hYi),t.set("conversation/preconditions",e$i),t.set("conversation/persistence",XGi),t.set("conversation/create",YGi),t.set("conversation/turn",i$i),t.set("conversation/turnDelete",o$i),t.set("conversation/destroy",KGi),t.set("conversation/compress",$Gi),t.set("conversation/rating",t$i),t.set("conversation/copyCode",HGi),t.set("conversation/insertCode",GGi),t.set("conversation/templates",n$i),t.set("conversation/modes",JGi),t.set("conversation/agents",jGi),t.set("conversation/registerTools",r$i),t.set("conversation/unregisterTools",s$i),t.set("conversation/updateToolsStatus",a$i),t.set("conversation/notifyCodeAcceptance",ZGi),t.set("customAgent/registerExtensionAgents",R$i),t.set("customAgent/unregisterExtensionAgents",k$i),t.set("copilot/customAgent/list",w$i),t.set("copilot/customSkill/list",N$i),t.set("copilot/customPrompt/list",D$i),t.set("copilot/customInstruction/list",P$i),t.set("copilot/hook/list",aVi),t.set("copilot/models",y$i),t.set("copilot/models/getModelMetadataList",E$i),t.set("copilot/byok/saveModel",wGi),t.set("copilot/byok/deleteModel",Xqi),t.set("copilot/byok/listModels",TGi),t.set("copilot/byok/saveApiKey",IGi),t.set("copilot/byok/deleteApiKey",Zqi),t.set("copilot/byok/listApiKeys",tji),t.set("copilot/byok/saveCustomProviderConfig",xGi),t.set("copilot/byok/listCustomProviderConfigs",rji),t.set("copilot/setModelPolicy",_$i),t.set("copilot/codeReview/reviewChanges",l$i),t.set("copilot/codeReview/reviewSnippets",u$i),t.set("git/commitGenerate",nVi),t.set("thinking/generateTitle",c$i),t.set("mcp/getTools",f$i),t.set("mcp/updateToolsStatus",p$i),t.set("mcp/readResource",h$i),t.set("mcp/registry/listServers",wVi),t.set("mcp/registry/getServer",RVi),t.set("mcp/registry/getAllowlist",PVi),t.set("mcp/getPrompt",m$i),t.set("mcp/completePrompt",g$i),t.set("mcp/serverAction",A$i),t.set("mcpGateway/listServers",AVi),t.set("mcpGateway/getServerDetails",yVi),t.set("mcpGateway/serverAction",EVi),t.set("mcpGateway/applyConfig",gVi),t.set("plugins/list",KVi),t.set("plugins/install",zVi),t.set("plugins/installFromSource",YVi),t.set("plugins/uninstall",tWi),t.set("plugins/enable",WVi),t.set("plugins/disable",VVi),t.set("plugins/update",rWi),t.set("plugins/marketplace/add",JVi),t.set("plugins/marketplace/remove",eWi),t.set("plugins/marketplace/list",XVi),t.set("plugins/marketplace/browse",ZVi),t.set("githubApi/searchPR",sVi),t.set("githubApi/cancelCodingAgent",FGi),t.set("cloudAgent/listSessions",qGi),t.set("cloudAgent/getSessionLogs",QGi),t.set("cloudAgent/createJob",UGi),t.set("cloudAgent/addPullRequestComment",BGi),t.set("githubApi/listPullRequestChangedFiles",iVi),t.set("worktree/create",vYi),t.set("worktree/complete",CYi),t.set("worktree/delete",bYi),t.set("backgroundAgent/create",Iqi),t.set("backgroundAgent/send",Vqi),t.set("backgroundAgent/truncateHistory",zqi),t.set("backgroundAgent/destroy",xqi),t.set("backgroundAgent/listModels",qqi),t.set("backgroundAgent/listSessions",Fqi),t.set("backgroundAgent/resume",Gqi),t.set("backgroundAgent/stop",Wqi),t.set("backgroundAgent/interaction",Oqi),t.set("backgroundAgent/enableRemote",Pqi),t.set("backgroundAgent/disableRemote",Rqi),t.set("backgroundAgent/getRemoteStatus",Nqi),t.set("backgroundAgent/getPlanPath",Dqi),t.set("backgroundAgent/compactHistory",bqi),new Uie(t)}a(SYi,"getAllMethods");p();p();p();var TYi=de(NP());var ky=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new TYi.NotificationType(this.name)}};var F8c=new fe("BackgroundAgent.notifications"),dFr=class extends ky{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},fFr=class extends ky{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:q4r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){F8c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Hs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},IYi=[dFr,fFr];p();var pFr=class extends ky{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")}},xYi=[pFr];p();var U8c=new fe("agentCopilotTokenManager");function mFr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(mFr,"tokenEndpointToApiUrl");function Q8c(t,e){if(!e.tokenEndpoint)return Vy(e);let r=mFr(e.tokenEndpoint);return r||U8c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),Vy({apiUrl:r})}a(Q8c,"getUrlsFromParams");var hFr=class extends ky{constructor(){super(...arguments);this.name=VQt.method;this.params=Evn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Lr),o=Q8c(this.ctx,r);this.ctx.get(Wm).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})}},wYi=[hFr];p();var gFr=class extends ky{constructor(){super(...arguments);this.name=ZQt.method;this.params=xvn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Ru).get(n);s&&yni(this.ctx,s)}},AFr=class extends ky{constructor(){super(...arguments);this.name=eqt.method;this.params=Dvn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(zv).handleShown(n)}},yFr=class extends ky{constructor(){super(...arguments);this.name=XQt.method;this.params=wvn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Ru),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Nme(this.ctx,c)):$dt(this.ctx,c,o,void 0,void 0,"cumulative"))}},RYi=[gFr,AFr,yFr];p();var fIt=class extends ky{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(PN).cancel(r.token)}};p();var EFr=class extends ky{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=S.Object({items:S.Array(S.Object({folderUri:S.String(),trusted:S.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(np);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},kYi=[EFr];var q8c=[...IYi,...xYi,...wYi,...RYi,...kYi,fIt];function PYi(t,e){for(let r of q8c){let n=new r(t),o=ju.Compile(n.params);e.onNotification(n.type,Y0(t,async s=>{y9(s),o.Check(s)?await n.handle(s):Vo.error(t,`Notification ${n.name}:`,new qA(o.Errors(s)))},`Notification ${n.name}`))}}a(PYi,"registerNotifications");p();var DYi=de(Xc());p();var z_e=de(Xc());var j8c=new z_e.ProtocolNotificationType("copilot/customAgent/didChange"),H8c=new z_e.ProtocolNotificationType("copilot/customSkill/didChange"),G8c=new z_e.ProtocolNotificationType("copilot/customPrompt/didChange"),$8c=new z_e.ProtocolNotificationType("copilot/customInstruction/didChange"),_Fr=new z_e.ProtocolNotificationType("copilot/hook/didChange");function V8c(t){switch(t){case"agent":return j8c;case"skill":return H8c;case"prompt":return G8c;case"instructions":return $8c;case"hook":return _Fr;default:return}}a(V8c,"notificationTypeFor");var pIt=class extends l0{constructor(r){super();this.ctx=r;this.logger=new fe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=V8c(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ar).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var W8c=new DYi.ProtocolNotificationType("copilot/plugins/didChange"),Qie=class{constructor(e,r){this.ctx=e;this.logger=new fe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(ar).connection}catch(n){this.logger.debug(this.ctx,"Failed to resolve connection for copilot/plugins/didChange:",n);return}let r=await Promise.allSettled([e.sendNotification(W8c,{}),e.sendNotification(_Fr,{})]);for(let n of r)n.status==="rejected"&&this.logger.debug(this.ctx,"Failed to send a plugin change notification:",n.reason)}dispose(){this.subscription.dispose()}};p();p();var NYi=de(require("crypto")),MYi=require("os");Oo();var z8c=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function Y8c(t){let e=t.replace(/-/g,":").toLowerCase();return!z8c.has(e)}a(Y8c,"validateMacAddress");function K8c(){let t=(0,MYi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(Y8c(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(K8c,"getMac");var vFr;function J8c(){try{let t=K8c();return NYi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(J8c,"getMacMachineId");function CFr(){return vFr||(vFr=J8c()||Mt()),vFr}a(CFr,"getMachineId");Oo();function bFr(t){let e=t??Mt()+Date.now();return new Qa(e,CFr(),CFr())}a(bFr,"createEditorSession");var OYi=bFr();p();var hIt=de(Xc());var SFr=new fe("AgentTextDocumentConfiguration"),TFr=class{constructor(e){this.ctx=e;this.#e=new Wi;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return MS.create(e,r,n,o)}catch(s){throw SFr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=MS.withChanges(e,r,n);for(let l of r)if(hIt.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])}.`;SFr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Wt.createAndMarkAsIssued({message:`Received ${g}`});At(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}])}else{let u=e.getText().length,f={range:{start:e.positionAt(0),end:e.positionAt(u)},rangeOffset:0,rangeLength:u,text:l.text};o.push(f),e=e.applyEdits([{range:f.range,newText:f.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw SFr.exception(this.ctx,o,".update"),o}}},JV=class extends $r{constructor(){super(...arguments);this.#e=new Wi;this.onDidOpenTextDocument=this.#e.event;this.#t=new Wi;this.onDidCloseTextDocument=this.#t.event;this.#r=new Wi;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new TFr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new hIt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Wi;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ar).connection}init(r){this.connection.onDidOpenTextDocument(o=>{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Fs(s.uri),c),this.#e.fire({document:{...s,uri:c.uri}})}),this.connection.onDidChangeTextDocument(o=>{let s=o.textDocument,c=o.contentChanges,{version:l}=s;if(l==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let u=Fs(s.uri),d=this._documents.get(u);d!==void 0&&(d=this._textDocumentConfiguration.update(d,c,l),this._documents.set(u,d))}),this.connection.onDidCloseTextDocument(o=>{let s=Fs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification(YQt.type,o=>{let s=("textDocument"in o?o.textDocument:o)??{};this.#r.fire("uri"in s?{document:s}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0;let n=this.ctx.get(np);for(let o of r){let s=o.trusted;typeof s=="boolean"&&n.setTrust(o.uri,s)}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),this.ctx.get(np).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(np).setTrust(r.uri,n),!this.workspaceFolders.find(o=>o.uri===r.uri)&&this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(Fs(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 LYi=ju.Compile(Svn);function y9(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(BYi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of pFe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(IO).handleConfigurationChange(e.settings)}catch(n){Vo.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return ITt(this.ctx,y9(e))}catch(r){Vo.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Hf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}isWorkspaceTrustGateEnabled(){return this.#r?.experimental?.workspaceTrustGate===!0}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),PYi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ds).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(JV).didChangeWorkspaceFolders(c)}catch(l){Vo.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,e.get(np).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=y9(c.initializationOptions);if(u){if(!LYi.Check(u))throw new qA(LYi.Errors(u));let m=u,g=e.get(Ir);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):Vo.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(Kp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Qa,bFr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(JV).init(c.workspaceFolders??[]),PXn(this.ctx),l&&(e.get(bn).setCapabilities(l),l.contentProvider&&da.registerSchemes(l.contentProvider),"openURL"in l&&Vdt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,Vo.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ps).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(xI.DidChangeConfigurationNotification.type,{section:BYi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(rb).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||TTt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ps).sendInitNonAuthStatus(),new gEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(Y0(e,h,"onInitialized")),e.get(IN).init(),l?.token&&e.get(Lr).setTransientSession({}),l?.redirectedTelemetry&&YQi(e),FYi.lt(process.versions.node,"22.0.0")&&Vo.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:xI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:$Qi(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 b1t;this.ctx.forceSet(Hf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");ai(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Uie).handlers.get(e);if(!o)return new xI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new xI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new xI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new xI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),y9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new xI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new xI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof yi)return this.telemetryMethodFailure(e,s),new xI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof xI.ResponseError||Vo.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(zY).stop()}catch(e){Vo.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(_F).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(y8).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Qie).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(oie).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(ty).dispose().catch(e=>{Vo.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){Vo.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(wH).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(n2).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(_8).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(uc).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Hs).shutdown().catch(e=>{Vo.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(dg).dispose()}catch(e){Vo.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Hf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(rb).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),khr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(Rd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(eg).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},Vo=new fe("lsp");var Kv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new UYi.ProtocolRequestType("conversation/context");this.typeCheck=ju.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ar).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 QYi.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 qA(this.typeCheck.Errors(o));return o}}};var IFr=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")}},Q9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new IFr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},mIt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Tc)}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(Yo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new Kv(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 SC(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:Mt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var DN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(Q9).get(r);if(o)return new mIt(e,o);let c=(await rw(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 yJe(e.ctx):l=new Eue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new KRe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new KRe(e,l):new Brt(e,l)}};p();var ZV=class extends U_{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 Z8c(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(Z8c,"mapToolNameToKind");function X8c(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(X8c,"extractLocationsFromInput");function e6c(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(e6c,"mapToolCallStatus");var gIt=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=e6c(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=X8c(c.name,c.input);await this.reportToolCallStart(c.id,c.name,Z8c(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 pIt(t){try{if((await t.get(Ur).checkAndUpdateStatus()).status==="OK")return;let n=await STt(t,(o,s)=>new DN(o,DN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof FU?new fo(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof yi?new fo(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(pIt,"performACPGitHubOAuth");function hIt(t){if(t!=="github_oauth")throw new fo(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(hIt,"validateAuthMethodId");async function mIt(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(mIt,"requireACPAuthenticated");var PYi=[{id:Cl.Ask.id,name:Cl.Ask.name,description:Cl.Ask.description},{id:Cl.Agent.id,name:Cl.Agent.name,description:Cl.Agent.description}],gIt=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(Ir);o instanceof ij&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}At(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:Crt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:n})}async newSession(e){At(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Mt(),n=Mt(),s=this.ctx.get(zo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ks(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 At(this.ctx,"acp.authenticate"),hIt(e.methodId),await pIt(this.ctx),{}}async requireAuthenticated(){await mIt(this.ctx)}async prompt(e){At(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 Fn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Mt(),l=new Xf(s,c),u=r.currentModeId===Cl.Ask.id?Cl.Ask:Cl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(zo),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 fIt(this.connection,e.sessionId),g=new hw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(F_);A instanceof zV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(RN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof zV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(F_);if(s instanceof zV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){At(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){At(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(Ze.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){At(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return rx(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?PYi:PYi.filter(e=>e.id===Cl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?Cl.Agent.id:Cl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(xs).getMetadata(),r=[],n=V_;r.push({modelId:V_,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!(sle.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 DYi=require("node:child_process"),yIt=require("node:stream");var AIt=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,DYi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:H9t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{Vn(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||At(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=yIt.Writable.toWeb(this.cliProcess.stdin),c=yIt.Readable.toWeb(this.cliProcess.stdout),l=GRe(s,c);return this._cliConnection=new wrt(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 EIt=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(Ir);r instanceof ij&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return At(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Crt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return At(this.ctx,"acp.cli.authenticate"),hIt(e.methodId),await pIt(this.ctx),{}}async newSession(e){return At(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return At(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return At(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return At(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return At(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return At(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return At(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return At(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(Ze.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:V1(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]),At(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw Vn(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(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await mIt(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 Xwt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(voo(),_oo)),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 Coo(t){let e=new sue;e.set(Lo,t),e.set(Cx,new Cx),e.set(ds,new ds),e.set(q2,new q2);let r=new Qt(e);return e.set(Qt,r),e.set(Zt,new Zt(e)),e.set(rO,new rO(e,r)),e.set(XN,new XN),e.set(Op,new Op(e)),e.set(X0,new X0),e.set(CC,new CC),e.set(AO,new oxe),e.set(TP,new dle),e.set(dP,new aSe),e.set(xd,new xd),e.set(t4,new t4(e)),e.set(ii,new ii(e)),e.set(z2,new z2(e)),e.set(T8,Pdt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(I8,I8.default),e.set(_f,new _f(e)),e.set(Ox,new Ox(e)),e.set(zp,new zp),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(Au,new Au(e)),e.set(gO,new gO(e)),e.set(CN,new CN),e.set(LK,new LK(e)),e}a(Coo,"createCommonContext");p();var eRt=class extends qf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||y1t(r))&&this.console.warn(`[${o}]`,...s)}};p();var Ioo=require("node:os");var grl=new fe("repository"),uoe="\\\\",xoo="(?:[#;].*)",zve=`(?:[^"${uoe}]|${uoe}.)`,Arl="[0-9A-Za-z-]",boo=`[A-Za-z]${Arl}*`,woo=`\\s*${xoo}?$`,Roo=`(?:[^"${uoe};#]|${uoe}.)`,yrl=`(?:"${zve}*"|"${zve}*(?${uoe})$)`,Erl=`(?:${Roo}|${yrl})+`,_rl=`(?:(?${uoe})$)`,koo=`(?${Erl})${_rl}?${woo}`,Soo=new RegExp(`^${koo}`),vrl=new RegExp(`^(?${zve}*(?:(?${uoe})$|(?")))`),Crl=new RegExp(`^\\s*(?:(?${boo})\\s*=\\s*${koo}|(?${boo})${woo})`),brl=new RegExp(`(?${Roo}+)|"(?${zve}*)"`,"g"),Too="[-.0-9A-Za-z]+",Srl=`\\s+"(?${zve}*)"`,Trl=`\\s+"(?${zve}*)"`,Irl=new RegExp(`^\\s*\\[(?:(?${Too})${Srl}|${Trl}|(?${Too}))\\]`),xrl=new RegExp(`^\\s*${xoo}$`),l7r=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(Irl);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(Crl);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(vrl),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(Soo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(Soo),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(brl)].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(){xrl.test(this.line)&&(this.line="")}},tRt=class extends NP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await _f.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 hK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new l7r(o),c=new hK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Qo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&grl.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=wa(this.xdgConfigUri(),"git","config"),s=wa(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=uf(r),o=wa(n,"commondir");try{let s=(await e.get(Qo).readFileString(o)).trimEnd();return wa($W(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ks(process.env.XDG_CONFIG_HOME):wa(this.homeUri(),".config")}homeUri(){return Ks((0,Ioo.homedir)())}};p();var Poo=require("child_process");var rRt=class extends NP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Poo.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){Y9t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){Y9t.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 hK;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 Doo(t){let e=Coo(t);return wrl(e),e.set(pp,fot(e)),e.set(uk,ZTt(e)),e.set(NP,new Eze([new rRt,new tRt])),e}a(Doo,"createProductionContext");function wrl(t){t.set(QI,QI.fromEnvironment(!1)),t.set(ZL,new j_e),t.set(qf,new eRt(console))}a(wrl,"setupRudimentaryLogging");var nXh=new fe("context");p();var aso=require("fs");p();p();var rso=require("node:url");p();p();var Yve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Moo=new Set,u7r=typeof process=="object"&&process?process:{},Ooo=a((t,e,r,n)=>{typeof u7r.emitWarning=="function"?u7r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),nRt=globalThis.AbortController,Noo=globalThis.AbortSignal;if(typeof nRt>"u"){Noo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},nRt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Noo;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=u7r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Ooo("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 Rrl=a(t=>!Moo.has(t),"shouldWarn");var gW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Loo=a(t=>gW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Kve:null:null,"getUintArray"),Kve=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},d7r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Loo(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]}},J8e=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&&!gW(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Loo(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=d7r.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&&!gW(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gW(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=gW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!gW(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 P="LRU_CACHE_UNBOUNDED";Rrl(P)&&(Moo.add(P),Ooo("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}#k(){let e=new Kve(this.#e),r=new Kve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Yve.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?Yve.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=Yve.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");#L=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new Kve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!gW(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!gW(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");#B=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-(Yve.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=Yve.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=Yve.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.#B(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.#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.#L(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.#P(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 nRt,{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 nRt}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.#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 Xve=require("node:path"),Voo=require("node:url"),KL=require("fs"),Url=de(require("node:fs"),1),EW=require("node:fs/promises");p();var uRt=require("node:events"),y7r=de(require("node:stream"),1),qoo=require("node:string_decoder");var Boo=typeof process=="object"&&process?process:{stdout:null,stderr:null},krl=a(t=>!!t&&typeof t=="object"&&(t instanceof yW||t instanceof y7r.default||Prl(t)||Drl(t)),"isStream"),Prl=a(t=>!!t&&typeof t=="object"&&t instanceof uRt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==y7r.default.Writable.prototype.pipe,"isReadable"),Drl=a(t=>!!t&&typeof t=="object"&&t instanceof uRt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),J9=Symbol("EOF"),Z9=Symbol("maybeEmitEnd"),AW=Symbol("emittedEnd"),iRt=Symbol("emittingEnd"),Z8e=Symbol("emittedError"),oRt=Symbol("closed"),Foo=Symbol("read"),sRt=Symbol("flush"),Uoo=Symbol("flushChunk"),VN=Symbol("encoding"),Jve=Symbol("decoder"),aA=Symbol("flowing"),X8e=Symbol("paused"),Zve=Symbol("resume"),cA=Symbol("buffer"),eC=Symbol("pipes"),lA=Symbol("bufferLength"),f7r=Symbol("bufferPush"),aRt=Symbol("bufferShift"),u_=Symbol("objectMode"),Th=Symbol("destroyed"),p7r=Symbol("error"),h7r=Symbol("emitData"),Qoo=Symbol("emitEnd"),m7r=Symbol("emitEnd2"),zL=Symbol("async"),g7r=Symbol("abort"),cRt=Symbol("aborted"),e6e=Symbol("signal"),doe=Symbol("dataListeners"),OI=Symbol("discarded"),t6e=a(t=>Promise.resolve().then(t),"defer"),Nrl=a(t=>t(),"nodefer"),Mrl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Orl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),Lrl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),lRt=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[Zve](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},A7r=class extends lRt{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)}},Brl=a(t=>!!t.objectMode,"isObjectModeOptions"),Frl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),yW=class extends uRt.EventEmitter{static{a(this,"Minipass")}[aA]=!1;[X8e]=!1;[eC]=[];[cA]=[];[u_];[VN];[zL];[Jve];[J9]=!1;[AW]=!1;[iRt]=!1;[oRt]=!1;[Z8e]=null;[lA]=0;[Th]=!1;[e6e];[cRt]=!1;[doe]=0;[OI]=!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");Brl(r)?(this[u_]=!0,this[VN]=null):Frl(r)?(this[VN]=r.encoding,this[u_]=!1):(this[u_]=!1,this[VN]=null),this[zL]=!!r.async,this[Jve]=this[VN]?new qoo.StringDecoder(this[VN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[cA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[eC],"get")});let{signal:n}=r;n&&(this[e6e]=n,n.aborted?this[g7r]():n.addEventListener("abort",()=>this[g7r]()))}get bufferLength(){return this[lA]}get encoding(){return this[VN]}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[u_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[zL]}set async(e){this[zL]=this[zL]||!!e}[g7r](){this[cRt]=!0,this.emit("abort",this[e6e]?.reason),this.destroy(this[e6e]?.reason)}get aborted(){return this[cRt]}set aborted(e){}write(e,r,n){if(this[cRt])return!1;if(this[J9])throw new Error("write after end");if(this[Th])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[zL]?t6e:Nrl;if(!this[u_]&&!Buffer.isBuffer(e)){if(Lrl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Orl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[u_]?(this[aA]&&this[lA]!==0&&this[sRt](!0),this[aA]?this.emit("data",e):this[f7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):e.length?(typeof e=="string"&&!(r===this[VN]&&!this[Jve]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[VN]&&(e=this[Jve].write(e)),this[aA]&&this[lA]!==0&&this[sRt](!0),this[aA]?this.emit("data",e):this[f7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):(this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA])}read(e){if(this[Th])return null;if(this[OI]=!1,this[lA]===0||e===0||e&&e>this[lA])return this[Z9](),null;this[u_]&&(e=null),this[cA].length>1&&!this[u_]&&(this[cA]=[this[VN]?this[cA].join(""):Buffer.concat(this[cA],this[lA])]);let r=this[Foo](e||null,this[cA][0]);return this[Z9](),r}[Foo](e,r){if(this[u_])this[aRt]();else{let n=r;e===n.length||e===null?this[aRt]():typeof n=="string"?(this[cA][0]=n.slice(e),r=n.slice(0,e),this[lA]-=e):(this[cA][0]=n.subarray(e),r=n.subarray(0,e),this[lA]-=e)}return this.emit("data",r),!this[cA].length&&!this[J9]&&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[J9]=!0,this.writable=!1,(this[aA]||!this[X8e])&&this[Z9](),this}[Zve](){this[Th]||(!this[doe]&&!this[eC].length&&(this[OI]=!0),this[X8e]=!1,this[aA]=!0,this.emit("resume"),this[cA].length?this[sRt]():this[J9]?this[Z9]():this.emit("drain"))}resume(){return this[Zve]()}pause(){this[aA]=!1,this[X8e]=!0,this[OI]=!1}get destroyed(){return this[Th]}get flowing(){return this[aA]}get paused(){return this[X8e]}[f7r](e){this[u_]?this[lA]+=1:this[lA]+=e.length,this[cA].push(e)}[aRt](){return this[u_]?this[lA]-=1:this[lA]-=this[cA][0].length,this[cA].shift()}[sRt](e=!1){do;while(this[Uoo](this[aRt]())&&this[cA].length);!e&&!this[cA].length&&!this[J9]&&this.emit("drain")}[Uoo](e){return this.emit("data",e),this[aA]}pipe(e,r){if(this[Th])return e;this[OI]=!1;let n=this[AW];return r=r||{},e===Boo.stdout||e===Boo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[eC].push(r.proxyErrors?new A7r(this,e,r):new lRt(this,e,r)),this[zL]?t6e(()=>this[Zve]()):this[Zve]()),e}unpipe(e){let r=this[eC].find(n=>n.dest===e);r&&(this[eC].length===1?(this[aA]&&this[doe]===0&&(this[aA]=!1),this[eC]=[]):this[eC].splice(this[eC].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[OI]=!1,this[doe]++,!this[eC].length&&!this[aA]&&this[Zve]();else if(e==="readable"&&this[lA]!==0)super.emit("readable");else if(Mrl(e)&&this[AW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Z8e]){let o=r;this[zL]?t6e(()=>o.call(this,this[Z8e])):o.call(this,this[Z8e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[doe]=this.listeners("data").length,this[doe]===0&&!this[OI]&&!this[eC].length&&(this[aA]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[doe]=0,!this[OI]&&!this[eC].length&&(this[aA]=!1)),r}get emittedEnd(){return this[AW]}[Z9](){!this[iRt]&&!this[AW]&&!this[Th]&&this[cA].length===0&&this[J9]&&(this[iRt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[oRt]&&this.emit("close"),this[iRt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Th&&this[Th])return!1;if(e==="data")return!this[u_]&&!n?!1:this[zL]?(t6e(()=>this[h7r](n)),!0):this[h7r](n);if(e==="end")return this[Qoo]();if(e==="close"){if(this[oRt]=!0,!this[AW]&&!this[Th])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Z8e]=n,super.emit(p7r,n);let s=!this[e6e]||this.listeners("error").length?super.emit("error",n):!1;return this[Z9](),s}else if(e==="resume"){let s=super.emit("resume");return this[Z9](),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[Z9](),o}[h7r](e){for(let n of this[eC])n.dest.write(e)===!1&&this.pause();let r=this[OI]?!1:super.emit("data",e);return this[Z9](),r}[Qoo](){return this[AW]?!1:(this[AW]=!0,this.readable=!1,this[zL]?(t6e(()=>this[m7r]()),!0):this[m7r]())}[m7r](){if(this[Jve]){let r=this[Jve].end();if(r){for(let n of this[eC])n.dest.write(r);this[OI]||super.emit("data",r)}}for(let r of this[eC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[u_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[u_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[u_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[VN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Th,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[OI]=!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[J9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(Th,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(Th,f),this.pause(),s({value:h,done:!!this[J9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(Th,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(Th,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[OI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(p7r,r),this.off(Th,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(p7r,r),this.once(Th,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Th])return e?this.emit("error",e):this.emit(Th),this;this[Th]=!0,this[OI]=!0,this[cA].length=0,this[lA]=0;let r=this;return typeof r.close=="function"&&!this[oRt]&&r.close(),e?this.emit("error",e):this.emit(Th),this}static get isStream(){return krl}};var Qrl=KL.realpathSync.native,n6e={lstatSync:KL.lstatSync,readdir:KL.readdir,readdirSync:KL.readdirSync,readlinkSync:KL.readlinkSync,realpathSync:Qrl,promises:{lstat:EW.lstat,readdir:EW.readdir,readlink:EW.readlink,realpath:EW.realpath}},Woo=a(t=>!t||t===n6e||t===Url?n6e:{...n6e,...t,promises:{...n6e.promises,...t.promises||{}}},"fsFromOption"),zoo=/^\\\\\?\\([a-z]:)\\?$/i,qrl=a(t=>t.replace(/\//g,"\\").replace(zoo,"$1\\"),"uncToDrive"),jrl=/[\\\/]/,Tk=0,Yoo=1,Koo=2,YL=4,Joo=6,Zoo=8,foe=10,Xoo=12,Sk=15,r6e=~Sk,E7r=16,joo=32,i6e=64,WN=128,dRt=256,pRt=512,Hoo=i6e|WN|pRt,Hrl=1023,_7r=a(t=>t.isFile()?Zoo:t.isDirectory()?YL:t.isSymbolicLink()?foe:t.isCharacterDevice()?Koo:t.isBlockDevice()?Joo:t.isSocket()?Xoo:t.isFIFO()?Yoo:Tk,"entToType"),Goo=new Map,o6e=a(t=>{let e=Goo.get(t);if(e)return e;let r=t.normalize("NFKD");return Goo.set(t,r),r},"normalize"),$oo=new Map,fRt=a(t=>{let e=$oo.get(t);if(e)return e;let r=o6e(t.toLowerCase());return $oo.set(t,r),r},"normalizeNocase"),hRt=class extends J8e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},v7r=class extends J8e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},eso=Symbol("PathScurry setAsCwd"),d_=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;#k;#R;#d;#L;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Tk,n,o,s,c,l){this.name=e,this.#E=s?fRt(e):o6e(e),this.#d=r&Hrl,this.nocase=s,this.roots=o,this.root=n||this,this.#L=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=Woo(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}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.#L.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#L.set(this,r),this.#d&=~E7r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?fRt(e):o6e(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,Tk,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=WN),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&Sk)===Tk}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&Sk)===Zoo}isDirectory(){return(this.#d&Sk)===YL}isCharacterDevice(){return(this.#d&Sk)===Koo}isBlockDevice(){return(this.#d&Sk)===Joo}isFIFO(){return(this.#d&Sk)===Yoo}isSocket(){return(this.#d&Sk)===Xoo}isSymbolicLink(){return(this.#d&foe)===foe}lstatCached(){return this.#d&joo?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&Sk;return!(e!==Tk&&e!==foe||this.#d&dRt||this.#d&WN)}calledReaddir(){return!!(this.#d&E7r)}isENOENT(){return!!(this.#d&WN)}isNamed(e){return this.nocase?this.#E===fRt(e):this.#E===o6e(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|=E7r;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&Hoo)return!1;let e=Sk&this.#d;return e===Tk||e===YL||e===foe}shouldWalk(e,r){return(this.#d&YL)===YL&&!(this.#d&Hoo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((pRt|dRt|WN)&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(!((pRt|dRt|WN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[eso](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}},mRt=class t extends d_{static{a(this,"PathWin32")}sep="\\";splitSep=jrl;constructor(e,r=Tk,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=Tk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Xve.win32.parse(e).root}getRoot(e){if(e=qrl(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 eCe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(zoo,"$1\\"),e===r}},gRt=class t extends d_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=Tk,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=Tk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},ARt=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=n6e}={}){this.#n=Woo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Voo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new hRt,this.#t=new hRt,this.#r=new v7r(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(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 d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new yW({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 d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new yW({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[eso](r)}},eCe=class extends ARt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,Xve.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return Xve.win32.parse(e).root.toUpperCase()}newRoot(e){return new mRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},tCe=class extends ARt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,Xve.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new gRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},s6e=class extends tCe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},AXh=process.platform==="win32"?mRt:gRt,tso=process.platform==="win32"?eCe:process.platform==="darwin"?s6e:tCe;p();var Grl=a(t=>t.length>=1,"isPatternList"),$rl=a(t=>t.length>=1,"isGlobList"),rCe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Grl(e))throw new TypeError("empty pattern list");if(!$rl(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 Vrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nCe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=Vrl}){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 Q_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},S7r=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())}},a6e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new b7r;subwalks=new S7r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new C7r}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 Wrl=a((t,e)=>typeof t=="string"?new nCe([t],e):Array.isArray(t)?new nCe(t,e):t,"makeIgnore"),yRt=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=Wrl(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 a6e(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 a6e(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()}},c6e=class extends yRt{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}},l6e=class extends yRt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new yW({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 zrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",zN=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,rso.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||zrl,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"?eCe:r.platform==="darwin"?s6e:r.platform?tCe:tso;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 Q_(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 rCe(u,f,0,this.platform)})}async walk(){return[...await new c6e(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 c6e(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 l6e(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 l6e(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 T7r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Q_(r,e).hasMagic())return!0;return!1},"hasMagic");function _Rt(t,e={}){return new zN(t,e).streamSync()}a(_Rt,"globStreamSync");function iso(t,e={}){return new zN(t,e).stream()}a(iso,"globStream");function oso(t,e={}){return new zN(t,e).walkSync()}a(oso,"globSync");async function nso(t,e={}){return new zN(t,e).walk()}a(nso,"glob_");function vRt(t,e={}){return new zN(t,e).iterateSync()}a(vRt,"globIterateSync");function sso(t,e={}){return new zN(t,e).iterate()}a(sso,"globIterate");var Yrl=_Rt,Krl=Object.assign(iso,{sync:_Rt}),Jrl=vRt,Zrl=Object.assign(sso,{sync:vRt}),Xrl=Object.assign(oso,{stream:_Rt,iterate:vRt}),ERt=Object.assign(nso,{glob:nso,globSync:oso,sync:Xrl,globStream:iso,stream:Krl,globStreamSync:_Rt,streamSync:Yrl,globIterate:sso,iterate:Zrl,globIterateSync:vRt,iterateSync:Jrl,Glob:zN,hasMagic:T7r,escape:Lle,unescape:MP});ERt.glob=ERt;var u6e=class t{constructor(){this.logger=new fe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(wA),s=r.map(d=>un(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(Ks(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 ERt(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 aso.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=Ks(r);try{let o=await e.get(Qo).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 Tem=new fe("exp");function lso(t){let e=t.get(Zt);e.registerStaticFilters(rnl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ft(t,Ye.DebugOverrideEngine)||Ft(t,Ye.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>o7e()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>cso(t)),e.registerDynamicFilter(Soe.CopilotRelatedPluginVersionGithubCopilot,()=>cso(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>enl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>CRt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>tnl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(UI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=E_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Soe).includes(o)){K6e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=CRt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?CRt(n.value):n.value;r[n.filter]=o}return r})}a(lso,"setupExperimentationService");function cso(t){return CRt(!t.get(ds).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(cso,"getEditorPluginVersion");function enl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(enl,"getPluginRelease");function tnl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(tnl,"getTargetPopulation");function rnl(t){return nnl(t)}a(rnl,"createAllFilters");function nnl(t){let e=t.get(Ua);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ds).isProduction()?V1(t):"1.999.0"}}a(nnl,"createDefaultFilters");function CRt(t){return t.split("-")[0]}a(CRt,"trimVersionSuffix");p();var _W=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var iCe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var uso=100,dso=1e3*60*5;function fso(t){let e=new I7r(t);t.get(hm).registerContextProvider(e),t.get(r4).add(e.id)}a(fso,"registerRelatedFilesShim");var I7r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new Pk(uso,dso);this.relatedFilesCache=new Pk(uso,dso);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(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await udt(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){LY(this.ctx,s,"relatedFilesShim")}}};var oao=de(cee()),sao=de(require("path"));p();var d6e=de(ri());var inl=new d6e.ProtocolRequestType("workspace/readFile"),onl=new d6e.ProtocolRequestType("workspace/readDirectory"),snl=new d6e.ProtocolRequestType("workspace/findFiles"),anl=new d6e.ProtocolRequestType("workspace/findTextInFiles"),bRt=class extends la{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(inl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(onl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(snl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(anl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ar).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 At(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Vn(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var SRt=class extends wO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ar);try{return await o.connection.sendRequest(r,n)}catch(s){throw Vn(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var TRt=class t extends dee{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ar)}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),v0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){v0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(bn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return v0.debug(this.context,"`copilot/related` not supported"),cri;try{let c=await this.service.connection.sendRequest(JQt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){v0.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,Et(r,"copilotRelated.hasRelatedCapability",n)}catch(s){v0.exception(r,s,"copilotRelated")}}};p();p();var Eso=de(ri());p();p();function pso(t,e){return(e<<5)-e+t|0}a(pso,"numberHash");function hso(t,e){e=pso(149417,e);for(let r=0,n=t.length;rnew ON(o,ON.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof QU?new fo(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof yi?new fo(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(AIt,"performACPGitHubOAuth");function yIt(t){if(t!=="github_oauth")throw new fo(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(yIt,"validateAuthMethodId");async function EIt(t){let r=await t.get(Lr).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(EIt,"requireACPAuthenticated");p();function Lu(t,e,r,n){Rt(t,e,r,n),At(t,e)}a(Lu,"telemetryAcp");function Y_e(t,e,r,n,o){ai(t,e,r,n,o),ua(t,r,e)}a(Y_e,"telemetryAcpWithError");var qYi=[{id:bl.Ask.id,name:bl.Ask.name,description:bl.Ask.description},{id:bl.Agent.id,name:bl.Agent.name,description:bl.Agent.description}],_It=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(Ir);o instanceof aj&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}Lu(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:wrt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:n})}async newSession(e){Lu(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Mt(),n=Mt(),s=this.ctx.get(Yo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ks(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 Lu(this.ctx,"acp.authenticate"),yIt(e.methodId),await AIt(this.ctx),{}}async requireAuthenticated(){await EIt(this.ctx)}async prompt(e){Lu(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 Fn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Mt(),l=new tp(s,c),u=r.currentModeId===bl.Ask.id?bl.Ask:bl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Yo),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 gIt(this.connection,e.sessionId),g=new gw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(U_);A instanceof ZV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(DN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof ZV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(U_);if(s instanceof ZV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){Lu(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){Lu(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(Ze.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){Lu(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return ox(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?qYi:qYi.filter(e=>e.id===bl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?bl.Agent.id:bl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(xs).getMetadata(),r=[],n=z_;r.push({modelId:z_,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!(ale.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 jYi=require("node:child_process"),CIt=require("node:stream");var vIt=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,jYi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:W9t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{Y_e(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||Lu(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=CIt.Writable.toWeb(this.cliProcess.stdin),c=CIt.Readable.toWeb(this.cliProcess.stdout),l=WRe(s,c);return this._cliConnection=new Mrt(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 bIt=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(Ir);r instanceof aj&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return Lu(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:wrt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return Lu(this.ctx,"acp.cli.authenticate"),yIt(e.methodId),await AIt(this.ctx),{}}async newSession(e){return Lu(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return Lu(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return Lu(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return Lu(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return Lu(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return Lu(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return Lu(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return Lu(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(Ze.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:V1(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]),Lu(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw Y_e(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(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await EIt(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 nRt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(Poo(),koo)),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 Doo(t){let e=new aue;e.set(Bo,t),e.set(Sx,new Sx),e.set(ds,new ds),e.set(G2,new G2);let r=new Qt(e);return e.set(Qt,r),e.set(Zt,new Zt(e)),e.set(oO,new oO(e,r)),e.set(rM,new rM),e.set(Bp,new Bp(e)),e.set(eg,new eg),e.set(bC,new bC),e.set(EO,new cxe),e.set(xP,new fle),e.set(pP,new uSe),e.set(Rd,new Rd),e.set(r4,new r4(e)),e.set(ni,new ni(e)),e.set(J2,new J2(e)),e.set(x8,Odt(e)),e.set(oy,new oy),e.set(Db,new Db),e.set(w8,w8.default),e.set(Cf,new Cf(e)),e.set(Bx,new Bx(e)),e.set(Kp,new Kp),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(Au,new Au(e)),e.set(yO,new yO(e)),e.set(TN,new TN),e.set(FK,new FK(e)),e}a(Doo,"createCommonContext");p();var iRt=class extends Hf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||C1t(r))&&this.console.warn(`[${o}]`,...s)}};p();var Loo=require("node:os");var Mrl=new fe("repository"),doe="\\\\",Boo="(?:[#;].*)",Jve=`(?:[^"${doe}]|${doe}.)`,Orl="[0-9A-Za-z-]",Noo=`[A-Za-z]${Orl}*`,Foo=`\\s*${Boo}?$`,Uoo=`(?:[^"${doe};#]|${doe}.)`,Lrl=`(?:"${Jve}*"|"${Jve}*(?${doe})$)`,Brl=`(?:${Uoo}|${Lrl})+`,Frl=`(?:(?${doe})$)`,Qoo=`(?${Brl})${Frl}?${Foo}`,Moo=new RegExp(`^${Qoo}`),Url=new RegExp(`^(?${Jve}*(?:(?${doe})$|(?")))`),Qrl=new RegExp(`^\\s*(?:(?${Noo})\\s*=\\s*${Qoo}|(?${Noo})${Foo})`),qrl=new RegExp(`(?${Uoo}+)|"(?${Jve}*)"`,"g"),Ooo="[-.0-9A-Za-z]+",jrl=`\\s+"(?${Jve}*)"`,Hrl=`\\s+"(?${Jve}*)"`,Grl=new RegExp(`^\\s*\\[(?:(?${Ooo})${jrl}|${Hrl}|(?${Ooo}))\\]`),$rl=new RegExp(`^\\s*${Boo}$`),h7r=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(Grl);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(Qrl);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(Url),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(Moo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(Moo),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(qrl)].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(){$rl.test(this.line)&&(this.line="")}},oRt=class extends OP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await Cf.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 AK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new h7r(o),c=new AK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(qo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&Mrl.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=Ra(this.xdgConfigUri(),"git","config"),s=Ra(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=ff(r),o=Ra(n,"commondir");try{let s=(await e.get(qo).readFileString(o)).trimEnd();return Ra(YW(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ks(process.env.XDG_CONFIG_HOME):Ra(this.homeUri(),".config")}homeUri(){return Ks((0,Loo.homedir)())}};p();var qoo=require("child_process");var sRt=class extends OP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,qoo.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){X9t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await dO()).path}catch(c){X9t.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 AK;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 joo(t){let e=Doo(t);return Vrl(e),e.set(mp,yot(e)),e.set(fk,rIt(e)),e.set(OP,new Sze([new sRt,new oRt])),e}a(joo,"createProductionContext");function Vrl(t){t.set(HI,HI.fromEnvironment(!1)),t.set(XL,new G_e),t.set(Hf,new iRt(console))}a(Vrl,"setupRudimentaryLogging");var FXh=new fe("context");p();var Aso=require("fs");p();p();var fso=require("node:url");p();p();var Zve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Goo=new Set,m7r=typeof process=="object"&&process?process:{},$oo=a((t,e,r,n)=>{typeof m7r.emitWarning=="function"?m7r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),aRt=globalThis.AbortController,Hoo=globalThis.AbortSignal;if(typeof aRt>"u"){Hoo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},aRt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Hoo;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=m7r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,$oo("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 Wrl=a(t=>!Goo.has(t),"shouldWarn");var _W=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Voo=a(t=>_W(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Xve:null:null,"getUintArray"),Xve=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},g7r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Voo(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]}},r6e=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&&!_W(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Voo(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=g7r.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&&!_W(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!_W(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=_W(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!_W(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 P="LRU_CACHE_UNBOUNDED";Wrl(P)&&(Goo.add(P),$oo("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}#k(){let e=new Xve(this.#e),r=new Xve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Zve.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?Zve.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=Zve.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");#L=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new Xve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!_W(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!_W(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");#B=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-(Zve.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=Zve.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=Zve.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.#B(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.#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.#L(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.#P(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 aRt,{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 aRt}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.#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 rCe=require("node:path"),rso=require("node:url"),JL=require("fs"),nnl=de(require("node:fs"),1),bW=require("node:fs/promises");p();var hRt=require("node:events"),b7r=de(require("node:stream"),1),Joo=require("node:string_decoder");var Woo=typeof process=="object"&&process?process:{stdout:null,stderr:null},zrl=a(t=>!!t&&typeof t=="object"&&(t instanceof CW||t instanceof b7r.default||Yrl(t)||Krl(t)),"isStream"),Yrl=a(t=>!!t&&typeof t=="object"&&t instanceof hRt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==b7r.default.Writable.prototype.pipe,"isReadable"),Krl=a(t=>!!t&&typeof t=="object"&&t instanceof hRt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),X9=Symbol("EOF"),eU=Symbol("maybeEmitEnd"),vW=Symbol("emittedEnd"),cRt=Symbol("emittingEnd"),n6e=Symbol("emittedError"),lRt=Symbol("closed"),zoo=Symbol("read"),uRt=Symbol("flush"),Yoo=Symbol("flushChunk"),YN=Symbol("encoding"),eCe=Symbol("decoder"),cA=Symbol("flowing"),i6e=Symbol("paused"),tCe=Symbol("resume"),lA=Symbol("buffer"),rC=Symbol("pipes"),uA=Symbol("bufferLength"),A7r=Symbol("bufferPush"),dRt=Symbol("bufferShift"),d_=Symbol("objectMode"),xh=Symbol("destroyed"),y7r=Symbol("error"),E7r=Symbol("emitData"),Koo=Symbol("emitEnd"),_7r=Symbol("emitEnd2"),YL=Symbol("async"),v7r=Symbol("abort"),fRt=Symbol("aborted"),o6e=Symbol("signal"),foe=Symbol("dataListeners"),BI=Symbol("discarded"),s6e=a(t=>Promise.resolve().then(t),"defer"),Jrl=a(t=>t(),"nodefer"),Zrl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Xrl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),enl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),pRt=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[tCe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},C7r=class extends pRt{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)}},tnl=a(t=>!!t.objectMode,"isObjectModeOptions"),rnl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),CW=class extends hRt.EventEmitter{static{a(this,"Minipass")}[cA]=!1;[i6e]=!1;[rC]=[];[lA]=[];[d_];[YN];[YL];[eCe];[X9]=!1;[vW]=!1;[cRt]=!1;[lRt]=!1;[n6e]=null;[uA]=0;[xh]=!1;[o6e];[fRt]=!1;[foe]=0;[BI]=!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");tnl(r)?(this[d_]=!0,this[YN]=null):rnl(r)?(this[YN]=r.encoding,this[d_]=!1):(this[d_]=!1,this[YN]=null),this[YL]=!!r.async,this[eCe]=this[YN]?new Joo.StringDecoder(this[YN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[lA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[rC],"get")});let{signal:n}=r;n&&(this[o6e]=n,n.aborted?this[v7r]():n.addEventListener("abort",()=>this[v7r]()))}get bufferLength(){return this[uA]}get encoding(){return this[YN]}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[d_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[YL]}set async(e){this[YL]=this[YL]||!!e}[v7r](){this[fRt]=!0,this.emit("abort",this[o6e]?.reason),this.destroy(this[o6e]?.reason)}get aborted(){return this[fRt]}set aborted(e){}write(e,r,n){if(this[fRt])return!1;if(this[X9])throw new Error("write after end");if(this[xh])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[YL]?s6e:Jrl;if(!this[d_]&&!Buffer.isBuffer(e)){if(enl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Xrl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[d_]?(this[cA]&&this[uA]!==0&&this[uRt](!0),this[cA]?this.emit("data",e):this[A7r](e),this[uA]!==0&&this.emit("readable"),n&&o(n),this[cA]):e.length?(typeof e=="string"&&!(r===this[YN]&&!this[eCe]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[YN]&&(e=this[eCe].write(e)),this[cA]&&this[uA]!==0&&this[uRt](!0),this[cA]?this.emit("data",e):this[A7r](e),this[uA]!==0&&this.emit("readable"),n&&o(n),this[cA]):(this[uA]!==0&&this.emit("readable"),n&&o(n),this[cA])}read(e){if(this[xh])return null;if(this[BI]=!1,this[uA]===0||e===0||e&&e>this[uA])return this[eU](),null;this[d_]&&(e=null),this[lA].length>1&&!this[d_]&&(this[lA]=[this[YN]?this[lA].join(""):Buffer.concat(this[lA],this[uA])]);let r=this[zoo](e||null,this[lA][0]);return this[eU](),r}[zoo](e,r){if(this[d_])this[dRt]();else{let n=r;e===n.length||e===null?this[dRt]():typeof n=="string"?(this[lA][0]=n.slice(e),r=n.slice(0,e),this[uA]-=e):(this[lA][0]=n.subarray(e),r=n.subarray(0,e),this[uA]-=e)}return this.emit("data",r),!this[lA].length&&!this[X9]&&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[X9]=!0,this.writable=!1,(this[cA]||!this[i6e])&&this[eU](),this}[tCe](){this[xh]||(!this[foe]&&!this[rC].length&&(this[BI]=!0),this[i6e]=!1,this[cA]=!0,this.emit("resume"),this[lA].length?this[uRt]():this[X9]?this[eU]():this.emit("drain"))}resume(){return this[tCe]()}pause(){this[cA]=!1,this[i6e]=!0,this[BI]=!1}get destroyed(){return this[xh]}get flowing(){return this[cA]}get paused(){return this[i6e]}[A7r](e){this[d_]?this[uA]+=1:this[uA]+=e.length,this[lA].push(e)}[dRt](){return this[d_]?this[uA]-=1:this[uA]-=this[lA][0].length,this[lA].shift()}[uRt](e=!1){do;while(this[Yoo](this[dRt]())&&this[lA].length);!e&&!this[lA].length&&!this[X9]&&this.emit("drain")}[Yoo](e){return this.emit("data",e),this[cA]}pipe(e,r){if(this[xh])return e;this[BI]=!1;let n=this[vW];return r=r||{},e===Woo.stdout||e===Woo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[rC].push(r.proxyErrors?new C7r(this,e,r):new pRt(this,e,r)),this[YL]?s6e(()=>this[tCe]()):this[tCe]()),e}unpipe(e){let r=this[rC].find(n=>n.dest===e);r&&(this[rC].length===1?(this[cA]&&this[foe]===0&&(this[cA]=!1),this[rC]=[]):this[rC].splice(this[rC].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[BI]=!1,this[foe]++,!this[rC].length&&!this[cA]&&this[tCe]();else if(e==="readable"&&this[uA]!==0)super.emit("readable");else if(Zrl(e)&&this[vW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[n6e]){let o=r;this[YL]?s6e(()=>o.call(this,this[n6e])):o.call(this,this[n6e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[foe]=this.listeners("data").length,this[foe]===0&&!this[BI]&&!this[rC].length&&(this[cA]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[foe]=0,!this[BI]&&!this[rC].length&&(this[cA]=!1)),r}get emittedEnd(){return this[vW]}[eU](){!this[cRt]&&!this[vW]&&!this[xh]&&this[lA].length===0&&this[X9]&&(this[cRt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[lRt]&&this.emit("close"),this[cRt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==xh&&this[xh])return!1;if(e==="data")return!this[d_]&&!n?!1:this[YL]?(s6e(()=>this[E7r](n)),!0):this[E7r](n);if(e==="end")return this[Koo]();if(e==="close"){if(this[lRt]=!0,!this[vW]&&!this[xh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[n6e]=n,super.emit(y7r,n);let s=!this[o6e]||this.listeners("error").length?super.emit("error",n):!1;return this[eU](),s}else if(e==="resume"){let s=super.emit("resume");return this[eU](),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[eU](),o}[E7r](e){for(let n of this[rC])n.dest.write(e)===!1&&this.pause();let r=this[BI]?!1:super.emit("data",e);return this[eU](),r}[Koo](){return this[vW]?!1:(this[vW]=!0,this.readable=!1,this[YL]?(s6e(()=>this[_7r]()),!0):this[_7r]())}[_7r](){if(this[eCe]){let r=this[eCe].end();if(r){for(let n of this[rC])n.dest.write(r);this[BI]||super.emit("data",r)}}for(let r of this[rC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[d_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[d_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[d_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[YN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(xh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[BI]=!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[X9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(xh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(xh,f),this.pause(),s({value:h,done:!!this[X9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(xh,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(xh,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[BI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(y7r,r),this.off(xh,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(y7r,r),this.once(xh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[xh])return e?this.emit("error",e):this.emit(xh),this;this[xh]=!0,this[BI]=!0,this[lA].length=0,this[uA]=0;let r=this;return typeof r.close=="function"&&!this[lRt]&&r.close(),e?this.emit("error",e):this.emit(xh),this}static get isStream(){return zrl}};var inl=JL.realpathSync.native,c6e={lstatSync:JL.lstatSync,readdir:JL.readdir,readdirSync:JL.readdirSync,readlinkSync:JL.readlinkSync,realpathSync:inl,promises:{lstat:bW.lstat,readdir:bW.readdir,readlink:bW.readlink,realpath:bW.realpath}},nso=a(t=>!t||t===c6e||t===nnl?c6e:{...c6e,...t,promises:{...c6e.promises,...t.promises||{}}},"fsFromOption"),iso=/^\\\\\?\\([a-z]:)\\?$/i,onl=a(t=>t.replace(/\//g,"\\").replace(iso,"$1\\"),"uncToDrive"),snl=/[\\\/]/,xk=0,oso=1,sso=2,KL=4,aso=6,cso=8,poe=10,lso=12,Ik=15,a6e=~Ik,S7r=16,Zoo=32,l6e=64,KN=128,mRt=256,ARt=512,Xoo=l6e|KN|ARt,anl=1023,T7r=a(t=>t.isFile()?cso:t.isDirectory()?KL:t.isSymbolicLink()?poe:t.isCharacterDevice()?sso:t.isBlockDevice()?aso:t.isSocket()?lso:t.isFIFO()?oso:xk,"entToType"),eso=new Map,u6e=a(t=>{let e=eso.get(t);if(e)return e;let r=t.normalize("NFKD");return eso.set(t,r),r},"normalize"),tso=new Map,gRt=a(t=>{let e=tso.get(t);if(e)return e;let r=u6e(t.toLowerCase());return tso.set(t,r),r},"normalizeNocase"),yRt=class extends r6e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},I7r=class extends r6e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},uso=Symbol("PathScurry setAsCwd"),f_=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;#k;#R;#d;#L;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=xk,n,o,s,c,l){this.name=e,this.#E=s?gRt(e):u6e(e),this.#d=r&anl,this.nocase=s,this.roots=o,this.root=n||this,this.#L=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=nso(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}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.#L.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#L.set(this,r),this.#d&=~S7r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?gRt(e):u6e(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,xk,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=KN),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&Ik)===xk}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&Ik)===cso}isDirectory(){return(this.#d&Ik)===KL}isCharacterDevice(){return(this.#d&Ik)===sso}isBlockDevice(){return(this.#d&Ik)===aso}isFIFO(){return(this.#d&Ik)===oso}isSocket(){return(this.#d&Ik)===lso}isSymbolicLink(){return(this.#d&poe)===poe}lstatCached(){return this.#d&Zoo?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&Ik;return!(e!==xk&&e!==poe||this.#d&mRt||this.#d&KN)}calledReaddir(){return!!(this.#d&S7r)}isENOENT(){return!!(this.#d&KN)}isNamed(e){return this.nocase?this.#E===gRt(e):this.#E===u6e(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|=S7r;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&Xoo)return!1;let e=Ik&this.#d;return e===xk||e===KL||e===poe}shouldWalk(e,r){return(this.#d&KL)===KL&&!(this.#d&Xoo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((ARt|mRt|KN)&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(!((ARt|mRt|KN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[uso](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}},ERt=class t extends f_{static{a(this,"PathWin32")}sep="\\";splitSep=snl;constructor(e,r=xk,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=xk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return rCe.win32.parse(e).root}getRoot(e){if(e=onl(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 nCe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(iso,"$1\\"),e===r}},_Rt=class t extends f_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=xk,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=xk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},vRt=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=c6e}={}){this.#n=nso(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,rso.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new yRt,this.#t=new yRt,this.#r=new I7r(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(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 f_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new CW({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 f_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new CW({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[uso](r)}},nCe=class extends vRt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,rCe.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return rCe.win32.parse(e).root.toUpperCase()}newRoot(e){return new ERt(this.rootPath,KL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},iCe=class extends vRt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,rCe.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new _Rt(this.rootPath,KL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},d6e=class extends iCe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},ZXh=process.platform==="win32"?ERt:_Rt,dso=process.platform==="win32"?nCe:process.platform==="darwin"?d6e:iCe;p();var cnl=a(t=>t.length>=1,"isPatternList"),lnl=a(t=>t.length>=1,"isGlobList"),oCe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!cnl(e))throw new TypeError("empty pattern list");if(!lnl(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]===Xp}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 unl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",sCe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=unl}){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 q_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},R7r=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())}},f6e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new w7r;subwalks=new R7r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new x7r}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===Xp){(!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===Xp?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 dnl=a((t,e)=>typeof t=="string"?new sCe([t],e):Array.isArray(t)?new sCe(t,e):t,"makeIgnore"),CRt=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=dnl(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 f6e(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 f6e(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()}},p6e=class extends CRt{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}},h6e=class extends CRt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new CW({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 fnl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",JN=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,fso.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||fnl,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"?nCe:r.platform==="darwin"?d6e:r.platform?iCe:dso;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 q_(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 oCe(u,f,0,this.platform)})}async walk(){return[...await new p6e(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 p6e(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 h6e(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 h6e(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 k7r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new q_(r,e).hasMagic())return!0;return!1},"hasMagic");function SRt(t,e={}){return new JN(t,e).streamSync()}a(SRt,"globStreamSync");function hso(t,e={}){return new JN(t,e).stream()}a(hso,"globStream");function mso(t,e={}){return new JN(t,e).walkSync()}a(mso,"globSync");async function pso(t,e={}){return new JN(t,e).walk()}a(pso,"glob_");function TRt(t,e={}){return new JN(t,e).iterateSync()}a(TRt,"globIterateSync");function gso(t,e={}){return new JN(t,e).iterate()}a(gso,"globIterate");var pnl=SRt,hnl=Object.assign(hso,{sync:SRt}),mnl=TRt,gnl=Object.assign(gso,{sync:TRt}),Anl=Object.assign(mso,{stream:SRt,iterate:TRt}),bRt=Object.assign(pso,{glob:pso,globSync:mso,sync:Anl,globStream:hso,stream:hnl,globStreamSync:SRt,streamSync:pnl,globIterate:gso,iterate:gnl,globIterateSync:TRt,iterateSync:mnl,Glob:JN,hasMagic:k7r,escape:Ble,unescape:LP});bRt.glob=bRt;var m6e=class t{constructor(){this.logger=new fe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(RA),s=r.map(d=>un(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(Ks(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 bRt(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 Aso.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=Ks(r);try{let o=await e.get(qo).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 stm=new fe("exp");function Eso(t){let e=t.get(Zt);e.registerStaticFilters(_nl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ft(t,Ye.DebugOverrideEngine)||Ft(t,Ye.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>u7e()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>yso(t)),e.registerDynamicFilter(Toe.CopilotRelatedPluginVersionGithubCopilot,()=>yso(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>ynl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>IRt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>Enl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(qI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=__+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Toe).includes(o)){t9e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=IRt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?IRt(n.value):n.value;r[n.filter]=o}return r})}a(Eso,"setupExperimentationService");function yso(t){return IRt(!t.get(ds).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(yso,"getEditorPluginVersion");function ynl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(ynl,"getPluginRelease");function Enl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(Enl,"getTargetPopulation");function _nl(t){return vnl(t)}a(_nl,"createAllFilters");function vnl(t){let e=t.get(Qa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ds).isProduction()?V1(t):"1.999.0"}}a(vnl,"createDefaultFilters");function IRt(t){return t.split("-")[0]}a(IRt,"trimVersionSuffix");p();var SW=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var aCe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var _so=100,vso=1e3*60*5;function Cso(t){let e=new P7r(t);t.get(gm).registerContextProvider(e),t.get(n4).add(e.id)}a(Cso,"registerRelatedFilesShim");var P7r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new Nk(_so,vso);this.relatedFilesCache=new Nk(_so,vso);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(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await hdt(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){QY(this.ctx,s,"relatedFilesShim")}}};var mao=de(lee()),gao=de(require("path"));p();var g6e=de(ei());var Cnl=new g6e.ProtocolRequestType("workspace/readFile"),bnl=new g6e.ProtocolRequestType("workspace/readDirectory"),Snl=new g6e.ProtocolRequestType("workspace/findFiles"),Tnl=new g6e.ProtocolRequestType("workspace/findTextInFiles"),xRt=class extends da{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(Cnl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(bnl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(Snl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(Tnl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ar).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 Rt(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw ai(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var wRt=class extends kO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ar);try{return await o.connection.sendRequest(r,n)}catch(s){throw ai(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var RRt=class t extends fee{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ar)}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),C0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){C0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(bn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return C0.debug(this.context,"`copilot/related` not supported"),gri;try{let c=await this.service.connection.sendRequest(tqt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){C0.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,At(r,"copilotRelated.hasRelatedCapability",n)}catch(s){C0.exception(r,s,"copilotRelated")}}};p();p();var Rso=de(ei());p();p();function bso(t,e){return(e<<5)-e+t|0}a(bso,"numberHash");function Sso(t,e){e=bso(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=kwn(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(bn).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,oCe.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){oCe.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,yso.setTimeout)(unl).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 gso.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${dnl}; - ${fnl}; - ${pnl}; - ${hnl}; - ${mnl}; - `);let n=this.all(r,Anl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):oCe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){oCe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Yn).directory;await mso.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Aso.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||lnl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=cnl;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=>{oCe.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){oCe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,gnl,[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 tC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},IRt=class extends tC{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"&&Uct(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(uA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(uA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(uA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(uA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(uA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(uA).delete(n)}};var f_=new fe("DynamicAuthenticationProvider"),xRt=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 x7r(e,l,{set:a(u=>{this.ctx.get(tC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(f_.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=>Lwe([...c.scopes].sort(),n));if(f_.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(f_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){f_.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&&(f_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),f_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){f_.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=>Lwe([...d.scopes].sort(),n))),f_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new R_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(f_.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 f_.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){f_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return f_.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]}),f_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(f_.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(tr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Uct(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},x7r=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}){f_.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)),f_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=ddr(e.id_token)}catch{}if(!r)try{r=ddr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:hso(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 LI=new fe("DynamicAuthProviderService"),YN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Eso.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 xRt(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){LI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Xu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${w_e}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ar).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)? +`,Onl="SELECT key, value FROM state",cCe=new fe("state-database"),dA=class{constructor(e){this.cache=new Map;this.changeEmitter=new Wi;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(bn).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=Own(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(bn).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,cCe.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){cCe.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,wso.setTimeout)(wnl).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 Iso.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` + ${Rnl}; + ${knl}; + ${Pnl}; + ${Dnl}; + ${Nnl}; + `);let n=this.all(r,Onl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):cCe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){cCe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(ti).directory;await Tso.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return xso.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||xnl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=Inl;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=>{cCe.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){cCe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,Mnl,[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 nC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},kRt=class extends nC{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"&&$ct(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(dA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(dA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(dA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(dA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(dA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(dA).delete(n)}};var p_=new fe("DynamicAuthenticationProvider"),PRt=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 D7r(e,l,{set:a(u=>{this.ctx.get(nC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(p_.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=>Uwe([...c.scopes].sort(),n));if(p_.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(p_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){p_.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&&(p_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),p_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){p_.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=>Uwe([...d.scopes].sort(),n))),p_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new P_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(p_.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 p_.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){p_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return p_.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]}),p_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(p_.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(nr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if($ct(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},D7r=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}){p_.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)),p_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=mdr(e.id_token)}catch{}if(!r)try{r=mdr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:Sso(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 FI=new fe("DynamicAuthProviderService"),ZN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Rso.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 PRt(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){FI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${ed(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${k_e}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ar).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){LI.error(this.ctx,`Failed to get client ID and secret from user: ${Xu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,LI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?LI.info(this.ctx,`User provided client secret for ${e.toString()}`):LI.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(tr).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=>p3r.includes(s)):p3r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${w_e}/callback`,`http://127.0.0.1:${w_e}/callback`],scope:r?.join(GYn),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(KYn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(dm).registerAuthenticationProvider(e.id,e),this.ctx.get(tC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(dm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);LI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);LI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw LI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(dm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});LI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);LI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw LI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(dm),n=this.ctx.get(tC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),LI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw LI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var wRt=class extends dm{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===DN.providerId){let s=new DN(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(tC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(tC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(YN).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 vso=de(Xc());var _so=new fe("agentCopilotTokenManager"),ynl={type:new vso.ProtocolRequestType("copilot/token")},RRt=class extends Rh{constructor(){super(...arguments);this.networkFetcher=new u7e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(bn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ar).connection;try{let c=await s.sendRequest(ynl.type,{force:!1,session:n});if(!c?.envelope)throw new yi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(_so.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(bn),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(bn),o=this.ctx.get(Zt),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(Ir).getEditorPluginInfo().name==="copilot-intellij"}};p();var Enl=new fe("Public Code References"),kRt=class extends jT{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," ");Enl.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(bn).getCapabilities().ipCodeCitation===!0&&await e.get(ar).connection.sendNotification(HQt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var w7r=de(Xc());var _nl=new w7r.ProtocolNotificationType("$/copilot/compressionStarted"),vnl=new w7r.ProtocolNotificationType("$/copilot/compressionCompleted"),PRt=class extends bI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ar).connection.sendNotification(_nl,r)}async notifyCompressionCompleted(r){await this.ctx.get(ar).connection.sendNotification(vnl,r)}};p();p();function Cso(t){Cnl(t)}a(Cso,"activateExtensibilityPlatformFeature");function Cnl(t){t.set(WP,new bJe(t)),t.set(NO,new NO(t))}a(Cnl,"registerContextDependencies");p();var bso=S.String(),R7r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(NRt,"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){FI.error(this.ctx,`Failed to get client ID and secret from user: ${ed(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,FI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?FI.info(this.ctx,`User provided client secret for ${e.toString()}`):FI.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(nr).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=>y3r.includes(s)):y3r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${k_e}/callback`,`http://127.0.0.1:${k_e}/callback`],scope:r?.join(YYn),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(tKn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(pm).registerAuthenticationProvider(e.id,e),this.ctx.get(nC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(pm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);FI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);FI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw FI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(pm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});FI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);FI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw FI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(pm),n=this.ctx.get(nC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),FI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw FI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var DRt=class extends pm{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===ON.providerId){let s=new ON(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(nC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(nC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(ZN).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 Pso=de(Xc());var kso=new fe("agentCopilotTokenManager"),Lnl={type:new Pso.ProtocolRequestType("copilot/token")},NRt=class extends Ph{constructor(){super(...arguments);this.networkFetcher=new m7e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(bn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ar).connection;try{let c=await s.sendRequest(Lnl.type,{force:!1,session:n});if(!c?.envelope)throw new yi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(kso.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(bn),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(bn),o=this.ctx.get(Zt),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(Ir).getEditorPluginInfo().name==="copilot-intellij"}};p();var Bnl=new fe("Public Code References"),MRt=class extends GT{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," ");Bnl.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(bn).getCapabilities().ipCodeCitation===!0&&await e.get(ar).connection.sendNotification(WQt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var N7r=de(Xc());var Fnl=new N7r.ProtocolNotificationType("$/copilot/compressionStarted"),Unl=new N7r.ProtocolNotificationType("$/copilot/compressionCompleted"),ORt=class extends TI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ar).connection.sendNotification(Fnl,r)}async notifyCompressionCompleted(r){await this.ctx.get(ar).connection.sendNotification(Unl,r)}};p();p();function Dso(t){Qnl(t)}a(Dso,"activateExtensibilityPlatformFeature");function Qnl(t){t.set(YP,new RJe(t)),t.set(OO,new OO(t))}a(Qnl,"registerContextDependencies");p();var Nso=S.String(),M7r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(BRt,"build logs"),`The contents of the application build logs: \`\`\` ${e} -\`\`\``}},NRt="build-logs",DRt=class extends gg{static{a(this,"BuildLogsSkill")}constructor(e){super(NRt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new R7r(r))}};p();var k7r=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 LXe(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")}},P7r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},bnl="directory-references",MRt=class{constructor(){this.id=bnl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new P7r}processor(e){return new k7r(e)}};p();var Snl=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Sso=S.Object({files:S.Array(Snl)}),Tnl=3,D7r=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=Cq(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(ii),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=td(c);if(await this.turnContext.collectFile(LRt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Tnl))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(ii).getRelativePath(n),c=new IO(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 xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},LRt="recent-files",ORt=class extends gg{static{a(this,"RecentFilesSkill")}constructor(e){super(LRt,"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 D7r(r))}};p();var Tso=S.String(),N7r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(FRt,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},BRt="build-logs",LRt=class extends Ag{static{a(this,"BuildLogsSkill")}constructor(e){super(BRt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new M7r(r))}};p();var O7r=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 jXe(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")}},L7r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},qnl="directory-references",FRt=class{constructor(){this.id=qnl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new L7r}processor(e){return new O7r(e)}};p();var jnl=S.Object({uri:S.String(),visibleRange:S.Optional(If),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Mso=S.Object({files:S.Array(jnl)}),Hnl=3,B7r=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=Tq(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(ni),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=rd(c);if(await this.turnContext.collectFile(QRt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Hnl))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(ni).getRelativePath(n),c=new wO(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 wo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},QRt="recent-files",URt=class extends Ag{static{a(this,"RecentFilesSkill")}constructor(e){super(QRt,"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 B7r(r))}};p();var Oso=S.String(),F7r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(jRt,"runtime logs"),`The contents of the application runtime logs: \`\`\` ${e} -\`\`\``}},FRt="runtime-logs",BRt=class extends gg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(FRt,"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 N7r(r))}};p();var URt=de(PP());var QRt=class extends zh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return Q9e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ar).connection}async inspectPrompt(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/documentDiff"),r)}};p();var Iso=de(Xc());var p6e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(ck).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ar).connection.sendNotification(new Iso.NotificationType(this.notificationEndpoint),e)}};function xso(t){Inl(t),xnl(t),Cso(t)}a(xso,"activateConversationFeature");function Inl(t){t.set(zo,new zo(t)),t.set(Ag,new Ag),t.set(kA,new kA(t)),t.set(el,new nYe(t)),t.set(F9,new F9),t.set(Tc,new Tc(t)),t.set(ck,new ck(t)),t.set(p6e,new p6e(t)),t.set(xs,new I$e(t,new T$e(t))),t.set(RN,new RN),t.set(zh,new QRt(t)),t.set(t2,new t2(t))}a(Inl,"registerContextDependencies");function xnl(t){let e=new Yh;e.registerSkill(new uXe(new lXe)),e.registerSkill(new UKe(new zv(t,xO,Bvn))),e.registerSkill(new xKe(new zv(t,GP,Dvn))),e.registerSkill(new IKe(new zv(t,lE,Pvn))),e.registerSkill(new QKe),e.registerSkill(new MRt),e.registerSkill(new ORt(new zv(t,LRt,Sso))),e.registerSkill(new hJe(new zv(t,MO,$Cn))),e.registerSkill(new hXe(new zv(t,Qq,kxn))),e.registerSkill(new BRt(new zv(t,FRt,Tso))),e.registerSkill(new DRt(new zv(t,NRt,bso))),e.registerSkill(new gXe(new zv(t,r2,Pxn))),e.registerSkill(new AXe(new zv(t,cJ,Dxn))),t.set(Yh,e)}a(xnl,"registerSkills");p();var wso=de(Xc()),Rso=de(PP());var qRt=class extends qd{constructor(){super(...arguments);this.requestType=new wso.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=qu.Compile(QAn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Rso.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 QA(this.typeCheck.Errors(s));return s}};p();var kso=de(Xc()),Pso=de(PP());var jRt=class extends F_{constructor(){super(...arguments);this.requestType=new kso.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=qu.Compile(UAn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Pso.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 QA(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 _K(o.value));return new Lr(n,r.status??"success")}};p();p();function Dso(t,e,r){try{let n=t.get(Zt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Dso,"fillInJavaActiveExperiments");var M7r=de(PP());var wnl={type:new M7r.NotificationType("featureFlagsNotification")},Rnl={type:new M7r.NotificationType("copilot/didChangeFeatureFlags")},h6e=class{constructor(e){this.ctx=e;bs(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=!1,d=r.get(Zt),f=await d.updateExPValuesAndAssignments(e);n=d.ideDataMigrationCompleted(f),o=d.appmodContextMenuEnabled(f),s=d.appmodProblemsViewEnabled(f),c=d.cliAsDefaultAgentProviderEnabled(f),l=kdn(r,f),u=d.inlineChatUseCliEnabled(f);let h={};r.get(Zt).excludeRelatedFiles(f)&&(h.ExcludeRelatedFiles=!0);let m=Qfr(r,f);m.length>0&&(h.ExpContextProviders=m);let g=new Map;NXn(r,m,g,f),qlt(r,g,f),Dso(r,g,f);for(let[E,_]of g.entries())h[E]=_;let A=r.get(bn),y=r.get(ar).connection;if(A.getCapabilities().didChangeFeatureFlags)await y.sendNotification(Rnl.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in: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:h,byok:XQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan});else{let E={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:h,byok:XQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u};e.getTokenValue("agent_mode")==="0"&&(E.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(E.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(E.mcp=!1),e.envelope.chat_enabled&&(E.xc=!0),e.userInfo.cliEnabled!==void 0&&(E.user_info__cli_enabled=e.userInfo.cliEnabled),await y.sendNotification(wnl.type,E)}}};p();var HRt=class extends ps{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(ar).connection.sendNotification(XQt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ar).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ar).connection.sendNotification(eqt.type,r)}};p();var Nso=new fe("AgentEncodingConfigurationService"),GRt=class extends SO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ar)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Nso.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){Nso.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Mso=new SQ;p();var Bso=de(ri());var Fso={"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"}},knl=new Bso.NotificationType("policy/didChange"),Pnl=Object.fromEntries(Object.entries(Fso).map(([t,e])=>[t,{type:e.type}])),m6e=class extends jl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Fso).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ar);o.onActivation(()=>{this.startWatching().catch(s=>{Nr.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(()=>de(Lso()));this.policyWatcher=r("IDEGitHubCopilot",Pnl,n=>{this.handlePolicyUpdate(n).catch(o=>{Nr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Nr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Nr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Nr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Nr.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),Nr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(bn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(bn).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(knl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Nr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Nr.debug(this.ctx,"Policy watcher stopped")}}};p();var $Rt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(ar).connection.sendNotification(nVi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ar).connection.sendNotification(iVi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(YN).unregisterProvider(e)}};p();var VRt=class extends wb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(uA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Uso=de(ri());var WRt="mcp.elicitation",zRt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Uso.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Un(ei.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 Un(ei.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;sr.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await lc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(wO).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 Et(e.ctx,WRt,Wt.createAndMarkAsIssued()),At(e.ctx,WRt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw sr.error(e.ctx,l,c),await _0(e.ctx,{message:l,server:r}),qa(e.ctx,c,WRt),Vn(e.ctx,WRt,c),new Un(ei.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var Ik=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var g6e=class extends Ik{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":sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),kX(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":sr.error(this.ctx,`MCP server ${this.serverName} log:`,r),_0(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var A6e=class extends Ik{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Prompts list changed, refreshing prompts..."),lc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(cTt)}};p();var y6e=class extends Ik{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Resource list changed, refreshing resources..."),lc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(aTt)}};p();var E6e=class extends Ik{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),lc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(t$i)}};p();var YRt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},_6e=class extends YRt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){sr.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),lc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){sr.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),_0(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 v6e=class extends Ik{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Tool list changed, refreshing tools..."),lc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(sTt)}};p();var Qso="mcp.sampling",KRt=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 Un(ei.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,sr.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await lc(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(_W).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(qd).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 Oc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await axe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new Fn.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 At(e.ctx,Qso,{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 sr.error(e.ctx,u,l),await _0(e.ctx,{message:u,server:o}),At(e.ctx,Qso,{success:"false",errorMessage:u}),new Un(ei.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){sr.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 sr.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",sr.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?hO(e,u.provider,l):await e.get(el).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(xs).getMetadata()).filter(n=>n.capabilities.type&&!sle.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 da(e.get(Yn)).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 sCe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function qso(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Fct(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(qso,"parseScopeChallenge");p();var L7r=/[^a-z0-9_-]/gi;var Dnl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jso(){let t={};for(let e of Dnl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jso,"getDefaultEnvironment");async function Hso(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e.description=""}if(L7r.lastIndex=0,L7r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(L7r,"_")}else e._nameForModel=e.name;return e}a(Hso,"normalizeTool");var JRt=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*B7r(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(B7r,"paginateRequest");async function F7r(t){let e=[];for await(let r of t)e.push(...r);return e}a(F7r,"flattenAsyncIterable");var Gso=de(require("events"));var U7r=6e4,vW=class{constructor(e,r,n){this.transport=null;this.emitter=new Gso.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(bn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new KRt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new zRt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new _H({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 sr.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw sr.error(this.ctx,"Connection failed:",r),await _0(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(FV)}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 Hso(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof sCe){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(sr.info(this.ctx,l),await _0(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===ei.MethodNotFound){if(sr.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(sr.error(this.ctx,c),await _0(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=B7r(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 F7r(this.getResourcesIterable(e));return lc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=B7r(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 F7r(this.getResourceTemplatesIterable(e));return lc(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=RJ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Lr([],"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}},uH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),lc(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 sr.error(this.ctx,m),await _0(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,h),await _0(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=()=>{sr.info(this.ctx,`MCP server ${this.name} connection closed.`),lc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),_0(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(fX,e=>new g6e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(a8,e=>new v6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(s8,e=>new A6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(o8,e=>new y6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Fcr,e=>new E6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Kcr,e=>(this.initRootsTracker(),new _6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(B2e,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Un(ei.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw sr.error(this.ctx,o),new Un(ei.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new oc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(F2e,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw sr.error(this.ctx,n),new Un(ei.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(sTt,()=>{this.refreshToolsCache()}),this.emitter.on(aTt,()=>{this.refreshResourcesCache()}),this.emitter.on(cTt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(U7r),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)))),sr.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(FV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(U7r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,sr.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(FV)}catch(r){sr.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(U7r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,sr.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(FV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Lr([],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 KQ({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 KQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Rr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get($r);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 Nnl(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=qso(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new sCe(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(Nnl,"createFetchAdapter");function ZRt(t,e){let r=t.get(tr),n=Nnl(r);return{...e,fetch:n}}a(ZRt,"createConfigWithFetch");var XRt=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=ZRt(this.ctx,r),{url:o,...s}=n;return new vhe(new URL(o),s)}};p();var $so=require("child_process"),Vso=require("util");var ekt=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...jso(),...r.env||{}},r.stderr="pipe",new xhe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{kX(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,Vso.promisify)($so.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),lc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),sr.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){sr.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),_0(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var C6e=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=ZRt(this.ctx,r),{url:o,...s}=n;return new Che(new URL(o),s)}};p();var tkt=class extends YQ{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 Oc;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(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var Kso=de(Xc());p();var Wso="mcp-servers-cache",zso="mcp-first-boot-completed",rkt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(uA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(zso)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(zso,"true")}parseCache(){let e=this.stateDb.get(Wso);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(Wso,e)}};p();function Yso(t){let e=t.get(Ir).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(Yso,"isNightlyOrDevBuild");var nkt=class t extends o_{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new Vx;this.prefixGenerator=new JRt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new rkt(r),this.registryService=r.get(PN),bs(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(sr.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(sr.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(bn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(sr.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new Kso.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return sr.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(bn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Yso(this.ctx);return n||sr.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:(sr.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(bn).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),sr.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),sr.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),sr.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)}`);sr.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){sr.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}ZIe(r)&&(d._status=c),this.ctx.get(gs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(gs).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 Et(this.ctx,"mcp.getPrompt",Wt.createAndMarkAsIssued()),At(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){sr.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await lc(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){sr.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await lc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(FV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await lc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await lc(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 lc(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){sr.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await lc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),sr.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(YN).unregisterProvider(o)}catch{sr.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;sr.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(wb).removeAccountPreference(r,c);try{let u=this.ctx.get(dm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),sr.info(this.ctx,`Successfully removed session for account ${l}`)):sr.warn(this.ctx,`No session found for account ${l}`)}catch(u){sr.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 sr.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),sr.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){sr.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(FV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await lc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Jw||c instanceof PDe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof C6e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;sr.info(this.ctx,f),lc(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 sr.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 _0(this.ctx,{message:d,server:r}),this.ctx.get(ts).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=>{sr.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){sr.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new XRt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new C6e(this.ctx,r.name,r.version||"1.0.0"):new ekt(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(ar).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){sr.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(gs).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 tkt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(sr.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){sr.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(gs).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){sr.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){sr.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;sr.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(wb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new She(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw sr.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(dm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(dm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(dm).createDynamicAuthenticationProvider(o,s,c),!A)){sr.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(dm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(wb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(dm).getProvider(l),g=!!this.ctx.get(tC).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(ts).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){sr.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){sr.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(wb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){sr.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ts).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){sr.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){sr.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ts).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(wb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){sr.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ts).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 Jso=de(Xc());var ikt=class t extends F2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Jso.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ar).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var Zso=de(Xc());var Mnl=new Zso.ProtocolRequestType("copilot/readMcpSamplingConfig"),okt=class extends _W{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Mnl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Xu(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 akt=de(Xc());var Onl=new akt.ProtocolRequestType("copilot/showPanelMessageRequest"),Lnl=new akt.ProtocolNotificationType("copilot/showPanelMessage"),skt=class extends iCe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ar).connection.sendNotification(Lnl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Onl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Xu(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 eao=require("node:stream"),poe=de($ar());var X9=new fe("UndiciFetcher"),lkt=class extends tr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`,this.certificateConfigurator=new F_e(r),this.proxySocketFactory=r.get(uk),this.settings=r.get(Lo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),X9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Lo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),X9.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=Unl(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};X9.debug(this.ctx,"Starting Undici fetch.",{target:ckt(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,poe.fetch)(r,{...h,dispatcher:m});return X9.debug(this.ctx,"Undici fetch completed.",{target:ckt(r),status:A.status,isProxy:g}),new ex(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?eao.Readable.fromWeb(A.body):null)}catch(h){throw l?(X9.warn(this.ctx,"Undici fetch timed out.",{target:ckt(r),timeout:n.timeout}),new jW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Qnl(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&&(X9.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||(X9.debug(this.ctx,"Creating direct Undici agent.",{target:ckt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new poe.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,poe.buildConnector)(r);return X9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:Xso(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new poe.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)&&X9.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}=Bnl(s),u=Fnl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:Xso(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 Bnl(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(Bnl,"splitHostPort");function Fnl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Fnl,"compileHostPattern");function ckt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(ckt,"describeUrl");function Xso(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Xso,"describeProxy");function Unl(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(Unl,"toNativeAbortSignal");function Qnl(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(Qnl,"withCauseNetworkProperties");p();var b6e=new fe("fetcher"),qnl="https://default.exp-tas.com/",S6e=class extends tr{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(Gm(o)||`${r}/`.startsWith(qnl))throw o;b6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),b6e.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()}},ukt=class extends tr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new S6e(r,n,o,(s,c)=>{this.current!==o&&(b6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Vn(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Hnl(c),...Gnl(s),...$nl(r)}),n.disconnectAll().catch(l=>{b6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(b6e.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()])}},jnl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Hnl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return jnl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Hnl,"describeHost");function Gnl(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(Gnl,"buildErrorCauseProperties");function $nl(t){try{let e=t.get(Lo).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($nl,"describeHttpContext");var tao=new fe("fetcher");function Vnl(t){return Ft(t,Ye.UseHelixFetcher)==="true"}a(Vnl,"isHelixFetcherForced");function Wnl(t){if(Vnl(t))return new Bie(t);let e=new ukt(t,new lkt(t),new Bie(t));return t.get(Lo).onDidChangeHttpSettings(()=>e.reset()),e}a(Wnl,"createDefaultFetcher");var dkt=class extends tr{constructor(r,n=Wnl(r),o=new L_e(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=Ft(this.ctx,Ye.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&&(tao.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new S6e(r,n,o,()=>{tao.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(bn).onDidSetCapabilities(this.updateFetcher),r.get(Lo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ft(this.ctx,Ye.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(bn).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 pkt=de(ri());var fkt=class extends ts{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ar).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(pkt.ShowMessageRequest.type,{type:pkt.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 rao=de(Xc());var hkt=class t extends bK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new rao.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var nao=de(Xc());var mkt=class t extends tq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new nao.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var iao=de(Xc());var znl=new iao.ProtocolNotificationType("$/copilot/rateLimitWarning"),gkt=class extends qS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ar).connection.sendNotification(znl,r)}};p();p();var Akt=class extends xze{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(bN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(bN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(bN);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 ykt=class extends zx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new Akt(this.ctx,e)}shouldStartWatching(e){return IP(this.ctx)?!1:!!this.ctx.get(bn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Ekt(t){let e=new rb(process.env),r=Doo(e);r.set(rb,e),r.set(tr,new dkt(r)),r.set(oc,new oc(r)),a3r(r,{});let n=mtn();r.set(Yn,n),r.set(uA,new uA(r));let o=new RRt;r.set(Rh,o);let s=sao.join(n.directory,mQr),c=v3.plaintextOnly();r.set(v3,c);let{repo:l,diagnostics:u}=Xdn(r,s,c);r.set(nx,l),r.set(Ur,new mje(r,process.env)),r.set(HT,new HT(r)),r.set(Pie,new Pie(r));let d=new pf(r,"agent");d.onInitialized(()=>tfn(r,u)),r.set(pf,d),r.set(Ua,TYi),r.set(UI,new UI),r.set(Ir,new ij),r.set(Fie,hYi()),r.set(Ru,new Ru),r.set(Qo,Mso),r.set(la,new bRt(r)),r.set(dee,new TRt(r)),r.set(zx,new ykt(r)),r.set(bN,new bN(r)),r.set(pm,new pm),r.set(hm,Glt(r,D$i)),r.set(Nb,new Nb(r)),r.set(r4,new nme),fso(r),wze(r),rfn(r),r.set(ar,new ar(r,t)),r.set(wO,new SRt(r)),r.set(ts,new fkt(r)),efn(r,u),r.set(iCe,new skt(r)),r.set(_W,new okt(r)),r.set(Vm,new x_e(r)),r.set(ps,new HRt(r));let f=new m6e(r,t);r.set(m6e,f),r.set(jl,f),r.set(h6e,new h6e(r)),r.set(f6e,new f6e(r)),r.set(tp,new tp);let h=new WV(r);r.set($r,h),r.set(WV,h),r.set($m,new q_e(r,process.env)),r.set(kk,new boe),r.set(nc,new nc(r)),xso(r),lso(r),r.set(wN,new wN),r.set(QV,new QV),r.set(kN,new kN),r.set(qV,new qV([])),r.set(jT,new kRt),r.set(oao.ObservableWorkspace,new bV(r,!0,!0)),r.set(m4,new H_e),r.set(h9,new h9),r.set(Vv,new Vv(r)),r.set(ry,new A1t(r)),r.set(F_,new jRt(r)),r.set(qd,new qRt(r)),r.set(mw,new mw(r)),r.set(gs,new gs(r)),r.set(gF,new gF(r)),r.set(yF,new yF(r)),r.set(tT,new tT(r)),r.set(yJ,new yJ(r)),r.set(XO,new XO),r.set(m0,new m0),r.set(PN,new PN(r)),r.set(o_,new nkt(r)),r.set(F2,new ikt(r)),r.set(dF,new dF(r)),r.set(wb,new VRt(r));let m=new TH(r);r.set(TH,m);let g=new ey(r,m,new $Rt(r));r.set(ey,g),r.set(PT,new PT(r,m,g)),r.set(iie,GQi(r)),r.set(qS,new gkt(r)),r.set(HX,new HX),r.set(Rie,new Rie),r.set(dm,new wRt(r)),r.set(tC,new IRt(r)),r.set(YN,new YN(r));let A=new wA(r);r.set(wA,A),r.set(bf,new bf(r,A)),r.set(Cg,new Cg(r,A)),r.set(Ld,new Ld(r,A)),r.set(h0,new h0(r,e,A));let y=new w3(r,A,n);r.set(w3,y),r.get(US).addListener(y.lifecycleListener);let E=new u6e;r.set(u6e,E),r.set(a0,new lIt(r)),r.set(ug,new ug(r,E)),r.set(Aw,new Aw),r.set(nT,new nT(r)),r.set(Zq,new Zq(r)),r.set(nw,new kO([new PO,new DO])),r.set(wie,new wie(r)),r.set(j_,new j_(r)),r.set(tq,new mkt(r)),r.set(bK,new hkt(r)),r.set(pv,new pv(r)),r.set(Hs,new Hs(r)),r.set(fm,new fm),r.set(WX,new WX(r)),r.set(y8,new y8(r,new Xwt)),r.set(cie,new cie(r)),r.set(aie,new aie(r)),r.set(fc,new fc(r)),r.set(SO,new GRt(r)),r.set(xN,new xN(r)),r.set(sk,new sk(r.get(xN),r)),r.set(HO,new HO(r)),r.set(bI,new PRt(r)),r.set(ZC,new ZC(r.get(sk),r.get(bI),r)),r.set(mE,new mE(r));let _=new uc(r);r.set(uc,_);let v=new g8(r,_);return r.set(g8,v),r.set(Uie,new Uie(r,_)),r.get(ar).onActivation(()=>{v.ensureInitialSync()}),r}a(Ekt,"createLanguageServerContext");var KN=new fe("ACP");async function aao(t){let e=t.get(ds);KN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(rb).markReady(),t.get(zp).githubAppId=Kae,Jnl(t),Knl(t),t.get(bn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?KN.info(t,"Token primed successfully"):KN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(pf).initialize(!0),T0n()?await Ynl(t):(At(t,"acp.server.start",{acpPipeline:"internal"}),await cao(t))}a(aao,"startACPServer");async function cao(t){KN.info(t,"Starting ACP server with internal pipeline");let e=aCe.Writable.toWeb(process.stdout),r=aCe.Readable.toWeb(process.stdin),n=GRe(e,r),o=new $Re(s=>new gIt(s,t),n);o.signal.addEventListener("abort",()=>{KN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(cao,"startACPServerInternal");async function Ynl(t){KN.info(t,"Starting ACP server with CLI proxy"),At(t,"acp.cli.discover");let e;try{e=await I0n()}catch(u){let d=u instanceof Error?u.message:String(u);KN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),Vn(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await cao(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;KN.info(t,`Found Copilot CLI: ${r} v${e.version}`),At(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new AIt(e,t),o=aCe.Writable.toWeb(process.stdout),s=aCe.Readable.toWeb(process.stdin),c=GRe(o,s),l=new $Re(u=>new EIt(u,t,n),c);l.signal.addEventListener("abort",()=>{KN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(Ynl,"startACPServerWithCLI");function Knl(t){let e=t.get(gs);e.registerTool(new Xq({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 Xq({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 Xq({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."})})})),KN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(Knl,"registerACPClientTools");function lao(){let e=Ekt({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 zV(e);return e.forceSet(F_,r),{ctx:e,acpToolInvoker:r}}a(lao,"createACPContext");function Jnl(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(KN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),l7e(t,r))}a(Jnl,"configureGitHubEnterpriseUrl");p();var Q7r=require("events"),T6e=de(require("fs"));p$e();var vkt=de(Xc());p();var dao=de(require("fs")),fao=de(require("http")),cCe=de(require("path"));var _kt=class{constructor(e,r){this.port=e;let n;this.server=fao.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=>{uao(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{uao(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;cCe.basename(__dirname)!=="debug"&&(c=cCe.dirname(__dirname)),n??=dao.readFileSync(cCe.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 uao(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},jRt="runtime-logs",qRt=class extends Ag{static{a(this,"RuntimeLogsSkill")}constructor(e){super(jRt,"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 F7r(r))}};p();var HRt=de(NP());var GRt=class extends Kh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return $9e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ar).connection}async inspectPrompt(r){return this.connection?.sendNotification(new HRt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new HRt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new HRt.NotificationType("conversation/documentDiff"),r)}};p();var Lso=de(Xc());var y6e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(uk).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ar).connection.sendNotification(new Lso.NotificationType(this.notificationEndpoint),e)}};function Bso(t){Gnl(t),$nl(t),Dso(t)}a(Bso,"activateConversationFeature");function Gnl(t){t.set(Yo,new Yo(t)),t.set(yg,new yg),t.set(PA,new PA(t)),t.set(el,new lYe(t)),t.set(Q9,new Q9),t.set(Tc,new Tc(t)),t.set(uk,new uk(t)),t.set(y6e,new y6e(t)),t.set(xs,new P$e(t,new k$e(t))),t.set(DN,new DN),t.set(Kh,new GRt(t)),t.set(n2,new n2(t))}a(Gnl,"registerContextDependencies");function $nl(t){let e=new Jh;e.registerSkill(new gXe(new mXe)),e.registerSkill(new $Ke(new Kv(t,RO,jvn))),e.registerSkill(new NKe(new Kv(t,VP,Bvn))),e.registerSkill(new DKe(new Kv(t,uE,Lvn))),e.registerSkill(new VKe),e.registerSkill(new FRt),e.registerSkill(new URt(new Kv(t,QRt,Mso))),e.registerSkill(new _Je(new Kv(t,LO,KCn))),e.registerSkill(new _Xe(new Kv(t,Hq,Oxn))),e.registerSkill(new qRt(new Kv(t,jRt,Oso))),e.registerSkill(new LRt(new Kv(t,BRt,Nso))),e.registerSkill(new CXe(new Kv(t,i2,Lxn))),e.registerSkill(new bXe(new Kv(t,uJ,Bxn))),t.set(Jh,e)}a($nl,"registerSkills");p();var Fso=de(Xc()),Uso=de(NP());var $Rt=class extends Hd{constructor(){super(...arguments);this.requestType=new Fso.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=ju.Compile($An)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Uso.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 qA(this.typeCheck.Errors(s));return s}};p();var Qso=de(Xc()),qso=de(NP());var VRt=class extends U_{constructor(){super(...arguments);this.requestType=new Qso.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=ju.Compile(GAn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new qso.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 qA(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 bK(o.value));return new Br(n,r.status??"success")}};p();p();function jso(t,e,r){try{let n=t.get(Zt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(jso,"fillInJavaActiveExperiments");var U7r=de(NP());var Vnl={type:new U7r.NotificationType("featureFlagsNotification")},Wnl={type:new U7r.NotificationType("copilot/didChangeFeatureFlags")},E6e=class{constructor(e){this.ctx=e;bs(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=!1,d=r.get(Zt),f=await d.updateExPValuesAndAssignments(e);n=d.ideDataMigrationCompleted(f),o=d.appmodContextMenuEnabled(f),s=d.appmodProblemsViewEnabled(f),c=d.cliAsDefaultAgentProviderEnabled(f),l=Odn(r,f),u=d.inlineChatUseCliEnabled(f);let h={};r.get(Zt).excludeRelatedFiles(f)&&(h.ExcludeRelatedFiles=!0);let m=Gfr(r,f);m.length>0&&(h.ExpContextProviders=m);let g=new Map;qXn(r,m,g,f),$lt(r,g,f),jso(r,g,f);for(let[E,_]of g.entries())h[E]=_;let A=r.get(bn),y=r.get(ar).connection;if(A.getCapabilities().didChangeFeatureFlags)await y.sendNotification(Wnl.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in: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:h,byok:rq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan,abexp_features:f.filtersAndExp.exp.features,abexp_assignment_context:f.filtersAndExp.exp.assignmentContext});else{let E={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:h,byok:rq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u};e.getTokenValue("agent_mode")==="0"&&(E.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(E.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(E.mcp=!1),e.envelope.chat_enabled&&(E.xc=!0),e.userInfo.cliEnabled!==void 0&&(E.user_info__cli_enabled=e.userInfo.cliEnabled),await y.sendNotification(Vnl.type,E)}}};p();var WRt=class extends ps{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(ar).connection.sendNotification(nqt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ar).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ar).connection.sendNotification(iqt.type,r)}};p();var Hso=new fe("AgentEncodingConfigurationService"),zRt=class extends IO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ar)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Hso.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){Hso.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Gso=new IQ;p();var Wso=de(ei());var zso={"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"}},znl=new Wso.NotificationType("policy/didChange"),Ynl=Object.fromEntries(Object.entries(zso).map(([t,e])=>[t,{type:e.type}])),_6e=class extends Hl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(zso).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ar);o.onActivation(()=>{this.startWatching().catch(s=>{Nr.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(()=>de(Vso()));this.policyWatcher=r("IDEGitHubCopilot",Ynl,n=>{this.handlePolicyUpdate(n).catch(o=>{Nr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Nr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Nr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Nr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Nr.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),Nr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(bn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(bn).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(znl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Nr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Nr.debug(this.ctx,"Policy watcher stopped")}}};p();var YRt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(ar).connection.sendNotification(pVi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ar).connection.sendNotification(hVi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(ZN).unregisterProvider(e)}};p();var KRt=class extends wb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(dA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(dA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(dA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Yso=de(ei());var JRt="mcp.elicitation",ZRt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Yso.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Un(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 Un(Zn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;sr.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await ia(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(kO).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 At(e.ctx,JRt,Wt.createAndMarkAsIssued()),Rt(e.ctx,JRt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw sr.error(e.ctx,l,c),await md(e.ctx,{message:l,server:r}),ua(e.ctx,c,JRt),ai(e.ctx,JRt,c),new Un(Zn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var wk=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var v6e=class extends wk{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":sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),ia(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),q2(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":sr.error(this.ctx,`MCP server ${this.serverName} log:`,r),md(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),ia(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var C6e=class extends wk{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Prompts list changed, refreshing prompts..."),ia(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(fTt)}};p();var b6e=class extends wk{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Resource list changed, refreshing resources..."),ia(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(dTt)}};p();var S6e=class extends wk{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),ia(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(d$i)}};p();var XRt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},T6e=class extends XRt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){sr.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),ia(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){sr.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),md(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 I6e=class extends wk{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Tool list changed, refreshing tools..."),ia(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(uTt)}};p();var Kso="mcp.sampling",ekt=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 Un(Zn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,sr.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await ia(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(SW).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(Hd).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 Oc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await uxe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new Fn.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 Rt(e.ctx,Kso,{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 sr.error(e.ctx,u,l),await md(e.ctx,{message:u,server:o}),Rt(e.ctx,Kso,{success:"false",errorMessage:u}),new Un(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){sr.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 sr.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",sr.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?gO(e,u.provider,l):await e.get(el).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(xs).getMetadata()).filter(n=>n.capabilities.type&&!ale.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 Ga(e.get(ti)).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 lCe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function Jso(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Gct(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(Jso,"parseScopeChallenge");p();var q7r=/[^a-z0-9_-]/gi;var Knl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Zso(){let t={};for(let e of Knl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Zso,"getDefaultEnvironment");async function Xso(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;sr.warn(t,n),await q2(t,{message:n,server:r,tool:e.name}),e.description=""}if(q7r.lastIndex=0,q7r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await q2(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(q7r,"_")}else e._nameForModel=e.name;return e}a(Xso,"normalizeTool");var tkt=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*j7r(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(j7r,"paginateRequest");async function H7r(t){let e=[];for await(let r of t)e.push(...r);return e}a(H7r,"flattenAsyncIterable");var eao=de(require("events"));var G7r=6e4,TW=class{constructor(e,r,n){this.transport=null;this.emitter=new eao.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(bn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new ekt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new ZRt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new bH({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 sr.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw sr.error(this.ctx,"Connection failed:",r),await md(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(jV)}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 Xso(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof lCe){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(sr.info(this.ctx,l),await md(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(sr.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(sr.error(this.ctx,c),await md(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=j7r(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 H7r(this.getResourcesIterable(e));return ia(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=j7r(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 H7r(this.getResourceTemplatesIterable(e));return ia(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=PJ();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}},pH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),ia(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 sr.error(this.ctx,m),await md(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,h),await md(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=()=>{sr.info(this.ctx,`MCP server ${this.name} connection closed.`),ia(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),md(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(hX,e=>new v6e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(l8,e=>new I6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(c8,e=>new C6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(a8,e=>new b6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(jcr,e=>new S6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(elr,e=>(this.initRootsTracker(),new T6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(Q2e,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Un(Zn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw sr.error(this.ctx,o),new Un(Zn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new sc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(q2e,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw sr.error(this.ctx,n),new Un(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(uTt,()=>{this.refreshToolsCache()}),this.emitter.on(dTt,()=>{this.refreshResourcesCache()}),this.emitter.on(fTt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(G7r),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)))),sr.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(jV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(G7r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,sr.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(jV)}catch(r){sr.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(G7r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,sr.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(jV)},"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 ZQ({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 ZQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Rr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get($r);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 Jnl(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=Jso(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new lCe(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(Jnl,"createFetchAdapter");function rkt(t,e){let r=t.get(nr),n=Jnl(r);return{...e,fetch:n}}a(rkt,"createConfigWithFetch");var nkt=class extends TW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=rkt(this.ctx,r),{url:o,...s}=n;return new Che(new URL(o),s)}};p();var tao=require("child_process"),rao=require("util");var ikt=class extends TW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...Zso(),...r.env||{}},r.stderr="pipe",new whe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{q2(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,rao.promisify)(tao.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),ia(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),sr.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){sr.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),md(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var x6e=class extends TW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=rkt(this.ctx,r),{url:o,...s}=n;return new bhe(new URL(o),s)}};p();var okt=class extends JQ{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 Oc;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(Hd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var sao=de(Xc());p();var nao="mcp-servers-cache",iao="mcp-first-boot-completed",skt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(dA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(iao)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(iao,"true")}parseCache(){let e=this.stateDb.get(nao);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(nao,e)}};p();function oao(t){let e=t.get(Ir).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(oao,"isNightlyOrDevBuild");var akt=class t extends s_{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new zx;this.prefixGenerator=new tkt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new skt(r),this.registryService=r.get(MN),bs(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(sr.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(sr.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(bn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(sr.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new sao.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return sr.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(bn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=oao(this.ctx);return n||sr.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:(sr.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(bn).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),sr.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),sr.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),sr.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)}`);sr.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){sr.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}txe(r)&&(d._status=c),this.ctx.get(gs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(gs).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 At(this.ctx,"mcp.getPrompt",Wt.createAndMarkAsIssued()),Rt(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){sr.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await ia(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){sr.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await ia(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(jV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await ia(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await ia(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 ia(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){sr.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await ia(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),sr.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(ZN).unregisterProvider(o)}catch{sr.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;sr.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(wb).removeAccountPreference(r,c);try{let u=this.ctx.get(pm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),sr.info(this.ctx,`Successfully removed session for account ${l}`)):sr.warn(this.ctx,`No session found for account ${l}`)}catch(u){sr.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 sr.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),sr.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){sr.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(jV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await ia(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Xw||c instanceof MDe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof x6e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;sr.info(this.ctx,f),ia(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 sr.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 md(this.ctx,{message:d,server:r}),this.ctx.get(ts).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=>{sr.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){sr.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new nkt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new x6e(this.ctx,r.name,r.version||"1.0.0"):new ikt(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(ar).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){sr.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(gs).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 okt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(sr.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){sr.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(gs).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){sr.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){sr.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;sr.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(wb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new The(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw sr.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(pm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(pm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(pm).createDynamicAuthenticationProvider(o,s,c),!A)){sr.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(pm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(wb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(pm).getProvider(l),g=!!this.ctx.get(nC).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(ts).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){sr.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){sr.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(wb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){sr.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ts).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){sr.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){sr.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ts).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(wb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){sr.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ts).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 aao=de(Xc());var ckt=class t extends Q2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new aao.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ar).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var cao=de(Xc());var Znl=new cao.ProtocolRequestType("copilot/readMcpSamplingConfig"),lkt=class extends SW{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Znl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${ed(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 dkt=de(Xc());var Xnl=new dkt.ProtocolRequestType("copilot/showPanelMessageRequest"),eil=new dkt.ProtocolNotificationType("copilot/showPanelMessage"),ukt=class extends aCe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ar).connection.sendNotification(eil,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Xnl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${ed(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 uao=require("node:stream"),hoe=de(Yar());var tU=new fe("UndiciFetcher"),pkt=class extends nr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`,this.certificateConfigurator=new Q_e(r),this.proxySocketFactory=r.get(fk),this.settings=r.get(Bo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),tU.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Bo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),tU.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=nil(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};tU.debug(this.ctx,"Starting Undici fetch.",{target:fkt(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,hoe.fetch)(r,{...h,dispatcher:m});return tU.debug(this.ctx,"Undici fetch completed.",{target:fkt(r),status:A.status,isProxy:g}),new nx(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?uao.Readable.fromWeb(A.body):null)}catch(h){throw l?(tU.warn(this.ctx,"Undici fetch timed out.",{target:fkt(r),timeout:n.timeout}),new VW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):iil(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&&(tU.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||(tU.debug(this.ctx,"Creating direct Undici agent.",{target:fkt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new hoe.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,hoe.buildConnector)(r);return tU.debug(this.ctx,"Creating proxied Undici agent.",{proxy:lao(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new hoe.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)&&tU.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}=til(s),u=ril(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:lao(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 til(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(til,"splitHostPort");function ril(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(ril,"compileHostPattern");function fkt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(fkt,"describeUrl");function lao(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(lao,"describeProxy");function nil(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(nil,"toNativeAbortSignal");function iil(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(iil,"withCauseNetworkProperties");p();var w6e=new fe("fetcher"),oil="https://default.exp-tas.com/",R6e=class extends nr{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(Vm(o)||`${r}/`.startsWith(oil))throw o;w6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),w6e.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()}},hkt=class extends nr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new R6e(r,n,o,(s,c)=>{this.current!==o&&(w6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,ai(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:ail(c),...cil(s),...lil(r)}),n.disconnectAll().catch(l=>{w6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(w6e.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()])}},sil=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function ail(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return sil.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(ail,"describeHost");function cil(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(cil,"buildErrorCauseProperties");function lil(t){try{let e=t.get(Bo).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(lil,"describeHttpContext");var dao=new fe("fetcher");function uil(t){return Ft(t,Ye.UseHelixFetcher)==="true"}a(uil,"isHelixFetcherForced");function dil(t){if(uil(t))return new Fie(t);let e=new hkt(t,new pkt(t),new Fie(t));return t.get(Bo).onDidChangeHttpSettings(()=>e.reset()),e}a(dil,"createDefaultFetcher");var mkt=class extends nr{constructor(r,n=dil(r),o=new F_e(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=Ft(this.ctx,Ye.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&&(dao.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new R6e(r,n,o,()=>{dao.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(bn).onDidSetCapabilities(this.updateFetcher),r.get(Bo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ft(this.ctx,Ye.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(bn).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 Akt=de(ei());var gkt=class extends ts{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ar).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(Akt.ShowMessageRequest.type,{type:Akt.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 fao=de(Xc());var ykt=class t extends TK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new fao.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var pao=de(Xc());var Ekt=class t extends iq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new pao.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var hao=de(Xc());var fil=new hao.ProtocolNotificationType("$/copilot/rateLimitWarning"),_kt=class extends HS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ar).connection.sendNotification(fil,r)}};p();p();var vkt=class extends Dze{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(IN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(IN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(IN);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 Ckt=class extends Kx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new vkt(this.ctx,e)}shouldStartWatching(e){return wP(this.ctx)?!1:!!this.ctx.get(bn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function bkt(t){let e=new rb(process.env),r=joo(e);r.set(rb,e),r.set(nr,new mkt(r)),r.set(sc,new sc(r)),f3r(r,{});let n=_tn();r.set(ti,n),r.set(dA,new dA(r));let o=new NRt;r.set(Ph,o);let s=gao.join(n.directory,_Qr),c=C3.plaintextOnly();r.set(C3,c);let{repo:l,diagnostics:u}=ifn(r,s,c);r.set(sx,l),r.set(Lr,new _je(r,process.env)),r.set($T,new $T(r)),r.set(Die,new Die(r));let d=new mf(r,"agent");d.onInitialized(()=>sfn(r,u)),r.set(mf,d),r.set(Qa,OYi),r.set(qI,new qI),r.set(Ir,new aj),r.set(Uie,SYi()),r.set(Ru,new Ru),r.set(qo,Gso),r.set(da,new xRt(r)),r.set(fee,new RRt(r)),r.set(Kx,new Ckt(r)),r.set(IN,new IN(r)),r.set(mm,new mm),r.set(gm,zlt(r,j$i)),r.set(Nb,new Nb(r)),r.set(n4,new ome),Cso(r),Nze(r),afn(r),r.set(ar,new ar(r,t)),r.set(kO,new wRt(r)),r.set(ts,new gkt(r)),ofn(r,u),r.set(aCe,new ukt(r)),r.set(SW,new lkt(r)),r.set(zm,new R_e(r)),r.set(ps,new WRt(r));let f=new _6e(r,t);r.set(_6e,f),r.set(Hl,f),r.set(E6e,new E6e(r)),r.set(A6e,new A6e(r)),r.set(np,new np);let h=new JV(r);r.set($r,h),r.set(JV,h),r.set(Wm,new H_e(r,process.env)),r.set(Dk,new Soe),r.set(ic,new ic(r)),Bso(r),Eso(r),r.set(PN,new PN),r.set(GV,new GV),r.set(NN,new NN),r.set($V,new $V([])),r.set(GT,new MRt),r.set(mao.ObservableWorkspace,new xV(r,!0,!0)),r.set(g4,new $_e),r.set(g9,new g9),r.set(zv,new zv(r)),r.set(ny,new v1t(r)),r.set(U_,new VRt(r)),r.set(Hd,new $Rt(r)),r.set(Aw,new Aw(r)),r.set(gs,new gs(r)),r.set(yF,new yF(r)),r.set(_F,new _F(r)),r.set(nT,new nT(r)),r.set(_J,new _J(r)),r.set(t5,new t5),r.set(A0,new A0),r.set(MN,new MN(r)),r.set(s_,new akt(r)),r.set(Q2,new ckt(r)),r.set(pF,new pF(r)),r.set(wb,new KRt(r));let m=new wH(r);r.set(wH,m);let g=new ty(r,m,new YRt(r));r.set(ty,g),r.set(NT,new NT(m,g)),r.set(oie,ZQi(r)),r.set(HS,new _kt(r)),r.set(GX,new GX),r.set(kie,new kie),r.set(pm,new DRt(r)),r.set(nC,new kRt(r)),r.set(ZN,new ZN(r));let A=new RA(r);r.set(RA,A),r.set(Tf,new Tf(r,A)),r.set(bg,new bg(r,A)),r.set(Fd,new Fd(r,A)),r.set(g0,new g0(r,e,A));let y=new k3(r,A,n);r.set(k3,y),r.get(qS).addListener(y.lifecycleListener);let E=new m6e;r.set(m6e,E),r.set(l0,new pIt(r)),r.set(dg,new dg(r,E)),r.set(Ew,new Ew),r.set(oT,new oT(r)),r.set(tj,new tj(r)),r.set(ow,new DO([new NO,new MO])),r.set(Rie,new Rie(r)),r.set(H_,new H_(r)),r.set(iq,new Ekt(r)),r.set(TK,new ykt(r)),r.set(mv,new mv(r)),r.set(Hs,new Hs(r)),r.set(hm,new hm),r.set(zX,new zX(r)),r.set(_8,new _8(r,new nRt)),r.set(lie,new lie(r)),r.set(cie,new cie(r)),r.set(fc,new fc(r)),r.set(IO,new zRt(r)),r.set(kN,new kN(r)),r.set(ck,new ck(r.get(kN),r)),r.set($O,new $O(r)),r.set(TI,new ORt(r)),r.set(ZC,new ZC(r.get(ck),r.get(TI),r)),r.set(gE,new gE(r));let _=new uc(r);r.set(uc,_);let v=new y8(r,_);return r.set(y8,v),r.set(Qie,new Qie(r,_)),r.get(ar).onActivation(()=>{v.ensureInitialSync()}),r}a(bkt,"createLanguageServerContext");var XN=new fe("ACP");async function Aao(t){let e=t.get(ds);XN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(rb).markReady(),t.get(Kp).githubAppId=Jae,mil(t),hil(t),t.get(bn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?XN.info(t,"Token primed successfully"):XN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(mf).initialize(!0),k0n()?await pil(t):(Lu(t,"acp.server.start",{acpPipeline:"internal"}),await yao(t))}a(Aao,"startACPServer");async function yao(t){XN.info(t,"Starting ACP server with internal pipeline");let e=uCe.Writable.toWeb(process.stdout),r=uCe.Readable.toWeb(process.stdin),n=WRe(e,r),o=new zRe(s=>new _It(s,t),n);o.signal.addEventListener("abort",()=>{XN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(yao,"startACPServerInternal");async function pil(t){XN.info(t,"Starting ACP server with CLI proxy"),Lu(t,"acp.cli.discover");let e;try{e=await P0n()}catch(u){let d=u instanceof Error?u.message:String(u);XN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),Y_e(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await yao(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;XN.info(t,`Found Copilot CLI: ${r} v${e.version}`),Lu(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new vIt(e,t),o=uCe.Writable.toWeb(process.stdout),s=uCe.Readable.toWeb(process.stdin),c=WRe(o,s),l=new zRe(u=>new bIt(u,t,n),c);l.signal.addEventListener("abort",()=>{XN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(pil,"startACPServerWithCLI");function hil(t){let e=t.get(gs);e.registerTool(new rj({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 rj({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 rj({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."})})})),XN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(hil,"registerACPClientTools");function Eao(){let e=bkt({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 ZV(e);return e.forceSet(U_,r),{ctx:e,acpToolInvoker:r}}a(Eao,"createACPContext");function mil(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(XN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),h7e(t,r))}a(mil,"configureGitHubEnterpriseUrl");p();var $7r=require("events"),k6e=de(require("fs"));y$e();var Tkt=de(Xc());p();var vao=de(require("fs")),Cao=de(require("http")),dCe=de(require("path"));var Skt=class{constructor(e,r){this.port=e;let n;this.server=Cao.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=>{_ao(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{_ao(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;dCe.basename(__dirname)!=="debug"&&(c=dCe.dirname(__dirname)),n??=vao.readFileSync(dCe.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 _ao(t,e){t.write("data: "+e.toString().replace(/\n/g,` data: `)+` -`)}a(uao,"writeData");var q7r=class extends vkt.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()}},j7r=class extends vkt.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 pao(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new Q7r.EventEmitter;let l=new _kt(o,n).listen();o===0&&await PTe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=T6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=T6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&T6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new Q7r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}a(_ao,"writeData");var V7r=class extends Tkt.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()}},W7r=class extends Tkt.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 bao(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new $7r.EventEmitter;let l=new Skt(o,n).listen();o===0&&await MTe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=k6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=k6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&k6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new $7r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new j7r(e,n),r=new q7r(r,n)),[e,r]}a(pao,"wrapTransports");p();var Ckt=de(require("fs/promises")),hao=de(require("os")),mao=de(require("path"));var Znl={tmpdir:a(()=>hao.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function gao(t=Znl){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Ckt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Ckt.mkdtemp(mao.join(e,"github-copilot-"))}}a(gao,"mitigateTempFolder");function Bil(){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(Bil,"shouldEnableSourceMapSupport");Bil()&&Jao();async function Xao(){let t=_0n(process.argv.slice(2)).version(new ds().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}=lao();await j8t(u),await aao(u);return}let r,n;e["node-ipc"]?(r=new wk.IPCMessageReader(process),n=new wk.IPCMessageWriter(process)):e.stdio?(r=new wk.StreamMessageReader(process.stdin),n=new wk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await gao();let o=(0,wk.createConnection)(wk.ProposedFeatures.all,...await pao(process.env,r,n)),s=Ekt(o);console=ihn(s),await j8t(s);let c=s.get(ar),l=new GY(s);s.set(GY,l),c.onActivation(()=>{l.start(),nfn()}),Fil(c,r),c.listen()}a(Xao,"main");function Fil(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(Fil,"setupExitHandlers");Zao.isMainThread?require.main===module&&Xao():(Tfn()&&Ifn(),B6t()&&nhn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}return n&&(e=new W7r(e,n),r=new V7r(r,n)),[e,r]}a(bao,"wrapTransports");p();var Ikt=de(require("fs/promises")),Sao=de(require("os")),Tao=de(require("path"));var gil={tmpdir:a(()=>Sao.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function Iao(t=gil){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Ikt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Ikt.mkdtemp(Tao.join(e,"github-copilot-"))}}a(Iao,"mitigateTempFolder");function tol(){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(tol,"shouldEnableSourceMapSupport");tol()&&aco();async function lco(){let t=T0n(process.argv.slice(2)).version(new ds().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}=Eao();await V8t(u),await Aao(u);return}let r,n;e["node-ipc"]?(r=new kk.IPCMessageReader(process),n=new kk.IPCMessageWriter(process)):e.stdio?(r=new kk.StreamMessageReader(process.stdin),n=new kk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await Iao();let o=(0,kk.createConnection)(kk.ProposedFeatures.all,...await bao(process.env,r,n)),s=bkt(o);console=lhn(s),await V8t(s);let c=s.get(ar),l=new zY(s);s.set(zY,l),c.onActivation(()=>{l.start(),cfn()}),rol(c,r),c.listen()}a(lco,"main");function rol(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(rol,"setupExitHandlers");cco.isMainThread?require.main===module&&lco():(kfn()&&Pfn(),q6t()&&chn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: diff --git a/lua/copilot/util.lua b/lua/copilot/util.lua index 0a246189..d594d1e1 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.517.0", + version = "1.520.0", }, } return info